/* =========================================================
   MAQUETTES — BACK-OFFICE AUTHENTIFIÉ
   Tech Center Multimédia · lot LOT-DESIGN-12 · doc 37

   Feuille autonome, DISTINCTE de celle du site vitrine.
   Le back-office est un OUTIL : dense, sobre, hors thème
   Privé/Entreprise. Il reste de la même maison par quatre
   choses seulement (doc 37 §4.1) :
     1. la police Lexend, auto-hébergée ;
     2. les titres en capitales, portées par text-transform ;
     3. le fil moulinet aux 4 couleurs officielles, en filet
        de 3 px sous la barre supérieure ;
     4. les 5 paires de couleurs d'état, identiques au site.
   Tout le reste diffère volontairement : pas d'aurora, pas de
   dégradé de marque, pas de coin coupé, pas de grands blancs.

   Zéro requête réseau sortante.
   ========================================================= */

/* ---------- 0. POLICE (auto-hébergée) ---------- */
@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../assets/fonts/lexend-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../assets/fonts/lexend-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* =========================================================
   1. TOKENS
   Repris de site/css/main.css pour les neutres, la typo, les
   espacements et le mouvement. Les tokens --bo-* sont propres
   au back-office et listés exhaustivement au doc 37 §4.2.
   ========================================================= */
:root {
  /* Couleurs de marque — utilisées UNIQUEMENT dans le fil moulinet */
  --brand-orange: #F58B24;
  --brand-pink:   #EC2475;
  --brand-blue:   #4165AF;
  --brand-cyan:   #3EC6F2;

  --ink:        #171A21;
  --ink-muted:  #5A6172;
  --paper:      #FFFFFF;
  --line:       #E4E7EE;
  --dark:       #14161C;
  --on-dark:        #FFFFFF;
  --on-dark-muted:  #A9B0BF;

  --font: "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;

  --fs-h2:    1.5rem;      /* le back-office ne fait pas de clamp : pas d'effet d'échelle */
  --fs-h3:    1.125rem;
  --fs-h4:    1rem;
  --fs-body:  1rem;
  --fs-small: 0.875rem;
  --fs-tiny:  0.75rem;

  --fw-light: 300; --fw-regular: 400; --fw-medium: 500;
  --fw-semibold: 600; --fw-bold: 700;

  --lh-tight: 1.1; --lh-heading: 1.2; --lh-body: 1.6;
  --ls-heading: 0.03em; --ls-label: 0.08em;

  /* v15 (docs/45 §3) — RÈGLE PROPRE À L'OUTIL. Le back-office garde le même
     RAPPORT que le site public (le rembourrage d'un bloc est plus grand que
     la gouttière qui le sépare de son voisin) mais l'applique un cran plus bas
     sur l'échelle : 24 dedans / 16 dehors, là où le site fait 32 / 24. On y
     traite une liste, on n'y lit pas un article.
     COROLLAIRE, non négociable : le rembourrage des cellules de tableau
     (8 / 16) ne bouge pas. Aérer une ligne d'administration, c'est réduire le
     nombre de lignes visibles sans rien rendre de plus lisible. Ce que le
     back-office gagne en air, il le gagne en RETIRANT des gris (§6), pas en
     ajoutant des pixels. */
  --sp-1: 0.25rem;  --sp-2: 0.5rem;   --sp-3: 0.75rem;
  --sp-4: 1rem;     --sp-5: 1.5rem;   --sp-6: 2rem;
  --sp-7: 3rem;     --sp-8: 4rem;

  --ease: cubic-bezier(.4, 0, .2, 1);
  --t-fast: 150ms; --t-med: 250ms;

  /* Couleurs d'état — HORS THÈME, identiques au site (docs/12 §3.1) */
  --etat-ok-bg:        #DCEFE3; --etat-ok-text:        #14603A;
  --etat-attention-bg: #FDE3D2; --etat-attention-text: #8A3D05;
  --etat-alerte-bg:    #FBE0E6; --etat-alerte-text:    #9E1239;
  --etat-info-bg:      #D9E4F7; --etat-info-text:      #2E4A85;
  --etat-neutre-bg:    #F0F2F6; --etat-neutre-text:    #5A6172;

  /* ---------- Tokens propres au back-office ---------- */
  --bo-fond:       #F4F5F8;   /* fond de travail, froid et neutre : ce n'est pas le site */
  --bo-zebra:      #F7F8FA;   /* lignes paires de tableau, repris de main.css --zebra */
  --bo-rail:       15rem;     /* largeur du rail de navigation ≥ 1024 px */
  --bo-barre:      52px;      /* hauteur de la barre supérieure */
  --bo-r:          6px;       /* rayon UNIQUE : l'outil abandonne le coin coupé de la marque */
  --bo-r-pill:     999px;     /* réservé aux pastilles d'état et aux compteurs */
  --bo-ctrl:       40px;      /* hauteur unique des commandes : boutons, champs, onglets */
  --bo-ctrl-s:     32px;      /* commandes de ligne de tableau, dans une cible de 44 px */
  --bo-focus:      0 0 0 2px var(--paper), 0 0 0 4px var(--ink);
  --bo-focus-sombre: 0 0 0 2px var(--dark), 0 0 0 4px var(--on-dark);
  /* Largeur de lecture du texte courant de l'outil, composé à 14 px :
     28 rem = 448 px = 69 caractères mesurés (docs/45 §4). */
  --bo-measure:    28rem;
}

/* =========================================================
   2. BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { font-family: var(--font); color: var(--ink); background: var(--bo-fond); }
body {
  margin: 0;
  font-size: var(--fs-body); line-height: var(--lh-body);
  font-weight: var(--fw-regular);
  background: var(--bo-fond);
}

h1, h2, h3, h4 {
  text-transform: uppercase;      /* règle de marque, conservée */
  letter-spacing: var(--ls-heading);
  line-height: var(--lh-heading);
  font-weight: var(--fw-semibold);
  margin: 0 0 var(--sp-2);
}
/* v15 : l'espace sous un titre suit son rang, un cran plus bas que le site. */
h1 { font-size: var(--fs-h2); font-weight: var(--fw-bold); line-height: var(--lh-tight); margin-bottom: var(--sp-4); }
h2 { font-size: var(--fs-h3); margin-bottom: var(--sp-4); }
h3 { font-size: var(--fs-h4); margin-bottom: var(--sp-2); }
h4 { font-size: var(--fs-small); margin-bottom: var(--sp-2); }

p { margin: 0 0 var(--sp-4); }
a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--etat-info-text); }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  border: 0; clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.skip-link {
  position: absolute; left: var(--sp-4); top: -3rem; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: var(--sp-2) var(--sp-4); border-radius: var(--bo-r);
  font-size: var(--fs-small); text-decoration: none;
}
.skip-link:focus { top: var(--sp-2); }
.muted { color: var(--ink-muted); }
.fs-small { font-size: var(--fs-small); }
.fs-tiny { font-size: var(--fs-tiny); }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }

/* =========================================================
   3. BARRE DE DÉMO — N'EXISTE PAS DANS LE PRODUIT FINAL
   ========================================================= */
.demo { background: #2A2E39; color: var(--on-dark); font-size: var(--fs-tiny); padding-block: var(--sp-2); }
.demo__inner {
  padding-inline: var(--sp-4);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4);
}
.demo__tag { text-transform: uppercase; letter-spacing: var(--ls-label); font-weight: var(--fw-semibold); }
.demo__sommaire { color: var(--on-dark-muted); text-decoration: underline; text-underline-offset: 3px; }
.demo__sommaire:hover { color: var(--on-dark); }
.demo__etats { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-left: auto; }
.demo__label { color: var(--on-dark-muted); }
.demo__btn {
  font-family: var(--font); font-size: var(--fs-tiny); font-weight: var(--fw-medium);
  color: var(--on-dark); background: rgb(255 255 255 / .12);
  border: 1px solid rgb(255 255 255 / .28); border-radius: var(--bo-r-pill);
  padding: var(--sp-1) var(--sp-3); cursor: pointer; min-height: 28px;
}
.demo__btn:hover { background: rgb(255 255 255 / .22); }
.demo__btn[aria-pressed="true"] { background: var(--on-dark); color: var(--dark); font-weight: var(--fw-semibold); }
.demo__btn:focus-visible { outline: 2px solid var(--on-dark); outline-offset: 2px; }

/* =========================================================
   4. COQUILLE : barre supérieure + rail + contenu
   ========================================================= */
.bo-barre {
  position: sticky; top: 0; z-index: 50;
  background: var(--dark); color: var(--on-dark);
}
.bo-barre__inner {
  height: var(--bo-barre);
  padding-inline: var(--sp-4);
  display: flex; align-items: center; gap: var(--sp-3);
  min-width: 0;
}
.bo-barre__logo { display: flex; align-items: center; gap: var(--sp-3); text-decoration: none; color: var(--on-dark); }
.bo-barre__logo img { height: 26px; width: auto; }
.bo-barre__nom {
  font-size: var(--fs-tiny); font-weight: var(--fw-semibold);
  text-transform: uppercase; letter-spacing: var(--ls-label); color: var(--on-dark);
}
.bo-barre__droite { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-small); min-width: 0; }
.bo-barre__qui { color: var(--on-dark-muted); display: none; }
/* Sous 768 px, le rôle et le libellé « Administration » cèdent la place :
   il ne reste que le pictogramme et la déconnexion, et rien ne dépasse. */
.bo-barre__role { display: none; }
.bo-barre__nom { display: none; }
.bo-barre__qui strong { color: var(--on-dark); font-weight: var(--fw-semibold); }
.bo-barre__role {
  font-size: var(--fs-tiny); text-transform: uppercase; letter-spacing: var(--ls-label);
  border: 1px solid rgb(255 255 255 / .35); border-radius: var(--bo-r-pill);
  padding: 2px var(--sp-2); color: var(--on-dark);
}
.bo-barre a { color: var(--on-dark-muted); text-decoration: none; }
.bo-barre a:hover { color: var(--on-dark); text-decoration: underline; text-underline-offset: 3px; }
.bo-barre a:focus-visible { outline: none; box-shadow: var(--bo-focus-sombre); border-radius: var(--bo-r); }

/* Le fil moulinet, réduit à un filet : la seule couleur de marque de l'outil */
.bo-fil { display: flex; height: 3px; }
.bo-fil i { display: block; }
.bo-fil i:nth-child(1) { flex: 3; background: var(--brand-orange); }
.bo-fil i:nth-child(2) { flex: 2; background: var(--brand-pink); }
.bo-fil i:nth-child(3) { flex: 2; background: var(--brand-blue); }
.bo-fil i:nth-child(4) { flex: 3; background: var(--brand-cyan); }

.bo-corps { display: block; }

/* Navigation : chips défilants sur téléphone, rail vertical sur ordinateur */
.bo-nav { background: var(--paper); border-bottom: 1px solid var(--line); }
.bo-nav__inner {
  display: flex; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4);
  overflow-x: auto; scrollbar-width: none;
}
.bo-nav__inner::-webkit-scrollbar { display: none; }
.bo-nav__lien {
  flex: none; display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: var(--bo-ctrl); padding-inline: var(--sp-3);
  border-radius: var(--bo-r); border: 1px solid transparent;
  font-size: var(--fs-small); font-weight: var(--fw-medium);
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.bo-nav__lien:hover { background: var(--etat-neutre-bg); color: var(--ink); }
.bo-nav__lien[aria-current="page"] { background: var(--ink); color: var(--paper); font-weight: var(--fw-semibold); }
.bo-nav__lien:focus-visible { outline: none; box-shadow: var(--bo-focus); }
.bo-nav__lien svg { width: 16px; height: 16px; flex: none; }
.bo-nav__pastille {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding-inline: var(--sp-1);
  border-radius: var(--bo-r-pill);
  background: var(--etat-attention-bg); color: var(--etat-attention-text);
  font-size: var(--fs-tiny); font-weight: var(--fw-semibold);
}
.bo-nav__lien[aria-current="page"] .bo-nav__pastille { background: var(--paper); color: var(--ink); }

/* v15 : 64 px de vide en pied de chaque écran ramenés à 32. L'outil récupère
   ainsi une partie de ce que le rembourrage des panneaux lui a coûté. */
.bo-main { padding: var(--sp-5) var(--sp-4) var(--sp-6); }
.bo-entete { margin-bottom: var(--sp-5); display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-3); }
.bo-entete__texte { flex: 1 1 20rem; }
.bo-entete h1 { margin-bottom: var(--sp-1); }
.bo-entete p { margin: 0; color: var(--ink-muted); font-size: var(--fs-small); max-width: var(--bo-measure); }
.bo-entete__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-left: auto; }

.bo-retour {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: 44px; font-size: var(--fs-small); color: var(--ink);
  text-decoration: none; margin-bottom: var(--sp-2);
}
.bo-retour:hover { text-decoration: underline; text-underline-offset: 3px; }
.bo-retour svg { width: 16px; height: 16px; }

/* =========================================================
   5. PANNEAUX (le conteneur de tout ce qui suit)
   Angles à 6 px, un seul filet, ombre minimale : c'est un
   outil, pas une vitrine.
   ========================================================= */
/* v15 (docs/45 §6) : l'OMBRE est supprimée. Un panneau portait un filet de
   1 px ET une ombre portée : deux délimitations pour une seule frontière, sur
   un fond de travail déjà gris. Le filet suffit, et l'outil y gagne un gris. */
.panneau {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--bo-r);
  margin-bottom: var(--sp-4);     /* v15 : gouttière 16, rembourrage 24 */
}
.panneau__titre {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line);
}
.panneau__titre h2, .panneau__titre h3 { margin: 0; }
.panneau__titre .bo-actions { margin-left: auto; }
/* v15 : 24 px. C'était 16 px pour 24 px de gouttière entre panneaux — le bloc
   était plus serré dedans que dehors, exactement le défaut signalé. */
.panneau__corps { padding: var(--sp-5); }
.panneau__corps > :last-child { margin-bottom: 0; }
.panneau__pied {
  padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--line);
  background: var(--bo-zebra); border-radius: 0 0 var(--bo-r) var(--bo-r);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3);
  font-size: var(--fs-small); color: var(--ink-muted);
}
/* v15 — `grid-template-columns` explicite en minmax(0, 1fr). Sans lui, la piste
   implicite vaut `auto`, dont la largeur MINIMALE est le min-content de son
   contenu : un tableau large imposait sa largeur à toute la page et
   `.tableau-wrap { overflow-x: auto }` ne protégeait plus rien (mesuré :
   809 px de document pour une fenêtre de 768 sur admin-session-detail.html).
   C'est exactement le défaut déjà corrigé côté site dans main.css §20.2. */
.bo-grille { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }

/* =========================================================
   6. BOUTONS ET COMMANDES
   Le bouton principal est ENCRE, jamais un dégradé de marque :
   blanc sur #171A21 = 17.4:1, et l'outil ne fait pas de promesse
   commerciale (doc 37 §4.3).
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: var(--bo-ctrl); padding-inline: var(--sp-4); min-width: 44px;
  border: 1px solid transparent; border-radius: var(--bo-r);
  font-family: var(--font); font-size: var(--fs-small); font-weight: var(--fw-semibold);
  text-decoration: none; cursor: pointer; text-align: center; white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease);
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:focus-visible { outline: none; box-shadow: var(--bo-focus); }
.btn--principal { background: var(--ink); color: var(--paper); }
.btn--principal:hover { background: #2A2E39; color: var(--paper); }
.btn--neutre { background: var(--paper); color: var(--ink); border-color: var(--ink-muted); }
.btn--neutre:hover { background: var(--etat-neutre-bg); color: var(--ink); }
.btn--danger { background: var(--paper); color: var(--etat-alerte-text); border-color: var(--etat-alerte-text); }
.btn--danger:hover { background: var(--etat-alerte-bg); color: var(--etat-alerte-text); }
.btn--s { height: var(--bo-ctrl-s); padding-inline: var(--sp-3); font-size: var(--fs-tiny); }
.btn--bloc { width: 100%; }
.btn[aria-disabled="true"], .btn:disabled {
  background: var(--etat-neutre-bg); color: var(--ink-muted);
  border-color: var(--line); cursor: not-allowed;
}
.bo-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
/* Cible tactile de 44 px autour des commandes de 32 px, sans casser la densité */
.bo-actions--ligne .btn--s { margin-block: 6px; }

/* =========================================================
   7. ONGLETS (journal, cours/session)
   ========================================================= */
.onglets { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--line); padding-inline: var(--sp-4); overflow-x: auto; scrollbar-width: none; }
.onglets::-webkit-scrollbar { display: none; }
.onglet {
  flex: none; font-family: var(--font); font-size: var(--fs-small); font-weight: var(--fw-medium);
  background: transparent; border: 0; border-bottom: 3px solid transparent;
  min-height: var(--bo-ctrl); padding-inline: var(--sp-3); cursor: pointer; color: var(--ink-muted);
  white-space: nowrap;
}
.onglet:hover { color: var(--ink); }
.onglet[aria-selected="true"] { color: var(--ink); font-weight: var(--fw-semibold); border-bottom-color: var(--ink); }
.onglet:focus-visible { outline: none; box-shadow: var(--bo-focus); border-radius: var(--bo-r) var(--bo-r) 0 0; }

/* Filtres de liste */
.filtres { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.filtre {
  font-family: var(--font); font-size: var(--fs-tiny); font-weight: var(--fw-semibold);
  min-height: var(--bo-ctrl-s); padding-inline: var(--sp-3);
  border: 1px solid var(--line); border-radius: var(--bo-r-pill);
  background: var(--paper); color: var(--ink); cursor: pointer;
}
.filtre[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.filtre:focus-visible { outline: none; box-shadow: var(--bo-focus); }

/* =========================================================
   8. TABLEAUX DENSES
   Le back-office assume le <table> : les données sont
   tabulaires et l'écran est celui d'un poste de travail.
   Sous 768 px, chaque ligne se replie en fiche (data-label).
   ========================================================= */
/* v15 — `position: relative` OBLIGATOIRE. Les <span class="visually-hidden">
   des cellules sont en position absolue : sans ancêtre positionné, leur bloc
   conteneur est la page, ils sortent donc du cadre défilant et allongent le
   document (817 px mesurés pour une fenêtre de 768 sur
   admin-session-detail.html, dont 809 déjà présents avant ce lot).
   Positionner le cadre les y ramène ; le tableau, lui, défile comme prévu. */
.tableau-wrap { overflow-x: auto; position: relative; }
.tableau { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.tableau caption { text-align: left; font-size: var(--fs-tiny); color: var(--ink-muted); padding: 0 var(--sp-4) var(--sp-2); }
/* Rembourrage de cellule INCHANGÉ (8 / 16) : c'est la règle du §3. Seules les
   colonnes de bord s'alignent sur le rembourrage du panneau (24) pour que la
   première et la dernière colonne tombent sur le même axe que le titre. */
.tableau th, .tableau td { text-align: left; padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.tableau th:first-child, .tableau td:first-child { padding-left: var(--sp-5); }
.tableau th:last-child,  .tableau td:last-child  { padding-right: var(--sp-5); }
.tableau thead th {
  font-size: var(--fs-tiny); font-weight: var(--fw-semibold);
  text-transform: uppercase; letter-spacing: var(--ls-label); color: var(--ink-muted);
  background: var(--bo-zebra); white-space: nowrap;
}
/* v15 (docs/45 §6) : le ZÉBRAGE est supprimé. Chaque ligne porte déjà un filet
   inférieur, l'en-tête son aplat, et le survol sa teinte : quatre gris pour
   guider un même œil. Le zébrage était le seul qui ne disait rien de plus. */
.tableau tbody tr:hover { background: var(--etat-neutre-bg); }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableau td.actions { text-align: right; white-space: nowrap; }
.tableau .principal { font-weight: var(--fw-semibold); color: var(--ink); }
.tableau a { color: var(--ink); }
.tableau tr.ligne--annulee td { color: var(--ink-muted); }
.tableau tr.ligne--annulee .principal { text-decoration: line-through; }
.tableau tr.ligne--annulee .principal::before { text-decoration: none; }
.tableau tr.ligne--verifier { box-shadow: inset 3px 0 0 var(--etat-attention-text); }

@media (max-width: 767px) {
  .tableau, .tableau tbody, .tableau tr, .tableau td { display: block; width: 100%; }
  .tableau thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tableau tr { border: 1px solid var(--line); border-radius: var(--bo-r); margin-bottom: var(--sp-3); background: var(--paper); }
  .tableau td { border-bottom: 1px solid var(--line); padding: var(--sp-3); display: grid; grid-template-columns: 8.5rem 1fr; gap: var(--sp-3); }
  .tableau td:first-child, .tableau td:last-child { padding-left: var(--sp-3); padding-right: var(--sp-3); }
  .tableau td:last-child { border-bottom: 0; }
  .tableau td::before {
    content: attr(data-label);
    font-size: var(--fs-tiny); text-transform: uppercase; letter-spacing: var(--ls-label);
    color: var(--ink-muted); align-self: center;
  }
  .tableau td.actions { text-align: left; grid-template-columns: 1fr; }
  .tableau td.actions::before { content: none; }
}

/* =========================================================
   9. PASTILLES D'ÉTAT
   Jamais la couleur seule : pastille + libellé écrit.
   ========================================================= */
.etat {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 2px var(--sp-3); border-radius: var(--bo-r-pill);
  font-size: var(--fs-tiny); font-weight: var(--fw-semibold);
  text-transform: uppercase; letter-spacing: var(--ls-label);
  background: var(--etat-neutre-bg); color: var(--etat-neutre-text);
  white-space: normal; text-wrap: balance;
}
.etat::before { content: ""; width: 8px; height: 8px; border-radius: var(--bo-r-pill); background: currentColor; flex: none; }
.etat--ok        { background: var(--etat-ok-bg);        color: var(--etat-ok-text); }
.etat--attention { background: var(--etat-attention-bg); color: var(--etat-attention-text); }
.etat--attention::before { border-radius: 1px; }        /* forme + couleur */
.etat--alerte    { background: var(--etat-alerte-bg);   color: var(--etat-alerte-text); }
.etat--info      { background: var(--etat-info-bg);     color: var(--etat-info-text); }

/* Remplissage « 3/4 » : chiffre lisible, jamais une jauge */
.remplissage { font-variant-numeric: tabular-nums; font-weight: var(--fw-semibold); white-space: nowrap; }
.remplissage--plein { color: var(--etat-neutre-text); }
.remplissage--sous-seuil { color: var(--etat-attention-text); }

/* =========================================================
   10. MESSAGES ET ALERTES D'ÉCRAN
   ========================================================= */
.msg {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-4) var(--sp-5); border-radius: var(--bo-r);
  font-size: var(--fs-small);
  background: var(--etat-info-bg); color: var(--etat-info-text);
  margin: 0 0 var(--sp-4);
}
.msg svg { width: 18px; height: 18px; flex: none; margin-top: 3px; }
.msg p { margin: 0 0 var(--sp-2); max-width: var(--bo-measure); }
.msg p:last-child { margin-bottom: 0; }
.msg strong { font-weight: var(--fw-semibold); }
.msg a { color: inherit; }
.msg--ok        { background: var(--etat-ok-bg);        color: var(--etat-ok-text); }
.msg--attention { background: var(--etat-attention-bg); color: var(--etat-attention-text); }
.msg--alerte    { background: var(--etat-alerte-bg);    color: var(--etat-alerte-text); }
.msg__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }
.msg .btn--neutre { background: transparent; color: currentColor; border-color: currentColor; }
.msg .btn--neutre:hover { background: rgb(255 255 255 / .55); color: currentColor; }

/* Liste « ce qui demande votre attention » — l'écran des 5 minutes */
.attentions { list-style: none; margin: 0; padding: 0; }
.attentions li {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line);
}
.attentions li:last-child { border-bottom: 0; }
.attentions__texte { flex: 1 1 18rem; }
.attentions__texte p { margin: 0; }
.attentions__quoi { font-weight: var(--fw-semibold); }
.attentions__pourquoi { font-size: var(--fs-small); color: var(--ink-muted); max-width: var(--bo-measure); }
.attentions .bo-actions { margin-left: auto; }
.attentions li.prioritaire { box-shadow: inset 3px 0 0 var(--etat-alerte-text); }

.vide {
  text-align: center; padding: var(--sp-7) var(--sp-5);
  border: 1px dashed var(--line); border-radius: var(--bo-r);
  background: var(--paper); color: var(--ink-muted);
}
.vide h3 { color: var(--ink); margin-bottom: var(--sp-2); }
.vide p { margin: 0 auto; max-width: 44ch; }

/* =========================================================
   11. FORMULAIRES
   ========================================================= */
.form { display: grid; gap: var(--sp-5); }        /* v15 : 16 → 24 entre deux champs */
.form__ligne { display: grid; gap: var(--sp-4); }
.champ { display: grid; gap: var(--sp-2); }       /* v15 : 4 → 8 étiquette ↔ champ */
.champ__label { font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.champ__aide { font-size: var(--fs-tiny); color: var(--ink-muted); margin: 0; max-width: var(--bo-measure); }
.champ :is(input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="date"], input[type="time"], input[type="number"], select, textarea) {
  font-family: var(--font); font-size: var(--fs-body); color: var(--ink);
  height: var(--bo-ctrl); padding-inline: var(--sp-3);
  background: var(--paper); border: 1px solid var(--ink-muted);
  border-radius: var(--bo-r); width: 100%;
}
.champ textarea { height: auto; min-height: 5.5rem; padding-block: var(--sp-2); resize: vertical; line-height: var(--lh-body); }
.champ :is(input, select, textarea):focus-visible { outline: none; box-shadow: var(--bo-focus); border-color: var(--ink); }
.champ :is(input, textarea)::placeholder { color: var(--ink-muted); }
.champ--invalide :is(input, select, textarea) { border-color: var(--etat-alerte-text); border-width: 2px; }
.champ__erreur { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-small); color: var(--etat-alerte-text); margin: 0; }
.champ__erreur svg { width: 16px; height: 16px; flex: none; }
/* Le code à 6 chiffres : un seul champ, jamais six cases (collage impossible) */
.champ--code input {
  font-size: 1.5rem; letter-spacing: 0.3em; text-align: center;
  height: 56px; font-variant-numeric: tabular-nums;
}
.champ-inline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.champ-case { display: grid; grid-template-columns: 20px 1fr; gap: var(--sp-3); align-items: start; font-size: var(--fs-small); }
.champ-case input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ink); }
.champ-case input:focus-visible { outline: none; box-shadow: var(--bo-focus); }
.obligatoire { color: var(--etat-alerte-text); font-weight: var(--fw-semibold); }

/* =========================================================
   12. ÉCRAN DE CONNEXION (A1) — hors coquille
   ========================================================= */
.bo-connexion {
  min-height: 100vh; display: grid; align-items: start; justify-items: center;
  padding: var(--sp-6) var(--sp-4) var(--sp-8);
}
.bo-carte-connexion {
  width: 100%; max-width: 26rem;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--bo-r);
  padding: var(--sp-6);
}
.bo-carte-connexion .bo-fil { margin-bottom: var(--sp-4); border-radius: 2px; overflow: hidden; }
.bo-carte-connexion h1 { font-size: var(--fs-h3); }
.bo-carte-connexion .intro { color: var(--ink-muted); font-size: var(--fs-small); }
.bo-etapes { display: flex; gap: var(--sp-2); font-size: var(--fs-tiny); color: var(--ink-muted); margin-bottom: var(--sp-4); text-transform: uppercase; letter-spacing: var(--ls-label); }
.bo-etapes span[aria-current="step"] { color: var(--ink); font-weight: var(--fw-semibold); }
.bo-pied-connexion { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--line); font-size: var(--fs-tiny); color: var(--ink-muted); }
.bo-pied-connexion p { margin: 0 0 var(--sp-2); }
.bo-pied-connexion p:last-child { margin: 0; }

/* Défi de calcul auto-hébergé (ALTCHA) — même composant que le public */
.altcha {
  border: 1px solid var(--line); border-radius: var(--bo-r);
  background: var(--etat-neutre-bg); padding: var(--sp-3) var(--sp-4);
  display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-small);
}
.altcha__spin {
  width: 18px; height: 18px; flex: none; border-radius: var(--bo-r-pill);
  border: 2px solid var(--ink-muted); border-top-color: transparent;
  animation: altcha-tourne 900ms linear infinite;
}
@keyframes altcha-tourne { to { rotate: 360deg; } }
.altcha p { margin: 0; }
.altcha__note { font-size: var(--fs-tiny); color: var(--ink-muted); }

/* =========================================================
   13. APERÇU DE LA BANNIÈRE (A3) — rendu fidèle au site
   Les deux variantes reprennent exactement les couleurs de
   main.css §4.5 ; c'est un aperçu, pas une approximation.
   ========================================================= */
/* v15 (docs/45 §6) : l'aplat gris est supprimé. Le filet pointillé dit déjà
   « ceci est un aperçu » ; l'aplat n'ajoutait qu'un gris de plus derrière une
   bannière qui a, elle, sa propre couleur. */
.apercu {
  border: 1px dashed var(--line); border-radius: var(--bo-r);
  padding: var(--sp-4);
}
.apercu__mention { font-size: var(--fs-tiny); text-transform: uppercase; letter-spacing: var(--ls-label); color: var(--ink-muted); margin: 0 0 var(--sp-2); }
.banniere {
  font-family: var(--font); font-size: var(--fs-small); line-height: var(--lh-body);
  padding: var(--sp-3) var(--sp-4);
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--etat-info-bg); color: var(--etat-info-text);
  border-radius: 2px;
}
.banniere--alerte { background: #8F5A00; color: #FFFFFF; }   /* 5.8:1 — docs/02 §6 */
.banniere svg { width: 18px; height: 18px; flex: none; }
.banniere p { margin: 0; }

/* Historique des bannières */
.historique { list-style: none; margin: 0; padding: 0; }
.historique li { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line); }
.historique li:last-child { border-bottom: 0; }
.historique__texte { flex: 1 1 18rem; }
.historique__meta { font-size: var(--fs-tiny); color: var(--ink-muted); text-transform: uppercase; letter-spacing: var(--ls-label); }
.historique__message { margin: var(--sp-1) 0 0; }
.historique .bo-actions { margin-left: auto; }

/* =========================================================
   14. APERÇU D'E-MAIL (B10, B12)
   ========================================================= */
.mail { border: 1px solid var(--line); border-radius: var(--bo-r); background: var(--bo-zebra); padding: var(--sp-3); }
.mail__entetes { list-style: none; margin: 0 0 var(--sp-3); padding: 0; font-size: var(--fs-tiny); color: var(--ink-muted); display: grid; gap: var(--sp-1); }
.mail__entetes strong { color: var(--ink); font-weight: var(--fw-semibold); }
/* v15 : filet supprimé — boîte blanche sur aplat gris, la frontière est là. */
.mail__corps { background: var(--paper); border-radius: 2px; padding: var(--sp-5); font-size: var(--fs-small); }
.mail__corps p { margin: 0 0 var(--sp-3); }
.mail__corps p:last-child { margin-bottom: 0; }

/* Liste des destinataires / des personnes à rappeler */
.rappels { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.rappels li { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: var(--bo-r); background: var(--paper); }
.rappels__nom { font-weight: var(--fw-semibold); }
.rappels__tel { margin-left: auto; font-variant-numeric: tabular-nums; }

/* =========================================================
   15. SOMMAIRE DES ÉTATS DE DÉMO (bandeau d'aide en pied d'écran)
   ========================================================= */
.bo-note {
  border: 1px dashed var(--line); border-radius: var(--bo-r);
  padding: var(--sp-4); font-size: var(--fs-tiny); color: var(--ink-muted);
  background: var(--paper);
  max-width: var(--bo-measure);   /* v15 : 193 caractères par ligne mesurés */
}
.bo-note strong { color: var(--ink); }
.bo-note__tag { display: inline-block; margin-right: .4em; padding: .1em .5em;
  border-radius: 999px; background: var(--ink); color: #fff;
  font-size: .85em; letter-spacing: .04em; text-transform: uppercase; }

/* =========================================================
   16. FEUILLE DE PRÉSENCE (B9) — écran et impression
   ========================================================= */
.presence { background: var(--paper); color: #000000; }
.feuille {
  max-width: 21cm; margin: var(--sp-5) auto; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--bo-r);
  padding: var(--sp-6) var(--sp-5);
}
.feuille__entete { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: var(--sp-3); margin-bottom: var(--sp-4); }
.feuille__entete img { height: 30px; width: auto; }
.feuille__titre { flex: 1 1 16rem; }
.feuille__titre h1 { font-size: var(--fs-h3); margin-bottom: var(--sp-1); }
.feuille__titre p { margin: 0; font-size: var(--fs-small); }
.feuille__quand { font-size: var(--fs-small); text-align: right; }
.feuille__quand strong { display: block; font-size: var(--fs-h4); }
.feuille__table { overflow-x: auto; }
.feuille table { width: 100%; min-width: 30rem; border-collapse: collapse; font-size: var(--fs-small); }
.feuille th, .feuille td { border: 1px solid #767B88; padding: var(--sp-2) var(--sp-3); text-align: left; vertical-align: middle; }
.feuille thead th { background: var(--etat-neutre-bg); font-size: var(--fs-tiny); text-transform: uppercase; letter-spacing: var(--ls-label); }
.feuille tbody td { height: 2.6rem; }
.feuille .col-signature { width: 32%; }
.feuille .col-paye { width: 14%; }
.feuille .col-tel { width: 20%; }
.feuille tr.vierge td { background: var(--bo-zebra); }
.feuille__pied { margin-top: var(--sp-4); font-size: var(--fs-tiny); color: var(--ink-muted); display: flex; flex-wrap: wrap; gap: var(--sp-4); justify-content: space-between; }
.feuille__consignes { margin: var(--sp-4) 0 0; font-size: var(--fs-small); }
.feuille__consignes p { max-width: var(--bo-measure); }

@media print {
  @page { size: A4 portrait; margin: 14mm; }
  html, body { background: #FFFFFF; }
  .demo, .bo-barre, .bo-fil, .bo-nav, .bo-entete__actions, .bo-retour, .bo-note, .sans-impression { display: none !important; }
  .bo-main { padding: 0; }
  .feuille { max-width: none; margin: 0; border: 0; border-radius: 0; padding: 0; }
  .feuille__table { overflow: visible; }
  .feuille table { min-width: 0; page-break-inside: avoid; }
  .feuille tr { page-break-inside: avoid; }
  .feuille th, .feuille td { border-color: #000000; }
  .feuille thead th { background: #FFFFFF; }
  .feuille tr.vierge td { background: #FFFFFF; }
  a[href]::after { content: none; }
}

/* =========================================================
   17. RESPONSIVE
   ========================================================= */
@media (min-width: 768px) {
  .bo-main { padding-inline: var(--sp-5); }
  .form__ligne--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form__ligne--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bo-barre__qui { display: inline; }
  .bo-barre__role { display: inline; }
  .bo-barre__nom { display: inline; }
}
@media (min-width: 1024px) {
  .bo-corps { display: grid; grid-template-columns: var(--bo-rail) minmax(0, 1fr); align-items: start; }
  .bo-nav { border-bottom: 0; border-right: 1px solid var(--line); min-height: calc(100vh - var(--bo-barre)); position: sticky; top: calc(var(--bo-barre) + 3px); }
  .bo-nav__inner { flex-direction: column; overflow: visible; padding: var(--sp-3); gap: var(--sp-1); }
  .bo-nav__lien { width: 100%; }
  .bo-main { padding: var(--sp-6); }
  .bo-grille--2 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
  .bo-grille--2-egal { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

/* =========================================================
   18. MOUVEMENT RÉDUIT
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .btn, .bo-nav__lien { transition: none; }
  .altcha__spin { animation: none; border-top-color: var(--ink-muted); }
}

/* ---------- Utilitaires d'espacement ---------- */
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mb-0 { margin-bottom: 0; }
