/* Charte graphique en essai — docs/design/reference_style.md.

   Ce fichier n'est chargé que par les pages /design/ (gabarit
   templates/design/base_v2.html). Les écrans en service gardent app.css, et
   app.css n'est pas chargé ici : les deux feuilles ne se rencontrent jamais.
   C'est ce qui permet de poser les variables dans :root sans risque.
   Les couleurs ACED communes viennent de jetons.css, partagé avec app.css
   (décision X1 du 06/10/2026, docs/design/README.md).

   Composants préfixés « v2- ». Police : Relative, servie par l'application
   (static/fonts/relative/), Arial en repli.

   Aucune valeur en dur dans les composants : tout passe par une variable. Les
   variables du § 8 sont reprises telles quelles, sauf celles marquées
   « modifiée le 06/10 » (revue critique, contrastes WCAG AA : ratios calculés
   dans docs/design/README.md). */

/* jetons.css est chargé par le gabarit, à côté de ce fichier (lot 18). */

/* Police Relative (charte ACED), décision de Fréjus du 06/10/2026 (X3).
   Fichiers web officiels sous licence Colophon d'ACED, servis par
   l'application elle-même, jamais renommés : static/fonts/relative/LICENCE.md.
   400 = book, 500 = medium, 600 et 700 = bold. */
@font-face { font-family: "Relative"; src: url("../fonts/relative/relative-book.woff2") format("woff2"); unicode-range: U+0-202E, U+2030-10FFFF; font-weight: 400; font-style: normal; font-display: swap }
@font-face { font-family: "Relative"; src: url("../fonts/relative/relative-italic.woff2") format("woff2"); unicode-range: U+0-202E, U+2030-10FFFF; font-weight: 400; font-style: italic; font-display: swap }
@font-face { font-family: "Relative"; src: url("../fonts/relative/relative-medium.woff2") format("woff2"); unicode-range: U+0-202E, U+2030-10FFFF; font-weight: 500; font-style: normal; font-display: swap }
@font-face { font-family: "Relative"; src: url("../fonts/relative/relative-bold.woff2") format("woff2"); unicode-range: U+0-202E, U+2030-10FFFF; font-weight: 600 700; font-style: normal; font-display: swap }
/* Retour S6 du testeur (07/10/2026) : Relative n'a pas l'espace fine insécable
   (U+202F) qui sépare les milliers ; le navigateur la dessinait à 0,11 em,
   presque invisible entre les chiffres serrés de Relative (« 1197200 »). Ce seul
   caractère vient d'une petite police faite pour lui (0,2 em, vide),
   scripts/police_espace_fine.py : les quatre fichiers de Relative ci-dessus
   le laissent de côté (unicode-range) et chaque graisse a sa face d'espace
   fine aux mêmes descripteurs, sinon le navigateur ne la consulte pas.
   Tout le reste reste en Relative. */
@font-face { font-family: "Relative"; src: url("../fonts/espace-fine/espace-fine.woff2") format("woff2"); unicode-range: U+202F; font-weight: 400; font-style: normal; font-display: swap }
@font-face { font-family: "Relative"; src: url("../fonts/espace-fine/espace-fine.woff2") format("woff2"); unicode-range: U+202F; font-weight: 400; font-style: italic; font-display: swap }
@font-face { font-family: "Relative"; src: url("../fonts/espace-fine/espace-fine.woff2") format("woff2"); unicode-range: U+202F; font-weight: 500; font-style: normal; font-display: swap }
@font-face { font-family: "Relative"; src: url("../fonts/espace-fine/espace-fine.woff2") format("woff2"); unicode-range: U+202F; font-weight: 600 700; font-style: normal; font-display: swap }
/* La même, pour les montants en Arial (--font-chiffres), qui dessine aussi
   cette espace à moitié de la sienne sur bien des postes. */
@font-face { font-family: "Espace fine ACED"; src: url("../fonts/espace-fine/espace-fine.woff2") format("woff2"); unicode-range: U+202F; font-display: swap }

/* --- § 8 du document de référence ----------------------------------------- */
:root {
  /* Police */
  /* Modifiée le 06/10 (décision X3) : Relative, la police de la charte ACED,
     Arial en repli (au lieu d'Inter ou de la police du système). */
  --font-sans: "Relative", Arial, sans-serif;
  --font-numeric: tabular-nums; /* à appliquer sur tous les montants */
  /* Décision de Fréjus du 06/10/2026 : Relative n'a pas de chiffres de même
     largeur ; montants et chiffres clés s'écrivent en Arial, dont les chiffres
     sont tabulaires, pour que les colonnes s'alignent chiffre à chiffre. */
  /* Retour S6 (07/10/2026) : « Espace fine ACED » ne sert que l'espace des
     milliers (U+202F) ; les chiffres restent en Arial. */
  --font-chiffres: "Espace fine ACED", Arial, sans-serif;

  /* Tailles de texte (taille / interligne) */
  --text-xs: 12px;   --leading-xs: 16px;    /* aide, unités, pastilles */
  --text-sm: 14px;   --leading-sm: 20px;    /* texte d'interface, tableaux, libellés, boutons */
  --text-base: 16px; --leading-base: 24px;  /* texte de base, bouton principal grand */
  --text-lg: 18px;   --leading-lg: 28px;    /* titre de sous-bloc */
  --text-xl: 20px;   --leading-xl: 28px;    /* titre de carte, chiffre secondaire */
  --text-3xl: 30px;  --leading-3xl: 36px;   /* chiffre clé */
  --text-4xl: 36px;  --leading-4xl: 40px;   /* titre de page, chiffre clé principal */
  --leading-relaxed: 1.625;                 /* paragraphes descriptifs */
  --tracking-table: 0.025em;                /* cellules de tableau */

  /* Graisses */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  /* Accent ACED et palette ACED : dans jetons.css (source commune, chargée
     aussi par les écrans en service ; décision X1 du 06/10/2026). */

  /* Fonds */
  --color-bg-page: #f3f4f6;
  --color-bg-card: #ffffff;
  --color-bg-subtle: #f9fafb;               /* bandeau de section, ligne paire */
  --color-bg-hover: #f3f4f6;                /* survol de ligne */
  --color-bg-secondary: #e5e7eb;            /* bouton secondaire, pastille */

  /* Bordures */
  --color-border: rgba(229, 231, 235, 0.75);  /* cartes, filets */
  --color-border-input: #d1d5db;
  --color-border-focus: #6f6f6f;

  /* Texte */
  --color-text: #000000;
  --color-text-secondary: rgba(0, 0, 0, 0.75);
  /* Modifiée le 06/10 (revue B1) : noir à 60 % au lieu de 50 % (#666, 5,74:1
     sur blanc ; 50 % ne donnait que 3,95:1). */
  --color-text-tertiary: rgba(0, 0, 0, 0.6);
  /* Modifiée le 06/10 (revue H5) : noir à 55 % au lieu de 25 % (4,74:1 sur
     blanc ; 25 % ne donnait que 1,84:1). L'exemple ne remplace jamais le libellé. */
  --color-text-placeholder: rgba(0, 0, 0, 0.55);

  /* États - proposition à partir de la palette ACED.
     Couleur pleine (texte foncé de l'état) / fond (couleur de la palette). */
  --color-success: #00533a;      --color-success-bg: #c4d970;  /* terminé */
  /* Modifiée le 06/10 (revue B2) : #6e5600 au lieu de #8a6d00 (6,03:1 sur le
     fond de pastille ; #8a6d00 donnait 4,23:1). */
  --color-warning: #6e5600;      --color-warning-bg: #ffd65c;  /* en circuit */
  /* Modifiée le 06/10 (revue H1) : #a1301f au lieu de #b4382a (5,28:1 sur le
     fond de pastille ; #b4382a donnait 4,41:1). */
  --color-danger: #a1301f;       --color-danger-bg: #ed7869;   /* à reprendre, erreur */
  /* Lot 70 (D20, 20/10/2026) : « produit, mais annulé depuis » sur la page publique
     de vérification (titre #8a3c00 sur #ffe4cc : contraste > 7:1). */
  --color-orange: #8a3c00;       --color-orange-bg: #f08a3c;   --color-orange-bg-soft: #ffe4cc;
  /* Modifiée le 06/10 (revue J1) : le bleu de la référence (#3b82f6, #eff6ff)
     sort ; l'information prend l'accent ACED. */
  --color-info: var(--color-accent);  --color-info-bg: var(--color-accent-soft);

  /* Espacements (base 4 px) */
  --space-0-5: 2px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-11: 44px;
  --space-16: 64px;

  /* Rayons */
  --radius-sm: 2px;
  --radius: 4px;        /* boutons, champs, pastilles, cases */
  --radius-md: 6px;     /* cartes */
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 9999px;

  /* Bordures et ombres */
  --border-hairline: 0.5px;
  --border-tab-active: 2px;
  --shadow-none: none;  /* cartes et boutons */
  --shadow-menu: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  /* Dimensions */
  --sidebar-width: 287px;
  --content-max-width: 1280px;
  --control-height: 37px;       /* champ, bouton standard */
  --control-height-lg: 45px;    /* bouton principal de page */
  /* Modifiée le 06/10 (revue H6) : 24 px au lieu de 21 px, la taille de cible
     minimale (WCAG 2.5.8). */
  --control-height-sm: 24px;
  --table-header-height: 46px;
  --table-row-height: 54px;     /* référence ; 40 à 44 px proposé pour la finance */
  --transition-fast: 100ms ease-in-out;
}

/* --- Ajouts propres à l'essai (hors § 8, donc à valider eux aussi) -------- */
:root {
  /* Proposition § 7.7 : 44 px par ligne au lieu des 54 de la référence. */
  --v2-table-row-height: 44px;
  --v2-tabbar-height: 60px;

  /* Teintes d'état (revue J2) : le texte foncé et le fond éclairci de chaque
     famille, déclarés une fois. Fonds = couleur de la palette ACED mêlée de
     blanc (45 % de vert clair ou de jaune, 30 % de rouge), écrits en clair
     pour ne plus dépendre de color-mix. Proposition. */
  --color-success-text: var(--color-success);   --color-success-bg-soft: #e4eebf;
  --color-warning-text: var(--color-warning);   --color-warning-bg-soft: #ffedb6;
  --color-danger-text: var(--color-danger);     --color-danger-bg-soft: #fad6d2;
  --color-info-text: var(--color-accent-text);  --color-info-bg-soft: #ebf1ef;   /* accent à 8 % sur blanc */
  --color-neutre-text: var(--color-text-secondary); --color-neutre-bg-soft: var(--color-bg-secondary);
  /* La pastille « Proposition » du guide : beige ACED, texte brun. */
  --color-proposition-text: #7a4a12;            --color-proposition-bg-soft: var(--aced-beige);
  /* Lot 91 (testeur du lot 85) : « Réservé » des Courriers, bleu, distinct du jaune « À signer ». */
  --color-reserve-text: #1f4e8c;                --color-reserve-bg-soft: #e3edfa;
  /* Lot RH 2 (congés, maquette validée le 16/11/2026) : le calendrier de l'équipe.
     « Congé » en vert pâle, « En attente » en ocre pâle bordé de pointillés,
     l'avertissement « absents de l'équipe » en crème bordé d'ocre. */
  --color-conge-text: #1d4d2f;                  --color-conge-bg-soft: #dff3e6;
  --color-attente-text: #5c4510;                --color-attente-bg-soft: #fff6dc;
  --color-attente-border: #d1a23b;
  --color-avis-bg-soft: #fff8e6;                --color-avis-border: #ecd9a6;

  /* Traits */
  --border-width: 1px;           /* champs, boutons contour, listes d'options */
  --focus-ring-width: 2px;       /* contour de focus, champs compris (revue B5) */
  --border-total: 1px;           /* filet au-dessus d'une ligne Total */

  /* Tailles de composants */
  --target-min: 24px;            /* plus petite cible cliquable (WCAG 2.5.8) */
  --nav-link-height: var(--space-11);
  --topbar-min-height: var(--space-16);
  --tab-height: 54px;            /* onglet (référence) */
  --group-row-height: 40px;      /* ligne de groupe d'un tableau */
  --empty-row-height: var(--space-16);
  --badge-height: 20px;          /* pastille, compteur */
  --dot-size: var(--space-2);    /* point d'état, 8 px */
  --check-size: 16px;            /* case à cocher */
  --icon-sm: 14px;               /* icônes de la barre latérale */
  --icon-md: 20px;               /* icônes de la barre d'onglets */
  --logo-height: 30px;
  --logo-height-mobile: 26px;

  /* Largeurs */
  --width-context-select: 260px; /* sélecteurs de contexte, en-tête */
  --width-search: 280px;         /* recherche, en-tête */
  --width-menu-min: 260px;
  --width-menu-max: 360px;
  --width-field-min: 180px;      /* champ d'une rangée de filtres */
  --width-field-wide: 260px;     /* champ large d'une rangée de filtres */
  --width-cell-wide: 240px;      /* cellule de texte long */
  --width-table-scroll: 640px;   /* tableau qui défile dans son cadre sur mobile */
  --width-grid-col: 200px;       /* grille du guide */
  --width-grid-col-lg: 280px;
  --width-scale-label: 250px;    /* intitulés des échelles du guide */

  color-scheme: light;
}

/* --- Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box }
html { scrollbar-gutter: stable; -webkit-text-size-adjust: 100% }

body.v2 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--color-text);
  background: var(--color-bg-page);
  -webkit-font-smoothing: antialiased;
}
.v2 a { color: var(--color-accent-text); text-decoration: none }
.v2 a:hover { text-decoration: underline }
/* Un lien au milieu d'un texte ou d'un tableau se distingue autrement que par
   sa couleur (revue B3, WCAG 1.4.1). */
.v2 p a, .v2-table td a, .v2-bandeau-essai a { text-decoration: underline; text-underline-offset: 2px }
.v2 h1, .v2 h2, .v2 h3, .v2 p { margin: 0 }
.v2 :focus-visible { outline: var(--focus-ring-width) solid var(--color-border-focus); outline-offset: 2px }

/* Texte lu par les lecteurs d'écran seulement. */
.v2-lecteur { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap }

/* Lien d'évitement : invisible jusqu'à ce qu'on y arrive au clavier (revue B6). */
.v2-evitement {
  position: absolute; left: var(--space-4); top: var(--space-2); z-index: 50;
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent); color: var(--color-on-accent);
  border-radius: var(--radius);
  font-weight: var(--weight-medium);
  transform: translateY(-200%);
}
.v2 a.v2-evitement { color: var(--color-on-accent) }
.v2-evitement:focus { transform: none }

/* Tout montant : chiffres de même largeur, alignés à droite (§ 7.8). */
.v2-num { font-family: var(--font-chiffres); font-variant-numeric: var(--font-numeric); text-align: right; white-space: nowrap }
.v2-tab-num { font-family: var(--font-chiffres); font-variant-numeric: var(--font-numeric) }

/* Marges d'appoint, sur l'échelle d'espacement (préfixées .v2 pour l'emporter
   sur « .v2 p { margin: 0 } »). */
.v2 .v2-mt-2 { margin-top: var(--space-2) }
.v2 .v2-mt-3 { margin-top: var(--space-3) }
.v2 .v2-mt-4 { margin-top: var(--space-4) }
.v2 .v2-mt-6 { margin-top: var(--space-6) }
.v2 .v2-mb-4 { margin-bottom: var(--space-4) }
.v2 .v2-mb-6 { margin-bottom: var(--space-6) }
.v2-centre { text-align: center }

/* Icônes au trait (templates/design/_icone.html). */
.v2-ico { width: var(--icon-sm); height: var(--icon-sm); flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round }

/* --- Structure : barre latérale, barre du haut, contenu (§ 1) ------------- */
.v2-shell { min-height: 100vh }

.v2-sidebar {
  display: none;
  position: sticky;
  top: 0;
  height: 100vh;
  width: var(--sidebar-width);
  background: var(--color-bg-card);
  padding: var(--space-6) 0 var(--space-10);
  flex-direction: column;
  overflow-y: auto;
}
.v2-brand { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-6) var(--space-6) }
.v2-brand img { height: var(--logo-height); width: auto }
.v2-brand span { font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--color-text-secondary) }
/* Lot 69 : un rôle par ligne sous le nom du module (trois rôles lisibles, sans « · » en début de ligne). */
.v2-brand .v2-role { display: block }
/* Plusieurs rôles : une puce par rôle et un retrait suspendu, pour qu'un rôle
   renvoyé à la ligne (« Administrateur de la / plateforme ») ne passe pas pour
   un rôle de plus (testeur du lot 69). */
.v2-brand .v2-role:not(:only-child) { padding-left: .8em; text-indent: -.8em }
.v2-brand .v2-role:not(:only-child)::before { content: "•"; display: inline-block; width: .8em; text-indent: 0 }
.v2-brand .v2-role + .v2-role { margin-top: 2px }
.v2-brand b { display: block; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text) }

.v2-nav { display: flex; flex-direction: column; padding: 0 var(--space-3) }
.v2-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--nav-link-height);
  padding: var(--space-3);
  border-radius: var(--radius);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.v2-nav a:hover { background: var(--color-bg-subtle); color: var(--color-text); text-decoration: none }
.v2-nav a.on { color: var(--color-text) }
/* Le trait de l'écran actif, sur le bord droit de la barre. */
.v2-nav a.on::after {
  content: "";
  position: absolute;
  top: var(--space-2); bottom: var(--space-2);
  right: calc(-1 * var(--space-3));
  width: var(--border-tab-active);
  background: var(--color-accent);
}
.v2-nav a.on .v2-ico { color: var(--color-accent) }

.v2-sidebar-bas { margin-top: auto; padding-top: var(--space-8) }
.v2-sidebar-pied {
  display: flex; flex-wrap: wrap; gap: 0 var(--space-4);
  padding: var(--space-4) var(--space-6) 0;
  font-size: var(--text-xs); line-height: var(--leading-xs);
}
/* Cibles de 24 px au moins (revue B4). */
.v2-sidebar-pied a { display: inline-flex; align-items: center; min-height: var(--target-min); color: var(--color-text-tertiary) }
.v2-sidebar-pied a.on { color: var(--color-text); font-weight: var(--weight-medium) }

.v2-main { min-width: 0 }

.v2-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-3);
  min-height: var(--topbar-min-height);
  padding: var(--space-3) var(--space-6);
}
.v2-topbar .v2-logo-mobile { margin-right: auto }
.v2-topbar .v2-logo-mobile img { height: var(--logo-height-mobile); display: block }
.v2-topbar form { margin: 0 }
.v2-topbar .v2-recherche .v2-input { width: var(--width-search) }
.v2-contexte { display: flex; gap: var(--space-2); margin-right: auto; min-width: 0 }
.v2-contexte .v2-select { max-width: var(--width-context-select) }

.v2-content { padding: var(--space-2) var(--space-6) var(--space-16) }
.v2-container { max-width: var(--content-max-width); margin: 0 auto }

@media (min-width: 1024px) {
  /* Lot 18 : la barre du haut tient sur une ligne ; les sélecteurs de
     contexte cèdent de la largeur avant la recherche et le compte. */
  .v2-topbar { flex-wrap: nowrap }
  .v2-contexte { flex: 0 1 auto }
  .v2-contexte .v2-select { min-width: 0; flex: 0 1 var(--width-context-select) }
  .v2-topbar .v2-recherche .v2-input { width: var(--width-field-wide) }
  /* La colonne blanche de la barre court sur toute la hauteur de la page. */
  .v2-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    align-items: start;
    background: linear-gradient(to right, var(--color-bg-card) var(--sidebar-width), transparent var(--sidebar-width));
  }
  .v2-sidebar { display: flex }
  .v2-topbar { padding: var(--space-3) var(--space-8) }
  .v2-content { padding: var(--space-2) var(--space-8) var(--space-16) }
  .v2-topbar .v2-logo-mobile { display: none }
}
/* Retours du testeur A5 (lot 20) : à 1 450 px, la barre du chargé de projet
   (« + Nouvelle demande de paiement ») coupait le projet et la recherche. Les
   sélecteurs cèdent de la largeur (et prennent leur nom court, charte.js,
   plutôt que d'être coupés) ; la recherche
   garde 236 px tant qu'il y a la place ; sous 1 680 px, le bouton du
   compte ne montre que l'icône (le nom est dans son menu et au survol). */
@media (min-width: 1024px) {
  .v2-contexte .v2-select { flex: 0 1 auto; width: auto; min-width: 6rem }
  .v2-contexte #ctx_financement { max-width: 13rem }
  .v2-contexte { min-width: calc(12rem + var(--space-2)) }
  .v2-topbar .v2-recherche { flex: 0 1 auto; min-width: auto }
  .v2-topbar .v2-recherche .v2-input { width: 236px; flex: 0 1 auto; min-width: 120px }
  .v2-topbar .v2-recherche { width: calc(236px + 2.5rem); min-width: calc(120px + 2.5rem) }
}
@media (min-width: 1280px) {
  .v2-topbar .v2-recherche, .v2-topbar .v2-recherche .v2-input { flex-shrink: 0 }
}
/* Second passage du testeur (A5, lot 20) : de 1 024 à 1 279 px, la barre du
   chargé de projet (« + Nouvelle demande de paiement ») coupait encore le
   financement (« 6 fina… ») et la recherche (« Numéro, bénéf… »). Elle passe
   sur deux lignes : le projet et le financement en entier sur la première,
   la recherche, la nouvelle pièce et le compte sur la seconde. */
@media (min-width: 1024px) and (max-width: 1279.98px) {
  .v2-topbar { flex-wrap: wrap; row-gap: var(--space-2) }
  .v2-contexte { flex: 1 0 100%; margin-right: 0 }
  .v2-topbar .v2-recherche { margin-left: auto }
  .v2-topbar .v2-recherche, .v2-topbar .v2-recherche .v2-input { flex-shrink: 0 }
}
.v2-menu-liste .v2-menu-nom { display: none; color: var(--color-text) }
@media (min-width: 1024px) and (max-width: 1679.98px) {
  .v2-compte-nom { display: none }
  .v2-menu-liste .v2-menu-nom { display: block }
}
@media (min-width: 1280px) {
  .v2-topbar { padding: var(--space-3) var(--space-11) }
  .v2-content { padding-left: var(--space-11); padding-right: var(--space-11) }
}
@media (min-width: 1536px) {
  .v2-topbar { padding: var(--space-3) var(--space-16) }
  .v2-content { padding-left: var(--space-16); padding-right: var(--space-16) }
}

/* Lot 18 : le cadre de toutes les pages (templates/base.html). */
a.v2-brand { color: inherit }
.v2 a.v2-brand:hover { text-decoration: none }
/* Le menu secondaire suit le principal, séparé par un filet, au lieu d'être
   repoussé au bas de l'écran (amélioration A3 du lot 18). */
.v2-nav-secondaire {
  margin: var(--space-4) var(--space-3) 0;
  padding: var(--space-4) 0 0;
  border-top: var(--border-hairline) solid var(--color-border-input);
}
.v2-sidebar-pied { margin-top: auto }
.v2-sigle { font-family: var(--font-chiffres); font-weight: var(--weight-semibold); margin-right: var(--space-1) }
.v2-messages { margin-bottom: var(--space-2) }
.v2-volets { margin-bottom: var(--space-6) }
/* Lot 56 (testeur, D1) : au-delà de dix volets (les deux rôles d'administration),
   un espacement plus serré pour tenir sur une ligne à 1 440 px. */
.v2-volets.v2-volets-serres { column-gap: var(--space-2) }
/* Finitions 7 (testeur Finitions 6) : à 1 366 px, « Envois » passait seul à la ligne (onze volets
   de l'administration) ; le soulignement de l'onglet actif garde sa largeur de texte. */
.v2-volets.v2-volets-serres a { padding-left: 0; padding-right: 0 }
.v2-volets span.avenir {
  display: inline-flex; align-items: center;
  height: var(--tab-height); padding: var(--space-4) var(--space-1);
  color: var(--color-text-tertiary); white-space: nowrap; cursor: default;
}
.v2-hors-connexion-tete {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  background: var(--color-bg-card);
  border-bottom: var(--border-hairline) solid var(--color-border);
}
.v2-hors-connexion-tete img { height: var(--logo-height); display: block }
@media (max-width: 767.98px) {
  .v2-compte-nom { display: none }
}

/* Bandeau des données réelles : il reste, dans la couleur d'attention. */
.v2-bandeau-reel {
  padding: var(--space-2) var(--space-6);
  background: var(--color-danger-bg);
  color: var(--color-text);
  font-size: var(--text-sm);
}

/* Bandeau « Charte en essai », commun aux pages de l'essai (revue G5). */
.v2-bandeau-essai {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2);
  margin-bottom: var(--space-6);
  font-size: var(--text-xs); line-height: var(--leading-xs);
  color: var(--color-text-secondary);
}
.v2-bandeau-essai a { display: inline-flex; align-items: center; min-height: var(--target-min) }

/* --- En-tête de page -------------------------------------------------------- */
.v2-page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: var(--space-4);
  margin-bottom: var(--space-10);
}
.v2-page-head h1, .v2-h1 {
  font-size: var(--text-4xl); line-height: var(--leading-4xl);
  font-weight: var(--weight-semibold);
}
.v2-page-head .v2-sous-titre { margin-top: var(--space-2); color: var(--color-text-secondary) }

/* --- Textes ----------------------------------------------------------------- */
.v2-h2 { font-size: var(--text-xl); line-height: var(--leading-xl); font-weight: var(--weight-semibold) }
.v2-h3 { font-size: var(--text-lg); line-height: var(--leading-lg); font-weight: var(--weight-semibold) }
.v2-texte-base { font-size: var(--text-base); line-height: var(--leading-base) }
.v2-texte-secondaire { color: var(--color-text-secondary) }
.v2-desc { color: var(--color-text-secondary); line-height: var(--leading-relaxed); max-width: 72ch }
.v2-aide { font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--color-text-secondary) }
.v2-attenue { color: var(--color-text-tertiary) }

/* --- Cartes et chiffres clés ---------------------------------------------- */
.v2-card {
  background: var(--color-bg-card);
  border: var(--border-hairline) solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-none);
  padding: var(--space-8);
  min-width: 0;
}
.v2-card + .v2-card, .v2-stack > * + * { margin-top: var(--space-6) }
.v2-card-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.v2-card-head h2 { font-size: var(--text-xl); line-height: var(--leading-xl); font-weight: var(--weight-semibold) }
.v2-card-head h2 .v2-pastille { margin-left: var(--space-2) }
/* Les cartes d'un bloc de module (Mon bureau, S21) : titres d'un cran plus bas, même allure. */
.v2-card-head h3 { font-size: var(--text-xl); line-height: var(--leading-xl); font-weight: var(--weight-semibold) }

/* Mon bureau, « Mes modules » (règle S21, lot 27) : un bloc par module, son nom et « Ouvrir … ». */
.v2-modules > .v2-module + .v2-module { margin-top: var(--space-10) }
.v2-module-tete {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: var(--border-hairline) solid var(--color-border);
}
.v2-module-tete h2 { font-size: var(--text-3xl); line-height: var(--leading-3xl); font-weight: var(--weight-semibold) }
.v2-module-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) }
.v2-module-actions form { margin: 0 }
/* Sur ordinateur le bloc reste ouvert, sans résumé ; sur téléphone, il se replie (S08, décision du 12/10/2026). */
.v2-module-corps > summary {
  cursor: pointer; padding: var(--space-3) 0;
  color: var(--color-accent); font-weight: var(--weight-medium);
}
@media (min-width: 1024px) {
  .v2-module-corps > summary { display: none }
}
.v2 #en-cours td.v2-num { white-space: normal } /* le montant passe à la ligne avant la devise, plutôt que de faire déborder le tableau (recette du 12/10/2026) */
.v2 #en-cours td.v2-num .insecable { white-space: nowrap } /* … mais jamais « 1 850 000 / XOF » sur deux lignes (testeur RAPP B, tour 3) */
.v2 .v2-bureau-pied { margin-top: var(--space-8); text-align: center; font-size: var(--text-sm); line-height: var(--leading-sm) }
.v2 .v2-bureau-pied + .v2-bureau-pied { margin-top: var(--space-3) }
/* Ce que montre le bloc : un filtre du haut ou tout le périmètre (X5). */
.v2-portee { font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--color-text-secondary) }
.v2-card-head + .v2-desc { margin-top: calc(-1 * var(--space-4)); margin-bottom: var(--space-6) }
.v2-card-foot { margin-top: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2) }

/* Aide repliée derrière « Pourquoi… ? » (revue A10) : le texte se déplie sous
   le titre de la carte, les données restent en haut. */
.v2-pourquoi > summary {
  display: inline-flex; align-items: center; min-height: var(--target-min);
  list-style: none; cursor: pointer;
  font-size: var(--text-xs); line-height: var(--leading-xs);
  color: var(--color-accent-text);
  text-decoration: underline; text-underline-offset: 2px;
}
.v2-pourquoi > summary::-webkit-details-marker { display: none }
.v2-pourquoi-texte {
  display: flex; flex-direction: column; gap: var(--space-2);
  margin: calc(-1 * var(--space-3)) 0 var(--space-6);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-subtle);
  border-radius: var(--radius);
  max-width: 80ch;
}
.v2-pourquoi-texte p { color: var(--color-text-secondary); line-height: var(--leading-relaxed) }

/* Bandeau de section : pleine largeur de la carte. */
.v2-band {
  display: flex; align-items: center; gap: var(--space-2);
  margin: 0 calc(-1 * var(--space-8));
  padding: var(--space-3) var(--space-8);
  background: var(--color-bg-subtle);
  border-top: var(--border-hairline) solid var(--color-border);
  border-bottom: var(--border-hairline) solid var(--color-border);
  font-weight: var(--weight-medium);
}

.v2-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) }
.v2-kpis.trois { grid-template-columns: repeat(3, minmax(0, 1fr)) }
/* Mon bureau du DE (lot 39) : cinq tuiles sur une ligne, un peu plus serrées. */
.v2-kpis.cinq { grid-template-columns: repeat(5, minmax(0, 1fr)) }
.v2-kpis.cinq .v2-kpi { padding: 0 var(--space-5) }
.v2-kpis.cinq .v2-kpi:first-child { padding-left: 0 }
/* Règle S21 (lot 27) : « Tâches en attente » puis une tuile par module. */
.v2-kpis.deux { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.v2-kpis.un { grid-template-columns: minmax(0, 1fr) }
.v2-kpi { display: block; padding: 0 var(--space-8); min-width: 0 }
.v2-kpi:first-child { padding-left: 0 }
.v2-kpi + .v2-kpi { border-left: var(--border-hairline) solid var(--color-border-input) }
.v2-kpi-label { color: var(--color-text-secondary) }
.v2-kpi-valeur {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-3xl); line-height: var(--leading-3xl);
  font-family: var(--font-chiffres);
  font-weight: var(--weight-semibold);
  font-variant-numeric: var(--font-numeric);
  color: var(--color-text);
  white-space: nowrap;
}
.v2-kpi-valeur.principal { font-size: var(--text-4xl); line-height: var(--leading-4xl) }
.v2-kpi-unite { display: block; font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--color-text-tertiary) }
.v2-kpi .v2-pastille { margin-top: var(--space-0-5) }
/* Une tuile entière mène au bloc qu'elle compte (revue A1). */
.v2 a.v2-kpi { color: inherit; border-radius: var(--radius) }
.v2 a.v2-kpi:hover { text-decoration: none }
.v2 a.v2-kpi:hover .v2-kpi-valeur { color: var(--color-accent) }

/* --- Boutons (§ 4) ---------------------------------------------------------- */
.v2-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--control-height);
  padding: var(--space-2) var(--space-4);
  border: var(--border-width) solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: var(--text-sm); line-height: var(--leading-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.v2 a.v2-btn:hover { text-decoration: none }
.v2-btn-primaire { background: var(--color-accent); color: var(--color-on-accent) }
.v2 a.v2-btn-primaire { color: var(--color-on-accent) }
.v2-btn-primaire:hover, .v2-btn-primaire:focus-visible { background: var(--color-accent-hover) }
.v2-btn-secondaire { background: var(--color-bg-secondary); color: var(--color-text-secondary) }
.v2 a.v2-btn-secondaire { color: var(--color-text-secondary) }
.v2-btn-secondaire:hover { background: var(--color-border-input) }
.v2-btn-contour { background: transparent; color: var(--color-text-secondary); border-color: var(--color-border-input) }
.v2 a.v2-btn-contour { color: var(--color-text-secondary) }
.v2-btn-contour:hover { background: var(--color-bg-subtle) }
.v2-btn-grand { height: var(--control-height-lg); padding: var(--space-3) var(--space-5); font-size: var(--text-base) }
.v2-btn-petit { height: var(--control-height-sm); padding: var(--space-1) var(--space-2); font-size: var(--text-xs); line-height: var(--leading-xs) }
.v2-btn:disabled, .v2-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed }
.v2-btn-groupe { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center }
.v2-btn-groupe.large { gap: var(--space-6) }
.v2-btn-groupe.haut { align-items: flex-start }

/* Menu déroulant (<details>) : « + Nouvelle pièce », le compte. Se ferme par
   un clic ailleurs ou par Échap (revue A7), script dans base_v2.html. */
.v2-menu { position: relative }
.v2-menu > summary { list-style: none }
.v2-menu > summary::-webkit-details-marker { display: none }
.v2-menu-liste {
  position: absolute; right: 0; top: calc(100% + var(--space-1)); z-index: 30;
  min-width: var(--width-menu-min); max-width: min(var(--width-menu-max), calc(100vw - var(--space-8)));
  max-height: 70vh; overflow-y: auto;
  padding: var(--space-1) 0;
  background: var(--color-bg-card);
  border: var(--border-hairline) solid var(--color-border-input);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-menu);
}
.v2-menu-liste .v2-menu-module {
  padding: var(--space-3) var(--space-4) var(--space-1);
  font-weight: var(--weight-semibold);
  border-top: var(--border-hairline) solid var(--color-border);
}
.v2-menu-liste .v2-menu-module:first-child { border-top: 0 }
.v2-menu-liste .v2-menu-groupe {
  padding: var(--space-2) var(--space-4) var(--space-1);
  font-size: var(--text-xs); line-height: var(--leading-xs);
  color: var(--color-text-tertiary);
}
.v2-menu-liste a, .v2-menu-liste button, .v2-menu-liste .v2-menu-texte {
  display: block; width: 100%;
  padding: var(--space-2) var(--space-4);
  border: 0; background: none; text-align: left; font: inherit;
  color: var(--color-text);
  cursor: pointer;
}
.v2-menu-liste .v2-menu-texte { cursor: default; color: var(--color-text-secondary) }
.v2-menu-liste a:hover, .v2-menu-liste button:hover { background: var(--color-bg-hover); text-decoration: none }
.v2-menu-liste form { margin: 0 }
/* Lot 62 (décision de Fréjus du 18/10/2026) : « + Nouveau » rangé par intention.
   La rubrique (Payer, Déplacer de l'argent, Engagements) : la taille et le gris
   du groupe, en capitales pour qu'on la lise comme un titre. */
.v2-menu-liste .v2-menu-rubrique {
  padding: var(--space-3) var(--space-4) var(--space-1);
  font-size: var(--text-xs); line-height: var(--leading-xs);
  font-weight: var(--weight-semibold); letter-spacing: .04em; text-transform: uppercase;
  color: var(--color-text-tertiary);
}
/* Sur ordinateur, le libellé et son sigle tiennent sur une ligne : le menu
   prend sa largeur la plus grande. Sur téléphone, il garde la largeur de son
   contenu, accroché au bouton, et les libellés longs passent à la ligne. */
@media (min-width: 768px) { .v2-nouvelle-piece > .v2-menu-liste { width: var(--width-menu-max) } }
/* Une ligne : le libellé à gauche, le sigle petit et gris à droite. */
.v2-menu-liste a.v2-menu-ligne { display: flex; align-items: baseline; gap: var(--space-4) }
.v2-menu-ligne .v2-menu-libelle { flex: 1 1 auto; min-width: 0 }
.v2-menu-ligne .v2-menu-aide { display: block; font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--color-text-tertiary) }
.v2-menu-ligne .v2-menu-sigle {
  flex: none; font-family: var(--font-chiffres);
  font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--color-text-tertiary);
}
/* « Autres opérations (5) » : replié, le chevron des listes dépliables. */
.v2-menu-autres { border-top: var(--border-hairline) solid var(--color-border); margin-top: var(--space-1) }
.v2-menu-autres > summary {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  list-style: none; cursor: pointer; color: var(--color-text-secondary);
}
.v2-menu-autres > summary::-webkit-details-marker { display: none }
.v2-menu-autres > summary:hover { background: var(--color-bg-hover) }
.v2-menu-autres > summary::before {
  content: ""; flex: none; width: var(--space-2); height: var(--space-2);
  border-right: var(--focus-ring-width) solid currentColor;
  border-bottom: var(--focus-ring-width) solid currentColor;
  transform: rotate(-45deg); transition: transform var(--transition-fast);
}
.v2-menu-autres[open] > summary::before { transform: rotate(45deg) }
.v2-menu-liste hr { margin: var(--space-1) 0; border: 0; border-top: var(--border-hairline) solid var(--color-border-input) }

/* --- Champs (§ 4) ------------------------------------------------------------ */
.v2-champ { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0 }
/* Un groupe de choix (radios, cases) : fieldset + legend (revue H4). */
.v2-fieldset { margin: 0; padding: 0; border: 0; min-width: 0 }
.v2-fieldset > legend { padding: 0; margin-bottom: var(--space-2) }
.v2-label { font-weight: var(--weight-medium); color: var(--color-text) }
.v2-input, .v2-select {
  width: 100%;
  height: var(--control-height);
  padding: var(--space-2) var(--space-3);
  border: var(--border-width) solid var(--color-border-input);
  border-radius: var(--radius);
  background: var(--color-bg-card);
  font: inherit; font-size: var(--text-sm); line-height: var(--leading-sm);
  color: var(--color-text);
  transition: border-color var(--transition-fast);
}
.v2-input::placeholder { color: var(--color-text-placeholder) }
/* Focus des champs : la bordure fonce ET un contour de 2 px (revue B5). */
.v2-input:focus, .v2-select:focus {
  outline: var(--focus-ring-width) solid var(--color-border-focus);
  outline-offset: 0;
  border-color: var(--color-border-focus);
}
.v2-input.v2-num { text-align: right }
.v2-select {
  appearance: none;
  padding-right: var(--space-8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-opacity='.6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  text-overflow: ellipsis;
}
.v2-input[aria-invalid="true"] { border-color: var(--color-danger) }
.v2-input[aria-invalid="true"]:focus { outline-color: var(--color-danger) }
.v2-erreur { font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--color-danger) }

.v2-options { border: var(--border-width) solid var(--color-border-input); border-radius: var(--radius); overflow: hidden }
.v2-option {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
}
.v2-option + .v2-option { border-top: var(--border-width) solid var(--color-border-input) }
.v2-option input { margin-top: var(--space-0-5); accent-color: var(--color-accent) }
.v2-option b { display: block; font-weight: var(--weight-medium) }
.v2-option small { display: block; font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--color-text-secondary) }
.v2-option:has(input:checked) {
  background: var(--color-accent-soft);
  box-shadow: inset 0 0 0 var(--border-width) var(--color-accent-border-soft);
}
.v2-option:has(input:focus-visible) { outline: var(--focus-ring-width) solid var(--color-border-focus); outline-offset: calc(-1 * var(--focus-ring-width)) }
.v2-case { display: flex; align-items: center; gap: var(--space-2); min-height: var(--target-min); cursor: pointer }
.v2-case input {
  width: var(--check-size); height: var(--check-size); margin: 0;
  border-radius: var(--radius);
  accent-color: var(--color-accent);
}

.v2-recherche { display: flex; min-width: 0 }
.v2-recherche .v2-input { border-radius: var(--radius) 0 0 var(--radius); min-width: 0 }
.v2-recherche .v2-btn { border-radius: 0 var(--radius) var(--radius) 0; padding: var(--space-2) var(--space-3) }

/* --- Tableaux (§ 4, hauteur de ligne § 7.7) -------------------------------- */
.v2-table-wrap { margin: 0 calc(-1 * var(--space-8)); overflow-x: auto }
.v2-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm); line-height: var(--leading-sm);
}
.v2-table th {
  height: var(--table-header-height);
  padding: 0 var(--space-4);
  text-align: left;
  font-weight: var(--weight-medium);
  color: var(--color-text);
  border-bottom: var(--border-hairline) solid var(--color-border-input);
  white-space: nowrap;
}
.v2-table th.v2-num { text-align: right; white-space: normal }  /* « Budget disponible (XOF) » passe sur deux lignes plutôt que d'élargir le tableau */
.v2-table td {
  height: var(--v2-table-row-height);
  padding: var(--space-2) var(--space-4);
  color: var(--color-text-secondary);
  letter-spacing: var(--tracking-table);
  vertical-align: middle;
}
.v2-table th:first-child, .v2-table td:first-child { padding-left: var(--space-8) }
.v2-table th:last-child, .v2-table td:last-child { padding-right: var(--space-8) }
.v2-table tbody tr:nth-child(even) td { background: var(--color-bg-subtle) }
.v2-table tbody tr:hover td { background: var(--color-bg-hover) }
.v2-table td.v2-num { color: var(--color-text) }
.v2-table td.v2-fort { color: var(--color-text); font-weight: var(--weight-medium) }
.v2-table td.v2-vide { color: var(--color-text-tertiary); text-align: center; height: var(--empty-row-height) }
.v2-table td.v2-large { min-width: var(--width-cell-wide) }
.v2-table td.v2-insecable { white-space: nowrap }
/* Lot 35 : la file de tâches tient dans un écran de 15 pouces — l'objet passe à la ligne,
   même une référence sans espace ; l'action reste visible sans défilement horizontal. */
.v2-table.v2-file td.v2-objet { overflow-wrap: anywhere; min-width: 12rem }
.v2-table.v2-file td.v2-action { min-width: 8rem }
.v2-table td .v2-aide { font-weight: var(--weight-regular); color: var(--color-text-secondary) }
.v2-table td .v2-renvoi { margin-top: var(--space-1); font-size: var(--text-xs); color: var(--color-danger-text); max-width: 48ch }  /* Retours du testeur du 08/10/2026 (point 1) : le motif d'un renvoi dans la file */
.v2-table td .v2-objet-detail { margin-top: var(--space-1); font-size: var(--text-xs); color: var(--color-text-secondary); max-width: 48ch; overflow-wrap: anywhere }  /* Lot 26, tour 3 : la description de la pièce sous son objet, dans la file */
.v2-table tr.v2-groupe td {
  background: var(--color-bg-subtle);
  color: var(--color-text);
  font-weight: var(--weight-medium);
  border-top: var(--border-hairline) solid var(--color-border-input);
  height: var(--group-row-height);
}
.v2-table tr.v2-groupe:hover td { background: var(--color-bg-subtle) }
.v2-table th a { color: var(--color-accent-text) }
.v2-table td .v2-pastille { margin-left: var(--space-1) }

/* Total et sous-total (revues C2, I2) : graisse 600, filet au-dessus. */
.v2-table tr.v2-sous-total td {
  color: var(--color-text);
  font-weight: var(--weight-medium);
  border-top: var(--border-hairline) solid var(--color-border-input);
  background: var(--color-bg-card);
}
.v2-table tfoot td {
  color: var(--color-text);
  font-weight: var(--weight-semibold);
  border-top: var(--border-total) solid var(--color-border-focus);
}

/* Tableau qui défile dans son cadre quand il ne tient pas (revue F2). */
.v2-table-wrap.defile:focus-visible { outline-offset: calc(-1 * var(--focus-ring-width)) }

/* Liste dépliable de groupes (revue A3) : une ligne de synthèse par groupe,
   le détail dans un tableau aux mêmes colonnes. */
.v2-depliables { margin: 0 calc(-1 * var(--space-8)); border-top: var(--border-hairline) solid var(--color-border-input) }
.v2-depliable { border-bottom: var(--border-hairline) solid var(--color-border-input) }
.v2-depliable > summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-4);
  min-height: var(--v2-table-row-height);
  padding: var(--space-2) var(--space-8);
  list-style: none; cursor: pointer;
  color: var(--color-text);
}
.v2-depliable > summary::-webkit-details-marker { display: none }
.v2-depliable > summary:hover { background: var(--color-bg-hover) }
.v2-depliable > summary::before {
  content: ""; flex: none;
  width: var(--space-2); height: var(--space-2);
  border-right: var(--focus-ring-width) solid currentColor;
  border-bottom: var(--focus-ring-width) solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--transition-fast);
}
.v2-depliable[open] > summary::before { transform: rotate(45deg) }
.v2-depliable-date { font-weight: var(--weight-medium); font-variant-numeric: var(--font-numeric) }
.v2-depliable-detail { margin-left: auto; color: var(--color-text-secondary) }
.v2-depliable .v2-table-wrap { margin: 0 }
.v2-depliable .v2-table { table-layout: fixed }
.v2-depliable .v2-table th { height: auto; padding-top: var(--space-2); padding-bottom: var(--space-2) }

/* --- Pastilles et états (§ 4, § 7.10) --------------------------------------- */
/* Une seule correspondance état → couleur pour le point et la pastille. Les
   couleurs regroupent des familles (en circuit, terminé, à reprendre) ; c'est
   le libellé écrit qui dit l'état exact (revue G3). */
.v2-etat, .v2-pastille {
  --etat-point: var(--color-border-input);   /* neutre : gris */
  --etat-contour: var(--color-text-tertiary);
  --etat-texte: var(--color-neutre-text);
  --etat-fond: var(--color-neutre-bg-soft);
}
:is(.v2-etat, .v2-pastille).attente { --etat-point: var(--aced-jaune);       --etat-contour: var(--color-warning-text); --etat-texte: var(--color-warning-text); --etat-fond: var(--color-warning-bg-soft) }
:is(.v2-etat, .v2-pastille).succes  { --etat-point: var(--aced-vert-clair);  --etat-contour: var(--color-success-text); --etat-texte: var(--color-success-text); --etat-fond: var(--color-success-bg-soft) }
:is(.v2-etat, .v2-pastille).danger  { --etat-point: var(--aced-rouge);       --etat-contour: var(--color-danger-text);  --etat-texte: var(--color-danger-text);  --etat-fond: var(--color-danger-bg-soft) }
:is(.v2-etat, .v2-pastille).info    { --etat-point: var(--color-info);       --etat-contour: var(--color-info-text);    --etat-texte: var(--color-info-text);    --etat-fond: var(--color-info-bg-soft) }
.v2-pastille.proposition { --etat-texte: var(--color-proposition-text); --etat-fond: var(--color-proposition-bg-soft) }

/* Point d'état de 8 px, cerclé d'un trait foncé pour rester visible sur
   blanc (revue B9), devant le libellé. */
.v2-etat { display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; color: var(--color-text-secondary) }
.v2-etat::before {
  content: ""; width: var(--dot-size); height: var(--dot-size); flex: none;
  border-radius: var(--radius-full);
  background: var(--etat-point);
  box-shadow: 0 0 0 var(--border-width) var(--etat-contour);
}

/* Pastille : fond éclairci de la famille, texte foncé. Variante « compteur »
   (nombre à côté d'un titre ou d'un onglet) : texte noir, chiffres de même
   largeur. */
.v2-pastille {
  display: inline-flex; align-items: center; gap: var(--space-1);
  height: var(--badge-height); padding: var(--space-0-5) var(--space-2);
  border-radius: var(--radius);
  font-size: var(--text-xs); line-height: var(--leading-xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  background: var(--etat-fond); color: var(--etat-texte);
  vertical-align: middle;
}
.v2-pastille.compteur { color: var(--color-text); font-variant-numeric: var(--font-numeric) }

/* --- Onglets ------------------------------------------------------------------- */
/* Recette du lot 25, tour 2 : les dix volets des Référentiels (Admin ACED, qui
   porte les deux rôles d'administration) dépassaient à 1 440 px et cachaient
   « Journal » derrière un défilement de côté. L'écart passe de 24 à 16 px (tout
   tient sur une ligne à 1 440 px) et les onglets passent à la ligne au-delà. */
.v2-onglets {
  display: flex; flex-wrap: wrap; column-gap: var(--space-4); row-gap: 0;
  border-bottom: var(--border-hairline) solid var(--color-border-input);
}
.v2-onglets a {
  display: inline-flex; align-items: center; gap: var(--space-2);
  height: var(--tab-height); padding: var(--space-4) var(--space-1);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  border-bottom: var(--border-tab-active) solid transparent;
  white-space: nowrap;
}
.v2-onglets a:hover { color: var(--color-text); text-decoration: none }
.v2-onglets a[aria-current="page"] { color: var(--color-text); border-bottom-color: var(--color-accent) }

/* --- Filtres --------------------------------------------------------------------- */
.v2-filtres { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end }
.v2-filtres .v2-champ { flex: 1 1 var(--width-field-min) }
.v2-filtres .v2-champ.large { flex: 2 1 var(--width-field-wide) }
.v2-resultats { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-4) }
.v2-resultats b { font-family: var(--font-chiffres); font-size: var(--text-xl); line-height: var(--leading-xl); font-weight: var(--weight-semibold); font-variant-numeric: var(--font-numeric) }

/* --- État vide : le texte et l'action, sans cadre décoratif (revue J4) ------ */
.v2-vide { max-width: 72ch }
.v2-vide ul { margin: var(--space-4) 0; padding-left: var(--space-5); color: var(--color-text-secondary); line-height: var(--leading-relaxed) }

/* --- Guide de style ---------------------------------------------------------------- */
.v2-grille { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(var(--width-grid-col), 1fr)) }
.v2-grille.large { grid-template-columns: repeat(auto-fill, minmax(var(--width-grid-col-lg), 1fr)); gap: var(--space-6) }
.v2-pastille-couleur { display: flex; gap: var(--space-3); align-items: center; min-width: 0 }
.v2-pastille-couleur i {
  width: var(--space-11); height: var(--space-11); flex: none;
  border-radius: var(--radius-md);
  border: var(--border-width) solid var(--color-border-input);
}
/* Échantillon d'état : le fond éclairci autour d'un carré du texte foncé. */
.v2-pastille-couleur i.etat { background: var(--fond); box-shadow: inset 0 0 0 var(--space-2) var(--fond), inset 0 0 0 var(--space-6) var(--trait) }
.v2-pastille-couleur code, .v2-code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: var(--text-xs); line-height: var(--leading-xs);
  color: var(--color-text-secondary);
  overflow-wrap: anywhere;
}
.v2-pastille-couleur b { display: block; font-weight: var(--weight-medium) }
.v2-section-titre { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin: var(--space-6) 0 var(--space-3) }
.v2-section-titre:first-child { margin-top: 0 }
.v2-echelle { display: flex; flex-direction: column }
.v2-echelle > div {
  display: grid; grid-template-columns: var(--width-scale-label) minmax(0, 1fr); gap: var(--space-4);
  align-items: baseline;
  padding: var(--space-3) 0;
  border-bottom: var(--border-hairline) solid var(--color-border-input);
}
.v2-echelle > div:last-child { border-bottom: 0 }
.v2-espace { display: flex; align-items: center; gap: var(--space-3) }
.v2-espace i { display: block; height: var(--space-3); background: var(--color-accent); border-radius: var(--radius-sm) }
.v2-rayon { width: var(--space-16); height: var(--space-11); border: var(--border-width) solid var(--color-border-input); background: var(--color-bg-subtle) }
.v2-rayon.rond { width: var(--space-11) }
.v2-sommaire { display: flex; flex-wrap: wrap; gap: 0 var(--space-4); font-size: var(--text-sm) }
.v2-sommaire a { display: inline-flex; align-items: center; min-height: var(--target-min) }
.v2-lexique td { white-space: normal }

/* Maquettes de structure : dimensions d'illustration, propres au guide. */
.v2-maquette {
  --maquette-barre: 90px; --maquette-hauteur: 160px;
  display: grid; grid-template-columns: var(--maquette-barre) minmax(0, 1fr); height: var(--maquette-hauteur);
  border: var(--border-width) solid var(--color-border-input); border-radius: var(--radius-md); overflow: hidden;
  font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--color-text-secondary);
}
.v2-maquette > div { padding: var(--space-2) }
.v2-maquette .lat { background: var(--color-bg-card); border-right: var(--border-width) dashed var(--color-border-input) }
.v2-maquette .cont { background: var(--color-bg-page) }
.v2-maquette .cont span { display: block; margin-top: var(--space-2); height: var(--space-8); background: var(--color-bg-card); border-radius: var(--radius) }
.v2-maquette-mobile {
  --maquette-largeur: 120px; --maquette-hauteur: 200px;
  width: var(--maquette-largeur); height: var(--maquette-hauteur); margin: 0 auto;
  display: flex; flex-direction: column;
  border: var(--border-width) solid var(--color-border-input); border-radius: var(--radius-xl); overflow: hidden;
  background: var(--color-bg-page);
  font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--color-text-secondary);
}
.v2-maquette-mobile .cont { flex: 1; padding: var(--space-2) }
.v2-maquette-mobile .cont span { display: block; margin-top: var(--space-2); height: var(--space-6); background: var(--color-bg-card); border-radius: var(--radius) }
.v2-maquette-mobile .bas { height: var(--space-6); background: var(--color-bg-card); border-top: var(--border-width) solid var(--color-border-input); display: flex; justify-content: space-around; align-items: center }
.v2-maquette-mobile .bas i { width: var(--space-2); height: var(--space-2); border-radius: var(--radius-sm); background: var(--color-text-tertiary) }
.v2-maquette-mobile .bas i:first-child { background: var(--color-accent) }

/* --- Barre d'onglets du bas (mobile, < 1024 px) ------------------------------------ */
.v2-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex;
  height: var(--v2-tabbar-height);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--color-bg-card);
  border-top: var(--border-hairline) solid var(--color-border-input);
}
.v2-tabbar > a, .v2-tabbar > details { flex: 1 1 0; min-width: 0 }
.v2-tabbar > a, .v2-tabbar > details > summary {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1);
  height: 100%;
  padding: 0 var(--space-1);
  font-size: var(--text-xs); line-height: var(--leading-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  text-align: center;
  cursor: pointer;
}
.v2-tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.v2 .v2-tabbar a:hover { text-decoration: none }
.v2-tabbar a.on { color: var(--color-accent) }
.v2-tabbar .v2-ico { width: var(--icon-md); height: var(--icon-md) }
.v2-tabbar .v2-menu-liste { top: auto; bottom: calc(100% + var(--space-2)); right: var(--space-2) }
.v2-tabbar details { position: static }

@media (max-width: 1023.98px) {
  body.v2 { padding-bottom: var(--v2-tabbar-height) }
}
@media (min-width: 1024px) {
  .v2-tabbar { display: none }
}

/* --- Petits écrans ------------------------------------------------------------------ */
@media (max-width: 767.98px) {
  .v2-card { padding: var(--space-5) }
  .v2-table-wrap, .v2-depliables { margin: 0 calc(-1 * var(--space-5)) }
  .v2-depliable .v2-table-wrap { margin: 0 }
  .v2-depliable > summary { padding: var(--space-2) var(--space-5) }
  .v2-table th:first-child, .v2-table td:first-child { padding-left: var(--space-5) }
  .v2-table th:last-child, .v2-table td:last-child { padding-right: var(--space-5) }
  .v2-band { margin: 0 calc(-1 * var(--space-5)); padding: var(--space-3) var(--space-5) }
  .v2-page-head { margin-bottom: var(--space-8) }
  .v2-page-head h1, .v2-h1 { font-size: var(--text-3xl); line-height: var(--leading-3xl) }
  .v2-kpis, .v2-kpis.trois, .v2-kpis.cinq { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--space-5) }
  .v2-kpi, .v2-kpis.cinq .v2-kpi { padding: 0 var(--space-4) }
  .v2-kpi:nth-child(odd) { padding-left: 0; border-left: 0 }
  .v2-kpi-valeur, .v2-kpi-valeur.principal { font-size: var(--text-3xl); line-height: var(--leading-3xl) }
  .v2-echelle > div { grid-template-columns: 1fr; gap: var(--space-1) }
  .v2-contexte { order: 3; width: 100%; margin-right: 0 }
  .v2-contexte .v2-select { max-width: none; flex: 1 1 0; min-width: 0 }
  .v2-topbar .v2-recherche { order: 4; width: 100% }
  .v2-topbar .v2-recherche .v2-input { width: auto; flex: 1 1 auto }
  /* Un tableau de chiffres garde sa forme et défile dans son cadre (revue F2). */
  .v2-table.defile { min-width: var(--width-table-scroll) }
  .v2-depliable .v2-table { table-layout: auto }
}

/* Chiffres clés sur une colonne sous 480 px (revue K1) : un montant à
   8 chiffres ne tient pas dans une demi-largeur. */
@media (max-width: 479.98px) {
  .v2-kpis, .v2-kpis.trois, .v2-kpis.cinq { grid-template-columns: minmax(0, 1fr); row-gap: 0 }
  .v2-kpi, .v2-kpi:nth-child(odd), .v2-kpis.cinq .v2-kpi { padding: var(--space-3) 0; border-left: 0 }
  .v2-kpi + .v2-kpi { border-left: 0; border-top: var(--border-hairline) solid var(--color-border-input) }
  .v2-kpi:first-child { padding-top: 0 }
  .v2-kpi:last-child { padding-bottom: 0 }
}

/* Mobile : un tableau « empilable » (file de tâches) devient une liste de
   fiches, une par ligne, chaque valeur précédée de son intitulé (data-label).
   Les rôles table / row / cell sont écrits dans le HTML : le navigateur les
   perd avec display: block (revue B7). */
@media (max-width: 767.98px) {
  .v2-table.empilable thead { display: none }
  .v2-table.empilable, .v2-table.empilable tbody, .v2-table.empilable tr { display: block; width: 100% }
  .v2-table.empilable tr { padding: var(--space-3) var(--space-5); border-bottom: var(--border-hairline) solid var(--color-border-input) }
  .v2-table.empilable tbody tr:nth-child(even) td, .v2-table.empilable tbody tr:hover td { background: none }
  .v2-table.empilable tbody tr:nth-child(even) { background: var(--color-bg-subtle) }
  .v2-table.empilable td {
    display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4);
    height: auto; min-width: 0; padding: var(--space-1) 0;
    text-align: right;
  }
  .v2-table.empilable td:first-child, .v2-table.empilable td:last-child { padding-left: 0; padding-right: 0 }
  .v2-table.empilable td::before {
    content: attr(data-label);
    flex: none; max-width: 45%;
    text-align: left;
    color: var(--color-text-tertiary);
    font-size: var(--text-xs);
    font-weight: var(--weight-regular);
    letter-spacing: 0;
  }
  .v2-table.empilable td:not([data-label])::before { content: none }
  .v2-table.empilable td:not([data-label]) { display: block; text-align: left }
  .v2-table.empilable td.v2-large { min-width: 0 }
  .v2-table.empilable tr.v2-groupe { padding: var(--space-2) var(--space-5); background: var(--color-bg-subtle) }
  .v2-table.empilable tr.v2-groupe td { background: none; border: 0; height: auto }
  .v2-table.empilable td.v2-vide { display: block; text-align: center }
  /* Lot Finitions 3 (lot FB, tour 4) : l'objet et l'action passent sous leur intitulé, sur
     toute la largeur ; ils ne se coupent plus en plein mot (« Marcellin / e D. ») et le motif
     d'un renvoi ne tient plus sur huit lignes étroites. */
  .v2-table.empilable td:is(.v2-objet, .v2-action) { display: block; text-align: left; overflow-wrap: break-word; min-width: 0 }
  .v2-table.empilable td:is(.v2-objet, .v2-action)::before { display: block; max-width: none; margin-bottom: 2px }
  .v2-table.empilable td :is(.v2-renvoi, .v2-objet-detail) { max-width: none; overflow-wrap: break-word }
}
