/* ============================================================
   notifications-ui.css — la cloche du professeur (04/10/2026)
   Chargé APRÈS styles.css : `#notif-dropdown.nc-panel` reprend la main sur
   l'ancien `.notif-dropdown` (360 px, 480 px de haut) sans le modifier.
   Couleurs : encres ≥ 4,5:1 sur leur fond (vérifiées une à une).
   ============================================================ */

#notif-dropdown.nc-panel {
  width: 430px;
  max-height: min(680px, calc(100vh - 90px));
  padding: 0;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .18), 0 2px 6px rgba(15, 23, 42, .06);
  background: #fff;
  color: #1f2937;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-top: 8px;
  text-align: left;
  /* Le panneau est logé dans l'en-tête, où styles.css impose « .header > div:last-child
     { white-space: nowrap } » : hérité, il empêchait titres et messages de revenir à la
     ligne (texte coupé sous les boutons, liste qui défile de côté — 20/10/2026). */
  white-space: normal;
}

.nc-chargement { padding: 28px; text-align: center; color: #6b7280; }

/* --- tête --- */
.nc-tete { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px; flex-shrink: 0; }
.nc-tete h4 { margin: 0; font-size: 17px; font-weight: 700; color: #111827; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-lien { white-space: nowrap; font-size: 13px; font-weight: 600; color: #1d4ed8; background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.nc-lien:hover { background: #eff6ff; }
.nc-ibtn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid #e5e7eb; background: #fff; display: grid; place-items: center; font-size: 15px; cursor: pointer; color: #4b5563; flex-shrink: 0; }
.nc-ibtn:hover { background: #f9fafb; }
.nc-fermer { display: none; }

/* --- résumé du jour --- */
.nc-resume { margin: 0 16px 10px; padding: 9px 12px; border-radius: 12px; background: linear-gradient(135deg, #f0fdfa, #ecfeff); border: 1px solid #ccfbf1; font-size: 13px; color: #374151; display: flex; gap: 14px; flex-wrap: wrap; flex-shrink: 0; }
.nc-resume b { font-size: 16px; color: #0f766e; margin-right: 3px; }
.nc-resume .nc-resume-alerte b { color: #b91c1c; }

/* --- filtres --- */
.nc-chips { display: flex; gap: 6px; padding: 0 16px 10px; flex-wrap: wrap; flex-shrink: 0; }
.nc-chip { font-size: 13px; padding: 4px 11px; border-radius: 999px; border: 1px solid #e5e7eb; color: #374151; background: #fff; cursor: pointer; white-space: nowrap; }
.nc-chip:hover { background: #f9fafb; }
.nc-chip--act, .nc-chip--act:hover { background: #1f2937; color: #fff; border-color: #1f2937; }
.nc-chip i { font-style: normal; opacity: .75; margin-left: 4px; }

/* --- liste --- */
.nc-liste { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; border-top: 1px solid #e5e7eb; overscroll-behavior: contain; }
.nc-jour { position: sticky; top: 0; z-index: 1; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #4b5563; padding: 8px 16px 6px; background: #f9fafb; border-bottom: 1px solid #f1f5f9; }
.nc-vide { padding: 36px 16px; text-align: center; color: #6b7280; font-size: 14px; }
.nc-vide-ico { font-size: 30px; margin-bottom: 6px; }

.nc-it { display: flex; gap: 11px; padding: 11px 16px; border-bottom: 1px solid #f1f5f9; position: relative; cursor: pointer; background: #fff; transition: background .12s; }
.nc-it:hover, .nc-it:focus-visible { background: #f8fafc; outline: none; }
.nc-it--nonlu { background: #eff6ff; }
.nc-it--nonlu:hover { background: #dbeafe; }
.nc-it--nonlu::before { content: ""; position: absolute; left: 5px; top: 24px; width: 6px; height: 6px; border-radius: 50%; background: #2563eb; }

.nc-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0; position: relative; background: var(--nc-av, #64748b); }
.nc-av--eleves { background: #e0f2fe; }
.nc-av--gestion { background: #fef3c7; }
.nc-av-ico { font-size: 18px; line-height: 1; display: grid; place-items: center; }
.nc-av--eleves .nc-av-ico { color: #0369a1; }
.nc-av--gestion .nc-av-ico { color: #b45309; }
.nc-av-ico .om-ic { width: 18px; height: 18px; }
.nc-av-type { position: absolute; right: -4px; bottom: -4px; width: 19px; height: 19px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 11px; box-shadow: 0 0 0 1px #e5e7eb; color: var(--brand-700, #0f766e); }
.nc-av--petit { width: 32px; height: 32px; }

.nc-c { flex: 1; min-width: 0; }
.nc-ti { font-size: 14px; font-weight: 600; line-height: 1.25; color: #111827; padding-right: 64px; overflow-wrap: anywhere; }
.nc-bo { font-size: 13px; color: #4b5563; margin-top: 2px; line-height: 1.35; overflow-wrap: anywhere; }
.nc-meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 12px; color: #6b7280; flex-wrap: wrap; }

.nc-tag { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: #f1f5f9; color: #475569; }
.nc-tag--eleves { background: #e0f2fe; color: #075985; }
.nc-tag--gestion { background: #fef3c7; color: #92400e; }
.nc-tag--pass { background: #f3e8ff; color: #6b21a8; }

.nc-score { flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.nc-score--r { background: #fee2e2; color: #b91c1c; }
.nc-score--o { background: #ffedd5; color: #9a3412; }
.nc-score--v { background: #dcfce7; color: #166534; }

.nc-grp { list-style: none; margin: 7px 0 0; padding: 0 0 0 9px; border-left: 2px solid #e9d5ff; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; font-size: 12.5px; color: #4b5563; }
.nc-grp li { min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.nc-grp-lib { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* actions : au survol sur ordinateur, toujours visibles au toucher */
.nc-acts { position: absolute; top: 9px; right: 12px; display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.nc-it:hover .nc-acts, .nc-it:focus-within .nc-acts { opacity: 1; }
.nc-mini { width: 28px; height: 28px; border-radius: 8px; border: 1px solid #e5e7eb; background: #fff; display: grid; place-items: center; font-size: 13px; color: #4b5563; cursor: pointer; }
.nc-mini:hover { background: #f3f4f6; color: #111827; }
/* au toucher, pas de survol : les boutons prennent leur colonne à droite */
@media (hover: none) {
  .nc-acts { position: static; opacity: 1; flex-direction: column; align-self: center; }
  .nc-ti, .nc-it .nc-ti { padding-right: 0; }
}

/* --- pied --- */
.nc-pied { padding: 10px 16px; border-top: 1px solid #e5e7eb; background: #fafafa; flex-shrink: 0; }
.nc-btn { width: 100%; background: #1f2937; color: #fff; border: 0; border-radius: 10px; padding: 9px; font-weight: 600; font-size: 14px; cursor: pointer; }
.nc-btn:hover { background: #111827; }

/* --- téléphone : plein écran --- */
@media (max-width: 640px) {
  #notif-dropdown.nc-panel {
    position: fixed; inset: 0; width: auto; max-height: none; height: 100%; height: 100dvh;
    margin: 0; border-radius: 0; border: 0; z-index: 10000;
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
  }
  .nc-fermer { display: grid; }
  .nc-long { display: none; }
  .nc-tete { padding: 14px 16px 12px; border-bottom: 1px solid #e5e7eb; }
  .nc-tete h4 { font-size: 19px; }
  .nc-resume { margin-top: 12px; }
  .nc-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .nc-it { padding: 13px 16px; }
  html.nc-ouvert, html.nc-ouvert body { overflow: hidden; }
}

/* --- alertes en temps réel --- */
#nc-alertes { position: fixed; left: 20px; bottom: 20px; z-index: 10001; display: flex; flex-direction: column; gap: 8px; width: 350px; max-width: calc(100vw - 32px); pointer-events: none; }
.nc-alerte { pointer-events: auto; background: #fff; border-radius: 14px; border: 1px solid #e5e7eb; box-shadow: 0 10px 30px rgba(15, 23, 42, .16); padding: 11px 12px; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; animation: nc-entree .25s ease-out; }
.nc-alerte .nc-ti { padding-right: 0; font-size: 13.5px; }
.nc-alerte--sort { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
.nc-alerte-x { background: none; border: 0; color: #6b7280; cursor: pointer; font-size: 14px; padding: 2px 4px; border-radius: 6px; }
.nc-alerte-x:hover { background: #f3f4f6; color: #111827; }
.nc-alerte-barre { height: 3px; border-radius: 3px; background: #e5e7eb; margin-top: 7px; overflow: hidden; }
.nc-alerte-barre i { display: block; height: 100%; background: #0d9488; transform-origin: left; transform: scaleX(1); }
@keyframes nc-entree { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  #nc-alertes { left: 12px; right: 12px; width: auto; bottom: calc(12px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .nc-alerte { animation: none; }
  .nc-alerte-barre i { transition: none !important; }
}

/* --- réglages (⚙︎) --- */
.nc-reg { padding: 4px 16px 16px; }
.nc-reg h5 { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #4b5563; margin: 16px 0 4px; }
.nc-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.nc-row b { font-size: 14px; color: #111827; font-weight: 600; }
.nc-row small { display: block; font-size: 12.5px; color: #6b7280; margin-top: 2px; line-height: 1.35; }
.nc-row small.nc-avert { color: #92400e; }
.nc-sw { width: 44px; height: 26px; min-width: 44px; min-height: 26px; padding: 0; border-radius: 999px; border: 0; background: #d1d5db; position: relative; flex-shrink: 0; cursor: pointer; transition: background .15s; }
.nc-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: left .15s; }
.nc-sw--on { background: #0d9488; }
.nc-sw--on::after { left: 21px; }
.nc-sw:disabled { opacity: .5; cursor: progress; }
.nc-heure { font: inherit; font-size: 12.5px; padding: 0 4px; border: 1px solid #d1d5db; border-radius: 6px; color: #111827; background: #fff; }
.nc-tab { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 2px; }
.nc-tab th { font-size: 11px; font-weight: 600; color: #6b7280; padding: 6px 2px; text-align: center; }
.nc-tab th:first-child, .nc-tab td:first-child { text-align: left; }
.nc-tab td { padding: 7px 2px; border-bottom: 1px solid #f1f5f9; text-align: center; color: #1f2937; }
.nc-ck { width: 20px; height: 20px; min-width: 20px; min-height: 20px; padding: 0; border-radius: 6px; border: 1.5px solid #9ca3af; background: #fff; cursor: pointer; position: relative; vertical-align: middle; }
.nc-ck--on { background: #0d9488; border-color: #0d9488; }
.nc-ck--on::after { content: "✓"; color: #fff; font-size: 13px; font-weight: 700; position: absolute; inset: 0; display: grid; place-items: center; }
.nc-btn--test { margin-top: 16px; background: #0d9488; }
.nc-btn--test:hover { background: #0f766e; }
@media (max-width: 640px) {
  .nc-ck { width: 26px; height: 26px; }
}

/* styles.css impose aux boutons, sous 768 px, « min-height: 44px ; padding: 12px 16px ;
   font-size: lg » en !important : il gonflait interrupteurs, cases et filtres. On garde
   des cibles tactiles confortables, mais à la bonne forme. */
@media (max-width: 768px) {
  #notif-dropdown .nc-sw { min-height: 28px !important; height: 28px; width: 48px; min-width: 48px; padding: 0 !important; }
  #notif-dropdown .nc-sw::after { width: 22px; height: 22px; }
  #notif-dropdown .nc-sw--on::after { left: 23px; }
  #notif-dropdown .nc-ck { min-height: 28px !important; height: 28px; width: 28px; min-width: 28px; padding: 0 !important; font-size: 13px !important; }
  #notif-dropdown .nc-chip { min-height: 36px !important; padding: 6px 14px !important; font-size: 14px !important; }
  #notif-dropdown .nc-ibtn, #notif-dropdown .nc-mini { padding: 0 !important; font-size: 16px !important; }
  #notif-dropdown .nc-lien { padding: 6px 8px !important; font-size: 14px !important; }
  #notif-dropdown .nc-btn { padding: 12px !important; font-size: 15px !important; }
  #notif-dropdown .nc-heure { min-height: 32px !important; padding: 2px 6px !important; font-size: 14px !important; }
}

.nc-diag { font-size: 11px; color: #6b7280; padding: 4px 0 8px; font-family: ui-monospace, Menlo, monospace; }
