/* Express Cabinet : design system d'Horalio repris à l'identique, palettes comprises (décision de José du
   06/11/2026, docs/DESIGN-SYSTEM.md). Primaire indigo, dégradé indigo sur le bouton principal et l'élément
   actif, coque blanche arrondie sur fond bleu nuit à halos, barre latérale blanche réduite ou dépliée, Inter.
   Écarts propres à EC : bordure de champ #868C98 (3,4:1), texte de succès #047857 (5,0:1), en-têtes de
   tableau en gris secondaire (4,7:1), coque de 1 600 px, « à compléter » en violet d'accent. */

/* Inter (SIL OFL 1.1, assets/fonts/LICENCE-INTER.txt), police variable 100 à 900, auto-hébergée. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-joy4ri1.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: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-ext-9fzmmZy.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; }

:root {
    /* ---- Marque et actions (valeurs d'Horalio, §2.1) ---- */
    --primaire: #3B4CCA;          /* liens, focus, pastilles ; 6,8:1 sur blanc, blanc dessus 6,8:1 */
    --primaire-survol: #2E3BA0;
    --primaire-pale: #EEF0FB;
    --primaire-pale-survol: #E4E7FB;
    --accent: #4F46E5;
    --accent-2: #6366F1;
    --marque: #4F5FE6; --marque-2: #6D7BF5; --marque-3: #8E9BF5;
    --menthe: #34D39A; --menthe-2: #7FE9BE;  /* halo et dégradé seulement, jamais en texte sur blanc */
    --degrade-primaire: linear-gradient(145deg, #4F5FE6, #6D7BF5);
    --degrade-chiffre: linear-gradient(120deg, #6D7BF5, #8E9BF5 45%, #34D39A);
    --ombre-bouton: 0 2px 8px rgba(59, 76, 202, .35);
    --ombre-actif: 0 6px 18px -6px rgba(79, 95, 230, .7);

    /* ---- Neutres (§2.2) ---- */
    --encre: #1F2937;             /* 14,7:1 sur blanc */
    --encre-douce: #6B7280;       /* 4,8:1 */
    --encre-pale: #9CA3AF;        /* icônes au repos, remplissage ; jamais un texte utile */
    --encre-muette: #C4C8D0;      /* décoratif */
    --fond-nuit: #080A16;
    --surface: #FFFFFF;
    --surface-2: #F9FAFB;
    --surface-3: #FAFBFC;
    --surface-4: #F5F6F9;
    --trait: #E5E7EB; --trait-2: #EEF0F4; --trait-3: #F1F2F5; --trait-4: #F4F5F7;
    --trait-champ: #868C98;       /* écart EC : 3,4:1 (WCAG 1.4.11) */
    --infobulle: #1F2937;

    /* ---- États (§2.3) : plein (point, jauge), texte, fond pâle, filet ---- */
    --succes: #10B981; --succes-fonce: #059669; --succes-texte: #047857; --succes-fond: #E7F7F1; --succes-trait: #9FE3CD;
    --attention: #F59E0B; --attention-texte: #B45309; --attention-fond: #FEF3E2; --attention-fond-2: #FFF7ED; --attention-trait: #FBD89D;
    --danger: #EF4444; --danger-texte: #B91C1C; --danger-texte-2: #DC2626; --danger-fond: #FEF2F2; --danger-ligne: #FEF6F6; --danger-trait: #F9B4B4;
    --neutre: #9CA3AF; --neutre-texte: #6B7280; --neutre-fond: #F5F6F9; --neutre-trait: #D7DADF;
    --a-completer: #6366F1; --a-completer-texte: #4F46E5; --a-completer-fond: #EEF0FB; --a-completer-trait: #C7CDF5;
    --ej-marine: #252e7a;         /* couleur d'Express Juridique, badge « part chez EJ », blanc 12:1 */

    /* ---- Graphiques (§6) ---- */
    --graphe-1: #3B4CCA;          /* série principale, « réel » */
    --graphe-2: #1F2937;          /* comparaison, « N-1 » */
    --graphe-3: #8E9BF5;
    --graphe-menthe: #34D39A;     /* remplissage seulement */
    --graphe-4: #9CA3AF;          /* « autres », « prévu », « interne » */
    --graphe-ok: #10B981; --graphe-alerte: #F59E0B; --graphe-depasse: #EF4444;
    --graphe-seq-1: #EEF0FB; --graphe-seq-2: #C7CDF5; --graphe-seq-3: #8E9BF5; --graphe-seq-4: #4F5FE6; --graphe-seq-5: #2E3BA0;

    /* ---- Typographie (§3) ---- */
    --police: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --t-micro: 10.5px; --t-meta: 11.5px; --t-libelle: 12.5px; --t-corps: 13.5px;
    --t-titre-carte: 14px; --t-titre-page: 16px; --t-h1: 22px; --t-chiffre: 30px; --t-accroche: 40px; --t-horloge: 44px;
    /* Échelle générale des feuilles de domaine, calée sur celle d'Horalio. */
    --t-xs: 11.5px; --t-sm: 12.5px; --t-base: 13.5px; --t-md: 15px; --t-lg: 17px; --t-xl: 22px;

    /* ---- Espacements (base 4) ---- */
    --e-1: 4px; --e-2: 8px; --e-3: 12px; --e-4: 16px; --e-5: 24px; --e-6: 32px; --e-7: 48px;
    --e-carte: 20px;

    /* ---- Formes (§4.1, §4.2) ---- */
    --rayon-xs: 4px;
    --rayon-sm: 8px;
    --rayon-champ: 10px;
    --rayon-md: 11px;
    --rayon-carte: 16px;
    --rayon-modale: 18px;
    --rayon-coque: 24px;
    --rayon-pilule: 999px;
    --ombre-carte: 0 1px 2px rgba(16, 18, 24, .04), 0 20px 44px -30px rgba(31, 41, 55, .4);
    --ombre-coque: 0 30px 80px -40px rgba(31, 41, 55, .5);
    --ombre-modale: 0 30px 70px -25px rgba(31, 41, 55, .6);
    --ombre-menu: 0 12px 30px -10px rgba(31, 41, 55, .35);
    --ombre-infobulle: 0 8px 20px -8px rgba(0, 0, 0, .5);
    /* Focus des champs : bordure indigo et contour indigo intérieur (2 px au total). */
    --anneau: inset 0 0 0 1px var(--primaire);
    --anneau-erreur: inset 0 0 0 1px var(--danger);
    --duree: 150ms;
    --courbe: cubic-bezier(.4, 0, .2, 1);

    /* ---- Gabarit (§4.3 à §4.5) ---- */
    --barre: 74px;
    --barre-depliee: 210px;
    --coque-max: 1600px;
    --marge-coque: 40px;
    --entete: 73px;
    --haut-avant-tableau: 150px;  /* lot W3G : hauteur de l'en-tête de liste sous la barre du haut, bornes du conteneur de tableau */
    --gouttiere: 24px;

    /* ---- Alias de la charte Fyre + Veneen (§10), retirés quand plus aucune feuille ne les cite ---- */
    --vert-barre: var(--primaire);
    --vert-barre-clair: var(--marque-2);
    --or: var(--primaire);
    --or-survol: var(--primaire-survol);
    --sur-or: #FFFFFF;
    --or-texte: var(--primaire-survol);
    --or-fond: var(--primaire-pale);
    --vert-texte: var(--primaire);
    --vert-texte-survol: var(--primaire-survol);
    --vert-pale: var(--surface-4);
    --tuile: var(--surface-4);
    --corail: var(--a-completer);
    --info-texte: var(--neutre-texte); --info-fond: var(--neutre-fond); --info-trait: var(--neutre-trait);
    --fond: var(--surface-2);
    --encre-2: var(--encre);
    --trait-leger: var(--trait-2);
    --trait-fort: var(--trait);
    --sombre: var(--infobulle);
    --sur-sombre: #FFFFFF;
    --police-mono: var(--police);
    --rayon: var(--rayon-carte);
    --rayon-grand: var(--rayon-carte);
    --ombre-legere: var(--ombre-carte);
    --ombre-flottante: var(--ombre-menu);
    --pastille-fond: var(--accent);
    --pastille-texte: #FFFFFF;
    --graphe-5: var(--graphe-depasse);
    --graphe-6: var(--graphe-alerte);
    --graphe-autre: var(--graphe-4);
}

/* Barre dépliée : la coque s'élargit de ce que la barre prend en plus, le contenu garde sa largeur. */
html[data-nav='expanded'] {
    --barre: var(--barre-depliee);
    --coque-max: calc(1600px + (210px - 74px));
}

/* Mode sombre d'Horalio (§8) : jetons posés, bascule non exposée avant la bascule de production. */
html[data-theme='dark'] {
    --primaire: #7986FF; --primaire-survol: #A0AAFF; --primaire-pale: #232847; --primaire-pale-survol: #2A3058;
    --accent: #8B85F6; --accent-2: #A5A0F7;
    --succes: #2FD592; --succes-fonce: #10B981; --succes-texte: #2FD592; --succes-fond: #133428; --succes-trait: #1F5A43;
    --attention: #FFB63B; --attention-texte: #FCC57A; --attention-fond: #3B2A10; --attention-fond-2: #3B2A10; --attention-trait: #6B4E1F;
    --danger: #FF6767; --danger-texte: #FFA0A0; --danger-texte-2: #FF8787; --danger-fond: #3B1A1A; --danger-ligne: #2B1414; --danger-trait: #6B2E2E;
    --neutre-texte: #A8ADB8; --neutre-fond: #1D2030; --neutre-trait: #2E3346;
    --a-completer-texte: #A5A0F7; --a-completer-fond: #232847; --a-completer-trait: #3A4170;
    --encre: #F5F6F9; --encre-douce: #A8ADB8; --encre-pale: #737884; --encre-muette: #4B4F58;
    --surface: #171923; --surface-2: #0F1017; --surface-3: #14161F; --surface-4: #1D2030;
    --trait: #262A3A; --trait-2: #22263A; --trait-3: #1D2130; --trait-4: #1A1D2A;
    --ombre-carte: 0 1px 2px rgba(0, 0, 0, .55), 0 20px 44px -30px rgba(0, 0, 0, .9);
    --ombre-coque: 0 30px 80px -40px rgba(0, 0, 0, .9);
    --ombre-modale: 0 30px 70px -25px rgba(0, 0, 0, .9);
    --ombre-menu: 0 12px 30px -10px rgba(0, 0, 0, .7);
    --ombre-bouton: 0 2px 8px rgba(121, 134, 255, .4);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--police);
    font-size: var(--t-corps);
    line-height: 1.55;
    color: var(--encre);
    background: var(--surface-2);
    font-feature-settings: 'cv11', 'ss01';
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body:has(> .coque) { background: var(--fond-nuit); }

h1, h2, h3, h4 { font-family: var(--police); font-weight: 700; margin: 0 0 .5em; line-height: 1.25; color: var(--encre); letter-spacing: -.01em; }
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-lg); }
h3 { font-size: var(--t-md); }
a { color: var(--primaire); text-underline-offset: 2px; transition: color var(--duree) var(--courbe); }
a:hover { color: var(--primaire-survol); }
:focus-visible { outline: 2px solid var(--primaire); outline-offset: 2px; }
abbr[title] { text-decoration: underline dotted; text-decoration-color: var(--trait-champ); cursor: help; }
strong { font-weight: 600; }
input, select, textarea, button { font-family: inherit; }
.tnum { font-variant-numeric: tabular-nums; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Lien d'évitement « Aller au contenu » (RGAA 12.7) : invisible jusqu'au focus clavier. */
.evitement { position: absolute; left: var(--e-3); top: -100px; z-index: 100; padding: 8px 14px; border-radius: var(--rayon-champ); background: var(--encre); color: #fff; font-weight: 500; text-decoration: none; }
.evitement:focus { top: var(--e-3); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

/* ---------- Coque : fond nuit à halos, carte blanche, barre latérale + en-tête (§4.3) ---------- */

.coque {
    min-height: 100vh; min-height: 100dvh;
    padding: var(--marge-coque) 16px;
    background:
        radial-gradient(64% 58% at 13% -3%, rgba(91, 108, 240, .62), transparent 66%),
        radial-gradient(56% 54% at 94% 7%, rgba(52, 211, 154, .42), transparent 64%),
        var(--fond-nuit);
}
/* overflow: clip (et non hidden) : coins arrondis sans créer de conteneur de défilement, l'en-tête et la barre restent collants. */
.coque__carte {
    display: flex; width: 100%; max-width: var(--coque-max); min-height: 760px; margin: 0 auto;
    background: var(--surface); border-radius: var(--rayon-coque); box-shadow: var(--ombre-coque);
    overflow: clip;
    transition: max-width .2s ease;
}

/* ---------- Barre latérale blanche, réduite (74 px) ou dépliée (210 px) (§4.4) ---------- */

.barre { flex: none; width: var(--barre); background: var(--surface); border-right: 1px solid var(--trait-3); transition: width .2s ease; }
.barre__interieur {
    position: sticky; top: 0; z-index: 20;
    /* Pas de défilement propre : il rognerait les infobulles. La barre tient en 760 px. */
    min-height: min(calc(100dvh - var(--marge-coque)), 100%);
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 20px 0;
}
.barre__logo {
    display: grid; place-items: center; flex-shrink: 0;
    width: 40px; height: 40px; margin-bottom: 26px;
    border-radius: var(--rayon-md); background: var(--degrade-primaire); box-shadow: var(--ombre-bouton);
    font: 800 14px/1 var(--police); letter-spacing: -.02em; color: #fff;
    text-decoration: none;
}
.barre__logo:hover { color: #fff; }
.barre__tete { position: relative; display: flex; align-items: center; gap: 10px; margin-bottom: 26px; text-decoration: none; color: var(--encre); border-radius: var(--rayon-md); }
.barre__tete .barre__logo { margin-bottom: 0; }
.barre__tete img { display: block; max-width: 160px; max-height: 64px; object-fit: contain; }
.barre__nom { display: none; min-width: 0; line-height: 1.2; }
.barre__nom strong { display: block; font-size: 14px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.barre__nom span { display: block; font-size: var(--t-meta); color: var(--encre-douce); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre__section { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
/* Groupes séparés par un filet de 28 × 1 px ; en déplié, un titre de section (ajout EC). */
.barre__section + .barre__section::before { content: ''; display: block; flex: none; width: 28px; height: 1px; margin: 6px auto; background: var(--trait-2); }
.barre__titre { display: none; margin: 0; padding: 0 10px; font: 600 var(--t-micro)/1.6 var(--police); letter-spacing: .06em; text-transform: uppercase; color: var(--encre-douce); }
.barre__pied { margin-top: auto; padding-top: var(--e-3); width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; }
/* Complément lu par les lecteurs d'écran seulement, même barre dépliée (« , 4 relances »). */
.barre__complement { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icone {
    position: relative; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 44px; height: 44px; border-radius: var(--rayon-md);
    border: 0; background: none; cursor: pointer;
    color: var(--encre-pale); font: 500 13px/1 var(--police);
    text-decoration: none;
    transition: background-color var(--duree) var(--courbe), color var(--duree) var(--courbe);
}
.icone svg { width: 20px; height: 20px; flex-shrink: 0; }
.icone:hover, .icone:focus-visible { background: var(--surface-4); color: var(--primaire); }
.icone[aria-current='page'], .icone[aria-current='page']:hover { background: var(--degrade-primaire); color: #fff; box-shadow: var(--ombre-actif); }
.icone[aria-disabled='true'] { opacity: .5; cursor: default; }
.icone[aria-disabled='true']:hover { background: none; color: var(--encre-pale); }
.icone--petite { height: 36px; }

/* Infobulle immédiate à droite de l'icône (barre réduite) : sans délai ni transition. */
.icone::after {
    content: attr(data-libelle);
    position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
    padding: 6px 10px; border-radius: var(--rayon-sm);
    background: var(--infobulle); color: #fff; font: 500 12px/1 var(--police); white-space: nowrap;
    box-shadow: var(--ombre-infobulle);
    visibility: hidden; pointer-events: none; z-index: 70;
}
.icone::before {
    content: ''; position: absolute; left: calc(100% + 0px); top: 50%; transform: translateY(-50%);
    border: 4px solid transparent; border-right-color: var(--infobulle);
    visibility: hidden; pointer-events: none; z-index: 70;
}
.icone:hover::after, .icone:focus-visible::after, .icone:hover::before, .icone:focus-visible::before { visibility: visible; }

/* Bascule vers Express Juridique : bouton fantôme 36 px et pastille EJ. */
.icone--ej { height: 36px; }
.icone__ej { display: grid; place-items: center; flex: none; width: 22px; height: 18px; border-radius: 5px; background: var(--ej-marine); color: #fff; font: 700 9.5px/1 var(--police); letter-spacing: .02em; }

/* Bouton « Déployer / Réduire » : double chevron qui pivote de 180°. */
.barre__bascule { margin-bottom: 6px; }
.barre__bascule svg { transition: transform .2s ease; }

/* Pastille de compteur (relances) : violet d'accent plein, texte blanc. */
.icone__pastille { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--rayon-pilule); background: var(--accent); color: #fff; font: 700 10px/20px var(--police); font-variant-numeric: tabular-nums; text-align: center; }

/* Barre dépliée : icône et libellé (préférence mémorisée, barre_controller.js). */
html[data-nav='expanded'] .barre__interieur { align-items: stretch; padding: 20px 12px; }
html[data-nav='expanded'] .barre__tete { padding: 2px; }
html[data-nav='expanded'] .barre__nom { display: block; }
html[data-nav='expanded'] .barre__titre { display: block; }
html[data-nav='expanded'] .barre__section { align-items: stretch; }
html[data-nav='expanded'] .barre__section + .barre__section { margin-top: var(--e-3); }
html[data-nav='expanded'] .barre__section + .barre__section::before { display: none; }
html[data-nav='expanded'] .barre__pied { align-items: stretch; }
html[data-nav='expanded'] .icone { width: 100%; justify-content: flex-start; padding: 0 10px; }
html[data-nav='expanded'] .icone::after, html[data-nav='expanded'] .icone::before { display: none; }
html[data-nav='expanded'] .icone .sr-only { position: static; width: auto; height: auto; overflow: hidden; clip: auto; text-overflow: ellipsis; white-space: nowrap; }
html[data-nav='expanded'] .icone--ej .sr-only { font-size: var(--t-meta); }
html[data-nav='expanded'] .icone .icone__pastille { position: static; margin-left: auto; }
html[data-nav='expanded'] .barre__bascule svg { transform: rotate(180deg); }

.principal { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ---------- En-tête blanc (§4.5) ---------- */

.entete {
    position: sticky; top: 0; z-index: 15;
    min-height: var(--entete);
    display: flex; align-items: center; gap: var(--e-4);
    padding: 18px 28px;
    background: var(--surface); border-bottom: 1px solid var(--trait-3);
}
.entete__titre { display: flex; align-items: center; gap: var(--e-3); min-width: 0; }
.entete__groupe { font: 700 var(--t-titre-page)/1.3 var(--police); letter-spacing: -.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entete__cabinet {
    display: inline-flex; align-items: center; height: 28px; padding: 0 12px; flex-shrink: 1; min-width: 0;
    border-radius: var(--rayon-pilule); background: var(--surface-4);
    color: var(--encre-douce); font: 500 var(--t-meta)/1 var(--police); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.entete__droite { margin-left: auto; display: flex; align-items: center; gap: var(--e-4); }
/* Boutons ronds de l'en-tête : fond indigo pâle, icône indigo, pastille de compteur. */
.entete__rond, .entete__journee {
    position: relative; flex: none;
    display: inline-flex; align-items: center; justify-content: center; gap: var(--e-2);
    height: 36px; min-width: 36px; border-radius: var(--rayon-pilule); border: 0;
    background: var(--primaire-pale); color: var(--primaire);
    font: 600 var(--t-libelle)/1 var(--police); text-decoration: none; cursor: pointer;
    transition: background-color var(--duree) var(--courbe), color var(--duree) var(--courbe);
}
.entete__journee { padding: 0 14px 0 12px; }
.entete__rond svg, .entete__journee svg { width: 17px; height: 17px; }
.entete__rond:hover, .entete__journee:hover { background: var(--primaire-pale-survol); color: var(--primaire-survol); }
.entete__journee[aria-current='page'] { background: var(--primaire); color: #fff; }
.entete__journee .icone__pastille { top: -4px; right: -4px; }
/* Ma journée pas encore consultée aujourd'hui : halo d'accent qui pulse. */
.entete__journee--a-voir { box-shadow: inset 0 0 0 1.5px var(--accent-2); animation: journee-a-voir 1.6s ease-in-out infinite; }
@keyframes journee-a-voir { 0%, 100% { box-shadow: inset 0 0 0 1.5px var(--accent-2), 0 0 0 0 rgba(99, 102, 241, .5); } 50% { box-shadow: inset 0 0 0 1.5px var(--accent-2), 0 0 0 6px rgba(99, 102, 241, 0); } }
@media (prefers-reduced-motion: reduce) { .entete__journee--a-voir { animation: none; } }
/* Déconnexion en un clic : rond transparent, rouge au survol. */
.entete__sortie { background: none; color: var(--encre-pale); }
.entete__sortie:hover { background: var(--danger-fond); color: var(--danger); }

.profil { position: relative; }
.profil summary { list-style: none; cursor: pointer; border-radius: 50%; }
.profil summary::-webkit-details-marker { display: none; }
.profil summary:focus-visible { outline: 2px solid var(--primaire); outline-offset: 2px; }
/* Avatar de l'en-tête : dégradé choisi par empreinte de l'adresse (avatar.ts d'Horalio, AvatarExtension). */
.avatar {
    display: grid; place-items: center; flex: none;
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--primaire-pale); color: var(--primaire-survol);
    font: 700 12px/1 var(--police);
}
.avatar--degrade { color: #fff; font-weight: 600; }
.profil[open] .avatar, .profil summary:hover .avatar { box-shadow: 0 0 0 3px var(--primaire-pale); }
.profil__menu {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 260px;
    background: var(--surface); border: 1px solid var(--trait-2); border-radius: var(--rayon-carte);
    box-shadow: var(--ombre-menu); padding: var(--e-2) 0; z-index: 20;
}
.profil__identite { padding: var(--e-2) var(--e-4) var(--e-3); border-bottom: 1px solid var(--trait-3); }
.profil__identite strong { display: block; font-weight: 600; }
.profil__identite span { color: var(--encre-douce); font-size: var(--t-meta); }
.profil__menu a { display: block; padding: var(--e-2) var(--e-4); color: var(--encre); text-decoration: none; }
.profil__menu a:hover { background: var(--surface-4); color: var(--primaire); }

.contenu { padding: var(--e-5) var(--gouttiere) var(--e-7); max-width: 1360px; width: 100%; }
/* Pages de liste (tête de liste W3G ou tableau sur une ligne, §9.14) : toute la largeur de la coque.
   Fiches et formulaires gardent la largeur de lecture de 1 360 px. */
.contenu:has(> .tete-liste, .tableau--une-ligne) { max-width: none; }
.contenu > h1, .contenu > .titre-actions { margin-bottom: var(--e-4); }

@media (max-width: 767px) {
    /* Sous 768 px : la coque occupe tout l'écran et garde la barre réduite (Horalio la masque). */
    :root { --marge-coque: 0px; --barre: 60px; --gouttiere: 16px; --entete: 61px; }
    html[data-nav='expanded'] { --barre: 60px; }
    .coque { padding: 0; }
    .coque__carte { border-radius: 0; min-height: 100dvh; box-shadow: none; }
    .barre__interieur { height: 100dvh; min-height: 0; padding: 14px 0; overflow-y: auto; scrollbar-width: none; }
    .barre__tete { margin-bottom: 14px; }
    .barre__bascule { display: none; }
    .icone::after, .icone::before { display: none; }
    html[data-nav='expanded'] .barre__interieur { align-items: center; padding: 14px 0; }
    html[data-nav='expanded'] .barre__nom, html[data-nav='expanded'] .barre__titre, html[data-nav='expanded'] .icone .sr-only { display: none; }
    html[data-nav='expanded'] .barre__section, html[data-nav='expanded'] .barre__pied { align-items: center; }
    html[data-nav='expanded'] .barre__section + .barre__section::before { display: block; }
    html[data-nav='expanded'] .icone { width: 44px; justify-content: center; padding: 0; }
    html[data-nav='expanded'] .icone .icone__pastille { position: absolute; }
    .entete { padding: 12px 16px; gap: var(--e-3); }
    .entete__droite { gap: var(--e-2); }
    .entete__cabinet { display: none; }
    .entete__journee { padding: 0; width: 36px; }
    .entete__journee > span:not(.icone__pastille):not(.sr-only) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 639px) {
    .contenu { padding: var(--e-4) var(--gouttiere) var(--e-6); }
}

/* ---------- Éléments (§5) ---------- */

.carte { background: var(--surface); border: 1px solid var(--trait-2); border-radius: var(--rayon-carte); box-shadow: var(--ombre-carte); padding: var(--e-carte); }
.contenu > .carte + .carte { margin-top: var(--e-4); }
.carte > h2:first-child, .carte > .titre-actions:first-child h2 { font-size: var(--t-titre-carte); font-weight: 700; margin-bottom: var(--e-3); }
.grille { display: grid; gap: var(--e-4); grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); align-items: start; }
.vide { color: var(--encre-douce); font-size: var(--t-sm); margin: 0; }
/* Chiffre-clé : 30 px 800 en dégradé indigo → menthe. */
.compteur-cle { font: 800 var(--t-chiffre)/1.1 var(--police); letter-spacing: -.02em; font-variant-numeric: tabular-nums; background: var(--degrade-chiffre); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Badge : pilule, point de la couleur pleine devant le libellé, fond pâle et texte de l'état. */
.etiquette {
    --point: var(--neutre);
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px; border-radius: var(--rayon-pilule); border: 0;
    font: 600 11px/1.3 var(--police); letter-spacing: 0; text-transform: none; white-space: nowrap; vertical-align: middle;
    background: var(--neutre-fond); color: var(--neutre-texte);
}
.etiquette::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--point); }
h1 .etiquette { position: relative; top: -3px; margin-left: 6px; }
/* États génériques (lot T0) : à préférer aux variantes par domaine. `--alerte` reste l'alias historique
   d'attention (pièce manquante, message à envoyer) ; un échec prend `--erreur`. */
.etiquette--succes { --point: var(--succes); background: var(--succes-fond); color: var(--succes-texte); }
.etiquette--attention, .etiquette--alerte { --point: var(--attention); background: var(--attention-fond); color: var(--attention-texte); }
.etiquette--erreur, .etiquette--danger { --point: var(--danger); background: var(--danger-fond); color: var(--danger-texte); }
.etiquette--info, .etiquette--neutre { --point: var(--neutre); background: var(--neutre-fond); color: var(--neutre-texte); }
.etiquette--a-completer { --point: var(--a-completer); background: var(--a-completer-fond); color: var(--a-completer-texte); }

/* Boutons : principal en dégradé indigo (44 px), secondaire blanc à contour, fantôme, danger. */
.bouton {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--e-2);
    min-height: 44px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--rayon-champ);
    font: 600 14px/1.2 var(--police); text-decoration: none; cursor: pointer; white-space: nowrap;
    background: var(--degrade-primaire); color: #fff; box-shadow: var(--ombre-bouton);
    transition: background-color var(--duree) var(--courbe), border-color var(--duree) var(--courbe), color var(--duree) var(--courbe), filter var(--duree) var(--courbe);
}
.bouton:hover { color: #fff; filter: brightness(1.07); }
.bouton:active { filter: brightness(.97); }
.bouton:focus-visible { outline: 2px solid var(--primaire); outline-offset: 2px; }
.bouton--plein { width: 100%; }
.bouton--petit { min-height: 36px; padding: 0 14px; font-size: 13px; }
.bouton--grand { min-height: 46px; padding: 0 24px; font-size: 14.5px; border-radius: var(--rayon-md); }
.bouton--secondaire { background: var(--surface); color: var(--encre); border-color: var(--trait); box-shadow: none; font-weight: 500; }
.bouton--secondaire:hover { background: var(--surface-4); color: var(--encre); filter: none; }
.bouton--secondaire:active { background: var(--surface-4); filter: none; }
.bouton--fantome { background: transparent; color: var(--encre-douce); border-color: transparent; box-shadow: none; font-weight: 500; }
.bouton--fantome:hover { background: var(--surface-4); color: var(--encre); filter: none; }
.bouton--danger { background: var(--danger); color: #fff; box-shadow: none; }
.bouton--danger:hover { background: var(--danger-texte-2); filter: none; }
/* Dans un tableau, les boutons restent compacts. */
.tableau .bouton { min-height: 32px; padding: 0 12px; font-size: var(--t-sm); }

/* Champs : 44 px, fond gris très pâle, bordure #868C98 ; focus fond blanc, bordure et contour indigo. */
.champ { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; }
.champ label { font-weight: 600; font-size: var(--t-libelle); color: var(--encre); }
.champ input {
    height: 44px; padding: 0 14px;
    border: 1px solid var(--trait-champ); border-radius: var(--rayon-champ);
    font: inherit; font-size: 14px; color: var(--encre); background: var(--surface-2);
    transition: border-color var(--duree) var(--courbe), box-shadow var(--duree) var(--courbe), background-color var(--duree) var(--courbe);
}
.champ input::placeholder, .champ textarea::placeholder { color: var(--encre-pale); }
.champ input:hover, .champ select:hover, .champ textarea:hover { border-color: var(--encre-douce); }
.champ input:focus { background: var(--surface); border-color: var(--primaire); outline: none; box-shadow: var(--anneau); }
.champ input:disabled, .champ select:disabled, .champ textarea:disabled { background: var(--surface-4); color: var(--encre-douce); cursor: not-allowed; }
.aide { font-size: var(--t-meta); color: var(--encre-douce); }

/* Messages : fond pâle, liseré gauche de la couleur pleine, texte d'état, icône obligatoire. */
.alerte {
    --couleur-alerte: var(--neutre);
    position: relative; display: block; padding: 10px 14px 10px 40px; border-radius: var(--rayon-champ); margin-bottom: var(--e-4);
    font-size: var(--t-sm); border: 0; box-shadow: inset 3px 0 0 var(--couleur-alerte);
    background: var(--neutre-fond); color: var(--encre);
}
.alerte::before {
    content: ''; position: absolute; left: 14px; top: 11px; width: 16px; height: 16px;
    background: var(--couleur-alerte);
    -webkit-mask: var(--icone-alerte, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E")) center / contain no-repeat;
    mask: var(--icone-alerte, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E")) center / contain no-repeat;
}
.alerte--erreur {
    --couleur-alerte: var(--danger); background: var(--danger-fond); color: var(--danger-texte);
    --icone-alerte: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m15 9-6 6M9 9l6 6'/%3E%3C/svg%3E");
}
.alerte--succes {
    --couleur-alerte: var(--succes); background: var(--succes-fond); color: var(--succes-texte);
    --icone-alerte: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m8 12 3 3 5-6'/%3E%3C/svg%3E");
}
.alerte--avertissement {
    --couleur-alerte: var(--attention); background: var(--attention-fond); color: var(--attention-texte);
    --icone-alerte: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0zM12 9v4M12 17h.01'/%3E%3C/svg%3E");
}

/* ---------- Formulaires ---------- */

.champ select, .champ textarea {
    padding: 8px 12px; border: 1px solid var(--trait-champ); border-radius: var(--rayon-champ);
    font: inherit; font-size: 14px; color: var(--encre); background-color: var(--surface-2);
    transition: border-color var(--duree) var(--courbe), box-shadow var(--duree) var(--courbe), background-color var(--duree) var(--courbe);
}
.champ select { height: 44px; padding-right: 34px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%236B7280' d='m7 10 5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 22px; }
.champ select { width: 100%; max-width: 100%; min-width: 0; text-overflow: ellipsis; }
/* Signataire : liste des fonctions sous la liste déroulante, visible seulement quand elle coupe le texte (mobile). */
.signataires-fonctions { display: none; margin: 0; padding-left: 18px; }
@media (max-width: 639px) { .signataires-fonctions { display: block; } }
.champ select[multiple] { appearance: auto; background-image: none; padding-right: 12px; }
.champ textarea { min-height: 96px; resize: vertical; }
.champ select:focus, .champ textarea:focus { background-color: var(--surface); border-color: var(--primaire); outline: none; box-shadow: var(--anneau); }
.champ fieldset { border: 0; margin: 0; padding: 0; }
.champ legend { font-weight: 600; font-size: var(--t-libelle); margin-bottom: 6px; padding: 0; }
.champ--case label { display: flex; align-items: center; gap: var(--e-2); font-weight: 400; font-size: var(--t-base); }
.champ--case input, .choix__option input { width: 18px; height: 18px; accent-color: var(--primaire); }
.champ--erreur input, .champ--erreur select, .champ--erreur textarea { border-color: var(--danger); }
.champ--erreur input:focus, .champ--erreur select:focus, .champ--erreur textarea:focus { box-shadow: var(--anneau-erreur); }
.choix { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.choix__option { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-base); }
.erreurs { list-style: none; margin: 0; padding: 0; color: var(--danger-texte); font-size: var(--t-xs); font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-3) var(--e-4); margin-top: var(--e-2); }
.titre-actions > .actions { margin-top: 0; }
.pile .actions .bouton { white-space: nowrap; }
/* Lien d'action discret (exporter, ajouter, réinitialiser) : indigo, souligné au survol. */
.lien-secondaire { color: var(--primaire); font-size: var(--t-libelle); font-weight: 500; text-decoration: none; }
.lien-secondaire:hover { color: var(--primaire-survol); text-decoration: underline; }

/* ---------- Listes et pages de paramétrage ---------- */

.fil { font-size: var(--t-sm); color: var(--encre-douce); margin-bottom: var(--e-1); }
.fil a { color: var(--encre-douce); text-decoration: none; }
.fil a:hover { color: var(--primaire); text-decoration: underline; }
.titre-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--e-3) var(--e-4); flex-wrap: wrap; }
.titre-actions > h1, .titre-actions > h2 { margin-bottom: 0; }
/* Fiche : titre sur sa ligne, boutons alignés dessous (barre d'outils). */
.titre-actions > h1:has(~ .bouton) { flex-basis: 100%; }
.titre-actions:has(> h1 ~ .bouton) { justify-content: flex-start; gap: var(--e-2); }
.titre-actions:has(> h1 ~ .bouton) > .bouton:not(.bouton--secondaire) { margin-left: auto; }
.carte--lien { display: block; color: inherit; text-decoration: none; transition: border-color var(--duree) var(--courbe); }
.carte--lien:hover, .carte--lien:focus-visible { border-color: var(--primaire); color: inherit; }
.carte h2 { font-size: var(--t-titre-carte); margin: 0 0 var(--e-2); }
.mise-en-page { display: grid; gap: var(--e-4); grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
/* Tableaux : en-tête gris très pâle, libellés en capitales 10,5 px gris secondaire (écart EC, 4,7:1). */
.tableau-conteneur { position: relative; overflow-x: auto; overflow-y: auto; max-height: calc(100dvh - var(--entete) - var(--haut-avant-tableau) - var(--e-4)); background: var(--surface); border: 1px solid var(--trait-2); border-radius: var(--rayon-carte); box-shadow: var(--ombre-carte); margin-top: var(--e-2); padding: 0; }
.tableau { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--t-corps); }
.tableau th { text-align: left; font: 600 var(--t-micro)/1.4 var(--police); letter-spacing: .06em; text-transform: uppercase; color: var(--encre-douce); padding: 12px 16px; background: var(--surface-3); border-bottom: 1px solid var(--trait-3); vertical-align: bottom; }
.tableau tbody th { background: none; color: var(--encre); font: 500 var(--t-corps) var(--police); letter-spacing: 0; text-transform: none; border-bottom: 1px solid var(--trait-4); vertical-align: middle; }
.tableau td { padding: 12px 16px; border-bottom: 1px solid var(--trait-4); vertical-align: middle; }
.tableau th.nombre, .tableau th.tableau__th--droite { text-align: right; }
.tableau tbody tr:last-child td, .tableau tbody tr:last-child th { border-bottom: 0; }
.tableau tfoot th, .tableau tfoot td { background: var(--surface-3); color: var(--encre); font: 600 var(--t-corps) var(--police); letter-spacing: 0; text-transform: none; border-top: 1px solid var(--trait-3); border-bottom: 0; vertical-align: middle; }
.tableau tbody tr { transition: background-color var(--duree) var(--courbe); }
.tableau tbody tr:hover td, .tableau tbody tr:hover th { background: var(--surface-4); }
.tableau td .aide { display: inline-block; margin-top: 1px; }
.tableau__action { text-align: right; white-space: nowrap; }
.tableau__action a { color: var(--primaire); font-weight: 500; text-decoration: none; }
.tableau__action a:hover { text-decoration: underline; }
/* Lot W3F : en-têtes toujours visibles. Le conteneur défile aussi verticalement (hauteur max sous la barre du haut) et
   les cellules d'en-tête collent en haut ; `top` des lignes suivantes est posé par redimensionnement_colonnes.js
   (cumul des hauteurs des lignes précédentes, exposé aussi en --entete-ligne-1 sur la table). Le coin figé passe au-dessus. */
.tableau-conteneur > .tableau > thead > tr > :is(th, td) { position: sticky; top: 0; z-index: 2; background: var(--surface-3); }
.tableau-conteneur > .tableau--colonne-figee > thead > tr > :is(th, td):first-child,
.tableau-conteneur > .tableau--colonne-figee-2 > thead > tr > :is(th, td):nth-child(-n + 2):not([colspan]) { z-index: 4; }

/* Colonnes figées au défilement horizontal (lot T0), dans un .tableau-conteneur. DESIGN-SYSTEM.md §9.7.
   `.tableau--colonne-figee` fige la première ; `.tableau--colonne-figee-2` les deux premières, la première
   ayant alors une largeur fixe --colonne-figee-1 (160 px par défaut, bordure et padding compris, le contenu
   passe à la ligne) pour que la deuxième se cale exactement après.
   Lignes visées : corps, pied et première ligne d'en-tête seulement (la colonne figée de l'en-tête porte
   un rowspan égal au nombre de lignes d'en-tête) ; une 2e cellule d'en-tête à colspan (groupe) reste libre.
   Pas de rowspan dans le corps. Spécificité basse (:where) : le survol de ligne reste prioritaire. */
.tableau--colonne-figee :where(tbody > tr, tfoot > tr, thead > tr:first-child) > :is(th, td):first-child,
.tableau--colonne-figee-2 :where(tbody > tr, tfoot > tr, thead > tr:first-child) > :is(th, td):first-child,
.tableau--colonne-figee-2 :where(tbody > tr, tfoot > tr, thead > tr:first-child) > :is(th, td):nth-child(2):not([colspan]) { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: inset -1px 0 0 var(--trait-3); }
.tableau--colonne-figee-2 :where(tbody > tr, tfoot > tr, thead > tr:first-child) > :is(th, td):first-child { box-sizing: border-box; width: var(--colonne-figee-1, 160px); min-width: var(--colonne-figee-1, 160px); max-width: var(--colonne-figee-1, 160px); white-space: normal; overflow-wrap: anywhere; box-shadow: none; }
.tableau--colonne-figee-2 :where(tbody > tr, tfoot > tr, thead > tr:first-child) > :is(th, td):nth-child(2):not([colspan]) { left: var(--colonne-figee-1, 160px); }
.tableau--colonne-figee thead > tr:first-child > :is(th, td):first-child,
.tableau--colonne-figee-2 thead > tr:first-child > :is(th, td):first-child,
.tableau--colonne-figee-2 thead > tr:first-child > :is(th, td):nth-child(2):not([colspan]) { z-index: 2; background: var(--surface-3); }
.tableau--colonne-figee tfoot > tr > :is(th, td):first-child,
.tableau--colonne-figee-2 tfoot > tr > :is(th, td):nth-child(-n + 2) { background: var(--surface-3); }
.historique h2 { font-size: var(--t-titre-carte); margin: 0 0 var(--e-3); }
.historique__liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--e-3); }
.historique__entete { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: var(--t-sm); }
.historique__entete span { color: var(--encre-douce); }
.historique__champs { margin: 4px 0 0; padding-left: var(--e-4); font-size: var(--t-xs); color: var(--encre-douce); word-break: break-word; }

/* IA Express (bientôt) : bandeau discret, ne doit pas voler la première place de l'écran. */
.ies {
    display: flex; gap: var(--e-3); align-items: center;
    margin-bottom: var(--e-5); padding: 10px 14px;
    background: transparent; border: 1px dashed var(--trait-champ); border-radius: var(--rayon-champ);
    color: var(--encre-douce); font-size: var(--t-sm);
}

/* ---------- Connexion et pages d'authentification « Cosmos » (§5.1) ---------- */

/* Jeu de jetons sombres propre aux pages d'authentification, indépendant du mode sombre : le formulaire
   commun (champs, libellés, bouton) s'affiche sur le fond nuit. */
.auth--cosmos {
    --surface: #0B0D1A; --surface-2: #141830; --surface-3: #171B33; --surface-4: #1C2140;
    --encre: #F4F5FC; --encre-douce: #AEB4C2; --encre-pale: #767A90;
    --trait: rgba(255, 255, 255, .14); --trait-2: rgba(255, 255, 255, .1); --trait-champ: rgba(255, 255, 255, .28);
    --primaire: #6D7BF5; --primaire-survol: #8E9BF5; --danger: #FF6767;
    --danger-fond: rgba(255, 103, 103, .12); --danger-texte: #FFA0A0;
    --succes-fond: rgba(52, 211, 154, .12); --succes-texte: #7FE9BE; --succes: #34D39A;
    --attention-fond: rgba(245, 158, 11, .14); --attention-texte: #FCC57A;
    --neutre-fond: rgba(255, 255, 255, .06);
    --anneau: inset 0 0 0 1px var(--primaire);
    color-scheme: dark;
}
.auth {
    min-height: 100vh; min-height: 100dvh; display: flex;
    background:
        radial-gradient(64% 58% at 13% -3%, rgba(91, 108, 240, .62), transparent 66%),
        radial-gradient(56% 54% at 94% 7%, rgba(52, 211, 154, .42), transparent 64%),
        var(--fond-nuit);
    color: var(--encre);
}
.auth--cosmos { background: #0B0D1A; }
/* Panneau gauche : visuel de marque, masqué sous 1 024 px. */
.auth__visuel {
    position: relative; overflow: hidden; flex: none; width: 52%;
    display: flex; flex-direction: column; justify-content: space-between; padding: 48px;
    background: linear-gradient(160deg, #080A16 0%, #0D1330 58%, #0B241C 125%); color: #fff;
}
.auth__halos { position: absolute; inset: 0; pointer-events: none; }
.auth__halos span { position: absolute; border-radius: 50%; }
.auth__halos span:nth-child(1) { top: -64px; left: -40px; width: 288px; height: 288px; filter: blur(40px); background: radial-gradient(circle, rgba(91, 108, 240, .55), transparent 70%); }
.auth__halos span:nth-child(2) { top: 33%; right: -80px; width: 320px; height: 320px; filter: blur(64px); background: radial-gradient(circle, rgba(52, 211, 154, .38), transparent 70%); }
.auth__halos span:nth-child(3) { bottom: 0; left: 25%; width: 256px; height: 256px; filter: blur(40px); background: radial-gradient(circle, rgba(109, 123, 245, .42), transparent 70%); }
.auth__visuel > :not(.auth__halos) { position: relative; }
.auth__logo { display: flex; align-items: center; gap: 14px; }
.auth__logo img { display: block; height: 72px; width: auto; max-width: 280px; object-fit: contain; }
.auth__monogramme { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 20px; background: var(--degrade-primaire); box-shadow: 0 10px 30px -10px rgba(79, 95, 230, .8); font: 800 26px/1 var(--police); letter-spacing: -.02em; color: #fff; }
.auth__logo-nom { font: 700 18px/1.2 var(--police); letter-spacing: -.01em; }
.auth__logo-nom span { display: block; font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .6); }
.auth__accroche { margin: 0; font: 800 var(--t-accroche)/1.08 var(--police); letter-spacing: -.02em; color: #fff; }
.auth__accroche span { background: var(--degrade-chiffre); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth__sous-titre { margin: 12px 0 0; font-size: 15px; line-height: 1.6; color: rgba(255, 255, 255, .8); }
/* Horloge en direct : rien au rendu serveur (le contrôleur la remplit), hauteur réservée pour éviter un saut. */
.auth__horloge { min-height: 71px; }
.auth__heure { font: 800 var(--t-horloge)/1 var(--police); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: #fff; }
.auth__date { margin-top: 8px; font-size: 15px; font-weight: 500; color: rgba(255, 255, 255, .55); }
.auth__date::first-letter { text-transform: uppercase; }
/* Panneau droit : formulaire centré, 380 px au plus. */
.auth__panneau { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 40px 24px 72px; }
.auth__colonne { width: 100%; max-width: 380px; min-width: 0; }
.auth--cosmos .auth__carte { width: 100%; padding: 0; background: none; border: 0; box-shadow: none; }
.auth__titre { margin: 0; font-size: var(--t-h1); font-weight: 700; letter-spacing: -.01em; color: var(--encre); }
.auth__intro { margin: 6px 0 28px; font-size: var(--t-corps); color: var(--encre-douce); }
.auth__formulaire .champ input { font-size: 14px; }
.auth__ligne-libelle { display: flex; align-items: baseline; justify-content: space-between; gap: var(--e-3); }
.auth__lien-champ { font-size: var(--t-libelle); font-weight: 500; text-decoration: none; }
.auth__lien-champ:hover { text-decoration: underline; }
.auth__formulaire .bouton--plein { min-height: 46px; margin-top: 8px; font-size: 14.5px; border-radius: var(--rayon-md); }
.auth__lien { display: block; margin-top: var(--e-5); text-align: center; font-size: var(--t-sm); }
.auth__carte .alerte { margin-bottom: var(--e-4); }
.auth__bouton { width: 100%; justify-content: center; margin-top: var(--e-2); }
/* Crédit éditeur, en bas à droite. */
.auth__credit { position: absolute; right: 24px; bottom: 24px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; transition: opacity var(--duree) var(--courbe); }
.auth__credit:hover { opacity: .65; }
.auth__credit-tuile { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; background: var(--primaire); color: #fff; }
.auth__credit-tuile svg { width: 11px; height: 11px; fill: currentColor; }
.auth__credit strong { font-size: 12px; font-weight: 700; letter-spacing: -.01em; color: var(--primaire); }
.auth__credit span:last-child { font-size: 11px; color: var(--encre-pale); }
/* Autres pages d'authentification : le panneau droit seul, centré sur le fond nuit à halos. */
.auth--seul .auth__panneau {
    background:
        radial-gradient(64% 58% at 13% -3%, rgba(91, 108, 240, .62), transparent 66%),
        radial-gradient(56% 54% at 94% 7%, rgba(52, 211, 154, .42), transparent 64%),
        var(--fond-nuit);
}
.auth--seul .auth__colonne { max-width: 440px; }
.auth--cosmos.auth--seul .auth__carte { padding: 32px 40px; background: #0B0D1A; border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--rayon-coque); box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .9); }
.auth--seul .auth__marque { display: flex; align-items: center; gap: var(--e-3); margin-bottom: var(--e-5); }
.auth__marque .barre__logo { margin: 0; }
.auth__marque strong { display: block; font-weight: 700; font-size: 15px; }
.auth__marque span { color: var(--encre-douce); font-size: var(--t-sm); }
@media (max-width: 1023px) {
    .auth__visuel { display: none; }
}
@media (max-width: 480px) {
    .auth--cosmos.auth--seul .auth__carte { padding: 24px 20px; }
    .auth__panneau { padding: 32px 16px 72px; }
}

/* Champ piège des formulaires publics (liens client) : hors écran, ignoré des lecteurs d'écran. */
.champ-piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 720px) {
    h1 { font-size: 20px; }
    .carte { padding: var(--e-4); }
    .mise-en-page { grid-template-columns: minmax(0, 1fr); }
    .titre-actions:has(> h1 ~ .bouton) > .bouton:not(.bouton--secondaire) { margin-left: 0; }
}

/* ---------- Dossiers ---------- */

/* Compteur : pilule indigo, texte blanc 10 px 700, chiffres tabulaires. */
.compteur { display: inline-block; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--rayon-pilule); background: var(--primaire); font: 700 10px/20px var(--police); font-variant-numeric: tabular-nums; color: #fff; text-align: center; margin-left: 6px; vertical-align: middle; }
h1 .compteur { font-size: 11px; height: 22px; line-height: 22px; min-width: 22px; }
.code { font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
a.code { text-decoration: none; color: var(--primaire); }
a.code:hover { text-decoration: underline; }
h1 .code { color: var(--primaire); }
/* Filtres : carte à champs compacts et libellé flottant. */
.filtres { display: flex; flex-wrap: wrap; gap: 0 var(--e-2); align-items: flex-end; margin-top: 0; padding: var(--e-3) 0 0; }
/* Lot W3G : une ligne compacte sans carte autour ; le libellé flottant prend le fond de la page. */
.filtres.carte { background: none; border: 0; border-radius: 0; box-shadow: none; }
.filtres .champ { position: relative; margin-bottom: var(--e-2); gap: 0; flex: 1 1 120px; min-width: 0; }
.filtres .champ:not(.champ--case) > label {
    position: absolute; top: -8px; left: 9px; z-index: 1; padding: 0 4px;
    background: var(--surface); font-size: 11px; font-weight: 500; line-height: 16px; color: var(--encre-douce);
}
.filtres .champ:focus-within > label { color: var(--primaire); }
.filtres input, .filtres select { width: 100%; }
.filtres .champ input, .filtres .champ select { height: 36px; font-size: var(--t-corps); }
.filtres .champ--case input { width: 16px; }
/* Lot W3F : champs sur une ligne qui se replie, bouton « Filtrer » à droite sur la dernière ligne de champs. */
.filtres .filtres__recherche { flex: 2 1 200px; }
.filtres .echeances-bascules, .filtres > fieldset { flex: 1 1 200px; }
.filtres__actions { display: flex; align-items: center; gap: var(--e-3); margin: 0 0 var(--e-2) auto; flex: 0 0 auto; }
.filtres__actions .bouton { height: 36px; min-height: 36px; padding-top: 0; padding-bottom: 0; font-size: 13px; }
/* Onglets de vues : contrôle segmenté blanc, onglet actif indigo pâle. */
nav.actions:has(> [aria-current='page']) { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 3px; margin: 0 0 var(--e-4); border: 1px solid var(--trait); border-radius: var(--rayon-champ); background: var(--surface); font-size: var(--t-sm); }
nav.actions:has(> [aria-current='page']) > a:not(.lien-secondaire), nav.actions:has(> [aria-current='page']) > [aria-current='page'] { padding: 6px 12px; border: 0; border-radius: var(--rayon-sm); color: var(--encre-douce); font-weight: 500; text-decoration: none; transition: background-color var(--duree) var(--courbe), color var(--duree) var(--courbe); }
nav.actions:has(> [aria-current='page']) > a:not(.lien-secondaire):hover { background: var(--surface-4); color: var(--encre); }
nav.actions:has(> [aria-current='page']) > [aria-current='page'], nav.actions:has(> [aria-current='page']) > [aria-current='page']:hover { background: var(--primaire-pale); color: var(--primaire-survol); font-weight: 600; }
nav.actions:has(> [aria-current='page']) > .lien-secondaire { padding: 0 10px 0 14px; margin-left: 4px; border-left: 1px solid var(--trait); }
.etiquette--actif { --point: var(--succes); background: var(--succes-fond); color: var(--succes-texte); }
.etiquette--en_sommeil, .etiquette--sortant, .etiquette--invite { --point: var(--attention); background: var(--attention-fond); color: var(--attention-texte); }
.etiquette--en_liquidation, .etiquette--liquide, .etiquette--vendu, .etiquette--perdu, .etiquette--sorti { --point: var(--neutre); background: var(--neutre-fond); color: var(--neutre-texte); }
.invitation p { margin: 0 0 var(--e-2); }
.invitation__lien { display: flex; gap: var(--e-2); flex-wrap: wrap; }
.invitation__lien input { flex: 1 1 280px; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--trait-champ); border-radius: var(--rayon-champ); font: inherit; font-size: var(--t-xs); background: var(--surface); color: var(--encre); }
.pile { display: flex; flex-direction: column; gap: var(--e-4); min-width: 0; }
.carte h3 { font: 600 var(--t-micro)/1.4 var(--police); letter-spacing: .06em; text-transform: uppercase; color: var(--encre-douce); margin: var(--e-5) 0 var(--e-3); }
/* Propriétés en tuiles gris pâle : libellé, valeur. */
.proprietes { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--e-2); margin: 0; }
.proprietes > div { padding: 10px 12px; border-radius: var(--rayon-champ); background: var(--surface-4); min-width: 0; }
.proprietes dt { font: 600 var(--t-micro)/1.6 var(--police); letter-spacing: .06em; text-transform: uppercase; color: var(--encre-douce); margin-bottom: 2px; }
.proprietes dd { margin: 0; overflow-wrap: anywhere; font-weight: 500; }
.proprietes--equipe { grid-template-columns: minmax(0, 1fr); }
.texte-libre { white-space: pre-line; margin: 0; }
.contacts, .affectations { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--e-3); }
.affectations li { font-size: var(--t-sm); padding: 2px 0 2px var(--e-3); border-left: 2px solid var(--trait); }
.affectations .affectations--en-cours { border-left-color: var(--primaire); }
.en-ligne { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: 6px; max-width: 100%; }
/* Liste compacte dans une ligne (variante, signataire du lot P1-6e) : même allure que les champs,
   quel que soit le conteneur (fiche devis, compte rendu F9, parcours de reprise). */
.en-ligne select, select.liste-compacte { height: 30px; max-width: 100%; min-width: 0; padding: 0 30px 0 8px; border: 1px solid var(--trait-champ); border-radius: var(--rayon-champ); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%236B7280' d='m7 10 5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 6px center / 20px; appearance: none; font: inherit; font-size: var(--t-xs); color: var(--encre); text-overflow: ellipsis; }
.en-ligne select:focus, select.liste-compacte:focus { border-color: var(--primaire); outline: none; box-shadow: var(--anneau); }
.en-ligne input[type='date'], .en-ligne input[type='month'] { height: 30px; padding: 0 6px; border: 1px solid var(--trait-champ); border-radius: var(--rayon-champ); font: inherit; font-size: var(--t-xs); }
.lien-bouton { border: 0; background: none; padding: 0; font: inherit; font-size: var(--t-sm); font-weight: 500; color: var(--primaire); text-decoration: none; cursor: pointer; }
.lien-bouton:hover { color: var(--primaire-survol); text-decoration: underline; }
.formulaire-compact .champ { margin-bottom: var(--e-3); }
.formulaire-etroit { max-width: 560px; }
.groupe-champs { border: 0; margin: 0; }
.groupe-champs > legend { float: left; width: 100%; font-weight: 700; font-size: var(--t-titre-carte); margin-bottom: var(--e-3); padding: 0; }
.groupe-champs > .champ { clear: both; }
.grille-champs { clear: both; display: grid; gap: 0 20px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grille-champs > div:not(.champ) { display: contents; }
@media (max-width: 720px) {
    .filtres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filtres .filtres__recherche { flex: 1 1 100%; }
}
.tableau-conteneur--plat { border: 1px solid var(--trait); margin-top: var(--e-2); }
.tableau__ligne--passee td { color: var(--encre-douce); }
.nombre { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.total { margin: 0 0 var(--e-2); font-size: var(--t-sm); color: var(--encre-douce); }
.total strong { color: var(--encre); font-variant-numeric: tabular-nums; }
.siren { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-3); margin: -4px 0 var(--e-4); }
.siren [data-siren-target='message'] { font-size: var(--t-sm); color: var(--encre-douce); }
.siren [data-siren-target='message'].erreur { color: var(--danger-texte); }

/* ---------- Fiche à compléter (violet d'accent, §2.3) ---------- */

.carte--a-completer { box-shadow: inset 3px 0 0 var(--a-completer), var(--ombre-carte); }
.alerte--a-completer { --couleur-alerte: var(--a-completer); background: var(--a-completer-fond); color: var(--encre); }
.alerte--a-completer a { color: var(--a-completer-texte); font-weight: 600; }
.alerte--a-completer ul { margin: 4px 0 0; padding-left: 18px; }
.a-completer { margin: var(--e-3) 0 0; padding: 6px 10px; border-radius: var(--rayon-champ); background: var(--a-completer-fond); font-size: var(--t-sm); }
.a-completer strong { color: var(--a-completer-texte); }
.champ--a-completer input, .champ--a-completer select, .champ--a-completer textarea { border-color: var(--a-completer-texte); background-color: var(--a-completer-fond); }
.champ--a-completer > label::after { content: ' · à compléter'; font-weight: 400; font-size: 11px; color: var(--a-completer-texte); }
.code-dossier__message { min-height: 18px; }
.code-dossier__message.erreur { color: var(--danger-texte); }

/* ---------- Liste filtrable (banques) ---------- */

.filtre-options__recherche { width: 100%; max-width: 360px; height: 36px; padding: 0 12px; border: 1px solid var(--trait-champ); border-radius: var(--rayon-champ); font: inherit; color: var(--encre); }
.champ select[multiple] { height: auto; min-height: 160px; }
.choix--defilant { flex-direction: column; flex-wrap: nowrap; max-height: 220px; overflow-y: auto; padding: var(--e-2) var(--e-3); border: 1px solid var(--trait-champ); border-radius: var(--rayon-champ); }
.filtre-options__choisies { display: flex; flex-wrap: wrap; gap: 6px; }
.filtre-options__choisies:empty { display: none; }
.etiquette-choix { padding: 2px 10px; border: 1px solid var(--trait); border-radius: var(--rayon-pilule); background: var(--surface-4); font: inherit; font-size: var(--t-sm); color: var(--encre); cursor: pointer; }
.etiquette-choix:hover, .etiquette-choix:focus-visible { border-color: var(--primaire); }

/* ---------- Révision des tarifs ---------- */

.etiquette-champ { font-weight: 600; font-size: var(--t-sm); }
.apercu-revision { margin-top: var(--e-4); }

/* ---------- Saisie des temps (grille hebdomadaire) ---------- */

.grille-temps th, .grille-temps td { vertical-align: middle; }
.grille-temps tbody th { font-weight: 400; min-width: 180px; }
.grille-temps__jour { text-align: center; font-size: var(--t-xs); white-space: nowrap; }
.grille-temps__jour--repos { color: var(--encre-douce); }
.grille-temps__jour--aujourdhui { color: var(--primaire); font-weight: 600; }
.grille-temps__case { padding: 4px; }
.grille-temps__case input { width: 64px; height: 32px; padding: 0 6px; border: 1px solid var(--trait-champ); border-radius: var(--rayon-champ); font: inherit; font-size: var(--t-sm); text-align: center; font-variant-numeric: tabular-nums; }
.grille-temps__case input:focus { border-color: var(--primaire); outline: none; box-shadow: var(--anneau); }
.grille-temps__case input[readonly] { background: var(--surface-4); color: var(--encre-douce); cursor: help; }
.grille-temps__tete { display: flex; align-items: center; justify-content: space-between; gap: var(--e-3); }
.grille-temps__tete > .aide { margin: 0; }
.grille-temps__ajout { display: flex; align-items: center; gap: var(--e-2); margin: 0; flex-shrink: 0; }
.grille-temps__ajout[hidden] { display: none; }
.bouton--icone { width: 32px; min-height: 32px; padding: 0; justify-content: center; font-size: var(--t-base); line-height: 1; }
.grille-temps__nouvelle select { max-width: 220px; height: 32px; border: 1px solid var(--trait-champ); border-radius: var(--rayon-champ); font: inherit; font-size: var(--t-sm); background: var(--surface); }
.grille-temps tfoot th, .grille-temps tfoot td { border-top: 2px solid var(--trait); }
.grille-temps__confirmation { margin: var(--e-3) 0 0; background: var(--attention-fond); color: var(--attention-texte); border-color: var(--attention-trait); }
.grille-temps__retrait { width: 1%; padding: 4px; text-align: center; }
.bouton-retrait { width: 28px; height: 28px; border: 1px solid transparent; border-radius: var(--rayon-champ); background: none; color: var(--encre-douce); font: inherit; cursor: pointer; }
.bouton-retrait:hover, .bouton-retrait:focus-visible { border-color: var(--danger-trait); color: var(--danger-texte); outline: none; box-shadow: var(--anneau); }
.bouton-retrait[aria-pressed="true"] { background: var(--danger-fond); color: var(--danger-texte); border-color: var(--danger-trait); }
.grille-temps__a-supprimer th, .grille-temps__a-supprimer td:not(.grille-temps__retrait) { text-decoration: line-through; color: var(--encre-douce); background: var(--danger-fond); }
.alerte ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Assistances et débours ---------- */

.liste-simple { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--e-2); font-size: var(--t-sm); }
.en-retard { color: var(--danger-texte); font-weight: 500; }
/* « En cours », « à facturer » et « à refacturer » en gris (neutre, 06/11) ; « en attente de retour » en ambre. */
.etiquette--assistance-en_cours, .etiquette--assistance-a_faire, .etiquette--assistance-a_facturer, .etiquette--debours-a_refacturer, .etiquette--debours-a_payer { --point: var(--neutre); background: var(--neutre-fond); color: var(--neutre-texte); }
.etiquette--assistance-en_attente_retour { --point: var(--attention); background: var(--attention-fond); color: var(--attention-texte); }
.etiquette--assistance-facturee, .etiquette--debours-refacture, .etiquette--debours-comptabilise, .etiquette--debours-paye { --point: var(--succes); background: var(--succes-fond); color: var(--succes-texte); }

/* ---------- Budgets ---------- */

.etiquette--budget-gain, .etiquette--budget-dans_le_budget { --point: var(--succes); background: var(--succes-fond); color: var(--succes-texte); }
.etiquette--budget-depassement_leger { --point: var(--attention); background: var(--attention-fond); color: var(--attention-texte); }
.etiquette--budget-depassement_critique { --point: var(--danger); background: var(--danger-fond); color: var(--danger-texte); }

/* ---------- Ma journée ---------- */

.notifications { margin-bottom: var(--e-4); }
/* Cartes de « Ma journée » en indicateurs : titre gris, grand chiffre gras (maquette « overview »). */
.grille > .carte > h2:first-child { display: flex; flex-wrap: wrap; align-items: baseline; font: 600 var(--t-micro)/1.4 var(--police); letter-spacing: .06em; text-transform: uppercase; color: var(--encre-douce); margin-bottom: var(--e-4); }
/* Chiffre-clé de « Ma journée » en dégradé (§5). */
.grille > .carte > h2:first-child > .compteur { order: 2; flex-basis: 100%; height: auto; margin: 6px 0 0; padding: 0; min-width: 0; text-align: left; font: 800 var(--t-chiffre)/1.1 var(--police); letter-spacing: -.02em; background: var(--degrade-chiffre); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* Listes de « Ma journée » : une ligne par élément, échéance alignée à droite. */
.grille .liste-simple, .notifications .liste-simple { gap: 0; }
.grille .liste-simple > li, .notifications .liste-simple > li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--e-2); padding: var(--e-2) 0; border-top: 1px solid var(--trait-3); }
.grille .liste-simple > li:first-child, .notifications .liste-simple > li:first-child { border-top: 0; padding-top: 0; }
.grille .liste-simple > li > a { flex: 1 1 60%; min-width: 0; color: var(--encre); text-decoration: none; }
.grille .liste-simple > li > a:hover { color: var(--primaire); text-decoration: underline; }
.grille .liste-simple > li > a .code, .notifications .liste-simple > li > a .code { color: var(--primaire); margin-right: 2px; }
.grille .liste-simple > li > .aide { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
.notifications .liste-simple > li > a { flex: 1 1 auto; min-width: 0; color: var(--encre); text-decoration: none; }
.notifications .liste-simple > li > a:hover { color: var(--primaire); text-decoration: underline; }
.notifications .liste-simple > li > .en-ligne { margin-left: auto; }
.temps-semaine { list-style: none; margin: 0 0 var(--e-3); padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--e-1); text-align: center; font-size: var(--t-xs); }
.temps-semaine li { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-radius: var(--rayon-champ); background: var(--surface-4); color: var(--encre-douce); }
.temps-semaine li strong { color: var(--encre); font-variant-numeric: tabular-nums; }
.temps-semaine__aujourdhui { outline: 1.5px solid var(--primaire); outline-offset: -1px; background: var(--primaire-pale) !important; }

/* ---------- Affichage conditionnel et pipeline des prospects ---------- */

[hidden] { display: none !important; }
.criteres-manquants { margin: var(--e-2) 0 0; padding-left: 18px; font-size: var(--t-sm); color: var(--encre-douce); }
.carte-prospect { margin: var(--e-2) 0; padding: 10px; border: 1px solid var(--trait); border-radius: var(--rayon-champ); background: var(--surface); transition: border-color var(--duree) var(--courbe); }
.carte-prospect:hover { border-color: var(--primaire); }
.carte-prospect > a { color: var(--encre); text-decoration: none; }
.carte-prospect > a:hover { color: var(--primaire); text-decoration: underline; }
.carte-prospect > a strong { font-weight: 500; }
.carte-prospect--nouveau { outline: 2px solid var(--primaire); outline-offset: -1px; }
.carte-prospect__etape { display: flex; gap: 4px; margin-top: 6px; }
.carte-prospect__etape select { flex: 1; min-width: 0; height: 28px; padding: 0 6px; border: 1px solid var(--trait-champ); border-radius: var(--rayon-champ); background: var(--surface); color: var(--encre); font-size: var(--t-xs); }
.carte-prospect__etape button { min-height: 28px; height: 28px; padding: 0 8px; font-size: var(--t-xs); }

/* Pipeline en colonnes, glisser-déposer (lot UX1, assets/controllers/kanban_controller.js) */
.colonnes-pipeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px;
    scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--trait) transparent; }
/* Plus de colonnes que de place : la suite est signalée par un fondu à droite (retiré en butée par kanban_controller). */
.colonnes-pipeline--deborde { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
.colonne-pipeline { scroll-snap-align: start; }
.colonne-pipeline__titre { overflow-wrap: anywhere; line-height: 1.3; }
.colonne-pipeline { padding: 12px; display: flex; flex-direction: column; transition: background-color .1s, box-shadow .1s; }
.colonne-pipeline__titre { font-size: 14px; }
.colonne-pipeline__cartes { flex: 1; min-height: 48px; }
.colonne-pipeline--cible { background: var(--primaire-pale); box-shadow: inset 0 0 0 2px var(--primaire); }
.carte-prospect--deplacable { cursor: grab; -webkit-touch-callout: none; touch-action: manipulation; }
.carte-prospect--glissee { opacity: .35; }
.carte-prospect--envoi { opacity: .6; pointer-events: none; }
.carte-prospect--fantome { position: fixed; top: 0; left: 0; margin: 0; z-index: 1000; pointer-events: none; cursor: grabbing; box-shadow: var(--ombre-menu); transform-origin: top left; }
.kanban-glisser, .kanban-glisser * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }

/* Lignes de tableau cliquables (lot UX1, assets/controllers/ligne_cliquable_controller.js) */
.tableau tbody tr.ligne-cliquable { cursor: pointer; }
.tableau tbody tr.ligne-cliquable:hover td { background: var(--surface-4); }
.tableau tbody tr.ligne-cliquable:focus-within td { background: var(--surface-4); }

.prerequis { list-style: none; margin: var(--e-2) 0; padding: 0; font-size: var(--t-base); }
.prerequis li { padding: 2px 0; }
.prerequis__ok::before { content: '✓ '; color: var(--succes-texte); font-weight: 700; }
.prerequis__ko::before { content: '✕ '; color: var(--danger-texte); font-weight: 700; }
.bouton:disabled, .bouton[aria-disabled='true'] { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* Formalité Express Juridique (référentiel EJ, lots J1 et J2) */
.formalite-ej { padding: 0; margin: var(--e-4) 0 0; }
.formalite-ej > legend + * { clear: both; }
.operations-ej { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: var(--e-3) var(--e-5); }
.operations-ej__categorie { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.operations-ej__categorie legend { font-weight: 600; font-size: var(--t-sm); margin-bottom: 4px; padding: 0; }
/* Badge EJ : marine d'Express Juridique, pour signaler ce qui part chez EJ. */
.badge-ej { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 1px 6px; border-radius: 4px; background: var(--ej-marine); color: #fff; vertical-align: middle; }
.fiche-transmission { width: 100%; min-height: 180px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--t-sm); }
.liens-ej { display: flex; flex-wrap: wrap; gap: var(--e-2) var(--e-4); margin: var(--e-2) 0; }
.suggestions-ej { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.suggestions-ej li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.suggestions-ej form { display: inline; }

/* Assistant de mise en place (lot M) */
.jauge { height: 8px; border-radius: var(--rayon-pilule); background: var(--surface-4); overflow: hidden; margin: 6px 0 var(--e-3); }
.jauge__barre { height: 100%; border-radius: inherit; background: var(--degrade-primaire); }
.etapes-mep { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--e-2); font-size: var(--t-sm); }
.etapes-mep li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; padding: var(--e-2) 10px; border-radius: var(--rayon-champ); background: var(--surface-4); }
.etapes-mep li.etapes-mep--a-completer { background: var(--a-completer-fond); box-shadow: inset 3px 0 0 var(--a-completer); }
.etapes-mep__manquants { flex-basis: 100%; color: var(--encre-douce); }
.fil-etapes { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--e-4); padding: 0; list-style: none; font-size: var(--t-xs); }
.fil-etapes a, .fil-etapes strong { display: inline-block; padding: 4px 10px; border-radius: var(--rayon-champ); background: var(--surface); border: 1px solid var(--trait); }
.fil-etapes a { color: var(--encre); text-decoration: none; }
.fil-etapes a:hover { border-color: var(--primaire); color: var(--primaire); }
.fil-etapes strong { border-color: transparent; background: var(--degrade-primaire); color: #fff; }
.propose { font-size: var(--t-xs); color: var(--primaire); }
.etape-client { border: 1px solid var(--trait); border-radius: var(--rayon-carte); padding: var(--e-3) var(--e-4); margin: 0 0 var(--e-4); }
.etape-client legend { font-weight: 600; padding: 0 6px; }
.etapes-client__progression { font-size: var(--t-xs); color: var(--encre-douce); }
.comparaison-client td, .comparaison-client th { vertical-align: top; }
/* Lot F : sociétés du formulaire de contact, documents partagés, pièces de reprise. */
.societe-contact { border: 1px dashed var(--trait-champ); border-radius: var(--rayon-champ); padding: var(--e-2) var(--e-3); margin: 0 0 var(--e-3); }
.societe-contact legend { font-weight: 500; padding: 0 6px; }
.documents-partages li { padding: var(--e-2) 0; border-bottom: 1px solid var(--trait); }
.partage { border-top: 1px solid var(--trait); padding: var(--e-3) 0; }
.liste-pieces .etiquette { margin-right: 6px; }

/* ---------- Divers ---------- */

/* Barre de progression : même rendu que .jauge (piste gris pâle, remplissage indigo). */
progress { -webkit-appearance: none; appearance: none; height: 8px; border: 0; border-radius: var(--rayon-pilule); background: var(--surface-4); color: var(--primaire); accent-color: var(--primaire); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--surface-4); border-radius: var(--rayon-pilule); }
progress::-webkit-progress-value { background: var(--primaire); border-radius: var(--rayon-pilule); }
progress::-moz-progress-bar { background: var(--primaire); border-radius: var(--rayon-pilule); }
/* Kanban des prospects : colonnes gris pâle sans ombre, cartes blanches. */
.colonnes-pipeline > .carte { background: var(--surface-3); border-color: var(--trait-2); box-shadow: none; }
.colonnes-pipeline > .colonne-pipeline--cible { background: var(--primaire-pale); }
.colonnes-pipeline > .carte > h2 { display: flex; align-items: center; gap: 2px; color: var(--encre); margin-bottom: var(--e-2); }
.colonnes-pipeline > .carte > h2 > .compteur { background: var(--surface); border: 1px solid var(--trait); color: var(--encre-douce); line-height: 18px; }

/* ---------- Mobile : onglets de vues et filtre unique (retours de préprod, 23/10) ---------- */

@media (max-width: 720px) {
    /* Un formulaire de filtres à un seul champ (campagne juridique) : le champ prend toute la ligne. */
    .filtres:not(:has(> .champ ~ .champ)) > .champ { flex: 1 1 100%; }
}
@media (max-width: 560px) {
    /* Contrôle segmenté en grille de deux colonnes : tous les onglets restent visibles. */
    nav.actions:has(> [aria-current='page']) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
    nav.actions:has(> [aria-current='page']) > a:not(.lien-secondaire), nav.actions:has(> [aria-current='page']) > [aria-current='page'] { display: flex; align-items: center; justify-content: center; min-height: 40px; text-align: center; line-height: 1.3; }
    nav.actions:has(> [aria-current='page']) > .lien-secondaire { grid-column: 1 / -1; margin: 2px 0 0; padding: 8px 12px 5px; border-left: 0; border-top: 1px solid var(--trait); text-align: center; }
}

/* Paramètres > Identité des documents (lot P1-6d) */
.identite-ligne { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--e-3); margin-bottom: var(--e-3); }
.identite-ligne__texte { min-width: 0; flex: 1 1 280px; }
.identite-ligne__texte h2, .identite-ligne__texte h3 { margin: 0 0 4px; }
.identite-ligne__texte p { margin: 0; overflow-wrap: anywhere; }
.identite-pastille { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.identite-vignette { max-height: 64px; max-width: 220px; width: auto; border: 1px solid var(--trait); border-radius: 6px; padding: 4px; background: #fff; }
/* Tableau des signataires (lot P1-6e) : tient dans la carte dès 1024 px, actions repliées sur deux lignes au besoin. */
.signataires-tableau .identite-vignette { max-height: 40px; max-width: 120px; }
.signataires-tableau .tableau__action { white-space: normal; }
.signataires-tableau__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.signataires-tableau__actions .en-ligne { margin-left: 0; }
@media (min-width: 1280px) { .signataires-tableau__actions { flex-wrap: nowrap; } }
.identite-apercu-colonne { position: sticky; top: var(--e-4); min-width: 0; }
.identite-apercu-colonne h2 { font-size: 1rem; margin: 0 0 var(--e-2); }
.document.identite-apercu { padding: 16px; font-size: 9pt; }

/* ---------- Demandes d'accès en attente (lot INS-4, Paramètres > Utilisateurs) ---------- */

.demandes-acces { margin-bottom: var(--e-4); }
.demandes-acces__intro { margin: 0 0 var(--e-3); font-size: var(--t-sm); color: var(--encre-2); }
.demandes-acces__demande { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--e-2) var(--e-4); padding: var(--e-3) 0; border-top: 1px solid var(--trait-3); }
.demandes-acces__demande:first-child { border-top: 0; padding-top: 0; }
.demandes-acces__identite { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.demandes-acces__identite small { color: var(--neutre-texte); }
.demandes-acces__message { margin: var(--e-1) 0 0; white-space: pre-line; }
.demandes-acces__actions { margin-top: 0; }
.demandes-acces__actions form { margin: 0; }
.demandes-acces__origine a { display: inline-block; margin-top: 4px; font-weight: 600; }
