/* admin-gaviota — feuille de style unique. Thème clair par défaut, sombre selon le système ou la bascule. */
:root {
  color-scheme: light;
  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --border: #e1e4ea;
  --text: #16181c;
  --text-2: #565c66;
  --text-3: #858b95;
  --accent: #1f6fd0;
  --accent-soft: #e6f0fd;
  --s1: #257de0;
  --s2: #f47230;
  --s3: #00b894;
  --good: #0aac23;
  --warn: #fbb315;
  --crit: #dc3c3d;
  --na: #d5d9e0;
  --good-text: #06751a;
  --warn-text: #8a5700;
  --crit-text: #c02a2b;
  --tip-bg: #1d2025;
  --tip-text: #f3f4f6;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%);
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1113;
    --surface: #191b1f;
    --surface-2: #24272c;
    --border: #2c3036;
    --text: #eceef0;
    --text-2: #a3a9b2;
    --text-3: #747a84;
    --accent: #5aa5f2;
    --accent-soft: #1b2b40;
    --s1: #338ced;
    --s2: #e76624;
    --s3: #00a888;
    --na: #3a3f47;
    --good-text: #45cf5c;
    --warn-text: #fbb315;
    --crit-text: #f27a7b;
    --tip-bg: #2d3138;
    --tip-text: #f3f4f6;
    --shadow: none;
  }
  :root:not([data-theme="light"]) .i-moon { display: none; }
  :root:not([data-theme="light"]) .i-sun { display: inline; }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1113;
  --surface: #191b1f;
  --surface-2: #24272c;
  --border: #2c3036;
  --text: #eceef0;
  --text-2: #a3a9b2;
  --text-3: #747a84;
  --accent: #5aa5f2;
  --accent-soft: #1b2b40;
  --s1: #338ced;
  --s2: #e76624;
  --s3: #00a888;
  --na: #3a3f47;
  --good-text: #45cf5c;
  --warn-text: #fbb315;
  --crit-text: #f27a7b;
  --tip-bg: #2d3138;
  --tip-text: #f3f4f6;
  --shadow: none;
}
:root[data-theme="dark"] .i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: inline; }
.i-sun { display: none; }

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}
h1, h2, h3, h4, p, dl, dd, ol { margin: 0; padding: 0; }
ol { list-style: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.ico { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.push { margin-left: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; }
.placeholder { color: var(--text-3); padding: 12px 0; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--text-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); border-radius: 8px;
  padding: 7px 12px; cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn.icon { width: 34px; height: 34px; padding: 0; color: var(--text-2); }
.btn.primary { background: var(--s1); border-color: transparent; color: #fff; font-weight: 600; padding: 10px 14px; }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-align: left; }
.link:hover { text-decoration: underline; }
.input {
  border: 1px solid var(--border); background: var(--surface); border-radius: 8px;
  padding: 7px 10px; min-width: 0; height: 34px;
}
select.input { padding-right: 6px; max-width: 100%; }
.check { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
.check input { accent-color: var(--s1); width: 15px; height: 15px; margin: 0; }

/* ------------------------------------------------------------------ connexion */
.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card {
  width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px 24px; box-shadow: var(--shadow);
}
.login-card h1 { font-size: 20px; margin-top: 8px; }
.login-card label { font-size: 12px; font-weight: 600; color: var(--text-2); margin-top: 18px; }
.login-card input[type="password"] {
  border: 1px solid var(--border); background: var(--bg); border-radius: 8px; padding: 10px 12px; font-size: 16px; width: 100%;
}
.login-card .btn { margin-top: 12px; }
.login-logo { border-radius: 10px; }
.form-error { color: var(--crit-text); font-size: 13px; margin-top: 6px; }

/* ------------------------------------------------------------------ barre du haut */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1320px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; min-height: 52px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 6px; }
.tabs { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; align-self: stretch; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  display: inline-flex; align-items: center; padding: 0 12px; color: var(--text-2); font-weight: 500; white-space: nowrap;
  border-bottom: 2px solid transparent; border-top: 2px solid transparent;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; min-width: 92px; justify-content: flex-end; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--na); }
.live[data-status="live"] i { background: var(--good); animation: pulse 2s ease-out infinite; }
.live[data-status="connecting"] i, .live[data-status="reconnecting"] i { background: var(--warn); }
.live[data-status="reconnecting"] { color: var(--warn-text); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(10 172 35 / 50%); } 100% { box-shadow: 0 0 0 7px rgb(10 172 35 / 0%); } }

/* ------------------------------------------------------------------ mise en page */
.view { max-width: 1320px; margin: 0 auto; padding: 16px 16px 48px; display: flex; flex-direction: column; gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid { display: grid; gap: 14px; }
.grid > * { min-width: 0; }
.grid.flush { gap: 20px 32px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g2.wide-left { grid-template-columns: minmax(0, 2fr) 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)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-title { font-size: 13px; font-weight: 650; letter-spacing: .01em; }
.card > .card-title { margin-bottom: 10px; }
.card-figure { font-size: 18px; font-weight: 650; }
.more { font-size: 12px; }
.banner { background: color-mix(in srgb, var(--crit) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--crit) 40%, var(--surface)); color: var(--crit-text); border-radius: var(--radius); padding: 10px 14px; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--na); flex: none; }
.dot.ok { background: var(--good); }
.dot.warn { background: var(--warn); }
.dot.ko { background: var(--crit); box-shadow: 0 0 0 3px color-mix(in srgb, var(--crit) 22%, transparent); }
.state { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.state.big { font-size: 15px; font-weight: 650; }

.badge { display: inline-flex; align-items: center; font-size: 11.5px; line-height: 1; padding: 4px 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.badge.type { color: var(--text); font-weight: 500; }
.badge.ok { background: color-mix(in srgb, var(--good) 14%, var(--surface)); color: var(--good-text); }
.badge.warn { background: color-mix(in srgb, var(--warn) 20%, var(--surface)); color: var(--warn-text); }
.badge.ko { background: color-mix(in srgb, var(--crit) 14%, var(--surface)); color: var(--crit-text); font-weight: 600; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; cursor: pointer; color: var(--text-2); font-size: 12.5px; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / 12%); }

.ext { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.ext > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ext .ico { opacity: .55; }

/* couleurs de séries et d'états, partagées par tous les graphiques */
.c1 { --c: var(--s1); }
.c2 { --c: var(--s2); }
.c3 { --c: var(--s3); }
.free, .seg-na { --c: var(--na); }
.seg-ok { --c: var(--good); }
.seg-warn { --c: var(--warn); }
.seg-ko { --c: var(--crit); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); }
.legend.wrap { flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend b { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------------ tuiles et jauges */
.tile-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.tile-val { font-size: 24px; font-weight: 680; line-height: 1.25; letter-spacing: -.01em; }
.tile-sub { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile[data-level="crit"] .tile-val { color: var(--crit-text); }
.tile[data-level="warn"] .tile-val { color: var(--warn-text); }
.gauge { display: flex; align-items: center; gap: 14px; }
.gauge-ring { position: relative; width: 72px; height: 72px; flex: none; }
.gauge-ring svg { display: block; }
.gauge-track { fill: none; stroke: var(--surface-2); stroke-width: 7; }
.gauge-arc { fill: none; stroke: var(--s1); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .6s ease, stroke .3s; }
.gauge[data-level="warn"] .gauge-arc { stroke: var(--warn); }
.gauge[data-level="crit"] .gauge-arc { stroke: var(--crit); }
.gauge-val { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; font-weight: 680; }
.gauge-text { min-width: 0; }
.gauge-text .tile-label { font-size: 13px; color: var(--text); font-weight: 600; }
.gauge-text .tile-sub { white-space: normal; }

.kpis { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.kpi-val { font-size: 22px; font-weight: 680; line-height: 1.2; }
.kpis.small { margin: 12px 0; }
.kpis.small .kpi-val { font-size: 16px; }
.spark-wrap { margin: 14px 0 6px; height: 56px; }
.spark { width: 100%; height: 100%; display: block; }
.spark-line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; }
.spark-area { fill: var(--c); opacity: .12; }

.down-list { display: flex; flex-direction: column; gap: 8px; }
.down-row { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.quick-links { display: flex; flex-direction: column; gap: 10px; }
.ql-group { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 4px 12px; align-items: baseline; }
.ql-domain { font-weight: 600; color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.ql-list { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.ql { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.ql .dot { width: 7px; height: 7px; box-shadow: none; }

/* ------------------------------------------------------------------ serveur */
.facts { display: flex; flex-wrap: wrap; gap: 10px 32px; }
.fact { display: flex; flex-direction: column; min-width: 0; }
.fact span { font-size: 11.5px; color: var(--text-2); }
.fact b { font-weight: 600; font-size: 14px; white-space: nowrap; }
.fact:nth-child(n+3) b { min-width: 86px; }

.cores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; margin-bottom: 10px; }
.meter { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.meter-label { font-size: 12px; color: var(--text-2); min-width: 14px; font-family: var(--mono); }
.meter-track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; display: block; }
.meter-track i { display: block; height: 100%; width: 0; background: var(--s1); border-radius: 5px; transition: width .5s ease; }
.meter[data-level="warn"] .meter-track i { background: var(--warn); }
.meter[data-level="crit"] .meter-track i { background: var(--crit); }
.meter-val { font-size: 12.5px; min-width: 54px; text-align: right; white-space: nowrap; }
.stack-bar { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; }
.stack-bar i { background: var(--c); min-width: 2px; transition: width .5s ease; }
.disks { display: flex; flex-direction: column; gap: 14px; }
.disk { display: flex; flex-direction: column; gap: 4px; }
.svc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
.svc { display: flex; align-items: center; gap: 8px; min-width: 0; }
.svc .strong { white-space: nowrap; }
.svc .push { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; }
.kv dt { color: var(--text-2); white-space: nowrap; }
.kv dd { overflow-wrap: anywhere; }

.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--text-2); padding: 6px 10px 6px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 6px 10px 6px 0; border-bottom: 1px solid var(--border); white-space: nowrap; height: 32px; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table .links { display: flex; gap: 4px 12px; flex-wrap: wrap; border-bottom: 0; align-items: center; }
.table tr:not(:last-child) .links { box-shadow: inset 0 -1px 0 var(--border); }
.procs { table-layout: fixed; }
.procs th:nth-child(1) { width: 62px; }
.procs th:nth-child(2) { width: 96px; }
.procs th:nth-child(4) { width: 76px; }
.procs th:nth-child(5) { width: 92px; }
.procs .cmd { overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 12px; }
.procs .col-user { overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.pm2 { min-width: 760px; }
.certs { min-width: 520px; }
.certs .domains { white-space: normal; color: var(--text-2); font-size: 12.5px; overflow-wrap: anywhere; }
.sort { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 600; font-size: 11.5px; color: var(--text-2); display: inline-flex; align-items: center; gap: 3px; }
.sort .ico { visibility: hidden; }
th[aria-sort="descending"] .sort { color: var(--accent); }
th[aria-sort="descending"] .sort .ico { visibility: visible; }

/* ------------------------------------------------------------------ graphiques */
.chart { position: relative; width: 100%; }
.chart-svg { display: block; touch-action: pan-y; overflow: visible; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 6px; }
.chart-head h3 { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.chart-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 3; }
.chart-base, .chart-tick { stroke: var(--text-3); stroke-width: 1; opacity: .6; }
.chart-axis { fill: var(--text-2); font-size: 11px; }
.chart-empty { fill: var(--text-3); font-size: 12.5px; }
.chart-line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: var(--c); opacity: .1; }
.chart-dot { fill: var(--c); }
.chart-hover { fill: var(--c); stroke: var(--surface); stroke-width: 2; }
.chart-cross { stroke: var(--text-3); stroke-width: 1; }
.chart-mark { fill: var(--crit); }
.tip {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; max-width: 280px;
  background: var(--tip-bg); color: var(--tip-text); border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: 0 6px 20px rgb(0 0 0 / 25%);
}
.tip-title { font-weight: 600; margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.tip-row b { margin-left: auto; padding-left: 14px; font-weight: 600; }

.barlist { display: flex; flex-direction: column; gap: 3px; }
.barlist li { position: relative; display: flex; align-items: center; gap: 10px; padding: 5px 8px; min-height: 30px; border-radius: 5px; overflow: hidden; }
.bl-bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c); opacity: .16; border-radius: 5px; }
.bl-bar.seg-na { opacity: .45; }
.bl-label { position: relative; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-note { position: relative; color: var(--text-2); font-size: 12px; white-space: nowrap; }
.bl-val { position: relative; font-weight: 600; white-space: nowrap; min-width: 34px; text-align: right; }

/* ------------------------------------------------------------------ sites */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; }
.toolbar-controls .input[type="search"] { width: 240px; }
.toolbar-controls { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; min-width: 0; }
.sites-summary { display: flex; align-items: baseline; gap: 4px 14px; flex-wrap: wrap; }
.site-groups { display: flex; flex-direction: column; gap: 14px; }
.group .card-head { margin-bottom: 2px; }
.site {
  display: grid; align-items: center; gap: 8px 18px; padding: 10px 0; border-top: 1px solid var(--border);
  grid-template-columns: minmax(0, 1.5fr) 84px minmax(150px, 1.3fr) 204px 34px;
  grid-template-areas: "main http bar pcts toggle" "detail detail detail detail detail";
}
.site-list .site:first-child { border-top: 0; }
.site-main { grid-area: main; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.site-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.site-name > span { min-width: 0; display: flex; }
.site-host { font-weight: 600; font-size: 14.5px; color: var(--text); }
.site-host:hover { color: var(--accent); }
.site-meta { display: flex; flex-wrap: wrap; gap: 4px; padding-left: 18px; }
.site-http { grid-area: http; display: flex; flex-direction: column; align-items: flex-end; font-size: 12.5px; line-height: 1.3; }
.code { font-weight: 650; font-size: 13.5px; }
.code.ok { color: var(--good-text); }
.code.warn { color: var(--warn-text); }
.code.ko { color: var(--crit-text); }
.site-bar { grid-area: bar; min-width: 0; }
.ubar { display: flex; gap: 1px; height: 26px; touch-action: pan-y; }
.ubar i { flex: 1; min-width: 0; border-radius: 1.5px; background: var(--na); }
.ubar i.ok { background: var(--good); }
.ubar i.warn { background: var(--warn); }
.ubar i.ko { background: var(--crit); }
.ubar i.hover { opacity: .55; }
.site-pcts { grid-area: pcts; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; text-align: right; }
.site-pcts span { display: flex; flex-direction: column; }
.site-pcts small { color: var(--text-3); font-size: 11px; }
.site-pcts b { font-weight: 600; font-size: 13px; }
.site-pcts b.ok { color: var(--good-text); }
.site-pcts b.warn { color: var(--warn-text); }
.site-pcts b.ko { color: var(--crit-text); }
.site-toggle { grid-area: toggle; border-color: transparent; background: none; }
.site-toggle .ico { transition: transform .15s; }
.site.open .site-toggle .ico { transform: rotate(180deg); }
.site-detail { grid-area: detail; background: var(--bg); border-radius: 8px; padding: 12px 14px; min-width: 0; }
.incidents { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.incidents h4 { font-size: 12.5px; color: var(--text-2); }
.incident { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; font-size: 13px; }

/* ------------------------------------------------------------------ analytics */
.empty { text-align: center; padding: 36px 20px; }
.empty h2 { font-size: 16px; margin-bottom: 8px; }
.empty p { max-width: 560px; margin: 4px auto 0; }

/* ------------------------------------------------------------------ adaptatif */
@media (max-width: 1040px) {
  .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site {
    grid-template-columns: minmax(0, 1fr) auto 34px;
    grid-template-areas: "main http toggle" "bar bar bar" "pcts pcts pcts" "detail detail detail";
  }
  .site-pcts { text-align: left; grid-template-columns: repeat(3, auto); justify-content: start; gap: 18px; }
  .site-pcts span { flex-direction: row; gap: 6px; align-items: baseline; }
}
@media (max-width: 900px) {
  .g2, .g2.wide-left, .g3 { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .topbar-inner { gap: 0 12px; padding-top: 6px; }
  .tabs { order: 3; flex-basis: 100%; height: 40px; margin: 0 -16px; padding: 0 8px; }
  .tabs a { padding: 0 10px; }
  .ql-group { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .view { padding: 12px 12px 40px; gap: 12px; }
  .grid, .stack, .site-groups { gap: 12px; }
  .card { padding: 12px; }
  .table-wrap { margin: 0 -12px; padding: 0 12px; }
  .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g5 > :first-child { grid-column: 1 / -1; }
  .gauge { flex-direction: column; align-items: flex-start; gap: 8px; }
  .tile-val { font-size: 21px; }
  .cores, .svc-list { grid-template-columns: minmax(0, 1fr); }
  .col-user { display: none; }
  .procs th:nth-child(1) { width: 54px; }
  .procs th:nth-child(4) { width: 64px; }
  .procs th:nth-child(5) { width: 74px; }
  .facts { gap: 10px 20px; }
  .toolbar-controls { width: 100%; }
  .toolbar-controls .input[type="search"] { flex: 1 1 100%; }
  .site-meta { padding-left: 0; }
  .live { min-width: 0; }
  .live span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Processus : app pm2 en badge devant la commande */
.badge.app { background: var(--accent-soft); color: var(--text); font-family: var(--font); font-weight: 600; max-width: 45%; vertical-align: middle; margin-right: 2px; }

/* ---- Connexion perdue : les valeurs temps réel figées sont atténuées et signalées */
.stale-banner { max-width: 1288px; margin: 12px auto 0; width: calc(100% - 32px); box-sizing: border-box;
  background: color-mix(in srgb, var(--warn) 16%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 45%, var(--surface)); color: var(--warn-text); }
.view .gauge, .view .facts, .view .cores, .view .stack-bar, .view .meter, .view .card-figure, .view table.procs, .view table.pm2 { transition: opacity .3s ease; }
.view[data-stale="true"] .gauge,
.view[data-stale="true"] .facts,
.view[data-stale="true"] .cores,
.view[data-stale="true"] .stack-bar,
.view[data-stale="true"] .legend.wrap,
.view[data-stale="true"] .meter,
.view[data-stale="true"] .card-figure,
.view[data-stale="true"] table.procs,
.view[data-stale="true"] table.pm2 { opacity: .45; }
