/* Feuille de style commune — direction « Cockpit × Apricot » (planche validée le 16/09/2026).
   Thème sombre par défaut : fond en dégradé ardoise → noir, panneaux translucides, cyan pour
   l'action, rouge/orange réservés aux signaux qui appellent une décision. Thème clair en option
   (Mon compte → Apparence), mémorisé dans le navigateur ; la barre latérale reste sombre. */
:root {
  --bg-grad: radial-gradient(1200px 640px at 14% -10%, rgba(165,185,200,0.38), rgba(165,185,200,0) 62%),
             radial-gradient(760px 520px at 70% 40%, rgba(120,140,155,0.14), rgba(120,140,155,0) 65%),
             radial-gradient(820px 500px at 108% 112%, rgba(25,182,198,0.16), rgba(25,182,198,0) 60%),
             linear-gradient(160deg, #2a353d 0%, #161f25 46%, #0a0f13 100%);
  --bg-solid: #131b21;
  --surface: rgba(255,255,255,0.06); --surface-solid: #1a232a; --surface-2: rgba(0,0,0,0.25);
  --ink: #e6edf0; --muted: #8ea3ae; --faint: #5f7480;
  --line: rgba(255,255,255,0.11); --line-soft: rgba(255,255,255,0.07);
  --accent: #19b6c6; --accent-ink: #06171a; --accent-soft: rgba(25,182,198,0.16); --accent-text: #6cc9d8;
  --ok: #3fbf7f; --warn: #e8a33d; --danger: #ef5d5d;
  --ok-soft: rgba(63,191,127,0.14); --warn-soft: rgba(232,163,61,0.16); --danger-soft: rgba(239,93,93,0.16);
  --shadow: 0 10px 30px rgba(0,0,0,0.30);
  --nav-bg: rgba(5,9,12,0.42); --nav-ink: #a9bcc6; --nav-active: rgba(25,182,198,0.16); --nav-line: rgba(255,255,255,0.07);
  --radius: 3px;
  --mono: Consolas, "Cascadia Mono", "Courier New", monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg-grad: radial-gradient(1200px 640px at 14% -10%, rgba(255,255,255,0.9), rgba(255,255,255,0) 62%),
             radial-gradient(820px 500px at 108% 112%, rgba(25,182,198,0.10), rgba(25,182,198,0) 60%),
             linear-gradient(160deg, #eef1f4 0%, #e3e8ec 60%, #d9dfe5 100%);
  --bg-solid: #e8ecf0;
  --surface: rgba(255,255,255,0.78); --surface-solid: #ffffff; --surface-2: rgba(255,255,255,0.9);
  --ink: #1b2430; --muted: #5b6675; --faint: #8592a0;
  --line: rgba(20,30,40,0.14); --line-soft: rgba(20,30,40,0.08);
  --accent: #0f8a99; --accent-ink: #ffffff; --accent-soft: rgba(15,138,153,0.12); --accent-text: #0f7d8b;
  --ok: #2f9e6b; --warn: #c97d1a; --danger: #d64545;
  --ok-soft: rgba(47,158,107,0.12); --warn-soft: rgba(201,125,26,0.14); --danger-soft: rgba(214,69,69,0.12);
  --shadow: 0 8px 24px rgba(20,30,40,0.10);
  --nav-bg: #1b2530; --nav-ink: #b7c4cd; --nav-active: rgba(25,182,198,0.22); --nav-line: rgba(255,255,255,0.09);
  color-scheme: light;
}
:root[data-theme="light"] .nav .search input { background: rgba(0,0,0,0.3); }
:root[data-theme="light"] .topbar .chip svg, :root[data-theme="light"] .nav a.active svg { color: #6cc9d8; }
:root[data-theme="light"] .nav .me .avatar, :root[data-theme="light"] .topbar .avatar { color: #6cc9d8; }
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0; min-height: 100vh; background: var(--bg-grad) fixed, var(--bg-solid); color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif; line-height: 1.5;
}
a { color: var(--accent-text); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
svg.ic { width: 15px; height: 15px; flex: none; vertical-align: -2px; }

/* ---------- Barre supérieure ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: 48px; padding: 0 16px; background: var(--nav-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--nav-line); color: #e6edf0; }
.topbar .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; min-width: 0; }
.topbar .brand .app { font-weight: 700; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.topbar .brand .app i { color: var(--accent); font-style: normal; }
.topbar .sep { width: 1px; height: 18px; background: var(--nav-line); }
.topbar .chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #a9bcc6; white-space: nowrap; }
.topbar .chip svg { color: var(--accent-text); }
.topbar .spacer { flex: 1; }
.topbar a.link { color: #a9bcc6; text-decoration: none; font-size: 12px; white-space: nowrap; }
.topbar a.link:hover { color: #fff; }
.topbar .burger { display: none; background: transparent; border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 5px 10px; border-radius: var(--radius); }
.logo { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 800; letter-spacing: .12em; font-size: 15px; line-height: 1; }
.logo svg { height: 22px; width: auto; }
.logo.big { font-size: 34px; gap: 14px; letter-spacing: .14em; }
.logo.big svg { height: 44px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: 11px; font-weight: 700; flex: none; }

/* ---------- Gabarit : barre latérale + contenu ---------- */
.shell { display: grid; grid-template-columns: 212px minmax(0, 1fr); min-height: calc(100vh - 48px); }
.nav { position: sticky; top: 48px; align-self: start; height: calc(100vh - 48px); overflow-y: auto; background: var(--nav-bg); backdrop-filter: blur(10px); border-right: 1px solid var(--nav-line); color: var(--nav-ink); display: flex; flex-direction: column; padding: 10px 0 12px; }
.nav .search { margin: 2px 12px 8px; }
.nav .search input { width: 100%; padding: 7px 10px 7px 30px; border: 1px solid var(--nav-line); border-radius: 4px; background: rgba(0,0,0,0.25); color: #e6edf0; font-size: 12px; }
.nav .search { position: relative; }
.nav .search svg { position: absolute; left: 10px; top: 9px; width: 13px; height: 13px; color: var(--faint); }
.nav .group { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); padding: 12px 16px 4px; }
.nav a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 19px; font-size: 13px; border-left: 3px solid transparent; }
.nav a svg { color: inherit; opacity: .9; }
.nav a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav a.active { background: var(--nav-active); color: #fff; font-weight: 600; border-left-color: var(--accent); }
.nav a.active svg { color: var(--accent-text); }
.nav a .badge { margin-left: auto; font-size: 10px; font-weight: 700; background: var(--danger); color: #fff; padding: 2px 6px; border-radius: 8px; line-height: 1.2; }
.nav a.soon { opacity: .45; cursor: default; }
.nav a.soon small { font-size: 10px; }
.nav .spacer { flex: 1; }
.nav .me { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 12px 16px 4px; border-top: 1px solid var(--nav-line); margin-top: 8px; color: var(--nav-ink); }
.nav .me b { color: #fff; display: block; font-size: 13px; }
.nav .me small { display: block; }
.nav .foot { display: flex; gap: 12px; padding: 4px 16px 0; font-size: 12px; }
.nav .foot a { padding: 4px 0; border: 0; font-size: 12px; color: var(--nav-ink); }
.nav .foot a:hover { background: transparent; color: #fff; }
.main { padding: 20px 28px 48px; min-width: 0; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .nav { display: none; position: fixed; left: 0; right: 0; top: 48px; height: auto; max-height: calc(100vh - 48px); z-index: 25; background: #0b1216; }
  .nav.open { display: flex; }
  .topbar .burger { display: inline-block; }
  .topbar .chip, .topbar a.link, .topbar .sep { display: none; }
  .main { padding: 16px; }
}

/* ---------- En-tête de page ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.page-head h1 { font-size: 22px; margin: 0; line-height: 1.2; font-weight: 700; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; max-width: 70ch; }
.crumb-nav { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.crumb-nav b { color: var(--accent-text); font-weight: 700; }
.crumbs { font-size: 12px; color: var(--muted); }
.crumbs b { color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; font-size: 13px; font-weight: 600; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Cartes, tableaux ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.card h2 { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 12px; }
.card h2::before { content: ""; width: 8px; height: 8px; background: var(--accent); flex: none; }
.card h2.warn::before { background: var(--warn); }
.card h2.danger::before { background: var(--danger); }
.card h2 small { color: var(--muted); font-weight: 400; font-size: 11px; letter-spacing: 0; text-transform: none; margin-left: auto; }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; background: rgba(0,0,0,0.18); white-space: nowrap; }
:root[data-theme="light"] th { background: rgba(20,30,40,0.05); }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--accent-soft); }
tr.inactive td { color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 24px; color: var(--muted); text-align: center; }

/* ---------- Formulaires ---------- */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px 18px; }
.form .full { grid-column: 1 / -1; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
label.field > span b { color: var(--danger); }
.field input, .field select, .field textarea { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--ink); font-size: 14px; width: 100%; }
.field textarea { min-height: 80px; resize: vertical; }
.field input:disabled, .field select:disabled { opacity: .6; }
select option { background: var(--surface-solid); color: var(--ink); }
.help { font-size: 12px; color: var(--muted); margin: 0; }
.form-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar input[type="search"], .toolbar select, .toolbar input[type="text"], .toolbar input[type="date"] { padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--ink); font-size: 13px; }
.toolbar input[type="search"] { min-width: 220px; }

/* ---------- Étiquettes ---------- */
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: var(--ok); }
.pill.warn { color: var(--warn); border-color: var(--warn); }
.pill.danger { color: var(--danger); border-color: var(--danger); }
.pill.accent { color: var(--accent-text); border-color: var(--accent); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; border: 1px solid rgba(0,0,0,.15); }
.tag { display: inline-block; background: var(--accent-soft); color: var(--accent-text); padding: 1px 8px; border-radius: 3px; font-size: 12px; margin: 2px 4px 2px 0; }

/* ---------- Messages ---------- */
.alert { padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); margin-bottom: 14px; font-size: 13px; }
.alert.error { border-color: var(--danger); background: var(--danger-soft); }
.alert.ok { border-color: var(--ok); background: var(--ok-soft); }
.toast { position: fixed; right: 16px; bottom: 16px; background: var(--surface-solid); color: var(--ink); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 10px 16px; border-radius: var(--radius); font-size: 13px; box-shadow: var(--shadow); z-index: 50; max-width: min(90vw, 420px); }

/* ---------- Fenêtre modale ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(5, 9, 12, .65); backdrop-filter: blur(4px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 40; overflow: auto; }
.modal { background: var(--surface-solid); border-radius: 4px; border: 1px solid var(--line); width: min(720px, 100%); padding: 20px 22px; box-shadow: var(--shadow); }
.modal h2 { margin: 0 0 14px; font-size: 16px; }

/* ---------- Page centrée (connexion, invitation) ---------- */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.center .card { width: min(440px, 100%); margin: 0; padding: 26px 28px 28px; }
.center .logo { justify-content: center; margin-bottom: 18px; width: 100%; }
.center h1 { font-size: 20px; margin: 0 0 4px; }
.center .eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; text-align: center; }
.center .eyebrow i { color: var(--accent-text); font-style: normal; font-weight: 700; }

/* ---------- Matrice de droits ---------- */
.rights th:first-child, .rights td:first-child { width: 36px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rights td.desc { color: var(--muted); font-size: 12px; }
.rights .inactive-note { color: var(--warn); font-size: 12px; display: block; }
.switch { display: inline-flex; gap: 0; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.switch button { border: 0; background: var(--surface-2); padding: 3px 12px; font-size: 12px; cursor: pointer; color: var(--muted); }
.switch button.on { background: var(--accent); color: var(--accent-ink); }
.switch button:disabled { cursor: default; }

/* ---------- Tableau de bord ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { position: relative; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px 14px; text-decoration: none; color: inherit; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.kpi:hover { border-color: var(--accent); }
.kpi .tag { display: inline-block; margin: -1px 0 0; background: var(--line); color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 0; }
.kpi .tag::before { content: "● "; }
.kpi.danger .tag { background: var(--danger); color: #fff; }
.kpi.warn .tag { background: var(--warn); color: #06171a; }
.kpi .v { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.kpi .v svg { width: 22px; height: 22px; align-self: center; color: var(--muted); }
.kpi.danger .v svg { color: var(--danger); }
.kpi.warn .v svg { color: var(--warn); }
.kpi .n { font-size: 40px; font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi.danger .n { color: var(--danger); }
.kpi .u { font-size: 13px; color: var(--muted); }
.kpi .s { font-size: 11px; color: var(--muted); margin-top: 8px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.hero > div { padding: 14px 18px; min-width: 0; }
.hero > div + div { border-left: 1px solid var(--line-soft); }
.hero h2, .panel h2 { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 10px; }
.hero h2::before, .panel h2::before { content: ""; width: 8px; height: 8px; background: var(--accent); flex: none; }
.hero h2.warn::before, .panel h2.warn::before { background: var(--warn); }
.panel h2.danger::before { background: var(--danger); }
.hero h2 .legend { margin-left: auto; }
.legend i.ln { width: 10px; height: 2px; border-radius: 0; vertical-align: 3px; }
.chart { display: block; width: 100%; height: 170px; }
.chart .grid { stroke: var(--line-soft); }
.chart .target { stroke: var(--faint); stroke-dasharray: 4 4; }
.chart .area { fill: var(--accent); fill-opacity: .12; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.chart .dot { fill: var(--accent); }
.chart text { fill: var(--faint); font-size: 10px; font-family: inherit; }
.chart text.val { fill: var(--ink); font-size: 12px; font-family: var(--mono); }
.chart-empty { height: 170px; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; }
.visit { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; text-decoration: none; color: inherit; }
.visit:last-child { border-bottom: 0; }
.visit .d { width: 40px; flex: none; text-align: center; background: var(--surface-2); border: 1px solid var(--line-soft); padding: 3px 0; }
.visit .d b { display: block; font-family: var(--mono); font-size: 15px; font-weight: 500; line-height: 1; }
.visit .d small { font-size: 9px; color: var(--faint); text-transform: uppercase; }
.visit .t b { display: block; font-weight: 600; }
.visit .t span { color: var(--muted); font-size: 11px; }
.dash { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.panel h2 small { margin-left: auto; color: var(--muted); font-weight: 400; letter-spacing: 0; text-transform: none; }
.rank { display: grid; grid-template-columns: minmax(120px, 190px) 1fr 34px; gap: 10px; align-items: center; font-size: 12px; padding: 4px 0; text-decoration: none; color: inherit; }
.rank .b { height: 8px; background: var(--line-soft); }
.rank .b span { display: block; height: 100%; background: var(--warn); }
.rank.danger .b span { background: var(--danger); }
.rank.ok .b span { background: var(--ok); }
.rank .n { font-family: var(--mono); text-align: right; }
.rank .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proof { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; text-decoration: none; color: inherit; }
.proof:last-child { border-bottom: 0; }
.proof .t b { display: block; font-weight: 600; }
.proof .t span { color: var(--muted); font-size: 11px; }
@media (max-width: 1000px) { .hero { grid-template-columns: 1fr; } .hero > div + div { border-left: 0; border-top: 1px solid var(--line-soft); } .dash { grid-template-columns: 1fr; } }
/* anciennes tuiles (autres écrans) */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: inherit; }
.tile:hover { border-color: var(--accent); }
.tile .n { font-size: 30px; font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; }
.tile .l { color: var(--muted); font-size: 13px; margin-top: 6px; }
.tile.soon { opacity: .55; }

/* ---------- Apparence (Mon compte) ---------- */
.themes { display: flex; flex-wrap: wrap; gap: 12px; }
.themes button { display: flex; flex-direction: column; gap: 8px; width: 180px; padding: 10px; border: 2px solid var(--line); border-radius: 4px; background: var(--surface-2); cursor: pointer; text-align: left; font-size: 13px; }
.themes button.on { border-color: var(--accent); }
.themes .sw { height: 56px; border-radius: 3px; border: 1px solid rgba(0,0,0,.2); }
.themes .sw.dark { background: linear-gradient(160deg, #2a353d, #0a0f13); }
.themes .sw.light { background: linear-gradient(160deg, #ffffff, #d9dfe5); }

/* ---------- Listes réordonnables ---------- */
.sortable li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: var(--radius); margin-bottom: 6px; background: var(--surface-2); }
.sortable li .grow { flex: 1; }
.sortable li .mini { display: flex; gap: 4px; }
.sortable li.off { opacity: .55; }
.sortable { list-style: none; padding: 0; margin: 0; }
pre.json { font-size: 12px; white-space: pre-wrap; word-break: break-word; margin: 0; color: var(--muted); }

/* ---------- Phase C : arbre des axes, barres, onglets, plan d'action ---------- */
.split { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }
.tree { list-style: none; margin: 0; padding: 0; }
.tree ul { list-style: none; margin: 0; padding-left: 18px; border-left: 1px solid var(--line-soft); }
.tree li { margin: 2px 0; }
.tree .node { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: var(--radius); cursor: pointer; font-size: 13px; }
.tree .node:hover { background: var(--accent-soft); }
.tree .node.selected { background: var(--accent); color: var(--accent-ink); }
.tree .node.selected .help, .tree .node.selected .code { color: inherit; opacity: .85; }
.tree .tw { width: 16px; text-align: center; color: var(--muted); font-size: 11px; flex: none; }
.tree .code { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tree .cnt { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tree .cnt .late { color: var(--danger); font-weight: 600; }
.bar { display: inline-flex; align-items: center; position: relative; width: 110px; height: 16px; background: var(--line-soft); border-radius: 3px; overflow: hidden; vertical-align: middle; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); }
.bar > b { position: relative; font-size: 11px; font-weight: 600; padding-left: 6px; color: var(--ink); }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; cursor: pointer; color: var(--muted); font-size: 13px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.prewrap { white-space: pre-wrap; word-break: break-word; }
.stat-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; min-width: 120px; }
.stat .n { font-size: 24px; font-weight: 300; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat.danger .n { color: var(--danger); }
.hbar { display: flex; height: 14px; border-radius: 2px; overflow: hidden; background: var(--line-soft); margin: 6px 0 4px; }
.hbar span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.note { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; background: var(--surface-2); }
.note .meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.note h4 { margin: 4px 0 6px; font-size: 14px; }
.files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.files a { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; border: 1px solid var(--line); border-radius: 3px; padding: 2px 8px; text-decoration: none; color: var(--accent-text); background: var(--surface-2); }
.files .x { color: var(--danger); cursor: pointer; border: 0; background: transparent; font-size: 14px; padding: 0 2px; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 10px 12px; font-size: 12px; color: var(--muted); }
.picker { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; background: var(--surface-2); }
.picker label { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 2px 0; cursor: pointer; }
.picker .lvl1 { padding-left: 16px; } .picker .lvl2 { padding-left: 32px; } .picker .lvl3 { padding-left: 48px; } .picker .lvl4 { padding-left: 64px; }
.event { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.event .when { color: var(--muted); white-space: nowrap; font-family: var(--mono); font-size: 11px; }
.map-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
@media (max-width: 700px) { .map-grid { grid-template-columns: 1fr; } }
.map-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.map-grid select { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--ink); }

/* ---------- Phase E1 : audits ---------- */
.pill a, a.pill { text-decoration: none; }
.quick-val { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px; border-radius: 4px; }
.quick-val:hover { background: var(--accent-soft); }
.quick select { padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); color: var(--ink); font-size: 13px; }

/* ---------- Cockpit Bâtiments : compléments ---------- */
.logo svg { height: 22px; width: 22px; color: var(--accent); }
.logo.big svg { height: 44px; width: 44px; }
.nav a.soon span { flex: 1; }
.rank.info .b span { background: var(--accent); opacity: .75; }
.rank:hover .l { color: var(--accent-text); }
.rank { grid-template-columns: minmax(120px, 200px) 1fr 64px; }
.chart .col { fill: var(--accent); fill-opacity: .35; }
.chart .col.hl { fill-opacity: .95; }
.chart .prevline { fill: none; stroke: var(--faint); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .prevdot { fill: var(--faint); }
.legend i.dash { width: 12px; height: 0; border-top: 2px dashed var(--faint); border-radius: 0; vertical-align: 3px; background: transparent; }
.kpi .n { font-size: 34px; white-space: nowrap; }
.kpi .n small { font-size: 16px; color: var(--muted); margin-left: 4px; }
.kpi.warn .n { color: var(--warn); }
.watch { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; text-decoration: none; color: inherit; }
.watch:last-child { border-bottom: 0; }
.watch b { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch span { font-family: var(--mono); color: var(--warn); white-space: nowrap; }
.watch:hover b { color: var(--accent-text); }
.dash.even { grid-template-columns: 1fr 1fr; }
.dash + .dash { margin-top: 14px; }
@media (max-width: 1000px) { .dash.even { grid-template-columns: 1fr; } }

/* Chapitres repliables (pages Contrôles et Site) */
details.chapter { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
details.chapter > summary { display: flex; align-items: center; gap: 10px; padding: 11px 16px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 700; letter-spacing: .04em; }
details.chapter > summary::-webkit-details-marker { display: none; }
details.chapter > summary::before { content: "▸"; color: var(--accent-text); font-size: 11px; width: 10px; }
details.chapter[open] > summary::before { content: "▾"; }
details.chapter > summary .sum { margin-left: auto; font-family: var(--mono); font-weight: 500; }
details.chapter > summary small { color: var(--muted); font-weight: 400; letter-spacing: 0; }
details.chapter table { border-top: 1px solid var(--line-soft); }
details.chapter table { table-layout: fixed; }
details.chapter th:first-child { width: 34%; }
details.chapter th:nth-child(2) { width: 200px; }
details.chapter td.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; vertical-align: middle; }
.spark i { display: block; width: 6px; background: var(--accent); opacity: .35; min-height: 1px; }
.spark i.on { opacity: 1; }

/* Matrice sites × contrôles */
.matrix { font-size: 12px; }
.matrix th, .matrix td { padding: 6px 8px; white-space: nowrap; }
.matrix th.site { writing-mode: vertical-rl; transform: rotate(180deg); text-align: left; height: 96px; vertical-align: bottom; letter-spacing: .02em; }
.matrix td.cell { text-align: right; font-family: var(--mono); font-size: 11px; cursor: pointer; }
.matrix td.cell:hover { outline: 1px solid var(--accent); outline-offset: -1px; }
.matrix tr.chap td { background: rgba(0,0,0,0.18); font-weight: 700; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
:root[data-theme="light"] .matrix tr.chap td { background: rgba(20,30,40,0.05); }
.matrix td.name { position: sticky; left: 0; background: var(--surface-solid); z-index: 1; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.matrix td.tot, .matrix th.tot { font-weight: 700; border-left: 1px solid var(--line); }
td.clip { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.wrap { max-width: 420px; }
.muted { color: var(--muted); }
.drop { display: block; border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); cursor: pointer; }
.drop.over, .drop:hover { border-color: var(--accent); color: var(--ink); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.steps li { counter-increment: s; padding: 3px 0; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 8px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: 11px; font-weight: 700; }
td.nowrap { white-space: nowrap; }
td.fam { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
