/* IBM Plex, auto-hébergée (aucune ressource externe : CSP default-src 'self').
   La même police que les PDF exportés : l'écran et le dossier se ressemblent. */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(/polices/plex-sans/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url(/polices/plex-sans/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url(/polices/plex-sans/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(/polices/plex-mono/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(/polices/plex-mono/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }

/* ─── Jetons ────────────────────────────────────────────────────────────────
   Neutres froids, un bleu d'action, et une sémantique d'état en cinq teintes
   stables partout : vert = fait, bleu = en cours, ambre = à faire,
   rouge = bloquant, gris = sans objet. Le rail est tonal : la même famille de
   gris que le contenu, un cran plus sombre. */
:root {
  color-scheme: light;
  --bg: #f3f4f7; --surface: #ffffff; --surface-2: #f7f8fa; --surface-3: #eceef2;
  --border: #e2e5ea; --border-2: #c7cdd6;
  --text: #171b22; --text-2: #4b5564; --text-3: #68717f;
  --accent: #1f5bd1; --accent-soft: #e6eefc; --accent-2: #1646a8; --on-accent: #ffffff;
  --green: #197a46; --green-soft: #dcf3e5; --amber: #94570a; --amber-soft: #fcefd3;
  --red: #c0352b; --red-soft: #fbe3df; --info: #596880; --info-soft: #e6eaf0;
  --purple: #6a4dc0; --purple-soft: #ebe6fa; --teal: #0f776f; --teal-soft: #d6f1ec;
  --rail-bg: #e9ecf1; --rail-surf: #ffffff; --rail-text: #4b5564; --rail-ink: #171b22; --rail-border: #dce0e6;
  --shadow: 0 1px 2px rgba(23,27,34,.06), 0 8px 24px rgba(23,27,34,.08);
  --shadow-sm: 0 1px 2px rgba(23,27,34,.08);
  --rayon: 8px; --rayon-sm: 6px;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1116; --surface: #161a21; --surface-2: #12151b; --surface-3: #1f242d;
    --border: #272d37; --border-2: #38404c;
    --text: #e8ecf2; --text-2: #a6afbd; --text-3: #818a99;
    --accent: #6ea8ff; --accent-soft: #1d3357; --accent-2: #93c0ff; --on-accent: #0a1526;
    --green: #52c987; --green-soft: #16402c; --amber: #e3a640; --amber-soft: #443212;
    --red: #f0736a; --red-soft: #47201c; --info: #97a6bd; --info-soft: #28344a;
    --purple: #b39cff; --purple-soft: #2e2550; --teal: #4ccdbf; --teal-soft: #143d38;
    --rail-bg: #0a0d12; --rail-surf: #1b2029; --rail-text: #8a93a3; --rail-ink: #f1f4f8; --rail-border: #1b212b;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.4);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1116; --surface: #161a21; --surface-2: #12151b; --surface-3: #1f242d;
  --border: #272d37; --border-2: #38404c;
  --text: #e8ecf2; --text-2: #a6afbd; --text-3: #818a99;
  --accent: #6ea8ff; --accent-soft: #1d3357; --accent-2: #93c0ff; --on-accent: #0a1526;
  --green: #52c987; --green-soft: #16402c; --amber: #e3a640; --amber-soft: #443212;
  --red: #f0736a; --red-soft: #47201c; --info: #97a6bd; --info-soft: #28344a;
  --purple: #b39cff; --purple-soft: #2e2550; --teal: #4ccdbf; --teal-soft: #143d38;
  --rail-bg: #0a0d12; --rail-surf: #1b2029; --rail-text: #8a93a3; --rail-ink: #f1f4f8; --rail-border: #1b212b;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.4);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
}

/* ─── Base ──────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; caret-color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--surface-3); padding: 0 .3em; border-radius: 3px; }
h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }

/* ─── Coque : rail, barre, bandeau ──────────────────────────────────────── */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
.rail { background: var(--rail-bg); border-right: 1px solid var(--rail-border); color: var(--rail-text); padding: 14px 10px 12px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: env(safe-area-inset-top, 0px); height: 100vh; overflow-y: auto; }
.marque { display: flex; align-items: center; gap: 10px; padding: 4px 8px 6px; color: var(--rail-ink); }
.marque-logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; font: 600 13px var(--mono); color: #fff; flex: none; box-shadow: inset 0 -1px 0 rgba(0,0,0,.18); }
.marque b { display: block; font-size: 14px; font-weight: 600; line-height: 1.2; }
.marque span { font-size: 11.5px; color: var(--rail-text); }
.nav-groupe { display: flex; flex-direction: column; gap: 1px; }
.nav-titre { font-size: 11px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; padding: 4px 10px 5px; color: var(--rail-text); opacity: .85; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: var(--rail-text); padding: 6px 10px; border-radius: 7px; cursor: pointer; text-align: left; font-size: 13.5px; transition: background .12s, color .12s; }
.nav-item:hover { background: color-mix(in srgb, var(--rail-ink) 6%, transparent); color: var(--rail-ink); }
.nav-item[aria-current="page"] { background: var(--rail-surf); color: var(--rail-ink); font-weight: 500; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--rail-border); }
.nav-item[aria-current="page"] svg { stroke: var(--accent); }
.nav-item svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.nav-item .compte { margin-left: auto; font: 500 11px var(--mono); font-variant-numeric: tabular-nums; color: var(--rail-text); background: color-mix(in srgb, var(--rail-ink) 7%, transparent); padding: 1px 6px; border-radius: 9px; min-width: 20px; text-align: center; }
.nav-item .compte.alerte { background: var(--red); color: #fff; }
.rail-pied { margin-top: auto; padding: 8px 10px 0; font: 400 11px var(--mono); color: var(--rail-text); border-top: 1px solid var(--rail-border); }

.principal { min-width: 0; display: flex; flex-direction: column; }
.barre { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px; padding: 9px 24px; flex-wrap: wrap; }
.recherche { position: relative; flex: 1 1 260px; max-width: 440px; }
.recherche input { width: 100%; border: 1px solid var(--border); background: var(--surface-2); border-radius: 7px; padding: 7px 56px 7px 32px; transition: border-color .12s, background .12s; }
.recherche input::placeholder { color: var(--text-3); }
.recherche input:focus { border-color: var(--accent); background: var(--surface); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.recherche > svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; stroke: var(--text-3); fill: none; stroke-width: 2; pointer-events: none; }
.kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 500 11px var(--mono); color: var(--text-3); border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; line-height: 16px; background: var(--surface); pointer-events: none; }
.recherche input:focus ~ .kbd { display: none; }
.suggestions { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow); max-height: 360px; overflow-y: auto; padding: 4px; z-index: 6; }
.suggestions button { display: flex; gap: 10px; width: 100%; background: none; border: 0; padding: 7px 10px; border-radius: 6px; text-align: left; cursor: pointer; align-items: baseline; }
.suggestions button:hover, .suggestions button:focus-visible { background: var(--accent-soft); outline: none; }
.suggestions-titre { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 6px 10px 2px; }
.accent { color: var(--accent); }
.marge-auto { margin-left: auto; }
.contexte { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.contexte .point { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); flex: none; }
.contexte.local .point { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.contexte b { font-weight: 500; color: var(--text); }
.contexte .sep { color: var(--border-2); }
.utilisateur { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.utilisateur label { font-size: 12px; color: var(--text-3); }
.utilisateur select { border: 1px solid var(--border); background: var(--surface); border-radius: 7px; padding: 5px 8px; max-width: 250px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-2); display: grid; place-items: center; font: 600 12px var(--sans); flex: none; }
.menu-compte { display: flex; align-items: center; gap: 10px; }
.menu-compte .qui { display: flex; flex-direction: column; line-height: 1.2; font-size: 13px; text-align: right; }
.menu-compte .qui span { font-size: 11.5px; color: var(--text-3); }
.bandeau { display: flex; align-items: center; gap: 10px; background: var(--amber-soft); color: var(--amber); font-size: 12.5px; padding: 7px 24px; border-bottom: 1px solid color-mix(in srgb, var(--amber) 20%, var(--border)); }
.bandeau.bloquant { background: var(--red-soft); color: var(--red); border-bottom-color: color-mix(in srgb, var(--red) 25%, var(--border)); }
.bandeau svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.vue { padding: 22px 24px 56px; display: flex; flex-direction: column; gap: 20px; max-width: 1360px; width: 100%; }
.entete { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.entete p { margin: 4px 0 0; color: var(--text-2); max-width: 70ch; }
.fil { font-size: 12.5px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fil button { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.fil button svg, .puce svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; }
.puce svg { color: var(--amber); display: inline-block; }

/* ─── Panneaux, tuiles, tableaux ────────────────────────────────────────── */
.panneau { background: var(--surface); border: 1px solid var(--border); border-radius: var(--rayon); box-shadow: var(--shadow-sm); min-width: 0; }
.panneau-tete { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.panneau-tete h2 { flex: 1; }
.panneau-tete .sous { flex-basis: 100%; margin: -2px 0 0; font-size: 12.5px; color: var(--text-3); }
.panneau-corps { padding: 14px 16px; }
.grille-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tuile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--rayon); padding: 12px 14px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-sm); transition: border-color .12s; }
.tuile:hover { border-color: var(--border-2); }
.tuile .val { font: 500 24px/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.tuile .val small { font-size: 13px; color: var(--text-3); }
.tuile .lib { font-size: 12.5px; color: var(--text-2); }
.tuile.rouge .val { color: var(--red); } .tuile.ambre .val { color: var(--amber); } .tuile.vert .val { color: var(--green); }

.defile { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr.cliquable { cursor: pointer; }
tr.cliquable:hover td { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.id { font: 500 13px var(--mono); white-space: nowrap; color: var(--accent); }
td.discret, .discret { color: var(--text-3); font-size: 12.5px; }

.pastille { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; padding: 1px 8px; border-radius: 10px; white-space: nowrap; background: var(--info-soft); color: var(--info); }
.pastille::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pastille.vert { background: var(--green-soft); color: var(--green); }
.pastille.ambre { background: var(--amber-soft); color: var(--amber); }
.pastille.rouge { background: var(--red-soft); color: var(--red); }
.pastille.bleu { background: var(--accent-soft); color: var(--accent); }
.pastille.violet { background: var(--purple-soft); color: var(--purple); }
.puce { display: inline-block; font: 500 12px var(--mono); padding: 1px 7px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; margin: 2px 4px 2px 0; white-space: nowrap; }
.puce:hover { border-color: var(--accent); color: var(--accent); }
.puce.vert { border-color: color-mix(in srgb, var(--green) 45%, var(--border)); color: var(--green); }
.puce.ambre { border-color: color-mix(in srgb, var(--amber) 45%, var(--border)); color: var(--amber); }
.puce.rouge { border-color: color-mix(in srgb, var(--red) 45%, var(--border)); color: var(--red); background: var(--red-soft); }
.puce.bleu { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--accent); }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-2); background: var(--surface); padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 500; font-size: 13px; white-space: nowrap; box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--text-3) 60%, var(--border-2)); }
.btn.plein { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.plein:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn.petit { font-size: 12px; padding: 3px 8px; }
.btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.raison { font-size: 12px; color: var(--text-3); }

.onglets { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; padding: 0 6px; }
.onglet { background: none; border: 0; padding: 9px 12px; cursor: pointer; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; transition: color .12s; }
.onglet:hover { color: var(--text); }
.onglet[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.onglet .compte { font: 500 11px var(--mono); color: var(--text-3); margin-left: 4px; }

.segment { display: inline-flex; background: var(--surface-3); border-radius: 8px; padding: 2px; gap: 2px; }
.segment button { border: 0; background: none; padding: 5px 12px; border-radius: 6px; font-weight: 500; font-size: 13px; color: var(--text-2); cursor: pointer; transition: background .12s, color .12s; }
.segment button:hover { color: var(--text); }
.segment button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.champs { display: grid; grid-template-columns: 170px 1fr; gap: 0; }
.champs > div { padding: 8px 0; border-bottom: 1px solid var(--border); }
.champs > div:nth-last-child(-n+2) { border-bottom: 0; }
.champs .cle { color: var(--text-3); font-size: 12.5px; padding-right: 12px; }

.chaine { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.chaine-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--rayon); padding: 10px; min-height: 90px; display: flex; flex-direction: column; gap: 6px; }
.chaine-col h3 { display: flex; justify-content: space-between; }
.noeud { border: 1px solid var(--border); background: var(--surface); border-radius: var(--rayon-sm); padding: 6px 8px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 1px; width: 100%; transition: border-color .12s; }
.noeud:hover { border-color: var(--accent); }
.noeud > b { font: 500 12.5px var(--mono); }
.noeud > span { font-size: 12px; color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.noeud.trou { border-style: dashed; border-color: var(--red); background: var(--red-soft); cursor: default; }
.noeud.trou b { color: var(--red); }

.etapes { display: flex; gap: 0; overflow-x: auto; padding-bottom: 2px; }
.etape { flex: 1 0 118px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-3); position: relative; padding-right: 8px; }
.etape::before { content: ""; height: 4px; border-radius: 2px; background: var(--surface-3); }
.etape.faite::before { background: var(--green); } .etape.courante::before { background: var(--accent); }
.etape.courante { color: var(--text); font-weight: 600; } .etape.faite { color: var(--text-2); }

.liste { display: flex; flex-direction: column; }
.ligne-tache { display: flex; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); align-items: flex-start; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; width: 100%; transition: background .12s; }
.ligne-tache:hover { background: var(--surface-2); }
.ligne-tache:last-child { border-bottom: 0; }
.ligne-tache.suite .corps > b { color: var(--accent); font-weight: 500; }
.ligne-tache .corps { flex: 1; min-width: 0; }
.ligne-tache .corps > b { font-weight: 500; display: block; }
.ligne-tache .corps > span { font-size: 12.5px; color: var(--text-3); }
.groupe-titre { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 16px 5px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.groupe-titre .compte { font: 500 11.5px var(--mono); }
.commit { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 8px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.commit:last-child { border-bottom: 0; }
.commit .h { font: 500 12px var(--mono); color: var(--accent); }
.commit .m { font-size: 12px; color: var(--text-3); grid-column: 2; }

.filtres { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.filtres input[type="search"] { border: 1px solid var(--border); background: var(--surface-2); border-radius: 7px; padding: 5px 10px; min-width: 0; flex: 0 1 260px; }
.filtres input[type="search"]:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.filtres label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text-2); }
select.sel { border: 1px solid var(--border); background: var(--surface); border-radius: 7px; padding: 5px 8px; max-width: 100%; }
.vide { padding: 28px 16px; text-align: center; color: var(--text-3); }
.note { font-size: 12.5px; color: var(--text-3); padding: 10px 16px; border-top: 1px solid var(--border); }

.droit-oui { color: var(--green); font-weight: 600; } .droit-non { color: var(--text-3); } .droit-cond { color: var(--amber); font-weight: 500; }

/* ─── Tableau de bord ────────────────────────────────────────────────────
   Trois lectures d'un même dossier. Les barres segmentées disent, par pilier,
   la part faite, en cours, à faire et bloquante ; chaque ligne mène à l'écran
   qui agit. */
.tdb { display: flex; flex-direction: column; gap: 20px; }
.tdb.fondu { animation: fondu .18s cubic-bezier(.2,.7,.2,1); }
@keyframes fondu { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tdb-tete .lecture-note { margin: 4px 0 0; color: var(--text-2); max-width: 72ch; }
.piliers { display: grid; grid-template-columns: minmax(0, 1fr) 332px; }
.piliers > .lignes { min-width: 0; }
.pilier { display: grid; grid-template-columns: minmax(260px, 1.1fr) minmax(0, 1fr) 170px 16px; gap: 14px; align-items: center; width: 100%; padding: 9px 16px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; cursor: pointer; color: inherit; transition: background .12s; }
.pilier:hover { background: var(--surface-2); }
.pilier:last-child { border-bottom: 0; }
.pilier .nom { min-width: 0; }
.pilier .nom > b { font-weight: 500; display: block; }
.pilier .nom > span { font-size: 12px; color: var(--text-3); display: block; line-height: 1.35; }
.pilier .chiffre { font: 500 13px var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pilier .chiffre small { font-weight: 400; color: var(--text-3); font-size: 12px; }
.pilier .chiffre.rouge { color: var(--red); } .pilier .chiffre.vert { color: var(--green); } .pilier .chiffre.ambre { color: var(--amber); }
.pilier .fleche svg { width: 14px; height: 14px; stroke: var(--text-3); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.pilier:hover .fleche svg { stroke: var(--accent); }
.barre-seg { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-3); gap: 2px; min-width: 0; }
.barre-seg i { display: block; height: 100%; min-width: 3px; transition: filter .15s; }
.barre-seg i.vert { background: var(--green); } .barre-seg i.bleu { background: var(--accent); } .barre-seg i.ambre { background: var(--amber); } .barre-seg i.rouge { background: var(--red); } .barre-seg i.gris { background: var(--border-2); }
.pilier:hover .barre-seg i { filter: brightness(1.1); }
.legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); padding: 8px 16px; border-top: 1px solid var(--border); }
.legende i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.legende i.vert { background: var(--green); } .legende i.bleu { background: var(--accent); } .legende i.ambre { background: var(--amber); } .legende i.rouge { background: var(--red); } .legende i.gris { background: var(--border-2); }
.cote { border-left: 1px solid var(--border); padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 16px; background: var(--surface-2); border-radius: 0 var(--rayon) var(--rayon) 0; }
.cote h3 { margin-bottom: 4px; }
.fait { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; border-bottom: 1px dashed var(--border); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; color: inherit; cursor: default; }
button.fait { cursor: pointer; }
button.fait:hover .k { color: var(--text); }
.fait .fleche svg { width: 13px; height: 13px; stroke: var(--text-3); fill: none; stroke-width: 2; display: block; }
button.fait:hover .fleche svg { stroke: var(--accent); }
.fait:last-child { border-bottom: 0; }
.fait .k { color: var(--text-2); flex: 1 1 auto; min-width: 0; }
.fait .v { font-weight: 500; text-align: right; flex: 0 0 auto; }
.fait .v.mono { font-size: 12.5px; }
button.lien { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
button.lien:hover { text-decoration-color: var(--accent); }
.fait button.lien { text-decoration: none; }
.echeance { display: grid; grid-template-columns: 66px minmax(0, 1fr) auto; gap: 12px; padding: 10px 16px; border: 0; border-bottom: 1px solid var(--border); width: 100%; background: none; text-align: left; cursor: pointer; color: inherit; align-items: start; transition: background .12s; }
.echeance:hover { background: var(--surface-2); }
.echeance:last-child { border-bottom: 0; }
.echeance .quand { display: flex; flex-direction: column; line-height: 1.2; }
.echeance .quand > b { font: 500 14px var(--mono); font-variant-numeric: tabular-nums; color: var(--text); }
.echeance .quand > span { font: 400 11.5px var(--mono); color: var(--text-3); margin-top: 2px; }
.echeance.retard .quand > b { color: var(--red); } .echeance.proche .quand > b { color: var(--amber); }
.echeance .corps { min-width: 0; }
.echeance .corps > b { font-weight: 500; display: block; }
.echeance .corps > span { font-size: 12.5px; color: var(--text-3); }
.flux { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.flux-col { border-right: 1px solid var(--border); padding: 10px 12px 12px; min-height: 150px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.flux-col:last-child { border-right: 0; }
.flux-col h3 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.flux-col h3 .compte { font: 500 12px var(--mono); color: var(--text); }
.flux-col .attendu { font-size: 11.5px; color: var(--text-3); margin: -4px 0 4px; text-transform: none; letter-spacing: 0; }
.flux-col .plus { background: none; border: 0; padding: 2px 0; text-align: left; color: var(--accent); font-size: 12.5px; cursor: pointer; font-weight: 500; }
.flux-col .rien { font-size: 12.5px; color: var(--text-3); padding: 6px 0; }

/* ─── Superpositions ────────────────────────────────────────────────────── */
.voile { position: fixed; inset: 0; background: rgba(10,13,18,.5); display: grid; place-items: center; padding: 16px; z-index: 20; backdrop-filter: blur(2px); }
.modale { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; border: 1px solid var(--border); }
.modale header { padding: 16px 18px 0; display: flex; flex-direction: column; gap: 4px; }
.modale header p { margin: 0; color: var(--text-2); font-size: 13px; }
.modale form { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.modale label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.modale input, .modale select, .modale textarea { border: 1px solid var(--border-2); border-radius: 7px; padding: 7px 10px; background: var(--surface); font-weight: 400; font-size: 14px; }
.modale input:focus, .modale select:focus, .modale textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.modale .avertir { background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 8px 10px; font-size: 12px; color: var(--text-3); }
.toast { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); right: 18px; left: 18px; margin-left: auto; max-width: 440px; background: var(--text); color: var(--bg); border-radius: 9px; padding: 11px 14px; box-shadow: var(--shadow); z-index: 30; font-size: 13px; }
.toast code { background: rgba(127,127,127,.25); color: inherit; }

/* ─── Connexion ─────────────────────────────────────────────────────────── */
.accueil { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.carte { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; width: 100%; max-width: 380px; padding: 24px 22px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); }
.carte .marque { color: var(--text); padding: 0; }
.carte .marque span { color: var(--text-3); }
.carte form { display: flex; flex-direction: column; gap: 12px; }
.carte label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.carte input { border: 1px solid var(--border-2); border-radius: 7px; padding: 8px 10px; background: var(--surface); font-size: 15px; }
.carte input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.carte input.code { font: 500 22px var(--mono); letter-spacing: .3em; text-align: center; }
.carte p { margin: 0; color: var(--text-2); font-size: 13px; }
.carte .qr { align-self: center; border-radius: 8px; background: #fff; padding: 6px; }
.secret { font: 500 13px var(--mono); word-break: break-all; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; user-select: all; }
.erreur { color: var(--red); font-size: 13px; }
.carte .btn { justify-content: center; padding: 9px 12px; }

/* ─── Lecture d'un document ─────────────────────────────────────────────── */
.document { padding: 8px 24px 28px; max-width: 78ch; line-height: 1.6; }
.document h1 { font-size: 22px; margin: 18px 0 8px; }
.document h2 { font-size: 18px; margin: 26px 0 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.document h3 { font-size: 14.5px; text-transform: none; letter-spacing: 0; color: var(--text); margin: 20px 0 6px; }
.document table { font-size: 13px; margin: 10px 0; display: block; overflow-x: auto; }
.document th { position: static; white-space: normal; }
.document td { vertical-align: top; }
.document blockquote { margin: 12px 0; padding: 8px 14px; border-left: 1px solid var(--accent); background: var(--surface-2); color: var(--text-2); }
.document pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 10px; overflow-x: auto; }
.document a[data-chemin] { color: var(--text-2); text-decoration: underline dotted; cursor: default; }
.document h1, .document h2, .document h3, .document h4 { scroll-margin-top: 120px; }
.alerte-bloquante { background: var(--red-soft); color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 35%, var(--border)); border-radius: var(--rayon); padding: 10px 14px; font-size: 13px; }
.chargement { padding: 40px 16px; text-align: center; color: var(--text-3); }
.chargement::before { content: ""; display: block; width: 18px; height: 18px; margin: 0 auto 10px; border-radius: 50%; border: 2px solid var(--border-2); border-top-color: var(--accent); animation: tourner .8s linear infinite; }
@keyframes tourner { to { transform: rotate(360deg); } }

/* ─── Progression : barre fine en haut pendant un appel réseau ─────────── */
.progression { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 40; background: var(--accent-soft); pointer-events: none; }
.progression-barre { height: 100%; width: 35%; background: var(--accent); border-radius: 0 2px 2px 0; animation: glisser 1.1s ease-in-out infinite; transition: width .2s; }
.progression[data-valeur] .progression-barre { animation: none; width: var(--valeur, 0%); }
@keyframes glisser { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.recherche::after { content: ""; position: absolute; right: 36px; top: 50%; width: 12px; height: 12px; margin-top: -7px; border-radius: 50%; border: 2px solid var(--border-2); border-top-color: var(--accent); animation: tourner .7s linear infinite; opacity: 0; transition: opacity .15s; }
.recherche.en-cours::after { opacity: 1; }

/* ─── Aide : sigles et références (docs/42 de mediscrim) ────────────────── */
.terme { text-decoration: underline dotted var(--text-3); text-underline-offset: 3px; cursor: help; }
.terme:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 2px; }
.pop-terme { position: fixed; z-index: 40; width: min(420px, calc(100vw - 24px)); max-height: min(60vh, 460px); overflow-y: auto; background: var(--surface); color: var(--text); border: 1px solid var(--border-2); border-radius: 10px; box-shadow: var(--shadow); padding: 12px 14px; font-size: 13px; line-height: 1.45; }
.pop-terme h4 { margin: 0 0 2px; font-size: 13.5px; }
.pop-terme .nature { display: inline-block; font-size: 11px; color: var(--text-3); margin-bottom: 6px; }
.pop-terme .corps { white-space: pre-line; color: var(--text-2); }
.pop-terme .actions { margin-top: 10px; }
.texte-officiel { white-space: pre-line; font-size: 13.5px; line-height: 1.55; }
.glossaire-entree { border-top: 1px solid var(--border); padding: 10px 16px; }
.glossaire-entree summary { cursor: pointer; }
.glossaire-entree .corps { white-space: pre-line; color: var(--text-2); margin-top: 6px; font-size: 13px; }

/* ─── Rédaction (lot C18-A5) ────────────────────────────────────────────── */
.redaction { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.redaction .avertir { background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 8px 10px; font-size: 12.5px; color: var(--text-2); }
.redaction-grille { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.red-col { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-2); font-weight: 500; min-width: 0; }
.red-texte { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; min-height: 64vh; padding: 10px 12px; border: 1px solid var(--border-2); border-radius: 7px; background: var(--surface); resize: vertical; tab-size: 2; width: 100%; }
.conflit .red-texte { min-height: 30vh; background: var(--surface-2); }
.red-apercu { border: 1px solid var(--border); border-radius: 7px; max-height: 64vh; min-height: 64vh; overflow-y: auto; padding: 4px 16px 16px; max-width: none; font-weight: 400; color: var(--text); }
.red-motif { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.red-motif input { border: 1px solid var(--border-2); border-radius: 7px; padding: 7px 10px; background: var(--surface); font-weight: 400; font-size: 14px; }

/* ─── Adaptation ────────────────────────────────────────────────────────── */
/* Utilitaires : remplacent les styles en ligne du script (une déclaration ou deux, nommées par leur effet). */
.t12 { font-size: 12px; } .t125 { font-size: 12.5px; } .t115 { font-size: 11.5px; }
.mt4 { margin-top: 4px; } .mt6 { margin-top: 6px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt14 { margin-top: 14px; } .mt16 { margin-top: 16px; } .mb6 { margin-bottom: 6px; }
.statique { cursor: default; } .nowrap { white-space: nowrap; } .haut { vertical-align: top; } .moyen { font-weight: 500; } .centre { text-align: center; } .fin { justify-content: flex-end; }
.largeur-auto { width: auto; } .texte2 { color: var(--text-2); } .rangee { flex-direction: row; align-items: center; gap: 8px; } .colonne16 { display: flex; flex-direction: column; gap: 16px; }
.lmin120 { min-width: 120px; } .lmin140 { min-width: 140px; } .lmin160 { min-width: 160px; } .lmin200 { min-width: 200px; } .lmin220 { min-width: 220px; } .lmin240 { min-width: 240px; } .lmin260 { min-width: 260px; } .lmin300 { min-width: 300px; } .lmin320 { min-width: 320px; } .lmin360 { min-width: 360px; }
/* Tri par colonne : l'en-tête est un bouton, le chevron ne s'affiche que sur la colonne triée. */
th button.tri { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
th button.tri:hover, th[aria-sort] button.tri { color: var(--text); }
th button.tri svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2; opacity: 0; transition: transform .12s; }
th[aria-sort] button.tri svg { opacity: 1; }
th[aria-sort="descending"] button.tri svg { transform: rotate(180deg); }
tr.active td { background: var(--accent-soft); }
tr.curseur td { background: var(--surface-2); }
tr.curseur td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
/* Volet : la fiche à côté de la liste, collée sous la barre. */
.vue:has(.avec-volet) { max-width: 1600px; }
.avec-volet { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 20px; align-items: start; }
.avec-volet .liste { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.volet { position: sticky; top: 64px; max-height: calc(100vh - 84px); overflow: auto; display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--rayon); box-shadow: var(--shadow-sm); padding: 14px 16px 16px; }
.volet .panneau { border: 0; box-shadow: none; border-radius: 0; }
.volet .onglets { padding: 0; }
.volet h1 { font-size: 15px; }
.volet .chaine { grid-template-columns: 1fr 1fr; }
.volet .champs { grid-template-columns: 130px 1fr; }
.volet-tete { justify-content: space-between; }
.volet-actions { display: inline-flex; gap: 10px; }
.volet-actions button { color: var(--text-3); }
.volet-actions button:hover { color: var(--accent); }
.volet-actions svg { width: 15px; height: 15px; }
.ecarts { display: flex; flex-direction: column; gap: 6px; }
.ecarts .discret { font-size: 12px; }
.panneau-tete select { border: 1px solid var(--border-2); background: var(--surface); color: var(--text); border-radius: 6px; padding: 3px 6px; font: inherit; font-size: 12.5px; }
/* Matrice exigences × tests : première colonne collée, en-têtes de colonne verticaux, ligne des totaux. */
.matrice table { width: auto; min-width: 100%; }
.matrice th:first-child, .matrice td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.matrice th:first-child { z-index: 2; background: var(--surface-2); }
.matrice th.col { height: 64px; vertical-align: bottom; padding: 6px 0; width: 24px; min-width: 24px; text-align: center; }
.matrice th.col button { all: unset; cursor: pointer; writing-mode: vertical-rl; transform: rotate(180deg); font: 500 11px var(--mono); color: var(--text-2); display: inline-block; }
.matrice th.col button:hover { color: var(--accent); }
.matrice th.col.trou button { color: var(--red); }
.matrice td.c { padding: 0; width: 24px; height: 28px; text-align: center; vertical-align: middle; border-left: 1px solid var(--surface-3); }
.matrice td.c.oui::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.matrice tr.total td { font-size: 11.5px; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border-2); }
.matrice tr.total td.c.trou { color: var(--red); background: var(--red-soft); font-weight: 600; }
.matrice td.id { font-size: 12px; }
@media (max-width: 1100px) { .avec-volet { grid-template-columns: 1fr; } .volet { position: static; max-height: none; } .piliers { grid-template-columns: 1fr; } .cote { border-left: 0; border-top: 1px solid var(--border); border-radius: 0 0 var(--rayon) var(--rayon); } .flux { grid-template-columns: repeat(3, minmax(0, 1fr)); } .flux-col:nth-child(3) { border-right: 0; } .flux-col:nth-child(n+4) { border-top: 1px solid var(--border); } }
@media (max-width: 1000px) { .grille-2 { grid-template-columns: 1fr; } .chaine { grid-template-columns: 1fr 1fr; } .redaction-grille { grid-template-columns: minmax(0, 1fr); } .red-texte, .red-apercu { min-height: 40vh; } .contexte .discret { display: none; } }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 8px 12px; gap: 6px; align-items: center; border-right: 0; border-bottom: 1px solid var(--rail-border); }
  .marque span, .nav-titre, .rail-pied { display: none; }
  .nav-groupe { flex-direction: row; gap: 2px; }
  .nav-item { white-space: nowrap; }
  .barre { position: static; padding: 8px 16px; gap: 10px; }
  .bandeau { padding-inline: 16px; }
  .kbd { display: none; }
  .recherche { flex-basis: 100%; max-width: none; }
  .recherche input { padding-right: 36px; }
  .contexte { order: 3; flex: 1 1 auto; white-space: nowrap; }
  .contexte > span:nth-child(2), .contexte .sep { display: none; }
  .utilisateur { order: 4; margin-left: auto; }
  .marque b { white-space: nowrap; }
  .flux-col { min-height: 0; }
  .cote { background: var(--surface); }
  .menu-compte .qui { display: none; }
  .vue { padding: 16px 16px 40px; }
  .champs { grid-template-columns: 1fr; } .champs .cle { border-bottom: 0 !important; padding-bottom: 0; }
  .utilisateur label { display: none; }
  .pilier { grid-template-columns: minmax(0, 1fr) auto 16px; gap: 6px 12px; }
  .pilier .barre-seg { grid-column: 1 / -1; }
  .pilier .barre-vide { display: none; }
  .flux { grid-template-columns: 1fr 1fr; } .flux-col { border-right: 0; } .flux-col:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 520px) { .chaine { grid-template-columns: 1fr; } .flux { grid-template-columns: 1fr; } .echeance { grid-template-columns: 56px minmax(0, 1fr); } .echeance .pastille { grid-column: 2; justify-self: start; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } .progression-barre { width: 100%; margin-left: 0; opacity: .7; } }
