/* Poortwachter — interface
   Ontwerpidee: de sluis. Niemand komt erdoor zonder dat de sluiswachter het licht op groen zet.
   Het enige opvallende element zijn de sluislichten; de rest is rustig en precies. */

@font-face { font-family: 'Instrument Sans'; src: url('/fonts/instrument-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/fonts/instrument-sans-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/fonts/instrument-sans-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/fonts/instrument-sans-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --ink: #13233f;
  --ink-2: #1c3155;
  --ink-soft: #4a5a75;
  --paper: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --line: #dce2ea;
  --line-strong: #c3ccd8;
  --text: #13233f;
  --muted: #5d6b82;
  --dijk: #2457a6;
  --dijk-hover: #1c4789;
  --dijk-soft: #e8eef8;
  --rood: #c8372d;
  --rood-soft: #fbeceb;
  --groen: #1e8a5a;
  --groen-soft: #e6f4ed;
  --amber: #e0a100;
  --amber-soft: #fdf5dc;
  --lamp-off: #d3d9e2;
  --focus: #2457a6;
  --radius-s: 6px;
  --radius-m: 10px;
  --shadow: 0 1px 2px rgba(19, 35, 63, .06), 0 8px 24px -12px rgba(19, 35, 63, .18);
  --font: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --rail: 236px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1626; --surface: #152038; --surface-2: #192743; --line: #26365a; --line-strong: #33466e;
    --text: #e6ebf3; --muted: #9aa8c0; --ink-soft: #9aa8c0; --dijk: #6c9be6; --dijk-hover: #8bb1ee; --dijk-soft: #1d2f52;
    --rood: #ef6a5f; --rood-soft: #3a1f25; --groen: #4cc28a; --groen-soft: #16362c; --amber: #f2c14a; --amber-soft: #3a311a;
    --lamp-off: #33466e; --focus: #8bb1ee; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e1626; --surface: #152038; --surface-2: #192743; --line: #26365a; --line-strong: #33466e;
  --text: #e6ebf3; --muted: #9aa8c0; --ink-soft: #9aa8c0; --dijk: #6c9be6; --dijk-hover: #8bb1ee; --dijk-soft: #1d2f52;
  --rood: #ef6a5f; --rood-soft: #3a1f25; --groen: #4cc28a; --groen-soft: #16362c; --amber: #f2c14a; --amber-soft: #3a311a;
  --lamp-off: #33466e; --focus: #8bb1ee; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--paper); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--dijk); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Sluislichten ---------- */
.lights { display: inline-flex; gap: 3px; padding: 3px; border-radius: 99px; background: var(--ink); flex: none; vertical-align: middle; }
.lights i { width: 8px; height: 8px; border-radius: 50%; background: #3a4c6d; display: block; }
.lights.dicht i { background: var(--rood); box-shadow: 0 0 6px rgba(200, 55, 45, .55); }
.lights.gereed i:first-child { background: var(--rood); box-shadow: 0 0 6px rgba(200, 55, 45, .55); }
.lights.gereed i:last-child { background: #4cc28a; box-shadow: 0 0 6px rgba(76, 194, 138, .6); }
.lights.open i:last-child { background: #4cc28a; box-shadow: 0 0 6px rgba(76, 194, 138, .6); }
.lights.live i:last-child { background: #4cc28a; animation: lamp 2.4s ease-in-out infinite; }
.lights.lg { gap: 10px; padding: 10px; }
.lights.lg i { width: 30px; height: 30px; }
@keyframes lamp { 0%, 100% { box-shadow: 0 0 4px rgba(76, 194, 138, .5); } 50% { box-shadow: 0 0 12px rgba(76, 194, 138, .95); } }
@media (prefers-reduced-motion: reduce) { .lights.live i:last-child { animation: none; box-shadow: 0 0 8px rgba(76,194,138,.8); } }

/* ---------- Knoppen en velden ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-s); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--dijk); border-color: var(--dijk); color: #fff; }
.btn.primary:hover { background: var(--dijk-hover); border-color: var(--dijk-hover); }
.btn.go { background: var(--groen); border-color: var(--groen); color: #fff; }
.btn.go:hover { filter: brightness(1.07); }
.btn.danger { color: var(--rood); border-color: color-mix(in srgb, var(--rood) 45%, var(--line)); }
.btn.danger:hover { background: var(--rood-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn.block { width: 100%; height: 42px; font-size: 15px; }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span { font-weight: 500; font-size: 13px; }
.field small { color: var(--muted); font-size: 12.5px; }
.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); outline: none; transition: border-color .12s, box-shadow .12s; }
textarea.input { height: auto; min-height: 84px; padding: 9px 12px; resize: vertical; }
.input:focus { border-color: var(--dijk); box-shadow: 0 0 0 3px var(--dijk-soft); }
.input.code { font-family: var(--mono); font-size: 22px; letter-spacing: .3em; text-align: center; height: 52px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--dijk); width: 16px; height: 16px; flex: none; }
.check b { font-weight: 500; display: block; }
.check small { color: var(--muted); }
.pwfield { position: relative; }
.pwfield .input { padding-right: 76px; font-family: var(--mono); }
.pwfield .tools { position: absolute; right: 4px; top: 4px; display: flex; gap: 2px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.groen { background: var(--groen-soft); color: var(--groen); border-color: transparent; }
.badge.rood { background: var(--rood-soft); color: var(--rood); border-color: transparent; }
.badge.amber { background: var(--amber-soft); color: color-mix(in srgb, var(--amber) 70%, var(--text)); border-color: transparent; }
.badge.dijk { background: var(--dijk-soft); color: var(--dijk); border-color: transparent; }
.rec { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: color-mix(in srgb, var(--amber) 70%, var(--text)); }
.rec::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.proto { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--dijk-soft); color: var(--dijk); flex: none; }
.proto.ssh { background: var(--ink); color: #b8c6de; }
.proto.password { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* ---------- App-structuur ---------- */
.app { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail { background: var(--ink); color: #c9d3e4; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 12px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 22px; color: #fff; }
.brand .mark { width: 30px; height: 30px; flex: none; }
.brand b { font-size: 16px; font-weight: 600; letter-spacing: -.01em; display: block; line-height: 1.2; }
.brand small { font-size: 12px; color: #8d9cb8; display: block; line-height: 1.3; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 11px; border-radius: 7px; color: #c9d3e4; font-weight: 500; position: relative; }
.nav a:hover { background: var(--ink-2); color: #fff; text-decoration: none; }
.nav a.active { background: #22406e; color: #fff; }
.nav a.active::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #6c9be6; }
.nav .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--amber); color: var(--ink); font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.nav-sep { height: 1px; background: #24395e; margin: 12px 8px; }
.rail-foot { margin-top: auto; display: grid; gap: 10px; }
.lic-pill { display: block; padding: 10px 12px; border-radius: 8px; background: var(--ink-2); font-size: 12.5px; color: #aab7cd; }
.lic-pill b { color: #fff; font-weight: 600; }
.lic-pill.warn { background: #3f2f12; color: #f2d48a; }
.lic-pill.warn b { color: #ffe3a3; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 10px; border-radius: 8px; }
.me .avatar { width: 32px; height: 32px; border-radius: 50%; background: #2c4a7a; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.me .who { min-width: 0; flex: 1; line-height: 1.3; }
.me .who b { display: block; color: #fff; font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who small { color: #8d9cb8; font-size: 12px; }
.me .btn { color: #c9d3e4; }
.me .btn:hover { background: var(--ink-2); border-color: transparent; color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; display: flex; align-items: center; gap: 16px; padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.topbar .crumb { color: var(--muted); font-weight: 400; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.page { padding: 28px 32px 48px; max-width: 1360px; width: 100%; }

/* ---------- Panelen en tabellen ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
/* Brede tabellen scrollen binnen het paneel, niet de hele pagina (390 px) */
.panel:has(table.t) { overflow-x: auto; }
.nowrap { white-space: nowrap; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 15px; font-weight: 600; margin: 0; }
.panel-head .spacer { flex: 1; }
.panel-body { padding: 18px; }
.section-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--muted); padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.t td { padding: 11px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover td { background: var(--surface-2); }
.t tbody tr.click:focus-visible { outline-offset: -2px; }
.t tbody tr.click:focus-visible td { background: var(--dijk-soft); }
.t .num { text-align: right; font-variant-numeric: tabular-nums; }
.t td.actions { text-align: right; white-space: nowrap; }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-main b { font-weight: 500; display: block; }
.cell-main small { color: var(--muted); display: block; }
.empty { padding: 44px 24px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs a { padding: 10px 12px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--dijk); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 10px; color: var(--muted); width: 17px; height: 17px; }
.search .input { padding-left: 36px; width: 300px; }

/* ---------- Dashboard ---------- */
.hero { background: var(--ink); color: #fff; border-radius: 14px; padding: 30px 32px 26px; margin-bottom: 24px; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -40px; top: -60px; width: 340px; height: 340px; border-radius: 50%; border: 56px solid rgba(108, 155, 230, .07); pointer-events: none; }
.hero h2 { font-size: 26px; font-weight: 600; margin: 0 0 4px; letter-spacing: -.02em; }
.hero p { color: #9fb0cc; margin: 0 0 20px; }
.qc { position: relative; max-width: 680px; z-index: 1; }
.qc .input { height: 52px; font-size: 16px; padding-left: 48px; border: 0; background: #fff; color: #13233f; border-radius: 10px; }
.qc .input:focus { box-shadow: 0 0 0 4px rgba(108, 155, 230, .45); }
.qc > svg { position: absolute; left: 16px; top: 16px; width: 20px; height: 20px; color: #5d6b82; z-index: 1; }
.qc .kbd { position: absolute; right: 14px; top: 15px; font-family: var(--mono); font-size: 12px; color: #8d9cb8; border: 1px solid #d3d9e2; border-radius: 5px; padding: 1px 6px; }
.qc-results { position: absolute; left: 0; right: 0; top: 58px; background: var(--surface); color: var(--text); border-radius: 10px; box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; z-index: 20; max-height: 380px; overflow-y: auto; }
.qc-item { display: flex; gap: 12px; align-items: center; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--line); }
.qc-item:last-child { border-bottom: 0; }
.qc-item.sel, .qc-item:hover { background: var(--dijk-soft); }
.qc-item b { font-weight: 500; }
.qc-item .grow small { display: block; color: var(--muted); }
.recent-targets { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; position: relative; z-index: 1; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 99px; background: rgba(255,255,255,.08); color: #dbe3f0; border: 1px solid rgba(255,255,255,.12); cursor: pointer; font-size: 13px; }
.chip:hover { background: rgba(255,255,255,.14); color: #fff; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); margin-bottom: 24px; }
.fact { padding: 16px 20px; border-right: 1px solid var(--line); }
.fact:last-child { border-right: 0; }
.fact .v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fact .l { color: var(--muted); font-size: 13px; margin-top: 3px; }
.fact.attn .v { color: var(--rood); }
.fact a.l { display: block; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 96px; padding: 0 4px; }
.bars .b { flex: 1; background: var(--dijk-soft); border-radius: 3px 3px 0 0; position: relative; min-height: 3px; }
.bars .b.on { background: var(--dijk); }
.bars .b:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12px; padding: 3px 7px; border-radius: 4px; white-space: nowrap; }
.bars-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 6px; padding: 0 4px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 8px; background: var(--amber-soft); margin-bottom: 20px; }
.notice.rood { background: var(--rood-soft); }
.notice.dijk { background: var(--dijk-soft); }
.notice b { font-weight: 600; }
.notice .grow p { margin: 2px 0 0; color: var(--muted); }

/* ---------- Kluis ---------- */
.vault { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 24px; align-items: start; }
.tree { position: sticky; top: 88px; }
.tree a { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 6px; color: var(--text); font-weight: 450; }
.tree a:hover { background: var(--surface); text-decoration: none; }
.tree a.active { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.tree a .n { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.tree a svg { color: var(--muted); width: 16px; height: 16px; }
.tree .sub { padding-left: 16px; }
.tree-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 0 10px; margin-bottom: 6px; color: var(--muted); font-size: 13px; font-weight: 500; }

/* ---------- Lade (detailpaneel) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(13, 22, 40, .38); z-index: 40; animation: fade .15s ease-out; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); z-index: 41; display: flex; flex-direction: column; box-shadow: -20px 0 50px -20px rgba(13,22,40,.4); animation: slide .2s cubic-bezier(.2,.8,.2,1); }
.drawer-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: flex-start; }
.drawer-head h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.drawer-body { padding: 22px 24px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); }
.modal { position: fixed; left: 50%; top: 12vh; transform: translateX(-50%); width: min(480px, calc(100vw - 32px)); background: var(--surface); border-radius: 12px; z-index: 41; box-shadow: var(--shadow); animation: pop .16s ease-out; }
.modal .drawer-head { border: 0; padding-bottom: 6px; }
.modal .drawer-body { padding-top: 6px; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: .4; } }
@keyframes pop { from { transform: translate(-50%, 8px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .scrim, .drawer, .modal { animation: none; } }
dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; margin: 0 0 22px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.reveal-box { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-family: var(--mono); }
.reveal-box .grow { overflow-wrap: anywhere; }
.reveal-reason { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.reveal-reason .field { margin-bottom: 10px; }
.access-state { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 22px; }
.access-state b { display: block; font-weight: 600; }
.access-state small { color: var(--muted); }
.history-list { display: grid; gap: 0; }
.history-list div { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 80; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; font-weight: 500; animation: pop2 .18s ease-out; }
.toast.err { background: var(--rood); }
@keyframes pop2 { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Inlogschermen ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 520px); }
.auth-side { background: var(--ink); color: #fff; padding: 44px 56px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-side .brand { padding: 0; }
.gate { margin: auto 0; max-width: 460px; }
.gate .lights { margin-bottom: 32px; }
.gate h1 { font-size: 40px; line-height: 1.08; letter-spacing: -.03em; font-weight: 600; margin: 0 0 16px; }
.gate p { color: #9fb0cc; font-size: 16px; margin: 0; max-width: 400px; }
.auth-side .waterline { position: absolute; left: 0; right: 0; bottom: 0; height: 120px; opacity: .55; }
.auth-foot { color: #6d7f9f; font-size: 12.5px; position: relative; z-index: 1; }
.auth-main { display: flex; flex-direction: column; justify-content: center; padding: 48px 56px; background: var(--surface); }
.auth-card { width: 100%; max-width: 380px; margin: 0 auto; }
.auth-card h2 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 6px; }
.auth-card > p { color: var(--muted); margin: 0 0 28px; }
.auth-card .err { color: var(--rood); background: var(--rood-soft); padding: 10px 12px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; margin: 20px 0; }
.divider::before, .divider::after { content: ''; height: 1px; background: var(--line); flex: 1; }
.qr { display: grid; place-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; background: #fff; }
.qr svg { width: 180px; height: 180px; }
.secret-code { text-align: center; font-family: var(--mono); font-size: 13px; color: var(--muted); margin-bottom: 20px; overflow-wrap: anywhere; }
.steps { margin: 0 0 18px; padding-left: 20px; color: var(--muted); }
.steps li { margin-bottom: 4px; }

/* ---------- Sessievenster ---------- */
.viewer { position: fixed; inset: 0; background: #0a101c; z-index: 60; display: flex; flex-direction: column; }
.viewer-bar { height: 50px; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px; background: var(--ink); color: #dbe3f0; flex: none; border-bottom: 1px solid #22385d; }
.viewer-bar .title b { color: #fff; font-weight: 600; }
.viewer-bar .title small { color: #8d9cb8; margin-left: 8px; }
.viewer-bar .btn { background: transparent; border-color: #2c4470; color: #dbe3f0; height: 32px; }
.viewer-bar .btn:hover { background: #1c3155; }
.viewer-bar .btn.end { border-color: #8a3a35; color: #ffb3ac; }
.viewer-bar .btn.end:hover { background: #4a1f22; }
.viewer-bar .timer { font-family: var(--mono); font-size: 13px; color: #9fb0cc; }
.viewer-bar .rec { color: #f2c14a; }
.viewer-bar .watching { color: #9fd8bd; font-size: 13px; font-weight: 500; }
.viewer-stage { flex: 1; position: relative; overflow: hidden; display: grid; place-items: center; }
.viewer-stage .display { position: relative; }
.viewer-stage .display > div { cursor: default; }
.viewer-msg { position: absolute; inset: 0; display: grid; place-items: center; color: #c9d3e4; text-align: center; padding: 24px; }
.viewer-msg .inner { max-width: 420px; }
.viewer-msg b { display: block; color: #fff; font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.viewer-msg p { margin: 0 0 18px; color: #9fb0cc; }
.viewer-msg .lights { margin-bottom: 18px; }
.player-bar { height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 16px; background: var(--ink); color: #dbe3f0; flex: none; }
.player-bar input[type=range] { flex: 1; accent-color: #6c9be6; }
.player-bar .btn { background: transparent; border-color: #2c4470; color: #dbe3f0; }
.player-bar .t { font-family: var(--mono); font-size: 13px; color: #9fb0cc; min-width: 110px; text-align: center; }
.player-bar select.input { width: auto; flex: none; background: transparent; border-color: #2c4470; color: #dbe3f0; }

/* ---------- Instellingen / licentie ---------- */
.settings-grid { display: grid; grid-template-columns: 200px minmax(0, 720px); gap: 32px; align-items: start; }
.settings-nav a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--text); }
.settings-nav a.active { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.settings-nav a:hover { text-decoration: none; background: var(--surface); }
.lic-card { border-radius: 12px; background: var(--ink); color: #fff; padding: 24px; margin-bottom: 20px; display: grid; grid-template-columns: 1fr auto; gap: 18px; }
.lic-card h3 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.lic-card p { margin: 4px 0 0; color: #9fb0cc; }
.lic-card .id { font-family: var(--mono); font-size: 13px; color: #c9d3e4; }
.lic-card .btn { color: #dbe3f0; }
.lic-card .btn:hover { background: var(--ink-2); border-color: #2c4470; }
.usage { display: grid; gap: 14px; margin-bottom: 22px; }
.usage .u-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.meter { height: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--dijk); border-radius: 99px; }
.meter i.full { background: var(--rood); }
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; margin: 0 0 22px; padding: 0; list-style: none; }
.features li { display: flex; gap: 8px; align-items: center; }
.features li.off { color: var(--muted); }
.features svg { width: 16px; height: 16px; }
.features li svg { color: var(--groen); }
.features li.off svg { color: var(--line-strong); }
.audit-ok { display: flex; gap: 10px; align-items: center; }
.detail-json { font-family: var(--mono); font-size: 12px; color: var(--muted); max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.load-more { display: flex; justify-content: center; padding: 14px; border-top: 1px solid var(--line); }
.acl-row { display: grid; grid-template-columns: 1fr 170px 36px; gap: 8px; align-items: center; margin-bottom: 8px; }

/* ---------- Responsief ---------- */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact:nth-child(2) { border-right: 0; }
  .fact:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .settings-grid { grid-template-columns: 1fr; gap: 16px; }
  .settings-nav { display: flex; gap: 4px; flex-wrap: wrap; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .app.nav-open .rail { transform: none; box-shadow: 20px 0 50px rgba(0,0,0,.3); }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .page { padding: 20px 16px 40px; }
  .vault { grid-template-columns: 1fr; }
  .tree { position: static; }
  .search .input { width: 100%; }
  .search { flex: 1; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 24px; min-height: 0; }
  .gate { margin: 36px 0 12px; }
  .gate h1 { font-size: 30px; }
  .auth-side .waterline, .auth-foot { display: none; }
  .auth-main { padding: 32px 24px; }
  .hero { padding: 22px 18px; }
  .hide-sm { display: none; }
  .t th, .t td { padding: 10px 12px; }
  .grid2 { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  dl.kv { grid-template-columns: 110px 1fr; }
  .viewer-bar .title small, .viewer-bar .hide-sm { display: none; }
}
.mt { margin-top: 24px; }
