/* PILOTIS 1.1 — feuille de styles. Aucune ressource externe ; compatible CSP stricte. */
@font-face { font-family: "Source Sans 3"; src: url("../fonts/SourceSans3-VF.woff2") format("woff2"); font-weight: 300 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/SourceSans3-Italic-VF.woff2") format("woff2"); font-weight: 300 800; font-style: italic; font-display: swap; }

:root {
  --nuit: #0E1B33; --nuit-2: #17284A; --signal: #2F6BFF; --signal-2: #1F56E0;
  --bg: #F7F8FA; --panel: #FFFFFF; --fill: #F0F2F6; --fill-2: #E7EBF1; --line: #DDE2EA; --line-2: #C9D0DB;
  --fg: #18212F; --fg-2: #3A4556; --muted: #687385;
  --ok: #24724D; --ok-bg: #E6F2EB; --warn: #9A6412; --warn-bg: #FBF0DC; --bad: #B23A2E; --bad-bg: #F9E7E4;
  --info: #2556C9; --info-bg: #E8EEFC;
  --side-bg: #0E1B33; --side-fg: #C3CCDB; --side-muted: #7D8AA3; --side-hover: rgba(255,255,255,.06); --side-active: rgba(255,255,255,.1);
  --chart: #3D5A8A; --chart-hl: #2F6BFF; --grid: #E6E9EF;
  --radius: 10px; --radius-sm: 6px; --side: 236px; --side-collapsed: 68px; --top: 60px;
  --font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0A1322; --panel: #101C31; --fill: #15233C; --fill-2: #1B2B48; --line: #22324F; --line-2: #2E4166;
  --fg: #E7ECF4; --fg-2: #C4CDDB; --muted: #8C99AF;
  --ok: #5CC48F; --ok-bg: #12301F; --warn: #E6B35C; --warn-bg: #33260F; --bad: #F08074; --bad-bg: #3A1A18;
  --info: #8FB0FF; --info-bg: #17284A; --signal: #6E96FF;
  --side-bg: #08101E; --chart: #7F9CCB; --chart-hl: #6E96FF; --grid: #1E2D47;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--fg); background: var(--bg);
  font-variant-numeric: lining-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 4px; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 600; margin: 0 0 6px; letter-spacing: -.012em; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 10px; }
small, .muted { color: var(--muted); }
code { font-size: 13px; background: var(--fill); padding: 1px 5px; border-radius: 4px; }
.hidden { display: none !important; }
.icon { width: 20px; height: 20px; flex: none; }
.icon.sm { width: 16px; height: 16px; }
.tabular, .n, td.n, .figure .v { font-variant-numeric: tabular-nums lining-nums; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------------------------------------------------------------- coque */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
[data-side="collapsed"] .shell { grid-template-columns: var(--side-collapsed) minmax(0, 1fr); }
.side { background: var(--side-bg); color: var(--side-fg); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; z-index: 20; }
.side-brand { height: var(--top); display: flex; align-items: center; padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.06); }
.side-brand a { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.side-brand .mark { width: 30px; height: 30px; flex: none; }
.side-brand .word { height: 16px; width: auto; }
.mark .m-mast { stroke: #fff; } .mark .m-head { fill: #6E96FF; stroke: #6E96FF; }
.side-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.side-nav .grp { font-size: 12.5px; color: var(--side-muted); padding: 16px 12px 6px; font-weight: 600; }
.side-nav a { display: flex; align-items: center; gap: 12px; color: var(--side-fg); padding: 8px 12px; border-radius: 8px; margin: 2px 0; font-size: 14.5px; position: relative; white-space: nowrap; }
.side-nav a:hover { background: var(--side-hover); text-decoration: none; color: #fff; }
.side-nav a.active { background: var(--side-active); color: #fff; font-weight: 600; }
.side-nav a.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--signal); }
.side-nav .sub a { padding-left: 44px; font-size: 13.5px; color: var(--side-muted); }
.side-nav .sub a.active { color: #fff; background: none; font-weight: 600; }
.side-nav .sub a.active::before { display: none; }
.side-foot { padding: 12px 18px 16px; font-size: 12px; color: var(--side-muted); border-top: 1px solid rgba(255,255,255,.06); white-space: nowrap; }
[data-side="collapsed"] .side .word, [data-side="collapsed"] .side .lbl, [data-side="collapsed"] .side .grp,
[data-side="collapsed"] .side .sub, [data-side="collapsed"] .side-foot span { display: none; }
[data-side="collapsed"] .side-nav a { justify-content: center; padding: 9px 0; }
[data-side="collapsed"] .side-brand { justify-content: center; padding: 0; }

.frame { min-width: 0; display: flex; flex-direction: column; }
.top { height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 28px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 15; }
.top .title { font-weight: 600; font-size: 15.5px; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .clock { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.top .spacer { flex: 1; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--fg-2); cursor: pointer; position: relative; padding: 0; }
.icon-btn:hover { background: var(--fill); }
.icon-btn .count { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--panel); }
.menu-btn { display: none; }
details.drop { position: relative; }
details.drop > summary { list-style: none; cursor: pointer; }
details.drop > summary::-webkit-details-marker { display: none; }
.drop-panel { position: absolute; right: 0; top: calc(100% + 8px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-width: 300px; max-width: 380px; padding: 6px; z-index: 30; box-shadow: 0 12px 32px rgba(14,27,51,.12); }
.drop-panel .head { padding: 10px 12px 8px; font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.drop-panel a.item, .drop-panel button.item { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 9px 12px; border-radius: 8px; color: var(--fg); font: inherit; font-size: 14px; background: none; border: 0; text-align: left; cursor: pointer; }
.drop-panel a.item:hover, .drop-panel button.item:hover { background: var(--fill); text-decoration: none; }
.drop-panel .empty-note { padding: 14px 12px; color: var(--muted); font-size: 14px; }
.who-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 10px; }
.who-chip:hover { background: var(--fill); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--nuit-2); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12.5px; flex: none; letter-spacing: .02em; }
.who-chip .who { line-height: 1.2; text-align: left; }
.who-chip .who b { display: block; font-size: 14px; font-weight: 600; }
.who-chip .who span { font-size: 12.5px; color: var(--muted); }

.page { padding: 28px 32px 64px; max-width: 1360px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .lead { color: var(--fg-2); max-width: 72ch; margin: 4px 0 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb, .eyebrow { font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); }
.updated { font-size: 13.5px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }

/* ---------------------------------------------------------------- panneaux et grilles */
.card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.card + .card, .stack > * + * { margin-top: 16px; }
.card-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-head .sub { color: var(--muted); font-size: 13.5px; }
.card-head .right { margin-left: auto; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-wide { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.g-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.span2 { grid-column: span 2; }
.section-gap { margin-top: 20px; }
.small-gap { margin-top: 14px; }
.sep { height: 1px; background: var(--line); margin: 16px 0; }

/* Bandeau d'indicateurs : un seul cadre découpé, pas une rangée de cartes */
.figures { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.figure { padding: 18px 22px; border-left: 1px solid var(--line); min-width: 0; }
.figure:first-child { border-left: 0; }
.figure .l { font-size: 14px; color: var(--fg-2); }
.figure .v { font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin: 6px 0 4px; }
.figure .v .u { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.figure .s { font-size: 13px; color: var(--muted); }
.figure .v.na { color: var(--muted); font-weight: 500; font-size: 22px; }
.delta { font-size: 13px; font-weight: 600; }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); } .delta.flat { color: var(--muted); }

/* Ancien gabarit KPI (pages Programme énergie) : même langage visuel */
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; display: block; color: inherit; }
a.kpi:hover { border-color: var(--line-2); text-decoration: none; }
.kpi .label { font-size: 14px; color: var(--fg-2); display: flex; align-items: center; gap: 8px; }
.kpi .label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.kpi.ok .label::before { background: var(--ok); } .kpi.warn .label::before, .kpi.orange .label::before { background: var(--warn); } .kpi.bad .label::before { background: var(--bad); }
.kpi .value { font-size: 28px; font-weight: 600; margin: 6px 0 2px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- statuts */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; background: var(--fill); color: var(--fg-2); line-height: 1.6; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--info-bg); color: var(--info); }
.badge.muted { background: var(--fill); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.info { background: var(--signal); }
.pos { color: var(--ok); } .neg { color: var(--bad); }
table.t td.pos, table.t td.neg { font-weight: 600; }

/* ---------------------------------------------------------------- familles (Programme énergie) */
.fam { display: flex; flex-direction: column; gap: 8px; }
.fam .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: auto; padding: 0; border: 0; position: static; background: none; }
.fam .fname { font-weight: 600; font-size: 15.5px; }
.fam .big { font-size: 28px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fam .big small { font-size: 14px; font-weight: 400; }
.fam .delta { font-size: 13.5px; }
.fam .delta.zero { color: var(--muted); }
.fam .mini { width: 100%; border-collapse: collapse; font-size: 14px; }
.fam .mini td { padding: 3px 0; vertical-align: top; }
.fam .mini td.n { text-align: right; padding-left: 10px; }
.fam .block { font-size: 13.5px; background: var(--fill); border-radius: 8px; padding: 9px 11px; margin-top: auto; color: var(--fg-2); }

/* ---------------------------------------------------------------- barres et graphiques */
.bar { height: 8px; background: var(--fill-2); border-radius: 4px; overflow: hidden; min-width: 60px; }
.bar > span { display: block; height: 100%; background: var(--chart); }
.bar.ok > span { background: var(--ok); } .bar.warn > span { background: var(--warn); } .bar.bad > span { background: var(--bad); }
.stacked { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--fill-2); }
.stacked span { display: block; height: 100%; }
.stacked .s-real { background: var(--chart); } .stacked .s-bloc { background: var(--bad); } .stacked .s-cours { background: #8FA6CC; }
.stacked .c-raccorde { background: var(--ok); } .stacked .c-en_cours { background: var(--signal); } .stacked .c-en_attente { background: var(--warn); }
.stacked .c-non_raccorde { background: var(--bad); } .stacked .c-autre, .stacked .c-non_classe { background: var(--line-2); }
.legend { display: flex; gap: 16px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; margin-bottom: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; background: var(--line-2); }
.legend .legend-real { background: var(--chart); } .legend .legend-cours { background: #8FA6CC; } .legend .legend-bloc { background: var(--bad); }
.legend .legend-reste { background: var(--fill-2); } .legend .legend-tracker { background: var(--warn); width: 4px; }
.legend .c-raccorde { background: var(--ok); } .legend .c-en_cours { background: var(--signal); } .legend .c-en_attente { background: var(--warn); }
.legend .c-non_raccorde { background: var(--bad); }
.prog-row { display: grid; grid-template-columns: minmax(140px, 240px) 1fr 70px; gap: 14px; align-items: center; padding: 7px 0; }
.prog-row .pct { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.hbar-row { display: grid; grid-template-columns: minmax(120px, 220px) 1fr minmax(110px, auto); gap: 14px; align-items: center; padding: 6px 0; font-size: 14px; }
.hbar { position: relative; height: 16px; background: var(--fill); border-radius: 4px; overflow: hidden; }
.hbar .in { position: absolute; inset: 0 auto 0 0; background: var(--chart); border-radius: 4px; }
.hbar .tr { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--warn); }
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .grid { stroke: var(--grid); stroke-width: 1; }
svg.chart .axis { fill: var(--muted); font-size: 12px; font-family: var(--font); }
svg.chart .col { fill: var(--chart); }
svg.chart .col.hl, svg.chart .col:hover { fill: var(--chart-hl); }
svg.spark { width: 120px; height: 32px; } svg.spark polyline { fill: none; stroke: var(--chart); stroke-width: 1.6; }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rank li:last-child { border-bottom: 0; }
.rank .pos-n { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.rank .bar { margin-top: 4px; }

/* ---------------------------------------------------------------- puces de changement */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; gap: 6px; align-items: baseline; border: 1px solid var(--line); background: var(--panel); padding: 5px 11px; border-radius: 8px; font-size: 13.5px; }
.chip b { font-variant-numeric: tabular-nums; font-weight: 600; }
.chip.up b { color: var(--ok); } .chip.down b { color: var(--bad); } .chip.warn b { color: var(--warn); }
.chip span { color: var(--muted); }

/* ---------------------------------------------------------------- tableaux */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; background: var(--fill); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: var(--fill); }
table.t .n, table.t th.n { text-align: right; white-space: nowrap; }
table.t tfoot td { font-weight: 600; background: var(--fill); border-top: 1px solid var(--line-2); }
table.t .wrap { white-space: normal; max-width: 440px; }
table.t td.c, table.t th.c { text-align: center; }
.heat-1 { background: rgba(61, 90, 138, .06); } .heat-2 { background: rgba(61, 90, 138, .12); } .heat-3 { background: rgba(61, 90, 138, .2); }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); }
.empty-state { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 36px 28px; text-align: left; background: var(--panel); }
.empty-state h2 { margin-bottom: 6px; }
.empty-state p { color: var(--fg-2); max-width: 64ch; }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- formulaires */
.form { max-width: 780px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .help { font-size: 13px; color: var(--muted); margin-top: 5px; }
.field .error { font-size: 13.5px; color: var(--bad); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], input[type=month], input[type=file], select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--fg); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 11px; min-height: 38px; }
textarea { min-height: 100px; resize: vertical; }
select[multiple] { min-height: 160px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(47, 107, 255, .3); border-color: var(--signal); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400 !important; }
.check input { width: 16px; height: 16px; min-height: 0; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters .f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.filters input, .filters select { width: auto; min-width: 150px; padding: 6px 10px; min-height: 36px; font-size: 14px; }
.filters .grow { flex: 1; min-width: 200px; }
.filters .grow input { width: 100%; }
.btn { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-weight: 600; font-size: 14px; border-radius: var(--radius-sm); padding: 7px 14px; min-height: 36px; cursor: pointer; border: 1px solid var(--line-2); background: var(--panel); color: var(--fg); text-decoration: none; white-space: nowrap; }
.btn:hover { text-decoration: none; background: var(--fill); }
.btn.primary { background: var(--nuit); border-color: var(--nuit); color: #fff; }
.btn.primary:hover { background: var(--nuit-2); }
[data-theme="dark"] .btn.primary { background: var(--signal); border-color: var(--signal); color: #071026; }
.btn.accent { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn.accent:hover { background: var(--signal-2); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: var(--panel); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: 3px 10px; font-size: 13px; min-height: 30px; }
.btn.link { border: none; background: none; color: var(--signal); padding: 0; min-height: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.inline, form.inline { display: inline; margin: 0; }

/* ---------------------------------------------------------------- messages */
.flash { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14.5px; border-left: 3px solid currentColor; }
.flash.success { background: var(--ok-bg); color: var(--ok); } .flash.error { background: var(--bad-bg); color: var(--bad); }
.flash.warn { background: var(--warn-bg); color: var(--warn); } .flash.info { background: var(--info-bg); color: var(--info); }
.callout { border-left: 3px solid var(--warn); background: var(--fill); padding: 12px 14px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 14px; color: var(--fg-2); }
.callout.info { border-left-color: var(--signal); }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list-plain li:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: 190px 1fr; gap: 7px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 14px; }
.pager .cur { color: var(--muted); padding: 0 6px; }
.activity { list-style: none; padding: 0; margin: 0; }
.activity li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.activity li:last-child { border-bottom: 0; }
.activity .avatar { width: 28px; height: 28px; font-size: 11px; }
.activity time { display: block; font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------- Energy Desk */
.desk { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.desk a.entry { display: grid; grid-template-columns: 40px 1fr; gap: 6px 14px; padding: 22px 24px; color: var(--fg); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 150px; }
.desk a.entry:nth-child(3n) { border-right: 0; }
.desk a.entry:nth-last-child(-n+3) { border-bottom: 0; }
.desk a.entry:hover { background: var(--fill); text-decoration: none; }
.desk .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--fill-2); color: var(--nuit); display: grid; place-items: center; grid-row: span 3; }
[data-theme="dark"] .desk .ic { color: var(--fg); }
.desk .ic svg { width: 22px; height: 22px; }
.desk .t1 { font-weight: 600; font-size: 16px; }
.desk .t2 { font-size: 14px; color: var(--fg-2); }
.desk .t3 { margin-top: 8px; font-size: 14px; }
.desk .t3 b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.desk .t3 .na { color: var(--muted); }
.steps { display: flex; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 18px; background: var(--panel); }
.steps span { flex: 1; padding: 9px 14px; font-size: 13.5px; color: var(--muted); border-right: 1px solid var(--line); }
.steps span:last-child { border-right: 0; }
.steps span.on { color: var(--fg); font-weight: 600; background: var(--fill); }
.steps span.done { color: var(--ok); }
.map-grid { display: grid; grid-template-columns: 220px 1fr; gap: 10px 16px; align-items: center; }
.map-grid .req::after { content: " *"; color: var(--bad); }
.samples { font-size: 12.5px; color: var(--muted); }
.matrix select { width: 100%; min-width: 92px; padding: 3px 6px; min-height: 30px; font-size: 13px; }
.matrix table.t td, .matrix table.t th { padding: 6px 6px; }
.matrix table.t th { white-space: normal; font-size: 12.5px; line-height: 1.25; vertical-align: bottom; }
.matrix select.lv-lecture { border-color: var(--line-2); }
.matrix select.lv-ecriture { border-color: var(--signal); color: var(--info); }
.matrix select.lv-admin, .matrix select.lv-super_admin { border-color: var(--nuit-2); font-weight: 600; }
.matrix select.lv-none { color: var(--warn); border-style: dashed; }
.matrix td.who { min-width: 190px; max-width: 230px; font-size: 13.5px; }
.matrix tr.changed td { background: var(--info-bg); }
.sticky-actions { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 12px 0 0; margin-top: 12px; display: flex; gap: 10px; align-items: center; }

/* ---------------------------------------------------------------- authentification */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side { background: var(--nuit); color: #C3CCDB; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side .logo-full { height: 40px; width: auto; }
.auth-side p.pitch { font-size: 22px; line-height: 1.35; color: #fff; max-width: 26ch; font-weight: 500; margin: 0; }
.auth-side ul { padding-left: 18px; margin: 16px 0 0; color: #A5B1C7; max-width: 44ch; }
.auth-side li { margin: 6px 0; }
.auth-legal { font-size: 13px; color: #7D8AA3; }
.auth-main { display: grid; place-items: center; padding: 40px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 24px; }
.auth-tools { display: flex; justify-content: flex-end; margin-bottom: 24px; }
.qr { background: #fff; padding: 10px; border-radius: var(--radius); display: inline-block; border: 1px solid var(--line); }
.qr svg { width: 196px; height: 196px; display: block; }
.secret { font-size: 15px; letter-spacing: .08em; background: var(--fill); padding: 10px 12px; border-radius: var(--radius-sm); word-break: break-all; font-variant-numeric: tabular-nums; }
.link-box { font-size: 13.5px; background: var(--fill); border: 1px solid var(--line-2); padding: 10px 12px; border-radius: var(--radius-sm); word-break: break-all; user-select: all; }
.err-code { font-size: 15px; font-weight: 600; color: var(--muted); }
.btn.block { width: 100%; justify-content: center; min-height: 42px; }
.danger-zone { border-color: var(--line-2); }

/* ---------------------------------------------------------------- impression et petits écrans */
@media (max-width: 1200px) { .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-wide, .g-side { grid-template-columns: 1fr; } .figures { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); } .figure { border-left: 0; border-top: 1px solid var(--line); } .figure:nth-child(-n+2) { border-top: 0; } .figure:nth-child(even) { border-left: 1px solid var(--line); } .desk { grid-template-columns: repeat(2, minmax(0, 1fr)); } .desk a.entry { border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line) !important; } }
@media (max-width: 900px) {
  .shell, [data-side="collapsed"] .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 272px; transform: translateX(-100%); transition: transform .2s ease; }
  [data-nav="open"] .side { transform: none; box-shadow: 0 0 0 100vmax rgba(8, 16, 30, .45); }
  [data-side="collapsed"] .side .word, [data-side="collapsed"] .side .lbl, [data-side="collapsed"] .side .grp, [data-side="collapsed"] .side .sub { display: revert; }
  [data-side="collapsed"] .side-nav a { justify-content: flex-start; padding: 8px 12px; }
  .menu-btn { display: inline-grid; } .collapse-btn, .top .clock, .who-chip .who { display: none; }
  .top { padding: 0 14px; } .page { padding: 20px 16px 48px; }
  .g2, .g3, .g4, .g5, .row, .row3 { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .figures { grid-template-columns: 1fr; } .figure { border-left: 0 !important; border-top: 1px solid var(--line); } .figure:first-child { border-top: 0; }
  .desk { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; }
  .prog-row, .hbar-row, .map-grid { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; }
}
@media print {
  .side, .top, .page-head .actions, .filters, .pager, .btn { display: none !important; }
  .shell { display: block; } .card, .figures { break-inside: avoid; } body { background: #fff; }
}
.auth-side .logo-full { align-self: flex-start; }
.form-actions { display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; flex-wrap: wrap; }
