/* Monitoring Site Web — charte de la plateforme TEKSAT (comme Teksat Antispam, Mission SN AUXISUD / NAVSAT) :
   barre bleue, menu latéral blanc avec profil, en-tête de page léger, cartes à ombre douce, tuiles colorées. */
:root {
  --brand: #2b65ee;
  --bg: #f2f3f7; --surface: #ffffff; --sunk: #eef0f4; --fg: #343a40; --muted: #6c757d; --line: #e3e6ea;
  --accent: var(--brand); --accent-fg: #ffffff; --accent-soft: color-mix(in srgb, var(--accent) 12%, #ffffff);
  --danger: #b42318; --warn: #b54708; --ok: #15803d;
  --ok-bg: #e7f6ec; --err-bg: #fdecea; --warn-bg: #fff4e0;
  /* Courbes : palette catégorielle validée (ordre fixe, jamais recyclé), statut réservé aux alertes */
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --c5: #e87ba4; --c6: #008300; --c7: #6250d6; --c8: #e34948;
  --critique: #d03b3b; --grille: #e9ebef; --axe: #c9ced6;
  --font: Roboto, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;
  --shadow: 0 1px 4px rgba(15,23,42,.08), 0 0 0 1px rgba(15,23,42,.03);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1614; --surface: #18211f; --sunk: #121a18; --fg: #e5ece9; --muted: #93a29e; --line: #2a3734;
  --accent: color-mix(in srgb, var(--brand) 55%, #ffffff); --accent-fg: #0b1512; --accent-soft: color-mix(in srgb, var(--brand) 28%, #18211f);
  --danger: #f97066; --warn: #f79009; --ok: #47cd89;
  --ok-bg: #16301f; --err-bg: #3b1a17; --warn-bg: #3a2a14;
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c6: #008300; --c7: #9085e9; --c8: #e66767;
  --critique: #e05252; --grille: #24302d; --axe: #3a4845;
  --shadow: 0 1px 4px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.04);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.5 var(--font); -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h2 { font-size: 17px; font-weight: 500; margin: 0 0 12px; }
h2 small, h3 small { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 6px; }
h3 { font-size: 15px; font-weight: 500; margin: 14px 0 8px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--sunk); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }

/* ---------- Boutons et champs */
input, select, button { font: inherit; color: inherit; }
input[type=password], select { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 7px 11px; min-height: 38px; max-width: 100%; color: var(--fg); }
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 4px; padding: 7px 13px; min-height: 38px; font-weight: 500; cursor: pointer; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); box-shadow: 0 1px 3px rgba(0,0,0,.18); }
button.primary:hover { background: color-mix(in srgb, var(--accent) 85%, #000); }
.hint { color: var(--muted); font-size: 13.5px; margin: 8px 0 0; }

/* ---------- Structure : barre, menu latéral, en-tête de page */
.app { min-height: 100%; display: flex; flex-direction: column; }
header.top { display: flex; align-items: center; gap: 6px; height: 60px; padding: 0 12px; background: var(--brand); color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.18); position: sticky; top: 0; z-index: 1000; flex: none; }
header.top .brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-size: 19px; font-weight: 500; white-space: nowrap; min-width: 0; }
header.top .brand img { height: 36px; width: auto; display: block; }
header.top .top-app { color: #fff; font-size: 18px; font-weight: 500; border-left: 1px solid rgba(255,255,255,.35); padding-left: 12px; }
.top-fill { flex: 1; }
.top-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: #fff; min-height: 40px; padding: 6px 12px;
  border-radius: 4px; font-weight: 500; white-space: nowrap; text-decoration: none; box-shadow: none; }
.top-btn:hover, .top-btn:focus-visible { background: rgba(255,255,255,.14); border-color: transparent; }
.top-btn .ico { width: 20px; height: 20px; }
header.top :focus-visible { outline-color: #fff; }
header.top form { margin: 0; }
.top-etat { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 4px 11px; border-radius: 99px; background: rgba(255,255,255,.14); white-space: nowrap; }
.top-etat .point { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.top-etat.vieux .point { background: #fbbf24; }
.top-etat.coupe .point { background: #f87171; }
.top-seg { display: inline-flex; border: 1px solid rgba(255,255,255,.45); border-radius: 4px; overflow: hidden; margin: 0 4px; flex: none; }
.top-seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 0; background: transparent; color: #fff;
  padding: 5px 11px; min-height: 34px; font-size: 14px; font-weight: 500; box-shadow: none; white-space: nowrap; }
.top-seg > * + * { border-left: 1px solid rgba(255,255,255,.45); }
.top-seg button:hover { background: rgba(255,255,255,.14); }
.top-seg .ico { width: 17px; height: 17px; }
.theme-seg .t-light, :root[data-theme="dark"] .theme-seg .t-dark { background: #fff; color: var(--brand); }
:root[data-theme="dark"] .theme-seg .t-light { background: transparent; color: #fff; }
:root[data-theme="dark"] .theme-seg .t-dark { color: #1d3f94; }
.burger { display: none; }

.shell { flex: 1; display: flex; min-height: 0; }
.side { width: 244px; flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; z-index: 900; }
.side-profile { display: grid; justify-items: center; gap: 3px; padding: 20px 15px 16px; text-align: center;
  background: linear-gradient(155deg, color-mix(in srgb, var(--fg) 7%, var(--surface)) 0 46%, color-mix(in srgb, var(--fg) 3%, var(--surface)) 46% 62%, var(--surface) 62%);
  border-bottom: 1px solid var(--line); }
.side-avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center;
  border: 4px solid var(--surface); box-shadow: 0 2px 10px rgba(0,0,0,.25); margin-bottom: 4px; position: relative; }
.side-avatar .ico { width: 32px; height: 32px; }
.side-avatar::after { content: ""; position: absolute; right: 2px; bottom: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--etat, #22c55e); border: 2px solid var(--surface); }
.side-avatar.attention { --etat: #f59e0b; } .side-avatar.critique { --etat: #ef4444; }
.side-profile strong { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.side-profile small { font-size: 12px; color: var(--muted); }
.side-nav { display: grid; padding: 6px 0; }
.side-nav a { display: flex; align-items: center; gap: 14px; border-left: 3px solid transparent; color: var(--fg); padding: 11px 21px; font-size: 15px; text-decoration: none; }
.side-nav a:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.side-nav a.on { color: var(--accent); border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); font-weight: 500; }
.side-nav .count { margin-left: auto; }
.ico { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.count { background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 6px; min-width: 18px; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.count.attention { background: #d97706; }
.side-foot { margin-top: auto; padding: 12px 18px 16px; display: grid; gap: 4px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.side-shade { display: none; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 26px 13px;
  background: color-mix(in srgb, var(--surface) 55%, var(--bg)); border-bottom: 1px solid var(--line); }
.pagehead h1 { margin: 0; font-size: 24px; font-weight: 300; color: color-mix(in srgb, var(--fg) 80%, var(--bg)); line-height: 1.2; }
.pagehead h1 small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; font-weight: 400; }
.crumb { display: flex; gap: 8px; align-items: center; font-size: 14px; background: var(--surface); padding: 5px 13px; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.crumb span:first-child { color: var(--accent); }
.crumb .sep { color: var(--muted); }
.view { padding: 20px 25px 60px; flex: 1; }
.view > .wrap { max-width: 1320px; margin: 0 auto; display: grid; gap: 16px; align-content: start; }

/* ---------- Panneaux, messages, tableaux */
.card { background: var(--surface); border-radius: 4px; box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card.scroll { overflow-x: auto; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.head h2 { margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.flash { padding: 11px 15px; border-radius: 4px; background: var(--ok-bg); color: var(--ok); box-shadow: inset 4px 0 0 var(--ok); }
.flash.err { background: var(--err-bg); color: var(--danger); box-shadow: inset 4px 0 0 var(--danger); }
.flash.vide { display: none; }
.info { background: var(--surface); border-radius: 4px; box-shadow: var(--shadow), inset 4px 0 0 var(--accent); padding: 10px 15px; font-size: 14px; }
.info p { margin: 0; } .info p + p { margin-top: 6px; color: var(--muted); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; border-bottom: 2px solid var(--line); padding: 9px 10px; white-space: nowrap; }
td { border-bottom: 1px solid var(--line); padding: 8px 10px; vertical-align: top; }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--fg) 2.5%, transparent); }
tr:last-child td { border-bottom: 0; }
th.num { text-align: right; }
.tag { display: inline-flex; align-items: center; gap: 4px; background: var(--sunk); border-radius: 4px; padding: 1px 8px; font-size: 12.5px; font-weight: 500; color: var(--fg); white-space: nowrap; }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.okc { background: var(--ok-bg); color: var(--ok); }
.tag.errc { background: var(--err-bg); color: var(--danger); }
.tag.app { background: var(--accent-soft); color: var(--accent); }
.tag .ico { width: 13px; height: 13px; }

/* ---------- Tuiles (comme le tableau de bord NAVSAT) */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tile { display: grid; grid-template-columns: 60px 1fr; border-radius: 4px; overflow: hidden; color: #fff; text-decoration: none; min-height: 72px;
  background: var(--tc); box-shadow: 0 1px 4px rgba(0,0,0,.12); transition: transform .12s, box-shadow .12s; position: relative; }
.tile:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.18); }
.tile-ico { display: grid; place-items: center; background: rgba(0,0,0,.16); }
.tile-ico .ico { width: 29px; height: 29px; stroke-width: 1.7; }
.tile-body { display: grid; grid-template-columns: auto 1fr; align-items: baseline; align-content: center; column-gap: 11px; padding: 8px 14px; min-width: 0; }
.tile-body strong { grid-row: span 2; align-self: center; font-size: 28px; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile-body strong.mot { font-size: 21px; }
.tile-body span { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 13px; text-transform: uppercase; letter-spacing: .3px; line-height: 1.3; }
.tile-body small { font-size: 12.5px; opacity: .9; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-bleu { --tc: #1e88e5; } .t-indigo { --tc: #3f51b5; } .t-vert { --tc: #15803d; } .t-orange { --tc: #d97706; } .t-rouge { --tc: #c62828; } .t-gris { --tc: #607080; }

/* ---------- Alertes */
.alertes { display: grid; gap: 8px; }
.alerte { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 11px 15px; border-radius: 4px;
  background: var(--surface); box-shadow: var(--shadow), inset 4px 0 0 var(--s); }
.alerte.critique { --s: var(--critique); background: color-mix(in srgb, var(--err-bg) 70%, var(--surface)); }
.alerte.attention { --s: #d97706; background: color-mix(in srgb, var(--warn-bg) 70%, var(--surface)); }
.alerte .ico { width: 21px; height: 21px; color: var(--s); margin-top: 1px; }
.alerte b { font-weight: 500; }
.alerte p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.alerte time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.alerte a { color: inherit; text-decoration: none; }
.alerte a:hover b { text-decoration: underline; }
.tout-va-bien { display: flex; gap: 12px; align-items: center; padding: 13px 16px; border-radius: 4px; background: var(--surface); box-shadow: var(--shadow), inset 4px 0 0 var(--ok); }
.tout-va-bien .ico { color: var(--ok); width: 22px; height: 22px; }

/* ---------- Statuts (pastille + libellé, jamais la couleur seule) */
.statut { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  border-radius: 99px; padding: 2px 10px 2px 8px; white-space: nowrap; color: var(--s); background: color-mix(in srgb, var(--s) 13%, var(--surface)); }
.statut .ico { width: 14px; height: 14px; stroke-width: 2.4; }
.st-ok { --s: var(--ok); } .st-lent, .st-attente, .st-inconnu { --s: var(--warn); } .st-hors_ligne, .st-erreur, .st-partiel { --s: var(--danger); }

/* ---------- Jauges (processeur, mémoire, disques) */
.jauges { display: grid; gap: 12px; }
.jauge { display: grid; gap: 4px; }
.jauge-l { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.jauge-l b { font-weight: 500; }
.jauge-l span { color: var(--muted); font-variant-numeric: tabular-nums; }
.barre { height: 10px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.barre i { display: block; height: 100%; border-radius: 99px; background: var(--c1); min-width: 2px; }
.barre.haut i { background: #d97706; } .barre.plein i { background: var(--critique); }

/* ---------- Applications */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.app-carte { display: grid; gap: 10px; align-content: start; box-shadow: var(--shadow), inset 0 4px 0 var(--s); }
.app-carte h2 { margin: 0; font-size: 19px; font-weight: 400; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.app-carte h2 a { color: inherit; text-decoration: none; }
.app-carte .resume { margin: 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chiffre { background: var(--sunk); border-radius: 4px; padding: 7px 10px; min-width: 0; }
.chiffre small { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
.chiffre b { font-weight: 500; font-size: 17px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 14px; }
.liste li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.liste .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.journal { font-family: var(--mono); font-size: 12.5px; background: var(--sunk); border-radius: 4px; padding: 8px 10px; margin: 0; display: grid; gap: 3px;
  max-height: 210px; overflow: auto; }
.journal div { white-space: pre-wrap; overflow-wrap: anywhere; }
.journal .recent { color: var(--danger); }
details.plus > summary { cursor: pointer; color: var(--accent); font-size: 14px; }
details.plus[open] > summary { margin-bottom: 8px; }
.prio-basse { color: var(--warn); font-weight: 500; }

/* ---------- Courbes (SVG dessinées à la main, sans bibliothèque) */
.courbe { position: relative; }
.courbe svg { display: block; width: 100%; height: auto; overflow: visible; }
.courbe .grille line { stroke: var(--grille); stroke-width: 1; }
.courbe .axe { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.courbe .serie { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.courbe .seuil { stroke: var(--critique); stroke-width: 1; stroke-dasharray: 4 4; opacity: .7; }
.courbe .seuil-l { fill: var(--critique); font-size: 11px; }
.courbe .fin { fill: var(--fg); font-size: 12px; font-weight: 500; }
.courbe .curseur { stroke: var(--muted); stroke-width: 1; }
.courbe .point { stroke: var(--surface); stroke-width: 2; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende i { width: 14px; height: 3px; border-radius: 2px; background: var(--c); }
.bulle { position: absolute; pointer-events: none; background: var(--surface); color: var(--fg); border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.18), 0 0 0 1px var(--line);
  padding: 9px 11px; font-size: 13px; min-width: 190px; max-width: 300px; z-index: 50; }
.bulle b { font-weight: 500; }
.bulle .l { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.bulle .l span:first-child { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulle .l i { width: 10px; height: 3px; border-radius: 2px; background: var(--c); flex: none; }
.bulle .sep { border-top: 1px solid var(--line); margin: 6px 0 4px; }
.bulle small { color: var(--muted); }
.periodes { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.periodes button { border: 0; border-radius: 0; min-height: 32px; padding: 4px 11px; font-size: 13.5px; background: var(--surface); }
.periodes button + button { border-left: 1px solid var(--line); }
.periodes button.on { background: var(--accent); color: var(--accent-fg); }

/* ---------- Connexion */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(circle at 85% -10%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 55%), var(--bg); }
.login-col { display: grid; gap: 12px; width: min(400px, 100%); }
.card.login { width: 100%; display: grid; gap: 14px; padding: 30px 26px; border-radius: 8px; }
.card.login label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-logo img { height: 42px; }
.logo-sombre, :root[data-theme="dark"] .logo-clair { display: none; }
:root[data-theme="dark"] .logo-sombre { display: block; }
.app-name { color: var(--muted); font-weight: 500; font-size: 15px; border-left: 1px solid var(--line); padding-left: 12px; }
.theme.floating { position: fixed; top: 14px; right: 14px; color: var(--fg); border: 1px solid var(--line); background: var(--surface); border-radius: 50%; width: 40px; padding: 0; }
.theme .to-light, :root[data-theme="dark"] .theme .to-dark { display: none; }
:root[data-theme="dark"] .theme .to-light { display: inline-flex; }

/* ---------- Téléphone et tablette */
@media (max-width: 1200px) { .tiles { grid-template-columns: repeat(2, 1fr); } .grid3 { grid-template-columns: 1fr; } }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .burger { display: inline-flex; }
  .side { position: fixed; top: 60px; bottom: 0; left: 0; height: auto; transform: translateX(-105%); transition: transform .2s; box-shadow: 4px 0 18px rgba(0,0,0,.2); }
  body.side-open .side { transform: none; }
  body.side-open .side-shade { display: block; position: fixed; inset: 60px 0 0 0; background: rgba(8,12,20,.45); z-index: 890; }
  .pagehead { padding: 12px 15px; } .pagehead h1 { font-size: 21px; } .crumb { display: none; }
  .view { padding: 14px 11px 80px; }
  header.top .top-app, .top-etat span { display: none; }
  .apps { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .tiles { gap: 8px; }
  .tile { grid-template-columns: 40px 1fr; min-height: 56px; }
  .tile-ico .ico { width: 21px; height: 21px; }
  .tile-body { padding: 4px 8px; column-gap: 6px; } .tile-body strong { font-size: 21px; grid-row: auto; } .tile-body span { font-size: 11px; } .tile-body small { display: none; }
  header.top .brand img { height: 30px; }
  header.top { gap: 2px; padding: 0 6px; }
  .top-seg span, .top-btn span { display: none; }
  .theme-seg .t-light, :root[data-theme="dark"] .theme-seg .t-dark { display: none; }
  :root[data-theme="dark"] .theme-seg .t-light { display: inline-flex; }
  .theme-seg .t-dark, :root[data-theme="dark"] .theme-seg .t-light { border-left: 0; }
  .chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .alerte { grid-template-columns: auto minmax(0, 1fr); } .alerte time { grid-column: 2; }
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* Couleur d'une série (palette catégorielle, ordre fixe) */
.k1 { --c: var(--c1); } .k2 { --c: var(--c2); } .k3 { --c: var(--c3); } .k4 { --c: var(--c4); }
.k5 { --c: var(--c5); } .k6 { --c: var(--c6); } .k7 { --c: var(--c7); } .k8 { --c: var(--c8); }
.courbe .serie { stroke: var(--c); }
.courbe .point { fill: var(--c); }
td code { white-space: nowrap; overflow-wrap: normal; }
/* Bande de disponibilité : couleurs d'état réservées (jamais utilisées pour une série) */
.bandes { margin-top: 14px; }
.bandes .b-ok { fill: #0ca30c; background: #0ca30c; } .bandes .b-lent { fill: #fab219; background: #fab219; }
.bandes .b-ko { fill: #d03b3b; background: #d03b3b; } .bandes .b-vide { fill: var(--sunk); background: var(--sunk); }
.bandes .legende i { height: 10px; width: 14px; border-radius: 2px; box-shadow: 0 0 0 1px var(--line); }
.boutons { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 10px; }
button:disabled { opacity: .6; cursor: progress; }
/* ---------- Redémarrage d'une application (bouton, avancement, fenêtre de confirmation) */
.redem-btn { margin-left: auto; min-height: 32px; padding: 4px 11px; font-size: 13.5px; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.redem-btn:hover:not(:disabled) { background: var(--err-bg); border-color: var(--danger); }
.redem-btn:disabled { color: var(--muted); border-color: var(--line); cursor: not-allowed; }
.redem-btn .ico { width: 16px; height: 16px; }
.redem-etat { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 13.5px; padding: 7px 11px; border-radius: 4px; }
.redem-etat .ico { width: 17px; height: 17px; margin-top: 1px; }
.redem-etat.encours { background: var(--warn-bg); color: var(--warn); }
.redem-etat.encours .ico { animation: tourne 1.2s linear infinite; }
.redem-etat.ok { background: var(--ok-bg); color: var(--ok); }
.redem-etat.ko { background: var(--err-bg); color: var(--danger); }
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .redem-etat.encours .ico { animation: none; } }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 85%, #000); }
button.danger:disabled { cursor: not-allowed; }
dialog.dlg { border: 0; border-radius: 8px; padding: 22px 24px; width: min(480px, calc(100vw - 32px)); background: var(--surface); color: var(--fg);
  box-shadow: 0 18px 50px rgba(0,0,0,.35); }
dialog.dlg::backdrop { background: rgba(8,12,20,.55); }
.dlg h2 { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 500; }
.dlg h2 .ico { color: var(--danger); width: 22px; height: 22px; }
.dlg p { margin: 0 0 10px; font-size: 14px; }
.dlg label { display: grid; gap: 6px; margin-top: 12px; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.dlg label b { color: var(--fg); }
.dlg label small { font-weight: 400; }
.dlg input { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 7px 11px; min-height: 38px; width: 100%; color: var(--fg); }
.dlg .flash { margin-top: 12px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

/* Double authentification (2.0.0) */
.card.login h2 { margin: 0; font-size: 18px; }
.qr { display: grid; place-items: center; padding: 8px; background: #fff; border-radius: 6px; }
.qr svg { width: 220px; height: 220px; }
code.cle { font-size: 15px; letter-spacing: .04em; word-break: break-all; }
.codes-secours { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin: 0; padding-left: 22px; }
.codes-secours code { font-size: 16px; letter-spacing: .06em; }
a.bouton { display: inline-block; text-align: center; padding: 10px 14px; border-radius: 4px; text-decoration: none; }
a.bouton.primary { background: var(--accent); color: var(--accent-fg); }
@media print { .theme.floating, a.bouton { display: none; } }
