/* ============================================================================
   David Analytics — COMPONENT KIT · BASIS
   Globale box-sizing + body-typografie uit de tokens, zodat alle tekst de
   thema-font/-kleur gebruikt (niet de browser-default) en paddings de breedte
   niet oprekken. (Stond voorheen bovenin app.css en mag niet ontbreken.)
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-700);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============================================================================
   David Analytics — COMPONENT KIT · CONSOLIDATED STYLESHEET
   ----------------------------------------------------------------------------
   Self-contained CSS for the standardized component kit (ds/components.jsx and
   the kit-owned primitives the CRM reuses). Contains NO CRM-screen styling.

   Assembled from:
     1. ds/components.css  (verbatim — the .ff-* , .pager , .ff-tip , .ff-toast kit)
     2. kit-required class blocks lifted from the legacy app.css

   Brand hex literals have been replaced with `var(--TOKEN, #fallback)` so the
   kit themes cleanly while still rendering correctly un-themed (the fallback is
   the original brand value). Pure structural greys / whites / shadow rgba()
   values are left as-is. See build notes / token surface for the full spec.
   ========================================================================== */

/* ============================================================================
   PART 1 — ds/components.css  (BRON VAN WAARHEID, verbatim + tokenized)
   ========================================================================== */

/* ---- Formulier-layout (FormGrid / FormField) ----------------------------- */
.ff-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  padding: 18px 22px 22px;
  align-items: start;
}
.ff-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.ff-field-wide { grid-column: 1 / -1; }
.ff-label {
  display: flex; align-items: center; gap: 6px 8px;
  min-height: 22px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-500);
}
.ff-label .name-flag, .ff-label .name-reset { text-transform: none; letter-spacing: 0; }

/* ---- RecordLayout (pagina-body: inhoud + optionele rail) ----------------- */
:root {
  --ff-rail: 340px;             /* breedte van een vaste rail */
  --ff-grid-gap: 24px;          /* hét uniforme gat: rail↔inhoud én tussen kaarten */
  --ff-col-gap: var(--ff-grid-gap); /* gelijk aan het gridgat (één maat overal) */
}
.ff-record {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--ff-grid-gap);
  align-items: start;
}
/* Vaste rail (standaard 340px, of een eigen breedte via de railWidth-prop). */
.ff-record.has-rail { grid-template-columns: minmax(0, 1fr) var(--ff-rail); }
.ff-record.has-rail.rail-left { grid-template-columns: var(--ff-rail) minmax(0, 1fr); }
/* Meebewegende rail (railWidth="flex"): inhoud 2fr, rail 1fr. */
.ff-record.has-rail.rail-flex { grid-template-columns: 2fr 1fr; }
.ff-record.has-rail.rail-flex.rail-left { grid-template-columns: 1fr 2fr; }
.ff-record-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--ff-grid-gap);
  align-items: start;
  min-width: 0;
}
.ff-record-content.ff-cols-2 { grid-template-columns: 1fr 1fr; }
.ff-record-content.ff-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ff-record-rail { display: flex; flex-direction: column; gap: var(--ff-grid-gap); min-width: 0; }

@media (max-width: 1100px) {
  .ff-record.has-rail,
  .ff-record.has-rail.rail-left,
  .ff-record.has-rail.rail-flex,
  .ff-record.has-rail.rail-flex.rail-left { grid-template-columns: 1fr; }
  /* Standaard klapt de rail bóven de inhoud; rail-stack-below zet 'm eronder. */
  .ff-record-rail { order: -1; }
  .ff-record.rail-stack-below .ff-record-rail { order: 1; }
}
@media (max-width: 860px) {
  .ff-record-content.ff-cols-2,
  .ff-record-content.ff-cols-3 { grid-template-columns: 1fr; }
}

/* ---- InfoTip ((i) + hover-tooltip) --------------------------------------- */
.ff-infotip { position: relative; display: inline-flex; }
.ff-infotip-btn {
  display: inline-flex; align-items: center; padding: 0; margin: 0;
  border: 0; background: none; color: var(--ink-300); cursor: help;
  transition: color 140ms ease;
}
.ff-infotip-btn:hover, .ff-infotip-btn:focus-visible { color: var(--primary-600); outline: none; }
.ff-infotip-bubble {
  position: absolute; bottom: calc(100% + 9px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: max-content; max-width: 240px;
  text-transform: none; letter-spacing: 0;
  font-size: 12.5px; font-weight: 500; line-height: 1.45;
  color: #fff; background: var(--ink-900);
  padding: 8px 11px; border-radius: 9px;
  box-shadow: 0 6px 18px rgba(15,23,42,.22);
  opacity: 0; visibility: hidden; pointer-events: none; z-index: 30;
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms;
}
.ff-infotip-bubble::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--ink-900);
}
.ff-infotip:hover .ff-infotip-bubble,
.ff-infotip-btn:focus-visible + .ff-infotip-bubble {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}

/* ---- Gedeelde maatvoering ------------------------------------------------
   Input, leeswaarde én disabled houden exact dezelfde hoogte, zodat wisselen
   tussen lezen en bewerken niets laat verspringen. */
.ff-input, .ff-value {
  box-sizing: border-box; width: 100%;
  height: 42px; padding: 0 13px;
  font-family: var(--font-body); font-size: 14.5px; color: var(--ink-900);
  border: 1px solid transparent; border-radius: 10px;
}

/* ---- Default (lees) state — zachte gevulde chip, geen actieve omlijning --- */
.ff-value {
  display: flex; align-items: center;
  background: var(--bg-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ff-value.empty { color: var(--ink-300); }
a.ff-value.fv-link { color: var(--primary-600); text-decoration: none; }
a.ff-value.fv-link:hover { text-decoration: underline; }

/* ---- Bewerkbare state ---------------------------------------------------- */
.ff-input-wrap { position: relative; width: 100%; }
.ff-input-wrap.has-trailing .ff-input { padding-right: 96px; }
.ff-input-trailing {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: flex; align-items: center;
}
.ff-input {
  background: var(--surface); border-color: var(--line);
  /* line-height = veldhoogte: centreert de native input-tekst exact gelijk aan
     ReadValue (.ff-value, flex-gecentreerd) en Select, zodat lezen↔bewerken
     niet 1px verspringt. Textarea/inline/select/date overschrijven dit hierna. */
  line-height: 42px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.ff-input::placeholder { color: var(--ink-300); }
.ff-input:hover { border-color: #cfdcdc; }
.ff-input:focus {
  outline: none; border-color: var(--primary-400);
  box-shadow: 0 0 0 3px var(--primary-050);
}
.ff-input.invalid { border-color: var(--danger); }

/* ---- Disabled state — zelfde footprint, gedempt en niet-interactief ------ */
.ff-input:disabled, .ff-input.ff-disabled {
  background: var(--bg-soft); border-color: var(--line);
  color: var(--ink-500); cursor: not-allowed; box-shadow: none;
}
.ff-input:disabled::placeholder { color: var(--ink-300); }

@media (max-width: 720px) { .ff-form { grid-template-columns: 1fr; } }

/* ---- Flag (melding) + ResetButton ---------------------------------------- */
.name-flag {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-size: 11.5px; font-weight: 600; color: var(--flag-ink);
  background: var(--accent-050); border-radius: var(--r-pill);
  padding: 2px 9px;
}
.name-reset {
  display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto;
  height: 30px; padding: 0 11px;
  font-family: var(--font-body); font-size: 12px; font-weight: 600;
  color: var(--primary-700); background: var(--primary-050);
  border: 1px solid var(--primary-400); border-radius: 8px;
  cursor: pointer; white-space: nowrap;
  transition: background 140ms ease;
}
.name-reset:hover { background: var(--primary-100); }

/* ---- Textarea ------------------------------------------------------------ */
.ff-textarea {
  height: auto; min-height: 84px; padding: 11px 13px;
  line-height: 1.5; resize: vertical;
}

/* ---- Select -------------------------------------------------------------- */
.ff-select-wrap { position: relative; width: 100%; }
.ff-select {
  display: flex; align-items: center; width: 100%; appearance: none; -webkit-appearance: none;
  padding-right: 40px; cursor: pointer; text-align: left;
  line-height: 40px;
}
.ff-select-label { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ff-select.ff-empty .ff-select-label { color: var(--ink-300); }
.ff-select-caret {
  position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  display: flex; pointer-events: none; color: var(--ink-500);
  transition: transform 140ms ease, color 140ms ease;
}
.ff-select-wrap.open .ff-select-caret { color: var(--primary-600); transform: translateY(-50%) rotate(180deg); }
.ff-select-wrap.disabled { opacity: 1; }
.ff-select-wrap.disabled .ff-select-caret { color: var(--ink-300); }

/* ---- Gestylede dropdown-popover (Select + MultiSelect) ------------------- */
.ff-pop {
  position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 41;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 6px; max-height: 280px; overflow-y: auto; overflow-x: hidden;
}
.ff-pop-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  font-family: var(--font-body); font-size: 14px; color: var(--ink-700);
  background: none; border: 0; border-radius: 8px; padding: 9px 11px;
  cursor: pointer; text-align: left;
  transition: background 120ms ease, color 120ms ease;
}
.ff-pop-item + .ff-pop-item { margin-top: 1px; }
.ff-pop-item:hover { background: var(--bg-soft); }
.ff-pop-item .ff-pop-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ff-pop-item .lic { flex: 0 0 auto; color: var(--primary-600); }
.ff-pop-item.on { color: var(--primary-700); font-weight: 600; }
.ff-pop-multi { left: 0; right: auto; min-width: 190px; }

/* ---- DateField ----------------------------------------------------------- */
.ff-date { display: block; cursor: pointer; line-height: 40px; }
.ff-date.ff-empty { color: var(--ink-300); }
.ff-date::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.55; }
.ff-date::-webkit-calendar-picker-indicator:hover { opacity: 0.85; }

/* ---- MoneyField ---------------------------------------------------------- */
.ff-money .ff-money-prefix {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--ink-500); font-size: 14.5px; pointer-events: none;
}
.ff-money-input { padding-left: 28px; }
.ff-money.disabled .ff-money-prefix { color: var(--ink-300); }

/* ---- Inline 'bewerk-in-plaats'-variant -----------------------------------
   Zelfde footprint als de leeswaarde; de highlight loopt in de marge zodat
   wisselen tussen lezen en bewerken niets laat verspringen. Spiegelt de
   legacy .edit-input zodat de detail-bewerk-UX identiek blijft. */
.ff-input.ff-inline {
  height: auto; display: block;
  width: calc(100% + 18px); margin: -5px -9px; padding: 5px 9px;
  font-size: 14.5px; line-height: 1.5;
  background: var(--bg-soft); border: 1px solid transparent; border-radius: 7px;
}
.ff-input.ff-inline:hover { border-color: var(--line); }
.ff-input.ff-inline:focus {
  background: var(--surface); border-color: var(--primary-400); box-shadow: 0 0 0 3px var(--primary-050);
}
.ff-textarea.ff-inline { min-height: 0; }
.ff-select-wrap.inline { display: block; }
.ff-select.ff-inline { line-height: 1.5; padding-right: 30px; }
.ff-select-wrap.inline .ff-select-caret { right: 4px; }
/* ---- NumberField --------------------------------------------------------- */
.ff-number { position: relative; }
.ff-number-input { -moz-appearance: textfield; }
.ff-number-input::-webkit-outer-spin-button,
.ff-number-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ff-affix {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: var(--ink-500); font-size: 14px; pointer-events: none;
}
.ff-affix-pre { left: 13px; }
.ff-affix-suf { right: 13px; }
.ff-number.has-prefix .ff-number-input { padding-left: 30px; }
.ff-number.has-suffix .ff-number-input { padding-right: 36px; }

/* ---- SearchInput --------------------------------------------------------- */
.ff-search {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 10px 0 12px; box-sizing: border-box;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.ff-search:focus-within {
  background: var(--surface); border-color: var(--primary-400); box-shadow: 0 0 0 3px var(--primary-050);
}
.ff-search-ico { display: flex; color: var(--ink-500); flex: 0 0 auto; }
.ff-search-input {
  flex: 1 1 auto; min-width: 0; border: 0; background: none; outline: none;
  font-family: var(--font-body); font-size: 14px; color: var(--ink-900);
}
.ff-search-input::placeholder { color: var(--ink-300); }
.ff-search-count {
  flex: 0 0 auto; font-size: 11.5px; font-weight: 600; color: var(--primary-700);
  background: var(--primary-050); border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
.ff-search-clear {
  flex: 0 0 auto; display: flex; border: 0; background: none; color: var(--ink-300);
  cursor: pointer; padding: 2px; border-radius: 6px;
}
.ff-search-clear:hover { color: var(--ink-700); background: var(--line); }

/* ---- MultiSelect (chips, compact) ---------------------------------------- */
.ff-multi-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 40px; padding: 5px 8px; box-sizing: border-box;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.ff-multi-box:focus-within { border-color: var(--primary-400); box-shadow: 0 0 0 3px var(--primary-050); }
.ff-multi-box.invalid { border-color: var(--danger); }
.ff-multi-box.disabled { background: var(--bg-soft); opacity: .8; }
.ff-chip {
  display: inline-flex; align-items: center; gap: 4px; line-height: 1.2;
  font-size: 12.5px; font-weight: 500; color: var(--ink-900);
  background: var(--primary-050); border-radius: 6px; padding: 3px 4px 3px 9px;
}
.ff-chip-x { display: flex; border: 0; background: none; color: var(--primary-700); cursor: pointer; padding: 1px; border-radius: 5px; }
.ff-chip-x:hover { background: var(--primary-200); }
.ff-multi-add-wrap { position: relative; display: inline-flex; }
.ff-multi-add-mini {
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--primary-700); border: 1px dashed var(--primary-200);
  background: none; cursor: pointer;
  border-radius: 6px; padding: 3px 9px 3px 6px;
  font-family: var(--font-body); font-size: 12.5px; font-weight: 600;
  transition: background 120ms ease, border-color 120ms ease;
}
.ff-multi-add-mini:hover { background: var(--primary-050); border-color: var(--primary-400); }
.ff-multi-add-mini .lic { color: var(--primary-700); }

/* ---- FileField (dropzone) ------------------------------------------------ */
.ff-file {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 26px 20px; text-align: center; cursor: pointer;
  background: var(--bg-soft); border: 1.5px dashed var(--line); border-radius: 14px;
  color: var(--ink-500); transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.ff-file:hover, .ff-file:focus-visible { outline: none; border-color: var(--primary-400); color: var(--primary-700); }
.ff-file.over { border-color: var(--primary-500); background: var(--primary-050); color: var(--primary-700); }
.ff-file-ico { display: flex; color: var(--primary-500); }
.ff-file-hint { font-size: 13.5px; }
.ff-file.disabled { opacity: .6; cursor: not-allowed; }

/* ---- Toggle -------------------------------------------------------------- */
.ff-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.ff-toggle.disabled { cursor: not-allowed; opacity: 0.55; }
.ff-toggle-track {
  position: relative; flex: 0 0 auto;
  width: 42px; height: 24px; border-radius: 999px;
  background: var(--line); transition: background 160ms ease;
}
.ff-toggle-track.on { background: var(--primary-500, var(--primary-600)); }
.ff-toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 999px;
  background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.25);
  transition: transform 160ms ease;
}
.ff-toggle-track.on .ff-toggle-thumb { transform: translateX(18px); }
.ff-toggle-label { font-size: 14.5px; color: var(--ink-900); }

/* ---- Checkbox ------------------------------------------------------------ */
.ff-check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.ff-check.disabled { cursor: not-allowed; opacity: 0.55; }
.ff-check-box {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--line); background: var(--surface); color: #fff;
  transition: background 140ms ease, border-color 140ms ease;
}
.ff-check-box.on { background: var(--primary-600); border-color: var(--primary-600); }
.ff-check-label { font-size: 14.5px; color: var(--ink-900); }

/* ---- RadioGroup ---------------------------------------------------------- */
.ff-radio-group { display: flex; flex-direction: column; gap: 11px; }
.ff-radio-group.inline { flex-direction: row; flex-wrap: wrap; gap: 10px 22px; }
.ff-radio { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.ff-radio.disabled { cursor: not-allowed; opacity: 0.55; }
.ff-radio-dot {
  position: relative; flex: 0 0 auto;
  width: 20px; height: 20px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface);
  transition: border-color 140ms ease;
}
.ff-radio-dot.on { border-color: var(--primary-600); border-width: 2px; }
.ff-radio-dot.on::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 10px; height: 10px; border-radius: 999px; background: var(--primary-600);
}
.ff-radio-label { font-size: 14.5px; color: var(--ink-900); }

/* ---- Autocomplete -------------------------------------------------------- */
.ff-ac { position: relative; width: 100%; }
.ff-ac-input { padding-right: 38px; }
.ff-ac-ico {
  position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  display: flex; color: var(--ink-300); pointer-events: none;
}
.ff-ac-loader {
  width: 15px; height: 15px; border: 2px solid var(--primary-100);
  border-top-color: var(--primary-500); border-radius: 50%;
  animation: ff-spin 0.7s linear infinite;
}
@keyframes ff-spin { to { transform: rotate(360deg); } }
.ff-ac-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 10px 28px rgba(15,23,42,.14);
  padding: 6px; max-height: 288px; overflow-y: auto;
}
.ff-ac-opt {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 8px; cursor: pointer;
}
.ff-ac-opt.hi { background: var(--primary-050); }
.ff-ac-opt-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ff-ac-opt-title { font-size: 14px; font-weight: 500; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ff-ac-opt-sub { font-size: 12.5px; color: var(--ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ff-ac-lead { flex: 0 0 auto; display: flex; }
.ff-ac-avatar {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; flex: 0 0 auto;
  font-size: 11.5px; font-weight: 700; color: #fff;
}
.ff-ac-avatar.round { border-radius: 999px; }
.ff-ac-msg { padding: 14px 12px; font-size: 13.5px; color: var(--ink-500); text-align: center; }

/* ---- Pager (paginatie) ---------------------------------------------------
   De basis-look van .pg leeft in app.css; daar staat de flex-layout echter
   alleen onder .tbl-foot. Hier maken we de component zelfvoorzienend (werkt ook
   los van een tabelvoet) en voegen we de uitgeschakelde pijl + het gat toe. */
.pager { display: inline-flex; align-items: center; gap: 6px; }
.pager .pg:disabled { opacity: 0.4; cursor: default; }
.pager .pg:disabled:hover { background: #fff; }
.pager .pg-gap {
  min-width: 20px; height: 32px;
  display: grid; place-items: center;
  color: var(--ink-300); font-size: 14px;
  user-select: none;
}

/* ---- Tooltip (algemeen) --------------------------------------------------
   Hover/focus-bubble om een willekeurig element. Puur CSS: de wrapper toont de
   bubbel op :hover en :focus-within. side via [data-side]. */
.ff-tip { position: relative; display: inline-flex; }
.ff-tip-bubble {
  position: absolute; z-index: 60;
  left: 50%; bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(3px);
  max-width: 240px; width: max-content;
  padding: 7px 10px;
  background: var(--ink-900); color: #fff;
  font-size: 12.5px; line-height: 1.4; font-weight: 500;
  border-radius: 9px;
  box-shadow: 0 6px 18px rgba(15,23,42, 0.22);
  opacity: 0; pointer-events: none;
  transition: opacity 130ms ease, transform 130ms ease;
}
.ff-tip-bubble::after {
  content: ""; position: absolute;
  left: 50%; top: 100%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--ink-900);
}
.ff-tip:hover .ff-tip-bubble,
.ff-tip:focus-within .ff-tip-bubble { opacity: 1; transform: translateX(-50%) translateY(0); }
/* Zijden */
.ff-tip[data-side="bottom"] .ff-tip-bubble { bottom: auto; top: calc(100% + 8px); transform: translateX(-50%) translateY(-3px); }
.ff-tip[data-side="bottom"]:hover .ff-tip-bubble,
.ff-tip[data-side="bottom"]:focus-within .ff-tip-bubble { transform: translateX(-50%) translateY(0); }
.ff-tip[data-side="bottom"] .ff-tip-bubble::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--ink-900); }
.ff-tip[data-side="left"] .ff-tip-bubble { left: auto; right: calc(100% + 8px); bottom: 50%; transform: translateY(50%) translateX(3px); }
.ff-tip[data-side="left"]:hover .ff-tip-bubble,
.ff-tip[data-side="left"]:focus-within .ff-tip-bubble { transform: translateY(50%) translateX(0); }
.ff-tip[data-side="left"] .ff-tip-bubble::after { left: 100%; top: 50%; bottom: auto; transform: translateY(-50%); border-top-color: transparent; border-left-color: var(--ink-900); }
.ff-tip[data-side="right"] .ff-tip-bubble { left: calc(100% + 8px); right: auto; bottom: 50%; transform: translateY(50%) translateX(-3px); }
.ff-tip[data-side="right"]:hover .ff-tip-bubble,
.ff-tip[data-side="right"]:focus-within .ff-tip-bubble { transform: translateY(50%) translateX(0); }
.ff-tip[data-side="right"] .ff-tip-bubble::after { left: auto; right: 100%; top: 50%; bottom: auto; transform: translateY(-50%); border-top-color: transparent; border-right-color: var(--ink-900); }

/* ---- Toast (notificatie) -------------------------------------------------
   Tijdelijke meldingen in een hoek. Vier tonen kleuren de icoonrand. */
.ff-toasts {
  position: fixed; z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 32px));
}
.ff-toasts.bottom-right { right: 20px; bottom: 20px; align-items: flex-end; }
.ff-toasts.bottom-left { left: 20px; bottom: 20px; align-items: flex-start; }
.ff-toasts.top-right { right: 20px; top: 20px; align-items: flex-end; }
.ff-toasts.top-left { left: 20px; top: 20px; align-items: flex-start; }
.ff-toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 11px;
  width: 100%;
  padding: 13px 13px 13px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15,23,42, 0.16);
  animation: ff-toast-in 200ms ease both;
}
@keyframes ff-toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .ff-toast { animation: none; } }
.ff-toast-ico {
  flex: 0 0 auto;
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
}
.ff-toast-ico .lic { display: flex; line-height: 0; }
.ff-toast.info    .ff-toast-ico { background: var(--primary-050); color: var(--primary-600); }
.ff-toast.success .ff-toast-ico { background: var(--success-050); color: var(--success); }
.ff-toast.warning .ff-toast-ico { background: var(--accent-050); color: var(--accent-600); }
.ff-toast.danger  .ff-toast-ico { background: var(--danger-050); color: var(--danger); }
.ff-toast-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding-top: 4px; }
.ff-toast-body b { font-size: 14px; font-weight: 600; color: var(--ink-900); }
.ff-toast-body span { font-size: 13.5px; line-height: 1.45; color: var(--ink-700); }
.ff-toast-action {
  flex: 0 0 auto; align-self: center;
  height: 30px; padding: 0 12px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--primary-700); cursor: pointer;
  transition: background 130ms ease, border-color 130ms ease;
}
.ff-toast-action:hover { background: #fff; border-color: #d4e0e0; }
.ff-toast-x {
  flex: 0 0 auto;
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  background: none; border: none; cursor: pointer; color: var(--ink-300);
  transition: background 130ms ease, color 130ms ease;
}
.ff-toast-x:hover { background: var(--bg-soft); color: var(--ink-700); }
.ff-toast-x .lic { display: flex; line-height: 0; }


/* ============================================================================
   PART 2 — kit-required class blocks lifted from app.css
   ========================================================================== */

/* from app.css: Reusable "bolletje" primitives — Avatar + IconBubble */
.ff-avatar,
.icon-bubble {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.ff-avatar {
  font-family: var(--font-display);
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
  overflow: hidden;
}
.ff-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
/* The Lucide icon wrapper carries residual line-height — zero it out and let
   the flex container do the centering, so every glyph sits dead-center. */
.ff-avatar .lic,
.icon-bubble .lic { display: flex; line-height: 0; color: inherit; }
.ff-avatar .lic { color: #fff; }
.icon-bubble { color: #fff; }

/* from app.css: Icon button (topbar / header actions) */
.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--r-pill);
  color: var(--ink-700);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
.icon-btn:hover { background: var(--bg-soft); border-color: #d4e0e0; }
.icon-btn .dot {
  position: absolute;
  top: 8px; right: 9px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-500);
  border: 2px solid #fff;
}
.icon-btn.sm { width: 40px; height: 40px; }

/* from app.css: Pill buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  padding: 0 18px;
  height: 40px;
  cursor: pointer;
  transition: background 140ms ease, transform 80ms ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent-500); color: #fff; }
.btn-primary:hover { background: var(--accent-600); }
.btn-approve { background: var(--success); color: #fff; }
.btn-approve:hover { background: var(--success); }
.btn-outline-danger { background: #fff; color: var(--danger); border: 1px solid #F0CFC8; }
.btn-outline-danger:hover { background: #FBEAE6; }

/* from app.css: Button variants (ghost / danger) */
.btn-ghost { background: var(--surface); color: var(--ink-700); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.93); }

/* from app.css: Button small modifiers */
.btn.sm { height: 40px; padding: 0 16px; font-size: 14px; }
.btn-primary.sm { height: 40px; }

/* from app.css: Chip button (toolbar / header) */
.chip-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 15px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-pill);
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  color: var(--ink-700); cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
.chip-btn:hover { background: var(--bg-soft); border-color: #d4e0e0; }
.chip-btn .lic { color: var(--ink-500); }
.chip-btn.head-btn { height: 32px; padding: 0 13px; font-size: 13px; gap: 6px; }
.chip-btn.primary {
  background: var(--accent-500);
  border-color: var(--accent-500);
  color: #fff;
}
.chip-btn.primary:hover { background: var(--accent-600); border-color: var(--accent-600); }
.chip-btn.primary .lic { color: #fff; }

/* from app.css: Standardized data table */
.tbl-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.tbl {
  display: grid;
  min-width: 880px;
  /* grid-template-columns set inline from column widths */
}
.tbl-head, .tbl-row {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: center;
}
.tbl-head {
  height: 46px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.tbl-head .th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-500);
  padding: 0 18px;
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap;
  cursor: default;
}
.tbl-head .th.num { justify-content: flex-end; }
.tbl-row {
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 120ms ease;
}
.tbl-row:last-child { border-bottom: none; }
.tbl-row:hover { background: var(--primary-050); }
.tbl-row .td {
  padding: 12px 18px;
  font-size: 14px;
  color: var(--ink-700);
  min-width: 0;
  overflow: hidden;
}
.tbl-row .td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.tbl-row .td.money { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-900); }
.tbl-row .td.date { color: var(--ink-500); white-space: nowrap; }

/* from app.css: Table footer / pagination + empty */
.tbl-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tbl-foot .count { font-size: 13px; color: var(--ink-500); }
.tbl-foot .pager { display: flex; align-items: center; gap: 6px; }
.pager .pg {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-sm);
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  color: var(--ink-700); cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.pager .pg:hover { background: var(--bg-soft); }
.pager .pg.active { background: var(--primary-500); border-color: var(--primary-500); color: #fff; }
.pager .pg.nav .lic { color: var(--ink-500); }
.tbl-empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--ink-500);
  font-size: 14px;
}

/* from app.css: Status badge */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-body);
  font-size: 12.5px; font-weight: 700;
  padding: 3px 11px 3px 9px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.badge::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
}
.badge.info    { color: var(--primary-700);  background: var(--primary-050); }
.badge.success { color: var(--success);          background: var(--success-050); }
.badge.warning { color: var(--flag-ink);          background: var(--accent-050); }
.badge.danger  { color: var(--danger);    background: #FBEAE6; }
.badge.neutral { color: var(--ink-500);   background: var(--bg-soft); }
.badge.token { display: inline-flex; align-items: center; gap: 5px; padding-right: 5px; }

/* from app.css: Badge dot (token menu / picker) */
.badge-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.badge-dot.info { background: var(--primary-500); }
.badge-dot.warning { background: var(--accent-500); }
.badge-dot.success { background: var(--success); }
.badge-dot.neutral { background: var(--ink-300); }

/* from app.css: Detail tabs */
.detail-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.dtab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  background: none;
  padding: 11px 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-500);
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease;
}
.dtab .lic { color: var(--ink-300); transition: color 140ms ease; }
.dtab:hover { color: var(--ink-900); }
.dtab:hover .lic { color: var(--ink-500); }
.dtab.active { color: var(--primary-700); border-bottom-color: var(--primary-500); }
.dtab.active .lic { color: var(--primary-600); }

/* from app.css: Detail card + card head */
.d-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.d-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}
.d-card-head .lic { color: var(--primary-600); }
.d-card-head h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-900);
  margin: 0;
}
/* card-head edit affordances (.head-btn lives in the chip-btn block above) */
.d-card-head .head-edit {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  flex: 0 0 auto;
}
.icon-btn.head-x { width: 32px; height: 32px; border-radius: 9px; }
.d-card-head:has(.head-edit) { padding-top: 9px; padding-bottom: 9px; min-height: 51px; }

/* from app.css: Timeline */
.timeline { list-style: none; margin: 0; padding: 14px 20px 16px; }
.tl-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding-bottom: 18px;
}
.tl-item::before {
  content: "";
  position: absolute;
  left: 14px; top: 30px; bottom: 0;
  width: 2px;
  background: var(--line);
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item:last-child::before { display: none; }
.tl-dot {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  z-index: 1;
}
.tl-dot .lic { color: #fff; display: flex; line-height: 0; }
.tl-dot.info    { background: var(--primary-500); }
.tl-dot.success { background: var(--success); }
.tl-dot.warning { background: var(--accent-500); }
.tl-dot.neutral { background: var(--ink-300); }
.tl-body { display: flex; flex-direction: column; min-width: 0; }
.tl-body b { min-height: 30px; display: flex; align-items: center; font-weight: 600; font-size: 14px; color: var(--ink-900); }
.tl-meta { font-size: 12.5px; color: var(--ink-500); margin-top: -1px; }

/* from app.css: Tab / card empty state */
.d-empty { text-align: center; padding: 48px 24px; }
.d-empty-ico {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: var(--primary-050);
  color: var(--primary-600);
}
.d-empty b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--ink-900); margin-bottom: 6px; }
.d-empty p { margin: 0 auto; max-width: 320px; font-size: 14px; color: var(--ink-500); line-height: 1.55; }

/* from app.css: Segmented view switch */
.view-switch {
  align-self: flex-end;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
}
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  background: none;
  padding: 7px 15px;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-500);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.seg-btn .lic { color: var(--ink-300); }
.seg-btn:hover { color: var(--ink-900); }
.seg-btn.on { background: var(--primary-500); color: #fff; }
.seg-btn.on .lic { color: #fff; }
.view-switch.sm .seg-btn { padding: 5px 12px; font-size: 12.5px; gap: 6px; }

/* from app.css: Drawer (side panel) — structural shell only */
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15,23,42, 0.34);
  display: flex;
  justify-content: flex-end;
  animation: scrim-in 160ms ease;
}
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  width: 460px;
  max-width: 94vw;
  height: 100%;
  background: var(--bg-soft);
  display: flex;
  flex-direction: column;
  box-shadow: -16px 0 44px rgba(15,23,42, 0.20);
  animation: drawer-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0.4; } to { transform: translateX(0); opacity: 1; } }
.drawer-head {
  position: relative;
  flex: 0 0 auto;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 22px 24px 20px;
}
.drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.drawer-body > .d-card { flex: 0 0 auto; }
.drawer-foot {
  flex: 0 0 auto;
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.drawer-foot .btn { flex: 1 1 0; justify-content: center; }

/* from app.css: Overflow / row menu */
.menu-backdrop { position: fixed; inset: 0; z-index: 40; }
.row-menu {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 41;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-lg);
  padding: 6px;
}
.row-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  font-family: var(--font-body); font-size: 14px; color: var(--ink-700);
  background: none; border: none; border-radius: var(--r-sm);
  padding: 9px 11px; cursor: pointer; text-align: left;
  transition: background 120ms ease, color 120ms ease;
}
.row-menu-item:hover { background: var(--bg-soft); }
.row-menu-item.danger { color: var(--danger); }
.row-menu-item.danger:hover { background: #FBEAE6; }
.row-menu-sep { height: 1px; margin: 5px 0; background: var(--line); }

/* from app.css: Confirm dialog */
.confirm-scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15,23,42, 0.42);
  display: grid; place-items: center;
  animation: fade-in 140ms ease;
}
.confirm-box {
  width: min(420px, calc(100vw - 48px));
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-lg);
  padding: 28px 28px 22px;
  text-align: center;
  animation: pop-in 160ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.confirm-box h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 19px;
  color: var(--ink-900); margin: 14px 0 8px;
}
.confirm-box p { font-size: 14.5px; color: var(--ink-500); line-height: 1.55; margin: 0 0 22px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-actions .btn { flex: 1 1 0; justify-content: center; }
@keyframes pop-in { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* from app.css: KPI tiles */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px 17px;
  min-width: 0;
}
.kpi-label {
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--ink-300);
}
.kpi-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.15;
  color: var(--ink-900);
  white-space: nowrap;
}
.kpi-value.success { color: var(--success); }
.kpi-value.warning { color: var(--accent-600); }
.kpi-value.danger  { color: var(--danger); }
.kpi-sub { font-size: 12.5px; color: var(--ink-500); }
.kpi-bar {
  display: block;
  margin-top: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  overflow: hidden;
}
.kpi-bar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
  border-radius: 4px 0 0 4px;
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .kpi-grid { grid-template-columns: 1fr; } }
.kpi-grid.sub .kpi { padding: 13px 16px 14px; gap: 3px; }
.kpi-grid.sub .kpi-value { font-size: 21px; }

/* from app.css: Persoon-dashboard KPI tiles */
.pdash-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.pkpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.pkpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pkpi-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-500);
}
.pkpi-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--primary-050); color: var(--primary-600); flex: 0 0 auto; }
.pkpi-value { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--ink-900); line-height: 1.15; }
.pkpi-badge { align-self: flex-start; font-size: 13.5px; padding: 5px 13px; }
.pkpi-sub { font-size: 12.5px; color: var(--ink-500); line-height: 1.4; }

/* from app.css: Calculated field popover (formula + filled-in calculation) */
.calc {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  outline: none;
}
.calc-val {
  border-bottom: 1px dashed var(--primary-400);
  cursor: help;
}
/* De popover rendert via een portal op <body> (position:fixed, hoge z-index)
   zodat hij nooit door kaarten of stacking contexts wordt afgedekt. */
.calc-pop {
  position: fixed;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 9px;
  white-space: nowrap;
  background: var(--ink-900);
  color: #fff;
  padding: 11px 15px 13px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  pointer-events: none;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  animation: calc-in 140ms ease;
}
@keyframes calc-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .calc-pop { animation: none; } }
.calc-pop .cp-name {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-body);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}
.calc-pop .cp-name .lic { color: var(--primary-400); }
/* Twee gescheiden secties: de algemene formule en de ingevulde berekening */
.calc-pop .cp-block { display: flex; flex-direction: column; gap: 6px; }
.calc-pop .cp-block.filled {
  border-top: 1px solid rgba(255,255,255,0.16);
  padding-top: 9px;
}
.calc-pop .cp-sec {
  font-family: var(--font-body);
  font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.42);
}
/* Formule-regels: wiskundige zetwijze — serif, cursieve variabelen,
   gestapelde breuken met deelstreep. */
.f-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'STIX Two Math', 'Cambria Math', Georgia, 'Times New Roman', serif;
  font-size: 14.5px;
  line-height: 1.3;
}
.f-var { font-style: italic; }
.frac {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  line-height: 1.25;
}
.fr-num { padding: 0 7px 2px; border-bottom: 1px solid rgba(255,255,255,0.85); }
.fr-den { padding: 2px 7px 0; }

/* ============================================================================
   from app.css: DETAIL/RECORD + DRAWER content + TABLE cell-stack
   Legacy klassen die de showcases (en app-detailpagina's) direct gebruiken:
   het record field-grid, de drawer-kop-inhoud, de kaartkop-bewerkacties en de
   gestapelde tabelcel. (Bij de eerste CSS-consolidatie ten onrechte weggelaten.)
   ========================================================================== */

/* Record field-grid (label/value-paren — lezen ↔ bewerken) */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 28px; margin: 0; padding: 8px 20px 18px; }
.field { padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.field-grid .field:last-child,
.field-grid .field:nth-last-child(2):nth-child(odd) { border-bottom: none; }
.field dt { font-size: 12px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-300); margin-bottom: 4px; }
.field dd { margin: 0; font-size: 14.5px; color: var(--ink-900); overflow-wrap: anywhere; }
.fv-link { color: var(--primary-600); text-decoration: none; font-weight: 500; }
.fv-link:hover { text-decoration: underline; }
.fv-muted { color: var(--ink-500); }
.fv-strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.fv-empty { color: var(--ink-300); }

/* Drawer-kop content */
.drawer-tools { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin: -6px -6px 6px 0; }
.drawer-id { display: flex; align-items: center; gap: 14px; margin-top: 2px; }
.drawer-id-text { min-width: 0; }
.drawer-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.drawer-title-row h2 { font-family: var(--font-display); font-weight: 600; font-size: 21px; color: var(--ink-900); margin: 0; letter-spacing: var(--tracking-tight); }
.drawer-sub { font-size: 14px; color: var(--ink-500); }
.drawer-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* Kaartkop bewerk-acties (Bewerken → Opslaan / Annuleren) */
.d-card-head .head-edit { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.chip-btn.head-btn { height: 32px; padding: 0 13px; font-size: 13px; gap: 6px; }
.icon-btn.head-x { width: 32px; height: 32px; border-radius: 9px; }
.d-card-head:has(.head-edit) { padding-top: 9px; padding-bottom: 9px; min-height: 51px; }

/* Gestapelde tabelcel (naam + subregel) */
.cell-stack { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.cell-stack b { font-weight: 600; color: var(--ink-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-stack span { font-size: 12.5px; color: var(--ink-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
