/* ==========================================================================
   Vigie — design system (sombre)
   ========================================================================== */
:root {
  color-scheme: dark;
  /* Surfaces */
  --bg: #08090b;
  --bg-2: #0d0f12;
  --panel: rgba(255, 255, 255, .025);
  --panel-solid: #111317;
  --panel-hover: rgba(255, 255, 255, .045);
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .12);
  /* Encre */
  --ink: #eef0f3;
  --ink-2: #b7bdc8;
  --muted: #7d8594;
  --faint: #4d5462;
  /* Accent */
  --accent: #4e9de5;
  --accent-2: #7fc4ff;
  --accent-soft: rgba(78, 157, 229, .14);
  --accent-grad: linear-gradient(135deg, #4e9de5 0%, #7fc4ff 100%);
  /* Statuts (réservés, toujours avec icône + libellé) */
  --good: #0ca30c;
  --good-ink: #5fd35f;
  --warning: #fab219;
  --critical: #d03b3b;
  --critical-ink: #ff7a7a;
  /* Séries de graphes (palette validée CVD sur fond sombre) */
  --s-cpu: #3987e5;
  --s-ram: #d95926;
  --s-temp: #199e70;
  --s-disk: #c98500;
  /* Formes */
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 40px -24px rgba(0,0,0,.8);
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "Cascadia Mono", ui-monospace, Consolas, monospace;
  --sidebar: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font: 14px/1.55 var(--font);
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(127, 196, 255, .07), transparent 60%),
    radial-gradient(900px 500px at 10% -20%, rgba(78, 157, 229, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: #fff; }
a.link, .link { color: var(--accent); }
a.link:hover { color: #a9d2ff; }
::selection { background: rgba(78, 157, 229, .35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.num { font-variant-numeric: tabular-nums; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
        stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
svg.i.sm { width: 15px; height: 15px; vertical-align: -2px; }
svg.i.lg { width: 22px; height: 22px; }

/* ---------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px; border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0));
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font: 650 17px/1 var(--font-display); letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-grad); box-shadow: 0 6px 20px -6px rgba(78,157,229,.7); color: #0b0c10; }
.brand-mark svg { width: 17px; height: 17px; stroke-width: 2.2; }
.nav-label { padding: 14px 12px 6px; color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 10px;
  color: var(--ink-2); font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--panel-hover); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: #fff; box-shadow: inset 0 0 0 1px rgba(78,157,229,.25); }
.nav a.active svg { color: var(--accent); }
.nav .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--critical);
  color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.me:hover { background: var(--panel-hover); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #1d3553, #15283d); color: #e3f0ff; font-weight: 700; font-size: 12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.me .who { line-height: 1.25; min-width: 0; }
.me .who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who span { color: var(--muted); font-size: 12px; }
.logout { width: 100%; margin-top: 6px; }

main { padding: 28px clamp(16px, 3vw, 40px) 60px; max-width: 1440px; width: 100%; }
.topbar { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.topbar .spacer { flex: 1; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--ink); }
h1 { margin: 0; font: 650 26px/1.15 var(--font-display); letter-spacing: -.025em; display: flex; align-items: center; gap: 12px; }
.subtitle { color: var(--muted); margin-top: 6px; }
h2 { margin: 34px 0 12px; font: 600 13px/1 var(--font); color: var(--ink-2); letter-spacing: .01em;
     display: flex; align-items: center; gap: 8px; }
h2 .hint { color: var(--faint); font-weight: 500; }
.section-head { display: flex; align-items: center; gap: 12px; margin: 34px 0 12px; }
.section-head h2 { margin: 0; }
.section-head .spacer { flex: 1; }

/* ---------------------------------------------------------------- cartes */
.card {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; box-shadow: var(--shadow); backdrop-filter: blur(8px);
}
.card + .card { margin-top: 12px; }
.grid > .card, .grid-2 > .card, .settings-grid > .card, .client-grid > .card, .channels > * { margin-top: 0; }
.card.tight { padding: 14px 16px; }
.card.flush { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-2 { display: grid; gap: 14px; grid-template-columns: 1.6fr 1fr; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.stack > * + * { margin-top: 10px; }

/* KPI */
.kpi { display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.kpi-top { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-weight: 500; }
.kpi-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
.kpi-ico.accent { background: var(--accent-soft); color: var(--accent); }
.kpi-ico.good { background: rgba(12,163,12,.12); color: var(--good-ink); }
.kpi-ico.crit { background: rgba(208,59,59,.14); color: var(--critical-ink); }
.kpi-ico.warn { background: rgba(250,178,25,.12); color: var(--warning); }
.kpi-val { font: 650 34px/1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi-val small { font-size: 15px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 4px; }
.kpi-foot { color: var(--muted); font-size: 12.5px; }
.kpi-glow::after { content: ""; position: absolute; inset: auto -40% -60% auto; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(208,59,59,.22), transparent); pointer-events: none; }

/* Jauges circulaires (fiche poste) */
.gauge { display: flex; align-items: center; gap: 18px; }
.ring { position: relative; width: 84px; height: 84px; flex: none; }
.ring svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.ring .track { stroke: rgba(255,255,255,.07); }
.ring .val { stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.ring .center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 1px; font: 650 19px/1 var(--font-display);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ring .center small { font-size: 11px; color: var(--muted); font-weight: 500; align-self: flex-start; margin-top: 30px; }
.gauge .lbl { color: var(--ink-2); font-weight: 500; }
.gauge .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ---------------------------------------------------------------- statut */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px;
  font-size: 12px; font-weight: 600; color: var(--ink); background: rgba(255,255,255,.05);
  box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.status svg { width: 14px; height: 14px; stroke-width: 2.2; }
.status.critical { background: rgba(208,59,59,.14); box-shadow: inset 0 0 0 1px rgba(208,59,59,.35); }
.status.critical svg { color: var(--critical-ink); }
.status.warning { background: rgba(250,178,25,.10); box-shadow: inset 0 0 0 1px rgba(250,178,25,.3); }
.status.warning svg { color: var(--warning); }
.status.good { background: rgba(12,163,12,.12); box-shadow: inset 0 0 0 1px rgba(12,163,12,.35); }
.status.good svg { color: var(--good-ink); }
.status.muted { color: var(--muted); }
.status.accent { background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(78,157,229,.3); }
.status.accent svg { color: var(--accent); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.on { background: var(--good); box-shadow: 0 0 0 3px rgba(12,163,12,.18); animation: pulse 2.4s infinite; }
.dot.off { background: var(--critical); box-shadow: 0 0 0 3px rgba(208,59,59,.18); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(12,163,12,0); } }
@media (prefers-reduced-motion: reduce) { .dot.on { animation: none; } * { transition: none !important; } }

/* Barre de valeur dans les tableaux : la couleur porte le niveau, le texte reste en encre */
.meter { display: flex; align-items: center; gap: 6px; min-width: 80px; }
.meter .track { flex: 1; height: 6px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; min-width: 26px; }
.meter .fill { height: 100%; border-radius: 99px; background: var(--good); }
.meter .fill.warn { background: var(--warning); } .meter .fill.crit { background: var(--critical); }
.meter .v { width: 34px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 13px; }
.meter.big .track { height: 8px; }

/* ---------------------------------------------------------------- tableaux */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 12px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
     background: rgba(255,255,255,.015); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr, table tr { transition: background .12s; }
tr:hover td { background: rgba(255,255,255,.02); }
td.nowrap, .nowrap { white-space: nowrap; }
td.empty { text-align: center; padding: 38px 16px; color: var(--muted); }
.cell-main { display: flex; align-items: center; gap: 10px; font-weight: 550; }
.cell-sub { color: var(--muted); font-size: 12.5px; }
.host { display: flex; align-items: center; gap: 12px; }
.host-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.04);
  box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); flex: none; position: relative; }
.host-ico .dot { position: absolute; right: -2px; bottom: -2px; box-shadow: 0 0 0 2px var(--bg-2); animation: none; }
tr.clickable { cursor: pointer; }

/* ---------------------------------------------------------------- clients (cartes) */
.client-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.client-card { display: block; padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--panel);
  transition: transform .15s, border-color .15s, background .15s; }
.client-card:hover { transform: translateY(-2px); border-color: var(--line-strong); background: var(--panel-hover); }
.client-card .top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.client-card .logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 700;
  background: linear-gradient(135deg, rgba(78,157,229,.25), rgba(127,196,255,.15)); color: #e3f0ff; box-shadow: inset 0 0 0 1px rgba(78,157,229,.3); }
.client-card .name { font-weight: 600; font-size: 15px; }
.client-card .stats { display: flex; gap: 16px; color: var(--muted); font-size: 12.5px; margin-top: 12px; }
.client-card .stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
.bar-split { display: flex; gap: 2px; height: 6px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.06); }
.bar-split span { display: block; height: 100%; }
.bar-split .on { background: var(--good); } .bar-split .off { background: var(--critical); }

.client-logo, .host-logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 15px; font-weight: 700;
  background: linear-gradient(135deg, rgba(78,157,229,.25), rgba(127,196,255,.15)); color: #e3f0ff; box-shadow: inset 0 0 0 1px rgba(78,157,229,.3); flex: none; }
.host-logo { position: relative; color: var(--ink-2); }
.host-logo .dot { position: absolute; right: -3px; bottom: -3px; box-shadow: 0 0 0 3px var(--bg); }

/* ---------------------------------------------------------------- flux d'alertes */
.feed { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: 0; }
.feed-item:hover { background: rgba(255,255,255,.02); }
.feed-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; }
.feed-ico.critical { background: rgba(208,59,59,.14); color: var(--critical-ink); }
.feed-ico.warning { background: rgba(250,178,25,.12); color: var(--warning); }
.feed-ico.good { background: rgba(12,163,12,.12); color: var(--good-ink); }
.feed-title { font-weight: 550; }
.feed-meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.feed-meta a { color: var(--ink-2); } .feed-meta a:hover { color: #fff; }
.feed-side { display: flex; align-items: center; gap: 10px; }
.empty-state { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty-state .big { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center;
  background: rgba(12,163,12,.10); color: var(--good-ink); }
.empty-state b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ---------------------------------------------------------------- formulaires & boutons */
input, textarea, select {
  background: rgba(255,255,255,.035); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 9px 12px; font: inherit; transition: border-color .15s, box-shadow .15s, background .15s; max-width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, textarea:hover, select:hover { border-color: rgba(255,255,255,.2); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(78,157,229,.18); background: rgba(255,255,255,.05); }
select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237d8594' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
select option { background: var(--panel-solid); }
textarea { width: 100%; min-height: 76px; resize: vertical; }
input[type=number] { width: 110px; font-variant-numeric: tabular-nums; }
input[type=checkbox] { appearance: none; width: 18px; height: 18px; padding: 0; border-radius: 6px; vertical-align: -4px; cursor: pointer;
  display: inline-grid; place-content: center; margin: 0 6px 0 0; }
input[type=checkbox]::before { content: ""; width: 10px; height: 10px; transform: scale(0); transition: transform .12s;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); background: #0b0c10; }
input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::before { transform: scale(1); }
label.check { display: inline-flex; align-items: center; gap: 2px; cursor: pointer; }

.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 10px; border: 0; cursor: pointer; font: 600 13.5px/1 var(--font); white-space: nowrap;
  color: #0b0c10; background: var(--accent-grad); box-shadow: 0 8px 22px -10px rgba(78,157,229,.8), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .12s, filter .15s, background .15s, box-shadow .15s;
}
.btn:hover, button:hover { filter: brightness(1.08); color: #0b0c10; }
.btn:active, button:active { transform: translateY(1px); }
button.ghost, .btn.ghost { background: rgba(255,255,255,.04); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
button.ghost:hover, .btn.ghost:hover { background: rgba(255,255,255,.08); color: #fff; filter: none; }
button.danger { background: rgba(208,59,59,.16); color: #ffb3b3; box-shadow: inset 0 0 0 1px rgba(208,59,59,.45); }
button.danger:hover { background: var(--critical); color: #fff; filter: none; }
button.small, .btn.small { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
button.icon-only { width: 38px; padding: 0; }
form.inline { display: inline; }

/* Formulaires en grille label / champ */
.kv { display: grid; grid-template-columns: 220px 1fr; gap: 14px 20px; align-items: center; }
.kv > div:nth-child(odd) { color: var(--ink-2); font-weight: 500; }
.kv.narrow { grid-template-columns: 170px minmax(0, 1fr); }
.kv > div { min-width: 0; }
.kv .help { color: var(--muted); font-size: 12.5px; margin-top: 6px; font-weight: 400; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.checks { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 10px; }
.checks label { display: flex; align-items: center; gap: 4px; padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,.025);
  box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.checks label:hover { background: rgba(255,255,255,.05); }

/* Terminal / commande */
.terminal { position: relative; border-radius: var(--r); background: #06070a; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.terminal-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.terminal-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2a2e37; display: inline-block; }
.terminal pre { margin: 0; padding: 16px; white-space: pre-wrap; word-break: break-all; font: 12.5px/1.6 var(--mono); color: #cfe3ff; }
.copy-btn { margin-left: auto; }

/* Messages */
.flash, .error { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; }
.flash { background: rgba(12,163,12,.10); box-shadow: inset 0 0 0 1px rgba(12,163,12,.3); color: #c9f5c9; }
.error { background: rgba(208,59,59,.10); box-shadow: inset 0 0 0 1px rgba(208,59,59,.35); color: #ffd0d0; }
.flash svg { color: var(--good-ink); margin-top: 1px; } .error svg { color: var(--critical-ink); margin-top: 1px; }

/* Détails / zones repliables */
details { margin-top: 14px; border-radius: var(--r); border: 1px solid var(--line); background: rgba(255,255,255,.015); }
details > summary { list-style: none; cursor: pointer; padding: 14px 18px; color: var(--ink-2); font-weight: 500; display: flex; align-items: center; gap: 10px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
details[open] > summary::after { transform: rotate(-135deg); }
details > .body { padding: 4px 18px 18px; }
details.danger > summary { color: #ffb3b3; }
details .card { margin-top: 10px; }

/* Infos clé/valeur */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1px; background: var(--line); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
.fact { background: var(--bg-2); padding: 14px 18px; }
.fact .k { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.fact .v { margin-top: 4px; font-weight: 550; word-break: break-word; }

/* Onglets / filtres */
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { padding-left: 36px; width: 260px; }

/* ---------------------------------------------------------------- graphe */
.chart-card { padding: 18px 18px 10px; }
.chart-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; }
.legend button { height: 28px; padding: 0 10px; border-radius: 99px; font-weight: 500; font-size: 12.5px; color: var(--ink-2);
  background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px var(--line); filter: none; }
.legend button:hover { color: #fff; background: rgba(255,255,255,.06); }
.legend button[aria-pressed=false] { opacity: .45; }
.legend .sw { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: 220px; display: block; overflow: visible; }
.chart .grid-line { stroke: rgba(255,255,255,.06); stroke-width: 1; }
.chart .axis-label { fill: var(--faint); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .10; }
.chart .cross { stroke: rgba(255,255,255,.25); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .marker { stroke: var(--bg-2); stroke-width: 2; }
.tooltip { position: absolute; top: 0; pointer-events: none; min-width: 150px; padding: 10px 12px; border-radius: 12px;
  background: rgba(17,19,23,.92); backdrop-filter: blur(10px); box-shadow: 0 12px 30px -8px rgba(0,0,0,.8), inset 0 0 0 1px var(--line-strong);
  font-size: 12.5px; opacity: 0; transition: opacity .1s; z-index: 5; }
.tooltip.show { opacity: 1; }
.tooltip .t { color: var(--muted); margin-bottom: 6px; }
.tooltip .r { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .r span:first-child { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.tooltip .r b { font-variant-numeric: tabular-nums; }
.chart-empty { height: 220px; display: grid; place-items: center; color: var(--muted); }

/* ---------------------------------------------------------------- connexion */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(400px, 100%); padding: 34px; border-radius: 24px; background: rgba(17,19,23,.7); border: 1px solid var(--line-strong);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(78,157,229,.08); backdrop-filter: blur(16px); }
.auth-card .brand { padding: 0 0 26px; justify-content: center; font-size: 20px; }
.auth-card .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
.auth-card h1 { font-size: 20px; justify-content: center; margin-bottom: 4px; }
.auth-card .subtitle { text-align: center; margin-bottom: 24px; }
.auth-card label { display: block; color: var(--ink-2); font-weight: 500; margin: 14px 0 6px; font-size: 13px; }
.auth-card input { width: 100%; height: 42px; }
.auth-card button { width: 100%; height: 42px; margin-top: 22px; }

/* ---------------------------------------------------------------- matrice des rôles */
.yes { color: var(--good-ink); } .no { color: var(--faint); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .logout .lbl { display: none; } .logout { width: 34px; padding: 0; }
  .me { padding: 2px; } .avatar { width: 30px; height: 30px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { padding: 16px; border-radius: 16px; }
  .kpi-val { font-size: 28px; } .kpi-top { font-size: 13px; } .kpi-ico { width: 30px; height: 30px; }
  .gauge { flex-direction: column; align-items: flex-start; gap: 10px; }
  .feed-item { grid-template-columns: auto 1fr; } .feed-side { grid-column: 2; }
  .topbar { margin-bottom: 18px; } h1 { font-size: 22px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; padding: 10px 16px;
    border-right: 0; border-bottom: 1px solid var(--line); background: rgba(8,9,11,.85); overflow-x: auto; }
  .brand { padding: 0 8px 0 0; } .brand span, .nav-label, .sidebar-foot .who { display: none; }
  .nav { display: flex; gap: 2px; } .nav a { padding: 8px 10px; } .nav a span.lbl { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; border: 0; display: flex; align-items: center; gap: 6px; }
  .logout { width: auto; margin: 0; }
  main { padding: 20px 16px 50px; }
  .kv, .kv.narrow { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); } .kv > div:nth-child(even) { margin-bottom: 10px; }
  .search input { width: 100%; }
  .btn, button { white-space: normal; height: auto; min-height: 38px; padding-top: 8px; padding-bottom: 8px; text-align: center; }
  th, td { padding: 10px 12px; }
}

/* ---------------------------------------------------------------- réglages */
.settings-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.set-title { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 14px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.setting:first-of-type { border-top: 0; }
.channels { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.channel { padding: 14px; border-radius: var(--r); background: rgba(255,255,255,.02); box-shadow: inset 0 0 0 1px var(--line); }
.channel .muted { word-break: break-all; }

/* Bouton d'action secondaire dans les listes */
button.soft { background: var(--accent-soft); color: #d6e9ff; box-shadow: inset 0 0 0 1px rgba(78,157,229,.3); }
button.soft:hover { background: rgba(78,157,229,.25); color: #fff; filter: none; }
.user-cell { white-space: nowrap; }
.user-cell .dom { color: var(--faint); }

/* ---------------------------------------------------------------- édition en ligne (renommer) */
details.inline-edit { display: inline-block; position: relative; margin: 0; border: 0; background: none; font: 400 14px/1.5 var(--font); letter-spacing: 0; }
details.inline-edit > summary { padding: 6px; border-radius: 8px; color: var(--muted); }
details.inline-edit > summary::after { display: none; }
details.inline-edit > summary:hover { background: var(--panel-hover); color: var(--ink); }
details.inline-edit .popover { position: absolute; top: 38px; left: 0; z-index: 30; width: 340px; max-width: 80vw; padding: 16px; border-radius: 14px;
  background: rgba(17,19,23,.97); backdrop-filter: blur(12px); box-shadow: 0 20px 40px -12px rgba(0,0,0,.9), inset 0 0 0 1px var(--line-strong); }
details.inline-edit .popover input[name=alias] { width: 100%; margin-top: 6px; }

/* ---------------------------------------------------------------- déploiement */
.deploy-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
.deploy-card { position: relative; margin-top: 0 !important; }
.deploy-card h3 { margin: 0 0 6px; font: 600 15px/1.3 var(--font); display: flex; align-items: center; gap: 8px; padding-right: 40px; }
.deploy-card .step { position: absolute; top: 16px; right: 16px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(78,157,229,.3); }
.onboarding { border-color: rgba(78,157,229,.3); background: linear-gradient(180deg, rgba(78,157,229,.06), rgba(255,255,255,.01)); }
.onboarding .deploy-card { background: rgba(8,9,11,.5); }
.status.waiting svg { animation: spin 3s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1000px) { .deploy-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- sélection multiple */
th.sel, td.sel { width: 44px; padding-right: 0; }
td.sel input, th.sel input { margin: 0; }
tr.selected td { background: rgba(78,157,229,.07) !important; }
.bulk-bar { position: sticky; bottom: 18px; z-index: 15; margin-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px 12px 18px; border-radius: 16px; background: rgba(17,19,23,.92); backdrop-filter: blur(14px);
  box-shadow: 0 20px 40px -12px rgba(0,0,0,.9), inset 0 0 0 1px rgba(78,157,229,.35); animation: rise .18s ease-out; }
.bulk-bar[hidden] { display: none; }
.bulk-bar select { min-width: 200px; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
@media (max-width: 1380px) { .col-seen { display: none; } }

/* ---------------------------------------------------------------- marque VigiMIDE */
.brand-logo { display: block; height: 30px; width: auto; }
.brand-icon { display: none; width: 30px; height: 30px; }
.sidebar .brand { padding: 6px 10px 24px; }
.auth-card .brand-logo { height: 42px; margin: 0 auto; }
.auth-card .brand { padding: 4px 0 26px; }
.powered { color: var(--faint); font-size: 11.5px; text-align: center; margin-top: 18px; letter-spacing: .02em; }
.powered b { color: var(--muted); font-weight: 600; }
@media (max-width: 860px) { .sidebar .brand-logo { display: none; } .sidebar .brand-icon { display: block; } }

/* ---------------------------------------------------------------- rôles */
.matrix .perm-col { min-width: 320px; }
.matrix .role-col { text-align: center; min-width: 130px; text-transform: none; letter-spacing: 0; }
.matrix td.cell { text-align: center; }
.role-head { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.role-name { color: var(--ink); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
a.role-name:hover { color: var(--accent); }
.role-sub { color: var(--faint); font-size: 11.5px; font-weight: 500; }
.group-row td { background: rgba(255,255,255,.02); color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding-top: 10px; padding-bottom: 10px; }
.perm-card { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.perm { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; cursor: pointer;
  background: rgba(255,255,255,.02); box-shadow: inset 0 0 0 1px var(--line); transition: background .12s, box-shadow .12s; }
.perm:hover { background: rgba(255,255,255,.045); }
.perm:has(input:checked) { background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(78,157,229,.4); }
.perm input { margin-top: 2px; }
.perm .help { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.perm.disabled { opacity: .5; cursor: not-allowed; }
.matrix .perm-col { min-width: 260px; }
.matrix .role-col { min-width: 112px; }
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; z-index: 1; background: #0e1014; }
.matrix tr.group-row td { position: static; }

/* ---------------------------------------------------------------- santé disques */
.pdisk { padding: 16px 18px; }
.pdisk + .pdisk { margin-top: 0; }
.pdisk-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.pdisk-grid .k { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.pdisk-grid .warn { color: var(--warning); }
@media (max-width: 860px) { .pdisk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
