/* Shared components (Huisstijl V1 §4, layout reference demo V10). Colours only through tokens.css.
   Overview of every component and state: /dev/componenten (development mode). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--pale); color: var(--ink); font: var(--fw-regular) var(--fs-base)/var(--lh) var(--font-sans); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.2; }
code { font-family: var(--font-mono); }
img, svg { max-width: 100%; }

/* Keyboard focus: always visible, on light and dark surfaces (Huisstijl §6) */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.on-dark :focus-visible, .hero :focus-visible { outline-color: var(--focus-on-dark); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }
.skip-link { position: absolute; left: var(--space-4); top: -60px; z-index: 100; padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); background: var(--white); color: var(--navy); font-weight: var(--fw-bold); }
.skip-link:focus { top: var(--space-3); }
.muted { color: var(--text-muted); font-size: var(--fs-sm); }
.inline-form { display: inline; }
.actions, .stack { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.page-actions { margin-bottom: var(--space-4); }
.grid { display: grid; gap: var(--gap-fields); }
.grid:has(> .card) { gap: var(--gap-cards); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.grid.stats > .card { padding: 16px 18px; border-radius: 12px; }

/* Brand mark: the theme's logo.svg, or the curator's initial until a logo is delivered (Huisstijl §1, §6; D-095) */
.brand { display: flex; align-items: center; gap: var(--space-3); color: var(--white); font-size: 19px; font-weight: var(--fw-bold); letter-spacing: .03em; text-decoration: none; }
.brandmark { width: 36px; height: 36px; display: grid; place-items: center; flex: none; border: 2px solid var(--brandmark-line); border-radius: var(--radius-md); color: var(--brandmark-text); font: 21px/1 var(--font-letter); letter-spacing: 0; }
.brandmark-logo { border: 0; object-fit: contain; }

/* Buttons: teal = main action, navy = emphatic alternative, light = secondary, white with border = back/close
   (Huisstijl §4); danger = destructive, light red as in the Sherlock reference (D-720). Disabled stays visible;
   .btn-reason says why. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; padding: 9px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); color: var(--navy); font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: 1.4; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-soft); }
.btn.primary { border-color: var(--teal); background: var(--teal); color: var(--white); }
.btn.primary:hover { border-color: var(--teal-hover); background: var(--teal-hover); }
.btn.dark { border-color: var(--navy); background: var(--navy); color: var(--white); }
.btn.dark:hover { border-color: var(--navy-2); background: var(--navy-2); }
.btn.blue { border-color: var(--blue); background: var(--blue); color: var(--white); }
.btn.blue:hover { border-color: var(--navy-2); background: var(--navy-2); }
.btn.secondary { border-color: transparent; background: var(--surface-soft); color: var(--navy); }
.btn.secondary:hover { border-color: var(--surface-soft-line); }
.btn.danger { border-color: var(--status-error-line); background: var(--status-error-bg); color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.btn.danger.outline { background: var(--white); color: var(--error-text); }
.btn.danger.outline:hover { background: var(--status-error-bg); }
.btn.small { min-height: 32px; padding: 6px 10px; font-size: 11px; }
.btn.block { width: 100%; }
.btn.icon-btn { width: 36px; min-height: 36px; padding: 0; border-color: transparent; background: var(--surface-soft); font-size: 20px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-reason { display: block; margin-top: var(--space-1); color: var(--text-muted); font-size: 12px; }
.link-btn { padding: 0; border: 0; background: none; color: var(--blue); font: inherit; font-weight: var(--fw-semibold); text-decoration: underline; cursor: pointer; }

/* Badges: colour plus a readable status word */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 5px; font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1.5; white-space: nowrap; }
.badge.neutral { background: var(--status-neutral-bg); color: var(--status-neutral-text); }
.badge.ok { background: var(--status-ok-bg); color: var(--status-ok-text); }
.badge.warn { background: var(--status-warn-bg); color: var(--status-warn-text); }
.badge.info { background: var(--status-info-bg); color: var(--status-info-text); }
.badge.error { background: var(--status-error-bg); color: var(--status-error-text); }

/* Notices and banners */
.notice { margin: 0 0 18px; padding: 13px 15px; border: 1px solid var(--notice-line); border-radius: var(--radius-md); background: var(--notice-bg); color: var(--notice-text); font-size: var(--fs-sm); }
.notice.warn { border-color: var(--status-warn-line); background: var(--status-warn-bg); color: var(--status-warn-text); }
.notice.error { border-color: var(--status-error-line); background: var(--status-error-bg); color: var(--status-error-text); }
.notice.ok { border-color: var(--status-ok-line); background: var(--status-ok-bg); color: var(--status-ok-text); }
.notice > :first-child { margin-top: 0; }
.notice > :last-child { margin-bottom: 0; }
.banner { display: flex; gap: var(--space-3); align-items: flex-start; margin-bottom: 18px; padding: var(--space-3) 15px; border: 1px solid var(--status-ok-line); border-radius: 9px; background: var(--status-ok-bg); color: var(--status-ok-text); }
.banner.error { border-color: var(--status-error-line); background: var(--status-error-bg); color: var(--status-error-text); }

/* Title strip ("hero"): purpose of the screen and one sentence of explanation (Huisstijl §3); look, size and the buttons
   at the right as in the Sherlock reference (D-720) */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 21px; padding: 25px 28px; border-radius: var(--radius-xl); background: linear-gradient(118deg, var(--navy), var(--navy-2)); box-shadow: var(--shadow-raised); color: var(--white); }
.hero > div:first-child { min-width: 0; }
.hero h1 { margin: 0; font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: 1.15; letter-spacing: -.6px; overflow-wrap: anywhere; }
.hero p { max-width: 800px; margin: 10px 0 0; color: var(--text-on-dark); line-height: 1.6; }
.hero .actions { flex: none; justify-content: flex-end; max-width: 52%; }
.hero .btn:not(.primary, .dark, .blue, .danger) { border-color: var(--field-line); background: transparent; color: var(--white); }
.hero .btn:not(.primary, .dark, .blue, .danger):hover { background: var(--navy-hover); }
.eyebrow { color: var(--teal); font-size: var(--fs-xs); font-weight: var(--fw-bold); line-height: 1.5; letter-spacing: 1.35px; text-transform: uppercase; }
.hero .eyebrow { color: var(--hero-eyebrow); }
.heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin: 23px 0 15px; }
.heading h2 { margin: 0; color: var(--navy); font-size: var(--fs-lg); }
.heading p { margin: 3px 0 0; color: var(--text-muted); font-size: var(--fs-sm); }

/* Cards */
.card { min-width: 0; padding: var(--card-pad); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); }
.card.flush { padding: 0; overflow: hidden; overflow: clip; }  /* clip: no scroll box, so a table header can stick to the window (D-406) */
.card h3, .card-title { margin: 0 0 10px; color: var(--navy); font-size: var(--fs-md); }
/* Cards one below the other keep one distance; in a grid the grid's gap does that (S60, review 30-11 §2) */
:where(.card, .grid) + :where(.card, .grid) { margin-top: var(--gap-cards); }
:where(.grid, .stack-col) > * { margin-top: 0; }
/* The next topic inside a card (heading, explanation, fields, button) starts at a clear distance from the button or text
   above it; the card's own first heading does not (S60, review §2–3) */
.card h3 { margin-top: var(--gap-topic); }
.card > h3:first-child, .card > :first-child > h3:first-of-type { margin-top: 0; }
/* A status with its action button: always the same distance, wrapping without touching; in a table cell the button
   sits under the status, the same on every row (S60, review §1) */
.status-actie { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--gap-status); }
td .status-actie { display: flex; flex-direction: column; align-items: flex-start; }
.card > p { margin: 5px 0 var(--space-3); color: var(--text-muted); font-size: var(--fs-sm); }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px var(--card-pad); border-bottom: 1px solid var(--line); }
.section-head .card-title { margin: 0; }
.section-head p { margin: 5px 0 0; color: var(--text-muted); font-size: var(--fs-sm); }
.stat-label { color: var(--text-muted); font-size: 11px; }
.stat-num { margin: 5px 0; color: var(--navy); font-size: var(--fs-stat); font-weight: var(--fw-bold); line-height: 1.1; }
.stat-foot { color: var(--text-muted); font-size: 11px; }
.progress { height: 7px; margin: 13px 0; overflow: hidden; border-radius: var(--radius-pill); background: var(--table-line); }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.kv { display: grid; grid-template-columns: minmax(110px, 35%) 1fr; gap: 7px var(--space-3); margin: var(--space-3) 0; font-size: var(--fs-sm); }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* Forms: label above the field, required marked, short Dutch error at the field (Huisstijl §4) */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.field > label, .field-label { color: var(--text-label); font-size: 11px; }
/* Excel cell code next to a descriptive label, for staff who check against the Rekenmodel */
.req { color: var(--error-text); }
.hint { color: var(--text-muted); font-size: 12px; }
.bron { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); font-size: 12px; }
.bron.afwijkend { color: var(--status-warn-text); }
.field :where(input:not([type="checkbox"], [type="radio"], [type="file"]), select, textarea), .input, .select {
  width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--field-line); border-radius: var(--radius-sm); background: var(--white); color: var(--ink); font-size: var(--fs-sm); }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .input:focus-visible, .select:focus-visible { border-color: var(--focus); outline-offset: 0; }
::placeholder { color: var(--text-muted); opacity: 1; }
.field input[readonly], .field textarea[readonly] { background: var(--pale); }
.field.prefill input, .field.prefill textarea { border-color: var(--prefill-line); background: var(--prefill); color: var(--ink); cursor: default; }
[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.field-error { display: flex; gap: 6px; color: var(--error-text); font-size: 12.5px; font-weight: var(--fw-semibold); }
.field-error::before { content: "!"; display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--error-text); color: var(--white); font-size: 11px; font-weight: 800; }
.field-warning { display: block; color: var(--warn-text); font-size: 12.5px; font-weight: var(--fw-semibold); }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 15px; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--teal); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--gap-fields); }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding-top: 18px; border-top: 1px solid var(--table-line); }

/* File picker with drag-and-drop (Dutch button text instead of the browser's own) */
/* The hidden input sits on its own button (position: relative), so a browser that scrolls to it when the file dialog
   closes stays where the button is instead of jumping elsewhere on the page (S25e item 5). */
.file-picker { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; }
.file-input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
html:not(.js) .file-input { position: static; width: auto; height: auto; opacity: 1; }
html:not(.js) .file-btn, html:not(.js) .file-name { display: none; }
.file-choice { display: grid; gap: var(--space-2); margin-top: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--teal); border-radius: var(--radius-md); background: var(--white); text-align: left; }
.file-choice[hidden] { display: none; }
.file-choice-title { margin: 0; color: var(--text-muted); font-size: 12px; font-weight: var(--fw-bold); letter-spacing: .04em; text-transform: uppercase; }
.file-choice ul { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.file-choice li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); overflow-wrap: anywhere; }
.file-choice li strong { font-weight: var(--fw-semibold); }
.file-choice .actions { margin: 0; }
.controlepunten { margin: var(--space-1) 0 var(--space-3); padding-left: 1.2em; }
.file-btn { cursor: pointer; }
.file-input:focus-visible + .file-btn { outline: 3px solid var(--focus); outline-offset: 2px; }
.file-input[aria-invalid="true"] + .file-btn { border-color: var(--red); color: var(--error-text); }
.file-name { overflow: hidden; color: var(--text-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.dropzone { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-5); border: 2px dashed var(--field-line); border-radius: var(--radius-lg); background: var(--pale); text-align: center; }
.dropzone.drag-over { border-color: var(--teal); background: var(--selected); }
.dropzone[aria-invalid="true"] { border-color: var(--red); box-shadow: none; }
.dropzone .file-picker { flex-direction: column; }
.dropzone .file-name { white-space: normal; }
.js .no-js-only { display: none; }

/* Tables: search directly above long lists, sticky header (Huisstijl §4). A table never scrolls inside the page (S29,
   D-406): the page scrolls and the header sticks to the top of the window. A table wider than its card scrolls sideways;
   app.js marks the ones that fit (.past), which lets their header stick. */
.table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px var(--card-pad); border-bottom: 1px solid var(--line); }
.table-tools .input { max-width: 350px; }
.table-meta { margin-left: auto; color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.table-wrap { overflow-x: auto; background: var(--white); }
.table-wrap.past { overflow: visible; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }  /* 12 px, as the reference */
th { position: sticky; top: 0; z-index: 3; padding: 11px 10px; border-bottom: 1px solid var(--table-line); background: var(--table-head); color: var(--table-head-text); font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .45px; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--table-line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-hover); }
/* A table with many columns fits a 1440 px window: narrower cells, headings over more lines, long addresses broken, and
   the buttons of a row one below the other where needed (S53). */
table.compact th { padding: 10px 4px; letter-spacing: 0; white-space: normal; vertical-align: bottom; }
table.compact td { padding: 10px 4px; }
table.compact td.adres, table.compact td .small-text { overflow-wrap: anywhere; }
table.compact td .btn { white-space: normal; overflow-wrap: normal; text-align: left; }
table.compact td .actions { min-width: 96px; }
table.compact td .meters { min-width: 170px; }
table.compact td.boedel .btn, table.compact td.num, table.compact .vast { white-space: nowrap; }
table.compact td.toelichting { min-width: 185px; font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* A table in a card without padding starts and ends on the card's text edge, like its heading and search (S60, review §3) */
.card.flush .table-wrap :is(th, td):first-child { padding-left: var(--card-pad); }
.card.flush .table-wrap :is(th, td):last-child { padding-right: var(--card-pad); }
/* Down to a 1024 px window a compact table still fits: progress, status buttons and row buttons narrower, a folder name
   broken between words only (S60, review §1) */
@media (max-width: 1280px) {
  th { white-space: normal; }
  td .meters, table.compact td .meters { min-width: 120px; }
  td.boedel .btn, table.compact td.boedel .btn { white-space: normal; }
  table.compact td .actions { min-width: 0; flex-direction: column; align-items: stretch; }
  table.compact td.path { overflow-wrap: break-word; }
}
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: var(--space-3) var(--card-pad); border-top: 1px solid var(--line); font-size: var(--fs-sm); }

/* Tabs: links to sub-pages, the current one marked with aria-current */
.tabs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: 18px; }
.tabs a { padding: 7px 11px; border: 1px solid var(--line); border-radius: 20px; background: var(--white); color: var(--navy); font-size: 11px; text-decoration: none; }
.tabs a:hover { border-color: var(--field-line); }
.tabs a[aria-current="page"] { border-color: var(--brandmark-line); background: var(--selected); color: var(--teal); }

/* Empty state */
.empty-state { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-8) var(--space-5); text-align: center; }
.empty-state h2, .empty-state h3 { margin: 0; color: var(--navy); font-size: var(--fs-md); }
.empty-state p { max-width: 560px; margin: 0; color: var(--text-muted); }
.empty-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: var(--radius-lg); background: var(--surface-soft); color: var(--navy); font: 24px/1 var(--font-letter); }

/* Modal: server-rendered, Escape and the backdrop close it (app.js); up to 760 px, dossier detail up to 1240 px */
.modal-layer { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: var(--overlay); }
.modal { width: min(var(--dialog-width), 100%); max-height: min(90vh, 850px); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow-dialog); }
.modal.narrow { width: min(560px, 100%); }
.modal.wide { width: min(var(--dialog-wide), 96vw); max-height: 94vh; }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 18px var(--card-pad); border-bottom: 1px solid var(--table-line); background: var(--surface-hover); }
.modal-header h2 { margin: 0; color: var(--navy); font-size: var(--fs-lg); }
.modal-header p { margin: 3px 0 0; color: var(--text-muted); font-size: 11px; }
.modal-body { padding: var(--card-pad); }
.modal-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px var(--card-pad); border-top: 1px solid var(--table-line); }

/* Toasts: short confirmations, read out by screen readers */
.toast-region { position: fixed; right: var(--space-5); bottom: var(--space-5); z-index: 80; display: grid; gap: 10px; width: min(390px, calc(100vw - 32px)); pointer-events: none; }
.toast { padding: 13px 17px; border-left: 4px solid var(--teal); border-radius: var(--radius-md); background: var(--navy); box-shadow: var(--shadow-raised); color: var(--white); font-size: var(--fs-sm); transition: opacity .18s ease; }
.toast.error { border-left-color: var(--red); }
.toast strong { display: block; margin-bottom: 2px; }

@media (max-width: 950px) {
  .grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero .actions { max-width: none; justify-content: flex-start; }
}
@media (max-width: 600px) {
  .hero { padding: 23px; }
  .hero h1 { font-size: 23px; }
  .grid.two, .grid.three, .grid.stats, .form-grid { grid-template-columns: 1fr; }
  .table-tools .input { max-width: none; }
  .table-meta { margin-left: 0; }
  .modal-layer { padding: 8px; }
  .modal-header, .modal-body, .modal-footer { padding-left: var(--space-4); padding-right: var(--space-4); }
  .form-actions, .modal-footer { justify-content: stretch; }
  .form-actions .btn, .modal-footer .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  body { background: var(--white); }
  .toast-region, .btn { display: none !important; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* First staff login: authenticator setup and recovery codes (templates/login/) */
.setup-2fa { display: flex; flex-wrap: wrap; gap: var(--space-5); align-items: flex-start; margin-bottom: var(--space-5); }
.setup-2fa .qr { flex: none; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--white); }
.setup-2fa .steps { flex: 1 1 280px; margin: 0; padding-left: 1.2em; line-height: var(--lh); }
.setup-2fa .steps li + li { margin-top: var(--space-2); }
.recovery-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-2) var(--space-5); margin: 0 0 var(--space-5); padding-left: 1.6em; font-size: var(--fs-md); }

/* X15 Gesimuleerde SharePoint: folder tree (templates/beheer/gesimuleerde_sharepoint.html) */
.tree { margin: var(--space-1) 0 0; padding-left: var(--space-5); list-style: none; border-left: 1px solid var(--line); }
.tree li { margin: var(--space-1) 0; }
.tree-folder > summary { cursor: pointer; }
.tree-name { font-weight: var(--fw-semibold); margin-right: var(--space-2); }
.tree-file { font-size: var(--fs-sm); }

/* Casusbeheer (templates/casusbeheer/): progress meters, chosen folder, folder picker, group totals */
.meters { display: grid; gap: var(--space-1); min-width: 180px; }
.meter { display: grid; grid-template-columns: 1fr auto; gap: 0 var(--space-2); font-size: 12px; }
.meter-label { color: var(--text-muted); }
.meter-num { font-variant-numeric: tabular-nums; font-weight: var(--fw-semibold); }
.meter .progress { grid-column: 1 / -1; height: 5px; margin: 2px 0 4px; }
td.path { max-width: 260px; color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }
.select.filter { width: auto; min-height: 42px; padding: 9px 11px; border: 1px solid var(--field-line); border-radius: var(--radius-sm); background: var(--white); }
.doelmap { margin: 0 0 15px; padding: 0; border: 0; }
.doelmap .actions { margin-top: var(--space-2); }
.chosen-folder { padding: 10px 12px; border: 1px solid var(--prefill-line); border-radius: var(--radius-sm); background: var(--prefill); font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.chosen-folder.empty { border-style: dashed; border-color: var(--field-line); background: var(--pale); color: var(--text-muted); font-weight: var(--fw-regular); }
.link-field { margin: var(--space-4) 0 0; }
.input-row { display: flex; gap: var(--space-2); }
.input-row input { flex: 1 1 auto; min-width: 0; }
.picker-crumbs { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-bottom: var(--space-4); font-size: var(--fs-sm); }
.picker-crumbs [aria-current] { color: var(--navy); font-weight: var(--fw-bold); text-decoration: none; }
.picker-search { margin-bottom: var(--space-2); }
.picker-search label { display: block; margin-bottom: 6px; color: var(--text-label); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.folder-list { margin: 0 0 var(--space-3); padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--radius-md); }
.folder-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 9px 12px; border-bottom: 1px solid var(--table-line); }
.folder-list li:last-child { border-bottom: 0; }
.folder-name { min-width: 0; overflow-wrap: anywhere; }
.suggestions { margin-bottom: var(--space-4); }
.suggestions h3 { margin: 0 0 var(--space-2); color: var(--navy); font-size: var(--fs-sm); }
.empty-line, .picker-help { margin-top: var(--space-3); }
.new-case-folder { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.new-case-folder h3 { margin: 0 0 var(--space-2); color: var(--navy); font-size: var(--fs-sm); }
.modal-body.flush-bottom { padding-bottom: 0; }
.close-case { border-top: 1px solid var(--table-line); }
.close-case h3 { margin: 0 0 var(--space-2); color: var(--navy); font-size: var(--fs-md); }
.group-filter { margin-bottom: var(--space-4); }
.group { margin-bottom: var(--space-5); }
tfoot .total th, tfoot .total td { border-top: 2px solid var(--table-line); background: var(--table-head); color: var(--navy); font-weight: var(--fw-bold); text-align: left; }
tfoot .total td.num { text-align: right; }
@media (max-width: 600px) {
  .input-row { flex-direction: column; }
  .folder-list li { flex-direction: column; align-items: stretch; }
}
.sim-link { display: block; margin: 2px 0 0 var(--space-4); font-size: 12px; overflow-wrap: anywhere; }

/* Overzicht, import check and Werknemersdossiers (templates/casus/) */
.grid.stats + .notice, .overview-cards { margin-top: var(--gap-cards); }
.columns-help { margin-top: var(--space-4); font-size: var(--fs-sm); }
.columns-help summary { cursor: pointer; color: var(--blue); }
.section-pad { padding: 0 var(--card-pad) var(--card-pad); }
td.reason { min-width: 220px; max-width: 360px; font-size: 12.5px; }
.import-check { margin-top: var(--space-5); }
a.sort { color: inherit; text-decoration: none; }
a.sort:hover { text-decoration: underline; }
.dossier-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.stack-col { display: grid; gap: var(--space-4); min-width: 0; }
.proposal + .proposal { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--table-line); }
ul.plain { margin: var(--space-2) 0 0; padding-left: 1.2em; font-size: var(--fs-sm); }
@media (max-width: 950px) {
  .dossier-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Dossier documents (X2) and UWV-opgaven (X16), S7b */
table.documents tbody th { position: static; min-width: 170px; background: var(--white); color: var(--ink); font-size: var(--fs-sm);
  font-weight: var(--fw-semibold); letter-spacing: 0; text-transform: none; white-space: normal; vertical-align: top; }
table.documents tbody + tbody th, table.documents tbody + tbody td { border-top: 1px solid var(--line); }
table.documents td { vertical-align: top; }
table.documents td.file { min-width: 200px; overflow-wrap: anywhere; }
tr.row-error td { background: var(--status-error-bg); }
.small-text { display: block; margin-top: 2px; font-size: 12px; overflow-wrap: anywhere; }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 48ch; }  /* an employee's explanation as typed (X12, S16) */
details.request-new > summary { list-style: none; }
details.request-new > summary::-webkit-details-marker { display: none; }
details.request-new[open] form { min-width: 240px; margin-top: var(--space-2); }
fieldset.field { margin: 0 0 15px; padding: 0; border: 0; }
fieldset.field legend { margin-bottom: 6px; color: var(--text-label); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
fieldset.field .check { margin-bottom: 6px; }

/* Registration (W1): the date of birth as three short number fields, as on paper (S9) */
.date-parts { display: grid; grid-template-columns: 5em 5em 7em; gap: var(--space-3); }
.date-parts label { display: block; margin-bottom: 4px; color: var(--text-muted); font-size: var(--fs-sm); }
/* W3: one button per case when an e-mail address has dossiers in several cases */
.btn.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-bottom: var(--space-3); text-align: left; }
/* X2 portal actions: a button that opens its confirmation (S9) */
.portaal-actie { margin-top: var(--space-2); }
.portaal-actie > summary { display: inline-flex; list-style: none; cursor: pointer; }
.portaal-actie > summary::-webkit-details-marker { display: none; }
.portaal-actie[open] form { margin-top: var(--space-2); padding: var(--space-3); border: 1px solid var(--table-line); border-radius: var(--radius-md); }

/* Employee portal pages (S10): the next step, the five documents with own files and upload, Ontvangen stukken */
.card.next-step { margin-bottom: var(--space-5); border-left: 4px solid var(--teal); }
.portal-cards { margin-bottom: var(--space-5); }
.doc-status-list, .file-list { margin: 0 0 var(--space-4); padding: 0; list-style: none; }
.doc-status-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: var(--space-2) 0; border-bottom: 1px solid var(--table-line); }
.file-list li { padding: var(--space-3) 0; border-bottom: 1px solid var(--table-line); }
.file-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); overflow-wrap: anywhere; }
.file-list .actions { margin-top: var(--space-2); }
.doc-category { margin-bottom: var(--space-4); scroll-margin-top: var(--space-4); }
.doc-category-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.doc-category-head .card-title { margin: 0; }
.upload-form { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--table-line); }
.upload-buttons { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* X4 Gegevens uit documenten (S18): the page images with the proposed fields boxed, next to the fields. A box is a
   highlighter over the text (multiply keeps the text readable); the active field and its box are marked together. */
.review { display: grid; grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); gap: var(--space-5); align-items: start; margin-top: var(--space-5); }
/* .card.flush clips (D-406); the page panel must scroll to show every page and the box "Toon in document" points at */
.review-scan, .review-scan.card.flush { position: sticky; top: var(--space-4); max-height: calc(100vh - 2 * var(--space-4)); overflow: auto; padding: var(--space-3); }
.scan-page { margin: 0 0 var(--space-4); }
.scan-page figcaption { margin-top: var(--space-1); }
.scan-image { position: relative; border: 1px solid var(--line); }
.scan-image img { display: block; width: 100%; height: auto; }
.anker-box { position: absolute; border: 2px solid var(--amber); border-radius: 2px; background: var(--prefill); mix-blend-mode: multiply; }
.anker-box.active, .anker-box:focus-visible { border-color: var(--teal); outline: 3px solid var(--focus); outline-offset: 2px; }
.review-fields .veld { margin-bottom: var(--space-4); cursor: pointer; scroll-margin-top: var(--space-4); }
.review-fields .veld.active { border-left: 4px solid var(--teal); }
.review-fields .veld form, .review-fields .veld summary { cursor: auto; }
tr.selected td { background: var(--selected); }
@media (max-width: 1000px) {
  .review { grid-template-columns: 1fr; }
  .review-scan, .review-scan.card.flush { position: static; max-height: none; }
}

/* M5 Dossierberekening as a page (S25c item 1): a summary bar that stays at the top, collapsible sections, and the source
   document next to the fields (below them on a narrow screen). */
.dossierbalk { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); margin: 0 0 var(--space-5); padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow-card); }
.testomgeving .dossierbalk, .testomgeving th { top: var(--testbalk-hoogte); }
/* in a table that scrolls sideways the header sticks to its own scroll box, not to the window: no room for the banner there */
.testomgeving .table-wrap:not(.past) th { top: 0; }
.dossierbalk-wie { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); color: var(--navy); }
.dossierbalk-bedragen { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin: 0; }
.dossierbalk-bedragen dt { color: var(--text-muted); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.dossierbalk-bedragen dd { margin: 0; color: var(--navy); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.dossierbalk-bedragen .totaal dd { font-weight: var(--fw-bold); }
.dossierbalk-acties { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-left: auto; }
.dossier-werk.met-bron { display: grid; grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); gap: var(--space-5); align-items: start; }
.dossier-velden > .sectie + .sectie { margin-top: var(--space-4); }
.sectie { padding: 0; }
.sectie > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-3); padding: var(--space-4) var(--card-pad); cursor: pointer; }
.sectie-titel { display: inline; margin: 0; color: var(--navy); font-size: var(--fs-md); }
.sectie-status { color: var(--text-muted); font-size: var(--fs-sm); }
.sectie-inhoud { padding: 0 var(--card-pad) var(--card-pad); border-top: 1px solid var(--table-line); }
.sectie-inhoud > :first-child { margin-top: var(--space-4); }
.sectie-inhoud > p { margin: 5px 0 var(--space-3); color: var(--text-muted); }
details.fold { margin: var(--space-3) 0; border: 1px solid var(--line); border-radius: var(--radius-md); }
details.fold > summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); cursor: pointer; }
details.fold > fieldset { margin: 0; padding: 0 var(--space-4) var(--space-4); border: 0; }
/* an address (#section, a value's source) lands below the summary bar that stays at the top */
.bron-anker { display: block; }
.dossier-velden .sectie, .dossier-velden .fold, .bron-anker { scroll-margin-top: 190px; }
.testomgeving .dossier-velden .sectie, .testomgeving .dossier-velden .fold, .testomgeving .bron-anker { scroll-margin-top: calc(190px + var(--testbalk-hoogte)); }
/* V2.3 M5 (S67 B5): every address after the summary bar lands below it; app.js measures the bar, whose height depends
   on the width */
.dossierbalk ~ [id], .dossierbalk ~ * [id] { scroll-margin-top: var(--balk-ruimte); }
.dossier-bron { position: sticky; top: 190px; max-height: calc(100vh - 190px - var(--space-4)); overflow: auto; }
.testomgeving .dossier-bron { top: calc(190px + var(--testbalk-hoogte)); max-height: calc(100vh - 190px - var(--testbalk-hoogte) - var(--space-4)); }
@media (max-width: 1000px) {
  .dossier-werk.met-bron { grid-template-columns: 1fr; }
  .dossier-bron, .testomgeving .dossier-bron { position: static; max-height: none; }
}
@media (max-width: 600px) {
  .dossierbalk { position: static; }  /* on a phone the bar would cover half the screen: it stays above the sections */
}
/* Notes per dossier (S29 item 2, D-403): X2's list and C6's button in the row, which opens in the row itself */
.notities { margin: 0 0 var(--space-3); padding: 0; list-style: none; }
.notities li { padding: var(--space-2) 0; border-bottom: 1px solid var(--table-line); }
.notitie-tekst { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.notitie-regel { max-width: 40ch; }
.notitie-knop > summary { list-style: none; }
.notitie-knop > summary::-webkit-details-marker { display: none; }
.notitie-form { display: grid; gap: var(--space-2); min-width: 260px; margin-top: var(--space-2); }
