/* SolidusQ - huisstijl: kleuren van het logo (navy woordmerk, blauw → groen verloop); drie lagen Klant → Entiteiten → Categorieën */
:root {
  --bg: #f3f6f9; --surface: #ffffff; --sunken: #e8eef4; --ink: #142033; --muted: #55627a; --line: #d6dfe8;
  --accent: #04519b; --accent-ink: #ffffff; --accent-soft: #e1ecf7; --band-ink: #f2f6fb; --band-muted: #b3cbe6;
  --band: linear-gradient(120deg, #01356f 0%, #04519b 62%, #0b7766 100%);
  --brand-navy: #01356f; --brand-green: #0d8762; --brand-line: linear-gradient(90deg, #0461b6, #38ab62);
  --silver: #7d8591; --paper-plate: #ffffff;
  --ok: #23955a; --warn: #e38b00; --bad: #d23a30; --ok-soft: #dff2e7; --warn-soft: #fcefd6; --bad-soft: #fbe2df;
  --shadow: 0 1px 2px rgba(20,40,60,.06), 0 4px 16px rgba(20,40,60,.06);
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --f-brand: "Montserrat", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10141b; --surface: #171d26; --sunken: #12171f; --ink: #e5e9f0; --muted: #949fb0; --line: #29313d;
    --accent: #6eaaea; --accent-ink: #0b1626; --accent-soft: #16304d; --band-ink: #eef2f8; --band-muted: #9fbbdc; --silver: #a3abb8;
    --band: linear-gradient(120deg, #0c2a52 0%, #0d3f74 62%, #0c5a4f 100%);
    --brand-navy: #a9c6ee; --brand-green: #4cc28a; --brand-line: linear-gradient(90deg, #2f7fd0, #4cc28a);
    --ok: #3fbf7a; --warn: #f2a531; --bad: #f0645a; --ok-soft: #173326; --warn-soft: #3a2c12; --bad-soft: #3e1d1a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.wrap { max-width: 1200px; margin: 0 auto; padding-inline: clamp(16px, 3vw, 32px); }
main.wrap { padding-block: 24px 64px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.mono { font-family: var(--f-mono); font-size: .82em; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.min0 { min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1 { font-family: var(--f-display); font-size: 1.5rem; margin: 0 0 6px; letter-spacing: -.01em; text-wrap: balance; }
.inline { display: inline; }

/* Werkbalk */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar::after { content: ""; position: absolute; inset: auto 0 -1px; height: 3px; background: var(--brand-line); }
.topbar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 8px; margin-right: auto; text-decoration: none; color: inherit; }
.brand-mark { width: 38px; height: 36px; object-fit: contain; background: var(--paper-plate); border-radius: 7px; padding: 2px; }
.brand-word { font-family: var(--f-brand); font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; color: var(--brand-navy); line-height: 1; }
.brand-word span { color: var(--brand-green); }
.brand-sub { display: block; font-size: .6rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.field-inline { display: flex; align-items: center; gap: 8px; }
.eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--muted); }
select.sel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; max-width: 100%; }
.userchip { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
/* Accountmenu: klik op de bol met initialen (details/summary, werkt ook zonder JavaScript) */
.user-menu-wrap { position: relative; }
.user-menu-wrap > summary { list-style: none; cursor: pointer; border: 1px solid transparent; border-radius: 999px; padding: 2px 10px 2px 2px; }
.user-menu-wrap > summary::-webkit-details-marker { display: none; }
.user-menu-wrap > summary:hover, .user-menu-wrap[open] > summary { background: var(--accent-soft); border-color: var(--line); }
.user-menu-wrap > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.user-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 240px; max-width: min(320px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 6px; }
.user-menu form { display: block; }
.um-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: grid; gap: 2px; }
.um-head b { font-size: .95rem; }
.um-head .muted { font-size: .8rem; overflow-wrap: anywhere; }
.um-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; }
.um-item svg { width: 16px; height: 16px; }
.um-item:hover, .um-item:focus-visible { background: var(--accent-soft); color: var(--accent); outline: none; }
/* Knop met alleen een pictogram (tandwiel = Instellingen) */
.btn.icon-only { width: 36px; height: 34px; padding: 0; justify-content: center; }
.btn.icon-only svg { width: 18px; height: 18px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-grid; place-items: center; font-size: .78rem; font-weight: 700; }
.role { font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); }

.rights { background: var(--accent-soft); border-bottom: 1px solid var(--line); font-size: .86rem; }
.rights .wrap { padding-block: 8px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.rights ul { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; }
.rights li::before { content: "✓ "; color: var(--accent); font-weight: 700; }

/* Knoppen */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: .86rem; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); color: var(--accent-ink); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger:hover, .btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.sm { padding: 3px 9px; font-size: .8rem; }
.btn svg { width: 16px; height: 16px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; font-size: .85rem; cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }
.icon-group { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.icon-group form { display: inline-flex; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 30px; border: 0; background: transparent; color: var(--muted); cursor: pointer; text-decoration: none; }
.icon-group > * + * { border-left: 1px solid var(--line); }
.icon-btn:hover { color: var(--accent); background: var(--accent-soft); }
.icon-btn.active { color: var(--accent); }
.icon-btn.danger:hover { color: var(--bad); background: var(--bad-soft); }

/* Meldingen */
.flashes { display: grid; gap: 8px; padding-top: 16px; }
.flash { padding: 10px 14px; border-radius: 10px; background: var(--ok-soft); border: 1px solid var(--line); }
.flash.error { background: var(--bad-soft); }
.flash.warn { background: var(--warn-soft); } /* waarschuwing, bijv. macro's (sinds versie 135) */
.av-stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 0 0 14px; }
.av-stat > div { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; }
.av-stat b { display: block; font-size: 1.05rem; }
.notice { padding: 10px 14px; border-radius: 10px; background: var(--warn-soft); border: 1px solid var(--line); margin: 0 0 12px; font-size: .9rem; }
.org-line { font-size: .8rem; color: var(--muted); margin-top: 2px; }
/* Gebruikersgroepen (admins, accountants, klanten): open- en dichtklappen met + en − */
.ugroup { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--surface); }
.ugroup > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-weight: 700; border-radius: 10px; }
.ugroup > summary::-webkit-details-marker { display: none; }
.ugroup > summary:hover { background: var(--accent-soft); }
.ugroup > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ug-sign { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line); display: inline-grid; place-items: center; color: var(--accent); font-weight: 700; line-height: 1; background: var(--surface); }
.ug-sign::before { content: "+"; }
.ugroup[open] > summary .ug-sign::before { content: "−"; }
.ugroup[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.ugroup > .table-wrap { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
.ug-empty { margin: 0; padding: 10px 12px; border-top: 1px solid var(--line); font-size: .88rem; }
/* Klanten van een accountant/superuser als uitklaplijst (sinds versie 87) */
.cl-drop > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: .82rem; white-space: nowrap; background: var(--surface); }
.cl-drop > summary::-webkit-details-marker { display: none; }
.cl-drop > summary::after { content: "\25BE"; color: var(--muted); }
.cl-drop[open] > summary::after { content: "\25B4"; }
.cl-drop > summary:hover { background: var(--accent-soft); }
.cl-drop ul { margin: 6px 0 0; padding-left: 18px; max-height: 180px; overflow: auto; font-size: .85rem; }
/* Klantgebruikers per klant (bedrijf), sinds versie 83 */
.ug-client { border-top: 1px solid var(--line); }
.ug-client-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--sunken, #f4f6f9); list-style: none; cursor: pointer; }
.ug-client-head::-webkit-details-marker { display: none; }
.ug-client-head:hover { background: var(--accent-soft); }
.ug-client-head .ug-sign { width: 20px; height: 20px; }
.ug-client-head .ug-client-del { margin-left: auto; } /* klant verwijderen of beëindigen (sinds versie 127) */
.ug-client[open] > summary .ug-sign::before { content: "\2212"; }
.ug-client > .table-wrap { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.ug-client:last-child > .table-wrap { border-radius: 0 0 10px 10px; }
/* Welkomstboodschap van de accountant (klant, na inloggen) */
.welcome-banner { position: relative; background: var(--accent-soft); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 14px 48px 14px 16px; display: grid; gap: 10px; }
.welcome-msg p { margin: 0 0 4px; overflow-wrap: anywhere; }
.welcome-msg .muted { font-size: .82rem; }
.welcome-banner > form { position: absolute; top: 8px; right: 8px; }
/* Logs: actueel of archief */
.log-view { display: inline-flex; flex-wrap: wrap; margin-bottom: 10px; background: var(--sunken); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.log-view a { padding: 5px 12px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 500; font-size: .88rem; }
.log-view a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
/* Zoeken en sorteren in de gebruikerslijst */
.user-search { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.user-search input[type="search"] { flex: 1 1 240px; min-width: 0; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 7px 10px; }
/* Bladeren door lange lijsten (sinds versie 106: Databases, Licenties) */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.th-sort { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.th-sort:hover { color: var(--accent); }
.th-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sort-ind { font-size: .7rem; opacity: .55; }
th[aria-sort="ascending"] .sort-ind, th[aria-sort="descending"] .sort-ind { opacity: 1; color: var(--accent); }
.err { color: var(--bad); }
.dev-note { background: var(--warn-soft); padding: 8px 12px; border-radius: 8px; font-size: .86rem; }

/* Lagen */
.layer-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 12px; }
.layer-head h2 { font-family: var(--f-display); font-size: 1.25rem; margin: 0; }
.layer-head .spacer, .legend { margin-left: auto; display: flex; gap: 8px 18px; flex-wrap: wrap; }
.layer-sep { margin: 0 0 16px; } /* losse lijn boven een laag (tussen entiteiten en categorieën) */
/* Vage scheidingslijn (kleuren van de lijn onder de bovenbalk), loopt aan beide kanten uit en valt nauwelijks op */
.layer-line { flex: 1 1 200px; height: 1px; background: var(--brand-line); opacity: .35; -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }
.legend { font-size: .82rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.layer-tag { font-family: var(--f-mono); font-size: .72rem; border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; color: var(--muted); }
.band { background: var(--band); color: var(--band-ink); border-radius: 14px; padding: 22px clamp(18px, 3vw, 30px); display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: center; }
.band .eyebrow { color: var(--band-muted); }
.band-left { flex: 1 1 320px; min-width: 0; }
.client-name { font-family: var(--f-display); font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; color: inherit; text-decoration: none; display: inline-block; }
.client-name:hover { text-decoration: underline; text-underline-offset: 6px; }
.client-name .arrow { font-size: .55em; color: var(--band-muted); vertical-align: middle; }
.band-meta { color: var(--band-muted); font-size: .88rem; display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; }
.tally { display: flex; gap: 10px; flex-wrap: wrap; }
.tally div { background: rgba(255,255,255,.08); border-radius: 10px; padding: 8px 14px; min-width: 86px; }
.tally b { display: block; font-family: var(--f-display); font-size: 1.6rem; line-height: 1.1; }
.tally span { font-size: .78rem; color: var(--band-muted); display: flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot.green { background: var(--ok); } .dot.orange { background: var(--warn); } .dot.red { background: var(--bad); }
.status-dot { --c: var(--ok); width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; background: color-mix(in srgb, var(--c) 62%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 80%, var(--surface)); }
.status-dot.orange { --c: var(--warn); } .status-dot.red { --c: var(--bad); }
.status-dot.grey { --c: var(--muted); } .dot.grey { background: var(--muted); opacity: .6; } /* nog niet verschenen */

.entities { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.entity { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 8px; }
.entity.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.entity-main { color: inherit; text-decoration: none; }
.entity-main:hover h3 { color: var(--accent); }
.entity h3 { margin: 0; font-size: 1rem; }
.entity .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.ent-actions { display: inline-flex; align-items: center; gap: 8px; }
.ent-actions .icon-btn { width: 28px; height: 26px; }
.counts { display: flex; gap: 10px; font-size: .82rem; }
.counts span { display: inline-flex; align-items: center; gap: 4px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.panel.pad { padding: 18px 20px; }
.panel.narrow { max-width: 640px; width: 100%; justify-self: center; }
.panel.narrow.wide { max-width: 760px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 1rem; }
.panel-head .spacer { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.empty { padding: 18px 16px; color: var(--muted); font-size: .9rem; }
/* Categorieën van de gekozen entiteit: vier naast elkaar, op smallere schermen twee of één */
.cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 1100px) { .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cats { grid-template-columns: minmax(0, 1fr); } }
.cats > .empty { grid-column: 1 / -1; }
/* Categorieën zonder lege ruimte onder elkaar (masonry, app.js): rijen van 2px, elke categorie overspant zoveel rijen als haar hoogte */
.cats.masonry { grid-auto-rows: 2px; row-gap: 0; }
.cats.masonry > .cat { margin-bottom: 14px; }
.layer-sub { color: var(--muted); font-weight: 600; font-size: .95rem; }
.cat { min-width: 0; }
/* Categorie verslepen (sinds versie 73; sinds versie 75 linkermuisknop: grijphand, niet op knoppen en links) */
.cats[data-cat-sort] > .cat { cursor: grab; }
.cats[data-cat-sort] > .cat :is(a, button, input, select, textarea, summary, label) { cursor: pointer; }
.cat.cat-drag { opacity: .55; outline: 2px dashed #04519b; outline-offset: 2px; }
body.cat-dragging, body.cat-dragging * { cursor: grabbing !important; user-select: none; }
.cat .panel-head { align-items: flex-start; padding: 12px 14px; }
.cat .panel-head .min0 { flex: 1 1 100%; }
.cat .panel-head .spacer { margin-left: 0; }
.cat-desc { font-size: .8rem; color: var(--muted); }
/* Niet aangeleverde periode in de Geschiedenis: alsnog aanleveren (sinds versie 70) */
.hist-late { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 2px 10px; }
/* Voorbeeld van een gekozen bestand rechts naast het formulier (sinds versie 66) */
.fp-panel { position: fixed; top: 16px; right: 16px; bottom: 16px; width: min(820px, calc(100vw - 580px)); display: flex; flex-direction: column; background: var(--surface, #fff); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden; z-index: 60; }
.fp-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--line); cursor: move; user-select: none; touch-action: none; }
.fp-head .icon-btn { cursor: pointer; }
.fp-name { display: grid; min-width: 0; flex: 1; }
.fp-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-body { flex: 1; min-height: 0; overflow: auto; display: flex; background: var(--sunken); }
.fp-body iframe { flex: 1; width: 100%; height: 100%; border: 0; background: #fff; }
.fp-body img { max-width: 100%; height: auto; margin: auto; display: block; }
.fp-body pre { margin: 0; padding: 14px 16px; white-space: pre-wrap; font-size: .82rem; width: 100%; }
.fp-none { margin: auto; padding: 24px; color: var(--muted); text-align: center; }
/* Klein gemaakt: alleen de kop; tijdens slepen vangt de PDF-weergave geen muis (sinds versie 67) */
.fp-panel.fp-min { bottom: auto; height: auto; }
.fp-panel.fp-min .fp-body { display: none; }
.fp-panel.fp-min .fp-head { border-bottom: 0; }
.fp-panel.fp-drag iframe { pointer-events: none; }
/* Het formulier houdt altijd minstens ca. 500 px; het voorbeeld past zich aan */
/* Het formulier houdt zijn eigen breedte (640 px, breed 760 px) en wordt alleen smaller als er naast het voorbeeld te weinig ruimte is */
body.fp-open .panel.narrow { justify-self: start; margin-left: 16px; margin-right: auto; max-width: min(640px, calc(100vw - min(820px, calc(100vw - 580px)) - 80px)); }
body.fp-open .panel.narrow.wide { max-width: min(760px, calc(100vw - min(820px, calc(100vw - 580px)) - 80px)); }
@media (max-width: 900px) {
  .fp-panel { position: static; width: auto; height: 60vh; margin: 16px; box-shadow: none; border: 1px solid var(--line); }
  .fp-head { cursor: default; }
  .fp-panel.fp-min { height: auto; }
  body.fp-open .panel.narrow { justify-self: center; margin-left: auto; margin-right: auto; max-width: 640px; }
  body.fp-open .panel.narrow.wide { max-width: 760px; }
}
/* In-/uitklappen (sinds versie 65): knop rechts in de kop; ingeklapt alleen kop en tellers */
.cat-title { display: flex; align-items: flex-start; gap: 8px; flex: 1 1 100%; min-width: 0; }
.cat-title .min0 { flex: 1; min-width: 0; }
.cat-toggle { flex: 0 0 auto; margin: -4px -6px 0 0; }
.cat-toggle svg { transition: transform .15s; }
.cat.collapsed .cat-toggle svg { transform: rotate(-90deg); }
.cat.collapsed > :not(.panel-head) { display: none; }
.cat-foot { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; gap: 6px; flex-wrap: wrap; }
/* In een smalle kaart staan de knoppen onder de documentgegevens */
.cat .doc { padding-inline: 14px; grid-template-columns: auto minmax(0, 1fr); }
.cat .doc-actions { grid-column: 2; justify-content: flex-start; }
.doc-links { font-size: .78rem; color: var(--muted); }
/* Koppelingen: per entiteit een categorie kiezen */
.links .link-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 4px 10px; align-items: center; padding: 4px 0; }
.links .link-row label { font-weight: 600; font-size: .88rem; overflow-wrap: anywhere; }
@media (max-width: 520px) { .links .link-row { grid-template-columns: minmax(0, 1fr); } }

.docs { list-style: none; margin: 0; padding: 0; }
.doc { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); }
.docs .doc:first-child { border-top: 0; }
.doc-title { font-weight: 600; overflow-wrap: anywhere; }
.doc-title a { color: inherit; text-decoration: none; }
.doc-title a:hover { color: var(--accent); text-decoration: underline; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: .8rem; color: var(--muted); }
.doc-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.validity { font-weight: 600; }
.validity.green { color: var(--ok); } .validity.orange { color: var(--warn); } .validity.red { color: var(--bad); }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.chip.pending { background: var(--warn-soft); border-color: transparent; }
.chip.signed { background: var(--ok-soft); border-color: transparent; }
.chip.expired { background: var(--bad-soft); border-color: transparent; }
.chip.who { background: var(--sunken); }
.signers { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 6px; font-size: .78rem; color: var(--muted); }
.signers .ok { color: var(--ok); } .signers .me { font-weight: 700; color: var(--ink); }
@media (max-width: 560px) { .doc { grid-template-columns: auto minmax(0, 1fr); } .doc-actions { grid-column: 2; justify-content: flex-start; } }

/* Verzoeken */
.req-list .doc { background: var(--warn-soft); }
.req-list + .docs .doc:first-child { border-top: 1px solid var(--line); }
.req-icon { width: 16px; display: inline-grid; place-items: center; color: var(--warn); }
.req-text { font-size: .82rem; margin-top: 4px; }
.req-note { display: flex; gap: 6px; align-items: flex-start; font-size: .8rem; margin-top: 6px; padding: 5px 8px; border-radius: 8px; background: var(--warn-soft); }
.req-note svg, .req-banner svg, .req-icon svg { width: 16px; height: 16px; flex: none; color: var(--warn); }
.req-note.remind-later { background: var(--sunken); color: var(--muted); }
.req-note.remind-done { background: var(--ok-soft); }
.req-note.remind-done svg { color: var(--ok); }
.req-banner { border: 1px solid var(--line); border-left: 4px solid var(--warn); background: var(--surface); border-radius: 12px; padding: 12px 16px; display: grid; gap: 8px; }
.req-banner-head { display: flex; align-items: center; gap: 8px; }
.req-banner ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.req-banner li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding-top: 6px; border-top: 1px solid var(--line); }
.req-banner .req-t { font-weight: 600; }
.req-banner li .btn, .req-banner li .chip { margin-left: auto; }
/* Openstaande verzoeken: één klikbare melding; het overzicht staat op de pagina Verzoeken */
.req-banner-btn { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.req-banner-btn:hover { background: var(--accent-soft); }
.req-banner-btn svg { width: 16px; height: 16px; color: var(--warn); flex: none; }
.req-banner-btn .req-open { margin-left: auto; color: var(--accent); font-weight: 600; font-size: .85rem; }

/* Formulieren */
.card-form { display: grid; gap: 14px; margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px 16px; }
.f { display: grid; gap: 4px; }
.f label, .label-like { font-size: .84rem; font-weight: 600; }
/* In formulieren iets meer ruimte (ca. 1 mm) tussen een label en het veld eronder */
.card-form .f { gap: 8px; }
/* Item, Herhaling en Periode: zelfde afstand als tussen de andere velden */
[data-item-fields] { display: grid; gap: 14px; }
.f input:not([type="checkbox"]):not([type="radio"]), .f select, .f textarea { /* keuzerondjes niet (sinds versie 113) */ border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 8px 10px; width: 100%; }
.f.check { display: flex; gap: 8px; align-items: center; }
.f.check label { font-weight: 500; }
.help { font-size: .78rem; color: var(--muted); }
fieldset.f { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; gap: 6px; }
fieldset.f legend { font-size: .84rem; font-weight: 600; padding: 0 4px; }
.ck { display: flex; gap: 10px; align-items: flex-start; padding: 6px 4px; border-radius: 6px; cursor: pointer; }
.ck:hover { background: var(--sunken); }
.ck-tools { font-size: .8rem; color: var(--muted); }
.ck-tools .link { font-size: .8rem; }
fieldset.checks { max-height: 340px; overflow-y: auto; }
.actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
/* Actiemenu onder een categorie (+ Item, Data opvragen, Categorie aanpassen) */
.menu-wrap { position: relative; }
.menu-wrap > summary { list-style: none; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.menu-wrap > summary::-webkit-details-marker { display: none; }
.menu-wrap[open] > summary { color: var(--accent); border-color: var(--accent); }
.pop-menu { position: absolute; left: 0; top: calc(100% + 4px); z-index: 30; min-width: 240px; display: grid; gap: 2px; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.pop-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--ink); font-size: .88rem; text-decoration: none; }
.pop-menu a:hover, .pop-menu a:focus-visible { background: var(--sunken); }
.pop-menu svg { color: var(--muted); flex: none; }
/* Template: categorie met slotje en sjablonen in het templatebeheer */
.chip.tpl { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; vertical-align: middle; font-size: .7rem; background: var(--accent-soft, var(--sunken)); color: var(--brand-navy); border: 1px solid var(--line); }
.chip.tpl svg { width: 12px; height: 12px; }
.tpl-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; background: var(--sunken); border-radius: 8px; padding: 7px 10px; }
.tpl-item .small { flex-basis: 100%; order: 3; }
.tpl-item .icon-group { margin-left: auto; }
/* Uitschuifpaneel rechts (app.js, links met data-drawer) */
.scrim { position: fixed; inset: 0; background: rgba(10, 20, 22, .45); z-index: 61; } /* boven het documentvoorbeeld (.fp-panel, 60), sinds versie 115 */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--surface); color: var(--ink); z-index: 62; box-shadow: -8px 0 30px rgba(0, 0, 0, .2); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 2px 0 0; font-size: 1.25rem; overflow-wrap: anywhere; }
.drawer-head .btn { margin-left: auto; }
.drawer-body { padding: 18px 20px; overflow-y: auto; display: grid; gap: 14px; align-content: start; }
.drawer-body > * { min-width: 0; }
/* Geschiedenis van een categorie: per Item de versies, klik = bekijken */
.hist-list { display: grid; gap: 12px; }
.hist-list > p { margin: 0; }
.hist-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; }
.hist-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.hist-head b { overflow-wrap: anywhere; }
.hist-vers { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.hist-ver { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; background: var(--sunken); border: 1px solid transparent; border-radius: 8px; padding: 7px 10px; color: inherit; text-decoration: none; }
.hist-ver:hover, .hist-ver:focus-visible { border-color: var(--accent); }
.hist-file { flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; font-weight: 600; font-size: .86rem; }
.hist-ver .small { flex-basis: 100%; font-size: .78rem; }
/* Gearchiveerd Item: label met archiefdoos, in de Geschiedenis en in de viewer */
.hist-arch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.hist-item.is-archived { opacity: .85; }
.chip.archived { display: inline-flex; align-items: center; gap: 4px; background: var(--sunken); color: var(--muted); border: 1px solid var(--line); }
.chip.archived svg { width: 13px; height: 13px; }
/* Geschiedenis van entiteiten en categorieën: per categorie de Items */
.ent-cat { display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 8px; }
.ent-cat-name { font-weight: 600; font-size: .88rem; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hist-ver .chip { font-size: .7rem; }
.layer-head .spacer { display: flex; align-items: center; gap: 8px; }
/* Stappenplan (wizard) voor Item aanmaken, aanpassen en opvragen (app.js) */
.wiz { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.wiz li { flex: 1 1 0; min-width: 0; border-top: 3px solid var(--line); padding-top: 6px; font-size: .74rem; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wiz li.done { border-color: var(--brand-green); cursor: pointer; }
.wiz li.on { border-color: var(--accent); color: var(--brand-navy); }
.wiz-step { display: grid; gap: 14px; }
.wiz-sum { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 6px 12px; margin: 0; padding: 12px; font-size: .86rem; background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; }
.wiz-sum:empty { display: none; }
.wiz-sum dt { color: var(--muted); }
.wiz-sum dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .wiz li:not(.on) { flex: 0 0 28px; font-size: 0; } .wiz li:not(.on)::first-letter { font-size: .74rem; } } /* smal: alleen de huidige stap met naam */
.back { margin: 0; font-size: .9rem; }
.back a { text-decoration: none; font-weight: 600; }
.sigpad { font-family: "Segoe Script", "Brush Script MT", cursive; font-size: 1.6rem; border-bottom: 2px solid var(--ink); min-height: 2.4rem; padding: 0 4px; color: var(--accent); }
.code-input { font-family: var(--f-mono); font-size: 1.4rem !important; letter-spacing: .4em; text-align: center; }
/* Delen: ronde knop naast de bol met initialen, met teller voor nieuw gedeelde bestanden */
.sharechip { position: relative; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--accent); display: inline-grid; place-items: center; text-decoration: none; }
.sharechip:hover { background: var(--accent-soft); }
.sharechip .ic { width: 17px; height: 17px; }
.share-badge { position: absolute; top: -5px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #c0392b; color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.share-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.share-item { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; justify-content: space-between; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.share-item > .min0 { flex: 1 1 220px; }
.share-item .small, .share-to { font-size: .8rem; }
.share-to { margin: 4px 0 0; padding-left: 16px; }
.share-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.login-card.share-ext { width: min(760px, 100%); max-width: 760px; }
.share-preview { margin: 10px 0; }
.share-preview img { max-width: 100%; border-radius: 6px; }
.share-preview iframe { width: 100%; height: 65vh; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
/* Verificatiecode: 6 losse blokjes, één cijfer per blokje (app.js; zonder JavaScript blijft het ene veld) */
.code-boxes { display: flex; gap: 8px; }
.code-boxes input { width: 46px; height: 54px; padding: 0; text-align: center; font-family: var(--f-mono); font-size: 1.5rem; font-weight: 600; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); }
.code-boxes input:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); outline-offset: 1px; }
@media (max-width: 420px) { .code-boxes { gap: 5px; } .code-boxes input { width: 38px; height: 48px; font-size: 1.3rem; } }
.kv { display: grid; grid-template-columns: minmax(120px, 34%) minmax(0, 1fr); gap: 8px 14px; margin: 12px 0; }
.kv dt { color: var(--muted); font-size: .85rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.section-title { font-weight: 700; font-size: 1rem; margin: 12px 0 8px; }
.danger-zone { border-color: var(--bad-soft); }
h1 svg { width: 22px; height: 22px; vertical-align: -3px; color: var(--accent); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checklist li { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; }
.checklist li svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.checklist li.ok svg { color: var(--ok); }
.checklist li.bad svg { color: var(--bad); }
.provider-help:not(:empty) { font-size: .84rem; background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; }
.btn svg { vertical-align: -3px; }
.lic-chip { display: inline-block; margin: 8px 0 2px; font-size: .78rem; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.1); }
.lic-chip.lic-bad { background: color-mix(in srgb, var(--bad) 35%, transparent); }
.lic-chip a { color: inherit; }
.lic-total { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .9rem; margin: 6px 0; }
.lic-actions { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.row-focus td { background: var(--accent-soft); }
td.wrapcell { white-space: normal; min-width: 160px; max-width: 300px; }
.head-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.head-row .spacer { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

.inv-rows { display: grid; gap: 6px; }
.inv-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 6px; align-items: center; }
.inv-row input { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 7px 9px; width: 100%; min-width: 0; }
.inv-row .icon-btn { border: 1px solid var(--line); border-radius: 8px; height: 34px; }
.inv-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.bulk-sum { display: flex; gap: 6px; flex-wrap: wrap; }
.bulk-table { max-height: 420px; overflow: auto; }
.row-bad td { background: var(--bad-soft); }
.bad-text { color: var(--bad); font-weight: 600; } .ok-text { color: var(--ok); font-weight: 600; }

/* Tabellen */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; } /* relative: verborgen teksten (.sr) blijven binnen het schuifvak */
table { border-collapse: collapse; width: 100%; font-size: .86rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--sunken); }
tr:last-child td { border-bottom: 0; }
td.wrapcell { white-space: normal; min-width: 180px; max-width: 320px; }
.dbtree { font-family: var(--f-mono); font-size: .82rem; background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; white-space: pre; overflow-x: auto; line-height: 1.7; }
.dbtree b { color: var(--accent); font-weight: 500; }

/* Viewer */
.viewer { overflow: hidden; }
.v-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.v-head h1 { font-size: 1.2rem; margin: 0; }
.v-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.v-versions, .v-sign { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 18px; border-bottom: 1px solid var(--line); font-size: .85rem; }
.v-sign { display: grid; }
.v-ver { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 3px 10px; font-size: .78rem; text-decoration: none; color: var(--ink); }
.v-ver:hover { border-color: var(--accent); color: var(--accent); }
.v-ver.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
/* Terugkerend sjabloondocument: periode als chip; keuzelijsten voor maand, kwartaal en jaar (niet gekozen = grijs) */
.chip.period { background: var(--sunken); }
.period-picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.period-picks .pp { display: grid; gap: 4px; font-size: .82rem; color: var(--muted); }
.period-picks select:disabled { opacity: .45; cursor: not-allowed; }
/* Verschijnen / uiterlijk inleveren: [aantal] [dagen vóór|na] [het begin|einde] van de periode (sinds versie 64) */
.rule-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.f .rule-pick input, .f .rule-pick input[type=number] { width: 5.5em; max-width: 5.5em; flex: 0 0 auto; }
.f .rule-pick select { width: auto; flex: 0 1 auto; }
.rule-preview { display: block; line-height: 1.6; }
/* Jaarkeuze in de versiebalk van de viewer */
.v-year { display: inline-flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.v-year select.sel { padding: 3px 8px; font-size: .8rem; }
.v-body { background: var(--sunken); padding: 16px; display: grid; justify-items: center; }
.v-body iframe { width: 100%; height: 75vh; border: 0; background: #fff; border-radius: 6px; }
.v-note { color: var(--muted); }
/* Ondertekeningsblad naast een bestand waar geen pagina aan toegevoegd kan worden (altijd als wit papier) */
.sign-sheet { background: #fff; color: #1f2733; width: 100%; max-width: 680px; padding: clamp(20px, 5%, 44px); border-radius: 6px; border-top: 4px solid #04519b; display: grid; gap: 12px; font-size: .88rem; margin-top: 16px; }
.sign-sheet h3 { margin: 0; color: #01356f; font-size: 1.2rem; }
.sign-sheet dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; }
.sign-sheet dt { color: #5d6875; }
.sign-sheet dd { margin: 0; }
.sign-sheet .muted { color: #5d6875; }
.sign-sheet a { color: #04519b; }
.ss-hash { overflow-wrap: anywhere; }
.ss-sig { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; border-top: 1px solid #d6dfe8; padding-top: 10px; }
.ss-nr { width: 22px; height: 22px; border-radius: 50%; background: #e1ecf7; color: #01356f; display: grid; place-items: center; font-size: .75rem; font-weight: 700; }
.ss-sig .ink { font-family: "Segoe Script", "Brush Script MT", cursive; font-size: 1.5rem; color: #1d4f8a; display: block; line-height: 1.3; }
.ss-foot { font-size: .78rem; margin: 8px 0 0; }
.mail-head { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 10px 14px; background: var(--sunken); border-radius: 10px; font-size: .85rem; }
.mail-head dt { color: var(--muted); } .mail-head dd { margin: 0; overflow-wrap: anywhere; }
.mail-frame { width: 100%; height: 480px; border: 1px solid var(--line); border-radius: 10px; margin-top: 12px; background: #fff; }

/* Inloggen */
.login-wrap { padding-block: clamp(24px, 6vh, 64px); display: grid; justify-items: center; }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: clamp(20px, 5vw, 32px); display: grid; gap: 16px; }
.login-card .f input, .login-card .f select { padding: 10px 12px; }
.login-logo { width: min(260px, 80%); justify-self: center; background: var(--paper-plate); border-radius: 12px; padding: 8px; }
.login-btn { justify-content: center; padding-block: 10px; font-size: .95rem; }
/* Inloggen als (meer accounts): knop over de hele breedte, tekst mag afbreken (sinds versie 141) */
.login-card > form.inline { display: block; min-width: 0; }
.login-btn.login-pick { width: 100%; white-space: normal; flex-direction: column; align-items: flex-start; justify-content: flex-start; text-align: left; gap: 2px; overflow-wrap: anywhere; }
.login-pick .lp-sub { font-size: .82rem; font-weight: 400; opacity: .8; }
/* Hulp per rol en per scherm (sinds versie 115), in het uitschuifpaneel */
.help-title { font-size: 1.25rem; margin: 0 0 8px; color: var(--navy, #01356f); }
.help-h { font-size: 1rem; margin: 18px 0 6px; color: #04519b; }
.help-body p { margin: 0 0 10px; line-height: 1.55; }
.help-steps { margin: 0 0 12px; padding-left: 22px; line-height: 1.55; }
.help-steps li { margin: 0 0 6px; }
.help-punt { padding-left: 16px; position: relative; }
.help-punt::before { content: "•"; position: absolute; left: 2px; color: #0d8762; }
.help-tip, .help-let { padding: 8px 10px 8px 12px; border-radius: 6px; font-size: .92rem; }
.help-tip { background: #e8f5ef; border-left: 4px solid #0d8762; }
.help-let { background: #fdf3e2; border-left: 4px solid #e0a030; }
.help-fig { margin: 8px 0 14px; }
.help-fig img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }
.help-fig figcaption { font-size: .8rem; color: var(--muted); text-align: center; margin-top: 4px; font-style: italic; }
.help-index { margin: 0 0 14px; padding-left: 18px; line-height: 1.7; }
/* Beveiliging: QR-code authenticator-app en herstelcodes (sinds versie 112) */
.qr-box { display: flex; justify-content: center; margin: 8px 0; }
.qr-box svg { width: 220px; height: 220px; max-width: 100%; }
.recovery-codes { columns: 2; font-size: 1rem; line-height: 1.7; }
/* Passkeys (sinds versie 111) */
.pk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pk-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
/* Wachtwoord vergeten (sinds versie 110) */
.forgot { margin: -8px 0 0; text-align: right; font-size: .85rem; }
/* Inloggen met Microsoft of Google (SSO, sinds versie 109) */
.sso-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; }
.sso-sep::before, .sso-sep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.sso-btns { display: grid; gap: 8px; }
.sso-btn { justify-content: center; gap: 10px; padding-block: 9px; }
.sso-btn svg { width: 18px; height: 18px; flex: none; }
.sso-steps { margin: 6px 0 12px; padding-left: 20px; font-size: .88rem; }
.sso-steps li { margin: 3px 0; }
.pw { position: relative; }
.pw input { padding-right: 64px !important; }
.pw .link { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }

/* Instellingen (admin): tabbladen Gebruikers & databases, Licenties, SMTP-beheer */
.settings-head { margin: 4px 0 14px; }
.settings-head .eyebrow { margin: 0 0 4px; }
.st-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.st-tabs a { font-size: .92rem; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; padding: 9px 14px; margin-bottom: -1px; }
.st-tabs a:hover { color: var(--ink); }
.st-tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.st-tabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px 6px 0 0; }

/* Betaallink: berekening van het jaarbedrag */
.lic-calc { display: grid; gap: 6px; background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: .9rem; }
.lic-calc div { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lic-calc span { color: var(--muted); }
.paylink-status { font-size: .78rem; color: var(--muted); margin-top: 4px; white-space: normal; }.lic-chip form.inline { display: inline; }
.lic-chip .link { color: inherit; text-decoration: underline; font-size: .78rem; }
.lic-chip .lic-sub { display: block; font-size: .72rem; opacity: .85; margin-top: 2px; }

/* Instellingen → Logs */
.log-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.log-tabs a { font-size: .88rem; font-weight: 600; color: var(--ink); text-decoration: none; background: var(--sunken); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.log-tabs a:hover { border-color: var(--accent); }
.log-tabs a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.log-tabs .log-count { font-weight: 500; opacity: .8; }
.log-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.log-tools select, .log-tools input[type=search] { font: inherit; font-size: .9rem; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.log-tools input[type=search] { flex: 1 1 200px; min-width: 0; }
/* Taalkeuze (vlaggen) op inlog-, account- en betaalpagina */
.lang-pick { display: flex; gap: 6px; justify-self: end; margin: -6px -6px -4px 0; }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--muted); text-decoration: none; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 6px; }
.lang-btn svg { border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.18); flex: none; }
.lang-btn:hover { border-color: var(--accent); color: var(--ink); }
.lang-btn[aria-current="true"] { color: var(--ink); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
/* Taalkeuze in de bovenbalk (ingelogd) */
.lang-pick.lang-top { margin: 0; gap: 4px; }
.lang-top .lang-btn { padding: 3px 8px 3px 5px; font-size: .74rem; }
/* Verzendknop na de eerste klik (sinds versie 78): niet nog eens te klikken */
button.is-busy { opacity: .6; cursor: progress; }

/* Explorer (sinds versie 92): mappen en bestanden per klant, rechts in het uitschuifpaneel */
.drawer:has(.exp) { width: min(760px, 100%); }
.exp { position: relative; display: grid; gap: 10px; min-height: 60vh; align-content: start; border-radius: 12px; }
.exp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; }
.exp-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-width: 0; font-size: .9rem; }
.exp-crumbs a { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 6px; color: var(--accent); text-decoration: none; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-crumbs a[aria-current] { color: var(--ink); font-weight: 600; }
.exp-crumbs .sep { color: var(--muted); }
.exp-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.exp-tools form { margin: 0; }
.exp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.exp-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.exp-row[draggable="true"] { cursor: grab; }
.exp-name { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; padding: 2px 0; color: inherit; text-decoration: none; }
.exp-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-name svg { width: 20px; height: 20px; flex: none; }
.exp-row.is-dir .exp-name svg { color: #d39a1c; }
.exp-name:hover span { text-decoration: underline; text-underline-offset: 3px; }
.exp-meta { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.exp-acts { display: flex; gap: 2px; }
.exp-acts .icon-btn { width: 28px; height: 28px; }
.exp-row.drop-on, .exp-crumbs a.drop-on { outline: 2px dashed var(--accent); outline-offset: 1px; background: var(--accent-soft); }
.exp.drop-files { outline: 2px dashed var(--accent); outline-offset: 4px; background: var(--accent-soft); }
.exp-empty { border: 2px dashed var(--line); border-radius: 12px; padding: 36px 16px; text-align: center; color: var(--muted); }
.exp-empty svg { width: 30px; height: 30px; }
.exp-status.err { color: #b42318; }
@media (max-width: 640px) { .exp-meta { display: none; } }

/* Explorer als boomstructuur (sinds versie 93): + klapt een map open, de inhoud staat ingesprongen eronder */
.exp-list > li { list-style: none; min-width: 0; }
.exp-sub { margin: 4px 0 0 22px; padding-left: 8px; border-left: 1px dashed var(--line); }
.exp-tog { flex: none; width: 22px; height: 22px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); font: 600 .95rem/1 inherit; cursor: pointer; padding: 0; }
.exp-tog:hover { background: var(--accent-soft); color: var(--accent); }
span.exp-tog { border-color: transparent; background: none; cursor: default; }
/* Viewer van de Explorer */
.exp-viewer { width: min(980px, calc(100% - 24px)); height: min(92vh, 1100px); padding: 0; border: 0; border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.exp-viewer[open] { display: flex; flex-direction: column; }
.exp-viewer::backdrop { background: rgba(10, 20, 35, .55); }
.ev-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ev-head .min0 { flex: 1; min-width: 0; }
.ev-head h2 { margin: 0; font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-body { flex: 1; min-height: 0; overflow: auto; background: var(--bg); display: flex; }
.ev-body iframe { flex: 1; border: 0; width: 100%; background: #fff; }
.ev-body img { max-width: 100%; height: auto; margin: auto; display: block; }
.ev-body pre { margin: 0; padding: 14px 16px; white-space: pre-wrap; font-size: .84rem; width: 100%; }
.ev-none { margin: auto; padding: 24px; color: var(--muted); text-align: center; }

/* Explorer (sinds versie 94): Ctrl+klik selecteert; slepen naar een categorie (de achtergrond houdt het slepen niet tegen) */
.exp-row.selected { background: var(--accent-soft); border-color: var(--accent); }
body.exp-dragging .scrim { pointer-events: none; }
.cat.drop-on { outline: 3px dashed var(--accent); outline-offset: 2px; }

/* Stappenplan: lange keuzelijsten (bijv. Categorie en Item bij Document naar Item, sinds versie 97) niet breder dan het formulier */
form.wizard, form.wizard .wiz-step, form.wizard .f { min-width: 0; grid-template-columns: minmax(0, 1fr); }
form.wizard select { max-width: 100%; min-width: 0; text-overflow: ellipsis; }

/* Zoeken in het dossier (sinds versie 99): zoekveld, Uitgebreid zoeken en resultaten */
.drawer:has(.srch) { width: min(820px, 100%); }
.srch { display: grid; gap: 12px; }
.srch > input[type=search] { width: 100%; font-size: 1rem; padding: 10px 12px; }
.srch-adv { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.srch-adv > summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.srch-adv[open] > summary { margin-bottom: 10px; }
.srch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; margin-bottom: 10px; }
.srch-grid label { display: grid; gap: 4px; font-size: .82rem; font-weight: 600; min-width: 0; }
.srch-grid select, .srch-grid input[type=date] { width: 100%; min-width: 0; font-weight: 400; }
.srch-in { grid-column: 1 / -1; border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.srch-in legend { font-size: .82rem; font-weight: 600; margin-bottom: 4px; }
.srch-in .ck { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }
.srch-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.srch-hit { display: flex; gap: 10px; align-items: flex-start; background: var(--sunken); border: 1px solid transparent; border-radius: 8px; padding: 8px 10px; color: inherit; text-decoration: none; }
.srch-hit:hover { border-color: var(--accent); }
.srch-hit .dot { margin-top: 5px; flex: none; }
.srch-ico svg { width: 16px; height: 16px; color: #d39a1c; margin-top: 2px; }
.srch-main { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; min-width: 0; }
.srch-meta { flex-basis: 100%; overflow-wrap: anywhere; }
/* Gevonden in de documentinhoud: stukje tekst rond de zoekterm (ook in de Geschiedenis) */
.hist-snip { flex-basis: 100%; display: block; font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.hist-snip mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 2px; }
/* Licentieoverzicht (sinds versie 117): tegels, filters, regels met gebruik-balk, contract */
.lic-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 10px 0 14px; }
.lic-tile { background: var(--sunken); border-radius: 10px; padding: 8px 12px; display: grid; gap: 2px; }
.lic-tile span { font-size: .76rem; color: var(--muted); }
.lic-tile strong { font-size: 1.2rem; }
.lic-tile strong.warn { color: var(--warn); } .lic-tile strong.bad { color: var(--bad); }
.lic-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.lic-filters input[type=search] { flex: 1; min-width: 180px; }
.lic-list { display: grid; gap: 6px; margin-top: 6px; }
.lic-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.lic-row.row-focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.lic-name { display: grid; min-width: 0; } .lic-name .muted { font-size: .78rem; }
.lic-use { display: grid; gap: 3px; font-size: .82rem; }
.lic-bar { height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.lic-bar.big { height: 10px; margin: 4px 0; }
.lic-bar i { display: block; height: 100%; } .lic-bar i.green { background: var(--ok); } .lic-bar i.orange { background: var(--warn); } .lic-bar i.red { background: var(--bad); }
.lic-usage { margin: 10px 0; padding: 10px 12px; background: var(--sunken); border-radius: 10px; font-size: .9rem; }
.lic-usage > div:first-child { display: flex; justify-content: space-between; }
.lic-log { padding-left: 18px; } .lic-log li { margin-bottom: 3px; }
table.plans input { width: 100%; min-width: 70px; }
@media (max-width: 720px) { .lic-row { grid-template-columns: 1fr; } }
/* Overstappen naar Mollie (sinds versie 119) */
.lic-switch { margin: 10px 0; padding: 10px 12px; border: 1px dashed var(--accent); border-radius: 10px; display: grid; gap: 6px; font-size: .9rem; }
.mollie-head { display: flex; gap: 8px; align-items: center; font-size: 1.2rem; }
.mollie-amount { font-size: 1.6rem; font-weight: 700; margin: 6px 0 0; }
/* Licenties per kantoororganisatie (sinds versie 122): uitklapbare groep per kantoor */
.lic-org { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--surface, #fff); }
.lic-org-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 14px 10px 34px; cursor: pointer; list-style: none; position: relative; }
.lic-org-head::-webkit-details-marker { display: none; }
.lic-org-head::before { content: "▸"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.lic-org[open] > .lic-org-head::before { content: "▾"; }
.lic-org-name { display: grid; } .lic-org-name .muted { font-size: .8rem; }
.lic-org-chips { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.lic-org > .lic-list { padding: 0 10px 10px; }
.seg-btns { display: inline-flex; gap: 4px; }
@media (max-width: 640px) { .lic-org-head { grid-template-columns: minmax(0, 1fr); } .lic-org-chips { justify-content: flex-start; } }

/* Importeren (sinds versie 124) */
.import-errs { margin: 0 0 8px; padding-left: 18px; font-size: .85rem; color: var(--bad); max-height: 260px; overflow: auto; }
.import-run { display: grid; gap: 8px; }


/* Kantoorbundel (sinds versie 125) */
.bundle-req > summary { list-style: none; display: inline-flex; cursor: pointer; }
.bundle-req > summary::-webkit-details-marker { display: none; }
.bundle-req[open] > summary { margin-bottom: 8px; }
.inline-reason { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; } .inline-reason input { flex: 1 1 200px; min-width: 0; }


/* Voortgangsbalk bij klant importeren en exporteren (sinds versie 129) */
.up-bar { height: 8px; border-radius: 4px; background: var(--sunken, #f4f6f9); border: 1px solid var(--line); overflow: hidden; margin: 6px 0 2px; min-width: 120px; }
.up-bar > i { display: block; height: 100%; width: 0; background: var(--brand-line); transition: width .3s; }
.job-notice a { margin-left: 6px; font-weight: 600; }