/* Businesspoint dashboard. Sober en zakelijk: wit en neutraal grijs, één lettertype (Fira Sans),
   Businesspoint-paars alleen voor het logo, de hoofdactie, de actieve tab en links.
   Geen schaduwen op vlakken, geen gradiënten, geen gekleurde randstrepen, kleine hoekradius. */

/* ============ Kleuren & maten ============ */
:root {
  --topbar-h: 52px;
  color-scheme: light;
  --font-body: "Fira Sans", system-ui, "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font-body);
  --brand: #6a1e5a;
  --brand-2: #551848;
  --brand-tint: #f3f0f2;
  --bg: #f4f4f3;
  --surface: #ffffff;
  --surface-2: #f0f0ee;
  --text: #1d1d1d;
  --text-2: #4d4d4d;
  --muted: #6b6b6b;
  --border: #e1e1de;
  --border-strong: #c7c7c3;
  --grid: #ebebe8;
  --axis: #c4c4c0;
  --accent: #6a1e5a;
  --accent-ink: #ffffff;
  --link: #6a1e5a;
  --series-1: #6a1e5a;
  --series-forecast: #cbbcc7;
  --good: #2e7d4f;
  --good-ink: #1f6b3f;
  --warning: #c98a00;
  --critical: #b3261e;
  --logo-filter: none;
  --heading: #1d1d1d;
  --nav-active: #1d1d1d;
  --radius: 4px;
  --radius-sm: 3px;
  --sidebar: 228px;
  --shadow-pop: 0 4px 16px rgba(0, 0, 0, .14);
  --ease: ease;
  --sidebar-bg: #ffffff;
  --sidebar-text: #3a3a3a;
  --sidebar-muted: #6b6b6b;
  --sidebar-hover: #f4f4f3;
  --sidebar-active-bg: #ebebe8;
  --sidebar-active-text: #1d1d1d;
  --sidebar-border: #e1e1de;
  --sidebar-mark: #6a1e5a;
  --sidebar-logo-filter: none;
  --float-bg: #262626;
}

/* ============ Kleurenschema's (zelfde indeling, andere kleuren) ============
   Gekozen via Gebruikersmenu → Kleurenschema; opgeslagen per browser. */
:root[data-palette="leisteen"] {
  --brand: #2f3a4c; --brand-2: #252e3d; --brand-tint: #eef0f3;
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #eef0f3;
  --text: #1d2330; --text-2: #4b5563; --muted: #68707c; --heading: #1d2330;
  --border: #e3e6ea; --border-strong: #cfd4da; --grid: #e9ecef; --axis: #c5cad1;
  --accent: #2f3a4c; --link: #2f5d8a; --series-1: #3b5b7d; --series-forecast: #b9c7d6; --nav-active: #1d2330;
  --sidebar-text: #3a4250; --sidebar-muted: #68707c; --sidebar-hover: #f4f5f7; --sidebar-active-bg: #e9ecef; --sidebar-active-text: #1d2330; --sidebar-border: #e3e6ea; --sidebar-mark: #2f3a4c;
}
:root[data-palette="zand"] {
  --brand: #5a3d52; --brand-2: #47303f; --brand-tint: #f0ece5;
  --bg: #f6f4f0; --surface: #fffdfa; --surface-2: #f0ece5;
  --text: #2a2420; --text-2: #5d544c; --muted: #766c62; --heading: #2a2420;
  --border: #e6e0d6; --border-strong: #d6cdc0; --grid: #ece6dc; --axis: #cfc5b6;
  --accent: #5a3d52; --link: #6b3f5f; --series-1: #6e4c65; --series-forecast: #d8c3cf; --nav-active: #2a2420;
  --sidebar-bg: #fffdfa; --sidebar-text: #5d544c; --sidebar-muted: #766c62; --sidebar-hover: #f6f4f0; --sidebar-active-bg: #efe9e0; --sidebar-active-text: #2a2420; --sidebar-border: #e6e0d6; --sidebar-mark: #5a3d52;
  --float-bg: #2a2420;
}
:root[data-palette="nacht"] {
  --brand: #0f5f63; --brand-2: #0b4c4f; --brand-tint: #e5eff0;
  --bg: #f3f5f6; --surface: #ffffff; --surface-2: #edf1f2;
  --text: #182024; --text-2: #4a565c; --muted: #65737a; --heading: #182024;
  --border: #e1e7e9; --border-strong: #cbd5d8; --grid: #e6ecee; --axis: #c2cdd1;
  --accent: #0f5f63; --link: #0e6b70; --series-1: #137177; --series-forecast: #a9d0d1; --nav-active: #0f5f63;
  --sidebar-bg: #1b2328; --sidebar-text: #c4cdd1; --sidebar-muted: #8e9ba1; --sidebar-hover: #263038;
  --sidebar-active-bg: #2b3840; --sidebar-active-text: #ffffff; --sidebar-border: #1b2328; --sidebar-mark: #5cc4c8; --sidebar-logo-filter: brightness(0) invert(1);
  --float-bg: #1b2328;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand-tint: #2b2529; --bg: #161616; --surface: #1f1f1f; --surface-2: #2a2a2a; --text: #ececec; --text-2: #c4c4c4;
    --muted: #a0a0a0; --border: #333333; --border-strong: #4a4a4a; --grid: #2d2d2d; --axis: #4a4a4a;
    --brand-2: #b76aa0; --accent: #a4578d; --link: #d9a3c8; --series-1: #c07fae; --series-forecast: #6e5468; --good: #4caf7a; --good-ink: #6fcf9a; --critical: #ef7a70;
    --logo-filter: brightness(0) invert(1); --heading: #ececec; --nav-active: #ececec; --shadow-pop: 0 4px 16px rgba(0, 0, 0, .5);
    --sidebar-bg: #1a1a1a; --sidebar-text: #cfcfcf; --sidebar-muted: #a0a0a0; --sidebar-hover: #262626; --sidebar-active-bg: #303030; --sidebar-active-text: #ffffff; --sidebar-border: #333333; --sidebar-mark: #d9a3c8; --sidebar-logo-filter: brightness(0) invert(1);
    --float-bg: #333333;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand-tint: #2b2529; --bg: #161616; --surface: #1f1f1f; --surface-2: #2a2a2a; --text: #ececec; --text-2: #c4c4c4;
  --muted: #a0a0a0; --border: #333333; --border-strong: #4a4a4a; --grid: #2d2d2d; --axis: #4a4a4a;
  --brand-2: #b76aa0; --accent: #a4578d; --link: #d9a3c8; --series-1: #c07fae; --series-forecast: #6e5468; --good: #4caf7a; --good-ink: #6fcf9a; --critical: #ef7a70;
  --logo-filter: brightness(0) invert(1); --heading: #ececec; --nav-active: #ececec; --shadow-pop: 0 4px 16px rgba(0, 0, 0, .5);
  --sidebar-bg: #1a1a1a; --sidebar-text: #cfcfcf; --sidebar-muted: #a0a0a0; --sidebar-hover: #262626; --sidebar-active-bg: #303030; --sidebar-active-text: #ffffff; --sidebar-border: #333333; --sidebar-mark: #d9a3c8; --sidebar-logo-filter: brightness(0) invert(1);
  --float-bg: #333333;
}

/* ============ Basis ============ */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font-body);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; font-size: 12.5px; }
h1 { font-size: 21px; line-height: 1.25; margin: 0; font-weight: 600; color: var(--heading); }
h2 { font-size: 14.5px; line-height: 1.35; margin: 0 0 4px; font-weight: 600; color: var(--heading); }
h3 { font-size: 14px; font-weight: 600; }
.sub { color: var(--text-2); font-size: 13px; margin: 0 0 12px; }
.small { font-size: 12px; color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); }
.late { color: var(--critical); font-weight: 500; }
.neg { color: var(--critical); font-weight: 600; }
.pos { color: var(--good-ink); }

/* ============ Indeling: menu links, inhoud rechts ============ */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--sidebar-bg); border-right: 1px solid var(--sidebar-border); padding: 14px 10px 10px; overflow-y: auto; scrollbar-width: thin; }
.brand { display: block; padding: 0 10px; }
.brand img { height: 26px; width: auto; display: block; filter: var(--sidebar-logo-filter); }
.sidebar .product { display: none; }
.tabs { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-title { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 26px; padding: 0 8px; background: none; border: 0; border-radius: var(--radius-sm); cursor: default; text-align: left; font: 600 11.5px/1 var(--font-body); color: var(--sidebar-muted); }
button.nav-title { cursor: pointer; transition: color .12s; }
button.nav-title:hover { color: var(--sidebar-active-text); }
.nav-title .nav-caret { margin-left: auto; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .16s var(--ease); }
.nav-group.collapsed .nav-caret { transform: rotate(-90deg); }
.nav-group.collapsed > a { display: none; }
/* Ingeklapte groep met openstaand werk: stip naast de titel */
.nav-group.collapsed:has(.count:not([hidden])) .nav-title::after { content: ""; order: 1; width: 7px; height: 7px; border-radius: 50%; background: var(--sidebar-mark); }
.nav-group.collapsed:has(.count:not([hidden])) .nav-caret { order: 2; }
.tabs a { position: relative; display: flex; align-items: center; gap: 9px; min-height: 30px; padding: 4px 8px; border-radius: var(--radius-sm); color: var(--sidebar-text); text-decoration: none; font-weight: 400; font-size: 13.5px; white-space: nowrap; }
.tabs a svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.tabs a span:first-of-type { flex: 1; }
.tabs a:hover { background: var(--sidebar-hover); color: var(--sidebar-active-text); }
.tabs a.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 600; }
.tabs a.active svg { opacity: 1; }
.tabs a.active::before { content: none; }
.tabs a .count { background: none; color: var(--sidebar-muted); min-width: 0; padding: 0; font-size: 12px; font-weight: 500; }
:root[data-palette="zand"] .tabs a .count { color: #fff; }
.sidebar :focus-visible { outline-color: var(--sidebar-mark); outline-offset: 1px; }
.sidebar-foot { margin-top: auto; padding: 14px 0 0; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; height: var(--topbar-h); display: flex; align-items: center; gap: 16px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .topbar-logo, .topbar .menu-toggle { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; }
.crumbs b { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.crumbs i { font-style: normal; color: var(--border-strong); }
.jump-btn { display: flex; align-items: center; gap: 8px; height: 30px; width: 220px; margin-left: auto; padding: 0 8px; font: inherit; font-size: 13px; color: var(--muted); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: text; }
.jump-btn:hover { border-color: var(--border-strong); color: var(--text-2); }
.jump-btn svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.jump-btn span { flex: 1; text-align: left; }
kbd { font: 500 11px/1 var(--font-body); color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 3px 5px; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
main { width: 100%; max-width: 1480px; padding: 20px 24px 48px; }
.banner { display: block; margin-bottom: 16px; padding: 6px 10px; font-size: 12.5px; background: var(--surface-2); color: var(--text-2); border: 0; border-radius: var(--radius-sm); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 8px 24px; flex-wrap: wrap; margin-bottom: 16px; }
.meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12.5px; margin: 0; flex-wrap: wrap; }
.meta > span { margin-right: 4px; }

/* ============ Knoppen & invoer ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px; font: inherit; font-weight: 500; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--critical); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12.5px; }
.btn.big { height: 40px; padding: 0 20px; font-size: 14px; }
.btn:disabled { opacity: .55; cursor: wait; }
.link-btn { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font: inherit; font-size: 12px; }

.field { display: grid; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field input, .field select, .field textarea, .select, .toolbar input[type=search], .toolbar input[type=date], .qty-input {
  font: inherit; font-size: 13px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); outline: none; transition: border-color .12s, box-shadow .12s;
}
.field input, .field select, .field textarea { width: 100%; height: 34px; padding: 0 10px; }
.field textarea { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; }
.select, .toolbar input[type=date] { height: 34px; padding: 0 8px; }
.toolbar input[type=search] { height: 34px; padding: 0 12px; min-width: 240px; }
.qty-input { width: 72px; height: 30px; padding: 0 8px; text-align: right; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.field input:focus, .field select:focus, .field textarea:focus, .select:focus, .toolbar input[type=search]:focus, .toolbar input[type=date]:focus, .qty-input:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.check-field { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; font-size: 13px; }
.check-field input, .plan-check, .matrix td.cell input { width: 16px; height: 16px; accent-color: var(--brand); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* ============ Kaarten & cijfers ============ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .empty { padding: 48px 24px; }
.grid2, .grid3 { display: grid; gap: 16px; margin-bottom: 16px; }
.grid2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid2 > .card, .grid3 > .card { margin-bottom: 0; }
/* KPI's: één doorlopende strook met lijnen ertussen, geen losse kaartjes */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.kpis:empty { display: none; }
.kpi { padding: 10px 14px 11px; box-shadow: -1px 0 0 var(--border), 0 -1px 0 var(--border); min-width: 0; }
.kpi .label { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12px; }
.kpi .value { font-size: 22px; line-height: 1.2; font-weight: 500; color: var(--heading); margin: 3px 0 1px; }
.kpi .delta { display: block; font-size: 12px; color: var(--muted); }
.kpi .delta.up { color: var(--good-ink); }
.kpi .delta.down { color: var(--critical); }
.empty { color: var(--muted); text-align: center; padding: 32px; }

/* ============ Filters & werkbalk ============ */
.toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar-right { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* Filtergroepen zijn tabbladen met een lijn eronder; een losse .chip blijft een klein knopje */
.chips { display: inline-flex; gap: 2px; border-bottom: 1px solid var(--border-strong); flex-wrap: wrap; max-width: 100%; }
.chip {
  font: inherit; font-size: 13px; font-weight: 400; min-height: 28px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-2); cursor: pointer; white-space: nowrap; transition: color .12s, border-color .12s, background .12s;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active { color: var(--text); border-color: var(--text-2); font-weight: 500; }
.chips .chip { min-height: 32px; padding: 0 10px; border: 0; border-radius: 0; background: transparent; margin-bottom: -1px; border-bottom: 2px solid transparent; display: inline-flex; align-items: center; text-decoration: none; }
.chips .chip:hover { color: var(--text); border-bottom-color: transparent; }
.chips .chip.active { color: var(--heading); font-weight: 500; border-bottom-color: var(--accent); }
.chip .n { color: var(--muted); font-weight: 400; margin-left: 4px; }

/* ============ Tabellen ============ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); background: var(--surface); border-bottom: 1px solid var(--border-strong); padding: 7px 12px; white-space: nowrap; }
td { border-bottom: 1px solid var(--border); padding: 7px 12px; vertical-align: middle; }
tr:last-child > td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.card.flush table th:first-child, .card.flush table td:first-child { padding-left: 18px; }
.card.flush table th:last-child, .card.flush table td:last-child { padding-right: 18px; }
tr.click, tr.order-row, table.plan tr.plan-row { cursor: pointer; }
tr.click:hover td, tr.order-row:hover td, table.plan tr.plan-row:hover td { background: var(--surface-2); }
tr.click:hover td:first-child, tr.order-row:hover td:first-child, table.plan tr.plan-row:hover td:first-child { box-shadow: none; }
tr.order-row td:first-child::before { content: "›"; display: inline-block; width: 14px; color: var(--muted); font-size: 16px; line-height: 1; transition: transform .15s var(--ease); }
tr.order-row.open td:first-child::before { transform: rotate(90deg); }
tr.order-row.open td { background: var(--brand-tint); }
tr.lines-row > td { background: var(--bg); padding: 12px 18px 16px; }
tr.lines-row table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
table.plan tr.selected td { background: var(--brand-tint); }

/* ============ Labels & statussen ============ */
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 2px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.badge::before { content: none; }
.badge.good { color: var(--good-ink); background: color-mix(in srgb, var(--good) 12%, transparent); }
.badge.warn { color: var(--text); background: color-mix(in srgb, var(--warning) 18%, transparent); }
.badge.warn::before { content: none; }
.badge.bad { color: var(--critical); background: color-mix(in srgb, var(--critical) 10%, transparent); }
.badge.muted { color: var(--muted); }
.tag { display: inline-block; font-size: 11px; font-weight: 500; padding: 1px 7px; border-radius: 4px; background: var(--surface-2); color: var(--text-2); vertical-align: 1px; }
.count { display: inline-block; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 2px; background: var(--critical); color: #fff; font-size: 11px; font-weight: 500; line-height: 16px; text-align: center; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status.success::before { background: var(--good); }
.status.error::before { background: var(--critical); }
.status.running::before { background: var(--warning); }
.pill { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 6px 8px; border-radius: var(--radius-sm); background: none; color: var(--sidebar-muted); cursor: pointer; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sidebar-muted); flex: none; }
.pill.ok::before { background: var(--good); }
.pill.warn::before { background: var(--warning); }
.pill.bad::before { background: var(--critical); }
.callout { border: 1px solid color-mix(in srgb, var(--warning) 45%, var(--border)); background: color-mix(in srgb, var(--warning) 7%, var(--surface)); padding: 8px 12px; border-radius: var(--radius-sm); margin: 12px 0; font-size: 13px; }
.callout.info { border-color: var(--border); background: var(--surface-2); }
.issues { margin: 0; padding-left: 16px; color: var(--critical); font-size: 12px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; font-size: 13px; margin: 10px 0 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
details.logic { padding: 12px 18px; }
.logic summary { cursor: pointer; font-size: 13px; color: var(--text-2); }
.logic summary b { font-weight: 500; }
.logic ol { margin: 12px 0 0; padding-left: 20px; color: var(--text-2); }
.logic li { margin-bottom: 6px; }
.steps li { margin-bottom: 6px; }

/* ============ Kopbalk: meldingen & account ============ */
.icon-btn { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm); border: 0; background: none; color: var(--text-2); cursor: pointer; transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .count { position: absolute; top: 2px; right: 1px; }
.bell-wrap, .user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; border-radius: var(--radius-sm); padding: 3px 8px 3px 3px; cursor: pointer; font: inherit; color: var(--text); transition: background .12s; }
.user-btn:hover { background: var(--surface-2); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border-strong); display: grid; place-items: center; font-weight: 500; font-size: 11.5px; }
.user-text { display: grid; text-align: left; line-height: 1.25; }
.user-text b { font-size: 13px; font-weight: 500; }
.user-text span { font-size: 11.5px; color: var(--muted); }
.menu { position: absolute; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 4px; min-width: 200px; z-index: 10; }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 4px; font: inherit; color: var(--text); cursor: pointer; }
.menu button:hover { background: var(--surface-2); }
.notif-menu { width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; padding: 0; }
.notif-head { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--brand-tint); }
.notif b { display: block; font-size: 13px; font-weight: 600; }
.notif-text { display: block; font-size: 12.5px; color: var(--text-2); white-space: pre-line; margin: 2px 0; }
.notif-icon { font-size: 15px; }

/* ============ Dialogen, meldingen, uitleg ============ */
dialog { border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text); padding: 20px; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-pop); }
dialog[open] { animation: none; }
dialog.wide { width: min(880px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .35); }
dialog.tour { width: min(460px, calc(100vw - 32px)); }
dialog.tour p { color: var(--text-2); line-height: 1.6; }
.tour-dots { display: none; }
.tour-dots span { flex: 1; max-width: 18px; height: 3px; border-radius: 2px; background: var(--border-strong); }
.tour-dots span.on { background: var(--brand-2); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--float-bg); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm); z-index: 30; max-width: calc(100vw - 32px); font-size: 13px; box-shadow: var(--shadow-pop); }
.tooltip { position: fixed; pointer-events: none; z-index: 20; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; font-size: 12px; box-shadow: var(--shadow-pop); }
.tooltip b { display: block; }
.help { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--border-strong); color: var(--muted); font-size: 10px; font-weight: 600; cursor: help; position: relative; text-transform: none; letter-spacing: 0; vertical-align: 1px; }
.help:hover, .help:focus { background: var(--brand); border-color: var(--brand); color: #fff; outline: none; }
.help:not(.static):hover::after, .help:not(.static):focus::after {
  content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); z-index: 30;
  width: max-content; max-width: 260px; white-space: normal; text-align: left; font-weight: 400; font-size: 12px; line-height: 1.45;
  background: var(--text); color: var(--bg); padding: 8px 10px; border-radius: var(--radius-sm); box-shadow: var(--shadow-pop);
}
.output { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; max-height: 50vh; overflow: auto; }
.output h3 { margin: 12px 0 4px; }
.logs { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--text-2); margin: 8px 0; }

/* ============ Snelzoeken (Ctrl+K) ============ */
dialog.jump { padding: 0; width: min(480px, calc(100vw - 32px)); margin-top: 10vh; overflow: hidden; }
.jump-input { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.jump-input svg { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.jump-input input { flex: 1; min-width: 0; height: 42px; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 15px; }
.jump-list { list-style: none; margin: 0; padding: 6px; max-height: min(420px, 55vh); overflow-y: auto; }
.jump-list a { display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.jump-list a svg { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--text-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.jump-list a .jump-group { margin-left: auto; font-size: 12px; color: var(--muted); }
.jump-list a.on { background: var(--surface-2); }
.jump-none { padding: 20px; text-align: center; color: var(--muted); }

/* ============ Lijniconen ============
   pointer-events: none zodat een klik op een icoon gewoon een klik op de knop is (e.target blijft de knop). */
.ic { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.ic-good { color: var(--good-ink); }
.ic-warn { color: var(--warning); }
.ic-bad { color: var(--critical); }
.kpi .value .ic { width: .72em; height: .72em; vertical-align: -.04em; stroke-width: 2; color: var(--text-2); }
.notif-icon .ic { width: 18px; height: 18px; vertical-align: -3px; color: var(--text-2); }
.notif-icon .ic-bad { color: var(--critical); }
.notif-icon .ic-warn { color: var(--warning); }
.tl-icon .ic { width: 15px; height: 15px; color: var(--text-2); }
.ai-fb button { display: inline-grid; place-items: center; min-width: 30px; min-height: 26px; color: var(--text-2); }

/* ============ Grafieken ============ */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); margin: 4px 0 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* ============ Onderdelen per pagina ============ */
.list { display: grid; gap: 12px; }
.auto { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.auto .title { font-weight: 500; font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.auto .desc { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.auto .facts { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.auto .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.health-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.health-row:first-child { border-top: 0; padding-top: 4px; }
.health-text span { color: var(--text-2); }
.settings-group { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; padding: 0 18px; background: var(--surface); }
.settings-group summary { cursor: pointer; padding: 14px 0; font-weight: 500; }
.settings-group[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 4px 24px; }
.matrix th.role { text-align: center; min-width: 110px; vertical-align: bottom; font-size: 12.5px; color: var(--text); }
.matrix th.role .small { display: block; font-weight: 400; }
.matrix td.cell { text-align: center; }
.matrix tr.group td { background: var(--surface-2); font-weight: 500; font-size: 12px; color: var(--text-2); padding-top: 7px; padding-bottom: 7px; }
.matrix .role-actions { display: flex; gap: 6px; justify-content: center; margin-top: 4px; }
.selection-bar { position: sticky; bottom: 12px; z-index: 4; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0 16px; padding: 8px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-pop); }

/* ============ Tablet & telefoon ============ */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 19; }
@media (max-width: 1023px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; z-index: 20; transform: translateX(-100%); transition: transform .2s var(--ease); box-shadow: var(--shadow-pop); }
  .sidebar.open { transform: none; }
  .topbar .menu-toggle { display: grid; margin-left: -8px; }
  .topbar .topbar-logo { display: block; height: 24px; filter: var(--logo-filter); }
  .topbar { padding: 0 20px; }
  .crumbs { display: none; }
  .jump-btn { width: 36px; padding: 0; justify-content: center; border-color: transparent; background: none; }
  .jump-btn span, .jump-btn kbd { display: none; }
  main { padding: 20px 20px 40px; }
}
@media (pointer: coarse) {
  .btn:not(.sm) { min-height: 38px; }
  .tabs a { min-height: 42px; }
  .nav-title { min-height: 36px; }
  .icon-btn { width: 44px; height: 44px; }
  .chips .chip { min-height: 44px; }
}
@media (max-width: 640px) {
  :root { --topbar-h: 56px; }
  .topbar { padding: 0 12px 0 16px; gap: 8px; }
  .topbar-actions { gap: 2px; }
  .jump-btn { margin-left: auto; }
  .user-text { display: none; }
  .user-btn { padding: 3px; }
  main { padding: 16px 16px 40px; }
  h1 { font-size: 24px; }
  .section-head { margin-bottom: 16px; align-items: flex-start; }
  .section-head .meta { width: 100%; }
  .section-head .meta > span { flex-basis: 100%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
  .kpi { padding: 12px 14px; }
  .kpi .value { font-size: 24px; margin-top: 4px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .toolbar input[type=search] { min-width: 0; width: 100%; }
  .toolbar-right { width: 100%; }
  .toolbar-right .select { width: 100%; }
  .auto { grid-template-columns: 1fr; }
  .auto .actions { justify-content: flex-start; }
  .row-actions { flex-wrap: wrap; }
  .callout .row-actions { justify-content: flex-start; }
  .grid2 { grid-template-columns: 1fr; }
  .health-row { grid-template-columns: 1fr auto; }
  .health-row .badge { grid-column: 1 / -1; justify-self: start; }
  .selection-bar { bottom: 8px; }
  .table-wrap td { white-space: nowrap; }
}
@media (display-mode: standalone) {
  :root { --topbar-h: calc(56px + env(safe-area-inset-top)); }
  .topbar { padding-top: env(safe-area-inset-top); }
  .sidebar { padding-top: max(18px, env(safe-area-inset-top)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Onderlinge orders */
.ic-matrix th, .ic-matrix td { text-align: center; }
.ic-matrix tr > th:first-child { text-align: left; }
.ic-self { color: var(--muted); }
button.ic-cell { width: 100%; min-width: 130px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: transparent; color: inherit; font: inherit; cursor: pointer; line-height: 1.35; }
button.ic-cell.good { background: color-mix(in srgb, var(--good) 10%, transparent); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
button.ic-cell.warn { background: color-mix(in srgb, var(--warning) 14%, transparent); border-color: color-mix(in srgb, var(--warning) 50%, transparent); }
button.ic-cell.active { outline: 2px solid var(--text); outline-offset: 1px; }

/* Filter op artikeleigenschappen */
.props-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: -4px 0 12px; font-size: 13px; color: var(--text-2); }
.props-label { font-weight: 600; color: var(--text); margin-right: 2px; }
.prop-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.prop-check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }

/* Verzenden */
.scan-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 14px; }
.scan-bar svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--text-2); stroke-width: 2; }
.scan-bar input { flex: 1; min-width: 0; height: 40px; font-size: 16px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 0 12px; background: var(--surface); color: var(--text); }
.scan-bar input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.ship-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; }
.ship-grid .field { margin-bottom: 10px; }
.piece-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.piece-row .select { min-width: 170px; }
.piece-row .qty-input { width: 80px; }
.piece-row .qty-input.wide { width: 140px; }
@media (max-width: 640px) { .ship-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ship-grid .field { grid-column: span 2 !important; } }

/* Kleurenschema-kiezer */
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 12px; }
.palette-card { text-align: left; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 10px; cursor: pointer; font: inherit; color: var(--text); }
.palette-card.active { border-color: var(--accent); }
.palette-card .mini { display: grid; grid-template-columns: 34% 1fr; height: 84px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); margin-bottom: 8px; }
.palette-card .mini > div { padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.palette-card .mini i { display: block; height: 6px; border-radius: 3px; }
.palette-card b { display: block; font-size: 13.5px; }
.palette-card span { font-size: 12px; color: var(--text-2); }

/* Klanten (CRM) */
.crm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; align-items: start; }
.contact-item { padding: 12px 0; border-top: 1px solid var(--border); }
.contact-item:first-of-type { margin-top: 10px; }
.tl-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); }
.tl-icon { width: 26px; height: 26px; flex: none; border-radius: 3px; display: grid; place-items: center; background: var(--surface-2); font-size: 14px; }
.tl-text { white-space: pre-wrap; margin-top: 2px; }
.note-form textarea { min-height: 70px; }
@media (max-width: 1023px) { .crm-grid { grid-template-columns: 1fr; } }

/* Klanten: filters, sorteerbare kolommen, grafieken */
.filter-bar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-row input[type=search] { flex: 1; min-width: 220px; height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--text); }
.pos { color: var(--good-ink); font-weight: 500; }
td.neg, span.neg { font-weight: 600; }
.group-bars { display: grid; gap: 6px; margin-top: 12px; }
.group-bar { display: grid; grid-template-columns: minmax(120px, 200px) 1fr minmax(150px, auto); gap: 12px; align-items: center; padding: 6px 8px; border: 1px solid transparent; border-radius: 8px; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.group-bar:hover { background: var(--surface-2); }
.group-bar.active { border-color: var(--accent); background: var(--brand-tint); }
.gb-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-track { position: relative; height: 18px; }
.gb-cur, .gb-prev { position: absolute; left: 0; border-radius: 3px; }
.gb-cur { top: 0; height: 11px; background: var(--accent); }
.gb-prev { top: 12px; height: 5px; background: var(--axis); }
.gb-val { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.legend-dot.cur { background: var(--accent); }
.legend-dot.prev { background: var(--axis); }
.month-chart { width: 100%; height: auto; margin-top: 10px; }
.month-chart .cur { fill: var(--accent); }
.month-chart .prev { fill: var(--axis); }
.month-chart .axis { stroke: var(--border-strong); }
.month-chart text { fill: var(--muted); font-size: 12px; }
@media (max-width: 640px) { .group-bar { grid-template-columns: 1fr; gap: 4px; } .gb-val { text-align: left; } }
.crm-grid.sales-row { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
@media (max-width: 1279px) { .crm-grid, .crm-grid.sales-row { grid-template-columns: 1fr; } }

/* Klanten: filterbalk en kolomkoppen blijven in beeld tijdens scrollen */
#cust-list-view .filter-bar { position: sticky; top: var(--topbar-h); z-index: 4; background: var(--bg); padding: 10px 0; margin: -10px 0 4px; }
@media (min-width: 1024px) {
  /* clip i.p.v. hidden/auto: knipt wel af, maar maakt geen eigen scrollvak, zodat sticky t.o.v. het scherm werkt */
  #cust-list-view .card.flush, #cust-list-view .table-wrap { overflow: clip; }
  #cust-table th { position: sticky; top: calc(var(--topbar-h) + var(--cust-filter-h, 110px)); z-index: 3; background: var(--surface); box-shadow: inset 0 -1px 0 var(--border); }
}

/* Assistent rechtsonder */
.ai-fab { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 400; cursor: pointer; }
.ai-fab svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ai-fab:hover { background: var(--surface-2); color: var(--text); }
.ai-fab.open { background: var(--surface-2); color: var(--text); }
.ai-panel { position: fixed; right: 16px; top: calc(var(--topbar-h) + 8px); bottom: 16px; z-index: 16; width: min(420px, calc(100vw - 32px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 6px; box-shadow: var(--shadow-pop); overflow: hidden; }
.ai-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--border); }
.ai-head-actions { display: flex; gap: 2px; }
.ai-msgs { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.ai-msg { max-width: 92%; padding: 8px 10px; border-radius: var(--radius); font-size: 13.5px; line-height: 1.5; }
.ai-msg p { margin: 0 0 6px; }
.ai-msg p:last-child { margin-bottom: 0; }
.ai-msg ul, .ai-msg ol { margin: 4px 0 6px; padding-left: 20px; }
.ai-msg li { margin: 2px 0; }
.ai-msg table { font-size: 12.5px; margin: 6px 0; }
.ai-msg.user { align-self: flex-end; background: var(--surface-2); color: var(--text); white-space: pre-wrap; }
.ai-msg.bot { align-self: flex-start; background: none; border: 1px solid var(--border); color: var(--text); }
.ai-msg.bot.error { border: 1px solid var(--critical); }
.ai-h { font-weight: 700; margin-top: 6px !important; }
.ai-steps { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.ai-empty p { color: var(--text-2); margin: 4px 0 12px; }
.ai-sugs { display: flex; flex-direction: column; gap: 8px; }
.ai-sug { text-align: left; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.ai-sug:hover { background: var(--surface-2); }
.ai-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--border); }
.ai-form textarea { flex: 1; resize: none; min-height: 40px; max-height: 140px; padding: 9px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; line-height: 1.4; }
.ai-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.ai-foot { margin: 0; padding: 0 12px 10px; font-size: 11.5px; color: var(--muted); }
.ai-dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.ai-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: ai-dot 1s infinite ease-in-out; }
.ai-dots i:nth-child(2) { animation-delay: .15s; }
.ai-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ai-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ai-dots i { animation: none; opacity: .6; } }
@media (max-width: 640px) {
  .ai-panel { inset: 0; width: auto; height: auto; border-radius: 0; border: 0; }
}

/* ============ Cockpit ============ */
.ck-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.ck-grid > .card { margin-bottom: 0; }
.ck-card.wide { grid-column: 1 / -1; }
.ck-card { padding: 0; }
.ck-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 6px 14px; border-bottom: 1px solid var(--border); }
.ck-body { padding: 12px 14px 14px; }
.ck-head h2 { margin: 0; font-size: 14px; }
.ck-head a { text-decoration: none; white-space: nowrap; }
.ck-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 20px; }
.ck-stat b { display: block; font-size: 22px; line-height: 1.2; font-weight: 500; color: var(--heading); }
.ck-stat span { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.ck-stat.pos b { color: var(--good-ink); }
.ck-stat.neg b { color: var(--critical); }
.ck-empty { color: var(--muted); font-size: 13px; padding: 8px 0; }
.ck-chart { margin-top: 16px; }
.ck-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.ck-chart svg text { font-size: 11px; fill: var(--muted); }
.ck-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.ck-legend .sw { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.ck-legend .sw.cur { background: var(--series-1); height: 4px; }
.ck-legend .sw.goal { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px); }
.ck-legend .sw.prev { background: var(--axis); }
.ck-legend .sw.prev2 { background: var(--series-forecast); height: 8px; width: 10px; }
.ck-foot { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ck-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.ck-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.ck-list li a { font-weight: 500; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-list li .small { text-align: right; flex: none; max-width: 55%; }
.ck-ask { display: flex; gap: 8px; }
.ck-ask input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; }
.ck-ask input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.ck-ask .btn { height: 40px; }
.ck-sugs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ck-edit-list { list-style: none; margin: 0 0 12px; padding: 0; }
.ck-edit-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.ck-edit-list label { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; cursor: pointer; }
.ck-edit-list input { width: 16px; height: 16px; accent-color: var(--accent); align-self: center; }
.ck-move { display: flex; flex: none; }
@media (max-width: 860px) { .ck-grid { grid-template-columns: minmax(0, 1fr); } }

/* ============ Onderbalk op de telefoon ============ */
.bottom-nav { display: none; }
@media (max-width: 640px) {
  .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 14; display: flex;
    background: var(--surface); 
    border-top: 1px solid var(--border); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px;
    border: 0; background: none; color: var(--text-2); font: inherit; font-size: 11px; font-weight: 500; text-decoration: none; cursor: pointer; border-radius: 8px;
  }
  .bottom-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .bottom-nav a.active { color: var(--accent); font-weight: 500; }
  .bottom-nav span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .ai-fab { display: none; }
  .selection-bar { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .ck-stat b { font-size: 22px; }
  .ck-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ck-card .ck-head { margin-bottom: 10px; }
  .ai-panel { z-index: 30; padding-top: env(safe-area-inset-top); }
}

/* Klanten op de telefoon: compacte lijst met vaste kolomkoppen (klant · dit jaar · verschil) */
.cust-mlist { display: none; }
@media (max-width: 640px) {
  #cust-list-view .filter-bar { position: static; margin: 0 0 12px; padding: 0; }
  #cust-list-view .card.flush { overflow: clip; }
  #cust-table .table-wrap { display: none; }
  .cust-mlist { display: block; }
  .cust-mhead, .cust-mrow { display: grid; grid-template-columns: minmax(0, 1fr) 92px 64px; gap: 8px; align-items: start; padding: 10px 12px; }
  .cust-mhead { position: sticky; top: var(--topbar-h); z-index: 3; background: var(--surface-2); border-bottom: 1px solid var(--border); padding-top: 8px; padding-bottom: 8px; }
  .cust-mhead button { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; font-weight: 600; color: var(--text-2); text-align: left; cursor: pointer; }
  .cust-mhead button:not(:first-child) { text-align: right; }
  .cust-mhead button.on { color: var(--text); }
  .cust-mrow { border-top: 1px solid var(--border); cursor: pointer; }
  .cust-mrow:first-of-type { border-top: 0; }
  .cust-mrow .cm-name b { overflow-wrap: anywhere; }
  .cust-mrow .small { margin-top: 2px; line-height: 1.35; }
  .cm-num { text-align: right; white-space: nowrap; font-size: 13.5px; }
}

/* Nieuw product: kopjes in het formulier */
.pf-sec { grid-column: 1 / -1; margin: 6px 0 2px; font-size: 13px; font-weight: 600; color: var(--text); }
.pf-sec .small { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }

/* ============ Omzet doorklikken ============ */
.drill-link { all: unset; cursor: pointer; border-bottom: 1px dashed currentColor; border-bottom-color: color-mix(in srgb, currentColor 45%, transparent); }
.drill-link:hover, .drill-link:focus-visible { color: var(--link); border-bottom-style: solid; outline: none; }
.drill-crumbs { font-size: 13px; color: var(--text-2); margin-bottom: 8px; padding-right: 28px; }
.drill-crumbs a { text-decoration: none; }
.drill-total { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.drill-total > span:first-child { font-size: 22px; font-weight: 500; color: var(--heading); }
.drill-how { font-size: 13px; color: var(--text-2); margin: 4px 0 12px; }
.drill-how summary { cursor: pointer; color: var(--link); }
.drill-how ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.5; }
.drill-tabs { margin-bottom: 10px; flex-wrap: wrap; }
.drill-table td { vertical-align: top; }
.drill-bar { height: 4px; background: var(--surface-2); border-radius: 2px; margin-top: 6px; max-width: 320px; }
.drill-bar i { display: block; height: 100%; border-radius: 2px; background: var(--series-1); }
.drill-bar i.neg { background: var(--critical); }
.drill-lines > td { background: var(--surface-2); }
.drill-lines table { width: 100%; }
.muted-row td { color: var(--muted); }

/* ============ Deze maand en week (cockpit) ============ */
.sch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; }
.sch-val { font-size: 22px; font-weight: 500; color: var(--heading); margin: 2px 0 6px; }
.sch-bar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-2); margin-bottom: 6px; }
.sch-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.sch-bar i.ok { background: var(--good); }
.sch-bar i.behind { background: var(--warning); }
.sch-bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); transform: translateX(-1px); }
.sch-weeks { display: flex; gap: 8px; margin-top: 18px; align-items: flex-end; }
.sch-week { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; border: 1px solid transparent; border-radius: 8px; background: none; color: inherit; font: inherit; cursor: pointer; }
.sch-week:hover { background: var(--surface-2); }
.sch-week.current { border-color: var(--border-strong); }
.sch-col { position: relative; width: 70%; max-width: 40px; height: 72px; background: var(--surface-2); border-radius: 1px; overflow: visible; }
.sch-col i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 1px; background: var(--series-1); }
.sch-week.ok .sch-col i { background: var(--good); }
.sch-week.behind .sch-col i { background: var(--warning); }
.sch-week.future .sch-col i { background: var(--axis); }
.sch-col b { position: absolute; left: -4px; right: -4px; height: 2px; background: var(--text); }
.sch-amt { font-size: 12px; font-weight: 500; }
@media (max-width: 640px) { .sch-grid { grid-template-columns: 1fr; } .sch-val { font-size: 22px; } .sch-col { height: 70px; } }

/* Bellen en mailen vanuit de klantkaart */
.contact-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.call-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 10px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--good) 12%, transparent); border: 1px solid color-mix(in srgb, var(--good) 35%, transparent); }
.call-bar .btn { margin-left: auto; }
.call-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--good); animation: callpulse 1.2s ease-in-out infinite; }
@keyframes callpulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .call-dot { animation: none; } }

/* Taken */
.tasks-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.task-list { display: flex; flex-direction: column; }
.task-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--border); }
.task-item:first-child { border-top: 0; }
.task-item input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--good); flex: none; cursor: pointer; }
.task-item.done b { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.task-form { margin: 4px 0 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.task-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; }
.task-grid .field { margin-bottom: 10px; }
.task-quick { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.task-quick .chip { font-size: 12px; padding: 2px 8px; }

/* Orderstatus: mail opstellen */
.osm-preview { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; background: var(--surface-2); margin-top: 6px; }
.osm-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.osm-mail { background: #fff; color: #222; border-radius: 6px; padding: 12px 14px; margin-top: 6px; max-height: 280px; overflow: auto; }

/* Voorbeeld track & trace-mail */
.mail-frame { width: 100%; height: 560px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #f4eff3; }
.auto-box .row-actions .btn { text-decoration: none; }

/* Service */
.tag.ldk { background: #e7f0ff; color: #1d4ed8; border-color: #c9dbff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.ldk { background: #1e2a44; color: #9cc0ff; border-color: #2c3d62; } }
.dot-new { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--critical); vertical-align: middle; }
tr.unread td { font-weight: 600; }
.svc-desc { max-width: 280px; }
.svc-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.svc-status { display: grid; gap: 4px; min-width: 220px; }
.svc-grid .field { margin-bottom: 10px; }
.svc-grid textarea { width: 100%; }
.svc-mail { white-space: normal; background: var(--surface-2); border-radius: 6px; padding: 8px 10px; margin: 6px 0; max-height: 240px; overflow: auto; }
.svc-timeline .tl-item { padding: 8px 0; border-top: 1px solid var(--border); }

.sl-steps li { margin-bottom: 8px; }
.sl-tpl { border-top: 1px solid var(--border); padding: 8px 0; }
.sl-tpl summary { cursor: pointer; }
#sl-exec input { width: 100%; }

/* Formuliervelden en knoppen volgen het lettertype van de pagina (alleen Fira Sans) */
:where(button, input, select, textarea) { font-family: inherit; }

/* Voorstellen artikelgegevens: voorgestelde waarde, nog niet in Exact */
.itd-val { border-bottom: 1px dashed var(--muted); color: var(--text-2); cursor: help; }
.itd-val.itd-goedgekeurd { color: var(--good-ink); border-bottom-style: solid; }
.itd-val.itd-afgewezen { color: var(--muted); text-decoration: line-through; border-bottom: 0; }
.itd-val.itd-warn { border-bottom-color: var(--warning); }
