/* ServerDash — gebaseerd op het Next Buzz Design System (/ds/styles.css).
   Licht thema is standaard; [data-theme="dark"] op <html> schakelt naar donker. */

:root {
  --ok: var(--success-500);
  --warn: var(--warning-500);
  --crit: var(--red-500);
  --pending: var(--ink-400);
  --accent: var(--red-500);
  --chart-blue: var(--info-500);

  --nb-header: rgba(255, 255, 255, .88);
  --crit-bg: #FDECEC; --crit-border: #E22830; --crit-fg: #9E171D; --crit-soft: #F4A7AA;
  --warn-bg: #FBF1DA; --warn-border: #E8A317; --warn-fg: #8A5D06; --warn-soft: #EEDDB0;
  --ok-bg: #E8F6EE; --ok-fg: #157347;
  --tile-shadow: var(--shadow-sm);
  --tile-crit-shadow: 0 10px 28px rgba(226, 40, 48, .18);
  --code-fg: var(--ink-700);
  --chart-axis: #767674;
  --chart-grid: rgba(24, 24, 24, .07);
  color-scheme: light;
}

[data-theme="dark"] {
  --surface-page: #1b1a17; --surface-alt: #141310; --surface-card: #26241f; --surface-sunken: #302d27;
  --text-strong: #F7F6F3; --text-default: #E7E6E1; --text-muted: #A9A7A1; --text-subtle: #8A867E;
  --border-subtle: #38342c; --border-default: #454036; --border-strong: #A9A7A1;
  --red-50: #2c1416; --red-200: #5e2327; --red-700: #F4A7AA; --text-link: #ED777C;
  --nb-header: rgba(26, 24, 20, .92);
  --crit-bg: #2c1416; --crit-fg: #F4A7AA; --crit-soft: #5e2327;
  --warn-bg: #2a2410; --warn-fg: #E8C877; --warn-soft: #5a4a1f;
  --ok-bg: #14321f; --ok-fg: #86efac;
  --tile-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  --tile-crit-shadow: 0 10px 28px rgba(226, 40, 48, .28);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, .5);
  --code-fg: #C5C5C1;
  --chart-axis: #A9A7A1;
  --chart-grid: rgba(255, 255, 255, .07);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--surface-alt); color: var(--text-default); font-size: var(--text-sm); line-height: 1.45; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
h2, h3, h4 { margin: 0; }
h2 { font-weight: 800; font-size: var(--text-h3); }
h3 { font-weight: 700; font-size: var(--text-h4); }
code, pre, .mono { font-family: var(--font-mono); font-size: 12.5px; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px;
  min-height: 64px; padding: 10px var(--gutter);
  background: var(--nb-header); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-subtle);
}
.brand {
  display: flex; align-items: center; gap: 10px; font-family: var(--font-heading); font-weight: 800; font-size: 18px;
  letter-spacing: var(--tracking-tight); color: var(--text-strong);
}
.logo { width: 26px; height: 26px; flex: none; background: url(/img/nextbuzz-arrow.png) center / contain no-repeat; }
.topbar nav { display: flex; gap: 2px; flex-wrap: wrap; }
.topbar nav a {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: var(--radius-pill);
  font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); transition: all var(--dur-fast);
}
.topbar nav a:hover { background: var(--surface-alt); color: var(--text-default); }
.topbar nav a.active { background: var(--surface-sunken); color: var(--text-strong); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.conn { display: inline-flex; align-items: center; gap: 7px; color: var(--text-muted); font-size: var(--text-xs); white-space: nowrap; }
.conn.err { color: var(--crit); }
.conn::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.conn.err::before { background: var(--crit); }

.theme-toggle {
  position: relative; width: 54px; height: 28px; flex: none; padding: 0; cursor: pointer;
  border-radius: var(--radius-pill); border: 1px solid var(--border-default); background: var(--surface-sunken);
  transition: background var(--dur-base) var(--ease-out);
}
.theme-toggle svg { position: absolute; top: 50%; transform: translateY(-50%); }
.theme-toggle .sun { left: 8px; }
.theme-toggle .moon { right: 9px; fill: #9B9B98; }
.theme-toggle .knob {
  position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform var(--dur-base) var(--ease-out);
}
[data-theme="dark"] .theme-toggle { background: var(--red-500); }
[data-theme="dark"] .theme-toggle .moon { fill: #fff; }
[data-theme="dark"] .theme-toggle .knob { transform: translateX(26px); }

main { width: 100%; margin: 0 auto; padding: 28px var(--gutter) 64px; }

/* ---------- paginakop ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 24px; }
.page-head h1, .toolbar h2 {
  margin: 0; font-family: var(--font-heading); font-weight: 800; font-size: var(--text-h3);
  letter-spacing: var(--tracking-tight); color: var(--text-strong);
}
.page-head p { margin: 4px 0 0; color: var(--text-muted); font-size: var(--text-sm); }
.page-head .right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- knoppen & formulieren ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap;
  font: inherit; font-family: var(--font-body); font-weight: 700; font-size: 14px; line-height: 1;
  padding: 10px 18px; border-radius: var(--radius-button); border: 1.5px solid transparent; cursor: pointer;
  background: var(--color-primary); color: var(--color-on-primary); box-shadow: var(--shadow-brand);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.btn:hover { background: var(--color-primary-hover); box-shadow: var(--shadow-lg); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost {
  background: transparent; color: var(--text-default); border: 1px solid var(--border-default); box-shadow: none; font-weight: 600;
}
.btn.ghost:hover { background: var(--surface-alt); border-color: var(--border-strong); }
.btn.danger { background: transparent; color: var(--red-600); border: 1px solid var(--red-200); box-shadow: none; font-weight: 600; }
.btn.danger:hover { background: var(--red-50); }
[data-theme="dark"] .btn.danger { color: var(--red-700); }
.btn.small { padding: 7px 13px; font-size: var(--text-xs); }
.btn.block { width: 100%; padding: 14px 24px; font-size: 16px; }
.btn .arrow { display: inline-block; transition: transform var(--dur-base) var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }

input, select, textarea {
  font: inherit; color: var(--text-default); background: var(--surface-page); border: 1px solid var(--border-default);
  border-radius: var(--radius-sm); padding: 9px 11px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus-ring); outline-offset: -1px; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--red-500); }
label { display: grid; gap: 6px; color: var(--text-muted); font-size: var(--text-xs); font-weight: 600; }
.form-error { color: var(--red-600); min-height: 1em; font-size: var(--text-xs); }
[data-theme="dark"] .form-error { color: var(--red-700); }

/* segmentknoppen: rode pil voor de actieve optie */
.seg { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.seg button {
  font: inherit; font-size: var(--text-sm); font-weight: 600; padding: 6px 14px; border-radius: var(--radius-pill); cursor: pointer;
  border: 1px solid var(--border-subtle); background: var(--surface-card); color: var(--text-muted);
  transition: all var(--dur-fast);
}
.seg button:hover { color: var(--text-default); border-color: var(--border-default); }
.seg button.on { background: var(--red-500); border-color: var(--red-500); color: #fff; }
/* tabbladen binnen een paneel (processen) */
.seg.tabs { gap: 4px; padding: 3px; background: var(--surface-sunken); border-radius: var(--radius-pill); }
.seg.tabs button { border: 0; background: transparent; font-size: var(--text-xs); padding: 5px 12px; }
.seg.tabs button.on { background: var(--surface-card); color: var(--text-strong); box-shadow: var(--shadow-xs); }

/* ---------- toolbar / summary ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; align-items: center; }
.filters input { width: 220px; border-radius: var(--radius-pill); padding: 7px 14px; }
.summary { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: var(--radius-pill);
  font-size: var(--text-sm); font-weight: 600; background: var(--surface-card); color: var(--text-default);
  border: 1px solid var(--border-subtle);
}
.chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-400); }
.chip.crit::before { background: var(--crit); }
.chip.warn::before { background: var(--warn); }
.chip.ok::before { background: var(--ok); }
.chip.crit.has { background: var(--crit-bg); border-color: var(--crit-soft); color: var(--crit-fg); }
.chip.warn.has { background: var(--warn-bg); border-color: var(--warn-soft); color: var(--warn-fg); }
.hint { color: var(--text-subtle); font-size: var(--text-xs); }

/* ---------- server-tegels ---------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-auto-flow: dense; gap: 20px; align-items: stretch;
}
.tile-groups { display: grid; gap: 20px; }
.tile-groups .empty { padding: 40px; }
.grid-crit { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-rest { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-crit .tile.big { grid-column: auto; }
@media (max-width: 1400px) { .grid-rest { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .grid-crit, .grid-rest { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid-crit, .grid-rest { grid-template-columns: 1fr; } }

.tile {
  display: flex; flex-direction: column; gap: 14px; padding: 20px; position: relative; color: var(--ok);
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  box-shadow: var(--tile-shadow);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tile > * { color: var(--text-default); }
.tile-head { display: flex; align-items: center; gap: 9px; }
.tile-head > div { min-width: 0; }
.tile-name {
  font-family: var(--font-heading); font-weight: 700; font-size: 15px; letter-spacing: var(--tracking-snug);
  color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile-host { color: var(--text-subtle); font-size: var(--text-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: -10px; }
.tile .badge { margin-left: auto; }
.badge {
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--surface-sunken); color: var(--text-muted); white-space: nowrap;
}
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 0 3px rgba(31, 157, 85, .18); }
.lvl-warn .dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(232, 163, 23, .2); }
.lvl-crit .dot { background: var(--crit); box-shadow: 0 0 0 3px rgba(226, 40, 48, .22); animation: nbpulse 1.6s infinite; }
.lvl-pending .dot, .lvl-muted .dot { background: var(--pending); box-shadow: none; }
@keyframes nbpulse {
  0% { box-shadow: 0 0 0 0 rgba(226, 40, 48, .5); }
  70% { box-shadow: 0 0 0 7px rgba(226, 40, 48, 0); }
  100% { box-shadow: 0 0 0 0 rgba(226, 40, 48, 0); }
}

.tile.lvl-warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn); }
.tile.lvl-crit { background: var(--crit-bg); border-color: var(--crit-border); color: var(--crit); box-shadow: var(--tile-crit-shadow); }
.tile.lvl-muted { opacity: .55; color: var(--pending); }
.tile.lvl-pending { background: var(--surface-alt); border-style: dashed; color: var(--pending); box-shadow: none; }
[data-theme="dark"] .tile.lvl-pending { background: var(--surface-sunken); }
.tile.big { grid-column: span 2; }
.tile.big .tile-name { font-size: 20px; }
.tile.big .spark { height: 72px; }
.tile-empty { color: var(--text-subtle); font-size: var(--text-sm); flex: 1; display: grid; place-items: center; text-align: center; padding: 28px 0; }

.meters { display: grid; gap: 9px; margin-top: auto; }
.meter { display: grid; grid-template-columns: 38px 1fr 52px; align-items: center; gap: 10px; font-size: var(--text-xs); }
.meter .ml { color: var(--text-muted); font-weight: 600; }
.meter .mv { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar { height: 7px; background: var(--surface-sunken); border-radius: 4px; overflow: hidden; display: block; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 4px; }
.meter.warn .bar i, .bar.warn i { background: var(--warn); }
.meter.crit .bar i, .bar.crit i { background: var(--crit); }
.meter.warn .mv { color: var(--warn); }
.meter.crit .mv { color: var(--crit); }

.spark { width: 100%; height: 42px; display: block; }
.spark path.l { stroke: currentColor; stroke-width: 2; stroke-linejoin: round; fill: none; }
.spark path.a { fill: currentColor; opacity: .12; stroke: none; }
.tile .spark { color: inherit; }
.tile-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: var(--text-xs); font-weight: 600; color: var(--warn-fg); }
.issues li { padding-left: 14px; position: relative; }
.issues li::before { content: ''; position: absolute; left: 0; top: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.issues li.crit { color: var(--crit); }
[data-theme="dark"] .issues li.crit { color: var(--crit-fg); }
.issues li.crit::before { background: var(--crit); }
.issues li.info { color: var(--text-muted); }
.issues li.info::before { background: var(--info-500); }
.empty { color: var(--text-subtle); padding: 40px; text-align: center; grid-column: 1 / -1; }
.empty a { color: var(--text-link); font-weight: 600; }

/* ---------- panels ---------- */
.panel {
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 20px 22px; margin-top: 18px; min-width: 0;
}
.panel h3 { margin-bottom: 14px; }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h3 { margin: 0; }
.panel-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cols3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 18px; }
.cols > .panel, .cols3 > .panel { margin-top: 18px; }
.panel a:not(.btn):not(.badge):not(.chip), td a { color: var(--text-link); font-weight: 600; }

.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 360px; overflow: auto; }
.events li {
  display: grid; grid-template-columns: 120px 170px 1fr; gap: 12px; padding: 9px 10px; border-radius: var(--radius-sm);
  font-size: var(--text-sm); align-items: center;
}
.events li > :nth-child(2) { font-weight: 700; color: var(--text-default); }
.events.compact li { grid-template-columns: 120px 1fr; }
.events li:hover { background: var(--surface-alt); }
.events li.muted { display: block; }
.events .t { color: var(--text-subtle); font-variant-numeric: tabular-nums; font-size: var(--text-xs); font-weight: 400; }
.events .lvl-crit { color: var(--crit); font-weight: 500; }
.events .lvl-warn { color: var(--warn-fg); font-weight: 500; }
.events .lvl-ok { color: var(--ok); font-weight: 500; }

/* ---------- detail ---------- */
.dhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.dhead h2 { font-size: 28px; font-weight: 800; }
.dhead .dot { width: 12px; height: 12px; }
.back { color: var(--text-muted); font-size: 22px; padding: 0 4px; }
.back:hover { color: var(--text-strong); }
.lvl-label { padding: 4px 12px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; background: var(--ok-bg); color: var(--ok-fg); }
.lvl-warn .lvl-label { background: var(--warn-bg); color: var(--warn-fg); }
.lvl-crit .lvl-label { background: var(--red-50); color: var(--red-700); }
.lvl-pending .lvl-label, .lvl-muted .lvl-label { background: var(--surface-sunken); color: var(--text-muted); }
.dsub { color: var(--text-muted); margin: 0 0 16px 38px; font-size: var(--text-sm); }
.alert {
  border: 1px solid var(--red-200); background: var(--red-50); border-radius: var(--radius-md); padding: 12px 16px; margin-bottom: 18px;
}
.alert .issues { font-size: var(--text-sm); color: var(--red-700); }
.alert .issues li::before { top: 6px; }
.alert.warn { border-color: var(--warn-soft); background: var(--warn-bg); }
.alert.warn .issues { color: var(--warn-fg); }
.alert .issues { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 20px; }

.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 18px; }
.chart {
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 16px 18px 10px; min-width: 0;
}
.chart h4 {
  margin: 0 0 10px; font-family: var(--font-heading); font-weight: 700; font-size: var(--text-sm); color: var(--text-strong);
  letter-spacing: 0; display: flex; justify-content: space-between;
}
.chart h4 span { color: var(--text-subtle); font-weight: 400; font-family: var(--font-body); }
.chart .plot { cursor: crosshair; }
.chart .nodata { height: 200px; display: grid; place-items: center; color: var(--text-subtle); }

.uplot { font-family: inherit; }
.uplot .u-legend { font-size: 12px; color: var(--text-muted); text-align: left; padding-top: 4px; }
.uplot .u-legend .u-series th { font-weight: 400; }
.uplot .u-legend .u-series > * { padding: 1px 4px; }
.uplot .u-legend .u-value { color: var(--text-default); font-variant-numeric: tabular-nums; }
.uplot .u-select { background: rgba(226, 40, 48, .12); }

/* ---------- tabellen ---------- */
.table-wrap { overflow: auto; max-height: 560px; }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th {
  text-align: left; color: var(--text-subtle); font-weight: 600; font-size: var(--text-xs); padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle); position: sticky; top: 0; background: var(--surface-card); white-space: nowrap;
}
td { padding: 8px 10px; border-bottom: 1px solid var(--surface-sunken); white-space: nowrap; }
tr:hover td { background: var(--surface-alt); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.cmd { max-width: 520px; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
td .cellbar {
  display: inline-block; width: 56px; height: 6px; background: var(--surface-sunken); border-radius: 3px;
  vertical-align: middle; margin-right: 8px; overflow: hidden;
}
td .cellbar i { display: block; height: 100%; background: var(--red-400); }
td.hot { color: var(--crit); font-weight: 700; }
td.warm { color: var(--warn-fg); font-weight: 600; }
td.actions { text-align: right; }
td.actions .btn { margin-left: 5px; }
.state { font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: var(--radius-pill); background: var(--ok-bg); color: var(--ok-fg); }
.state.bad { background: var(--crit-bg); color: var(--crit-fg); }
.state.idle { background: var(--surface-sunken); color: var(--text-muted); }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: var(--text-sm); margin: 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; word-break: break-word; color: var(--text-default); }

.disk { margin-bottom: 14px; }
.disk-head { display: flex; justify-content: space-between; font-size: var(--text-sm); margin-bottom: 5px; }
.disk-head b { color: var(--text-strong); }
.disk-head span { color: var(--text-muted); }
.disk .bar { height: 9px; border-radius: 5px; }
.disk .sub { font-size: 11px; color: var(--text-subtle); margin-top: 4px; }

/* ---------- websites ---------- */
.site-stats { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 7px 16px; font-size: var(--text-xs); }
.site-stats div { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
.site-stats span { color: var(--text-subtle); }
.site-stats b { font-weight: 700; font-variant-numeric: tabular-nums; }
.site-stats b.warn { color: var(--warn); }
.site-stats b.crit { color: var(--crit); }
.tile.big .site-stats { font-size: var(--text-sm); }
.site-links { display: flex; flex-wrap: wrap; gap: 8px; }
.panel .site-links a {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--surface-card); border: 1px solid var(--border-subtle); font-size: var(--text-xs); color: var(--text-default);
}
.panel .site-links a:hover { border-color: var(--border-default); background: var(--surface-alt); }
.site-links .dot { width: 8px; height: 8px; }
.shares { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px 28px; }
.share-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.share-head span { color: var(--text-muted); }
.share-head b { font-family: var(--font-heading); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.share .bar { height: 8px; border-radius: 5px; }
.share small { display: block; color: var(--text-subtle); font-size: 11px; margin-top: 5px; line-height: 1.4; }
.toplist table { font-size: var(--text-xs); }
.toplist td.cmd { max-width: 260px; }
a.badge:hover { color: var(--text-strong); background: var(--border-subtle); }

/* ---------- rollen, navigatie ---------- */
.role-viewer .admin-only { display: none !important; }
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; font-size: 10px; font-weight: 700; background: var(--warn); color: #1a1205;
}
.nav-badge.crit { background: var(--red-500); color: #fff; }
a.chip { cursor: pointer; }
.badge.sec { background: var(--red-50); color: var(--red-700); }
.badge.ok { background: var(--ok-bg); color: var(--ok-fg); }
.lvl-crit { color: var(--crit); }
dd.lvl-warn, p.lvl-warn, td.lvl-warn, b.lvl-warn { color: var(--warn-fg); font-weight: 600; }
dd.lvl-crit, td.lvl-crit, b.lvl-crit { color: var(--crit); font-weight: 600; }
.dhead .lvl-crit, .tile .lvl-crit { color: inherit; }
td .cellbar.warn i { background: var(--warn); }
td .cellbar.crit i { background: var(--crit); }
table.clickable tbody tr { cursor: pointer; }
details summary { cursor: pointer; color: var(--text-muted); font-size: var(--text-sm); }
details[open] summary { color: var(--text-default); }
.tips { margin: 0; padding-left: 18px; display: grid; gap: 10px; font-size: var(--text-sm); line-height: 1.5; color: var(--text-default); }
.tips code { color: var(--text-strong); }
.qr { background: #fff; padding: 10px; border-radius: var(--radius-sm); width: 220px; margin: 8px 0; border: 1px dashed var(--border-default); }
.qr svg { display: block; width: 200px; height: 200px; }

/* ---------- meldingskanalen ---------- */
.channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.channel {
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 14px 16px; display: grid; gap: 10px;
  margin: 0; opacity: .7; align-content: start;
}
.channel.on { opacity: 1; border-color: var(--red-200); background: var(--surface-alt); }
.channel legend { padding: 0 6px; font-weight: 700; color: var(--text-strong); }
.channel .note { margin: 0; }

/* ---------- websites ontdekken ---------- */
.discover { max-height: 46vh; overflow: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 8px 12px; }
.disc-server { margin-bottom: 12px; }
.disc-head { position: sticky; top: -8px; background: var(--surface-card); padding: 6px 0; }
.disc-item { padding: 3px 0 3px 12px; font-size: var(--text-sm); }

/* ---------- tv-modus ---------- */
body.tv .topbar { display: none; }
body.tv main { max-width: none; padding: 22px 28px 40px; }
.tv-head { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-bottom: 22px; }
.tv-head .brand { font-size: 22px; }
.tv-head .logo { width: 30px; height: 30px; }
.tv-head .summary .chip { font-size: var(--text-sm); padding: 6px 14px; }
.tv-clock { margin-left: auto; font-family: var(--font-heading); font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.tv-head .btn { width: 40px; height: 40px; padding: 0; font-size: 18px; }
.tv-problems { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; margin-bottom: 24px; }
.tv-card {
  border-radius: var(--radius-lg); padding: 20px 22px; border: 1px solid var(--warn-border); background: var(--warn-bg);
  color: var(--warn); display: grid; gap: 12px;
}
.tv-card.lvl-crit { border-color: var(--crit-border); background: var(--crit-bg); color: var(--crit); animation: tvpulse 2s infinite; }
@keyframes tvpulse { 50% { box-shadow: 0 10px 30px rgba(226, 40, 48, .25); } }
.tv-card > * { color: var(--text-default); }
.tv-card-head { display: flex; align-items: center; gap: 10px; font-family: var(--font-heading); font-size: 22px; font-weight: 800; color: var(--text-strong); }
.tv-card-head .dot { width: 14px; height: 14px; }
.tv-card-head .badge { margin-left: auto; font-size: 12px; background: var(--surface-card); border: 1px solid var(--border-subtle); }
.tv-card .issues { font-size: var(--text-body); gap: 6px; }
.tv-card .issues li::before { width: 7px; height: 7px; top: 7px; }
.tv-mini { color: var(--text-muted); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.tv-allgood { padding: 60px; text-align: center; font-family: var(--font-heading); font-weight: 800; font-size: 40px; color: var(--ok); margin-bottom: 20px; }
.tv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tv-mini-tile {
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 14px 16px;
  display: grid; gap: 8px; color: var(--ok);
}
.tv-mini-tile > * { color: var(--text-default); }
.tv-mini-tile.lvl-warn { border-color: var(--warn-border); color: var(--warn); }
.tv-mini-tile.lvl-crit { border-color: var(--crit-border); background: var(--crit-bg); color: var(--crit); }
.tv-mini-tile.lvl-muted, .tv-mini-tile.lvl-pending { opacity: .5; color: var(--pending); }
.tv-mini-name {
  display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: var(--text-sm); color: var(--text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tv-mini-name .dot { width: 9px; height: 9px; }
.tv-bars { display: grid; gap: 4px; }
.tv-bars span { height: 6px; background: var(--surface-sunken); border-radius: 3px; overflow: hidden; display: block; }
.tv-bars i { display: block; height: 100%; background: var(--ok); }
.tv-bars i.warn { background: var(--warn); }
.tv-bars i.crit { background: var(--crit); }
.tv-mini-val { font-size: var(--text-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ---------- dialogen ---------- */
dialog {
  background: var(--surface-card); color: var(--text-default); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl);
  padding: 28px; width: min(640px, 94vw); box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(22, 22, 22, .45); backdrop-filter: blur(3px); }
.form { display: grid; gap: 14px; }
.form h3 { font-size: var(--text-h4); }
.form .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 9px; color: var(--text-default); font-size: var(--text-sm); font-weight: 400; }
.check input { width: 16px; }
.cmd-box { position: relative; }
.cmd-box pre {
  background: var(--surface-ink); border-radius: var(--radius-sm); padding: 12px;
  white-space: pre-wrap; word-break: break-all; margin: 0; color: #c5f5d0;
}
.note { color: var(--text-subtle); font-size: var(--text-xs); line-height: 1.5; font-weight: 400; }
.note code { color: var(--text-default); }
.ok-msg { color: var(--ok); }

.th-table td { padding: 4px 12px 4px 0; border: 0; }
.th-table tr:hover td { background: none; }
.th-table input { width: 90px; padding: 6px 9px; font-variant-numeric: tabular-nums; }

/* ---------- login ---------- */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 500px at 50% -10%, var(--red-50), var(--surface-alt) 60%);
}
.login-box {
  display: grid; gap: 16px; width: 380px; max-width: 100%; background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 36px 32px;
}
.login-box .brand { font-size: 22px; margin-bottom: -10px; }
.login-box .logo { width: 30px; height: 30px; }
.login-box .lead { color: var(--text-muted); font-size: var(--text-sm); margin-bottom: 8px; }
.login-box input { padding: 11px 13px; }
.login-box .foot { text-align: center; color: var(--text-subtle); font-size: var(--text-xs); margin-top: 4px; }

@media (max-width: 1100px) {
  .cols, .cols3 { grid-template-columns: 1fr; }
  .charts { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  main { padding: 16px 12px 40px; }
  .tile.big { grid-column: span 1; }
  .grid { grid-template-columns: 1fr; }
  .filters { margin-left: 0; width: 100%; }
  .topbar { gap: 10px; padding: 10px 12px; }
  .conn { display: none; }
  .events li { grid-template-columns: 1fr; gap: 2px; }
}
