/* Console d'exploitation VSS-Sync : sobre, dense, l'état se lit à la couleur */
:root {
  --bg: #f2f4f6; --surface: #ffffff; --fg: #16222b; --muted: #5d6c78; --line: #d8dfe4; --line-soft: #e8edf0; --soft: #eef2f5;
  --accent: #0d7482; --accent-soft: #e2f1f3; --accent-fg: #ffffff;
  --ok: #2c8a52; --progress: #1f6fbf; --wait: #c47f0a; --error: #c2392b; --lost: #4a3f5c; --skip: #c9d2d8; --neutral: #ffffff;
  --error-soft: #fbeceb; --wait-soft: #fbf3e3; --ok-soft: #e7f4ec;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 30, 40, .06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: Consolas, "Cascadia Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e161b; --surface: #152027; --fg: #e3eaee; --muted: #93a4af; --line: #2b3b45; --line-soft: #22313a; --soft: #1b2931;
    --accent: #3cbccb; --accent-soft: #163a40; --accent-fg: #0e161b;
    --ok: #4cc07c; --progress: #5aa3ea; --wait: #e6a93b; --error: #f06a5c; --lost: #a796c4; --skip: #3a4a54; --neutral: #152027;
    --error-soft: #3a2020; --wait-soft: #3a3020; --ok-soft: #1a3324;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.45 var(--font); }
h2 { margin: 0; font-size: 17px; } h3 { margin: 0; font-size: 15px; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }
a { color: var(--accent); }
.bad { color: var(--error); } .ok { color: var(--ok); }

/* ---------- en-tête ---------- */
.top { position: sticky; top: 0; z-index: 6; display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
  padding: 8px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 10px; align-items: center; }
.brand strong { display: block; font-size: 15px; } .brand .sub { color: var(--muted); font-size: 11.5px; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; font-size: 13px; }
.tabs { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.tabs button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; padding: 8px 13px; border-radius: 7px; cursor: pointer; }
.tabs button:hover { color: var(--fg); background: var(--soft); }
.tabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.engine { display: flex; gap: 8px; align-items: center; }
.state-pill { display: inline-flex; gap: 7px; align-items: center; font-size: 12.5px; font-weight: 600; padding: 4px 11px;
  border-radius: 99px; background: var(--soft); white-space: nowrap; }
.state-pill.ok { background: var(--ok-soft); color: var(--ok); } .state-pill.ok .dot { background: var(--ok); }
.state-pill.warn { background: var(--wait-soft); color: var(--wait); } .state-pill.warn .dot { background: var(--wait); }
.badge { background: var(--error); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 11px; margin-left: 4px; }

main { padding: 16px 20px 60px; }
.tab { display: grid; gap: 14px; }

/* ---------- contrôles ---------- */
.btn { font: inherit; font-weight: 600; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg);
  padding: 6px 14px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: var(--surface); color: var(--fg); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); filter: none; }
.btn.danger { background: var(--surface); color: var(--error); border-color: color-mix(in srgb, var(--error) 50%, var(--line)); }
.btn.danger:hover { background: var(--error-soft); filter: none; }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn.xs { padding: 2px 8px; font-size: 12px; font-weight: 600; }
.btn:disabled { opacity: .55; cursor: wait; }
.btn:focus-visible, .tabs button:focus-visible, .cell:focus-visible, .kpi:focus-visible, .link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 600; }
.link:hover { text-decoration: underline; }
.chip { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--soft); white-space: nowrap; display: inline-block; }
.chip.ok { color: var(--ok); background: var(--ok-soft); } .chip.bad { color: var(--error); background: var(--error-soft); }
.chip.warn { color: var(--wait); background: var(--wait-soft); }
input, select, textarea { font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--skip); flex: none; display: inline-block; }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--error); } .dot.warn { background: var(--wait); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.panel-head h2 { font-size: 14.5px; }
.panel-head .count { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--progress); }

.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.section-head p { max-width: 760px; margin-top: 4px; }
.head-acts { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.head-acts label, .toolbar label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* ---------- Suivi : connexions ---------- */
.health { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); padding: 2px 2px 0; }
.health .h { display: inline-flex; gap: 7px; align-items: center; }
.health .h b { color: var(--fg); font-weight: 600; }
.health .h.bad b { color: var(--error); }

/* ---------- Suivi : indicateurs groupés ---------- */
.overview { display: grid; grid-template-columns: 2.2fr 1fr 1.5fr; gap: 12px; }
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 10px;
  align-content: start; box-shadow: var(--shadow); }
.group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.group h3 .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 8px; }
.kpi { font: inherit; color: inherit; text-align: left; cursor: pointer; background: var(--soft); border: 1px solid transparent;
  border-radius: 8px; padding: 9px 11px; display: grid; gap: 2px; align-content: start; transition: border-color .15s; }
.kpi:hover { border-color: var(--accent); }
.kpi .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .l { color: var(--muted); font-size: 12px; line-height: 1.3; }
.kpi .s { color: var(--muted); font-size: 11.5px; }
.kpi.hero { background: var(--ok-soft); } .kpi.hero .v { color: var(--ok); font-size: 26px; }
.kpi.alert { background: var(--error-soft); } .kpi.alert .v { color: var(--error); }
.kpi.warn { background: var(--wait-soft); } .kpi.warn .v { color: var(--wait); }
.kpi.zero .v { color: var(--muted); }

/* ---------- Suivi : colonne principale + panneau latéral ---------- */
.suivi-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.main-col { display: grid; gap: 10px; min-width: 0; }
.side-col { display: grid; gap: 12px; position: sticky; top: calc(var(--hdr, 56px) + 10px);
  max-height: calc(100vh - var(--hdr, 56px) - 20px); overflow-y: auto; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.toolbar .grow { flex: 1; min-width: 180px; }
.toolbar.sticky { position: sticky; top: var(--hdr, 56px); z-index: 4; background: var(--surface); padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.tb-actions { display: flex; gap: 6px; align-items: end; }
.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding: 0 2px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; }

/* transferts en cours (panneau latéral) */
.active-list { display: grid; gap: 6px; margin-top: 8px; }
.tr { display: grid; gap: 5px; border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px 10px; font: inherit; color: inherit;
  background: var(--surface); text-align: left; cursor: pointer; }
.tr:hover { border-color: var(--accent); }
.tr .l1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.tr .l1 b { font-family: var(--mono); font-size: 13px; }
.tr .l1 .pct { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12.5px; }
.tr .l2 { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); }
.tr .l2 span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr .step { font-size: 11.5px; color: var(--progress); font-weight: 600; }
.pbar { height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--progress); transition: width .4s; }
.pbar.indet i { width: 35% !important; animation: indet 1.4s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
@media (prefers-reduced-motion: reduce) { .pbar.indet i { animation: none; width: 100% !important; opacity: .5; } }
.recent-list { display: grid; gap: 2px; margin-top: 8px; font-size: 12.5px; }
.recent-list .r { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line-soft); }
.recent-list .r:first-child { border-top: 0; }
.recent-list .r span:first-child { font-family: var(--mono); }

/* ---------- frise : compte → flotte → véhicules ---------- */
.fleets { display: grid; gap: 5px; }
.acct-title { display: flex; gap: 12px; align-items: baseline; margin-top: 8px; padding: 0 2px 2px; }
.acct-title h2 { font-size: 15px; }
.acct-title::after { content: ""; flex: 1; border-bottom: 1px solid var(--line); transform: translateY(-4px); }
.fleet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.fleet.open { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.fleet-head { width: 100%; display: grid; grid-template-columns: 16px minmax(200px, 1fr) minmax(200px, 2fr);
  gap: 12px; align-items: center; padding: 6px 14px; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.fleet-head:hover { background: var(--soft); }
.fleet-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fleet-head .chev { color: var(--muted); }
.fleet-head .fname { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.fleet-head .fname .muted { white-space: nowrap; }
.fleet-head .fname b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fleet-head .fname .muted { font-size: 12px; }
.fchips { display: flex; gap: 4px; flex-wrap: wrap; }
.fchip { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--soft); white-space: nowrap; }
.fchip.ok { color: var(--ok); } .fchip.progress { color: var(--progress); } .fchip.wait { color: var(--wait); } .fchip.lost { color: var(--lost); }
.fchip.flag { color: var(--error); background: var(--error-soft); }
.stack { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--soft); }
.stack .seg { display: block; height: 100%; }
.seg.ok { background: var(--ok); } .seg.progress { background: var(--progress); } .seg.wait { background: var(--wait); }
.seg.lost { background: var(--lost); } .seg.skip { background: var(--skip); }
.seg.neutral { background: color-mix(in srgb, var(--fg) 12%, var(--surface)); } .seg.none { background: var(--soft); }
.fleet-body { border-top: 1px solid var(--line); overflow-x: auto; max-height: 70vh; overflow-y: auto; }
.frise { min-width: 860px; }
.row { display: grid; grid-template-columns: 250px 120px 1fr; gap: 12px; align-items: center; padding: 7px 14px; border-top: 1px solid var(--line-soft); }
.row:hover:not(.head) { background: color-mix(in srgb, var(--soft) 60%, transparent); }
.row.head { border-top: 0; font-size: 11px; color: var(--muted); position: sticky; top: 0; z-index: 1; background: var(--surface);
  border-bottom: 1px solid var(--line-soft); }
.veh { min-width: 0; }
.veh .id { font-weight: 700; font-family: var(--mono); display: flex; align-items: center; gap: 4px; }
.veh .name { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.veh .flags { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.veh .flags .chip { font-size: 10.5px; padding: 0 7px; }
.veh .flags button.chip { border: 0; font-family: inherit; cursor: pointer; }
.chan { font: inherit; font-family: var(--mono); font-size: 11px; border: 1px dashed var(--line); background: none; color: var(--muted);
  border-radius: 4px; padding: 0 5px; cursor: pointer; font-weight: 400; }
.chan:hover { border-color: var(--accent); color: var(--accent); }
.chan.manual { border-style: solid; border-color: var(--wait); color: var(--wait); }
.budget .t { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.budget .t.full { color: var(--error); font-weight: 600; }
.cells, .hours { display: grid; gap: 2px; }
.cell { height: 20px; border-radius: 3px; border: 1px solid var(--line); background: var(--neutral); cursor: pointer; padding: 0; }
.cell.ok { background: var(--ok); border-color: var(--ok); }
.cell.progress { background: linear-gradient(to right, var(--progress) var(--p, 100%), color-mix(in srgb, var(--progress) 35%, var(--surface)) var(--p, 100%)); border-color: var(--progress); }
.cell.wait { background: var(--wait); border-color: var(--wait); }
.cell.lost { background: var(--lost); border-color: var(--lost); }
.cell.skip { background: var(--skip); border-color: var(--skip); }
.cell.none { background: transparent; border-style: dashed; cursor: default; }
.cell.error { background: var(--error); border-color: var(--error); }
.cell.nogps { position: relative; }
.cell.nogps::after { content: ""; position: absolute; top: 2px; right: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--error); box-shadow: 0 0 0 1px var(--surface); }
.hours span { font-size: 10px; white-space: nowrap; }

/* ---------- à traiter ---------- */
.err-groups { display: grid; gap: 12px; }
.eg { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--error); border-radius: var(--radius); box-shadow: var(--shadow); }
.eg-head { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 12px 16px; align-items: start; }
.eg-head h3 { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.eg-head h3 .n { font-variant-numeric: tabular-nums; color: var(--error); }
.eg-head .code { font-family: var(--mono); font-size: 11.5px; color: var(--muted); font-weight: 400; }
.eg-head .todo { grid-column: 1 / -1; font-size: 13px; background: var(--soft); border-radius: 7px; padding: 8px 10px; }
.eg-head .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.eg-body { border-top: 1px solid var(--line-soft); }
.erow { display: grid; grid-template-columns: 130px minmax(110px, 160px) 1fr auto; gap: 10px; align-items: center; padding: 6px 16px;
  border-top: 1px solid var(--line-soft); font-size: 13px; }
.erow:first-child { border-top: 0; }
.erow .mono { font-size: 12.5px; }
.erow .msg { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erow .acts { display: flex; gap: 4px; }
.eg-more { padding: 8px 16px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line-soft); }
.retry-block > summary { cursor: pointer; display: flex; gap: 12px; align-items: baseline; list-style: none; }
.retry-block > summary::-webkit-details-marker { display: none; }
.retry-block > summary h2 { font-size: 14.5px; }
.retry-block > summary h2::before { content: "▸ "; color: var(--muted); }
.retry-block[open] > summary h2::before { content: "▾ "; }
.retry-block .rows { margin-top: 10px; }

/* listes de vidéos */
.rows { display: grid; gap: 4px; }
.rows button { display: grid; grid-template-columns: 110px 100px 1fr auto; gap: 8px; align-items: center; text-align: left;
  font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 7px; padding: 6px 10px; cursor: pointer; }
.rows button:hover { border-color: var(--accent); }
.rows .mono { font-size: 12.5px; }
.rows .st { font-size: 12px; color: var(--muted); }

/* ---------- journal ---------- */
.ev-list { display: grid; }
.ev { display: grid; grid-template-columns: 128px 64px 1fr auto; gap: 12px; align-items: start; padding: 8px 16px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.ev:first-child { border-top: 0; }
.ev .ts { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.ev .lvl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; border-radius: 4px; padding: 1px 6px; text-align: center; background: var(--soft); color: var(--muted); }
.ev .lvl.error { background: var(--error-soft); color: var(--error); } .ev .lvl.warn { background: var(--wait-soft); color: var(--wait); }
.ev .dev { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-left: 6px; }
.ev-foot { padding: 10px 16px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line-soft); }

/* ---------- comptes VSS ---------- */
.acc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 14px; align-items: start; }
.acc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; }
.acc.off { opacity: .7; }
.acc > * { padding: 12px 16px; }
.acc-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.acc-head h3 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.acc-head .mono { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; margin-top: 2px; }
.acc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; padding: 0; background: var(--line-soft);
  border-block: 1px solid var(--line-soft); }
.acc-stats div { background: var(--surface); padding: 9px 12px; display: grid; }
.acc-stats b { font-size: 18px; font-variant-numeric: tabular-nums; }
.acc-stats span { font-size: 11.5px; color: var(--muted); }
.acc-fleets .lbl { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: flex; justify-content: space-between; gap: 8px; }
.fl-chips { display: flex; gap: 5px; flex-wrap: wrap; max-height: 79px; overflow: hidden; }
.fl-chip { line-height: 19px; }
.fl-chips.all { max-height: none; }
.fl-chip { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--soft); white-space: nowrap; }
.fl-chip b { font-weight: 600; } .fl-chip span { color: var(--muted); font-variant-numeric: tabular-nums; }
.fl-chip.zero { border: 1px dashed var(--line); background: none; }
.acc .kv { font-size: 12.5px; border-top: 1px solid var(--line-soft); }
.acc .err { background: var(--error-soft); color: var(--error); font-size: 12.5px; }
.acc .acts { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--line-soft); background: color-mix(in srgb, var(--soft) 50%, var(--surface));
  border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- formulaires / tiroir ---------- */
.form { display: grid; gap: 10px; }
.form label { display: grid; gap: 3px; font-size: 13px; color: var(--muted); }
.form label.opt, .opts .opt { display: flex; gap: 8px; align-items: center; color: var(--fg); }
.form input:not([type=checkbox]):not([type=radio]), .form textarea { width: 100%; }
.form .actions { display: flex; gap: 8px; }
.opts { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; display: grid; gap: 6px; }
.fleet-chips { display: flex; gap: 5px; flex-wrap: wrap; margin: 6px 0; max-height: 220px; overflow-y: auto; }
.fleet-chips .chip { border: 1px solid var(--line); cursor: pointer; font: inherit; font-size: 12px; background: var(--surface); }
.fleet-chips .chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.field { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 6px; }
.field.key { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.field label { font-weight: 600; } .field .help { font-size: 12px; color: var(--muted); }
.field input[type=text], .field input[type=number] { width: 100%; }
.settings .actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: -8px 0 24px rgba(0,0,0,.14); z-index: 10; padding: 16px 18px; overflow-y: auto; display: grid; align-content: start; gap: 14px; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 10px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.box { background: var(--soft); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.box.error { background: var(--error-soft); }
.box.warn { background: var(--wait-soft); }
.diag { display: grid; gap: 8px; }
.diag .g { border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px; display: grid; gap: 6px; }
.diag .g p { margin: 0; font-size: 13px; }
.diag .g .devs { display: flex; gap: 4px; flex-wrap: wrap; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 20; max-width: 90vw; }

/* ---------- écrans étroits ---------- */
@media (max-width: 1280px) {
  .suivi-grid { grid-template-columns: 1fr; }
  .side-col { position: static; max-height: none; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); order: -1; }
  .active-list { max-height: 330px; overflow-y: auto; }
}
@media (max-width: 1100px) { .overview { grid-template-columns: 1fr 1fr; } .overview .group:first-child { grid-column: 1 / -1; } }
@media (max-width: 900px) {
  .fleet-head { grid-template-columns: 16px 1fr; } .fchips { grid-column: 2; }
  .erow { grid-template-columns: 1fr 1fr; } .erow .msg { grid-column: 1 / -1; }
  .ev { grid-template-columns: 1fr auto; } .ev .msgc { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  main { padding: 12px 16px 60px; } .top { padding: 8px 16px; }
  .overview { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; } .frise { min-width: 0; }
  .acc-stats { grid-template-columns: repeat(2, 1fr); }
  .toolbar.sticky { position: static; }
}
