/* ==========================================================================
   Analyse factures énergie — feuille de style
   Jetons de couleur (clair / sombre), coque avec menu latéral, composants.
   ========================================================================== */

:root {
    --fond: #f4f6f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #eef2f7;
    --texte: #111827;
    --texte-2: #4b5563;
    --texte-3: #6b7280;
    --bord: #e3e8ef;
    --bord-fort: #cfd6e0;
    --marque: #0f2f4f;
    --marque-2: #163d63;
    --accent: #1d5fd1;
    --accent-doux: #e8f0fd;
    --jaune: #f5b400;
    --rouge: #c0262d;
    --rouge-doux: #fdecec;
    --rouge-fort: #b3141b;
    --ambre: #8a4b00;
    --ambre-doux: #fff5e3;
    --ambre-bord: #f1c97e;
    --vert: #166a3c;
    --vert-doux: #e6f4ec;
    --menu-fond: #0d2236;
    --menu-texte: #c5d1de;
    --menu-texte-actif: #ffffff;
    --menu-survol: rgba(255, 255, 255, .07);
    --rayon: 12px;
    --rayon-petit: 8px;
    --ombre: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 20px rgba(15, 23, 42, .05);
    --ombre-forte: 0 12px 32px rgba(15, 23, 42, .12);
    --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --fond: #0b1118;
        --surface: #121a24;
        --surface-2: #17212d;
        --surface-3: #1c2734;
        --texte: #e6ecf3;
        --texte-2: #b3bfcc;
        --texte-3: #8794a3;
        --bord: #253141;
        --bord-fort: #33425a;
        --marque: #9cc3ff;
        --marque-2: #b7d3ff;
        --accent: #6aa5ff;
        --accent-doux: #172a45;
        --rouge: #ff6b6b;
        --rouge-doux: #3a1518;
        --rouge-fort: #d63b40;
        --ambre: #f5c46b;
        --ambre-doux: #2c2312;
        --ambre-bord: #6b5221;
        --vert: #6fd39a;
        --vert-doux: #12291d;
        --menu-fond: #0a131d;
        --ombre: none;
        --ombre-forte: 0 12px 32px rgba(0, 0, 0, .4);
        color-scheme: dark;
    }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 15px/1.55 var(--police); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 1.08rem; margin: 0 0 12px; }
h3 { font-size: .95rem; }
code { font: .88em ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.icone { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Coque : menu latéral + contenu ---------- */
.coque { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.menu-lateral {
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
    padding: 20px 14px; background: var(--menu-fond); color: var(--menu-texte); overflow-y: auto;
}
.marque-app { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; padding: 2px 8px; }
.marque-app__logo { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #1d5fd1, #0f2f4f); color: var(--jaune); flex: none; }
.marque-app__logo .icone { fill: currentColor; stroke: none; }
.marque-app__nom { font-weight: 700; font-size: .95rem; line-height: 1.2; }
.menu-bureau { display: flex; flex-direction: column; flex: 1; }
.menu-mobile { display: none; }
.navigation ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.navigation a {
    display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px;
    color: var(--menu-texte); text-decoration: none; font-weight: 550; font-size: .92rem;
}
.navigation a:hover { background: var(--menu-survol); color: var(--menu-texte-actif); }
.navigation a[aria-current="page"] { background: rgba(255, 255, 255, .1); color: var(--menu-texte-actif); box-shadow: inset 3px 0 0 var(--jaune); }
.compte { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.compte__avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #1d3a57; color: #fff; font-weight: 700; flex: none; }
.compte__nom { display: flex; flex-direction: column; min-width: 0; color: #fff; font-weight: 600; font-size: .88rem; overflow-wrap: anywhere; }
.compte__nom small { color: var(--menu-texte); font-weight: 400; font-size: .76rem; }
.compte form { margin: 0 0 0 auto; }
.compte__sortie { all: unset; cursor: pointer; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--menu-texte); }
.compte__sortie:hover { background: var(--menu-survol); color: #fff; }
.compte__sortie:focus-visible { outline: 2px solid var(--jaune); }

.contenu { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 40px; display: flex; flex-direction: column; }
.entete-page { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; justify-content: space-between; margin: 0 0 22px; }
.entete-page h1 { margin: 0; font-size: 1.6rem; }
.entete-page p { margin: 4px 0 0; color: var(--texte-2); }
.entete-page__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.entete-page__actions form { margin: 0; }
.principal { display: flex; flex-direction: column; gap: 20px; max-width: 1180px; width: 100%; }
.principal--large { max-width: none; }
.pied { margin-top: auto; padding-top: 32px; color: var(--texte-3); font-size: .8rem; }
.pied a { color: inherit; }

/* Pages sans menu (connexion, activation) */
.page-seule { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 48px 16px 32px; gap: 8px;
    background: radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent), var(--fond); }
.marque-app--centree { color: var(--texte); }
.page-seule__titre { margin: 18px 0 6px; font-size: 1.45rem; text-align: center; }
.page-seule .principal { max-width: 480px; }
.page-seule .pied { text-align: center; }

/* Menu sur petit écran */
@media (max-width: 900px) {
    .coque { grid-template-columns: 1fr; }
    .menu-lateral { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 14px; overflow: visible; }
    .menu-bureau { display: none; }
    .menu-mobile { display: block; position: static; }
    .menu-mobile summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 8px 12px; border-radius: 9px; color: #fff; font-weight: 600; background: rgba(255, 255, 255, .08); }
    .menu-mobile summary::-webkit-details-marker { display: none; }
    .menu-mobile__panneau {
        position: absolute; left: 0; right: 0; top: 100%; display: flex; flex-direction: column; gap: 10px;
        background: var(--menu-fond); padding: 6px 14px 14px; box-shadow: var(--ombre-forte); max-height: calc(100vh - 60px); overflow-y: auto;
    }
    .contenu { padding-top: 20px; }
    .entete-page h1 { font-size: 1.35rem; }
}

/* ---------- Cartes, grilles, indicateurs ---------- */
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 20px; min-width: 0; }
.carte > h2:first-child, .carte > .barre-outils:first-child h2 { margin-top: 0; }
.carte__pied { margin: 14px -20px -20px; padding: 12px 20px; border-top: 1px solid var(--bord); background: var(--surface-2); border-radius: 0 0 var(--rayon) var(--rayon); }
.grille-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; }
.indicateurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 16px; }
.indicateur { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.indicateur__libelle { color: var(--texte-3); font-size: .78rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }
.indicateur__valeur { font-size: 1.75rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.indicateur__note { color: var(--texte-2); font-size: .85rem; }
.indicateur--vert .indicateur__valeur { color: var(--vert); }
.indicateur--rouge .indicateur__valeur { color: var(--rouge); }
.indicateur--accent .indicateur__valeur { color: var(--accent); }
.vide { color: var(--texte-3); margin: 0; }
.etat-vide { text-align: center; padding: 28px 16px; color: var(--texte-3); }
.etat-vide strong { display: block; color: var(--texte); font-size: 1rem; margin-bottom: 4px; }

/* ---------- Boutons ---------- */
.bouton {
    appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    border: 1px solid var(--accent); background: var(--accent); color: #fff; padding: 9px 16px; border-radius: 9px;
    font: inherit; font-weight: 600; font-size: .9rem; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.bouton:hover { filter: brightness(1.08); }
.bouton:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.bouton--secondaire { background: var(--surface); color: var(--texte); border-color: var(--bord-fort); }
.bouton--secondaire:hover { background: var(--surface-2); filter: none; border-color: var(--accent); color: var(--accent); }
.bouton--danger { color: var(--rouge); }
.bouton--danger:hover { border-color: var(--rouge); color: var(--rouge); }
.bouton--petit { padding: 5px 10px; font-size: .82rem; border-radius: 7px; }

/* ---------- Bandeaux ---------- */
.bandeau { border-radius: 10px; padding: 12px 16px; border: 1px solid; white-space: pre-line; }
.bandeau--erreur { background: var(--rouge-doux); border-color: color-mix(in srgb, var(--rouge) 30%, transparent); color: var(--rouge); }
.bandeau--succes { background: var(--vert-doux); border-color: color-mix(in srgb, var(--vert) 30%, transparent); color: var(--vert); }
.bandeau--info { background: var(--accent-doux); border-color: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--texte); }
.contenu > .bandeau { margin-bottom: 16px; max-width: 1180px; }
.appris { margin-top: 14px; white-space: normal; }
.appris ul { margin: 6px 0 0; padding-left: 20px; }
/* Page Fournisseurs */
.modele { align-items: start; }
.modele h3 { margin: 0 0 10px; }
.regles-fournisseur summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.regles-fournisseur ul { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.regles-fournisseur li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.regles-fournisseur form { margin: 6px 0 0; }
.regles-fournisseur li form { margin: 0; }
.qualite meter { width: min(220px, 50vw); height: 12px; vertical-align: middle; margin-right: 6px; }
.lien-activation code { display: block; padding: 12px 14px; border: 1px solid var(--bord); user-select: all; }
.note-legale { font-size: .82rem; color: var(--texte-3); margin: 12px 0 0; }

/* ---------- Badges ---------- */
.statut, .pastille, .badge {
    display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 650;
    border: 1px solid var(--bord); background: var(--surface-2); color: var(--texte-2); text-decoration: none; white-space: nowrap;
}
.statut--eligible_exoneration_totale, .statut--eligible_taux_reduit, .badge--vert { background: var(--vert-doux); border-color: color-mix(in srgb, var(--vert) 35%, transparent); color: var(--vert) !important; }
.statut--analyse_humaine_requise, .badge--ambre { background: var(--ambre-doux); border-color: var(--ambre-bord); color: var(--ambre) !important; }
.statut--non_eligible, .statut--non_evaluee { color: var(--texte-3) !important; }
.badge--rouge { background: var(--rouge-doux); border-color: color-mix(in srgb, var(--rouge) 35%, transparent); color: var(--rouge); }
.pastille--electricite { background: #fff4cc; border-color: #f1d36b; color: #6b5200; }
.pastille--gaz { background: #e3efff; border-color: #a9c7f5; color: #1d4b8f; }
@media (prefers-color-scheme: dark) {
    .pastille--electricite { background: #3a3110; border-color: #6b5a1c; color: #f5d978; }
    .pastille--gaz { background: #15294a; border-color: #2c4f85; color: #a9c7f5; }
}
.confiance { font-weight: 700; }
.confiance--haute { color: var(--vert); }
.confiance--moyenne { color: var(--ambre); }
.confiance--basse { color: var(--rouge); }

/* ---------- Tableaux ---------- */
.tableau-defile { overflow-x: auto; }
.carte > .tableau-defile { margin: 0 -20px; }
.carte > .tableau-defile:last-child { margin-bottom: -20px; }
.carte > .tableau-defile:first-child { margin-top: -20px; border-radius: var(--rayon) var(--rayon) 0 0; }
.tableau { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tableau th, .tableau td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--bord); vertical-align: top; }
.tableau thead th { background: var(--surface-2); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--texte-3); white-space: nowrap; position: sticky; top: 0; }
.tableau tbody th { font-weight: 600; color: var(--texte-2); width: 34%; }
.tableau tbody tr:last-child td, .tableau tbody tr:last-child th { border-bottom: 0; }
.tableau tbody tr:hover { background: var(--surface-2); }
.tableau th button { all: unset; cursor: pointer; }
.tableau th button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tableau th[aria-sort="ascending"] button::after { content: " ▲"; }
.tableau th[aria-sort="descending"] button::after { content: " ▼"; }
.tableau .nombre { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableau .actions { text-align: right; white-space: nowrap; }
.tableau .actions form { display: inline-flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; margin: 0; }
.tableau .actions > .bouton + .bouton { margin-left: 6px; }
.tableau small { color: var(--texte-3); }
.tableau a { font-weight: 600; text-decoration: none; }
.tableau a:hover { text-decoration: underline; }
.cellule--corrigee::after { content: " ✎"; color: var(--texte-3); }
.delai--proche, .delai--aujourdhui { color: var(--rouge); font-weight: 700; }
.delai--echue { color: var(--texte-3); text-decoration: line-through; }

/* ---------- Barres d'outils, recherche ---------- */
.barre-outils { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.barre-outils h2 { margin: 0; }
.barre-outils + .barre-outils { padding-top: 14px; border-top: 1px dashed var(--bord); }
.recherche { display: flex; gap: 8px; flex: 1 1 320px; max-width: 520px; margin: 0; }
.recherche input { flex: 1; }

/* ---------- Formulaires ---------- */
.formulaire form, form.formulaire { display: flex; flex-direction: column; gap: 16px; }
form.formulaire { margin-top: 16px; }
.formulaire--etroit { width: 100%; }
.formulaire label { display: flex; flex-direction: column; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--texte-2); }
.formulaire input, .formulaire select, .formulaire textarea, .recherche input, .correction input {
    font: inherit; font-weight: 400; color: var(--texte); background: var(--surface); border: 1px solid var(--bord-fort);
    border-radius: var(--rayon-petit); padding: 9px 11px; min-width: 0; width: 100%;
}
.formulaire input[type="color"] { padding: 3px; height: 40px; }
.formulaire input[type="checkbox"] { width: auto; }
.formulaire input:focus, .formulaire select:focus, .formulaire textarea:focus, .recherche input:focus, .correction input:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.formulaire .bouton { align-self: flex-start; }
.formulaire__aide { color: var(--texte-3); font-size: .86rem; margin: 0; font-weight: 400; }
.formulaire fieldset { border: 1px solid var(--bord); border-radius: var(--rayon-petit); padding: 14px 16px; margin: 0; }
.formulaire legend { font-weight: 700; padding: 0 6px; }
.formulaire label.case { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; }
.formulaire label.case input { margin-top: 3px; width: auto; }
.ligne-formulaire { display: flex; gap: 12px; flex-direction: row !important; flex-wrap: wrap; align-items: flex-end; margin: 0; }
.ligne-formulaire label { flex: 1 1 200px; display: flex; flex-direction: column; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--texte-2); }
.ligne-formulaire input:not([type="checkbox"]), .ligne-formulaire select {
    font: inherit; font-weight: 400; color: var(--texte); background: var(--surface); border: 1px solid var(--bord-fort);
    border-radius: var(--rayon-petit); padding: 8px 10px; min-width: 0; width: 100%;
}
.tableau .ligne-formulaire input[type="file"] { padding: 4px; font-size: .8rem; max-width: 190px; }
.fichiers { display: flex; flex-wrap: wrap; gap: 6px; }
.fichiers a { display: inline-flex; padding: 2px 9px; border-radius: 6px; background: var(--accent-doux); font-size: .8rem; }
.grille-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px 18px; }

/* ---------- Double authentification ---------- */
.totp ol { margin: 0 0 8px; padding-left: 20px; }
.totp__qr { margin: 8px 0; }
.totp__qr img { display: block; width: 220px; height: 220px; padding: 12px; background: #fff; border-radius: 10px; border: 1px solid var(--bord); }
.totp details summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.totp__cle code { font-size: 1.1rem; letter-spacing: .08em; font-weight: 700; }

/* ---------- Listes de règles / anomalies / étapes ---------- */
.regles { list-style: none; margin: 0; padding: 0; }
.regles li { display: grid; grid-template-columns: 70px 120px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--bord); font-size: .9rem; }
.regles li:last-child { border-bottom: 0; }
.regles small { display: block; color: var(--texte-3); margin-top: 2px; }
.verdict--ok { color: var(--vert); font-weight: 700; }
.verdict--ko { color: var(--rouge); font-weight: 700; }
.verdict--nd { color: var(--ambre); font-weight: 700; }
.etapes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.etapes li { display: flex; gap: 10px; align-items: baseline; font-size: .9rem; }
.etapes li::before { content: "○"; color: var(--texte-3); font-weight: 700; flex: none; }
.etapes li.ok::before { content: "✓"; color: var(--vert); }
.etapes li.ko::before { content: "✗"; color: var(--rouge); }
.etapes small { color: var(--texte-3); overflow-wrap: anywhere; }
.montant-cle { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 0; color: var(--vert); }
.texte-long { max-width: 760px; }
.texte-long h2 { font-size: 1.02rem; margin: 20px 0 6px; }
.texte-long h2:first-child { margin-top: 0; }
.api-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.api-carte { display: flex; flex-direction: column; gap: 12px; }
.api-carte__entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.api-carte__entete h2 { margin: 0; }
.api-carte__entete p { margin: 2px 0 0; color: var(--texte-3); font-size: .85rem; }
.api-carte form { margin-top: auto; }

@media (max-width: 680px) {
    .regles li { grid-template-columns: 1fr; gap: 2px; }
    .carte { padding: 16px; }
    .carte > .tableau-defile { margin: 0 -16px; }
    .carte > .tableau-defile:last-child { margin-bottom: -16px; }
    .carte > .tableau-defile:first-child { margin-top: -16px; }
}

/* ==========================================================================
   Page « Analyser » : dépôt, progression, fiche, historique
   ========================================================================== */
.depot {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 220px; padding: 32px 20px; text-align: center; cursor: pointer;
    border: 2px dashed var(--bord-fort); border-radius: var(--rayon); background: var(--surface-2);
    transition: border-color .15s, background .15s;
}
.depot:hover, .depot:focus-visible { border-color: var(--accent); outline: none; background: color-mix(in srgb, var(--accent) 5%, var(--surface-2)); }
.depot.survol { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }
.depot__icone { width: 52px; height: 52px; padding: 12px; border-radius: 14px; background: var(--accent-doux); fill: var(--accent); margin-bottom: 6px; }
.depot__titre { font-size: 1.18rem; font-weight: 700; }
.depot__aide { color: var(--texte-2); max-width: 540px; }
.depot__limites { color: var(--texte-3); font-size: .84rem; }
.lien { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.chargement { display: flex; align-items: center; gap: 16px; padding: 18px 4px 4px; }
.chargement__corps { flex: 1; min-width: 0; }
.chargement__titre { margin: 0; font-weight: 650; }
.chargement__detail { margin: 2px 0 0; color: var(--texte-2); font-size: .9rem; }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--bord); border-top-color: var(--accent); animation: tourne .9s linear infinite; flex: none; }
@keyframes tourne { to { transform: rotate(360deg); } }
.progression { height: 6px; margin: 8px 0 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progression__barre { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #3c8bff); transition: width .4s ease; }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } .progression__barre { transition: none; } }

.resultat:empty { display: none; }
.fiche { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); overflow: hidden; }
.echeance { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 22px 24px; background: linear-gradient(135deg, #b3141b, #d4322f); color: #fff; }
.echeance__icone svg { width: 44px; height: 44px; fill: currentColor; opacity: .95; }
.echeance__libelle { margin: 0; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .92; }
.echeance__date { margin: 2px 0 0; font-size: clamp(1.8rem, 4.5vw, 2.5rem); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.echeance__source { margin: 6px 0 0; font-size: .85rem; opacity: .88; }
.echeance__delai { margin: 0; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-weight: 700; white-space: nowrap; }
.echeance--echue .echeance__delai { background: #fff; color: var(--rouge-fort); }
.echeance--inconnue { background: var(--ambre-doux); color: var(--ambre); }
.echeance--inconnue .echeance__date { font-size: 1.35rem; }
.echeance--inconnue .echeance__delai { display: none; }
.grille { display: grid; grid-template-columns: 1fr 1fr; }
.bloc { padding: 20px 24px; border-top: 1px solid var(--bord); min-width: 0; }
.bloc:nth-child(odd) { border-right: 1px solid var(--bord); }
.bloc__titre { margin: 0 0 6px; font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--texte-3); }
.bloc__valeur { margin: 0; font-size: 1.3rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.bloc__valeur--chiffre { font-size: 1.85rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.bloc__valeur .unite { font-size: .95rem; font-weight: 600; color: var(--texte-2); margin-left: 4px; }
.bloc__valeur.vide { font-size: 1.02rem; font-weight: 600; color: var(--texte-3); }
.bloc__note { margin: 4px 0 0; color: var(--texte-2); font-size: .9rem; }
.lignes { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px dashed var(--bord); }
.lignes:empty { display: none; }
.lignes li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--bord); font-size: .9rem; }
.lignes li span:first-child { color: var(--texte-2); min-width: 0; overflow-wrap: anywhere; }
.lignes li span:last-child { font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lignes li.incoherent span:last-child::after { content: " ⚠"; color: var(--ambre); }
.alertes { margin: 0; padding: 16px 24px; background: var(--ambre-doux); border-top: 1px solid var(--ambre-bord); color: var(--ambre); }
.alertes h3 { margin: 0 0 6px; font-size: .76rem; letter-spacing: .07em; text-transform: uppercase; }
.alertes ul { margin: 0; padding-left: 18px; }
.alertes li { margin: 3px 0; font-size: .92rem; }
.carte .alertes { margin: 12px 0; border: 1px solid var(--ambre-bord); border-radius: var(--rayon-petit); }
.corrige { display: inline-block; padding: 0 7px; border-radius: 999px; font-size: .7rem; font-weight: 700; vertical-align: middle; background: var(--surface-2); border: 1px solid var(--bord); color: var(--texte-2); }
.echeance .corrige { background: rgba(255, 255, 255, .2); border-color: transparent; color: inherit; }
.correction { padding: 18px 24px; border-top: 1px solid var(--bord); background: var(--surface-2); }
.correction__titre { margin: 0 0 4px; font-size: .76rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--texte-3); }
.correction__aide { margin: 0 0 12px; color: var(--texte-2); font-size: .9rem; }
.correction__champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.correction label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--texte-2); }
.correction__erreur { color: var(--rouge); margin: 0 0 10px; }
.fiche__pied { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 14px 24px; border-top: 1px solid var(--bord); background: var(--surface-2); }
.fiche__meta { margin: 0; color: var(--texte-3); font-size: .85rem; }
.fiche__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fiche__actions form { margin: 0; }
.historique { padding: 0; overflow: hidden; }
.historique__entete { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 16px 20px; }
.historique__entete h2 { margin: 0; }
.historique__nombre { color: var(--texte-3); font-weight: 500; }
.historique > .tableau-defile, .historique > .tableau-defile:last-child { margin: 0; border-top: 1px solid var(--bord); }

@media (max-width: 680px) {
    .grille { grid-template-columns: 1fr; }
    .bloc:nth-child(odd) { border-right: 0; }
    .echeance { grid-template-columns: 1fr; gap: 8px; padding: 18px 16px; }
    .echeance__icone { display: none; }
    .echeance__delai { justify-self: start; }
    .bloc, .alertes, .fiche__pied, .correction { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Fil conducteur (tableau de bord, page client) ---------- */
.parcours__entete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.parcours__entete h2 { margin: 0; }
.parcours__compte { color: var(--texte-3); font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.parcours__etapes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 0; counter-reset: etape; }
.parcours__etape { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 0 14px 4px 0; min-width: 0; }
/* Trait qui relie les étapes : vert jusqu'à la dernière étape faite. */
.parcours__etape::before { content: ""; position: absolute; top: 15px; left: 34px; right: 0; height: 2px; background: var(--bord); }
.parcours__etape:last-child::before { display: none; }
.parcours__etape--fait::before { background: var(--vert); }
.parcours__puce {
    position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
    font-weight: 750; font-size: .9rem; background: var(--surface); border: 2px solid var(--bord-fort); color: var(--texte-3);
}
.parcours__etape--fait .parcours__puce { background: var(--vert); border-color: var(--vert); color: var(--surface); }
.parcours__etape--courante .parcours__puce { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-doux); }
.parcours__etape--facultatif .parcours__puce { border-style: dashed; }
.parcours__texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.parcours__texte a, .parcours__texte strong { font-weight: 700; color: var(--texte); text-decoration: none; }
.parcours__texte a:hover { color: var(--accent); text-decoration: underline; }
.parcours__etape--courante .parcours__texte a { color: var(--accent); }
.parcours__texte small { color: var(--texte-2); font-size: .82rem; line-height: 1.4; }
.parcours__etape--fait .parcours__texte small { color: var(--texte-3); }
.parcours__suivante {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 18px -20px -20px; padding: 14px 20px;
    background: var(--accent-doux); border-top: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); border-radius: 0 0 var(--rayon) var(--rayon);
}
.parcours__suivante--fini { background: var(--vert-doux); border-top-color: color-mix(in srgb, var(--vert) 30%, transparent); color: var(--vert); }
.parcours__etiquette { display: inline-block; margin-right: 6px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
@media (max-width: 680px) {
    .parcours__etapes { grid-template-columns: 1fr; gap: 14px; }
    .parcours__etape { flex-direction: row; align-items: flex-start; padding: 0; }
    .parcours__etape::before { top: 34px; bottom: -14px; left: 15px; right: auto; width: 2px; height: auto; }
    .parcours__puce { flex: none; }
    .parcours__suivante { margin: 16px -16px -16px; padding: 14px 16px; }
}
.navigation__groupe { margin: 18px 12px 6px; color: var(--menu-texte); opacity: .6; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.navigation__groupe:first-child { margin-top: 4px; }

/* ---------- Guide en étapes (page Analyser) ---------- */
.guide { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.guide li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--rayon-petit); background: var(--surface); border: 1px solid var(--bord); font-size: .86rem; color: var(--texte-2); line-height: 1.4; }
.guide strong { color: var(--texte); }
.guide__num { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-doux); color: var(--accent); font-weight: 750; font-size: .8rem; }
.jauge { display: inline-flex; gap: 3px; vertical-align: middle; }
.jauge__pas { width: 16px; height: 6px; border-radius: 3px; background: var(--bord-fort); }
.jauge__pas--fait { background: var(--vert); }

/* ---------- Sous-étapes (dossier fiscal) ---------- */
.sous-etapes ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sous-etapes li a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 7px; border-radius: 999px; background: var(--surface); border: 1px solid var(--bord); color: var(--texte); font-size: .86rem; font-weight: 600; text-decoration: none; }
.sous-etapes li a:hover { border-color: var(--accent); }
.sous-etapes__num { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--bord-fort); font-size: .75rem; color: var(--texte-3); }
.sous-etapes__fait .sous-etapes__num { background: var(--vert); border-color: var(--vert); color: var(--surface); }
.sous-etapes__suite { margin-left: auto; }
.sous-etapes__suite form { margin: 0; }
.parcours-rappel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- Accise expliquée (réponse, manques, papiers, conditions) ---------- */
.verdict { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 14px; padding: 18px 20px; border-radius: var(--rayon); border: 1px solid; border-left-width: 5px; }
.verdict--vert { background: var(--vert-doux); border-color: color-mix(in srgb, var(--vert) 35%, transparent); border-left-color: var(--vert); }
.verdict--rouge { background: var(--rouge-doux); border-color: color-mix(in srgb, var(--rouge) 30%, transparent); border-left-color: var(--rouge); }
.verdict--orange { background: color-mix(in srgb, var(--ambre) 12%, var(--surface)); border-color: color-mix(in srgb, var(--ambre) 35%, transparent); border-left-color: var(--ambre); }
.verdict__titre { margin: 0; font-size: 1.3rem; font-weight: 750; letter-spacing: -.01em; }
.verdict--vert .verdict__titre { color: var(--vert); }
.verdict--rouge .verdict__titre { color: var(--rouge); }
.verdict__phrase { margin: 0; color: var(--texte); line-height: 1.5; max-width: 75ch; }
.verdict__apres { margin: 12px 0 0; color: var(--texte-2); font-size: .9rem; }
.manquants, .papiers, .conditions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.manquants li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--bord); }
.manquants li:last-child, .papiers li:last-child, .conditions li:last-child { border-bottom: 0; }
.manquants__quoi, .conditions li > span:last-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.manquants small, .conditions small { color: var(--texte-2); font-size: .86rem; line-height: 1.45; }
.papiers li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--bord); }
.papiers li::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 2px; border: 2px solid var(--bord-fort); border-radius: 4px; }
.conditions li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--bord); }
.conditions__reponse { flex: none; min-width: 86px; text-align: center; padding: 3px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--texte-3); border: 1px solid var(--bord); }
.conditions__ligne--oui .conditions__reponse { background: var(--vert-doux); color: var(--vert); border-color: color-mix(in srgb, var(--vert) 35%, transparent); }
.conditions__ligne--non .conditions__reponse { background: var(--rouge-doux); color: var(--rouge); border-color: color-mix(in srgb, var(--rouge) 30%, transparent); }
.conditions__ligne--a_verifier .conditions__reponse { background: color-mix(in srgb, var(--ambre) 14%, var(--surface)); color: var(--ambre); border-color: color-mix(in srgb, var(--ambre) 35%, transparent); }
.technique > summary { cursor: pointer; font-weight: 650; color: var(--texte-2); }
.technique[open] > summary { margin-bottom: 12px; }
@media (max-width: 680px) { .conditions li { flex-direction: column; gap: 6px; } .manquants li { flex-direction: column; align-items: flex-start; } }

/* ==========================================================================
   Animations : changement de page, clic, apparition du contenu, tableau de bord.
   Toutes coupées si le système demande moins de mouvement (fin de fichier).
   ========================================================================== */
@view-transition { navigation: auto; }
.menu-lateral { view-transition-name: menu-lateral; }
::view-transition-group(menu-lateral), ::view-transition-old(menu-lateral), ::view-transition-new(menu-lateral) { animation: none; }
::view-transition-old(root) { animation: .18s ease both va-disparait; }
::view-transition-new(root) { animation: .22s ease both va-apparait; }
@keyframes va-disparait { to { opacity: 0; } }
@keyframes va-apparait { from { opacity: 0; } }

@keyframes monte { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }
@keyframes glisse { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes surgit { 0% { opacity: 0; transform: scale(.4); } 70% { transform: scale(1.12); } 100% { opacity: 1; transform: none; } }
@keyframes trace { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes trace-v { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px var(--accent-doux); } 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--accent-doux) 40%, transparent); } }
@keyframes onde { from { transform: scale(0); opacity: .35; } to { transform: scale(1); opacity: 0; } }
@keyframes avance { from { transform: translateX(-100%); } to { transform: translateX(-12%); } }

/* Arrivée sur une page : en-tête puis blocs, l'un après l'autre. */
.entete-page { animation: monte .4s cubic-bezier(.2, .7, .2, 1) both; }
.principal > *, .indicateurs > * { animation: monte .45s cubic-bezier(.2, .7, .2, 1) both; }
.principal > :nth-child(1) { animation-delay: .05s; }
.principal > :nth-child(2) { animation-delay: .1s; }
.principal > :nth-child(3) { animation-delay: .15s; }
.principal > :nth-child(4) { animation-delay: .2s; }
.principal > :nth-child(5) { animation-delay: .25s; }
.principal > :nth-child(n+6) { animation-delay: .3s; }
.indicateurs > :nth-child(2) { animation-delay: .1s; }
.indicateurs > :nth-child(3) { animation-delay: .17s; }
.indicateurs > :nth-child(4) { animation-delay: .24s; }
.bandeau { animation: glisse .35s ease both; }
.tableau tbody tr { animation: fondu .4s ease both; transition: background-color .15s; }
.tableau tbody tr:nth-child(2) { animation-delay: .03s; }
.tableau tbody tr:nth-child(3) { animation-delay: .06s; }
.tableau tbody tr:nth-child(4) { animation-delay: .09s; }
.tableau tbody tr:nth-child(5) { animation-delay: .12s; }
.tableau tbody tr:nth-child(6) { animation-delay: .15s; }
.tableau tbody tr:nth-child(n+7) { animation-delay: .18s; }

/* Survol et clic. */
.carte, .indicateur { transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease; }
.indicateur:hover { transform: translateY(-3px); box-shadow: var(--ombre-forte); border-color: var(--bord-fort); }
.bouton { position: relative; overflow: hidden; transition: transform .12s ease, filter .15s, background-color .15s, border-color .15s, color .15s, box-shadow .15s; }
.bouton:not(:disabled):hover { box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 22%, transparent); }
.bouton:not(:disabled):active { transform: scale(.96); }
.navigation a, .compte__sortie, .sous-etapes li a { position: relative; overflow: hidden; transition: background-color .15s, color .15s, border-color .15s, box-shadow .2s, transform .12s; }
.navigation a:active, .compte__sortie:active { transform: scale(.97); }
.navigation a .icone { transition: transform .2s ease; }
.navigation a:hover .icone { transform: translateX(2px) scale(1.08); }
.onde { position: absolute; border-radius: 50%; background: currentColor; pointer-events: none; animation: onde .55s ease-out forwards; }
.bouton--envoi { cursor: progress; }
.bouton--envoi::after { content: ""; width: 12px; height: 12px; margin-left: 4px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: tourne .7s linear infinite; }
.depot { transition: border-color .15s, background .15s, transform .2s ease; }
.depot.survol { transform: scale(1.01); }
.depot__icone { transition: transform .25s ease; }
.depot:hover .depot__icone, .depot.survol .depot__icone { transform: translateY(-4px); }

/* Barre de chargement en haut de l'écran pendant le changement de page. */
.barre-page { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity .3s; }
.barre-page::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--accent), var(--jaune)); transform: translateX(-100%); }
.barre-page--active { opacity: 1; }
.barre-page--active::before { animation: avance 2.5s cubic-bezier(.1, .6, .2, 1) forwards; }
.barre-page--fin::before { animation: none; transform: none; transition: transform .25s ease; }
.barre-page--fin { opacity: 0; transition-delay: .2s; }

/* Menu mobile qui se déplie. */
.menu-mobile[open] .menu-mobile__panneau { animation: glisse .22s ease both; }

/* Page « Analyser » : panneau d'attente, fiche, guide. */
.chargement { animation: fondu .3s ease both; }
.resultat .fiche { animation: monte .5s cubic-bezier(.2, .7, .2, 1) both; }
.resultat .bloc { animation: fondu .4s ease both; animation-delay: .15s; }
.resultat .bloc:nth-child(n+3) { animation-delay: .25s; }
.guide li { transition: transform .2s ease, border-color .2s; }
.guide li:hover { transform: translateY(-2px); border-color: var(--accent); }

/* Tableau de bord : le fil conducteur se trace étape par étape. */
.parcours__puce { animation: surgit .45s cubic-bezier(.3, 1.4, .5, 1) both; }
.parcours__etape:nth-child(1) .parcours__puce { animation-delay: .25s; }
.parcours__etape:nth-child(2) .parcours__puce { animation-delay: .45s; }
.parcours__etape:nth-child(3) .parcours__puce { animation-delay: .65s; }
.parcours__etape:nth-child(4) .parcours__puce { animation-delay: .85s; }
.parcours__etape:nth-child(5) .parcours__puce { animation-delay: 1.05s; }
.parcours__etape:nth-child(n+6) .parcours__puce { animation-delay: 1.25s; }
.parcours__etape::before { transform-origin: left center; animation: trace .35s ease both; }
.parcours__etape:nth-child(1)::before { animation-delay: .4s; }
.parcours__etape:nth-child(2)::before { animation-delay: .6s; }
.parcours__etape:nth-child(3)::before { animation-delay: .8s; }
.parcours__etape:nth-child(4)::before { animation-delay: 1s; }
.parcours__etape:nth-child(n+5)::before { animation-delay: 1.2s; }
.parcours__etape--courante .parcours__puce { animation: surgit .45s cubic-bezier(.3, 1.4, .5, 1) both, pulse 2.2s ease-in-out 1.6s infinite; }
.parcours__etape--courante:nth-child(1) .parcours__puce { animation-delay: .25s, 1.6s; }
.parcours__etape--courante:nth-child(2) .parcours__puce { animation-delay: .45s, 1.6s; }
.parcours__etape--courante:nth-child(3) .parcours__puce { animation-delay: .65s, 1.6s; }
.parcours__etape--courante:nth-child(4) .parcours__puce { animation-delay: .85s, 1.6s; }
.parcours__etape--courante:nth-child(5) .parcours__puce { animation-delay: 1.05s, 1.6s; }
.parcours__etape--courante:nth-child(n+6) .parcours__puce { animation-delay: 1.25s, 1.6s; }
.parcours__suivante { animation: monte .45s ease both; animation-delay: .9s; }
.parcours__suivante .bouton:not(:disabled):hover { transform: translateX(3px); }
.jauge__pas { transform-origin: left center; animation: trace .3s ease both; }
.jauge__pas:nth-child(2) { animation-delay: .1s; }
.jauge__pas:nth-child(3) { animation-delay: .2s; }
.jauge__pas:nth-child(n+4) { animation-delay: .3s; }
@media (max-width: 680px) {
    .parcours__etape::before { transform-origin: center top; animation-name: trace-v; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
    .spinner { animation-duration: 3s !important; animation-iteration-count: infinite !important; }
}

/* ---------- ACD (autorisation de communication de données) ---------- */
.badge--gris { background: var(--surface-2); color: var(--texte-2); }
.badge--bleu { background: var(--accent-doux); border-color: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent); }
.formulaire label .badge { align-self: flex-start; white-space: normal; }
.filtres { display: flex; flex-wrap: wrap; gap: 6px; }
.filtres a { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--bord); color: var(--texte-2); text-decoration: none; font-size: .86rem; }
.filtres a[aria-current] { background: var(--marque); border-color: var(--marque); color: #fff; }
.barre-boutons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.barre-boutons form { margin: 0; }
.acd-formulaire fieldset { display: flex; flex-direction: column; gap: 14px; }
.acd-site { border: 1px solid var(--bord); border-radius: var(--rayon-petit); padding: 12px 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 12px; }
.acd-site__entete { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.formulaire [aria-invalid="true"] { border-color: var(--rouge); box-shadow: 0 0 0 3px var(--rouge-doux); }
.acd-options { display: grid; gap: 10px; }
.acd-option { border: 1px solid var(--bord); border-radius: var(--rayon-petit); padding: 12px 14px; }
.acd-option[open] { border-color: var(--accent); }
.acd-option summary { cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.acd-option summary small { color: var(--texte-2); }
.acd-option > :not(summary) { margin-top: 12px; }
.document-acd { line-height: 1.6; }
.document-acd h1 { font-size: 1.35rem; margin: 0 0 4px; }
.document-acd h2 { font-size: 1.02rem; margin: 20px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--bord); }
.document-acd .sous-titre, .document-acd .petit { color: var(--texte-2); font-size: .86rem; }
.document-acd table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.document-acd th, .document-acd td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--bord); vertical-align: top; }
.document-acd th { color: var(--texte-2); font-size: .78rem; text-transform: uppercase; }
.document-acd .a-completer { color: var(--ambre); font-style: italic; }
.signature-acd { border: 1px solid var(--bord); border-radius: var(--rayon-petit); padding: 10px 14px; max-width: 420px; }
.signature-acd img { display: block; max-width: 100%; max-height: 110px; background: #fff; border-radius: 4px; }
.signature-acd--vide { min-height: 110px; }
.signature-cadre { position: relative; border: 2px dashed var(--bord-fort); border-radius: var(--rayon-petit); background: #fff; max-width: 560px; }
.signature-cadre canvas { display: block; width: 100%; height: 190px; touch-action: none; cursor: crosshair; border-radius: var(--rayon-petit); }
.signature-cadre__aide { position: absolute; inset: 0; display: grid; place-items: center; color: #8a94a3; pointer-events: none; font-size: .95rem; text-align: center; padding: 0 12px; }
.signature-erreur { color: var(--rouge); font-weight: 600; margin: 0; }
@media (max-width: 680px) { .document-acd table { font-size: .82rem; } .document-acd th, .document-acd td { padding: 5px 4px; } }

/* Récapitulatif d'un envoi de plusieurs factures (doublons, erreurs) */
.lot__resume { margin: 0 0 .5rem; color: var(--texte-2); }
.lot td .badge { margin-right: .25rem; }
.doublon-paire td { vertical-align: top; }

/* Fiche : contrat (compteur, segment, CAR, CEE) sous les chiffres clés */
.grille--contrat { margin-top: .75rem; }
.bloc__valeur--compteur { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* Tableau de bord : ACD par utilisateur */
.indicateurs--compacts { margin-bottom: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
.indicateur--ambre .indicateur__valeur { color: var(--ambre); }
.tableau tfoot th, .tableau tfoot td { border-top: 2px solid var(--bord-fort); background: var(--surface-2); text-align: left; }
.tableau tfoot td.nombre { text-align: right; }

/* Comparatifs d'offres (admin) */
.comparatif .site-comparatif { display: flex; flex-direction: column; gap: 14px; }
.comparatif fieldset { display: flex; flex-direction: column; gap: 12px; }
.comparatif legend small, .comparatif label small { color: var(--texte-3); font-weight: 400; }
.offre-comparatif { background: var(--surface-2); }
.offre-comparatif > .bouton { align-self: flex-start; }
.marge { display: flex; gap: 6px; }
.marge input { flex: 1 1 auto; min-width: 0; }
.marge select { flex: 0 0 auto; width: auto; }
.barre-boutons--collante { position: sticky; bottom: 0; z-index: 5; background: var(--fond); padding: 12px 0; border-top: 1px solid var(--bord); }
.ligne--meilleure td { background: var(--vert-doux); }
.ligne--actuelle td { background: var(--surface-2); }
.economie-comparatif { font-size: 1.1rem; margin: 10px 0 22px; }
.economie-comparatif strong { color: var(--vert); }
.economie-comparatif--negative strong { color: var(--rouge); }
.partenaire { display: grid; gap: 12px; padding: 14px 0; border-top: 1px solid var(--bord); }
.partenaire--inactif { opacity: .65; }
.partenaire__logo img { max-height: 48px; max-width: 180px; }

/* Comparatifs : option tarifaire, postes en couleur, résultats colorés */
.option-comparatif { display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: 999px; background: #0b6f86; color: #fff; font-size: .8rem; font-weight: 700; letter-spacing: .03em; vertical-align: middle; }
.puce-poste { display: inline-block; padding: 1px 7px; border-radius: 5px; color: #fff; font-weight: 700; font-size: .8rem; }
.prix-annees .tableau input { width: 7em; }
.tuiles-comparatif { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.tuile-comparatif { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--rayon-petit); border: 1px solid var(--bord); background: var(--surface-2); }
.tuile-comparatif span { font-size: .82rem; color: var(--texte-2); }
.tuile-comparatif strong { font-size: 1.3rem; }
.tuile-comparatif small { color: var(--texte-3); }
.tuile-comparatif--actuelle { background: var(--rouge-doux); border-color: color-mix(in srgb, var(--rouge) 35%, transparent); }
.tuile-comparatif--actuelle strong { color: var(--rouge); }
.tuile-comparatif--meilleure { background: var(--vert-doux); border-color: color-mix(in srgb, var(--vert) 35%, transparent); }
.tuile-comparatif--meilleure strong { color: var(--vert); }
.tuile-comparatif--economie { background: var(--vert); border-color: var(--vert); }
.tuile-comparatif--economie span, .tuile-comparatif--economie strong, .tuile-comparatif--economie small { color: var(--surface); }
.tableau--comparatif .offre-nom { text-align: left; vertical-align: top; font-weight: 600; }
.tableau--comparatif .ligne--pondere td { font-weight: 600; border-bottom: 2px solid var(--bord-fort); }
.tableau--comparatif .ligne--actuelle td, .tableau--comparatif .ligne--actuelle th { background: var(--rouge-doux); color: var(--rouge); }
.tableau--comparatif .ttc { color: var(--ambre); }
.tableau--comparatif .ligne--meilleure .ttc { color: var(--vert); }
.tableau--comparatif .positif { color: var(--vert); }
.tableau--comparatif .negatif { color: var(--rouge); }

/* Comparatif : en-têtes en trois couleurs (offre, fourniture, réseau et taxes), ligne pondérée en vert clair, doutes, aperçu du PDF */
.tableau--comparatif th.g-offre { background: #3d5a48; color: #fff; }
.tableau--comparatif th.g-fourniture { background: #1d6f73; color: #fff; }
.tableau--comparatif th.g-reseau { background: #4f4a2e; color: #fff; }
.tableau--comparatif .ligne--pondere td { background: #d8eed3; color: #000; font-weight: 700; }
.bandeau--doute { background: var(--ambre-doux); border-color: var(--ambre-bord); color: var(--texte); }
.bandeau--doute ul, .bandeau--succes ul { margin: .3rem 0 .5rem 1.2rem; padding: 0; }
.apercu-pdf { display: block; width: 100%; height: 80vh; min-height: 480px; border: 1px solid var(--bord); border-radius: 8px; background: #fff; }

/* Visionneuse du scan d'origine (vérification humaine de la fiche) */
.visionneuse { margin: 1rem 0; border: 1px solid var(--bord); border-radius: 10px; background: var(--surface-2); padding: .75rem; }
.visionneuse__barre { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.visionneuse__titre { margin: 0 auto 0 0; font-size: 1rem; }
.visionneuse__pages { display: flex; flex-wrap: wrap; gap: .3rem; }
.visionneuse__pages [aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.visionneuse__cadre { background: #fff; border-radius: 6px; overflow: auto; max-height: 80vh; }
.visionneuse__vue { display: block; width: 100%; border: 0; }
iframe.visionneuse__vue { height: 78vh; min-height: 420px; }
img.visionneuse__vue { height: auto; }
.liens-scan { display: inline-flex; flex-wrap: wrap; gap: .3rem; vertical-align: middle; }

/* Lien à copier, file « À vérifier », journal d'activité, filtres de l'historique, photos depuis le téléphone */
.lien-copie { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .5rem 0; }
.lien-copie code { flex: 1 1 22rem; min-width: 0; overflow-wrap: anywhere; padding: .45rem .6rem; border: 1px solid var(--bord); border-radius: 6px; background: var(--surface-2); font-size: .85rem; }
.motifs { margin: 0; padding-left: 1.1rem; }
.journal__filtres label { min-width: 9rem; }
.journal__date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.journal__details { font-size: .85rem; overflow-wrap: anywhere; max-width: 36rem; }
.journal__cle { color: var(--texte-2); }
.filtres-historique { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; margin: 0 0 .8rem; }
.filtres-historique label { display: grid; gap: .2rem; font-size: .85rem; }
.filtres-historique label:first-child { flex: 1 1 16rem; }
.filtres-historique input, .filtres-historique select { font: inherit; padding: .4rem .5rem; border: 1px solid var(--bord); border-radius: 6px; background: var(--surface); color: var(--texte); }
.photo { margin-top: .8rem; display: grid; justify-items: center; gap: .6rem; }
.photo__bouton { display: inline-flex; align-items: center; gap: .5rem; }
.photos { width: 100%; border: 1px dashed var(--bord-fort); border-radius: 10px; padding: .8rem; background: var(--surface-2); }
.photos__titre { margin: 0 0 .5rem; font-weight: 600; }
.photos__pages { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 .5rem; padding: 0; list-style: none; }
.photos__pages li { display: grid; gap: .3rem; justify-items: center; }
.photos__pages img { width: 110px; height: 150px; object-fit: contain; background: #fff; border: 1px solid var(--bord); border-radius: 6px; }
@media (min-width: 900px) { .photo__bouton { opacity: .85; } }
