/* Cupstack klantportaal (2.209.0)
   Gebouwd op het Cupstack Design System (v2, hoofdstuk 1 t/m 18): woorden in Onest, cijfers in IBM Plex
   Mono, een zijbalk op een koel grijs canvas en een wit werkvlak. Alle kleuren
   staan als token in :root; in de componenten staat nergens een losse kleur.
   Dit bestand staat los van style.css (het interne systeem) en laadt het niet. */

/* ------------------------------------------------------------------ tokens */
:root {
  --font-sans: "Onest", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
  --text-ui: 0.8125rem;                 /* 13px */

  /* Canvas en vlakken */
  --background: #F3F3F3;
  --surface: #FFFFFF;
  --card: #FFFFFF;
  --popover: #FFFFFF;
  --foreground: #222222;                /* inkt, nooit #000 */

  /* Lijnen */
  --border: #DDDDDD;
  --input: #DDDDDD;
  --ring: var(--primary);

  /* Neutraal */
  --muted: #F3F3F3;
  --muted-foreground: #666666;
  --control-hover: color-mix(in oklab, var(--foreground) 8%, transparent);
  --control-pressed: color-mix(in oklab, var(--foreground) 14%, transparent);
  --row-hover: color-mix(in oklab, var(--foreground) 8%, var(--surface));

  /* Merk */
  --primary: #0065FB;
  --primary-foreground: #FFFFFF;
  --primary-text: #0051CC;
  --accent: #EBF2FF;
  --accent-foreground: #0051CC;
  --brand-helder: #4D94FF;
  --brand-soft: #99C2FF;

  /* Status */
  --destructive: #C45C3E;
  --destructive-text: #A8442E;
  --warning: #9A6B14;
  --success: #2F8F3C;
  --ready: #0065FB;

  /* Zijbalk */
  --sidebar: #EBEBEB;
  --sidebar-foreground: #222222;
  --sidebar-muted: #666666;
  --sidebar-accent: #E0E0E0;
  --sidebar-border: #DDDDDD;
  --sidebar-raised: #FFFFFF;

  --shadow-hairline: 0 1px 0 0 oklch(0.2 0.01 170 / 6%), 0 1px 3px 0 oklch(0.2 0.01 170 / 5%);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-glide: cubic-bezier(0.22, 1, 0.36, 1);
}

/* -------------------------------------------------------------------- basis */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  background: var(--sidebar);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--text-ui);
  line-height: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
input, textarea, time, td { font-variant-numeric: tabular-nums; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
b, strong { font-weight: 500; }
a { color: var(--primary-text); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: .6; }
.ic { flex: none; display: block; }
.muted, .help { color: var(--muted-foreground); font-size: 12px; line-height: 16px; }
p.help { margin-top: 6px; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
/* De vier hoverklassen krijgen dezelfde toetsenbordfocus: een ring van 2px. */
.card-hit:focus-visible, .icon-hit:focus-visible, .icon-hit-dark:focus-visible, .selectable-card:focus-visible,
.card-hit:focus-within:has(:focus-visible) { outline: none; box-shadow: 0 0 0 2px color-mix(in oklab, var(--ring) 50%, transparent); }

/* ------------------------------------------------------------------- schil */
.pt-app { display: flex; height: 100vh; overflow: hidden; background: var(--sidebar); }

.pt-side {
  width: 232px; flex: none; padding: 16px 12px 20px; display: flex; flex-direction: column;
  background: var(--sidebar); color: var(--sidebar-foreground);
  transition: width 150ms var(--ease);
}
.pt-side > * + * { margin-top: 20px; }

/* kop: 40px hoog in beide standen (zelfde hoogte als de ingeklapte items, dus niets verschuift bij in- of uitklappen);
   logo 22px hoog, de beker is dan 20px; de inklapknop is 32px en staat in lijn met de chevron van de bedrijfskaart */
.pt-brandrow { height: 40px; display: flex; align-items: center; justify-content: space-between; margin-top: 0 !important; margin-bottom: -8px; padding-left: 10px; }
.pt-brandrow .pt-collapse { width: 32px; height: 32px; margin-right: 2px; flex: none; }
.pt-brand { display: flex; align-items: center; gap: 8px; color: var(--sidebar-foreground);
            font-size: 16px; font-weight: 700; letter-spacing: -0.025em; min-width: 0; }
.pt-brand:hover { text-decoration: none; }
.pt-brand img { height: 22px; width: auto; display: block; }
/* zijbalk: beeldmerk in een wit tegeltje van 28px (zelfde kolom als de iconen eronder) + los woordmerk */
.pt-brandrow .pt-brand { gap: 10px; }
.pt-tile { width: 28px; height: 28px; flex: none; display: grid; place-items: center; background: var(--surface); border-radius: 8px; }
.pt-tile img { width: 18px; height: 18px; }
.pt-brandrow .pt-word { height: 18px; }
.pt-expand { display: none; }
/* 2. neutrale secundaire knoppen en iconen; -dark is voor iconen direct op de zijbalk */
.icon-hit, .icon-hit-dark { cursor: pointer; transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out); }
.icon-hit > svg, .icon-hit-dark > svg { pointer-events: none; }
.icon-hit:hover:not(:disabled) { background-color: var(--control-hover); color: var(--foreground); }
.icon-hit:active:not(:disabled) { background-color: var(--control-pressed); }
.icon-hit-dark:hover:not(:disabled) { background-color: var(--sidebar-accent); color: var(--sidebar-foreground); }
.icon-hit-dark:active:not(:disabled) { background-color: var(--control-pressed); }
.icon-hit:disabled, .icon-hit-dark:disabled { cursor: not-allowed; opacity: .3; }
.pt-iconbtn { width: 28px; height: 28px; display: grid; place-items: center; border: 0; background: none;
              color: var(--sidebar-muted); border-radius: 8px; padding: 0; }

/* kaartjes: wit met 1px rand */
/* 1. witte kaartjes op papier: het vlak blijft wit, alleen de rand licht op */
.card-hit { transition: border-color 150ms var(--ease-out), color 150ms var(--ease-out); }
.card-hit:hover, .card-hit[open] > summary, .card-hit[data-state="open"] { border-color: color-mix(in oklab, var(--primary) 40%, var(--sidebar-border)); color: var(--sidebar-foreground); }
.pt-cardbtn {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; color: inherit;
  background: var(--sidebar-raised); border: 1px solid var(--sidebar-border); border-radius: 10px;
}
.pt-cardbtn:hover { text-decoration: none; }

.pt-orgtxt { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.pt-orgtxt small { font-size: 12px; line-height: 16px; color: var(--sidebar-muted); }
.pt-orgtxt span { font-size: 13px; font-weight: 500; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-chev { color: var(--sidebar-muted); transition: transform 180ms var(--ease); }
details[open] > summary .pt-chev { transform: rotate(180deg); }

/* organisatiekiezer: alleen bij een concern met meerdere BV's */
.pt-org { position: relative; }
.pt-org > summary { height: 52px; padding: 8px 10px; list-style: none; }
.pt-org > summary::-webkit-details-marker { display: none; }
.pt-avatar {
  width: 36px; height: 36px; flex: none; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-foreground); font-size: 12px; font-weight: 600; letter-spacing: 0;
}
.pt-org .pt-pop { top: calc(100% + 4px); --pop-y: -2px; }

/* menu's (BV-keuze, account) */
.pt-pop {
  position: absolute; left: 0; right: 0; z-index: 30; padding: 4px; display: grid; gap: 2px;
  background: var(--popover); border: 1px solid var(--sidebar-border); border-radius: 10px;
  box-shadow: var(--shadow-hairline), 0 8px 24px -8px oklch(0.2 0.01 170 / 18%);
  animation: calm-popover-in 140ms var(--ease) both;
}
.pt-acct .pt-pop { bottom: calc(100% + 4px); --pop-y: 2px; }
@keyframes calm-popover-in { from { opacity: 0; transform: translate(var(--pop-x, 0), var(--pop-y, 0)); } to { opacity: 1; transform: none; } }
@keyframes calm-popover-out { to { opacity: 0; } }
.pt-pop a, .pt-pop .pt-pi {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px;
  color: var(--foreground); font-size: 13px; line-height: 18px;
}
.pt-pop a:hover { background: var(--control-hover); text-decoration: none; }
.pt-pop a.on { font-weight: 500; }
.pt-pop a .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-pop a .ic:last-child:not(:first-child) { color: var(--primary-text); }
.pt-pop .pt-sep { height: 1px; background: var(--border); margin: 2px 4px; }

/* zoeken */
.pt-search {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px;
  background: var(--sidebar-raised); border: 1px solid var(--sidebar-border); border-radius: 10px;
  color: var(--sidebar-muted);
}
.pt-search { cursor: pointer; }
.pt-search:focus-within { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.pt-search input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; padding: 0; outline: 0;
  font: inherit; color: var(--foreground); cursor: pointer;
}
.pt-search input::placeholder { color: var(--sidebar-muted); }
.pt-search input[type=search], .pt-search input[type=search]:hover, .pt-search input[type=search]:focus {
  width: auto; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; outline: 0;
}
kbd.num {
  font-size: 12px; line-height: 16px; border: 1px solid var(--sidebar-border); border-radius: 4px; padding: 0 4px;
  color: var(--sidebar-muted); background: transparent;
}

/* navigatie */
.pt-nav { display: flex; flex-direction: column; gap: 4px; }
.pt-nav a {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
  font-size: 13px; line-height: 18px; color: var(--sidebar-muted); transition: color 150ms;
}
.pt-nav a::before {
  content: ""; position: absolute; inset: 0; border-radius: 10px; background: var(--sidebar-accent);
  opacity: 0; transition: opacity 120ms ease-out; z-index: 0;
}
.pt-nav a > * { position: relative; z-index: 1; }
.pt-nav a:hover { color: var(--sidebar-foreground); text-decoration: none; }
.pt-nav a:hover::before { opacity: 1; }
.pt-nav a.on { color: var(--sidebar-foreground); }
.pt-nav a.on::before { opacity: 1; }
.pt-nav a.on .ic { color: var(--primary-text); }
.pt-nav .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cnt {
  font-family: var(--font-mono); font-size: 12px; line-height: 16px; min-width: 20px; text-align: center;
  padding: 1px 6px; border-radius: 999px; background: var(--sidebar-border); color: var(--sidebar-foreground);
}

/* account, onderaan */
.pt-acct { margin-top: auto !important; position: relative; }
.pt-acct > summary { height: 52px; padding: 0 12px 0 11px; list-style: none; }
.pt-acct > summary::-webkit-details-marker { display: none; }
.pt-person {
  width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-foreground); font-size: 12px; font-weight: 600;
}

/* ingeklapt (alleen op een breed scherm) */
@media (min-width: 769px) {
  html[data-nav="collapsed"] .pt-side { width: 60px; padding: 16px 8px 20px; }
  html[data-nav="collapsed"] .pt-orgtxt, html[data-nav="collapsed"] .pt-chev,
  html[data-nav="collapsed"] .pt-search input, html[data-nav="collapsed"] .pt-search kbd,
  html[data-nav="collapsed"] .pt-nav .lbl, html[data-nav="collapsed"] .pt-acct .pt-orgtxt { display: none; }
  html[data-nav="collapsed"] .pt-brandrow { justify-content: flex-start; padding-left: 0; }
  html[data-nav="collapsed"] .pt-brandrow .pt-brand, html[data-nav="collapsed"] .pt-brandrow .pt-collapse { display: none; }
  /* ingeklapt is het beeldmerk de uitklapknop: bij hover vervaagt het en verschijnt het paneel-icoon */
  html[data-nav="collapsed"] .pt-expand { display: grid; place-items: center; position: relative; width: 40px; height: 40px;
    border: 0; background: none; border-radius: 10px; padding: 0; color: var(--sidebar-foreground); cursor: pointer; }
  html[data-nav="collapsed"] .pt-expand:hover { background-color: var(--sidebar-accent); }
  .pt-expand::before { content: ""; position: absolute; width: 28px; height: 28px; border-radius: 8px; background: var(--surface); transition: background-color 150ms ease-out; }
  .pt-expand:hover::before, .pt-expand:focus-visible::before { background: transparent; }
  .pt-expand img { position: relative; width: 18px; height: 18px; transition: opacity 150ms ease-out; }
  .pt-expand .ic { position: absolute; opacity: 0; transition: opacity 150ms ease-out; }
  .pt-expand:hover img, .pt-expand:focus-visible img { opacity: 0; }
  .pt-expand:hover .ic, .pt-expand:focus-visible .ic { opacity: 1; }
  html[data-nav="collapsed"] .pt-org > summary,
  html[data-nav="collapsed"] .pt-acct > summary { width: 40px; height: 40px; padding: 0; justify-content: center; }
  html[data-nav="collapsed"] .pt-org .pt-avatar { width: 28px; height: 28px; }
  html[data-nav="collapsed"] .pt-search { width: 40px; height: 40px; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
  html[data-nav="collapsed"] .pt-nav a { width: 40px; height: 40px; padding: 0; justify-content: center; }
  html[data-nav="collapsed"] .pt-nav .cnt { position: absolute; top: 8px; right: 8px; min-width: 0; width: 6px; height: 6px;
                                           padding: 0; font-size: 0; background: var(--primary); }
  html[data-nav="collapsed"] .pt-pop { left: 0; right: auto; min-width: 200px; }
  html[data-nav="collapsed"] .pt-acct .pt-pop { left: 0; }
}

/* werkvlak: wit vel, 8px los van de rand */
.pt-sheet {
  position: relative; flex: 1; min-width: 0; margin: 8px 8px 8px 0; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 14px; overflow: hidden;
}
.pt-main { flex: 1; min-width: 0; overflow: auto; -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }
.pt-hd {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 8px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.pt-hd h1 { font-size: 15px; line-height: 20px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-hd h1 .sub { font-weight: 400; color: var(--muted-foreground); font-size: 13px; }
.pt-hd .acts { display: flex; align-items: center; gap: 8px; flex: none; }
.pt-body { padding: 24px; max-width: 1180px; display: grid; gap: 16px; align-content: start; }
.pt-body > * { min-width: 0; }
/* schermwissel (hoofdstuk 13): het nieuwe scherm bouwt blok voor blok op, 8px omhoog in 300ms.
   Met View Transitions (html.vt) wacht het eerst 160ms, zodat het oude scherm kan uitvaden. */
:root { --route-delay: 0ms; --route-step: 45ms; }
html.vt { --route-delay: 160ms; }
.pt-hd, .pt-body > * { animation: pt-rise 300ms var(--ease-glide) both; animation-delay: var(--route-delay); }
.pt-body > :nth-child(2) { animation-delay: calc(var(--route-delay) + var(--route-step)); }
.pt-body > :nth-child(3) { animation-delay: calc(var(--route-delay) + var(--route-step) * 2); }
.pt-body > :nth-child(n+4) { animation-delay: calc(var(--route-delay) + var(--route-step) * 3); }
@keyframes pt-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* bovenbalk en lade: alleen op een telefoon */
.pt-top { display: none; }
.pt-scrim { display: none; }

/* meekijken */
.pt-view {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 24px; font-size: 13px;
  background: color-mix(in oklab, var(--warning) 12%, var(--surface)); color: var(--warning);
  border-bottom: 1px solid color-mix(in oklab, var(--warning) 30%, var(--surface));
}
.pt-view .btn { margin-left: auto; }

/* meldingen (toasts): donkere pil, gecentreerd onderaan het werkvlak (hoofdstuk 14).
   .pt-sheet is het werkvlak zelf, dus midden is midden van het witte vel en niet van de zijbalk. */
.pt-toasts { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 20; display: grid; gap: 8px;
             justify-items: center; width: min(560px, calc(100% - 24px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  max-width: 100%; padding: 9px 10px 9px 16px; border-radius: 20px;
  background: var(--foreground); color: var(--surface); font-size: 13px; line-height: 18px;
  box-shadow: 0 25px 50px -12px oklch(0.2 0.01 170 / 35%);
  animation: toast-in 200ms var(--ease) both; transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.out { opacity: 0; transform: translateY(4px); }
.toast .ti { display: grid; place-items: center; color: var(--brand-helder); }
.toast.t-error .ti, .toast.t-warning .ti { color: color-mix(in oklab, var(--destructive) 65%, var(--surface)); }
.toast span.t { min-width: 0; }
.toast .tx {
  display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 999px; padding: 0;
  background: color-mix(in oklab, var(--surface) 15%, transparent); color: var(--surface);
  transition: background-color 150ms var(--ease-out);
}
.toast .tx:hover { background: color-mix(in oklab, var(--surface) 25%, transparent); }
.pt-bare .pt-toasts { position: static; transform: none; margin: 0 0 12px; width: min(420px, 100%); }

/* ----------------------------------------------------------------- onderdelen */
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 14px; }
.panel.flush { overflow: hidden; }
.panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px 0; }
.panel-h h2 { font-size: 13px; line-height: 18px; font-weight: 500; }
.panel-h .sub, h2 .sub { font-weight: 400; color: var(--muted-foreground); font-size: 12px; margin-left: 6px; }
.panel-b { padding: 12px 16px 16px; }
.panel.flush .panel-b { padding: 0; }
.panel-h + .panel-b.tight { padding-top: 8px; }
.panel.flush .panel-h { padding-bottom: 12px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-foreground); font-size: 13px; }
.back:hover { color: var(--foreground); text-decoration: none; }

/* knoppen: primair = pil, secundair = 10px */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 999px; background: var(--primary); color: var(--primary-foreground);
  font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap; transition: background-color 150ms ease-out, border-color 150ms ease-out;
}
.btn:hover { background: color-mix(in oklab, var(--primary) 88%, black); text-decoration: none; }
.btn:active { background: color-mix(in oklab, var(--primary) 78%, black); }
.btn-secondary { background: var(--surface); color: var(--foreground); border-color: var(--border); border-radius: 10px; }
.btn-secondary:hover { background: var(--control-hover); }
.btn-secondary:active { background: var(--control-pressed); }
.btn-sm { height: 28px; padding: 0 12px; }
.btn-block { width: 100%; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* velden: 1px rand, geen schaduw, focus als ring aan de binnenkant */
label { display: block; font-size: 12px; font-weight: 400; line-height: 16px; color: var(--muted-foreground); margin: 0 0 6px; }
.fg + .fg, .fg + .actions, .fg + .check, .check + .fg, .check + .actions, .help + .fg { margin-top: 16px; }
.fg > .help { margin-top: 6px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], input[type=number], select, textarea {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--input); border-radius: 10px; background: var(--surface);
  color: var(--foreground); font: inherit; transition: border-color 150ms var(--ease-out);
}
input::placeholder, textarea::placeholder { color: var(--muted-foreground); }
select { padding-right: 28px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='1.75' 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 9px center; }
textarea { height: auto; min-height: 96px; padding: 8px 10px; line-height: 18px; resize: vertical; }
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: color-mix(in oklab, var(--primary) 40%, transparent); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
input[type=file] { width: 100%; max-width: 360px; height: 34px; padding: 3px; border: 1px solid var(--input); border-radius: 10px; background: var(--surface); font: inherit; color: var(--muted-foreground); }
input[type=file]::file-selector-button { height: 26px; margin-right: 10px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--muted); color: var(--foreground); font: inherit; font-weight: 500; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: color-mix(in oklab, var(--foreground) 8%, var(--muted)); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 15px; height: 15px; margin: 0; flex: none; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.field select, .field input { color: var(--foreground); }
.field select, .field input { min-width: 160px; }
.filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 18px; color: var(--foreground); font-weight: 400; margin: 0; }
.check input { margin-top: 2px; }

/* tabs als pillen met teller */
.pt-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.pt-tabs a {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 999px;
  color: var(--muted-foreground); font-size: 13px; transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
.pt-tabs a:hover { color: var(--foreground); text-decoration: none; }
.pt-tabs a.on { background: var(--accent); color: var(--accent-foreground); font-weight: 500; }
.pt-tabs .cnt { background: color-mix(in oklab, var(--primary) 12%, var(--surface)); color: var(--accent-foreground); padding: 0 6px; }
.pt-tabs a:not(.on) .cnt { background: var(--muted); color: var(--muted-foreground); }

/* badges: pil, functionele kleuren */
.badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; white-space: nowrap;
  font-size: 12px; line-height: 1; font-weight: 400; background: var(--muted); color: var(--muted-foreground);
}
.badge.b-info { background: var(--accent); color: var(--accent-foreground); }
.badge.b-ok { background: color-mix(in oklab, var(--success) 12%, var(--surface)); color: var(--success); }
.badge.b-warn { background: color-mix(in oklab, var(--warning) 12%, var(--surface)); color: var(--warning); }
.badge.b-bad { background: color-mix(in oklab, var(--destructive) 12%, var(--surface)); color: var(--destructive-text); }

/* tabellen: in een afgeronde kaart, rijen lichten op */
.tbl-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
.tbl th {
  height: 40px; padding: 0 16px; text-align: left; font-size: 12px; font-weight: 400; color: var(--muted-foreground);
  white-space: nowrap; border-bottom: 1px solid var(--border);
}
.tbl td { padding: 11px 16px; vertical-align: top; border-top: 1px solid var(--border); }
.tbl td .num, .tbl td.num { white-space: nowrap; }
.tbl tr:first-child td { border-top: 0; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl tbody tr { transition: background-color 150ms ease-out; }
.tbl tbody tr:hover { background: var(--row-hover); }
.tbl tfoot td { background: var(--background); font-weight: 500; }
.tbl .cell-main { font-weight: 500; color: var(--foreground); }
.tbl a.cell-main { color: var(--foreground); }
.tbl a.cell-main:hover { color: var(--primary-text); }
.tbl .sub { display: block; color: var(--muted-foreground); font-size: 12px; line-height: 16px; }
.tbl .code { font-family: var(--font-mono); font-size: 12px; color: var(--muted-foreground); letter-spacing: -0.01em; }
.tbl .none { color: var(--muted-foreground); }
.tbl td.act { text-align: right; white-space: nowrap; width: 1%; }

/* label-en-waardelijst (order, melding, account) */
.kv { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; margin: 0; }
.kv dt, .kv dd { margin: 0; padding: 10px 16px; border-top: 1px solid var(--border); min-width: 0; overflow-wrap: anywhere; }
.kv dt { color: var(--muted-foreground); }
.kv dt:first-of-type, .kv dt:first-of-type + dd { border-top: 0; }

/* cijfers: vier tegels */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.stat { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; background: var(--card); }
.stat .l { color: var(--muted-foreground); font-size: 12px; line-height: 16px; }
.stat .v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; font-size: 16px; line-height: 24px; font-weight: 500; margin-top: 4px; }
.stat .v .pct { font-size: 12px; font-weight: 400; color: var(--muted-foreground); margin-left: 6px; }
.stat .d { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 12px; line-height: 16px; color: var(--muted-foreground); }

/* grafieken (svg_bars, kleuren uit de tokens via de opties) */
.chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart { display: block; height: auto; }
.chart text { font-family: var(--font-mono); fill: var(--muted-foreground); }
.chart line { stroke: var(--border); }
.chart line[stroke="#9ca3af"] { stroke: var(--muted-foreground); }
.chart rect[fill="#d1d5db"] { fill: var(--border); }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0 0; color: var(--muted-foreground); font-size: 12px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* soort melding: keuzekaarten (hoofdstuk 9, klasse 3). Het gekozen kaartje krijgt een rand in de merkkleur,
   een lichte tint en rechts een vinkje dat getekend wordt. De sneltoetsen 1 t/m 4 staan zichtbaar op het kaartje. */
.kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; margin: 6px 0 0; }
.selectable-card { cursor: pointer; border: 1px solid var(--border); border-radius: 10px;
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out); }
.selectable-card:hover { background-color: var(--control-hover); }
.selectable-card:has(input:checked), .selectable-card[aria-pressed="true"] { border-color: var(--primary); background: color-mix(in oklab, var(--primary) 8%, transparent); }
.kind {
  position: relative; display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 40px 10px 12px;
  font-size: 13px; line-height: 18px; font-weight: 400; color: var(--foreground);
}
.kind:has(input:focus-visible) { box-shadow: 0 0 0 2px color-mix(in oklab, var(--ring) 50%, transparent); }
.kind input { margin-top: 2px; }
.kind b { display: block; font-weight: 500; }
.kind .kk { position: absolute; top: 10px; right: 12px; }
.kind .kc { position: absolute; top: 10px; right: 12px; display: none; color: var(--primary); }
.kind:has(input:checked) .kk { display: none; }
.kind:has(input:checked) .kc { display: block; }
.need { display: none; }

/* gesprek */
.msg { border-left: 2px solid var(--border); padding: 0 0 0 12px; margin: 0 0 16px; }
.msg.them { border-left-color: var(--primary); }
.msg .who { color: var(--muted-foreground); font-size: 12px; line-height: 16px; margin-bottom: 4px; }
.files { display: flex; flex-wrap: wrap; gap: 12px; }
.files a { display: block; width: 140px; color: var(--muted-foreground); font-size: 12px; line-height: 16px; }
.files a:hover { text-decoration: none; color: var(--foreground); }
.files img { display: block; width: 100%; height: 104px; object-fit: cover; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; }
.files .doc { height: 104px; display: grid; place-items: center; background: var(--muted); border-radius: 10px; margin-bottom: 6px; color: var(--muted-foreground); }
.files span.fn { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* volg de rit */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; align-items: baseline; gap: 10px; padding: 8px 0 8px 14px; margin-left: 5px; border-left: 2px solid var(--border); color: var(--muted-foreground); }
.steps li .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); margin-left: -20px; flex: none; transform: translateY(1px); }
.steps li.done { color: var(--foreground); }
.steps li.done .dot { background: var(--primary); }
.steps li .help { margin-left: auto; }
details.hist summary { cursor: pointer; color: var(--muted-foreground); font-size: 12px; }

/* offerte (docparts.php levert de tabel) */
.portal-doc table.doc-lines { width: 100%; border-collapse: collapse; min-width: 480px; }
.portal-doc .doc-lines th { font-size: 12px; font-weight: 400; color: var(--muted-foreground); text-align: left; padding: 6px; border-bottom: 1px solid var(--border); }
.portal-doc .doc-lines td { padding: 5px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.portal-doc .doc-lines .num { text-align: right; white-space: nowrap; }
.portal-doc .doc-lines th.num { font-family: var(--font-sans); }
.portal-doc .doc-lines tr.art td { padding-top: 12px; border-bottom: 0; }
.portal-doc .doc-lines td.ind { padding-left: 18px; }
.portal-doc .doc-lines tr.info td, .portal-doc .mute { color: var(--muted-foreground); }
.portal-doc .doc-lines tfoot td { border-bottom: 0; padding: 3px 6px; }
.portal-doc .doc-lines tfoot tr:first-child td { padding-top: 12px; border-top: 1px solid var(--foreground); }
.portal-doc .doc-lines tfoot tr.grand td { font-weight: 500; border-top: 1px solid var(--border); padding-top: 8px; }
.portal-doc tr:hover td { background: transparent; }
.portal-doc .doc-note { margin-top: 16px; padding: 10px 12px; background: var(--accent); border-radius: 10px; }
.portal-doc .doc-terms { margin-top: 16px; font-size: 12px; color: var(--muted-foreground); }
.portal-doc .doc-terms h2 { font-size: 12px; font-weight: 500; margin: 0 0 6px; }
.portal-doc .doc-terms ul { margin: 0; padding-left: 18px; }
.portal-doc p.doc-terms { margin-bottom: 0; }
.portal-doc .doc-fine { margin-top: 10px; font-size: 12px; color: var(--muted-foreground); }
.portal-doc .doc-fine p { margin: 0 0 4px; }

/* zonder zijbalk: inloggen, uitnodiging, offerte, volg de rit */
.pt-bare { height: 100%; overflow: auto; display: flex; flex-direction: column; align-items: center; padding: 48px 16px 32px; }
.pt-bare .pt-brand { margin-bottom: 20px; }
.pt-bare .pt-brand img { height: 32px; }
.pt-bare-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 14px; padding: 28px; animation: pt-rise 300ms var(--ease) both; }
.pt-bare-card.wide { max-width: 720px; }
.pt-bare-card h1, .pt-bare-card h2 { font-size: 16px; line-height: 24px; font-weight: 600; }
.pt-bare-card h2 .sub, .pt-bare-card h1 .sub { font-size: 13px; font-weight: 400; color: var(--muted-foreground); margin-left: 6px; }
.pt-bare .pt-toasts { position: static; transform: none; margin: 0 0 12px; width: min(420px, 100%); }
.callout { padding: 10px 12px; border-radius: 10px; background: var(--accent); color: var(--accent-foreground); margin-top: 12px; }
.callout.warn { background: color-mix(in oklab, var(--warning) 12%, var(--surface)); color: var(--warning); }
.callout.bad { background: color-mix(in oklab, var(--destructive) 12%, var(--surface)); color: var(--destructive-text); }

/* --------------------------------------------------------------- telefoon */
@media (max-width: 768px) {
  .pt-app { flex-direction: column; height: 100dvh; }
  /* primaire duimactie 48px, secundaire 44px */
  .btn { height: 48px; }
  .btn-secondary, .btn-sm { height: 44px; }
  .pt-tabs a { height: 40px; }
  .pt-nav a { padding-top: 11px; padding-bottom: 11px; }
  .pt-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 52px; padding: 0 12px 0 8px; flex: none; }
  .pt-top .pt-iconbtn { width: 40px; height: 40px; }
  .pt-top .pt-brand { margin: 0; }
  .pt-top .who { color: var(--sidebar-muted); font-size: 12px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pt-side {
    position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: min(280px, 86vw); transform: translateX(-100%);
    transition: transform 240ms var(--ease); box-shadow: none; overflow-y: auto;
  }
  html.nav-open .pt-side { transform: none; box-shadow: 0 0 40px oklch(0.2 0.01 170 / 25%); }
  .pt-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: oklch(0.2 0.01 170 / 30%); opacity: 0; pointer-events: none; transition: opacity 240ms; }
  html.nav-open .pt-scrim { opacity: 1; pointer-events: auto; }
  .pt-brandrow .pt-collapse { display: none; }
  .pt-sheet { margin: 0; border-radius: 14px 14px 0 0; }
  .pt-hd { padding: 8px 16px; }
  .pt-body { padding: 16px; }
  .pt-view { padding: 8px 16px; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { padding-bottom: 0; border-top: 1px solid var(--border); font-size: 12px; line-height: 16px; }
  .kv dd { border-top: 0; padding-top: 2px; }
  .kv dt:first-of-type { border-top: 0; }
  .panel-h { padding: 12px 12px 0; }
  .panel-b { padding: 12px; }
  .pt-bare { padding-top: 28px; }
  .pt-bare-card { padding: 20px; }
}

/* tabellen vallen op een telefoon uiteen in regels: label, waarde */
@media (max-width: 720px) {
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack thead { display: none; }
  .tbl.stack tbody tr { padding: 12px 16px; border-top: 1px solid var(--border); }
  .tbl.stack tbody tr:first-child { border-top: 0; }
  .tbl.stack td { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 2px 0; border: 0; text-align: right; }
  .tbl.stack td::before { content: attr(data-l); color: var(--muted-foreground); font-family: var(--font-sans); font-size: 12px; letter-spacing: 0; text-align: left; flex: none; }
  .tbl.stack td:first-child { display: block; text-align: left; font-size: 14px; padding-bottom: 6px; }
  .tbl.stack td:first-child::before { content: none; }
  .tbl.stack td.act { width: 100%; text-align: left; padding-top: 8px; }
  .tbl.stack td.act::before { content: none; }
  .tbl.stack .sub { text-align: right; }
  .tbl.stack td:first-child .sub { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  html, body, .pt-app, .pt-sheet, .pt-main { height: auto; overflow: visible; }
  .pt-side, .pt-top, .pt-toasts, .pt-hd .acts { display: none; }
  .pt-sheet { margin: 0; border-radius: 0; }
}

/* velden met het label erboven (filters op het cijferscherm) */
label.field { margin: 0; font-weight: 400; font-size: 12px; color: var(--muted-foreground); }
.kv.plain dt, .kv.plain dd { padding-left: 0; padding-right: 0; }
.panel-b h2.card-title, .pt-bare-card h2.card-title { font-size: 16px; line-height: 24px; font-weight: 600; }
h2.card-title .sub { font-size: 13px; font-weight: 400; color: var(--muted-foreground); margin-left: 6px; }


/* ============================================================== v2 (hoofdstuk 9 t/m 18) */

/* alleen-lezen en berekende waarden: een grijs omkaderd vak, zelfde hoogte als het buurveld */
.ro { display: flex; align-items: center; min-height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: none; color: var(--foreground); }

/* lege staat: rustig icoon van 20px op 50% en één zin, geen illustratie */
.empty { display: grid; justify-items: center; gap: 8px; padding: 32px 16px; color: var(--muted-foreground); text-align: center; }
.empty .ic { opacity: .5; }
.empty p { margin: 0; max-width: 46ch; }

/* tooltips (hoofdstuk 11): nooit klikbaar, nooit in de weg */
.tip {
  position: fixed; z-index: 80; display: flex; align-items: center; gap: 8px; max-width: 280px; padding: 6px 12px;
  border-radius: 8px; background: var(--primary); color: var(--primary-foreground);
  font-size: 12px; line-height: 16px; pointer-events: none; user-select: none; -webkit-user-select: none;
  animation: calm-popover-in 140ms var(--ease) both;
}
.tip[data-side="bottom"] { --pop-y: -2px; --pop-x: 0; } .tip[data-side="top"] { --pop-y: 2px; --pop-x: 0; }
.tip[data-side="right"] { --pop-x: -2px; --pop-y: 0; }  .tip[data-side="left"] { --pop-x: 2px; --pop-y: 0; }
.tip[data-state="closed"] { animation: calm-popover-out 90ms ease-in both; }
.tip kbd { font-family: var(--font-mono); font-size: 12px; line-height: 16px; border: 1px solid color-mix(in oklab, var(--primary-foreground) 45%, transparent);
           border-radius: 4px; padding: 0 4px; color: inherit; }
.tip .tc { font-family: var(--font-mono); opacity: .8; }

/* zoekpalet (hoofdstuk 12) */
.pal[hidden] { display: none; }
.pal { position: fixed; inset: 0; z-index: 60; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; }
.pal-scrim { position: absolute; inset: 0; background: oklch(0.2 0.01 170 / 30%); animation: calm-fade 150ms var(--ease-out) both; }
.pal-win {
  position: relative; width: min(760px, 100%); max-height: min(580px, 78vh); display: flex; flex-direction: column; overflow: hidden;
  background: var(--popover); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-hairline), 0 24px 60px -12px oklch(0.2 0.01 170 / 30%); animation: calm-fade 150ms var(--ease-out) both;
}
.pal-top { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; color: var(--muted-foreground); flex: none; }
.pal-top input[type=text], .pal-top input[type=text]:hover, .pal-top input[type=text]:focus {
  flex: 1; width: auto; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; outline: 0;
  font-size: 14px; color: var(--foreground);
}
.pal-scopes { display: flex; gap: 6px; padding: 0 16px 12px; flex: none; flex-wrap: wrap; }
.pal-scopes button {
  height: 28px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--muted-foreground);
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
.pal-scopes button:hover { background: var(--control-hover); color: var(--foreground); }
.pal-scopes button[aria-pressed="true"] { background: var(--foreground); color: var(--surface); }
.pal-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; flex: 1; min-height: 0; border-top: 1px solid var(--border); }
.pal-body.nopv { grid-template-columns: minmax(0, 1fr); }
.pal-list { overflow-y: auto; padding: 8px; min-height: 120px; scroll-padding: 8px; }
.pal-h { padding: 10px 8px 4px; font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.pal-h:first-child { padding-top: 4px; }
.pal-row {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) 104px 132px; align-items: center; gap: 12px; height: 44px; padding: 0 8px;
  border-radius: 10px; cursor: pointer; color: var(--foreground); transition: background-color 150ms var(--ease-out);
}
.pal-row.simple { grid-template-columns: 28px minmax(0, 1fr) auto; }
.pal-row:hover, .pal-row[aria-selected="true"] { background: var(--control-hover); text-decoration: none; }
.pal-ic { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--muted); color: var(--muted-foreground); }
.pal-nm { min-width: 0; }
.pal-nm b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-nm .num { display: block; font-size: 12px; line-height: 16px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-nm .num span { font-family: var(--font-sans); letter-spacing: 0; }
.pal-am { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.pal-st { text-align: right; min-width: 0; overflow: hidden; }
.pal-row .cnt { background: var(--muted); }
.pal-prev { border-left: 1px solid var(--border); padding: 16px; overflow-y: auto; animation: none; }
.pal-prev .pv { animation: calm-fade 150ms var(--ease-out) both; display: grid; gap: 12px; align-content: start; }
.pal-prev .pv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pal-prev .pv-t { font-weight: 500; overflow-wrap: anywhere; }
.pal-prev .pv-n { color: var(--muted-foreground); font-size: 12px; line-height: 16px; margin-top: 2px; }
.pal-prev .pv-big { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; font-size: 16px; line-height: 24px; font-weight: 500; }
.pal-prev dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.pal-prev dt { color: var(--muted-foreground); font-size: 12px; line-height: 18px; }
.pal-prev dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.pal-empty { display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 160px; padding: 24px; color: var(--muted-foreground); text-align: center; }
.pal-empty .ic { opacity: .5; }
.pal-foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--border); color: var(--muted-foreground); font-size: 12px; line-height: 16px; flex: none; }
.pal-foot kbd.num, .kind kbd.num, .pal-row kbd.num { color: var(--muted-foreground); border-color: var(--border); }
.pal-foot kbd + kbd { margin-left: 4px; }
@media (max-width: 768px) {
  .pal { padding: 8px; }
  .pal-win { max-height: calc(100dvh - 16px); }
  .pal-body { grid-template-columns: minmax(0, 1fr); }
  .pal-prev { display: none; }
  .pal-row { grid-template-columns: 28px minmax(0, 1fr) auto; }
  .pal-row .pal-am { display: none; }
  .pal-foot { display: none; }
}

/* toetsenbord in lijsten: J en K lopen door de rijen, Enter opent */
.tbl tbody tr.kb { background: var(--row-hover); box-shadow: inset 2px 0 0 var(--primary); }

/* animaties uit het design system, bruikbaar voor wat nog komt */
@keyframes calm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes calm-rise { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
.calm-tab { animation: calm-fade 120ms var(--ease-out) both; }
.calm-unfold { animation: calm-rise 180ms var(--ease-out) both; }
.check-draw path, .check-draw polyline { stroke-dasharray: 24; animation: draw-check 360ms var(--ease-out) both; }
@keyframes draw-check { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
.grid-collapse { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 180ms var(--ease-out), opacity 180ms var(--ease-out); }
.grid-collapse > * { overflow: hidden; min-height: 0; }
.grid-collapse[data-open="true"] { grid-template-rows: 1fr; opacity: 1; }
@keyframes shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.shake { animation: shake 320ms var(--ease-out) both; }
@keyframes skeleton-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.skeleton { height: 44px; border-radius: 10px; background: var(--muted); animation: skeleton-pulse 1.4s ease-in-out infinite; }

/* schermwissel tussen pagina's (View Transitions, cross-document): de zijbalk staat vast, het oude werkvlak
   vaagt 100ms uit en het nieuwe bouwt zich op via de blokken hierboven. */
@view-transition { navigation: auto; }
.pt-side { view-transition-name: pt-side; }
.pt-main { view-transition-name: pt-work; }
::view-transition-group(pt-side), ::view-transition-group(pt-work),
::view-transition-old(root), ::view-transition-new(root), ::view-transition-new(pt-side), ::view-transition-new(pt-work) { animation: none; }
::view-transition-old(pt-side) { display: none; }
::view-transition-old(pt-work) { animation: vt-out 100ms cubic-bezier(0.4, 0, 1, 1) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-2px); } }
::view-transition, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { pointer-events: none !important; }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }

.pal[data-closing] .pal-win, .pal[data-closing] .pal-scrim { animation: calm-fade-out 90ms ease-in both; }
@keyframes calm-fade-out { to { opacity: 0; } }
.pal-body.nopv .pal-prev { display: none; }

/* zoekbare keuzelijst: ziet eruit als een veld, de lijst opent eronder met een zoekvak */
.cb { position: relative; }
.cb-btn {
  width: 100%; min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 9px 0 10px;
  border: 1px solid var(--input); border-radius: 10px; background: var(--surface); color: var(--foreground); font: inherit; text-align: left;
  transition: border-color 150ms var(--ease-out);
}
.cb-btn:hover, .cb-btn[aria-expanded="true"] { border-color: color-mix(in oklab, var(--primary) 40%, transparent); }
.cb-btn:focus-visible { outline: 0; border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.cb-btn .ic { color: var(--muted-foreground); }
.cb-v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-v.ph { color: var(--muted-foreground); }
.field .cb { min-width: 160px; }
.cb-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; padding: 4px; min-width: 220px;
  background: var(--popover); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-hairline), 0 8px 24px -8px oklch(0.2 0.01 170 / 18%); animation: calm-popover-in 140ms var(--ease) both; --pop-y: -2px;
}
.cb-pop[hidden] { display: none; }
.cb-pop input.cb-q, .cb-pop input.cb-q:hover, .cb-pop input.cb-q:focus { height: 32px; margin-bottom: 4px; box-shadow: none; border-color: var(--input); }
.cb-pop input.cb-q:focus { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.cb-list { max-height: 240px; overflow-y: auto; display: grid; gap: 2px; }
.cb-o { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.cb-o.hl, .cb-o:hover { background: var(--control-hover); }
.cb-o.on { font-weight: 500; }
.cb-o .ic { color: var(--primary-text); flex: none; }
.cb-none { padding: 10px; color: var(--muted-foreground); text-align: center; }

.pt-orgtxt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ====================================================================== 2.209.0: detailscherm en factuurviewer */

/* een hele regel is klikbaar; de link in de eerste cel blijft de echte link (toetsenbord, schermlezer, nieuw tabblad) */
.tbl tbody tr.rl { cursor: pointer; }
.tbl tbody tr.rl:hover { box-shadow: inset 2px 0 0 var(--primary); }
.tbl tbody tr.rl:active { background: var(--control-pressed); }
.tbl tbody tr.rl.kb { background: var(--row-hover); box-shadow: inset 2px 0 0 var(--primary); }

/* de kop van een detailscherm: ✕, vorige, volgende, titel, teller */
.pt-hd-detail { gap: 8px; padding-left: 16px; }
.pt-hd-detail h1 { flex: 1; }
.hd-nav { display: flex; align-items: center; gap: 2px; flex: none; }
.hd-btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center; flex: none; border: 0; background: none;
  border-radius: 8px; padding: 0; color: var(--muted-foreground); font: inherit; cursor: pointer;
}
.hd-btn:hover { text-decoration: none; }
.hd-btn.is-off { opacity: .3; cursor: default; }
.hd-count { color: var(--muted-foreground); font-size: 13px; white-space: nowrap; }
.tbl td.act .hd-btn { vertical-align: middle; margin: -7px 0; }

/* een scherm met twee vlakken naast elkaar: elk vlak scrolt zelf, de kop blijft staan */
.pt-main.split { overflow: hidden; display: flex; flex-direction: column; scroll-behavior: auto; }
.pt-main.split .pt-hd { position: static; flex: none; }
.pt-body.split { padding: 0; max-width: none; flex: 1; min-height: 0; display: block; }
.inv { display: grid; grid-template-columns: minmax(0, 1fr) 360px; height: 100%; min-height: 0; }
.inv-pdf { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--background); }
.inv-data { border-left: 1px solid var(--border); overflow: auto; min-height: 0; background: var(--surface); }
.inv-data .kv { grid-template-columns: minmax(96px, 128px) 1fr; }
.inv-act { padding: 16px; border-top: 1px solid var(--border); }
.inv-act .btn { width: 100%; justify-content: center; }
.inv-tabs { display: none; }

/* de PDF-viewer */
.pdfv-bar {
  flex: none; height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.pdfv-grp { display: inline-flex; align-items: center; gap: 2px; }
.pdfv-pct { min-width: 44px; text-align: center; font-size: 12px; color: var(--foreground); }
.pdfv-fit, .pdfv-dl {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; background: none; border-radius: 8px;
  color: var(--muted-foreground); font: inherit; font-size: 12px; cursor: pointer; transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
.pdfv-fit:hover, .pdfv-dl:hover { background: var(--control-hover); color: var(--foreground); text-decoration: none; }
.pdfv-bar .hd-btn:disabled { opacity: .3; cursor: not-allowed; }
.pdfv-pg { font-size: 12px; color: var(--muted-foreground); }
.pdfv-scroll { flex: 1; min-height: 0; overflow: auto; padding: 24px 16px 32px; -webkit-overflow-scrolling: touch; }
.pdfv-pages { display: grid; justify-items: center; gap: 16px; width: max-content; min-width: 100%; }
.pdfv-page {
  position: relative; background: #fff; border-radius: 2px; overflow: hidden; --scale-factor: 1; --total-scale-factor: 1;
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--foreground) 8%, transparent), 0 6px 20px color-mix(in oklab, var(--foreground) 8%, transparent);
}
.pdfv-page:not(.is-ready) { background: var(--muted); animation: skeleton-pulse 1.4s ease-in-out infinite; }
.pdfv-page canvas { position: absolute; left: 0; top: 0; display: block; }
.pdfv-skel { width: min(100%, 794px); aspect-ratio: 1 / 1.414; background: var(--muted); border-radius: 2px; animation: skeleton-pulse 1.4s ease-in-out infinite; }
.pdfv-err { margin: 48px auto; max-width: 320px; text-align: center; color: var(--muted-foreground); }
.pdfv-pill, .pdfv-fab { display: none; }

/* de selecteerbare tekstlaag: onzichtbare tekst precies boven het canvas (naar pdf.js, Apache-2.0) */
.textLayer {
  position: absolute; text-align: initial; inset: 0; overflow: clip; opacity: 1; line-height: 1; text-size-adjust: none;
  -webkit-text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; caret-color: CanvasText; z-index: 1;
}
.textLayer :is(span, br) { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; }
.textLayer > :not(.markedContent), .textLayer .markedContent span:not(.markedContent) { z-index: 1; }
.textLayer span.markedContent { top: 0; height: 0; }
.textLayer ::selection { background: color-mix(in oklab, var(--primary) 28%, transparent); }
.textLayer br::selection { background: transparent; }
.textLayer .endOfContent { display: block; position: absolute; inset: 100% 0 0; z-index: 0; cursor: default; user-select: none; -webkit-user-select: none; }
.textLayer.selecting .endOfContent { top: 0; }

@media (max-width: 768px) {
  .pt-hd-detail { padding-left: 8px; }
  .hd-count { display: none; }
  .inv { display: flex; flex-direction: column; }
  .inv-pdf { flex: 1; }
  .inv-data { border-left: 0; flex: 1; }
  .inv-data .kv { grid-template-columns: 1fr; }
  html.js .inv-tabs { display: flex; flex: none; gap: 4px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .inv-tabs button {
    flex: 1; height: 36px; border: 0; border-radius: 999px; background: none; color: var(--muted-foreground); font: inherit; cursor: pointer;
  }
  .inv-tabs button.on { background: var(--accent); color: var(--accent-foreground); font-weight: 500; }
  html.js .inv[data-pane="pdf"] .inv-data, html.js .inv[data-pane="data"] .inv-pdf { display: none; }
  .pdfv-bar { display: none; }
  .pdfv-scroll { padding: 12px 8px 72px; }
  .pdfv-pill {
    display: block; position: absolute; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
    padding: 6px 12px; border-radius: 999px; background: color-mix(in oklab, var(--foreground) 88%, transparent); color: var(--surface);
    font-size: 12px; line-height: 16px; pointer-events: none;
  }
  .pdfv-fab {
    display: grid; place-items: center; position: absolute; right: 16px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: 40px; height: 40px;
    border-radius: 999px; background: var(--surface); color: var(--foreground); box-shadow: 0 0 0 1px var(--border), 0 4px 12px rgb(0 0 0 / .12);
  }
}
@media print { .inv { display: block; } .pdfv-bar, .pdfv-pill, .pdfv-fab { display: none; } }

[hidden] { display: none !important; }
