/* ============================================================================
   ORBIT4 — Design system v2  ·  "Petrol & Paper"
   ----------------------------------------------------------------------------
   Andere opzet dan v1: donkere icoon-rail links, warme papieren canvas,
   petrol/teal als merkkleur (geen oranje), panelen met kopband i.p.v. losse
   kaarten, een rechter drawer i.p.v. modals, en een command palette.
   Geen enkele gradient — alle vlakken zijn effen.

    1. Tokens            7. Panelen & metrics    13. Agenda
    2. Reset & basis     8. Tabellen             14. Plattegrond
    3. Shell             9. Tags & status        15. Auth / admin / gast
    4. Rail             10. Grafieken            16. Responsive
    5. Topbar           11. Formulieren
    6. Knoppen          12. Drawer / cmdk / toast
   ========================================================================== */

/* ==========================================================================
   1. TOKENS
   ========================================================================== */
:root {
  color-scheme: light;

  /* Vlakken — warm papier i.p.v. koel grijs */
  --canvas:        #f0efec;
  --surface:       #ffffff;
  --surface-2:     #f7f6f3;
  --surface-3:     #eceae5;
  --border:        #dfdcd5;
  --border-strong: #c8c4ba;

  /* Inkt */
  --text:   #161a19;
  --text-2: #5b625f;
  --text-3: #8e938f;

  /* Merk — petrol/teal */
  --accent:       #0e6f66;
  --accent-hover: #0a564f;
  --accent-text:  #0b5c54;
  --accent-soft:  #e2efed;
  --accent-line:  #b6d7d2;
  --on-accent:    #ffffff;

  /* Tweede merkkleur — klei/terracotta, voor highlights & VIP */
  --brand-2:      #a35a3c;
  --brand-2-soft: #f6ebe5;

  /* Rail — altijd donker, in beide thema's */
  --rail:      #14201e;
  --rail-2:    #1d2c29;
  --rail-line: #273834;
  --rail-ink:  #cfdad7;
  --rail-ink-2:#84948f;
  --rail-active-bg: #17423c;
  --rail-active:    #5fd3c2;

  /* Semantisch */
  --good:        #2c7a4f;
  --good-soft:   #e5f1e9;
  --good-line:   #bcdcc8;
  --warn:        #9a6710;
  --warn-soft:   #f7efdf;
  --warn-line:   #e6d4ae;
  --danger:      #ad3327;
  --danger-soft: #f8e8e6;
  --danger-line: #eec7c2;
  --info:        #2a5c96;
  --info-soft:   #e7eef7;
  --info-line:   #c4d5ec;
  --gold:        #96701a;
  --violet:      #6a4a9c;

  /* Grafiek-ramp: rustig → piek */
  --c-quiet:  #9aa7a4;
  --c-steady: #3f8c81;
  --c-busy:   #c08034;
  --c-peak:   #ad3327;

  /* Vorm */
  --r-xs: 5px;
  --r-sm: 8px;
  --r-md: 11px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 999px;

  /* Diepte — alleen waar iets echt zweeft */
  --sh-1: 0 1px 2px rgba(20, 26, 24, .06);
  --sh-2: 0 6px 18px rgba(20, 26, 24, .10);
  --sh-3: 0 24px 60px rgba(12, 18, 16, .24);

  /* Maatvoering */
  --rail-w: 74px;
  --h-ctl: 36px;
  --h-ctl-sm: 28px;
  --gap: 14px;

  --t-fast: 110ms cubic-bezier(.4, 0, .2, 1);
  --t: 200ms cubic-bezier(.32, .72, 0, 1);

  --grid-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cpath d='M20 0H0v20' fill='none' stroke='%23e4e1da' stroke-width='1'/%3E%3C/svg%3E");
  --grid-img-lg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cpath d='M100 0H0v100' fill='none' stroke='%23d5d1c8' stroke-width='1'/%3E%3C/svg%3E");
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --canvas:        #0d1211;
  --surface:       #151b1a;
  --surface-2:     #1b2322;
  --surface-3:     #242e2c;
  --border:        #283331;
  --border-strong: #3a4744;

  --text:   #e6ecea;
  --text-2: #96a29e;
  --text-3: #6b7773;

  --accent:       #2fa295;
  --accent-hover: #43b8aa;
  --accent-text:  #56c8b8;
  --accent-soft:  #10312d;
  --accent-line:  #1d4b45;
  --on-accent:    #04140f;

  --brand-2:      #cd8a6b;
  --brand-2-soft: #2c1d16;

  --rail:      #0a100f;
  --rail-2:    #131c1a;
  --rail-line: #1d2926;
  --rail-ink:  #c3cfcb;
  --rail-ink-2:#75837f;
  --rail-active-bg: #123832;
  --rail-active:    #4fc7b6;

  --good:        #47b077;
  --good-soft:   #10261b;
  --good-line:   #1f4530;
  --warn:        #cf9a3c;
  --warn-soft:   #2a2113;
  --warn-line:   #4a3a1c;
  --danger:      #e2695c;
  --danger-soft: #2c1614;
  --danger-line: #4e2724;
  --info:        #5b93d6;
  --info-soft:   #121f2e;
  --info-line:   #24374f;
  --gold:        #cba63f;
  --violet:      #9a83d6;

  --c-quiet:  #63736f;
  --c-steady: #3f9e90;
  --c-busy:   #cf9a3c;
  --c-peak:   #e2695c;

  --sh-1: 0 1px 2px rgba(0, 0, 0, .5);
  --sh-2: 0 6px 18px rgba(0, 0, 0, .5);
  --sh-3: 0 24px 60px rgba(0, 0, 0, .68);

  --grid-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cpath d='M20 0H0v20' fill='none' stroke='%23212b29' stroke-width='1'/%3E%3C/svg%3E");
  --grid-img-lg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cpath d='M100 0H0v100' fill='none' stroke='%232b3835' stroke-width='1'/%3E%3C/svg%3E");
}

/* ==========================================================================
   2. RESET & BASIS
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Inter var", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px; line-height: 1.5;
  background: var(--canvas); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 640; letter-spacing: -.014em; line-height: 1.25; }
h1 { font-size: 19px; }
h2 { font-size: 16px; }
h3 { font-size: 13.5px; }
h4 { font-size: 12.5px; }
p { margin: 0 0 10px; }
a { color: var(--accent-text); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }
::selection { background: var(--accent-line); color: var(--text); }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .92em; }

/* --- Iconen ---------------------------------------------------------------
   Inline SVG op 24×24. Ze schalen mee met de tekstgrootte (1em) en erven de
   kleur, dus ze kloppen overal automatisch — ook in donkere modus. */
.i {
  width: 1.15em; height: 1.15em; flex: none; display: inline-block;
  vertical-align: -.22em; stroke-width: 1.7;
}
.i-sm { width: 1em; height: 1em; }
.i-lg { width: 1.35em; height: 1.35em; }
.i-xl { width: 30px; height: 30px; vertical-align: middle; }
/* In tekstregels wat rustiger, in knoppen exact uitgelijnd. */
.btn-primary .i, .btn-ghost .i, .btn-soft .i, .btn-danger .i,
.icon-btn .i, .tool .i, .rail-btn .i, .zoom-ctl .i,
.ri-ico .i, .rail-brand .i, .q-ico .i, .ck-ico .i, .toast .ico .i,
.auth-logo .i, .guest-mark .i, .brand-mark .i { vertical-align: 0; }
button .i { pointer-events: none; }
/* Iconen in vaste vierkantjes krijgen een eigen maat, anders volgen ze de
   (kleine) font-size van dat blokje en worden ze te klein. */
.q-ico .i  { width: 15px; height: 15px; }
.ck-ico .i { width: 14px; height: 14px; }
.toast .ico .i { width: 11px; height: 11px; }
.empty .big .i { width: 32px; height: 32px; }
.m-value .i { width: 26px; height: 26px; vertical-align: -.12em; }

.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.sub { font-size: 12px; color: var(--text-2); font-weight: 450; }
.stack { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }
.divider { height: 1px; background: var(--border); border: 0; margin: 14px 0; }
.mt { margin-top: var(--gap); }
.mb { margin-bottom: var(--gap); }
.center { text-align: center; }

* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-full); border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   3. SHELL
   ========================================================================== */
.shell { display: grid; grid-template-columns: var(--rail-w) 1fr; height: 100vh; height: 100dvh; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.page { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px 20px 40px; }
.rail-backdrop { display: none; }

/* ==========================================================================
   4. RAIL — donkere icoonbalk, in beide thema's
   ========================================================================== */
.rail {
  background: var(--rail); color: var(--rail-ink);
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 6px; gap: 2px; min-height: 0;
  border-right: 1px solid var(--rail-line);
}
.rail-brand {
  width: 38px; height: 38px; flex: none; margin-bottom: 8px;
  border-radius: var(--r-md); background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 20px; line-height: 1;
  cursor: pointer; border: 0;
}
.rail-nav {
  display: flex; flex-direction: column; gap: 2px; width: 100%;
  overflow-y: auto; overflow-x: hidden; min-height: 0; flex: 1;
  scrollbar-width: none;
}
.rail-nav::-webkit-scrollbar { display: none; }
.rail-sep { height: 1px; background: var(--rail-line); margin: 7px 8px; flex: none; }

.rail-item {
  position: relative; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 8px 2px 6px; border: 0; border-radius: var(--r-md);
  background: none; color: var(--rail-ink-2); cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.rail-item .ri-ico { font-size: 16px; line-height: 1; }
.rail-item .ri-label {
  font-size: 9.5px; font-weight: 600; letter-spacing: .01em;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rail-item:hover { background: var(--rail-2); color: var(--rail-ink); }
.rail-item.active { background: var(--rail-active-bg); color: var(--rail-active); }
.rail-item.active::before {
  content: ""; position: absolute; left: -6px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--rail-active);
}
.rail-item .ri-dot {
  position: absolute; top: 3px; right: 6px;
  min-width: 15px; height: 15px; padding: 0 4px;
  background: var(--danger); color: #fff; border-radius: var(--r-full);
  font-size: 9.5px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--rail);
}

.rail-foot { width: 100%; display: flex; flex-direction: column; gap: 4px; padding-top: 6px; flex: none; }
.rail-btn {
  width: 100%; height: 32px; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--rail-ink-2); cursor: pointer; font-size: 14px;
  display: grid; place-items: center;
}
.rail-btn:hover { background: var(--rail-2); color: var(--rail-ink); }
.rail-status {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 9px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  color: var(--rail-ink-2); padding: 5px 0;
}
.rail-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.rail-status.live::before { background: #43c08d; }
.rail-avatar {
  width: 30px; height: 30px; margin: 2px auto 0; border-radius: 50%;
  background: var(--rail-2); color: var(--rail-ink); border: 1px solid var(--rail-line);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; cursor: default;
}

/* ==========================================================================
   5. TOPBAR
   ========================================================================== */
.bar {
  display: flex; align-items: center; gap: 12px; flex: none;
  padding: 10px 20px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.bar-title { min-width: 0; display: flex; flex-direction: column; }
.bar-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-title .sub { margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.hamburger { display: none; }

/* Zoekknop die de command palette opent — geen los invoerveld meer. */
.cmd-trigger {
  display: flex; align-items: center; gap: 8px;
  height: var(--h-ctl); min-width: 210px; padding: 0 11px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text-3); cursor: pointer;
  font-size: 13px; transition: border-color var(--t-fast), background var(--t-fast);
}
.cmd-trigger:hover { border-color: var(--border-strong); background: var(--surface); }
.cmd-trigger .ct-ico { font-size: 14px; }
.cmd-trigger .ct-txt { flex: 1; text-align: left; }
.kbd {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 10.5px;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--r-xs); padding: 1px 5px; color: var(--text-2); white-space: nowrap;
}

/* ==========================================================================
   6. KNOPPEN
   ========================================================================== */
.btn-primary, .btn-ghost, .btn-soft, .btn-danger, .icon-btn {
  --h: var(--h-ctl);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--h); padding: 0 13px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 550; line-height: 1; white-space: nowrap;
  cursor: pointer; text-decoration: none;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn-primary[disabled], .btn-ghost[disabled], .btn-soft[disabled], .btn-danger[disabled] { opacity: .5; pointer-events: none; }

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-ghost.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }

.btn-soft { background: var(--surface-3); color: var(--text); }
.btn-soft:hover { background: var(--border); }

.btn-danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

.btn-primary.small, .btn-ghost.small, .btn-soft.small, .btn-danger.small {
  --h: var(--h-ctl-sm); padding: 0 9px; font-size: 12px; gap: 4px;
}
.btn-primary.block, .btn-ghost.block, .btn-soft.block, .btn-danger.block { width: 100%; }

.icon-btn {
  width: var(--h-ctl); padding: 0; position: relative;
  background: var(--surface); border-color: var(--border); color: var(--text-2); font-size: 14px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.icon-btn.small { width: var(--h-ctl-sm); --h: var(--h-ctl-sm); font-size: 12px; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--accent-text); font-size: 13px; font-weight: 550; }
.link-btn:hover { text-decoration: underline; }

/* Segmented control */
.segmented { display: inline-flex; padding: 2px; gap: 2px; background: var(--surface-3); border-radius: var(--r-sm); flex-wrap: wrap; }
.segmented button {
  border: 0; background: none; cursor: pointer; padding: 6px 11px; border-radius: var(--r-xs);
  font-size: 12.5px; font-weight: 550; color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.segmented button .n { margin-left: 5px; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.segmented button.active .n { color: var(--accent-text); }

/* ==========================================================================
   7. PANELEN, GRID & METRICS
   ========================================================================== */
.grid { display: grid; gap: var(--gap); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

/* Panel = het nieuwe basisvlak. .card blijft bestaan voor de losse pagina's. */
.panel, .card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); min-width: 0;
}
.card { padding: 16px; }
.panel { display: flex; flex-direction: column; overflow: hidden; }
.panel > .p-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); flex: none;
}
.panel > .p-head h3 { display: flex; align-items: center; gap: 7px; }
.panel > .p-head .p-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.panel > .p-body { padding: 14px; flex: 1; min-height: 0; }
.panel > .p-body.flush { padding: 0; }
.panel > .p-body.scroll { overflow-y: auto; }
.panel > .p-foot { padding: 10px 14px; border-top: 1px solid var(--border); background: var(--surface-2); flex: none; }
.card h3, .card > h3 { margin-bottom: 10px; }

/* Split-layout: hoofdkolom + zijkolom. Stretch, zodat overtollige ruimte
   binnen het paneel valt en niet als gat naast de zijkolom. */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gap); align-items: stretch; }
.split > .panel > .p-body.scroll { overflow-y: auto; }

/* Metric-strip: één band, verdeeld door lijnen — geen losse kaartjes */
.metrics {
  display: flex; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; margin-bottom: var(--gap);
}
.metric {
  flex: 1 1 160px; min-width: 0; padding: 12px 16px;
  border-left: 1px solid var(--border);
}
.metric:first-child { border-left: 0; }
.m-label {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-3);
}
.m-value { font-size: 25px; font-weight: 660; letter-spacing: -.024em; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 3px; }
.m-sub { font-size: 11.5px; color: var(--text-2); }
.m-sub.up { color: var(--good); }
.m-sub.down { color: var(--danger); }
.metric.hot { background: var(--danger-soft); }
.metric.hot .m-value, .metric.hot .m-label { color: var(--danger); }

/* Sparkline in een metric */
.spark { display: flex; align-items: flex-end; gap: 2px; height: 18px; margin-top: 5px; }
.spark i { flex: 1; background: var(--border-strong); border-radius: 1px; min-height: 2px; display: block; }
.spark i.on { background: var(--accent); }

/* Lege staat */
.empty { text-align: center; padding: 38px 20px; color: var(--text-2); }
.empty .big { font-size: 30px; line-height: 1; margin-bottom: 10px; opacity: .75; }
.empty .t { font-weight: 640; font-size: 14.5px; color: var(--text); margin-bottom: 3px; }
.empty .s { font-size: 13px; max-width: 44ch; margin: 0 auto; }
.empty .btn-primary, .empty .btn-ghost { margin-top: 14px; }

/* Inzicht-regels */
.insight {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; margin-bottom: 7px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong); border-radius: var(--r-sm);
}
.insight:last-child { margin-bottom: 0; }
.insight .ico { font-size: 15px; line-height: 1.35; flex: none; }
.insight .title { font-weight: 620; font-size: 12.5px; margin-bottom: 1px; }
.insight .text { font-size: 12px; color: var(--text-2); }
.insight.warn { border-left-color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.insight.info { border-left-color: var(--info); background: var(--info-soft); border-color: var(--info-line); }
.insight.good { border-left-color: var(--good); background: var(--good-soft); border-color: var(--good-line); }
.insight.bad  { border-left-color: var(--danger); background: var(--danger-soft); border-color: var(--danger-line); }
.insight.clickable { cursor: pointer; }
.insight.clickable:hover { border-color: var(--border-strong); }
.insight.read { opacity: .55; }

/* ---- Run of service: de operationele lijst op het startscherm ---- */
.run-group { border-bottom: 1px solid var(--border); }
.run-group:last-child { border-bottom: 0; }
.run-head {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; background: var(--surface-2);
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3);
  position: sticky; top: 0; z-index: 2;
}
.run-head .n { margin-left: auto; font-weight: 600; letter-spacing: 0; text-transform: none; font-size: 11.5px; }
.run-head.now { color: var(--accent-text); background: var(--accent-soft); }

.run-row {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 14px; border-top: 1px solid var(--border);
  cursor: pointer; transition: background var(--t-fast);
}
.run-group .run-row:first-of-type { border-top: 0; }
.run-row:hover { background: var(--surface-2); }
.run-time {
  font-size: 14px; font-weight: 680; font-variant-numeric: tabular-nums;
  width: 44px; flex: none;
}
.run-bar { width: 3px; align-self: stretch; border-radius: 2px; background: var(--border-strong); flex: none; }
.run-row.s-seated .run-bar { background: var(--good); }
.run-row.s-booked .run-bar { background: var(--accent); }
.run-row.s-waitlist .run-bar { background: var(--info); }
.run-row.s-completed .run-bar { background: var(--text-3); }
.run-row.s-no-show .run-bar { background: var(--danger); }
.run-row.late { background: var(--danger-soft); }
.run-row.late:hover { background: var(--danger-soft); filter: brightness(.98); }
.run-main { flex: 1; min-width: 0; }
.run-name { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.run-meta { font-size: 11.5px; color: var(--text-2); display: flex; gap: 7px; flex-wrap: wrap; margin-top: 1px; }
.run-meta b { color: var(--text); font-weight: 600; }
.run-acts { display: flex; gap: 5px; flex: none; opacity: 0; transition: opacity var(--t-fast); }
.run-row:hover .run-acts, .run-row:focus-within .run-acts { opacity: 1; }
@media (hover: none) { .run-acts { opacity: 1; } }

/* ---- Aandacht-wachtrij ---- */
.q-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 11px; margin-bottom: 6px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong); border-radius: var(--r-sm);
  transition: border-color var(--t-fast);
}
.q-item:last-child { margin-bottom: 0; }
.q-item:hover { border-color: var(--border-strong); }
.q-ico {
  width: 24px; height: 24px; flex: none; border-radius: var(--r-xs);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--surface-3); color: var(--text-2);
}
.q-txt { flex: 1; min-width: 0; }
.q-txt b { display: block; font-size: 12.5px; font-weight: 620; }
.q-txt i { display: block; font-style: normal; font-size: 11.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-go { color: var(--text-3); flex: none; }
.q-item.bad  { border-left-color: var(--danger); }
.q-item.bad .q-ico  { background: var(--danger-soft); color: var(--danger); }
.q-item.warn { border-left-color: var(--warn); }
.q-item.warn .q-ico { background: var(--warn-soft); color: var(--warn); }
.q-item.info { border-left-color: var(--info); }
.q-item.info .q-ico { background: var(--info-soft); color: var(--info); }

/* ==========================================================================
   8. TABELLEN
   ========================================================================== */
.data-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2);
  color: var(--text-3); font-weight: 640; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .05em; padding-top: 8px; padding-bottom: 8px; white-space: nowrap;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data tr.clickable { cursor: pointer; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .cell-main { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
table.data .cell-sub { font-size: 11.5px; color: var(--text-2); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; opacity: 0; transition: opacity var(--t-fast); }
tr:hover .row-actions, tr:focus-within .row-actions { opacity: 1; }
@media (hover: none) { .row-actions { opacity: 1; } }

/* ==========================================================================
   9. TAGS, CHIPS & STATUS
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: var(--r-xs);
  font-size: 11px; font-weight: 640; white-space: nowrap; border: 1px solid transparent;
}
.badge.low     { background: var(--good-soft);   color: var(--good);   border-color: var(--good-line); }
.badge.medium  { background: var(--warn-soft);   color: var(--warn);   border-color: var(--warn-line); }
.badge.high    { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.badge.late    { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.badge.soon    { background: var(--warn-soft);   color: var(--warn);   border-color: var(--warn-line); }
.badge.overrun { background: var(--info-soft);   color: var(--violet); border-color: var(--info-line); }
.badge.neutral { background: var(--surface-3);   color: var(--text-2); border-color: var(--border); }
/* Semantische namen — leesbaarder dan low/medium/high buiten de risico-context. */
.badge.good   { background: var(--good-soft);   color: var(--good);   border-color: var(--good-line); }
.badge.warn   { background: var(--warn-soft);   color: var(--warn);   border-color: var(--warn-line); }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.badge.info   { background: var(--info-soft);   color: var(--info);   border-color: var(--info-line); }

.status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 620; white-space: nowrap; border: 1px solid transparent;
}
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.status.booked    { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-line); }
.status.seated    { background: var(--good-soft);   color: var(--good);   border-color: var(--good-line); }
.status.completed { background: var(--surface-3);   color: var(--text-2); border-color: var(--border); }
.status.cancelled { background: var(--surface-3);   color: var(--text-3); border-color: var(--border); }
.status.no-show   { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.status.waitlist  { background: var(--info-soft);   color: var(--info);   border-color: var(--info-line); }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px; border-radius: var(--r-xs);
  font-size: 11px; font-weight: 500; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
}
.chip.accent { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); font-weight: 620; }
.chip.gold   { background: var(--brand-2-soft); border-color: var(--brand-2); color: var(--brand-2); font-weight: 620; }
.chip.code   { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 10.5px; letter-spacing: .03em; }
.chip.good   { background: var(--good-soft);   border-color: var(--good-line);   color: var(--good); }
.chip.warn   { background: var(--warn-soft);   border-color: var(--warn-line);   color: var(--warn); }
.chip.danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }

.seg-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.mini-bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 15px; }
.mini-bars i { width: 4px; background: var(--border); border-radius: 1px; display: block; }
.mini-bars i.on { background: var(--accent); }

/* ==========================================================================
   10. GRAFIEKEN
   ========================================================================== */
.bars { display: flex; gap: 5px; align-items: flex-end; }
.bar-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-val { font-size: 11px; font-weight: 640; font-variant-numeric: tabular-nums; height: 14px; color: var(--text-2); }
.bar-track { height: 92px; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar-fill { width: 76%; max-width: 32px; min-height: 3px; border-radius: 3px 3px 1px 1px; background: var(--c-steady); transition: height var(--t); }
.bar-fill.quiet { background: var(--c-quiet); }
.bar-fill.steady { background: var(--c-steady); }
.bar-fill.busy { background: var(--c-busy); }
.bar-fill.peak { background: var(--c-peak); }
.bar-fill.ghost { background: var(--surface-3); }
.bar-cap { font-size: 10.5px; color: var(--text-2); text-align: center; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bar-cap b { display: block; color: var(--text); font-weight: 600; }
.bar-col.today .bar-cap b { color: var(--accent-text); }
.bar-col.today .bar-fill { box-shadow: 0 0 0 2px var(--accent-soft), 0 0 0 3px var(--accent); }
.panel .bars { min-height: 120px; }

.meter { height: 6px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.meter > div { height: 100%; border-radius: var(--r-full); background: var(--accent); transition: width var(--t); }

.legend-row { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-2); margin-top: 10px; }
.legend-row span { display: inline-flex; align-items: center; gap: 5px; }
.legend-row i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex: none; }

.hbar { margin-bottom: 10px; }
.hbar:last-child { margin-bottom: 0; }
.hbar-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; gap: 8px; }
.hbar-head b { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   11. FORMULIEREN
   ========================================================================== */
.field { margin-bottom: 12px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field > label { display: block; font-size: 11.5px; font-weight: 560; color: var(--text-2); margin-bottom: 4px; }
.field > label .req { color: var(--danger); }
.field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }

input:where(:not([type])), input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="date"], input[type="time"], input[type="search"],
input[type="url"], input[type="datetime-local"], input[type="month"], input[type="week"],
select, textarea, .input {
  width: 100%; height: var(--h-ctl); padding: 0 10px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  outline: none; font-size: 13.5px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
textarea { height: auto; padding: 8px 10px; resize: vertical; min-height: 60px; line-height: 1.5; }
select {
  appearance: none; padding-right: 28px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%238e938f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input[disabled], select[disabled], textarea[disabled] { background: var(--surface-3); color: var(--text-3); cursor: not-allowed; }
input[type="color"] { padding: 3px; cursor: pointer; }
input[type="range"] { accent-color: var(--accent); height: auto; padding: 0; border: 0; background: none; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; flex: none; }
input.w-auto, select.w-auto { width: auto; }
input.narrow { width: 66px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.field-row .field, .field-row-3 .field { margin-bottom: 12px; }

.check-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 13.5px; cursor: pointer; flex-wrap: wrap; }
.check-row input[type="number"] { width: 60px; height: var(--h-ctl-sm); }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 4px; }

.code-box {
  width: 100%; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px;
  line-height: 1.6; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 9px 11px; resize: vertical; color: var(--text-2);
}

/* Slimme assistent */
.smart-panel { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; }
.smart-panel .sp-title {
  display: flex; align-items: center; gap: 7px; justify-content: space-between;
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 9px;
}
.slot-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.slot-chip {
  padding: 5px 10px; border-radius: var(--r-sm); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 500;
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.slot-chip:hover { border-color: var(--border-strong); background: var(--surface-2); }
.slot-chip.sel { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 620; }
.slot-chip .w { color: var(--text-3); font-size: 11px; }

/* ==========================================================================
   12. DRAWER, MODAL, COMMAND PALETTE, TOAST
   ========================================================================== */
/* --- Drawer: detail zonder de lijst eronder te verbergen --- */
.drawer-host { position: fixed; inset: 0; z-index: 70; display: flex; justify-content: flex-end; }
.drawer-host::before {
  content: ""; position: absolute; inset: 0; background: rgba(12, 18, 16, .38);
  animation: fade var(--t) both;
}
.drawer {
  position: relative; width: min(460px, 100%); height: 100%;
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--sh-3); display: flex; flex-direction: column;
  animation: slideIn var(--t) both;
}
@keyframes slideIn { from { transform: translateX(28px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.drawer.wide { width: min(620px, 100%); }
.drawer-head {
  display: flex; align-items: flex-start; gap: 10px; flex: none;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.drawer-head h2 { font-size: 15.5px; }
.drawer-head .sub { margin-top: 2px; }
.drawer-body { padding: 16px; overflow-y: auto; flex: 1; min-height: 0; }
.drawer-foot {
  display: flex; gap: 8px; flex-wrap: wrap; flex: none;
  padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2);
}
.drawer-foot .grow { flex: 1; }
.drawer-foot .left { margin-right: auto; }
.x-close { background: none; border: 0; cursor: pointer; color: var(--text-3); font-size: 20px; line-height: 1; padding: 0 2px; flex: none; margin-left: auto; }
.x-close:hover { color: var(--text); }

/* Mini-statistieken in een drawer */
.d-stats { display: flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; margin-bottom: 14px; }
.d-stat { flex: 1 1 90px; padding: 9px 11px; border-left: 1px solid var(--border); }
.d-stat:first-child { border-left: 0; }
.d-stat span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 620; }
.d-stat b { display: block; font-size: 15px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* --- Gast-autocomplete (naam / 06-nummer / e-mail) ---
   De lijst hangt aan <body> met position:fixed, omdat .drawer-body scrollt en
   een absolute lijst daar afgekapt zou worden. Plaatsing gebeurt in JS. */
.ac-list {
  position: fixed; z-index: 75; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); box-shadow: var(--sh-3); padding: 5px;
  animation: fade var(--t) both;
}
.ac-list[hidden] { display: none; }
.ac-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 8px;
  border-radius: var(--r-sm); cursor: pointer; min-width: 0;
}
.ac-item:hover { background: var(--surface-2); }
.ac-item.active { background: var(--accent-soft); }
.ac-av {
  width: 25px; height: 25px; flex: none; border-radius: var(--r-full);
  background: var(--surface-3); color: var(--text-2);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 650;
}
.ac-item.active .ac-av { background: var(--accent); color: var(--on-accent); }
.ac-txt { min-width: 0; flex: 1; }
.ac-txt b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-txt i {
  display: block; font-style: normal; font-size: 11.5px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px;
}
.ac-list mark { background: var(--accent-soft); color: var(--accent-text); font-weight: 650; border-radius: 2px; padding: 0 1px; }
.ac-item.active mark { background: transparent; color: var(--accent-text); }
.ac-empty { display: flex; align-items: center; gap: 7px; padding: 8px; font-size: 12.5px; color: var(--text-3); }

/* Zichtbare bevestiging dat er aan een bestaand profiel gekoppeld is */
.ac-linked {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 5px; font-size: 11.5px; color: var(--accent-text);
}
.ac-linked b { font-weight: 650; }
.ac-unlink {
  display: inline-flex; align-items: center; gap: 3px; margin-left: auto;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  border-radius: var(--r-full); padding: 2px 8px; font-size: 11px; cursor: pointer;
}
.ac-unlink:hover { border-color: var(--border-strong); color: var(--text); }

/* --- Modal: alleen nog voor bevestigingen --- */
.modal-host {
  position: fixed; inset: 0; z-index: 80; background: rgba(12, 18, 16, .44);
  display: grid; place-items: center; padding: 20px; animation: fade var(--t) both;
}
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh-3); width: min(560px, 100%); max-height: min(88vh, 860px);
  display: flex; flex-direction: column; animation: pop var(--t) both;
}
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: 0; } }
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex: none; }
.modal-head h2 { font-size: 15.5px; }
.modal-body { padding: 16px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); flex: none; }
.modal-foot .left { margin-right: auto; }

/* --- Command palette --- */
.cmdk {
  position: fixed; inset: 0; z-index: 90; background: rgba(12, 18, 16, .44);
  display: flex; justify-content: center; align-items: flex-start;
  padding: 10vh 20px 20px; animation: fade var(--t) both;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.cmdk-box {
  width: min(620px, 100%); max-height: 70vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-lg); box-shadow: var(--sh-3); overflow: hidden;
  animation: pop var(--t) both;
}
.cmdk-top { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--border); flex: none; }
.cmdk-top .ci { color: var(--text-3); font-size: 16px; }
.cmdk-input { flex: 1; height: 50px; border: 0; background: none; outline: none; font-size: 15px; padding: 0; }
.cmdk-input:focus { box-shadow: none; }
.cmdk-list { overflow-y: auto; padding: 6px; flex: 1; min-height: 0; }
.cmdk-group { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 9px 9px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px; }
.cmdk-item:hover { background: var(--surface-2); }
.cmdk-item.active { background: var(--accent-soft); }
.cmdk-item.active .ck-label { color: var(--accent-text); font-weight: 600; }
.ck-ico { width: 22px; height: 22px; flex: none; border-radius: var(--r-xs); background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; font-size: 11px; }
.ck-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-sub { color: var(--text-3); font-size: 11.5px; white-space: nowrap; }
.cmdk-foot {
  display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--border);
  background: var(--surface-2); font-size: 11px; color: var(--text-3); flex: none; flex-wrap: wrap;
}

/* --- Toast --- */
.toast-host { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px;
  background: var(--rail); color: var(--rail-ink);
  border: 1px solid var(--rail-line); border-radius: var(--r-sm);
  padding: 10px 14px; box-shadow: var(--sh-2); max-width: 340px; font-size: 13px;
  animation: toastIn var(--t) both; pointer-events: auto;
}
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }
.toast .ico { width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; background: var(--rail-2); flex: none; }
.toast.good .ico { background: var(--good); color: #fff; }
.toast.bad  .ico { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); transition: all var(--t); }

/* Hulp-overlay */
.help-overlay { position: fixed; inset: 0; z-index: 85; background: rgba(12, 18, 16, .46); display: grid; place-items: center; padding: 20px; }
.help-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; width: min(460px, 100%); box-shadow: var(--sh-3); max-height: 86vh; overflow-y: auto; }
.help-card h3 { margin-bottom: 10px; }
.help-card h4 { color: var(--text-3); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; margin: 14px 0 3px; }
.help-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.help-row:last-child { border-bottom: 0; }

/* --- Installeren (PWA) ----------------------------------------------------
   Drie verschijningsvormen van dezelfde actie: een knop in de rail (desktop),
   een onderbalk (mobiel, waar de rail achter het hamburger-menu zit) en een
   CTA op de inlogpagina. Alle drie openen .inst-overlay. */
.rail-install {
  height: auto; padding: 7px 4px; gap: 3px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--rail-active-bg); color: var(--rail-active);
  font-size: 8.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  line-height: 1;
}
.rail-install:hover { background: #1c554d; color: #7fe3d3; }
/* Het label is klein; zonder vaste maat zou het icoon met die font-size
   meekrimpen tot een stipje. */
.rail-install .i { width: 17px; height: 17px; }

.inst-cta {
  width: 100%; display: flex; align-items: center; gap: 11px; text-align: left;
  padding: 11px 13px; height: auto; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--text); font: inherit; transition: border-color var(--t-fast), background var(--t-fast);
}
.inst-cta:hover { background: var(--surface-3); border-color: var(--border-strong); }
.inst-cta .ic-mark {
  width: 34px; height: 34px; flex: none; border-radius: var(--r-sm);
  background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center;
}
.inst-cta .ic-mark .i { width: 18px; height: 18px; }
.inst-cta .ic-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.inst-cta .ic-txt b { font-size: 13px; font-weight: 600; }
.inst-cta .ic-txt span { font-size: 11.5px; color: var(--text-2); }
.inst-cta .ic-go { margin-left: auto; color: var(--text-3); flex: none; }

.inst-banner {
  position: fixed; z-index: 90;
  left: calc(12px + env(safe-area-inset-left)); right: calc(12px + env(safe-area-inset-right));
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: none; align-items: center; gap: 11px; padding: 10px 11px;
  background: var(--rail); color: var(--rail-ink);
  border: 1px solid var(--rail-line); border-radius: var(--r-md); box-shadow: var(--sh-3);
  animation: toastIn var(--t) both;
}
.inst-banner .ib-mark {
  width: 32px; height: 32px; flex: none; border-radius: var(--r-sm);
  background: var(--rail-active-bg); color: var(--rail-active); display: grid; place-items: center;
}
.inst-banner .ib-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.inst-banner .ib-txt b { font-size: 12.5px; font-weight: 600; }
.inst-banner .ib-txt > span { font-size: 11px; color: var(--rail-ink-2); }
.inst-banner .btn-primary { margin-left: auto; flex: none; }
.inst-banner .ib-x {
  width: 26px; height: 26px; flex: none; border: 0; background: none; padding: 0;
  color: var(--rail-ink-2); cursor: pointer; border-radius: var(--r-xs); display: grid; place-items: center;
}
.inst-banner .ib-x:hover { background: var(--rail-2); color: var(--rail-ink); }
.inst-banner .ib-x .i { width: 14px; height: 14px; }

.inst-overlay {
  position: fixed; inset: 0; z-index: 95; background: rgba(12, 18, 16, .5);
  display: grid; place-items: center; padding: 20px; overflow-y: auto;
}
.inst-card {
  position: relative; width: min(432px, 100%); max-height: 90vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px; box-shadow: var(--sh-3);
  animation: instIn var(--t) both;
}
@keyframes instIn { from { transform: translateY(10px) scale(.985); opacity: 0; } }
.inst-x {
  position: absolute; top: 12px; right: 12px; width: 28px; height: 28px;
  border: 0; background: none; color: var(--text-3); cursor: pointer;
  border-radius: var(--r-xs); display: grid; place-items: center;
}
.inst-x:hover { background: var(--surface-2); color: var(--text); }
.inst-x .i { width: 15px; height: 15px; }

.inst-hero { display: flex; gap: 13px; align-items: flex-start; padding-right: 26px; }
.inst-mark { border-radius: var(--r-md); border: 1px solid var(--border); flex: none; }
.inst-hero h3 { font-size: 16.5px; line-height: 1.25; }
.inst-lead { font-size: 12.5px; color: var(--text-2); margin-top: 4px; line-height: 1.5; }

.inst-benefits { list-style: none; padding: 0; margin: 15px 0; display: flex; flex-direction: column; gap: 7px; }
.inst-benefits li { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text-2); }
.inst-benefits .i { width: 15px; height: 15px; color: var(--accent-text); flex: none; }

.inst-go { justify-content: center; gap: 8px; height: 42px; font-size: 14px; }
.inst-note { font-size: 11.5px; color: var(--text-3); text-align: center; margin-top: 7px; }

.inst-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 3px; }
.inst-steps li {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm);
}
.inst-steps .is-n {
  width: 19px; height: 19px; flex: none; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; font-size: 10.5px; font-weight: 700;
}
.inst-steps .is-ico { flex: none; color: var(--text); display: grid; place-items: center; }
.inst-steps .is-ico .i { width: 18px; height: 18px; }
.inst-steps .is-txt { font-size: 12.5px; line-height: 1.45; }
.inst-steps .is-txt b { font-weight: 650; }

.inst-manual { margin-top: 14px; }
.inst-manual summary {
  cursor: pointer; font-size: 12px; font-weight: 550; color: var(--accent-text);
  padding: 4px 0; list-style: none;
}
.inst-manual summary::-webkit-details-marker { display: none; }
.inst-manual summary::before { content: "▸ "; }
.inst-manual[open] summary::before { content: "▾ "; }
.inst-manual summary:hover { text-decoration: underline; }
.inst-manual .inst-steps { margin-top: 8px; }

/* ==========================================================================
   13. AGENDA
   ========================================================================== */
.tl-scroll { overflow: auto; max-height: calc(100vh - 230px); }
.tl-grid { min-width: 100%; position: relative; }
.tl-axis, .tl-row { display: flex; align-items: stretch; }
.tl-axis { position: sticky; top: 0; z-index: 6; }
.tl-row-label {
  width: 128px; flex: none; padding: 7px 11px;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--surface-2); position: sticky; left: 0; z-index: 3;
  display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
}
.tl-row-label .cap { margin-left: auto; font-size: 11px; color: var(--text-3); font-weight: 500; }
.tl-corner { background: var(--surface-3); z-index: 7; }
.tl-lane { position: relative; flex: 1; border-bottom: 1px solid var(--border); min-height: 42px; }
.tl-hours { min-height: 30px; background: var(--surface-3); }
.tl-tick { position: absolute; top: 0; height: 100%; border-left: 1px solid var(--border); padding: 6px 0 0 5px; font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tl-tick.half { border-left-style: dotted; }
.tl-row:nth-child(odd) .tl-lane { background: var(--surface); }
.tl-row:nth-child(even) .tl-lane { background: var(--surface-2); }
.tl-row.unassigned .tl-row-label { color: var(--warn); }
.tl-book { cursor: copy; }
.tl-lane.drop-ok { box-shadow: inset 0 0 0 2px var(--accent); }
.tl-lane.drop-bad { box-shadow: inset 0 0 0 2px var(--danger); }

.tl-block {
  position: absolute; top: 4px; bottom: 4px;
  border-radius: var(--r-xs); padding: 4px 7px;
  font-size: 11px; line-height: 1.3; color: #fff;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  cursor: grab; border: 1px solid rgba(0, 0, 0, .14);
  background: var(--accent); z-index: 2; transition: filter var(--t-fast);
}
.tl-block:hover { filter: brightness(1.08); z-index: 5; }
.tl-block:active { cursor: grabbing; }
.tl-block b { font-weight: 700; }
.tl-block.seated { background: var(--good); }
.tl-block.completed { background: var(--text-3); }
.tl-block.no-show { background: var(--danger); }
.tl-block.waitlist { background: var(--info); }
.tl-block.late { box-shadow: 0 0 0 2px var(--danger); }
.tl-block.dragging { opacity: .45; }
.tl-block .tl-grip { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: ew-resize; background: rgba(255, 255, 255, .24); opacity: 0; transition: opacity var(--t-fast); }
.tl-block:hover .tl-grip { opacity: 1; }

.tl-now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 2; pointer-events: none; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 5; pointer-events: none; }
.tl-now::before { content: ""; position: absolute; top: 0; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.tl-ghost { position: fixed; z-index: 200; pointer-events: none; background: var(--rail); color: var(--rail-ink); border-radius: var(--r-xs); padding: 5px 9px; font-size: 11.5px; font-weight: 620; box-shadow: var(--sh-2); }

/* ==========================================================================
   14. PLATTEGROND
   ========================================================================== */
.floor { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.floor-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-md);
}
.floor-bar .sep { width: 1px; height: 20px; background: var(--border); flex: none; margin: 0 2px; }
.floor-bar .stat-inline { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.floor-bar .stat-inline b { color: var(--text); font-variant-numeric: tabular-nums; }

.toolset { display: flex; gap: 2px; padding: 2px; background: var(--surface-3); border-radius: var(--r-sm); }
.tool { display: grid; place-items: center; width: 30px; height: 28px; border: 0; border-radius: var(--r-xs); background: none; cursor: pointer; font-size: 13px; color: var(--text-2); transition: background var(--t-fast), color var(--t-fast); }
.tool:hover { background: var(--surface); color: var(--text); }
.tool.active { background: var(--accent); color: var(--on-accent); }

.zoom-ctl { display: flex; align-items: center; gap: 2px; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 2px; }
.zoom-ctl button { width: 24px; height: 24px; border: 0; background: none; cursor: pointer; border-radius: var(--r-xs); color: var(--text-2); font-size: 13px; line-height: 1; }
.zoom-ctl button:hover { background: var(--surface-2); color: var(--text); }
.zoom-ctl .pct { font-size: 11.5px; min-width: 40px; text-align: center; color: var(--text-2); font-variant-numeric: tabular-nums; }

.time-scrub { display: flex; align-items: center; gap: 8px; min-width: 200px; flex: 1; }
.time-scrub input[type="range"] { flex: 1; min-width: 90px; }
.time-scrub .t { font-variant-numeric: tabular-nums; font-weight: 640; font-size: 13px; min-width: 42px; text-align: center; }

.floor-body { display: flex; gap: 12px; align-items: flex-start; min-height: 0; }
.floor-stage { flex: 1; min-width: 0; overflow: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 20px; max-height: calc(100vh - 220px); }
.floor-scale { transform-origin: 0 0; width: max-content; margin: 0 auto; }
.floor-canvas { position: relative; margin: 0 auto; background-color: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm); box-shadow: var(--sh-1); }
.floor-canvas.grid-on { background-image: var(--grid-img), var(--grid-img-lg); }
.floor-canvas.editing { cursor: crosshair; }
.floor-canvas.editing.tool-select { cursor: default; }

.fl-zone { position: absolute; border-radius: var(--r-sm); border: 1.5px dashed currentColor; overflow: visible; user-select: none; z-index: 1; }
.fl-zone.ellipse { border-radius: 50%; }
.fl-zone .zl { position: absolute; top: 4px; left: 6px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .9; pointer-events: none; }
.editing .fl-zone { cursor: move; }
.editing .fl-zone:hover { border-style: solid; }
.fl-zone.selected { border-style: solid; box-shadow: 0 0 0 2px var(--accent); }

.fl-obj { position: absolute; border-radius: var(--r-xs); border: 1.5px solid currentColor; display: grid; place-items: center; user-select: none; font-size: 11px; font-weight: 600; text-align: center; z-index: 2; overflow: hidden; }
.fl-obj .oi { font-size: 14px; line-height: 1; }
.fl-obj .on { font-size: 9.5px; opacity: .85; margin-top: 1px; }
.fl-obj.wall { border-radius: 2px; border-width: 0; }
.fl-obj.label { border: 0; background: none !important; font-size: 12px; font-weight: 650; }
.editing .fl-obj { cursor: move; }
.fl-obj.selected { box-shadow: 0 0 0 2px var(--accent); }

.fl-table {
  position: absolute; z-index: 4; background: var(--surface); border: 2px solid var(--border-strong);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  user-select: none; text-align: center; line-height: 1.15;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.fl-table.round, .fl-table.oval { border-radius: 50%; }
.fl-table.square, .fl-table.rect { border-radius: var(--r-xs); }
.fl-table.booth { border-radius: var(--r-md) var(--r-md) 3px 3px; }
.fl-table.counter { border-radius: var(--r-full); }
/* Vrij = open contour, bezet = dichtgevuld. Tijdens de service moet je in één
   oogopslag zien welke tafels vol zitten; alleen een andere tint volstaat niet. */
.fl-table.free { border-color: var(--good); background: var(--surface); }
.fl-table.soon { border-color: var(--warn); background: var(--warn-soft); }
.fl-table.occupied { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.fl-table.overrun { border-color: var(--danger); background: var(--danger); color: #fff; }
.fl-table.blocked { border-color: var(--border-strong); background: var(--surface-3); opacity: .65; }
.fl-table.occupied .ft-cap, .fl-table.overrun .ft-cap,
.fl-table.occupied .ft-occ, .fl-table.overrun .ft-occ { color: inherit; opacity: .85; }
.fl-table.occupied .seat.taken { background: var(--accent); }
.fl-table.overrun .seat.taken { background: var(--danger); }
.fl-table.selected { box-shadow: 0 0 0 2px var(--accent), var(--sh-2); }
.fl-table.drop-target { box-shadow: 0 0 0 3px var(--accent); }
.fl-table.drop-deny { box-shadow: 0 0 0 3px var(--danger); }
.editing .fl-table { cursor: move; }
.fl-table > .ft-name, .fl-table > .ft-cap, .fl-table > .ft-occ { max-width: 96%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-table .ft-name { font-weight: 720; font-size: 13px; }
.fl-table .ft-cap { font-size: 9.5px; color: var(--text-2); }
.fl-table .ft-occ { font-size: 9.5px; font-weight: 700; color: var(--accent-text); }
.fl-table .ft-tag { position: absolute; top: -8px; left: -6px; background: var(--text); color: var(--surface); font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: var(--r-full); line-height: 1.5; }
.fl-table .ft-next { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: 9px; font-weight: 640; padding: 0 5px; border-radius: var(--r-full); white-space: nowrap; }

.seat { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); pointer-events: none; }
.fl-table.occupied .seat.taken { background: var(--accent); }

.handle { position: absolute; width: 11px; height: 11px; background: var(--surface); border: 2px solid var(--accent); border-radius: 2px; z-index: 20; touch-action: none; }
.handle.se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.handle.rot { top: -22px; left: 50%; margin-left: -6px; border-radius: 50%; cursor: grab; background: var(--accent); border-color: var(--surface); }
.handle.rot::before { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 12px; background: var(--accent); transform: translateX(-50%); }
.canvas-handle { position: absolute; right: -8px; bottom: -8px; width: 18px; height: 18px; border-radius: var(--r-xs); background: var(--accent); border: 3px solid var(--surface); cursor: nwse-resize; z-index: 30; touch-action: none; box-shadow: var(--sh-1); }

.guide { position: absolute; background: var(--violet); z-index: 25; pointer-events: none; }
.guide.v { width: 1px; top: 0; bottom: 0; }
.guide.h { height: 1px; left: 0; right: 0; }
.marquee { position: absolute; z-index: 24; pointer-events: none; border: 1px solid var(--accent); background: var(--accent-soft); opacity: .5; border-radius: 2px; }

.floor-side { width: 256px; flex: none; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 220px); overflow-y: auto; }
.insp { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; }
.insp h4 { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.insp .field { margin-bottom: 10px; }
.insp .tip-list { font-size: 12px; color: var(--text-2); line-height: 1.65; padding-left: 0; list-style: none; margin: 0; }
.insp .tip-list li { padding-left: 14px; position: relative; }
.insp .tip-list li::before { content: "·"; position: absolute; left: 5px; font-weight: 700; }
.insp .tip-list b { color: var(--text); }

.palette { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.palette button { aspect-ratio: 1; border: 1px solid var(--border); border-radius: var(--r-xs); background: var(--surface-2); cursor: pointer; font-size: 14px; display: grid; place-items: center; color: var(--text-2); }
.palette button:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.palette button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }

.swatches { display: flex; gap: 5px; flex-wrap: wrap; }
.swatch { width: 22px; height: 22px; border-radius: var(--r-xs); border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.active { border-color: var(--text); }

.tray-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px; margin-bottom: 5px;
  background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--r-sm); cursor: grab; font-size: 12.5px; touch-action: none;
}
.tray-item:last-child { margin-bottom: 0; }
.tray-item:hover { border-color: var(--border-strong); }
.tray-item:active { cursor: grabbing; }
.tray-item.dragging { opacity: .4; }
.tray-item .tm { font-weight: 640; font-variant-numeric: tabular-nums; }
.tray-item .tn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tray-item .tp { color: var(--text-2); font-size: 11.5px; white-space: nowrap; }

.drag-ghost { position: fixed; z-index: 300; pointer-events: none; background: var(--rail); color: var(--rail-ink); padding: 6px 10px; border-radius: var(--r-sm); font-size: 12px; font-weight: 620; box-shadow: var(--sh-2); white-space: nowrap; }

.mini-x { position: absolute; top: -8px; right: -8px; width: 18px; height: 18px; border-radius: 50%; background: var(--danger); color: #fff; border: 2px solid var(--surface); font-size: 11px; line-height: 1; cursor: pointer; padding: 0; display: none; place-items: center; z-index: 21; }
.editing .fl-table:hover .mini-x, .editing .fl-zone:hover .mini-x, .editing .fl-obj:hover .mini-x { display: grid; }

.fl-table, .fl-zone, .fl-obj, .handle, .canvas-handle, .tl-block { touch-action: none; }

/* ==========================================================================
   15. AUTH / ADMIN / GAST
   ========================================================================== */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-brand { position: relative; display: flex; align-items: center; padding: 6vh 5vw; color: #fff; overflow: hidden; background: var(--rail) url("../assets/auth-bg.png") center / cover no-repeat; }
.auth-brand::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: rgba(9, 16, 14, .56); }
.auth-brand-inner { position: relative; z-index: 1; max-width: 440px; background: rgba(8, 14, 12, .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--r-xl); padding: 26px 28px; }
.auth-logo { width: 46px; height: 46px; border-radius: var(--r-md); background: var(--accent); display: grid; place-items: center; font-size: 24px; margin-bottom: 16px; }
.auth-brand h1 { font-size: 32px; margin-bottom: 10px; letter-spacing: .01em; }
.auth-brand h1 span { opacity: .7; }
.auth-tag { font-size: 15px; line-height: 1.55; opacity: .92; }
.auth-feats { list-style: none; padding: 0; margin: 18px 0 0; font-size: 13.5px; }
.auth-feats li { padding: 5px 0; opacity: .92; }
.auth-form { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6vh 6vw; gap: 14px; background: var(--canvas); }
.auth-card { width: min(384px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; }
.auth-card h2 { font-size: 20px; }
.auth-err { color: var(--danger); font-size: 12.5px; min-height: 17px; margin: 4px 0 10px; }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 11.5px; margin: 16px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-foot { color: var(--text-3); font-size: 12px; }
.invite-chip { background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-text); border-radius: var(--r-sm); padding: 9px 11px; font-size: 12.5px; margin-bottom: 14px; }

.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; background: var(--surface); border-bottom: 1px solid var(--border); }
.admin-top .brand { display: flex; align-items: center; gap: 10px; }
.admin-top .brand-mark { width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 17px; }
.admin-top .brand-text { min-width: 0; }
.admin-top .brand-name { font-weight: 700; font-size: 14px; }
.admin-top .brand-name span { color: var(--accent-text); }
.admin-top .brand-sub { font-size: 11.5px; color: var(--text-2); }
.admin-wrap { max-width: 1020px; margin: 0 auto; padding: 20px; }
.company-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.company-row:last-child { border-bottom: 0; }
.invite-link { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 7px 9px; width: 100%; height: auto; }

.guest-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.guest-panel { width: min(456px, 100%); }
.guest-mark { width: 42px; height: 42px; border-radius: var(--r-md); background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 22px; margin: 0 auto 10px; }

/* ==========================================================================
   16. RESPONSIVE
   ========================================================================== */
@media (display-mode: standalone) {
  .rail { padding-top: calc(10px + env(safe-area-inset-top)); }
  .bar  { padding-top: calc(10px + env(safe-area-inset-top)); }
}

@media (max-width: 1240px) {
  .split { grid-template-columns: minmax(0, 1fr) 300px; }
  .floor-side { width: 232px; }
}

@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: fixed; inset: 0 auto 0 0; width: 210px; z-index: 75;
    align-items: stretch; transform: translateX(-100%); transition: transform var(--t);
    box-shadow: var(--sh-3); padding-left: calc(8px + env(safe-area-inset-left));
  }
  .rail.open { transform: none; }
  .rail-item { flex-direction: row; justify-content: flex-start; gap: 11px; padding: 9px 12px; }
  .rail-item .ri-ico { width: 18px; text-align: center; }
  .rail-item .ri-label { font-size: 13px; font-weight: 550; }
  .rail-item.active::before { left: 0; }
  .rail-item .ri-dot { position: static; margin-left: auto; border: 0; }
  .rail-brand { margin: 4px 0 10px 8px; }
  .rail-foot { flex-direction: row; flex-wrap: wrap; }
  .rail-btn { width: auto; flex: 1; }
  .rail-status { justify-content: flex-start; padding-left: 10px; }
  /* De rail zit hier achter het hamburger-menu, dus de installatieknop krijgt
     een eigen onderbalk die wél meteen zichtbaar is. */
  .rail-install { flex: 1 1 100%; flex-direction: row; gap: 8px; padding: 9px 12px; justify-content: flex-start; font-size: 11px; }
  .inst-banner { display: flex; }
  body.has-install-banner .toast-host { bottom: calc(74px + env(safe-area-inset-bottom)); }
  .rail-backdrop.show { display: block; position: fixed; inset: 0; z-index: 72; background: rgba(10, 16, 14, .5); }
  .hamburger { display: inline-flex; }
  .split { grid-template-columns: 1fr; }
  .cols-3, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .floor-body { flex-direction: column; }
  .floor-side { width: 100%; max-height: none; flex-direction: row; flex-wrap: wrap; }
  .floor-side > * { flex: 1 1 240px; }
  .floor-stage { max-height: 58vh; width: 100%; }
  .tl-scroll { max-height: 56vh; }
}

@media (max-width: 720px) {
  .bar { padding: 8px 12px; gap: 8px; }
  .bar-title h1 { font-size: 16px; }
  .bar-title .sub { display: none; }
  .page { padding: 12px 12px 32px; }
  .cmd-trigger { min-width: 0; width: var(--h-ctl); padding: 0; justify-content: center; }
  .cmd-trigger .ct-txt { display: none; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .metric { flex: 1 1 50%; }
  .m-value { font-size: 21px; }
  .card { padding: 13px; }
  .field-row, .field-row-3, .check-grid { grid-template-columns: 1fr; }
  .drawer-host { align-items: flex-end; }
  .drawer { width: 100%; height: 92vh; border-left: 0; border-top: 1px solid var(--border); border-radius: var(--r-xl) var(--r-xl) 0 0; animation: sheetIn var(--t) both; }
  @keyframes sheetIn { from { transform: translateY(30px); opacity: 0; } }
  .drawer-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .modal-host { padding: 0; align-items: stretch; }
  .modal { width: 100%; max-height: 100%; height: 100%; border-radius: 0; border: 0; }
  .cmdk { padding: 0; }
  .cmdk-box { max-height: 100%; height: 100%; border-radius: 0; border: 0; }
  .toast-host { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); align-items: stretch; }
  .toast { max-width: none; }
  .bar-track { height: 74px; }
  .lbl-full { display: none; }
  table.data th, table.data td { padding: 8px 9px; }
  table.data .cell-main, table.data .cell-sub { white-space: nowrap; }
  .run-time { width: 40px; font-size: 13px; }
  .floor-bar { padding: 6px; gap: 6px; }
  .time-scrub { order: 10; width: 100%; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form { min-height: 100vh; justify-content: flex-start; padding-top: 7vh; }
}

@media (min-width: 721px) { .lbl-short { display: none; } }

/* ==========================================================================
   17. FEESTEN & OFFERTES
   --------------------------------------------------------------------------
   Een feest doorloopt aanvraag → offerte → bevestigd; de statuspil gebruikt
   dezelfde vormtaal als die van een reservering, met een eigen kleurpad.
   ========================================================================== */
.status.ev-request   { background: var(--warn-soft);   color: var(--warn);       border-color: var(--warn-line); }
.status.ev-quoted    { background: var(--info-soft);   color: var(--info);       border-color: var(--info-line); }
.status.ev-confirmed { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-line); }
.status.ev-completed { background: var(--surface-3);   color: var(--text-2);     border-color: var(--border); }
.status.ev-cancelled { background: var(--surface-3);   color: var(--text-3);     border-color: var(--border); }
.status.ev-lost      { background: var(--danger-soft); color: var(--danger);     border-color: var(--danger-line); }

/* Kopregel per blok in de feest-drawer */
.ev-sec {
  display: flex; align-items: center; gap: 7px;
  margin: 20px 0 10px; padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
}
.ev-sec .sub { text-transform: none; letter-spacing: 0; margin-left: auto; }
.ev-sec:first-child { margin-top: 0; }

.ev-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 9px 11px;
}
.ev-toolbar .grow { flex: 1; }

/* Bewerkbare offerteregels — compacte velden zodat een regel op één rij past */
.qlines table.data th, .qlines table.data td { padding: 5px 6px; vertical-align: top; }
.qlines table.data th:first-child, .qlines table.data td:first-child { padding-left: 0; }
.ql-label, .ql-desc, .ql-num, .ql-sel {
  width: 100%; box-sizing: border-box; height: 30px; padding: 0 7px;
  border: 1px solid var(--border); border-radius: var(--r-xs);
  background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px;
}
.ql-label:focus, .ql-desc:focus, .ql-num:focus, .ql-sel:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft);
}
.ql-desc { margin-top: 4px; height: 26px; font-size: 11.5px; color: var(--text-2); }
.ql-num { text-align: right; min-width: 62px; }
.ql-sel { min-width: 76px; }
table.data.compact th, table.data.compact td { padding: 5px 6px; }

/* Totalenblok onder de regels */
.q-totals {
  margin-top: 12px; margin-left: auto; width: min(320px, 100%);
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface-2); padding: 10px 12px;
}
.qt-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 12.5px; }
.qt-row b { font-variant-numeric: tabular-nums; }
.qt-row.muted { color: var(--text-3); }
.qt-row.neg b { color: var(--brand-2); }
.qt-row.total {
  margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--border-strong);
  font-size: 14px; color: var(--accent-text);
}
.qt-row.total b { font-size: 17px; font-weight: 680; }

/* Label + veld naast elkaar, voor korting/aanbetaling in de regelbalk */
.field.inline { display: flex; align-items: center; gap: 7px; margin: 0; }
.field.inline > label { margin: 0; white-space: nowrap; font-size: 11.5px; color: var(--text-2); }
.field.inline > input { width: 74px; height: var(--h-ctl-sm); text-align: right; }

.drawer.wide { width: min(760px, 100%); }

@media (max-width: 720px) {
  .qlines table.data td { min-width: 92px; }
  .q-totals { width: 100%; }
  .ev-toolbar .grow { display: none; }
}

/* ===========================================================================
   Beheer — Huisstijl
   De klant stelt hier logo, kleuren en teksten in voor de website-pop-up en
   de offerte. Alles wat je ziet is een voorbeeld van wat de GAST straks ziet,
   dus de vlakken blijven neutraal: geen accentkleur van ORBIT4 eroverheen.
   =========================================================================== */
.brand-logo-row { display: flex; gap: 16px; align-items: flex-start; }
.brand-logo-side { flex: 1; min-width: 0; }
.brand-logo-side .sub { margin: 0 0 10px; }

.brand-logo-box {
  width: 148px; height: 96px; flex: none; cursor: pointer;
  border: 1px dashed var(--border-strong); border-radius: var(--r-md);
  background: var(--surface-2); display: grid; place-items: center; padding: 10px;
  transition: border-color .12s, background .12s;
}
.brand-logo-box:hover { border-color: var(--accent); background: var(--surface); }
.brand-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-logo-box.empty span { color: var(--text-3); font-size: 11.5px; text-align: center; line-height: 1.7; }
.brand-logo-box.empty .i { width: 18px; height: 18px; }

.brand-swatches { display: flex; gap: 6px; margin-top: 10px; }
.brand-swatch {
  width: 22px; height: 22px; border-radius: var(--r-full); cursor: pointer;
  border: 1px solid var(--border-strong); padding: 0;
}

.brand-color-row { display: flex; gap: 6px; align-items: center; }
.brand-color-row input[type="color"] {
  width: 38px; height: var(--h-ctl); padding: 2px; flex: none; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface);
}
.brand-color-row input[type="text"] { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: 12.5px; }
.brand-color-row input:disabled { opacity: .45; cursor: not-allowed; }

.brand-contrast {
  display: inline-block; padding: 3px 10px; border-radius: var(--r-full);
  font-weight: 600; font-size: 11.5px; margin-left: 4px;
}

.brand-group {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); margin: 16px 0 8px; padding-top: 12px; border-top: 1px solid var(--border);
}
.brand-group:first-child { margin-top: 0; padding-top: 0; border-top: none; }

/* Sjabloonkiezer voor de offerte */
.brand-templates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.brand-tpl {
  border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; background: var(--surface);
}
.brand-tpl:hover { border-color: var(--border-strong); }
.brand-tpl.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.brand-tpl b { font-size: 12.5px; }
.brand-tpl span { font-size: 11px; color: var(--text-3); line-height: 1.4; }

.brand-thumb {
  height: 74px; border-radius: var(--r-xs); overflow: hidden; padding: 0 0 8px;
  display: flex; flex-direction: column; align-items: center; margin-bottom: 6px;
}
.brand-thumb u { width: 100%; height: 22px; display: flex; align-items: center; padding: 0 7px; flex: none; }
.brand-thumb em { width: 9px; height: 9px; border-radius: 50%; display: block; }
.brand-thumb s { width: calc(100% - 14px); height: 2px; margin-top: 5px; display: block; }
.brand-thumb i { height: 3px; border-radius: 2px; display: block; align-self: flex-start; margin-left: 7px; }

/* Live voorbeeld van de website-pop-up */
.brand-preview {
  width: 100%; height: 520px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface-2); display: block;
}

@media (max-width: 720px) {
  .brand-logo-row { flex-direction: column; }
  .brand-templates { grid-template-columns: 1fr; }
  .brand-preview { height: 420px; }
}

/* ===========================================================================
   Subnavigatie binnen een view (Beheer)
   Een view met losstaande onderwerpen krijgt tabbladen in plaats van één
   eindeloze pagina. Bewust anders dan .segmented: dat filtert een lijst, dit
   verwisselt de hele inhoud.

   Twee elementen, niet één: de balk plakt bovenaan (zodat je vanuit een lange
   tab kunt wisselen zonder terug te scrollen) en moet daarom óók de ruimte
   eronder afdekken — anders schuift een paneel zichtbaar dóór het gat tussen
   de tabs en de eerste kaart. De binnenste track doet het horizontaal
   scrollen; had de plakkende laag zelf overflow, dan zou het afdekvlak
   meescrollen.
   =========================================================================== */
.subnav {
  position: sticky; top: 0; z-index: 5;
  background: var(--canvas);
  padding: 2px 0 var(--gap);
}
.subnav-track {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.subnav-track::-webkit-scrollbar { display: none; }
.subnav button {
  display: flex; align-items: center; gap: 7px; flex: none;
  border: 0; background: none; cursor: pointer;
  padding: 11px 14px; margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  font-size: 13.5px; font-weight: 550; color: var(--text-2); white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.subnav button .i { width: 16px; height: 16px; flex: none; opacity: .75; }
.subnav button:hover { color: var(--text); }
.subnav button.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.subnav button.active .i { opacity: 1; }

/* Op smal scherm alleen iconen tonen zou raadselachtig zijn: liever
   horizontaal scrollen mét labels, dus alleen de padding krimpt. */
@media (max-width: 560px) {
  .subnav button { padding: 10px 10px; font-size: 12.5px; }
}
