/* Summa base components and semantic colour tokens.
 * Screen styles load afterwards; mobile.css owns the final small-screen layer.
 * Check light/dark themes and both languages when changing typography.
 */

@font-face {
  font-family: "Figtree";
  src: url("assets/fonts/Figtree-Variable-v1.ttf") format("truetype");
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
}

.summa-icon {
  display: inline-block; width: 24px; height: 24px; flex: 0 0 auto;
  aspect-ratio: 1 / 1;
  overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.45;
  stroke-linecap: round; stroke-linejoin: round;
}
svg.nav-icon.summa-icon { filter: none !important; color: currentColor; }
.button-icon { width: 18px; height: 18px; margin-right: 7px; vertical-align: -4px; }
.money-label-icon { display: block; width: 18px; height: 18px; stroke-width: 1.35; }
.settings-nav button { display: inline-flex; align-items: center; }
.dialog-close .summa-icon { width: 19px; height: 19px; }
.payment-check-icon { width: 23px; height: 23px; }

/* ---- Summa basis ----------------------------------------------------
 * De app voelt als een rustige werkplek, niet als een financieel dashboard.
 * De zijbalk is licht, informatie verschijnt pas wanneer ze nodig is en de
 * accentkleur stuurt interactie; statuskleuren verschijnen alleen bij betekenis.
 * -------------------------------------------------------------------- */

.app { grid-template-columns: 248px minmax(0, 1fr); }
.sidebar {
  background: var(--paper); color: var(--ink); border-right: 1px solid var(--line);
  padding: 24px 15px; gap: 5px;
}
.sidebar :focus-visible { outline-color: var(--green); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 9px 26px; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border-radius: var(--radius-sm); background: var(--green); color: #fff;
  font: 600 17px/1 Georgia, serif;
}
.brand strong { font-size: 15px; letter-spacing: .1px; }
.brand small { display: block; color: var(--muted); }
.nav-button { color: var(--muted); padding: 10px 11px; }
.nav-button:hover { background: var(--hover); color: var(--ink); }
.nav-button.is-active { background: var(--green-soft); color: var(--green); }
.nav-icon { filter: none; opacity: .58; }
.nav-button:hover .nav-icon, .nav-button.is-active .nav-icon { opacity: .82; }
.sidebar-foot { border-top-color: var(--line); }
.privacy-note {
  display: flex; gap: 9px; align-items: flex-start; padding: 10px 11px 14px;
  color: var(--muted);
}
.privacy-note strong, .privacy-note small { display: block; }
.privacy-note strong { color: var(--ink); font-size: 12px; font-weight: 600; }
.privacy-note small { font-size: 11px; }
.privacy-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--green); flex: none; }

.main { width: 100%; max-width: 1240px; padding: 40px 48px 72px; }
.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: 29px; letter-spacing: -.65px; line-height: 1.2; }
.page-head .row { align-items: center; }
.page-title-row { justify-content: space-between; }
.eyebrow, .panel-kicker {
  display: block; color: var(--green); font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px;
}
.panel { box-shadow: var(--shadow); padding: 20px; }
.summary-panel, .entry-panel { padding: 0; }
.headline strong { font-size: 38px; font-weight: 650; }
button, .button, input, select, textarea { border-radius: var(--radius-sm); }
button.primary { box-shadow: 0 5px 14px rgba(47, 118, 92, .16); }

/* In Geld staat één hoofdcijfer open. De onderbouwing zit in rustige regels. */
.money-headline { margin-bottom: 28px; }
.summary-panel { padding: 0; overflow: hidden; }
.summary-panel > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px;
  padding: 17px 20px; min-height: 62px;
}
.summary-panel > summary::-webkit-details-marker { display: none; }
.summary-panel > summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 20px; font-weight: 300; }
.summary-panel[open] > summary::after { content: "−"; }
.summary-panel > summary > span { font-weight: 650; }
.summary-panel > summary > strong { margin-left: auto; font-size: 18px; }
.summary-panel > summary > small { color: var(--muted); font-size: 13px; }
.summary-panel > summary > strong + ::after { margin-left: 0; }
.summary-content, .summary-panel > .money-block { border-top: 1px solid var(--line); padding: 18px 20px 20px; }
.summary-panel > .money-block { margin: 0; }
.entry-panel { padding: 0; }
.entry-panel > summary {
  list-style: none; cursor: pointer; padding: 17px 20px; font-weight: 650;
}
.entry-panel > summary::-webkit-details-marker { display: none; }
.entry-panel > summary::after { content: "+"; float: right; color: var(--muted); font-size: 20px; font-weight: 300; }
.entry-panel[open] > summary::after { content: "−"; }
.entry-content { border-top: 1px solid var(--line); padding: 18px 20px 20px; }
.mobile-flow-sheet, .mobile-form-extra { display: contents; }
.mobile-form-more-toggle, .mobile-sheet-close, .mobile-sheet-handle { display: none; }

/* Facturen lezen: eerst vertrouwen, daarna het document. */
.local-promise {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 12px;
  border: 1px solid var(--green-line); border-radius: var(--radius-md); background: var(--green-soft);
}
.local-promise-icon { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: var(--radius-sm); background: var(--paper); color: var(--green); }
.local-promise-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.local-promise-copy strong, .local-promise-copy > span { display: block; }
.local-promise-copy { min-width: 0; }
.local-promise strong { font-size: 13px; line-height: 1.25; font-weight: 650; }
.local-promise div > span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.drop { padding: 54px 22px; border-color: var(--green-line); }
.drop strong { font-size: 18px; }
.read-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 18px; }
.read-step {
  display: flex; align-items: center; gap: 10px; padding: 12px 13px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); color: var(--muted);
}
.read-step > span { display: grid; place-items: center; width: 25px; height: 25px; flex: none; border-radius: 50%; background: var(--surface-soft); font-size: 12px; font-weight: 700; }
.read-step strong, .read-step small { display: block; }
.read-step strong { color: var(--ink); font-size: 13px; }
.read-step small { font-size: 11px; }
.read-step.is-active { border-color: var(--green-line); background: var(--green-soft); }
.read-step.is-active > span { background: var(--green); color: #fff; }
.read-step.is-done > span { background: var(--green); color: #fff; }
.read-step.is-done > span::before { content: "✓"; }
.read-step.is-done > span { font-size: 0; }

.view-switch {
  display: inline-flex; gap: 3px; padding: 3px; margin-top: 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft);
}
.view-switch button { border: 0; background: transparent; color: var(--muted); padding: 6px 12px; }
.view-switch button.is-active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(25,45,35,.1); }
.detail-grid { grid-template-columns: minmax(340px, .92fr) minmax(400px, 1.08fr); }
.detail-grid.is-document { grid-template-columns: 1fr; }
.document-panel { position: sticky; top: 24px; }
.detail-grid.is-document .document-panel { position: static; }
.detail-grid.is-document .doc-frame { height: calc(100vh - 230px); min-height: 650px; }
.recognition-panel { border-color: var(--green-line); }
.recognition-panel h2 { margin-bottom: 14px; }
.recognition-grid { display: grid; gap: 9px; }
.recognition-item {
  display: grid; grid-template-columns: 118px 1fr; gap: 12px; align-items: baseline;
  padding: 9px 11px; border-radius: var(--radius-sm); background: var(--surface-soft);
}
.recognition-item span { color: var(--muted); font-size: 12px; }
.recognition-item strong { font-size: 14px; }
.recognition-item strong.is-missing { color: var(--amber); }
.recognition-status { display: inline-flex; align-items: center; gap: 7px; margin: 13px 0 0; }
.recognition-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.recognition-status.needs-review::before { background: var(--amber); }
.inline-link { padding: 6px 0; margin-top: 5px; }
.field-needs-review label > span::after {
  content: "even controleren"; float: right; margin-left: 8px; padding: 1px 6px;
  border-radius: var(--radius-pill); background: var(--amber-soft); color: var(--amber); font-size: 11px;
}
.field-needs-review :is(input, select) { border-color: var(--amber-line); background: var(--amber-soft); }

.theme-setting { margin-top: 18px; border-top: 1px solid var(--line); border-bottom: 0; }
.theme-switch { width: 230px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); }
.theme-switch button { color: var(--muted); }
.theme-switch button.is-active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(25,45,35,.1); }

:root[data-theme="dark"] .nav-icon { filter: brightness(0) invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-icon { filter: brightness(0) invert(1); }
}

@media (max-width: 900px) {
  .main { padding: 30px 28px 60px; }
  .read-steps { grid-template-columns: 1fr; }
  .document-panel { position: static; }
}

@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { background: var(--paper); border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-foot { border-left-color: var(--line); }
  .privacy-note { display: none; }
  .nav-button.is-active { background: var(--green-soft); color: var(--green); }
  .main { padding: 22px 16px 48px; }
  .page-title-row { align-items: flex-end; }
  .page-head h1 { font-size: 25px; }
  .read-steps { display: none; }
  .view-switch { display: flex; }
  .view-switch button { flex: 1; }
  .detail-grid.is-document .doc-frame { min-height: 520px; height: 68vh; }
  .recognition-item { grid-template-columns: 1fr; gap: 1px; }
  .theme-switch { display: flex; width: 100%; }
  .theme-setting { align-items: stretch; flex-direction: column; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.55 "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: var(--radius-xs); }
.sidebar :focus-visible { outline-color: #fff; }

/* ---- raamwerk ---------------------------------------------------------- */

.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { padding: 0 10px 18px; }
.brand strong { display: block; font-size: 15px; letter-spacing: .2px; }
.brand small { color: var(--nav-muted); font-size: 12px; }

.nav-button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--nav-muted);
  font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.nav-button:hover { background: var(--navy-soft); color: #fff; }
.nav-button.is-active { background: var(--navy-soft); color: #fff; font-weight: 600; }
/* De pictogrammen zijn donkere glyphs op een transparante achtergrond. Op de
   donkerblauwe zijbalk zijn ze daardoor onleesbaar; dit maakt ze wit. */
.nav-icon {
  width: 18px; height: 18px; flex: none;
  filter: brightness(0) invert(1);
  opacity: .72;
}
.nav-button:hover .nav-icon { opacity: .92; }
.nav-button.is-active .nav-icon { opacity: 1; }
.nav-count {
  margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: var(--radius-pill);
  background: var(--danger); color: var(--on-danger); font-size: 12px; font-weight: 600; text-align: center;
}
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); }

.theme-switch { display: flex; gap: 4px; padding: 4px; }
.theme-switch button {
  flex: 1; padding: 5px; border: 0; border-radius: var(--radius-xs); cursor: pointer;
  background: transparent; color: var(--nav-muted); font: inherit; font-size: 12px;
}
.theme-switch button.is-active { background: var(--navy-soft); color: #fff; }

.main { padding: 28px 32px 64px; max-width: 1080px; }
.page-back {
  display: inline-flex; align-items: center; gap: 3px;
  min-height: 40px; margin: 0 0 2px -9px; padding: 6px 9px;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--blue-strong); font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.page-back:hover { background: var(--hover); }
.page-back .summa-icon { width: 17px; height: 17px; }

.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: 25px; letter-spacing: -.2px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.page-head .row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }

/* ---- bouwstenen -------------------------------------------------------- */

.panel {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 18px;
}
.panel > h2 { margin: 0 0 14px; font-size: 16px; }
.panel > h2 + p { margin-top: -10px; }
.panel-note { color: var(--muted); font-size: 13px; margin: 0 0 14px; }

/* Precies één kopgetal per scherm. Meer dan één is in versie 3 de reden
   geweest dat dezelfde vraag vier antwoorden kreeg. */
.headline { margin: 0 0 20px; }
.headline > span { display: block; color: var(--muted); font-size: 13px; }
.headline strong { display: block; font-size: 34px; letter-spacing: -.6px; line-height: 1.2; }
.headline small { color: var(--muted); font-size: 13px; }

button, .button {
  font: inherit; font-size: 14px; padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  cursor: pointer;
}
button:hover, .button:hover { background: var(--hover); }
.button { display: inline-flex; align-items: center; text-decoration: none; }
button.primary { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
button.primary:hover { filter: brightness(1.07); }
button.quiet { border-color: transparent; background: transparent; color: var(--muted); }
button.quiet:hover { background: var(--hover); color: var(--ink); }
button.danger { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
button:disabled { opacity: .5; cursor: not-allowed; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
label > span { display: block; margin-bottom: 3px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink);
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper);
}
textarea { min-height: 70px; resize: vertical; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.template-card {
  margin: 16px 0; padding: 16px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface-soft);
}
.template-card h3 { margin: 0 0 12px; font-size: 15px; }
.template-card textarea { min-height: 150px; line-height: 1.5; background: var(--paper); }
.template-card input { background: var(--paper); }
.template-card > small { display: block; color: var(--muted); font-size: 12px; }
.template-card code { color: var(--ink); }
/* Twee kolommen op het factuurdetail: anders is het een lange sliert waarvoor
   je moet scrollen om er iets uit te halen. */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.field-grid label { margin-bottom: 6px; }
.field-grid .field-source { margin: -4px 0 8px; }
.field-grid > .wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .field-grid { grid-template-columns: 1fr; } }
.detail-edit-section {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
}
.detail-edit-section h3 { margin: 0 0 12px; font-size: 15px; }
.detail-edit-section .detail-section-note {
  margin: -7px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.45;
}
.detail-review-summary {
  margin-top: 14px; padding: 10px 12px; border: 1px solid var(--amber-line);
  border-radius: var(--radius-sm); background: var(--amber-soft); color: var(--amber);
  font-size: 13px; font-weight: 500; line-height: 1.5;
}
.detail-review-summary.is-complete {
  border-color: var(--green-line); background: var(--green-soft); color: var(--green);
}
.detail-vat-summary {
  margin-top: 14px; padding: 14px; border: 1px solid var(--green-line);
  border-radius: var(--radius-sm); background: var(--green-soft);
}
.detail-vat-summary.needs-review { border-color: var(--amber-line); background: var(--amber-soft); }
.detail-vat-heading { display: flex; align-items: flex-start; gap: 10px; }
.detail-vat-icon { width: 20px; height: 20px; flex: none; color: var(--green); }
.detail-vat-summary.needs-review .detail-vat-icon { color: var(--amber); }
.detail-vat-heading strong { display: block; color: var(--ink); font-size: 13px; }
.detail-vat-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.detail-vat-rates { display: grid; gap: 6px; margin-top: 12px; }
.detail-vat-rate {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) minmax(0, 1fr); gap: 8px;
  padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--paper) 72%, transparent);
  font-size: 12px; font-variant-numeric: tabular-nums;
}
.detail-vat-rate span { color: var(--muted); }
.detail-vat-total { margin: 10px 0 0; color: var(--ink); font-size: 12px; font-weight: 650; }
@media (max-width: 560px) {
  .detail-vat-rate { grid-template-columns: 38px 1fr; }
  .detail-vat-rate span:last-child { grid-column: 2; }
}
.detail-extra-fields { margin-top: 18px; }
.remember-advanced {
  margin-top: 12px; padding-top: 4px; border-top: 1px dashed var(--line);
}
.remember-advanced > summary {
  min-height: 40px; color: var(--muted); font-size: 12px;
}
.remember-advanced > label { margin-top: 8px; }
.invoice-source-facts {
  grid-column: 1 / -1; margin-top: 12px; padding-top: 4px; border-top: 1px dashed var(--line);
}
.invoice-source-facts > summary { min-height: 42px; font-size: 13px; font-weight: 650; }
.invoice-source-facts > p { margin: 8px 0; color: var(--muted); font-size: 12px; }
.invoice-source-lines { display: grid; margin-top: 8px; border-top: 1px solid var(--line); }
.invoice-source-line { padding: 10px 0; border-bottom: 1px solid var(--line); }
.invoice-source-line-main {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline;
}
.invoice-source-line-main strong { min-width: 0; font-size: 13px; font-weight: 550; }
.invoice-source-line-main span { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.invoice-source-line small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.invoice-source-vat { font-variant-numeric: tabular-nums; }
.invoice-source-warning { color: var(--amber) !important; }
#detailDataPanel.is-expense-data .field-key-total input { font-weight: 700; }
.inline { display: flex; align-items: center; gap: 8px; }
.inline input[type="checkbox"] { width: auto; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; color: var(--ink); }
.check input { width: auto; margin-top: 3px; flex: none; }
.check small { display: block; color: var(--muted); font-size: 13px; }

/* ---- Vandaag: de actielijst is het scherm ------------------------------ */

.today-list { display: flex; flex-direction: column; gap: 10px; }
.today-row {
  display: flex; align-items: center; gap: 6px; width: 100%; text-align: left;
  padding: 0 8px 0 0; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow);
}
.today-row:hover { background: var(--hover); }
.today-row-main {
  display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0;
  padding: 15px 9px 15px 17px; border: 0; background: transparent;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.today-row-main:hover { background: transparent; }
.today-row .body { flex: 1; min-width: 0; }
.today-row strong { display: block; font-size: 15px; font-weight: 600; }
.today-row small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.today-row .value { color: var(--muted); font-size: 14px; white-space: nowrap; }
.today-dismiss {
  flex: none; padding: 7px 9px; border: 0; background: transparent;
  color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; opacity: .65;
}
.today-dismiss:hover, .today-dismiss:focus-visible { background: var(--surface-soft); color: var(--ink); opacity: 1; }
.today-row .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.today-row.is-alarm { border-color: var(--danger-line); background: var(--danger-soft); }
.today-row.is-alarm .dot { background: var(--danger); }
.today-row.is-werk { border-color: var(--amber-line); background: var(--amber-soft); }
.today-row.is-werk .dot { background: var(--amber); }
.today-row.is-rustig .dot { background: var(--info); }
.today-empty {
  padding: 44px 20px; text-align: center; color: var(--muted);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
}
.today-empty strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }
.today-mobile-dashboard { display: none; }

/* ---- lijsten ----------------------------------------------------------- */

.list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  padding: 12px 15px; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--ink); font: inherit; cursor: pointer;
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--hover); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row strong { display: block; font-size: 14px; font-weight: 600; }
.list-row small { display: block; color: var(--muted); font-size: 13px; }
.list-row .amount { font-variant-numeric: tabular-nums; font-size: 14px; white-space: nowrap; }
.bank-row { cursor: default; padding-right: 10px; }
.bank-row .bank-category { color: var(--green); }
.bank-actions { flex-wrap: nowrap; }
.bank-actions button { padding-inline: 8px; }
.bank-check { margin-left: 1px; }
.invoice-list-row { gap: 7px; padding: 0 10px 0 0; cursor: default; }
.invoice-row-open {
  display: flex; align-items: center; gap: 13px; flex: 1; min-width: 0;
  padding: 12px 5px 12px 15px; border: 0; background: transparent;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.invoice-row-open:hover { background: transparent; }
.invoice-due {
  display: inline-flex !important; width: max-content; max-width: 100%;
  margin-top: 5px; padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--blue-soft); color: var(--blue-dark) !important;
  font-size: 11px !important; font-weight: 650; line-height: 1.45;
}
.invoice-due.is-paid { background: var(--surface-soft); color: var(--muted) !important; }
.invoice-due.is-today { background: var(--amber-soft); color: var(--amber) !important; }
.invoice-due.is-overdue { background: var(--danger-soft); color: var(--danger) !important; }
.payment-check {
  display: grid; place-items: center; width: 29px; height: 29px; flex: none;
  padding: 0; border: 1.5px solid var(--line); border-radius: 50%;
  background: var(--paper); color: var(--muted); cursor: pointer;
}
.payment-check span { display: block; font-size: 17px; font-weight: 750; line-height: 1; opacity: .35; transform: translateY(-.5px); }
.payment-check:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.payment-check:hover span { opacity: 1; }
.payment-check.is-completing {
  border-color: var(--green); background: var(--green); color: #fff;
  animation: payment-complete 550ms ease forwards;
}
.payment-check.is-completing span { opacity: 1; }
@keyframes payment-complete {
  0% { opacity: 1; transform: scale(1); }
  45% { opacity: 1; transform: scale(1.14); }
  100% { opacity: 0; transform: scale(.72); }
}
@media (prefers-reduced-motion: reduce) {
  .payment-check.is-completing { animation: none; opacity: 0; }

  .audit-panel > summary::after { transition: none; }
}
.list-head {
  padding: 9px 15px; background: var(--surface-soft); border-bottom: 1px solid var(--line);
  font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}
.empty { padding: 30px 18px; text-align: center; color: var(--muted); font-size: 14px; }

/* De statusstip is het enige oordeel in de lijst; het woord staat in de tooltip. */
.state { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--line); }
.state.is-klopt { background: var(--green); }
.state.is-verschil { background: var(--danger); }
.state.is-aandacht { background: var(--amber); }
.state.is-open { background: var(--line); border: 1px solid var(--muted); }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: 12px; border: 1px solid var(--line); background: var(--surface-soft); color: var(--muted);
}
.tag.good { background: var(--green-soft); border-color: var(--green-line); color: var(--green); }
.tag.warn { background: var(--amber-soft); border-color: var(--amber-line); color: var(--amber); }
.tag.bad { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.tag.bad { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }

/* ---- Geld: drie blokken onder elkaar ----------------------------------- */

.money-block { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.money-block:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.money-block h3 { margin: 0 0 3px; font-size: 15px; }
.money-block .figure { font-size: 26px; font-weight: 600; letter-spacing: -.4px; }
.money-block .sub { color: var(--muted); font-size: 13px; }

#rememberPanel.is-suggested {
  border-top: 1px solid var(--line); border-radius: 0;
  background: transparent; padding: 12px 0 0;
}
#rememberPanel.is-suggested > summary { color: var(--ink); font-weight: 650; }
#rememberPanel.is-suggested #rememberSave {
  border-color: var(--line); background: var(--surface-soft); color: var(--ink); font-weight: 650;
}
#rememberPanel.is-suggested #rememberSave:hover {
  border-color: var(--muted); background: var(--hover);
}


/* ---- Controle ---------------------------------------------------------- */

.checks-summary { margin: 14px 0 12px; color: var(--muted); font-size: 13px; }
.checks-list { display: grid; gap: 8px; border: 0; background: transparent; }
.check-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper);
}
.check-open {
  display: grid; gap: 4px; min-width: 0; padding: 0; border: 0;
  background: transparent; text-align: left; cursor: pointer;
}
.check-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.check-head > strong {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px; color: var(--ink);
}
.check-amount { font-size: 14px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.check-meta { color: var(--muted); font-size: 11.5px; }
.check-reasons { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.check-reasons > i {
  padding: 2px 8px; border: 1px solid var(--amber-line); border-radius: var(--radius-pill);
  color: var(--amber); font-size: 11px; font-style: normal; font-weight: 600;
}
.check-action { min-height: 40px; padding: 0 14px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.check-action.is-approve {
  border-color: var(--green-line); background: var(--green-soft); color: var(--green);
}
.check-action.is-approve:hover {
  border-color: var(--green); background: color-mix(in srgb, var(--green-soft) 82%, var(--green));
}
.checks-list > .empty { padding: 22px 4px; color: var(--muted); }

.bars { display: flex; align-items: flex-end; gap: 5px; height: 128px; margin: 16px 0 6px; }
.bars.is-empty { height: auto; margin: 6px 0 0; }
.bars.is-empty .empty { width: 100%; padding: 16px 0 4px; text-align: left; }
.bar-month { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; }
.bar-month .stack { display: flex; align-items: flex-end; gap: 2px; height: 100%; }
.bar-month .bar { flex: 1; border-radius: 3px 3px 0 0; min-height: 2px; }
.bar.revenue { background: var(--chart-revenue); }
.bar.costs { background: var(--chart-costs); }
.bars.has-negative .bar-month .stack { flex-direction: column; align-items: stretch; gap: 0; }
.bars.has-negative .bar-month .half { flex: 1 1 50%; display: flex; min-height: 0; }
.bars.has-negative .bar-month .half.is-up { align-items: flex-end; border-bottom: 1px solid var(--line); }
.bars.has-negative .bar-month .half.is-down { align-items: flex-start; }
.bars.has-negative .bar-month .half > .bar { width: 100%; }
.bars.has-negative .bar-month .half.is-down > .bar { border-radius: 0 0 var(--radius-xs) var(--radius-xs); }
.bar-month .label { text-align: center; color: var(--muted); font-size: 12px; }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 13px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: var(--radius-xs); margin-right: 5px; }

.progress { height: 9px; border-radius: var(--radius-pill); background: var(--hover); overflow: hidden; margin: 9px 0 5px; }
.progress > span { display: block; height: 100%; background: var(--green); }

/* Geld: vier vaste keuzes boven, één breed informatiepaneel eronder. */
.money-card-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
  margin-bottom: 18px;
}
.money-card-button {
  min-width: 0; min-height: 142px; padding: 20px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); box-shadow: var(--shadow);
}
.money-card-button:hover { border-color: var(--blue); background: var(--paper); }
.money-card-button.is-active {
  border-color: var(--blue); background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--blue), var(--shadow);
}
.money-card-label {
  display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center;
  column-gap: 8px; min-height: 20px; margin-bottom: 7px;
  color: var(--muted); font-size: 12px; line-height: 1;
  font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
}
.money-card-value {
  display: block; color: var(--ink); font-size: 29px; font-weight: 700;
  line-height: 1.12; letter-spacing: -.55px;
}
.money-card-meta {
  display: block; margin-top: 7px; color: var(--muted); font-size: 13px;
  font-weight: 400; line-height: 1.35;
}
.money-detail { margin: 0; padding: 24px; }
.money-detail > h2 { margin-bottom: 14px; }
.money-detail-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  margin-bottom: 16px;
}
.money-detail-head span, .money-detail-head strong, .money-detail-head small { display: block; }
.money-detail-head span, .money-detail-head small, .money-detail-head p {
  color: var(--muted); font-size: 13px;
}
.money-detail-head strong { color: var(--ink); font-size: 25px; letter-spacing: -.35px; }
.money-detail-head p { margin: 0; }
.money-detail-note { margin-top: 14px; }
.money-facts { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.money-facts small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.money-detail .money-section-title { margin: 22px 0 10px; font-size: 14px; }
.money-vat-quarters { margin-bottom: 14px; }
.money-export-actions { margin-top: 14px; }
.settings-subsection {
  margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line);
}
.settings-subsection h2 { margin: 0 0 3px; }
.settings-subsection .panel-note { margin: 0; }

@media (max-width: 1100px) {
  .money-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- factuurdetail: drie blokken in plaats van negen ------------------- */

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.doc-frame { width: 100%; height: 620px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); }
.doc-preview {
  display: block; width: 100%; height: auto; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: white; object-fit: contain;
}
.doc-preview[hidden] { display: none; }
.document-title-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.document-title-row h2 { margin: 0; font-size: 16px; }
.document-actions { display: flex; gap: 6px; }
.document-actions .button { padding: 6px 9px; color: var(--muted); font-size: 12px; text-decoration: none; }
.document-actions .button:hover { background: var(--hover); color: var(--ink); }

.payment-panel { border-color: var(--line); }
.payment-panel.is-betaald { border-color: var(--green-line); }
.payment-panel.is-te-laat { border-color: var(--danger-line); }
.payment-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.payment-main h2 { margin: 0 0 3px; font-size: 22px; }
.payment-icon {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--blue-soft); color: var(--blue);
}
.payment-icon .summa-icon { width: 44px; height: 44px; stroke-width: 1.4; }
.payment-panel.is-betaald .payment-icon { background: var(--green-soft); color: var(--green); }
.payment-panel.is-te-laat .payment-icon { background: var(--danger-soft); color: var(--danger); }
.payment-text { flex: 1 1 auto; min-width: 0; }
.payment-panel.is-betaald h2 { color: var(--green); }
.payment-panel.is-te-laat h2 { color: var(--danger); }
.payment-main .panel-note { margin: 0; }
.payment-amount { flex: none; color: var(--ink); font-size: 25px; font-variant-numeric: tabular-nums; }
.payment-actions { display: flex; align-items: center; gap: 9px; }
.payment-actions button { margin: 0; }
.message-box { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.message-action { margin-top: 13px; padding: 13px; border-radius: var(--radius-sm); background: var(--surface-soft); }
.message-action > strong { display: block; font-size: 14px; }
.message-action > p { margin: 3px 0 10px; color: var(--muted); font-size: 13px; }
.message-action > small { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.calculation {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px;
  margin-top: 12px; padding: 11px 12px; border-radius: var(--radius-sm); background: var(--surface-soft);
}
.calculation div { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.calculation span { color: var(--muted); }
.calculation strong { font-variant-numeric: tabular-nums; }

.panel.audit-panel { padding: 0; overflow: hidden; }
.audit-panel > summary {
  display: flex; align-items: center; padding: 16px 18px; cursor: pointer; list-style: none;
}
.audit-panel > summary::-webkit-details-marker { display: none; }
.audit-panel > summary > span { display: block; min-width: 0; }
.audit-panel > summary strong, .audit-panel > summary small { display: block; }
.audit-panel > summary strong { color: var(--ink); font-size: 14px; }
.audit-panel > summary small { color: var(--muted); font-size: 12px; font-weight: 400; }
.audit-panel > summary::after {
  content: ""; flex: 0 0 auto; width: 9px; height: 9px; margin: 0 3px 0 auto;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  border-radius: 1px; transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .18s ease;
}
.audit-panel[open] > summary::after { transform: rotate(-135deg) translate(-3px, -3px); }
.audit-panel.has-attention > summary small { color: var(--amber); font-weight: 550; }
.audit-content { padding: 18px; border-top: 1px solid var(--line); }

.danger-zone { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.danger-zone .panel-note { margin: 8px 0 0; font-size: 12px; }
#detailDataPanel .danger-zone { border-top: 0; }

.verdict { border-radius: var(--radius); border: 1px solid var(--line); padding: 15px; margin-bottom: 13px; }
.verdict.good { background: var(--green-soft); border-color: var(--green-line); }
.verdict.bad { background: var(--danger-soft); border-color: var(--danger-line); }
.verdict.warn { background: var(--amber-soft); border-color: var(--amber-line); }
.verdict h3 { margin: 0 0 5px; font-size: 15px; }

/* Een uitkomst zonder problemen hoeft geen halve pagina te vullen: hij klapt
   dicht tot één regel met een vinkje, en open als je hem wilt nalezen. */
.verdict > summary {
  cursor: pointer; list-style: none; font-size: 15px; font-weight: 600;
  display: flex; align-items: center; gap: 9px;
}
.verdict > summary::-webkit-details-marker { display: none; }
.verdict > summary::before {
  content: "✓"; font-weight: 700; color: var(--green); width: 15px; flex: none;
}
.verdict.warn > summary::before, .verdict.bad > summary::before { content: "!"; }
.verdict.warn > summary::before { color: var(--amber); }
.verdict.bad > summary::before { color: var(--danger); }
.verdict > summary::after {
  content: "toon"; margin-left: auto; font-weight: 400; font-size: 13px; color: var(--muted);
}
.verdict[open] > summary::after { content: "verberg"; }
.verdict[open] > summary { margin-bottom: 9px; }
.verdict .req:first-of-type { margin-top: 4px; }
.verdict ul { margin: 7px 0 0; padding-left: 19px; font-size: 14px; }
.verdict li { margin-bottom: 3px; }

.req { display: flex; gap: 9px; align-items: baseline; font-size: 14px; padding: 3px 0; }
.req .mark { width: 15px; flex: none; font-weight: 700; }
.req.is-ok .mark { color: var(--green); }
.req.is-ontbreekt .mark { color: var(--danger); }
.req.is-handmatig { color: var(--muted); }

details.more { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 6px; }
details.more > summary { cursor: pointer; font-size: 14px; color: var(--muted); padding: 4px 0; }
details.more[open] > summary { color: var(--ink); margin-bottom: 10px; }

.rate-schedule {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 14px;
  margin: 12px 0 14px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-soft);
}
.rate-schedule .panel-note { grid-column: 1 / -1; margin: 2px 0 0; }

.field-source { color: var(--muted); font-size: 12px; margin: -7px 0 10px; }

/* ---- meldingen: één kanaal -------------------------------------------- */

.banner {
  border-radius: var(--radius); padding: 12px 15px; margin-bottom: 16px; font-size: 14px;
  border: 1px solid var(--amber-line); background: var(--amber-soft); color: var(--amber);
  display: flex; gap: 12px; align-items: center;
}
.banner.bad { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger); }
.banner .grow { flex: 1; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 11px 17px; border-radius: var(--radius-pill);
  box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center;
  font-size: 14px; z-index: 90;
}
.toast button { background: transparent; border: 0; color: #fff; text-decoration: underline; padding: 0; font-size: 14px; }

.drop {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 40px 20px;
  text-align: center; color: var(--muted); background: var(--paper);
}
.drop.is-over { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.drop strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

.settings-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.settings-nav button.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }

.reset-zone { margin-top: 18px; border-top: 1px solid var(--line); }
.reset-zone > summary {
  display: flex; align-items: center; gap: 10px; min-height: 52px;
  color: var(--muted); cursor: pointer; list-style: none; font-size: 13px;
}
.reset-zone > summary::-webkit-details-marker { display: none; }
.reset-zone > summary span { color: var(--ink); font-weight: 650; }
.reset-zone > summary small { margin-left: auto; color: var(--muted); font-size: 12px; }
.reset-zone > summary::after { content: "+"; color: var(--muted); font-size: 18px; font-weight: 300; }
.reset-zone[open] > summary::after { content: "−"; }
.reset-zone-content { padding: 16px 0 0; border-top: 1px solid var(--danger-line); }
.reset-zone-head { margin-bottom: 8px; }
.reset-zone h3 { margin: 0 0 4px; font-size: 16px; color: var(--danger); }
.reset-zone p { margin: 0; color: var(--muted); font-size: 13px; }
.reset-choice {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 15px 0; border-bottom: 1px solid var(--line);
}
.reset-choice:last-child { border-bottom: 0; padding-bottom: 0; }
.reset-choice > div { min-width: 0; }
.reset-choice strong, .reset-choice small { display: block; }
.reset-choice strong { margin-bottom: 3px; font-size: 14px; color: var(--ink); }
.reset-choice small { max-width: 690px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.reset-choice button { flex: none; }
.reset-choice.is-final { margin-top: 2px; }

.reset-dialog {
  width: min(520px, calc(100vw - 32px)); padding: 22px; border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--paper); color: var(--ink); box-shadow: 0 24px 80px rgba(0,0,0,.22);
}
.reset-dialog::backdrop { background: rgba(20,20,20,.46); backdrop-filter: blur(2px); }
.reset-dialog-body { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
.reset-dialog h2 { margin: 0 0 6px; font-size: 20px; }
.reset-dialog p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.reset-warning-icon {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--danger-soft); color: var(--danger); font-weight: 750;
}
.reset-impact {
  margin: 16px 0; padding: 12px 13px; border: 1px solid var(--danger-line);
  border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: 13px; line-height: 1.5;
}
.reset-confirm-label { margin: 0; color: var(--ink); }
.reset-confirm-label code { padding: 2px 5px; border-radius: var(--radius-xs); background: var(--surface-soft); font-weight: 700; }
.reset-confirm-label input { margin-top: 7px; }
.reset-dialog-error {
  margin: 12px 0 0; padding: 10px 11px; border: 1px solid var(--danger-line);
  border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger);
  font-size: 13px; line-height: 1.45;
}
.reset-dialog-actions { justify-content: flex-end; margin-top: 18px; }

.bank-edit-dialog { width: min(640px, calc(100vw - 32px)); }
.receipt-scan-dialog { width: min(560px, calc(100vw - 32px)); }
.receipt-preview {
  display: grid; place-items: center; min-height: 220px; max-height: 52vh;
  margin-top: 18px; overflow: hidden; border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--surface-soft);
}
.receipt-preview img { display: block; width: 100%; max-height: 52vh; object-fit: contain; }
.receipt-scan-status { min-height: 21px; margin: 12px 0 0 !important; }
.bank-edit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.bank-edit-head .dialog-close {
  width: 34px; height: 34px; flex: none; padding: 0; border-radius: 50%;
  font-size: 22px; line-height: 1;
}
.bank-edit-fields { margin-top: 18px; }
.bank-learn-check {
  margin: 15px 0 0; padding: 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface-soft);
}
.bank-learn-check strong { display: block; font-size: 14px; }
.bank-edit-dialog .bank-edit-guard { margin-top: 10px; font-size: 12px; }

.setting-row {
  display: flex; gap: 18px; align-items: center; justify-content: space-between;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.setting-row:last-child { border-bottom: 0; }
.setting-row .setting-label strong { display: block; font-size: 14px; }
.setting-row .setting-label small { color: var(--muted); font-size: 13px; }
.setting-row > *:last-child { flex: none; }

.demo-settings-panel { margin-bottom: 18px; }
.demo-mode-status { margin: 0; }
.demo-switch { display: inline-flex; flex: none; margin: 0; cursor: pointer; }
.demo-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.demo-switch span {
  position: relative; display: block; width: 52px; height: 30px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--surface-soft); transition: .18s ease;
}
.demo-switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--paper); box-shadow: 0 1px 4px rgba(16, 24, 40, .2);
  transition: transform .18s ease;
}
.demo-switch input:checked + span { border-color: var(--blue); background: var(--blue); }
.demo-switch input:checked + span::after { transform: translateX(22px); }
.demo-switch input:focus-visible + span { outline: 3px solid var(--mobile-focus); outline-offset: 2px; }
.demo-switch input:disabled + span { opacity: .55; cursor: wait; }
.modern-demo-badge {
  margin-left: 3px; padding: 3px 7px; border: 1px solid #b9ccff; border-radius: var(--radius-pill);
  background: #edf3ff; color: #155cf6; font-size: 11px; font-weight: 750;
  letter-spacing: .08em; text-transform: uppercase;
}
.demo-mode .privacy-dot { background: var(--blue); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.facts div { background: var(--surface-soft); border-radius: var(--radius-sm); padding: 11px 13px; }
.facts span { display: block; color: var(--muted); font-size: 13px; }
.facts strong { font-size: 16px; }

@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; top: 0; z-index: 20; height: auto;
    flex-direction: row; align-items: center; overflow-x: auto; padding: 8px 10px; gap: 2px;
  }
  .brand { display: none; }
  /* Instellingen blijft een gewoon menu-item; alleen de themakeuze verhuist
     naar het scherm zelf, want die past niet in een rij van zes. */
  .sidebar-foot {
    margin: 0; padding: 0; border: 0; border-left: 1px solid rgba(255,255,255,.14);
    padding-left: 6px; margin-left: 4px;
  }
  .theme-switch { display: none; }
  .nav-button {
    flex-direction: column; gap: 3px; font-size: 12px; padding: 7px 9px;
    white-space: nowrap; width: auto;
  }
  .nav-count { position: absolute; margin: 0; transform: translate(16px, -6px); }
  .nav-button { position: relative; }
  .main { padding: 18px 15px 48px; }
  .page-head h1 { font-size: 22px; }
  .headline strong { font-size: 29px; }
  .today-row { padding: 13px 14px; }
  .field-row { grid-template-columns: 1fr; }
  .calculation, .rate-schedule { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .bank-row { align-items: flex-start; flex-wrap: wrap; }
  .bank-row .grow { flex-basis: calc(100% - 100px); }
  .bank-actions { order: 4; margin-left: 0; }
  .bank-check { margin-left: auto; }
}

/* Deze regels staan bewust als laatste: ze bepalen het nieuwe raamwerk boven
   de generieke bouwstenen die ook door oudere schermen worden gebruikt. */
.app { grid-template-columns: 248px minmax(0, 1fr); }
.sidebar {
  background: var(--paper); color: var(--ink); border-right: 1px solid var(--line);
  padding: 24px 15px; gap: 5px;
}
.sidebar :focus-visible { outline-color: var(--green); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 9px 26px; }
.brand strong { font-size: 15px; letter-spacing: .1px; }
.brand small { display: block; color: var(--muted); }
.nav-button { color: var(--muted); padding: 10px 11px; }
.nav-button:hover { background: var(--hover); color: var(--ink); }
.nav-button.is-active { background: var(--green-soft); color: var(--green); }
.nav-icon { filter: none; opacity: .58; }
.nav-button:hover .nav-icon, .nav-button.is-active .nav-icon { opacity: .82; }
.sidebar-foot { border-top-color: var(--line); }
.main { width: 100%; max-width: 1240px; padding: 40px 48px 72px; }
.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: 29px; letter-spacing: -.65px; line-height: 1.2; }
.page-head .row { align-items: center; }
.panel { box-shadow: var(--shadow); padding: 20px; }
.headline strong { font-size: 38px; font-weight: 650; }
button, .button, input, select, textarea { border-radius: var(--radius-sm); }
.drop { padding: 54px 22px; border-color: var(--green-line); }
.drop strong { font-size: 18px; }
.detail-grid { grid-template-columns: minmax(340px, .92fr) minmax(400px, 1.08fr); }
.detail-grid.is-document { grid-template-columns: 1fr; }
.theme-switch { display: flex; width: 230px; }
.theme-switch button { color: var(--muted); }
.theme-switch button.is-active { background: var(--paper); color: var(--ink); }

:root[data-theme="dark"] .nav-icon { filter: brightness(0) invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-icon { filter: brightness(0) invert(1); }
}

@media (max-width: 900px) {
  .main { padding: 30px 28px 60px; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { background: var(--paper); border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; }
  .brand { display: none; }
  .sidebar-foot { border-left-color: var(--line); }
  .privacy-note { display: none; }
  .main { padding: 22px 16px 48px; }
  .page-head h1 { font-size: 25px; }
  .headline strong { font-size: 31px; }
  .theme-switch { display: flex; width: 100%; }
}

/* ---- Summa ----------------------------------------------------------
 * Licht, stil en functioneel. Zwart geeft richting; kleur verschijnt alleen
 * wanneer een status inhoudelijk iets betekent.
 * -------------------------------------------------------------------- */

:root {
  color-scheme: light;
  --blue: #2d5bde;
  --blue-dark: #2146b5;
  --blue-soft: #eaf0ff;
  --slate: #9299a5;
  --ink: #17181c;
  --muted: #656c79;
  --line: #e3e5e8;
  --paper: #ffffff;
  --canvas: #f7f8fa;
  --surface-soft: #f7f8fa;
  --hover: #eaf0ff;
  --navy: #2d5bde;
  --navy-soft: #2146b5;
  --nav-muted: #6b7280;
  --green: #1f7a5b;
  --green-soft: #eaf6f1;
  --green-line: #bcdcca;
  --amber: #8a5a00;
  --amber-soft: #fff4e0;
  --amber-line: #f0d5a8;
  --blue-strong: #1e3fa8;
  --danger: #b33a35;
  --on-danger: #ffffff;
  --danger-soft: #fff1f0;
  --danger-line: #efc8c5;
  --info: #2d5bde;
  --info-soft: #eaf0ff;
  --info-line: #c8d5fb;
  --chart-revenue: #2d5bde;
  --chart-costs: #9299a5;
  --shadow: 0 1px 2px rgba(23, 24, 28, .05), 0 5px 14px rgba(23, 24, 28, .04);
  --radius: 14px;
  --radius-xs: 4px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --mobile-panel: #ffffff; --mobile-row: #ffffff; --mobile-bar: rgba(255, 255, 255, .94);
  --mobile-secondary: #ffffff; --mobile-focus: rgba(45, 91, 222, .2);
  --mobile-nav-icon: none;
  --mobile-nav-icon-active: brightness(0) saturate(100%) invert(36%) sepia(91%) saturate(1589%) hue-rotate(211deg) brightness(91%) contrast(94%);
  --modern-ink: #061437;
  --modern-accent: #155cf6;
  --modern-success: #16a13a;
  --modern-icon-blue-bg: #eef3ff;
  --modern-icon-green-bg: #ecf9f0;
  --modern-icon-orange-bg: #fff4e8;
  --modern-kpi-orange: #b0520b;
  --brand-watermark-opacity: .055;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --blue: #6f91ff; --blue-dark: #5478ed; --blue-soft: #23345f; --slate: #9299a5;
  --ink: #f5f7fa; --muted: #a6adba; --line: #343943; --paper: #191c22;
  --canvas: #111318; --surface-soft: #20242c; --hover: #263353;
  --navy: #4062d9; --navy-soft: #3352c4; --nav-muted: #a6adba;
  --green: #58b990; --green-soft: #17382c; --green-line: #28634d;
  --amber: #f0b357; --amber-soft: #3a2a12; --amber-line: #6b4c1c;
  --blue-strong: #a9bcff;
  --danger: #ff817a; --danger-soft: #3b2224; --danger-line: #6d3838;
  --on-danger: #2a0f0c;
  --info: #88a4ff; --info-soft: #23345f; --info-line: #40558d;
  --chart-revenue: #6f91ff; --chart-costs: #9299a5;
  --shadow: 0 1px 2px rgba(0, 0, 0, .28), 0 5px 16px rgba(0, 0, 0, .22);
  --mobile-panel: #171b22; --mobile-row: #1b2028; --mobile-bar: rgba(21, 25, 32, .94);
  --mobile-secondary: #171b22; --mobile-focus: rgba(111, 145, 255, .25);
  --mobile-nav-icon: brightness(0) invert(1);
  --mobile-nav-icon-active: brightness(0) saturate(100%) invert(63%) sepia(62%) saturate(1546%) hue-rotate(197deg) brightness(103%) contrast(101%);
  --modern-ink: #f5f7fa;
  --modern-accent: #7d9cff;
  --modern-success: #4fd073;
  --modern-icon-blue-bg: #25345b;
  --modern-icon-green-bg: #193c2b;
  --modern-icon-orange-bg: #412b1e;
  --modern-kpi-orange: #ff9a58;
  --brand-watermark-opacity: .088;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --blue: #6f91ff; --blue-dark: #5478ed; --blue-soft: #23345f; --slate: #9299a5;
    --ink: #f5f7fa; --muted: #a6adba; --line: #343943; --paper: #191c22;
    --canvas: #111318; --surface-soft: #20242c; --hover: #263353;
    --navy: #4062d9; --navy-soft: #3352c4; --nav-muted: #a6adba;
    --green: #58b990; --green-soft: #17382c; --green-line: #28634d;
    --amber: #f0b357; --amber-soft: #3a2a12; --amber-line: #6b4c1c;
  --blue-strong: #a9bcff;
    --danger: #ff817a; --danger-soft: #3b2224; --danger-line: #6d3838;
  --on-danger: #2a0f0c;
    --info: #88a4ff; --info-soft: #23345f; --info-line: #40558d;
    --chart-revenue: #6f91ff; --chart-costs: #9299a5;
    --shadow: 0 1px 2px rgba(0, 0, 0, .28), 0 5px 16px rgba(0, 0, 0, .22);
    --mobile-panel: #171b22; --mobile-row: #1b2028; --mobile-bar: rgba(21, 25, 32, .94);
    --mobile-secondary: #171b22; --mobile-focus: rgba(111, 145, 255, .25);
    --mobile-nav-icon: brightness(0) invert(1);
    --mobile-nav-icon-active: brightness(0) saturate(100%) invert(63%) sepia(62%) saturate(1546%) hue-rotate(197deg) brightness(103%) contrast(101%);
    --modern-ink: #f5f7fa;
    --modern-accent: #7d9cff;
    --modern-success: #4fd073;
    --modern-icon-blue-bg: #25345b;
    --modern-icon-green-bg: #193c2b;
    --modern-icon-orange-bg: #412b1e;
    --modern-kpi-orange: #ff9a58;
    --brand-watermark-opacity: .088;
  }
}

body { background: var(--canvas); color: var(--ink); }
a:not(.button) { color: var(--blue); }
:focus-visible { outline-color: var(--blue); }
.app { grid-template-columns: 236px minmax(0, 1fr); }
.sidebar {
  background: var(--paper); border-right: 1px solid var(--line); color: var(--ink);
  padding: 26px 14px; gap: 5px;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 0 12px 32px; }
.brand-logo { width: 36px; height: 36px; flex: none; object-fit: contain; }
.brand strong { font-size: 20px; font-weight: 700; line-height: 1; letter-spacing: -.35px; }
.nav-button { color: var(--muted); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 16px; }
.sidebar :focus-visible { outline-color: var(--blue); }
.nav-button:hover { background: var(--blue-soft); color: var(--blue-dark); }
.nav-button.is-active { background: var(--navy); color: #fff; font-weight: 600; }
.nav-icon { filter: none; opacity: .53; }
.nav-button.is-active .nav-icon { filter: brightness(0) invert(1); opacity: 1; }
.nav-button:hover .nav-icon { opacity: .76; }
.sidebar-foot { border-top-color: var(--line); }
.privacy-note { padding-left: 12px; }
.privacy-note strong { color: var(--ink); }
.privacy-dot { background: var(--green); width: 6px; height: 6px; }

.main { width: 100%; max-width: 1460px; padding: 42px 48px 76px; }
.page-head { margin-bottom: 30px; }
.page-head h1 { color: var(--ink); font-size: 29px; font-weight: 720; letter-spacing: -.75px; }
.page-head p { color: var(--muted); }
.eyebrow { display: none; }
.page-title-row { align-items: flex-start; }
.page-title-copy { min-width: 0; }
.page-title-copy h1 { margin: 0; }
.page-title-copy p { margin: 5px 0 0; line-height: 1.4; }
.page-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.page-header-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 620; line-height: 1; white-space: nowrap;
  box-shadow: none;
}
.page-header-action .button-icon {
  width: 18px; height: 18px; margin: 0; vertical-align: 0; stroke-width: 1.7;
}
.page-header-action.primary {
  border-color: var(--navy); background: var(--navy); color: #fff;
}
.page-header-action.primary:hover { border-color: var(--navy-soft); background: var(--navy-soft); }
.page-header-action.is-secondary {
  border-color: var(--line); background: var(--paper); color: var(--ink);
}
.page-header-action.is-secondary:hover { border-color: color-mix(in srgb, var(--blue) 32%, var(--line)); background: var(--hover); }

.panel, .today-row, .today-empty, .list {
  border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.panel { padding: 20px; }
.summary-panel, .entry-panel { padding: 0; }
button, .button { border-color: var(--line); }
button.primary {
  background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: none;
}
button.primary:hover { background: var(--navy-soft); filter: none; }
button.quiet { color: var(--muted); }
input, select, textarea { border-color: var(--line); box-shadow: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); }

.headline strong { font-size: 37px; color: var(--ink); }
.summary-panel > summary { min-height: 64px; }
.summary-panel > summary > strong { color: var(--ink); }
.facts div, .recognition-item { background: var(--surface-soft); }
.bars.is-empty .empty { color: var(--muted); }

.local-promise {
  background: var(--surface-soft); border-color: var(--line); color: var(--ink); box-shadow: none;
}
.local-promise-icon { color: var(--ink); border: 1px solid var(--line); background: var(--paper); }
.drop { border-color: var(--line); background: var(--paper); }
.drop.is-over { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); }
.read-step { box-shadow: none; }
.read-step.is-active { border-color: var(--blue); background: var(--blue-soft); }
.read-step.is-active > span, .read-step.is-done > span { background: var(--navy); }

.view-switch { background: var(--surface-soft); }
.view-switch button.is-active { background: var(--navy); color: #fff; box-shadow: none; }
.recognition-panel { border-color: var(--line); }
.panel-kicker { color: var(--muted); }
.settings-nav button.is-active { background: var(--navy); border-color: var(--navy); }
.theme-switch button.is-active { background: var(--navy); color: #fff; box-shadow: none; }
.bank-row .bank-category { color: var(--blue); }
.progress > span { background: var(--blue); }

@media (max-width: 900px) {
  .main { padding: 32px 28px 60px; }
}

@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { padding: 8px 10px; background: var(--paper); }
  .brand { display: none; }
  .nav-button { font-size: 12px; }
  .main { padding: 24px 16px 48px; }
  .page-title-row { align-items: stretch; }
  .page-actions { width: 100%; margin-left: 0; }
  .page-actions button { flex: 1; }
  .money-card-grid { grid-template-columns: 1fr; }
  .money-card-button { min-height: 112px; padding: 18px; }
  .money-card-value { font-size: 25px; }
  .money-detail { padding: 18px; }
  .money-detail-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .reset-zone > summary small { display: none; }
  .nav-button.is-active { background: var(--navy); color: #fff; }
  .reset-choice { align-items: stretch; flex-direction: column; gap: 10px; }
  .reset-choice button { width: 100%; }
  .payment-main { align-items: flex-start; flex-direction: column-reverse; gap: 5px; }
  .payment-panel > button { width: 100%; }
  .today-row { align-items: stretch; flex-direction: column; padding: 0; }
  .today-row-main { width: 100%; }
  .today-dismiss { align-self: flex-end; margin: -8px 8px 7px 0; }
  .invoice-row-open { gap: 9px; padding-left: 12px; }
  .invoice-row-open .tag { display: none; }
}

/* ---- Mobiele werkplek -------------------------------------------------
 * Op een telefoon is de navigatie een vaste tabbar. De Mac-zijbalk blijft
 * hierboven volledig intact; alleen onder 720px verandert de plaatsing.
 * -------------------------------------------------------------------- */

.mobile-more-toggle, .mobile-more-menu, .mobile-only { display: none; }

@media (max-width: 720px) {
  body { min-width: 0; overscroll-behavior-y: none; }
  .desktop-only { display: none; }
  .mobile-only { display: inline; }
  .app { display: block; min-height: 100dvh; }
  .main {
    max-width: none;
    overflow-x: clip;
    padding: max(22px, env(safe-area-inset-top)) 14px
      calc(96px + env(safe-area-inset-bottom));
  }

  /* Eén grote merkboog loopt achter de bovenste inhoud door. Witte velden en
     kaarten snijden hem af, zodat hij als achtergrondlaag verschijnt en weer
     verdwijnt in plaats van als een los logo in de hoek te staan. */
  :is(#invoicesView, #expensesView, #moneyView, #workView, #uploadView, #detailView, #settingsView) {
    position: relative;
    isolation: isolate;
  }
  :is(#invoicesView, #expensesView, #moneyView, #workView, #uploadView, #detailView, #settingsView)::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: -108px;
    right: -72vw;
    width: min(620px, 148vw);
    aspect-ratio: 1;
    background: url("assets/brand/summa-app-icon-1024.png") center / contain no-repeat;
    opacity: var(--brand-watermark-opacity);
    pointer-events: none;
    transform: rotate(-10deg);
  }

  .sidebar {
    position: fixed; z-index: 60; inset: auto 0 0; top: auto;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%; height: auto; overflow: visible;
    padding: 6px max(6px, env(safe-area-inset-right))
      calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    gap: 2px; border: 0; border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--paper) 94%, transparent);
    box-shadow: 0 -8px 28px rgba(23, 24, 28, .08);
    backdrop-filter: saturate(160%) blur(18px);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
  }
  .sidebar > .brand,
  .sidebar > .nav-button[data-go="work"],
  .sidebar > .sidebar-foot { display: none; }
  .mobile-more-toggle { display: flex; }
  .sidebar > .nav-button {
    justify-content: center; align-items: center; flex-direction: column;
    width: 100%; min-width: 0; min-height: 56px; padding: 5px 2px;
    gap: 3px; border-radius: var(--radius-sm); color: var(--muted); font-size: 11px;
    line-height: 1.05; white-space: nowrap;
  }
  .sidebar > .nav-button:hover { background: var(--surface-soft); color: var(--ink); }
  .sidebar > .nav-button.is-active,
  .sidebar > .mobile-more-toggle.is-active {
    background: transparent; color: var(--blue); font-weight: 700;
  }
  .sidebar > .nav-button .nav-icon {
    width: 24px; height: 24px; filter: none; opacity: .56;
  }
  .sidebar > .nav-button.is-active .nav-icon { filter: none; opacity: 1; }
  .mobile-more-icon { display: flex; align-items: center; gap: 3px; height: 21px; }
  .mobile-more-icon i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
  .nav-count {
    position: absolute; top: 2px; left: calc(50% + 7px); transform: none;
    min-width: 17px; padding: 1px 5px; border: 2px solid var(--paper);
    font-size: 11px; line-height: 14px;
  }
  .mobile-more-menu {
    position: fixed; z-index: 70; right: max(10px, env(safe-area-inset-right));
    bottom: calc(76px + env(safe-area-inset-bottom));
    display: grid; width: min(250px, calc(100vw - 20px)); padding: 7px;
    border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper);
    box-shadow: 0 18px 55px rgba(23, 24, 28, .2);
  }
  .mobile-more-menu[hidden] { display: none; }
  .mobile-more-menu button {
    display: flex; align-items: center; gap: 12px; min-height: 58px;
    padding: 9px 11px; border: 0; border-radius: var(--radius-sm); text-align: left;
  }
  .mobile-more-menu button + button { border-top: 1px solid var(--line); border-radius: 0 0 11px 11px; }
  .mobile-more-menu .nav-icon { width: 22px; height: 22px; filter: none; opacity: .68; }
  .mobile-more-menu strong, .mobile-more-menu small { display: block; }
  .mobile-more-menu strong { font-size: 15px; }
  .mobile-more-menu small { color: var(--muted); font-size: 12px; }

  .page-head { margin-bottom: 20px; }
  .page-head h1 { font-size: 28px; line-height: 1.12; letter-spacing: -.7px; }
  .page-head p { margin-top: 6px; line-height: 1.42; }
  .page-title-row { align-items: center; gap: 10px; }
  .page-title-row > div:first-child { min-width: 0; }
  .page-title-row > .primary { margin-left: auto; }
  .page-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .page-actions button { width: 100%; }
  .headline { margin-bottom: 18px; }
  .headline strong { font-size: 34px; }

  button, .button, input, select, textarea { font-size: 16px; }
  button, .button { min-height: 44px; }
  button.quiet { min-height: 40px; }
  input, select { min-height: 46px; padding: 10px 11px; }
  textarea { min-height: 96px; padding: 10px 11px; }
  label { font-size: 13px; }
  .actions { gap: 9px; }
  .panel > .actions select { flex: 1 1 145px; width: 100% !important; }

  .panel { margin-bottom: 14px; padding: 16px; border-radius: var(--radius-md); }
  .summary-panel, .entry-panel { padding: 0; }
  .entry-panel > summary, .summary-panel > summary { min-height: 58px; padding: 15px 16px; }
  .entry-content, .summary-content, .summary-panel > .money-block { padding: 16px; }
  .drop { padding: 38px 16px; }

  .list-row { min-height: 62px; padding: 13px 12px; gap: 10px; }
  .list-row strong { font-size: 15px; line-height: 1.3; }
  .list-row small { margin-top: 2px; font-size: 12px; line-height: 1.38; }
  .invoice-list-row { padding: 0 7px 0 0; }
  .invoice-row-open { min-height: 64px; padding: 12px 4px 12px 11px; }
  .payment-check { width: 44px; height: 44px; }
  .today-row-main { min-height: 76px; padding: 15px 13px; }
  .today-dismiss { min-height: 40px; padding: 8px 12px; }

  .bank-row { gap: 8px; padding: 13px 12px; }
  .bank-row .grow { flex-basis: 100%; }
  .bank-row .amount { margin-right: auto; align-self: center; font-weight: 650; }
  .bank-actions { gap: 4px; }
  .bank-actions button { min-height: 44px; padding-inline: 10px; }
  .bank-check { margin-left: 2px; }

  .money-card-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px;
    overflow: visible; margin-inline: 0; padding: 0; scroll-snap-type: none;
  }
  .money-card-grid::-webkit-scrollbar { display: none; }
  .money-card-button {
    min-width: 0; min-height: 118px; padding: 14px;
    scroll-snap-align: none;
  }
  .money-card-value {
    font-size: clamp(20px, 5.7vw, 24px); letter-spacing: -.35px;
    white-space: nowrap;
  }
  .money-card-label { margin-bottom: 5px; font-size: 11px; }
  .money-card-meta { margin-top: 6px; font-size: 12px; line-height: 1.3; }
  .money-card-button:focus-visible { outline: 0; }
  .money-detail { padding: 16px; }
  .money-facts, .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .money-facts > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .facts div { padding: 10px 11px; }

  .settings-nav {
    flex-wrap: nowrap; overflow-x: auto; margin-inline: -14px;
    padding: 0 14px 7px; scrollbar-width: none;
  }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav button { flex: none; min-height: 42px; }
  .setting-row { align-items: stretch; flex-direction: column; gap: 9px; }
  .setting-row > *:last-child { width: 100%; }
  .demo-settings-panel .setting-row { align-items: center; flex-direction: row; gap: 14px; }
  .demo-settings-panel .setting-row > *:last-child { width: auto; }

  .document-title-row { align-items: flex-start; flex-direction: column; }
  .document-actions { width: 100%; }
  .document-actions .button { flex: 1; justify-content: center; }
  .detail-grid.is-document .doc-frame, .doc-frame { height: 62dvh; min-height: 430px; }
  .view-switch { position: sticky; z-index: 15; top: 8px; width: 100%; }

  .reset-dialog, .bank-edit-dialog, .receipt-scan-dialog {
    inset: auto 0 0; width: 100%; max-width: none; max-height: 90dvh;
    margin: 0 auto; padding: 20px 16px calc(18px + env(safe-area-inset-bottom));
    overflow: auto; border-width: 1px 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .reset-dialog-actions { position: sticky; bottom: 0; padding-top: 10px; background: var(--paper); }
  .reset-dialog-actions button { flex: 1; }
  .bank-edit-head .dialog-close { width: 44px; height: 44px; }
  .receipt-preview { min-height: 180px; max-height: 48dvh; }
  .receipt-preview img { max-height: 48dvh; }

  .toast {
    left: 12px; right: 12px; bottom: calc(148px + env(safe-area-inset-bottom));
    width: auto; transform: none; justify-content: space-between;
    border-radius: var(--radius-md); padding: 12px 14px;
  }
}

@media (max-width: 370px) {
  .main { padding-inline: 11px; }
  .page-head h1 { font-size: 26px; }
  .page-title-row > .primary { width: 100%; }
  .money-facts, .facts { grid-template-columns: 1fr; }
}

/* Mobiele dark-mode afwerking. De telefoon gebruikt één rustige ondergrond per
   component en laat kleur alleen de primaire actie en actieve tab markeren. */
@media (max-width: 720px) {
  .sidebar {
    background: var(--mobile-bar);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .16);
  }
  .sidebar > .nav-button .nav-icon {
    filter: var(--mobile-nav-icon);
    opacity: .58;
  }
  .sidebar > .nav-button.is-active .nav-icon {
    filter: var(--mobile-nav-icon-active);
    opacity: 1;
  }
  .sidebar > .nav-button:focus-visible {
    outline: 0; box-shadow: none;
  }
  .mobile-more-menu .nav-icon { filter: var(--mobile-nav-icon); }

  #expensesView .page-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  #expensesView #receiptScanButton { grid-column: 1 / -1; }
  #expensesView #newCostButton,
  #expensesView #bankImportButton {
    min-width: 0; padding-inline: 8px; background: var(--mobile-secondary);
    border-color: var(--line); font-size: 14px;
  }

  #expensesView .panel {
    padding: 12px; background: var(--mobile-panel); box-shadow: none;
  }
  #expensesView .panel > .actions { margin: 0 0 10px !important; }
  #expensesView .panel > .list {
    overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--mobile-row); box-shadow: none;
  }
  #expensesView .list-row {
    border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
    background: transparent;
  }
  #expensesView .list-row:last-child { border-bottom: 0; }

  input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 0; border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--mobile-focus);
  }
}

@media (max-width: 720px) and (hover: none) {
  #expensesView #newCostButton:hover,
  #expensesView #bankImportButton:hover { background: var(--mobile-secondary); }
  #expensesView .list-row:hover { background: transparent; }
}

/* Facturen: compact dashboard, duidelijke vervalstatus en rustige tabel. */
#invoicesView {
  --invoice-grid: minmax(220px, 1.2fr) minmax(120px, .55fr) minmax(150px, .7fr) minmax(100px, .45fr) minmax(110px, .45fr);
}
#todayView .today-desktop-head,
#invoicesView .invoice-page-head { margin-bottom: 18px; }

.invoice-metrics {
  display: grid; grid-template-columns: minmax(330px, 1.5fr) minmax(0, 2.5fr);
  gap: 14px; margin-bottom: 16px;
}
.invoice-hero-card, .invoice-kpi-card {
  position: relative; overflow: hidden; min-width: 0; border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--paper); color: var(--ink); text-align: left; cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.invoice-hero-card {
  display: flex; min-height: 150px; flex-direction: column; justify-content: center;
  padding: 24px 96px 22px 22px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--paper) 96%, var(--blue)), var(--paper));
}
.invoice-hero-card > span, .invoice-kpi-card > span { color: var(--muted); font-size: 13px; }
.invoice-hero-card > strong {
  margin-top: 8px; font-size: clamp(30px, 2.8vw, 40px); font-weight: 690;
  line-height: 1.05; letter-spacing: -1px; white-space: nowrap;
}
.invoice-hero-card > small, .invoice-kpi-card > small { margin-top: 10px; color: var(--muted); font-size: 12px; }
.invoice-hero-icon {
  position: absolute; right: 25px; top: 50%; width: 62px; height: 62px;
  color: var(--muted); opacity: .24; stroke-width: 1.2; transform: translateY(-50%);
}
.invoice-kpi-secondary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.invoice-kpi-card {
  display: flex; min-height: 150px; flex-direction: column; justify-content: center;
  padding: 22px 18px; cursor: pointer;
  background: linear-gradient(145deg, color-mix(in srgb, var(--paper) 98%, var(--blue)), var(--paper));
}
.invoice-kpi-card:hover { border-color: color-mix(in srgb, var(--blue) 38%, var(--line)); background: var(--hover); }
.invoice-hero-card:hover { border-color: color-mix(in srgb, var(--blue) 38%, var(--line)); }
.invoice-hero-card.is-active, .invoice-kpi-card.is-active {
  border-color: color-mix(in srgb, #fff 28%, #1164f3);
  background: linear-gradient(118deg, #0d369d 0%, #0c4ccc 48%, #1164f3 100%);
  color: #fff; box-shadow: 0 10px 24px rgba(17, 68, 176, .18);
}
.invoice-hero-card.is-active:hover, .invoice-kpi-card.is-active:hover {
  border-color: color-mix(in srgb, #fff 28%, #1164f3);
  background: linear-gradient(118deg, #0d369d 0%, #0c4ccc 48%, #1164f3 100%);
}
:is(.invoice-hero-card, .invoice-kpi-card).is-active > :is(span, strong, small) {
  color: #fff;
}
.invoice-hero-card.is-active .invoice-hero-icon {
  color: #fff; opacity: .88;
}
.invoice-kpi-card.is-active .invoice-kpi-icon {
  background: rgba(255, 255, 255, .16); color: #fff;
}
.invoice-kpi-card > strong {
  overflow: hidden; margin-top: 13px; padding-right: 38px; font-size: clamp(21px, 2vw, 27px);
  line-height: 1.05; letter-spacing: -.45px; text-overflow: ellipsis; white-space: nowrap;
}
.invoice-kpi-icon {
  position: absolute; top: 18px; right: 17px; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%; background: var(--blue-soft); color: var(--blue);
}
.invoice-kpi-icon.is-green { background: var(--green-soft); color: var(--green); }
.invoice-kpi-icon.is-danger { background: var(--danger-soft); color: var(--danger); }
.invoice-kpi-icon .summa-icon { width: 21px; height: 21px; stroke-width: 1.5; }

.invoice-browser { margin: 0; padding: 18px; border-radius: var(--radius-md); }
#invoicesView .invoice-browser {
  border: 0; background: transparent; box-shadow: none;
}
.invoice-toolbar {
  display: grid; grid-template-columns: minmax(250px, 1fr) auto; align-items: center;
  gap: 18px; margin-bottom: 16px;
}
.invoice-search-wrap { min-width: 0; }
.invoice-search {
  display: flex; align-items: center; width: min(350px, 100%); min-height: 44px;
  margin: 0; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--muted);
}
.invoice-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 13%, transparent); }
.invoice-search .summa-icon { width: 20px; height: 20px; }
.invoice-search input {
  min-height: 42px; margin: 0; padding: 7px 10px; border: 0; background: transparent;
  box-shadow: none; color: var(--ink); font-size: 14px;
}
.invoice-search input:focus { border: 0; outline: 0; }
.invoice-search-toggle { display: none; }
.invoice-toolbar-controls { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.invoice-toolbar-controls select {
  width: auto; min-width: 155px; min-height: 44px; padding-block: 8px;
  background-color: var(--paper); font-size: 13px;
}
.invoice-toolbar-controls #invoiceFilter { min-width: 190px; }
.invoice-toolbar-controls #invoiceYear[hidden] { display: none; }

.invoice-table-head {
  display: grid; grid-template-columns: var(--invoice-grid); gap: 12px;
  padding: 11px 110px 11px 16px; border: 1px solid var(--line); border-bottom: 0;
  border-radius: var(--radius-md) var(--radius-md) 0 0; background: var(--surface-soft); color: var(--muted);
  font-size: 11px; font-weight: 650; letter-spacing: .01em;
}
.invoice-table-head > span:last-child { justify-self: end; text-align: right; }
#invoicesView .invoice-browser > .list {
  display: grid; gap: 8px; overflow: visible;
  border: 0; border-radius: 0; background: transparent;
}
#invoicesView .invoice-table-head {
  margin-bottom: 8px; border: 0; border-radius: var(--radius-sm);
}
.invoice-list-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 32px; align-items: center;
  gap: 10px; min-height: 78px; padding: 0 12px 0 0; background: var(--paper);
}
#invoicesView .invoice-list-row {
  overflow: visible; border: 1px solid var(--line); border-radius: var(--radius-sm);
}
#invoicesView .invoice-list-row:last-child { border-bottom: 1px solid var(--line); }
.invoice-list-row:hover { background: var(--hover); }
.invoice-row-open {
  display: grid; grid-template-columns: var(--invoice-grid); align-items: center;
  gap: 12px; min-height: 77px; padding: 10px 8px 10px 16px;
}
.invoice-party { display: flex; align-items: center; gap: 12px; min-width: 0; }
.invoice-avatar {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 50%; background: #355fd2; color: #fff; font-style: normal;
  font-size: 11px; font-weight: 720; letter-spacing: .01em;
}
.invoice-avatar.is-tone-1 { background: #6946b9; }
.invoice-avatar.is-tone-2 { background: #236f91; }
.invoice-avatar.is-tone-3 { background: #446bdc; }
.invoice-party .grow { overflow: hidden; min-width: 0; }
.invoice-party strong, .invoice-party small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invoice-party strong { font-size: 14px; }
.invoice-party small { margin-top: 2px; font-size: 11px; }
.invoice-issued-date {
  min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px;
  font-variant-numeric: tabular-nums; font-weight: 500; text-overflow: ellipsis; white-space: nowrap;
}
.invoice-date-cell { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.invoice-date-icon { width: 17px; height: 17px; margin-top: 1px; color: var(--muted); }
.invoice-date-copy { overflow: hidden; min-width: 0; }
.invoice-date-copy > strong {
  display: block; color: var(--ink); font-size: 12px; font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.invoice-date-cell .invoice-due {
  display: block !important; overflow: hidden; width: 100%; max-width: none;
  margin: 2px 0 0; padding: 0; border-radius: 0; background: transparent;
  color: var(--blue) !important; font-size: 11px !important; font-weight: 540;
  line-height: 1.3; text-overflow: ellipsis; white-space: nowrap;
}
.invoice-date-cell.is-overdue .invoice-due-date { color: var(--danger); }
.invoice-date-cell.is-today .invoice-due-date { color: var(--modern-kpi-orange); }
.invoice-date-cell.is-missing .invoice-due-date { color: var(--muted); font-weight: 550; }
.invoice-date-cell .invoice-due.is-overdue { color: var(--danger) !important; }
.invoice-date-cell .invoice-due.is-today { color: var(--modern-kpi-orange) !important; }
.invoice-date-cell .invoice-due.is-paid { color: var(--muted) !important; }
.invoice-status {
  display: inline-flex; justify-self: start; max-width: 100%; padding: 4px 10px;
  border-radius: var(--radius-pill); background: var(--blue-soft); color: var(--blue-strong);
  font-size: 11px; font-weight: 650; line-height: 1.2; white-space: nowrap;
}
.invoice-status.is-betaald { background: var(--green-soft); color: var(--green); }
.invoice-status.is-te-laat { background: var(--danger-soft); color: var(--danger); }
.invoice-row-open .amount {
  justify-self: end; min-width: 0; color: var(--ink); font-size: 14px; font-weight: 650;
  font-variant-numeric: tabular-nums; text-align: right;
}
.invoice-list-row .payment-check {
  width: 32px; height: 32px; border-color: var(--green-line); color: var(--green);
  background: color-mix(in srgb, var(--green-soft) 45%, var(--paper));
}
.invoice-list-row .payment-check span { opacity: .85; }
.invoice-paid-check { pointer-events: none; }
.invoice-more {
  display: grid; place-items: center; width: 32px; min-height: 38px; padding: 0;
  border: 0; background: transparent; color: var(--muted);
}
.invoice-more:hover { background: var(--surface-soft); color: var(--ink); }
.invoice-more .summa-icon { width: 19px; height: 19px; }
.invoice-actions-menu { position: relative; z-index: 1; align-self: center; }
.invoice-actions-menu[open] { z-index: 30; }
.invoice-actions-menu > summary { list-style: none; cursor: pointer; }
.invoice-actions-menu > summary::-webkit-details-marker { display: none; }
.invoice-actions-menu[open] > .invoice-more { background: var(--surface-soft); color: var(--ink); }
.invoice-actions-popover {
  position: absolute; top: calc(100% + 6px); right: 0; display: grid; width: 220px; padding: 6px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper);
  box-shadow: 0 16px 36px rgba(15, 36, 78, .18);
}
.invoice-actions-popover button {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: 10px;
  width: 100%; min-height: 42px; padding: 9px 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--ink); text-align: left;
}
.invoice-actions-popover button:hover, .invoice-actions-popover button:focus-visible {
  outline: 0; background: var(--surface-soft);
}
.invoice-actions-popover .summa-icon { width: 18px; height: 18px; }
.invoice-actions-popover .invoice-action-delete { color: var(--danger); }
.detail-actions-menu { margin-left: auto; }
.detail-actions-menu > .invoice-more { width: 40px; min-height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* Uitgaven gebruikt dezelfde dashboardtaal, met categorie als hoofdstatus. */
#expensesView { --invoice-grid: minmax(240px, 1.25fr) minmax(150px, .65fr) minmax(210px, .9fr) minmax(115px, .45fr); }
#expensesView .expenses-page-head { margin-bottom: 18px; }
#expensesView .expense-browser {
  border: 0; background: transparent; box-shadow: none;
}
#expensesView .expense-browser > .list {
  display: grid; gap: 8px; overflow: visible;
  border: 0; border-radius: 0; background: transparent;
}
#expensesView .expense-table-head {
  margin-bottom: 8px; border: 0; border-radius: var(--radius-sm);
}
#expensesView .expense-list-row {
  overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper);
}
#expensesView .expense-list-row:not(.has-subtitle) { min-height: 68px; }
#expensesView .expense-row-open:not(.has-subtitle) { min-height: 67px; }
#expensesView .expense-list-row:hover { background: var(--paper); }
#expensesView .expense-list-row:last-child { border-bottom: 1px solid var(--line); }
.expense-kpi-card.is-active {
  border-color: var(--blue); box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 13%, transparent);
}
.invoice-kpi-icon.is-orange { background: var(--modern-icon-orange-bg); color: var(--modern-kpi-orange); }
.expense-toolbar-controls #expenseCategory { min-width: 190px; }
.expense-table-head { padding-right: 62px; }
.expense-list-row { grid-template-columns: minmax(0, 1fr) 32px; }
.expense-row-open { grid-template-columns: var(--invoice-grid); }
.expense-category {
  display: inline-flex; justify-self: start; overflow: hidden; max-width: 100%;
  padding: 4px 10px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 620; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap;
}
.expense-date-cell { align-items: center; }
.expense-date-cell .invoice-date-copy > strong { color: var(--muted); }

@media (max-width: 1180px) and (min-width: 721px) {
  .invoice-metrics { grid-template-columns: 1fr; }
  .invoice-hero-card { min-height: 132px; }
  .invoice-kpi-card { min-height: 126px; }
  .invoice-toolbar { grid-template-columns: 1fr; gap: 10px; }
  .invoice-search { width: 100%; }
  .invoice-toolbar-controls { justify-content: stretch; }
  .invoice-toolbar-controls select { flex: 1; }
}

@media (max-width: 720px) {
  #invoicesView { --invoice-grid: 1fr; }
  #invoicesView .invoice-page-head { margin-bottom: 14px; }
  #invoicesView .invoice-page-head h1 { font-size: 27px; }
  .invoice-metrics { display: block; margin-bottom: 12px; }
  .invoice-hero-card {
    min-height: 136px; padding: 20px 76px 18px 18px; border-radius: var(--radius-md);
  }
  .invoice-hero-card > strong { margin-top: 7px; font-size: clamp(32px, 10vw, 40px); }
  .invoice-hero-card > small { margin-top: 8px; }
  .invoice-hero-icon { right: 18px; width: 50px; height: 50px; }
  .invoice-kpi-secondary {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px; overflow: visible; margin: 10px 0 0; padding: 0;
  }
  .invoice-kpi-secondary::-webkit-scrollbar { display: none; }
  .invoice-kpi-secondary > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .invoice-kpi-card {
    min-height: 112px; padding: 15px 13px; border-radius: var(--radius-md); scroll-snap-align: none;
  }
  .invoice-kpi-secondary > :last-child:nth-child(odd) { min-height: 96px; }
  .invoice-kpi-card > span { padding-right: 30px; font-size: 11px; line-height: 1.25; }
  .invoice-kpi-card > strong { margin-top: 12px; padding-right: 0; font-size: 20px; }
  .invoice-kpi-card > small { margin-top: 7px; font-size: 11px; }
  .invoice-kpi-icon { top: 13px; right: 11px; width: 31px; height: 31px; }
  .invoice-kpi-icon .summa-icon { width: 17px; height: 17px; }

  .invoice-browser,
  #expensesView .expense-browser {
    padding: 10px;
    border-radius: var(--radius-md);
  }
  .invoice-toolbar {
    display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: stretch;
    gap: 8px; margin-bottom: 10px;
  }
  .invoice-toolbar-controls {
    grid-column: 1; grid-row: 1; display: flex; min-width: 0; gap: 8px; margin: 0;
  }
  .invoice-search-wrap { grid-column: 2; grid-row: 1; }
  .invoice-search-wrap .invoice-search { display: none; width: 100%; }
  .invoice-search-toggle {
    display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0;
    border-color: var(--line); background: var(--paper); color: var(--muted);
  }
  .invoice-search-toggle .summa-icon { width: 20px; height: 20px; }
  .invoice-search-wrap.is-open {
    grid-column: 1 / -1; grid-row: 2; display: grid; align-items: center;
    grid-template-columns: minmax(0, 1fr) 44px; gap: 8px;
  }
  .invoice-search-wrap.is-open .invoice-search { display: flex; }
  .invoice-search-wrap.is-open .invoice-search-toggle { color: var(--blue); }
  .invoice-toolbar-controls select,
  .invoice-toolbar-controls #invoiceFilter { width: 100%; min-width: 0; font-size: 12px; }
  .invoice-table-head { display: none; }
  .invoice-browser > .list {
    display: grid; gap: 8px; overflow: visible; border: 0; border-radius: 0; background: transparent;
  }
  /* Twee regels in plaats van vier opgestapelde blokken. Regel 1 is wie en
     hoeveel, regel 2 is wanneer en hoe het ervoor staat. De factuurdatum
     verhuist naar het detailscherm; in een lijst op datum voegt hij niets toe. */
  .invoice-list-row {
    grid-template-columns: minmax(0, 1fr) 40px; gap: 0; min-height: 84px;
    padding: 0; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper);
    overflow: visible;
  }
  .invoice-list-row:last-child { border-bottom: 1px solid var(--line); }
  .invoice-list-row:hover { background: var(--paper); }
  .invoice-row-open {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "partij partij bedrag"
      "datum  teller status";
    align-items: center; gap: 6px 10px;
    min-height: 82px; padding: 11px 9px 11px 12px;
  }
  .invoice-party { grid-area: partij; min-width: 0; }
  .invoice-avatar { width: 32px; height: 32px; }
  .invoice-party .grow {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 7px; min-width: 0;
  }
  .invoice-party strong {
    font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .invoice-party small { font-size: 11px; color: var(--muted); }
  .invoice-issued-date {
    grid-area: datum; display: block; font-size: 11.5px; color: var(--muted);
    white-space: nowrap; font-variant-numeric: tabular-nums;
  }
  .invoice-issued-date::before { content: none; }
  .invoice-date-cell { grid-area: teller; min-width: 0; }
  /* De vervaldatum zelf staat op het detailscherm; hier telt hoe dichtbij hij is. */
  #invoicesView .invoice-date-cell .invoice-due-date { display: none; }
  .invoice-date-icon { display: none; }
  .invoice-date-copy { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 6px; }
  .invoice-date-copy > strong { font-size: 11.5px; font-weight: 600; }
  /* De teller vertelt zelf waar hij over gaat, zodat hij niet als een tweede
     factuurdatum gelezen kan worden. */
  #invoicesView .invoice-date-cell.is-upcoming .invoice-due::before,
  #invoicesView .invoice-date-cell.is-today .invoice-due::before { content: 'vervalt\00a0'; }
  /* De bureaubladregel maakt hiervan een blok van 100% breed; op twee regels
     moet hij naast de datum passen. */
  /* Zelfde vorm als de statusbadge, maar met een rand in plaats van een vulling:
     twee gevulde pillen naast elkaar zouden om dezelfde aandacht vragen. */
  .invoice-date-cell .invoice-due {
    display: inline-flex !important; align-items: center; width: auto; margin: 0;
    padding: 2px 9px; border: 1px solid var(--info-line); border-radius: var(--radius-pill);
    background: transparent; color: var(--blue-strong) !important;
    font-size: 11px !important; font-weight: 600;
    text-transform: lowercase; white-space: nowrap;
  }
  .invoice-date-cell.is-today .invoice-due {
    border-color: var(--amber-line); color: var(--amber) !important;
  }
  .invoice-date-cell.is-overdue .invoice-due {
    border-color: var(--danger-line); color: var(--danger) !important;
  }
  /* Bij een betaalde factuur zegt de badge het al; '· betaald' erachter is dubbel.
     Bij een te late factuur blijft de teller staan, want die telt hoeveel dagen. */
  .invoice-date-cell.is-missing .invoice-due,
  .invoice-date-cell.is-paid .invoice-due { display: none !important; }
  /* Onzichtbare rand, zodat de gevulde badge exact even hoog is als de omlijnde teller. */
  .invoice-status {
    grid-area: status; justify-self: end; padding: 2px 9px;
    border: 1px solid transparent; font-size: 11px;
  }
  .invoice-row-open .amount {
    grid-area: bedrag; justify-self: end; align-self: end; font-size: 15px; font-weight: 650;
  }
  .invoice-list-row .payment-check {
    align-self: center; width: 44px; height: 44px; min-height: 44px; border: 0;
    border-radius: 50%; background: transparent;
  }
  .invoice-actions-menu:not(.detail-actions-menu) { margin-right: 5px; }
  .invoice-actions-menu:not(.detail-actions-menu) > .invoice-more { display: grid; width: 40px; min-height: 44px; }
  .expense-more { display: none; }

  #expensesView .expenses-page-head { margin-bottom: 14px; }
  #expensesView .expenses-page-head h1 { font-size: 27px; }
  #expensesView .expenses-page-head > p { margin-top: 5px; font-size: 12px; }
  .expense-list-row { grid-template-columns: minmax(0, 1fr); }
  #expensesView .expense-list-row:not(.has-subtitle) { min-height: 74px; }
  .expense-row-open {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "partij bedrag"
      "datum categorie";
    gap: 6px 10px; min-height: 82px;
  }
  #expensesView .expense-row-open:not(.has-subtitle) {
    min-height: 72px; padding-block: 8px;
  }
  .expense-party { grid-area: partij; }
  .expense-date-cell { grid-area: datum; align-self: center; }
  .expense-category {
    grid-area: categorie; grid-column: auto; justify-self: end;
    max-width: min(48vw, 230px);
    padding: 3px 8px; font-size: 11px;
  }
  .expense-row-open .amount {
    grid-area: bedrag; grid-column: auto; grid-row: auto;
    align-self: center; justify-self: end;
  }
  .expense-more { display: none; }
}

/* Vandaag op mobiel: één kerncijfer, één waarschuwing en acties binnen duimbereik. */
@media (max-width: 720px) {
  .main:has(#todayView:not([hidden])) { padding-bottom: 0; }
  /* Reserveer onder de laatste Vandaag-kaart ruimte voor zowel de vaste
     actiebalk als de tabbar. Vooral Safari maakt de bruikbare viewport kleiner
     wanneer de adresbalk zichtbaar is; met de oude 164px schoof 'Komt eraan'
     daardoor achter beide bedieningslagen. */
  #todayView {
    margin-inline: 8px;
    padding-bottom: calc(224px + env(safe-area-inset-bottom));
  }
  #todayView .today-desktop-head, #todayView > .today-list { display: none; }
  .today-mobile-dashboard {
    --modern-blue: var(--modern-accent);
    --modern-green: var(--modern-success);
    --today-actions-height: 89px;
    display: flex;
    min-height: calc(100dvh - max(22px, env(safe-area-inset-top)) - 84px - env(safe-area-inset-bottom) - var(--today-actions-height) - 12px);
    flex-direction: column; justify-content: flex-start; gap: clamp(12px, 2vh, 18px);
    color: var(--modern-ink);
  }
  .modern-topbar { display: flex; align-items: center; justify-content: space-between; min-height: 40px; }
  .modern-brand { display: flex; align-items: center; gap: 8px; }
  .modern-brand img { width: 31px; height: 31px; object-fit: contain; }
  .modern-brand strong { font-size: 20px; font-weight: 720; letter-spacing: -.4px; }
  /* De knop kreeg via 'button { min-height: 44px }' wel 44 px hoogte maar bleef
     38 px breed: een ovaal. Nu vierkant, dus rond, en niet meer krimpbaar. */
  .modern-avatar {
    position: relative; display: grid; place-items: center; overflow: hidden;
    flex: 0 0 auto; width: 44px; height: 44px; min-height: 44px; padding: 0;
    border: 3px solid var(--modern-blue); border-radius: 50%; background: var(--blue-soft);
    box-shadow: 0 4px 16px rgba(26, 57, 119, .1); color: var(--modern-blue);
    font-size: 12px; font-weight: 750;
  }
  .modern-avatar img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; object-position: 50% 12%;
  }
  /* De initialen blijven staan als de foto niet laadt. */
  .modern-avatar img + .modern-avatar-initials { visibility: hidden; }
  .modern-welcome { margin-top: 0; }
  .modern-welcome h1 {
    margin: 0; font-size: clamp(22px, 6vw, 25px); font-weight: 730;
    line-height: 1.08; letter-spacing: -.65px;
  }
  .modern-welcome p { margin: 0; }
  /* 'dinsdag 1 september' hoort in het Nederlands maar één hoofdletter te
     krijgen: de eerste. capitalize maakte er 'Dinsdag 1 September' van. */
  .modern-welcome #todayMobileDate { margin-top: 4px; color: var(--muted); font-size: 12px; }
  .modern-welcome #todayMobileDate::first-letter { text-transform: uppercase; }

  .modern-overview-card {
    position: relative; overflow: hidden; width: 100%; min-height: 174px; margin-top: 0;
    padding: 18px 20px; border: 1px solid rgba(118, 164, 255, .65); border-radius: var(--radius-lg);
    background: linear-gradient(118deg, #0d369d 0%, #0c4ccc 48%, #1164f3 100%);
    box-shadow: 0 14px 30px rgba(17, 68, 176, .2); color: #fff; text-align: left;
  }
  .modern-overview-card::before {
    content: ''; position: absolute; z-index: 0; right: -115px; bottom: -118px;
    width: 390px; height: 220px; border-radius: 50%; transform: rotate(-10deg);
    background: linear-gradient(180deg, rgba(68,119,255,.64), rgba(9,54,190,.68));
    box-shadow: inset 0 1px 0 rgba(175,204,255,.28); pointer-events: none;
  }
  .modern-overview-card::after {
    content: ''; position: absolute; z-index: 0; right: -125px; bottom: -145px;
    width: 315px; height: 190px; border: 1px solid rgba(151,188,255,.4); border-radius: 50%;
    transform: rotate(-8deg); background: rgba(8,56,199,.24); pointer-events: none;
  }
  .modern-overview-label {
    position: relative; z-index: 2; display: flex; align-items: center; gap: 7px;
    color: rgba(255,255,255,.88); font-size: 14px;
  }
  .modern-overview-label i {
    display: inline-grid; place-items: center; width: 17px; height: 17px; border: 1px solid rgba(255,255,255,.55);
    border-radius: 50%; font-size: 10px; font-style: normal; font-weight: 750;
  }
  .modern-overview-card > strong {
    position: relative; z-index: 2; display: block; max-width: calc(100% - 112px); margin-top: 13px;
    overflow: hidden; font-size: clamp(36px, 10.8vw, 46px); font-weight: 680; line-height: .98;
    letter-spacing: -1.8px; text-overflow: ellipsis; white-space: nowrap;
  }
  .modern-overview-visual {
    position: absolute; z-index: 1; top: 28px; right: -13px; width: 142px; height: 147px;
    pointer-events: none;
  }
  .modern-kpi-bank-card {
    position: absolute; top: 14px; right: 0; display: grid; place-items: start center;
    width: 116px; height: 144px; padding-top: 36px; border: 1px solid rgba(255,255,255,.5);
    border-radius: 16px; transform: rotate(9deg);
    background: linear-gradient(145deg, rgba(236,243,255,.94), rgba(139,176,255,.67) 52%, rgba(52,105,238,.5));
    box-shadow: inset 0 1px 8px rgba(255,255,255,.45), 0 12px 30px rgba(4,34,126,.22);
  }
  .modern-kpi-bank-card::after {
    content: ''; position: absolute; left: -22px; right: -20px; bottom: -38px; height: 78px;
    border-top: 1px solid rgba(168,200,255,.55); border-radius: 24px 24px 0 0;
    background: linear-gradient(155deg, rgba(44,104,246,.8), rgba(12,68,214,.93));
    transform: rotate(-7deg);
  }
  .modern-kpi-bank-card b {
    color: #1857d5; font-size: 38px; font-weight: 760; line-height: 1; transform: rotate(-2deg);
  }
  .modern-overview-card:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
  .modern-overview-card:hover, .modern-overview-card:active {
    background: linear-gradient(118deg, #0d369d 0%, #0c4ccc 48%, #1164f3 100%);
    color: #fff; transform: none;
  }
  .modern-overview-card .today-mobile-trend {
    position: relative; z-index: 2; width: max-content; max-width: calc(100% - 92px); min-height: 34px;
    margin-top: 18px; padding: 0; border-radius: 0; background: transparent; box-shadow: none;
  }
  .today-mobile-trend {
    display: flex; align-items: center; min-height: 30px; gap: 7px; margin-top: 14px;
    color: var(--modern-green); font-size: 13px; line-height: 1.2;
  }
  .modern-trend-icon {
    display: grid; place-items: center; width: 30px; height: 30px; flex: none;
    border-radius: 50%; background: var(--modern-icon-green-bg);
  }
  .modern-trend-icon svg { width: 17px; height: 17px; stroke-width: 1.65; }
  .today-mobile-trend > strong { color: inherit; font-size: 13px; }
  .today-mobile-trend > span:last-child { color: var(--muted); }
  .today-mobile-trend.is-negative { color: var(--danger); }
  .today-mobile-trend.is-negative .modern-trend-icon { background: var(--danger-soft); }
  .today-mobile-trend.is-negative svg { transform: rotate(90deg); }
  .today-mobile-trend.is-neutral { color: var(--muted); }
  .modern-overview-card .today-mobile-trend { color: #fff; }
  .modern-overview-card .today-mobile-trend > strong { color: #fff; }
  .modern-overview-card .today-mobile-trend > span:last-child { color: rgba(255,255,255,.72); }
  .modern-overview-card .today-mobile-trend .modern-trend-icon {
    background: rgba(56,185,137,.2); color: #79e0ad;
  }
  .modern-overview-card .today-mobile-trend.is-neutral { color: #fff; }
  .modern-overview-card .today-mobile-trend.is-negative .modern-trend-icon {
    background: rgba(255,113,113,.2); color: #ffb0b0;
  }

  .modern-open-invoices {
    display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center;
    gap: 12px; width: 100%; min-height: 60px; margin-top: 0; padding: 8px 14px;
    border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); text-align: left;
  }
  .modern-open-invoices.has-overdue { border-left: 3px solid var(--danger); }
  .modern-notification-icon {
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius-sm);
    background: var(--modern-icon-blue-bg); color: var(--modern-blue);
  }
  .has-overdue .modern-notification-icon { background: var(--danger-soft); color: var(--danger); }
  .modern-notification-icon svg { width: 22px; height: 22px; stroke-width: 1.45; }
  .modern-open-invoices strong, .modern-open-invoices small { display: block; }
  .modern-open-invoices strong { font-size: 13px; line-height: 1.2; }
  .modern-open-invoices small { margin-top: 3px; color: var(--muted); font-size: 12px; }
  .modern-chevron { width: 18px; height: 18px; color: var(--muted); }

  /* Drie losse iconen in drie kleuren vochten met de drie getallen om aandacht,
     terwijl elders op Vandaag een icoon juist één onderwerp aanwijst. Ze zijn
     eruit; de cijfers zijn de inhoud. De rij loopt nu door tot de kaartrand,
     zodat het eerste getal onder de kop uitkomt en de scheidingslijnen overal
     even ver van hun tekst staan. */
  .modern-financial-summary {
    overflow: hidden; margin-top: 0; padding: 16px 14px 0; border: 1px solid var(--line);
    border-radius: var(--radius-md); background: var(--paper);
  }
  .modern-financial-summary h2 {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    margin: 0; font-size: 15px;
  }
  .modern-financial-summary h2 small {
    color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .01em;
  }
  .modern-financial-summary > div {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 14px -14px 0; gap: 1px;
    border-top: 1px solid var(--line); background: var(--line);
  }
  .modern-financial-summary button {
    display: flex; min-width: 0; flex-direction: column; align-items: flex-start;
    gap: 9px; padding: 15px 14px 16px; border: 0; border-radius: 0; min-height: 0;
    background: var(--paper); color: var(--modern-ink); text-align: left;
  }
  .modern-financial-summary button:active { background: var(--surface-soft); }
  .modern-financial-summary span {
    width: 100%; color: var(--muted); font-size: 12px; line-height: 1.25;
  }
  .modern-financial-summary strong {
    /* Meeschalen, zodat '€ 18.742,35' ook op een 360 px-toestel op één regel past. */
    width: 100%; font-size: clamp(15px, 4.7vw, 19px); font-variant-numeric: tabular-nums;
    line-height: 1; letter-spacing: -.4px; white-space: nowrap;
  }
  .modern-financial-summary strong.is-negative { color: var(--danger); }

  .modern-attention { margin-top: 0; }
  .modern-attention h2 { margin: 0 0 8px 2px; font-size: 15px; }
  .modern-attention-card {
    display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center;
    gap: 11px; min-height: 68px; padding: 9px 12px; border: 1px solid var(--line);
    border-radius: var(--radius-md); background: var(--paper);
  }
  .modern-attention-icon {
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
    background: var(--modern-icon-blue-bg); color: var(--modern-blue);
  }
  .modern-attention.is-overdue .modern-attention-icon { background: var(--danger-soft); color: var(--danger); }
  .modern-attention.is-clear .modern-attention-icon { background: var(--modern-icon-green-bg); color: var(--modern-green); }
  .modern-attention-icon svg { width: 21px; height: 21px; stroke-width: 1.5; }
  .modern-attention-card > span:nth-child(2) { min-width: 0; }
  .modern-attention-card strong, .modern-attention-card small { display: block; }
  .modern-attention-card strong { font-size: 13px; line-height: 1.2; }
  .modern-attention-card small {
    overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 11px;
    line-height: 1.2; text-overflow: ellipsis; white-space: nowrap;
  }
  .modern-attention-card .modern-focus-action {
    min-height: 40px; padding: 7px 11px; border-color: var(--info-line);
    background: transparent; color: var(--modern-blue); font-size: 12px; white-space: nowrap;
  }
  .modern-attention.is-overdue .modern-attention-card .modern-focus-action {
    border-color: var(--danger-line); color: var(--danger);
  }
  #todayMobileReminder .message-action { margin-top: 6px; padding: 10px; }
  #todayMobileReminder .message-action > p { font-size: 11px; }
  #todayMobileReminder .button { min-height: 36px; font-size: 12px; }

  /* Vandaag is een briefing, geen stapel losse dashboards. De hoofdactie en
     twee contextregels delen daarom één rustige kaart. */
  .modern-daily-briefing {
    overflow: hidden; padding: 12px; border: 1px solid var(--line);
    border-radius: var(--radius-md); background: var(--paper);
  }
  .modern-focus-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 1px 2px 10px;
  }
  .modern-focus-head span, .modern-focus-head strong, .modern-focus-head small { display: block; }
  .modern-focus-head strong { font-size: 15px; line-height: 1.15; }
  .modern-focus-head small { margin-top: 3px; color: var(--muted); font-size: 11px; }
  .modern-focus-head > b {
    flex: none; padding: 4px 8px; border-radius: 999px;
    background: var(--blue-soft); color: var(--modern-blue); font-size: 10px;
  }
  .modern-daily-briefing .modern-attention > h2,
  .modern-daily-briefing .modern-upcoming > h2 { display: none; }
  .modern-daily-briefing #todayModernAttention .modern-attention-card {
    min-height: 58px; padding: 7px 9px; border: 0;
    background: var(--surface-soft);
  }
  .modern-focus-context { margin-top: 5px; border-top: 1px solid var(--line); }
  .modern-daily-briefing .modern-open-invoices {
    min-height: 42px; padding: 6px 2px; border: 0; border-radius: 0; background: transparent;
  }
  .modern-daily-briefing .modern-notification-icon,
  .modern-daily-briefing .modern-upcoming .modern-attention-icon {
    width: 30px; height: 30px; border-radius: 9px;
  }
  .modern-daily-briefing .modern-notification-icon svg,
  .modern-daily-briefing .modern-upcoming .modern-attention-icon svg { width: 18px; height: 18px; }
  .modern-daily-briefing .modern-upcoming .modern-attention-card {
    min-height: 46px; padding: 6px 2px; border: 0; border-top: 1px solid var(--line);
    border-radius: 0; background: transparent;
  }
  .modern-daily-briefing .modern-upcoming .modern-attention-card .modern-focus-action {
    min-height: 34px; padding: 5px 8px; border: 0;
  }

  /* Het jaaroverzicht blijft beschikbaar, maar gedraagt zich als één rustige
     samenvatting in plaats van een vierde grote kaart. */
  .modern-financial-summary {
    overflow: visible; padding: 3px 2px 0; border: 0; border-radius: 0; background: transparent;
  }
  .modern-financial-summary > div {
    margin: 8px 0 0; gap: 12px; border-top: 0; background: transparent;
  }
  .modern-financial-summary button {
    gap: 5px; padding: 3px 0 5px; background: transparent;
  }

  .modern-quick-actions {
    position: fixed; z-index: 55;
    left: calc(22px + env(safe-area-inset-left));
    right: calc(22px + env(safe-area-inset-right));
    bottom: calc(84px + env(safe-area-inset-bottom));
    margin: 0; padding-top: 8px;
    background: linear-gradient(to bottom, transparent, var(--canvas) 14px);
  }
  .modern-quick-actions h2 { margin: 0 0 8px 2px; font-size: 15px; }
  .modern-quick-actions > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .modern-quick-actions button {
    display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0;
    min-height: 50px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-md);
    background: var(--paper); color: var(--modern-ink); font-size: 11px; white-space: nowrap;
  }
  .modern-quick-actions button.is-primary {
    border-color: var(--modern-blue); background: var(--modern-blue); color: #fff;
  }
  .modern-quick-actions button svg { width: 22px; height: 22px; stroke-width: 1.45; }
  .modern-quick-actions button:nth-child(2) svg { color: var(--modern-blue); }

  .sidebar {
    inset: auto 10px max(5px, env(safe-area-inset-bottom)); width: auto; padding: 7px 5px;
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--paper) 96%, transparent);
    box-shadow: 0 12px 38px rgba(19, 42, 92, .11);
  }
  .sidebar > .nav-button { position: relative; min-height: 56px; padding: 4px 1px; font-size: 11px; }
  .sidebar > .nav-button .nav-icon { width: 23px; height: 23px; opacity: .7; }
  .sidebar > .nav-button.is-active::after { content: none; }
}

/* Safari maakt de zichtbare hoogte kleiner zodra de adresbalk uitklapt.
   Verdeel dan alleen de verticale ruimte compacter; tekst blijft even groot. */
@media (max-width: 720px) and (max-height: 900px) {
  .today-mobile-dashboard { gap: 8px; }
  .today-mobile-dashboard { --today-actions-height: 80px; }
  .modern-welcome { margin-top: 0; }
  .modern-overview-card { min-height: 148px; margin-top: 0; padding: 14px 16px; }
  .modern-overview-label { font-size: 13px; }
  .modern-overview-card > strong { margin-top: 5px; font-size: clamp(38px, 11.3vw, 45px); }
  .modern-overview-card .today-mobile-trend { min-height: 30px; margin-top: 12px; }
  .modern-overview-visual { top: 24px; right: -17px; width: 128px; height: 134px; }
  .modern-kpi-bank-card { width: 104px; height: 132px; padding-top: 33px; }
  .modern-kpi-bank-card b { font-size: 34px; }
  .modern-trend-icon { width: 26px; height: 26px; }
  .modern-trend-icon svg { width: 15px; height: 15px; }

  .modern-open-invoices { min-height: 48px; margin-top: 0; padding: 5px 12px; }
  .modern-notification-icon { width: 34px; height: 34px; }
  .modern-notification-icon svg { width: 20px; height: 20px; }

  .modern-financial-summary { margin-top: 0; padding: 3px 2px 0; }
  .modern-financial-summary h2 { font-size: 14px; }
  .modern-financial-summary > div { margin: 6px 0 0; }
  .modern-financial-summary button { min-height: 48px; gap: 5px; padding: 3px 0 5px; }
  .modern-financial-summary svg { width: 21px; height: 21px; }
  .modern-financial-summary span { font-size: 11px; }
  .modern-financial-summary strong { margin-top: 3px; font-size: clamp(15px, 4.2vw, 17px); }

  .modern-attention { margin-top: 0; }
  .modern-attention h2 { margin-bottom: 4px; font-size: 14px; }
  .modern-attention-card { min-height: 54px; padding: 6px 9px; }
  .modern-attention-icon { width: 34px; height: 34px; }
  .modern-attention-icon svg { width: 19px; height: 19px; }
  .modern-quick-actions { padding-top: 6px; }
  .modern-quick-actions h2 { margin-bottom: 6px; font-size: 14px; }
  .modern-quick-actions button { min-height: 46px; }
}

/* Mobiele bediening met één hand: acties leven vlak boven de tabbar, terwijl
   bedragen en context bovenaan leesbaar blijven. */
.mobile-settings-tab, .mobile-reach-actions { display: none; }

@media (max-width: 720px) {
  /* Instellingen zit op mobiel achter de initialen rechtsboven; de tabbalk
     houdt zo ruimte voor Controle. */
  .sidebar > .mobile-settings-tab { display: none; }

  #invoicesView, #expensesView { padding-bottom: 0; }
  #invoicesView .page-head .page-actions,
  #expensesView .page-head .page-actions { display: none; }
  .mobile-reach-actions {
    position: static; z-index: auto;
    margin: 0 0 12px; padding: 0; gap: 8px; border: 0;
    border-radius: 0; background: transparent; box-shadow: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  #invoicesView:not([hidden]) .mobile-invoice-actions { display: grid; }
  #expensesView:not([hidden]) .mobile-expense-actions {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mobile-reach-actions button { min-height: 46px; font-size: 13px; }
  .mobile-expense-actions #mobileReceiptScanButton { grid-column: 1 / -1; }

  #moneyView .money-card-grid {
    margin-top: 24px;
  }


}

/* Inzichten, Werk en Instellingen spreken dezelfde dashboardtaal als
   Facturen en Uitgaven: één duidelijke hoofdkaart, vaste icon-badges en
   rustige informatiepanelen zonder geneste card-soup. */
.insights-page-head, .work-page-head, .settings-page-head { margin-bottom: 18px; }
.insights-metrics, .work-metrics { margin-bottom: 14px; }
.insights-hero-card { cursor: pointer; }
.insights-hero-card.is-active,
.insights-kpi-card.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 11%, transparent);
}
.insights-kpi-card > strong { padding-right: 0; }

.money-status-card {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto 20px;
  align-items: center; gap: 13px; width: 100%; min-height: 70px;
  margin: 0 0 14px; padding: 10px 15px; border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--paper); color: var(--ink); text-align: left;
}
.money-status-card:hover { border-color: color-mix(in srgb, var(--blue) 38%, var(--line)); }
.money-status-card.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 11%, transparent);
}
.money-status-icon {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--blue-soft); color: var(--blue);
}
.money-status-icon .summa-icon { width: 21px; height: 21px; stroke-width: 1.45; }
.money-status-copy { min-width: 0; }
.money-status-copy strong, .money-status-copy small { display: block; }
.money-status-copy strong { font-size: 14px; }
.money-status-copy small {
  overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 12px;
  text-overflow: ellipsis; white-space: nowrap;
}
.money-status-value { font-size: 18px; letter-spacing: -.25px; white-space: nowrap; }
.money-status-chevron { width: 18px; height: 18px; color: var(--muted); }

#moneyView .money-detail {
  overflow: hidden; padding: 22px; border-radius: var(--radius-md); box-shadow: none;
}
#moneyView .money-detail-head { align-items: center; margin-bottom: 14px; }
#moneyView .money-detail-head h2 { margin: 0; font-size: 17px; }
#moneyView .money-detail-head h2 + small { margin-top: 4px; }
#moneyView .money-detail-head strong { margin-top: 3px; font-size: 29px; }
#moneyView .money-buddy-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  margin-bottom: 16px;
}
.money-buddy-kicker {
  display: block; margin-bottom: 5px; color: var(--blue); font-size: 11px;
  font-weight: 720; letter-spacing: .07em; text-transform: uppercase;
}
#moneyView .money-buddy-head h2 { margin: 0; font-size: 19px; letter-spacing: -.25px; }
#moneyView .money-buddy-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
#moneyMonth { width: auto; min-width: 150px; }

.money-plan-grid {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr);
  align-items: start; gap: 14px; margin-bottom: 20px;
}
.money-plan-primary { min-width: 0; }
.money-plan-grid .money-buddy-goals,
.money-plan-grid .money-safe-card { margin-bottom: 0; }
.money-plan-grid .money-pot-card { grid-template-columns: 112px minmax(0, 1fr); gap: 18px; }
.money-plan-grid .money-pot-gauge { width: 104px; height: 104px; }
.money-plan-grid .money-pot-gauge > div { width: 78px; height: 78px; }
.money-plan-grid .money-pot-gauge strong { font-size: 21px; }

.money-month-summary {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden;
  margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface-soft);
}
.money-month-summary > div { padding: 13px 15px; border-right: 1px solid var(--line); }
.money-month-summary > div:last-child { border-right: 0; }
.money-month-summary span, .money-month-summary strong { display: block; }
.money-month-summary span { color: var(--muted); font-size: 12px; }
.money-month-summary strong { margin-top: 5px; font-size: 18px; }
.money-month-summary .is-profit strong { color: var(--blue); }
.money-month-summary .is-negative strong { color: var(--danger); }

.money-pot-card {
  display: grid; grid-template-columns: 154px minmax(0, 1fr); align-items: center; gap: 24px;
  margin-bottom: 14px; padding: 22px; border: 1px solid color-mix(in srgb, var(--modern-kpi-orange) 35%, var(--line));
  border-radius: var(--radius-md); background: color-mix(in srgb, var(--paper) 95%, var(--modern-icon-orange-bg));
}
.money-pot-card.is-complete {
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
  background: color-mix(in srgb, var(--paper) 95%, var(--green-soft));
}
.money-pot-gauge {
  --pot-progress: 0deg; display: grid; place-items: center; width: 138px; height: 138px;
  border-radius: 50%; background: conic-gradient(var(--modern-kpi-orange) var(--pot-progress), var(--surface-soft) 0);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--modern-kpi-orange) 18%, var(--line));
}
.money-pot-card.is-complete .money-pot-gauge {
  background: conic-gradient(var(--green) var(--pot-progress), var(--surface-soft) 0);
}
.money-pot-gauge > div {
  display: grid; place-content: center; width: 104px; height: 104px; border-radius: 50%;
  background: var(--paper); text-align: center;
}
.money-pot-gauge strong, .money-pot-gauge span { display: block; }
.money-pot-gauge strong { font-size: 25px; letter-spacing: -.5px; }
.money-pot-gauge span { margin-top: 1px; color: var(--muted); font-size: 11px; }
.money-pot-copy { min-width: 0; }
.money-pot-label {
  display: inline-flex; align-items: center; gap: 6px; color: var(--modern-kpi-orange);
  font-size: 12px; font-weight: 700;
}
.money-pot-card.is-complete .money-pot-label { color: var(--green); }
.money-pot-label .summa-icon { width: 17px; height: 17px; }
.money-pot-copy h3 { margin: 5px 0 0; font-size: 19px; letter-spacing: -.2px; }
.money-pot-copy > p { margin: 4px 0 13px; color: var(--muted); font-size: 13px; }
.money-pot-values {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper);
}
.money-pot-values > div, .money-pot-values > button {
  min-height: 0; padding: 9px 11px; border: 0; border-right: 1px solid var(--line);
  border-radius: 0; background: transparent; text-align: left;
}
.money-pot-values > :last-child { border-right: 0; }
.money-pot-value-button:hover { background: var(--hover); }
.money-pot-values span, .money-pot-values strong { display: block; }
.money-pot-values span { color: var(--muted); font-size: 11px; }
.money-pot-values strong { margin-top: 3px; font-size: 15px; }
.money-pot-values .is-remaining strong { color: var(--modern-kpi-orange); }
.money-pot-card.is-complete .money-pot-values .is-remaining strong { color: var(--green); }
.money-pot-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.money-pot-actions button { min-height: 40px; }
.money-pot-editor {
  display: grid; grid-template-columns: minmax(0, 220px) auto auto; align-items: end; gap: 8px;
  margin-top: 10px;
}
.money-pot-editor[hidden] { display: none; }
.money-pot-editor label { margin: 0; }
.money-pot-editor button { min-height: 39px; }
.money-pot-note { display: block; margin-top: 9px; color: var(--muted); font-size: 11px; }

.money-safe-card {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  margin-bottom: 20px; padding: 13px 15px; border: 1px solid var(--green-line);
  border-radius: var(--radius-md); background: var(--green-soft);
}
.money-safe-icon {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--paper); color: var(--green);
}
.money-safe-icon .summa-icon { width: 21px; height: 21px; stroke-width: 1.7; }
.money-safe-card div > span, .money-safe-card div > small { display: block; }
.money-safe-card div > span { font-size: 13px; font-weight: 700; }
.money-safe-card div > small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.money-safe-card > strong { color: var(--green); font-size: 23px; letter-spacing: -.4px; white-space: nowrap; }

.money-buddy-goals {
  margin-bottom: 20px; overflow: hidden; border: 1px solid var(--info-line);
  border-radius: var(--radius-md); background: var(--paper);
}
.money-buddy-goals-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px; border-bottom: 1px solid var(--line);
}
.money-buddy-goals-head h3 { margin: 3px 0 0; font-size: 17px; }
.money-buddy-goals-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.money-buddy-goals-head > button { min-height: 39px; padding: 7px 10px; color: var(--blue); }
.money-buddy-goals-summary {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 12px 15px; overflow: hidden; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface-soft);
}
.money-buddy-goals-summary[hidden] { display: none; }
.money-buddy-goals-summary > div { padding: 10px 11px; border-right: 1px solid var(--line); }
.money-buddy-goals-summary > div:nth-child(even) { border-right: 0; }
.money-buddy-goals-summary > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
.money-buddy-goals-summary span, .money-buddy-goals-summary strong { display: block; }
.money-buddy-goals-summary span { color: var(--muted); font-size: 11px; }
.money-buddy-goals-summary strong { margin-top: 4px; font-size: 14px; }
.money-buddy-goals-summary > div:nth-child(n + 3) strong { color: var(--green); }
.money-buddy-goals-summary > div.is-negative strong { color: var(--danger); }
.money-buddy-empty {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 11px;
  padding: 14px 15px;
}
.money-buddy-empty > .summa-icon { width: 26px; height: 26px; color: var(--blue); }
.money-buddy-empty strong, .money-buddy-empty small { display: block; }
.money-buddy-empty strong { font-size: 13px; }
.money-buddy-empty small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.money-buddy-empty button { min-height: 37px; padding: 6px 9px; font-size: 11px; }
.money-buddy-goal-row {
  position: relative; display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 18px; align-items: center; gap: 11px;
  width: 100%; min-height: 72px; padding: 11px 15px 16px; border: 0;
  border-top: 1px solid var(--line); border-radius: 0; background: transparent; text-align: left;
}
.money-buddy-goal-row:first-child { border-top: 0; }
.money-buddy-goal-icon {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 50%; background: var(--blue-soft); color: var(--blue);
}
.money-buddy-goal-icon.is-buffer { background: var(--green-soft); color: var(--green); }
.money-buddy-goal-icon.is-vacation { background: var(--modern-icon-orange-bg); color: var(--modern-kpi-orange); }
.money-buddy-goal-icon .summa-icon { width: 20px; height: 20px; }
.money-buddy-goal-copy strong, .money-buddy-goal-copy small { display: block; }
.money-buddy-goal-copy strong { font-size: 13px; }
.money-buddy-goal-copy small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.money-buddy-goal-status { color: var(--blue); font-size: 11px; font-weight: 700; white-space: nowrap; }
.money-buddy-goal-status.is-complete { color: var(--green); }
.money-buddy-goal-progress {
  position: absolute; right: 15px; bottom: 7px; left: 68px; height: 4px;
  overflow: hidden; border-radius: var(--radius-pill); background: var(--hover);
}
.money-buddy-goal-progress i { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.money-buddy-goal-chevron { width: 17px; height: 17px; color: var(--muted); }
.money-buddy-disclaimer { display: block; padding: 9px 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.4; }
.buddy-goal-dialog { width: min(620px, calc(100vw - 32px)); }
.buddy-goal-fields { margin-top: 18px; }
.buddy-goal-saved-field { grid-column: 1 / -1; }
.buddy-goal-note { margin: 12px 0 0 !important; }

.money-pot-history {
  margin-bottom: 20px; overflow: hidden; border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--paper);
}
.money-pot-history-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 15px; border-bottom: 1px solid var(--line);
}
.money-pot-history-head h3 { margin: 0; font-size: 15px; }
.money-pot-history-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.money-pot-history-head > span {
  padding: 5px 8px; border-radius: var(--radius-pill); background: var(--surface-soft);
  color: var(--muted); font-size: 11px; white-space: nowrap;
}
.money-pot-overview {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 12px 15px; overflow: hidden; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface-soft);
}
.money-pot-overview > div { padding: 10px 11px; border-right: 1px solid var(--line); }
.money-pot-overview > div:last-child { border-right: 0; }
.money-pot-overview span, .money-pot-overview strong { display: block; }
.money-pot-overview span { color: var(--muted); font-size: 11px; }
.money-pot-overview strong { margin-top: 4px; font-size: 15px; }
.money-pot-overview .is-gap strong { color: var(--modern-kpi-orange); }
.money-pot-history-subtitle {
  margin: 14px 15px 5px; color: var(--muted); font-size: 11px;
  font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.money-pot-history-list > .empty { margin: 0; padding: 18px 15px; }
.money-pot-history-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 13px;
  padding: 11px 15px; border-bottom: 1px solid var(--line);
}
.money-pot-history-copy strong, .money-pot-history-copy small { display: block; }
.money-pot-history-copy strong { font-size: 13px; }
.money-pot-history-copy small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.money-pot-history-amount { font-size: 15px; white-space: nowrap; }
.money-pot-history-actions { display: flex; gap: 6px; }
.money-pot-history-actions button { min-height: 35px; padding: 6px 9px; font-size: 11px; }
.money-pot-history-editor {
  display: grid; grid-template-columns: minmax(0, 180px) auto auto; align-items: center; gap: 6px;
  grid-column: 1 / -1; padding-top: 9px; border-top: 1px dashed var(--line);
}
.money-pot-history-editor[hidden] { display: none; }
.money-pot-history-editor input { min-height: 38px; }
.money-pot-history-editor button { min-height: 38px; }
.money-pot-history-note { display: block; padding: 9px 15px; color: var(--muted); font-size: 11px; }

.money-tax-pot-progress {
  margin-top: 14px; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface-soft);
}
.money-tax-pot-progress > div:first-child {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.money-tax-pot-progress span { color: var(--muted); font-size: 11px; }
.money-tax-pot-progress strong { color: var(--blue); font-size: 13px; }
.money-tax-pot-progress .progress { margin: 8px 0 0; }
.money-tax-history {
  margin-top: 14px; overflow: hidden; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface-soft);
}
.money-tax-history > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; padding: 10px 13px; cursor: pointer; list-style: none;
}
.money-tax-history > summary::-webkit-details-marker { display: none; }
.money-tax-history > summary span { font-size: 12px; font-weight: 700; }
.money-tax-history > summary strong { color: var(--muted); font-size: 11px; font-weight: 600; }
.money-tax-history[open] > summary { border-bottom: 1px solid var(--line); }
.money-tax-history-note {
  display: block; padding: 9px 13px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 11px; line-height: 1.4;
}
.money-tax-contributions {
  overflow: hidden; background: var(--surface-soft);
}
.money-tax-contributions > .empty { margin: 0; padding: 14px; }
.money-tax-contribution-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  min-height: 55px; padding: 10px 13px; border-bottom: 1px solid var(--line);
}
.money-tax-contribution-row:last-child { border-bottom: 0; }
.money-tax-contribution-row div strong,
.money-tax-contribution-row div small { display: block; }
.money-tax-contribution-row div strong { font-size: 12px; }
.money-tax-contribution-row div small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.money-tax-contribution-row > strong { font-size: 14px; white-space: nowrap; }

@media (max-width: 1000px) {
  .money-plan-grid { grid-template-columns: 1fr; }
}

.money-vat-quarter-list { display: grid; gap: 10px; }
.money-vat-quarter {
  overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface-soft);
}
.money-vat-quarter-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 13px; border-bottom: 1px solid var(--line);
}
.money-vat-quarter-head div strong, .money-vat-quarter-head div small { display: block; }
.money-vat-quarter-head div strong { font-size: 13px; }
.money-vat-quarter-head div small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.money-vat-status {
  padding: 5px 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.money-vat-status.is-neutral { background: var(--blue-soft); color: var(--blue-strong); }
.money-vat-status.is-attention { background: var(--modern-icon-orange-bg); color: var(--modern-kpi-orange); }
.money-vat-status.is-overdue { background: var(--danger-soft); color: var(--danger); }

/* Een openstaande aangifte uit een ouder kwartaal, op de kaart van het lopende
   kwartaal. Oranje zolang de deadline nog niet verstreken is, rood daarna. */
.insights-kpi-warning { margin-top: 6px; font-weight: 600; color: var(--modern-kpi-orange); }
.insights-kpi-warning.is-overdue { color: var(--danger); }
.money-vat-status.is-filed { background: var(--blue-soft); color: var(--blue-strong); }
.money-vat-status.is-settled { background: var(--green-soft); color: var(--green); }
.money-vat-quarter-head small.is-overdue { color: var(--danger); font-weight: 600; }
.money-vat-quarter.is-overdue { border-color: var(--danger-line); }
.money-vat-quarter-values {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
}
.money-vat-quarter-values > div { padding: 10px 13px; border-right: 1px solid var(--line); }
.money-vat-quarter-values > div:last-child { border-right: 0; }
.money-vat-quarter-values span, .money-vat-quarter-values strong { display: block; }
.money-vat-quarter-values span { color: var(--muted); font-size: 11px; }
.money-vat-quarter-values strong { margin-top: 3px; font-size: 13px; }
.money-vat-quarter-actions {
  display: flex; justify-content: flex-end; gap: 7px; padding: 8px 12px;
  border-top: 1px solid var(--line); background: var(--paper);
}
.money-vat-quarter-actions button { min-height: 35px; padding: 6px 9px; font-size: 11px; }
.money-vat-note { margin-top: 10px; }

.money-hours-compact {
  --hours-progress: 0%; position: relative; display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 18px; align-items: center; gap: 12px;
  width: 100%; min-height: 72px; margin-top: 16px; padding: 11px 13px 13px;
  overflow: hidden; border-color: var(--line); border-radius: var(--radius-md);
  background: var(--surface-soft); text-align: left;
}
.money-hours-compact::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: var(--hours-progress);
  height: 3px; background: var(--blue); transition: width .25s ease;
}
.money-hours-compact.is-complete::after,
.money-hours-compact.is-on-track::after { background: var(--green); }
.money-hours-compact.is-attention::after { background: var(--modern-kpi-orange); }
.money-hours-icon {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--blue-soft); color: var(--blue);
}
.money-hours-icon .summa-icon { width: 21px; height: 21px; }
.money-hours-copy { min-width: 0; }
.money-hours-copy > span, .money-hours-copy strong, .money-hours-copy small { display: block; }
.money-hours-copy > span { color: var(--muted); font-size: 11px; }
.money-hours-copy strong { margin-top: 2px; font-size: 14px; }
.money-hours-copy small {
  overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 11px;
  text-overflow: ellipsis; white-space: nowrap;
}
.money-hours-status {
  padding: 5px 8px; border-radius: var(--radius-pill); background: var(--blue-soft);
  color: var(--blue); font-size: 11px; font-weight: 700; white-space: nowrap;
}
.money-hours-compact.is-complete .money-hours-status,
.money-hours-compact.is-on-track .money-hours-status { background: var(--green-soft); color: var(--green); }
.money-hours-compact.is-attention .money-hours-status {
  background: var(--modern-icon-orange-bg); color: var(--modern-kpi-orange);
}
.money-hours-compact + .panel-note { margin-top: 12px; }

.money-profit-chart-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding-top: 2px;
}
.money-profit-chart-head h3 { margin: 0; font-size: 16px; }
.money-profit-chart-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.money-profit-chart-head > div:last-child { text-align: right; }
.money-profit-chart-head > div:last-child span,
.money-profit-chart-head > div:last-child strong { display: block; }
.money-profit-chart-head > div:last-child span { color: var(--muted); font-size: 11px; }
.money-profit-chart-head > div:last-child strong { margin-top: 2px; font-size: 16px; }
#moneyView .bar.profit { background: var(--chart-revenue); }
#moneyView .bar.profit.is-negative { background: var(--danger); opacity: .76; }
#moneyView .bar.profit.is-zero { min-height: 0; }
#moneyView .money-revenue-chart .bar.revenue.is-zero { min-height: 0; }
.money-revenue-clients {
  overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.money-revenue-clients:has(> .empty) {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.money-revenue-clients > .empty { margin: 0; padding: 14px; }
.money-revenue-client-row { padding: 10px 13px; border-bottom: 1px solid var(--line); }
.money-revenue-client-row:last-child { border-bottom: 0; }
.money-revenue-client-row > div:first-child {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.money-revenue-client-row strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.money-revenue-client-row div > span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.money-revenue-client-bar {
  height: 4px; margin-top: 7px; overflow: hidden; border-radius: var(--radius-pill);
  background: var(--paper);
}
.money-revenue-client-bar > span {
  display: block; height: 100%; border-radius: inherit; background: var(--blue);
}
#moneyView .money-facts {
  gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface-soft);
}
#moneyView .money-facts > div {
  min-width: 0; padding: 13px 15px; border-right: 1px solid var(--line);
  border-radius: 0; background: transparent;
}
#moneyView .money-facts > div:last-child { border-right: 0; }
#moneyView .money-facts span { color: var(--muted); font-size: 12px; }
#moneyView .money-facts strong { display: block; margin-top: 4px; font-size: 17px; }
#moneyView .bars { height: 156px; margin-top: 18px; }
#moneyView .money-detail-note { margin-bottom: 0; }

.work-hours-note {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45;
}
.work-hours-note .inline-link { margin: 0; padding: 0; font-size: 13px; }
.work-hero-card { cursor: default; }
.work-kpi-card { cursor: default; }
.work-kpi-card:hover { border-color: var(--line); background: linear-gradient(145deg, color-mix(in srgb, var(--paper) 98%, var(--blue)), var(--paper)); }
.work-kpi-card > strong { padding-right: 0; }
.work-entry-panel, .work-list-panel { margin-bottom: 14px; border-radius: var(--radius-md); box-shadow: none; }
.work-entry-panel > summary { min-height: 72px; padding: 12px 16px; }
.work-entry-panel > summary::after { align-self: center; }
.work-panel-title { display: flex; align-items: center; gap: 12px; }
.work-panel-title > span:last-child { min-width: 0; }
.work-panel-title strong, .work-panel-title small { display: block; }
.work-panel-title strong { font-size: 14px; }
.work-panel-title small { margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 400; }
.work-panel-icon {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 50%; background: var(--blue-soft); color: var(--blue);
}
.work-panel-icon.is-orange { background: var(--modern-icon-orange-bg); color: var(--modern-kpi-orange); }
.work-panel-icon .summa-icon { width: 20px; height: 20px; stroke-width: 1.5; }
.work-entry-panel .entry-content { padding: 18px; }
.work-entry-panel .field-row { align-items: end; }
.work-list-panel { padding: 16px; }
.work-list-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 13px;
}
.work-list-head h2 { margin: 0; font-size: 16px; }
.work-list-head .panel-note { margin: 3px 0 0; }
.work-list-head select { min-width: 110px; }
#workView .work-list-panel > .list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); }
#workView .work-list-panel .list-row { min-height: 70px; padding: 11px 13px; background: var(--paper); }
#workView .work-list-panel .list-row:hover { background: var(--hover); }
#workView .work-list-panel .empty { background: var(--paper); }
.work-empty-state {
  display: grid; place-items: center; min-height: 116px; margin: 0; padding: 22px;
  color: var(--muted); text-align: center;
}

.settings-page-head { max-width: 760px; }
#settingsView .settings-nav {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px;
  margin: 0 0 14px;
}
#settingsView .settings-nav button {
  display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center;
  gap: 10px; min-width: 0; min-height: 76px; padding: 10px 11px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper);
  color: var(--ink); text-align: left;
}
#settingsView .settings-nav button:hover { border-color: color-mix(in srgb, var(--blue) 38%, var(--line)); }
#settingsView .settings-nav button.is-active {
  border-color: var(--blue); background: color-mix(in srgb, var(--paper) 93%, var(--blue));
  color: var(--ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 10%, transparent);
}
.settings-tab-icon {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--blue-soft); color: var(--blue);
}
#settingsView .settings-nav button:nth-child(2) .settings-tab-icon { background: var(--green-soft); color: var(--green); }
#settingsView .settings-nav button:nth-child(4) .settings-tab-icon,
#settingsView .settings-nav button:nth-child(6) .settings-tab-icon { background: var(--modern-icon-orange-bg); color: var(--modern-kpi-orange); }
.settings-tab-icon .summa-icon { width: 19px; height: 19px; stroke-width: 1.45; }
#settingsView .settings-nav button > span:last-child { overflow: hidden; min-width: 0; }
#settingsView .settings-nav strong, #settingsView .settings-nav small { display: block; }
#settingsView .settings-nav strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
#settingsView .settings-nav small {
  overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 11px;
  line-height: 1.25; text-overflow: ellipsis; white-space: nowrap;
}
#settingsView > .panel[data-pane] {
  margin: 0; padding: 24px; border-radius: var(--radius-md); box-shadow: none;
}
#settingsView > .panel[data-pane] > h2 { margin-bottom: 4px; font-size: 17px; }
#settingsView > .panel[data-pane] > .panel-note { margin-top: 0; }
#settingsView > .panel[data-pane] > .field-row { margin-top: 20px; }
#settingsView > .settings-content-panel {
  overflow: hidden; padding: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.settings-panel-hero {
  display: flex; align-items: center; gap: 16px; min-height: 132px; padding: 26px 28px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 88% 0, color-mix(in srgb, var(--blue) 12%, transparent), transparent 36%),
    linear-gradient(135deg, color-mix(in srgb, var(--blue-soft) 62%, var(--paper)), var(--paper));
}
.settings-panel-hero.is-green {
  background:
    radial-gradient(circle at 88% 0, color-mix(in srgb, var(--green) 12%, transparent), transparent 36%),
    linear-gradient(135deg, color-mix(in srgb, var(--green-soft) 64%, var(--paper)), var(--paper));
}
.settings-panel-hero.is-orange {
  background:
    radial-gradient(circle at 88% 0, color-mix(in srgb, var(--modern-kpi-orange) 11%, transparent), transparent 36%),
    linear-gradient(135deg, color-mix(in srgb, var(--modern-icon-orange-bg) 62%, var(--paper)), var(--paper));
}
.settings-panel-icon {
  display: grid; place-items: center; width: 52px; height: 52px; flex: none;
  border: 1px solid color-mix(in srgb, var(--blue) 18%, var(--line)); border-radius: 16px;
  background: var(--paper); box-shadow: 0 9px 24px rgba(25, 86, 210, .10); color: var(--blue);
}
.settings-panel-hero.is-green .settings-panel-icon { color: var(--green); border-color: var(--green-line); }
.settings-panel-hero.is-orange .settings-panel-icon { color: var(--modern-kpi-orange); border-color: color-mix(in srgb, var(--modern-kpi-orange) 20%, var(--line)); }
.settings-panel-icon .summa-icon { width: 27px; height: 27px; stroke-width: 1.45; }
.settings-panel-kicker {
  display: block; margin-bottom: 5px; color: var(--blue); font-size: 11px;
  font-weight: 750; letter-spacing: .08em; text-transform: uppercase;
}
.settings-panel-hero.is-green .settings-panel-kicker { color: var(--green); }
.settings-panel-hero.is-orange .settings-panel-kicker { color: var(--modern-kpi-orange); }
.settings-panel-hero h2 { margin: 0; font-size: 23px; line-height: 1.2; letter-spacing: -.3px; }
.settings-panel-hero p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.settings-panel-body { padding: 24px 28px 28px; }
.settings-form-card {
  grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 0; border: 0; background: transparent;
}
.settings-content-panel :is(input, select, textarea) {
  border-color: color-mix(in srgb, var(--line) 88%, var(--ink)); background: var(--surface-soft);
}
.settings-content-panel :is(input, select, textarea):hover { border-color: color-mix(in srgb, var(--blue) 28%, var(--line)); }
.settings-content-panel label:not(.demo-switch) > span { margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 650; }
.settings-save-row { justify-content: flex-end; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.settings-save-row .primary { min-width: 210px; }
.settings-section-card {
  padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper);
}
.settings-section-card + .settings-section-card { margin-top: 18px; }
.settings-section-head { display: flex; align-items: center; gap: 11px; margin-bottom: 17px; }
.settings-section-head > div { min-width: 0; }
.settings-section-head h3 { margin: 0; font-size: 15px; }
.settings-section-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.settings-section-icon {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 12px; background: var(--blue-soft); color: var(--blue);
}
.settings-section-icon.is-orange { background: var(--modern-icon-orange-bg); color: var(--modern-kpi-orange); }
.settings-section-icon .summa-icon { width: 20px; height: 20px; }
.settings-assignment-panel .settings-section-card:first-child > .field-row { margin-top: 0; }
.settings-assignment-panel .rate-schedule {
  margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.settings-assignment-panel .settings-learned-card { background: var(--surface-soft); }
.settings-learned-card .list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.settings-template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings-message-panel .template-card {
  min-width: 0; margin: 0; padding: 20px; border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--paper); box-shadow: none;
}
.settings-message-panel .template-card textarea { min-height: 210px; resize: vertical; }
.settings-message-panel .template-card > small { display: block; margin-top: 12px; color: var(--muted); line-height: 1.55; }
.settings-template-note {
  margin: 16px 0 0; padding: 13px 15px; border-radius: var(--radius-sm);
  background: var(--blue-soft); line-height: 1.55;
}
.settings-message-panel .settings-panel-body > .actions { justify-content: flex-end; margin-top: 20px; }
.settings-source-note {
  margin: 0 0 16px; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--muted); font-size: 12px;
}
.settings-choice-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); }
.settings-choice-list .setting-row { min-height: 86px; padding: 15px 17px; background: var(--paper); }
.settings-choice-list .setting-row:last-child { border-bottom: 0; }
.settings-choice-list .setting-label { max-width: 720px; }
.settings-choice-list .setting-label strong { font-size: 14px; }
.settings-choice-list .setting-label small { margin-top: 4px; line-height: 1.45; }
.settings-data-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.settings-data-actions button { min-height: 48px; padding-inline: 10px; }
.settings-data-actions #backupButton { border-color: var(--blue); background: var(--blue); color: #fff; }
.settings-restore-note { margin: 12px 0 0; font-size: 11px; line-height: 1.5; }
.settings-data-panel .settings-subsection {
  margin-top: 20px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft);
}
.settings-data-panel .settings-subsection h2 { font-size: 16px; }
.settings-data-panel .theme-setting {
  min-height: 80px; margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--paper);
}
.settings-data-panel .reset-zone { margin-top: 18px; }
.settings-data-disclosures { display: grid; gap: 10px; margin-top: 18px; }
.settings-data-disclosure {
  overflow: hidden; margin: 0; padding: 0; border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--paper);
}
.settings-data-disclosure > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  min-height: 62px; padding: 12px 15px; cursor: pointer; list-style: none;
}
.settings-data-disclosure > summary::-webkit-details-marker { display: none; }
.settings-data-disclosure > summary::after {
  width: 8px; height: 8px; flex: none; border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted); content: "";
  transform: rotate(45deg) translate(-2px, 2px); transition: transform .16s ease;
}
.settings-data-disclosure[open] > summary::after { transform: rotate(225deg) translate(-2px, 2px); }
.settings-data-disclosure > summary strong,
.settings-data-disclosure > summary small { display: block; }
.settings-data-disclosure > summary strong { font-size: 13px; }
.settings-data-disclosure > summary small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.settings-data-disclosure-body { padding: 0 15px 15px; }
.settings-data-disclosure-body > p { margin: 0 0 11px; color: var(--muted); font-size: 12px; }
.settings-data-disclosure-body > :is(button, select) { min-height: 44px; }
.settings-data-disclosure.settings-subsection { margin: 0; padding: 0; border-top: 1px solid var(--line); }
#settingsView > .demo-settings-panel {
  overflow: hidden; padding: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.demo-settings-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) 270px; align-items: center;
  gap: 28px; min-height: 210px; padding: 28px;
  background:
    radial-gradient(circle at 78% 10%, color-mix(in srgb, var(--blue) 13%, transparent), transparent 38%),
    linear-gradient(135deg, color-mix(in srgb, var(--blue-soft) 66%, var(--paper)), var(--paper));
}
.demo-settings-intro { display: flex; align-items: flex-start; gap: 16px; min-width: 0; }
.demo-settings-icon {
  display: grid; place-items: center; width: 50px; height: 50px; flex: none;
  border: 1px solid color-mix(in srgb, var(--blue) 18%, var(--line)); border-radius: 15px;
  background: var(--paper); box-shadow: 0 9px 24px rgba(25, 86, 210, .10); color: var(--blue);
}
.demo-settings-icon svg { width: 26px; height: 26px; }
.demo-settings-kicker {
  display: block; margin: 1px 0 6px; color: var(--blue); font-size: 11px;
  font-weight: 750; letter-spacing: .08em; text-transform: uppercase;
}
.demo-settings-intro h2 { margin: 0; max-width: 510px; font-size: 24px; line-height: 1.15; letter-spacing: -.35px; }
.demo-settings-intro p { margin: 9px 0 0; max-width: 530px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.demo-settings-preview {
  overflow: hidden; min-height: 142px; border: 1px solid rgba(124, 157, 220, .28);
  border-radius: 16px; background: #f7f9fd; box-shadow: 0 18px 44px rgba(22, 54, 112, .14);
  transform: rotate(1.2deg);
}
.demo-preview-top {
  display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px;
  border-bottom: 1px solid #dfe6f2; background: #fff;
}
.demo-preview-top > i { width: 7px; height: 7px; border-radius: 50%; background: #d4dbe7; }
.demo-preview-top > b {
  margin-left: auto; padding: 3px 7px; border-radius: var(--radius-pill);
  background: #edf3ff; color: #155cf6; font-size: 8px; letter-spacing: .08em;
}
.demo-preview-body { display: grid; grid-template-columns: 42px minmax(0, 1fr); min-height: 110px; }
.demo-preview-nav { background: #0f1b35; }
.demo-preview-content { display: grid; align-content: center; gap: 9px; padding: 16px; }
.demo-preview-content i { display: block; height: 13px; border-radius: 6px; background: #e7edf8; }
.demo-preview-content i:first-child { width: 64%; height: 18px; background: #d9e5ff; }
.demo-preview-content i:last-child { width: 78%; }
.demo-settings-control {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 96px; padding: 20px 28px; border-top: 1px solid var(--line);
  background: var(--paper);
}
.demo-settings-control > div { min-width: 0; }
.demo-settings-control strong, .demo-settings-control small { display: block; }
.demo-settings-control strong { font-size: 15px; }
.demo-settings-control small { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.demo-settings-safety {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center;
  gap: 12px; min-height: 76px; padding: 15px 28px;
  border-top: 1px solid var(--green-line); background: color-mix(in srgb, var(--green-soft) 54%, var(--paper));
}
.demo-safety-icon {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: var(--paper); color: var(--green);
}
.demo-safety-icon svg { width: 19px; height: 19px; }
.demo-settings-safety > span:nth-child(2) { min-width: 0; }
.demo-settings-safety strong, .demo-settings-safety small { display: block; }
.demo-settings-safety strong { font-size: 13px; }
.demo-settings-safety small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.demo-mode-status {
  min-width: 54px; padding: 5px 9px; border: 1px solid var(--line);
  border-radius: var(--radius-pill); background: var(--paper); color: var(--muted);
  font-size: 11px; font-weight: 700; text-align: center;
}
.demo-settings-panel.is-active .demo-mode-status {
  border-color: color-mix(in srgb, var(--blue) 22%, var(--line)); background: var(--blue-soft); color: var(--blue);
}
.demo-settings-panel.is-active .demo-settings-preview { transform: rotate(0); }
.sidebar .nav-button:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 34%, transparent);
}

@media (max-width: 1180px) and (min-width: 721px) {
  #settingsView .settings-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .insights-page-head, .work-page-head, .settings-page-head { margin-bottom: 14px; }
  .insights-page-head h1, .work-page-head h1, .settings-page-head h1 { font-size: 27px; }
  .insights-page-head p, .work-page-head p, .settings-page-head p { margin-top: 5px; font-size: 12px; }

  .insights-metrics, .work-metrics { display: block; margin-bottom: 12px; }
  .insights-hero-card, .work-hero-card {
    min-height: 136px; padding: 20px 76px 18px 18px; border-radius: var(--radius-md);
  }
  .insights-hero-card > strong, .work-hero-card > strong { margin-top: 7px; font-size: clamp(32px, 10vw, 40px); }
  .insights-kpi-secondary, .work-kpi-secondary {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px; overflow: visible; margin: 10px 0 0; padding: 0;
  }
  .insights-kpi-secondary::-webkit-scrollbar, .work-kpi-secondary::-webkit-scrollbar { display: none; }
  .insights-kpi-card, .work-kpi-card {
    min-height: 112px; padding: 15px 13px; border-radius: var(--radius-md); scroll-snap-align: none;
  }
  .insights-kpi-secondary > :last-child:nth-child(odd),
  .work-kpi-secondary > :last-child:nth-child(odd) {
    grid-column: 1 / -1; min-height: 96px;
  }
  .insights-kpi-card > span:first-child, .work-kpi-card > span:first-child {
    padding-right: 30px; font-size: 11px; line-height: 1.25;
  }
  .insights-kpi-card > strong, .work-kpi-card > strong { margin-top: 12px; padding-right: 0; font-size: 20px; }
  .insights-kpi-card > small, .work-kpi-card > small { margin-top: 7px; font-size: 11px; }

  .money-status-card {
    grid-template-columns: 38px minmax(0, 1fr) auto 17px; gap: 10px;
    min-height: 62px; margin-bottom: 12px; padding: 8px 11px; border-radius: var(--radius-md);
  }
  .money-status-icon { width: 38px; height: 38px; }
  .money-status-copy strong { font-size: 13px; }
  .money-status-copy small { font-size: 11px; }
  .money-status-value { font-size: 15px; }
  #moneyView .money-detail { padding: 15px; border-radius: var(--radius-md); }
  #moneyView .money-buddy-head { align-items: center; gap: 10px; margin-bottom: 12px; }
  #moneyView .money-buddy-head h2 { font-size: 16px; }
  #moneyView .money-buddy-head p { display: block; max-width: 190px; font-size: 11px; line-height: 1.35; }
  #moneyMonth { min-width: 0; max-width: 140px; padding-left: 8px; padding-right: 8px; font-size: 12px; }
  .money-month-summary > div { padding: 10px; }
  .money-month-summary span { font-size: 11px; }
  .money-month-summary strong { font-size: 15px; }
  .money-pot-card { grid-template-columns: 84px minmax(0, 1fr); gap: 13px; padding: 14px; }
  .money-pot-gauge { width: 80px; height: 80px; }
  .money-pot-gauge > div { width: 60px; height: 60px; }
  .money-pot-gauge strong { font-size: 18px; }
  .money-pot-gauge span { font-size: 11px; }
  .money-pot-copy h3 { font-size: 16px; }
  .money-pot-copy > p { margin-bottom: 10px; font-size: 11px; }
  .money-pot-values > div, .money-pot-values > button { padding: 7px 6px; }
  .money-pot-values span { font-size: 11px; }
  .money-pot-values strong { font-size: 12px; }
  .money-pot-actions { align-items: stretch; flex-direction: column; }
  .money-pot-actions button { width: 100%; min-height: 38px; font-size: 11px; }
  .money-pot-editor { grid-template-columns: 1fr 1fr; }
  .money-pot-editor label { grid-column: 1 / -1; }
  .money-pot-editor button { width: 100%; }
  .money-pot-note { font-size: 11px; line-height: 1.35; }
  .money-safe-card { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 9px; padding: 10px; }
  .money-safe-icon { width: 36px; height: 36px; }
  .money-safe-card div > span { font-size: 11px; }
  .money-safe-card div > small { font-size: 11px; }
  .money-safe-card > strong { font-size: 17px; }
  .money-buddy-goals-head { align-items: flex-start; padding: 12px; }
  .money-buddy-goals-head h3 { font-size: 15px; }
  .money-buddy-goals-head small { font-size: 11px; }
  .money-buddy-goals-head > button { min-height: 36px; padding: 6px 8px; font-size: 11px; }
  .money-buddy-goals-summary { margin: 9px 11px; }
  .money-buddy-goals-summary > div { padding: 8px 6px; }
  .money-buddy-goals-summary span { font-size: 11px; line-height: 1.2; }
  .money-buddy-goals-summary strong { font-size: 11px; }
  .money-buddy-empty { grid-template-columns: 32px minmax(0, 1fr); padding: 12px; }
  .money-buddy-empty > .summa-icon { width: 22px; height: 22px; }
  .money-buddy-empty button { grid-column: 1 / -1; width: 100%; }
  .money-buddy-goal-row { grid-template-columns: 38px minmax(0, 1fr) auto 15px; gap: 8px; padding: 10px 11px 16px; }
  .money-buddy-goal-icon { width: 34px; height: 34px; }
  .money-buddy-goal-copy strong { font-size: 12px; }
  .money-buddy-goal-copy small { font-size: 11px; }
  .money-buddy-goal-status { font-size: 11px; }
  .money-buddy-goal-progress { right: 11px; left: 57px; }
  .money-buddy-disclaimer { padding: 8px 11px; }
  .money-pot-history-head { padding: 11px; }
  .money-pot-history-head small { font-size: 11px; }
  .money-pot-overview { margin: 9px 11px; }
  .money-pot-overview > div { padding: 8px 6px; }
  .money-pot-overview span { font-size: 11px; line-height: 1.2; }
  .money-pot-overview strong { font-size: 12px; }
  .money-pot-history-subtitle { margin: 12px 11px 4px; font-size: 11px; }
  .money-pot-history-row {
    grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px 11px;
  }
  .money-pot-history-amount { font-size: 14px; }
  .money-pot-history-actions { grid-column: 1 / -1; }
  .money-pot-history-actions button { flex: 1; }
  .money-pot-history-editor { grid-template-columns: 1fr 1fr; }
  .money-pot-history-editor input { grid-column: 1 / -1; }
  .money-pot-history-note { padding: 8px 11px; line-height: 1.35; }
  .money-tax-pot-progress { padding: 10px; }
  .money-tax-contribution-row {
    grid-template-columns: minmax(0, 1fr) auto; min-height: 50px; padding: 9px 10px;
  }
  .money-tax-contribution-row .money-pot-history-actions { grid-column: 1 / -1; }
  .money-tax-contribution-row .money-pot-history-actions button { flex: 1; }
  .money-vat-quarter-head { padding: 9px 10px; }
  .money-vat-quarter-values > div { padding: 8px 7px; }
  .money-vat-quarter-values span { font-size: 11px; line-height: 1.2; }
  .money-vat-quarter-values strong { font-size: 11px; }
  .money-vat-quarter-actions { align-items: stretch; flex-direction: column; padding: 8px 10px; }
  .money-vat-quarter-actions button { width: 100%; }
  .money-hours-compact {
    grid-template-columns: 36px minmax(0, 1fr) auto 16px; gap: 9px;
    min-height: 64px; padding: 9px 10px 11px;
  }
  .money-hours-icon { width: 36px; height: 36px; }
  .money-hours-copy strong { font-size: 12px; }
  .money-hours-copy small { font-size: 11px; }
  .money-hours-status { padding: 4px 6px; font-size: 11px; }
  .money-profit-chart-head h3 { font-size: 14px; }
  .money-revenue-client-row { padding: 9px 10px; }
  #moneyView .money-detail-head { align-items: flex-start; margin-bottom: 12px; }
  #moneyView .money-detail-head p { display: none; }
  #moneyView .money-detail-head strong { font-size: 25px; }
  #moneyView .money-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #moneyView .money-facts > div { padding: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  #moneyView .money-facts > div:nth-child(odd) { border-right: 1px solid var(--line); }
  #moneyView .money-facts > div:last-child { border-bottom: 0; }
  #moneyView .money-facts > div:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }
  #moneyView .bars { height: 132px; }

  .work-entry-panel > summary { min-height: 66px; padding: 10px 13px; }
  .work-panel-icon { width: 38px; height: 38px; }
  .work-entry-panel .entry-content { padding: 14px; }
  .work-list-panel { padding: 12px; }
  .work-list-head { margin-bottom: 10px; }
  .work-list-head select { min-width: 100px; width: auto; }
  #workView .work-list-panel .list-row {
    align-items: flex-start; flex-wrap: wrap; min-height: 74px; padding: 11px;
  }
  #workView .work-list-panel .list-row .grow { flex: 1 1 calc(100% - 86px); }
  #workView .work-list-panel .list-row .amount { margin-left: auto; }
  #workView .work-list-panel .list-row button { margin-left: auto; min-height: 36px; padding: 6px 9px; font-size: 11px; }

  #settingsView .settings-nav {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
    overflow: visible; margin: 0 0 12px; padding: 0;
  }
  #settingsView .settings-nav button {
    grid-template-columns: 34px minmax(0, 1fr); min-height: 68px;
    padding: 9px; border-radius: var(--radius-md);
  }
  .settings-tab-icon { width: 34px; height: 34px; }
  .settings-tab-icon .summa-icon { width: 18px; height: 18px; }
  #settingsView .settings-nav strong { font-size: 12px; }
  #settingsView .settings-nav small { font-size: 11px; }
  #settingsView > .panel[data-pane] { padding: 16px; border-radius: var(--radius-md); }
  #settingsView > .panel[data-pane] > .field-row { margin-top: 16px; }
}

@media (max-width: 720px) {
  #settingsView .settings-nav {
    position: fixed; z-index: 53;
    left: calc(14px + env(safe-area-inset-left));
    right: calc(14px + env(safe-area-inset-right));
    bottom: calc(82px + env(safe-area-inset-bottom));
    width: auto;
    display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 14px) / 3); grid-template-columns: none;
    gap: 7px; overflow-x: auto; overflow-y: hidden; margin: 0; padding: 0;
    border: 0; border-radius: 0; background: transparent; box-shadow: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
    scroll-snap-type: x proximity; scrollbar-width: none;
  }
  #settingsView .settings-nav::-webkit-scrollbar { display: none; }
  #settingsView .settings-nav button {
    display: flex; align-items: center; justify-content: center; grid-template-columns: none;
    gap: 7px; min-width: 0; min-height: 52px; padding: 7px 6px;
    scroll-snap-align: start; border: 1px solid var(--line); border-radius: var(--radius-md);
    background: var(--paper); font-size: 12px; font-weight: 650;
  }
  #settingsView .settings-nav button.is-active {
    border-color: var(--navy); background: var(--navy); color: #fff; box-shadow: none;
  }
  #settingsView .settings-nav small { display: none; }
  #settingsView .settings-nav strong { font-size: 12px; }
  #settingsView .settings-tab-icon,
  #settingsView .settings-nav button:nth-child(n) .settings-tab-icon {
    width: 21px; height: 21px; border-radius: 0; background: transparent; color: var(--blue);
  }
  #settingsView .settings-nav button:nth-child(2) .settings-tab-icon { color: var(--green); }
  #settingsView .settings-nav button:nth-child(4) .settings-tab-icon,
  #settingsView .settings-nav button:nth-child(6) .settings-tab-icon { color: var(--modern-kpi-orange); }
  #settingsView .settings-nav button.is-active .settings-tab-icon { color: #fff; }
  #settingsView .settings-tab-icon .summa-icon { width: 21px; height: 21px; }
  #settingsView > .settings-content-panel { padding: 0; border-radius: var(--radius-md); }
  .settings-panel-hero { min-height: 112px; gap: 12px; padding: 19px 17px; }
  .settings-panel-icon { width: 44px; height: 44px; border-radius: 13px; }
  .settings-panel-icon .summa-icon { width: 23px; height: 23px; }
  .settings-panel-kicker { margin-bottom: 3px; font-size: 10px; }
  .settings-panel-hero h2 { font-size: 20px; }
  .settings-panel-hero p { margin-top: 4px; font-size: 11px; line-height: 1.4; }
  .settings-panel-body { padding: 16px; }
  .settings-form-card { grid-template-columns: 1fr; gap: 13px; }
  .settings-save-row { margin-top: 17px; padding-top: 15px; }
  .settings-save-row .primary { width: 100%; min-width: 0; }
  .settings-section-card { padding: 15px; }
  .settings-section-head { align-items: flex-start; margin-bottom: 14px; }
  .settings-section-head h3 { font-size: 14px; }
  .settings-section-head p { font-size: 11px; }
  .settings-assignment-panel .settings-section-card:first-child > .field-row { grid-template-columns: 1fr; gap: 13px; }
  .settings-assignment-panel .actions { display: grid; grid-template-columns: 1fr; }
  .settings-assignment-panel .actions button { width: 100%; }
  .settings-template-grid { grid-template-columns: 1fr; gap: 14px; }
  .settings-message-panel .template-card { padding: 15px; }
  .settings-message-panel .template-card textarea { min-height: 180px; }
  .settings-message-panel .settings-panel-body > .actions { display: grid; grid-template-columns: 1fr; }
  .settings-message-panel .settings-panel-body > .actions button { width: 100%; }
  .settings-template-note { font-size: 11px; }
  .settings-choice-list .setting-row {
    align-items: center; flex-direction: row; gap: 14px; min-height: 82px; padding: 13px;
  }
  .settings-choice-list .setting-row > *:last-child { width: auto; }
  .settings-choice-list .setting-label strong { font-size: 13px; }
  .settings-choice-list .setting-label small { font-size: 11px; }
  .settings-choice-list .setting-row:last-child {
    align-items: flex-start; flex-direction: column; gap: 10px;
  }
  .settings-choice-list .setting-row:last-child > label { width: 100% !important; }
  .settings-data-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-data-actions button { min-height: 54px; font-size: 11px; }
  .settings-data-panel .settings-subsection { padding: 15px; }
  .settings-data-panel .settings-subsection .page-title-row { align-items: flex-start; }
  .settings-data-panel .settings-subsection .money-export-actions { display: grid; grid-template-columns: 1fr; }
  .settings-data-panel .settings-subsection .money-export-actions button { width: 100%; }
  .settings-data-panel .theme-setting { align-items: stretch; flex-direction: column; gap: 12px; }
  .settings-data-panel .theme-setting > *:last-child { width: 100%; }
  #settingsView { padding-bottom: calc(246px + env(safe-area-inset-bottom)); }
  #settingsView .mobile-settings-actions { bottom: calc(151px + env(safe-area-inset-bottom)); }
  #settingsView > .demo-settings-panel { border-radius: var(--radius-md); }
  .demo-settings-hero { grid-template-columns: 1fr; gap: 18px; min-height: 0; padding: 20px; }
  .demo-settings-intro { gap: 12px; }
  .demo-settings-icon { width: 44px; height: 44px; border-radius: 13px; }
  .demo-settings-icon svg { width: 23px; height: 23px; }
  .demo-settings-intro h2 { font-size: 20px; }
  .demo-settings-intro p { margin-top: 7px; font-size: 12px; }
  .demo-settings-preview { min-height: 112px; border-radius: 13px; transform: none; }
  .demo-preview-body { min-height: 80px; }
  .demo-settings-control { min-height: 88px; padding: 17px 20px; }
  .demo-settings-control small { max-width: 270px; }
  .demo-settings-safety {
    grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; min-height: 72px; padding: 14px 20px;
  }
  .demo-safety-icon { width: 36px; height: 36px; }
  .demo-settings-safety small { line-height: 1.35; }
}

/* Mobiele overzichten: alle kerncijfers leven in één lage swipebaan. Zo staat
   de werklijst direct in beeld zonder dat informatiekaarten het scherm vullen. */
@media (max-width: 720px) {
  :is(#invoicesView, #expensesView, #moneyView, #workView) > .invoice-metrics {
    display: grid; grid-auto-flow: column; grid-auto-columns: min(86vw, 335px);
    grid-template-columns: none; gap: 10px; overflow-x: auto; overflow-y: hidden;
    margin: 0 -14px 12px; padding: 0 14px 5px;
    scroll-padding-inline: 14px; scroll-snap-type: x mandatory;
    overscroll-behavior-inline: contain; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  :is(#invoicesView, #expensesView, #moneyView, #workView) > .invoice-metrics::-webkit-scrollbar {
    display: none;
  }


  :is(#invoicesView, #expensesView, #moneyView, #workView)
    > .invoice-metrics > .invoice-kpi-secondary {
    display: contents;
  }
  :is(#invoicesView, #expensesView, #moneyView, #workView)
    > .invoice-metrics :is(.invoice-hero-card, .invoice-kpi-card) {
    width: 100%; min-height: 128px; height: 128px; scroll-snap-align: start;
  }
  :is(#invoicesView, #expensesView, #moneyView, #workView)
    > .invoice-metrics .invoice-hero-card {
    padding: 18px 70px 16px 18px; border-radius: var(--radius-md);
  }
  :is(#invoicesView, #expensesView, #moneyView, #workView)
    > .invoice-metrics .invoice-hero-card > strong {
    font-size: clamp(30px, 9vw, 38px);
  }
  :is(#invoicesView, #expensesView, #moneyView, #workView)
    > .invoice-metrics .invoice-hero-icon {
    right: 15px; width: 46px; height: 46px;
  }
  :is(#invoicesView, #expensesView, #moneyView, #workView)
    > .invoice-metrics .invoice-kpi-card {
    grid-column: auto; min-height: 128px; padding: 17px 15px;
  }

  /* Binnen de swipebanen is elk pictogram even groot en staat het op dezelfde
     optische as als het pictogram van de eerste kaart. */
  :is(#invoicesView, #expensesView, #moneyView)
    > .invoice-metrics .invoice-kpi-icon {
    top: 50%; right: 15px; width: 46px; height: 46px;
    padding: 0; transform: translateY(-50%);
  }
  :is(#invoicesView, #expensesView, #moneyView)
    > .invoice-metrics .invoice-kpi-icon .summa-icon {
    width: 25px; height: 25px;
  }
  :is(#invoicesView, #expensesView, #moneyView)
    > .invoice-metrics .invoice-kpi-card > :not(.invoice-kpi-icon) {
    max-width: calc(100% - 60px); padding-right: 0;
  }

  #expensesView:not([hidden]) .mobile-expense-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .mobile-expense-actions #mobileReceiptScanButton { grid-column: auto; }
  .mobile-expense-actions button {
    display: flex; align-items: center; justify-content: center; flex-direction: column;
    min-width: 0; min-height: 54px; padding: 6px 3px; gap: 3px; font-size: 11px;
  }
  .mobile-expense-actions .button-icon { margin: 0; }
}

/* Eén vaste duimzone voor alle mobiele hoofdacties. De inhoud wisselt per
   pagina, maar positie, maat en hiërarchie blijven overal hetzelfde. */
@media (max-width: 720px) {
  :is(#invoicesView, #expensesView, #workView, #settingsView, #detailView) {
    padding-bottom: calc(174px + env(safe-area-inset-bottom));
  }
  #moneyView { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

  .mobile-action-dock {
    position: fixed; z-index: 54;
    left: calc(14px + env(safe-area-inset-left));
    right: calc(14px + env(safe-area-inset-right));
    bottom: calc(82px + env(safe-area-inset-bottom));
    width: auto; max-width: none; margin: 0; padding: 0;
    border: 0; border-radius: 0; background: transparent;
    box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  }

  .modern-quick-actions.mobile-action-dock {
    left: calc(14px + env(safe-area-inset-left));
    right: calc(14px + env(safe-area-inset-right));
    bottom: calc(82px + env(safe-area-inset-bottom));
    padding: 0; background: transparent;
  }
  .modern-quick-actions.mobile-action-dock h2 { display: none; }
  .modern-quick-actions.mobile-action-dock > div { gap: 7px; }

  .mobile-reach-actions.mobile-action-dock {
    margin: 0; padding: 0; gap: 7px; border: 0;
    border-radius: 0; background: transparent; box-shadow: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  /* De factuurlijst staat tien pixels binnen de paginarand. De vaste actie
     volgt exact diezelfde kolom, zodat hij niet buiten de kaarten uitsteekt. */
  .mobile-invoice-actions.mobile-action-dock {
    left: calc(24px + env(safe-area-inset-left));
    right: calc(24px + env(safe-area-inset-right));
  }
  .mobile-expense-actions.mobile-action-dock {
    left: calc(24px + env(safe-area-inset-left));
    right: calc(24px + env(safe-area-inset-right));
  }
  /* Op een detailscherm past de inhoud vaak binnen één beeld. Een vast
     verankerde balk laat dan een gat vallen tussen de laatste kaart en de
     knoppen. Sticky zet hem direct onder de inhoud zolang die past, en plakt
     hem pas onderaan zodra er gescrold moet worden. */
  #detailView .mobile-detail-actions.mobile-action-dock {
    position: sticky; top: auto; margin-top: 16px;
  }

  .mobile-action-dock button,
  .modern-quick-actions.mobile-action-dock button {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    min-width: 0; min-height: 52px; border-radius: var(--radius-md);
    font-size: 12px; font-weight: 650; line-height: 1;
  }
  .mobile-action-dock button.primary,
  .modern-quick-actions.mobile-action-dock button.is-primary {
    border-color: var(--navy); background: var(--navy); color: #fff;
  }
  .mobile-action-dock .button-icon {
    display: block; flex: 0 0 auto; width: 20px; height: 20px;
    margin: 0; vertical-align: 0;
  }

  #invoicesView:not([hidden]) .mobile-invoice-actions,
  #detailView:not([hidden]) .mobile-detail-actions,
  #workView:not([hidden]) .mobile-work-actions,
  #settingsView:not([hidden]) .mobile-settings-actions:not([hidden]) { display: grid; }

  #expensesView:not([hidden]) .mobile-expense-actions {
    display: grid; grid-template-columns: 1.35fr .82fr .82fr;
  }
  .mobile-expense-actions button {
    flex-direction: row; min-height: 52px; padding: 7px 5px; gap: 5px;
    font-size: 11px;
  }
  .mobile-expense-actions #mobileReceiptScanButton { grid-column: auto; font-size: 12px; }

  .mobile-work-actions { grid-template-columns: 1.15fr 1fr; }
  .mobile-detail-actions { grid-template-columns: 1.35fr 1fr .8fr; }
  .mobile-detail-actions.is-single { grid-template-columns: 1fr; }
  #detailView:not([hidden]) .mobile-detail-actions.is-empty { display: none; }
  .mobile-detail-actions.is-two-actions { grid-template-columns: 1.25fr 1fr; }
  .mobile-detail-actions button { padding-inline: 7px; font-size: 11px; }
  .mobile-detail-actions button.primary { font-size: 11px; }
  .mobile-detail-actions button[hidden] { display: none; }
  .mobile-settings-actions { grid-template-columns: 1fr; }
  #mobileSettingsActions[hidden] { display: none; }
}

@media (max-width: 370px) {
  #settingsView .settings-nav button { gap: 4px; padding-inline: 4px; }
  #settingsView .settings-nav strong { font-size: 10px; }
  #settingsView .settings-tab-icon,
  #settingsView .settings-nav button:nth-child(n) .settings-tab-icon,
  #settingsView .settings-tab-icon .summa-icon { width: 19px; height: 19px; }
  :is(.mobile-invoice-actions, .mobile-expense-actions).mobile-action-dock {
    left: calc(21px + env(safe-area-inset-left));
    right: calc(21px + env(safe-area-inset-right));
  }
}

@media (max-width: 720px) {
  /* In standalone iOS kan scrollende inhoud anders leesbaar onder de
     transparante statusbalk komen. Deze vaste ondergrond bewaakt de safe-area. */
  #detailView::before {
    position: fixed; z-index: 60; top: 0; right: 0; left: 0;
    height: env(safe-area-inset-top); background: var(--bg); content: "";
    pointer-events: none;
  }
  #detailView .page-head { margin-bottom: 12px; }
  #detailView .page-head > .row { align-items: center; }
  #detailView .page-head h1 { max-width: calc(100% - 74px); font-size: 25px; }
  #detailView .page-head > p { margin-top: 3px; font-size: 11px; }
  #detailMode { top: 6px; gap: 4px; padding: 4px; border-radius: var(--radius-md); background: var(--paper); }
  #detailMode button { min-height: 40px; padding: 7px 6px; font-size: 11px; }

  #detailPaymentPanel, #detailRecognitionPanel { padding: 14px; }
  #detailPaymentPanel > .payment-actions { display: none; }
  #detailPaymentPanel .payment-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "icoon bedrag"
      "icoon tekst";
    align-items: center;
    column-gap: 20px;
    row-gap: 2px;
    margin-bottom: 0;
    text-align: left;
  }
  #detailPaymentPanel .payment-icon { grid-area: icoon; width: 84px; height: 84px; }
  #detailPaymentPanel .payment-icon .summa-icon { width: 42px; height: 42px; }
  #detailPaymentPanel .payment-amount { grid-area: bedrag; align-self: end; font-size: 21px; }
  #detailPaymentPanel .payment-text { grid-area: tekst; align-self: start; }
  #detailPaymentPanel .payment-text .panel-kicker { display: none; }
  #detailPaymentPanel .payment-main h2 { margin: 0 0 1px; font-size: 15px; }
  #detailPaymentPanel .payment-main .panel-note { font-size: 11px; line-height: 1.35; }
  #detailRecognitionPanel h2 { margin-bottom: 10px; font-size: 16px; }
  #detailRecognitionPanel .recognition-grid { gap: 7px; }
  #detailRecognitionPanel .recognition-item { padding: 9px; }
  #detailVerdictPanel > summary { min-height: 58px; padding: 12px 14px; }
  #detailDataPanel { padding: 14px 14px 84px; }
  #detailDataPanel > .actions { margin-bottom: 0; }
  #detailDataPanel > .actions #detailSave {
    display: block; width: 100%; min-height: 52px;
  }
  #detailDataPanel .detail-edit-section { margin-top: 16px; padding-top: 14px; }
  #detailDataPanel .detail-edit-section h3 { margin-bottom: 10px; font-size: 14px; }
  #detailDataPanel .field-grid { gap: 0; }
  #detailDataPanel .field-grid > div { min-width: 0; }
  #detailDataPanel .field-grid label { margin-bottom: 5px; }
  #detailDataPanel .field-grid input { min-height: 50px; }
  #detailDataPanel .field-grid .field-source {
    margin: -2px 0 10px; font-size: 11px; line-height: 1.35;
  }
  #detailDataPanel.is-expense-data .detail-amount-section .field-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  }
  #detailDataPanel.is-expense-data .detail-amount-section .field-key-total {
    grid-column: 1 / -1;
  }
  #detailDataPanel.is-expense-data .detail-amount-section .field-key-total input {
    min-height: 56px; font-size: 18px;
  }
  #detailDataPanel .detail-extra-fields > summary { min-height: 48px; }
  #detailView .mobile-detail-actions.mobile-action-dock {
    margin-inline: -14px; padding: 10px 14px 0;
    background: linear-gradient(to bottom, transparent, var(--bg) 34%);
  }
  #detailView .mobile-detail-actions.is-editing { display: none !important; }
  #detailDocumentPanel { padding: 12px; }
  #detailDocumentPanel .document-title-row { margin-bottom: 10px; }
  #detailDocumentPanel .doc-frame { height: calc(100dvh - 300px); min-height: 420px; }
}

/* Mobiele invoerflows: dezelfde bottom-sheet, dezelfde vaste bevestigingszone
   en alleen de hoofdvelden direct in beeld. */
@media (max-width: 720px) {
  body.has-mobile-sheet { overflow: hidden; }

  .mobile-sheet-handle {
    display: block; width: 42px; height: 5px; margin: 0 auto 14px;
    border-radius: var(--radius-pill); background: color-mix(in srgb, var(--muted) 42%, transparent);
  }

  #uploadView:not([hidden]) {
    position: fixed; z-index: 76; inset: 0; display: flex; align-items: flex-end;
    padding: 0; background: rgba(4, 9, 18, .54); backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }
  #uploadView::before { content: none; }
  #uploadView .mobile-flow-sheet {
    display: block; width: 100%; max-height: 92dvh; overflow: auto;
    padding: 12px 16px calc(18px + env(safe-area-inset-bottom));
    border: 1px solid var(--line); border-width: 1px 0 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--paper);
    box-shadow: 0 -18px 60px rgba(0, 0, 0, .24);
  }
  #uploadView .page-head { margin-bottom: 14px; }
  #uploadView .page-head h1 { font-size: 22px; }
  #uploadView .local-promise { margin-bottom: 12px; }
  #uploadView .drop { padding: 24px 14px; border-style: solid; }
  #uploadView .drop > strong { margin-bottom: 14px; font-size: 16px; }
  #uploadView .drop > span { display: block; }
  #uploadView .upload-pick-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; min-height: 54px; padding: 10px 14px; border-color: var(--navy);
    background: var(--navy); color: #fff; text-decoration: none;
  }
  #uploadView .read-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 12px;
  }
  #uploadView .read-step { min-width: 0; padding: 9px 7px; }
  #uploadView .read-step > div { min-width: 0; }
  #uploadView .read-step strong { font-size: 11px; }
  #uploadView .read-step small { display: none; }

  .work-entry-panel.is-mobile-sheet {
    position: fixed; z-index: 78; inset: auto 0 0; display: block;
    width: 100%; max-height: 92dvh; margin: 0; overflow: auto;
    border-width: 1px 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--paper);
    box-shadow: 0 -100vh 0 100vh rgba(4, 9, 18, .58), 0 -18px 60px rgba(0, 0, 0, .26);
  }
  .work-entry-panel.is-mobile-sheet > summary {
    position: sticky; z-index: 2; top: 0; padding: 16px 58px 14px 16px;
    border-bottom: 1px solid var(--line); background: var(--paper);
  }
  .work-entry-panel.is-mobile-sheet > summary::after { display: none; }
  .work-entry-panel.is-mobile-sheet .entry-content {
    position: relative; display: block; padding: 16px 16px calc(12px + env(safe-area-inset-bottom));
  }
  .mobile-sheet-close {
    position: absolute; z-index: 4; top: -59px; right: 12px;
    display: grid; place-items: center; width: 44px; height: 44px;
    padding: 0; border-radius: 50%;
  }
  .mobile-sheet-close .summa-icon { width: 20px; height: 20px; }
  .work-entry-panel.is-mobile-sheet .field-row { grid-template-columns: 1fr 1fr; gap: 11px; }
  .work-entry-panel.is-mobile-sheet .field-row > label:first-child { grid-column: 1 / -1; }
  .work-entry-panel.is-mobile-sheet .field-row > .mobile-form-more-toggle,
  .work-entry-panel.is-mobile-sheet .field-row > .mobile-form-extra { grid-column: 1 / -1; }
  .mobile-form-more-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; min-height: 44px; padding: 8px 2px; border: 0;
    background: transparent; color: var(--muted); text-align: left;
  }
  .mobile-form-more-toggle::after { content: "+"; font-size: 20px; font-weight: 400; }
  .mobile-form-more-toggle[aria-expanded="true"]::after { content: "−"; }
  .mobile-form-extra { display: none; }
  .mobile-form-extra.is-open { display: block; }
  .mobile-form-extra label { width: 100%; }
  .mobile-sheet-actions {
    position: sticky; z-index: 3; bottom: calc(74px + env(safe-area-inset-bottom));
    margin: 12px -16px 0; padding: 10px 16px 12px;
    border-top: 1px solid var(--line); background: var(--paper);
  }
  .mobile-sheet-actions button { width: 100%; min-height: 54px; }

  .receipt-scan-dialog .mobile-sheet-handle { margin-top: -8px; }
  .buddy-goal-dialog {
    inset: auto 14px 0;
    width: auto;
    max-width: none;
    max-height: calc(100dvh - 28px);
    box-sizing: border-box;
    border-width: 1px 1px 0;
  }
  .buddy-goal-dialog .mobile-sheet-handle { margin-top: -8px; }
  .buddy-goal-dialog .buddy-goal-fields { grid-template-columns: 1fr; gap: 0; }
  .buddy-goal-dialog .buddy-goal-saved-field { grid-column: auto; }
  .buddy-goal-dialog .reset-dialog-actions {
    margin: 12px -16px calc(-18px - env(safe-area-inset-bottom));
    padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
  }
  .receipt-scan-dialog .reset-dialog-actions {
    margin: 12px -16px calc(-18px - env(safe-area-inset-bottom));
    padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
  }
}

/* Vandaag gebruikt op desktop dezelfde inhoud als op mobiel. De ruime
   werkruimte wordt een echt dashboard in plaats van een uitgerekte melding. */
@media (min-width: 721px) {
  #todayView { position: relative; }
  #todayView > .today-list { display: none; }
  #todayView > .today-desktop-head {
    position: absolute; z-index: 5; top: 0; right: 0; margin: 0;
  }
  #todayView .today-desktop-head .page-title-copy { display: none; }
  #todayView .today-desktop-head .page-title-row { justify-content: flex-end; }

  .today-mobile-dashboard {
    --modern-blue: var(--modern-accent);
    --modern-green: var(--modern-success);
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px;
    color: var(--modern-ink);
  }
  .modern-topbar { display: none; }
  .modern-welcome { min-height: 58px; padding-right: 390px; }
  .modern-welcome h1 {
    margin: 0; font-size: 30px; font-weight: 730; line-height: 1.08;
    letter-spacing: -.7px;
  }
  .modern-welcome p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
  .modern-welcome #todayMobileDate::first-letter { text-transform: uppercase; }

  .modern-overview-card {
    position: relative; overflow: hidden; width: 100%; min-height: 235px;
    padding: 30px 34px; border: 1px solid rgba(118, 164, 255, .65);
    border-radius: var(--radius-lg);
    background: linear-gradient(118deg, #0d369d 0%, #0c4ccc 48%, #1164f3 100%);
    box-shadow: 0 14px 30px rgba(17, 68, 176, .18); color: #fff; text-align: left;
  }
  .modern-overview-card::before {
    content: ''; position: absolute; z-index: 0; right: -105px; bottom: -180px;
    width: 520px; height: 310px; border-radius: 50%; transform: rotate(-10deg);
    background: linear-gradient(180deg, rgba(68,119,255,.64), rgba(9,54,190,.68));
    box-shadow: inset 0 1px 0 rgba(175,204,255,.28); pointer-events: none;
  }
  .modern-overview-card::after {
    content: ''; position: absolute; z-index: 0; right: -100px; bottom: -205px;
    width: 410px; height: 250px; border: 1px solid rgba(151,188,255,.4);
    border-radius: 50%; transform: rotate(-8deg); background: rgba(8,56,199,.24);
    pointer-events: none;
  }
  .modern-overview-label {
    position: relative; z-index: 2; display: flex; align-items: center; gap: 8px;
    color: rgba(255,255,255,.88); font-size: 16px;
  }
  .modern-overview-label i {
    display: inline-grid; place-items: center; width: 19px; height: 19px;
    border: 1px solid rgba(255,255,255,.55); border-radius: 50%;
    font-size: 11px; font-style: normal; font-weight: 750;
  }
  .modern-overview-card > strong {
    position: relative; z-index: 2; display: block; max-width: calc(100% - 190px);
    margin-top: 18px; overflow: hidden; font-size: clamp(44px, 4.8vw, 64px);
    font-weight: 680; line-height: .98; letter-spacing: -2px;
    text-overflow: ellipsis; white-space: nowrap;
  }
  .modern-overview-visual {
    position: absolute; z-index: 1; top: 22px; right: 4px; width: 210px; height: 215px;
    pointer-events: none;
  }
  .modern-kpi-bank-card {
    position: absolute; top: 12px; right: 0; display: grid; place-items: start center;
    width: 155px; height: 195px; padding-top: 48px;
    border: 1px solid rgba(255,255,255,.5); border-radius: 20px; transform: rotate(9deg);
    background: linear-gradient(145deg, rgba(236,243,255,.94), rgba(139,176,255,.67) 52%, rgba(52,105,238,.5));
    box-shadow: inset 0 1px 8px rgba(255,255,255,.45), 0 12px 30px rgba(4,34,126,.22);
  }
  .modern-kpi-bank-card::after {
    content: ''; position: absolute; left: -28px; right: -24px; bottom: -46px; height: 96px;
    border-top: 1px solid rgba(168,200,255,.55); border-radius: 28px 28px 0 0;
    background: linear-gradient(155deg, rgba(44,104,246,.8), rgba(12,68,214,.93));
    transform: rotate(-7deg);
  }
  .modern-kpi-bank-card b {
    color: #1857d5; font-size: 48px; font-weight: 760; line-height: 1;
    transform: rotate(-2deg);
  }
  .modern-overview-card:hover, .modern-overview-card:active {
    background: linear-gradient(118deg, #0d369d 0%, #0c4ccc 48%, #1164f3 100%);
    color: #fff; transform: none;
  }
  .modern-overview-card .today-mobile-trend {
    position: relative; z-index: 2; display: flex; align-items: center; gap: 9px;
    width: max-content; max-width: calc(100% - 180px); min-height: 38px;
    margin-top: 22px; color: #fff; font-size: 14px;
  }
  .modern-trend-icon {
    display: grid; place-items: center; width: 34px; height: 34px; flex: none;
    border-radius: 50%; background: rgba(56,185,137,.2); color: #79e0ad;
  }
  .modern-trend-icon svg { width: 18px; height: 18px; }
  .today-mobile-trend > strong { color: inherit; font-size: 14px; }
  .modern-overview-card .today-mobile-trend > span:last-child { color: rgba(255,255,255,.72); }
  .modern-overview-card .today-mobile-trend.is-negative .modern-trend-icon {
    background: rgba(255,113,113,.2); color: #ffb0b0;
  }

  .modern-open-invoices {
    display: grid; grid-template-columns: 58px minmax(0, 1fr) 22px; align-items: center;
    gap: 16px; width: 100%; min-height: 235px; padding: 28px;
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    background: var(--paper); box-shadow: var(--shadow); text-align: left;
  }
  .modern-open-invoices.has-overdue { border-left: 4px solid var(--danger); }
  .modern-notification-icon {
    display: grid; place-items: center; width: 56px; height: 56px;
    border-radius: var(--radius-md); background: var(--modern-icon-blue-bg); color: var(--modern-blue);
  }
  .has-overdue .modern-notification-icon { background: var(--danger-soft); color: var(--danger); }
  .modern-notification-icon svg { width: 29px; height: 29px; }
  .modern-open-invoices strong, .modern-open-invoices small { display: block; }
  .modern-open-invoices strong { font-size: 19px; line-height: 1.2; }
  .modern-open-invoices small { margin-top: 7px; color: var(--muted); font-size: 14px; }
  .modern-chevron { width: 22px; height: 22px; color: var(--muted); }

  .modern-financial-summary {
    min-height: 170px; padding: 24px; border: 1px solid var(--line);
    border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow);
  }
  .modern-financial-summary h2 {
    display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
    margin: 0; font-size: 20px;
  }
  .modern-financial-summary h2 small { color: var(--muted); font-size: 12px; font-weight: 600; }
  .modern-financial-summary > div {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 20px;
  }
  .modern-financial-summary button {
    display: flex; min-width: 0; min-height: 92px; flex-direction: column; align-items: flex-start;
    padding: 2px 18px; border: 0; border-right: 1px solid var(--line);
    border-radius: 0; background: transparent; color: var(--modern-ink); text-align: left;
  }
  .modern-financial-summary button:first-child { padding-left: 2px; }
  .modern-financial-summary button:last-child { padding-right: 2px; border-right: 0; }
  .modern-financial-summary svg { width: 28px; height: 28px; color: var(--muted); }
  .modern-financial-summary svg.is-orange { color: var(--modern-kpi-orange); }
  .modern-financial-summary svg.is-blue { color: var(--modern-blue); }
  .modern-financial-summary span {
    overflow: hidden; width: 100%; margin-top: 7px; color: var(--muted);
    font-size: 13px; text-overflow: ellipsis; white-space: nowrap;
  }
  .modern-financial-summary strong {
    overflow: hidden; width: 100%; margin-top: 6px; font-size: clamp(19px, 2vw, 25px);
    line-height: 1; text-overflow: ellipsis; white-space: nowrap;
  }

  .modern-attention { min-height: 0; }
  .modern-attention h2 { margin: 0 0 10px 2px; font-size: 18px; }
  .modern-attention-card {
    display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center;
    gap: 14px; min-height: 118px; padding: 18px;
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    background: var(--paper); box-shadow: var(--shadow);
  }
  .modern-attention-icon {
    display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
    background: var(--modern-icon-blue-bg); color: var(--modern-blue);
  }
  .modern-attention.is-overdue .modern-attention-icon { background: var(--danger-soft); color: var(--danger); }
  .modern-attention.is-clear .modern-attention-icon { background: var(--modern-icon-green-bg); color: var(--modern-green); }
  .modern-attention-icon svg { width: 24px; height: 24px; }
  .modern-attention-card strong, .modern-attention-card small { display: block; }
  .modern-attention-card strong { font-size: 16px; line-height: 1.25; }
  .modern-attention-card small { margin-top: 5px; color: var(--muted); font-size: 13px; }
  .modern-attention-card .modern-focus-action {
    min-height: 44px; padding: 8px 14px; border-color: var(--info-line);
    background: transparent; color: var(--modern-blue); white-space: nowrap;
  }
  .modern-attention.is-overdue .modern-attention-card .modern-focus-action { color: var(--modern-blue); }

  .modern-daily-briefing {
    overflow: hidden; padding: 22px; border: 1px solid var(--line);
    border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow);
  }
  .modern-focus-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    padding-bottom: 16px;
  }
  .modern-focus-head span, .modern-focus-head strong, .modern-focus-head small { display: block; }
  .modern-focus-head strong { font-size: 20px; }
  .modern-focus-head small { margin-top: 4px; color: var(--muted); font-size: 13px; }
  .modern-focus-head > b {
    flex: none; padding: 5px 10px; border-radius: 999px;
    background: var(--blue-soft); color: var(--modern-blue); font-size: 12px;
  }
  .modern-daily-briefing .modern-attention > h2,
  .modern-daily-briefing .modern-upcoming > h2 { display: none; }
  .modern-daily-briefing #todayModernAttention .modern-attention-card {
    min-height: 88px; padding: 14px; border: 0; background: var(--surface-soft); box-shadow: none;
  }
  .modern-focus-context { margin-top: 8px; border-top: 1px solid var(--line); }
  .modern-daily-briefing .modern-open-invoices {
    min-height: 68px; padding: 10px 14px 10px 2px; border: 0; border-radius: 0;
    background: transparent; box-shadow: none;
  }
  .modern-daily-briefing .modern-notification-icon,
  .modern-daily-briefing .modern-upcoming .modern-attention-icon {
    width: 42px; height: 42px; border-radius: var(--radius-sm);
  }
  .modern-daily-briefing .modern-notification-icon svg,
  .modern-daily-briefing .modern-upcoming .modern-attention-icon svg { width: 22px; height: 22px; }
  .modern-daily-briefing .modern-open-invoices strong { font-size: 15px; }
  .modern-daily-briefing .modern-open-invoices small { margin-top: 3px; font-size: 12px; }
  .modern-daily-briefing .modern-upcoming .modern-attention-card {
    min-height: 72px; padding: 10px 14px 10px 2px; border: 0; border-top: 1px solid var(--line);
    border-radius: 0; background: transparent; box-shadow: none;
  }
  .modern-daily-briefing #todayModernAttention .modern-attention-card,
  .modern-daily-briefing .modern-open-invoices,
  .modern-daily-briefing .modern-upcoming .modern-attention-card {
    grid-template-columns: 42px minmax(0, 1fr) 72px;
    gap: 14px;
  }
  /* Alle regels in 'Vandaag voor jou' eindigen met dezelfde rustige actie.
     De statuskleur zit al in het icoon; rode en blauwe knopkaders maakten drie
     identieke handelingen onnodig verschillend. De vaste maat houdt de
     rechterkant op tablet en desktop exact op één lijn. */
  .modern-daily-briefing .modern-focus-action,
  .modern-daily-briefing .modern-attention.is-overdue .modern-focus-action {
    display: inline-grid; place-items: center;
    width: 72px; min-width: 72px; height: 40px; min-height: 40px;
    padding: 0; border: 0; border-radius: 10px;
    background: transparent; color: var(--modern-blue);
    font-size: 13px; font-weight: 650; line-height: 1;
  }

  .modern-quick-actions {
    position: static; margin: 0; padding: 22px; border: 1px solid var(--line);
    border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow);
  }
  .modern-quick-actions h2 { margin: 0 0 14px; font-size: 18px; }
  .modern-quick-actions > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .modern-quick-actions button {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    min-width: 0; min-height: 64px; padding: 10px;
    border: 1px solid var(--line); border-radius: var(--radius-md);
    background: var(--paper); color: var(--modern-ink); font-size: 13px; font-weight: 650;
  }
  .modern-quick-actions button.is-primary { border-color: var(--modern-blue); background: var(--modern-blue); color: #fff; }
  .modern-quick-actions button svg { width: 23px; height: 23px; }
  .modern-quick-actions button:nth-child(2) svg { color: var(--modern-blue); }
}

/* ---- Controlewerkplek -------------------------------------------------
 * De pagina blijft ook zonder open punten informatief: status, dekking en
 * historie vullen één symmetrisch dashboard. De twee middenpanelen delen
 * exact dezelfde maat en hun lange inhoud scrolt intern. */
.checks-page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin-bottom: 22px;
}
.checks-page-head > div:first-child { min-width: 0; }
.checks-page-head h1 { margin: 0; }
.checks-page-head p { margin: 4px 0 0; }
.checks-page-actions { flex: none; display: flex; gap: 10px; }
.checks-page-actions .page-header-action { min-height: 44px; }
#checksRefreshButton.is-loading svg { animation: checks-spin .7s linear infinite; }
@keyframes checks-spin { to { transform: rotate(360deg); } }

.checks-status-card {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center; column-gap: 18px; row-gap: 13px;
  min-height: 126px; padding: 22px 24px;
  border: 1px solid var(--green-line); border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--green-soft) 54%, var(--paper));
  box-shadow: var(--shadow);
}
.checks-status-card.has-attention {
  border-color: var(--amber-line);
  background: color-mix(in srgb, var(--amber-soft) 52%, var(--paper));
}
.checks-status-card.is-empty {
  border-color: var(--line); background: var(--paper);
}
.checks-status-icon {
  display: grid; place-items: center; width: 62px; height: 62px;
  border-radius: 50%; background: color-mix(in srgb, var(--green-soft) 72%, var(--paper));
  color: var(--green);
}
.checks-status-card.has-attention .checks-status-icon {
  background: var(--amber-soft); color: var(--amber);
}
.checks-status-card.is-empty .checks-status-icon { background: var(--blue-soft); color: var(--blue); }
.checks-status-icon svg { width: 32px; height: 32px; stroke-width: 1.6; }
.checks-status-copy strong, .checks-status-copy small { display: block; }
.checks-status-copy strong { font-size: 20px; line-height: 1.2; }
.checks-status-copy small { margin-top: 5px; color: var(--muted); font-size: 13px; }
.checks-status-badge {
  padding: 6px 11px; border: 1px solid var(--green-line); border-radius: var(--radius-pill);
  background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 650;
  white-space: nowrap;
}
.checks-status-card.has-attention .checks-status-badge {
  border-color: var(--amber-line); background: var(--amber-soft); color: var(--amber);
}
.checks-status-card.is-empty .checks-status-badge {
  border-color: var(--line); background: var(--surface-soft); color: var(--muted);
}
.checks-progress {
  grid-column: 2 / -1; overflow: hidden; height: 6px;
  border-radius: var(--radius-pill); background: color-mix(in srgb, var(--green-soft) 70%, var(--line));
}
.checks-progress i {
  display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green);
  transition: width .3s ease;
}
.checks-status-card.has-attention .checks-progress { background: color-mix(in srgb, var(--amber-soft) 70%, var(--line)); }
.checks-status-card.has-attention .checks-progress i { background: var(--amber); }

.checks-kpi-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px; margin: 18px 0;
}
.checks-kpi {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) 18px;
  align-items: center; gap: 12px; min-width: 0; min-height: 94px; padding: 15px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--paper); color: var(--ink); text-align: left;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.checks-kpi:hover, .checks-kpi.is-active {
  border-color: color-mix(in srgb, var(--blue) 38%, var(--line)); background: var(--hover);
}
.checks-kpi.is-active { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 16%, transparent); }
.checks-kpi-icon {
  display: grid; place-items: center; width: 46px; height: 46px;
  border-radius: 13px; background: var(--blue-soft); color: var(--blue);
}
.checks-kpi.is-attention .checks-kpi-icon { background: var(--danger-soft); color: var(--danger); }
.checks-kpi.is-work .checks-kpi-icon { background: var(--green-soft); color: var(--green); }
.checks-kpi.is-original .checks-kpi-icon { background: var(--modern-icon-orange-bg); color: var(--modern-kpi-orange); }
.checks-kpi-icon svg { width: 23px; height: 23px; }
.checks-kpi > span:nth-child(2) { min-width: 0; }
.checks-kpi small, .checks-kpi strong { display: block; }
.checks-kpi small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.checks-kpi strong { overflow: hidden; margin-top: 5px; font-size: 20px; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.checks-kpi-chevron { width: 16px; height: 16px; color: var(--muted); }

.checks-workspace {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px; align-items: stretch;
}
.checks-workspace.is-single { grid-template-columns: minmax(0, 1fr); }
.checks-workspace.is-single .checks-coverage-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px;
}
#checksView .checks-workspace > .panel {
  min-width: 0; min-height: 350px; margin: 0; padding: 20px;
  border-radius: var(--radius-lg);
}
#checksView .checks-workspace > .panel > h2 { margin: 0; font-size: 18px; }
.checks-coverage-panel > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 34px; color: var(--ink); cursor: pointer; list-style: none;
  font-size: 18px; font-weight: 700;
}
.checks-coverage-panel > summary::-webkit-details-marker { display: none; }
.checks-coverage-panel > summary::after {
  content: '›'; color: var(--muted); font-size: 26px; font-weight: 400;
  line-height: 1; transform: rotate(90deg); transition: transform .16s ease;
}
.checks-coverage-panel[open] > summary::after { transform: rotate(-90deg); }
.checks-coverage-panel > summary small {
  margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 600;
}
.checks-switch {
  display: flex; gap: 22px; margin-top: 14px; border-bottom: 1px solid var(--line);
}
.checks-switch button {
  min-height: 38px; padding: 5px 3px 9px; border: 0; border-bottom: 2px solid transparent;
  border-radius: 0; background: transparent; color: var(--muted); font-size: 12px;
}
.checks-switch button:hover { background: transparent; color: var(--ink); }
.checks-switch button.is-active { border-bottom-color: var(--blue); color: var(--blue); font-weight: 650; }
.checks-summary { min-height: 19px; margin: 10px 0 6px; }
.checks-list { max-height: 238px; overflow: auto; padding-right: 2px; }
.checks-clear-state {
  display: grid; place-items: center; align-content: center; min-height: 208px;
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-soft) 58%, var(--paper)); text-align: center;
}
.checks-clear-icon {
  display: grid; place-items: center; width: 52px; height: 52px;
  border-radius: 50%; background: var(--green-soft); color: var(--green);
  font-size: 24px; font-weight: 700;
}
.checks-clear-state strong { margin-top: 13px; font-size: 15px; }
.checks-clear-state small { margin-top: 4px; color: var(--muted); font-size: 12px; }

.checks-coverage-list { margin-top: 14px; }
.checks-coverage-row {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center; gap: 10px; min-height: 43px; border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px;
}
.checks-coverage-row:last-child { border-bottom: 0; }
.checks-coverage-mark {
  display: grid; place-items: center; width: 18px; height: 18px;
  border: 1px solid var(--green-line); border-radius: 50%; color: var(--green);
  font-size: 11px; font-weight: 750;
}
.checks-coverage-row.is-warning .checks-coverage-mark {
  border-color: var(--amber-line); background: var(--amber-soft); color: var(--amber);
}
.checks-coverage-row strong { color: var(--muted); font-size: 12px; font-weight: 600; }

#checksView .checks-history-panel {
  margin: 18px 0 0; padding: 17px 20px 10px; border-radius: var(--radius-lg);
}
.checks-page-actions {
  justify-content: flex-end; margin: 18px 0 0;
}
.checks-history-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 42px; margin-bottom: 5px;
}
#checksView .checks-history-head h2 { margin: 0; font-size: 18px; }
.checks-download-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 7px 11px;
  border-color: var(--line); background: var(--surface-soft); color: var(--ink);
  font-size: 12px; font-weight: 650;
}
.checks-download-button:hover {
  border-color: color-mix(in srgb, var(--blue) 30%, var(--line)); background: var(--hover);
}
.checks-download-button svg { width: 17px; height: 17px; color: var(--blue); }
.checks-download-button small {
  padding: 2px 5px; border-radius: 6px; background: var(--blue-soft);
  color: var(--blue); font-size: 10px; font-weight: 700; line-height: 1.2;
}
.checks-history-list { display: grid; }
.checks-history-row {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 18px;
  align-items: center; gap: 10px; min-height: 43px; padding: 5px 2px;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; color: var(--ink); text-align: left;
}
.checks-history-row:last-child { border-bottom: 0; }
.checks-history-row:hover { background: var(--hover); }
.checks-history-mark {
  display: grid; place-items: center; width: 18px; height: 18px;
  border: 1px solid var(--green-line); border-radius: 50%; color: var(--green);
  font-size: 11px; font-weight: 750;
}
.checks-history-copy { overflow: hidden; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.checks-history-row time { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.checks-history-chevron { color: var(--muted); font-size: 20px; }
.checks-history-empty { margin: 0; padding: 18px 2px; color: var(--muted); font-size: 12px; }

@media (min-width: 1200px) {
  .main:has(#checksView:not([hidden])) { max-width: none; }
  #checksView { max-width: 1280px; margin-inline: auto; }
}

@media (max-width: 1050px) {
  .checks-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checks-workspace { grid-template-columns: 1fr; }
  #checksView .checks-workspace > .panel { min-height: 0; }
  .checks-list { max-height: 360px; }
}

@media (max-width: 720px) {
  .checks-page-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .checks-page-actions { width: 100%; }
  .checks-page-actions button { flex: 1; min-width: 0; padding-inline: 9px; font-size: 11px; }
  .checks-status-card {
    grid-template-columns: 48px minmax(0, 1fr); min-height: 0; padding: 16px;
  }
  .checks-status-icon { width: 46px; height: 46px; }
  .checks-status-icon svg { width: 25px; height: 25px; }
  .checks-status-copy strong { font-size: 16px; }
  .checks-status-copy small { font-size: 11px; }
  .checks-status-badge { grid-column: 1 / -1; justify-self: start; }
  .checks-progress { grid-column: 1 / -1; }
  .checks-kpi-grid { gap: 9px; margin: 12px 0; }
  .checks-kpi {
    grid-template-columns: 38px minmax(0, 1fr); min-height: 82px; gap: 9px; padding: 10px;
  }
  .checks-kpi-icon { width: 38px; height: 38px; }
  .checks-kpi-icon svg { width: 20px; height: 20px; }
  .checks-kpi strong { font-size: 16px; }
  .checks-kpi-chevron { display: none; }
  #checksView .checks-workspace > .panel { padding: 16px; border-radius: var(--radius-md); }
  .checks-workspace.is-single .checks-coverage-list { grid-template-columns: 1fr; }
  .checks-switch { gap: 12px; overflow-x: auto; }
  #checksView .checks-history-panel { padding: 16px; border-radius: var(--radius-md); }
  .checks-history-head { gap: 10px; }
  .checks-download-button { padding-inline: 9px; }
  .checks-download-button span { font-size: 0; }
  .checks-download-button span::after { content: 'Download'; font-size: 11px; }
  .checks-history-row { grid-template-columns: 22px minmax(0, 1fr) 14px; }
  .checks-history-row time { display: none; }
}

@media (min-width: 1100px) {
  .today-mobile-dashboard {
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr);
  }
  .modern-welcome { grid-column: 1 / -1; }
  .modern-overview-card { grid-column: 1; grid-row: 2; }
  .modern-daily-briefing { grid-column: 2; grid-row: 2 / 4; }
  .modern-quick-actions { grid-column: 1; grid-row: 3; }
}

/* De drie regels van 'Vandaag voor jou' vormen op mobiel één ritmische lijst:
   gelijke hoogte, gelijke iconkolom en exact dezelfde tekstas. */
@media (max-width: 720px) {
  .modern-daily-briefing #todayModernAttention .modern-attention-card,
  .modern-daily-briefing .modern-open-invoices,
  .modern-daily-briefing .modern-upcoming .modern-attention-card {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 60px;
    padding: 7px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .modern-focus-context { margin-top: 0; border-top: 0; }
  .modern-daily-briefing .modern-open-invoices,
  .modern-daily-briefing .modern-upcoming .modern-attention-card {
    border-top: 1px solid var(--line);
  }
  .modern-daily-briefing .modern-attention-icon,
  .modern-daily-briefing .modern-notification-icon,
  .modern-daily-briefing .modern-upcoming .modern-attention-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }
  .modern-daily-briefing .modern-attention-icon svg,
  .modern-daily-briefing .modern-notification-icon svg,
  .modern-daily-briefing .modern-upcoming .modern-attention-icon svg {
    width: 19px;
    height: 19px;
  }
  .modern-daily-briefing .modern-focus-action {
    display: inline-grid;
    place-items: center;
    width: 72px;
    min-width: 72px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--modern-blue);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
  }
  .modern-focus-head > b {
    display: grid;
    place-items: center;
    width: 72px;
    min-width: 72px;
    padding: 4px 0;
    background: var(--amber-soft);
    color: var(--amber);
    text-align: center;
  }
  .modern-topbar { margin-bottom: 4px; }
  .modern-welcome { margin-bottom: 5px; }
  .modern-overview-card { margin-bottom: 6px; }
}

/* ---- Responsieve navigatierail ---------------------------------------
 * De inhoud blijft het lichte werkvlak. Vanaf tabletformaat vormt een vaste
 * marineblauwe balk het herkenbare navigatieanker. Op smallere Macs en tablets
 * klapt alleen de tekst in; de mobiele tabbar onder 721px blijft onaangeraakt.
 * -------------------------------------------------------------------- */

:root {
  --sidebar-bg: #0f1b35;
  --sidebar-hover: #1b2d50;
  --sidebar-active: #2a4069;
  --sidebar-text: #ffffff;
  --sidebar-muted: #b3bfd2;
  --sidebar-line: rgba(255, 255, 255, .12);
}

:root[data-theme="dark"] {
  --sidebar-bg: #0b1428;
  --sidebar-hover: #182746;
  --sidebar-active: #293f68;
  --sidebar-text: #ffffff;
  --sidebar-muted: #b3bfd2;
  --sidebar-line: rgba(255, 255, 255, .12);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sidebar-bg: #0b1428;
    --sidebar-hover: #182746;
    --sidebar-active: #293f68;
    --sidebar-text: #ffffff;
    --sidebar-muted: #b3bfd2;
    --sidebar-line: rgba(255, 255, 255, .12);
  }
}

@media (min-width: 721px) {
  .app { grid-template-columns: 236px minmax(0, 1fr); }
  .sidebar {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-right: 0;
    box-shadow: 10px 0 32px rgba(12, 25, 51, .06);
  }
  .sidebar .brand { color: var(--sidebar-text); }
  .sidebar .brand strong { color: var(--sidebar-text); }
  .sidebar .nav-button {
    position: relative;
    color: var(--sidebar-muted);
  }
  .sidebar .nav-button:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
  }
  .sidebar .nav-button.is-active {
    background: var(--sidebar-active);
    color: var(--sidebar-text);
    font-weight: 650;
  }
  .sidebar .nav-icon {
    color: currentColor;
    filter: none;
    opacity: .82;
  }
  .sidebar .nav-button:hover .nav-icon,
  .sidebar .nav-button.is-active .nav-icon { opacity: 1; }
  .sidebar .sidebar-foot { border-top-color: var(--sidebar-line); }
  .sidebar .privacy-note { color: var(--sidebar-muted); }
  .sidebar .privacy-note strong { color: var(--sidebar-text); }
  .sidebar .privacy-dot { background: #70d4b2; }
  .sidebar :focus-visible { outline-color: #ffffff; }
}

@media (min-width: 721px) and (max-width: 1180px) {
  .app { grid-template-columns: 88px minmax(0, 1fr); }
  .sidebar {
    align-items: center;
    padding: 22px 12px;
    gap: 7px;
  }
  .sidebar > .brand {
    justify-content: center;
    width: 100%;
    padding: 0 0 25px;
  }
  .sidebar > .brand .brand-logo { width: 42px; height: 42px; }
  .sidebar > .brand strong { display: none; }
  .sidebar > .nav-button,
  .sidebar > .sidebar-foot > .nav-button {
    justify-content: center;
    width: 56px;
    min-height: 52px;
    padding: 0;
    border-radius: 14px;
  }
  .sidebar .nav-button > span:not(.nav-count) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .sidebar .nav-icon { width: 23px; height: 23px; }
  .sidebar > .sidebar-foot {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
    padding-top: 14px;
  }
  .sidebar > .sidebar-foot .privacy-note { display: none; }
  .sidebar .nav-count {
    position: absolute;
    top: 3px;
    right: 2px;
    min-width: 18px;
    margin: 0;
    padding: 1px 5px;
    border: 2px solid var(--sidebar-bg);
    font-size: 10px;
    line-height: 13px;
  }
  .sidebar .nav-button::after {
    content: attr(data-tooltip);
    position: absolute;
    z-index: 80;
    top: 50%;
    left: calc(100% + 12px);
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--paper);
    box-shadow: 0 10px 28px rgba(15, 27, 53, .16);
    color: var(--ink);
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translate(4px, -50%);
    visibility: hidden;
    transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
  }
  .sidebar .nav-button:hover::after,
  .sidebar .nav-button:focus-visible::after {
    opacity: 1;
    transform: translate(0, -50%);
    visibility: visible;
  }
}

/* ---- Symmetrisch desktopdashboard -----------------------------------
 * Tablet en mobiel behouden hun compacte compositie. Vanaf 1200 px vormen
 * omzet en aandacht één even hoge bovenrij; de maandcijfers en twee resterende
 * snelacties delen daaronder één kaart en exact dezelfde verticale as. */
.modern-month-panel { display: contents; }
#todayFinancialSummary { display: none; }

@media (min-width: 1181px) {
  .app { grid-template-columns: 210px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .sidebar .nav-button { font-size: 15px; }
}

@media (min-width: 1200px) {
  .main:has(#todayView:not([hidden])) { max-width: none; }
  #todayView { max-width: 1280px; margin-inline: auto; }
  .today-mobile-dashboard {
    grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
    gap: 24px;
    align-items: stretch;
  }
  .modern-welcome {
    grid-column: 1 / -1;
    min-height: 70px;
    padding-right: 320px;
  }
  .modern-overview-card {
    grid-column: 1;
    grid-row: 2;
    height: 360px;
    min-height: 360px;
    padding: 36px 38px;
  }
  .modern-overview-card > strong {
    max-width: calc(100% - 120px);
    margin-top: 26px;
    font-size: clamp(48px, 4.6vw, 62px);
  }
  .modern-overview-card .today-mobile-trend {
    max-width: calc(100% - 120px);
    margin-top: 28px;
  }
  .modern-overview-visual {
    top: 74px;
    right: -8px;
    width: 176px;
    height: 210px;
  }
  .modern-kpi-bank-card {
    width: 142px;
    height: 178px;
    padding-top: 44px;
  }

  .modern-daily-briefing {
    grid-column: 2;
    grid-row: 2;
    height: 360px;
    min-height: 360px;
    padding: 26px 28px;
  }
  .modern-focus-head { min-height: 64px; padding-bottom: 14px; }
  .modern-focus-head strong { font-size: 21px; }
  .modern-focus-head small { font-size: 13px; }
  .modern-daily-briefing #todayModernAttention .modern-attention-card,
  .modern-daily-briefing .modern-open-invoices,
  .modern-daily-briefing .modern-upcoming .modern-attention-card {
    grid-template-columns: 46px minmax(0, 1fr) 132px;
    gap: 16px;
  }
  .modern-daily-briefing #todayModernAttention .modern-attention-card {
    min-height: 88px;
    padding: 13px 14px;
    border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
    border-radius: var(--radius-md);
  }
  .modern-focus-context { margin-top: 8px; }
  .modern-daily-briefing .modern-open-invoices,
  .modern-daily-briefing .modern-upcoming .modern-attention-card {
    min-height: 82px;
    padding: 11px 14px;
  }
  .modern-daily-briefing .modern-attention-card strong,
  .modern-daily-briefing .modern-open-invoices strong { font-size: 15px; }
  .modern-daily-briefing .modern-attention-card small,
  .modern-daily-briefing .modern-open-invoices small {
    overflow: visible;
    font-size: 12px;
    text-overflow: clip;
    white-space: normal;
  }
  .modern-daily-briefing .modern-focus-action {
    width: 132px;
    min-width: 132px;
    font-size: 0;
  }
  .modern-daily-briefing .modern-attention.is-overdue .modern-focus-action {
    width: 132px;
    min-width: 132px;
    font-size: 0;
  }
  .modern-daily-briefing .modern-focus-action::before {
    content: attr(data-desktop-label);
    font-size: 13px;
  }
  .modern-daily-briefing .modern-row-chevron {
    width: 132px;
    min-width: 132px;
    justify-content: end;
    font-size: 0;
  }
  .modern-daily-briefing .modern-row-chevron::after {
    content: '›';
    font-size: 28px;
    font-weight: 400;
    line-height: 1;
  }

  .modern-month-panel {
    display: grid;
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: minmax(0, 1fr);
    min-height: 208px;
    padding: 25px 28px 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    box-shadow: var(--shadow);
  }
  #todayFinancialSummary {
    display: block;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .modern-financial-summary h2 { margin: 0; font-size: 20px; }
  .modern-financial-summary > div {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
  }
  .modern-financial-summary .modern-month-metric {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-height: 112px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
    text-align: left;
  }
  .modern-financial-summary > div > .modern-month-metric:first-child,
  .modern-financial-summary > div > .modern-month-metric:last-child {
    padding-inline: 16px;
  }
  .modern-financial-summary .modern-month-metric {
    transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
  }
  .modern-financial-summary .modern-month-metric:hover {
    border-color: color-mix(in srgb, var(--blue) 38%, var(--line));
    background: var(--hover);
  }
  .modern-financial-summary .modern-month-metric:disabled { opacity: 1; cursor: default; }
  .modern-month-icon {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 14px;
  }
  .modern-month-icon.is-blue { background: var(--modern-icon-blue-bg); color: var(--modern-blue); }
  .modern-month-icon.is-green { background: var(--modern-icon-green-bg); color: var(--modern-success); }
  .modern-month-icon.is-purple {
    background: color-mix(in srgb, var(--blue-soft) 72%, #f2eaff);
    color: color-mix(in srgb, var(--modern-blue) 72%, #8b35d8);
  }
  .modern-month-icon.is-orange {
    background: var(--modern-icon-orange-bg);
    color: var(--modern-kpi-orange);
  }
  .modern-month-icon svg { width: 25px; height: 25px; }
  .modern-financial-summary .modern-month-copy {
    display: block;
    min-width: 0;
    width: auto;
    margin: 0;
  }
  .modern-financial-summary .modern-month-copy small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 550;
    white-space: nowrap;
  }
  .modern-financial-summary .modern-month-copy strong {
    display: block;
    overflow: hidden;
    width: 100%;
    margin-top: 6px;
    font-size: clamp(18px, 1.7vw, 24px);
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .modern-month-panel .modern-quick-actions { display: none; }
}

/* Op een 13-inch MacBook is de desktopcompositie al actief, maar blijft het
   eurobedrag volledig leesbaar naast de kaartillustratie. */
@media (min-width: 1200px) and (max-width: 1399px) {
  .today-mobile-dashboard {
    grid-template-columns: minmax(0, .96fr) minmax(0, 1.04fr);
  }
  .modern-overview-card > strong {
    max-width: calc(100% - 76px);
    font-size: clamp(42px, 4.1vw, 54px);
  }
  .modern-overview-card .today-mobile-trend { max-width: calc(100% - 72px); }
  .modern-overview-visual { right: -30px; width: 150px; opacity: .88; }
}

/* Desktopacties horen bij elkaar. Het menu houdt de kop rustig, terwijl de
   drie manieren om iets toe te voegen op één voorspelbare plek blijven. */
@media (min-width: 721px) {
  .today-new-menu { position: relative; z-index: 20; }
  .today-new-menu > summary {
    display: flex; align-items: center; justify-content: center;
    min-width: 132px; min-height: 44px; padding: 10px 15px;
    border: 1px solid var(--blue); border-radius: var(--radius-sm);
    background: var(--blue); box-shadow: 0 8px 20px rgba(27, 92, 220, .18);
    color: #fff; cursor: pointer; font-weight: 680; list-style: none;
    transition: box-shadow .18s ease, transform .18s ease, filter .18s ease;
  }
  .today-new-menu > summary::-webkit-details-marker { display: none; }
  .today-new-menu > summary:hover {
    filter: brightness(1.035); box-shadow: 0 11px 25px rgba(27, 92, 220, .24);
    transform: translateY(-1px);
  }
  .today-new-menu > summary:focus-visible {
    outline: 0; box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 20%, transparent),
      0 11px 25px rgba(27, 92, 220, .22);
  }
  .today-new-chevron {
    width: 16px; height: 16px; margin-left: 8px; transform: rotate(90deg);
    transition: transform .18s ease;
  }
  .today-new-menu[open] .today-new-chevron { transform: rotate(-90deg); }
  .today-new-popover {
    position: absolute; top: calc(100% + 10px); right: 0;
    display: grid; width: 286px; padding: 8px;
    border: 1px solid var(--line); border-radius: var(--radius-md);
    background: var(--paper); box-shadow: 0 20px 48px rgba(15, 36, 78, .18);
  }
  .today-new-popover button {
    display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center;
    gap: 11px; width: 100%; min-height: 62px; padding: 9px 10px;
    border: 0; border-radius: 11px; background: transparent; color: var(--ink);
    text-align: left;
  }
  .today-new-popover button:hover { background: var(--blue-soft); }
  .today-new-popover button:focus-visible {
    outline: 0; background: var(--blue-soft);
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--blue) 22%, transparent);
  }
  .today-new-popover button > svg {
    width: 20px; height: 20px; padding: 9px; box-sizing: content-box;
    border-radius: 11px; background: var(--modern-icon-blue-bg); color: var(--blue);
  }
  .today-new-popover strong, .today-new-popover small { display: block; }
  .today-new-popover strong { font-size: 13px; }
  .today-new-popover small { margin-top: 3px; color: var(--muted); font-size: 11px; }

  /* Hele regels zijn het klikdoel. Hover gebruikt diepte en tint in plaats van
     een formulierachtige outline of veranderende rand. */
  .modern-daily-briefing #todayModernAttention .modern-attention-card,
  .modern-daily-briefing .modern-open-invoices,
  .modern-daily-briefing .modern-upcoming .modern-attention-card {
    width: 100%; color: var(--modern-ink); text-align: left; cursor: pointer;
    transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
  }
  .modern-daily-briefing #todayModernAttention .modern-attention-card:hover,
  .modern-daily-briefing .modern-open-invoices:hover,
  .modern-daily-briefing .modern-upcoming .modern-attention-card:hover {
    border-color: color-mix(in srgb, var(--blue) 38%, var(--line));
    background: var(--hover);
    box-shadow: none;
  }
  .modern-daily-briefing #todayModernAttention .modern-attention-card:focus-visible,
  .modern-daily-briefing .modern-open-invoices:focus-visible,
  .modern-daily-briefing .modern-upcoming .modern-attention-card:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 15%, transparent);
  }
  .modern-daily-briefing .modern-attention.is-clear .modern-attention-card:disabled {
    cursor: default;
  }
  .modern-daily-briefing .modern-attention.is-clear .modern-attention-card:disabled:hover {
    background: var(--surface-soft); box-shadow: none;
  }
}

/* Definitieve mobiele rijgeometrie voor 'Vandaag voor jou'. Oudere varianten
   gebruikten deels `auto` en deels vaste kolommen, waardoor dezelfde actie op
   drie verschillende x-posities eindigde. Iedere rij deelt nu exact dezelfde
   icon-, tekst- en actiekolom. */
@media (max-width: 720px) {
  .modern-daily-briefing #todayModernAttention,
  .modern-daily-briefing .modern-focus-context,
  .modern-daily-briefing .modern-upcoming {
    display: block; width: 100%; min-width: 0; margin: 0;
  }
  .modern-daily-briefing #todayModernAttention .modern-attention-card,
  .modern-daily-briefing .modern-open-invoices,
  .modern-daily-briefing .modern-upcoming .modern-attention-card {
    display: grid; box-sizing: border-box;
    grid-template-columns: 34px minmax(0, 1fr) 72px;
    align-items: center; column-gap: 10px;
    width: 100%; min-width: 0; min-height: 60px;
    margin: 0; padding: 9px 4px;
    border: 0; border-radius: 0; background: transparent; box-shadow: none;
  }
  .modern-daily-briefing .modern-open-invoices,
  .modern-daily-briefing .modern-upcoming .modern-attention-card {
    border-top: 1px solid var(--line);
  }
  .modern-daily-briefing #todayModernAttention .modern-attention-card > span:nth-child(2),
  .modern-daily-briefing .modern-open-invoices > span:nth-child(2),
  .modern-daily-briefing .modern-upcoming .modern-attention-card > span:nth-child(2) {
    display: block; justify-self: stretch; min-width: 0; margin: 0; text-align: left;
  }
  .modern-daily-briefing .modern-attention-card strong,
  .modern-daily-briefing .modern-attention-card small,
  .modern-daily-briefing .modern-open-invoices strong,
  .modern-daily-briefing .modern-open-invoices small {
    display: block; margin-inline: 0; text-align: left;
  }
  .modern-daily-briefing .modern-attention-icon,
  .modern-daily-briefing .modern-notification-icon,
  .modern-daily-briefing .modern-upcoming .modern-attention-icon {
    justify-self: start; width: 34px; height: 34px; margin: 0;
  }
  .modern-daily-briefing .modern-focus-action,
  .modern-daily-briefing .modern-attention.is-overdue .modern-focus-action,
  .modern-daily-briefing .modern-row-chevron {
    display: grid; place-items: center; justify-self: end;
    width: 72px; min-width: 72px; height: 34px; min-height: 34px;
    margin: 0; padding: 0; border: 0; border-radius: 10px;
    background: transparent; color: var(--modern-blue);
    font-size: 11px; font-weight: 650; line-height: 1; text-align: center;
  }
  .modern-focus-head > b {
    width: 72px; min-width: 72px; box-sizing: border-box; text-align: center;
  }
}

/* ---- Finale pagina-uitlijning ---------------------------------------
 * De primaire informatie begint op elke hoofdpagina op dezelfde assen.
 * Alleen Vandaag houdt bewust ruimte voor merk en begroeting. */
@media (min-width: 721px) {
  :is(#invoicesView, #expensesView, #moneyView, #checksView, #settingsView) > .page-head {
    min-height: 58px;
    margin-bottom: 18px;
  }
  .expenses-page-head .page-title-row {
    flex-wrap: nowrap;
  }
  .expenses-page-head .page-title-copy {
    flex: 1 1 auto;
    min-width: 0;
  }
  .expenses-page-head .page-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
  }
  .expenses-page-head .page-header-action {
    padding-inline: 11px;
    font-size: 12px;
  }
}

@media (min-width: 721px) and (max-width: 1050px) {
  .expenses-page-head .page-header-action.is-secondary {
    width: 44px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }
  .expenses-page-head .page-header-action.is-secondary .button-icon {
    width: 19px;
    height: 19px;
  }
}

@media (max-width: 720px) {
  :is(#invoicesView, #expensesView, #moneyView, #checksView, #settingsView) > .page-head {
    display: block;
    overflow: hidden;
    width: 100%;
    height: 70px;
    min-height: 70px;
    margin: 0 0 14px;
    padding: 0;
  }
  :is(#invoicesView, #expensesView, #moneyView, #checksView, #settingsView) > .page-head p {
    display: -webkit-box;
    overflow: hidden;
    margin: 5px 0 0;
    font-size: 12px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  :is(.invoice-page-head, .expenses-page-head, .insights-page-head) .page-title-row {
    min-height: 0;
    align-items: flex-start;
  }

  /* Alle onderste hoofdacties volgen dezelfde 14px-paginakolom. */
  .mobile-invoice-actions.mobile-action-dock,
  .mobile-expense-actions.mobile-action-dock {
    left: calc(14px + env(safe-area-inset-left));
    right: calc(14px + env(safe-area-inset-right));
  }

  /* Hercontrole staat na de inhoud en bedekt daardoor nooit een controle. */
  #checksView { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  #checksView > .checks-page-actions {
    position: static;
    display: grid;
    width: 100%;
    margin: 14px 0 0;
  }
  #checksView #checksRefreshButton {
    width: 100%;
    min-height: 52px;
    border-color: var(--navy);
    border-radius: var(--radius-md);
    background: var(--navy);
    color: #fff;
    font-size: 12px;
  }
  .checks-status-card {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    height: 133px;
    min-height: 133px;
    padding: 16px;
  }
  .checks-status-badge {
    grid-column: auto;
    justify-self: end;
  }
  .checks-progress { grid-column: 1 / -1; }
  .checks-kpi-grid {
    display: flex;
    gap: 8px;
    margin: 14px 0;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .checks-kpi-grid::-webkit-scrollbar { display: none; }
  .checks-kpi {
    flex: 0 0 min(238px, 72vw);
    min-height: 76px;
    padding: 12px;
    scroll-snap-align: start;
  }
  #checksView.is-complete .checks-kpi-grid { display: none; }
  #checksView .checks-workspace {
    display: block;
    margin-top: 14px;
  }
  #checksView .checks-workspace > .panel {
    min-height: 0;
    padding: 16px;
    border-radius: var(--radius-md);
  }
  #checksView .checks-workspace > .panel + .panel { margin-top: 10px; }
  #checksView .checks-coverage-panel > summary {
    min-height: 44px;
    font-size: 15px;
  }
  #checksView .checks-coverage-list { margin-top: 8px; }
  #checksView.is-complete .checks-coverage-panel { background: var(--surface-soft); }
  #checksView .checks-history-panel { margin-top: 10px; }
}

@media (max-width: 370px) {
  .checks-status-card {
    grid-template-columns: 44px minmax(0, 1fr);
    height: auto;
  }
  .checks-status-badge {
    grid-column: 2;
    justify-self: start;
  }
}

/* ---- Eerste opening --------------------------------------------------
 * Dit scherm staat buiten de app-shell: een nieuwe gebruiker ziet nog geen
 * dashboard, navigatie of profielknop voordat de basis is ingericht. */
.first-run {
  --first-run-navy: #0d1b36;
  --first-run-blue: #2f5de3;
  --first-run-blue-deep: #2049c5;
  --first-run-soft: #edf3ff;
  min-height: 100dvh;
  padding: clamp(22px, 4vw, 54px);
  background:
    radial-gradient(circle at 92% 9%, rgba(64, 112, 232, .16), transparent 27%),
    linear-gradient(145deg, #f4f7fc 0%, #eef3fb 55%, #f8faff 100%);
  color: #111a2c;
}
.first-run-shell {
  display: grid;
  grid-template-columns: minmax(360px, 1.02fr) minmax(390px, .98fr);
  width: min(1120px, 100%);
  min-height: min(760px, calc(100dvh - clamp(44px, 8vw, 108px)));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(18, 42, 87, .1);
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 32px 90px rgba(20, 44, 90, .14);
}
.first-run-story {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(34px, 5vw, 64px);
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 82%, rgba(54, 105, 235, .34), transparent 36%),
    linear-gradient(145deg, #0b1830 0%, var(--first-run-navy) 58%, #132a57 100%);
  color: #fff;
}
.first-run-story::after {
  position: absolute;
  right: -130px;
  bottom: -150px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  box-shadow: 0 0 0 65px rgba(255, 255, 255, .035), 0 0 0 130px rgba(255, 255, 255, .025);
  content: "";
}
.first-run-brand,
.first-run-mobile-brand { display: flex; align-items: center; gap: 11px; }
.first-run-brand img,
.first-run-mobile-brand img { width: 38px; height: 38px; }
.first-run-brand strong,
.first-run-mobile-brand strong { font-size: 20px; font-weight: 740; letter-spacing: -.35px; }
.first-run-promise { position: relative; z-index: 1; margin: auto 0 44px; }
.first-run-kicker {
  display: block;
  margin-bottom: 10px;
  color: #3162e6;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.first-run-story .first-run-kicker { color: #8eb1ff; }
.first-run-promise h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(35px, 4vw, 52px);
  font-weight: 720;
  line-height: 1.04;
  letter-spacing: -1.9px;
}
.first-run-promise p {
  max-width: 470px;
  margin: 22px 0 0;
  color: #b8c6df;
  font-size: 16px;
  line-height: 1.55;
}


.first-run-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: clamp(34px, 5vw, 70px);
  background: #fff;
}
.first-run-mobile-brand { display: none; }
.first-run-step { width: min(410px, 100%); }
.first-run-step-copy h2 {
  margin: 0;
  font-size: clamp(27px, 3vw, 35px);
  font-weight: 725;
  line-height: 1.1;
  letter-spacing: -1px;
}
.first-run-step-copy > p {
  margin: 13px 0 0;
  color: #697386;
  font-size: 13px;
  line-height: 1.55;
}
.first-run-auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 29px 0 22px;
  padding: 4px;
  border-radius: 13px;
  background: #f1f4f8;
}
.first-run-auth-switch button {
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #697386;
  box-shadow: none;
  font-size: 12px;
  font-weight: 660;
}
.first-run-auth-switch button.is-active { background: #fff; color: #15203a; box-shadow: 0 3px 12px rgba(20, 40, 78, .08); }


.first-run-form { display: grid; gap: 17px; margin-top: 27px; }

#firstRunAccountForm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#firstRunAccountForm .first-run-primary { grid-column: 1 / -1; }
#firstRunNameField[hidden] + label { grid-column: 1 / -1; }
.first-run-form label > span {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: #3c4659;
  font-size: 11px;
  font-weight: 660;
}
.first-run-form label > span small { color: #929aa8; font-size: 10px; font-weight: 520; }
.first-run-form input {
  width: 100%;
  min-height: 50px;
  padding: 11px 14px;
  border: 1px solid #d9dee8;
  border-radius: 12px;
  background: #fbfcfe;
  color: #121a2b;
  font-size: 14px;
}
.first-run-form input:focus {
  outline: 0;
  border-color: var(--first-run-blue);
  box-shadow: 0 0 0 3px rgba(47, 93, 227, .11);
}
.first-run-form input.is-invalid {
  border-color: #d94b4b;
  background: #fffafa;
  box-shadow: 0 0 0 3px rgba(217, 75, 75, .08);
}
.first-run-field-error {
  display: block;
  margin-top: 6px;
  color: #c83d3d;
  font-size: 10px;
  font-weight: 590;
  line-height: 1.35;
}
.first-run-primary {
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  border: 1px solid var(--first-run-blue);
  border-radius: 13px;
  background: linear-gradient(135deg, var(--first-run-blue-deep), var(--first-run-blue));
  color: #fff;
  box-shadow: 0 10px 24px rgba(47, 93, 227, .2);
  font-size: 13px;
  font-weight: 690;
}
.first-run-primary:hover { border-color: #244fc7; background: linear-gradient(135deg, #1c42b5, #2855d5); }
.first-run-terms { margin: 14px 0 0; color: #8c95a6; font-size: 9.5px; line-height: 1.5; text-align: center; }
.first-run-terms a { color: #5d6b83; font-weight: 620; text-decoration: underline; text-decoration-color: #c5ccda; text-underline-offset: 2px; }
.first-run-terms a:hover { color: var(--first-run-blue); text-decoration-color: currentColor; }


.first-run-finish { text-align: center; }
.first-run-finish-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0 auto 25px;
  border-radius: 21px;
  background: #eaf8f3;
  color: #238365;
  box-shadow: 0 12px 30px rgba(35, 131, 101, .12);
}
.first-run-finish-icon svg { width: 31px; height: 31px; stroke-width: 1.8; }
.first-run-ready-list { display: grid; gap: 9px; margin: 27px 0 23px; text-align: left; }
.first-run-ready-list > div {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e1e5ec;
  border-radius: 13px;
  background: #fafbfd;
}
.first-run-ready-list svg { width: 36px; height: 36px; padding: 8px; border-radius: 11px; background: #eaf8f3; color: #238365; }
.first-run-ready-list strong,
.first-run-ready-list small { display: block; }
.first-run-ready-list strong { font-size: 11px; }
.first-run-ready-list small { margin-top: 2px; color: #7b8494; font-size: 9.5px; }
.first-run-secondary-action {
  min-height: 42px;
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--first-run-blue);
  box-shadow: none;
  font-size: 11px;
  font-weight: 650;
}

@media (max-width: 760px) {
  body.first-run-active { height: 100dvh; overflow: hidden; }
  .first-run {
    height: 100dvh;
    overflow: hidden;
    padding: 0;
    background:
      radial-gradient(circle at 95% 4%, rgba(64, 112, 232, .13), transparent 31%),
      linear-gradient(160deg, #f7f9fd 0%, #f1f5fb 100%);
  }
  .first-run-shell {
    display: block;
    height: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .first-run-story { display: none; }
  .first-run-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: max(22px, env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));
    background: transparent;
  }
  .first-run-mobile-brand {
    display: flex;
    width: min(480px, 100%);
    margin: 0 auto 20px;
    padding-inline: 3px;
  }
  .first-run-mobile-brand img { width: 31px; height: 31px; }
  .first-run-mobile-brand strong { font-size: 17px; }
  .first-run-step {
    width: min(480px, 100%);
    margin: 0 auto;
    padding: 25px 22px 22px;
    border: 1px solid rgba(18, 42, 87, .1);
    border-radius: 22px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 50px rgba(20, 44, 90, .11);
  }
  .first-run-step-copy h2 { font-size: clamp(25px, 7vw, 30px); letter-spacing: -.8px; }
  .first-run-step-copy > p { font-size: 12px; }
  .first-run-auth-switch { margin: 22px 0 19px; }
  .first-run-auth-switch button { min-height: 40px; }

  .first-run-form { gap: 15px; }
  #firstRunAccountForm { grid-template-columns: 1fr; }
  #firstRunAccountForm > * { grid-column: 1; }
  .first-run-form input { min-height: 56px; font-size: 16px; }
  .first-run-primary { min-height: 54px; }


  .first-run-finish { padding-top: 8px; }
}

@media (max-width: 760px) and (max-height: 760px) {
  .first-run-card { padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .first-run-mobile-brand { margin-bottom: 11px; }
  .first-run-mobile-brand img { width: 27px; height: 27px; }
  .first-run-mobile-brand strong { font-size: 16px; }
  .first-run-step { padding: 17px 18px 16px; border-radius: 18px; }
  .first-run-kicker { margin-bottom: 6px; }
  .first-run-step-copy h2 { font-size: 24px; }
  .first-run-step-copy > p { margin-top: 7px; line-height: 1.4; }
  .first-run-auth-switch { margin: 13px 0 11px; }
  .first-run-auth-switch button { min-height: 36px; }

  .first-run-form { gap: 9px; }
  .first-run-form label > span { margin-bottom: 4px; }
  .first-run-form input { min-height: 46px; padding-block: 8px; }
  .first-run-primary { min-height: 47px; }
  .first-run-terms { margin-top: 9px; line-height: 1.35; }

}

@media (max-width: 380px) {
  .first-run-card { padding-inline: 12px; }
  .first-run-mobile-brand { margin-bottom: 16px; }
  .first-run-step { padding: 22px 17px 19px; border-radius: 19px; }
  .first-run-auth-switch button { padding-inline: 5px; font-size: 11px; }
}

/* Het aandachtsoverzicht heeft één duidelijke hoofdactie. De controlepagina
   staat als rustige afsluitende rij onder de inhoud en blijft ook bereikbaar
   wanneer er niets openstaat. */
.modern-focus-collapsed { display: none; }
.modern-focus-collapsed[hidden] { display: none !important; }
.modern-focus-head-actions {
  display: inline-flex !important;
  flex: none;
  align-items: center;
  gap: 7px;
}
.modern-focus-head-actions #todayFocusCount {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.modern-focus-head-actions #todayFocusCount[hidden] { display: none !important; }
.modern-focus-dismiss {
  display: inline-grid;
  place-items: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}
.modern-focus-dismiss:hover { background: var(--hover); color: var(--ink); }
.modern-focus-dismiss .summa-icon {
  width: 17px;
  height: 17px;
  transform: rotate(-90deg);
}
.modern-checks-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  padding: 9px 3px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.modern-checks-row:hover { color: var(--modern-blue); }
.modern-checks-row-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
}
.modern-checks-row-icon .summa-icon { width: 18px; height: 18px; }
.modern-checks-row strong { font-size: 13px; font-weight: 650; }
.modern-checks-row-chevron {
  justify-self: end;
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.modern-daily-briefing.is-clear #todayModernAttention,
.modern-daily-briefing.is-clear .modern-focus-context { display: none !important; }
.modern-daily-briefing.is-collapsed {
  height: auto;
  min-height: 0;
  padding: 0;
}
.modern-daily-briefing.is-collapsed > :not(.modern-focus-collapsed) { display: none !important; }
.modern-daily-briefing.is-collapsed .modern-focus-collapsed {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.modern-focus-collapsed-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--amber-soft);
  color: var(--amber);
}
.modern-focus-collapsed-icon .summa-icon { width: 18px; height: 18px; }
.modern-focus-collapsed > strong { font-size: 13px; font-weight: 650; }
.modern-focus-collapsed-chevron {
  justify-self: end;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transform: rotate(90deg);
}

.today-new-menu:not([open]) > summary .launcher-close { display: none; }
.today-new-menu[open] > summary .launcher-add { display: none; }

@media (min-width: 721px) {
  .modern-daily-briefing { height: auto; }
}

/* Uren gebruikt dezelfde rustige lijsttaal als Facturen en Uitgaven. */
#workView .work-list-panel {
  padding: 18px;
  border: 0;
  background: transparent;
  box-shadow: none;
}
#workView .work-list-head { margin: 0 0 14px; }
#workView .work-list-head h2 { font-size: 18px; }
#workView .work-toolbar-controls #workFilter { min-width: 175px; }
#workView .work-toolbar-controls #workYear[hidden] { display: none; }
#workView .work-list-panel > #serviceList {
  display: grid;
  gap: 8px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
#workView .work-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: stretch;
  gap: 0;
  min-height: 78px;
  padding: 0;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}
#workView .work-list-row:last-child { border-bottom: 1px solid var(--line); }
#workView .work-list-row:hover { background: var(--paper); }
.work-row-main {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(90px, auto) minmax(105px, auto);
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 76px;
  padding: 10px 8px 10px 14px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--ink);
  text-align: left;
  box-sizing: border-box;
}
button.work-row-main {
  width: 100%;
  appearance: none;
  font: inherit;
}
button.work-row-main:hover { background: var(--hover); }
.work-row-party {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.work-row-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--muted);
}
.work-list-row.is-manual .work-row-icon { background: var(--blue-soft); color: var(--blue); }
.work-list-row.is-indirect .work-row-icon { background: var(--modern-icon-orange-bg); color: var(--modern-kpi-orange); }
.work-row-icon .summa-icon { width: 20px; height: 20px; stroke-width: 1.55; }
.work-row-party .grow { min-width: 0; overflow: hidden; }
.work-row-party strong,
.work-row-party small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.work-row-party strong { font-size: 14px; font-weight: 650; }
.work-row-party small { margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.work-row-main > .amount {
  justify-self: end;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.work-source-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  box-sizing: border-box;
  width: 72px;
  min-width: 72px;
  min-height: 22px;
  padding: 3px 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}
.work-source-badge.is-manual { background: var(--blue-soft); color: var(--blue-strong); }
.work-source-badge.is-indirect { background: var(--modern-icon-orange-bg); color: var(--modern-kpi-orange); }
.work-row-menu { justify-self: center; }
.work-row-menu > .invoice-more { width: 40px; min-height: 44px; }
#workView .work-empty-state {
  min-height: 112px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
#workView #workInvoiceNotes {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  overflow: visible;
  border: 0;
  border-radius: 0;
}
#workView #workInvoiceNotes[hidden] { display: none; }

/* Facturen en Uitgaven volgen dezelfde kaartopbouw als Uren. */
:is(#invoicesView, #expensesView) .invoice-table-head { display: none; }
:is(#invoicesView, #expensesView) .invoice-browser > .list {
  display: grid;
  gap: 8px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
:is(#invoicesView, #expensesView) .invoice-list-row,
#expensesView .expense-list-row,
#expensesView .expense-list-row.has-subtitle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: stretch;
  gap: 0;
  min-height: 78px;
  padding: 0;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}
:is(#invoicesView, #expensesView) .invoice-list-row:last-child {
  border-bottom: 1px solid var(--line);
}
:is(#invoicesView, #expensesView) .invoice-row-open,
#expensesView .expense-row-open,
#expensesView .expense-row-open.has-subtitle {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(100px, auto) minmax(115px, auto);
  align-items: center;
  gap: 14px;
  width: 100%;
  min-width: 0;
  min-height: 76px;
  padding: 10px 8px 10px 14px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
:is(#invoicesView, #expensesView) .invoice-row-open:hover { background: var(--hover); }
:is(#invoicesView, #expensesView) .invoice-party { gap: 12px; }
:is(#invoicesView, #expensesView) .invoice-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--muted);
}
#invoicesView .invoice-card-icon { background: var(--blue-soft); color: var(--blue); }
:is(#invoicesView, #expensesView) .invoice-avatar .summa-icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.55;
}
:is(#invoicesView, #expensesView) .invoice-party .grow { min-width: 0; overflow: hidden; }
:is(#invoicesView, #expensesView) .invoice-party strong,
:is(#invoicesView, #expensesView) .invoice-party small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:is(#invoicesView, #expensesView) .invoice-party strong { font-size: 14px; font-weight: 650; }
:is(#invoicesView, #expensesView) .invoice-party small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}
:is(#invoicesView, #expensesView) .invoice-row-open > .amount {
  justify-self: end;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#invoicesView .invoice-status,
#expensesView .expense-category {
  display: inline-flex;
  justify-self: end;
  max-width: 100%;
  padding: 4px 10px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#invoicesView .invoice-status.is-betaald { background: var(--green-soft); color: var(--green); }
#invoicesView .invoice-status.is-te-laat { background: var(--danger-soft); color: var(--danger); }
#invoicesView .invoice-status.is-vandaag { background: var(--amber-soft); color: var(--amber); }
#invoicesView .invoice-status.is-openstaand { background: var(--blue-soft); color: var(--blue-strong); }
:is(#invoicesView, #expensesView) .invoice-actions-menu:not(.detail-actions-menu) {
  align-self: center;
  justify-self: center;
  margin: 0;
}
:is(#invoicesView, #expensesView) .invoice-actions-menu:not(.detail-actions-menu) > .invoice-more {
  display: grid;
  width: 40px;
  min-height: 44px;
}

/* Feedback stays readable and keyboard users can locate the active control. */
.toast { max-width: min(640px, calc(100vw - 32px)); font-size: 14px; line-height: 1.5; }
.today-first-step p { margin: 0 0 16px; max-width: 52ch; color: var(--muted); font-size: 15px; line-height: 1.6; }
.today-first-step button { min-height: 48px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.settings-legal-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 24px; border-top: 1px solid var(--line); padding-top: 12px; }
.settings-legal-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }

#todayView .today-first-step button { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Bank import feedback remains visible after the short toast disappears. */
.bank-import-status { padding: 1rem; border: 1px solid var(--line); border-radius: 12px; line-height: 1.5; margin: 0 0 1rem; overflow-wrap: anywhere; }
