/* ── Material Symbols rendering ───────────────────────────────────── */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  line-height: 1;
  user-select: none;
}

/* ── Design tokens — Clean Contrast palette ─────────────────────────── */
:root {
  /* Brand */
  --primary:            #2563eb;   /* blue-600 — vivid, max contrast on white */
  --primary-dim:        #1d4ed8;
  --primary-container:  #dbeafe;   /* blue-100 tint */
  --primary-subtle:     rgba(37,99,235,.07);
  --on-primary:         #ffffff;

  /* Surfaces — pure neutral, zero blue tint */
  --bg:                 #f6f6f6;
  --surface:            #f6f6f6;
  --surface-low:        #efefef;
  --surface-mid:        #e2e2e2;
  --surface-high:       #c8c8c8;
  --surface-highest:    #b0b0b0;
  --card-bg:            #ffffff;

  /* Text — maximum legibility */
  --text:               #111111;   /* near-black  →  contrast 14.7:1 on bg */
  --text-muted:         #555555;   /* mid-gray    →  contrast  7.0:1 on white */
  --outline:            #888888;
  --outline-variant:    #93c5fd;   /* blue tint for active/focus rings */

  /* Semantic colours */
  --danger:             #c0392b;
  --danger-solid:       #c0392b;
  --success:            #1a7440;
  --warning:            #92400e;
  --danger-bg:          #fff0ef;
  --success-bg:         #edfbf3;
  --warning-bg:         #fffbeb;

  /* Layout */
  --sidebar-w:          248px;
  --topbar-h:           58px;
  --radius:             7px;
  --radius-lg:          12px;
  --shadow:             0 1px 3px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.06);
  --shadow-md:          0 4px 24px rgba(0,0,0,.12);
  --shadow-lg:          0 12px 40px rgba(0,0,0,.18);

  /* Typography — Geist variable (wght 100–900)
     Vercel's eigen font. Ultrascherp, technisch, modern.
     Eén familie voor kop én broodtekst. */
  --font-headline:      'Geist', ui-sans-serif, -apple-system, sans-serif;
  --font-body:          'Geist', ui-sans-serif, -apple-system, sans-serif;

  /* Sidebar */
  --sidebar-bg:         #ffffff;
  --sidebar-border:     #e8e8e8;
  --sidebar-text:       #555555;
  --sidebar-section:    #888888;
  --sidebar-hover-bg:   #f3f3f3;
  --sidebar-active-bg:  #dbeafe;
  --sidebar-active-txt: #2563eb;

  /* Legacy token aliases — keep older templates rendering correct colours.
     These map historical names to the canonical tokens above. */
  --color-green:        var(--success);
  --color-red:          var(--danger);
  --color-orange:       var(--warning);        /* dark amber — passes AA as text */
  --color-blue:         var(--primary);
  --color-blue-rgb:     37, 99, 235;           /* --primary as rgb triplet for rgba() */
  --color-green-rgb:    26, 116, 64;            /* --success as rgb triplet for rgba() */
  --border:             var(--surface-mid);
  --bg-hover:           var(--surface-low);
  --bg-card:            var(--card-bg);
  --bg-input:           var(--card-bg);
  --text-main:          var(--text);
  --accent:             var(--primary);
}

/* ── Reset ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  font-optical-sizing: auto;    /* Geist: opsz niet van toepassing, letter-spacing wel */
  letter-spacing: -0.01em;            /* Geist leest strak, licht negatief tracking */
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { opacity: .8; }

/* ── Top bar ──────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  z-index: 40;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1.5px solid var(--surface-mid);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
}

.topbar-left {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  border-radius: var(--radius);
}
.brand-link:hover { opacity: 1; }

.brand-logo {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-headline);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.3px;
  color: var(--text);
}

.topbar-center {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;   /* laat de bedrijfsnaam afkorten i.p.v. de topbar oprekken */
}

.topbar-company {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-low);
  border: 1px solid var(--outline-variant);
  border-radius: 99px;
  padding: 4px 12px 4px 8px;
}

.topbar-company > span:not(.material-symbols-outlined) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-switch {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-left: 4px;
  text-decoration: none;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  color: var(--text-muted);
  transition: background .15s, color .15s;
  text-decoration: none;
}

.topbar-icon-btn:hover {
  background: var(--surface-mid);
  color: var(--text);
}

.topbar-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-low);
  border: 1px solid var(--outline-variant);
  transition: background .15s, color .15s, border-color .15s;
  text-decoration: none;
  white-space: nowrap;
}

.topbar-pill-btn:hover {
  background: var(--surface-mid);
  color: var(--text);
  border-color: var(--outline);
}

.topbar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary-container);
  color: var(--primary-dim);
  font-family: var(--font-headline);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  user-select: none;
}

/* ── Taken-drawer (voorheen vaste zijbalk) ────────────────────────── */
/* Standaard verborgen; schuift in beeld als body.taken-open gezet is via
   het checklist-icoon in de topbar. */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: 42;
  transform: translateX(-105%);
  transition: transform .2s cubic-bezier(.4,0,.2,1);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 0 24px;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-high) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--surface-high); border-radius: 2px; }

.nav-list {
  list-style: none;
  padding: 0;
  flex: 1;
}

.nav-section {
  font-size: 11px;
  text-transform: none;       /* lowercase as requested */
  letter-spacing: .01em;
  color: var(--text-muted);
  padding: 14px 20px 4px;
  font-weight: 800;
  font-family: var(--font-body);
}

.nav-item { display: block; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px 7px 14px;
  margin: 1px 8px;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.nav-link:hover {
  background: var(--surface-low);
  color: var(--text);
  transform: translateX(3px);
  opacity: 1;
}

.nav-link.active {
  background: var(--primary-container);
  color: var(--primary);
  font-weight: 600;
  transform: none;
}

.nav-icon {
  font-size: 16px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
}

.nav-link.active .nav-icon {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

/* ── Collapsible nav group (Meer rapporten) ───────────────────────── */
.nav-more { list-style: none; }

.nav-more > summary { list-style: none; cursor: pointer; }
.nav-more > summary::-webkit-details-marker { display: none; }

.nav-more-toggle {
  /* push chevron to the right */
}
.nav-more-toggle .nav-more-chevron {
  font-size: 16px;
  margin-left: auto;
  flex-shrink: 0;
  transition: transform .22s ease;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
  color: var(--outline);
}
.nav-more[open] > summary .nav-more-chevron {
  transform: rotate(180deg);
}

.nav-more-list {
  list-style: none;
  padding: 2px 0 4px;
  overflow: hidden;
}
.nav-more[open] .nav-more-list {
  animation: sl-slide-down .18s ease both;
}

/* Sub-items indented */
.nav-link.nav-sub {
  padding-left: 20px;
  font-size: 12.5px;
}

/* ── Main content ─────────────────────────────────────────────────── */
/* Geen vaste zijbalk of menubalk meer: de inhoud staat gecentreerd onder
   de topbar; taken en menu zijn drawers achter de topbar-iconen. */
.main-content {
  margin: var(--topbar-h) auto 0;
  padding: 28px 36px 48px;
  max-width: 1280px;
  min-height: calc(100vh - var(--topbar-h));
}

.main-content.full-width {
  margin-left: 0;
  margin-top: 0;
  max-width: 100%;
  min-height: 100vh;
}

/* ── Beheerportaal-schil (admin/base.html): geen zijbalk of menubar ── */
/* .topbar-left heeft app-breed een vaste breedte (= zijbalkbreedte); in de
   portaal-schil is er geen zijbalk en is de inhoud (logo + naam + badge)
   breder dan die kolom — laat de breedte hier meegroeien met de inhoud. */
.admin-topbar .topbar-left {
  width: auto;
  margin-right: 28px;
}

.main-content.admin-main {
  margin: var(--topbar-h) auto 0;
  max-width: 1280px;
  min-height: calc(100vh - var(--topbar-h));
}

.admin-shell-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
}

.admin-nav {
  display: flex;
  gap: 6px;
}
.admin-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}
.admin-nav a:hover,
.admin-nav a.active {
  background: var(--surface-mid);
  color: var(--text);
}

/* Impersonatie-regels vallen op in het platformlogboek */
.audit-impersonation td { background: rgba(37, 99, 235, .08); }

.admin-nav .wf-nav-badge { margin-left: 2px; }

/* ── Support-berichtendraad (klant én beheerportaal) ─────────────────── */
.support-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.support-msg {
  max-width: 720px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface-mid);
  align-self: flex-start;
}
.support-msg-admin {
  background: rgba(37, 99, 235, .10);
  align-self: flex-end;
}
.support-msg-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
}
.support-msg-head span { color: var(--text-muted); }
.support-msg-body { white-space: pre-wrap; font-size: 14px; }

/* ── Aankondigingsbanners (platformbeheer → klant) ───────────────────── */
.announcement-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
}
.announcement-info {
  background: rgba(37, 99, 235, .10);
  color: var(--primary);
  border: 1px solid var(--primary);
}
.announcement-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning);
}
.announcement-banner-text {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.announcement-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 4px;
}
.announcement-dismiss:hover { background: rgba(0, 0, 0, .08); }

/* ── Flash messages ───────────────────────────────────────────────── */
.flash-messages { margin-bottom: 20px; }

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
}

.flash::before {
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
  font-size: 18px;
  flex-shrink: 0;
}

.flash-success {
  background: var(--success-bg);
  border: 1px solid #a7f3c0;
  color: var(--success);
}
.flash-success::before { content: 'check_circle'; }

.flash-error {
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  color: var(--danger);
}
.flash-error::before { content: 'error'; }

.flash-info {
  background: var(--primary-container);
  border: 1px solid var(--outline-variant);
  color: var(--primary-dim);
}
.flash-info::before { content: 'info'; }

/* ── Page header ──────────────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-header h1 {
  font-family: var(--font-headline);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.4px;
  color: var(--text);
  line-height: 1.15;
}

.header-actions { display: flex; gap: 8px; }
.company-title { font-size: 14px; color: var(--text-muted); font-weight: 500; }

/* ── Cards ────────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid rgba(100,122,171,.15);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.card-title {
  font-family: var(--font-headline);
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 18px;
  color: var(--text);
}

.form-card { max-width: 760px; }
.form-card-wide { max-width: 1100px; }
.upload-split-layout .form-card,
.upload-split-layout .form-card-wide { max-width: none; }

/* ── Invoice lines table ──────────────────────────────────────────── */
.table-scroll-wrapper { overflow-x: auto; }
.invoice-lines-table { min-width: 720px; }
.invoice-lines-table col.col-desc    { width: auto; min-width: 160px; }
.invoice-lines-table col.col-qty     { width: 75px; }
.invoice-lines-table col.col-price   { width: 95px; }
.invoice-lines-table col.col-btw     { width: 125px; }
.invoice-lines-table col.col-account { width: 175px; }
.invoice-lines-table col.col-total   { width: 85px; }
.invoice-lines-table col.col-del     { width: 40px; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  text-decoration: none;
  transition: background .12s, border-color .12s, box-shadow .12s, transform .1s;
  white-space: nowrap;
  letter-spacing: .01em;
  line-height: 1.4;
  user-select: none;
}

.btn:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
}

/* Primary — solid fill, max contrast */
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  box-shadow: 0 1px 2px rgba(0,0,0,.15), 0 0 0 0 rgba(37,99,235,0);
}
.btn-primary:hover {
  background: var(--primary-dim);
  border-color: var(--primary-dim);
  box-shadow: 0 2px 8px rgba(37,99,235,.35);
  transform: translateY(-1px);
  opacity: 1;
}
.btn-primary:active { transform: translateY(0); box-shadow: none; }

/* Secondary — clean border, strong text */
.btn-secondary {
  background: var(--card-bg);
  color: var(--text);
  border-color: var(--surface-mid);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.btn-secondary:hover {
  background: var(--surface-low);
  border-color: var(--surface-high);
  transform: translateY(-1px);
  opacity: 1;
}
.btn-secondary:active { transform: translateY(0); }

/* Danger — solid red so intent is unambiguous */
.btn-danger {
  background: #fff;
  color: var(--danger);
  border-color: #e8b4b0;
}
.btn-danger:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
  transform: translateY(-1px);
  opacity: 1;
}
.btn-danger:active { transform: translateY(0); }

.dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}
.dropdown-item:hover { background: var(--surface-low); }

.btn-full { width: 100%; justify-content: center; }
.btn-sm   { padding: 6px 13px; font-size: 12.5px; }
.btn-xs   { padding: 3px 9px; font-size: 11.5px; border-width: 1px; }

/* ── Segmented action control (relaties importeren) ───────────────────── */
.seg-control {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-low);
}
.seg-control input { position: absolute; opacity: 0; pointer-events: none; width: 0; }
.seg-control label {
  padding: 6px 11px;
  font-size: 12px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  border-right: 1px solid var(--border);
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.seg-control label:last-of-type { border-right: 0; }
.seg-control label:hover { background: var(--surface-mid); }
.seg-control input:checked + label { background: var(--primary); color: #fff; }
.seg-control input:checked + label[data-act="skip"] { background: var(--surface-high); color: var(--text); }
.seg-control input:checked + label[data-act="exclude"] { background: var(--danger); color: #fff; }
.seg-control input:focus-visible + label { box-shadow: inset 0 0 0 2px var(--primary-dim); }
.seg-control label.is-disabled { opacity: .45; cursor: not-allowed; }

/* ── Relaties-import: tabbladen ───────────────────────────────────────── */
.import-tabs {
  display: flex;
  gap: 2px;
  margin: 2px 0 16px;
  border-bottom: 2px solid var(--border);
}
.import-tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 9px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color .12s, border-color .12s;
}
.import-tab:hover { color: var(--text); }
.import-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.import-tab-count {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 99px;
  background: var(--surface-mid);
  color: var(--text-muted);
}
.import-tab.active .import-tab-count { background: var(--primary-container); color: var(--primary-dim); }

/* ── Relaties-import tabel ────────────────────────────────────────────── */
.import-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.import-toolbar-info { font-size: 13px; }
.import-toolbar-bulk { display: flex; align-items: center; gap: 6px; }
.import-bulk-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--outline);
  margin-right: 2px;
}
.import-table th, .import-table td { padding-left: 14px; padding-right: 14px; }
.import-table td { vertical-align: top; padding-top: 12px; padding-bottom: 12px; }
.import-table td.text-right { padding-top: 18px; font-variant-numeric: tabular-nums; }
.import-table .import-name { width: 100%; max-width: 340px; }
.import-table .import-name:disabled { background: var(--surface-low); color: var(--text-muted); }
.import-ibans { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; margin-top: 5px; }
.import-iban {
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: .2px;
}
.import-ibans-toggle {
  appearance: none;
  background: none;
  border: none;
  padding: 2px 0;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}
.import-ibans-toggle:hover { text-decoration: underline; }
.import-row.row-skip { opacity: .5; }
.import-row.row-exclude { background: var(--danger-bg); }
.import-context-note { font-size: 12px; font-style: italic; display: inline-block; padding-top: 7px; }
.import-new-fields { display: flex; flex-direction: column; gap: 6px; }
.import-new-fields select, .import-relation { width: 100%; font-size: 12.5px; }

/* ── Boekregels uit transacties ───────────────────────────────────────── */
.rb-card { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.rb-card.rb-off .rb-match, .rb-card.rb-off .rb-book { opacity: .55; }

/* Kop: tegenpartij + stats + aan/uit */
.rb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.rb-head-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; min-width: 0; }
.rb-payee { font-size: 16px; font-weight: 700; }
.rb-stats { display: inline-flex; gap: 12px; font-size: 12px; color: var(--text-muted);
  font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.rb-stats .rb-in { color: var(--success); font-weight: 600; }
.rb-stats .rb-out { color: var(--danger); font-weight: 600; }

/* Aan/uit-schakelaar */
.rb-switch { position: relative; display: inline-block; width: 40px; height: 23px; flex: none; }
.rb-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.rb-slider { position: absolute; inset: 0; cursor: pointer; border-radius: 23px;
  background: var(--surface-high); transition: background .15s; }
.rb-slider::before { content: ''; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.rb-switch input:checked + .rb-slider { background: var(--primary); }
.rb-switch input:checked + .rb-slider::before { transform: translateX(17px); }
.rb-switch input:disabled + .rb-slider { opacity: .4; cursor: not-allowed; }
.rb-switch input:focus-visible + .rb-slider { box-shadow: 0 0 0 3px rgba(37,99,235,.30); }

/* Match-blok */
.rb-match { background: var(--surface-low); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.rb-match-title { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.rb-group { display: flex; align-items: flex-start; gap: 10px; }
.rb-group-tag { flex: none; width: 38px; padding-top: 9px; font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.rb-group-fields { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; flex: 1; }
.rb-join { padding-left: 48px; }

/* Match-veld (chip) */
.rb-chip { flex: 1 1 220px; min-width: 190px; display: flex; flex-direction: column; gap: 5px;
  border: 1.5px solid var(--border); border-radius: var(--radius); padding: 8px 10px;
  background: var(--card-bg); transition: border-color .12s, background .12s; }
.rb-chip.is-on { border-color: var(--primary); background: var(--primary-subtle); }
.rb-chip-head { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.rb-use { position: absolute; opacity: 0; width: 0; height: 0; }
.rb-use-dot { width: 16px; height: 16px; border-radius: 50%; flex: none; position: relative;
  border: 2px solid var(--surface-high); background: var(--card-bg); transition: all .12s; }
.rb-use:checked + .rb-use-dot { border-color: var(--primary); background: var(--primary); }
.rb-use:checked + .rb-use-dot::after { content: ''; position: absolute; left: 4px; top: 1px;
  width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.rb-use:focus-visible + .rb-use-dot { box-shadow: 0 0 0 3px rgba(37,99,235,.30); }
.rb-chip-label { font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.rb-chip.is-on .rb-chip-label { color: var(--primary-dim); }
.rb-input { width: 100%; padding: 6px 9px; font-size: 13px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--bg-input); }
.rb-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-subtle); }

/* EN/OF-segmenten — compact, verticaal gecentreerd tussen de chips */
.rb-seg { align-self: center; flex: none; }
.rb-seg label { padding: 6px 10px; font-size: 11px; }

/* Preview + teken */
.rb-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding-left: 48px; padding-top: 2px; }
.rb-preview { font-size: 12.5px; }
.rb-preview-arrow { color: var(--text-muted); }
.rb-preview-arrow::after { content: ' →'; }
.rb-preview-text { font-weight: 700; }
.rb-sign { display: flex; align-items: center; gap: 8px; }
.rb-sign-lbl { font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted); }

/* Boekingsconfig */
.rb-book { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.rb-book-field { display: flex; flex-direction: column; gap: 3px; }
.rb-book-grow { flex: 1 1 240px; min-width: 200px; }
.rb-book-lbl { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.rb-book select, .rb-book input[type="number"] { padding: 7px 9px; font-size: 13px;
  border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--bg-input); }
.rb-book select:disabled, .rb-term[readonly] { opacity: .5; }
.rb-tax { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.rb-tax[hidden] { display: none; }   /* hidden-attribuut wint van display:flex */

/* Uitklapbare transactielijst */
.rb-txns { border-top: 1px solid var(--border); padding-top: 8px; }
.rb-txns > summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--primary);
  list-style: none; display: inline-flex; align-items: center; gap: 6px; user-select: none; }
.rb-txns > summary::-webkit-details-marker { display: none; }
.rb-txns > summary::before { content: '▸'; font-size: 10px; transition: transform .12s; }
.rb-txns[open] > summary::before { transform: rotate(90deg); }
.rb-txns > summary:hover { color: var(--primary-dim); }
.rb-txn-scroll { max-height: 280px; overflow: auto; margin-top: 8px;
  border: 1px solid var(--border); border-radius: var(--radius); }
.rb-txn-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rb-txn-table th { position: sticky; top: 0; background: var(--surface-low); text-align: left;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: var(--text-muted); padding: 6px 9px; border-bottom: 1px solid var(--border); }
.rb-txn-table td { padding: 5px 9px; border-bottom: 1px solid var(--surface-mid); vertical-align: top; }
.rb-txn-table tr:last-child td { border-bottom: 0; }
.rb-txn-date { white-space: nowrap; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rb-txn-iban { white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; color: var(--text-muted); }
.rb-txn-desc { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-txn-amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rb-txn-amt.rb-in { color: var(--success); font-weight: 600; }
.rb-txn-amt.rb-out { color: var(--danger); font-weight: 600; }

/* Plakkende actiebalk */
.rb-actionbar { position: sticky; bottom: 12px; z-index: 5; display: flex;
  justify-content: flex-end; align-items: center; gap: 14px; padding: 12px 16px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(0,0,0,.18); margin-top: 4px; }
#rb-count { font-size: 13px; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .rb-group { flex-direction: column; }
  .rb-group-tag { width: auto; padding-top: 0; }
  .rb-join, .rb-foot { padding-left: 0; }
  .rb-seg { align-self: flex-start; }
}

.import-cp-name { font-weight: 600; font-size: 13.5px; }
.import-decision-form { display: flex; gap: 6px; align-items: center; margin: 0; padding-top: 3px; }

/* ── Forms ────────────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);          /* full contrast — not muted */
  letter-spacing: .01em;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 8px 12px;
  border: 1.5px solid var(--surface-mid);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font-body);
  background: var(--card-bg);
  color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: var(--surface-high);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.30);
}

.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; }
.form-row .form-group.flex-grow { flex: 2; }
.form-check { flex-direction: row; align-items: center; gap: 8px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(100,122,171,.12);
}
.required { color: var(--danger); }

/* ── Tables ───────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(100,122,171,.15);
}

.data-table th {
  background: var(--surface-low);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: none;         /* DM Sans lowercase column headers */
  letter-spacing: .01em;
  border-bottom: 1.5px solid var(--surface-mid);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--surface-low);
  font-size: 13.5px;
  vertical-align: middle;
  letter-spacing: -0.01em;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover {
  background: var(--surface-low);
}

.data-table tfoot td {
  background: var(--surface-low);
  border-top: 2px solid rgba(100,122,171,.2);
  font-weight: 800;
}

.text-right { text-align: right; }

.empty-cell {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
  font-size: 13px;
}

.actions { white-space: nowrap; display: flex; gap: 4px; }

/* ── Bulk select (list tables) ──────────────────────────────────── */
.bulk-col { width: 1%; white-space: nowrap; text-align: center; }
.bulk-col input[type="checkbox"] { cursor: pointer; margin: 0; }

.bulk-action-bar {
  position: sticky;
  top: 8px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px 14px;
  background: var(--card-bg);
  border: 1px solid rgba(100,122,171,.25);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.bulk-action-bar[hidden] { display: none; }
.bulk-action-bar .bulk-count { font-weight: 800; font-size: 13px; margin-right: auto; }

.description-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Badges ───────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}

.badge-unmatched { background: #fef3c7; color: #92400e; }
.badge-warning   { background: var(--warning-bg); color: var(--warning); }
.badge-suggested { background: var(--primary-container); color: var(--primary-dim); }
.badge-posted    { background: #dcfce7; color: #15803d; }
.badge-draft     { background: #eff6ff; color: #1e40af; }
.badge-danger    { background: var(--danger-bg); color: var(--danger); }
.badge-asset     { background: var(--primary-container); color: var(--primary-dim); }
.badge-liability { background: #fef9c3; color: #713f12; }
.badge-equity    { background: #dcfce7; color: #15803d; }
.badge-income    { background: #dcfce7; color: #15803d; }
.badge-expense   { background: var(--danger-bg); color: var(--danger); }

/* Status & generic colour badges (referenced via badge-{{ status }} and direct classes) */
.badge-blue      { background: var(--primary-container); color: var(--primary-dim); }
.badge-orange    { background: var(--warning-bg); color: var(--warning); }
.badge-red       { background: var(--danger-bg); color: var(--danger); }
.badge-sent      { background: var(--primary-container); color: var(--primary-dim); }
.badge-paid      { background: #dcfce7; color: #15803d; }
.badge-booked    { background: #dcfce7; color: #15803d; }
.badge-overdue   { background: var(--danger-bg); color: var(--danger); }
.badge-cancelled { background: var(--surface-mid); color: var(--text-muted); }
.badge-received  { background: var(--surface-low); color: var(--text-muted); }
.badge-open      { background: var(--surface-low); color: var(--text-muted); }
.badge-partial   { background: var(--warning-bg); color: var(--warning); }

/* ── Utility ──────────────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.badge-success { background: #dcfce7; color: #15803d; }

/* Inline-style replacements (see QUALITY_REPORT round 2) */
.d-inline { display: inline; }
.nowrap { white-space: nowrap; }
/* Material Symbols sizing helpers — vertical-align is already on the base class */
.icon-sm { font-size: 16px; }
.icon-md { font-size: 18px; }
.icon-lg { font-size: 20px; }

/* ── Relation autocomplete ────────────────────────────────────────── */
.rel-suggestion {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid rgba(100,122,171,.1);
}
.rel-suggestion:last-child { border-bottom: none; }
.rel-suggestion:hover,
.rel-suggestion--active {
  background: var(--primary-container);
  color: var(--primary);
}
.rel-suggestion--active .rel-sub { color: var(--primary); opacity: .75; }
.rel-suggestion .rel-sub { font-size: 11px; color: var(--text-muted); }

/* ── Sessions (user management) ──────────────────────────────────── */
.sessions-details { display: inline-block; }
.sessions-summary { cursor: pointer; list-style: none; }
.sessions-summary::-webkit-details-marker { display: none; }
.sessions-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 340px;
}
.sessions-revoke-all {
  padding: 4px 0 2px;
  border-bottom: 1px solid var(--surface-mid);
  margin-bottom: 2px;
}
.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--surface-mid);
  border-radius: var(--radius);
  font-size: 12px;
}
.session-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

/* ── Amounts ──────────────────────────────────────────────────────── */
.amount-positive { color: var(--success); font-weight: 600; }
.amount-negative { color: var(--danger); font-weight: 600; }
.muted { color: var(--text-muted); }

/* ── Auth pages ───────────────────────────────────────────────────── */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg);
}

.auth-card {
  background: var(--card-bg);
  border: 1px solid rgba(100,122,171,.2);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
}

.auth-title {
  font-family: var(--font-headline);
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 28px;
  text-align: center;
  color: var(--text);
  letter-spacing: -.3px;
}

.auth-footer {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Company cards ────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.company-card {
  background: var(--card-bg);
  border: 1px solid rgba(100,122,171,.15);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}

.company-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.company-card-name {
  font-family: var(--font-headline);
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 8px;
}

.company-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.company-card-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* ── Dashboard stats ──────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid rgba(100,122,171,.15);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow .2s;
}

.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-value {
  font-family: var(--font-headline);
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.5px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-value.stat-warning { color: var(--warning); }
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--outline); }

.stat-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.action-card {
  background: var(--card-bg);
  border: 1px solid rgba(100,122,171,.15);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .15s, border-color .15s;
}

.action-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--outline-variant);
  opacity: 1;
}

.action-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 10px;
  color: var(--primary);
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 28;
}

.action-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }

/* ── Detail list ──────────────────────────────────────────────────── */
.detail-list { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 13px; }
.detail-list dt { font-weight: 600; color: var(--text-muted); }

/* ── Filter bar ───────────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }

.filter-bar select,
.filter-bar input[type="search"],
.filter-bar input[type="text"],
.filter-select {
  box-sizing: border-box;
  height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--surface-mid);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.4;
  font-family: var(--font-body);
  background: var(--card-bg);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}

.filter-bar select,
.filter-select { cursor: pointer; }

.filter-bar input[type="search"],
.filter-bar input[type="text"] { min-width: 200px; }

.filter-bar select:focus,
.filter-bar input[type="search"]:focus,
.filter-bar input[type="text"]:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,56,202,.30);
}

/* Reset-knop sluit qua hoogte aan op de filtervelden */
.filter-bar .filter-reset { height: 34px; display: inline-flex; align-items: center; gap: 4px; }

.search-input {
  padding: 7px 12px;
  border: 1px solid rgba(100,122,171,.3);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font-body);
  background: var(--card-bg);
  color: var(--text);
  min-width: 200px;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,56,202,.30);
}

/* ── Quick-filter chips ───────────────────────────────────────────── */
.quick-filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.quick-filters .qf-label {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em; margin-right: 1px;
}
.quick-filters .qf-sep { width: 1px; align-self: stretch; background: var(--surface-mid); margin: 2px 6px; }

/* ── Year stepper ─────────────────────────────────────────────────── */
.year-stepper { display: inline-flex; align-items: stretch; vertical-align: middle; }
.year-stepper .step-btn {
  width: 30px; border: 1px solid var(--surface-mid); background: var(--card-bg);
  color: var(--text); cursor: pointer; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.year-stepper .step-btn:first-child { border-radius: var(--radius) 0 0 var(--radius); border-right: none; }
.year-stepper .step-btn:last-child  { border-radius: 0 var(--radius) var(--radius) 0; border-left: none; }
.year-stepper .step-btn:hover { background: var(--surface-mid); }
.year-stepper .year-input {
  width: 62px; text-align: center; border: 1px solid var(--surface-mid);
  background: var(--card-bg); color: var(--text); font-size: 13px;
  font-family: var(--font-body); padding: 7px 4px; border-radius: 0;
  -moz-appearance: textfield; appearance: textfield;
}
.year-stepper .year-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,56,202,.30); position: relative; z-index: 1;
}
.year-stepper .year-input::-webkit-outer-spin-button,
.year-stepper .year-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ── Journal form ─────────────────────────────────────────────────── */
.balance-indicator {
  margin: 8px 0 12px;
  padding: 9px 14px;
  background: var(--surface-low);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
}

.diff-ok    { color: var(--success); }
.diff-error { color: var(--danger); }
.section-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--outline); margin: 18px 0 10px; }
.account-select, .btw-select { width: 100%; }
.amount-input { width: 100px; text-align: right; }
.line-desc { width: 180px; }

/* ── Suggestion box ───────────────────────────────────────────────── */
.suggestion-box {
  background: var(--primary-container);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--primary-dim);
  font-weight: 500;
}

/* ── Reports ──────────────────────────────────────────────────────── */
.report-table { margin-bottom: 0; }

.report-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.report-col h2 { font-family: var(--font-headline); font-size: 16px; font-weight: 800; margin-bottom: 14px; }
.report-col h3 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--outline); margin: 14px 0 8px; }

.report-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(100,122,171,.08);
  font-size: 13px;
}

.report-subtotal {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-weight: 800;
  border-top: 2px solid rgba(100,122,171,.2);
  margin-top: 4px;
  font-size: 13px;
}

.report-total {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-weight: 800;
  font-family: var(--font-headline);
  border-top: 3px double rgba(100,122,171,.3);
  margin-top: 4px;
  font-size: 14px;
}

.report-period { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }

.report-section {
  background: var(--card-bg);
  border: 1px solid rgba(100,122,171,.15);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.report-section h2 { font-family: var(--font-headline); font-size: 15px; font-weight: 800; margin-bottom: 14px; }
.btw-section { margin-bottom: 22px; }
.btw-section h2 { font-family: var(--font-headline); font-size: 15px; font-weight: 800; margin-bottom: 10px; }

.btw-summary {
  background: var(--card-bg);
  border: 1px solid rgba(100,122,171,.15);
  border-radius: var(--radius-lg);
  padding: 18px;
  max-width: 420px;
}

/* ── Invoice layout ───────────────────────────────────────────────── */
.invoice-layout { display: grid; grid-template-columns: 1fr 380px; gap: 22px; align-items: start; }
.invoice-preview { background: var(--card-bg); border: 1px solid rgba(100,122,171,.15); border-radius: var(--radius-lg); padding: 8px; }
.invoice-meta .card { margin-bottom: 0; }


/* ── File drop zone ───────────────────────────────────────────────── */
.file-drop-zone {
  border: 2px dashed rgba(100,122,171,.3);
  border-radius: var(--radius-lg);
  padding: 36px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color .15s, background .15s;
}

.file-drop-zone:hover,
.file-drop-zone.drop-zone--active {
  border-color: var(--primary);
  background: var(--surface-low);
}

.file-drop-zone.drop-zone--active {
  border-color: #3b82f6;
  background: #eff6ff;
}

.file-drop-zone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-hint { color: var(--text-muted); font-size: 13px; }

/* ── Alerts ───────────────────────────────────────────────────────── */
.alert { padding: 11px 16px; border-radius: var(--radius); font-size: 13px; margin-top: 12px; }
.alert-error { background: var(--danger-bg); border: 1px solid #fecaca; color: var(--danger); }
.alert-warning { background: var(--warning-bg); border: 1px solid #fcd34d; color: var(--warning); }
.alert-success { background: var(--success-bg); border: 1px solid #a7e0c0; color: var(--success); }
.alert-info { background: #eef4fb; border: 1px solid #bcd4ee; color: #1c4f8a; }

/* Prominent reminder when an intake document looks addressed to another company. */
.intake-addressee-warning {
  display: flex; align-items: flex-start; gap: 10px;
  /* Extra ruimte onder de banner (18px > de 16px veld-ritmiek) zodat de melding
     duidelijk losstaat van het formulier eronder i.p.v. tegen het eerste veld te plakken. */
  margin: 12px 0 18px; padding: 13px 16px;
  background: #fff4d6; border: 1px solid #f0c14b; border-left: 4px solid #e0a800;
  border-radius: var(--radius); color: #7a5200; font-size: 13px; line-height: 1.45;
}
.intake-addressee-warning .material-symbols-outlined {
  color: #d99400; font-size: 21px; flex-shrink: 0; margin-top: 1px;
}

/* ── Empty state ──────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 56px 24px; color: var(--text-muted); }
.empty-state p { margin-bottom: 18px; }

/* ── Totals row ───────────────────────────────────────────────────── */
.totals-row td { font-weight: 800; background: var(--surface-low); }

/* ── Search page ──────────────────────────────────────────────────── */
.search-bar-large { display: flex; gap: 10px; margin-bottom: 22px; }

.search-input-large {
  flex: 1;
  padding: 11px 16px;
  font-size: 15px;
  border: 1px solid rgba(100,122,171,.3);
  border-radius: var(--radius);
  font-family: var(--font-body);
  background: var(--card-bg);
  color: var(--text);
}

.search-input-large:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,56,202,.30);
}

.search-summary { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }

/* ── Code ─────────────────────────────────────────────────────────── */
code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: var(--surface-mid);
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 12px;
  color: var(--text);
}

/* ── Narrow viewport: stack two-column layouts ────────────────────── */
@media (max-width: 720px) {
  .report-columns { grid-template-columns: 1fr; gap: 16px; }
  .invoice-layout { grid-template-columns: 1fr; }
}

/* ── Print ────────────────────────────────────────────────────────── */
@media print {
  .topbar, .sidebar, .no-print { display: none !important; }
  .main-content { margin: 0; padding: 0; max-width: 100%; }
  .data-table { font-size: 11px; }
  .report-columns { grid-template-columns: 1fr 1fr; }
  body { background: white; }
}

/* ── Confirm modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(25, 49, 93, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}
.modal-box {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px 32px;
  min-width: 320px;
  max-width: 480px;
}
.modal-message {
  font-size: 15px;
  color: var(--text);
  margin: 0 0 20px;
  line-height: 1.5;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Upload split layout (preview + form side-by-side) ────────────── */
.upload-split-layout {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}
.upload-split-layout > * {
  min-width: 0; /* prevent grid items from overflowing their fr column */
}
.upload-preview-pane {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  background: var(--card-bg);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.file-preview-embed {
  width: 100%;
  height: 75vh;
  min-height: 400px;
  display: block;
  border: none;
}
.file-preview-img {
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
  display: block;
}
.file-preview-unavailable {
  text-align: center;
  padding: 48px 24px;
}
@media (max-width: 900px) {
  .upload-split-layout {
    grid-template-columns: 1fr;
  }
  .upload-preview-pane {
    position: static;
    min-height: 280px;
  }
  .file-preview-embed { height: 50vh; min-height: 280px; }
}

/* ── Micro-interactions & motion ──────────────────────────────────── */

/* Page content fades up on load */
@keyframes sl-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.main-content {
  /* 'backwards' i.p.v. 'both': een blijvende transform zou .main-content het
     containing block maken voor position:fixed-afstammelingen (modals), die dan
     midden in de paginahoogte i.p.v. de viewport verschijnen. */
  animation: sl-fade-up .22s ease backwards;
}

/* Flash messages slide down */
@keyframes sl-slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.flash {
  animation: sl-slide-down .2s ease both;
}

/* Stat cards lift on hover */
.stat-card {
  transition: box-shadow .2s ease, transform .2s ease;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Cards subtle lift */
.card {
  transition: box-shadow .2s ease;
}

/* Table rows smooth highlight */
.data-table tbody tr {
  transition: background .12s ease;
}

/* Company cards — already have transform; smooth the shadow too */
.company-card {
  transition: box-shadow .2s ease, transform .2s ease;
}

/* Action cards on dashboard */
.action-card {
  transition: box-shadow .2s ease, transform .18s ease, border-color .15s ease;
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .main-content { animation: none; }
  .flash        { animation: none; }
  .nav-link, .stat-card, .company-card, .action-card,
  .btn, .card   { transition: none; }
}

/* ── Playful brand & nav accents ──────────────────────────────────── */

/* 1. Brand name: slow gradient shimmer (indigo → violet → back) */
@keyframes sl-brand-shimmer {
  0%   { background-position: 0% center; }
  100% { background-position: -200% center; }
}

.brand-name {
  background: linear-gradient(
    90deg,
    var(--text) 0%,
    var(--primary) 35%,
    #1d4ed8 55%,
    var(--text) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: sl-brand-shimmer 5s linear infinite;
}

/* 2. Brand logo: spring-bounce on hover */
.brand-logo {
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
  cursor: pointer;
}
.brand-logo:hover {
  transform: rotate(14deg) scale(1.15);
}

/* 3. Nav section labels: small indigo dash that slides in */
@keyframes sl-dash-in {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: .55; }
}

.nav-section {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-section::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: var(--primary);
  flex-shrink: 0;
  transform-origin: left center;
  animation: sl-dash-in .3s cubic-bezier(.34, 1.56, .64, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .brand-name  { animation: none; }
  .brand-logo  { transition: none; }
  .nav-section::before { animation: none; }
}

/* ── Landing page (login + marketing) ──────────────────────────────── */
.main-content.full-width:has(.landing-wrap) {
  padding: 0;
  margin-top: 0;
  min-height: 100vh;
}

.landing-wrap {
  display: flex;
  min-height: 100vh;
}

/* Left branded panel */
.landing-left {
  flex: 1;
  background: linear-gradient(145deg, #172554 0%, #1e3a8a 30%, #1d4ed8 70%, #2563eb 100%);
  padding: 52px 56px 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  color: white;
  overflow: hidden;
  position: relative;
  min-width: 0;
}

/* Subtle radial glow */
.landing-left::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -80px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59,130,246,.35) 0%, transparent 70%);
  pointer-events: none;
}

/* Brand row */
.landing-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.landing-logo-img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  box-shadow: 0 0 0 2px rgba(255,255,255,.2), 0 2px 12px rgba(0,0,0,.3);
}

.landing-brand-text {
  font-family: var(--font-headline);
  font-size: 19px;
  font-weight: 800;
  color: white;
  letter-spacing: -.3px;
}

.landing-beta {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.28);
  color: rgba(255,255,255,.9);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .7px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

/* Hero */
.landing-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.landing-headline {
  font-family: var(--font-headline);
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.6px;
  color: white;
}

.landing-tagline {
  font-size: 14.5px;
  line-height: 1.7;
  color: rgba(255,255,255,.72);
  max-width: 440px;
}

/* Features */
.landing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.landing-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: rgba(255,255,255,.88);
}

.landing-features .material-symbols-outlined {
  font-size: 16px;
  color: rgba(255,255,255,.65);
  background: rgba(255,255,255,.1);
  border-radius: 6px;
  padding: 5px;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mockup screenshot */
.landing-mockup {
  margin-top: auto;
  position: relative;
  padding-top: 16px;
}

.mock-screen {
  background: #f1f5f9;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  box-shadow:
    0 -8px 48px rgba(0,0,0,.4),
    0 0 0 1px rgba(255,255,255,.12),
    inset 0 1px 0 rgba(255,255,255,.15);
  transform: perspective(1400px) rotateX(3deg) translateY(4px);
  transform-origin: bottom center;
}

/* Mock topbar */
.mock-topbar {
  background: white;
  height: 28px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}

.mock-tb-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mock-tb-logo {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: #3b82f6;
}

.mock-tb-name {
  width: 60px;
  height: 6px;
  border-radius: 2px;
  background: #cbd5e1;
}

.mock-tb-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mock-tb-search {
  width: 80px;
  height: 16px;
  border-radius: 4px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.mock-tb-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #bfdbfe;
}

/* Mock body */
.mock-body {
  display: flex;
  height: 200px;
}

/* Mock sidebar */
.mock-sidebar {
  width: 88px;
  background: white;
  border-right: 1px solid #e2e8f0;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

.mock-nav-section {
  height: 4px;
  border-radius: 2px;
  background: #e2e8f0;
  width: 50%;
  margin: 4px 0 2px;
}

.mock-nav {
  height: 8px;
  border-radius: 3px;
  background: #f1f5f9;
  width: 90%;
}

.mock-nav.active {
  background: #bfdbfe;
  width: 95%;
}

/* Mock main content */
.mock-main {
  flex: 1;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.mock-page-title {
  height: 10px;
  width: 30%;
  background: #1e293b;
  border-radius: 3px;
  opacity: .5;
}

/* Stat cards */
.mock-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.mock-stat {
  background: white;
  border-radius: 5px;
  padding: 6px 7px;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mock-stat-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #dbeafe;
  flex-shrink: 0;
}

.mock-stat-icon.success { background: #dcfce7; }
.mock-stat-icon.warning { background: #fef3c7; }

.mock-stat-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.mock-stat-label {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  width: 70%;
}

.mock-stat-value {
  height: 7px;
  background: #cbd5e1;
  border-radius: 2px;
  width: 55%;
}

.mock-stat-value.accent {
  background: #93c5fd;
}

/* Data table */
.mock-table {
  background: white;
  border-radius: 5px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  flex: 1;
}

.mock-row {
  height: 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 8px;
}

.mock-row.header {
  background: #f8fafc;
  height: 22px;
}

.mock-row.alt {
  background: #fafafa;
}

.mock-cell {
  height: 5px;
  border-radius: 2px;
  background: #e2e8f0;
  flex-shrink: 0;
}

.mock-row.header .mock-cell { background: #cbd5e1; }

.mock-cell.w40 { flex: 1; }
.mock-cell.w20 { width: 18%; }
.mock-cell.w15 { width: 12%; }
.mock-cell.green { background: #86efac; }
.mock-cell.orange { background: #fcd34d; }

/* ── Right panel: login form ──────────────────────────────────────── */
.landing-right {
  width: 420px;
  flex-shrink: 0;
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  border-left: 1px solid var(--surface-mid);
}

.landing-form-wrap {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.landing-form-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.landing-form-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.landing-form-title {
  font-family: var(--font-headline);
  font-size: 21px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.3px;
  line-height: 1.2;
}

.landing-form-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.landing-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.landing-form-footer {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: -8px;
}

.landing-beta-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12.5px;
  color: #1e40af;
  line-height: 1.5;
}

.landing-beta-notice .material-symbols-outlined {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
  color: #3b82f6;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .landing-left {
    padding: 36px 32px 0;
    gap: 20px;
  }
  .landing-headline {
    font-size: 34px;
  }
  .landing-mockup {
    display: none;
  }
  .landing-right {
    width: 380px;
    padding: 40px 32px;
  }
}

@media (max-width: 720px) {
  .landing-wrap {
    flex-direction: column;
  }
  .landing-left {
    padding: 32px 24px 32px;
  }
  .landing-headline {
    font-size: 30px;
  }
  .landing-right {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--surface-mid);
    padding: 36px 24px;
    align-items: flex-start;
  }
  .landing-form-wrap {
    max-width: 100%;
  }
}

/* ── Landing: mogelijkheden & prijzen ───────────────────────────────── */
html:has(.landing-pricing) { scroll-behavior: smooth; }

.landing-scroll-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-top: 2px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 20px;
  transition: background .15s ease, color .15s ease;
  position: relative;
}
.landing-scroll-link:hover { background: rgba(255,255,255,.12); color: #fff; }
.landing-scroll-link .material-symbols-outlined { font-size: 15px; }

.landing-pricing {
  background: var(--card-bg);
  border-top: 1px solid var(--surface-mid);
  padding: 64px 32px 72px;
}

.landing-pricing-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.landing-pricing-head {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}
.landing-pricing-head h2 {
  font-family: var(--font-headline);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.4px;
  color: var(--text);
  margin-bottom: 10px;
}
.landing-pricing-head p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
}

/* Capabilities grid */
.landing-caps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.landing-cap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--surface-mid);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.landing-cap > .material-symbols-outlined {
  font-size: 18px;
  color: var(--primary);
  background: var(--primary-subtle);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.landing-cap-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.landing-cap-sub { font-size: 12.5px; line-height: 1.55; color: var(--text-muted); }

/* Plan cards */
.landing-plans {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: stretch;
}
.landing-plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--surface-mid);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow);
}
.landing-plan--featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-md);
}
.landing-plan-tag {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 20px;
  white-space: nowrap;
}
.landing-plan-name { font-size: 15px; font-weight: 700; color: var(--text); }
.landing-plan-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
  min-height: 38px;
}
.landing-plan-price {
  font-family: var(--font-headline);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--text);
}
.landing-plan-per {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 3px;
  letter-spacing: 0;
}
.landing-plan-feats {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.landing-plan-feats li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}
.landing-plan-feats .material-symbols-outlined {
  font-size: 16px;
  color: var(--success);
  flex-shrink: 0;
  margin-top: 1px;
}
.landing-plan .btn { margin-top: auto; }

.landing-pricing-foot {
  text-align: center;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
}

@media (max-width: 960px) {
  .landing-caps, .landing-plans { grid-template-columns: repeat(2, 1fr); }
  .landing-pricing { padding: 48px 24px 56px; }
}

@media (max-width: 560px) {
  .landing-caps, .landing-plans { grid-template-columns: 1fr; }
  .landing-plan-desc { min-height: 0; }
}

/* ── Toggle switch ──────────────────────────────────────────────────── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--outline-variant);
  border-radius: 24px;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-switch input:disabled + .toggle-slider { opacity: .45; cursor: not-allowed; }
.toggle-switch input:focus-visible + .toggle-slider { outline: 2.5px solid var(--primary); outline-offset: 2px; }

/* ══════════════════════════════════════════════════════════════════════
   DESIGN SYSTEM V2 — added by UX overhaul
   ══════════════════════════════════════════════════════════════════════ */

/* ── Dark mode tokens ──────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:                 #111113;
  --surface:            #111113;
  --surface-low:        #1c1c1f;
  --surface-mid:        #28282c;
  --surface-high:       #3a3a3f;
  --surface-highest:    #4a4a52;
  --card-bg:            #1c1c1f;
  --text:               #f0f0f0;
  --text-muted:         #9a9a9a;
  --outline:            #6a6a72;
  --outline-variant:    #3b82f6;   /* was #3d3a6e — invisible as focus ring on dark surface */
  --primary-dim:        #93c5fd;   /* align badge/flash accent with sidebar-active-txt in dark */
  --sidebar-bg:         #151518;
  --sidebar-border:     #242428;
  --sidebar-hover-bg:   #242428;
  --sidebar-active-bg:  rgba(37,99,235,.2);
  --sidebar-active-txt: #93c5fd;
  --primary-container:  rgba(37,99,235,.2);
  --on-primary:         #ffffff;
  --danger-bg:          rgba(192,57,43,.15);
  --success-bg:         rgba(26,116,64,.15);
  --warning-bg:         rgba(146,64,14,.15);
  --shadow:             0 1px 4px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.04);
  --shadow-md:          0 4px 28px rgba(0,0,0,.55);
  --shadow-lg:          0 16px 48px rgba(0,0,0,.65);
}

/* Badges with hardcoded light-mode pastels need dark equivalents (they won't flip via tokens) */
[data-theme="dark"] .badge-posted,
[data-theme="dark"] .badge-paid,
[data-theme="dark"] .badge-booked,
[data-theme="dark"] .badge-equity,
[data-theme="dark"] .badge-income,
[data-theme="dark"] .badge-success { background: rgba(26,116,64,.22); color: #86efac; }
[data-theme="dark"] .badge-draft    { background: rgba(29,78,216,.22); color: #93c5fd; }
[data-theme="dark"] .badge-liability { background: rgba(146,64,14,.22); color: #fcd34d; }
[data-theme="dark"] .badge-unmatched { background: rgba(146,64,14,.22); color: #fcd34d; }

[data-theme="dark"] .topbar {
  background: rgba(13,15,24,.92);
  border-bottom-color: var(--surface-mid);
}
[data-theme="dark"] .data-table {
  color: var(--text);
}
[data-theme="dark"] .data-table th {
  background: var(--surface-mid);
}
[data-theme="dark"] .data-table tbody tr:hover {
  background: var(--surface-low);
}

/* ── Sidebar collapse ──────────────────────────────────────────────── */

.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--surface-mid);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.sidebar-toggle-btn:hover {
  background: var(--surface-low);
  color: var(--text);
}

/* Taken-drawer open: schuif in beeld met een zwevende schaduw */
body.taken-open .sidebar {
  transform: none;
  box-shadow: var(--shadow-lg);
}

/* Scrim onder beide drawers (taken links, volledig menu rechts) */
.drawer-scrim {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  top: var(--topbar-h);
  z-index: 41;
  background: rgba(17, 24, 39, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
body.taken-open .drawer-scrim,
body.menu-open .drawer-scrim {
  opacity: 1;
  pointer-events: auto;
}

/* ── Dark mode toggle button ───────────────────────────────────────── */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.theme-toggle-btn:hover {
  background: var(--surface-mid);
  color: var(--text);
}
.theme-toggle-btn .icon-sun   { display: none; }
.theme-toggle-btn .icon-moon  { display: block; }
[data-theme="dark"] .theme-toggle-btn .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle-btn .icon-moon { display: none; }

/* ── Command palette ───────────────────────────────────────────────── */
.cmd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s;
}
.cmd-overlay.cmd-open {
  opacity: 1;
  pointer-events: all;
}

.cmd-box {
  width: 100%;
  max-width: 580px;
  background: var(--card-bg);
  border: 1px solid var(--surface-mid);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,.4);
  overflow: hidden;
  transform: translateY(-12px) scale(.97);
  transition: transform .18s cubic-bezier(.34,1.56,.64,1);
}
.cmd-overlay.cmd-open .cmd-box {
  transform: none;
}

.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--surface-mid);
}

.cmd-search-icon {
  color: var(--text-muted);
  font-size: 20px;
  flex-shrink: 0;
}

.cmd-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 16px;
  font-family: var(--font-body);
  color: var(--text);
  outline: none;
}
.cmd-input::placeholder { color: var(--outline); }

.cmd-kbd {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--surface-mid);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--font-body);
  flex-shrink: 0;
}

.cmd-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
}

.cmd-group-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--outline);
  padding: 8px 10px 4px;
}

.cmd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: background .1s;
}
.cmd-item:hover,
.cmd-item.cmd-active {
  background: var(--primary-container);
  color: var(--primary);
  opacity: 1;
}
.cmd-item-icon {
  font-size: 18px;
  color: var(--text-muted);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
}
.cmd-item:hover .cmd-item-icon,
.cmd-item.cmd-active .cmd-item-icon { color: var(--primary); }

.cmd-item-label { font-size: 14px; font-weight: 500; flex: 1; }
.cmd-item-section { font-size: 11px; color: var(--text-muted); }

.cmd-empty {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 13px;
}

.cmd-footer {
  display: flex;
  gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid var(--surface-mid);
  font-size: 11px;
  color: var(--outline);
}
.cmd-footer span { display: flex; align-items: center; gap: 4px; }

/* ── Toast notifications ───────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 8000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  max-width: 340px;
  min-width: 220px;
  box-shadow: 0 4px 24px rgba(0,0,0,.18);
  pointer-events: all;
  animation: toast-in .22s cubic-bezier(.34,1.56,.64,1) both;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(32px) scale(.9); }
  to   { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(32px) scale(.9); }
}

.toast-success {
  background: var(--success-bg);
  border-color: #a7f3c0;
  color: var(--success);
}
.toast-error {
  background: var(--danger-bg);
  border-color: #fecaca;
  color: var(--danger);
}
.toast-info {
  background: var(--primary-container);
  border-color: var(--outline-variant);
  color: var(--primary-dim);
}
.toast-warning {
  background: var(--warning-bg);
  border-color: #fde68a;
  color: var(--warning);
}

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

.toast-msg { flex: 1; line-height: 1.4; }

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: .6;
  padding: 2px;
  display: flex;
  font-family: 'Material Symbols Outlined';
  font-size: 16px;
  flex-shrink: 0;
  transition: opacity .15s;
}
.toast-close:hover { opacity: 1; }

/* Progress bar */
.toast::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  background: currentColor;
  opacity: .25;
  border-radius: 0 0 10px 10px;
  animation: toast-progress linear both;
}
.toast-success::after { animation-duration: 5s; }
.toast-error::after   { animation-duration: 8s; }
.toast-info::after    { animation-duration: 5s; }
.toast-warning::after { animation-duration: 6s; }

@keyframes toast-progress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ── Sticky table header ───────────────────────────────────────────── */
/* Opmerking: .data-table heeft overflow:hidden wat het tot een sticky-container
   maakt. top:var(--topbar-h) zou de header dan 58px naar beneden verschuiven
   binnen de tabel en over de eerste rij laten zweven. Daarom sticky verwijderd;
   de header staat sowieso bovenaan de tabel op zijn natuurlijke positie. */
.data-table thead th {
  /* position: sticky; top: var(--topbar-h); z-index: 10; — zie opmerking */
}

/* ── Row actions — show on hover ───────────────────────────────────── */
.data-table tbody tr .row-actions {
  opacity: 0;
  transition: opacity .15s;
}
.data-table tbody tr:hover .row-actions {
  opacity: 1;
}

/* ── Sortable column headers ────────────────────────────────────────── */
.data-table th.th-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  padding-right: 26px;   /* ruimte voor het pijltje */
  position: relative;
  transition: color .12s, background .12s;
}
.data-table th.th-sortable:hover {
  color: var(--text-main);
  background: var(--surface-mid);
}
.data-table th.th-sortable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
/* actieve sorteerkolom: kleur accent */
.data-table th.th-sort-asc,
.data-table th.th-sort-desc {
  color: var(--accent);
}
/* pijl-indicator */
.th-sort-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  line-height: 1;
  opacity: .45;
  transition: opacity .12s;
}
.data-table th.th-sort-asc  .th-sort-icon,
.data-table th.th-sort-desc .th-sort-icon {
  opacity: 1;
}
/* dark mode */
[data-theme="dark"] .data-table th.th-sortable:hover {
  background: rgba(255,255,255,.08);
}

/* ── Keyboard shortcut hints ───────────────────────────────────────── */
.kb-hint {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--outline);
  margin-left: 8px;
}
.kb-hint kbd {
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-body);
  background: var(--surface-mid);
  border: 1px solid var(--surface-high);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--text-muted);
}

/* ── Improved empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 72px 24px;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 48px;
  display: block;
  margin: 0 auto 16px;
  color: var(--surface-high);
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'FILL' 0, 'wght' 200, 'GRAD' 0, 'opsz' 48;
}
.empty-state h3 {
  font-family: var(--font-headline);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.empty-state p {
  font-size: 13px;
  max-width: 340px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

/* ── Reduced motion respect ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .cmd-overlay, .cmd-box, .toast { transition: none; animation: none; }
  .sidebar, .main-content, .topbar-left { transition: none; }
}

/* ══════════════════════════════════════════════════════════════════════
   UNIFIED CHAT DRAWER
   — Replaces both the wizard button link and the dashboard chatbox.
   — Slides in from the right. Works on every page.
   ══════════════════════════════════════════════════════════════════════ */

/* Topbar AI button — prominent pill with gradient */
.ai-drawer-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--on-primary);
  background: linear-gradient(130deg, var(--primary) 0%, #1d4ed8 100%);
  border: none;
  cursor: pointer;
  letter-spacing: .01em;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
  transition: box-shadow .15s, transform .12s;
}
.ai-drawer-trigger:hover {
  box-shadow: 0 4px 16px rgba(37,99,235,.45);
  transform: translateY(-1px);
}
.ai-drawer-trigger:active { transform: translateY(0); }
.ai-drawer-trigger .material-symbols-outlined { font-size: 16px; }

/* Drawer overlay (closes on click) */
.chat-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.18);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s;
}
.chat-drawer-open .chat-drawer-overlay {
  opacity: 1;
  pointer-events: all;
}

/* Drawer panel */
.chat-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  z-index: 501;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border-left: 1.5px solid var(--surface-mid);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform .26s cubic-bezier(.4,0,.2,1);
}
.chat-drawer-open .chat-drawer {
  transform: translateX(0);
}

/* Drawer header */
.chat-drawer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1.5px solid var(--surface-mid);
  flex-shrink: 0;
  background: linear-gradient(to bottom, var(--primary-container), transparent);
}
.chat-drawer-header-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--on-primary);
}
.chat-drawer-header-icon .material-symbols-outlined { font-size: 20px; }
.chat-drawer-title {
  font-family: var(--font-headline);
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.chat-drawer-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}
.chat-drawer-close {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .12s, color .12s;
}
.chat-drawer-close:hover { background: var(--surface-low); color: var(--text); }
.chat-drawer-close .material-symbols-outlined { font-size: 20px; }

/* Quick actions inside drawer */
.chat-drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--surface-low);
  flex-shrink: 0;
}
.chat-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-low);
  border: 1px solid var(--surface-mid);
  color: var(--text-muted);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.chat-action-chip:hover {
  background: var(--primary-container);
  border-color: var(--outline-variant);
  color: var(--primary);
}
.chat-action-chip .material-symbols-outlined { font-size: 13px; }

/* Chat log */
.chat-drawer-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-high) transparent;
}
.chat-drawer-log::-webkit-scrollbar { width: 4px; }
.chat-drawer-log::-webkit-scrollbar-thumb { background: var(--surface-high); border-radius: 2px; }

/* Message rows */
.dc-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: dc-msg-in .2s ease-out both;
}
@keyframes dc-msg-in {
  from { opacity:0; transform: translateY(5px); }
  to   { opacity:1; transform: none; }
}
.dc-msg-user { flex-direction: row-reverse; }

.dc-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.dc-avatar-ai {
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  color: var(--on-primary);
}
.dc-avatar-user {
  background: var(--surface-mid);
  color: var(--text-muted);
}
.dc-avatar .material-symbols-outlined { font-size: 15px; }

.dc-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}
.dc-bubble-ai {
  background: var(--card-bg);
  border: 1.5px solid var(--surface-mid);
  color: var(--text);
}
.dc-bubble-user {
  background: var(--primary);
  color: var(--on-primary);
  border: none;
}

/* Typing indicator */
.dc-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 4px 2px;
}
.dc-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--outline);
  opacity: .4;
  animation: dc-dot 1.2s infinite;
}
.dc-typing span:nth-child(2) { animation-delay: .18s; }
.dc-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes dc-dot {
  0%,60%,100% { opacity:.25; transform:translateY(0); }
  30% { opacity:1; transform:translateY(-2px); }
}

/* Input bar */
.chat-drawer-input-bar {
  padding: 10px 14px 14px;
  border-top: 1.5px solid var(--surface-mid);
  flex-shrink: 0;
  background: var(--card-bg);
}
.chat-drawer-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-low);
  border: 1.5px solid var(--surface-mid);
  border-radius: 24px;
  padding: 6px 6px 6px 14px;
  transition: border-color .12s, box-shadow .12s;
}
.chat-drawer-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  background: var(--card-bg);
}
.chat-drawer-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13.5px;
  font-family: var(--font-body);
  color: var(--text);
  outline: none;
  min-width: 0;
}
.chat-drawer-input::placeholder { color: var(--outline); }
.chat-drawer-send {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: var(--on-primary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .12s, transform .1s, box-shadow .12s;
}
.chat-drawer-send:hover:not(:disabled) {
  background: var(--primary-dim);
  box-shadow: 0 2px 8px rgba(37,99,235,.35);
  transform: scale(1.05);
}
.chat-drawer-send:disabled {
  background: var(--surface-high);
  cursor: not-allowed;
  transform: none;
}
.chat-drawer-send .material-symbols-outlined { font-size: 17px; }

/* Wizard link inside drawer */
.chat-drawer-wizard-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--primary-container);
  color: var(--primary-dim);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background .12s;
}
.chat-drawer-wizard-link:hover { background: var(--outline-variant); color: var(--primary); opacity:1; }
.chat-drawer-wizard-link .material-symbols-outlined { font-size: 15px; }

/* Dark mode for drawer */
[data-theme="dark"] .chat-drawer {
  background: var(--card-bg);
  border-left-color: var(--surface-mid);
}
[data-theme="dark"] .chat-drawer-header {
  background: linear-gradient(to bottom, rgba(37,99,235,.15), transparent);
}
[data-theme="dark"] .dc-bubble-ai {
  background: var(--surface-low);
  border-color: var(--surface-mid);
}
[data-theme="dark"] .chat-drawer-input-wrap {
  background: var(--surface-low);
}

@media (max-width: 500px) {
  .chat-drawer { width: 100vw; }
}

/* ════════════════════════════════════════════════════════════════════════
   Top menu bar (primary navigation) + workflow sidebar + workflow pages
   ════════════════════════════════════════════════════════════════════════ */

/* ── Menu (dropdown-bouwstenen; de menubalk zelf is vervangen door de
   app-menu-drawer achter het ☰-icoon, zie onderaan dit bestand) ────── */
.menu-group { position: relative; display: flex; }

.menu-dropdown {
  position: absolute;
  top: 100%; left: 0;
  min-width: 224px;
  padding: 6px;
  background: var(--card-bg);
  border: 1px solid var(--surface-mid);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .14s ease, transform .14s ease, visibility .14s;
  z-index: 50;
}
.menu-group:hover > .menu-dropdown,
.menu-group:focus-within > .menu-dropdown,
.menu-group.open > .menu-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.menu-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background .12s;
}
.menu-dropdown a:hover { background: var(--surface-low); }
.menu-dropdown a .material-symbols-outlined {
  font-size: 18px;
  width: 18px;
  color: var(--text-muted);
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
}
.menu-divider { height: 1px; background: var(--surface-mid); margin: 5px 8px; }

/* ── Gebruikersmenu (avatar rechtsboven) ─────────────────────────── */
.menu-dropdown-right { left: auto; right: 0; }
.topbar-usermenu .topbar-avatar {
  cursor: pointer;
  border: none;
  padding: 0;
}
.topbar-usermenu .topbar-avatar:hover,
.topbar-usermenu .topbar-avatar:focus-visible { filter: brightness(0.95); }
.topbar-usermenu > .menu-dropdown { top: calc(100% + 6px); }
.usermenu-head {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px 6px;
}
.usermenu-name { font-size: 13px; font-weight: 700; color: var(--text); }
.usermenu-email { font-size: 12px; color: var(--text-muted); word-break: break-all; }

/* ── Meekijkbalk (impersonatie) ──────────────────────────────────── */
/* Permanente balk, bewust los van .flash (die wordt door app.js een toast). */
.impersonation-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning);
  font-size: 13px;
  font-weight: 500;
}
.impersonation-banner-text {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Workflow sidebar ───────────────────────────────────────────────── */
.wf-sidebar { padding-top: 10px; }

.wf-side-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text);
}
.wf-side-head .material-symbols-outlined { font-size: 18px; color: var(--primary); }

.wf-side-section {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 18px 5px;
}

.wf-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--text);
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.wf-nav-item:hover { background: var(--surface-low); transform: translateX(2px); }

.wf-nav-ico {
  flex-shrink: 0;
  width: 30px; height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 19px;
  color: var(--wf-accent, var(--primary));
  background: color-mix(in srgb, var(--wf-accent, var(--primary)) 12%, transparent);
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}
.wf-nav-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.wf-nav-title {
  font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wf-nav-sub {
  font-size: 11px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wf-nav-badge {
  flex-shrink: 0;
  font-size: 11px; font-weight: 700;
  color: #fff;
  background: var(--wf-accent, var(--primary));
  border-radius: 10px;
  padding: 1px 7px;
}
.wf-nav-badge-soft {
  color: var(--wf-accent, var(--primary));
  background: color-mix(in srgb, var(--wf-accent, var(--primary)) 15%, transparent);
}
.wf-nav-item.active {
  background: color-mix(in srgb, var(--wf-accent, var(--primary)) 13%, transparent);
  border-color: color-mix(in srgb, var(--wf-accent, var(--primary)) 38%, transparent);
}

/* Onboarding standout — filled gradient card in brand-indigo */
.wf-nav-onboarding {
  margin: 4px 8px 6px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .28);
}
.wf-nav-onboarding:hover { transform: translateY(-1px); background: linear-gradient(135deg, #3b82f6, #2563eb); }
.wf-nav-onboarding .wf-nav-ico { background: rgba(255, 255, 255, .18); color: #fff; }
.wf-nav-onboarding .wf-nav-title { color: #fff; }
.wf-nav-onboarding .wf-nav-sub { color: rgba(255, 255, 255, .82); }
.wf-nav-onboarding .wf-nav-badge { background: rgba(255, 255, 255, .22); color: #fff; }
.wf-nav-onboarding.active { box-shadow: 0 0 0 2px rgba(96, 165, 250, .6), 0 4px 14px rgba(37, 99, 235, .3); }

/* Pinned launchers — set off from the cadence groups below */
.wf-pinned {
  padding-bottom: 8px;
  margin: 2px 0 4px;
  border-bottom: 1px solid var(--surface-mid);
}

/* ── Workflow / onboarding page ─────────────────────────────────────── */
.wf-page { max-width: 880px; }

.wf-head { display: flex; align-items: center; gap: 14px; }
.wf-head-icon {
  flex-shrink: 0;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  font-size: 26px;
  color: var(--wf-accent, var(--primary));
  background: color-mix(in srgb, var(--wf-accent, var(--primary)) 12%, transparent);
}
.wf-head-sub { margin: 3px 0 0; font-size: 13px; }

.wf-period {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}
.wf-period-icon { font-size: 20px; color: var(--text-muted); }
.wf-period-label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.wf-period-select { max-width: 220px; }

.wf-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.wf-progress-title { margin: 0 0 4px; }
.wf-progress-sub { margin: 0; font-size: 13px; }
.wf-progress-count { text-align: right; min-width: 120px; }
.wf-progress-num { font-size: 22px; font-weight: 700; color: var(--text); }
.wf-progress-label { font-size: 12px; }
.wf-progress-bar {
  margin-top: 14px;
  height: 8px;
  border-radius: 4px;
  background: var(--surface-high);
  overflow: hidden;
}
.wf-progress-fill { height: 100%; border-radius: 4px; background: #4ade80; transition: width .35s ease; }

.wf-step { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.wf-step-num {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  background: var(--surface-high);
  color: var(--text-muted);
}
.wf-step-num .material-symbols-outlined { font-size: 20px; }
.wf-step--done .wf-step-num { background: #4ade80; color: #06281a; }
.wf-step--todo .wf-step-num { background: var(--wf-accent, var(--primary)); color: #fff; }
.wf-step--locked { opacity: .55; }

.wf-step-body { flex: 1 1 auto; min-width: 0; }
.wf-step-title { margin: 0 0 4px; font-size: 15px; }
.wf-step-desc { margin: 0; font-size: 13px; }
.wf-step-extra, .wf-step-extra-actions {
  margin-top: 10px;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.wf-step-action { flex: 0 0 auto; align-self: center; }
.wf-step-done { font-size: 12px; font-weight: 600; color: #22c55e; }
.wf-step-locked { font-size: 12px; }
.wf-step-soon {
  font-size: 11px; font-weight: 700;
  color: var(--wf-accent, var(--primary));
  background: color-mix(in srgb, var(--wf-accent, var(--primary)) 13%, transparent);
  padding: 3px 9px;
  border-radius: 10px;
}
.wf-complete { border-left: 3px solid #4ade80; }

/* Per-workflow accent on the primary CTA */
.wf-page .btn-primary {
  background: var(--wf-accent, var(--primary));
  border-color: var(--wf-accent, var(--primary));
}
.wf-page .btn-primary:hover { filter: brightness(.93); }

/* ════════════════════════════════════════════════════════════════════════
   Guided workflows (chatbot-style flow) — .bgw
   Eén kleurverhaal per workflow: elke mijlpaalstaat is een tint van het
   workflow-accent (--wf-accent) — nooit oranje naast groen.
   ════════════════════════════════════════════════════════════════════════ */
.bgw { --bgw-accent: var(--wf-accent, var(--primary)); }

.bgw-header { align-items: flex-start; }
.bgw-period-chip {
  display: inline-block; font-size: 12px; font-weight: 700;
  color: var(--bgw-accent);
  background: color-mix(in srgb, var(--bgw-accent) 10%, transparent);
  padding: 1px 9px; border-radius: 999px;
}
.bgw-inline-form {
  margin: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 5px;
}
.bgw-restart-hint {
  font-size: 11.5px; line-height: 1.4; color: var(--text-muted);
  max-width: 260px; text-align: right;
}

/* Stepper rail — done: zachte accent-check, actief: gevulde accent-pill */
.bgw-stepper {
  display: flex; align-items: center; gap: 1px;
  padding: 8px 10px; margin-bottom: 22px; overflow-x: auto;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 999px; box-shadow: var(--shadow);
}
.bgw-stp {
  display: flex; align-items: center; gap: 6px; flex: 0 0 auto;
  padding: 4px 8px 4px 4px; border-radius: 999px;
  transition: background .25s ease;
}
.bgw-stp-dot {
  width: 25px; height: 25px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: var(--surface-low); color: var(--text-muted);
  border: 1.5px dashed var(--surface-high);
}
.bgw-stp-dot .material-symbols-outlined {
  font-size: 15px; font-variation-settings: 'FILL' 0, 'wght' 600;
}
.bgw-stp-title { font-size: 11.5px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }

.bgw-stp--done .bgw-stp-dot {
  background: color-mix(in srgb, var(--bgw-accent) 14%, transparent);
  color: var(--bgw-accent); border: none;
}
.bgw-stp--done .bgw-stp-title { color: var(--text); opacity: .7; }

.bgw-stp--active {
  background: var(--bgw-accent);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--bgw-accent) 35%, transparent);
}
.bgw-stp--active .bgw-stp-dot { background: rgba(255, 255, 255, .25); color: #fff; border: none; }
.bgw-stp--active .bgw-stp-title { color: #fff; }

.bgw-stp-line {
  flex: 1 1 10px; min-width: 6px; height: 2px; border-radius: 2px;
  background: var(--surface-mid);
}
.bgw-stp-line--done { background: color-mix(in srgb, var(--bgw-accent) 45%, transparent); }
/* Bij veel stappen (>8): alleen de actieve stap toont zijn titel */
.bgw-stepper--compact .bgw-stp:not(.bgw-stp--active) .bgw-stp-title { display: none; }
.bgw-stepper--compact .bgw-stp:not(.bgw-stp--active) { padding-right: 4px; }

/* Chat log */
.bgw-log { display: flex; flex-direction: column; gap: 14px; }
.bgw-msg { display: flex; gap: 12px; align-items: flex-start; }
.bgw-msg-user { justify-content: flex-end; }
.bgw-avatar {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--bgw-accent) 80%, #fff), var(--bgw-accent));
  color: #fff;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--bgw-accent) 30%, transparent);
}
.bgw-avatar .material-symbols-outlined { font-size: 19px; }
.bgw-bubble {
  background: var(--card-bg);
  border-radius: 4px 16px 16px 16px; padding: 16px 18px;
  max-width: 760px; box-shadow: var(--shadow);
}
.bgw-bubble--final {
  border: 1px solid color-mix(in srgb, var(--bgw-accent) 30%, transparent);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--bgw-accent) 6%, var(--card-bg)), var(--card-bg));
}
.bgw-text { font-size: 14px; line-height: 1.55; }
.bgw-text p { margin: 0 0 8px; }
.bgw-text p:last-child { margin-bottom: 0; }
.bgw-text code {
  font-family: var(--font-body); font-size: 12px;
  background: var(--surface-high); padding: 1px 6px; border-radius: 4px;
}
.bgw-reply {
  background: var(--bgw-accent); color: #fff;
  border-radius: 16px 16px 4px 16px; padding: 9px 15px;
  font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--bgw-accent) 25%, transparent);
}
.bgw-reply .material-symbols-outlined { font-size: 16px; }

.bgw-step-tag {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--bgw-accent);
  background: color-mix(in srgb, var(--bgw-accent) 11%, transparent);
  padding: 3px 10px; border-radius: 999px; margin-bottom: 10px;
}
.bgw-note {
  display: flex; align-items: flex-start; gap: 8px; width: fit-content;
  font-size: 12.5px; line-height: 1.45; color: var(--text-muted); margin: 12px 0 0;
  padding: 9px 12px; background: var(--surface-low);
  border-radius: 10px;
}
.bgw-note--warn {
  color: var(--warning); background: var(--warning-bg);
  border: 1px solid color-mix(in srgb, var(--warning) 18%, transparent);
}
.bgw-note .material-symbols-outlined { font-size: 16px; flex: 0 0 auto; margin-top: 1px; }

/* Oud vs. nieuw (correctie-tak) */
.bgw-diff {
  display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap;
  margin: 14px 0 4px;
}
.bgw-diff-item {
  flex: 1 1 150px; display: flex; flex-direction: column; gap: 3px;
  padding: 10px 14px; border-radius: var(--radius-lg);
  background: var(--surface-low); border: 1px solid var(--border);
}
.bgw-diff-arrow { align-self: center; color: var(--text-muted); font-size: 18px; flex: 0 0 auto; }
.bgw-diff-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-muted);
}
.bgw-diff-val { font-size: 18px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.bgw-diff--more .bgw-diff-delta {
  background: var(--danger-bg);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}
.bgw-diff--more .bgw-diff-delta .bgw-diff-val,
.bgw-diff--more .bgw-diff-delta .bgw-diff-label { color: var(--danger); }
.bgw-diff--less .bgw-diff-delta {
  background: var(--success-bg);
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
}
.bgw-diff--less .bgw-diff-delta .bgw-diff-val,
.bgw-diff--less .bgw-diff-delta .bgw-diff-label { color: var(--success); }
.bgw-diff--zero .bgw-diff-delta .bgw-diff-val { color: var(--text-muted); }

/* Tables inside bubbles */
.bgw-table-wrap {
  margin: 12px 0 2px; overflow-x: auto;
  border: 1px solid var(--border); border-radius: 10px;
}
.bgw-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bgw-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--text-muted); background: var(--surface-low);
  padding: 7px 12px; border-bottom: 1px solid var(--border);
}
.bgw-table td { padding: 7px 12px; border-bottom: 1px solid var(--surface-low); }
.bgw-table tr:last-child td { border-bottom: none; }
.bgw-table td.num, .bgw-table th:nth-child(n+4) {
  text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.bgw-table .bgw-grp td {
  font-weight: 600;
  background: color-mix(in srgb, var(--bgw-accent) 6%, var(--card-bg));
  border-top: 1px solid var(--border);
}
.bgw-table .bgw-total td { font-weight: 700; border-top: 2px solid var(--border); }
.bgw-tag {
  display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 600;
  color: var(--warning);
  background: var(--warning-bg);
  padding: 0 6px; border-radius: 5px; vertical-align: middle;
}

/* Jaarcijfer-kaartjes (periodeafsluiting): W&V / balans / kasstroom */
.bgw-reports {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px; margin: 14px 0 4px;
}
.bgw-report {
  display: flex; flex-direction: column; gap: 5px;
  padding: 12px 14px; border-radius: var(--radius-lg);
  background: var(--surface-low); border: 1px solid var(--border);
  color: var(--text); transition: border-color .15s ease, transform .15s ease;
}
.bgw-report:hover {
  opacity: 1; transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--bgw-accent) 45%, transparent);
}
.bgw-report-title {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--bgw-accent); margin-bottom: 3px;
}
.bgw-report-title .material-symbols-outlined { font-size: 14px; }
.bgw-report-row {
  display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px;
  color: var(--text-muted);
}
.bgw-report-row .num { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.bgw-report-row:last-child .num { color: var(--bgw-accent); }

/* Collapsed table behind a summary toggle */
.bgw-recap-details { margin: 8px 0 0; }
.bgw-recap-details > summary {
  cursor: pointer; font-size: 12.5px; font-weight: 600;
  color: var(--bgw-accent); list-style: none; width: fit-content;
}
.bgw-recap-details > summary::-webkit-details-marker { display: none; }
.bgw-recap-details > summary::before { content: '▸ '; font-size: 10px; }
.bgw-recap-details[open] > summary::before { content: '▾ '; }
.bgw-recap-details[open] > summary { margin-bottom: 2px; }

/* Ingevuld aangifteformulier binnen een chat-bubble: rapport-secties compacter
   maken zodat ze netjes in de bubbel passen. */
.bgw-formview .report-section,
.bgw-formview .btw-section { margin: 10px 0 0; }
.bgw-formview .report-section:first-of-type,
.bgw-formview .btw-section:first-of-type { margin-top: 6px; }
.bgw-formview h2 { font-size: 14px; margin: 0 0 6px; }
.bgw-formview h3 { font-size: 12.5px; }

/* Controls */
.bgw-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.bgw-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.bgw-period { align-items: flex-end; }
.bgw-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.bgw-field select { min-width: 110px; }
.bgw .btn-primary {
  background: var(--bgw-accent); border-color: var(--bgw-accent);
  box-shadow: 0 1px 6px color-mix(in srgb, var(--bgw-accent) 30%, transparent);
}
.bgw .btn-primary:hover { filter: brightness(.93); }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .bgw-stp:not(.bgw-stp--active) .bgw-stp-title { display: none; }
  .bgw-bubble { max-width: 100%; }
}

/* ── Dark mode ──────────────────────────────────────────────────────── */
[data-theme="dark"] .wf-nav-onboarding { box-shadow: 0 4px 16px rgba(0, 0, 0, .5); }

/* ════════════════════════════════════════════════════════════════════════
   Dashboard (rebuilt) — KPI hero, charts, ageing, freshness
   ════════════════════════════════════════════════════════════════════════ */

/* Generic responsive two-column grid for dashboard cards */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.card-head .card-title { margin: 0; }
.data-table.compact th, .data-table.compact td { padding: 6px 10px; font-size: 13px; }
.data-table .row-strong td { font-weight: 700; border-top: 1.5px solid var(--border); }
code.iban {
  font-size: 11px; color: var(--text-muted);
  background: var(--surface-low); padding: 2px 6px; border-radius: 4px;
}

/* ── Hero KPI row ─────────────────────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 16px; margin-bottom: 16px;
}
.kpi-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.kpi-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  text-transform: uppercase; color: var(--text-muted);
}
.kpi-head .material-symbols-outlined { font-size: 17px; }
.kpi-value { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.1; }
.kpi-value.sm { font-size: 18px; }
.kpi-value.neg { color: var(--danger); }
.kpi-foot { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi-delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; }
.kpi-delta .material-symbols-outlined { font-size: 15px; }
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--danger); }
.kpi-delta.neutral { color: var(--text-muted); }
.spark { width: 100%; height: 36px; margin-top: 4px; }

.pill {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 10px;
}
.pill-ok   { background: var(--success-bg); color: var(--success); }
.pill-warn { background: var(--warning-bg); color: var(--warning); }

/* ── Charts ───────────────────────────────────────────────────────────── */
.line-chart { width: 100%; }
.line-chart .spark { height: 150px; }
.line-axis {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text-muted); margin-top: 4px;
}
.bar-chart {
  display: flex; align-items: flex-end; gap: 10px;
  height: 130px; padding-top: 8px;
}
.bar-chart.months { gap: 5px; height: 150px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-track {
  flex: 1; width: 100%; display: flex; align-items: flex-end;
  justify-content: center; gap: 3px;
}
.bar-track.grouped .bar { width: 45%; }
.bar {
  width: 60%; border-radius: 4px 4px 0 0; min-height: 2px;
  transition: opacity .15s;
}
.bar:hover { opacity: .8; }
.bar-pos, .bar-income { background: var(--success); }
.bar-neg { background: var(--danger); }
.bar-expense { background: var(--danger); opacity: .85; }
.bar-label { font-size: 10px; color: var(--text-muted); margin-top: 5px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); }
.legend .dot, .age-legend .dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 2px;
  margin-right: 4px; vertical-align: middle;
}
.dot-income { background: var(--success); }
.dot-expense { background: var(--danger); }

/* ── Attention list ───────────────────────────────────────────────────── */
.attention-list { display: flex; flex-direction: column; gap: 6px; }
.attention-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius);
  background: var(--surface-low); text-decoration: none; color: var(--text);
  transition: background .12s;
}
.attention-item:hover { background: var(--surface-mid); }
.attention-item.is-zero { opacity: .5; }
.att-count {
  min-width: 34px; text-align: center; font-size: 18px; font-weight: 800;
  color: var(--warning);
}
.attention-item.is-zero .att-count { color: var(--text-muted); }
.att-label { flex: 1; font-size: 14px; }
.att-arrow { color: var(--text-muted); font-size: 20px; }

/* ── Working capital / ageing ─────────────────────────────────────────── */
.wc-totals { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.wc-big { font-size: 22px; font-weight: 800; line-height: 1.1; }
.age-bar {
  display: flex; height: 10px; border-radius: 5px; overflow: hidden;
  background: var(--surface-low); margin-bottom: 8px;
}
.age-seg { display: block; min-width: 0; }
.age-seg.age-cur, .dot.age-cur { background: #3b82f6; }
.age-seg.age-30,  .dot.age-30  { background: #f59e0b; }
.age-seg.age-60,  .dot.age-60  { background: #ef6c00; }
.age-seg.age-90,  .dot.age-90  { background: var(--danger); }
.age-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--text-muted); }

/* ── Freshness ────────────────────────────────────────────────────────── */
.fresh-list { display: flex; flex-direction: column; }
.fresh-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.fresh-item:last-child { border-bottom: none; }
.fresh-item .material-symbols-outlined { font-size: 18px; color: var(--text-muted); }
.fresh-label { flex: 1; }
.fresh-date { font-weight: 600; color: var(--text); }

/* ── Urenboekingsformulier (kalender-grid) ────────────────────────────── */
.ts-formdate {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  background: var(--surface-low); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 11px;
}
.ts-opt { color: var(--text-muted); font-weight: 500; font-size: .82em; }

.ts-controls { max-width: none; }
.ts-controls-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.ts-controls .form-group { margin-bottom: 0; }
.ts-controls-row.ts-period { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.ts-narrow { max-width: 150px; }
.ts-fieldset { display: flex; gap: 16px; align-items: flex-end; }
.ts-fieldset[hidden] { display: none; }
.ts-show-btn { align-self: flex-end; }

.ts-scope { display: inline-flex; border: 1.5px solid var(--surface-mid); border-radius: var(--radius); overflow: hidden; }
.ts-scope label {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 8px 16px; font-size: 13px; font-weight: 700; color: var(--text-muted);
  background: var(--card-bg);
}
.ts-scope label:first-child { border-right: 1.5px solid var(--surface-mid); }
.ts-scope label:hover { background: var(--surface-low); }
.ts-scope label.is-active { background: var(--primary); color: var(--on-primary); }
.ts-scope input { position: absolute; opacity: 0; width: 0; height: 0; }

/* Toolbar */
.ts-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 18px; }
.ts-quickfill { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ts-tool-label { font-size: 12px; font-weight: 800; color: var(--text); }
.ts-default-input {
  width: 64px; padding: 6px 10px; text-align: center; font-size: 14px;
  border: 1.5px solid var(--surface-mid); border-radius: var(--radius);
  background: var(--card-bg); color: var(--text);
}
.ts-default-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.30); }
.ts-grandtotal { font-size: 14px; color: var(--text-muted); }
.ts-grandtotal strong, .ts-foot-total strong { font-size: 19px; color: var(--text); font-variant-numeric: tabular-nums; }

/* Calendar */
.ts-block { padding: 18px; }
.ts-block-title { font-family: var(--font-headline); font-size: 16px; font-weight: 800; margin: 0 0 14px; text-transform: capitalize; }
.ts-cal-wrap { overflow-x: auto; }
.ts-cal { width: 100%; border-collapse: separate; border-spacing: 6px; table-layout: fixed; min-width: 640px; }
.ts-cal th {
  font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted); text-align: left; padding: 0 4px 4px; width: 13%;
}
.ts-cal th.ts-we { color: var(--surface-highest); }
.ts-cal th.ts-sum-head { width: 9%; text-align: right; }

.ts-cell {
  position: relative; vertical-align: top; height: 66px;
  border: 1px solid var(--surface-low); border-radius: var(--radius);
  background: var(--card-bg); padding: 6px;
}
.ts-cell.ts-we { background: var(--surface-low); border-color: var(--surface-mid); }
.ts-cell.ts-out { background: transparent; border: 1px dashed var(--surface-mid); opacity: .4; }
.ts-cell.ts-today { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
.ts-daynum {
  position: absolute; top: 6px; right: 8px; font-size: 11px; font-weight: 500;
  color: var(--surface-highest); font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.ts-cell.ts-today .ts-daynum { color: var(--primary); font-weight: 700; }
/* Het invulveld is het duidelijk herkenbare, witte vlak met rand. */
.ts-input {
  width: 100%; margin-top: 20px; padding: 6px; text-align: center;
  font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums;
  border: 1.5px solid var(--surface-mid); border-radius: 5px; background: var(--card-bg);
  color: var(--text); font-family: var(--font-body);
  transition: border-color .12s, box-shadow .12s;
}
.ts-input::placeholder { color: var(--surface-high); font-weight: 500; }
.ts-input:hover { border-color: var(--surface-high); }
.ts-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.25); }

.ts-locked { background: var(--surface-low); }
.ts-locked-val {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  margin-top: 24px; font-size: 15px; font-weight: 700; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.ts-lock { font-size: 14px; }

.ts-wtotal {
  text-align: right; font-size: 15px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; padding-right: 4px; vertical-align: middle;
}

.ts-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.ts-foot-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ts-foot-total { font-size: 14px; color: var(--text-muted); }
.ts-foot--locked { align-items: center; }

/* Status-banner op de kalender + urenstaat-overzicht/detail */
.ts-status-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; padding: 12px 16px; border-left: 4px solid var(--border);
}
.ts-status-banner .ts-status-info { display: flex; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.ts-status-ingediend   { border-left-color: var(--primary); }
.ts-status-goedgekeurd { border-left-color: var(--success); }
.ts-status-afgekeurd   { border-left-color: var(--danger); }

.ts-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.ts-detail-head { display: flex; flex-direction: column; gap: 14px; }
.ts-detail-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.ts-detail-meta > div { display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.ts-meta-label { font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--text-muted); }
.ts-reject-note {
  display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--danger);
  background: var(--danger-bg); border-radius: var(--radius); padding: 8px 12px;
}
.ts-detail-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); }
.ts-reject-form { display: inline-flex; gap: 8px; align-items: center; }
.ts-reject-input {
  padding: 7px 11px; border: 1.5px solid var(--surface-mid); border-radius: var(--radius);
  font-size: 13px; background: var(--card-bg); color: var(--text); min-width: 200px;
}
.ts-reject-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.25); }

@media (max-width: 720px) {
  .ts-cal { border-spacing: 3px; }
  .ts-cell { height: 56px; padding: 4px; }
  .ts-input { margin-top: 16px; font-size: 14px; }
}

/* ── Boekingsschema (journals.schema) ───────────────────────────────── */
.bs-lead {
  max-width: 760px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 18px;
}
.bs-lead strong { color: var(--text); }

.bs-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 30px;
  padding: 10px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.bs-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.bs-legend-dot { width: 11px; height: 11px; border-radius: 3px; }

.bs-group { margin-bottom: 40px; }
.bs-group-head { margin-bottom: 16px; }
.bs-group-head h2 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.bs-group-head p {
  max-width: 760px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}

.bs-flow {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--bs-accent, var(--primary));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 16px;
}

.bs-flow-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 18px;
}
.bs-flow-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--bs-accent, var(--primary));
  background: color-mix(in srgb, var(--bs-accent, var(--primary)) 12%, transparent);
  font-size: 22px;
}
.bs-flow-meta h3 { font-size: 16px; font-weight: 650; margin-bottom: 2px; }
.bs-flow-meta p { font-size: 13px; color: var(--text-muted); }

/* Flow diagram: bron → bestemming */
.bs-diagram {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: stretch;
}
.bs-col { display: flex; flex-direction: column; gap: 10px; }
.bs-col-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--outline);
}
.bs-arrow {
  display: grid;
  place-items: center;
  color: var(--bs-accent, var(--primary));
  padding-top: 22px;
}
.bs-arrow .material-symbols-outlined { font-size: 28px; }

.bs-chip {
  position: relative;
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-left: 3px solid var(--chip, var(--outline));
  border-radius: var(--radius);
  padding: 9px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bs-chip-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bs-chip-code {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--chip, var(--text));
  font-variant-numeric: tabular-nums;
}
.bs-chip-tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--chip, var(--text-muted));
  background: color-mix(in srgb, var(--chip, var(--outline)) 14%, transparent);
  padding: 1px 7px;
  border-radius: 999px;
}
.bs-chip-name { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.3; }
.bs-chip-gl { font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.bs-chip-warn { color: var(--danger); font-weight: 600; }
.bs-chip-note { font-size: 11.5px; color: var(--text-muted); line-height: 1.45; margin-top: 1px; }
.bs-chip-missing { border-style: dashed; opacity: .85; }

/* Journaalpost: debet vs credit */
.bs-entry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.bs-entry-side { display: flex; flex-direction: column; gap: 4px; }
.bs-entry-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--outline);
}
.bs-entry-acc { font-size: 12.5px; color: var(--text); font-variant-numeric: tabular-nums; }
.bs-entry-acc b { font-weight: 700; }

.bs-entry-bidi {
  display: flex;
  align-items: center;
  gap: 9px;
  grid-template-columns: none;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
}
.bs-entry-bidi .material-symbols-outlined { font-size: 18px; color: var(--bs-accent, var(--primary)); flex: none; }

.bs-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

@media (max-width: 720px) {
  .bs-diagram { grid-template-columns: 1fr; gap: 10px; }
  .bs-arrow { padding: 0; transform: rotate(90deg); }
  .bs-entry { grid-template-columns: 1fr; }
}

/* Afrondingsverschil-callout op de aangifte-stromen */
.bs-rounding {
  display: flex;
  gap: 11px;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--warning-bg);
  border: 1px solid color-mix(in srgb, var(--warning) 28%, transparent);
  border-radius: var(--radius);
}
.bs-rounding-ico { flex: none; color: var(--warning); font-size: 20px; margin-top: 1px; }
.bs-rounding-body { flex: 1; min-width: 0; }
.bs-rounding-title {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--warning);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 3px;
}
.bs-rounding-body > p { font-size: 12.5px; color: var(--text); line-height: 1.5; }
.bs-rounding-target { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.bs-rounding-target .bs-chip { flex: none; min-width: 200px; background: var(--card-bg); }
.bs-rounding-arrow { color: var(--warning); font-size: 20px; flex: none; }

/* ════════════════════════════════════════════════════════════════════════
   Startpagina, hubs & app-menu-drawer — de centrale navigatieschil
   ════════════════════════════════════════════════════════════════════════ */

/* ── App-menu: drawer rechts, achter het ☰-icoon in de topbar ──────── */
.app-menu {
  position: fixed;
  top: var(--topbar-h); right: 0; bottom: 0;
  z-index: 42;
  width: min(300px, 88vw);
  background: var(--card-bg);
  border-left: 1px solid var(--surface-mid);
  transform: translateX(105%);
  transition: transform .2s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  padding: 10px 14px 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-high) transparent;
}
body.menu-open .app-menu {
  transform: none;
  box-shadow: var(--shadow-lg);
}

.app-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 4px 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text);
}
.app-menu-close {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.app-menu-close:hover { background: var(--surface-low); color: var(--text); }
.app-menu-close .material-symbols-outlined { font-size: 19px; }

.app-menu-section {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 10px 4px;
}

.app-menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background .12s;
}
.app-menu-link:hover { background: var(--surface-low); opacity: 1; }
.app-menu-link .material-symbols-outlined {
  font-size: 18px;
  width: 18px;
  color: var(--text-muted);
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
}

/* ── Startpagina ───────────────────────────────────────────────────── */
.start-wrap { max-width: 940px; margin: 0 auto; }

.start-head { margin: 6px 0 24px; }
.start-head h1 {
  font-family: var(--font-headline);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -.4px;
  margin: 0 0 4px;
}
.start-head p { margin: 0; color: var(--text-muted); font-size: 14px; }

.start-onboard {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  margin-bottom: 22px;
  text-decoration: none;
  color: var(--text);
  transition: transform .14s ease, box-shadow .14s ease;
}
.start-onboard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); opacity: 1; }
.start-onboard-ico {
  width: 38px; height: 38px;
  border-radius: 10px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--primary-container);
  color: var(--primary-dim);
}
.start-onboard-ico .material-symbols-outlined { font-size: 21px; }
.start-onboard-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.start-onboard-title { font-weight: 700; font-size: 14.5px; }
.start-onboard-sub { font-size: 13px; color: var(--text-muted); }
.start-onboard-count {
  flex: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dim);
  font-variant-numeric: tabular-nums;
}

.start-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.start-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-height: 190px;
  padding: 24px 24px 20px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border-top: 3px solid var(--tile-accent, var(--primary));
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: transform .14s ease, box-shadow .14s ease;
}
.start-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); opacity: 1; }

.start-tile-ico {
  width: 46px; height: 46px;
  border-radius: 12px;
  flex: none;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--tile-accent, var(--primary)) 13%, var(--card-bg));
  color: var(--tile-accent, var(--primary));
}
.start-tile-ico .material-symbols-outlined { font-size: 26px; }
[data-theme="dark"] .start-tile-ico {
  background: color-mix(in srgb, var(--tile-accent, var(--primary)) 28%, var(--card-bg));
  color: #dbeafe;
}

.start-tile-title {
  font-family: var(--font-headline);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.3px;
}
.start-tile-sub { color: var(--text-muted); font-size: 13.5px; margin-top: -8px; }
.start-tile-badges { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; }

.start-foot {
  margin-top: 26px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
}
.start-foot a,
.start-foot-link {
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 500;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-body);
}
.start-foot a:hover,
.start-foot-link:hover { text-decoration: underline; opacity: 1; }
.start-foot-sep { margin: 0 8px; color: var(--surface-high); }

/* ── Live badges (start-tegels en hub-knoppen) ─────────────────────── */
.hub-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  background: var(--primary-container);
  color: var(--primary-dim);
}
.hub-badge-warn { background: var(--warning-bg); color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent); }
.hub-badge-ok   { background: var(--success-bg); color: var(--success); }
.hub-badge-muted { background: var(--surface-low); color: var(--text-muted); }

/* ── Kruimelpad (base.html, op elke pagina behalve Start) ──────────── */
.crumbs-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-muted);
  margin: -6px 0 16px;
}
.crumbs-bar a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}
.crumbs-bar a:hover { color: var(--primary); opacity: 1; }
.crumbs-bar .crumb-home { font-size: 15px; }
.crumbs-bar .crumb-here { color: var(--text); font-weight: 600; }
.crumb-sep { color: var(--surface-high); user-select: none; }

/* ── Hub-pagina's ──────────────────────────────────────────────────── */
.hub-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.hub-head .start-tile-ico { width: 42px; height: 42px; }
.hub-head .start-tile-ico .material-symbols-outlined { font-size: 24px; }
.hub-head h1 {
  font-family: var(--font-headline);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.4px;
  margin: 0;
}
.hub-sub { color: var(--text-muted); margin: 0 0 24px 56px; font-size: 14px; }

.hub-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.hub-action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: transform .12s ease, box-shadow .12s ease;
}
a.hub-action:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); opacity: 1; }

.hub-action-ico {
  width: 40px; height: 40px;
  border-radius: 10px;
  flex: none;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--hub-accent, var(--primary)) 12%, var(--card-bg));
  color: var(--hub-accent, var(--primary));
}
.hub-action-ico .material-symbols-outlined { font-size: 22px; }
[data-theme="dark"] .hub-action-ico {
  background: color-mix(in srgb, var(--hub-accent, var(--primary)) 28%, var(--card-bg));
  color: #dbeafe;
}

.hub-action-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hub-action-title {
  font-weight: 700;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hub-action-sub { font-size: 12.5px; color: var(--text-muted); }
.hub-action-end { display: flex; align-items: center; gap: 8px; flex: none; }
.hub-chev { color: var(--outline); font-size: 20px; }

.hub-action.soon {
  box-shadow: none;
  background: transparent;
  border: 1px dashed var(--surface-high);
  opacity: .6;
}
.hub-chip-soon {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-low);
  border-radius: 4px;
  padding: 2px 6px;
}

.hub-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hub-chip {
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 99px;
  background: var(--primary-subtle);
  color: var(--primary-dim);
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--hub-accent, var(--primary)) 25%, transparent);
  transition: background .12s;
}
.hub-chip:hover { background: var(--primary-container); opacity: 1; }

.hub-secondary {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--surface-mid);
  font-size: 13.5px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
}
.hub-secondary a { color: var(--primary); text-decoration: none; font-weight: 500; }
.hub-secondary a:hover { text-decoration: underline; opacity: 1; }
.hub-sec-sep { color: var(--surface-high); }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .start-tiles, .hub-actions { grid-template-columns: 1fr; }
  .start-tile { min-height: 0; }
  .hub-sub { margin-left: 0; }
  /* Griditems mogen smaller worden dan hun inhoud (badge met deadline
     rekte de kolom anders breder dan het scherm) */
  .start-tile, .hub-action { min-width: 0; }
  .hub-action { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .app-menu, .drawer-scrim,
  .start-tile, .start-onboard, .hub-action { transition: none; }
}

/* ════════════════════════════════════════════════════════════════════════
   Smartphone-layout — mobiele schil voor alle basispagina's
   De schil (topbar + drawers + gecentreerde inhoud) werkt al op elk formaat;
   dit blok maakt de bouwstenen (tabellen, filters, formulieren, modals,
   toasts) bruikbaar op een telefoon.
   ════════════════════════════════════════════════════════════════════════ */

/* ── Tabellen: horizontaal scrollen binnen hun kaart ────────────────── */
/* app.js wikkelt elke .data-table in een .table-scroll; op brede schermen
   verandert er niets, op smalle schermen scrollt de tabel in de wrapper. */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);   /* zelfde radius als .data-table, anders knipt de hoek */
}

/* ── Aanraakschermen: geen hover ────────────────────────────────────── */
@media (hover: none) {
  /* Rij-acties verschijnen op desktop pas bij hover; op touch altijd tonen */
  .data-table tbody tr .row-actions { opacity: 1; }
}
@media (pointer: coarse) {
  /* Grotere tikdoelen */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
}

/* De wissel-link naast de bedrijfsnaam mag nooit meekrimpen */
.topbar-switch { flex: none; }

/* ── Telefoons & smalle tablets ─────────────────────────────────────── */
@media (max-width: 760px) {
  .main-content { padding: 18px 14px 44px; }
  .card { padding: 16px 14px; }
  .form-card, .form-card-wide { max-width: none; }

  /* Topbar: compact — zoekknop wordt icoon, sneltoets-hints weg */
  .topbar { padding: 0 10px; gap: 8px; }
  .topbar-right { gap: 6px; }
  .topbar-pill-btn {
    width: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .topbar-pill-btn span:not(.material-symbols-outlined) { display: none; }
  .kb-hint { display: none; }

  /* Paginakop: titel en knoppen mogen onder elkaar vallen */
  .page-header {
    flex-wrap: wrap;
    gap: 10px 12px;
    margin-bottom: 18px;
  }
  .page-header h1 { font-size: 21px; }
  .header-actions { flex-wrap: wrap; }
  /* Knoppengroepen in paginakoppen (o.a. div.nowrap op regel-/relatiepagina's)
     mogen op een telefoon over meerdere regels vallen */
  .page-header .nowrap { white-space: normal; flex-wrap: wrap; }

  /* Kruimelpad: één regel die horizontaal scrollt */
  .crumbs-bar {
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    margin-top: 0;
  }
  .crumbs-bar::-webkit-scrollbar { display: none; }
  .crumbs-bar a, .crumbs-bar .crumb-here { flex: none; }

  /* Filterbalken: velden vullen de beschikbare breedte */
  .filter-bar select,
  .filter-bar input[type="search"],
  .filter-bar input[type="text"],
  .filter-select { flex: 1 1 140px; min-width: 0; }
  .filter-bar input[type="search"],
  .filter-bar input[type="text"] { min-width: 0; }

  /* iOS zoomt in op velden met tekst kleiner dan 16px — voorkom dat */
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea { font-size: 16px; }

  /* Formulieren */
  .form-row { gap: 12px; }
  .form-actions { flex-wrap: wrap; }

  /* Drawers nooit breder dan het scherm */
  .sidebar { width: min(var(--sidebar-w), 88vw); }

  /* Bevestigingsvenster: passend met marge */
  .modal-overlay { padding: 16px; }
  .modal-box { min-width: 0; width: 100%; padding: 20px 18px; }

  /* Command palette: vult de breedte, blijft bovenin */
  .cmd-overlay { padding: 12px; }
  .cmd-box { max-width: none; }

  /* Toasts: volle breedte onderaan */
  #toast-container { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: none; width: 100%; }

  /* Banners (aankondiging/meekijkmodus): knop mag onder de tekst vallen */
  .announcement-banner, .impersonation-banner { flex-wrap: wrap; gap: 8px; }

  /* Beheerportaal: navigatie in de topbar scrollt horizontaal */
  .admin-nav { overflow-x: auto; scrollbar-width: none; }
  .admin-nav::-webkit-scrollbar { display: none; }
  .admin-nav a { flex: none; }
  .admin-topbar .topbar-left { margin-right: 10px; }
}

/* ── Kleine telefoons ───────────────────────────────────────────────── */
@media (max-width: 560px) {
  .brand-name { display: none; }     /* logo blijft, linkt naar Start */
  .topbar-switch { display: none; }  /* bedrijf wisselen kan via menu → Bedrijven */
  .main-content { padding: 14px 10px 40px; }

  /* Beheerportaal-topbar: badge weg en compactere knoppen, anders
     valt "Uitloggen" buiten beeld */
  .admin-shell-badge { display: none; }
  .admin-topbar .topbar-right .btn { padding: 6px 10px; }
}
