:root {
  /* Kleurschema "nachtcafé": donker en neutraal (geen bruin, dat wordt modderig onder warm licht),
     tekst bijna wit voor maximaal contrast, en een koel cyaan accent dat niet wegvalt
     in het gele cafélicht zoals oranje of amber. */
  --bg: #0a0c0f;
  --panel: #151a20;
  --panel-2: #1f262e;
  --line: #34414d;
  --text: #f6f8fa;
  --muted: #b4c0cc;
  --accent: #3ad1ff;
  --accent-ink: #001a24;
  --accent-glow: #3ad1ff66;
  --ok: #4ade80;
  --warn: #ffd23f;
  --bad: #ff5d5d;
  --ok-bg: #0f3d22;   --ok-ink: #c9ffd9;
  --warn-bg: #4d3b00; --warn-ink: #ffe9a3;
  --bad-bg: #5c1616;  --bad-ink: #ffd6d6;
  --sel-bg: #0d2f3d;  --sel-line: #3ad1ff;
  --bar-bg: #0f1317f2;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }   /* de browser mag tekst niet zelf groter maken */
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100dvh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; border-radius: 10px; padding: 12px 16px; background: var(--panel-2); min-height: 44px; }
button:active { transform: scale(.97); }
button:disabled { opacity: .45; }
.btn-primary { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn-danger { background: var(--bad-bg); color: var(--bad-ink); }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
button.on, .btn-ghost.on { border-color: var(--accent); color: var(--accent); }
.btn-ok { background: var(--ok-bg); color: var(--ok-ink); font-weight: 700; }
input, select, textarea { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 6px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.grow { flex: 1; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.center-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.narrow { width: min(420px, 100%); }
.brand { font-weight: 800; letter-spacing: .02em; color: var(--accent); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); display: inline-block; }
.dot.on { background: var(--ok); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--panel-2); color: var(--muted); }
.badge.ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.bad { background: var(--bad-bg); color: var(--bad-ink); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600;
  box-shadow: 0 10px 30px #0008; z-index: 100; max-width: calc(100% - 32px); text-align: center; }
.toast.bad { background: var(--bad); color: #1a0000; }
.hidden { display: none !important; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- plattegrond (beheer en obers) ---------- */
.floor { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.fl-bg { fill: var(--panel); stroke: var(--line); stroke-width: 3; }
.fl-gridline { fill: none; stroke: var(--line); stroke-width: 1; opacity: .55; }
.k-table .fl-shape { fill: var(--panel-2); stroke: #6b7d8f; stroke-width: 4; }
.k-table.sel .fl-shape { fill: var(--sel-bg); stroke: var(--accent); stroke-width: 8; }
.k-zone .fl-shape { fill: var(--accent); fill-opacity: .07; stroke: var(--accent); stroke-opacity: .55; stroke-width: 3; stroke-dasharray: 14 10; }
.k-zone.sel .fl-shape { fill-opacity: .2; stroke-opacity: 1; stroke-width: 5; }
.k-deco .fl-shape { fill: var(--deco); stroke: var(--deco); stroke-width: 2; }
.k-deco.sel .fl-shape { stroke: var(--accent); stroke-width: 6; }
.fl-item text { text-anchor: middle; dominant-baseline: central; pointer-events: none;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.fl-num { fill: var(--text); font-weight: 800; }
.fl-numname { font-weight: 700; }
.k-table.sel .fl-num { fill: var(--accent); }
.fl-name { fill: var(--muted); font-weight: 600; }
.fl-name, .fl-numname, .fl-zonename { paint-order: stroke; stroke: var(--panel); stroke-width: 7px; stroke-linejoin: round; }
.floorbox { position: relative; }
.fl-zonename { fill: var(--accent); font-weight: 700; opacity: .9; }
.fl-deconame { fill: var(--muted); font-weight: 700; letter-spacing: .06em; }
.fl-handle { fill: var(--accent); stroke: var(--bg); stroke-width: 4; cursor: grab; touch-action: none; }
.fl-hline { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 6 6; pointer-events: none; }
.fl-hicon { fill: none; stroke: var(--accent-ink); stroke-width: 3; pointer-events: none; }
.fl-pin { pointer-events: none; }
.fl-pinring { fill: var(--accent); fill-opacity: .25; stroke: var(--accent); stroke-width: 4; }
.fl-pindot { fill: var(--accent); stroke: var(--bg); stroke-width: 4; }
.floorwrap { overflow: auto; border-radius: 16px; -webkit-overflow-scrolling: touch; }
.zoom { display: flex; gap: 6px; }
.zoom button { width: 44px; padding: 0; font-size: 22px; font-weight: 700; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { background: transparent; padding: 8px 14px; min-height: 38px; border-radius: 9px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; border: 0; }

/* ===== licht: dezelfde opbouw als donker, met een donkerder cyaan zodat tekst en knoppen leesbaar blijven ===== */
:root { --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace; --note: var(--accent); --deco: #2c3640; --tile-edge: #ffffff14; }
html[data-theme="licht"] {
  --bg: #eef1f4; --panel: #ffffff; --panel-2: #e3e8ed; --line: #c2ccd5; --text: #10161c; --muted: #4a5866;
  --accent: #006d96; --accent-ink: #ffffff; --accent-glow: #006d9655;
  --ok: #15803d; --warn: #a86f00; --bad: #c62828;
  --ok-bg: #d3f2df; --ok-ink: #0d4a28; --warn-bg: #ffefba; --warn-ink: #573f00; --bad-bg: #fbdcdc; --bad-ink: #7a1a1a;
  --sel-bg: #d3edf8; --sel-line: #006d96; --bar-bg: #f8fafbf2; --deco: #b6c1cb; --tile-edge: #0000001a;
  color-scheme: light;
}
html[data-theme="licht"] .toast { box-shadow: 0 10px 30px #0004; }
html[data-theme="licht"] .k-table .fl-shape { stroke: #7c8b99; }
.demobar { background: var(--warn); color: #1a1200; text-align: center; font-weight: 800; font-size: 13px; padding: 4px 8px; letter-spacing: .02em; }
.demobar.testbar { background: repeating-linear-gradient(135deg, #7c3aed 0 14px, #6d28d9 14px 28px); color: #fff; }
.logo { display: block; max-width: 80%; height: auto; margin: 0 auto 14px; }
.newver { position: fixed; top: 0; left: 0; right: 0; z-index: 90; min-height: 44px; padding: 8px 14px; border: 0; border-radius: 0; background: var(--accent); color: var(--accent-ink); font-size: 16px; font-weight: 800; }
