/* NXT Commerce · rustig, licht en zakelijk: grijze ondergrond, witte kaarten met een haarlijn,
   Inter, een fris blauw accent en ingetogen statuskleuren. Geen schaduwen op kaarten. */

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f5f5f5;
  --surface: #ffffff;
  --panel: #f5f5f5;
  --hover: #fafafa;
  --line: #e5e5e5;
  --line-2: #d4d4d4;
  --text: #6e6e6e;
  --heading: #171717;
  --ink-2: #404040;
  --faint: #a3a3a3;

  /* Fris blauw. De donkere variant is voor tekst en gevulde knoppen (contrast), de heldere voor lijnen. */
  --accent: #1f6fe5;
  --accent-hover: #1a5fc6;
  --accent-bright: #2a85ff;
  --accent-soft: #eaf2ff;

  --ok: #11804a;
  --ok-dot: #22b573;
  --ok-soft: #e7f6ee;
  --warn: #a35600;
  --warn-dot: #f59e0b;
  --warn-soft: #fff3e0;
  --bad: #cc3626;
  --bad-dot: #ef4444;
  --bad-soft: #feecea;

  --p-blauw: #d6e6ff;  --i-blauw: #173d7a;
  --p-groen: #cdeedd;  --i-groen: #14532d;
  --p-paars: #e7defd;  --i-paars: #3b1f7a;
  --p-oranje: #ffe4c7; --i-oranje: #7a3a06;
  --p-rood: #ffdcd7;   --i-rood: #7f1d1d;
  --p-grijs: #ececec;  --i-grijs: #404040;

  --radius: 16px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
  --t: 150ms var(--ease);
  --gutter: 16px;
  --sidebar: 260px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  font-feature-settings: 'cv11', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { margin: 0; color: var(--heading); font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; }
h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 15px; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
strong, .strong { color: var(--heading); font-weight: 700; }
address { font-style: normal; }
ul, ol { margin: 0; padding: 0; }
img, svg { display: block; }
.icon { width: 20px; height: 20px; flex: none; }
table { border-collapse: collapse; }

:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; border-radius: 8px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); transition: top var(--t); }
.skip:focus { top: 12px; }

.muted { color: var(--text); }
.small { font-size: 13px; }
.cell-sub { display: block; color: var(--text); font-size: 13px; font-weight: 500; margin-top: 2px; }
.text-fout { color: var(--bad) !important; }
.text-let-op { color: var(--warn) !important; }
.fineprint { font-size: 13px; color: var(--text); margin-top: 14px; }
.inline-form { display: inline; margin: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Schil: zijbalk, kopbalk, dok ---------- */

.shell { min-height: 100vh; }
.sidebar { display: none; }
.shell-main { min-width: 0; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--heading); flex: none; }
.brand:hover { color: var(--heading); }
.logo-mark { color: var(--accent); width: 30px; height: 30px; }
.brand-name { font-weight: 800; letter-spacing: -0.03em; font-size: 17px; white-space: nowrap; }

.side-section { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text); padding: 20px 12px 8px; }
.side-nav ul { list-style: none; display: grid; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 10px;
  color: var(--ink-2); font-weight: 500; transition: background var(--t), color var(--t);
}
.side-nav a .icon { color: var(--text); transition: color var(--t); }
.side-nav a:hover { background: var(--bg); color: var(--heading); }
.side-nav a:hover .icon { color: var(--heading); }
.side-nav a[aria-current='page'] { color: var(--accent); font-weight: 600; background: var(--accent-soft); }
.side-nav a[aria-current='page'] .icon { color: var(--accent); }

.side-shop {
  display: flex; align-items: center; gap: 12px; margin-top: auto; padding: 12px; border-radius: var(--radius-sm);
  background: var(--panel); color: var(--heading); transition: background var(--t);
}
.side-shop:hover { background: #eeeeee; color: var(--heading); }
.side-shop-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); flex: none; }
.side-shop-icon .icon { width: 18px; height: 18px; }
.side-shop-text { display: grid; min-width: 0; }
.side-shop-text strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-shop-text span { font-size: 12.5px; color: var(--accent); font-weight: 600; }
.side-shop-arrow { margin-left: auto; width: 16px; height: 16px; color: var(--faint); }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  height: 64px; padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-search { display: none; position: relative; flex: 1; max-width: 420px; }
.top-search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text); pointer-events: none; }
.top-search input { height: 40px; min-height: 40px; padding-left: 42px; background: var(--panel); border-color: var(--panel); }
.top-search input:hover { border-color: var(--line); }
.top-search input:focus { background: var(--surface); }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  color: var(--text); transition: background var(--t), color var(--t);
}
.icon-btn:hover, .icon-btn.is-active { color: var(--heading); background: var(--panel); }

.menu { position: relative; margin-left: 6px; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.avatar {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--p-blauw); color: var(--i-blauw); font-size: 13px; font-weight: 700;
  transition: box-shadow var(--t); flex: none;
}
.menu > summary.avatar:hover { box-shadow: 0 0 0 4px var(--accent-soft); }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: 272px; z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.18); padding: 6px;
  animation: pop 140ms var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.menu-who { display: flex; gap: 12px; align-items: center; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-who > div { display: grid; min-width: 0; }
.menu-who strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-who span { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-group + .menu-group { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.menu-group form { margin: 0; }
.menu-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text); padding: 8px 10px 4px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px;
  border: 0; background: none; color: var(--ink-2); font: inherit; font-weight: 500; cursor: pointer; text-align: left;
}
.menu-item .icon { width: 18px; height: 18px; color: var(--text); }
.menu-item:hover { background: var(--panel); color: var(--heading); }
.menu-item.is-current { color: var(--heading); font-weight: 600; }
.menu-check { margin-left: auto; color: var(--accent) !important; }

.dock {
  position: fixed; z-index: 45; left: 50%; transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom));
  width: min(calc(100% - 20px), 460px);
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.2);
}
.dock a {
  display: grid; justify-items: center; gap: 3px; padding: 7px 2px 6px; border-radius: 14px;
  color: var(--text); font-size: 10.5px; font-weight: 600; transition: color var(--t), background var(--t);
}
.dock a .icon { width: 22px; height: 22px; }
.dock a[aria-current='page'] { color: var(--accent); background: var(--accent-soft); }

.main { padding: 20px var(--gutter) calc(110px + env(safe-area-inset-bottom)); max-width: 1440px; }
.main-narrow { max-width: 900px; }

/* ---------- Bouwstenen ---------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-pad { padding: 20px 20px 0; }
.card-pad-x { padding: 0 20px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; min-height: 36px; }
.card-head > div > .muted { margin-top: 4px; }
.card-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; min-width: 0; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin: 4px 0 20px; }
.page-head-text { min-width: 0; flex: 1 1 360px; }
.page-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text); margin-bottom: 6px; }
.lede { color: var(--text); margin-top: 6px; max-width: 70ch; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; margin-bottom: 12px; }
.back .icon { width: 17px; height: 17px; }
.back:hover { color: var(--heading); }
.link-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-weight: 600; }
.link-more .icon { width: 16px; height: 16px; transition: transform var(--t); }
.link-more:hover .icon { transform: translateX(2px); }
.link-plain { color: var(--heading); }
.link-plain:hover { color: var(--accent); }

/* Knoppen */
.btn {
  --h: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--h); padding: 0 16px; border-radius: 12px;
  font: inherit; font-weight: 700; line-height: 1; white-space: nowrap; cursor: pointer;
  border: 1px solid transparent; background: none; color: var(--heading);
  transition: background var(--t), border-color var(--t), color var(--t), transform 80ms;
}
.btn .icon { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-quiet { background: var(--surface); border-color: var(--line-2); color: var(--ink-2); }
.btn-quiet:hover { border-color: #b5b5b5; color: var(--heading); background: var(--hover); }
.btn-text { padding: 0; min-height: 0; color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.btn-text:hover { color: var(--bad); }
.btn-sm { --h: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-lg { --h: 48px; font-size: 15px; padding: 0 22px; }
.btn-block { width: 100%; }
.btn[aria-busy='true'] { pointer-events: none; opacity: 0.75; }
.btn[aria-busy='true'] .icon { display: none; }
.btn .spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Status als bolletje met tekst */
.badge { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 600; color: var(--ink-2); }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.badge-goed { color: var(--ok); }
.badge-goed .dot { background: var(--ok-dot); }
.badge-let-op { color: var(--warn); }
.badge-let-op .dot { background: var(--warn-dot); }
.badge-fout { color: var(--bad); }
.badge-fout .dot { background: var(--bad-dot); }
.badge-accent { color: var(--accent); }
.badge-accent .dot { background: var(--accent-bright); }

.trend { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 8px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.trend-up { color: var(--ok); background: var(--ok-soft); }
.trend-down { color: var(--bad); background: var(--bad-soft); }
.trend-flat { color: var(--text); background: var(--panel); font-weight: 600; }

.icon-round { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none; }
.icon-round .icon { width: 20px; height: 20px; }
.icon-round-lg { width: 52px; height: 52px; }
.icon-round-lg .icon { width: 24px; height: 24px; }
.icon-blauw { background: var(--p-blauw); color: var(--i-blauw); }
.icon-groen { background: var(--p-groen); color: var(--i-groen); }
.icon-paars { background: var(--p-paars); color: var(--i-paars); }
.icon-oranje { background: var(--p-oranje); color: var(--i-oranje); }
.icon-rood { background: var(--p-rood); color: var(--i-rood); }
.icon-grijs { background: var(--p-grijs); color: var(--i-grijs); }

/* Meldingen */
.flash {
  display: flex; align-items: flex-start; gap: 12px; margin: 0 0 16px; padding: 12px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
}
.flash > .icon { margin-top: 1px; }
.flash p { flex: 1; }
.flash-goed { border-color: #bfe6d0; background: var(--ok-soft); }
.flash-goed > .icon { color: var(--ok); }
.flash-fout { border-color: #f5c6bf; background: var(--bad-soft); }
.flash-fout > .icon { color: var(--bad); }
.flash-info > .icon { color: var(--accent); }
.flash-close { border: 0; background: none; padding: 2px; margin: -2px -4px -2px 0; color: var(--text); cursor: pointer; border-radius: 8px; }
.flash-close:hover { color: var(--heading); }
.flash-close .icon { width: 18px; height: 18px; }
.flash.is-hiding { opacity: 0; transform: translateY(-4px); transition: opacity 200ms, transform 200ms; }

.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 20px; padding: 16px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.notice-text { flex: 1 1 320px; min-width: 0; }
.notice-title { color: var(--heading); font-weight: 700; }
.notice-text p + p { margin-top: 2px; }

.hint { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-size: 13px; margin: 0 0 16px; max-width: 90ch; }
.hint .icon { width: 17px; height: 17px; margin-top: 1px; color: var(--faint); }
.inline-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bad-soft); color: var(--bad); margin-bottom: 16px; font-weight: 600; }
.inline-alert .icon { width: 18px; height: 18px; margin-top: 1px; }

.empty { display: grid; justify-items: center; text-align: center; padding: 44px 20px; }
.empty .icon-round { margin-bottom: 14px; }
.empty-title { font-size: 18px; }
.empty-text { color: var(--text); max-width: 46ch; margin-top: 6px; }
.empty-action { margin-top: 18px; }

/* Tabbladen in een grijs paneel, het gekozen blad wit */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--radius-sm); background: var(--panel); max-width: 100%; }
.tabs a { padding: 7px 14px; border-radius: 9px; color: var(--text); font-weight: 600; white-space: nowrap; transition: background var(--t), color var(--t); }
.tabs a:hover { color: var(--heading); }
.tabs a[aria-current='page'] { background: var(--surface); color: var(--heading); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
.tabs-scroll { overflow-x: auto; scrollbar-width: none; }
.tabs-scroll::-webkit-scrollbar { display: none; }

.search { position: relative; flex: 1 1 240px; max-width: 360px; }
.search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text); pointer-events: none; }
.search input { padding-left: 40px; height: 40px; min-height: 40px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); }

/* ---------- Tabellen ---------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; }
.table th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text); padding: 12px 20px; white-space: nowrap; }
.table td { padding: 15px 20px; border-top: 1px solid var(--line); vertical-align: middle; color: var(--text); }
.table tfoot th, .table tfoot td { border-top: 1px solid var(--line-2); text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--heading); font-weight: 700; padding: 14px 20px; }
.table .num { text-align: right; }
.table-compact th { padding: 10px 12px; }
.table-compact td { padding: 13px 12px; }
.table-compact th:first-child, .table-compact td:first-child { padding-left: 0; }
.table-compact th:last-child, .table-compact td:last-child { padding-right: 0; }
.row-click { position: relative; transition: background var(--t); }
.row-click:hover { background: var(--hover); }
.row-link { color: var(--heading); }
.row-link::after { content: ''; position: absolute; inset: 0; }
.row-link:hover { color: var(--accent); }
.row-link:focus-visible { outline: none; }
.row-link:focus-visible::after { outline: 2px solid var(--accent-bright); outline-offset: -2px; border-radius: 8px; }

.ship-items { list-style: none; display: grid; gap: 2px; color: var(--ink-2); }
.qty { font-weight: 700; color: var(--accent); margin-right: 6px; font-variant-numeric: tabular-nums; }
.picklist { list-style: none; margin-top: 12px; }
.picklist li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.picklist li:first-child { border-top: 0; }
.qty-box { display: grid; place-items: center; min-width: 38px; height: 32px; padding: 0 8px; border-radius: 10px; background: var(--panel); color: var(--heading); font-weight: 700; font-variant-numeric: tabular-nums; }
.pick-title { display: grid; min-width: 0; }

/* ---------- Vandaag ---------- */

.status-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin: 4px 0 20px; }
.status-title { font-size: clamp(24px, 3.2vw, 30px); letter-spacing: -0.025em; }
.status-title::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 12px; vertical-align: 0.18em; }
.status-title.is-calm::before { background: var(--ok-dot); box-shadow: 0 0 0 5px var(--ok-soft); }
.status-title.is-attention::before { background: var(--warn-dot); box-shadow: 0 0 0 5px var(--warn-soft); }
.status-meta { margin-top: 8px; }

.card-tasks { margin-bottom: 16px; }
.tasks { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); }
.task { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: start; padding: 16px 0; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; padding-top: 0; }
.task:last-child { padding-bottom: 0; }
.task-body h3 { margin-top: 1px; }
.task-body p { margin-top: 3px; max-width: 70ch; }
.task-btn { grid-column: 1 / -1; justify-self: stretch; margin-top: 8px; }

.calm { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.calm h2 { font-size: 18px; }
.calm p { margin-top: 2px; }

.dash { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.dash-main, .dash-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }

.period-form { display: flex; gap: 8px; align-items: center; }
.select-soft { height: 40px; min-height: 40px; width: auto; background-color: var(--panel); border-color: var(--panel); font-weight: 600; color: var(--heading); }
.js .period-form [data-autosubmit-knop] { display: none; }

.kpis { display: grid; gap: 8px; padding: 8px; margin: 0; border-radius: var(--radius); background: var(--panel); }
.kpi {
  display: grid; gap: 4px; padding: 16px; border-radius: var(--radius); color: var(--text);
  border: 1px solid transparent; transition: background var(--t), box-shadow var(--t);
}
.kpis-static { grid-template-columns: repeat(2, minmax(0, 1fr)); background: none; padding: 0; gap: 10px; margin-bottom: 16px; }
.kpis-static .kpi { background: var(--surface); border-color: var(--line); padding: 18px 20px; }
@media (max-width: 639px) {
  .kpis-static .kpi { padding: 14px; }
  .kpis-static .kpi-value { font-size: 20px; }
  .kpis-static .icon-round { width: 32px; height: 32px; }
  .kpis-static .icon-round .icon { width: 17px; height: 17px; }
  .kpis-static .kpi-delta { font-size: 12.5px; }
}
a.kpi:hover { background: rgba(255, 255, 255, 0.6); color: var(--text); }
.kpi.is-selected { background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 6px 16px -6px rgba(0, 0, 0, 0.08); }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.kpi-label { font-weight: 600; padding-top: 2px; }
.kpi-value { margin: 0; color: var(--heading); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.kpi-delta { margin: 0; font-size: 13px; }
.kpi-delta strong { font-weight: 700; }
.kpi-delta strong.up { color: var(--ok); }
.kpi-delta strong.down { color: var(--bad); }

.chart-head { display: flex; justify-content: space-between; margin: 20px 0 4px; font-size: 13px; }
.chart-head strong { color: var(--heading); }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; overflow: visible; }
.chart-wide { display: none; }
.chart text { font-family: var(--font); fill: var(--text); font-weight: 500; }
.chart-y, .chart-x { font-size: 12px; }
.chart-narrow .chart-y, .chart-narrow .chart-x { font-size: 11px; }
.chart-hit { cursor: crosshair; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, calc(-100% - 12px));
  padding: 8px 10px; border-radius: 10px; background: var(--heading); color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.chart-empty { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); padding: 8px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 600; white-space: nowrap; }

.ring-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.big-number { color: var(--heading); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.big-number span { font-size: 15px; color: var(--text); font-weight: 600; letter-spacing: 0; }
.ring { width: 104px; height: 104px; flex: none; }
.ring-text { font-family: var(--font); font-size: 20px; font-weight: 700; fill: var(--heading); }
.meter { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--panel); }
.meter-top { display: flex; justify-content: space-between; margin-bottom: 8px; }
progress { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: 999px; background: #e3e3e3; overflow: hidden; }
progress::-webkit-progress-bar { background: #e3e3e3; border-radius: 999px; }
progress::-webkit-progress-value { background: var(--ok-dot); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--ok-dot); border-radius: 999px; }

.top-list { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); }
.top-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.top-list li:first-child { border-top: 0; padding-top: 0; }
.top-rank { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--panel); color: var(--heading); font-weight: 700; flex: none; }
.top-main { flex: 1; min-width: 0; }
.top-title { color: var(--heading); font-weight: 700; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; line-height: 1.35; }

.events { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); }
.event { display: grid; grid-template-columns: 12px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.event:first-child { border-top: 0; padding-top: 0; }
.event-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-top: 6px; }
.event-goed .event-dot { background: var(--ok-dot); }
.event-let-op .event-dot { background: var(--warn-dot); }
.event-fout .event-dot { background: var(--bad-dot); }
.event-text { color: var(--ink-2); }
.event-time { font-size: 12.5px; color: var(--text); }

/* ---------- Bestelling ---------- */

.address { line-height: 1.7; color: var(--ink-2); }
.address-mail { margin-top: 10px; overflow-wrap: anywhere; }
.facts { margin: 0; display: grid; }
.facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.facts > div:first-child { border-top: 0; padding-top: 0; }
.facts dt { color: var(--text); }
.facts dd { margin: 0; color: var(--heading); font-weight: 600; text-align: right; }

.option { display: flex; gap: 14px; align-items: center; }
.option-main { flex-wrap: wrap; padding: 16px; border-radius: var(--radius); background: var(--panel); }
.option-body { flex: 1 1 260px; min-width: 0; }
.option-body p { margin-top: 3px; }

.disclosure { margin-top: 12px; }
.disclosure > summary {
  display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; padding: 12px 16px;
  border-radius: var(--radius); border: 1px solid var(--line); color: var(--heading); font-weight: 600; transition: background var(--t);
}
.disclosure > summary:hover { background: var(--hover); }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary > .icon { margin-left: auto; width: 18px; height: 18px; color: var(--text); transition: transform var(--t); }
.disclosure > summary .icon-round { width: 32px; height: 32px; }
.disclosure > summary .icon-round .icon { width: 17px; height: 17px; }
details[open] > summary > .icon:last-child { transform: rotate(180deg); }
.disclosure > form { margin-top: 16px; }

.list { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); }
.list-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; padding-top: 0; }
.list-main { flex: 1 1 220px; min-width: 0; }
.list-end { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Voorraad: tabel als raster, zodat de bewerkregel eronder past ---------- */

.grid-head { display: none; }
.grid-list { list-style: none; }
.grid-row { padding: 16px 20px; border-top: 1px solid var(--line); transition: background var(--t); }
.grid-list .grid-row:first-child { border-top: 0; }
.grid-row:hover { background: var(--hover); }
.stock-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 16px; align-items: center; }
.g-product { grid-column: 1 / 3; min-width: 0; }
.g-status { justify-self: end; }
.g-num { display: grid; }
.g-num::before { content: attr(data-label); font-size: 12px; color: var(--text); font-weight: 600; }
.g-num span { color: var(--heading); font-weight: 600; font-variant-numeric: tabular-nums; }
.g-advice { grid-column: 1 / -1; }
.g-edit { grid-column: 1 / -1; }
.g-edit > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; color: var(--accent); }
.g-edit > summary::-webkit-details-marker { display: none; }
.g-edit > summary .muted { font-weight: 500; }
.g-edit > summary .icon { width: 16px; height: 16px; transition: transform var(--t); }
.inset { margin-top: 12px; padding: 16px; border-radius: var(--radius); background: var(--panel); }

/* ---------- Logboek ---------- */

.log-day + .log-day { border-top: 1px solid var(--line); }
.log-day-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text); padding: 16px 20px 4px; }
.log { list-style: none; }
.log-row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 20px; transition: background var(--t); }
.log-row:hover { background: var(--hover); }
.log-row .icon-round { width: 36px; height: 36px; }
.log-row .icon-round .icon { width: 18px; height: 18px; }
.log-main { min-width: 0; overflow-wrap: anywhere; }
.log-text { color: var(--ink-2); }
.log-rood .log-text { color: var(--bad); font-weight: 600; }
.log-time { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- Formulieren ---------- */

label { font-weight: 600; color: var(--ink-2); }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 14px;
  font: inherit; font-weight: 500; color: var(--heading);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
  -webkit-appearance: none; appearance: none;
}
input::placeholder { color: var(--faint); }
input:hover, select:hover { border-color: #b5b5b5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-bright); box-shadow: 0 0 0 3px rgba(42, 133, 255, 0.18); }
select {
  padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23404040' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 17px;
}
input[type='radio'], input[type='checkbox'] { width: auto; min-height: 0; padding: 0; -webkit-appearance: auto; appearance: auto; box-shadow: none; }
input[type='search']::-webkit-search-cancel-button { -webkit-appearance: none; }

.form-grid { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field-row { display: flex; gap: 8px; }
.field-row input { flex: 1; min-width: 0; }
.field-actions { display: flex; align-items: end; }
.help { font-size: 13px; color: var(--text); }
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text); pointer-events: none; }
.input-prefix input { padding-left: 32px; font-variant-numeric: tabular-nums; }
.form-foot { display: flex; justify-content: flex-end; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- Instellingen ---------- */

.settings { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-nav { display: flex; gap: 4px; padding: 6px; overflow-x: auto; scrollbar-width: none; }
.settings-nav::-webkit-scrollbar { display: none; }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.settings-nav a .icon { width: 18px; height: 18px; color: var(--text); }
.settings-nav a:hover { background: var(--panel); color: var(--heading); }
.settings-card .card-head { align-items: flex-start; margin-bottom: 20px; }

.steps { list-style: none; display: grid; }
.step { display: grid; grid-template-columns: 36px 1fr; gap: 16px; position: relative; padding-bottom: 28px; }
.step:last-child { padding-bottom: 0; }
.step:not(:last-child)::before { content: ''; position: absolute; left: 17.5px; top: 42px; bottom: 6px; width: 1px; background: var(--line); }
.step-num { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--p-blauw); color: var(--i-blauw); font-weight: 700; }
.step-body { min-width: 0; padding-top: 6px; }
.step-body > h3 { margin-bottom: 4px; }
.step-body > .muted { max-width: 64ch; }
.step-body .form-grid, .step-body .choice-group { margin-top: 12px; }
.step-body > .btn { margin-top: 16px; }
.step-body > .help { margin-top: 8px; }
.mini-steps { margin: 12px 0 0 18px; display: grid; gap: 6px; color: var(--ink-2); }
.mini-steps li::marker { color: var(--text); font-weight: 600; }

.choice-group { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px; cursor: pointer; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); transition: border-color var(--t), background var(--t); font-weight: 500; }
.choice:hover { border-color: #b5b5b5; }
.choice:has(input:checked) { border-color: var(--accent-bright); background: var(--accent-soft); }
.choice input { accent-color: var(--accent); margin: 2px 0 0; width: 17px; height: 17px; flex: none; }
.choice-body { display: grid; gap: 1px; }
.choice-body strong { font-size: 14px; }
.choice-body span { color: var(--text); font-size: 13px; }

.connected { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--ok-soft); }
.connected > div { flex: 1; min-width: 0; }
.connected-title { color: var(--heading); font-weight: 700; font-size: 15px; }
.unlink { margin-top: 18px; }

.switch-row { display: grid; gap: 18px; padding: 16px; border-radius: var(--radius); background: var(--panel); }
.switch { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 44px; height: 24px; border-radius: 999px; margin-top: 1px; background: #cfcfcf; transition: background var(--t); }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform var(--t); }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
.switch-text { display: grid; gap: 3px; }
.switch-text strong { font-size: 15px; }
.switch-text span { color: var(--text); max-width: 60ch; }
.field-price { max-width: 200px; }
.settings-form > .form-grid { margin-top: 18px; }
.is-off-dim { opacity: 0.55; }

/* ---------- Welkom en fout ---------- */

.bare-main { min-height: 100vh; min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 24px; padding: 40px var(--gutter) 56px; }
.bare-main > .flash { width: min(100%, 960px); margin: 0; }
.welcome { width: min(100%, 960px); padding: 0; display: grid; overflow: hidden; }
.welcome-text { padding: 32px 24px 28px; }
.welcome h1 { font-size: clamp(26px, 4vw, 32px); letter-spacing: -0.025em; }
.welcome .lede { margin-top: 12px; }
.welcome-points { list-style: none; display: grid; gap: 12px; margin: 24px 0; }
.welcome-points li { display: flex; gap: 12px; align-items: center; color: var(--text); }
.welcome .fineprint { text-align: center; }
.welcome-side { display: none; background: var(--panel); padding: 32px; border-left: 1px solid var(--line); }
.preview { display: grid; gap: 12px; align-content: center; height: 100%; }
.preview-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.preview-card .icon-round { margin-bottom: 10px; }
.preview-status { display: flex; align-items: center; gap: 12px; }
.preview-status .icon-round { margin: 0; }
.preview-title { color: var(--heading); font-weight: 700; }
.preview-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.preview-num { color: var(--heading); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; }
.preview-up { color: var(--ok); font-weight: 700; font-size: 13px; }
.preview-chart { width: 100%; height: auto; }
.dev-login { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line-2); display: grid; gap: 8px; }
.dev-login label { font-size: 13px; color: var(--text); }

.error-card { width: min(100%, 480px); padding: 36px 28px 28px; text-align: center; display: grid; justify-items: center; }
.main .error-card { margin: 40px auto 0; }
.error-card .icon-round { margin-bottom: 16px; }
.error-card .lede { margin: 8px auto 0; }
.error-actions { margin-top: 22px; }

/* ---------- Breder ---------- */

@media (min-width: 640px) {
  :root { --gutter: 24px; }
  .top-search { display: block; }
  .top-search-link { display: none; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .task { grid-template-columns: auto 1fr auto; align-items: center; }
  .task-btn { grid-column: auto; margin-top: 0; justify-self: end; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .field-actions { grid-column: 1 / -1; }
  .switch-row { grid-template-columns: 1fr auto; }
  .field-price { width: 170px; }
  .stock-row { grid-template-columns: repeat(4, 1fr); }
  .g-product { grid-column: 1 / 4; }
}

@media (min-width: 900px) {
  .chart-wide { display: block; }
  .chart-narrow { display: none; }
  .kpis-static { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .welcome { grid-template-columns: 1.1fr 1fr; }
  .welcome-text { padding: 44px 44px 36px; }
  .welcome-side { display: block; }
  .detail-grid { grid-template-columns: minmax(0, 1fr) 340px; }
  .settings { grid-template-columns: 240px minmax(0, 1fr); }
  .settings-nav { position: sticky; top: 84px; flex-direction: column; overflow: visible; }
}

@media (min-width: 1024px) {
  :root { --gutter: 32px; }
  .shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .sidebar {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
    padding: 0 16px 16px; background: var(--surface); border-right: 1px solid var(--line);
  }
  .sidebar .brand { height: 64px; padding: 0 8px; }
  .side-nav { margin-bottom: 16px; }
  .brand-top { display: none; }
  .dock { display: none; }
  .main { padding: 28px var(--gutter) 48px; }

  /* Tabellen in volle breedte: rijen als echte tabel */
  .table-orders td.c-items { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (min-width: 1200px) {
  .dash { grid-template-columns: minmax(0, 1fr) 360px; }
  .grid-head {
    display: grid; padding: 12px 20px; border-bottom: 1px solid var(--line);
    font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text);
  }
  .stock-row { grid-template-columns: minmax(0, 2.2fr) 150px 100px 90px 130px minmax(140px, 1fr); }
  .grid-head.stock-row { gap: 16px; }
  .g-product { grid-column: auto; }
  .g-status { justify-self: start; }
  .g-num { text-align: right; }
  .g-num::before { display: none; }
  .g-advice { grid-column: auto; display: grid; }
  .g-edit { grid-column: 1 / -1; margin-top: -2px; }
}

/* Telefoon en tablet: tabellen worden kaarten */
@media (max-width: 899px) {
  .table-orders thead, .table-ship thead, .table-sent thead { display: none; }
  .table-orders tr, .table-ship tr, .table-sent tr { display: grid; gap: 4px 12px; padding: 14px 20px; border-top: 1px solid var(--line); }
  .table-orders tbody tr:first-child, .table-ship tbody tr:first-child, .table-sent tbody tr:first-child { border-top: 0; }
  .table-orders td, .table-ship td, .table-sent td { padding: 0; border: 0; }
  .table-orders tr { grid-template-columns: 1fr auto; grid-template-areas: 'klant bedrag' 'items items' 'status datum' 'order order'; }
  .table-orders .c-klant { grid-area: klant; }
  .table-orders .c-bedrag { grid-area: bedrag; }
  .table-orders .c-items { grid-area: items; color: var(--ink-2); }
  .table-orders .c-status { grid-area: status; }
  .table-orders .c-datum { grid-area: datum; text-align: right; font-size: 13px; }
  .table-orders .c-datum .cell-sub { display: none; }
  .table-orders .c-order { grid-area: order; font-size: 12.5px; }
  .table-orders .c-order .row-link { color: var(--text); font-weight: 600; }
  .table-orders .c-klant .cell-sub { display: inline; margin-left: 6px; }
  .table-ship tr, .table-sent tr { grid-template-columns: 1fr auto; grid-template-areas: 'klant status' 'items items' 'actie actie'; }
  .table-ship .c-klant, .table-sent .c-klant { grid-area: klant; }
  .table-ship .c-status, .table-sent .c-status { grid-area: status; }
  .table-ship .c-items, .table-sent .c-items { grid-area: items; }
  .table-ship .c-actie, .table-sent .c-actie { grid-area: actie; text-align: left; }
  .table-ship .c-actie:empty, .table-sent .c-actie:empty { display: none; }
  .table-ship .c-actie .btn, .table-sent .c-actie .btn { margin-top: 6px; }
}

@media (prefers-reduced-motion: reduce) { .menu-panel { animation: none; } * { transition: none !important; } }

@media print {
  .sidebar, .topbar, .dock, .flash, .page-head-actions, .btn { display: none !important; }
  body { background: #fff; }
  .shell { display: block; }
}
