/* De Desk — donker terminal-thema. Tokens eerst, dan layout, dan componenten. */

:root {
  color-scheme: dark;
  --bg: #0a0b0d;
  --panel: #101216;
  --panel-2: #161a20;
  --panel-3: #1b2027;
  --border: #1f242c;
  --border-2: #2a313b;
  --text: #e6e8ec;
  --text-2: #9aa3b2;
  --muted: #6b7383;
  --grid: #1f242c;

  /* één accent voor interactie én de enige reeks in de grafiek (dark slot 1) */
  --accent: #3987e5;
  --accent-text: #6aa6f0;
  --accent-dim: rgba(57, 135, 229, 0.16);
  --accent-wash: rgba(57, 135, 229, 0.10);

  /* status (vast): goed / waarschuwing / ernstig / kritiek */
  --good: #0ca30c;
  --warn: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --up: #0ca30c;
  --down: #ef5350;            /* lichtere stap van kritiek-rood: 5,4:1 voor kleine tekst */
  --violet: #9085e9;
  --live: #ff4d6d;

  /* ordinale ramp voor de funnel (blauw 200→600, gevalideerd) */
  --ramp-1: #9ec5f4;
  --ramp-2: #6da7ec;
  --ramp-3: #3987e5;
  --ramp-4: #256abf;
  --ramp-5: #184f95;

  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 4px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body.modal-open { overflow: hidden; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
code, pre, .mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.dim { color: var(--text-2); }
.small { font-size: 11px; }
.up { color: var(--up); }
.down { color: var(--down); }
.neutral { color: var(--text-2); }
.warn-text { color: var(--warn); }
.nowrap { white-space: nowrap; }
.wrap { white-space: normal; }
.right { text-align: right; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.gap-lg { gap: 16px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- app-raamwerk ---------- */
.app { display: grid; overflow-x: clip; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr auto; min-height: 100vh; }
.main { padding: 12px; max-width: 1700px; width: 100%; margin: 0 auto; min-width: 0; }
.page > * { min-width: 0; }
.page { display: flex; flex-direction: column; gap: 12px; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 15px; font-weight: 600; letter-spacing: 0.02em; }
.page-title .sub { color: var(--muted); font-weight: 400; margin-left: 8px; font-size: 12px; }

/* statusstrook */
.strip {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 7px 12px; background: #0c0e11; border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 11.5px; color: var(--text-2);
}
.strip .brand { font-family: var(--sans); font-weight: 700; font-size: 14px; color: var(--text); letter-spacing: 0.02em; margin-right: 4px; display: flex; align-items: center; gap: 8px; }
.strip .brand .logo { width: 18px; height: 18px; border: 1px solid var(--border-2); border-radius: 3px; display: grid; place-items: center; font-size: 10px; color: var(--accent-text); }
.strip .item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.strip .item .k { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; }
.strip .item .v { color: var(--text); }
.strip .spacer { flex: 1; }
.strip .warnings { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.strip .clock { color: var(--text); }
.strip .btn-sm { font-family: var(--sans); }

/* navigatie */
.nav {
  display: flex; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--border);
  background: var(--bg); overflow-x: auto; scrollbar-width: none; white-space: nowrap;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: inline-block; padding: 9px 11px; color: var(--text-2); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.1em; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.active { color: var(--text); border-bottom-color: var(--accent); }
.nav a .cnt { margin-left: 5px; color: var(--muted); font-family: var(--mono); letter-spacing: 0; }

/* stoelenrij */
.seats {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px;
  background: var(--border); border-top: 1px solid var(--border);
}
.seat {
  background: #0c0e11; padding: 9px 12px; min-width: 0; display: flex; flex-direction: column; gap: 5px;
  position: relative;
}
.seat.chief { background: #0e1116; }
.seat-head { display: flex; justify-content: space-between; align-items: center; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-family: var(--mono); gap: 6px; }
.seat-head .status { display: inline-flex; align-items: center; gap: 5px; letter-spacing: 0.05em; }
.seat-name { font-weight: 700; font-size: 15px; letter-spacing: 0.04em; display: flex; align-items: center; gap: 8px; }
.seat-name .role { font-weight: 400; color: var(--muted); font-size: 10.5px; letter-spacing: 0.02em; }
.seat-meta { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; font-family: var(--mono); font-size: 11px; color: var(--text-2); }
.seat-meta .k { display: block; color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; }
.seat-meta .v { color: var(--text); }
.seat-err { font-size: 10.5px; color: var(--serious); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat.st-running { box-shadow: inset 0 2px 0 var(--good); }
.seat.st-error { box-shadow: inset 0 2px 0 var(--critical); }
.seat.st-halted { box-shadow: inset 0 2px 0 var(--critical); }
.seat.st-degraded { box-shadow: inset 0 2px 0 var(--warn); }

/* lampjes */
.light { display: inline-flex; align-items: center; gap: 6px; }
.light i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.04); }
.light-running i, .light-ok i, .light-good i { background: var(--good); box-shadow: 0 0 6px rgba(12, 163, 12, 0.6); animation: pulse 1.6s ease-in-out infinite; }
.light-ok i { animation: none; }
.light-idle i { background: #4a5261; }
.light-error i, .light-bad i { background: var(--critical); box-shadow: 0 0 6px rgba(208, 59, 59, 0.6); }
.light-halted i { background: var(--critical); box-shadow: 0 0 0 2px rgba(208, 59, 59, 0.35); }
.light-degraded i, .light-warn i { background: var(--warn); box-shadow: 0 0 6px rgba(250, 178, 25, 0.5); }
.light-poll i { background: var(--warn); }
.light-offline i { background: var(--critical); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .light i { animation: none !important; } }

/* ---------- panelen & roosters ---------- */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); min-height: 34px; }
.panel-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-2); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.panel-title::before { content: ""; width: 5px; height: 5px; background: var(--accent); border-radius: 1px; transform: rotate(45deg); }
.panel-right { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--muted); flex-wrap: wrap; justify-content: flex-end; }
.panel-body { padding: 10px 12px; min-width: 0; flex: 1; }
.panel-body.flush { padding: 0; }
.panel.refreshing .panel-body { opacity: 0.6; transition: opacity 0.2s; }

.grid { display: grid; gap: 12px; min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-32 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.span-2 { grid-column: span 2; }

/* stat-tegels */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tile-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.tile-value { font-family: var(--mono); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-delta { font-family: var(--mono); font-size: 12px; }
.tile-sub { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .meter { margin-top: 4px; }

/* badges */
.badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; border: 1px solid transparent; line-height: 1.5; white-space: nowrap; vertical-align: middle; }
.badge-good { color: #37c437; background: rgba(12, 163, 12, 0.14); border-color: rgba(12, 163, 12, 0.35); }
.badge-bad { color: #f07070; background: rgba(208, 59, 59, 0.14); border-color: rgba(208, 59, 59, 0.4); }
.badge-warn { color: var(--warn); background: rgba(250, 178, 25, 0.12); border-color: rgba(250, 178, 25, 0.35); }
.badge-accent { color: var(--accent-text); background: var(--accent-dim); border-color: rgba(57, 135, 229, 0.4); }
.badge-muted { color: var(--text-2); background: rgba(255, 255, 255, 0.04); border-color: var(--border-2); }
.badge-neutral { color: var(--text); background: rgba(255, 255, 255, 0.06); border-color: var(--border-2); }
.badge-violet { color: #b3abf5; background: rgba(144, 133, 233, 0.14); border-color: rgba(144, 133, 233, 0.4); }
.badge-live { color: #fff; background: var(--live); border-color: var(--live); font-weight: 700; }
.badge-lg { font-size: 12px; padding: 2px 8px; }

/* knoppen */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 11px; border-radius: var(--radius); border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text); cursor: pointer; font-size: 12px; line-height: 1.2; white-space: nowrap; }
.btn:hover { background: var(--panel-3); border-color: #343c48; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #4a93ea; border-color: #4a93ea; }
.btn-danger { background: rgba(208, 59, 59, 0.15); border-color: rgba(208, 59, 59, 0.6); color: #f28b8b; }
.btn-danger:hover { background: rgba(208, 59, 59, 0.3); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }
.btn-sm { padding: 3px 8px; font-size: 11px; }
.btn.busy::after { content: "…"; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* chips / filters */
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-2); background: transparent; color: var(--text-2); font-size: 10.5px; font-family: var(--mono); letter-spacing: 0.05em; cursor: pointer; }
.chip:hover { color: var(--text); border-color: #3a4350; }
.chip.active { background: var(--accent-dim); border-color: var(--accent); color: var(--text); }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }

/* formulieren */
.input, select.input, textarea.input { width: 100%; padding: 6px 8px; background: #0c0e11; border: 1px solid var(--border-2); border-radius: var(--radius); color: var(--text); font-family: var(--mono); font-size: 12px; }
.input:focus { border-color: var(--accent); outline: none; }
textarea.input { min-height: 70px; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.field > span { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.help { color: var(--muted); font-size: 11px; }
.msg-error { color: var(--down); font-size: 12px; margin-top: 8px; font-family: var(--mono); }
.msg-ok { color: var(--up); font-size: 12px; margin-top: 8px; font-family: var(--mono); }

/* tabellen */
.table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; padding: 6px 8px; border-bottom: 1px solid var(--border-2); background: var(--panel); position: sticky; top: 0; z-index: 1; }
.tbl td { padding: 5px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: rgba(255, 255, 255, 0.025); }
.tbl .al-r { text-align: right; }
.tbl .al-c { text-align: center; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tbl .ticker { font-weight: 700; color: var(--text); }
.tbl .wrapcell { white-space: normal; min-width: 220px; max-width: 420px; color: var(--text-2); }
.tbl tr.row-dim td { color: var(--muted); }
.tbl tr.row-alert td:first-child { box-shadow: inset 3px 0 0 var(--critical); }
.tbl tr.row-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.tbl-compact td, .tbl-compact th { padding: 4px 6px; }
.tbl details.inline summary { cursor: pointer; color: var(--accent-text); list-style: none; }
.tbl details.inline summary::-webkit-details-marker { display: none; }
.tbl details.inline[open] summary { color: var(--text-2); }
.tbl details.inline .reason { white-space: normal; max-width: 420px; min-width: 200px; color: var(--text-2); padding-top: 4px; font-family: var(--sans); font-size: 12px; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.kv:last-child { border-bottom: 0; }
.kv-k { color: var(--muted); }
.kv-v { font-family: var(--mono); text-align: right; word-break: break-all; }
.kvs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 24px; }

.ext .ext-arrow { font-size: 10px; margin-left: 2px; opacity: 0.7; }

.empty { padding: 18px 12px; text-align: center; color: var(--muted); font-size: 12px; }
.empty.error { color: var(--down); }
.loading { padding: 14px; color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 8px; }
.spin { width: 12px; height: 12px; border: 2px solid var(--border-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.section { display: flex; flex-direction: column; gap: 6px; }
.section-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }

.pre { font-family: var(--mono); font-size: 11.5px; line-height: 1.5; background: #0c0e11; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0; color: var(--text); max-height: 70vh; }
.pre.report { max-height: none; white-space: pre; overflow-x: auto; }

/* inklapbaar */
.collapsible { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2); }
.collapsible > summary { cursor: pointer; padding: 8px 10px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; }
.collapsible > summary::-webkit-details-marker { display: none; }
.collapsible > summary::before { content: "▸"; color: var(--muted); margin-right: 8px; font-size: 10px; }
.collapsible[open] > summary::before { content: "▾"; }
.collapsible-title { flex: 1; }
.collapsible-right { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.collapsible-body { padding: 0 10px 10px; }

/* JSON-boom */
.json { font-family: var(--mono); font-size: 11.5px; line-height: 1.55; }
.json details { margin: 0; }
.json summary { cursor: pointer; list-style: none; color: var(--text-2); white-space: normal; overflow-wrap: anywhere; }
.json summary::-webkit-details-marker { display: none; }
.json summary::before { content: "▸ "; color: var(--muted); }
.json details[open] > summary::before { content: "▾ "; }
.json details[open] > summary .json-preview { display: none; }
.json-children { padding-left: 16px; border-left: 1px solid var(--border); margin-left: 4px; }
.json-line { white-space: pre-wrap; word-break: break-word; }
.json-key { color: var(--accent-text); }
.json-str { color: #c9d2a7; }
.json-num { color: #f0b76a; }
.json-bool { color: #d78bd0; }
.json-null { color: var(--muted); font-style: italic; }
.json-brace { color: var(--muted); }
.json-preview { color: var(--muted); }

/* ---------- grafieken ---------- */
.chart { position: relative; width: 100%; min-width: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis-text { fill: var(--muted); font-family: var(--mono); font-size: 10px; }
.chart .baseline { stroke: #3a4350; stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline-text { fill: var(--text-2); font-family: var(--mono); font-size: 10px; }
.chart .area { fill: var(--accent); fill-opacity: 0.10; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .end-dot { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.chart .end-label { fill: var(--text); font-family: var(--mono); font-size: 11px; font-weight: 600; }
.chart .crosshair { stroke: var(--text-2); stroke-width: 1; shape-rendering: crispEdges; opacity: 0; }
.chart .hover-dot { fill: var(--accent); stroke: var(--panel); stroke-width: 2; opacity: 0; }
.chart.hover .crosshair, .chart.hover .hover-dot { opacity: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart:focus { outline: none; }
.chart:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chart-tip { position: fixed; z-index: 50; pointer-events: none; background: #181c23; border: 1px solid var(--border-2); border-radius: var(--radius); padding: 6px 9px; font-family: var(--mono); font-size: 11px; color: var(--text-2); box-shadow: var(--shadow); min-width: 120px; opacity: 0; transition: opacity 0.08s; }
.chart-tip.show { opacity: 1; }
.chart-tip .tip-val { color: var(--text); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.chart-tip .tip-val i { width: 10px; height: 2px; background: var(--accent); display: inline-block; }
.chart-tip .tip-sub { color: var(--muted); margin-top: 2px; }
.chart-empty { height: 160px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }

.sparkline { display: inline-block; vertical-align: middle; }
.sparkline .sl-line { fill: none; stroke: #5b6472; stroke-width: 1.5; stroke-linejoin: round; }
.sparkline .sl-thr { stroke: var(--critical); stroke-width: 1; stroke-dasharray: none; opacity: 0.7; shape-rendering: crispEdges; }
.sparkline .sl-dot { fill: var(--accent); stroke: var(--panel); stroke-width: 1.5; }
.sparkline .sl-dot.bad { fill: var(--critical); }

/* horizontale staven */
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar-row { display: grid; grid-template-columns: minmax(90px, 140px) 1fr 44px; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; }
.hbar-label { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 14px; position: relative; }
.hbar-fill { height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; transition: width 0.3s; }
.hbar-row:hover .hbar-fill, .hbar-row:focus-within .hbar-fill { filter: brightness(1.2); }
.hbar-val { text-align: right; color: var(--text); }

/* funnel */
.funnel { display: flex; flex-direction: column; gap: 7px; }
.funnel-row { display: grid; grid-template-columns: minmax(80px, 110px) 1fr 40px; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; }
.funnel-label { color: var(--text-2); white-space: nowrap; }
.funnel-track { height: 16px; position: relative; display: flex; align-items: center; gap: 8px; }
.funnel-bar { height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; transition: width 0.3s; }
.funnel-extra { display: inline-flex; gap: 4px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.funnel-val { text-align: right; color: var(--text); }

/* meter / gauge */
.meter { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.meter-track { position: relative; height: 6px; border-radius: 3px; background: var(--track, var(--accent-dim)); overflow: visible; }
.meter-fill { height: 100%; border-radius: 3px; background: var(--fill, var(--accent)); transition: width 0.3s; }
.meter-tick { position: absolute; top: -3px; width: 1px; height: 12px; background: var(--text-2); }
.meter-tick::after { content: attr(data-label); position: absolute; top: 12px; left: -2px; font-size: 9px; color: var(--muted); font-family: var(--mono); white-space: nowrap; }
.meter.with-tick { padding-bottom: 12px; }
.meter-text { font-family: var(--mono); font-size: 11px; color: var(--text-2); display: flex; justify-content: space-between; gap: 8px; }
.meter-text b { color: var(--text); font-weight: 600; }
.meter.sev-good { --fill: var(--good); --track: rgba(12, 163, 12, 0.18); }
.meter.sev-accent { --fill: var(--accent); --track: rgba(57, 135, 229, 0.18); }
.meter.sev-warn { --fill: var(--warn); --track: rgba(250, 178, 25, 0.18); }
.meter.sev-serious { --fill: var(--serious); --track: rgba(236, 131, 90, 0.18); }
.meter.sev-critical { --fill: var(--critical); --track: rgba(208, 59, 59, 0.2); }
.gauge { display: inline-flex; flex-direction: column; gap: 2px; min-width: 110px; }
.gauge .meter { width: 110px; }

/* WM-checks */
.wm-checks { display: flex; flex-direction: column; gap: 6px; }
.wm-check { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; font-family: var(--mono); font-size: 11.5px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.wm-check:last-child { border-bottom: 0; }
.wm-check .detail { color: var(--muted); font-size: 10.5px; grid-column: 1 / -1; margin-top: -4px; }

/* activiteitenlog */
.log { font-family: var(--mono); font-size: 11.5px; max-height: 520px; overflow-y: auto; display: flex; flex-direction: column; }
.log-row { display: grid; grid-template-columns: 62px 48px 1fr; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--border); align-items: start; }
.log-row:last-child { border-bottom: 0; }
.log-ts { color: var(--muted); }
.log-agent { color: var(--text-2); font-weight: 600; letter-spacing: 0.03em; }
.log-msg { color: var(--text); white-space: normal; word-break: break-word; }
.log-kind { color: var(--muted); margin-right: 6px; font-size: 10px; text-transform: uppercase; }
.log-row.lvl-info .log-msg { color: var(--text-2); }
.log-row.lvl-warn .log-msg { color: var(--warn); }
.log-row.lvl-error .log-msg { color: var(--down); }
.log-row.lvl-trade .log-msg { color: var(--text); }
.log-row.lvl-trade .log-agent { color: var(--accent-text); }
.log-row.lvl-warn { box-shadow: inset 2px 0 0 var(--warn); padding-left: 6px; }
.log-row.lvl-error { box-shadow: inset 2px 0 0 var(--critical); padding-left: 6px; }
.log-row.lvl-trade { box-shadow: inset 2px 0 0 var(--accent); padding-left: 6px; }
.log-row.fresh { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--accent-dim); } to { background: transparent; } }
.log-data { color: var(--muted); font-size: 10.5px; display: block; }

/* modals */
.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 12px; }
.modal { background: var(--panel); border: 1px solid var(--border-2); border-radius: 6px; width: min(560px, 100%); max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal-wide { width: min(1000px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 13px; letter-spacing: 0.04em; }
.modal-body { padding: 14px; overflow: auto; }
.modal-body p { margin: 0 0 8px; color: var(--text-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }

/* toasts */
.toasts { position: fixed; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 200; max-width: min(360px, calc(100vw - 24px)); }
.toast { background: #181c23; border: 1px solid var(--border-2); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: var(--radius); font-size: 12px; opacity: 0; transform: translateY(6px); transition: all 0.25s; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: none; }
.toast-ok { border-left-color: var(--good); }
.toast-error { border-left-color: var(--critical); }
.toast-warn { border-left-color: var(--warn); }

/* login */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at top, #10141b 0%, var(--bg) 60%); }
.login-box { width: min(360px, 100%); background: var(--panel); border: 1px solid var(--border-2); border-radius: 6px; padding: 22px; box-shadow: var(--shadow); }
.login-box h1 { font-size: 16px; letter-spacing: 0.04em; display: flex; align-items: center; gap: 10px; }
.login-box .sub { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; margin-top: 4px; }
.login-box .btn { width: 100%; margin-top: 14px; }

/* instellingen */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.control-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.control-row:last-child { border-bottom: 0; }
.control-row .lbl { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.control-row .lbl b { font-weight: 600; font-size: 12.5px; }
.control-row .lbl span { color: var(--muted); font-size: 11px; }
.switch { position: relative; width: 38px; height: 20px; border-radius: 999px; background: #2a313b; border: 1px solid var(--border-2); cursor: pointer; flex: none; transition: background 0.2s; padding: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #9aa3b2; transition: transform 0.2s, background 0.2s; }
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); background: #fff; }
.switch.danger[aria-checked="true"] { background: var(--live); border-color: var(--live); }
.switch:disabled { opacity: 0.5; cursor: not-allowed; }
.pubkey { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; word-break: break-all; }

/* rapporten */
.report-list .tbl td { cursor: pointer; }
.report-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; }

/* agent-kosten */
.cost-grid .tbl td.al-r { font-variant-numeric: tabular-nums; }

/* ---------- responsief ---------- */
@media (max-width: 1200px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .seats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-32, .settings-grid, .report-layout { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .seats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .log { max-height: 360px; }
}
@media (max-width: 600px) {
  .main { padding: 8px; }
  .page { gap: 8px; }
  .grid { gap: 8px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile-value { font-size: 20px; }
  .strip { gap: 8px 12px; padding: 6px 8px; }
  .strip .item.optional { display: none; }
  .seats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seat.chief { grid-column: 1 / -1; }
  .seat { padding: 8px 10px; }
  .seat-meta { grid-template-columns: 1fr 1fr 1fr; gap: 4px; font-size: 10.5px; }
  .form-row { grid-template-columns: 1fr; }
  .hbar-row { grid-template-columns: minmax(70px, 100px) 1fr 40px; }
  .funnel-row { grid-template-columns: 76px 1fr 32px; }
  .log-row { grid-template-columns: 54px 44px 1fr; font-size: 11px; }
  .modal-body { padding: 10px; }
  .panel-body { padding: 8px 10px; }
}

/* overzicht: grafiek + funnel/WM links, activiteit rechts over twee rijen */
.ov-top { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); grid-template-rows: auto auto; }
.ov-top .ov-log { grid-column: 2; grid-row: 1 / span 2; }
.ov-top .ov-mid { grid-column: 1; }
.ov-top .ov-log .log { max-height: 580px; }
@media (max-width: 900px) {
  .ov-top { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .ov-top .ov-log { grid-column: auto; grid-row: auto; }
  .ov-top .ov-mid { grid-column: auto; }
  .ov-top .ov-log .log { max-height: 380px; }
}
.row-ok td:first-child { box-shadow: inset 3px 0 0 var(--good); }
