/* ═══════════════════════════════════════════════════════════════
   ARKIV — Backup Console
   Direction : console opérationnelle. Graphite, vert acide, données
   en monospace, angles nets, filets fins.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #0d0e0b;
  --bg-2: #111310;
  --panel: #151712;
  --panel-2: #1b1e17;
  --hover: #20241b;
  --line: #262a20;
  --line-2: #343a2b;
  --text: #ecefe0;
  --text-2: #b3b8a1;
  --muted: #777c69;
  --accent: #c8f03c;
  --accent-ink: #121405;
  --accent-text: #c8f03c;
  --accent-soft: rgba(200, 240, 60, 0.1);
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, 0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --err: #ff6b5b;
  --err-soft: rgba(255, 107, 91, 0.12);
  --run: #5ec8ff;
  --run-soft: rgba(94, 200, 255, 0.12);
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --grid: rgba(236, 239, 224, 0.035);

  --f-display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --f-body: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --r: 3px;
  --side: 244px;
  color-scheme: dark;
}

:root[data-theme='light'] {
  --bg: #efefe8;
  --bg-2: #e8e8e0;
  --panel: #fbfbf7;
  --panel-2: #f3f3ec;
  --hover: #ececE3;
  --line: #dddfd2;
  --line-2: #c9ccbb;
  --text: #15170f;
  --text-2: #474c3c;
  --muted: #7c8070;
  --accent: #c8f03c;
  --accent-ink: #121405;
  --accent-text: #4f6b00;
  --accent-soft: rgba(120, 160, 0, 0.12);
  --ok: #138a45;
  --ok-soft: rgba(19, 138, 69, 0.1);
  --warn: #b26b00;
  --warn-soft: rgba(178, 107, 0, 0.1);
  --err: #d0321f;
  --err-soft: rgba(208, 50, 31, 0.09);
  --run: #0b78b8;
  --run-soft: rgba(11, 120, 184, 0.1);
  --shadow: 0 24px 60px -24px rgba(30, 32, 20, 0.35);
  --grid: rgba(21, 23, 15, 0.04);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
.mono { font-family: var(--f-mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.dim { color: var(--text-2); }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.boot { display: grid; place-items: center; height: 100vh; }
.logo-mark {
  width: 22px; height: 22px; display: inline-block; flex: none;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / 100% 28% no-repeat,
    linear-gradient(color-mix(in srgb, var(--accent) 70%, transparent), color-mix(in srgb, var(--accent) 70%, transparent)) 0 50% / 100% 28% no-repeat,
    linear-gradient(color-mix(in srgb, var(--accent) 40%, transparent), color-mix(in srgb, var(--accent) 40%, transparent)) 0 100% / 100% 24% no-repeat;
}
.boot .logo-mark { width: 34px; height: 34px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ─────────────── Shell ─────────────── */

.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--bg-2);
  display: flex; flex-direction: column;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 22px 20px;
  border-bottom: 1px solid var(--line);
}
.brand b { font: 800 19px/1 var(--f-display); letter-spacing: -0.02em; }
.brand small { display: block; font: 500 10px/1 var(--f-mono); letter-spacing: 0.18em; color: var(--muted); margin-top: 5px; }
.nav { padding: 14px 10px; display: grid; gap: 2px; }
.nav-label { font: 500 10px/1 var(--f-mono); letter-spacing: 0.16em; color: var(--muted); padding: 14px 12px 8px; text-transform: uppercase; }
.nav a {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r);
  color: var(--text-2); font-weight: 500;
  position: relative;
}
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.active { background: var(--panel-2); color: var(--text); }
.nav a.active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; background: var(--accent); }
.nav a .num { font: 500 10px/1 var(--f-mono); color: var(--muted); }
.nav svg { width: 17px; height: 17px; }
.side-foot { margin-top: auto; padding: 14px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font: 700 13px/1 var(--f-mono); border-radius: var(--r);
}
.me .who { min-width: 0; }
.me .who b { display: block; font-weight: 600; font-size: 13px; }
.me .who span { font-size: 11px; color: var(--muted); font-family: var(--f-mono); }
.side-foot .row { display: flex; gap: 6px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 0 32px; height: 56px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.crumbs { font: 500 12px/1 var(--f-mono); color: var(--muted); letter-spacing: 0.04em; }
.crumbs b { color: var(--text); font-weight: 500; }
.topbar .spacer { flex: 1; }
.clock { font: 500 12px/1 var(--f-mono); color: var(--text-2); }
.health {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 100px;
  font: 500 12px/1 var(--f-mono);
}
.health .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.health.ok .dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.health.warn .dot { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.health.err .dot { background: var(--err); box-shadow: 0 0 0 4px var(--err-soft); animation: pulse 1.4s infinite; }
.health.run .dot { background: var(--run); box-shadow: 0 0 0 4px var(--run-soft); animation: pulse 1s infinite; }
.btn.menu-btn { display: none; }

.view {
  padding: 30px 32px 60px;
  max-width: 1440px; width: 100%;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
  flex: 1;
}

/* ─────────────── Page header ─────────────── */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.eyebrow { font: 500 11px/1 var(--f-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ''; width: 18px; height: 1px; background: currentColor; }
h1 { font: 800 34px/1.05 var(--f-display); letter-spacing: -0.03em; margin: 0; }
h2 { font: 700 17px/1.2 var(--f-display); letter-spacing: -0.01em; margin: 0; }
h3 { font: 600 14px/1.3 var(--f-body); margin: 0; }
.page-head p { margin: 8px 0 0; color: var(--text-2); max-width: 640px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ─────────────── Buttons & inputs ─────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--panel); color: var(--text);
  font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
}
.btn:hover { background: var(--hover); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: var(--err-soft); border-color: var(--err); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn.block { width: 100%; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rot 0.7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font: 500 11px/1.2 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 12px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r);
  outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; min-height: 90px; font-family: var(--f-mono); font-size: 12.5px; line-height: 1.5; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.mono { font-family: var(--f-mono); font-size: 13px; }
select.input { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }

.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { width: 18px; height: 18px; flex: none; margin-top: 1px; border: 1px solid var(--line-2); border-radius: 2px; display: grid; place-items: center; background: var(--bg-2); }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .box::after { content: ''; width: 9px; height: 5px; border: 2px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check input:focus-visible + .box { box-shadow: 0 0 0 3px var(--accent-soft); }
.check small { display: block; color: var(--muted); font-size: 12px; }

.switch { position: relative; width: 36px; height: 20px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 20px; transition: background 0.15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: var(--text); border-radius: 50%; transition: transform 0.15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); background: var(--accent-ink); }

.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); padding: 3px; background: var(--bg-2); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 2px; cursor: pointer; color: var(--text-2); font-weight: 500; font-size: 13px; display: inline-flex; align-items: center; gap: 7px; }
.seg button svg { width: 15px; height: 15px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg button.on svg { color: var(--accent-text); }

.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days button { width: 42px; height: 36px; border: 1px solid var(--line-2); background: var(--bg-2); border-radius: var(--r); cursor: pointer; font: 500 12px/1 var(--f-mono); color: var(--text-2); }
.days button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* ─────────────── Panels ─────────────── */

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-head .sub { font: 500 11px/1 var(--f-mono); color: var(--muted); letter-spacing: 0.05em; }
.panel-body { padding: 18px; }
.panel-body.flush { padding: 0; }
.stack { display: grid; gap: 18px; }
.grid-2 { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.grid-2.even { grid-template-columns: 1fr 1fr; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 34px; height: 34px; color: var(--line-2); margin-bottom: 10px; }
.empty b { display: block; color: var(--text); font: 700 16px/1.3 var(--f-display); margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--panel); border-radius: var(--r); margin-bottom: 18px; }
.kpi { padding: 18px 20px 20px; border-right: 1px solid var(--line); min-width: 0; position: relative; }
.kpi:last-child { border-right: 0; }
.kpi .k { font: 500 11px/1 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.kpi .v { font: 800 32px/1 var(--f-display); letter-spacing: -0.03em; margin-top: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v small { font: 500 14px/1 var(--f-mono); color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.kpi .s { font-size: 12px; color: var(--text-2); margin-top: 8px; font-family: var(--f-mono); }
.kpi.accent::after { content: ''; position: absolute; left: 0; top: 0; height: 2px; width: 100%; background: var(--accent); }

/* Status */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px 3px 7px; border-radius: 2px;
  font: 600 11px/1.3 var(--f-mono); letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--panel-2); color: var(--text-2); white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.run { background: var(--run-soft); color: var(--run); }
.badge.run::before { animation: pulse 1s infinite; }
.badge.plain::before { display: none; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border: 1px solid var(--line-2); border-radius: 2px; font: 500 11px/1.4 var(--f-mono); color: var(--text-2); white-space: nowrap; }
.tag svg { width: 12px; height: 12px; }
.sdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.sdot.ok { background: var(--ok); } .sdot.warn { background: var(--warn); } .sdot.err { background: var(--err); } .sdot.run { background: var(--run); animation: pulse 1s infinite; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font: 500 10.5px/1 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 12px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover td { background: var(--hover); }
.table .num { font-family: var(--f-mono); font-size: 12.5px; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

/* Chart */
.chart { width: 100%; height: 200px; display: block; }
.chart .axis { stroke: var(--line); }
.chart text { fill: var(--muted); font: 500 10px var(--f-mono); }
.chart .b-ok { fill: var(--ok); } .chart .b-warn { fill: var(--warn); } .chart .b-err { fill: var(--err); } .chart .b-none { fill: var(--line); }
.chart .col:hover rect { opacity: 0.8; }
.legend { display: flex; gap: 14px; font: 500 11px/1 var(--f-mono); color: var(--text-2); }
.legend i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; vertical-align: 0; }

/* Meter */
.meter { height: 6px; background: var(--line); border-radius: 0; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); }
.meter.warn > span { background: var(--warn); } .meter.err > span { background: var(--err); }
.meter.indet > span { width: 30% !important; background: var(--run); animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }

/* Storage card */
.sto { padding: 16px 18px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.sto:last-child { border-bottom: 0; }
.sto-top { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.sto-name { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.sto-name svg { width: 18px; height: 18px; color: var(--accent-text); flex: none; }
.sto-nums { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font: 500 12px/1.4 var(--f-mono); color: var(--text-2); }

/* Feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.feed li:hover { background: var(--hover); }
.feed li:last-child { border-bottom: 0; }
.feed .t { font: 500 11.5px/1 var(--f-mono); color: var(--muted); text-align: right; }
.feed .sub { font-size: 12px; color: var(--muted); font-family: var(--f-mono); }

/* Live run */
.live { display: grid; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.live:last-child { border-bottom: 0; }
.live-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.live-items { display: flex; flex-wrap: wrap; gap: 6px; }

/* Project cards */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.pcard.off { opacity: 0.6; }
.pcard .stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line-2); }
.pcard .stripe.ok { background: var(--ok); } .pcard .stripe.warn { background: var(--warn); } .pcard .stripe.err { background: var(--err); } .pcard .stripe.run { background: var(--run); }
.pcard-head { padding: 16px 18px 12px; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.pcard-head h2 { font-size: 18px; }
.pcard-head p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.route { display: flex; align-items: center; gap: 8px; padding: 0 18px 14px; flex-wrap: wrap; }
.route .arrow { color: var(--muted); font-family: var(--f-mono); }
.pcard dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.pcard dl > div { padding: 11px 18px; border-bottom: 1px solid var(--line); min-width: 0; }
.pcard dl > div:nth-child(odd) { border-right: 1px solid var(--line); }
.pcard dt { font: 500 10px/1 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.pcard dd { margin: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-foot { display: flex; gap: 6px; padding: 12px 18px; margin-top: auto; align-items: center; }
.pcard-foot .spacer { flex: 1; }

/* Form sections */
.fsec { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; padding: 26px 0; border-top: 1px solid var(--line); }
.fsec:first-of-type { border-top: 0; padding-top: 4px; }
.fsec-title .n { font: 600 11px/1 var(--f-mono); color: var(--accent-text); letter-spacing: 0.1em; }
.fsec-title h2 { margin-top: 8px; }
.fsec-title p { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
.dirs { display: grid; gap: 6px; }
.dir-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); font-family: var(--f-mono); font-size: 13px; }
.dir-row svg { width: 16px; height: 16px; color: var(--accent-text); flex: none; }
.dir-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 8px; background: var(--bg-2); }
.preview .expr { font: 600 13px/1 var(--f-mono); color: var(--accent-text); }
.preview ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font: 400 12.5px/1.4 var(--f-mono); color: var(--text-2); }
.preview li::before { content: '→ '; color: var(--muted); }
.form-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 16px 0; border-top: 1px solid var(--line); background: linear-gradient(transparent, var(--bg) 30%); margin-top: 10px; }
.callout { padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); font-size: 13px; border-radius: 0 var(--r) var(--r) 0; }
.callout.err { border-color: var(--err); background: var(--err-soft); }
.callout.ok { border-color: var(--ok); background: var(--ok-soft); }
.callout.warn { border-color: var(--warn); background: var(--warn-soft); }

/* Server list */
.srv-type { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg-2); flex: none; }
.srv-type svg { width: 18px; height: 18px; color: var(--accent-text); }
.srv-cell { display: flex; gap: 12px; align-items: center; min-width: 0; }

/* Modal */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(5, 6, 4, 0.6); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(620px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); animation: up 0.18s ease-out; }
.modal.wide { width: min(880px, 100%); }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--bg-2); }
.modal-foot .left { margin-right: auto; }

/* Explorer */
.explorer { display: grid; grid-template-rows: auto 1fr auto; height: min(560px, calc(100vh - 220px)); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ex-bar { display: flex; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); background: var(--bg-2); align-items: center; }
.ex-crumbs { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; font: 500 12.5px/1 var(--f-mono); padding: 0 4px; }
.ex-crumbs button { border: 0; background: transparent; cursor: pointer; padding: 5px 6px; border-radius: 2px; color: var(--text-2); font: inherit; }
.ex-crumbs button:hover { background: var(--hover); color: var(--text); }
.ex-crumbs .sep { color: var(--muted); }
.ex-list { overflow: auto; }
.ex-row { display: grid; grid-template-columns: 26px 22px 1fr auto auto; align-items: center; gap: 10px; padding: 7px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.ex-row:hover { background: var(--hover); }
.ex-row.sel { background: var(--accent-soft); }
.ex-row svg { width: 16px; height: 16px; color: var(--muted); }
.ex-row.is-dir svg { color: var(--accent-text); }
.ex-row .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-row.is-dir .nm { cursor: pointer; font-weight: 500; }
.ex-row.is-dir .nm:hover { text-decoration: underline; text-underline-offset: 3px; }
.ex-row .meta { font: 400 11.5px/1 var(--f-mono); color: var(--muted); white-space: nowrap; }
.ex-foot { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--bg-2); flex-wrap: wrap; min-height: 52px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 9px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 2px; font: 500 12px/1 var(--f-mono); max-width: 280px; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 2px 4px; line-height: 1; }
.chip button:hover { color: var(--err); }
.chip svg { width: 12px; height: 12px; display: block; }

/* Drawer */
.drawer-bg { position: fixed; inset: 0; z-index: 90; background: rgba(5, 6, 4, 0.5); animation: fade 0.15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 91; width: min(720px, 100%); background: var(--panel); border-left: 1px solid var(--line-2); display: flex; flex-direction: column; box-shadow: var(--shadow); animation: slide 0.2s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { padding: 20px 22px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.drawer-body { overflow: auto; padding: 20px 22px; display: grid; gap: 20px; align-content: start; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r); }
.facts > div { padding: 12px 14px; border-right: 1px solid var(--line); }
.facts > div:last-child { border-right: 0; }
.facts .k { font: 500 10px/1 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.facts .v { font: 600 15px/1.2 var(--f-mono); margin-top: 8px; }
.console { background: #090a07; color: #d6dac6; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; font: 400 12px/1.65 var(--f-mono); max-height: 360px; overflow: auto; }
.console div { white-space: pre-wrap; word-break: break-word; }
.console .ts { color: #6b705d; margin-right: 10px; }
.console .l-ok { color: #8ee86b; } .console .l-warn { color: #f5c04a; } .console .l-error { color: #ff7a6b; } .console .l-info { color: #d6dac6; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 12px 16px; cursor: pointer; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }

/* Toasts */
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); padding: 12px 14px; border-radius: var(--r); box-shadow: var(--shadow); font-size: 13px; animation: up 0.2s; display: flex; gap: 10px; align-items: flex-start; }
.toast.err { border-left-color: var(--err); }
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast b { display: block; }

/* Auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art {
  position: relative; overflow: hidden; padding: 44px; display: flex; flex-direction: column; justify-content: space-between;
  background: #0b0c09; color: #ecefe0; border-right: 1px solid var(--line);
}
.auth-art::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(236, 239, 224, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(236, 239, 224, 0.05) 1px, transparent 1px); background-size: 48px 48px; }
.auth-art > * { position: relative; }
.auth-art .big { font: 800 clamp(44px, 6vw, 84px)/0.92 var(--f-display); letter-spacing: -0.045em; margin: 0; }
.auth-art .big em { font-style: normal; color: #c8f03c; }
.tape { display: grid; gap: 7px; font: 500 12px/1 var(--f-mono); color: #8d927d; }
.tape div { display: flex; gap: 12px; align-items: center; }
.tape .bar { flex: 1; height: 4px; background: #1d2018; position: relative; overflow: hidden; }
.tape .bar i { position: absolute; inset: 0; background: #c8f03c; transform-origin: left; animation: fill 3.6s ease-in-out infinite; }
.tape div:nth-child(2) .bar i { animation-delay: 0.6s; } .tape div:nth-child(3) .bar i { animation-delay: 1.2s; } .tape div:nth-child(4) .bar i { animation-delay: 1.8s; }
@keyframes fill { 0% { transform: scaleX(0); } 60%, 100% { transform: scaleX(1); opacity: 0.25; } }
.tape .ok { color: #c8f03c; width: 30px; text-align: right; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-form form { width: min(380px, 100%); display: grid; gap: 18px; }
.auth-form h1 { font-size: 30px; }

/* ─────────────── Responsive ─────────────── */

@media (max-width: 1180px) {
  .grid-2, .grid-2.even { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(2) { border-right: 0; }
  .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .fsec { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 60; left: 0; width: 260px; transform: translateX(-100%); transition: transform 0.2s; }
  .shell.nav-open .side { transform: none; box-shadow: var(--shadow); }
  .btn.menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .clock { display: none; }
  .view { padding: 22px 16px 60px; }
  h1 { font-size: 28px; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 240px; padding: 28px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts > div:nth-child(2) { border-right: 0; }
  .facts > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .cards { grid-template-columns: 1fr; }
  .table th, .table td { padding: 11px 12px; }
  .hide-sm { display: none; }
  .ex-row { grid-template-columns: 26px 22px 1fr; }
  .ex-row .meta { display: none; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr; }
  .kpi { border-right: 0 !important; border-bottom: 1px solid var(--line); }
  .kpi:last-child { border-bottom: 0; }
  .health span.txt { display: none; }
}
