/* Opérations fixes — styles du site. Mise en page : navigation latérale (empilée sur téléphone) + zone de travail ;
   tableaux denses, état encodé par pastilles (vert / jaune / rouge). Aucune ressource externe (CSP stricte). */
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("vendor/polices/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("vendor/polices/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("vendor/polices/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("vendor/polices/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }

:root {
  --bg: #f3f5f6; --surface: #ffffff; --surface-2: #eaeef0; --ink: #16212b; --muted: #56626f; --line: #d9dfe3;
  --accent: #0b5e66; --accent-ink: #ffffff; --accent-soft: #dcedee;
  --ok-bg: #e1f1e4; --ok: #1d6a33; --jaune-bg: #fbefcf; --jaune: #7a5500; --rouge-bg: #fadfdb; --rouge: #a3271a;
  --test-bg: #7a5500; --test-ink: #ffffff;
  --f-titre: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --f-texte: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1519; --surface: #161e24; --surface-2: #1d272e; --ink: #e4eaee; --muted: #9aa7b2; --line: #2a363f;
    --accent: #5fb7bf; --accent-ink: #0b1a1d; --accent-soft: #16343a;
    --ok-bg: #163522; --ok: #93d6a5; --jaune-bg: #3a2f10; --jaune: #efcb69; --rouge-bg: #43201b; --rouge: #f2a092;
    --test-bg: #efcb69; --test-ink: #1d1600;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-texte); font-size: 14px; line-height: 1.5; font-variant-numeric: tabular-nums; }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
.gut { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.demarrage { padding: 2rem; color: var(--muted); }

.bandeau-test { background: var(--test-bg); color: var(--test-ink); text-align: center; font-size: 12.5px; font-weight: 600; padding: 5px 16px; letter-spacing: .02em; }

header.haut { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); padding-block: 10px; display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; }
.marque { display: flex; align-items: baseline; gap: 10px; margin-right: auto; min-width: 0; }
.marque h1 { font-family: var(--f-titre); font-weight: 600; font-size: 24px; margin: 0; line-height: 1; }
.marque span { color: var(--muted); font-size: 13px; }
.ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
select, input { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; color: var(--ink); }
.frais { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; background: var(--ok-bg); color: var(--ok); }
.frais.hist, .frais.vieux { background: var(--jaune-bg); color: var(--jaune); }
.qui { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.av { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 600; font-size: 12px; }

.coque { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; padding-block: 20px; max-width: 1440px; margin: 0 auto; }
nav.cote { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 76px; align-self: start; }
nav.cote h2 { font-family: var(--f-titre); font-weight: 600; font-size: 13px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 14px 10px 4px; }
nav.cote a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 13.5px; }
nav.cote a:hover { background: var(--surface-2); }
nav.cote a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
nav.cote .pre { display: none; color: var(--muted); }
main#principal { min-width: 0; }

.ph { display: flex; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.ph-texte { min-width: 0; flex: 1 1 420px; }
.ph h2 { font-family: var(--f-titre); font-weight: 600; font-size: 32px; line-height: 1.05; margin: 0; text-wrap: balance; }
.ph h2 .section { color: var(--muted); font-weight: 600; }
.ph p { margin: 4px 0 0; color: var(--muted); max-width: 75ch; }
.ph p.meta, p.meta { font-size: 12.5px; }
.ph-ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 5px 12px; cursor: pointer; font-size: 13px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tuile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tuile .l { font-size: 12px; color: var(--muted); }
.tuile .v { font-family: var(--f-titre); font-weight: 600; font-size: 30px; line-height: 1.1; }
.tuile .d { font-size: 12px; color: var(--muted); }
.tuile .d.hausse { color: var(--ok); } .tuile .d.baisse { color: var(--rouge); }

.carte { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.carte > .hd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.carte > .hd h3 { margin: 0; font-size: 15px; font-weight: 600; }
.carte > .hd .n { color: var(--muted); font-size: 12.5px; }
.grille2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.defile { overflow-x: auto; }

table.t { border-collapse: collapse; width: 100%; font-size: 13px; }
.t thead th { font-weight: 500; color: var(--muted); font-size: 12px; text-align: right; padding: 0; border-bottom: 1px solid var(--line); vertical-align: bottom; white-space: nowrap; }
.t thead th button.tri { all: unset; cursor: pointer; display: block; padding: 8px 10px; text-align: inherit; }
.t thead th button.tri:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.t thead th[aria-sort="ascending"], .t thead th[aria-sort="descending"] { color: var(--accent); }
.t th:first-child, .t td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.t tbody th, .t tfoot th { font-weight: 500; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; }
.t td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td.g { text-align: left; white-space: normal; }
.t tbody tr:hover > * { background: var(--surface-2); }
.t tr.focus > * { background: var(--accent-soft); }
.t tr.sous > * { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.t tr.sous > th { padding-left: 30px; }
.t tfoot th, .t tfoot td { font-weight: 600; border-top: 2px solid var(--ink); border-bottom: 0; }
.t tr.rangee-detail > td { padding: 0; position: static; text-align: left; white-space: normal; background: var(--surface-2); }
.t.compact { font-size: 12.5px; }
.t.compact th:first-child, .t.compact td:first-child { position: static; background: transparent; }
button.lien { all: unset; cursor: pointer; display: inline-flex; gap: 6px; align-items: baseline; }
button.lien:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fl { color: var(--accent); }
.pill { display: inline-block; min-width: 58px; padding: 1px 7px; border-radius: 5px; text-align: right; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.jaune { background: var(--jaune-bg); color: var(--jaune); }
.pill.rouge { background: var(--rouge-bg); color: var(--rouge); font-weight: 600; }
.neg { color: var(--rouge); }
.outils { display: flex; justify-content: flex-end; padding: 8px 14px 0; }
.note { font-size: 12.5px; color: var(--muted); padding: 10px 14px; display: flex; gap: 6px 16px; flex-wrap: wrap; }
.note.bordure { border-top: 1px solid var(--line); }
.detail { padding: 12px 14px; }
.detail h4 { margin: 0 0 8px; font-size: 14px; }

.legende { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.legende i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legende i.ok { background: var(--ok-bg); border: 1px solid var(--ok); }
.legende i.jaune { background: var(--jaune-bg); border: 1px solid var(--jaune); }
.legende i.rouge { background: var(--rouge-bg); border: 1px solid var(--rouge); }
table.hm { border-collapse: separate; border-spacing: 3px; width: 100%; font-size: 12.5px; table-layout: fixed; min-width: 780px; }
.hm thead th { font-weight: 500; color: var(--muted); font-size: 11.5px; line-height: 1.2; padding: 4px 2px; vertical-align: bottom; text-align: center; }
.hm thead th:first-child { width: 175px; text-align: left; }
.hm tbody th { font-weight: 400; text-align: left; padding: 6px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm tbody th a { color: var(--ink); text-decoration: none; }
.hm tbody th a:hover { text-decoration: underline; }
.hm td { text-align: center; border-radius: 5px; padding: 0; }
.hm td button { all: unset; cursor: pointer; display: block; width: 100%; padding: 6px 2px; text-align: center; }
.hm td button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 5px; }
.hm td.ok { background: var(--ok-bg); color: var(--ok); }
.hm td.jaune { background: var(--jaune-bg); color: var(--jaune); }
.hm td.rouge { background: var(--rouge-bg); color: var(--rouge); font-weight: 600; }
ul.alertes { list-style: none; margin: 0; padding: 0; }
ul.alertes li { border-bottom: 1px solid var(--line); }
ul.alertes li:last-child { border-bottom: 0; }
ul.alertes button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 14px; }
ul.alertes button:hover { background: var(--surface-2); }
ul.alertes button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
ul.alertes .sev { width: 4px; align-self: stretch; border-radius: 2px; background: var(--rouge); }
ul.alertes .tx { flex: 1; min-width: 0; }
ul.alertes .tx b { font-weight: 600; }
ul.alertes .sous-tx { display: block; color: var(--muted); font-size: 12px; }

.fiches { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.fiche { all: unset; box-sizing: border-box; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fiche:hover, .fiche:focus-visible { border-color: var(--accent); }
.fiche .l { font-size: 12.5px; color: var(--muted); }
.fiche .rangee { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fiche .v { font-family: var(--f-titre); font-weight: 600; font-size: 26px; line-height: 1; }
.fiche .s { font-size: 11.5px; color: var(--muted); }
svg.courbe { width: 100%; height: 36px; display: block; color: var(--accent); }
.puce { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.puce.ok { background: var(--ok-bg); color: var(--ok); }
.puce.jaune { background: var(--jaune-bg); color: var(--jaune); }
.puce.rouge { background: var(--rouge-bg); color: var(--rouge); }

.etat { padding: 24px 14px; color: var(--muted); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.etat.erreur { color: var(--rouge); }
.etat.erreur p { margin: 0; flex-basis: 100%; }
.roue { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: tourne 0.8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .roue { animation: none; } }

.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 8px; padding: 10px 16px; font-weight: 500; cursor: pointer; }
.bouton.sec { background: var(--surface); color: var(--ink); border-color: var(--line); }
.bouton.petit { padding: 4px 10px; font-size: 12.5px; font-weight: 400; }
.bouton[disabled] { opacity: .7; cursor: progress; }
.connexion { min-height: 80vh; display: grid; place-items: center; padding: 40px 16px; }
.connexion .boite { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 32px; max-width: 420px; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.connexion h1 { font-family: var(--f-titre); font-weight: 600; font-size: 40px; margin: 0 0 4px; line-height: 1; }
.connexion p { margin: 0; color: var(--muted); }
.connexion label { font-size: 13px; font-weight: 500; margin-top: 6px; }
.connexion .bouton { margin-top: 10px; }
.erreur-form { color: var(--rouge) !important; font-size: 13px; }
.ms { width: 16px; height: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.ms i { display: block; background: currentColor; }
footer { color: var(--muted); font-size: 12.5px; padding-block: 8px 28px; max-width: 1440px; margin: 0 auto; }

@media (max-width: 860px) {
  header.haut { position: static; }
  .coque { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-block: 12px; }
  nav.cote { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  nav.cote h2 { display: none; }
  nav.cote .pre { display: inline; }
  nav.cote a { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); }
  .grille2 { grid-template-columns: minmax(0, 1fr); }
  .ph h2 { font-size: 26px; }
  .marque span, .qui .nom { display: none; }
}
