/* Global Outsourcing Partners portaal — calm, structured, scannable. No external assets.
   Huisstijl: donkerblauw (#0a2342) en goud (#b7892b) uit het logo. */
:root {
  --ink: #0d1b30;
  --ink-soft: #3b4a63;
  --muted: #5d6679;  /* ≥ 4.5:1 contrast on every tinted background (WCAG AA) */
  --line: #e2e6ec;
  --bg: #f4f6f9;
  --card: #ffffff;
  --brand: #0a2342;
  --brand-dark: #061529;
  --brand-soft: #eef2f8;
  --gold: #b7892b;
  --gold-light: #d4b066;
  --gold-dark: #7d5c14;
  --gold-soft: #f8f1e2;
  --side: #0a2342;
  --side-soft: #163659;
  --ok: #137445;     /* ≥ 4.5:1 on --ok-bg */
  --ok-bg: #e4f5ec;
  --warn: #9a5b00;
  --warn-bg: #fff3d6;
  --danger: #b42318;
  --danger-bg: #fde8e6;
  --info: #1d4ed8;
  --info-bg: #e6edff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 35, 63, .06), 0 4px 14px rgba(16, 35, 63, .05);
  font-size: 15px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5; -webkit-font-smoothing: antialiased;
}
body.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
a { color: var(--brand-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand); }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.08rem; margin: 0 0 .75rem; }
h3 { font-size: .98rem; margin: 1.1rem 0 .5rem; }
p { margin: 0 0 .75rem; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; }
code { background: #eef1f5; padding: .1em .35em; border-radius: 4px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: .5rem .75rem; z-index: 10; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 2px; }

/* ------------------------------------------------------------- sidebar */
.sidebar {
  background: var(--side); color: #dbe4f0; padding: 1.1rem .9rem; display: flex; flex-direction: column;
  gap: 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; padding: .2rem .4rem; }
.brand strong { display: block; font-size: 1.05rem; letter-spacing: .01em; }
.brand small { display: block; color: var(--gold-light); font-size: .74rem; letter-spacing: .04em; }
.brand-logo { width: 58px; height: auto; flex: none; }
.login-logo { display: block; width: 150px; height: auto; margin: 0 auto 1.25rem; }
.login-wordmark { text-align: center; font-size: 1.35rem; font-weight: 700; color: var(--brand); margin: 0 0 1.25rem; }
.brand-dark { color: var(--ink); padding: 0; margin-bottom: 1rem; }
.brand-dark small { color: var(--muted); }
.mainnav { display: flex; flex-direction: column; gap: 2px; }
.mainnav a {
  color: #cfd9e8; text-decoration: none; padding: .55rem .7rem; border-radius: 8px; display: flex;
  justify-content: space-between; align-items: center; gap: .5rem; font-size: .93rem;
}
.mainnav a:hover { background: var(--side-soft); color: #fff; }
.mainnav a[aria-current="page"] { background: var(--gold); color: var(--brand-dark); font-weight: 600; }
.navsep { font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: #7f93b0; padding: .9rem .7rem .3rem; }
.whoami { margin-top: auto; border-top: 1px solid #263f63; padding: .9rem .4rem 0; font-size: .86rem; }
.who-name { color: #fff; font-weight: 600; }
.who-role { color: #9fb2cc; font-size: .78rem; margin-bottom: .5rem; }
.who-actions { display: flex; gap: .9rem; align-items: center; }
.who-actions a, .linkbtn { color: #cfd9e8; font-size: .84rem; }
.who-actions form { margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; font: inherit; font-size: .84rem; }
.linkbtn:hover, .who-actions a:hover { color: #fff; }

/* ---------------------------------------------------------------- main */
.main { padding: 1.6rem 2rem 3rem; max-width: 1320px; width: 100%; min-width: 0; }
body.public .main { max-width: none; padding: 0; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; color: var(--gold-dark); font-weight: 700; margin: 0 0 .2rem; }
.headmeta { margin: .45rem 0 0; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; color: var(--ink-soft); }
.lead { font-size: 1.02rem; color: var(--ink-soft); }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.breakall { word-break: break-all; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.hint { color: var(--muted); font-size: .86rem; margin: .4rem 0 0; }
.empty { color: var(--muted); padding: .6rem 0; margin: 0; }
.hiddenform { display: none; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow); margin: 0 0 1.1rem; min-width: 0;
}
fieldset.card { min-inline-size: 0; }
legend { font-weight: 700; padding: 0 .4rem; font-size: 1rem; }
.card-accent { border-left: 4px solid var(--gold); }
.card.narrow { max-width: 520px; margin: 3rem auto; }
.card.center { text-align: center; }
.cardhead { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.cardhead h2 { margin: 0; }

.grid { display: grid; gap: .9rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.tight { gap: .6rem; }
.kpis { margin-bottom: 1.1rem; }
.card .kpis { margin-bottom: .8rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.card .kpi { background: #f8fafc; }
.kpi-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.kpi strong { font-size: 1.3rem; letter-spacing: -.01em; overflow-wrap: anywhere; }
.kpi small { color: var(--muted); font-size: .8rem; }
.kpi-ok { border-color: #b7e2c8; background: var(--ok-bg) !important; }
.kpi-warn { border-color: #f1d28a; background: var(--warn-bg) !important; }
.kpi-danger { border-color: #f3b6b0; background: var(--danger-bg) !important; }

/* -------------------------------------------------------------- badges */
.badge {
  display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 600;
  line-height: 1.5; white-space: nowrap; vertical-align: middle; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: #eceff3; color: #475467; }
.badge-subtle { background: #f1eefc; color: #5b3fb3; font-weight: 500; white-space: normal; }
.count { background: rgba(16, 35, 63, .1); color: inherit; border-radius: 999px; padding: 0 .45rem; font-size: .76rem; font-weight: 700; min-width: 1.4rem; text-align: center; display: inline-block; }
.mainnav .count { background: #f59e0b; color: #1f1300; }
.mainnav a[aria-current="page"] .count { background: var(--brand-dark); color: #fff; }
.dot { width: .62rem; height: .62rem; border-radius: 50%; display: inline-block; margin-right: .35rem; }
.dot-ok { background: #22a05f; } .dot-warn { background: #e39b12; } .dot-danger { background: #d92d20; }
.calm { background: var(--ok-bg); color: #0d5c36; border: 1px solid #b7e2c8; border-radius: var(--radius); padding: .6rem .9rem; margin: 0 0 1.1rem; font-weight: 500; }
.card .calm { margin: .3rem 0; }
.person { display: inline-block; background: #eef1f5; border-radius: 6px; padding: .05rem .45rem; font-size: .82rem; margin: 0 .2rem .2rem 0; }
.person-pending { border: 1px dashed #c58a0b; background: #fff8e6; }
.actor { font-weight: 600; }
.actor-team { color: var(--brand-dark); }

/* ------------------------------------------------------------- notices */
.flashes { margin-bottom: 1rem; display: grid; gap: .4rem; }
.flash, .notice { border-radius: 8px; padding: .65rem .9rem; border: 1px solid transparent; margin: 0 0 1rem; }
.flashes .flash { margin: 0; }
.flash-ok { background: var(--ok-bg); border-color: #b7e2c8; color: #0d5c36; }
.flash-warn, .notice-warn { background: var(--warn-bg); border-color: #f1d28a; color: #6b4100; }
.flash-error, .notice-danger { background: var(--danger-bg); border-color: #f3b6b0; color: #8a1c13; }
.notice-info { background: var(--info-bg); border-color: #bfd0ff; color: #1e3a8a; }
.field-error { color: var(--danger); font-size: .84rem; font-weight: 600; margin: .25rem 0 0; }

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: .4rem; border: 1px solid #cdd5df; background: #fff; color: var(--ink);
  border-radius: 8px; padding: .5rem .9rem; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
  text-decoration: none; line-height: 1.3;
}
.btn:hover { border-color: #9aa7b8; color: var(--ink); background: #f8fafc; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-warn { background: #fff8e6; border-color: #e0b24b; color: #6b4100; }
.btn-warn:hover { background: #ffefc2; color: #6b4100; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--danger); background: var(--danger-bg); border-color: transparent; }
.btn-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-active:hover { background: var(--ink); color: #fff; }
.btn-small { padding: .28rem .6rem; font-size: .82rem; border-radius: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* --------------------------------------------------------------- forms */
label { display: block; font-weight: 600; font-size: .88rem; color: var(--ink-soft); }
input, select, textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .5rem .65rem; border: 1px solid #cdd5df; border-radius: 8px;
  font: inherit; color: var(--ink); background: #fff; min-width: 0;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 3px solid rgba(183, 137, 43, .25); outline-offset: 0; }
input[type="checkbox"], input[type="radio"] { width: 1.05rem; height: 1.05rem; display: inline-block; margin: 0; accent-color: var(--brand); flex: none; }
input[type="file"] { padding: .35rem; }
input.num { text-align: right; min-width: 5.5rem; }
.stack { display: grid; gap: .8rem; }
.formgrid { display: grid; gap: 0; }
.formactions { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-top: .8rem; }
.check { display: flex; gap: .55rem; align-items: center; font-weight: 500; color: var(--ink); }
.check-box { border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; background: #fafbfc; align-self: end; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem; margin: .5rem 0; }
.filters, .inline-form { display: flex; gap: .7rem; align-items: flex-end; flex-wrap: wrap; margin: 0 0 1.1rem; }
.inline-form { margin: .8rem 0 0; }
.filters label, .inline-form label { flex: 0 1 190px; }
.inline-form label.grow, .filters label.grow { flex: 1 1 260px; }
.filters .btn, .inline-form .btn { margin-bottom: 1px; }
form.inline { display: inline-block; margin: 0; }
.inline-label { display: flex; gap: .5rem; align-items: center; }
.inline-label select { margin: 0; width: auto; }
.acceptform { display: grid; gap: .55rem; margin-top: .6rem; }
.js .js-optional { display: none; }

/* -------------------------------------------------------------- tables */
.tablewrap { overflow-x: auto; margin: 0 -.25rem; padding: 0 .25rem; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .6rem .6rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th.right, .table td.right { text-align: right; white-space: nowrap; }
.table th.center, .table td.center { text-align: center; }
.table thead th { font-size: .73rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 2px solid var(--line); white-space: nowrap; }
.table tbody tr:hover { background: #f8fafc; }
.table tfoot th { border-top: 2px solid var(--line); border-bottom: 0; }
.table tfoot tr.total th { font-size: 1.05rem; }
.table-compact th, .table-compact td { padding: .38rem .5rem; font-size: .86rem; }
.table .narrowcol { width: 2rem; }
.table input, .table select { margin-top: 0; }
.table-edit td input:not([type="checkbox"]) { padding: .35rem .5rem; }
.table-edit th:first-child, .table-edit td:first-child { min-width: 20rem; width: 46%; }
.table-edit td input.num { width: 6.5rem; min-width: 0; margin-left: auto; }
.grouprow th { background: #f1f4f8; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
#specificatie .grouprow th { text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--brand); border-top: 2px solid var(--gold-light); }
.grouprow-meta { display: block; font-weight: 500; font-size: .78rem; color: var(--muted); margin-top: .1rem; }
.table tr.subtotal th { background: #fafbfc; font-size: .86rem; border-bottom: 1px solid var(--line); }
/* An inactive row is tinted, not faded: its text and badges keep their full contrast (WCAG AA). */
.row-off td { background: #fafbfc; }
.row-off td strong { text-decoration: line-through; }
.row-drift { background: #fff6f5; }
.rowlink { text-decoration: none; color: inherit; display: block; }
.rowlink:hover strong { color: var(--brand); text-decoration: underline; }

/* ------------------------------------------------------------ progress */
.budget { display: flex; align-items: center; gap: .7rem; margin: .5rem 0 .9rem; }
.budget-compact { margin: 0; min-width: 150px; gap: .5rem; }
.budget-compact .bar { flex: 1 1 64px; width: 64px; min-width: 48px; }
.budget-text { font-size: .86rem; font-weight: 600; white-space: nowrap; }
.bar { appearance: none; -webkit-appearance: none; flex: 1 1 120px; height: .62rem; border: 0; border-radius: 999px; background: #e6eaf0; overflow: hidden; min-width: 70px; }
.bar::-webkit-progress-bar { background: #e6eaf0; border-radius: 999px; }
.bar::-webkit-progress-value { border-radius: 999px; background: var(--ok); }
.bar::-moz-progress-bar { border-radius: 999px; background: var(--ok); }
.bar-ok { color: var(--ok); } .bar-ok::-webkit-progress-value { background: #22a05f; } .bar-ok::-moz-progress-bar { background: #22a05f; }
.bar-warn::-webkit-progress-value { background: #e39b12; } .bar-warn::-moz-progress-bar { background: #e39b12; }
.bar-danger::-webkit-progress-value { background: #d92d20; } .bar-danger::-moz-progress-bar { background: #d92d20; }
.bar-muted::-webkit-progress-value { background: #98a2b3; } .bar-muted::-moz-progress-bar { background: #98a2b3; }

.stepper { list-style: none; display: flex; gap: .3rem; padding: 0; margin: 0 0 .6rem; flex-wrap: wrap; counter-reset: step; }
.stepper li { counter-increment: step; flex: 1 1 130px; background: #eef1f5; color: var(--muted); padding: .45rem .7rem; border-radius: 8px; font-size: .82rem; font-weight: 600; }
.stepper li::before { content: counter(step) ". "; }
.stepper li.done { background: var(--ok-bg); color: var(--ok); }
.stepper li.current { background: var(--brand); color: #fff; }
.stepper li.current.blocked { background: var(--danger); }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem 1.2rem; margin: .4rem 0 0; }
.facts div { min-width: 0; }
.facts .wide { grid-column: 1 / -1; }
.facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.facts dd { margin: .1rem 0 0; font-weight: 600; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- tabs */
[role="tablist"] { display: flex; gap: .2rem; border-bottom: 2px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
[role="tab"] {
  border: 0; background: none; padding: .6rem .9rem; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2px; display: inline-flex; gap: .4rem; align-items: center; border-radius: 6px 6px 0 0;
}
[role="tab"]:hover { color: var(--ink); background: #eef1f5; }
[role="tab"][aria-selected="true"] { color: var(--brand-dark); border-bottom-color: var(--gold); }
[role="tabpanel"] { min-width: 0; }
[role="tabpanel"][hidden] { display: none; }
.card [role="tabpanel"] > .calm:first-child { margin-top: 0; }
.subnav { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 1.1rem; position: sticky; top: 0; background: var(--bg); padding: .5rem 0; z-index: 2; }
.subnav a { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem; text-decoration: none; font-weight: 600; font-size: .86rem; color: var(--ink-soft); }
.subnav a:hover { border-color: var(--brand); color: var(--brand-dark); }
.weeknav { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ------------------------------------------------------------- drawers */
.drawer { border: 1px solid var(--line); border-radius: 8px; padding: .1rem .9rem; margin: .7rem 0; background: #fafbfc; }
.drawer > summary { cursor: pointer; font-weight: 600; padding: .55rem 0; color: var(--ink-soft); }
.drawer[open] { padding-bottom: .8rem; }
.drawer[open] > summary { margin-bottom: .3rem; }
.drawer-attention { border-color: #f1d28a; background: #fffaf0; }
.drawer-attention > summary { color: #6b4100; }
.drawer-inline { background: transparent; border: 0; padding: 0; margin: .25rem 0 0; }
.drawer-inline > summary { font-weight: 500; font-size: .84rem; padding: 0; color: var(--brand-dark); }
.plain { list-style: none; padding: 0; margin: .3rem 0; display: grid; gap: .35rem; }
.attention { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.attention li { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; border-top: 1px solid #f1e2b8; padding-top: .45rem; }
.attention-danger { font-weight: 600; }

/* -------------------------------------------------------------- thread */
.thread { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; }
.msg { border: 1px solid var(--line); border-radius: 10px; padding: .65rem .85rem; background: #fff; max-width: 780px; }
.msg-mine { background: var(--gold-soft); border-color: #ead7ad; margin-left: auto; width: 100%; }
.msg-system { background: #f6f7f9; border-style: dashed; color: var(--ink-soft); font-size: .88rem; }
.msg-head { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .2rem; }
.msg-head time { color: var(--muted); font-size: .8rem; margin-left: auto; }

/* -------------------------------------------------------- offers/inbox */
.offer { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 1rem 1.15rem; margin-bottom: .9rem; box-shadow: var(--shadow); }
.offer header { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.offer h3 { margin: 0 0 .15rem; font-size: 1.05rem; }
.offer-facts { display: flex; gap: 1.4rem; }
.offer-facts span { display: flex; flex-direction: column; }
.offer-facts small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.inbox-item { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.inbox-item:last-child { border-bottom: 0; }
.inbox-main { flex: 1 1 380px; min-width: 0; }
.inbox-main p { margin: .2rem 0; color: var(--ink-soft); }
.inbox-actions { display: flex; flex-direction: column; gap: .4rem; align-items: flex-end; }
.inbox-actions form { display: flex; gap: .4rem; align-items: center; margin: 0; }
.inbox-actions input.num { width: 6rem; margin: 0; padding: .28rem .5rem; }
.worklist { list-style: none; padding: 0; margin: 0; }
.worklist li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.worklist li:last-child { border-bottom: 0; }
.worklist-meta { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.steps { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.stepform { display: flex; gap: .6rem; align-items: flex-end; margin: 0; flex-wrap: wrap; }
.stepform label { min-width: 260px; }
.decide { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-top: .8rem; }
.decide-form { border: 1px solid var(--line); border-radius: 8px; padding: .8rem; display: grid; gap: .6rem; align-content: start; background: #fafbfc; margin: 0; }

/* --------------------------------------------------------------- login */
.login-wrap { min-height: 100vh; display: flex; gap: 1.5rem; align-items: flex-start; justify-content: center; flex-wrap: wrap; padding: 8vh 1.2rem 3rem;
  background: radial-gradient(1200px 500px at 15% -10%, #d9f1ed 0, transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 420px; padding: 1.6rem 1.7rem; margin: 0; }
.login-card h1 { margin-bottom: 1rem; }
.demo-list { display: grid; gap: .45rem; margin-top: .8rem; }
.demo-list form { margin: 0; }
.demo-btn { width: 100%; display: grid; grid-template-columns: auto 1fr; gap: .1rem .7rem; align-items: center; text-align: left; border: 1px solid var(--line);
  background: #fafbfc; border-radius: 8px; padding: .55rem .7rem; cursor: pointer; font: inherit; color: var(--ink); }
.demo-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.demo-btn .badge { grid-row: span 2; }
.demo-btn small { color: var(--muted); }
body.public .flashes { position: absolute; top: 1rem; left: 50%; transform: translateX(-50%); width: min(92vw, 560px); z-index: 3; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  body.app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; }
  .mainnav { flex-direction: row; flex-wrap: wrap; }
  .navsep { display: none; }
  .whoami { margin-top: 0; }
  .main { padding: 1.1rem 1rem 2.5rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .inbox-actions { align-items: flex-start; }
}
@media print {
  .sidebar, .actions, .subnav, .filters, .btn { display: none !important; }
  body.app { display: block; }
}

/* ------------------------------------------------------------ meldingen & ongelezen */
.js .nojs-only { display: none; }
.count-unread { background: var(--danger); color: #fff; }
.mainnav-secondary { margin-top: auto; }
.popups { position: fixed; right: 1rem; bottom: 1rem; z-index: 20; display: grid; gap: .5rem; width: min(92vw, 380px); }
.popups.is-hidden { display: none; }
.popup { display: flex; align-items: flex-start; gap: .25rem; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(16, 35, 63, .18); padding: .35rem; }
.popup-open { flex: 1; margin: 0; }
.popup-body { all: unset; cursor: pointer; display: block; padding: .4rem .5rem; color: var(--ink); line-height: 1.35; }
.popup-body:focus-visible, .popup-close:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.popup-kind { display: block; font-size: .75rem; font-weight: 700; color: var(--gold-dark); text-transform: uppercase; letter-spacing: .03em; }
.popup-close { background: none; border: 0; font-size: 1.3rem; line-height: 1; color: var(--muted); cursor: pointer; padding: .25rem .45rem; }
.notelist { list-style: none; margin: 0; padding: 0; }
.notelist li { padding: .6rem 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }
.notelist form { margin: 0; }
.notelink { text-align: left; color: var(--ink); }
.note-unread .notelink { font-weight: 600; }
.pointlist { margin: 0 0 .8rem; padding-left: 1.2rem; }
.pointlist li { margin: .15rem 0; }
@media (max-width: 640px) { .popups { right: .5rem; left: .5rem; width: auto; } }
.login-card-wide { max-width: 680px; }
fieldset.subtle { border: 1px dashed var(--line); border-radius: var(--radius); padding: .75rem 1rem; margin: 0; }
fieldset.subtle legend { font-weight: 600; padding: 0 .35rem; color: var(--ink-soft); }
.popup-more { justify-self: end; font-size: .85rem; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .7rem; box-shadow: var(--shadow); color: var(--brand); }
.kpi-amount { margin: .8rem 0 0; font-size: 1.05rem; }

/* ------------------------------------------------------------ teamportaal */
.voortgang { display: inline-flex; align-items: center; gap: .45rem; min-width: 120px; }
.voortgang .bar { flex: 1 1 60px; width: 60px; min-width: 48px; }
.voortgang strong { font-size: .9rem; font-variant-numeric: tabular-nums; min-width: 2.8em; text-align: right; }
.offer-facts .voortgang { display: inline-flex; flex-direction: row; }
.mv-total { display: inline-flex; align-items: center; gap: .55rem; }
.mv-total .bar { flex: 0 0 110px; width: 110px; min-width: 0; }
.mv-list { list-style: none; margin: .3rem 0 0; padding: 0; }
.mv-list li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(170px, 1fr) minmax(0, 1fr); gap: .35rem 1rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.mv-list li:last-child { border-bottom: 0; }
.mv-list a { min-width: 0; overflow-wrap: anywhere; }
.mv-bar { display: flex; align-items: center; gap: .55rem; }
.mv-bar .bar { height: .8rem; }
.mv-bar strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mv-note { color: var(--ink-soft); font-size: .9rem; }
@media (max-width: 860px) { .mv-list li { grid-template-columns: 1fr; } }
.suggestions { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .45rem; }
.suggestions li { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem; background: #fafbfc; }
.suggestions .inline-form { justify-content: space-between; align-items: center; margin: 0; }

/* ------------------------------------------------------------ beveiliging (2FA) */
.setup-steps { margin: .4rem 0 1rem; padding-left: 1.3rem; display: grid; gap: .55rem; }
.qr { display: block; width: 240px; max-width: 100%; height: auto; margin: .6rem 0 .2rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.secret-key { display: inline-block; margin-top: .3rem; letter-spacing: .08em; word-break: break-all; }
.recovery-codes { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.recovery-codes code { display: block; text-align: center; padding: .45rem .5rem; font-size: 1rem; letter-spacing: .06em; }
.who-actions { flex-wrap: wrap; row-gap: .35rem; }

/* ------------------------------------------------------------ platformbeheer (neutraal, geen huisstijl van een organisatie) */
body.platform {
  --brand: #1e293b; --brand-dark: #0f172a; --brand-soft: #f1f5f9;
  --side: #1e293b; --side-soft: #334155;
  --gold: #cbd5e1; --gold-light: #e2e8f0; --gold-dark: #475569; --gold-soft: #f1f5f9;
}
body.platform .login-wrap { background: var(--bg); }
.stepwrap { display: block; }
.fieldlabel { display: block; font-weight: 600; font-size: .88rem; color: var(--ink-soft); }
label .hint { display: block; font-weight: 400; }
.enroll { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin: .8rem 0 1rem; }
.enroll .qr { width: 200px; height: 200px; margin: 0; flex: none; }
.codes { list-style: none; padding: 0; margin: .8rem 0 1.2rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.codes code { display: block; text-align: center; font-size: 1rem; padding: .4rem; }
.logo-preview { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: .8rem; }
.logo-preview img { max-width: 180px; max-height: 76px; height: auto; border: 1px solid var(--line); border-radius: 6px; padding: .3rem; background: #fff; }

/* ------------------------------------------------------------ AVG: verwijderen per kantoor */
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #8a1c13; border-color: #8a1c13; color: #fff; }
.danger-zone { border: 1px solid #f3b6b0; border-radius: 8px; padding: .8rem 1rem; margin-top: 1rem; background: #fffafa; }
.danger-zone h3 { margin-top: 0; color: #8a1c13; }

/* ------------------------------------------------------------ alleen-inzage documentviewer */
.viewer-print-note { display: none; }
.viewer-toolbar, .viewer-sheets { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 .8rem; }
.viewer-pageinfo { font-weight: 600; color: var(--ink-soft); min-width: 8.5rem; text-align: center; }
.viewer-zoom { display: inline-flex; gap: .3rem; margin-left: auto; }
.btn.is-disabled { opacity: .45; pointer-events: none; }
.viewer-stage { overflow: auto; max-height: 80vh; background: #e9edf2; border: 1px solid var(--line); border-radius: 8px; padding: .6rem; text-align: center; }
.viewer-canvas, .viewer-image { display: block; margin: 0 auto; height: auto; background: #fff; box-shadow: 0 1px 4px rgba(13, 27, 48, .18); }
.zoom-50 { width: 50%; } .zoom-75 { width: 75%; } .zoom-100 { width: 100%; max-width: 1000px; }
.zoom-125 { width: 125%; max-width: none; } .zoom-150 { width: 150%; max-width: none; } .zoom-200 { width: 200%; max-width: none; }
.viewer-image { max-width: 100%; }
.viewer-sheet { position: relative; overflow: hidden; contain: paint; }
.viewer-statusbar { display: flex; align-items: center; gap: .4rem; margin: 0 0 .7rem; padding: .3rem .7rem; border: 1px solid var(--line);
  border-radius: 6px; background: #f8fafc; color: var(--ink-soft); font-size: .84rem; line-height: 1.4; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.viewer-para { white-space: pre-wrap; overflow-wrap: anywhere; }
.viewer-table td { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 28rem; vertical-align: top; }
.viewer-watermark { position: absolute; inset: -20%; display: flex; flex-wrap: wrap; align-content: space-around; justify-content: space-around;
  gap: 3rem 4rem; transform: rotate(-30deg); pointer-events: none; z-index: 2; }
.viewer-watermark span { color: rgba(15, 23, 42, .065); font-weight: 700; font-size: .95rem; white-space: nowrap; user-select: none; }
.viewer-protect, .viewer-protect * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media print {
  .viewer-protect { display: none !important; }
  .viewer-print-note { display: block; }
}

/* WP1 toegangspoort */
.input-short { max-width: 6rem; }
.gate-step + .gate-step { margin-top: .75rem; }
.gate-actions { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }

/* WP3 contracten: progressive disclosure */
.disclosure { border-top: 1px solid var(--line, #d9dee3); padding: .5rem 0; }
.disclosure > summary { cursor: pointer; font-weight: 600; }
.disclosure > form { margin-top: .75rem; }

/* WP8 kopiëren zonder mailserver */
.copyrow { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; }
.copybox textarea { width: 100%; font-family: inherit; }

/* WP2 onboarding-checklist */
.checklist-progress { width: 100%; height: .6rem; margin: .25rem 0 .75rem; accent-color: var(--ok, #1a7f37); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist-step { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-top: 1px solid var(--line, #d9dee3); }
.checklist-step.is-done .checklist-label::before { content: "\2713  "; color: #1a7f37; font-weight: 700; }
.checklist-step.is-open .checklist-label::before { content: "\25CB  "; color: #57606a; }
.checklist-state { color: #3d444d; white-space: nowrap; }
.copy-scratch { position: fixed; top: 0; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.register-table thead th { white-space: normal; }
.register-table td { overflow-wrap: anywhere; }
@media (max-width: 1100px) { .register-table th, .register-table td { padding: .3rem .35rem; } }
