/* ==========================================================================
   SMARTSALLE ISPITS — design system
   Clean / professionnel / institutionnel / responsive (mobile, tablette, PC)
   ========================================================================== */
:root {
  /* ===== Palette premium — harmonisée avec le logo Smart Salle =====
     Bleu principal #0B4F9C · bleu foncé #12366B · orange #F58220 ·
     blanc #FFFFFF · gris clair #F4F7FB · texte principal #253247.
     Les fonds bleu clair (#EAF2FC / #f4f8fe) sont conservés : déjà cohérents
     avec le gris clair de référence. */
  --brand: #0B4F9C;
  --brand-2: #1A6FC4;
  --brand-3: #2E86E0;
  --brand-deep: #12366B;
  --brand-soft: #EAF2FC;
  --accent: #F58220;
  --bg: #EAF2FC;
  --surface: #ffffff;
  --surface-2: #f4f8fe;
  --text: #253247;
  --muted: #5b6b84;
  --line: #e4e9f2;
  --line-strong: #ccd5e4;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #b45309;
  --warn-soft: #fdf1e0;
  --danger: #b91c1c;
  --danger-soft: #fdeaea;
  --info: #1d4ed8;
  --info-soft: #e6edff;
  --purple: #6d28d9;
  --purple-soft: #efe9fd;
  /* Géométrie : coins arrondis, échelle cohérente */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  /* Ombres diffuses et profondeur discrète (effet cartes flottantes) */
  --shadow: 0 1px 2px rgba(36, 87, 167, .05), 0 10px 26px -8px rgba(36, 87, 167, .14);
  --shadow-lg: 0 24px 56px -14px rgba(36, 87, 167, .30);
  /* Cartes légèrement surélevées (statistiques, options, salles) */
  --shadow-float: 0 2px 4px rgba(36, 87, 167, .06), 0 16px 34px -10px rgba(36, 87, 167, .20);
  /* Bordure très fine des cartes sur le fond bleu clair */
  --card-line: rgba(36, 87, 167, .12);
  /* Anneau de focus commun (champs, filtres) */
  --ring: rgba(36, 87, 167, .16);
  --sidebar-w: 272px;
  --topbar-h: 64px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: rgba(36, 87, 167, .12);
}
::selection { background: rgba(36, 87, 167, .18); }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; }

/* ---------- Icônes SVG (système premium — js/icons.js) ----------
   Grille 24×24, tracé de 1.7, bouts arrondis, couleur héritée (currentColor) :
   mêmes dimensions et même alignement dans tout le menu, les boutons, les
   cartes, les listes et les tableaux. Les libellés restent toujours visibles
   à côté — l'icône est décorative (aria-hidden). */
.ico { display: inline-block; flex: none; vertical-align: -0.18em; color: inherit; }
.btn .ico { width: 16px; height: 16px; vertical-align: -3px; }
.btn.sm .ico { width: 14px; height: 14px; }
.icon-btn .ico { width: 19px; height: 19px; }
.empty .big .ico { width: 30px; height: 30px; opacity: .5; }
.item .i-ico .ico, .quick .qi .ico { width: 17px; height: 17px; }
.searchbox .ico { width: 16px; height: 16px; color: var(--muted); }
.nav-group-head .ico { width: 12px; height: 12px; }
/* Icône porteur d'un titre de rubrique : bleu professionnel */
.card-head h3 .ico { color: var(--brand); }
/* Statuts : couleurs réservées aux informations réellement importantes */
.ico-ok { color: var(--ok); }
.ico-danger { color: var(--danger); }
.ico-warn { color: var(--warn); }
/* Pastille « en cours » de la page Trouver une salle (remplace l'emoji rouge) */
.dot-live { color: var(--danger); }
/* Cohérence des volumes : somme des éléments constitutifs ≠ volume du module.
   Simple avertissement (jamais de correction automatique des heures saisies). */
.hours-mismatch {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px;
  background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
  font-size: 13.5px; font-weight: 600; margin: 10px 0 4px;
}
.hours-mismatch .ico { color: #ea580c; }
/* Conforme : somme des éléments = volume horaire total (indicateur en direct
   du formulaire « Ajouter un module ») */
.hours-ok {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px;
  background: var(--ok-soft); border: 1px solid #c3e6d0; color: var(--ok);
  font-size: 13.5px; font-weight: 600; margin: 10px 0 4px;
}
.hours-ok .ico { color: var(--ok); }
/* Pastille de type d'activité (cours / stage / contrôle continu) : même code
   couleur qu'au planning, sous forme vectorielle (plus d'emoji). */
.act-dot { vertical-align: -1px; margin-right: 2px; background: var(--brand-soft); }
.act-dot.dot-cours { color: #2563eb; background: #dbeafe; }
.act-dot.dot-stage { color: #16a34a; background: #dcfce7; }
.act-dot.dot-controle { color: #ea580c; background: #ffedd5; }
/* Icône de chargement */
.spin { animation: spin 1.1s linear infinite; }

/* ---------- Boot ---------- */
.boot-screen {
  height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--brand);
}
.boot-logo { font-size: 44px; animation: pulse 1.4s ease-in-out infinite; }
.boot-title { font-weight: 800; letter-spacing: 2px; }
.boot-sub { color: var(--muted); font-size: 13px; }
@keyframes pulse { 0%, 100% { opacity: .45; transform: scale(.96) } 50% { opacity: 1; transform: scale(1.04) } }

/* ---------- Layout ---------- */
.app-shell { min-height: 100vh; }
/* ---------- Sidebar Glassmorphism — rail compact + drawer mobile ----------
   Desktop : rail d’icônes compact, extension au survol. Les mêmes liens,
   permissions et groupes restent montés pour chaque rôle. */
.sidebar {
  --sb-ink: #F4F8FD; --sb-mute: #D4E0EF; --sb-soft: #AFC8E2;
  --sb-line: rgba(255, 255, 255, .24);
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); height: 100vh;
  display: flex; flex-direction: column; z-index: 40; overflow: hidden;
  color: var(--sb-ink); border: 1px solid rgba(255, 255, 255, .22); border-left: 0;
  border-radius: 0 20px 20px 0;
  background: linear-gradient(135deg, rgba(18, 54, 107, .84) 0%, rgba(11, 79, 156, .78) 58%, rgba(26, 111, 196, .72) 112%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  backdrop-filter: blur(20px) saturate(130%);
  box-shadow: 0 10px 26px -12px rgba(11, 79, 156, .50), inset 0 1px 0 rgba(255, 255, 255, .18), inset 1px 0 0 rgba(255, 255, 255, .10);
  transition: width .30s cubic-bezier(.2, .75, .25, 1), transform .30s cubic-bezier(.2, .75, .25, 1), box-shadow .30s ease;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sidebar { background: linear-gradient(135deg, rgba(18, 54, 107, .98), rgba(11, 79, 156, .96)); }
}
/* En-tête : logo officiel + raison sociale + bouton de réduction. */
.sidebar-brand {
  display: flex; align-items: center; gap: 11px; flex: none;
  padding: 14px 12px; border-bottom: 1px solid var(--sb-line);
}
.sidebar-brand .mark {
  width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.96); flex: none;
  display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 2px 8px rgba(8, 20, 38, .18), 0 0 0 1px rgba(255,255,255,.25);
}
.sidebar-brand .mark img { width: 100%; height: 100%; object-fit: contain; }
.sb-id { min-width: 0; }
.brand-name { font-size: 14.5px; font-weight: 800; letter-spacing: .4px; color: #F8FBFF; line-height: 1.15; white-space: nowrap; }
/* « SALLE » légèrement mis en valeur (orange du logo). */
.brand-name b { color: var(--accent); font-weight: 800; }
.brand-sub { font-size: 9.8px; letter-spacing: 1.2px; color: var(--sb-mute); margin-top: 2px; white-space: nowrap; }
.nav-section { padding: 14px 12px 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--sb-soft); }

/* ---------- Recherche de menu (rubriques déjà autorisées uniquement) ---------- */
.sb-search {
  display: flex; align-items: center; gap: 8px; flex: none; height: 34px;
  margin: 10px 12px 2px; padding: 0 10px; border-radius: 10px;
  background: rgba(217, 237, 255, .22); border: 1px solid var(--sb-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}
.sb-search .ico { color: var(--sb-soft); }
.sb-search-input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: #F4F8FD; font-size: 12.5px; }
.sb-search-input::placeholder { color: #B7CBE0; }
.sb-search-input::-webkit-search-cancel-button { display: none; }
.sb-search-clear {
  border: 0; background: transparent; color: var(--sb-mute); cursor: pointer;
  padding: 2px; display: grid; place-items: center; border-radius: 6px;
}
.sb-search-clear:hover { color: #173B5E; background: rgba(255, 255, 255, .58); }

/* ---------- Zone défilante : le menu défile seul, l'en-tête et le profil
   restent fixes. Barre de défilement discrète mais utilisable. ---------- */
.sb-nav {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  padding: 8px 10px 16px; scrollbar-width: thin;
  scrollbar-color: rgba(222, 237, 250, .30) transparent;
}
.sb-nav::-webkit-scrollbar { width: 5px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(222, 237, 250, .26); border-radius: 3px; }
.sb-nav::-webkit-scrollbar-track { background: transparent; }

.nav-link {
  position: relative; display: flex; align-items: center; gap: 11px;
  margin: 2px 0; padding: 9px 10px; min-height: 42px; border-radius: 12px;
  color: #E3F0FC; font-size: 13.5px; font-weight: 500; cursor: pointer;
  /* Le padding glisse pendant le resserrement : les icônes ne "sautent" pas. */
  transition: background .16s ease, color .16s ease, padding .25s cubic-bezier(.4, 0, .2, 1), box-shadow .18s ease, transform .18s ease;
}
.nav-link:hover { background: rgba(255, 255, 255, .13); color: #fff; text-decoration: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13), 0 4px 12px rgba(8, 38, 87, .16); transform: translateX(2px); }
.nav-link:focus-visible { outline: 2px solid rgba(211, 231, 250, .9); outline-offset: 2px; }
/* Page active : glass bleu du Dashboard, reflet intérieur et repère cyan discret. */
.nav-link.active {
  background: linear-gradient(135deg, rgba(26, 111, 196, .62), rgba(11, 79, 156, .48));
  color: #fff; font-weight: 700;
  border: 1px solid rgba(255, 255, 255, .30);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), 0 6px 16px -8px rgba(11, 79, 156, .62);
}
.nav-link.active::before {
  content: ""; position: absolute; left: -6px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #BDEBFF, #61CEFF); box-shadow: 0 1px 7px rgba(97, 206, 255, .32);
}
/* L'icône est un <svg> de la bibliothèque partagée (classe « ico » portée par
   le svg lui-même) : taille fixe, centrée, jamais d'emoji de navigation. */
.nav-link .ico { width: 19px; height: 19px; flex: none; opacity: .92; display: block; }
.nav-link.active .ico { opacity: 1; }
.nav-link .ico svg { width: 19px; height: 19px; display: block; }
/* Libellé : largeur animée + fondu. En mode compact il est invisible mais
   TOUJOURS présent dans le DOM (jamais supprimé, lisible par lecteur d'écran). */
.nav-link .nl {
  min-width: 0; max-width: 190px; overflow: hidden; white-space: nowrap;
  transition: max-width .25s cubic-bezier(.4, 0, .2, 1), opacity .18s ease;
}
.nav-link .pill {
  margin-left: auto; color: #fff; font-size: 10.5px; font-weight: 800;
  border-radius: 999px; padding: 1px 7px;
  background: linear-gradient(160deg, #FFA043, var(--accent));
}
.nav-link .pill.danger { background: linear-gradient(160deg, #ff7474, #dc2626); box-shadow: 0 2px 7px rgba(220, 38, 38, .35); }
.nav-link.nav-attention { background: linear-gradient(135deg, rgba(220, 38, 38, .28), rgba(251, 146, 60, .16)); border: 1px solid rgba(255, 135, 115, .48); animation: nav-attention-pulse 2s ease-in-out infinite; }
.nav-link.nav-attention.active { background: linear-gradient(135deg, rgba(220, 38, 38, .42), rgba(251, 146, 60, .25)); }
@keyframes nav-attention-pulse { 50% { box-shadow: 0 0 0 3px rgba(239, 68, 68, .11), 0 5px 15px rgba(220, 38, 38, .16); } }
/* Aucun résultat de recherche (liste vide, jamais un menu interdit). */
.sb-empty { display: flex; align-items: center; gap: 8px; padding: 14px 10px; color: var(--sb-mute); font-size: 12.5px; }

/* ---------- Groupes de rubriques repliables (en-têtes de section) ----------
   L'en-tête est un vrai bouton : aria-expanded / aria-controls pour le lecteur
   d'écran, chevron qui pivote, focus clavier visible. La section contenant la
   page active reste toujours ouverte (impossible à replier). */
.nav-group { margin-top: 4px; }
.nav-group-head {
  width: 100%; display: flex; align-items: center; gap: 8px; text-align: left;
  background: transparent; border: 0; border-radius: 9px; cursor: pointer;
  margin: 10px 0 2px; padding: 6px 8px;
  font: inherit; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.3px;
  color: var(--sb-soft); transition: color .16s ease, background .16s ease;
}
.nav-group-head:hover { color: #fff; background: rgba(255, 255, 255, .10); }
.nav-group-head:focus-visible { outline: 2px solid rgba(154, 213, 249, .72); outline-offset: 2px; }
.nav-group-head .chev { margin-left: auto; font-size: 10px; line-height: 1; opacity: .8; transition: transform .18s ease; }
/* Titre de section : même fondu que les libellés (masqué en mode compact). */
.nav-group-head .gs {
  min-width: 0; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: max-width .25s cubic-bezier(.4, 0, .2, 1), opacity .18s ease;
}
.nav-group-head[aria-expanded="true"] .chev { transform: rotate(90deg); }
/* Corps du groupe : en grille seulement s'il est déplié (l'attribut `hidden`
   retire aussi les liens masqués de l'ordre de tabulation clavier). */
.nav-group-body:not([hidden]) { display: grid; }

/* ---------- Bouton de mode compact (icônes seules) ---------- */
.nav-compact-btn {
  margin-left: auto; flex: none; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .22);
  background: linear-gradient(145deg, rgba(255, 255, 255, .16), rgba(157, 205, 239, .10)); color: #F4F8FD;
  font-size: 14px; line-height: 1; cursor: pointer; display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .20), 0 3px 8px rgba(5, 20, 38, .12);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.nav-compact-btn:hover { transform: translateY(-1px); background: rgba(255, 255, 255, .24); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 5px 12px rgba(5, 20, 38, .18); }
.nav-compact-btn:focus-visible { outline: 2px solid rgba(154, 213, 249, .76); outline-offset: 2px; }
/* Fermeture du tiroir mobile (masquée sur grand écran). */
.sb-close {
  display: none; margin-left: auto; flex: none; width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .10);
  color: #F4F8FD; cursor: pointer; place-items: center;
}
.sb-close:hover { background: rgba(255, 255, 255, .20); }

/* ---------- Profil utilisateur (bas de la barre latérale) ---------- */
.sb-user {
  flex: none; display: flex; align-items: center; gap: 9px;
  padding: 11px 12px calc(11px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--sb-line); background: rgba(18, 54, 107, .30);
}
.su-main {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
  padding: 4px; border: 0; border-radius: 12px; background: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.su-main:hover { background: rgba(255, 255, 255, .07); }  .su-main:focus-visible { outline: 2px solid rgba(154, 213, 249, .76); outline-offset: 2px; }
.su-av {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 800; color: #fff;
  background: linear-gradient(145deg, #8BC9F1, #559BCB);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .40), 0 3px 9px rgba(5, 20, 38, .20);
}
.su-who { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.su-who b { font-size: 12.8px; font-weight: 700; color: #F4F8FD; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.su-who span { font-size: 10.5px; color: var(--sb-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.su-acts { display: flex; align-items: center; gap: 2px; flex: none; }
.su-btn {
  width: 30px; height: 30px; border-radius: 9px; border: 0; background: transparent;
  color: var(--sb-mute); display: grid; place-items: center; cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.su-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }  .su-btn:focus-visible { outline: 2px solid rgba(154, 213, 249, .76); outline-offset: 2px; }
.su-out:hover { background: rgba(239, 68, 68, .18); color: #FCA5A5; }

/* ---------- Infobulle flottante du mode compact ----------
   Rendu en position:fixed (sur body) pour n'être jamais rogné par le
   défilement interne du rail ; affichée au survol ET au focus clavier. */
.nav-tip {
  position: fixed; z-index: 300; transform: translateY(-50%);
  background: linear-gradient(145deg, rgba(40, 91, 151, .97), rgba(19, 54, 105, .96)); color: #F4F8FD; font-size: 12.5px; font-weight: 650;
  padding: 7px 11px; border-radius: 9px; white-space: nowrap; pointer-events: none;
  border: 1px solid rgba(190, 225, 249, .26);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 7px 18px rgba(5, 20, 38, .20), inset 0 1px 0 rgba(255, 255, 255, .16);
  animation: navTipIn .12s ease-out;
}
@keyframes navTipIn { from { opacity: 0; transform: translateY(-50%) translateX(-4px); } to { opacity: 1; transform: translateY(-50%); } }

/* Mouvement réduit : aucune animation de largeur ni d'infobulle. */
@media (prefers-reduced-motion: reduce) {
  .sidebar, .main, .nav-link, .nav-link .nl, .nav-group-head .chev,
  .nav-compact-btn { transition: none !important; }
  .nav-tip { animation: none; }
}

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column;
  /* Le contenu principal suit le rail sans à-coup (même courbe, même durée). */
  transition: margin-left .30s cubic-bezier(.2, .75, .25, 1);
}
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h); background: rgba(255,255,255,.90);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-line); display: flex; align-items: center;
  gap: 12px; padding: 0 22px; box-shadow: 0 1px 0 rgba(11, 79, 156, .06);
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: .2px; }
.topbar .spacer { flex: 1; }
/* La barre supérieure ne déborde jamais quand la barre latérale change de
   largeur : le titre et la recherche se resserrent avant de pousser les
   actions (quick-nav, cloche, compte) hors de l'écran. */
.topbar h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .searchbox { flex: 0 1 320px; min-width: 140px; }

/* ---------- Navigation rapide 3D de la barre supérieure -----------------
   Trois accès permanents : Dashboard (bleu #0B4F9C) · Planning (orange
   #F58220) · Trouver une salle (vert) — couleurs reprises du logo Smart Salle.
   Inactif : couleur de référence SOURDE + relief léger.
   Actif  : dégradé intense, texte blanc, lueur extérieure assortie. */
.quick-nav { display: flex; align-items: center; gap: 8px; margin-left: 6px; }
.qn-btn {
  --qn-fg: #0b4f9c; --qn-bg: #eaf2fc; --qn-line: #cfe0f6;
  --qn-a: #0b4f9c; --qn-b: #1a6fc4; --qn-glow: rgba(11, 79, 156, .42);
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 7px 13px; border-radius: 12px;
  font-size: 13.5px; font-weight: 700; letter-spacing: .1px; white-space: nowrap;
  color: var(--qn-fg); background: linear-gradient(180deg, #fff 0%, var(--qn-bg) 100%);
  border: 1px solid var(--qn-line); text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 2px 3px -1px rgba(36, 87, 167, .14),
    0 6px 12px -6px rgba(36, 87, 167, .22);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.qn-btn:hover { background: #fff; transform: translateY(-1px); text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 4px 7px -2px rgba(36, 87, 167, .18),
    0 12px 20px -10px rgba(36, 87, 167, .30); }
.qn-btn:active { transform: translateY(1px);
  box-shadow: inset 0 1px 3px rgba(36, 87, 167, .16), 0 1px 2px rgba(36, 87, 167, .12); }
.qn-btn:focus-visible { outline: 2.5px solid rgba(11, 79, 156, .55); outline-offset: 2px; }
/* État actif lumineux : couleur principale, lueur assortie, relief renforcé. */
.qn-btn.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--qn-a) 0%, var(--qn-b) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 4px 9px -3px var(--qn-glow),
    0 12px 24px -8px var(--qn-glow);
}
.qn-btn.active:hover { transform: translateY(-1px); }
.qn-btn.active:active { transform: translateY(1px); }
.qn-btn .ico { flex: none; }
/* Couleurs de référence de chaque bouton (actif ou non). */
.qn-dash { --qn-fg: #0b4f9c; --qn-bg: #eaf2fc; --qn-line: #cfe0f6;
  --qn-a: #0b4f9c; --qn-b: #1a6fc4; --qn-glow: rgba(11, 79, 156, .42); }
.qn-plan { --qn-fg: #b8590a; --qn-bg: #fdf1e3; --qn-line: #f6dcbd;
  --qn-a: #e9761a; --qn-b: #f58220; --qn-glow: rgba(245, 130, 32, .48); }
.qn-room { --qn-fg: #15803d; --qn-bg: #e7f6ec; --qn-line: #c9e9d4;
  --qn-a: #0f7a38; --qn-b: #22a45d; --qn-glow: rgba(21, 128, 61, .42); }
/* La couleur de fond du bouton actif reste lisible en dégradé sur blanc. */
.qn-plan.active { background: linear-gradient(135deg, var(--qn-a) 0%, var(--qn-b) 100%); }

@media (max-width: 1280px) {
  .quick-nav { gap: 6px; margin-left: 2px; }
  .qn-btn { padding: 7px 10px; font-size: 13px; }
}
/* Tablette / mobile : boutons compacts icône seule (libellé conservé dans
   l'infobulle title ET en libellé accessible aria-label). */
@media (max-width: 1080px) {
  .qn-txt { display: none; }
  .qn-btn { padding: 8px 9px; gap: 0; border-radius: 11px; }
}
@media (max-width: 760px) {
  .quick-nav { gap: 5px; }
  .qn-btn { padding: 7px 8px; border-radius: 10px; }
}
/* Respect des préférences système : aucune animation excessive. */
@media (prefers-reduced-motion: reduce) {
  .qn-btn { transition: none; }
  .qn-btn:hover, .qn-btn:active, .qn-btn.active:hover { transform: none; }
}

/* ---------- Mon compte — fenêtre premium (fidèle à la maquette ISPITS) -----
   Fond : photographie RÉELLE de la façade de l’établissement sous un voile de
   bleu nuit. En-tête bleu clair : icône dans un cercle bleu · titre +
   description · bouton X rond blanc. Palette officielle :
   #0756D9 (bleu principal) · #073B91 (bleu profond) · #08285F (bleu nuit). */
/* Spécificité +0,2 : doit primer sur `.modal-backdrop` déclaré plus bas. */
.modal-backdrop.acc-backdrop {
  background:
    linear-gradient(rgba(8, 40, 95, .74), rgba(7, 59, 145, .8)),
    url('/assets/ispits-laayoune-facade.jpg') center / cover no-repeat;
}
.acc-modal .modal-head {
  align-items: center; gap: 13px; padding: 14px 18px;
  background: linear-gradient(115deg, #d5e7ff 0%, #ecf4ff 48%, #ffffff 100%);
  border-bottom: 1px solid #dbe8fa;
}
.acc-modal .modal-head h3 { flex: 1; min-width: 0; margin: 0; font-size: inherit; font-weight: 400; }
.acc-hd { display: flex; align-items: center; gap: 13px; min-width: 0; }
.acc-hd-ico {
  flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, #2f7cf0 0%, var(--brand) 55%, var(--brand-deep) 100%);
  box-shadow: 0 8px 16px -8px rgba(7, 86, 217, .75), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.acc-hd-t { font-size: 17px; font-weight: 800; color: var(--brand-deep); }
.acc-hd-s { margin-top: 2px; font-size: 12.5px; color: #3f6db3; overflow-wrap: anywhere; }
.acc-modal .modal-head .x {
  flex: none; width: 34px; height: 34px; margin-left: auto; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: var(--brand-deep);
  border: 1px solid #d7e6fa; box-shadow: 0 4px 10px -5px rgba(11, 79, 156, .55);
  transition: transform .16s ease, box-shadow .16s ease;
}
.acc-modal .modal-head .x:hover { transform: translateY(-1px); box-shadow: 0 7px 14px -7px rgba(11, 79, 156, .7); }

/* Corps : une seule colonne (onglets puis contenu de l’onglet actif). */
.acc { display: grid; gap: 15px; min-width: 0; }
.acc-tab:focus-visible, .acc-modal .modal-head .x:focus-visible {
  outline: 2.5px solid rgba(7, 86, 217, .55); outline-offset: 2px;
}

/* Onglet Profil — carte d’identité : avatar bleu aux initiales, nom, statut
   RÉEL du compte, rôle et établissement. */
.acc-id { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; min-width: 0; }
.acc-avatar {
  flex: none; width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #2f7cf0 0%, var(--brand) 55%, var(--brand-deep) 100%);
  color: #fff; font-size: 22px; font-weight: 800; letter-spacing: .5px;
  border: 3px solid #e8f1ff;
  box-shadow: 0 8px 18px -8px rgba(7, 86, 217, .75), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.acc-id-main { min-width: 0; display: grid; gap: 5px; }
.acc-id-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acc-id-name { font-size: 17px; font-weight: 800; color: var(--text); overflow-wrap: anywhere; }
.acc-id-row {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  font-size: 13.5px; font-weight: 600; color: var(--text); overflow-wrap: anywhere;
}
.acc-id-row .ico { flex: none; color: var(--brand); }

/* Bandeau d’information : bleu clair + pastille « i » bleue. */
.acc-note {
  display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.55;
  color: #17417f; background: #e9f2ff; border: 1px solid #cfe2fb;
  border-radius: 13px; padding: 12px 14px;
}
.acc-note-ico {
  flex: none; width: 24px; height: 24px; border-radius: 50%; margin-top: 1px;
  display: grid; place-items: center; background: var(--brand); color: #fff;
}
.acc-sub { margin: 0; font-size: 15.5px; font-weight: 800; color: var(--brand-deep); }

/* ---- Installer Smart Salle (PWA universelle) : carte premium bleu/blanc,
   effet verre léger, bouton à animation discrète, guide d’étapes. ---- */
.pwa-card {
  border: 1px solid #d5e5fb; border-radius: 16px; padding: 16px;
  background: linear-gradient(135deg, rgba(233, 242, 255, .85), rgba(255, 255, 255, .95));
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 10px 26px -18px rgba(11, 79, 156, .55);
  display: grid; gap: 12px;
}
.pwa-row { display: flex; align-items: flex-start; gap: 12px; }
.pwa-ico {
  flex: none; width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #2f86f6, var(--brand-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 14px -8px rgba(7, 86, 217, .8);
}
.pwa-txt { display: grid; gap: 3px; font-size: 14px; }
.pwa-txt b { font-size: 15px; color: var(--brand-deep); }
.pwa-btn { justify-self: start; transition: transform .16s ease, box-shadow .16s ease; }
.pwa-btn:hover:not(:disabled) { transform: translateY(-1px); }
.pwa-btn:active:not(:disabled) { transform: translateY(0) scale(.985); }
.pwa-btn:disabled { opacity: .65; cursor: wait; }
.pwa-done { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 700; color: #14622e; }
.pwa-done-ico {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: #1c8a43; color: #fff;
}
.pwa-hd { display: flex; align-items: center; gap: 12px; }
.pwa-hd-ico {
  flex: none; width: 40px; height: 40px; border-radius: 13px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #2f86f6, var(--brand-deep));
}
.pwa-hd-t { font-size: 16px; font-weight: 800; color: var(--brand-deep); }
.pwa-hd-s { font-size: 13px; color: var(--muted, #5b6b82); }
.pwa-guide { display: grid; gap: 12px; }
.pwa-guide-logo { display: flex; justify-content: center; }
.pwa-guide-logo img { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 8px 20px -10px rgba(11, 79, 156, .6); }
.pwa-steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; font-size: 14px; line-height: 1.55; }
.pwa-steps li::marker { color: var(--brand); font-weight: 800; }
@media (max-width: 560px) { .pwa-card { padding: 14px; } .pwa-btn { width: 100%; justify-content: center; } }

/* Onglets : piste claire, pilule active en dégradé bleu (texte et icône blancs). */
.acc-tabs {
  display: flex; gap: 8px; padding: 6px; border-radius: 14px;
  background: #eef2f8; border: 1px solid #e3ebf6;
}
.acc-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 12px; border: 0; border-radius: 11px; cursor: pointer;
  background: transparent; color: #46608a; font-size: 14px; font-weight: 700;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.acc-tab:hover { background: #fff; color: var(--brand); }
.acc-tab.active {
  color: #fff; background: linear-gradient(135deg, #2f86f6 0%, var(--brand) 55%, var(--brand-deep) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 6px 14px -6px rgba(7, 86, 217, .75);
}
.acc-panes { margin-top: 15px; }
.acc-pane { display: grid; gap: 14px; align-content: start; animation: acc-in .18s ease; }
/* L’attribut hidden doit primer sur `display: grid` : un seul onglet visible. */
.acc-pane[hidden] { display: none; }
@keyframes acc-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* « Informations du compte » : EXACTEMENT trois cartes alignées sur une ligne. */
.acc-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.acc-info {
  display: flex; align-items: center; gap: 11px; min-width: 0; min-height: 74px;
  background: #fff; border: 1px solid #cfe0f8; border-radius: 14px; padding: 13px 14px;
  box-shadow: 0 1px 2px rgba(36, 87, 167, .05), 0 10px 22px -18px rgba(36, 87, 167, .6);
}
.acc-ic {
  flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: #e8f1ff; color: var(--brand); border: 1px solid #d5e6fb;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}
.acc-txt { min-width: 0; display: grid; gap: 3px; }
.acc-k { font-size: 12.5px; font-weight: 800; color: var(--brand-deep); }
.acc-v { font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; }

/* Carte générique conservée pour « Paramètres du compte » (inchangée). */
.acc-card {
  background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 13px 14px;
  box-shadow: 0 1px 2px rgba(36, 87, 167, .05), 0 10px 22px -16px rgba(36, 87, 167, .5);
}
.acc-card h4 { margin: 0 0 9px; font-size: 13.5px; color: var(--brand-deep); }
.acc-card .help { margin-top: 5px; }

/* Onglet Sécurité : titre + description, puis le changement de mot de passe. */
.acc-sec-head { display: flex; align-items: center; gap: 11px; }
.acc-sec-ico {
  flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: #e8f1ff; color: var(--brand); border: 1px solid #d5e6fb;
}
.acc-sec-txt { min-width: 0; }
.acc-sec-txt h4 { margin: 0; font-size: 15.5px; color: var(--brand-deep); }
.acc-sec-txt p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }

/* Mot de passe : actuel + nouveau sur la 1re ligne, confirmation en pleine
   largeur, rappel de la règle RÉELLE du serveur, puis bouton dégradé pleine
   largeur. */
.acc-modal .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.acc-modal .field.acc-full { grid-column: 1 / -1; }
.acc-hint {
  display: flex; align-items: flex-start; gap: 8px; margin-top: 12px;
  font-size: 12.5px; line-height: 1.5; color: #1d4f9e;
  background: #eef5ff; border: 1px solid #d5e5fb; border-radius: 11px; padding: 9px 12px;
}
.acc-hint .ico { flex: none; margin-top: 1px; }
.acc-modal .form-actions { margin-top: 14px; }
.acc-modal .form-actions .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  background: linear-gradient(135deg, #2f86f6 0%, var(--brand) 55%, var(--brand-deep) 100%);
  border-color: transparent; border-radius: 12px; color: #fff; font-weight: 700;
  box-shadow: 0 10px 20px -10px rgba(7, 86, 217, .85);
}
.acc-modal .form-actions .btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.acc-modal .form-actions .btn:disabled { transform: none; filter: none; opacity: .8; }
.acc-btn-in { display: inline-flex; align-items: center; gap: 8px; }

/* « Informations personnelles » : nom et prénom en consultation puis édition
   (bouton Modifier → champs actifs → Enregistrer / Annuler). */
.acc-edit {
  background: #fff; border: 1px solid #cfe0f8; border-radius: 15px; padding: 14px;
  box-shadow: 0 1px 2px rgba(36, 87, 167, .05), 0 10px 22px -18px rgba(36, 87, 167, .6);
}
.acc-edit input:disabled {
  background: #f2f6fc; color: var(--text); cursor: default; opacity: 1;
  -webkit-text-fill-color: var(--text);
}
.acc-edit input:disabled:focus { outline: none; box-shadow: none; }
/* Adresse e-mail : affichage seul, encadré en pointillés bleus. */
.acc-ro {
  display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 9px 12px;
  background: var(--pp-bg, #f4f7fc); border: 1.5px dashed #cfe0f8; border-radius: 11px;
  color: var(--text); font-weight: 600; overflow-wrap: anywhere;
}
.acc-ro .ico { flex: none; color: var(--brand); }
/* Rang « Modifier mes informations » : aligné à droite, cible confortable. */
.acc-mod-row { display: flex; justify-content: flex-end; margin-top: 12px; }
.acc-edit-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; }
/* Deux boutons d’action côte à côte : Annuler (contour) + Enregistrer (dégradé). */
.acc-modal .acc-edit .form-actions { display: flex; gap: 10px; }
.acc-modal .acc-edit .form-actions .btn { width: auto; flex: 1; min-height: 44px; }
.acc-modal .acc-edit .form-actions .btn.secondary {
  background: #fff; color: var(--brand-deep); border: 1.5px solid #cfe0f8;
  box-shadow: 0 6px 14px -10px rgba(36, 87, 167, .6);
}
.acc-modal .acc-edit .form-actions .btn.secondary:hover {
  background: #f4f8ff; border-color: var(--brand); transform: none; filter: none;
}

/* ---- Onglet Notifications : préférences (son, badge, système, catégories) -- */
.np { display: grid; gap: 14px; }
.np .acc-card { display: grid; gap: 9px; align-content: start; }
.np .acc-card h4 { margin: 0; }
.np .np-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.np .np-count {
  font-size: 12px; font-weight: 800; color: var(--brand);
  background: #e8f1ff; border: 1px solid #d5e6fb; border-radius: 999px; padding: 3px 10px;
}
/* Ligne de sauvegarde automatique : discret, jamais bloquant. */
.np-save {
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; gap: 7px; padding: 2px 4px;
}
.np-save.busy { color: var(--brand-2); }
.np-save.err { color: #dc2626; }
/* État de l'autorisation système : vert / orange / rouge selon le navigateur. */
.np-perm-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.np-perm {
  font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 5px 11px;
  border: 1px solid transparent;
}
.np-perm.ok { color: var(--ok); background: #e9f7ef; border-color: #c3e6d0; }
.np-perm.wait { color: var(--warn); background: #fdf3e3; border-color: #f4ddb5; }
.np-perm.no { color: #dc2626; background: #fdecec; border-color: #f6cfcf; }
.np-dev { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.np-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.np-enable { display: inline-flex; align-items: center; gap: 8px; }
/* Choix de la tonalité + bouton de test. */
.np-tone-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.np-tone-label { font-size: 13px; font-weight: 700; color: var(--brand-deep); }
.np-tone {
  min-width: 150px; padding: 9px 11px; border-radius: 11px;
  border: 1.5px solid #cfe0f8; background: #fff; color: var(--text);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.np-tone:focus { outline: 2.5px solid rgba(7, 86, 217, .35); outline-offset: 1px; }
.np-sub { display: grid; gap: 8px; }
.np-sub-title { font-size: 12.5px; font-weight: 700; color: var(--brand-deep); }
/* Puces de catégories : coche réelle (input accessible) + état actif bleu. */
.np-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.np-chip {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 13px; border-radius: 999px; cursor: pointer; user-select: none;
  background: #fff; border: 1.5px solid #dbe6f6; color: #46608a;
  font-size: 13px; font-weight: 700;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.np-chip:hover { border-color: var(--brand-2); color: var(--brand); }
.np-chip input {
  position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none;
}
.np-chip input:focus-visible + .np-dot { outline: 2.5px solid rgba(7, 86, 217, .55); outline-offset: 2px; }
.np-dot {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: #cfd8e6; transition: background .15s ease, box-shadow .15s ease;
}
.np-chip.on {
  background: linear-gradient(135deg, #2f86f6 0%, var(--brand) 55%, var(--brand-deep) 100%);
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 14px -8px rgba(7, 86, 217, .8);
}
.np-chip.on .np-dot { background: #ffd479; box-shadow: 0 0 0 3px rgba(255, 212, 121, .28); }
/* Téléphone : les lignes de réglage passent en colonne (jamais de chevauchement). */
@media (max-width: 640px) {
  .np .uc-row { flex-wrap: wrap; gap: 10px; }
  .np-cats { gap: 7px; }
  .np-chip { font-size: 12.5px; padding: 7px 11px; }
  .np-tone { width: 100%; }
  .np-tone-row .btn { flex: 1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .np-chip, .np-dot { transition: none; }
}

/* Pied de fenêtre : « Se déconnecter » (gauche, icône rouge) et « Fermer » (droite). */
.acc-modal .modal-foot { justify-content: space-between; gap: 10px; }
.acc-modal .modal-foot .btn {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 12px; padding: 10px 16px;
}
.acc-out .ico { color: var(--danger); }
.acc-close .ico { color: var(--brand-deep); }

/* Mon compte : tablette et téléphone — cartes empilées, champs sur une
   colonne, aucun défilement horizontal, boutons du pied accessibles. */
@media (max-width: 760px) {
  .acc-cards { grid-template-columns: 1fr; }
  .acc-modal .form-grid { grid-template-columns: 1fr; }
  .acc-modal .field.acc-full { grid-column: auto; }
}
@media (max-width: 520px) {
  .acc-modal .modal-head { padding: 13px 14px; gap: 10px; }
  .acc-hd-t { font-size: 15.5px; }
  .acc-hd-ico { width: 38px; height: 38px; }
  .acc-tab { font-size: 13px; padding: 10px 6px; }
  .acc-id { gap: 11px; }
  .acc-info { min-height: 0; }
  .acc-modal .modal-foot { flex-wrap: wrap; }
  .acc-modal .modal-foot .btn { flex: 1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .acc-pane { animation: none; }
  .acc-tab, .acc-modal .modal-head .x, .acc-modal .form-actions .btn { transition: none; }
  .acc-tab:hover, .acc-modal .modal-head .x:hover, .acc-modal .form-actions .btn:hover { transform: none; }
}
.searchbox {
  display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px; min-width: 260px;
}
.searchbox input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 14px; }
.icon-btn {
  border: 1px solid var(--line); background: #fff; width: 38px; height: 38px; border-radius: 10px;
  cursor: pointer; display: grid; place-items: center; font-size: 16px; position: relative; color: var(--text);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .dot {
  position: absolute; top: -5px; right: -5px; background: #ef4444; color: #fff; font-size: 10px;
  font-weight: 700; border-radius: 999px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px;
}

/* ---------- Cloche Premium 3D des notifications (barre supérieure) --------
   Relief et lueurs aux COULEURS DU LOGO : dégradé bleu #2457A7, reflet blanc
   en haut, halo bleu et point orange (#F58220) en angle. Le badge rouge
   affiche le nombre RÉEL de notifications non lues (masqué à 0).
   Animations discrètes : balancement + lueur à l'arrivée (temps réel),
   élévation au survol, retour visuel au clic — toutes neutralisées avec
   prefers-reduced-motion. Aucune donnée de démonstration. */
.bell-wrap { position: relative; display: grid; place-items: center; flex: none; }
.bell3d {
  position: relative; width: 40px; height: 40px; border: 0; cursor: pointer;
  border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(158deg, #3d78d8 0%, #2457a7 55%, #173f7e 100%);
  box-shadow: 0 6px 14px rgba(36, 87, 167, .32), inset 0 1px 0 rgba(255, 255, 255, .38),
    inset 0 -2px 5px rgba(11, 40, 84, .35);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.bell3d .bell-shine {
  position: absolute; inset: 2px 3px auto 3px; height: 44%; border-radius: 10px 10px 45% 45%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.bell3d .ico { width: 20px; height: 20px; filter: drop-shadow(0 1px 1px rgba(9, 32, 68, .5)); }
.bell3d::before {
  content: ''; position: absolute; inset: -7px; border-radius: 16px; pointer-events: none;
  background: radial-gradient(58% 58% at 50% 46%, rgba(96, 152, 255, .38), rgba(96, 152, 255, 0) 72%);
  opacity: .75; transition: opacity .2s ease;
}
.bell3d::after {
  content: ''; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #ffd0a3, #f58220 70%);
  box-shadow: 0 0 8px rgba(245, 130, 32, .8); pointer-events: none;
}
.bell-badge {
  position: absolute; top: -5px; right: -5px; z-index: 2;
  background: linear-gradient(160deg, #ff7a6b, #dc2626); color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: .2px;
  border-radius: 999px; min-width: 18px; height: 18px; padding: 0 4px;
  display: grid; place-items: center; border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(220, 38, 38, .45); font-variant-numeric: tabular-nums;
}
.bell3d:hover {
  transform: translateY(-2px); filter: brightness(1.06);
  box-shadow: 0 10px 22px rgba(36, 87, 167, .42), inset 0 1px 0 rgba(255, 255, 255, .45),
    inset 0 -2px 5px rgba(11, 40, 84, .35);
}
.bell3d:hover::before { opacity: 1; }
.bell3d:active {
  transform: translateY(0) scale(.94); transition-duration: .06s;
  box-shadow: 0 3px 8px rgba(36, 87, 167, .35), inset 0 2px 4px rgba(11, 40, 84, .42);
}
.bell3d[aria-expanded="true"] {
  box-shadow: 0 8px 20px rgba(36, 87, 167, .45), 0 0 0 3px rgba(36, 87, 167, .18),
    inset 0 1px 0 rgba(255, 255, 255, .4);
}
@keyframes bell-swing {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(14deg); } 32% { transform: rotate(-11deg); }
  48% { transform: rotate(8deg); } 64% { transform: rotate(-6deg); }
  80% { transform: rotate(3deg); }
}
@keyframes bell-glow-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.bell3d.bell-swing .ico { transform-origin: 50% 12%; animation: bell-swing .9s ease; }
.bell3d.bell-swing::before, .bell3d.bell-swing .bell-badge { animation: bell-glow-pulse .9s ease 2; }
@media (prefers-reduced-motion: reduce) {
  .bell3d, .bell3d:hover, .bell3d:active { transition: none; transform: none; }
  .bell3d.bell-swing .ico, .bell3d.bell-swing::before, .bell3d.bell-swing .bell-badge { animation: none; }
}
/* Panneau déroulant : titres, contenu, date, état de lecture — positionné
   sous la cloche et jamais coupé par les bords de l'écran. */
.bell-panel {
  position: absolute; top: calc(100% + 10px); right: -4px; z-index: 60;
  width: min(372px, calc(100vw - 28px)); max-height: min(70vh, 520px);
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 44px rgba(15, 42, 84, .18), 0 3px 10px rgba(15, 42, 84, .10);
  display: flex; flex-direction: column; overflow: hidden;
  animation: bell-panel-in .16s ease;
}
@keyframes bell-panel-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.bell-panel .bp-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 13px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f6faff, #fff);
}
.bell-panel .bp-list { overflow-y: auto; padding: 6px; display: grid; gap: 3px; }
.bell-item {
  display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: start;
  padding: 9px 10px; border-radius: 10px; border: 1px solid transparent;
  background: none; text-align: left; width: 100%; cursor: pointer;
  font: inherit; color: inherit; transition: background .12s ease, border-color .12s ease;
}
.bell-item:hover { background: #eaf2fc; border-color: rgba(36, 87, 167, .16); }
.bell-item.unread { background: #f4f8ff; }
.bell-item .bi-ico {
  display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px;
  background: #eaf2fc; color: #2457a7;
}
.bell-item.unread .bi-ico { background: linear-gradient(160deg, #3d78d8, #2457a7); color: #fff; }
.bell-item .bi-main b { font-size: 13px; display: block; }
.bell-item .bi-main p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.bell-item .bi-main small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); opacity: .85; }
.bell-item.unread .bi-main b::after {
  content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 6px;
  border-radius: 50%; background: #2457a7; vertical-align: 1px;
}
.bp-empty { padding: 26px 12px; text-align: center; color: var(--muted); }
.bp-empty p { margin: 6px 0 0; font-size: 13px; }
@media (max-width: 640px) {
  /* Téléphone : panneau en pleine largeur sous la barre supérieure. */
  .bell-panel { position: fixed; top: calc(var(--topbar-h) + 6px); right: 10px; left: 10px; width: auto; }
}
/* ---------- Compte utilisateur PREMIUM (barre supérieure) -----------------
   Même famille 3D que la cloche voisine (dégradé bleu du logo, liseré
   lumineux, relief inset) et MÊME hauteur (40 px) : bouton et notifications
   restent parfaitement alignés. Le chevron indique l'ouverture du menu. */
.uc-wrap { position: relative; display: flex; align-items: center; flex: none; }
.user-chip {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  height: 40px; padding: 4px 11px 4px 5px; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .26); font: inherit;
  background: linear-gradient(158deg, #3d78d8 0%, #2457a7 55%, #173f7e 100%);
  color: #fff;
  box-shadow: 0 6px 14px rgba(36, 87, 167, .32), inset 0 1px 0 rgba(255, 255, 255, .38),
    inset 0 -2px 5px rgba(11, 40, 84, .35);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.user-chip:hover {
  transform: translateY(-1px); filter: brightness(1.06);
  box-shadow: 0 10px 20px rgba(36, 87, 167, .40), inset 0 1px 0 rgba(255, 255, 255, .45),
    inset 0 -2px 5px rgba(11, 40, 84, .35);
}
.user-chip:active { transform: translateY(0) scale(.98); transition-duration: .06s; }
.user-chip:focus-visible { outline: 2.5px solid rgba(36, 87, 167, .55); outline-offset: 2px; }
.user-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #173f7e;
  display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none;
  box-shadow: inset 0 0 0 1px rgba(11, 40, 84, .14);
}
.user-chip .who { line-height: 1.15; text-align: left; min-width: 0; }
.user-chip .who b { font-size: 13px; display: block; color: #fff; font-weight: 700; white-space: nowrap; }
.user-chip .who span { font-size: 11px; color: rgba(255, 255, 255, .80); white-space: nowrap; }
/* Chevron tracé en CSS (aucune image) : pivote en 220 ms à l'ouverture. */
.uc-caret {
  width: 8px; height: 8px; margin-left: 2px; flex: none;
  border-right: 2px solid rgba(255, 255, 255, .85);
  border-bottom: 2px solid rgba(255, 255, 255, .85);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .22s ease;
}
.user-chip[aria-expanded="true"] .uc-caret { transform: rotate(225deg) translate(-2px, -2px); }
.user-chip[aria-expanded="true"] {
  box-shadow: 0 8px 20px rgba(36, 87, 167, .45), 0 0 0 3px rgba(36, 87, 167, .18),
    inset 0 1px 0 rgba(255, 255, 255, .4);
}
/* ---------- MULTI-RÔLES : bascule d'espace (barre supérieure) ----------
   Même hauteur et même famille de relief que le chip de compte, mais fond
   CLAIR bleu royal / blanc pour se distinguer d'un bouton de navigation.
   · le nom de l'espace ACTIF s'efface sous 1240 px ;
   · le libellé de l'espace CIBLE s'efface sous 1024 px (icône + aria-label),
     la barre ne déborde jamais sur tablette ni sur téléphone. */
.space-chips { display: flex; align-items: center; gap: 8px; flex: none; }
.space-now {
  font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap;
  letter-spacing: .2px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: rgba(36, 87, 167, .06);
}
.space-now b { color: var(--brand); font-weight: 800; }
.space-chip {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  height: 40px; padding: 0 12px; border-radius: 14px; font: inherit;
  border: 1px solid rgba(255, 255, 255, .7); white-space: nowrap;
  background: linear-gradient(158deg, #ffffff 0%, #eef4ff 55%, #dce8ff 100%);
  color: #173f7e; font-size: 12.5px; font-weight: 700;
  box-shadow: 0 4px 10px rgba(36, 87, 167, .18), inset 0 1px 0 #ffffff;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.space-chip:hover {
  transform: translateY(-1px); filter: brightness(1.04);
  box-shadow: 0 8px 16px rgba(36, 87, 167, .26), inset 0 1px 0 #ffffff;
}
.space-chip:active { transform: translateY(0) scale(.98); transition-duration: .06s; }
.space-chip:focus-visible { outline: 2.5px solid rgba(36, 87, 167, .55); outline-offset: 2px; }
.space-chip .ico { color: var(--brand); flex: none; }
@media (max-width: 1240px) { .space-now { display: none; } }
@media (max-width: 1024px) {
  .space-chip .sp-txt { display: none; }
  .space-chip { padding: 0 11px; }
}
@media (prefers-reduced-motion: reduce) { .space-chip { transition: none; } }
/* Écrans intermédiaires (≈1025-1440 px, y compris zoom système 110 %) :
   le contenu de la barre (accès rapides + présence + compte) peut dépasser
   la largeur disponible — AUCUN débordement horizontal toléré (§16). Les
   libellés se tronquent en points de suspension au lieu de pousser le chip
   hors écran ; le nom du compte reste visible. */
@media (max-width: 1440px) {
  .topbar .quick-nav { min-width: 0; }
  .topbar .quick-nav a {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .topbar .presence { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .uc-wrap { min-width: 0; }
  .user-chip { min-width: 0; max-width: 100%; overflow: hidden; }
  .user-chip .who { max-width: 132px; }
  .user-chip .who b, .user-chip .who span { overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- Menu déroulant du compte -------------------------------------
   Fond blanc, coins 20 px, ombre douce, en-tête RÉEL du compte puis rubriques
   et Déconnexion séparée en rouge. Fermeture : clic extérieur, Échap ou choix. */
.uc-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  width: min(292px, calc(100vw - 24px)); padding: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 18px 44px rgba(15, 42, 84, .18), 0 3px 10px rgba(15, 42, 84, .10);
  transform-origin: top right; animation: uc-in .16s ease;
}
@keyframes uc-in {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.uc-head {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 12px;
  border-bottom: 1px solid var(--line); margin-bottom: 6px;
}
.uc-av {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14.5px;
  background: linear-gradient(158deg, #3d78d8 0%, #2457a7 55%, #173f7e 100%);
  box-shadow: 0 4px 10px rgba(36, 87, 167, .30), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.uc-id { min-width: 0; }
.uc-id .n { font-size: 13.5px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-id .r { font-size: 11.5px; font-weight: 700; color: #2457a7; margin-top: 1px; }
.uc-id .e { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px;
  border: 0; background: none; border-radius: 12px; font: inherit; font-size: 13.5px;
  color: var(--text); text-align: left; cursor: pointer;
  transition: background .14s ease, color .14s ease, transform .14s ease;
}
.uc-item:hover { background: #eaf2fc; transform: translateX(2px); }
.uc-item:focus-visible { outline: 2.5px solid rgba(36, 87, 167, .55); outline-offset: -2px; }
.uc-item .uc-i {
  display: grid; place-items: center; width: 26px; height: 26px; flex: none;
  border-radius: 8px; background: #eaf2fc; color: #2457a7;
}
.uc-sep { height: 1px; background: var(--line); margin: 6px 6px; }
.uc-item.danger { color: #dc2626; font-weight: 700; }
.uc-item.danger .uc-i { background: #fdecec; color: #dc2626; }
.uc-item.danger:hover { background: #fdecec; }

/* ---------- Modale « Paramètres du compte » (réglages réels) -------------- */
.uc-set { display: grid; gap: 12px; }
.uc-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 4px 0 10px;
}
.uc-row-txt b { font-size: 13.5px; color: var(--text); }
.uc-row-txt .help { margin-top: 3px; }
.uc-toggle {
  position: relative; width: 46px; height: 26px; flex: none; cursor: pointer;
  border: 0; border-radius: 999px; background: #cfd8e6;
  transition: background .18s ease; padding: 0;
}
.uc-toggle[aria-checked="true"] { background: linear-gradient(158deg, #3d78d8, #173f7e); }
.uc-knob {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(15, 42, 84, .35); transition: transform .18s ease;
}
.uc-toggle[aria-checked="true"] .uc-knob { transform: translateX(20px); }
.uc-toggle:focus-visible { outline: 2.5px solid rgba(36, 87, 167, .55); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .user-chip, .uc-caret, .uc-item, .uc-toggle, .uc-knob { transition: none !important; }
  .uc-menu { animation: none; }
}
@media (max-width: 640px) {
  /* Téléphone : menu ancré sous la barre, jamais plus large que l'écran. */
  .uc-menu { position: fixed; top: calc(var(--topbar-h) + 6px); right: 10px; width: min(300px, calc(100vw - 20px)); }
  .uc-item { min-height: 44px; }
}

.presence { display: flex; align-items: center; gap: 4px; }
.presence .p-av {
  width: 26px; height: 26px; border-radius: 50%; background: var(--brand-3); color: #fff; font-size: 10.5px;
  font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; margin-left: -8px;
}
.presence .p-av:first-child { margin-left: 0; }
.presence .p-label { font-size: 11.5px; color: var(--muted); margin-left: 4px; }

/* Largeur entièrement fluide : le contenu occupe tout l'espace disponible à
   droite de la barre latérale, jusqu'au bord droit de la fenêtre (aucun
   plafond artificiel — correction de l'espace vide à droite). */
.content { padding: 24px; flex: 1; width: 100%; min-width: 0; }
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h2 { margin: 0 0 3px; font-size: 21px; letter-spacing: -.2px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13.5px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Cards / stats ---------- */
.card {
  background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card + .card { margin-top: 16px; }
.card h3 { margin: 0 0 12px; font-size: 15px; letter-spacing: .1px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
/* Actions de l'en-tête : retour à la ligne autorisé — sur petit écran les
   boutons (onglets de statut, filtres) passent sous le titre au lieu de
   faire déborder la page horizontalement. */
.card-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); }
.stat {
  background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius); padding: 16px 17px;
  box-shadow: var(--shadow-float); position: relative; overflow: hidden;
}
.stat:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(36, 87, 167, .07), 0 22px 42px -12px rgba(36, 87, 167, .26); }
.stat .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.stat .v { font-size: 27px; font-weight: 800; letter-spacing: -.6px; margin-top: 4px; }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand-3); }
.stat.ok::after { background: var(--ok); }
.stat.warn::after { background: var(--warn); }
.stat.danger::after { background: var(--danger); }
.stat.purple::after { background: var(--purple); }

.cols-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cols-equal { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent;
  background: var(--brand); color: #fff; padding: 9px 16px; border-radius: var(--radius-sm); font-size: 14px;
  font-weight: 600; letter-spacing: .1px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(36, 87, 167, .22);
  transition: background .16s ease, box-shadow .16s ease, transform .12s ease, border-color .16s ease, color .16s ease;
}
.btn:hover { background: var(--brand-2); text-decoration: none; box-shadow: 0 4px 12px rgba(36, 87, 167, .26); transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(36, 87, 167, .2); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.secondary { background: #fff; color: var(--text); border-color: var(--line-strong); box-shadow: 0 1px 2px rgba(37, 50, 71, .05); }
.btn.secondary:hover { background: var(--surface-2); border-color: var(--brand-3); color: var(--brand); }
.btn.ghost { background: transparent; color: var(--brand-2); border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--brand-soft); color: var(--brand); box-shadow: none; }
.btn.danger { background: var(--danger); box-shadow: 0 1px 2px rgba(185, 28, 28, .22); }
.btn.danger:hover { background: #c92626; box-shadow: 0 4px 12px rgba(185, 28, 28, .24); }
.btn.ok { background: var(--ok); box-shadow: 0 1px 2px rgba(21, 128, 61, .22); }
.btn.ok:hover { background: #1a9146; box-shadow: 0 4px 12px rgba(21, 128, 61, .22); }
.btn.warn { background: var(--warn); box-shadow: 0 1px 2px rgba(180, 83, 9, .22); }
.btn.warn:hover { background: #c25f10; box-shadow: 0 4px 12px rgba(180, 83, 9, .22); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }

/* Bouton « Télécharger PDF » du planning : bleu institutionnel Smart Salle,
   icône PDF, survol discret — même famille visuelle que les autres actions. */
.btn.pdf {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff; border-color: transparent;
  box-shadow: 0 1px 2px rgba(11, 79, 156, .26);
  transition: background .18s ease, box-shadow .18s ease, transform .12s ease;
}
.btn.pdf:hover { background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 100%); box-shadow: 0 6px 16px rgba(11, 79, 156, .3); transform: translateY(-1px); }
.btn.pdf:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(11, 79, 156, .24); }
.btn.pdf:disabled { opacity: .72; cursor: progress; transform: none; box-shadow: none; }
.btn.pdf .ico-file-pdf, .btn.pdf .ico-pdf { flex: 0 0 auto; }
@media (prefers-reduced-motion: reduce) {
  .btn.pdf, .btn.pdf:hover, .btn.pdf:active { transition: none; transform: none; }
}

/* Contrôles de présence : sélection explicite, à fort contraste et tactile. */
.attendance-mark {
  min-height: 40px; padding: 8px 12px; gap: 7px; border-radius: 10px;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease,
    box-shadow .18s ease, transform .14s ease;
}
.attendance-mark--present { background: #fff; color: var(--ok); border-color: #b9dfc5; box-shadow: none; }
.attendance-mark--present:hover { background: var(--ok-soft); color: #166534; border-color: #8bc99f; box-shadow: 0 3px 10px rgba(21,128,61,.12); }
.attendance-mark--present.is-selected { background: var(--ok-soft); color: #166534; border-color: #63b77d; box-shadow: 0 0 0 2px rgba(21,128,61,.12); }
.attendance-mark--absent { background: #fff; color: var(--danger); border-color: #efc1c1; box-shadow: none; }
.attendance-mark--absent:hover { background: var(--danger-soft); color: #991b1b; border-color: #e8a0a0; box-shadow: 0 3px 10px rgba(185,28,28,.1); }
.attendance-mark--absent.is-selected { background: var(--danger-soft); color: #991b1b; border-color: #dc7777; box-shadow: 0 0 0 2px rgba(185,28,28,.1); }
.attendance-mark--unset { background: #fff; color: var(--muted); border-color: var(--line-strong); box-shadow: none; }
.attendance-mark--unset:hover { background: var(--surface-2); color: var(--text); border-color: var(--brand-3); box-shadow: none; }
.attendance-mark.is-selected { font-weight: 700; transform: translateY(-1px); }
.attendance-mark.is-selected:hover { transform: translateY(-1px); }
.attendance-mark__dirty { margin-left: -3px; font-size: 17px; line-height: 0; color: currentColor; }
.attendance-mark:focus-visible { outline: 3px solid rgba(36,87,167,.28); outline-offset: 2px; }
@media (max-width: 640px) {
  .attendance-mark { min-height: 44px; padding: 8px 10px; font-size: 12px; }
  .attendance-mark .ico { width: 14px; height: 14px; }
}
.btn .spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.quick {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px; border: 1px solid var(--card-line);
  background: var(--surface); border-radius: 13px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text);
  box-shadow: 0 1px 2px rgba(36, 87, 167, .05), 0 6px 16px -6px rgba(36, 87, 167, .12);
}
.quick:hover {
  background: var(--brand-soft); border-color: #bcd3f0; text-decoration: none;
  transform: translateY(-2px); box-shadow: var(--shadow-float);
}
.quick .qi { width: 32px; height: 32px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }

/* ---------- DASHBOARD PREMIUM 3D ----------------------------------------
   Portée strictement limitée à .dash-premium (tableaux de bord des 4 rôles
   + espace étudiant) : en-tête hero, cartes statistiques à icône relief,
   panneaux de salles en mini-cartes. Les autres pages gardent leurs styles. */
/* En-tête hero : dégradé bleu Smart Salle + reflets subtils. */
.dash-premium .page-head {
  position: relative; overflow: hidden; align-items: center;
  background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand) 55%, var(--brand-2) 112%);
  border-radius: var(--radius-lg); padding: 19px 24px;
  box-shadow: 0 10px 26px -12px rgba(11, 79, 156, .5), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.dash-premium .page-head > * { position: relative; z-index: 1; }
/* Reflet blanc en haut à droite et halo orange du logo en bas — décoratifs. */
.dash-premium .page-head::before {
  content: ""; position: absolute; right: -38px; top: -62px; width: 190px; height: 190px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, 0) 68%);
}
.dash-premium .page-head::after {
  content: ""; position: absolute; left: 26%; bottom: -74px; width: 156px; height: 156px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(245, 130, 32, .30) 0%, rgba(245, 130, 32, 0) 70%);
}
.dash-premium .page-head h2 { color: #fff; }
.dash-premium .page-head p { color: rgba(255, 255, 255, .85); }
/* Sur le hero : bouton principal blanc, bouton secondaire « verre dépoli ». */
.dash-premium .page-head .btn {
  background: #fff; color: var(--brand); border-color: transparent;
  box-shadow: 0 3px 10px -3px rgba(0, 0, 0, .3);
}
.dash-premium .page-head .btn:hover { background: var(--surface-2); color: var(--brand-deep); box-shadow: 0 5px 14px -4px rgba(0, 0, 0, .35); }
.dash-premium .page-head .btn.secondary {
  background: rgba(255, 255, 255, .13); color: #fff; border-color: rgba(255, 255, 255, .45); box-shadow: none;
}
.dash-premium .page-head .btn.secondary:hover { background: rgba(255, 255, 255, .26); color: #fff; border-color: rgba(255, 255, 255, .75); }
/* Actions secondaires des cartes : accent orange sobre (identité Smart Salle). */
.dash-premium .card .btn.secondary {
  background: linear-gradient(180deg, #fffaf3 0%, #fdf1e3 100%); border-color: #f6dcbd; color: #b8590a;
}
.dash-premium .card .btn.secondary:hover { background: #fdf1e3; border-color: var(--accent); color: #96480a; }

/* Cartes statistiques : relief flottant, entrée en fondu léger, icône 3D. */
.dash-premium .stat {
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  box-shadow: 0 1px 2px rgba(16, 34, 64, .05), 0 12px 26px -14px rgba(16, 34, 64, .28);
  padding-right: 58px; /* place pour la pastille-icône */
  animation: dashStatIn .45s ease both;
}
@keyframes dashStatIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.dash-premium .stats .stat:nth-child(2) { animation-delay: .05s; }
.dash-premium .stats .stat:nth-child(3) { animation-delay: .1s; }
.dash-premium .stats .stat:nth-child(4) { animation-delay: .15s; }
.dash-premium .stats .stat:nth-child(5) { animation-delay: .2s; }
.dash-premium .stats .stat:nth-child(6) { animation-delay: .25s; }
.dash-premium .stat:hover { border-color: rgba(36, 87, 167, .28); }
/* Pastille-icône en relief : dégradé + reflet intérieur + ombre portée,
   teintée par le type de carte (par défaut : bleu Smart Salle). */
.stat-ic {
  position: absolute; top: 13px; right: 13px; width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(160deg, var(--brand-2) 0%, var(--brand) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 10px -4px rgba(11, 79, 156, .55);
  transition: transform .18s ease, box-shadow .18s ease;
}
.stat.ok .stat-ic { background: linear-gradient(160deg, #1a9146 0%, var(--ok) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 10px -4px rgba(21, 128, 61, .5); }
.stat.info .stat-ic { background: linear-gradient(160deg, #2f63d8 0%, var(--info) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 10px -4px rgba(29, 78, 216, .5); }
.stat.warn .stat-ic { background: linear-gradient(160deg, #d97706 0%, var(--warn) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 10px -4px rgba(180, 83, 9, .5); }
.stat.danger .stat-ic { background: linear-gradient(160deg, #d14343 0%, var(--danger) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 10px -4px rgba(185, 28, 28, .5); }
.stat.purple .stat-ic { background: linear-gradient(160deg, #7c3aed 0%, var(--purple) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 10px -4px rgba(109, 40, 217, .5); }
.dash-premium .stat:hover .stat-ic { transform: translateY(-1px) scale(1.06); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 14px -5px rgba(11, 79, 156, .6); }

/* Cartes et tableaux : ombre diffuse, en-tête délimité, lignes aérées au survol. */
.dash-premium .card { box-shadow: 0 1px 2px rgba(16, 34, 64, .04), 0 14px 30px -20px rgba(16, 34, 64, .32); }
.dash-premium .card-head { border-bottom: 1px solid var(--line); padding-bottom: 11px; margin-bottom: 13px; }
.dash-premium .card-head h3 { font-size: 15.5px; }
.dash-premium .table tbody tr { transition: background .15s ease; }
.dash-premium .table tbody tr:hover { background: rgba(36, 87, 167, .045); }

/* Panneaux « Salles libres » / « Salles occupées » : compteurs colorés et
   mini-cartes avec liseré vert (libre) ou rouge (occupée). */
.oc-count {
  display: inline-grid; place-items: center; min-width: 23px; height: 21px; padding: 0 7px;
  border-radius: 999px; font-size: 12px; font-weight: 800;
  background: var(--brand-soft); color: var(--brand); vertical-align: middle;
}
.oc-count.ok { background: var(--ok-soft); color: var(--ok); }
.oc-count.taken { background: var(--danger-soft); color: var(--danger); }
.oc-panels .list { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 9px; }
.oc-panels .item {
  padding: 10px 12px; border-radius: 12px; border-left: 3px solid var(--ok);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.oc-panels .item.oc-taken { border-left-color: var(--danger); }
.oc-panels .item:hover { transform: translateY(-2px); box-shadow: var(--shadow-float); border-color: rgba(36, 87, 167, .22); }
.oc-panels .item.oc-taken:hover { border-left-color: var(--danger); }

/* Accès rapide : tuiles-icônes en dégradé assorti des cartes statistiques. */
.dash-premium .quick { border-radius: 14px; transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease; }
.dash-premium .quick .qi {
  width: 34px; height: 34px; border-radius: 11px; color: #fff;
  background: linear-gradient(160deg, var(--brand-2) 0%, var(--brand) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 3px 8px -3px rgba(11, 79, 156, .5);
  transition: transform .16s ease;
}
.dash-premium .quick:hover .qi { transform: translateY(-1px) scale(1.05); }

/* Téléphone : en-tête compact, pastilles réduites, aucun débordement. */
@media (max-width: 560px) {
  .dash-premium .page-head { padding: 15px 15px; border-radius: 14px; }
  .dash-premium .page-head .actions { width: 100%; }
  .dash-premium .stat { padding-right: 44px; }
  .stat-ic { width: 29px; height: 29px; border-radius: 9px; }
}
/* Mouvement réduit : aucune animation, survols statiques. */
@media (prefers-reduced-motion: reduce) {
  .dash-premium .stat, .dash-premium .stat-ic, .dash-premium .quick, .dash-premium .quick .qi, .oc-panels .item {
    animation: none !important; transition: none !important;
  }
  .dash-premium .stat:hover, .dash-premium .stat:hover .stat-ic,
  .dash-premium .quick:hover .qi, .oc-panels .item:hover { transform: none; }
}

/* ---------- DASHBOARD — GLASSMORPHISM 3D (refonte premium) --------------
   Photographie de la façade de l'ISPITS Laâyoune en arrière-plan, floutée à
   environ 20 % + voile clair de lisibilité ; cartes translucides en verre
   dépoli (backdrop-filter), bordures blanches semi-transparentes, ombres
   douces, coins 16-24 px et panneau droit collant. Portée : .dash-premium. */
.dash-premium {
  position: relative; isolation: isolate;
  border-radius: 20px; padding: 18px;
  overflow: hidden; overflow: clip; /* le clip ne crée pas de conteneur de défilement : sticky reste actif */
}
.dash-premium::before {
  content: ""; position: absolute; inset: -34px; z-index: -1; pointer-events: none;
  background: url('/assets/ispits-laayoune-facade.jpg') center 38% / cover no-repeat;
  filter: blur(20px) saturate(1.06); transform: scale(1.03);
}
.dash-premium::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, .58) 0%, rgba(231, 241, 255, .70) 52%, rgba(255, 255, 255, .60) 100%);
}
/* Cartes en verre dépoli : translucidité, bordure blanche, ombre naturelle. */
.dash-premium .card, .dash-premium .stat {
  background: linear-gradient(150deg, rgba(255, 255, 255, .80), rgba(255, 255, 255, .58));
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, .78);
  box-shadow: 0 1px 2px rgba(16, 34, 64, .05), 0 18px 42px -26px rgba(16, 34, 64, .50), inset 0 1px 0 rgba(255, 255, 255, .70);
  border-radius: 18px;
}
/* En-tête d'accueil « Bienvenue sur Smart Salle ». */
.dash-premium .g-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  position: relative; overflow: hidden;
  padding: 20px 24px; border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .87), rgba(255, 255, 255, .62) 58%, rgba(236, 244, 255, .72));
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, .82);
  box-shadow: 0 1px 2px rgba(16, 34, 64, .05), 0 20px 44px -28px rgba(11, 79, 156, .55), inset 0 1px 0 rgba(255, 255, 255, .8);
  animation: dashStatIn .5s ease both;
}
.dash-premium .g-hero::after {
  content: ""; position: absolute; right: -60px; top: -84px; width: 240px; height: 240px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(36, 87, 167, .16) 0%, rgba(36, 87, 167, 0) 70%);
}
.dash-premium .g-hero > * { position: relative; z-index: 1; }
.dash-premium .g-hero h2 { font-size: clamp(21px, 2.4vw, 29px); letter-spacing: -.5px; color: #0f2a4a; }
.g-hero-brand { color: var(--brand-deep); }
.g-hero-sub { margin: 5px 0 10px; color: #43566f; font-size: 14px; }
.g-hero-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: #43566f; }
.g-hero-who, .g-hero-date { display: inline-flex; align-items: center; gap: 6px; }
.g-hero-who b { color: #12305a; }
.dash-premium .g-hero svg { flex: none; }
/* Coquille : colonne principale + panneau droit collant. */
.dash-premium .g-shell {
  display: grid; grid-template-columns: minmax(0, 1fr) 344px;
  gap: 16px; align-items: start; margin-top: 16px;
}
.dash-premium .g-left { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.dash-premium .g-aside { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; position: sticky; top: 8px; min-width: 0; }
.dash-premium .g-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
/* Graphiques SVG natifs. */
.dash-premium .g-chart-svg svg, .dash-premium .g-donut-svg svg { display: block; width: 100%; height: auto; }
.dash-premium .g-legend { display: flex; gap: 14px; font-size: 12.5px; color: #51617a; margin-bottom: 6px; }
.dash-premium .g-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.dash-premium .lg-occ { background: #2457a7; }
.dash-premium .lg-free { background: #9cc4f5; }
.dash-premium .g-donut { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.dash-premium .g-donut-svg { position: relative; width: 176px; flex: none; }
.dash-premium .g-donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dash-premium .g-donut-center b { font-size: 27px; color: var(--brand-deep); line-height: 1.05; }
.dash-premium .g-donut-center span { font-size: 12px; color: #64748b; }
.dash-premium .g-donut-legend { display: grid; gap: 7px; min-width: 170px; flex: 1; }
.dash-premium .g-dl-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; font-size: 13px; color: #33445f; }
.dash-premium .g-dl-row i { width: 10px; height: 10px; border-radius: 50%; }
.dash-premium .g-dl-name { display: grid; line-height: 1.2; min-width: 0; }
.dash-premium .g-dl-name small { font-size: 11px; color: #7d8ca3; font-weight: 500; }
.dash-premium .g-dl-row b { font-variant-numeric: tabular-nums; }
.dash-premium .g-dl-pct { color: #7488a5; font-size: 12px; min-width: 42px; text-align: right; }
/* Panneau droit : date, heure locale (Africa/El_Aaiun) et météo. */
.dash-premium .g-clock-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dash-premium .g-clock-date { font-size: 13px; color: #51617a; text-transform: capitalize; }
.dash-premium .g-clock-time { font-size: 34px; font-weight: 800; letter-spacing: -1px; color: var(--brand-deep); font-variant-numeric: tabular-nums; line-height: 1.1; }
.dash-premium .g-weather { display: flex; align-items: center; gap: 9px; }
.dash-premium .g-weather-ic { display: grid; place-items: center; }
.dash-premium .g-weather-txt { display: grid; line-height: 1.2; }
.dash-premium .g-weather-txt b { font-size: 18px; color: #12305a; }
.dash-premium .g-weather-txt span { font-size: 12px; color: #64748b; }
.dash-premium .g-weather-wait, .dash-premium .g-weather-na { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #64748b; }
/* Prochaines séances (panneau droit). */
.dash-premium .g-sess-list { display: grid; gap: 7px; }
.dash-premium .g-sess {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 9px 10px; border-radius: 14px; text-decoration: none; color: inherit;
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.dash-premium .g-sess:hover { background: rgba(255, 255, 255, .72); border-color: rgba(36, 87, 167, .20); transform: translateY(-1px); box-shadow: 0 10px 22px -16px rgba(16, 34, 64, .55); }
.dash-premium .g-sess-time { display: grid; justify-items: center; font-variant-numeric: tabular-nums; color: #51617a; }
.dash-premium .g-sess-time b { font-size: 13.5px; color: #12305a; }
.dash-premium .g-sess-time span { font-size: 12px; }
.dash-premium .g-sess-time i { font-size: 10.5px; font-style: normal; color: #8aa0bd; }
.dash-premium .g-sess-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), 0 4px 10px -5px rgba(16, 34, 64, .5); }
.dash-premium .g-sess-ic.t-cours { background: linear-gradient(160deg, #2f63d8, #2457a7); }
.dash-premium .g-sess-ic.t-stage { background: linear-gradient(160deg, #22a45d, #0f7a38); }
.dash-premium .g-sess-ic.t-controle { background: linear-gradient(160deg, #f9a03f, #f58220); }
.dash-premium .g-sess-main { min-width: 0; }
.dash-premium .g-sess-main b { display: block; font-size: 13.5px; color: #14325c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-premium .g-sess-main span { display: block; font-size: 12px; color: #5b6b82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-premium .g-sess-arrow { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.dash-premium .g-sess-arrow svg { transform: rotate(90deg); }
/* Activités récentes. */
.dash-premium .g-act-list { display: grid; gap: 3px; }
.dash-premium .g-act { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 12px; transition: background .15s ease; }
.dash-premium .g-act:hover { background: rgba(255, 255, 255, .68); }
.dash-premium .g-act-ic { width: 31px; height: 31px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
.dash-premium .g-act-ic.k-blue { background: linear-gradient(160deg, #2f63d8, #2457a7); }
.dash-premium .g-act-ic.k-green { background: linear-gradient(160deg, #22a45d, #0f7a38); }
.dash-premium .g-act-ic.k-purple { background: linear-gradient(160deg, #8b5cf6, #6d28d9); }
.dash-premium .g-act-ic.k-orange { background: linear-gradient(160deg, #f9a03f, #f58220); }
.dash-premium .g-act-main { min-width: 0; }
.dash-premium .g-act-main b { display: block; font-size: 13.5px; color: #16325a; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-premium .g-act-main span { font-size: 12px; color: #5b6b82; }
.dash-premium .g-act-when { font-size: 11.5px; color: #7488a5; white-space: nowrap; }
/* Liens rapides : tuiles teintées + raccourcis secondaires. */
.dash-premium .g-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.dash-premium .g-tile {
  display: grid; justify-items: center; gap: 7px; text-align: center; padding: 13px 8px 10px;
  border-radius: 15px; text-decoration: none; color: inherit;
  border: 1px solid rgba(255, 255, 255, .7);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.dash-premium .g-tile-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 10px -5px rgba(16, 34, 64, .55); }
.dash-premium .g-tile-label { font-size: 12px; font-weight: 700; line-height: 1.25; color: #1d3b66; }
.dash-premium .g-tile-arrow { color: #7d93b3; }
.dash-premium .g-tile-arrow svg { transform: rotate(90deg); }
.dash-premium .g-tile.t1 { background: rgba(36, 87, 167, .09); }
.dash-premium .g-tile.t1 .g-tile-ic { background: linear-gradient(160deg, #2f63d8, #2457a7); }
.dash-premium .g-tile.t2 { background: rgba(15, 122, 56, .10); }
.dash-premium .g-tile.t2 .g-tile-ic { background: linear-gradient(160deg, #22a45d, #0f7a38); }
.dash-premium .g-tile.t3 { background: rgba(109, 40, 217, .10); }
.dash-premium .g-tile.t3 .g-tile-ic { background: linear-gradient(160deg, #8b5cf6, #6d28d9); }
.dash-premium .g-tile.t4 { background: rgba(245, 130, 32, .11); }
.dash-premium .g-tile.t4 .g-tile-ic { background: linear-gradient(160deg, #f9a03f, #f58220); }
.dash-premium .g-tile:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -20px rgba(16, 34, 64, .6); background-color: rgba(255, 255, 255, .82); }
/* Tableaux sur verre. */
.dash-premium .table thead th { background: rgba(247, 250, 255, .75); color: #51617a; font-size: 11.5px; letter-spacing: .4px; text-transform: uppercase; }
/* Tablette : panneau droit au-dessus de la colonne principale, pas de collage. */
@media (max-width: 1180px) {
  .dash-premium .g-shell { grid-template-columns: minmax(0, 1fr); }
  .dash-premium .g-aside { position: static; order: -1; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
}
@media (max-width: 900px) {
  .dash-premium .g-duo { grid-template-columns: minmax(0, 1fr); }
  .dash-premium .g-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Téléphone : tout s'empile, aucun débordement horizontal. */
@media (max-width: 560px) {
  .dash-premium { padding: 10px; border-radius: 14px; }
  .dash-premium .g-hero { padding: 16px 14px; border-radius: 15px; }
  .dash-premium .g-hero h2 { font-size: 19px; }
  .dash-premium .g-clock-time { font-size: 30px; }
  .dash-premium .g-aside { grid-template-columns: minmax(0, 1fr); }
  .dash-premium .g-sess { grid-template-columns: auto auto minmax(0, 1fr); }
  .dash-premium .g-sess-arrow { display: none; }
  .dash-premium .g-donut { flex-direction: column; align-items: center; justify-content: center; }
  .dash-premium .g-donut-legend { min-width: 0; width: 100%; }
}
/* Mouvement réduit : survols et transitions du nouveau design neutralisés. */
@media (prefers-reduced-motion: reduce) {
  .dash-premium .g-hero, .dash-premium .g-tile, .dash-premium .g-sess,
  .dash-premium .g-act, .dash-premium .g-sess-arrow svg {
    transition: none !important; animation: none !important;
  }
  .dash-premium .g-tile:hover, .dash-premium .g-sess:hover { transform: none !important; }
}

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; letter-spacing: .1px; margin-bottom: 5px; color: #3b4a63; }
.field label .req { color: var(--danger); }
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=date], .field input[type=time], .field input[type=number], .field select, .field textarea,
.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff;
  outline: none; transition: border-color .16s ease, box-shadow .16s ease; font-size: 14.5px;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--ring);
}
.field textarea { min-height: 92px; resize: vertical; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field .err { font-size: 12.5px; color: var(--danger); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.checkbox-list { display: grid; gap: 8px; }
.check {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 9px; cursor: pointer; background: #fff; font-size: 14px;
}
.check:hover { border-color: var(--brand-3); }
.check input { accent-color: var(--brand-2); width: 16px; height: 16px; }
.check.sel { border-color: var(--brand-2); background: var(--brand-soft); font-weight: 600; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--card-line); border-radius: var(--radius); background: #fff; box-shadow: 0 1px 3px rgba(36, 87, 167, .05); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted);
  background: #f1f6fd; padding: 13px 14px; border-bottom: 1px solid var(--card-line); white-space: nowrap;
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f4f8ff; }
.table .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.table td.num, .table th.num { text-align: right; }
.empty {
  text-align: center; color: var(--muted); padding: 34px 18px; font-size: 14px;
}
.empty .big { font-size: 30px; display: block; margin-bottom: 6px; opacity: .6; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px;
  font-weight: 700; letter-spacing: .3px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: #c6ead1; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: #f3ddbe; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: #f5cccc; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: #cfddff; }
.badge.purple { background: var(--purple-soft); color: var(--purple); border-color: #ddd0fb; }
.badge.brand { background: var(--brand-soft); color: var(--brand); border-color: #c4d7f2; }

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff;
}
.auth-hero {
  background: linear-gradient(150deg, var(--brand) 0%, var(--brand-2) 55%, var(--brand-3) 130%);
  color: #fff; padding: 46px; display: flex; flex-direction: column; justify-content: center; gap: 18px;
  position: relative; overflow: hidden;
}
.auth-hero::after {
  content: ""; position: absolute; right: -80px; bottom: -80px; width: 320px; height: 320px;
  background: rgba(255,255,255,.07); border-radius: 50%;
}
/* Logo COMPLET (symbole + raison sociale) dans un badge blanc arrondi :
   l'image est affichée entière — aucun recadrage, aucune déformation. */
.auth-hero .hero-logo {
  display: inline-block; align-self: flex-start; max-width: 330px;
  background: #fff; border-radius: 18px; padding: 13px;
  box-shadow: 0 12px 32px rgba(6, 28, 60, .35);
}
.auth-hero .hero-logo img { display: block; width: 100%; height: auto; }
.auth-hero h1 { font-size: 31px; margin: 0; letter-spacing: .5px; }
.auth-hero .tagline { font-size: 15.5px; color: #cfe1f7; max-width: 460px; }
.auth-hero ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 9px; font-size: 14.5px; color: #e2edfb; }
.auth-hero li::before { content: "✓"; color: #6ee7b7; font-weight: 800; margin-right: 9px; }
.auth-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 36px 30px;
}
.auth-card { width: 100%; max-width: 430px; }
.auth-card h2 { margin: 0 0 4px; font-size: 23px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.auth-alt { margin-top: 18px; text-align: center; font-size: 14px; color: var(--muted); }
.role-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-card {
  border: 1.5px solid var(--line); border-radius: 11px; padding: 13px; cursor: pointer; text-align: center;
  font-weight: 600; font-size: 14px; background: #fff;
}
.role-card .rl-sub { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; margin-top: 3px; }
.role-card.sel { border-color: var(--brand-2); background: var(--brand-soft); color: var(--brand); }

.opt-check-groups { display: grid; gap: 13px; margin-top: 4px; }
.opt-check-cat {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .9px; font-weight: 800;
  color: var(--brand-2); margin-bottom: 6px;
}
/* §29 — Sélecteur d’options officielles : recherche par code ou intitulé,
   code en gras, intitulé secondaire, état sélectionné et compteur dynamique. */
.opt-search-wrap { position: relative; display: block; margin-top: 7px; }
.opt-search-wrap .ico {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.opt-search {
  width: 100%; padding: 10px 13px 10px 34px; font-size: 14px; color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 11px; background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.opt-search::placeholder { color: var(--muted); }
.opt-search:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(11, 79, 156, .14); }
.opt-code { font-weight: 800; color: var(--text); letter-spacing: .3px; }
.opt-name { color: var(--muted); font-weight: 400; font-size: 12.5px; overflow-wrap: anywhere; }
.check.sel .opt-code { color: var(--brand-deep); }
.check.sel .opt-name { color: var(--brand); }
.opt-empty {
  font-size: 13px; color: var(--muted); padding: 12px; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: 11px;
}
.code-input {
  font-size: 30px; letter-spacing: 12px; text-align: center; font-weight: 800; padding: 14px;
  border: 1.5px dashed var(--line-strong); border-radius: 11px; width: 100%;
}

/* ---------- Rooms ---------- */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 13px; }
.room {
  background: #fff; border: 1px solid var(--card-line); border-radius: var(--radius); padding: 15px; position: relative;
  box-shadow: var(--shadow);
}
.room:hover { transform: translateY(-3px); box-shadow: var(--shadow-float); }
/* Code de la salle : pastille en relief (même langage visuel que la connexion) */
.room .code {
  display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 13px;
  font-size: 15.5px; font-weight: 800; letter-spacing: .8px; color: var(--brand);
  border-radius: 11px; background: linear-gradient(145deg, #ffffff, #e7effb);
  box-shadow: 5px 5px 11px rgba(151, 166, 187, .34), -5px -5px 10px #ffffff, inset 1px 1px 1px #fff;
}
.room .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.room .state { margin-top: 10px; display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.room.free { border-left: 4px solid var(--ok); }
.room.busy { border-left: 4px solid var(--danger); }
.room.restricted { border-left: 4px solid var(--purple); background: #fbf9ff; }
.room .state .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.room .now { font-size: 12.5px; margin-top: 7px; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--muted); }
.room .actions { margin-top: 10px; display: flex; gap: 6px; }

/* ---------- Planning ---------- */
.planning-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--card-line); border-radius: var(--radius); box-shadow: var(--shadow); }
table.planning { border-collapse: collapse; width: 100%; min-width: 900px; font-size: 13px; }
table.planning th, table.planning td { border: 1px solid var(--line); }
table.planning thead th {
  background: var(--brand); color: #fff; padding: 9px 8px; font-size: 12.5px; text-align: center; position: sticky; top: 0;
}
table.planning thead th .d { display: block; font-size: 11px; opacity: .8; font-weight: 500; }
table.planning tbody th {
  background: var(--surface-2); padding: 6px 8px; font-size: 12px; color: var(--muted); text-align: right;
  white-space: nowrap; width: 62px; font-weight: 600;
}
table.planning td { height: 46px; vertical-align: top; padding: 3px; background: #fff; }
/* Case libre : cliquable pour y placer une séance */
table.planning td.free { cursor: pointer; }
table.planning td.free:hover { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand-2); }
table.planning td.free::after { content: '＋'; opacity: 0; color: var(--brand); font-size: 15px; }
table.planning td.free:hover::after { opacity: .55; }
table.planning td.closed { background: repeating-linear-gradient(45deg, #f6f7f9, #f6f7f9 6px, #eef1f5 6px, #eef1f5 12px); }
.slot {
  position: relative;
  border-radius: 7px; padding: 5px 7px; font-size: 11.5px; line-height: 1.3; cursor: pointer; height: 100%;
  border-left: 3px solid var(--brand-2); background: var(--brand-soft); color: #123; overflow: hidden;
}
/* Actions en un clic sur une séance : ✏️ modifier · 🗑 supprimer (au survol) */
.slot-quick {
  position: absolute; top: 3px; right: 3px; z-index: 3;
  display: none; gap: 4px;
}
.slot:hover .slot-quick { display: flex; }
.slot-quick .sq {
  border: 1px solid #cbd5e1; background: #fff; border-radius: 6px; cursor: pointer;
  font-size: 11px; line-height: 1; padding: 3px 5px;
  box-shadow: 0 1px 3px rgba(37, 50, 71, .18);
}
.slot-quick .sq:hover { background: var(--brand-soft); border-color: var(--brand-2); }
.slot-quick .sq-del:hover { background: #fee2e2; border-color: var(--danger); }
.slot b { display: block; font-size: 11.5px; }
.slot .m { color: #334155; }
.slot.other-option { background: #fdf1e0; border-left-color: var(--warn); }
.slot.mine { background: #e7f6ec; border-left-color: var(--ok); }
.slot.cancelled { opacity: .5; text-decoration: line-through; }
/* Couleurs par TYPE D'ACTIVITÉ : 🟦 cours (bleu) · 🟩 stage (vert)
   · 🟧 contrôle continu (orange). Ces règles viennent APRÈS .mine /
   .other-option : le type l'emporte sur la couleur d'appartenance. */
.slot.t-cours { background: #dbeafe; border-left-color: #2563eb; }
.slot.t-stage { background: #dcfce7; border-left-color: #16a34a; }
.slot.t-controle { background: #ffedd5; border-left-color: #ea580c; }
/* Même code couleur sur la feuille d'emploi imprimée. */
.pg-item.pg-cours { border-left: 3px solid #2563eb; padding-left: 5px; }
.pg-item.pg-stage { border-left: 3px solid #16a34a; padding-left: 5px; }
.pg-item.pg-controle { border-left: 3px solid #ea580c; padding-left: 5px; }
.planning-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.planning-legend .sw { display: inline-block; width: 13px; height: 13px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; }

/* ---------- Toasts / modal ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 9px; max-width: 380px; }
.toast {
  background: #111a26; color: #fff; padding: 12px 15px; border-radius: 10px; box-shadow: var(--shadow-lg);
  font-size: 14px; display: flex; gap: 10px; align-items: flex-start; animation: slideIn .22s ease;
}
.toast.ok { background: #14532d; }
.toast.err { background: #7f1d1d; }
.toast.warn { background: #78350f; }
.toast .t-close { cursor: pointer; opacity: .7; margin-left: auto; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0 } to { transform: none; opacity: 1 } }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 150; display: grid; place-items: center;
  padding: 18px; animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }  .modal {
    background: #fff; border: 1px solid var(--card-line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; animation: pop .18s ease;
  }
.modal.wide { max-width: 940px; }
@keyframes pop { from { transform: scale(.97); opacity: .6 } to { transform: none; opacity: 1 } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16.5px; }
.modal-head .x { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; }
.modal-body { padding: 20px; }
.modal-foot { padding: 15px 20px; border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-end; }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-bottom: 15px; }
.filters select, .filters input {
  padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; font-size: 14px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.filters select:focus, .filters input:focus {
  outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--ring);
}
.filters .lbl { font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- Onglets de catégories (page Utilisateurs) ---------- */
.role-tabs { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.role-tab {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--text);
  border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 700;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}
.role-tab:hover { border-color: var(--brand-2); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15, 42, 84, .08); }
.role-tab:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.role-tab.active {
  background: linear-gradient(135deg, var(--brand-2), var(--brand-deep));
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 16px rgba(18, 54, 107, .22);
}
.role-tab-n {
  font-size: 11px; font-weight: 800; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 7px; line-height: 17px;
}
.role-tab.active .role-tab-n { background: rgba(255, 255, 255, .22); border-color: transparent; color: #fff; }
@media (max-width: 640px) {
  .role-tabs { gap: 6px; }
  .role-tab { padding: 6px 11px; font-size: 12.5px; }
}

/* ---------- Notifications / list items ---------- */
.list { display: grid; gap: 9px; }
.item {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border: 1px solid var(--card-line);
  border-radius: 13px; background: #fff; box-shadow: 0 1px 3px rgba(36, 87, 167, .05);
}
.item.unread { background: var(--brand-soft); border-color: #c4d7f2; }
.item .i-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.item .i-main { flex: 1; min-width: 0; }
.item .i-main b { font-size: 14px; }
.item .i-main p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.item .i-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.timeline { display: grid; gap: 0; }
.tl-row { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.tl-row:last-child { border-bottom: 0; }
.tl-row .tl-time { color: var(--muted); font-size: 12px; white-space: nowrap; width: 128px; flex: none; }

/* ---------- Option picker ---------- */
.option-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.option-card {
  border: 1px solid var(--card-line); border-radius: var(--radius); padding: 22px 16px; text-align: center; cursor: pointer;
  background: #fff; box-shadow: var(--shadow);
}
.option-card:hover { transform: translateY(-4px); border-color: var(--brand-3); box-shadow: var(--shadow-float); }
/* Code de l'option : carré en relief — l'« icône » de la référence */
.option-card .oc-code {
  display: inline-flex; align-items: center; justify-content: center; min-width: 68px; min-height: 68px; padding: 0 12px;
  font-size: 24px; font-weight: 800; color: var(--brand); letter-spacing: 1.5px;
  border-radius: 22px; background: linear-gradient(145deg, #ffffff, #e7effb);
  box-shadow: 8px 8px 17px rgba(151, 166, 187, .36), -8px -8px 16px #ffffff, inset 1px 1px 2px #fff;
}
.option-card .oc-name { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

/* ---------- Bottom navigation (mobile) ---------- */
.bottom-nav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line);
  z-index: 60; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px;
  color: var(--muted); padding: 5px 2px; border-radius: 9px; cursor: pointer;
}
.bottom-nav a.active { color: var(--brand); font-weight: 700; background: var(--brand-soft); }
.bottom-nav a .ico { width: 19px; height: 19px; display: block; }
.bottom-nav a .ico svg { width: 19px; height: 19px; display: block; }
.mobile-head { display: none; }

/* ---------- Public room page ---------- */
.public-room { max-width: 860px; margin: 0 auto; padding: 26px 18px 60px; }
.public-room .pr-head {
  background: linear-gradient(140deg, var(--brand), var(--brand-2)); color: #fff; border-radius: 16px; padding: 24px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.public-room .pr-code { font-size: 34px; font-weight: 800; letter-spacing: 1px; }
.public-room .pr-state { font-size: 14px; font-weight: 700; padding: 5px 13px; border-radius: 999px; background: rgba(255,255,255,.18); }
.readonly-note { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 16px; }

/* ---------- Print header ---------- */
.print-sheet { background: #fff; padding: 0; }
.print-header { text-align: center; margin-bottom: 14px; }
.print-header .ph-line { font-size: 13.5px; font-weight: 700; letter-spacing: .4px; }
.print-header .ph-title { font-size: 20px; font-weight: 800; margin-top: 6px; letter-spacing: 1px; color: var(--brand); }
.print-header .ph-meta { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.signatures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 28px; }
.sig { text-align: center; font-size: 12px; }
.sig .sig-line { border-top: 1px dashed var(--line-strong); margin-top: 46px; padding-top: 6px; font-weight: 600; }
.print-only { display: none; }

/* ---------- Feuille d'emploi officielle (A4 paysage) ----------
   Informations administratives (filière / option / année) SANS cadre au-dessus
   du tableau ; tableau : [heure] [lundi…samedi] ; 4 blocs de signature alignés
   SOUS le tableau. Une séance de 2 h remplit la bande entière (rowSpan).   */
.pg-head { text-align: center; margin-bottom: 10px; }
.pg-hl { font-size: 12.5px; font-weight: 700; letter-spacing: .4px; line-height: 1.5; }
table.pg-grid { width: 100%; border-collapse: collapse; table-layout: fixed; border: 1px solid #333; }
table.pg-grid th, table.pg-grid td { border: 1px solid #333; }
/* Case sans séance : pas de « boîte vide » — seulement les lignes de séparation
   restent, les cellules habitées sont encadrées par leurs propres bordures. */
table.pg-grid td.pg-cell.empty { border-left: 0; border-right: 0; }
/* Infos administratives au-dessus du tableau : texte simple, sans cadre,
   sans bordure ni arrière-plan. */
.pg-admin { margin-top: 4px; text-align: center; font-size: 12px; font-weight: 600; }
/* Aucun cours pour le filtre choisi (semestre / semaine) : message explicite
   au-dessus du tableau, visible à l’écran comme à l’impression. */
.pg-empty {
  margin-top: 8px; padding: 7px 10px; text-align: center;
  font-size: 12px; font-weight: 600; color: #7a4b00;
  background: #fff7e6; border: 1px dashed #e0b26a; border-radius: 6px;
}
.pg-sig { margin-top: 0; }
.pg-sig-label { font-size: 11px; font-weight: 600; }
.pg-sig-name { font-size: 11.5px; font-weight: 700; min-height: 17px; padding-top: 2px; overflow-wrap: anywhere; }
/* Espace blanc sous l'intitulé : signature manuscrite + cachet éventuel. */
.pg-sig-space { height: 40px; border-bottom: 1px solid #333; margin-top: 4px; }
table.pg-grid th.pg-corner { border: 0; }
table.pg-grid th.pg-band { font-size: 13px; padding: 4px 2px; text-align: center; }
table.pg-grid th.pg-band .b { display: block; letter-spacing: 2px; font-weight: 800; }
table.pg-grid th.pg-band .s { display: block; font-size: 10px; font-weight: 500; letter-spacing: .3px; }
table.pg-grid th.pg-day { font-size: 11px; padding: 3px 2px; text-align: center; font-weight: 700; }
table.pg-grid th.pg-day .d { display: block; font-size: 10px; font-weight: 500; }
table.pg-grid tbody th.pg-time { width: 62px; font-size: 10px; text-align: center; font-weight: 600; line-height: 1.25; }
table.pg-grid th.pg-time .dash { display: block; }
table.pg-grid td.pg-cell {
  vertical-align: middle; text-align: center; font-size: 10.5px; padding: 5px 3px;
  /* Aucun débordement : le texte long se coupe DANS la cellule, jamais hors du cadre */
  overflow-wrap: anywhere; word-break: break-word; hyphens: auto; line-height: 1.3;
}
.pg-item, .pg-mod, .pg-tea, .pg-meta { max-width: 100%; }
table.pg-grid tbody th.pg-time { white-space: nowrap; }
table.pg-grid th.pg-day, table.pg-grid th.pg-band { overflow-wrap: anywhere; }
table.pg-grid td.pg-cell.closed { background: #efefef; }
.pg-item { border-bottom: 1px dotted #999; padding-bottom: 3px; margin-bottom: 4px; }
.pg-item:last-child { border-bottom: 0; margin-bottom: 0; }
.pg-mod { font-weight: 600; line-height: 1.3; }
.pg-tea { margin-top: 2px; }
.pg-meta { margin-top: 2px; font-size: 9px; color: #555; }
/* Trois blocs de signature alignés sur une seule ligne, sous le tableau
   (coordinateur d'option, responsable de filière, DAC — le Directeur de
   l'ISPITS n'a plus de bloc dans le modèle). */
.pg-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 8px; text-align: center; }
/* Fiche de réservation : deux espaces de signature côte à côte, avec les mêmes
   règles typographiques que la feuille imprimée (pg-sig*). */
.sig-pair { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; text-align: center; }
.pg-foot-cap { font-size: 11px; font-weight: 700; }
.pg-foot-txt { font-size: 10.5px; font-style: italic; margin-top: 4px; }
/* Note de bas de page : une seule ligne (légende + texte en ligne). */
.pg-foot-note { margin-top: 6px; text-align: center; }
.pg-foot-note .pg-foot-cap { display: inline; margin-right: 6px; }
.pg-foot-note .pg-foot-txt { display: inline; margin-top: 0; }
/* En-tête / pied de page officiels fournis par l’institut (images).
   Taille exacte : les images ne sont ni étirées ni réduites — largeur naturelle
   (752 px et 776 px = 199 mm et 205 mm sur A4 paysage), rapport conservé.    */
.pg-logo-head { margin-bottom: 4px; text-align: center; }
.pg-logo-head img, .pg-logo-foot img {
  display: inline-block; width: auto; max-width: 100%; height: auto;
  margin: 0 auto; object-fit: none;
}
.pg-title { font-size: 13px; font-weight: 800; letter-spacing: 1.6px; margin-top: 4px; }
.pg-logo-foot { margin-top: 12px; text-align: center; }

/* ---------- Pages officielles : une page par option / semestre / groupe ---------- */
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 15px; margin-top: 16px; }
.sheet-card { background: #fff; border: 1px solid var(--line-strong); border-radius: 14px; padding: 15px; display: flex; flex-direction: column; gap: 12px; }
.sheet-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.sheet-card-head b { font-size: 17px; letter-spacing: .5px; }
.sheet-card-head .m { font-size: 12px; color: var(--muted); }
.sheet-card-head .badge { font-size: 11.5px; background: var(--brand); color: #fff; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.sheet-card-body { display: flex; flex-direction: column; gap: 9px; }
.sheet-line { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.sheet-line .lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); min-width: 78px; }
.sheet-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 5px 9px; font-size: 12.5px; text-decoration: none; color: inherit; background: #f7f9fc; }
.sheet-chip:hover { border-color: var(--brand); color: var(--brand); }
.sheet-chip b { font-weight: 700; }
.sheet-chip span { font-size: 11px; color: var(--muted); }
.sheet-chip.empty { opacity: .55; }
.sheet-empty { font-size: 12.5px; color: var(--muted); font-style: italic; }
.sheet-card-foot { display: flex; gap: 8px; margin-top: auto; }

/* Plein écran : la feuille occupe seule l’écran */
body.sheet-full { background: #e9eff9; }
body.sheet-full .sidebar, body.sheet-full .topbar, body.sheet-full .bottom-nav,
body.sheet-full .mobile-head, body.sheet-full .page-head .actions,
body.sheet-full .app-foot, body.sheet-full .to-top-fab, body.sheet-full .nav-backdrop { display: none !important; }
body.sheet-full .main { margin-left: 0 !important; }
body.sheet-full .content { max-width: none; padding: 12px; }
body.sheet-full .print-sheet { background: #fff; border-radius: 12px; box-shadow: 0 6px 26px rgba(0, 0, 0, .12); padding: 18px; }
body.sheet-full .sheet-toolbar { position: sticky; top: 0; z-index: 4; background: #fff; padding: 8px 0; margin-bottom: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, .07); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .cols-2 { grid-template-columns: 1fr; }
  .cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .searchbox { min-width: 190px; }
}
@media (max-width: 1024px) {
  :root { --sidebar-w: 0px; }
  /* Tiroir coulissant : largeur adaptée à l'écran, jamais plus de 86 vw. */
  .sidebar {
    width: 282px; max-width: 86vw; height: 100%;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: none; box-shadow: 8px 0 28px rgba(8, 22, 42, .22); }
  .sb-close { display: grid; }
  /* Le rail compact est une fonction de bureau : sur mobile le bouton de
     réduction serait sans effet, on ne montre que la fermeture du tiroir. */
  .nav-compact-btn { display: none; }
  .main { margin-left: 0; padding-bottom: 68px; }
  .bottom-nav { display: flex; }
  /* Sur écran tactile : zone de cliquer confortable (≥ 44 px). */
  .nav-link { min-height: 44px; }
  .nav-group-head { margin: 10px 0 3px; padding: 8px; }
  /* Fond figé pendant l'ouverture du tiroir (le défilement revient à la fermeture). */
  body.nav-locked { overflow: hidden; }
  .content { padding: 16px 14px 24px; }
  .mobile-head { display: flex; align-items: center; gap: 10px; }
  .searchbox { display: none; }
  /* Barre supérieure épurée sur tablette/mobile : le libellé du compte est
     masqué (l'avatar et le menu restent cliquables, le nom est affiché dans
     la modale du compte) — évite tout débordement horizontal. */
  .user-chip .who { display: none; }
  /* Chip serré sur petit écran : même hauteur (40 px), moins de marge
     latérale — la barre reste exactement dans la largeur de l'écran. */
  .user-chip { padding: 4px 7px 4px 4px; gap: 6px; }
  .uc-caret { margin-left: 0; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}
@media (max-width: 768px) {
  .topbar { padding: 0 12px; gap: 8px; }
  /* Le titre tronque plutôt que de pousser la cloche et le compte hors écran. */
  .topbar h1 {
    font-size: 15.5px; min-width: 0; flex: 0 1 auto;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .presence, .user-chip .who { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat .v { font-size: 23px; }
  .page-head h2 { font-size: 18px; }
  .page-head .actions { width: 100%; margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .role-picker { grid-template-columns: 1fr; }
  .signatures { grid-template-columns: repeat(2, 1fr); }
  .modal { max-width: 100%; border-radius: 14px 14px 0 0; max-height: 94vh; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
}
@media (max-width: 560px) {
  .content { padding: 12px 11px 26px; }
  .card-head .actions { margin-left: 0; width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px; }
  .quick-actions { grid-template-columns: 1fr; }
  .room-grid { grid-template-columns: 1fr; }
  .auth-panel { padding: 22px 14px; }
  .btn { width: auto; }
  .filters select, .filters input { flex: 1; min-width: 130px; }
}

/* ==========================================================================
   NAVIGATION — barre principale publique, pied de page, retour en haut,
   voile du menu latéral mobile.
   ========================================================================== */

/* Coquille des pages publiques : nav en haut, contenu, pied de page */
.public-page {
  min-height: 100vh; display: flex; flex-direction: column; background: var(--bg);
}
.public-page .auth-wrap { flex: 1; min-height: 0; }

/* ---------- Barre de navigation principale (pages publiques) ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  /* Fond blanc PUR (aucune transparence ni flou), filet bleu clair et ombre
     très légère : effet flottant discret, cohérent avec la carte de connexion. */
  background: #fff;
  border-bottom: 1px solid #d7e5f9;
  box-shadow: 0 2px 10px rgba(11, 79, 156, .08);
}
.site-nav-inner {
  max-width: 1240px; margin: 0 auto; min-height: 62px;
  display: flex; align-items: center; gap: 14px; padding: 9px 18px;
}
.site-brand { display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; }
.site-brand:hover { text-decoration: none; }
.site-mark {
  width: 38px; height: 38px; border-radius: 10px; overflow: hidden; flex: none;
  background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800;
  box-shadow: 0 2px 6px rgba(11, 79, 156, .25);
}
/* Logo carré, image recadrée sans déformation, proportionnée à la barre (62 px). */
.site-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.site-brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.site-brand-text b { font-size: 14.5px; font-weight: 800; letter-spacing: .7px; color: var(--brand); }
.site-brand-text em { font-style: normal; font-size: 10px; letter-spacing: 1.5px; color: var(--muted); }
.site-links { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.site-link {
  display: inline-flex; align-items: center; min-height: 40px;
  padding: 9px 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
  /* Bleu nuit (palette : #253247) — contraste AA sur fond blanc. */
  color: var(--text);
  white-space: nowrap;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.site-link:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
/* Spécificité volontairement supérieure à la règle générale de focus (fin
   du fichier) : anneau bleu 2,5 px SANS altérer le rayon des liens au focus. */
.site-nav .site-link:focus-visible { outline: 2.5px solid rgba(11, 79, 156, .55); outline-offset: 2px; }
.site-link.active {
  background: var(--brand); color: #fff;
  box-shadow: 0 2px 7px rgba(11, 79, 156, .30);
}
.site-burger {
  display: none; margin-left: auto; width: 44px; height: 42px; border-radius: 11px;
  border: 1px solid #d7e5f9; background: #fff; color: var(--brand); font-size: 17px;
  cursor: pointer; place-items: center;
  transition: background .18s ease, border-color .18s ease;
}
.site-burger:hover { background: var(--brand-soft); border-color: var(--brand-2); }
.site-nav .site-burger:focus-visible { outline: 2.5px solid rgba(11, 79, 156, .55); outline-offset: 2px; }

/* ---------- Pied de page (pages publiques) ------------------------------
   Zone principale en colonnes (identité · navigation · ressources), puis une
   BARRE copyright séparée qui ne contient QUE la mention légale. */
.site-foot { margin-top: auto; background: #fff; border-top: 1px solid var(--line); }
.site-foot-main {
  max-width: 1240px; margin: 0 auto; padding: 34px 22px 30px;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 28px;
}
.sf-col { min-width: 0; }
/* Séparateurs discrets entre colonnes (ordinateur uniquement). */
.sf-col + .sf-col { border-left: 1px solid var(--line); padding-left: 28px; }
.sf-logo { display: block; width: 210px; max-width: 100%; height: auto; margin-bottom: 12px; }
.sf-desc { margin: 0 0 14px; font-size: 13.5px; line-height: 1.65; color: var(--muted); max-width: 44ch; }
.sf-title {
  margin: 0 0 14px; font-size: 13px; font-weight: 800; letter-spacing: .8px;
  text-transform: uppercase; color: var(--brand-deep);
}
.sf-title .sf-title-in { display: flex; align-items: center; gap: 8px; }
.sf-title .sf-title-in svg { color: var(--brand); flex: none; }
/* Petite ligne orange sous le titre (couleur du logo). */
.sf-title::after {
  content: ""; display: block; width: 32px; height: 3px; border-radius: 2px;
  background: var(--accent); margin-top: 8px;
}
.sf-links { display: grid; gap: 2px; }
.sf-links a {
  display: flex; align-items: center; min-height: 40px; padding: 7px 10px; margin-left: -10px;
  border-radius: 10px; font-size: 14px; color: var(--text);
  transition: background .16s ease, color .16s ease;
}
.sf-links a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.sf-links a:focus-visible { outline: 2.5px solid rgba(11, 79, 156, .55); outline-offset: 1px; }
/* Barre inférieure : UNIQUEMENT le copyright — fond bleu foncé, texte blanc,
   centré ; le texte se répartit naturellement sur deux lignes en mobile. */
.site-foot-bar {
  background: var(--brand-deep); color: #fff; text-align: center;
  padding: 15px 20px; font-size: 13px; font-weight: 600; letter-spacing: .3px; line-height: 1.7;
}
@media (max-width: 1024px) {
  .site-foot-main { grid-template-columns: 1fr 1fr; padding: 28px 18px 26px; gap: 24px; }
  .sf-col + .sf-col { border-left: 0; padding-left: 0; }
  .sf-col:nth-child(2) { border-left: 1px solid var(--line); padding-left: 24px; }
}
@media (max-width: 640px) {
  .site-foot-main { grid-template-columns: 1fr; padding: 24px 16px 22px; gap: 20px; }
  .sf-col:nth-child(2) { border-left: 0; padding-left: 0; }
  .sf-links a { min-height: 44px; }
  .site-foot-bar { padding: 13px 16px; font-size: 12.5px; }
}

/* ---------- Pied de page de l'espace connecté ---------- */
.app-foot {
  width: 100%; display: flex; flex-direction: column; gap: 12px;
  padding: 14px 0 0; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px;
}
.app-foot-top {
  max-width: 1440px; width: 100%; margin: 0 auto; padding: 0 22px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px;
}
.app-foot-links { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.app-foot a { color: var(--muted); }
.app-foot a:hover { color: var(--brand); }
.app-foot-sep { opacity: .5; }
/* Barre copyright de l'espace connecté : même traitement que le public —
   fond bleu foncé, texte blanc centré, uniquement la mention légale. */
.app-foot-copy {
  background: var(--brand-deep); color: #fff; text-align: center;
  padding: 13px 18px; font-size: 12.5px; font-weight: 600; letter-spacing: .3px; line-height: 1.7;
}

/* ---------- Mode compact : rail d'icônes + infobulles (grand écran) ----------
   Le rail ne s'active qu'à partir de 1025 px : sur mobile le menu reste un
   tiroir à libellés complets, ouvert par ☰ et fermé par le voile.
   Aucun centrage instantané : c'est le padding qui glisse (animé, 260 ms)
   pendant que le rail se resserre, donc aucune icône ne « saute ».
   Les en-têtes de catégorie disparaissent et TOUS les liens restent visibles
   (aucune rubrique perdue) : l'infobulle compense le libellé masqué. */
@media (min-width: 1025px) {
  .app-shell.nav-compact { --sidebar-w: 90px; }
  .app-shell.nav-compact .sidebar { width: 90px; }
  .app-shell.nav-compact.nav-hover-expanded { --sidebar-w: 340px; }
  .app-shell.nav-compact.nav-hover-expanded .sidebar { width: min(340px, calc(100vw - 24px)); max-width: calc(100vw - 24px); box-shadow: 10px 0 32px rgba(9, 27, 49, .28); }
  .app-shell.nav-compact.nav-hover-expanded .main { margin-left: min(340px, calc(100vw - 24px)); }

  .app-shell.nav-compact .sidebar-brand { flex-direction: column; gap: 9px; padding: 12px 8px 10px; }
  .app-shell.nav-compact .sidebar-brand .mark { width: 54px; height: 54px; }
  .app-shell.nav-compact .sb-id { display: none; }
  .app-shell.nav-compact .nav-compact-btn { display: none; margin-left: 0; }

  .app-shell.nav-compact .sb-search { display: none; }
  .app-shell.nav-compact .nav-group-head { display: none; }
  /* Les groupes restent montés : le rail montre toutes les icônes. */
  .app-shell.nav-compact .nav-group-body { display: grid !important; }
  .app-shell.nav-compact .nav-group { margin-top: 0; }
  .app-shell.nav-compact .sb-nav { padding: 10px 9px 14px; }
  .app-shell.nav-compact .nav-link { justify-content: center; gap: 0; padding: 10px 0; }
  .app-shell.nav-compact .nav-link .nl { max-width: 0; opacity: 0; }
  .app-shell.nav-compact .nav-link .pill { position: absolute; top: 3px; right: 8px; margin-left: 0; }
  .app-shell.nav-compact .sb-user { flex-direction: column; gap: 8px; padding: 12px 8px calc(14px + env(safe-area-inset-bottom)); }
  .app-shell.nav-compact .su-main { flex: none; justify-content: center; padding: 0; }
  .app-shell.nav-compact .su-who { display: none; }
  .app-shell.nav-compact .su-acts { flex-direction: column; gap: 6px; }
  .app-shell.nav-compact.nav-hover-expanded .sidebar-brand { flex-direction: row; gap: 11px; padding: 18px 16px; }
  .app-shell.nav-compact.nav-hover-expanded .sidebar-brand .mark { width: 54px; height: 54px; }
  .app-shell.nav-compact.nav-hover-expanded .sb-id { display: block; }
  .app-shell.nav-compact.nav-hover-expanded .nav-compact-btn { display: grid; margin-left: auto; }
  .app-shell.nav-compact.nav-hover-expanded .sb-search { display: flex; }
  .app-shell.nav-compact.nav-hover-expanded .nav-group-head { display: flex; }
  .app-shell.nav-compact.nav-hover-expanded .nav-link { justify-content: flex-start; gap: 11px; padding: 9px 10px; }
  .app-shell.nav-compact.nav-hover-expanded .nav-link .nl { max-width: 190px; opacity: 1; }
  .app-shell.nav-compact.nav-hover-expanded .nav-link .pill { position: static; margin-left: auto; }
  .app-shell.nav-compact.nav-hover-expanded .sb-user { flex-direction: row; gap: 9px; padding: 11px 12px calc(11px + env(safe-area-inset-bottom)); }
  .app-shell.nav-compact.nav-hover-expanded .su-main { flex: 1; justify-content: flex-start; padding: 4px; }
  .app-shell.nav-compact.nav-hover-expanded .su-who { display: flex; }
  .app-shell.nav-compact.nav-hover-expanded .su-acts { flex-direction: row; gap: 2px; }
  .app-shell.nav-compact.nav-hover-expanded .nav-link.active::before { left: -6px; }
  .app-shell.nav-compact.nav-hover-expanded .nav-group-body[hidden] { display: none !important; }
  .app-shell.nav-compact.nav-hover-expanded .sb-nav { padding: 8px 10px 16px; }
}

/* En desktop, le retrait du contenu suit la largeur réelle du rail : aucun
   recouvrement pendant l'ouverture automatique ou la réduction. */
@media (min-width: 1025px) {
  .app-shell.nav-compact .main { margin-left: var(--sidebar-w); }
}

/* ---------- Retour en haut ---------- */
.to-top-fab {
  position: fixed; right: 18px; bottom: 24px; z-index: 120;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: #fff; color: var(--brand); font-size: 19px; font-weight: 800; cursor: pointer;
  box-shadow: var(--shadow-lg); display: grid; place-items: center;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.to-top-fab:hover { background: var(--brand-soft); border-color: var(--brand-2); }
.to-top-fab.show { opacity: 1; visibility: visible; transform: none; }
.to-top-inline { flex: none; }

/* ---------- Voile du menu latéral (petits écrans) ---------- */
.nav-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 35;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s ease, visibility .2s;
}
.nav-backdrop.show { opacity: 1; visibility: visible; pointer-events: auto; }

/* ---------- Responsive : navigation ---------- */
/* Tablette : espacements réduits progressivement, liens toujours sur une
   même ligne (débordement impossible : la barre se resserre avant 900 px). */
@media (max-width: 1180px) {
  .site-nav-inner { gap: 10px; padding: 9px 14px; }
  .site-links { gap: 2px; }
  .site-link { padding: 9px 11px; font-size: 13.5px; }
  .site-brand-text b { font-size: 13.5px; }
}
@media (max-width: 900px) {
  .site-burger { display: grid; }
  .site-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: #fff; border-bottom: 1px solid #d7e5f9;
    box-shadow: 0 12px 26px rgba(36, 87, 180, .12);
    padding: 8px 10px 12px; margin-left: 0;
  }
  .site-links.open { display: flex; }
  .site-link { padding: 12px 14px; font-size: 15px; min-height: 46px; }
}
@media (min-width: 901px) {
  .nav-backdrop { display: none; }
}
@media (max-width: 1024px) {
  /* Le menu latéral passe au-dessus de la barre d'onglets basse : aucun
     élément du menu (dont « Déconnexion ») n'est masqué. */
  .sidebar { z-index: 70; }
  .sb-user { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .to-top-fab { bottom: 78px; right: 14px; }
  .app-foot-top { padding: 0 14px; }
}
@media (max-width: 560px) {
  .site-mark { width: 34px; height: 34px; border-radius: 9px; }
  .site-brand-text b { font-size: 13px; }
  .site-brand-text em { font-size: 9.5px; letter-spacing: 1.2px; }
  .site-nav-inner { padding: 8px 12px; min-height: 56px; }
  .app-foot-top { flex-direction: column; align-items: flex-start; }
}

/* ---------- Impression (A4 paysage) ---------- */
@page { size: A4 landscape; margin: 10mm; }
@media print {
  body { background: #fff; font-size: 11.5px; }
  /* La feuille tient sur une seule page A4 paysage : légère réduction d'échelle
     (en-tête + tableau + signatures + pied de page officiels ≈ 750 px à 800 px
     selon la densité de la semaine > 718 px utiles). Le facteur est appliqué à
     la mise en page, donc la pagination voit la hauteur réduite — aucun
     débordement sur une deuxième page. */
  .print-sheet { zoom: 0.92; }
  .sidebar, .topbar, .bottom-nav, .no-print, .toasts, .filters, .page-head .actions, .mobile-head,
  .site-nav, .site-foot, .app-foot, .to-top-fab, .nav-backdrop { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  .content { padding: 0 !important; max-width: none; }
  .print-only { display: block !important; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .table-wrap { border: 0; overflow: visible; }
  table.planning { min-width: 0; width: 100%; table-layout: fixed; font-size: 10.5px; }
  table.planning td { height: 34px; word-break: break-word; overflow-wrap: anywhere; }
  table.planning td.free::after { content: none !important; }
  table.planning tbody th { width: 62px; }
  .planning-wrap { overflow: visible !important; border: 0; border-radius: 0; box-shadow: none !important; }
  .slot { border: 1px solid #999; background: #f2f5fa !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .signatures { page-break-inside: avoid; }
  .print-header { page-break-after: avoid; }
  /* L'en-tête se répète sur chaque page et aucune ligne n'est coupée en deux :
     c'est ce qui évite le décalage et le chevauchement de cellules à l'impression. */
  table.planning thead { display: table-header-group; }
  table.planning tfoot { display: table-footer-group; }
  table { page-break-inside: auto; }
  tr { page-break-inside: avoid; }
  /* Feuille officielle : traits fins, pas de couleur d'écran, cellule de gauche intacte */
  table.pg-grid { table-layout: fixed; width: 100%; font-size: 10.5px; }
  table.pg-grid th, table.pg-grid td { border: 0.6pt solid #000; padding: 3px 2px; }
  table.pg-grid { border-color: #000; }
  table.pg-grid td.pg-cell.empty { border-left: 0; border-right: 0; }
  /* Cellules compactes à l'impression : mêmes informations (module, enseignant,
     salle), interlignes et marges réduits pour que la feuille (en-tête + tableau
     + 4 signatures + pied de page) tienne sur une seule page A4 paysage même
     lorsque plusieurs séances se superposent dans la semaine. */
  table.pg-grid td.pg-cell { height: 30px; font-size: 10px; line-height: 1.22; padding: 2px; }
  .pg-item { padding-bottom: 2px; margin-bottom: 2px; }
  .pg-tea { margin-top: 1px; }
  .pg-meta { margin-top: 1px; font-size: 8.5px; }
  table.pg-grid th.pg-corner { border: 0; }
  .pg-hl { font-size: 11px; line-height: 1.35; }
  .pg-admin { font-size: 11px; page-break-inside: avoid; break-inside: avoid; }
  .pg-empty { background: #fff; color: #000; border: 0.6pt dashed #000; page-break-inside: avoid; break-inside: avoid; }
  .pg-foot { page-break-inside: avoid; }
  /* Les images officielles doivent garder leurs couleurs et ne jamais être
     coupées en deux entre deux pages. */
  .pg-logo-head, .pg-logo-foot, .pg-title { page-break-inside: avoid; break-inside: avoid; }
  .pg-logo-head img, .pg-logo-foot img {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
    /* Taille exacte du fichier, sans mise à l’échelle */
    width: auto; max-width: 100%; height: auto; object-fit: none;
  }
  .pg-logo-foot { margin-top: 4px; }
}

/* =====================================================================
   §3–§4 — APPEL DE PRÉSENCE
   Bandeau d'état : fenêtre du créneau (heure serveur), verrou après
   clôture, liste administrative obligatoire.
   ===================================================================== */
.callout {
  border: 1px solid #cbd5e1; border-left: 4px solid var(--brand-2);
  background: #f6faff; border-radius: 12px; padding: 11px 13px;
  margin: 10px 0; display: grid; gap: 4px;
}
.callout.ok { border-left-color: var(--ok); background: var(--ok-soft); }
.callout.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.callout.danger { border-left-color: var(--danger); background: var(--danger-soft); }
.slot-quick .sq-call { background: var(--brand-soft); border-color: var(--brand-2); }

/* §2 — classement administratif : actions de réordonnancement alignées */
.rank-actions { display: flex; gap: 4px; align-items: center; }
.tbl-scroll { overflow-x: auto; }

/* §10 — état nominatif paginé (impression A4) */
.etat-grid { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.etat-grid th, .etat-grid td { border: 1px solid #94a3b8; padding: 5px 7px; text-align: left; overflow-wrap: break-word; }
/* Huit colonnes Massar/absences/retards : identité et convocation gardent
   une largeur lisible, les valeurs numériques restent centrées à l'écran et
   sur la feuille imprimée. */
.etat-grid th:nth-child(1), .etat-grid td:nth-child(1) { width: 14%; }
.etat-grid th:nth-child(2), .etat-grid td:nth-child(2) { width: 20%; }
.etat-grid th:nth-child(3), .etat-grid td:nth-child(3) { width: 7%; text-align: center; }
.etat-grid th:nth-child(4), .etat-grid td:nth-child(4) { width: 12%; text-align: center; }
.etat-grid th:nth-child(5), .etat-grid td:nth-child(5) { width: 8%; text-align: center; }
.etat-grid th:nth-child(6), .etat-grid td:nth-child(6) { width: 11%; text-align: center; }
.etat-grid th:nth-child(7), .etat-grid td:nth-child(7) { width: 12%; text-align: center; }
.etat-grid th:nth-child(8), .etat-grid td:nth-child(8) { width: 16%; text-align: center; }
.etat-grid th { background: var(--brand-soft); font-weight: 700; }
.etat-grid tr { page-break-inside: avoid; break-inside: avoid; }
@media print {
  .etat-thead { display: table-header-group; }
  .no-print { display: none !important; }
}

/* ==========================================================================
   NEUMORPHISM / SOFT UI — écrans d'authentification (accueil, connexion,
   création de compte, mot de passe oublié, compte en attente).
   · fond gris très clair + cercles décoratifs en relief 3D
   · cartes blanches légèrement grisées, coins arrondis, ombres douces
   · champs de saisie creusés (inset), bleu en couleur d'action
   · transitions fluides et discrètes, responsive, accessibles
   Thème BORNÉ aux écrans .auth-wrap : aucun autre écran, aucune règle
   d'accès, aucun composant métier ne sont modifiés.
   ========================================================================== */
:root {
  --neu-bg: #e8ecf3;
  --neu-card: #eef1f7;
  --neu-ink: #1b2735;
  --neu-dark: rgba(151, 166, 187, .55);
  --neu-light: rgba(255, 255, 255, .95);
  --neu-inset-dark: rgba(150, 164, 185, .45);
  --neu-blue: #0B4F9C;
  --neu-blue-light: #1A6FC4;
}

/* ---------- Fond gris très clair + cercles en relief 3D ---------- */
.auth-wrap {
  position: relative;
  overflow: hidden;
  background: var(--neu-bg);
  /* Sur fond gris, le gris secondaire par défaut tombait sous 4.5:1 :
     sur TOUS les écrans d'auth, les textes secondaires sont plus foncés. */
  --muted: #55637a;
  --line: #d8dfe9;
  --line-strong: #c9d2e0;
}
.auth-wrap::before, .auth-wrap::after {
  content: ""; position: absolute; border-radius: 50%; z-index: 0;
  background: var(--neu-bg); pointer-events: none;
  box-shadow: 16px 16px 34px var(--neu-dark), -14px -14px 30px var(--neu-light);
}
.auth-wrap::before { width: 340px; height: 340px; top: -110px; left: -95px; }
.auth-wrap::after { width: 260px; height: 260px; bottom: -85px; right: -70px; }
.auth-hero, .auth-panel { position: relative; z-index: 1; }
.auth-hero > * { position: relative; z-index: 1; }

/* ---------- Panneau de présentation : même thème clair (contenu inchangé) -- */
.auth-hero { background: transparent; color: var(--neu-ink); }
.auth-hero::after {
  background: var(--neu-bg); opacity: 1; z-index: 0;
  box-shadow: 18px 18px 38px var(--neu-dark), -16px -16px 34px var(--neu-light);
}
/* Badge du logo COMPLET : sur fond clair, élévation douce (thème neumorphique)
   et filet bleu fin — l'image reste nette et parfaitement lisible. */
.auth-hero .hero-logo {
  background: var(--neu-card);
  border: 1px solid rgba(11, 79, 156, .12);
  box-shadow: 9px 9px 20px var(--neu-dark), -7px -7px 16px var(--neu-light);
}
.auth-hero h1 { color: var(--brand); }
.auth-hero .tagline { color: #4b5a6e; }
.auth-hero ul { color: #3d4c60; }
.auth-hero li::before { color: var(--neu-blue); }

/* ---------- Carte : blanc légèrement grisé, arrondie, ombres douces ------- */
.auth-card {
  background: var(--neu-card);
  border: 0;
  border-radius: 22px;
  padding: 30px 30px 26px;
  box-shadow: 13px 13px 30px var(--neu-dark), -11px -11px 26px var(--neu-light);
}
.auth-card h2 { color: var(--neu-ink); letter-spacing: .2px; }
/* Boîte d'information imbriquée (compte en attente / refusé / suspendu). */
.auth-card .card {
  background: #f3f6fb; border-color: transparent;
  box-shadow: inset 2px 2px 6px rgba(150, 164, 185, .3), inset -2px -2px 6px rgba(255, 255, 255, .9);
}

/* ---------- Marque institutionnelle en tête de carte ---------- */
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.auth-brand-mark {
  width: 46px; height: 46px; border-radius: 14px; overflow: hidden; flex: none;
  background: #f3f6fb; color: var(--brand); display: grid; place-items: center;
  font-size: 21px; font-weight: 800;
  box-shadow: 6px 6px 15px var(--neu-dark), -6px -6px 13px var(--neu-light);
}
.auth-brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.auth-brand-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.auth-brand-txt b { font-size: 16.5px; color: var(--neu-ink); letter-spacing: .3px; }
.auth-brand-txt span {
  font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}

/* ---------- Champs de saisie creusés (effet « rentré ») ---------- */
.auth-card .field input[type=text], .auth-card .field input[type=email],
.auth-card .field input[type=password], .auth-card .field input[type=date],
.auth-card .field input[type=time], .auth-card .field input[type=number],
.auth-card .field select, .auth-card .field textarea, .auth-card .input {
  background: #e6eaf2;
  color: var(--neu-ink);
  border: 1px solid transparent;
  border-radius: 12px;
  box-shadow: inset 4px 4px 9px var(--neu-inset-dark), inset -4px -4px 9px rgba(255, 255, 255, .92);
  transition: box-shadow .18s ease, background .18s ease;
}
.auth-card .field input::placeholder, .auth-card .field textarea::placeholder { color: #7e8b9f; }
.auth-card .field input:focus, .auth-card .field select:focus,
.auth-card .field textarea:focus, .auth-card .input:focus {
  background: #eaeff6;
  border-color: transparent;
  outline: none;
  /* Anneau bleu bien visible au clavier (contraste > 3:1 sur le fond creusé). */
  box-shadow: inset 3px 3px 7px var(--neu-inset-dark), inset -3px -3px 7px rgba(255, 255, 255, .92),
    0 0 0 2.5px rgba(36, 87, 167, .5);
}

/* ---------- Afficher / masquer le mot de passe ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; border-radius: 10px; padding: 0;
  background: transparent; color: var(--muted); cursor: pointer;
  display: grid; place-items: center; font-size: 15px; line-height: 1;
  transition: background .15s ease, color .15s ease;
}
.pw-eye:hover { background: rgba(36, 87, 167, .12); color: var(--neu-blue); }

/* ---------- Boutons bleus : action principale en relief ---------- */
.auth-card .btn {
  background: linear-gradient(145deg, var(--neu-blue-light), var(--neu-blue));
  border: 0; border-radius: 14px; padding: 12px 18px; font-size: 15px;
  box-shadow: 8px 8px 18px var(--neu-dark), -6px -6px 14px var(--neu-light);
  transition: box-shadow .18s ease, transform .18s ease, filter .18s ease;
}
.auth-card .btn:hover {
  filter: none; text-decoration: none;
  box-shadow: 10px 10px 22px var(--neu-dark), -7px -7px 16px var(--neu-light);
}
.auth-card .btn:active {
  transform: translateY(1px);
  box-shadow: inset 5px 5px 11px rgba(11, 44, 84, .45), inset -3px -3px 8px rgba(255, 255, 255, .22);
}
.auth-card .btn.secondary {
  background: var(--neu-card); color: var(--neu-ink); border: 1px solid transparent;
}
.auth-card .btn.secondary:hover { background: #f2f5fa; }
.auth-card .btn.secondary:active {
  box-shadow: inset 4px 4px 9px var(--neu-inset-dark), inset -3px -3px 7px rgba(255, 255, 255, .9);
}
.auth-card .form-actions { display: flex; gap: 10px; }
.auth-card .form-actions .btn { flex: 1 1 auto; }

/* ---------- Ligne « Se souvenir de moi » + « Mot de passe oublié » -------- */
.auth-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-top: 13px;
}
.auth-row .check-plain {
  background: var(--neu-card); border-color: transparent; font-size: 13.5px;
  padding: 8px 12px; border-radius: 11px;
  box-shadow: inset 2px 2px 6px rgba(150, 164, 185, .38), inset -2px -2px 6px rgba(255, 255, 255, .88);
}
.auth-inline-link { font-size: 13.5px; font-weight: 700; color: var(--neu-blue); }
.auth-inline-link:hover { text-decoration: underline; }

/* ---------- Cases à cocher et cartes de rôle : actif en bleu ---------- */
.auth-card .check {
  background: var(--neu-card); border-color: transparent; color: var(--neu-ink);
  box-shadow: inset 2px 2px 5px rgba(150, 164, 185, .32), inset -2px -2px 5px rgba(255, 255, 255, .85);
  transition: box-shadow .16s ease, background .16s ease, color .16s ease;
}
.auth-card .check.sel {
  background: #e3edfb; color: var(--brand); font-weight: 600;
  box-shadow: inset 3px 3px 7px rgba(36, 87, 167, .18), inset -3px -3px 7px rgba(255, 255, 255, .92),
    0 0 0 1.5px rgba(36, 87, 167, .38);
}
.auth-card .role-card {
  background: var(--neu-card); border: 1px solid transparent;
  box-shadow: 6px 6px 14px var(--neu-dark), -5px -5px 12px var(--neu-light);
  transition: box-shadow .18s ease, color .18s ease, border-color .18s ease;
}
.auth-card .role-card:hover { border-color: rgba(36, 87, 167, .35); color: var(--brand); }
.auth-card .role-card.sel {
  background: linear-gradient(145deg, #eef4fc, #e1ecfa);
  color: var(--brand); border-color: rgba(36, 87, 167, .45);
  box-shadow: inset 4px 4px 9px rgba(36, 87, 167, .16), inset -4px -4px 9px rgba(255, 255, 255, .92);
}

/* ---------- Message d'erreur clair sous le formulaire ---------- */
.auth-card form > .err:not(:empty) {
  margin-top: 13px; padding: 10px 13px; border-radius: 12px;
  background: var(--danger-soft); color: var(--danger);
  border: 1px solid #f3c9c9; font-size: 13.5px; font-weight: 600;
  box-shadow: inset 2px 2px 5px rgba(185, 28, 28, .10), inset -2px -2px 5px rgba(255, 255, 255, .8);
}

/* ---------- Accessibilité clavier : anneau de focus visible ---------- */
.auth-wrap a:focus-visible, .auth-wrap button:focus-visible {
  outline: 2px solid var(--neu-blue); outline-offset: 2px; border-radius: 8px;
}
.auth-wrap input[type=checkbox]:focus-visible, .auth-wrap input[type=radio]:focus-visible {
  outline: 2px solid var(--neu-blue); outline-offset: 2px;
}

/* ---------- Mouvement réduit (accessibilité) ---------- */
@media (prefers-reduced-motion: reduce) {
  .auth-wrap *, .auth-wrap *::before, .auth-wrap *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Responsive du thème (cercles + cartes) ---------- */
@media (max-width: 1024px) {
  /* Le panneau de présentation est masqué par la règle existante ci-dessus :
     la carte seule porte la marque, sur le fond gris et ses cercles. */
  .auth-wrap::before { width: 250px; height: 250px; top: -95px; left: -85px; }
  .auth-wrap::after { width: 190px; height: 190px; bottom: -70px; right: -60px; }
}
@media (max-width: 560px) {
  .auth-card { padding: 24px 18px 20px; border-radius: 18px; }
  .auth-brand-mark { width: 42px; height: 42px; }
  .auth-card .btn { padding: 11px 15px; }
  .auth-row { justify-content: flex-start; }
}

/* ==========================================================================
   HARMONISATION PREMIUM — finitions communes
   Accessibilité (focus clavier, mouvement réduit), barres de défilement
   discrètes et transitions d'interface. Aucune règle existante n'est
   supprimée : ces ajouts complètent le design system ci-dessus.
   ========================================================================== */

/* Focus clavier visible sur TOUS les éléments interactifs */
a:focus-visible, button:focus-visible, .btn:focus-visible, .icon-btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible, .nav-link:focus-visible, .site-link:focus-visible {
  outline: 2px solid var(--brand-2); outline-offset: 2px; border-radius: 6px;
}

/* Barres de défilement fines et discrètes */
* { scrollbar-width: thin; scrollbar-color: #c3cddd transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #c3cddd; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: #a9b7cc; background-clip: padding-box; }

/* Transitions d'interface : rapides et discrètes (aucun effet de charge) */
.card, .stat, .item, .room, .quick, .option-card, .badge, .check, .role-card, .nav-link {
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease,
    background .18s ease, color .18s ease;
}

/* Mouvement réduit (accessibilité) — l'application reste entièrement lisible */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Section « Éléments constitutifs » du formulaire module ----------
   Lignes dynamiques (intitulé · volume · enseignant · retirer),
   en-tête discret, total en direct. Responsive : empilées sous 760 px. */
.el-section { margin-top: 4px; }
.el-rows { display: grid; gap: 8px; }
.el-head, .el-row {
  display: grid;
  grid-template-columns: 2fr 0.9fr 1.6fr 40px;
  gap: 8px;
  align-items: center;
}
.el-head {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 0 2px;
}
.el-row .input { width: 100%; min-width: 0; }
.el-row .btn { justify-self: end; }
@media (max-width: 760px) {
  .el-head { display: none; }
  .el-row { grid-template-columns: 1fr; }
  .el-row .btn { justify-self: start; }
}

/* ---------- Rubrique Absences : barre à trois boutons (sous le titre) ----------
   Un seul accès « Absences » dans le menu ouvre la vérification ; ces boutons
   mènent aux trois pages existantes avec l'état actif mis en évidence. */
.abs-nav {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 14px;
}
.abs-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); font-size: 13.5px; font-weight: 600;
  box-shadow: 0 1px 2px rgba(18, 54, 107, .05);
  transition: background .15s ease, border-color .15s ease, color .15s ease,
    box-shadow .15s ease, transform .15s ease;
}
.abs-tab .ico { color: var(--brand); }
.abs-tab:hover {
  text-decoration: none; border-color: var(--brand-3);
  background: var(--brand-soft); transform: translateY(-1px);
}
.abs-tab.active {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 4px 10px rgba(11, 79, 156, .25);
}
.abs-tab.active .ico { color: #fff; }
@media (max-width: 600px) {
  .abs-tab { flex: 1 1 auto; justify-content: center; }
}

/* Utilitaire placé EN FIN de fichier : doit primer sur les règles de position
   contextuelles (ex. .auth-hero > *) pour rester réellement invisible. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   REFONTE PREMIUM — pages publiques (accueil · connexion · création de
   compte · mot de passe oublié · page d'attente)
   · palette institutionnelle : #0866D9 · #073B91 · #EAF4FF · #F5F8FC ·
     #102347 · #64748B (orange du logo en accent, vert = état positif,
     rouge = erreur)
   · panneau de présentation bleu à gauche (~62 %), carte blanche à droite
     (~38 %), coins 24-30 px, ombres douces, bordures fines
   · animations discrètes uniquement (entrée en fondu, survol, focus),
     neutralisées par les préférences « mouvement réduit » déjà en place
   Ce bloc est placé EN FIN de fichier : il prime sur le thème neumorphique
   précédent, sans modifier une seule règle hors des pages publiques.
   ========================================================================== */
:root {
  /* Palette officielle des pages publiques (fournie par l'établissement). */
  --pp-blue: #0756D9;
  --pp-deep: #073B91;
  --pp-night: #08285F;
  --pp-light: #EAF2FF;
  --pp-bg: #F4F7FC;
  --pp-ink: #08285F;
  --pp-mute: #5A6B85;
  --pp-orange: #FFB323;
  --pp-green: #10B981;
}

/* ---------- Coquille : fond gris bleuté, hauteur réellement disponible --- */
.public-page { background: var(--pp-bg); }
.auth-wrap {
  /* 1.68fr / 1fr ≈ 62.7 % / 37.3 %, borné à 900 px pour rester lisible. */
  grid-template-columns: minmax(0, 1.68fr) minmax(0, 1fr);
  min-height: 0;
  background: var(--pp-bg);
  --muted: var(--pp-mute);
  --line: #dde7f4;
}
/* Cercles neumorphiques de l'ancien thème : retirés de cet écran. */
.auth-wrap::before, .auth-wrap::after { content: none; box-shadow: none; }

/* ---------- Panneau gauche : dégradé bleu premium ----------------------- */
.auth-hero {
  display: flex; flex-direction: column; justify-content: center;
  gap: 14px; padding: 34px 50px; overflow: hidden;
  color: #fff;
  background:
    radial-gradient(760px 460px at 8% 4%, rgba(255, 255, 255, .18), transparent 62%),
    radial-gradient(680px 520px at 92% 96%, rgba(8, 102, 217, .65), transparent 66%),
    linear-gradient(150deg, var(--pp-deep) 0%, #0A4CB2 52%, var(--pp-blue) 100%);
}
.auth-hero::after { content: none; }
.auth-hero > * { animation: pp-in .5s ease both; }
.auth-hero > *:nth-child(2) { animation-delay: .06s; }
.auth-hero > *:nth-child(3) { animation-delay: .12s; }
.auth-hero > *:nth-child(4) { animation-delay: .18s; }
@keyframes pp-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Logo officiel dans un cadre blanc élégant (jamais redessiné). */
.auth-hero .hero-logo {
  background: #fff; border: 0; border-radius: 22px; padding: 11px;
  max-width: 158px; align-self: flex-start;
  box-shadow: 0 20px 44px rgba(3, 17, 44, .38);
}
.auth-hero .hero-title {
  margin: 4px 0 0; color: #fff; letter-spacing: -.6px; line-height: 1.14;
  font-size: clamp(30px, 3vw, 42px); font-weight: 800; max-width: 17ch;
}
.auth-hero .hero-em { color: var(--pp-orange); }
.auth-hero .tagline {
  margin: 0; max-width: 54ch; font-size: 16px; line-height: 1.62; color: #d7e7ff;
}

/* Quatre avantages : icône sur fond coloré discret, titre gras, description. */
.auth-hero .hero-points {
  list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 13px;
  color: inherit; max-width: 54ch;
}
.auth-hero .hero-points li { display: flex; align-items: center; gap: 13px; }
.auth-hero .hero-points li::before { content: none; }
.hp-ico {
  flex: none; width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 8px 18px -8px rgba(3, 17, 44, .75);
}
.hp-blue { background: linear-gradient(140deg, #2f8bf0, #0b57c4); }
.hp-orange { background: linear-gradient(140deg, #ffc94d, #e09600); }
.hp-green { background: linear-gradient(140deg, #45d197, #0e9c6c); }
.hp-purple { background: linear-gradient(140deg, #9a7bf5, #6b46d6); }
.hp-txt { display: grid; gap: 2px; min-width: 0; }
.hp-txt b { font-size: 14.5px; font-weight: 700; color: #fff; }
.hp-txt span { font-size: 13.5px; line-height: 1.45; color: #cfe1fb; }

/* Illustration : carte de planning purement décorative (aucune donnée). */
.hero-illu { width: min(420px, 100%); margin-top: 6px; }
.hl-card {
  background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 18px; padding: 13px 14px 15px;
  box-shadow: 0 18px 34px -22px rgba(3, 17, 44, .9);
}
.hl-top { display: flex; align-items: center; gap: 6px; margin-bottom: 11px; }
.hl-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .5); }
.hl-bar { flex: 1; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .26); }
.hl-heads {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .4px; color: #cfe1fb; margin-bottom: 7px;
}
.hl-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.hl-col { display: grid; gap: 6px; align-content: start; }
.hl-cell { height: 17px; border-radius: 6px; background: rgba(255, 255, 255, .14); }
.hl-cell.b { background: linear-gradient(135deg, #63adff, #2f7fe6); }
.hl-cell.o { background: linear-gradient(135deg, #ffbc6d, #f58220); }
.hl-cell.g { background: linear-gradient(135deg, #6bdfa6, #17a05e); }

/* ---------- Panneau droit : carte blanche premium ----------------------- */
.auth-panel { padding: 28px 32px; gap: 16px; background: var(--pp-bg); }
.auth-card {
  max-width: 440px; background: #fff; border: 1px solid #e6edf8;
  border-radius: 26px; padding: 32px 32px 28px;
  box-shadow: 0 26px 60px -34px rgba(9, 40, 92, .55), 0 2px 8px rgba(9, 40, 92, .05);
  animation: pp-in .45s ease both;
}
.auth-card h2 {
  margin: 0 0 5px; font-size: clamp(22px, 2.2vw, 27px); color: var(--pp-ink);
  text-align: center; letter-spacing: -.3px;
}
.auth-card .sub { text-align: center; font-size: 14.5px; color: var(--pp-mute); margin-bottom: 22px; }
.auth-card .auth-brand { justify-content: center; margin-bottom: 14px; }
.auth-card .auth-brand-mark {
  background: var(--pp-light); box-shadow: 0 4px 12px -6px rgba(9, 40, 92, .45);
  border: 1px solid #d7e6fa;
}
.auth-card .auth-brand-txt b { color: var(--pp-ink); font-size: 17px; }
.auth-card .auth-brand-txt span { color: var(--pp-mute); }

/* Champs : blanc, bordure fine, anneau bleu au focus. */
.auth-card .field input[type=text], .auth-card .field input[type=email],
.auth-card .field input[type=password], .auth-card .field input[type=date],
.auth-card .field input[type=time], .auth-card .field input[type=number],
.auth-card .field select, .auth-card .field textarea, .auth-card .input {
  background: #fff; color: var(--pp-ink); border: 1.5px solid #dde6f3;
  border-radius: 13px; box-shadow: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.auth-card .field input::placeholder, .auth-card .field textarea::placeholder { color: #93a3bd; }
.auth-card .field input:focus, .auth-card .field select:focus,
.auth-card .field textarea:focus, .auth-card .input:focus {
  background: #fff; border-color: var(--pp-blue); outline: none;
  box-shadow: 0 0 0 4px rgba(8, 102, 217, .15);
}
.auth-card .field label { color: var(--pp-ink); font-size: 13.5px; font-weight: 700; }
.auth-card .field .help { color: var(--pp-mute); }

/* Icône de tête (enveloppe, cadenas) : positionnée dans le champ. */
.input-ico { position: relative; display: block; }
.input-ico > .ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--pp-mute); pointer-events: none;
}
.input-ico > input, .input-ico > .pw-wrap { width: 100%; }
.input-ico input, .input-ico .pw-wrap input { padding-left: 42px; }
.input-ico .pw-wrap input { padding-right: 46px; }

/* Boutons : dégradé bleu discret, état de chargement, désactivé explicite. */
.auth-card .btn {
  background: linear-gradient(135deg, #2f8bf0 0%, var(--pp-blue) 55%, #073B91 100%);
  color: #fff; border: 0; border-radius: 14px; padding: 13px 18px;
  font-size: 15px; font-weight: 700; letter-spacing: .1px;
  box-shadow: 0 14px 26px -14px rgba(8, 102, 217, .85);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, opacity .18s ease;
}
.auth-card .btn:hover {
  filter: none; text-decoration: none; transform: translateY(-1px);
  box-shadow: 0 18px 30px -14px rgba(8, 102, 217, .9);
}
.auth-card .btn:active { transform: translateY(0); box-shadow: 0 8px 16px -12px rgba(8, 102, 217, .8); }
.auth-card .btn:disabled { opacity: .78; cursor: not-allowed; transform: none; }
.auth-card .btn.secondary {
  background: #fff; color: var(--pp-blue); border: 1.5px solid #cfe0f6;
  box-shadow: 0 6px 16px -12px rgba(9, 40, 92, .5);
}
.auth-card .btn.secondary:hover { background: var(--pp-light); border-color: #a9cbf3; }
.auth-card .btn.secondary:active { box-shadow: none; }
.auth-card .form-actions .btn { min-height: 48px; }

/* Séparateur « ou » + seconde action. */
.auth-or {
  display: flex; align-items: center; gap: 12px; margin: 18px 0 14px;
  color: var(--pp-mute); font-size: 13px; font-weight: 600; text-transform: lowercase;
}
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: #e3eaf5; }
.auth-create { justify-content: center; }
.auth-back {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; color: var(--pp-blue); font-weight: 700; font-size: 14px;
}
.auth-back:hover { text-decoration: underline; }

/* Ligne « Se souvenir de moi » + lien « Mot de passe oublié ? ». */
.auth-row .check-plain {
  background: var(--pp-light); border: 1px solid #d7e6fa; color: var(--pp-ink);
  box-shadow: none; min-height: 40px;
}
.auth-inline-link { color: var(--pp-blue); font-weight: 700; }
.auth-card .check { background: var(--pp-light); border: 1px solid #d7e6fa; box-shadow: none; }
.auth-card .check.sel { background: #dcebff; border-color: var(--pp-blue); }
.auth-card .role-card { background: #fff; border: 1.5px solid #dde6f3; box-shadow: none; }
.auth-card .role-card:hover { border-color: #a9cbf3; }
.auth-card .role-card.sel { background: var(--pp-light); border-color: var(--pp-blue); box-shadow: none; }
.auth-card form > .err:not(:empty) {
  background: var(--danger-soft); border: 1px solid #f3c9c9; color: var(--danger);
  box-shadow: none; border-radius: 12px;
}
.auth-alt { color: var(--pp-mute); }
.auth-alt a { color: var(--pp-blue); }

/* Page d'attente / refus : pastille d'état en tête de carte. */
.pend-ico {
  width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 20px;
  display: grid; place-items: center; color: var(--pp-blue);
  background: var(--pp-light); border: 1px solid #d7e6fa;
  box-shadow: 0 10px 22px -14px rgba(8, 102, 217, .7);
}
.pend-ico.is-refused { color: var(--danger); background: var(--danger-soft); border-color: #f3c9c9; }

/* ---------- Navigation publique : icônes + page active en bleu ---------- */
.site-link { gap: 7px; }
.site-link .ico { flex: none; opacity: .9; }
.site-brand-hl { color: var(--pp-orange); }

/* ---------- Pied de page institutionnel (bleu profond) ------------------ */
.site-foot { background: linear-gradient(180deg, #073B91 0%, #062C6D 100%); border-top: 0; }
.site-foot-main { color: #dbe8fb; }
.sf-col + .sf-col { border-left-color: rgba(255, 255, 255, .14); }
.sf-title { color: #bcd4f8; }
.sf-title .sf-title-in svg { color: #7fb6ff; }
.sf-desc { color: #a9c4ec; }
.sf-links a { color: #e7effc; }
.sf-links a:hover { background: rgba(255, 255, 255, .10); color: #fff; }
.sf-links a:focus-visible { outline-color: #9cc6ff; }
@media (max-width: 1024px) {
  .site-foot-main .sf-col:nth-child(2) { border-left-color: rgba(255, 255, 255, .14); }
}
@media (max-width: 640px) {
  .site-foot-main .sf-col:nth-child(2) { border-left: 0; }
}

/* Barre copyright : identité officielle · mention légale · 4 repères. */
.site-foot-bar {
  background: #041F52; padding: 0; font-weight: 500; letter-spacing: 0; text-align: left;
}
.sfb-inner {
  max-width: 1240px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
}
.sfb-official {
  height: 36px; width: auto; background: #fff; border-radius: 9px; padding: 3px 8px;
  box-shadow: 0 6px 16px -10px rgba(0, 0, 0, .8); flex: none;
}
.sfb-copy { display: grid; gap: 2px; font-size: 13px; font-weight: 700; color: #fff; text-align: center; }
.sfb-dev { font-size: 12px; font-weight: 500; color: #a9c8f2; }
.sfb-icons { list-style: none; margin: 0; padding: 0; display: flex; gap: 16px; flex-wrap: wrap; }
.sfb-icon { display: grid; justify-items: center; gap: 4px; font-size: 11px; color: #b9d1f5; }
.sfb-ico {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .20);
}
.sfb-icon:hover .sfb-ico { background: rgba(255, 255, 255, .22); }

/* ---------- Tablette : panneaux réduits, toujours côte à côte ------------ */
@media (max-width: 1180px) {
  .auth-wrap { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  /* Reprend la main sur la règle historique « panneau masqué sous 1024 px » :
     les deux panneaux restent côte à côte jusqu'à 900 px. */
  .auth-hero { display: flex; padding: 36px 34px; gap: 14px; }
  .auth-hero .hero-title { font-size: clamp(27px, 2.7vw, 34px); }
  .auth-hero .tagline { font-size: 15px; }
  .hero-illu { width: min(360px, 100%); }
  .auth-panel { padding: 24px 22px; }
  .auth-card { padding: 28px 26px 24px; border-radius: 24px; }
}
/* Sous 900 px : un seul colonne, panneau de présentation en bannière. */
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: minmax(0, 1fr); }
  .auth-hero {
    display: flex; flex-direction: row; align-items: center; flex-wrap: wrap;
    gap: 14px 18px; padding: 20px 20px; min-height: 0;
  }
  .auth-hero .hero-logo { max-width: 92px; padding: 7px; border-radius: 16px; align-self: center; }
  .auth-hero .hero-title { font-size: clamp(21px, 5vw, 26px); max-width: none; margin: 0; flex: 1 1 240px; }
  .auth-hero .tagline, .auth-hero .hero-points, .hero-illu { display: none; }
  .auth-panel { padding: 26px 18px; }
}
/* ---------- Téléphone : carte centrée, cibles tactiles ------------------- */
@media (max-width: 560px) {
  .auth-hero { padding: 16px 15px; gap: 10px 14px; }
  .auth-hero .hero-logo { max-width: 74px; padding: 5px; border-radius: 13px; }
  .auth-hero .hero-title { font-size: 19px; flex-basis: 180px; letter-spacing: -.3px; }
  .auth-panel { padding: 20px 14px 26px; }
  .auth-card { padding: 24px 18px 22px; border-radius: 20px; }
  .auth-card h2 { font-size: 21px; }
  .auth-brand-mark { width: 42px; height: 42px; }
  .auth-card .btn { padding: 13px 15px; min-height: 48px; }
  /* Zone de clic tactile confortable pour l'œil du mot de passe. */
  .pw-eye { width: 44px; height: 44px; right: 2px; }
  .auth-row { justify-content: flex-start; }
  .auth-row .check-plain, .auth-inline-link { min-height: 44px; display: inline-flex; align-items: center; }
  .sfb-inner { justify-content: center; text-align: center; padding: 14px 16px; gap: 12px; }
  .sfb-official { width: min(330px, 100%); height: auto; }
  .sfb-icons { justify-content: center; gap: 14px; }
  .sfb-icon { font-size: 10.5px; }
}
/* ---------- Petits écrans bas de gamme : pas de surcharge ---------------- */
@media (max-width: 380px) {
  .auth-card { padding: 20px 14px 18px; }
  .auth-card h2 { font-size: 19px; }
  .sfb-icon span:last-child { display: none; }
}
/* ---------- Écrans peu hauts : l'illustration cède la place -------------- */
@media (max-height: 960px) and (min-width: 901px) {
  .hero-illu { display: none; }
}

/* ---------- Module « Gestion des examens » ----------
   Complète le design system existant (aucune couleur nouvelle en dur hors
   alertes de conflit) : mêmes cartes, mêmes coins arrondis, mêmes espacements. */
.exam-conflict-box {
  border: 1px solid #fecaca; background: #fff5f5; color: #991b1b;
  border-radius: 12px; padding: 10px 12px; margin-top: 10px; font-size: 13px;
}
.exam-conflict-box ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.exam-conflict-box li.blocking { font-weight: 700; }
.exam-detail-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 10px;
}
.exam-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 10px; }
.exam-detail-grid > div { display: flex; flex-direction: column; gap: 2px; }
.exam-detail-grid .help { margin: 0; }
.eligible-list { margin-top: 10px; max-height: 46vh; overflow: auto; padding-right: 2px; }
.eligible-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px; }
.eligible-grid .eligible-item {
  border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; background: #fff;
  align-items: flex-start; gap: 8px;
}
.row-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.row-actions .btn.sm { padding: 5px 7px; }
.exam-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.exam-student-card .card-head { padding-bottom: 8px; }
@media (max-width: 640px) {
  .exam-detail-grid { grid-template-columns: 1fr 1fr; }
  .exam-cards { grid-template-columns: 1fr; }
}

/* ==========================================================================
   PAGES PUBLIQUES — REFONTE INSTITUTIONNELLE
   Photographie réelle de la façade ISPITS Laâyoune, accueil institutionnel,
   pied de page officiel. Aucune règle de cette section ne sort des pages
   publiques (.public-page / .auth-hero / .site-*) : l'espace connecté reste
   strictement intact.
   ========================================================================== */

/* ---------- Panneau bleu : photographie réelle de la façade -------------- */
.hero-photo { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.hero-photo img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: 58% 56%;
  /* La photo apparaît sur la moitié droite du panneau et se fond dans le bleu
     sous le texte : aucune bande, aucun recadrage visible, aucune déformation. */
  opacity: .62;
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .40) 32%, #000 82%);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .40) 32%, #000 82%);
}
/* Voile bleu dégradé : garantit la lisibilité du titre et des textes. */
.hero-photo::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(620px 420px at 0% 0%, rgba(7, 59, 145, .55), transparent 68%),
    linear-gradient(102deg, rgba(7, 59, 145, .96) 0%, rgba(7, 59, 145, .80) 40%, rgba(8, 40, 95, .34) 100%);
}
.auth-hero { position: relative; }
.hero-body {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
}

/* ---------- Accueil institutionnel -------------------------------------- */
.home-hero {
  position: relative; flex: 1; display: flex; align-items: center; overflow: hidden;
  color: #fff;
  background:
    radial-gradient(760px 460px at 6% 2%, rgba(255, 255, 255, .16), transparent 62%),
    linear-gradient(150deg, var(--pp-deep) 0%, #0A4CB2 52%, var(--pp-blue) 100%);
}
.home-hero .hero-photo img { object-position: 62% 58%; opacity: .55; }
.home-inner {
  position: relative; z-index: 1; width: 100%; max-width: 1240px; margin: 0 auto;
  padding: 46px 26px; display: grid; align-items: center; gap: 34px 44px;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.home-copy { display: flex; flex-direction: column; gap: 13px; min-width: 0; }
.home-hero .hero-logo {
  background: #fff; border-radius: 22px; padding: 11px; max-width: 158px;
  align-self: flex-start; box-shadow: 0 20px 44px rgba(3, 17, 44, .38);
}
.home-hero .hero-logo img { display: block; width: 100%; height: auto; }
.home-title {
  margin: 6px 0 0; color: #fff; font-weight: 800; letter-spacing: -.6px; line-height: 1.1;
  font-size: clamp(25px, 3vw, 38px);
}
.home-lead {
  margin: 0; color: #fff; font-weight: 800; letter-spacing: -.4px; line-height: 1.22;
  font-size: clamp(20px, 2.4vw, 30px);
}
.home-hero .tagline { margin: 0; max-width: 56ch; font-size: 15.5px; line-height: 1.62; color: #d9e8ff; }
.home-hero .hero-em { color: var(--pp-orange); }
.home-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.home-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 50px; padding: 12px 24px; border-radius: 14px;
  background: #fff; color: var(--pp-blue); font-size: 15px; font-weight: 800;
  box-shadow: 0 18px 30px -18px rgba(0, 0, 0, .85);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.home-btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 22px 34px -18px rgba(0, 0, 0, .9); }
.home-btn:active { transform: translateY(0); }
.home-btn.alt {
  background: rgba(255, 255, 255, .12); color: #fff;
  border: 1.5px solid rgba(255, 255, 255, .55); box-shadow: none;
}
.home-btn.alt:hover { background: rgba(255, 255, 255, .20); }
@media (prefers-reduced-motion: reduce) {
  .home-btn { transition: none; }
  .home-btn:hover { transform: none; }
}

/* Quatre fonctionnalités : cartes translucides sur le dégradé bleu. */
.home-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.home-features {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.home-feature {
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
  padding: 15px 15px 16px; border-radius: 18px;
  background: rgba(255, 255, 255, .11); border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 18px 32px -24px rgba(3, 17, 44, .95);
}
.home-feature b { font-size: 14.5px; font-weight: 700; color: #fff; }
.home-feature > span:last-child { font-size: 13px; line-height: 1.5; color: #d7e7ff; }
.home-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.home-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 999px;
  background: rgba(255, 255, 255, .93); color: var(--pp-deep);
  font-size: 12.5px; font-weight: 700;
  box-shadow: 0 12px 24px -16px rgba(3, 17, 44, .9);
}

/* ---------- Navigation publique : bleu officiel -------------------------- */
.site-brand-text b { color: var(--pp-blue); }
.site-nav .site-link:hover { background: var(--pp-light); color: var(--pp-blue); }
.site-nav .site-link.active {
  background: var(--pp-blue); color: #fff;
  box-shadow: 0 8px 16px -10px rgba(7, 86, 217, .95);
}
.site-nav .site-link.active:hover { background: var(--pp-deep); color: #fff; }

/* Note de validation du formulaire d'inscription (sous le sous-titre). */
.reg-note {
  margin: -10px 0 20px; text-align: center; font-size: 12.5px; line-height: 1.55;
  color: var(--pp-deep); background: var(--pp-light); border: 1px solid #d7e6fa;
  border-radius: 12px; padding: 9px 12px;
}

/* ---------- Pied de page officiel : emblème · mention · 4 repères -------- */
.site-foot-bar { background: linear-gradient(180deg, var(--pp-deep) 0%, var(--pp-night) 100%); }
.sfb-inner {
  max-width: 1240px; margin: 0 auto; padding: 14px 20px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: 12px 22px;
}
.sfb-inst { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sfb-emblem {
  height: 58px; width: auto; max-width: 140px; flex: none;
  object-fit: contain;               /* jamais déformé */
  background: #fff; border-radius: 8px; padding: 3px 6px;
  box-shadow: 0 6px 16px -10px rgba(0, 0, 0, .8);
}
.sfb-inst-txt { display: grid; gap: 1px; min-width: 0; line-height: 1.4; }
.sfb-inst-txt b { color: #fff; font-size: 12.5px; font-weight: 700; }
.sfb-inst-txt span { color: #c7dcf8; font-size: 11.5px; }
.sfb-copy { text-align: center; }
.sfb-icons { justify-self: end; }

@media (max-width: 1024px) {
  .home-inner { grid-template-columns: minmax(0, 1fr); gap: 26px; padding: 34px 22px; }
  .home-side { gap: 10px; }
}
@media (max-width: 900px) {
  .hero-photo img {
    opacity: .34; object-position: 62% 42%;
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000 62%);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000 62%);
  }
  .hero-body { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px 14px; flex: 1; }
  .sfb-inner { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: 12px; }
  .sfb-inst { text-align: left; }
}
@media (max-width: 640px) {
  /* Cibles tactiles confortables (≥ 44 px) sur téléphone. */
  .auth-card .field input[type=text], .auth-card .field input[type=email],
  .auth-card .field input[type=password], .auth-card .field input[type=date],
  .auth-card .field input[type=time], .auth-card .field input[type=number],
  .auth-card .field select { min-height: 44px; }
  .home-inner { padding: 26px 16px 32px; gap: 22px; }
  .home-hero .hero-logo { max-width: 108px; padding: 8px; border-radius: 16px; }
  .home-features { grid-template-columns: minmax(0, 1fr); }
  .home-cta { flex-direction: column; }
  .home-btn { width: 100%; }
  .home-chips { justify-content: center; }
  .sfb-inst { flex-direction: column; text-align: center; gap: 8px; }
  .sfb-icons { justify-self: center; }
}

/* ---------- Pages « Aide » et « Contact » (contenu réel, aucune invention) -- */
.auth-card.info-card { max-width: 520px; }
.help-list { display: grid; gap: 10px; }
.help-item {
  background: var(--pp-light); border: 1px solid #d7e6fa;
  border-radius: 14px; padding: 11px 13px;
}
.help-item b { display: block; color: var(--pp-ink); font-size: 13.5px; font-weight: 700; }
.help-item p { margin: 3px 0 0; color: var(--pp-mute); font-size: 13px; line-height: 1.55; }
.contact-official {
  background: #fff; border: 1px solid #e6edf8; border-radius: 14px; padding: 10px;
}
.contact-official img { display: block; width: 100%; height: auto; object-fit: contain; }

/* ==========================================================================
   REFONTE PREMIUM — barre supérieure flottante + pied de page ondulé
   Pages publiques : Accueil · Connexion · Créer un compte · Mot de passe
   oublié (et toute la coquille publique partagée, pour rester uniforme).
   · STRUCTURE HTML INCHANGÉE : siteNav() et siteFoot() demeurent les SEULS
     composants partagés — aucune duplication par page, aucun lien ajouté.
   · Aucune donnée, route, autorisation ni fonctionnalité n'est touchée.
   ========================================================================== */

/* Hauteur réellement occupée par la barre : la pilule vient se poser PAR-
   DESSUS le panneau bleu (photo de façade, hero) dont le padding interne est
   compensé plus bas — la position du contenu reste donc identique, seul le
   fond de la page remonte derrière la barre. */
:root { --nav-h: 92px; }

/* ---------- Barre supérieure : pilule blanche flottante (glassmorphism) --- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  /* Conteneur TRANSPARENT : seule la pilule est peinte, détachée des bords
     de l'écran par des marges régulières. */
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 14px clamp(12px, 2.2vw, 26px);
}
.site-nav-inner {
  position: relative;                    /* ancrage du panneau mobile */
  max-width: 1240px; margin: 0 auto; min-height: 60px;
  display: flex; align-items: center; gap: 16px;
  padding: 8px 12px 8px 14px;
  background: rgba(255, 255, 255, .84);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(147, 197, 253, .55);   /* filet bleu clair très fin */
  border-radius: 30px;                          /* coins fortement arrondis */
  box-shadow:
    0 18px 38px -16px rgba(8, 40, 95, .38),     /* profondeur 3D */
    0 2px 8px rgba(8, 40, 95, .08),
    inset 0 1px 0 rgba(255, 255, 255, .9);      /* reflet supérieur */
}
/* Identité : logo réel net · SMART bleu · SALLE orange · sous-titre bleu foncé */
.site-brand { gap: 11px; }
.site-mark {
  width: 40px; height: 40px; border-radius: 13px;
  box-shadow: 0 4px 12px rgba(7, 86, 217, .28);
}
.site-brand-text b { font-size: 15px; letter-spacing: .8px; color: var(--pp-blue); }
/* Spécificité portée à (0,2,0) : « SALLE » reste orange malgré la règle
   générique `.site-brand-text b` plus bas. */
.site-brand-text .site-brand-hl { color: var(--pp-orange); }
.site-brand-text em { color: var(--pp-deep); font-weight: 700; letter-spacing: 1.6px; }

/* Liens : texte bleu foncé, icônes bleues, espacement généreux. */
.site-links { gap: 4px; }
.site-link {
  gap: 8px; padding: 9px 15px; border-radius: 14px;
  font-size: 14px; font-weight: 600; color: var(--pp-ink);
}
.site-link .ico { color: var(--pp-blue); opacity: 1; }
.site-nav .site-link:hover { background: rgba(7, 86, 217, .08); color: var(--pp-blue); }
.site-nav .site-link:hover .ico { color: var(--pp-blue); }
.site-nav .site-link:hover, .site-nav .site-link.active:hover { text-decoration: none; }
/* Page active : bouton bleu vif, texte et icône blancs, ombre bleue. */
.site-nav .site-link.active {
  background: linear-gradient(135deg, var(--pp-blue) 0%, #0A63E8 55%, #0750C8 100%);
  color: #fff;
  box-shadow:
    0 10px 20px -10px rgba(7, 86, 217, .9),    /* ombre bleue, effet de profondeur */
    inset 0 1px 0 rgba(255, 255, 255, .28);
}
.site-nav .site-link.active .ico { color: #fff; }
.site-nav .site-link.active:hover {
  background: linear-gradient(135deg, var(--pp-deep) 0%, var(--pp-blue) 100%);
  color: #fff;
  box-shadow: 0 12px 22px -10px rgba(7, 86, 217, .95), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.site-nav .site-link.active:hover .ico { color: #fff; }
/* Bouton burger : même langage visuel que la pilule. */
.site-burger {
  border-radius: 14px; border-color: rgba(147, 197, 253, .55);
  background: #fff; color: var(--pp-blue);
  box-shadow: 0 6px 14px -8px rgba(8, 40, 95, .45);
}

/* ---------- Recouvrement : le contenu reste à sa place exacte ------------- */
.home-hero, .auth-wrap { margin-top: calc(-1 * var(--nav-h)); }
.home-hero { padding-top: var(--nav-h); }
.auth-hero { padding-top: calc(34px + var(--nav-h)); }
.auth-panel { padding-top: calc(28px + var(--nav-h)); }
@media (max-width: 1180px) {
  .auth-hero { padding-top: calc(36px + var(--nav-h)); }
  .auth-panel { padding-top: calc(24px + var(--nav-h)); }
}
@media (max-width: 900px) {
  .auth-hero { padding-top: calc(20px + var(--nav-h)); }
  .auth-panel { padding-top: calc(26px + var(--nav-h)); }
}
@media (max-width: 560px) {
  .auth-hero { padding-top: calc(16px + var(--nav-h)); }
  .auth-panel { padding-top: calc(20px + var(--nav-h)); }
}

/* ---------- Pied de page : bande bleu profond à bord supérieur ondulé ----- */
.site-foot {
  position: relative;
  background: linear-gradient(168deg, #0A3EA1 0%, var(--pp-deep) 40%, var(--pp-night) 100%);
  border-top: 0;
  box-shadow: inset 0 16px 30px -22px rgba(3, 17, 44, .95);  /* effet de profondeur */
}
/* Forme supérieure légèrement ondulée (SVG en CSS) : la vague rejoint la
   couleur des pages publiques ; un filet clair suit la vague, sans jamais
   recouvrir de contenu (padding de la barre ≥ profondeur de la vague). */
.site-foot::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 26' preserveAspectRatio='none'%3E%3Cpath d='M0 0H1440V13C1260 4 1080 22 900 15C720 8 540 24 360 16C240 10 120 7 0 13Z' fill='%23F4F7FC'/%3E%3Cpath d='M0 13C120 7 240 10 360 16C540 24 720 8 900 15C1080 22 1260 4 1440 13' fill='none' stroke='%2396C8FF' stroke-opacity='.45' stroke-width='2.4'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
}
/* Zone principale (autres pages publiques) : conservée telle quelle. */
.site-foot-main { color: #dbe8fb; padding-top: 38px; }
/* Barre : fond transparent — tout le pied partage le même dégradé. */
.site-foot-bar { background: transparent; padding: 0; text-align: left; }
.sfb-inner {
  max-width: 1240px; margin: 0 auto;
  padding: 34px 24px 30px;                 /* ≥ profondeur de l'ondulation */
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: 16px 26px;
}
.sfb-inst { gap: 14px; }
.sfb-emblem {
  height: 62px; width: auto; max-width: 150px; flex: none;
  object-fit: contain;                /* jamais déformé */
  /* AUCUN cadre blanc : l'emblème détouré (PNG transparent) se pose
     directement sur la bande bleue, avec une ombre douce qui suit la
     silhouette (drop-shadow) et non le rectangle. */
  background: transparent; border: 0; padding: 0; border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 4px 10px rgba(3, 17, 44, .55));
}
.sfb-inst-txt b { color: #fff; font-size: 13px; font-weight: 700; }
.sfb-inst-txt span { color: #d7e7ff; font-size: 12px; }
.sfb-copy { color: #fff; font-size: 13.5px; font-weight: 700; text-align: center; gap: 3px; }
.sfb-dev { color: #b9d3f7; font-size: 12.5px; font-weight: 500; }
/* Quatre repères : icône blanche dans une pastille bleue lumineuse. */
.sfb-icons { gap: 18px; justify-self: end; }
.sfb-icon { color: #e2edff; font-size: 11.5px; font-weight: 600; gap: 6px; letter-spacing: .2px; }
.sfb-ico {
  width: 36px; height: 36px; border-radius: 12px;
  background: linear-gradient(140deg, #3E92F0 0%, var(--pp-blue) 58%, #0647B4 100%);
  border: 1px solid rgba(255, 255, 255, .30);
  box-shadow:
    0 8px 18px -8px rgba(7, 86, 217, .95),
    0 0 14px rgba(62, 146, 240, .35),
    inset 0 1px 0 rgba(255, 255, 255, .35);
  color: #fff;
}
.sfb-icon:hover { color: #fff; }
.sfb-icon:hover .sfb-ico {
  background: linear-gradient(140deg, #54A2F6 0%, var(--pp-blue) 60%, #0A55C9 100%);
  box-shadow:
    0 10px 22px -8px rgba(7, 86, 217, 1),
    0 0 18px rgba(62, 146, 240, .5),
    inset 0 1px 0 rgba(255, 255, 255, .45);
}

/* ---------- Responsive de la refonte -------------------------------------- */
/* Tablette : espacements resserrés, proportions conservées. */
@media (max-width: 1180px) {
  .site-nav-inner { gap: 10px; padding: 8px 10px; }
  .site-links { gap: 2px; }
  .site-link { padding: 8px 11px; font-size: 13.5px; }
  .site-brand-text b { font-size: 14px; }
  .sfb-inner { padding: 32px 18px 26px; gap: 14px 20px; }
  .sfb-icons { gap: 14px; }
}
/* Téléphone : menu compact en panneau déroulant arrondi sous la pilule. */
@media (max-width: 900px) {
  .site-links {
    top: calc(100% + 10px); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: rgba(255, 255, 255, .97);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(147, 197, 253, .55);
    border-radius: 22px;
    box-shadow: 0 22px 44px -18px rgba(8, 40, 95, .45);
    padding: 10px;
    margin-left: 0;
  }
  .site-link { padding: 12px 14px; font-size: 15px; min-height: 46px; gap: 10px; border-radius: 14px; }
}
@media (max-width: 560px) {
  .site-nav { padding: 10px clamp(10px, 3vw, 16px); }
  .site-nav-inner { min-height: 56px; border-radius: 26px; padding: 6px 8px 6px 10px; }
  .site-mark { width: 34px; height: 34px; border-radius: 11px; }
  .site-brand-text b { font-size: 13px; }
  .site-brand-text em { font-size: 9.5px; letter-spacing: 1.2px; }
}
/* Téléphone : pied de page empilé — institution, signature centrée, puis les
   quatre repères sur une grille de deux colonnes (aucun débordement). */
@media (max-width: 640px) {
  .sfb-inner {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center; text-align: center;
    padding: 30px 16px 26px; gap: 14px;
  }
  .sfb-inst { flex-direction: column; text-align: center; gap: 8px; }
  .sfb-copy { text-align: center; }
  .sfb-icons {
    justify-self: center;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px; width: 100%; max-width: 300px;
  }
}

/* ==========================================================================
   REFONTE — photographie de la façade en FOND INTÉGRAL des pages publiques
   (accueil · connexion · création de compte · mot de passe oublié ·
   Contact · Aide).
   · heroPhoto() est monté UNE fois dans publicShell : la photo couvre toute
     la page (fixe), derrière la barre flottante, les cartes et le pied.
   · L'ancien fond fractionné disparaît : plus de panneau bleu opaque à
     gauche, plus de zone blanche indépendante à droite, plus de séparation
     verticale — la photographie est le fond COMMUN.
   · Aucune route, autorisation, validation ni donnée n'est touchée.
   ========================================================================== */

/* ---------- Photographie commune : plein écran, jamais déformée ---------- */
.public-page > .hero-photo {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}
.public-page > .hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;                  /* aucun étirement, aucune répétition */
  object-position: 50% 58%;           /* façade, entrée et bandeau conservés */
  opacity: 1;
  -webkit-mask-image: none; mask-image: none;
}
/* Voile bleu TRANSLUCIDE : lisibilité du texte blanc à gauche et sous la
   barre — la photographie reste visible, naturelle et lumineuse ailleurs. */
.public-page > .hero-photo::after {
  background:
    linear-gradient(101deg, rgba(7, 45, 110, .80) 0%, rgba(8, 52, 128, .55) 36%,
      rgba(8, 40, 95, .20) 64%, rgba(8, 40, 95, .10) 100%),
    linear-gradient(180deg, rgba(8, 40, 95, .30) 0%, rgba(8, 40, 95, 0) 26%);
}

/* Tous les blocs de contenu passent AU-DESSUS de la photo fixe (la barre
   flottante conserve déjà son position sticky + z-index 50). */
.public-page > *:not(.site-nav):not(.hero-photo) { position: relative; z-index: 1; }

/* ---------- Pages d'authentification : cartes vitrées sur la photo ------- */
.auth-wrap { background: transparent; }
/* Le panneau gauche n'est plus un aplat bleu : contenu en surimpression. */
.auth-hero { background: transparent; color: #fff; text-shadow: 0 1px 3px rgba(3, 17, 44, .40); }
.auth-hero::after { content: none; }
.auth-hero .hero-title, .auth-hero .tagline {
  text-shadow: 0 1px 4px rgba(3, 17, 44, .45);
}
.auth-hero .hero-logo {
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 20px 44px rgba(3, 17, 44, .38);
}
/* La zone droite n'est plus une dalle blanche : la photo continue derrière. */
.auth-panel { background: transparent; }
/* Carte de connexion : blanc TRANSLUCIDE + glassmorphism léger, ombre
   élégante — lisible sans devenir un grand panneau blanc opaque. */
.auth-card {
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .65);
  box-shadow:
    0 30px 70px -30px rgba(3, 17, 44, .60),
    0 2px 10px rgba(3, 17, 44, .08);
}

/* ---------- Accueil : hiérarchie claire sur la photographie -------------- */
.home-hero { background: transparent; }
.home-copy .home-title, .home-copy .home-lead, .home-copy .tagline {
  text-shadow: 0 1px 4px rgba(3, 17, 44, .45);
}
.home-hero .hero-logo {
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}

/* ---------- Pied de page : institutionnel mais DISCRET sur la photo ------- */
.site-foot {
  background: linear-gradient(180deg, rgba(9, 42, 102, .90) 0%, rgba(7, 30, 78, .94) 100%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
}
/* Ondulation du bord : voile clair translucide (pas d'aplat opaque) pour
   rester compatible avec le fond photographique. */
.site-foot::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 26' preserveAspectRatio='none'%3E%3Cpath d='M0 0H1440V13C1260 4 1080 22 900 15C720 8 540 24 360 16C240 10 120 7 0 13Z' fill='%23FFFFFF' fill-opacity='.5'/%3E%3Cpath d='M0 13C120 7 240 10 360 16C540 24 720 8 900 15C1080 22 1260 4 1440 13' fill='none' stroke='%2396C8FF' stroke-opacity='.35' stroke-width='2.4'/%3E%3C/svg%3E");
}

/* ---------- Téléphone : voile vertical, cadrage conservé ------------------ */
@media (max-width: 900px) {
  .public-page > .hero-photo::after {
    background:
      linear-gradient(180deg, rgba(7, 45, 110, .74) 0%, rgba(8, 45, 110, .46) 42%,
        rgba(8, 40, 95, .26) 100%);
  }
  .public-page > .hero-photo img { object-position: 56% 60%; }
}

/* Impression : la photographie de fond n'est jamais imprimée ; les cartes
   repassent en fond blanc pour rester lisibles sur papier. */
@media print {
  .public-page > .hero-photo { display: none !important; }
  .public-page { background: #fff !important; }
  .auth-wrap, .auth-hero, .auth-panel, .home-hero {
    background: #fff !important; color: var(--text) !important; text-shadow: none !important;
  }
  .auth-card { background: #fff !important; }  .auth-hero .hero-title, .auth-hero .tagline,
  .home-copy .home-title, .home-copy .home-lead,
  .home-copy .tagline {
    color: var(--text) !important; text-shadow: none !important;
  }
}

/* ==========================================================================
   §30 — CRÉATION DE COMPTE EN 4 ÉTAPES
   Barre de progression (colonne sur ordinateur, barre compacte sur
   téléphone), panneaux d'étapes, en-tête de sélection (recherche + compteur
   + « tout désélectionner »), catégories repliables et cartes d'options
   compactes. Rien d'autre n'est touché : la connexion, l'accueil et le mot de
   passe oublié gardent exactement leur mise en page actuelle.
   ========================================================================== */

/* ---------- Carte large de l'inscription (la connexion garde sa largeur) --- */
.auth-card.reg-card { max-width: 1040px; }
/* La page d'inscription est à une seule colonne : l'assistant profite de toute
   la largeur sur la photographie de la façade (la connexion, l'accueil et le
   mot de passe oublié gardent leur panneau 62/38 inchangé). */
.auth-wrap.reg-page { grid-template-columns: minmax(0, 1fr); }
.auth-wrap.reg-page .auth-panel { width: 100%; padding-bottom: 46px; }
.auth-wrap.reg-page .reg-card { margin: 0 auto; }

/* ---------- Zone gauche : progression · zone droite : étape active -------- */
.reg-wizard { display: grid; grid-template-columns: 212px minmax(0, 1fr); gap: 26px; align-items: start; }
.reg-steps { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 86px; }
.reg-step {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 8px 6px; border: 0; background: none; text-align: left; border-radius: 12px;
  cursor: pointer; transition: background .15s ease;
}
.reg-step:hover:not(:disabled) { background: rgba(7, 86, 217, .07); }
.reg-step:disabled { cursor: default; opacity: .7; }
.rs-dot {
  width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: #eef2f8; border: 1.5px solid #dae3f1; color: var(--muted);
  font-size: 13px; font-weight: 800; z-index: 1;
}
.rs-txt { display: block; min-width: 0; line-height: 1.3; }
.rs-txt b { display: block; font-size: 13px; font-weight: 600; color: #55637a; }
.rs-txt .rs-full { display: block; }
.rs-txt .rs-short { display: none; }
/* Terminée : pastille bleue pleine + coche · Active : cercle bleu entouré,
   libellé en gras · À venir : indicateur gris. */
.reg-step.done .rs-dot { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 11px rgba(7, 86, 217, .3); }
.reg-step.done .rs-txt b { color: var(--text); }
.reg-step.on .rs-dot { background: #e9f2ff; border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px rgba(7, 86, 217, .14); }
.reg-step.on .rs-txt b { color: var(--brand-deep); font-weight: 800; }
.reg-step:not(:last-child)::after {
  content: ""; position: absolute; left: 20px; top: 38px; width: 2px; height: 13px;
  background: #dde5f1; border-radius: 2px;
}
.reg-step.done:not(:last-child)::after { background: var(--brand); }

/* ---------- Panneaux d'étapes (un seul visible) -------------------------- */
.reg-pane { display: none; }
.reg-pane.on { display: block; animation: pp-in .28s ease both; }
.reg-pane-head h3 { margin: 0 0 3px; font-size: 19px; color: var(--neu-ink); }
.reg-pane-head .sub { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.reg-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid #e8eef7;
}
.reg-foot .btn { min-height: 44px; padding: 11px 20px; border-radius: 12px; }
.reg-foot .btn.secondary { background: #fff; border-color: #c9d9f2; color: var(--brand); }
.reg-foot .btn.secondary:hover { background: var(--brand-soft); border-color: var(--brand); }
.reg-foot-gap { display: block; }
/* Flèches du pied : icône « vers le haut » pivotée (aucune nouvelle icône). */
.rf-left { transform: rotate(-90deg); }
.rf-right { transform: rotate(90deg); }
/* Les trois cartes de rôle tiennent sur la largeur ; « Fonction » reste en 2 colonnes. */
.reg-card .role-picker.wide { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* ---------- Étape 3 : titre, recherche, compteur, « tout désélectionner » - */
.opt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.opt-head-txt h3 { margin: 0 0 3px; font-size: 19px; color: var(--neu-ink); }
.opt-sub { margin: 0; color: var(--muted); font-size: 13.5px; }
.opt-head-tools { display: flex; flex-direction: column; gap: 8px; width: min(360px, 100%); }
.opt-head-tools .opt-search-wrap { margin-top: 0; }
.opt-tools-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.opt-counter {
  font-size: 12.5px; font-weight: 700; color: var(--brand); white-space: nowrap;
  background: var(--brand-soft); border: 1px solid #cfe0f8; border-radius: 999px; padding: 5px 11px;
}
.opt-clear {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  background: #fff; border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 10px;
}
.opt-clear:hover { color: var(--danger); border-color: #f1c4c4; background: #fff7f7; }
.opt-body { margin-top: 14px; }
/* Message d'erreur de l'étape 3 (hors <form> : même habillage que les autres
   messages de la carte d'authentification). */
.opt-body > .err:not(:empty) {
  margin-top: 12px; padding: 10px 13px; border-radius: 12px;
  background: var(--danger-soft); color: var(--danger);
  border: 1px solid #f3c9c9; font-size: 13.5px; font-weight: 600;
}

/* ---------- Catégories repliables : titre, compteur propre, repli --------- */
.opt-cats { display: grid; gap: 13px; }
.opt-cat {
  background: #fff; border: 1px solid #e4ebf6; border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(9, 40, 92, .05);
}
.opt-cat-head {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border: 0; background: linear-gradient(180deg, #f8fbff, #f1f6fd); text-align: left; cursor: pointer;
}
.opt-cat-head:hover { background: linear-gradient(180deg, #f2f7ff, #eaf2fd); }
.opt-cat-name { font-size: 11.5px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--brand); }
.opt-cat-count {
  margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--brand-deep);
  background: #fff; border: 1px solid #d9e6fa; border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
.opt-cat-caret { display: grid; place-items: center; color: var(--brand); transition: transform .18s ease; }
.opt-cat.closed .opt-cat-caret { transform: rotate(180deg); }
.opt-cat.closed .opt-cat-head { background: #f6f9fd; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 10px; padding: 12px; }

/* ---------- Cartes d'options : compactes, cliquables, accessibles --------- */
.opt-card {
  display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 11px 12px;
  background: #fff; border: 1px solid #e3eaf5; border-radius: 12px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(9, 40, 92, .05);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .12s ease;
}
.opt-card:hover { border-color: #a9c8f2; box-shadow: 0 4px 12px rgba(9, 40, 92, .1); }
.opt-card:active { transform: translateY(1px); }
.opt-card input[type="checkbox"], .opt-card input[type="radio"] {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none;
  width: 19px; height: 19px; margin-top: 1px;
  background: #fff; border: 1.7px solid #bfccdf; border-radius: 6px; cursor: pointer;
  transition: background .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.opt-card input[type="radio"] { border-radius: 50%; }
/* Case cochée : fond bleu + coche blanche (SVG inline, aucune police). */
.opt-card input:checked {
  background-color: var(--brand); border-color: var(--brand);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.6 4.6 4.6L19 6.8'/%3E%3C/svg%3E");
  background-size: 13px 13px; background-position: center; background-repeat: no-repeat;
  box-shadow: 0 3px 8px rgba(7, 86, 217, .35);
}
.opt-card-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.opt-card .opt-code { font-size: 13.5px; }
.opt-card .opt-name { font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.opt-card.sel { border-color: var(--brand); background: #f3f8ff; box-shadow: 0 0 0 1px rgba(7, 86, 217, .5), 0 4px 12px rgba(7, 86, 217, .12); }
.opt-card.sel .opt-code { color: var(--brand-deep); }

/* ---------- Message « enseignant » + récapitulatif de l'étape 4 ----------- */
.opt-note {
  display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; font-size: 13.5px;
  line-height: 1.55; color: var(--brand-deep); background: var(--brand-soft);
  border: 1px solid #d3e3fb; border-radius: 12px;
}
.reg-recap { display: grid; gap: 10px; }
.reg-recap-row {
  display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 11px 13px; background: #f7f9fd; border: 1px solid #e7edf7; border-radius: 11px;
}
.reg-recap-row .k { font-size: 11.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.reg-recap-row .v { font-size: 14px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.reg-recap-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.reg-recap-tag {
  font-size: 12px; font-weight: 800; color: var(--brand-deep);
  background: #fff; border: 1px solid #d6e4f8; border-radius: 8px; padding: 3px 8px;
}

/* ---------- Tablette : colonne de progression réduite -------------------- */
@media (max-width: 1040px) {
  .reg-wizard { grid-template-columns: 172px minmax(0, 1fr); gap: 18px; }
  .rs-txt b { font-size: 12.5px; }
}

/* ---------- Téléphone : la colonne devient une barre compacte ------------ */
@media (max-width: 900px) {
  .reg-wizard { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .reg-steps {
    position: static; flex-direction: row; gap: 6px; overflow-x: auto;
    padding-bottom: 4px; -webkit-overflow-scrolling: touch;
  }
  .reg-step { flex: 1 0 auto; flex-direction: column; gap: 5px; text-align: center; padding: 6px 8px; }
  .reg-step:not(:last-child)::after { left: auto; right: -6px; top: 20px; width: 12px; height: 2px; }
  .rs-txt .rs-full { display: none; }
  .rs-txt .rs-short { display: block; font-size: 11px; }
  .opt-head-tools { width: 100%; }
  .opt-tools-row { justify-content: space-between; }
}
@media (max-width: 640px) {
  .opt-grid { grid-template-columns: 1fr; padding: 10px; }
  .reg-recap-row { grid-template-columns: 1fr; gap: 3px; }
  .reg-foot { flex-wrap: wrap; }
  .reg-foot .btn { flex: 1 1 auto; }
}

/* ==========================================================================
   TROUVER UNE SALLE — « Recherche par créneau » + « Disponibilités
   hebdomadaires » (grille lundi → samedi, sélection multiple de créneaux,
   réservation groupée). Bleu et blanc Smart Salle, cartes arrondies, ombres
   douces, micro-animations discrètes uniquement (hover / sélection).
   ========================================================================== */
.findroom { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Onglets de mode ---------- */
.fr-tabs {
  display: inline-flex; gap: 6px; padding: 6px; background: var(--surface);
  border: 1px solid var(--card-line); border-radius: 999px; box-shadow: var(--shadow);
  align-self: flex-start; max-width: 100%; overflow-x: auto;
}
.fr-tab {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  background: transparent; color: var(--brand-deep); font-weight: 700; font-size: 14px;
  padding: 9px 16px; border-radius: 999px; white-space: nowrap;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.fr-tab:hover { background: var(--brand-soft); }
.fr-tab.active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff; box-shadow: 0 8px 18px -8px rgba(11, 79, 156, .65); transform: translateY(-1px);
}
.fr-tab:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.fr-panel { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Barre d'outils du mode hebdomadaire ---------- */
.fr-shell { display: flex; flex-direction: column; gap: 12px; }
.fr-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fr-nav input[type='date'], .fr-nav select {
  height: 36px; padding: 0 10px; border: 1px solid var(--line-strong);
  border-radius: 9px; background: var(--surface); color: var(--text); font-size: 13.5px;
}
.fr-nav input[type='date']:focus, .fr-nav select:focus { outline: 3px solid var(--ring); border-color: var(--brand-2); }
.fr-nav-right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fr-toggle {
  display: inline-flex; gap: 3px; padding: 3px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 11px;
}
.fr-tg {
  display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer;
  background: transparent; color: var(--muted); font-weight: 600; font-size: 13px;
  padding: 6px 11px; border-radius: 8px; transition: background .18s ease, color .18s ease;
}
.fr-tg:hover { background: #fff; color: var(--brand); }
.fr-tg.active { background: var(--brand); color: #fff; box-shadow: 0 4px 10px -4px rgba(11, 79, 156, .6); }
.fr-count {
  margin-left: auto; font-weight: 700; font-size: 13px; color: var(--brand);
  background: var(--brand-soft); padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.fr-days { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.fr-days .check { font-weight: 600; font-size: 13.5px; }

/* ---------- Grille hebdomadaire (salles en lignes, jours en colonnes) ---- */
.fr-board { display: flex; flex-direction: column; gap: 12px; }
.fr-gridwrap {
  background: var(--surface); border: 1px solid var(--card-line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: auto; max-height: 70vh;
}
.fr-grid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 880px; font-size: 13px; }
.fr-grid thead th {
  position: sticky; top: 0; z-index: 3; background: var(--brand-soft);
  color: var(--brand-deep); font-size: 12.5px; text-align: center; padding: 10px 8px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.fr-grid thead th .fr-date { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.fr-grid th.fr-room {
  position: sticky; left: 0; z-index: 2; background: var(--surface);
  text-align: left; width: 170px; min-width: 170px; padding: 10px 12px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-weight: 600;
}
.fr-grid thead th.fr-room { z-index: 4; background: var(--brand-soft); }
.fr-grid tbody td {
  padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; background: #fbfcff;
}
.fr-grid tbody tr:hover td { background: #f4f8fe; }
.fr-room-code { font-weight: 800; font-size: 14px; color: var(--brand); }
.fr-room-meta { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.fr-room-eq { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.fr-closed { font-size: 12px; color: #93a0b4; font-style: italic; padding: 6px 2px; }

/* ---------- Pastilles de créneaux (vert / rouge / orange / gris) -------- */
.fr-chip {
  display: block; width: 100%; text-align: left; border: 1px solid transparent;
  border-radius: 9px; padding: 6px 7px; margin-bottom: 6px; font-size: 11.5px;
  line-height: 1.25; cursor: default; background: #fff; font-family: inherit;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.fr-chip:last-child { margin-bottom: 0; }
.fr-chip-t { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.fr-chip-m { display: block; font-size: 10.5px; font-weight: 600; opacity: .88; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-chip.free { background: #dcfce7; border-color: #b7e4c7; color: #14532d; cursor: pointer; }
.fr-chip.free:hover { background: #c9f9dc; transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgba(21, 128, 61, .8); }
.fr-chip.busy { background: #fde2e2; border-color: #f6c6c6; color: #7f1d1d; }
.fr-chip.partial { background: #ffe7cc; border-color: #ffd3a6; color: #92400e; }
.fr-chip.off { background: #eef1f7; border-color: #e3e8f1; color: #93a0b4; }
.fr-chip.sel {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  border-color: var(--brand); color: #fff;
  box-shadow: 0 8px 16px -9px rgba(11, 79, 156, .95);
}
.fr-chip:focus-visible { outline: 3px solid var(--ring); outline-offset: 1px; }

/* ---------- Barre de sélection (collée en bas) ---------- */
.fr-selbar {
  position: sticky; bottom: 10px; z-index: 6; display: flex; gap: 12px;
  align-items: center; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--card-line);
  box-shadow: var(--shadow-lg); color: var(--muted); font-size: 13.5px;
}
.fr-selbar.active { border-color: rgba(11, 79, 156, .35); }
.fr-selinfo { display: flex; flex-direction: column; gap: 2px; }
.fr-selinfo b { color: var(--brand); font-size: 14.5px; }
.fr-selbar .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Vue liste : cartes de salles ---------- */
.fr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 14px; }
.fr-roomcard {
  background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 10px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.fr-roomcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-float); }
.fr-rc-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.fr-rc-count {
  font-size: 12px; font-weight: 700; color: var(--ok); background: var(--ok-soft);
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.fr-rc-slots { display: flex; flex-wrap: wrap; gap: 6px; }
.fr-rc-slots .fr-chip { width: auto; min-width: 104px; margin-bottom: 0; }
.fr-rc-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: auto; }

/* ---------- « Trouver le meilleur créneau » : résultats ---------- */
.fr-best { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.fr-best-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.fr-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; }
.fr-slot {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.fr-slot-day { font-size: 12px; color: var(--muted); font-weight: 700; grid-row: span 2; }
.fr-slot-time { font-weight: 800; color: var(--brand); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.fr-slot-room { font-size: 12px; color: var(--muted); }
.fr-slot .btn { grid-column: 1 / -1; justify-self: stretch; }
.fr-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 26px 16px; color: var(--muted); background: var(--surface);
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
}

/* ---------- Skeleton de chargement (grille) ---------- */
.fr-skel {
  background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
}
.fr-skel-row { display: grid; grid-template-columns: 170px repeat(6, 1fr); gap: 10px; margin-bottom: 10px; }
.fr-skel-row:last-child { margin-bottom: 0; }
.fr-skel-cell {
  height: 46px; border-radius: 9px;
  background: linear-gradient(90deg, #eef2f9 25%, #f7f9fd 37%, #eef2f9 63%);
  background-size: 400% 100%; animation: fr-shimmer 1.4s ease infinite;
}
@keyframes fr-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Récapitulatif + erreur de réservation groupée ---------- */
.fr-recap {
  border: 1px solid var(--card-line); border-radius: 14px; background: var(--surface-2);
  padding: 12px; margin-bottom: 14px;
}
.fr-recap-head { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--brand-deep); margin-bottom: 8px; }
.fr-recap-head .badge { margin-left: auto; }
.fr-recap .table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 10px; }

/* ---------- Encadré « Créneau sélectionné » (réservation pré-remplie) ------
   Case cliquée dans les disponibilités : SALLE · DATE · DÉBUT · FIN · DURÉE
   recalculés à chaque changement, avec validation immédiate. */
.slot-sum {
  border: 1px solid rgba(7, 86, 217, .16); border-radius: 14px; padding: 12px 14px;
  margin-bottom: 14px; background: linear-gradient(135deg, #f7faff, #eef4ff);
  box-shadow: 0 2px 10px -6px rgba(7, 59, 145, .18);
}
.slot-sum-head {
  display: flex; align-items: center; gap: 7px; margin-bottom: 10px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--brand-deep);
}
.slot-sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; }
.slot-sum-cell {
  background: #fff; border: 1px solid rgba(7, 86, 217, .12); border-radius: 10px;
  padding: 7px 9px; min-width: 0;
}
.slot-sum-cell .k { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #5b7195; }
.slot-sum-cell .v { margin-top: 3px; font-size: 13.5px; font-weight: 800; color: #08285f; overflow-wrap: anywhere; }
.slot-sum-dur .v { color: var(--brand); }
.slot-sum-err { display: flex; flex-direction: column; gap: 5px; margin-top: 9px; }
.slot-sum-err > div {
  display: flex; align-items: center; gap: 6px; background: var(--danger-soft);
  border: 1px solid #f5c2c2; color: var(--danger); border-radius: 9px;
  padding: 6px 9px; font-size: 12.5px; font-weight: 600;
}
.slot-sum-hint { margin-top: 9px; font-size: 12px; color: #5b7195; }

/* ---------- Case partiellement libre + retrait d’un créneau au récapitulatif */
.fr-chip.partial { cursor: default; }
button.fr-chip.partial { cursor: pointer; }
button.fr-chip.partial:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgba(190, 110, 10, .8); }
.fr-chip-m.free-h { color: #15803d; opacity: 1; font-weight: 700; }
.fr-chip.sel .fr-chip-m.free-h { color: #fff; }
.fr-xcol { width: 34px; text-align: center; }
.fr-xbtn {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border-radius: 7px; border: 1px solid #f1c1c1; background: #fdecec; color: #b42318;
  cursor: pointer; padding: 0; transition: background .15s ease, transform .15s ease;
}
.fr-xbtn:hover { background: #fadcdc; transform: scale(1.06); }
.fr-err {
  display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; padding: 12px 14px;
  border-radius: 12px; background: var(--danger-soft); border: 1px solid #f5c2c2;
  color: var(--danger); margin-bottom: 14px;
}
.fr-err-body { flex: 1 1 260px; }
.fr-err-body b { display: block; margin-bottom: 4px; }
.fr-err-body p { margin: 4px 0 0; color: #7f1d1d; }
.fr-err .btn { background: #fff; color: var(--danger); border-color: #f0b9b9; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .fr-skel-row { grid-template-columns: 130px repeat(6, 1fr); }
}
/* Navigation basse (mobile / tablette) : la barre de sélection reste
   au-dessus, jamais derrière. */
@media (max-width: 1024px) {
  .fr-selbar { bottom: 74px; }
}
@media (max-width: 768px) {
  .fr-tabs { width: 100%; }
  .fr-tab { flex: 1 1 auto; justify-content: center; font-size: 13px; padding: 9px 10px; }
  .fr-nav-right { margin-left: 0; width: 100%; justify-content: space-between; }
  .fr-count { margin-left: 0; }
  .fr-grid { min-width: 760px; }
  .fr-gridwrap { max-height: none; }
  .fr-selbar .actions { margin-left: 0; width: 100%; }
  .fr-selbar .actions .btn { flex: 1 1 auto; justify-content: center; }
  .fr-slot { grid-template-columns: 1fr; }
  .fr-slot-day { grid-row: auto; }
}
@media (max-width: 520px) {
  .fr-cards { grid-template-columns: 1fr; }
  .fr-skel-row { grid-template-columns: 100px repeat(6, 1fr); }
  .fr-skel-cell { height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .fr-skel-cell { animation: none; }
  .fr-chip, .fr-roomcard, .fr-tab, .fr-tg { transition: none; }
}

/* ==========================================================================
   SMART SALLE CONNECT — messagerie Option + Semestre (premium bleu/blanc)
   · Bouton de la barre supérieure + badge de non-lus · barre latérale repliable
     Option → Semestres · fil de discussion · zone d'annonces · composer.
   · Responsive : deux colonnes sur ordinateur/tablette, empilement vertical
     sur téléphone (aucun défilement horizontal).
   ========================================================================== */
/* Bouton « Smart Salle Connect » : tonalité indigo distincte des trois
   boutons existants (bleu / orange / vert), même relief 3D. */
.qn-btn { position: relative; }
.qn-connect {
  --qn-fg: #4c1d95; --qn-bg: #f2edfd; --qn-line: #ddd0fa;
  --qn-a: #6d28d9; --qn-b: #8b5cf6; --qn-glow: rgba(109, 40, 217, .42);
}
.qn-connect.active { background: linear-gradient(135deg, var(--qn-a) 0%, var(--qn-b) 100%); }
/* Badge de messages non lus (compteur serveur : 0 masqué · 99+ au-delà). */
.qn-badge {
  position: absolute; top: -7px; right: -7px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: #ef4444; color: #fff;
  font-size: 10.5px; font-weight: 800; line-height: 1;
  display: grid; place-items: center;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(239, 68, 68, .45);
}
@media (max-width: 1080px) { .qn-badge { top: -5px; right: -5px; } }

/* ---------- Disposition générale ---------- */
.cn {
  display: grid; grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px; align-items: stretch;
  height: calc(100vh - var(--topbar-h, 62px) - 128px);
  min-height: 440px;
}
.cn-side, .cn-main {
  background: var(--surface); border: 1px solid var(--card-line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden; min-width: 0;
}

/* ---------- Barre latérale : recherche + arborescence ---------- */
.cn-side-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #f8fbff, #fff); }
.cn-side-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14.5px; font-weight: 800; color: var(--brand-deep); margin-bottom: 10px;
}
.cn-side-title .ico { color: #6d28d9; }
.cn-side-head .input { width: 100%; padding: 9px 12px; font-size: 13.5px; }
.cn-side-list { flex: 1; overflow-y: auto; padding: 8px; display: grid; gap: 6px; align-content: start; }

.cn-opt-group { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.cn-opt {
  display: flex; align-items: center; gap: 7px; width: 100%;
  padding: 9px 10px; border: 0; background: var(--surface-2);
  font: inherit; cursor: pointer; text-align: left;
  transition: background .14s ease;
}
.cn-opt:hover { background: #eef4fd; }
.cn-opt-code {
  font-size: 11.5px; font-weight: 800; letter-spacing: .4px; color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  border-radius: 7px; padding: 2px 7px; white-space: nowrap;
}
.cn-opt-name { flex: 1; min-width: 0; font-size: 12.8px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-chev { font-size: 11px; color: var(--muted); transition: transform .16s ease; }
.cn-chev.open { transform: rotate(180deg); }

.cn-spaces { display: grid; gap: 3px; padding: 6px; background: #fff; }
.cn-space {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 9px; border: 1px solid transparent; border-radius: 9px;
  background: none; font: inherit; cursor: pointer; text-align: left;
  color: var(--text); font-size: 13.2px; font-weight: 600;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.cn-space:hover { background: var(--surface-2); border-color: var(--line); }
.cn-space-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: none; transition: background .14s ease; }
.cn-space-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-space.active {
  background: linear-gradient(135deg, rgba(11, 79, 156, .10) 0%, rgba(26, 111, 196, .07) 100%);
  border-color: var(--brand-3); color: var(--brand-deep);
}
.cn-space.active .cn-space-dot { background: var(--brand-2); box-shadow: 0 0 0 3px rgba(26, 111, 196, .18); }

.cn-badge {
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  background: #ef4444; color: #fff; font-size: 10.5px; font-weight: 800;
  display: grid; place-items: center; flex: none;
}
.cn-opt .cn-badge { position: static; border: 0; }
.cn-empty-side { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 13px; display: grid; gap: 8px; justify-items: center; }

/* ---------- En-tête de la discussion ---------- */
.cn-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fbff, #fff);
}
.cn-head-main { min-width: 0; flex: 1; }
.cn-head h2 { margin: 0; font-size: 16.5px; color: var(--brand-deep); letter-spacing: -.2px; }
.cn-head-sub { font-size: 12.5px; color: var(--muted); }
.cn-head-act { display: flex; gap: 8px; flex: none; }

/* ---------- Zone de messages ---------- */
.cn-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; background: #f7faff; }
.cn-nomsg { margin: auto; text-align: center; color: var(--muted); display: grid; gap: 8px; justify-items: center; font-size: 13.5px; padding: 30px 10px; }
.cn-nomsg p { margin: 0; }

.cn-msg { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.cn-msg.mine .cn-mbody { background: linear-gradient(180deg, #eef5ff, #e9f1fe); border-color: #d3e2f8; }
.cn-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff;
  font-size: 12.5px; font-weight: 800; letter-spacing: .3px;
  background: linear-gradient(158deg, #3d78d8 0%, #2457a7 55%, #173f7e 100%);
  box-shadow: 0 3px 8px rgba(36, 87, 167, .28), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.cn-avatar.a-admin { background: linear-gradient(158deg, #173f7e 0%, #0f2c5c 100%); }
.cn-avatar.a-coordinateur { background: linear-gradient(158deg, #2457a7 0%, #0b4f9c 100%); }
.cn-avatar.a-etudiant { background: linear-gradient(158deg, #5b8fd6 0%, #3d78d8 100%); }

.cn-mbody {
  min-width: 0; background: #fff; border: 1px solid var(--line);
  border-radius: 4px 14px 14px 14px; padding: 9px 12px 10px;
  box-shadow: 0 1px 3px rgba(36, 87, 167, .05);
}
.cn-mhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cn-mhead b { font-size: 13.5px; color: var(--text); }
.cn-time { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.cn-role {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
  padding: 2px 7px; border-radius: 999px; border: 1px solid transparent;
}
.cn-role.r-admin { background: #eef2ff; color: #3730a3; border-color: #d7ddff; }
.cn-role.r-coordinateur { background: var(--brand-soft); color: var(--brand-deep); border-color: #cfe0f6; }
.cn-role.r-etudiant { background: var(--surface-2); color: var(--muted); border-color: var(--line); }

.cn-text { margin: 6px 0 2px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.cn-quote {
  margin-top: 6px; padding: 5px 9px; border-left: 3px solid var(--brand-2);
  background: var(--surface-2); border-radius: 0 8px 8px 0;
  font-size: 12.3px; color: var(--muted); display: grid; gap: 1px;
}
.cn-quote b { color: var(--brand-deep); font-size: 12px; }

/* Pièces jointes : disque, nom, poids — téléchargement contrôlé par le serveur. */
.cn-atts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.cn-att {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--text); text-decoration: none;
  font-size: 12.5px; transition: border-color .14s ease, background .14s ease, transform .14s ease;
}
.cn-att:hover { border-color: var(--brand-3); background: #eef4fd; transform: translateY(-1px); }
.cn-att-ext {
  font-size: 10px; font-weight: 800; letter-spacing: .5px; color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  border-radius: 6px; padding: 2px 6px; flex: none;
}
.cn-att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; font-weight: 600; }
.cn-att-size { color: var(--muted); font-size: 11.5px; flex: none; }

/* Réactions + actions de message */
.cn-reactrow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; position: relative; }
.cn-react {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 2px 8px; font-size: 12px; cursor: pointer; color: var(--text);
  display: inline-flex; align-items: center; gap: 4px;
  transition: border-color .14s ease, background .14s ease, transform .14s ease;
}
.cn-react-n { font-size: 11.5px; font-weight: 700; }
.cn-react:hover { border-color: var(--brand-3); background: var(--surface-2); transform: translateY(-1px); }
.cn-react.mine { border-color: var(--brand-2); background: var(--brand-soft); color: var(--brand-deep); font-weight: 700; }
.cn-react.add { color: var(--muted); font-weight: 800; }
.cn-emoji-pop {
  position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 5;
  display: flex; gap: 4px; padding: 6px 8px; background: #fff;
  border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 10px 26px rgba(15, 42, 84, .18);
}
.cn-emoji-pop button { border: 0; background: none; cursor: pointer; padding: 3px 5px; border-radius: 8px; color: var(--text); display: inline-flex; align-items: center; transition: background .12s ease, transform .12s ease; }
.cn-emoji-pop button:hover { color: var(--brand-deep); }
.cn-emoji-pop button:hover { background: var(--surface-2); transform: scale(1.15); }

.cn-acts { display: flex; gap: 8px; margin-left: auto; }
.cn-act {
  border: 0; background: none; padding: 0; font: inherit;
  font-size: 11.5px; font-weight: 700; color: var(--brand-2); cursor: pointer;
  transition: color .14s ease;
}
.cn-act:hover { color: var(--brand-deep); text-decoration: underline; }
.cn-act.danger { color: var(--danger); }
.cn-act.danger:hover { color: #c92626; }
.cn-ann .cn-act { color: var(--warn); }

/* ---------- Zone d'annonces (dédiée, épinglable) ---------- */
.cn-announces { display: grid; gap: 10px; }
.cn-ann {
  border: 1px solid #f3ddbe; background: linear-gradient(180deg, #fffdf7, #fffaf0);
  border-radius: 14px; padding: 10px 13px 11px;
  box-shadow: 0 1px 3px rgba(180, 83, 9, .06);
}
.cn-ann.pinned { border-color: #e9c07a; box-shadow: 0 4px 14px -8px rgba(180, 83, 9, .35); }
.cn-ann-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 6px; }
.cn-ann-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px;
  color: var(--warn); background: var(--warn-soft); border: 1px solid #f3ddbe;
  border-radius: 999px; padding: 3px 9px;
}
.cn-ann .cn-time { margin-left: 0; }
.cn-ann-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.cn-ann-body .cn-mbody { background: transparent; border: 0; box-shadow: none; padding: 0; }

/* ---------- Composer ---------- */
.cn-composer { border-top: 1px solid var(--line); background: #fff; padding: 11px 14px 12px; display: grid; gap: 8px; }
.cn-kinds { display: flex; gap: 6px; flex-wrap: wrap; }
.cn-kind {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
  border-radius: 999px; padding: 5px 12px; font: inherit;
  font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.cn-kind:hover { border-color: var(--brand-3); color: var(--brand); }
.cn-kind.on {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 10px -4px rgba(11, 79, 156, .5);
}
.cn-composer-row { display: flex; align-items: flex-end; gap: 9px; }
.cn-input {
  flex: 1; min-width: 0; resize: none; min-height: 44px; max-height: 160px;
  border: 1px solid var(--line-strong); border-radius: 13px; padding: 11px 13px;
  font: inherit; font-size: 14px; color: var(--text); background: var(--surface-2);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.cn-input:focus { outline: none; border-color: var(--brand-2); background: #fff; box-shadow: 0 0 0 3px var(--ring); }
.cn-clip {
  width: 44px; height: 44px; flex: none; border-radius: 13px;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--brand-2);
  display: grid; place-items: center; cursor: pointer;
  transition: background .14s ease, border-color .14s ease, transform .14s ease;
}
.cn-clip:hover { background: var(--brand-soft); border-color: var(--brand-3); transform: translateY(-1px); }
.cn-send { height: 44px; padding: 0 17px; border-radius: 13px; flex: none; }
.cn-send:disabled { opacity: .6; cursor: wait; }
.cn-fileinput { display: none; }
.cn-filechips { display: flex; flex-wrap: wrap; gap: 7px; }
.cn-filechip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px;
  border: 1px solid var(--brand-3); background: var(--brand-soft);
  border-radius: 999px; font-size: 12.3px; color: var(--brand-deep); max-width: 100%;
}
.cn-filechip .cn-fs { color: var(--muted); font-size: 11px; }
.cn-filechip .cn-act { color: var(--brand-2); font-weight: 800; }
.cn-replybar {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--brand-deep);
  background: var(--brand-soft); border: 1px solid #cfe0f6;
  border-radius: 10px; padding: 7px 11px;
}
.cn-replybar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-composer-hint { font-size: 11.3px; color: var(--muted); }

/* ---------- États : chargement, vide, erreur ---------- */
.cn-loading { flex: 1; display: grid; place-items: center; padding: 30px; }
.cn-empty {
  flex: 1; display: grid; gap: 9px; justify-items: center; align-content: center;
  text-align: center; padding: 40px 24px; color: var(--muted);
}
.cn-empty h3 { margin: 0; font-size: 18px; color: var(--brand-deep); }
.cn-empty p { margin: 0; font-size: 13.5px; max-width: 460px; }
.cn-empty .ico { color: #6d28d9; }

/* ---------- Membres (modale) ---------- */
.cn-memgroup { margin-top: 14px; }
.cn-memgroup h4 { margin: 0 0 8px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--brand-2); }
.cn-mems { display: grid; gap: 6px; }
.cn-mem { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.cn-mem .cn-avatar { width: 30px; height: 30px; font-size: 11px; }
.cn-mem-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.modal-body > input[type="search"] { width: 100%; margin-bottom: 4px; padding: 9px 12px; font-size: 13.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .cn { grid-template-columns: 246px minmax(0, 1fr); }
  .cn-att-name { max-width: 150px; }
}
@media (max-width: 760px) {
  /* Téléphone : barre latérale repliée au-dessus, discussion en dessous —
     défilement vertical INTERNE uniquement, jamais horizontal. */
  .cn {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(320px, 1fr);
    height: auto; min-height: 0;
  }
  .cn-side { max-height: 230px; }
  .cn-side-list { max-height: 168px; }
  .cn-main { min-height: 60vh; }
  .cn-head { padding: 11px 12px; }
  .cn-msgs { padding: 12px 10px; }
  .cn-composer { padding: 10px; }
  .cn-composer-row { flex-wrap: wrap; }
  .cn-input { flex: 1 1 100%; order: 1; }
  .cn-clip { order: 0; }
  .cn-send { order: 2; margin-left: auto; }
  .cn-acts { width: 100%; margin-left: 0; }
  .cn-time { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cn-space, .cn-att, .cn-react, .cn-chev, .cn-kind { transition: none; }
}


/* ---------- Bandeau de consentement (mesure d'audience PostHog) ----------
   Affiché une seule fois, dans le coin inférieur gauche, aux couleurs de la
   plateforme (bleu / blanc). Discret : il ne recouvre ni la navigation ni les
   formulaires, et reste sous les fenêtres modales et les notifications. */
.consentbar {
  position: fixed; left: 18px; bottom: 18px; z-index: 190;
  max-width: 470px; display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--card-line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 14px 16px;
}
.consentbar .consent-txt { flex: 1 1 240px; min-width: 0; }
.consentbar .consent-txt b { display: block; font-size: 13.5px; color: var(--brand-deep); }
.consentbar .consent-txt p { margin: 4px 0 0; font-size: 12.4px; line-height: 1.55; color: var(--muted); }
.consent-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
@media (max-width: 560px) {
  .consentbar { left: 10px; right: 10px; bottom: 10px; max-width: none; flex-direction: column; }
  .consent-actions { margin-left: 0; width: 100%; }
  .consent-actions .btn { flex: 1; justify-content: center; }
}
/* ==========================================================================
   SMART SALLE CONNECT — interface premium (messagerie pédagogique)
   Blanc + bleu institutionnel, glassmorphism maîtrisé, micro-interactions.
   Bloc autonome : les anciennes règles `.cn-*` restent intactes pour les
   écrans qui les utilisent encore ; cette vue porte le préfixe `.cx-`.
   ========================================================================== */
.cx {
  --cx-a: #0b3b82;
  --cx-b: #1458d4;
  --cx-c: #2f80ed;
  --cx-cyan: #20c7f7;
  --cx-night: #081a38;
  --cx-bg: #f4f7fc;
  --cx-ok: #16a34a;
  --cx-seen: #2f80ed;
  --cx-warn: #f59e0b;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  height: calc(100vh - var(--topbar-h, 62px) - 128px);
  min-height: 460px;
}
.cx.with-reads { grid-template-columns: 300px minmax(0, 1fr) 340px; }
.cx-list, .cx-chat, .cx-reads {
  background: #fff;
  border: 1px solid var(--card-line, #e3eaf6);
  border-radius: 18px;
  box-shadow: 0 18px 40px -28px rgba(8, 26, 56, .38), 0 2px 6px rgba(8, 26, 56, .04);
  display: flex; flex-direction: column; overflow: hidden; min-width: 0;
}
.cx-reads { display: none; }
.cx.with-reads .cx-reads { display: flex; }

/* ---------- Colonne des groupes ---------- */
.cx-list-head {
  padding: 14px 14px 12px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(32, 199, 247, .18), transparent 55%),
    linear-gradient(150deg, #0b3b82 0%, #1458d4 62%, #2f80ed 100%);
  color: #fff;
  display: grid; gap: 10px;
}
.cx-list-title { display: flex; align-items: center; gap: 10px; }
.cx-logo {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}
.cx-list-title > div { flex: 1; min-width: 0; display: grid; gap: 1px; }
.cx-list-title b { font-size: 14.5px; letter-spacing: -.2px; }
.cx-list-sub { font-size: 11.6px; color: rgba(255, 255, 255, .8); }
.cx-total-badge {
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px;
  background: #fff; color: var(--cx-b); font-size: 11.5px; font-weight: 900;
  display: grid; place-items: center; flex: none;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .35);
}
.cx-searchwrap {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 12px; padding: 0 10px;
  backdrop-filter: blur(6px);
}
.cx-searchwrap .ico { color: rgba(255, 255, 255, .85); flex: none; }
.cx-search {
  width: 100%; min-width: 0; border: 0; background: none; color: #fff;
  font: inherit; font-size: 13.4px; padding: 9px 0; outline: none;
}
.cx-search::placeholder { color: rgba(255, 255, 255, .72); }
.cx-search::-webkit-search-cancel-button { filter: invert(1); }
.cx-filters { display: flex; gap: 7px; }
.cx-chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid rgba(255, 255, 255, .32);
  background: rgba(255, 255, 255, .12);
  color: #fff; border-radius: 999px; padding: 5px 11px;
  font: inherit; font-size: 12.2px; font-weight: 700; cursor: pointer;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.cx-chip:hover { background: rgba(255, 255, 255, .22); transform: translateY(-1px); }
.cx-chip.on { background: #fff; color: var(--cx-b); border-color: #fff; }
.cx-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.cx-select {
  width: 100%; min-width: 0; border: 1px solid rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .14); color: #fff;
  border-radius: 10px; padding: 7px 9px; font: inherit; font-size: 12.2px;
  cursor: pointer;
}
.cx-select option { color: var(--cx-night); background: #fff; }
.cx-list-body { flex: 1; overflow-y: auto; padding: 8px; display: grid; gap: 6px; align-content: start; background: var(--cx-bg); }
.cx-item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; border-radius: 14px; }
.cx-item-btn {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px; align-items: center; width: 100%;
  border: 1px solid transparent; border-radius: 14px; background: #fff;
  padding: 9px 34px 9px 10px; font: inherit; text-align: left; cursor: pointer;
  box-shadow: 0 1px 2px rgba(8, 26, 56, .05);
  transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.cx-item-btn:hover { border-color: #cfe0f8; transform: translateY(-1px); box-shadow: 0 8px 18px -14px rgba(20, 88, 212, .55); }
.cx-item-btn.on {
  background: linear-gradient(120deg, rgba(20, 88, 212, .1), rgba(32, 199, 247, .08));
  border-color: #b9d5f6;
  box-shadow: inset 3px 0 0 var(--cx-b), 0 8px 18px -16px rgba(11, 59, 130, .7);
}
.cx-ava {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  display: grid; place-items: center; color: #fff;
  font-size: 12.5px; font-weight: 900; letter-spacing: .4px;
  background: linear-gradient(150deg, #2f80ed, #0b3b82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
.cx-head-ava {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 12px;
  background: linear-gradient(150deg, #1458d4, #081a38);
  box-shadow: 0 8px 18px -12px rgba(11, 59, 130, .9);
}
.cx-item-main { min-width: 0; display: grid; gap: 3px; }
.cx-item-top { display: flex; align-items: baseline; gap: 8px; }
.cx-item-label { font-size: 13.2px; color: #0e2a52; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.cx-item-time { font-size: 10.8px; color: #7d8bab; flex: none; }
.cx-item-prev {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #64748b; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cx-item-prev > span:first-child, .cx-item-prev { text-overflow: ellipsis; }
.cx-item-prev .cx-badge { margin-left: auto; }
.cx-item-meta { align-self: start; padding-top: 2px; color: #8a99b5; }
.cx-item-members { display: inline-flex; align-items: center; gap: 3px; font-size: 10.6px; }
.cx-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: linear-gradient(135deg, #2f80ed, #1458d4); color: #fff;
  font-size: 10.6px; font-weight: 900; display: grid; place-items: center; flex: none;
  box-shadow: 0 4px 10px -5px rgba(20, 88, 212, .8);
}
.cx-pin {
  position: absolute; top: 8px; right: 6px;
  width: 24px; height: 24px; border-radius: 8px; border: 0; cursor: pointer;
  background: none; color: #c3cddf; display: grid; place-items: center;
  transition: color .16s ease, background .16s ease, transform .16s ease;
}
.cx-pin:hover { background: #eef4fd; color: var(--cx-warn); transform: scale(1.08); }
.cx-pin.on { color: var(--cx-warn); }
.cx-list-empty, .cx-empty-feed, .cx-reads-empty {
  padding: 28px 16px; text-align: center; color: #7d8bab;
  display: grid; gap: 8px; justify-items: center; font-size: 13px;
}
.cx-list-empty p, .cx-empty-feed p, .cx-reads-empty p { margin: 0; max-width: 320px; line-height: 1.5; }
.cx-empty-feed { margin: auto; }
.cx-muted { color: #7d8bab; font-size: 12.4px; margin: 0 0 4px; }

/* ---------- Conversation ---------- */
.cx-chat { background: linear-gradient(180deg, #fbfdff 0%, #f4f7fc 100%); }
.cx-head {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid #e6edf8;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
}
.cx-head-main { flex: 1; min-width: 0; }
.cx-head h2 { margin: 0; font-size: 16px; letter-spacing: -.2px; color: #0b2b57; }
.cx-head-sub { font-size: 12.2px; color: #6b7c99; }
.cx-head-act { display: flex; gap: 6px; flex: none; }
.cx-iconbtn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid #e1e9f5;
  background: #fff; color: #4b6386; display: grid; place-items: center; cursor: pointer;
  transition: border-color .16s ease, color .16s ease, background .16s ease, transform .16s ease;
}
.cx-iconbtn:hover { border-color: #b9d5f6; color: var(--cx-b); background: #f5f9ff; transform: translateY(-1px); }
.cx-iconbtn.on { color: var(--cx-warn); border-color: #f3ddbe; background: #fffaf0; }
.cx-back { display: none; width: 34px; height: 34px; border-radius: 10px; border: 1px solid #e1e9f5; background: #fff; color: #4b6386; cursor: pointer; }
.cx-back .ico { transform: rotate(-90deg); }
.cx-searchbar { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: #fff; border-bottom: 1px solid #e6edf8; }
.cx-searchbar .cx-search { color: #0e2a52; border: 1px solid #dbe6f5; border-radius: 10px; padding: 7px 10px; background: #f7faff; }
.cx-searchbar .cx-search::placeholder { color: #94a3b8; }
.cx-searchbar .ico { color: #64748b; }
.cx-search-go { border: 1px solid #cfe0f8; background: #eef4fd; color: var(--cx-b); border-radius: 9px; padding: 7px 11px; font: inherit; font-size: 12.4px; font-weight: 800; cursor: pointer; }
.cx-feed-wrap { flex: 1; min-height: 0; display: flex; }
.cx-feed { flex: 1; overflow-y: auto; padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.cx-search-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #eef4fd; border: 1px solid #d3e4fa; color: #1e4a8f; border-radius: 12px; padding: 8px 12px; font-size: 12.6px; }
.cx-link { border: 0; background: none; color: var(--cx-b); font: inherit; font-size: 12.6px; font-weight: 800; cursor: pointer; text-decoration: underline; }
.cx-more { align-self: center; border: 1px solid #dbe6f5; background: #fff; color: #37527a; border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 12.4px; font-weight: 700; cursor: pointer; }
.cx-more:hover { border-color: #b9d5f6; color: var(--cx-b); }
.cx-day { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.cx-day::before, .cx-day::after { content: ''; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, #dfe8f5, transparent); }
.cx-day span { font-size: 11px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: #7d8bab; background: #fff; border: 1px solid #e6edf8; border-radius: 999px; padding: 3px 10px; }
.cx-annzone { display: grid; gap: 9px; padding: 10px; border-radius: 14px; background: linear-gradient(180deg, #fffdf7, #fff7ea); border: 1px solid #f3ddbe; }
.cx-annzone-t { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 900; letter-spacing: .7px; text-transform: uppercase; color: #b45309; }
.cx-msg { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; align-items: start; animation: cxIn .22s ease both; }
@keyframes cxIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.cx-avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .3px; background: linear-gradient(158deg, #3d78d8 0%, #2457a7 55%, #173f7e 100%); box-shadow: 0 4px 10px -6px rgba(36, 87, 167, .8), inset 0 1px 0 rgba(255, 255, 255, .35); }
.cx-avatar.a-admin { background: linear-gradient(158deg, #1b3f74, #081a38); }
.cx-avatar.a-coordinateur { background: linear-gradient(158deg, #2f80ed, #0b3b82); }
.cx-avatar.a-etudiant { background: linear-gradient(158deg, #6aa6ea, #3d78d8); }
.cx-bubble { min-width: 0; background: #fff; border: 1px solid #e6edf8; border-radius: 4px 16px 16px 16px; padding: 10px 13px 11px; box-shadow: 0 2px 8px -6px rgba(8, 26, 56, .3); transition: box-shadow .18s ease, border-color .18s ease; }
.cx-msg:hover .cx-bubble { border-color: #d8e5f7; box-shadow: 0 10px 24px -20px rgba(20, 88, 212, .7); }
.cx-msg.mine .cx-bubble { background: linear-gradient(180deg, #f2f8ff, #eaf2fe); border-color: #d3e4fa; }
.cx-msg.ann .cx-bubble { background: linear-gradient(180deg, #fffdf7, #fffaf0); border-color: #f3ddbe; }
.cx-msg.ann.imp-important .cx-bubble { border-left: 3px solid var(--cx-warn); }
.cx-msg.ann.imp-urgent .cx-bubble { border-left: 3px solid #ef4444; background: linear-gradient(180deg, #fff8f8, #fff1f1); border-color: #f6cdcd; }
.cx-msg.q .cx-bubble { border-left: 3px solid var(--cx-c); }
.cx-mhead { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.cx-mhead b { font-size: 13.4px; color: #0e2a52; }
.cx-time { font-size: 11.2px; color: #8494b1; margin-left: auto; }
.cx-role { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; padding: 2px 7px; border-radius: 999px; border: 1px solid transparent; }
.cx-role.r-admin { background: #eef2ff; color: #3730a3; border-color: #d7ddff; }
.cx-role.r-coordinateur { background: #e8f1fe; color: #0b3b82; border-color: #cfe0f6; }
.cx-role.r-etudiant { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.cx-kindtag { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase; color: #b45309; background: #fff7ea; border: 1px solid #f3ddbe; border-radius: 999px; padding: 2px 7px; }
.cx-kindtag.q { color: var(--cx-b); background: #eef4fd; border-color: #d3e4fa; }
.cx-imp { font-size: 10px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; color: #b45309; background: #fff3e2; border: 1px solid #f8d9ae; }
.cx-imp.urgent { color: #b91c1c; background: #fdecec; border-color: #f6c9c9; }
.cx-mtitle { margin: 7px 0 2px; font-size: 14.6px; color: #0b2b57; letter-spacing: -.2px; }
.cx-text { margin: 6px 0 2px; font-size: 14px; line-height: 1.58; color: #1e2f47; white-space: pre-wrap; overflow-wrap: anywhere; }
.cx-quote { margin-top: 6px; padding: 5px 9px; border-left: 3px solid var(--cx-c); background: #f5f9ff; border-radius: 0 8px 8px 0; font-size: 12.2px; color: #64748b; display: grid; gap: 1px; }
.cx-quote b { color: #0b3b82; font-size: 12px; }
.cx-atts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.cx-att { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 6px 10px; border: 1px solid #dbe6f5; border-radius: 11px; background: #f7faff; color: #1e2f47; text-decoration: none; font-size: 12.4px; transition: border-color .14s ease, background .14s ease, transform .14s ease; }
.cx-att:hover { border-color: #b9d5f6; background: #eef4fd; transform: translateY(-1px); }
.cx-att-ext { font-size: 9.6px; font-weight: 900; letter-spacing: .5px; color: #fff; background: linear-gradient(135deg, var(--cx-a), var(--cx-b)); border-radius: 6px; padding: 2px 6px; flex: none; }
.cx-att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; font-weight: 600; }
.cx-att-size { color: #7d8bab; font-size: 11.2px; flex: none; }
.cx-reactrow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; position: relative; }
.cx-react { border: 1px solid #e1e9f5; background: #fff; border-radius: 999px; padding: 2px 8px; font-size: 12px; cursor: pointer; color: #37527a; display: inline-flex; align-items: center; gap: 4px; transition: border-color .14s ease, background .14s ease, transform .14s ease; }
.cx-react:hover { border-color: #b9d5f6; background: #f5f9ff; transform: translateY(-1px); }
.cx-react.mine { border-color: var(--cx-c); background: #eef4fd; color: var(--cx-a); font-weight: 800; }
.cx-react-n { font-size: 11.2px; font-weight: 800; }
.cx-react.add { color: #7d8bab; font-weight: 900; }
.cx-emoji-pop { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 8; display: flex; gap: 4px; padding: 6px 8px; background: #fff; border: 1px solid #dbe6f5; border-radius: 999px; box-shadow: 0 14px 34px -18px rgba(8, 26, 56, .55); }
.cx-emoji-pop button { border: 0; background: none; cursor: pointer; padding: 3px 5px; border-radius: 8px; color: #37527a; display: inline-flex; align-items: center; }
.cx-emoji-pop button:hover { background: #eef4fd; transform: scale(1.12); }
.cx-emoji-pop.emoji { border-radius: 14px; flex-wrap: wrap; max-width: 240px; font-size: 17px; }
.cx-acts { display: flex; gap: 8px; margin-left: auto; }
.cx-act { border: 0; background: none; padding: 0; font: inherit; font-size: 11.4px; font-weight: 800; color: var(--cx-b); cursor: pointer; }
.cx-act:hover { color: var(--cx-a); text-decoration: underline; }
.cx-act.danger { color: #dc2626; }
.cx-mfoot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding-top: 7px; border-top: 1px dashed #e3ebf7; font-size: 11.4px; }
.cx-reads-link { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-size: 11.4px; font-weight: 700; color: #64748b; }
.cx-reads-link:hover { color: var(--cx-b); text-decoration: underline; }
.cx-ack { display: inline-flex; align-items: center; gap: 4px; color: #64748b; font-weight: 700; }
.cx-ack.ok { color: var(--cx-ok); }
.cx-ack-btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #bfe6cc; background: #f2fbf5; color: #15803d; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 11.6px; font-weight: 800; cursor: pointer; transition: background .14s ease, transform .14s ease; }
.cx-ack-btn:hover { background: #e7f8ec; transform: translateY(-1px); }
.cx-composer-slot { border-top: 1px solid #e6edf8; background: rgba(255, 255, 255, .96); }
.cx-composer { padding: 10px 14px 11px; display: grid; gap: 8px; }
.cx-kinds { display: flex; gap: 6px; flex-wrap: wrap; }
.cx-kind { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #e1e9f5; background: #f7faff; color: #64748b; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12.3px; font-weight: 800; cursor: pointer; transition: background .14s ease, color .14s ease, border-color .14s ease; }
.cx-kind:hover { border-color: #b9d5f6; color: var(--cx-b); }
.cx-kind.on { background: linear-gradient(135deg, var(--cx-b), var(--cx-c)); border-color: transparent; color: #fff; box-shadow: 0 6px 14px -8px rgba(20, 88, 212, .8); }
.cx-composer-row { display: flex; align-items: flex-end; gap: 8px; }
.cx-input { flex: 1; min-width: 0; resize: none; min-height: 44px; max-height: 180px; border: 1px solid #dbe6f5; border-radius: 13px; padding: 11px 13px; font: inherit; font-size: 14px; color: #1e2f47; background: #f7faff; transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.cx-input:focus { outline: none; border-color: var(--cx-c); background: #fff; box-shadow: 0 0 0 3px rgba(47, 128, 237, .16); }
.cx-clip { width: 44px; height: 44px; flex: none; border-radius: 13px; border: 1px solid #dbe6f5; background: #f7faff; color: var(--cx-b); display: grid; place-items: center; cursor: pointer; transition: background .14s ease, border-color .14s ease, transform .14s ease; }
.cx-clip:hover { background: #eef4fd; border-color: #b9d5f6; transform: translateY(-1px); }
.cx-emoji-face { font-size: 19px; line-height: 1; }
.cx-send { height: 44px; padding: 0 18px; border: 0; border-radius: 13px; flex: none; background: linear-gradient(135deg, var(--cx-b), var(--cx-c)); color: #fff; font: inherit; font-size: 13.4px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 10px 20px -12px rgba(20, 88, 212, .9); transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease; }
.cx-send:hover { transform: translateY(-1px); box-shadow: 0 14px 24px -12px rgba(20, 88, 212, .95); }
.cx-send:disabled { opacity: .62; cursor: wait; transform: none; }
.cx-fileinput { display: none; }
.cx-filechips { display: flex; flex-wrap: wrap; gap: 7px; }
.cx-filechip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid #cfe0f6; background: #eef4fd; border-radius: 999px; font-size: 12.2px; color: #0b3b82; max-width: 100%; }
.cx-filechip .cx-fs { color: #7d8bab; font-size: 10.8px; }
.cx-filechip .cx-act { color: var(--cx-b); font-weight: 900; }
.cx-replybar { display: flex; align-items: center; gap: 8px; font-size: 12.4px; color: #0b3b82; background: #eef4fd; border: 1px solid #cfe0f6; border-radius: 10px; padding: 7px 11px; }
.cx-replybar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-hint { font-size: 11px; color: #8a99b5; }
.cx-annfields { display: grid; gap: 7px; }
.cx-input-line { width: 100%; border: 1px solid #dbe6f5; border-radius: 11px; padding: 9px 12px; font: inherit; font-size: 13.4px; color: #1e2f47; background: #fffdf7; }
.cx-input-line:focus { outline: none; border-color: var(--cx-warn); box-shadow: 0 0 0 3px rgba(245, 158, 11, .15); }
.cx-annrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cx-annrow .cx-select { color: #1e2f47; border-color: #e3d3b6; background: #fffdf7; width: auto; }
.cx-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.2px; color: #7c5a1c; font-weight: 700; }
.cx-loading { flex: 1; display: grid; place-items: center; padding: 30px; }
.cx-empty { flex: 1; display: grid; gap: 9px; justify-items: center; align-content: center; text-align: center; padding: 40px 24px; color: #7d8bab; }
.cx-empty h3 { margin: 0; font-size: 18px; color: #0b2b57; }
.cx-empty p { margin: 0; font-size: 13.4px; max-width: 460px; line-height: 1.55; }
.cx-empty .ico { color: var(--cx-b); }
.cx-reads { background: #fff; }
.cx-reads-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, rgba(32, 199, 247, .22), transparent 55%), linear-gradient(150deg, #081a38 0%, #0b3b82 60%, #1458d4 100%); }
.cx-reads-head > div { flex: 1; min-width: 0; display: grid; gap: 3px; }
.cx-reads-head b { display: inline-flex; align-items: center; gap: 7px; font-size: 13.4px; }
.cx-reads-head span { font-size: 11.8px; color: rgba(255, 255, 255, .8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-reads-head .cx-iconbtn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .28); color: #fff; }
.cx-reads-body { flex: 1; overflow-y: auto; padding: 12px; display: grid; gap: 10px; align-content: start; background: var(--cx-bg); }
.cx-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cx-stat { background: #fff; border: 1px solid #e6edf8; border-radius: 12px; padding: 9px 11px; display: grid; gap: 1px; box-shadow: 0 1px 2px rgba(8, 26, 56, .04); }
.cx-stat b { font-size: 19px; line-height: 1.1; color: #0b2b57; letter-spacing: -.4px; }
.cx-stat span { font-size: 11px; color: #7d8bab; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.cx-stat.ok b { color: var(--cx-ok); }
.cx-stat.seen b { color: var(--cx-seen); }
.cx-stat.off b { color: #64748b; }
.cx-ackrow { display: flex; align-items: center; gap: 6px; font-size: 11.8px; font-weight: 700; color: #15803d; background: #f2fbf5; border: 1px solid #bfe6cc; border-radius: 10px; padding: 7px 10px; }
.cx-rfilters { display: flex; gap: 5px; flex-wrap: wrap; }
.cx-rtab { border: 1px solid #e1e9f5; background: #fff; color: #64748b; border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 11.8px; font-weight: 800; cursor: pointer; }
.cx-rtab.on { background: var(--cx-b); border-color: var(--cx-b); color: #fff; }
.cx-rsearch { display: flex; align-items: center; gap: 7px; background: #fff; border: 1px solid #dbe6f5; border-radius: 10px; padding: 0 9px; }
.cx-rsearch .ico { color: #94a3b8; }
.cx-rsearch .cx-search { color: #1e2f47; padding: 8px 0; }
.cx-rsearch .cx-search::placeholder { color: #94a3b8; }
.cx-rlist { display: grid; gap: 6px; }
.cx-rrow { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 9px; align-items: center; background: #fff; border: 1px solid #e6edf8; border-radius: 11px; padding: 8px 10px; }
.cx-rrow .cx-avatar { width: 32px; height: 32px; font-size: 11px; }
.cx-rmain { min-width: 0; display: grid; gap: 1px; }
.cx-rmain b { font-size: 12.8px; color: #0e2a52; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-rsub { font-size: 10.8px; color: #7d8bab; }
.cx-rright { display: grid; gap: 2px; justify-items: end; text-align: right; }
.cx-rstat { font-size: 10px; font-weight: 900; letter-spacing: .4px; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; border: 1px solid transparent; }
.cx-rstat.ok { color: #15803d; background: #f2fbf5; border-color: #bfe6cc; }
.cx-rstat.seen { color: var(--cx-b); background: #eef4fd; border-color: #cfe0f6; }
.cx-rstat.off { color: #64748b; background: #f1f5f9; border-color: #e2e8f0; }
.cx-rtime { font-size: 10.2px; color: #8494b1; }
.cx-rtime.ok { color: #15803d; }
.cx-members input[type="search"] { width: 100%; margin-bottom: 6px; }
.cx-memgroup { margin-top: 12px; }
.cx-memgroup h4 { margin: 0 0 7px; font-size: 11.6px; text-transform: uppercase; letter-spacing: .7px; color: var(--cx-b); }
.cx-mems { display: grid; gap: 5px; max-height: 300px; overflow-y: auto; }
.cx-mem { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border: 1px solid #e6edf8; border-radius: 10px; background: #fff; }
.cx-mem .cx-avatar { width: 30px; height: 30px; font-size: 10.5px; }
.cx-mem-name { flex: 1; font-size: 13px; font-weight: 600; color: #1e2f47; }
.cx-role-mini { font-size: 10.4px; color: #7d8bab; font-weight: 700; }
.cx-info-head { display: flex; gap: 11px; align-items: center; margin-bottom: 12px; }
.cx-info-head b { display: block; font-size: 15px; color: #0b2b57; }
.cx-info-head span { font-size: 12px; color: #7d8bab; }
.cx-dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 0; }
.cx-dl dt { font-size: 12px; color: #7d8bab; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.cx-dl dd { margin: 0; font-size: 13px; color: #1e2f47; font-weight: 600; }
@media (max-width: 1180px) {
  .cx.with-reads { grid-template-columns: 280px minmax(0, 1fr); }
  .cx.with-reads .cx-reads { display: none; }
  .cx-reads.open { display: flex; position: fixed; z-index: 80; right: 12px; top: 78px; bottom: 12px; width: min(380px, 94vw); box-shadow: 0 30px 70px -30px rgba(8, 26, 56, .65); }
  .cx-att-name { max-width: 160px; }
}
@media (max-width: 980px) {
  .cx { grid-template-columns: 260px minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 860px) {
  .cx { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 150px); min-height: 420px; }
  .cx.chat-open .cx-list { display: none; }
  .cx:not(.chat-open) .cx-chat { display: none; }
  .cx:not(.chat-open) .cx-list { display: flex; }
  .cx-back { display: grid; place-items: center; }
  .cx-head { padding: 10px 11px; gap: 8px; }
  .cx-head-act { gap: 4px; }
  .cx-iconbtn { width: 32px; height: 32px; }
  .cx-feed { padding: 12px 11px 6px; }
  .cx-msg { grid-template-columns: 32px minmax(0, 1fr); gap: 8px; }
  .cx-avatar { width: 32px; height: 32px; font-size: 10.6px; }
  .cx-composer { padding: 9px 10px 10px; }
  .cx-composer-row { flex-wrap: wrap; }
  .cx-input { flex: 1 1 100%; order: 3; }
  .cx-clip { order: 1; }
  .cx-send { order: 2; margin-left: auto; height: 40px; }
  .cx-acts { width: 100%; margin-left: 0; }
  .cx-time { margin-left: 0; }
  .cx-reads.open { top: 68px; right: 8px; left: 8px; width: auto; bottom: 8px; }
  .cx-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cx-stat b { font-size: 16px; }
  .cx-searchbar { flex-wrap: wrap; }
  .cx-searchbar .cx-search { flex: 1 1 140px; }
}
@media (max-width: 480px) {
  .cx { height: calc(100vh - 128px); }
  .cx-list-head { padding: 12px; }
  .cx-filters .cx-chip { flex: 1; justify-content: center; }
  .cx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-att-name { max-width: 120px; }
  .cx-bubble { padding: 9px 11px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .cx-msg { animation: none; }
  .cx-feed { scroll-behavior: auto; }
  .cx-item-btn, .cx-chip, .cx-iconbtn, .cx-clip, .cx-send, .cx-att, .cx-react, .cx-kind, .cx-ack-btn { transition: none; }
}
/* ---------- Recherche globale Connect + mise en évidence ---------- */
.cx-searchres { display: grid; gap: 6px; margin-top: 8px; padding: 10px; border: 1px solid #dbe6f5; border-radius: 14px; background: #fff; }
.cx-searchres-t { display: flex; align-items: center; gap: 6px; font-size: 10.6px; font-weight: 900; letter-spacing: .6px; text-transform: uppercase; color: #7d8bab; }
.cx-res-groups { display: grid; gap: 4px; }
.cx-res-group { display: flex; justify-content: space-between; gap: 8px; border: 1px solid #e6edf8; background: #f7faff; border-radius: 10px; padding: 7px 9px; font: inherit; font-size: 12.2px; color: #1e2f47; cursor: pointer; text-align: left; }
.cx-res-group:hover { border-color: #b9d5f6; background: #eef4fd; }
.cx-res-group b { color: #0b3b82; }
.cx-res-group span { color: #7d8bab; font-size: 11px; }
.cx-res { display: grid; gap: 2px; width: 100%; border: 1px solid #e6edf8; background: #fff; border-radius: 10px; padding: 7px 9px; font: inherit; text-align: left; cursor: pointer; }
.cx-res:hover { border-color: #b9d5f6; background: #f5f9ff; }
.cx-res-space { font-size: 10.4px; font-weight: 900; letter-spacing: .4px; text-transform: uppercase; color: #1458d4; }
.cx-res-body { font-size: 12.3px; color: #1e2f47; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-res-time { font-size: 10.4px; color: #8a99b5; }
.cx-focus { animation: cxFocus 2.6s ease; }
@keyframes cxFocus {
  0%, 100% { box-shadow: none; }
  15%, 60% { box-shadow: 0 0 0 3px rgba(47, 128, 237, .35); background: #eef7ff; border-radius: 14px; }
}
.qn-badge.ping { animation: qnPing .9s ease; }
@keyframes qnPing {
  0% { transform: scale(1); }
  35% { transform: scale(1.35); box-shadow: 0 0 0 6px rgba(239, 68, 68, .18); }
  100% { transform: scale(1); }
}

/* ---------- Centre de notifications premium (filtres + états) ---------- */
.ncenter { display: grid; gap: 12px; }
.nc-toolbar { display: grid; gap: 8px; padding: 12px; border: 1px solid #dbe6f5; border-radius: 16px; background: linear-gradient(158deg, #ffffff, #f4f8ff); box-shadow: 0 10px 26px rgba(20, 60, 130, .06); }
.nc-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.nc-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d7e3f5; background: #fff; color: #33476a; border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 12.4px; font-weight: 700; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.nc-chip:hover { border-color: #a9c8ef; background: #f3f8ff; }
.nc-chip.on { background: linear-gradient(158deg, #2b6fd4, #123f85); border-color: #1d56ad; color: #fff; box-shadow: 0 6px 14px rgba(20, 70, 160, .22); }
.nc-chip-n { display: inline-grid; place-items: center; min-width: 20px; height: 19px; padding: 0 5px; border-radius: 999px; background: rgba(15, 61, 110, .08); font-size: 10.8px; font-weight: 900; }
.nc-chip.on .nc-chip-n { background: rgba(255, 255, 255, .22); color: #fff; }
.nc-summary { font-size: 12.2px; color: #5c6f8f; }
.nc-summary b { color: #123f85; }
.nc-list { display: grid; gap: 6px; }
.nc-item { display: grid; grid-template-columns: 38px 1fr; gap: 10px; width: 100%; text-align: left; border: 1px solid #e2eaf6; background: #fff; border-radius: 14px; padding: 11px 12px; font: inherit; cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .12s ease; }
.nc-item:hover { border-color: #b7d3f4; background: #f8fbff; transform: translateY(-1px); }
.nc-item.unread { border-left: 4px solid #2f80ed; background: linear-gradient(90deg, #f2f8ff, #fff 55%); }
.nc-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #eef4fd; color: #1f5db8; }
.nc-item.unread .nc-ico { background: linear-gradient(158deg, #e3efff, #d3e6ff); color: #0d3f8f; }
.nc-main { min-width: 0; }
.nc-title { display: flex; align-items: center; gap: 6px; }
.nc-title b { font-size: 13.6px; color: #14263f; }
.nc-dot { width: 8px; height: 8px; border-radius: 50%; background: #2f80ed; box-shadow: 0 0 0 3px rgba(47, 128, 237, .15); }
.nc-text { margin: 2px 0 5px; font-size: 12.6px; color: #4a5d7b; overflow-wrap: anywhere; }
.nc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 10.9px; color: #8191ab; }
.nc-type { padding: 2px 7px; border-radius: 999px; background: #eef3fb; color: #4b6b95; font-weight: 800; }
.nc-open { margin-left: auto; color: #1d5fbf; font-weight: 800; }
.nc-empty { display: grid; justify-items: center; gap: 6px; padding: 34px 12px; border: 1px dashed #c9d9ee; border-radius: 16px; color: #7d8bab; background: #fbfdff; }
.nc-empty p { margin: 0; font-size: 13px; }
@media (max-width: 560px) {
  .nc-chip { padding: 5px 9px; font-size: 11.6px; }
  .nc-item { grid-template-columns: 32px 1fr; padding: 10px; }
  .nc-ico { width: 32px; height: 32px; border-radius: 10px; }
  .nc-open { margin-left: 0; }
}

/* ---------- Prompt premium d’activation des notifications ---------- */
.ncp-modal .modal-body { padding-top: 4px; }
.ncp-title { display: flex; align-items: center; gap: 8px; }
.ncp-hero { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.ncp-hero-ico { display: grid; place-items: center; width: 52px; height: 52px; flex: 0 0 auto; border-radius: 16px; color: #fff; background: linear-gradient(158deg, #3d78d8, #123f85); box-shadow: 0 10px 22px rgba(20, 70, 160, .28); }
.ncp-hero h4 { margin: 2px 0 4px; font-size: 16px; color: #10233d; }
.ncp-hero p { margin: 0; font-size: 12.8px; color: #526583; }
.ncp-list { display: grid; gap: 6px; margin: 12px 0; padding: 0; list-style: none; }
.ncp-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 12.8px; color: #33476a; }
.ncp-list li svg { color: #1f8a4c; flex: 0 0 auto; margin-top: 2px; }
.ncp-ios, .ncp-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #eef5ff; border: 1px solid #cfe2fb; font-size: 12.2px; color: #24508c; }
.ncp-note { margin-top: 12px; }
.ncp-note.err { background: #fff3f1; border-color: #f6cdc6; color: #92321f; }

/* ---------- Appareils abonnés (Mon compte) ---------- */
.np-devices { display: grid; gap: 6px; margin-top: 8px; }
.np-dev-item { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 9px; border: 1px solid #e2eaf6; border-radius: 12px; padding: 8px 10px; background: #fff; }
.np-dev-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #eef4fd; color: #1f5db8; }
.np-dev-main { display: grid; gap: 1px; min-width: 0; }
.np-dev-main b { font-size: 12.8px; color: #14263f; }
.np-dev-main small { font-size: 10.9px; color: #8191ab; }
.np-dev-cur { width: fit-content; margin-top: 2px; padding: 1px 7px; border-radius: 999px; background: #e6f6ec; color: #1c7a44; font-size: 10px; font-weight: 900; }
.np-dev-empty { display: grid; gap: 5px; padding: 14px; border: 1px dashed #c9d9ee; border-radius: 12px; color: #7d8bab; font-size: 12.4px; background: #fbfdff; }
.np-dev-empty p { margin: 0; font-weight: 700; color: #40536f; }
@media (max-width: 560px) {
  .np-dev-item { grid-template-columns: 32px 1fr; }
  .np-dev-item .btn { grid-column: 1 / -1; justify-content: center; }
}
