/* estiam-newdesign.css — Design refonte v1-21 « Estiam · Syllabus »
   Source : maquettes standalone UXResearch/01-newdesign (+ Design System).
   Tokens (39), shell custom (header + sidebar + main) et classes partagées.
   Charger APRÈS le CSS MudBlazor. Dark mode : voir bloc [data-theme="dark"] / .mud-theme-dark. */

/* ============================ TOKENS — CLAIR ============================ */
:root {
  /* Surfaces */
  --bg: #F4F2ED;
  --surface: #FFFFFF;
  --surface-alt: #FBFAF7;
  --sunken: #EFEDE6;
  --header-fill: #FFFFFF;
  /* Bordures */
  --border: #E6E2D9;
  --border-strong: #D3CEC2;
  /* Encre / texte */
  --ink: #1A1C21;
  --ink-2: #565A63;
  --ink-3: #8A8E96;
  /* Primaire */
  --primary: #1F51C4;
  --primary-hover: #1A45A8;
  --primary-active: #153A8E;
  --primary-tint: #E7ECFB;
  --on-primary: #FFFFFF;
  /* Accent (corail) */
  --accent: #E0542A;
  --accent-tint: #FBE7DE;
  /* Focus */
  --focus: #8AA6EE;
  /* Sémantiques */
  --success: #1E7F52;  --success-tint: #E2F3EA;
  --warning: #9A6207;  --warning-tint: #F8EDD5;
  --error:   #BE3529;  --error-tint:   #F9E6E3;
  --info:    #1C6C97;  --info-tint:    #E1EEF6;
  /* Statuts (fond -b / texte -t) */
  --st-draft-b:#ECEAE3;  --st-draft-t:#565A63;
  --st-review-b:#F8EDD5;  --st-review-t:#8A5A00;
  --st-pub-b:#E2F3EA;    --st-pub-t:#155F3B;
  --st-arch-b:#E7EAEE;   --st-arch-t:#485360;
  --st-susp-b:#F9E6E3;   --st-susp-t:#93261D;
  /* Fontes */
  --font-head: 'Archivo', system-ui, sans-serif;
  --font-ui: 'Public Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* ============================ TOKENS — SOMBRE ============================ */
[data-theme="dark"], .mud-theme-dark {
  --bg: #14161A;
  --surface: #1C1F25;
  --surface-alt: #21242B;
  --sunken: #191C21;
  --header-fill: #1C1F25;
  --border: #2C3039;
  --border-strong: #3A3F4A;
  --ink: #ECEAE4;
  --ink-2: #A7ACB4;
  --ink-3: #737880;
  --primary: #7EA2F5;
  --primary-hover: #96B4F8;
  --primary-active: #6E96F2;
  --primary-tint: #22324F;
  --on-primary: #0E1830;
  --accent: #FF7A52;
  --accent-tint: #3A241A;
  --focus: #2C4C86;
  --success: #55C08A;  --success-tint: #16311F;
  --warning: #E0A64B;  --warning-tint: #382C12;
  --error:   #F0796C;  --error-tint:   #3A1F1B;
  --info:    #67B4DB;  --info-tint:    #14303D;
  --st-draft-b:#2A2E37;  --st-draft-t:#B6BBC3;
  --st-review-b:#3A2E14;  --st-review-t:#E7B15A;
  --st-pub-b:#16321F;    --st-pub-t:#63C793;
  --st-arch-b:#2A2F38;   --st-arch-t:#9AA3AE;
  --st-susp-b:#3A1F1B;   --st-susp-t:#F09083;
}

/* ============================ BASE ============================ */
body.es-app {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.es-app *, .es-app *::before, .es-app *::after { box-sizing: border-box; }

/* ============================ SHELL ============================ */
/* data-theme est porté par .es-shell : on y (re)fixe la couleur de texte de base pour que TOUT
   contenu non stylé (titres de page, cartes, KPI…) résolve var(--ink) sur le thème courant.
   Sans ça, body.es-app résout var(--ink) sur :root (thème clair) et le texte reste sombre en mode sombre. */
.es-shell { min-height: 100vh; background: var(--bg); color: var(--ink); display: flex; flex-direction: column; }

/* Header (58px) */
.es-header {
  height: 58px; flex-shrink: 0;
  background: var(--header-fill);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  position: sticky; top: 0; z-index: 30;
}
.es-header-burger { font-size: 22px; color: var(--ink-2); cursor: pointer; background: none; border: none; padding: 0; display: grid; place-items: center; }
.es-logo {
  width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 17px;
}
/* Logo Estiam (wordmark) dans le header. Le SVG source est blanc sur transparent : on le teinte par
   filtre — foncé (brightness 0) en thème clair, blanc (aucun filtre) en sombre — pour suivre l'encre
   comme le texte de marque. Logo provisoire (tâche de mise à jour du logo à venir). */
.es-brand-logo { height: 22px; width: auto; display: block; filter: brightness(0); }
[data-theme="dark"] .es-brand-logo { filter: none; }
.es-brand { font-family: var(--font-head); font-weight: 700; font-size: 15px; color: var(--ink); }
.es-brand .dot { color: var(--accent); }
.es-header-right { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--ink-2); }
/* Badge année (barre du haut) — pastille accent + « Année » + valeur mono (v1-22) */
.es-year-pill { display: inline-flex; align-items: center; gap: 7px; background: var(--sunken); padding: 4px 11px; border-radius: 8px; font-size: 12px; color: var(--ink-2); }
.es-year-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.es-year-pill-val { font-family: var(--font-mono); font-weight: 600; color: var(--ink); }
/* Sélecteur de langue de la barre d'application — MENU DÉROULANT (direction 2 des maquettes,
   docs/design/selecteur-langue/direction-2.html, retenue par l'éditeur le 2026-09-10). Il a remplacé
   le segment de deux ancres du 2026-09-10 : plus rien ne porte .es-lang-btn ni .es-lang-avis, tous
   deux retirés ici. Attention, /connexion N'EST PAS concernée — elle a ses propres .cx-lang* dans
   Connexion.razor.css, et elle n'emprunte pas ce layout (@layout LayoutConnexion).
   Aucune couleur littérale : uniquement des variables déjà définies plus haut. Le focus visible
   vient de la règle AA globale « .es-app a/button:focus-visible ». Rayon, bordure et ombre du
   panneau sont ceux du menu de la pastille utilisateur, pour que les deux menus de la barre soient
   le même objet à l'œil. */
.es-lang { position: relative; display: inline-flex; }

/* Pastille : globe + langue courante en toutes lettres + chevron. */
.es-lang-pastille {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 7px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; cursor: pointer;
  color: var(--ink-2); font-family: var(--font-ui); font-size: 12.5px; font-weight: 600;
  white-space: nowrap;
}
.es-lang-pastille:hover { background: var(--sunken); color: var(--ink); }
.es-lang-pastille[aria-expanded="true"] {
  background: var(--primary-tint); color: var(--primary); border-color: var(--primary);
}
.es-lang-ico { font-size: 18px; color: var(--ink-3); }
.es-lang-chev { font-size: 16px; color: var(--ink-3); }
.es-lang-pastille[aria-expanded="true"] .es-lang-ico,
.es-lang-pastille[aria-expanded="true"] .es-lang-chev { color: var(--primary); }

/* Fermeture au clic extérieur, sans JavaScript ni écouteur global : même overlay plein écran que
   le menu de la pastille utilisateur (MainLayout) et que les popovers de l'Explorer. Les deux z-index
   sont ceux de ce menu-là — ils se lisent dans le contexte d'empilement de .es-header (z-index 30). */
.es-lang-overlay { position: fixed; inset: 0; z-index: 35; }
.es-lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 36; width: 232px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  box-shadow: 0 16px 44px rgba(20, 22, 30, .18); padding: 6px;
  display: flex; flex-direction: column; gap: 1px;
  max-height: 420px; overflow-y: auto;
}
.es-lang-titre {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-2); padding: 6px 10px 7px; margin: 0;
}
/* L'entrée active ne se signale JAMAIS par la seule couleur : coche, graisse 700 et fond teinté
   la portent aussi, et aria-current la porte pour le lecteur d'écran. */
.es-lang-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px;
  text-decoration: none; color: var(--ink); font-size: 13px;
}
.es-lang-item:hover { background: var(--sunken); }
.es-lang-item.on { background: var(--primary-tint); color: var(--primary); font-weight: 700; }
.es-lang-item .msr { font-size: 17px; flex: 0 0 auto; }
/* Gouttière de la coche pour les entrées inactives : sans elle, les endonymes ne s'alignent pas. */
.es-lang-tick { width: 17px; flex: 0 0 auto; }
.es-lang-sep { height: 1px; background: var(--border); margin: 5px 4px; }
/* Pied : une ÉCRITURE, donc un <button>, jamais une ancre — d'où la remise à plat des styles de
   bouton natifs, que .es-lang-item n'a pas à faire. */
.es-lang-foot {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 7px 10px; border-radius: 8px; border: none; background: none; cursor: pointer;
  font-family: var(--font-ui); font-size: 12px; color: var(--ink-2);
}
.es-lang-foot:hover:not(:disabled) { background: var(--sunken); color: var(--primary); }
.es-lang-foot:disabled { cursor: default; opacity: .6; }
.es-lang-foot .msr { font-size: 16px; flex: 0 0 auto; }
.es-lang-ok, .es-lang-erreur { margin: 2px 4px 4px; font-size: 11.5px; line-height: 1.45; }
.es-lang-ok { color: var(--success); }
.es-lang-erreur { color: var(--error); }

.es-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--primary-tint); color: var(--primary);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.es-header-user { display: flex; align-items: center; gap: 9px; }

/* Body split : sidebar + main */
.es-body { display: flex; flex: 1; min-height: calc(100vh - 58px); }

/* Sidebar (238px) */
.es-sidebar {
  width: 238px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 58px; align-self: flex-start;
  height: calc(100vh - 58px);
}
.es-sidebar-scroll { flex: 1; overflow-y: auto; }

.es-nav { padding: 8px 10px; display: flex; flex-direction: column; gap: 1px; }
.es-nav-group {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .11em; text-transform: uppercase;
  color: var(--ink-3); padding: 14px 12px 6px;
}
.es-nav-group:first-child { padding-top: 10px; }

/* Item de navigation */
.navlink, a.navlink {
  display: flex; align-items: center; gap: 13px; padding: 10px 12px; border-radius: 9px;
  color: var(--ink-2); cursor: pointer; text-decoration: none; position: relative;
  transition: background .12s;
}
.navlink:hover { background: var(--sunken); }
.es-menu-item:hover { background: var(--sunken); }
.navlink .msr { font-size: 21px; color: var(--ink-3); }
.navlink .navlink-label { font-size: 13.5px; }
.navlink .navlink-badge { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); }
.navlink .navlink-badge-error {
  margin-left: auto; font-family: var(--font-ui); font-size: 10.5px; font-weight: 600; color: #fff;
  background: var(--error); padding: 1px 7px; border-radius: 999px;
}
/* Item actif */
.navlink.active {
  color: var(--primary); font-weight: 600; background: var(--primary-tint);
}
.navlink.active .msr { color: var(--primary); font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.navlink.active .navlink-badge { color: var(--primary); }
.navlink.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px;
  background: var(--primary);
}

/* ── v1-217 · TROISIÈME NIVEAU DE NAVIGATION ────────────────────────────────────────────────
   Grammaire : un titre en petites capitales (.es-nav-group) est un GROUPE inerte ; une ligne
   terminée par un chevron à droite (.es-nav-parent) est un CONTENEUR dépliable, sans page ; toute
   autre ligne est une DESTINATION. Maquette « Parents dépliables » (jeu B) : le parent porte une
   icône comme les autres lignes — la colonne d'icône reste homogène — et le chevron, poussé à
   droite, ne sert plus qu'à signaler le repli. */
.es-nav-parent {
  width: 100%; text-align: left; border: none; background: transparent;
  font-family: var(--font-ui); font-weight: inherit;
}
/* Un seul glyphe pour les deux états : la rotation dit l'ouverture, pilotée par aria-expanded —
   l'attribut d'accessibilité et l'apparence ne peuvent donc pas se contredire. */
.es-nav-parent .es-nav-chevron {
  margin-left: auto; font-size: 20px; transition: transform .18s ease;
}
.es-nav-parent[aria-expanded="true"] .es-nav-chevron { transform: rotate(180deg); }
/* Un parent dont un enfant est actif s'appuie discrètement — sans concurrencer l'enfant actif. */
.es-nav-parent.es-nav-parent-actif .navlink-label { color: var(--ink); font-weight: 600; }
.es-nav-parent.es-nav-parent-actif .msr { color: var(--ink-2); }

/* Sous-groupe : filet de guidage à gauche, comme un arbre. L'accent d'item actif (::before, à
   left:0 du .navlink) se pose juste à droite du filet — la hiérarchie reste lisible. */
.es-nav-sub {
  display: flex; flex-direction: column; gap: 1px;
  margin: 1px 0 3px 22px; padding-left: 10px; border-left: 1px solid var(--border);
}
.es-nav-sub .navlink { padding-left: 9px; gap: 11px; }
.es-nav-sub .navlink .msr { font-size: 19px; }
.es-nav-sub .navlink .navlink-label { font-size: 13px; }

/* Pied de sidebar : profil / thème */
.es-sidebar-footer { margin-top: auto; padding: 10px; border-top: 1px solid var(--border); }
.es-user-row { display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: 9px; }
.es-user-meta { min-width: 0; line-height: 1.2; }
.es-user-name { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.es-user-mail { font-size: 11px; color: var(--ink-3); }
.es-user-logout { margin-left: auto; font-size: 20px; color: var(--ink-3); background: none; border: none; cursor: pointer; padding: 0; display: grid; place-items: center; }
.es-theme-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; font-size: 12.5px; color: var(--ink-2); }
.es-theme-row .msr { font-size: 19px; color: var(--ink-3); }
.es-theme-row .es-theme-label { flex: 1; }

/* Main */
.es-main { flex: 1; min-width: 0; overflow-x: hidden; }
.es-main-inner { padding: 0; }

/* Sidebar repliée */
.es-shell.es-collapsed .es-sidebar { display: none; }

/* ============================ COMPOSANTS PARTAGÉS ============================ */
/* Icônes (repli si fonts.css absent) */
.msr { font-family: 'Material Symbols Rounded'; font-weight: 400; line-height: 1; font-style: normal; -webkit-font-smoothing: antialiased; }

/* Cartes cliquables « quick action » */
.qa { transition: all .15s; }
.qa:hover { border-color: var(--primary) !important; box-shadow: 0 2px 10px rgba(31,81,196,.10) !important; transform: translateY(-1px); }
.qa:hover .qa-go { color: var(--primary) !important; transform: translateX(2px); }
.qa-go { transition: all .15s; }

/* KPI */
.kpi { transition: all .13s; cursor: pointer; }
.kpi:hover { border-color: var(--primary) !important; box-shadow: 0 2px 10px rgba(31,81,196,.09) !important; }

/* Lignes de tableau */
.srow { transition: background .1s; cursor: pointer; }
.srow:hover { background: var(--primary-tint) !important; }

/* Champ de saisie « nu » */
.es-input { border: none; outline: none; background: transparent; font-family: var(--font-ui); font-size: 15px; color: var(--ink); width: 100%; }
.es-input::placeholder { color: var(--ink-3); }

/* Formulaires (v1-10) : label, champ encadré, aide, lien retour */
.es-lbl { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.es-field { width: 100%; box-sizing: border-box; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); padding: 10px 12px; font-family: var(--font-ui); font-size: 14px; color: var(--ink); outline: none; }
.es-field:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
.es-field::placeholder { color: var(--ink-3); }
.es-hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.es-back:hover { color: var(--primary); }

/* Focus visible AA */
.es-app a:focus-visible, .es-app button:focus-visible, .es-input:focus-visible, .navlink:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--focus);
}

/* ============================ CHIPS STATUT / GRAVITÉ ============================ */
.es-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: 600; font-size: 11.5px; border-radius: 999px; padding: 2px 10px; line-height: 1.5;
}
.chip-brouillon { background: var(--st-draft-b); color: var(--st-draft-t); }
.chip-relecture { background: var(--st-review-b); color: var(--st-review-t); }
.chip-publie    { background: var(--st-pub-b);   color: var(--st-pub-t); }
.chip-suspendu  { background: var(--st-susp-b);  color: var(--st-susp-t); }
.chip-archive   { background: var(--st-arch-b);  color: var(--st-arch-t); }
.grav-info   { background: var(--info-tint);    color: var(--info); }
.grav-avert  { background: var(--warning-tint); color: var(--warning); }
.grav-erreur { background: var(--error-tint);   color: var(--error); }

/* Pastille arrondie générique (v1-163) — socle commun des petites étiquettes stylées en ligne
   (statut, attribut cours, « obligatoire », tags Cadre/Transversal/Intl…). Couleur, padding,
   taille de police et bordure restent portés en ligne au point d'appel (variations propres à
   chaque pastille) ; seuls les traits invariants sont mutualisés ici. */
.es-pill { display: inline-flex; align-items: center; font-weight: 600; border-radius: 999px; }

/* ============================ PAGES REFONTE (v1-21) ============================ */
/* Conteneur de page générique — padding fidèle aux maquettes (region CONTENT). */
.es-page { padding: 28px 36px 40px; min-width: 0; }
@media (max-width: 900px) { .es-page { padding: 22px 20px 32px; } }

/* Tableau de bord (v1-21c) */
.es-tb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.es-tb-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.es-tb-panels { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; margin-top: 22px; }
.es-year-select {
  height: 40px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 0 34px 0 13px;
  font-size: 13px; font-family: var(--font-ui); background: var(--surface); color: var(--ink); cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238A8E96' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 9px center;
}
@media (max-width: 1000px) { .es-tb-kpis { grid-template-columns: repeat(2, 1fr); } .es-tb-panels { grid-template-columns: 1fr; } }

/* Toolbar + tableaux (v1-21d Catalogue, réutilisable) */
.es-toolbar { display: flex; gap: 12px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.es-tool-box { height: 44px; border: 1px solid var(--border-strong); border-radius: 9px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--surface); }
.es-tool-search { flex: 1; min-width: 220px; transition: border-color .15s, box-shadow .15s; }
.es-sel { border: none; outline: none; background: transparent; font-family: var(--font-ui); font-size: 13px; color: var(--ink); cursor: pointer; max-width: 200px; }
.es-count { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); margin-bottom: 10px; }
.es-tablecard { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.es-tablescroll { overflow-x: auto; }
.es-cat-row { display: grid; grid-template-columns: 120px 120px 1.2fr 1.2fr 130px 150px; min-width: 940px; }
.trow { transition: background .1s; }
.trow:hover { background: var(--primary-tint) !important; }
.es-pageicon { cursor: pointer; user-select: none; }
.es-pageicon.es-disabled { opacity: .4; cursor: default; pointer-events: none; }

/* Fiche cours (v1-21e) — carte d'en-tête + consultation/édition custom */
.es-fiche-head { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; margin-bottom: 12px; }
.es-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.es-h2 { font-family: var(--font-head); font-weight: 600; font-size: 18px; margin: 24px 0 12px; }
.es-h2 .es-h2-sub { font-size: 13px; color: var(--ink-2); font-weight: 400; }
.es-sec { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.es-sec-head { display: flex; align-items: center; gap: 10px; padding: 15px 20px; cursor: pointer; }
.es-sec-head.open { border-bottom: 1px solid var(--border); background: var(--surface-alt); }
.es-sec-title { font-family: var(--font-head); font-weight: 600; font-size: 15px; }
.es-visz { font-size: 10.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.es-count { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.es-del { color: var(--ink-3); cursor: pointer; user-select: none; }
.es-del:hover { color: var(--error); }
.fld { width: 100%; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font-family: var(--font-ui); font-size: 13px; padding: 8px 11px; outline: none; }
.fld:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
.fld::placeholder { color: var(--ink-3); }
.es-fld-label { font-size: 10px; font-weight: 600; color: var(--ink-3); margin-bottom: 4px; }
.es-btn-primary-sm, .es-btn-ghost-sm { height: 34px; font-size: 12.5px; padding: 0 13px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; font-family: var(--font-ui); }
.es-btn-primary-sm { background: var(--primary); color: #fff; border: none; }
.es-btn-ghost-sm { background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); }
.es-btn-primary-sm:disabled, .es-btn-ghost-sm:disabled { opacity: .55; cursor: default; }
.es-seg { display: flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; font-size: 12.5px; font-weight: 600; }
.es-seg > button { flex: 1; text-align: center; padding: 8px 0; background: transparent; border: none; border-left: 1px solid var(--border-strong); color: var(--ink-2); cursor: pointer; font-family: var(--font-ui); font-weight: 600; }
.es-seg > button:first-child { border-left: none; }
.es-seg > button.active { background: var(--primary); color: #fff; }
.es-seg.disabled { opacity: .7; pointer-events: none; }
.es-banner { display: flex; gap: 11px; padding: 12px 15px; border-radius: 9px; margin-bottom: 14px; font-size: 12.5px; color: var(--ink); }
.es-banner-info { background: var(--info-tint); border-left: 3px solid var(--info); }
.es-banner-success { background: var(--success-tint); border-left: 3px solid var(--success); }
.es-banner-warn { background: var(--warning-tint); border-left: 3px solid var(--warning); }
.es-banner-error { background: var(--error-tint); border-left: 3px solid var(--error); }
@keyframes es-spin { to { transform: rotate(360deg); } }
@media (max-width: 820px) { .es-fiche-lifecycle { grid-template-columns: 1fr; } }
.es-aff-row { display: grid; grid-template-columns: 90px 1.2fr 60px 60px 130px 90px 90px 70px; min-width: 720px; }
.es-gpill { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 999px; border: 1.5px solid var(--border-strong); font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; }
.es-qi-row { display: grid; grid-template-columns: 130px 200px 180px 1fr; gap: 14px; min-width: 760px; }
/* v1-10 (#565) : une 6e colonne, le NOM du programme, insérée après le code. */
.es-prog-row { display: grid; grid-template-columns: 1.1fr 2fr 150px .7fr .7fr 1fr; min-width: 860px; }
.es-coh-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.es-coh-cols { display: grid; grid-template-columns: 0.85fr 1.35fr; gap: 18px; align-items: start; margin-top: 18px; }
.es-coh-row { display: grid; grid-template-columns: 100px 1.2fr 90px 1.7fr 90px; gap: 10px; min-width: 640px; }
@media (max-width: 1000px) { .es-coh-kpis { grid-template-columns: repeat(2, 1fr); } .es-coh-cols { grid-template-columns: 1fr; } }
.es-fbtn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border-strong); font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; }
.es-exp-row { display: grid; grid-template-columns: 70px 90px 1.3fr 110px 50px 80px 70px 62px 70px 60px; gap: 8px; min-width: 940px; }
.es-comp-row { display: grid; grid-template-columns: 120px 1fr 70px 90px 150px 100px 90px; min-width: 760px; }
.es-rec-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; }
.es-imp-top { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; margin-bottom: 28px; }
.es-imp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.es-kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.es-kv:last-child { border-bottom: none; }
.es-kv .v { font-family: var(--font-mono); font-weight: 600; }
.es-lots-row { display: grid; grid-template-columns: 1fr 150px 150px 180px; min-width: 700px; }
.es-step { width: 24px; height: 24px; border-radius: 7px; background: var(--primary); color: #fff; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 12px; flex-shrink: 0; }
.es-drop { border: 1.5px dashed var(--border-strong); border-radius: 11px; padding: 16px; background: var(--surface-alt); display: flex; align-items: center; gap: 13px; transition: border-color .12s, background .12s; }
label:hover > .es-drop { border-color: var(--primary); }
/* Label flottant (Export / Reconduction) */
.es-flabel { position: absolute; top: -8px; left: 12px; background: var(--surface); padding: 0 6px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); z-index: 2; }
.es-dd { position: absolute; left: 0; right: 0; top: 62px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; box-shadow: 0 16px 44px rgba(20,22,30,.18); overflow: hidden; z-index: 30; padding: 6px; }
.es-cal { position: absolute; top: 64px; left: 0; width: 320px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 44px rgba(20,22,30,.22); overflow: hidden; z-index: 40; }
.es-cal-day { height: 36px; display: grid; place-items: center; border-radius: 50%; font-size: 13px; cursor: pointer; }
.es-cal-day:hover { background: var(--sunken); }
.es-cal-day.sel { background: var(--primary); color: #fff; font-weight: 700; }
.es-cal-day.sel:hover { background: var(--primary); }
@media (max-width: 900px) { .es-imp-top, .es-imp-grid { grid-template-columns: 1fr; } }
.es-btn-primary { display: inline-flex; height: 38px; align-items: center; gap: 7px; padding: 0 16px; border-radius: 8px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 600; border: none; cursor: pointer; font-family: var(--font-ui); }
.es-btn-primary:disabled { opacity: .55; cursor: default; }
.es-btn-ghost { display: inline-flex; height: 38px; align-items: center; gap: 7px; padding: 0 15px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font-ui); }
.es-btn-ghost:disabled { opacity: .55; cursor: default; }

/* Chevron de repli : « expand_less » est absent du subset Material → on garde « expand_more »
   et on le pivote de 180° à l'ouverture (rendu identique, un seul glyphe embarqué). */
.msr.es-flip { transform: rotate(180deg); }

/* ============================ SÉLECTEUR DE MODE (v1-36) ============================ */
.es-segmented { display: flex; gap: 10px; flex-wrap: wrap; max-width: 900px; }
.es-seg { flex: 1 1 320px; display: flex; align-items: center; gap: 12px; text-align: left; padding: 13px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--ink-2); cursor: pointer; font-family: var(--font-ui); transition: border-color .12s, background .12s, box-shadow .12s; }
.es-seg:hover { border-color: var(--primary); }
.es-seg .msr { font-size: 24px; color: var(--ink-3); flex-shrink: 0; }
.es-seg-t { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.es-seg-d { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.es-seg-on { border-color: var(--primary); background: var(--primary-tint); box-shadow: 0 0 0 1px var(--primary) inset; }
.es-seg-on .msr { color: var(--primary); }

/* ============================ PAGE ACCUEIL (v1-21b) ============================ */
.es-home { padding: 28px 36px 40px; min-width: 0; }
.es-home-title { font-family: var(--font-head); font-weight: 700; font-size: 28px; letter-spacing: -.02em; margin: 0 0 20px; }
.es-home-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 13px; }
.es-home-cols { display: grid; grid-template-columns: 1fr 1.05fr; gap: 26px; align-items: start; }
@media (max-width: 900px) {
  .es-home { padding: 22px 20px 32px; }
  .es-home-cols { grid-template-columns: 1fr; }
}

/* ============================ HELPERS ============================ */
.es-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.es-accent { color: var(--accent); }
.es-muted { color: var(--ink-2); }
.es-muted-3 { color: var(--ink-3); }

/* ============================ REFONTE ADMIN (2026-07-16) ============================ */
/* Brief : docs/design/refonte-admin/rapport-references-mobbin.html (références Mobbin).
   Briques réutilisables pour les écrans back-office (identités, accès, journaux, bugs). */

/* Aliases de compat : --muted / --border-faible étaient utilisés dans les pages SANS être
   définis → var(--muted) retombait sur l'encre pleine. On les aligne sur les vrais tokens
   (résolus par thème via --ink-3 / --border). */
:root { --muted: var(--ink-3); --border-faible: var(--border); }

/* En-tête de page : titre + compteur à gauche, actions primaires à droite */
.es-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 4px; }
.es-page-head .es-ph-l { min-width: 0; }
.es-page-head .es-ph-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding-top: 4px; }
.es-count-badge { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--sunken); padding: 2px 9px; border-radius: 999px; margin-left: 10px; vertical-align: middle; }

/* Onglets (segmented control) — remplace l'ancienne barre .es-seg des pages admin.
   Conteneur .es-segtabs + boutons .es-seg-btn (.es-seg-on = actif). */
.es-segtabs { display: inline-flex; gap: 3px; padding: 3px; background: var(--sunken); border: 1px solid var(--border); border-radius: 11px; flex-wrap: wrap; }
.es-segtabs .es-seg-btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border: none; background: transparent; color: var(--ink-2); font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; border-radius: 8px; cursor: pointer; transition: background .12s, color .12s; }
.es-segtabs .es-seg-btn .msr { color: inherit; }
.es-segtabs .es-seg-btn:hover { color: var(--ink); background: var(--surface); }
.es-segtabs .es-seg-btn.es-seg-on { background: var(--surface); color: var(--primary); box-shadow: none; border-color: transparent; }
.es-segtabs .es-seg-btn.es-seg-on .msr { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

/* Cellule identité : avatar initiales + nom + email empilés */
.es-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.es-ava { width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--primary-tint); color: var(--primary); font-family: var(--font-head); }
.es-id-meta { min-width: 0; line-height: 1.25; display: flex; flex-direction: column; }
.es-id-name { display: block; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.es-id-mail { display: block; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Table dense normalisée */
.es-dtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.es-dtable thead th { text-align: left; padding: 9px 14px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); background: var(--surface-alt); border-bottom: 1px solid var(--border); white-space: nowrap; }
.es-dtable thead th.r { text-align: right; }
.es-dtable thead th.c { text-align: center; }
.es-dtable tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--ink); vertical-align: middle; }
.es-dtable tbody tr:last-child td { border-bottom: none; }
.es-dtable tbody tr.es-clickable { cursor: pointer; }
.es-dtable tbody tr:hover { background: var(--primary-tint); }
.es-td-time { white-space: nowrap; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.es-td-num { text-align: center; font-family: var(--font-mono); }
.es-td-right { text-align: right; white-space: nowrap; }
.es-td-right > * + * { margin-left: 8px; }
.es-td-mono { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }
.es-td-strong { font-weight: 600; }
.es-td-trunc { max-width: 360px; }
.es-td-trunc > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.es-empty { padding: 34px 20px; text-align: center; color: var(--ink-3); }

/* Chips sémantiques génériques (statut / résultat / gravité) — remplacent les hex codés en dur */
.es-chip.st-ok   { background: var(--success-tint); color: var(--success); }
.es-chip.st-warn { background: var(--warning-tint); color: var(--warning); }
.es-chip.st-err  { background: var(--error-tint);   color: var(--error); }
.es-chip.st-info { background: var(--info-tint);    color: var(--info); }
.es-chip.st-neu  { background: var(--sunken);       color: var(--ink-2); }
.es-chip.st-sys  { background: var(--primary-tint); color: var(--primary); }

/* Filet d'accent de gravité à gauche des lignes (Sentry-like) */
.es-dtable tbody tr.es-acc-err  > td:first-child { box-shadow: inset 3px 0 0 var(--error); }
.es-dtable tbody tr.es-acc-warn > td:first-child { box-shadow: inset 3px 0 0 var(--warning); }
.es-dtable tbody tr.es-acc-info > td:first-child { box-shadow: inset 3px 0 0 var(--info); }
.es-dtable tbody tr.es-acc-neu  > td:first-child { box-shadow: inset 3px 0 0 var(--border-strong); }

/* Barre de filtres normalisée */
.es-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; }
.es-filters .es-f { display: flex; flex-direction: column; gap: 4px; }
.es-f-label { font-size: 11px; font-weight: 600; color: var(--ink-3); }
.es-f-grow { flex: 1; min-width: 200px; }
.es-f-right { margin-left: auto; display: flex; gap: 6px; align-items: center; }

/* Matrice de permissions : cellules d'état cliquables colorées */
.es-matrix { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 620px; }
.es-matrix thead th { padding: 9px 8px; text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); background: var(--surface-alt); border-bottom: 1px solid var(--border); }
.es-matrix thead th:first-child { text-align: left; }
.es-matrix tbody td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: center; }
.es-matrix tbody td:first-child { text-align: left; font-weight: 600; color: var(--ink); }
.es-matrix tbody tr:last-child td { border-bottom: none; }
.es-matrix tbody tr:hover { background: var(--surface-alt); }
.es-cell { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 96px; height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); font-family: var(--font-ui); font-size: 12px; font-weight: 600; color: var(--ink-3); cursor: pointer; transition: background .1s, border-color .1s, color .1s; }
.es-cell .msr { font-size: 15px; }
.es-cell:hover { border-color: var(--primary); }
.es-cell.on  { background: var(--success-tint); border-color: transparent; color: var(--success); }
.es-cell.off { background: var(--error-tint);   border-color: transparent; color: var(--error); }
.es-cell:disabled { cursor: default; opacity: .55; }
.es-cell:disabled:hover { border-color: var(--border-strong); }

/* Panneau de détail (journaux / bugs) */
.es-detail { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-top: 18px; }
.es-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.es-detail-title { font-family: var(--font-head); font-weight: 700; font-size: 16px; }
.es-detail-title .id { color: var(--ink-3); font-weight: 400; font-family: var(--font-mono); font-size: 13px; }
.es-kvgrid { display: grid; grid-template-columns: 160px 1fr; gap: 6px 16px; font-size: 13px; }
.es-kvgrid .k { color: var(--ink-3); }
.es-json { white-space: pre-wrap; font-size: 12px; font-family: var(--font-mono); background: var(--sunken); padding: 12px; border-radius: 8px; overflow-x: auto; max-height: 340px; color: var(--ink); }
.es-close { cursor: pointer; color: var(--ink-3); user-select: none; }
.es-close:hover { color: var(--ink); }
.es-danger-sm { color: var(--error) !important; border-color: var(--error) !important; }

/* ============================ REFONTE CONSULTATION (vol. 2, 2026-07-16) ============================ */
/* Brief : docs/design/refonte-admin/rapport-references-mobbin-vol2.html (Catalogue/Explorer/Cohérence). */

/* Chips de filtres actifs, retirables un à un (pattern Aboard/Dovetail) */
.es-active-filters { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-bottom: 12px; }
.es-afchip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 7px 3px 11px; border-radius: 999px; background: var(--primary-tint); color: var(--primary); }
.es-afchip .k { font-weight: 400; opacity: .78; }
.es-afchip .msr { font-size: 15px; cursor: pointer; border-radius: 50%; padding: 1px; }
.es-afchip .msr:hover { background: rgba(0,0,0,.10); }
.es-af-clear { font-size: 12px; font-weight: 600; color: var(--ink-3); cursor: pointer; user-select: none; }
.es-af-clear:hover { color: var(--error); }

/* Barre de progression fine (KPI Vanta-like) */
.es-progress { height: 6px; border-radius: 999px; background: var(--sunken); overflow: hidden; margin-top: 10px; }
.es-progress > span { display: block; height: 100%; border-radius: 999px; background: var(--success); transition: width .25s; }
.es-progress > span.warn { background: var(--warning); }
.es-progress > span.err { background: var(--error); }
.es-kpi-sub { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--ink-3); margin-top: 5px; font-family: var(--font-mono); }

/* ============ 5ᵉ MODE D'IMPORT — « Compléter des fiches » (v1-225, #764) ============
   Maquette B de l'étude v1-219 : la portée à gauche, l'aperçu qui se recalcule à droite. */

/* Sous-onglets d'un mode (préparer / historique) — plus légers que .es-segmented, qui porte déjà
   le choix du MODE : deux sélecteurs de même poids visuel se disputeraient la lecture. */
.es-subtab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-3); font-family: var(--font-ui); font-size: 13px; font-weight: 600; cursor: pointer; transition: color .12s, border-color .12s; }
.es-subtab:hover { color: var(--ink); }
.es-subtab-on { color: var(--primary); border-bottom-color: var(--primary); }

/* Puce de palier de portée : cliquable, à deux états. Le compteur « n sur N » vit à côté du
   libellé du palier, pas dans la puce — sinon chaque puce porterait un nombre sans rapport. */
.es-chip-portee { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); font-family: var(--font-ui); font-size: 11.5px; font-weight: 600; cursor: pointer; transition: border-color .12s, background .12s, color .12s; }
.es-chip-portee:hover { border-color: var(--primary); color: var(--ink); }
.es-chip-portee-on { border-color: var(--primary); background: var(--primary-tint); color: var(--primary); }

.es-fiches-cols { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; align-items: start; }
.es-fiches-compteurs { display: flex; flex-wrap: wrap; gap: 9px; }
.es-fiches-row { display: grid; grid-template-columns: 118px 108px minmax(0, 1fr); gap: 12px; min-width: 520px; }
.es-exec-row { display: grid; grid-template-columns: 128px 96px minmax(0, 1fr) 150px; gap: 12px; min-width: 620px; }

@media (max-width: 1100px) { .es-fiches-cols { grid-template-columns: 1fr; } }

/* ============================================================================
   v1-250 — ASSISTANT GUIDÉ D'IMPORT DE FICHES (2026-07-26)
   Le fil des 5 étapes, les cartes-choix de portée et la barre de navigation.
   ============================================================================ */
.es-wiz-steps { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 4px 0 18px; max-width: 940px; }
.es-wiz-step { display: inline-flex; align-items: center; gap: 7px; border: none; background: transparent; padding: 5px 8px; border-radius: 8px; font-family: var(--font-ui); font-size: 12px; font-weight: 600; color: var(--ink-3); cursor: default; }
.es-wiz-step:not(:disabled) { cursor: pointer; }
.es-wiz-step:not(:disabled):hover { background: var(--surface); color: var(--ink); }
.es-wiz-num { width: 21px; height: 21px; border-radius: 999px; background: var(--sunken); color: var(--ink-3); font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.es-wiz-on { color: var(--ink); }
.es-wiz-on .es-wiz-num { background: var(--primary); color: #fff; }
.es-wiz-done { color: var(--ink-2); }
.es-wiz-done .es-wiz-num { background: var(--success-tint); color: var(--success); }
.es-wiz-sep { width: 18px; height: 2px; border-radius: 2px; background: var(--border-strong); flex-shrink: 0; }
.es-wiz-choice { display: flex; align-items: flex-start; gap: 11px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 11px; background: var(--surface); cursor: pointer; transition: border-color .12s, background .12s; }
.es-wiz-choice:hover { border-color: var(--primary); }
.es-wiz-choice-on { border-color: var(--primary); background: var(--primary-tint); box-shadow: 0 0 0 1px var(--primary) inset; }
.es-wiz-effet { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 4px; }
.es-wiz-choice-on .es-wiz-effet { color: var(--ink-2); }
.es-wiz-foot { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ============================================================================
   v1-251 — SÉLECTEUR « DEUX VITESSES » DU HUB D'IMPORT (2026-07-26, Direction 2)
   Deux portes : la posture avant l'opération. Le danger du mode Modèle se voit
   au moment du choix (benchmark Mobbin, motif M6).
   ============================================================================ */
.es-hub-doors { display: flex; gap: 14px; align-items: stretch; flex-wrap: wrap; max-width: 1100px; }
.es-hub-door { flex: 1 1 380px; min-width: 0; border-radius: 14px; padding: 17px 19px; background: var(--surface); border: 1px solid var(--border-strong); }
.es-hub-door-guide { border-color: var(--primary); }
.es-hub-door-on { background: var(--primary-tint); box-shadow: 0 0 0 1px var(--primary) inset; }
.es-hub-steps { display: flex; flex-direction: column; gap: 5px; }
.es-hub-step { font-size: 11.5px; color: var(--ink-2); display: flex; align-items: baseline; gap: 7px; }
.es-hub-step b { font-weight: 600; color: var(--ink); }
.es-hub-step-n { width: 18px; height: 18px; border-radius: 999px; background: var(--primary-tint); color: var(--primary); font-family: var(--font-mono); font-size: 10px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; align-self: center; }
.es-hub-door-on .es-hub-step-n { background: var(--surface); }
.es-hub-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-alt); color: var(--ink); font-family: var(--font-ui); cursor: pointer; transition: border-color .12s, background .12s; }
.es-hub-row:hover { border-color: var(--primary); }
.es-hub-row .msr { font-size: 19px; color: var(--ink-3); flex-shrink: 0; }
.es-hub-row-t { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.es-hub-row-d { font-size: 10.5px; color: var(--ink-3); line-height: 1.4; flex: 1; text-align: right; min-width: 0; }
.es-hub-row-on { border-color: var(--primary); background: var(--primary-tint); box-shadow: 0 0 0 1px var(--primary) inset; }
.es-hub-row-on .msr { color: var(--primary); }
.es-hub-row-danger { border-color: color-mix(in srgb, var(--error) 32%, var(--surface)); background: color-mix(in srgb, var(--error-tint) 46%, var(--surface)); }
.es-hub-row-danger:hover { border-color: var(--error); }
.es-hub-row-danger .msr { color: var(--error); }
.es-hub-row-danger.es-hub-row-on { border-color: var(--error); box-shadow: 0 0 0 1px var(--error) inset; background: var(--error-tint); }
.es-hub-row-ghost { border-style: dashed; opacity: .72; cursor: default; }
.es-hub-row-ghost:hover { border-color: var(--border); }

/* ============================ v1-10 — IDENTITÉ D'UN PROGRAMME (#565) ============================
   Vue « Identité » de /programmes/{id} : en-tête de carte, paires de champs, et la liste répétable
   des reconnaissances (motif « entrée encadrée + ajouter », benchmark Mobbin M2).
   ⚠ Préfixe .es-rec-* volontaire : .es-seg-t est déjà pris (titre des cartes de mode v1-36). */

.es-card-head { padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.es-card-title { font-family: var(--font-head); font-size: 15px; font-weight: 700; margin: 0; }

.es-fieldrow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.es-entry { border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden;
  background: var(--surface-alt); }
.es-entry + .es-entry { margin-top: 12px; }
.es-entry-head { background: var(--sunken); padding: 6px 8px 6px 12px; display: flex;
  align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.es-entry-n { font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--ink-2); letter-spacing: .04em; }

.es-rec-types { display: inline-flex; background: var(--sunken); border-radius: 8px; padding: 3px;
  gap: 2px; flex-wrap: wrap; }
.es-rec-type { font-family: var(--font-ui); font-size: 12px; font-weight: 600; color: var(--ink-2);
  padding: 5px 11px; border-radius: 6px; border: 0; background: transparent; cursor: pointer;
  white-space: nowrap; }
.es-rec-type:hover:not(:disabled) { color: var(--ink); }
.es-rec-type-on { background: var(--surface); color: var(--primary); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.es-rec-type:disabled { cursor: default; opacity: .6; }

.es-add-entry { width: 100%; height: 40px; margin-top: 12px; border: 1px dashed var(--border-strong);
  border-radius: 10px; background: var(--surface-alt); color: var(--primary); font-family: var(--font-ui);
  font-weight: 600; font-size: 13px; display: flex; align-items: center; justify-content: center;
  gap: 7px; cursor: pointer; }
.es-add-entry:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-tint); }
.es-add-entry:disabled { cursor: default; opacity: .55; }

.es-identite-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
@media (max-width: 900px) {
  .es-identite-grid { grid-template-columns: 1fr; }
  .es-fieldrow { grid-template-columns: 1fr; }
}

/* ============================ v1-10 — IMPORT DE PROGRAMME (#565, D5) ============================ */
.es-lock-row { display: flex; align-items: center; gap: 9px; padding: 9px 12px; background: var(--sunken);
  border-radius: 8px; font-size: 12.5px; flex: 1; min-width: 240px; }
.es-lock-row .msr { font-size: 16px; color: var(--ink-3); }

.es-qcard { border: 1px solid var(--border-strong); border-radius: 10px; padding: 14px;
  background: var(--surface); }
.es-qcard + .es-qcard { margin-top: 12px; }
.es-qcard h4 { font-family: var(--font-head); font-size: 14px; font-weight: 700; margin: 0 0 3px; }
.es-qhint { margin: 0 0 8px; font-size: 12px; color: var(--ink-2); }

.es-opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; width: 100%; text-align: left;
  font-family: var(--font-ui); cursor: pointer; color: var(--ink); }
.es-opt:hover:not(:disabled) { background: var(--surface-alt); }
.es-opt-on { border-color: var(--primary); background: var(--primary-tint); }
.es-opt-on:hover:not(:disabled) { background: var(--primary-tint); }
.es-opt:disabled { cursor: default; opacity: .6; }
.es-opt-t { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.es-opt-d { display: block; font-size: 12px; color: var(--ink-2); margin-top: 2px; line-height: 1.45; }
.es-radio { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--border-strong);
  flex: none; background: var(--surface); margin-top: 2px; }
.es-radio-on { border-color: var(--primary); border-width: 5px; }

.es-drop { border: 1.5px dashed var(--border-strong); border-radius: 12px; background: var(--surface-alt);
  padding: 22px; text-align: center; }

.es-counts { display: flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; flex-wrap: wrap; }
.es-count { flex: 1; padding: 13px 16px; border-right: 1px solid var(--border); min-width: 118px; }
.es-count:last-child { border-right: 0; }
.es-count-v { font-family: var(--font-mono); font-size: 23px; font-weight: 600; line-height: 1.1; }
.es-count-k { font-size: 10.5px; font-weight: 600; letter-spacing: .03em; color: var(--ink-2);
  text-transform: uppercase; margin-top: 3px; }

.es-dtable tr.es-row-bloquee td { background: var(--error-tint); }
.es-dtable tr.es-row-bloquee td:first-child { box-shadow: inset 3px 0 0 var(--error); }

.es-rules { display: flex; gap: 0; flex-wrap: wrap; background: var(--sunken); border-radius: 10px;
  padding: 12px 16px; font-size: 12px; margin-top: 14px; }
.es-rule { padding-right: 20px; margin-right: 20px; border-right: 1px solid var(--border-strong); }
.es-rule:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.es-rule-k { color: var(--ink-3); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase;
  font-family: var(--font-mono); font-weight: 600; }
.es-rule-v { font-weight: 600; color: var(--ink); margin-top: 2px; }

/* ==================== v1-253 — IMPORT DE PROGRAMMES, LES TROIS PRÉRÉGLAGES (#791) ====================
   Direction 2 : une seule question, deux intentions nommées + « Personnaliser… » (motif ClickUp M3).
   Tout le reste est emprunté au lot #565 (es-qcard, es-opt, es-counts, es-rules, es-dtable) — une
   3ᵉ direction d'écran ne justifie pas une 3ᵉ trousse de styles.
   ⚠ Chaque carte porte une LIGNE DE CONSÉQUENCE (.es-preset-c) : c'est elle qui empêche le
   préréglage d'être un bouton qui rassure sans informer (compromis assumé de la direction 2). */

.es-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.es-preset { border: 1.5px solid var(--border-strong); border-radius: 12px; background: var(--surface);
  padding: 14px; display: flex; flex-direction: column; gap: 8px; text-align: left;
  font-family: var(--font-ui); color: var(--ink); cursor: pointer; }
.es-preset:hover:not(:disabled) { border-color: var(--primary); }
.es-preset:disabled { cursor: default; opacity: .6; }
.es-preset-on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.es-preset-h { display: flex; align-items: flex-start; gap: 9px; }
.es-preset-t { font-family: var(--font-head); font-size: 14.5px; font-weight: 700; line-height: 1.25; }
.es-preset-w { font-size: 12px; color: var(--ink-2); line-height: 1.5; margin: 0; }
.es-preset-c { margin-top: auto; padding-top: 9px; border-top: 1px dashed var(--border);
  font-size: 11.5px; line-height: 1.6; color: var(--ink-2); }
.es-preset-c b { color: var(--ink); }

/* Le dépliant « Personnaliser » : rattaché visuellement aux cartes, jamais un écran de plus. */
.es-custom { border: 1.5px solid var(--primary); border-top: 0; border-radius: 0 0 12px 12px;
  background: var(--primary-tint); padding: 16px; margin-top: -4px; }
.es-dims { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.es-dim { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.es-dim-k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 3px; font-weight: 600; }
.es-dim-q { font-size: 13px; font-weight: 600; margin: 0 0 7px; line-height: 1.35; }
/* Dimension VERROUILLÉE : servie par un autre moteur, donc expliquée — jamais un réglage inerte. */
.es-dim-locked { background: var(--sunken); }

@media (max-width: 900px) {
  .es-presets { grid-template-columns: 1fr; }
  .es-dims { grid-template-columns: 1fr; }
}

/* ── Hub d'import · modale de traitement partagée (chantier 1) et bandeau « dernières opérations »
   (chantier 2). La zone de statut est une région annoncée (aria-live) : le sens est porté par le
   texte, les icônes sont décoratives. ───────────────────────────────────────────────────────── */
.es-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.es-traitement { display: flex; flex-direction: column; gap: 14px; min-height: 96px; }
.es-traitement-statut { display: flex; align-items: flex-start; gap: 12px; }
.es-traitement-icone { font-size: 30px; line-height: 1; flex: none; }
.es-traitement-titre { font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--ink); }
.es-traitement-aide { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; margin-top: 3px; overflow-wrap: anywhere; }
.es-traitement-compteurs { width: 100%; border-collapse: collapse; font-size: 13px; }
.es-traitement-compteurs th, .es-traitement-compteurs td { padding: 7px 10px; border-top: 1px solid var(--border); text-align: left; }
.es-traitement-compteurs thead th { background: var(--sunken); font-size: 11.5px; font-weight: 600; color: var(--ink-2); border-top: none; }
.es-traitement-compteurs tbody th { font-weight: 400; }
.es-traitement-compteurs td { font-family: var(--font-mono); font-weight: 600; text-align: right; width: 30%; }
.es-traitement-succes td { color: var(--success); }
.es-traitement-avert td { color: var(--warning); }
.es-traitement-erreur td { color: var(--error); }

.es-dernieres-ops { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: baseline; max-width: 900px;
  margin: 4px 0 0; padding: 9px 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface);
  font-size: 12px; color: var(--ink-2); }
.es-dernieres-ops dl { display: contents; }
.es-dernieres-ops-ligne { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.es-dernieres-ops dt { font-weight: 600; color: var(--ink); }
.es-dernieres-ops dd { margin: 0; }
.es-dernieres-ops time { font-family: var(--font-mono); color: var(--ink); }

/* ── Chantier Cohérence, lot F (ADR 0021) · maquette docs/features/coherence-sous-noeuds-orphelins-lignes-sans-code/ux/
   Seules les classes NOUVELLES de la maquette dont le lot F a l'usage : disposition commune des
   quatre pages, bloc d'indicateurs repliable, compteurs du menu. Aucune règle existante n'est
   redéfinie ici (les propositions « à arbitrer » de la maquette — en-têtes .es-dtable en --ink-2,
   anneau de focus étendu — restent hors de ce lot). Les composants propres aux pages orphelins et
   lignes sans code portent leurs styles en CSS isolée (.razor.css), pour ne pas se disputer ce fichier. */

/* Texte réservé aux lecteurs d'écran — alias de .es-sr-only, nom employé par les maquettes. */
.es-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* DispositionCoherence : surtitre, titre + sélecteur de période */
.es-coh-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.es-coh-eyebrow .msr { font-size: 15px; }
.es-coh-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.es-coh-head h1 { margin: 0 0 4px; font-size: 25px; }
.es-coh-head .es-home-sub { margin: 0; font-size: 13.5px; color: var(--ink-2); max-width: 720px; line-height: 1.5; }

/* BlocIndicateursCoherence : bouton de repli (aria-expanded pilote la rotation), grille à cinq cartes */
.es-kpi-bloc { margin-bottom: 16px; }
.es-kpi-toggle { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 6px; margin: 0 0 8px -6px;
  font: 600 12px var(--font-ui); color: var(--ink-2); cursor: pointer; border-radius: 7px; }
.es-kpi-toggle:hover { background: var(--sunken); color: var(--ink); }
.es-kpi-toggle .msr { font-size: 18px; transition: transform .18s; }
.es-kpi-toggle[aria-expanded="true"] .msr { transform: rotate(180deg); }
.es-kpi-toggle .es-kpi-resume { font-family: var(--font-mono); font-weight: 500; color: var(--ink-2); }
.es-coh-kpis5 { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; }
@media (max-width: 1100px) { .es-coh-kpis5 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 640px) { .es-coh-kpis5 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.es-kpi-lbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; }
.es-kpi-val { font-family: var(--font-head); font-weight: 700; font-size: 26px; letter-spacing: -.02em; }
@media (prefers-reduced-motion: reduce) { .es-kpi-toggle .msr { transition: none; } }

/* États de page (vide) — commun aux quatre pages */
.es-state { padding: 28px; text-align: center; font-size: 13px; color: var(--ink-2); border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.es-state .msr { font-size: 28px; display: block; margin: 0 auto 8px; }

/* Pagination au clavier : de vrais boutons (les span.es-pageicon ne se focalisent pas) */
.es-pagebtn { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.es-pagebtn:disabled { opacity: .45; cursor: default; }

/* Compteurs du menu : neutre lisible (le .navlink-badge existant, en --ink-3, mesure 3,29:1), et
   somme portée par un parent replié. */
.navlink .navlink-badge-neutre { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; color: var(--ink-2); background: var(--sunken); padding: 1px 7px; border-radius: 999px; }
.navlink.active .navlink-badge-neutre { color: var(--primary); background: var(--surface); }
.es-nav-parent .es-badge-somme { margin-left: auto; }
.es-nav-parent .es-badge-somme + .es-nav-chevron { margin-left: 6px; }
.navlink .navlink-label { min-width: 0; }
