/* Rustig — componentstijlen. Alleen tokens (var(--…)); geen vaste kleurwaarden. */

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1.0625rem/1.6 var(--font-sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; margin: 0 0 4px; color: var(--text); }
/* Koppen volgens Rivsenn: serif, gewicht 500, ruime schaal */
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.12; }
h2 { font-size: 1.35rem; line-height: 1.2; }
h3 { font-size: 1.15rem; line-height: 1.25; }
p { margin: 0; }
a { color: var(--accent-text); }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--font-mono); font-size: 0.9688rem; }
code { background: var(--surface-sunken); padding: 1px 6px; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
svg.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg.icon.sm { width: 16px; height: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.positive { color: var(--success); }
.negative { color: var(--danger); }
.zero { color: var(--text-faint); }
.divider { height: 1px; background: var(--border); margin: 22px 0; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.cluster { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spacer { flex: 1; }
@keyframes rs-spin { to { transform: rotate(360deg); } }
@keyframes rs-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Merk ---------- */
.logo { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--surface); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; font-size: 1.2188rem; flex-shrink: 0; }
.logo.xs { width: 26px; height: 26px; border-radius: 8px; font-size: 1.0625rem; }
.logo.lg { width: 36px; height: 36px; border-radius: 10px; font-size: 1.4062rem; }
.logo.xl { width: 56px; height: 56px; border-radius: 16px; font-size: 2.125rem; }
.logo.pulse { animation: rs-pulse 1.4s ease-in-out infinite; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; letter-spacing: -0.02em; }

/* ---------- Scrollbalken: dun en rustig ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 100px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--border-control); background-clip: content-box; }

/* ---------- App-shell ---------- */
.layout { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); }
.page { width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 22px 20px 40px; flex: 1; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-header .sub { font-size: 0.9688rem; color: var(--text-muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.sidebar { display: none; flex-direction: column; gap: 2px; width: var(--sidebar-w); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: var(--z-sticky); background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 12px 10px 16px; }
.topbar .brand { padding: 0; font-size: 1.125rem; }
.appbar { display: none; align-items: center; gap: 12px; position: sticky; top: 0; z-index: var(--z-sticky); background: var(--bg); border-bottom: 1px solid var(--border); padding: 12px 40px; }
.appbar .searchbar { flex: 1; max-width: 460px; }
.bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-nav); background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); min-height: var(--nav-h); }
.bottom-nav a, .bottom-nav button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px; background: transparent; border: 0; border-radius: 8px; font-size: 0.7812rem; font-weight: 500; line-height: 1rem; color: var(--text-muted); text-decoration: none; text-align: center; cursor: pointer; }
.bottom-nav .active { color: var(--accent-text); }
.bottom-nav .active .icon { stroke: var(--accent-strong); }
.app-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding: 16px 20px; border-top: 1px solid var(--border); font-size: 0.875rem; color: var(--text-muted); }
.app-footer a { color: var(--text-muted); }

@media (min-width: 1024px) {
  .sidebar { display: flex; }
  .topbar, .bottom-nav { display: none; }
  .appbar { display: flex; }
  .main { padding-bottom: 0; }
  .page { max-width: var(--page-max-lg); padding: 34px 40px 50px; }
  .app-footer { padding: 16px 40px; }
}
.layout.is-desktop .sidebar { display: flex; }
.layout.is-desktop .topbar, .layout.is-desktop .bottom-nav { display: none; }
.layout.is-desktop .appbar { display: flex; }
.layout.is-desktop .main { padding-bottom: 0; }
.layout.is-mobile .sidebar, .layout.is-mobile .appbar { display: none; }
.layout.is-mobile .topbar, .layout.is-mobile .bottom-nav { display: flex; }
.layout.is-mobile .main { padding-bottom: calc(var(--nav-h) + 12px); }
.layout.is-mobile .page { max-width: var(--page-max); padding: 22px 20px 40px; }

.nav-link { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); font-size: 1rem; font-weight: 400; line-height: 1.4062rem; text-decoration: none; text-align: left; cursor: pointer; min-height: var(--touch); transition: background .15s, color .15s; }
.nav-link:hover { background: var(--bg-alt); color: var(--text); }
.nav-link.active, .nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.nav-link .count { margin-left: auto; padding: 0 7px; border-radius: 100px; background: var(--surface); border: 1px solid var(--border); font-size: 0.8125rem; font-weight: 600; line-height: 1.2812rem; color: var(--text-muted); }
.nav-link.active .count { color: var(--accent-text); }
.nav-link .chev { margin-left: auto; transition: transform .15s; }
.nav-link[aria-expanded="true"] .chev { transform: rotate(180deg); }
.nav-section { padding: 18px 12px 6px; font-size: 0.75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 6px 21px; padding-left: 10px; border-left: 1px solid var(--border-strong); }
.nav-sub .nav-link { padding: 7px 10px; font-size: 0.9688rem; min-height: 36px; }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.sidebar-foot .who { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 2px 12px 6px; min-width: 0; font-size: 0.9062rem; color: var(--text-faint); }
.sidebar-foot .email { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-toggle { margin-bottom: 4px; }
.sidebar, .nav-drawer { scrollbar-width: none; }
.sidebar::-webkit-scrollbar, .nav-drawer::-webkit-scrollbar { display: none; }
.sidebar { transition: width .2s ease; }
.sidebar.is-collapsed { width: var(--sidebar-w-collapsed); padding-left: 10px; padding-right: 10px; }
.sidebar.is-collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar.is-collapsed .brand-name, .sidebar.is-collapsed .nav-label, .sidebar.is-collapsed .nav-section, .sidebar.is-collapsed .count, .sidebar.is-collapsed .chev, .sidebar.is-collapsed .nav-sub, .sidebar.is-collapsed .sidebar-foot .who { display: none; }
.sidebar.is-collapsed .nav-link { justify-content: center; padding-left: 0; padding-right: 0; }
.nav-drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 86%); z-index: var(--z-modal); background: var(--surface); border-right: 1px solid var(--border); box-shadow: var(--shadow); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }

.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 0.9062rem; color: var(--text-muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 600; }
.breadcrumb .icon { width: 14px; height: 14px; color: var(--text-faint); }
.back-link { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px 8px 6px; margin: 0 0 10px -6px; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); font-size: 1rem; font-weight: 500; text-decoration: none; cursor: pointer; min-height: var(--touch); }
.back-link:hover { background: var(--surface-sunken); color: var(--text); }

/* ---------- Kaarten ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); min-width: 0; }
.card h2, .card h3 { font-size: 1.15rem; line-height: 1.25; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-header h2, .card-header h3 { margin: 0; }
.card-footer { display: flex; justify-content: flex-end; gap: 8px; margin: 16px -20px -18px; padding: 12px 20px; border-top: 1px solid var(--border); }
.clickable-card { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.clickable-card:hover { border-color: var(--accent-strong); box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 20px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.stat-label { font-size: 0.875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.stat-value { font-family: var(--font-display); font-size: 1.8438rem; line-height: 2.2812rem; font-weight: 500; letter-spacing: -0.02em; margin-top: 4px; }
.stat-value.hero { font-size: 2.2812rem; line-height: 2.5625rem; }
.stat-sub { font-size: 0.875rem; color: var(--text-faint); margin-top: 4px; }
.stat-sub-row { display: flex; justify-content: space-between; gap: 12px; font-size: 0.875rem; color: var(--text-faint); }
.stat-sub-row > :last-child { text-align: right; }
.section-title { font-size: 0.9062rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); margin: 28px 0 12px; }
.kv { display: flex; flex-direction: column; }
.kv .row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 0.9688rem; }
.kv .row:first-child { border-top: 0; }
.kv .row > :first-child { color: var(--text-muted); }
.kv .row > :last-child { font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Knoppen ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; min-height: var(--touch); border-radius: 8px; border: 1px solid transparent; font-size: 1rem; font-weight: 600; line-height: 1.4062rem; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, opacity .15s; }
.btn-primary { background: var(--accent-strong); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: var(--surface-sunken); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { opacity: .85; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-sunken); color: var(--text); }
.btn-link { background: transparent; color: var(--accent-text); padding-left: 4px; padding-right: 4px; }
.btn-link:hover { text-decoration: underline; }
.btn-sm { padding: 6px 12px; font-size: 0.9062rem; min-height: 34px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--touch); padding: 0; position: relative; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: rs-spin .6s linear infinite; flex-shrink: 0; }
.btn-primary .spinner { border-color: var(--on-accent); border-right-color: transparent; }
.dot-badge { position: absolute; top: 8px; right: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-strong); border: 2px solid var(--surface); }
.appbar .dot-badge { border-color: var(--bg); }

/* ---------- Menu ---------- */
.menu { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; min-width: 208px; z-index: var(--z-overlay); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; min-height: var(--touch); border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 1rem; font-weight: 500; text-align: left; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-sunken); }
.menu-item .icon { color: var(--text-muted); }
.menu-item .kbd { margin-left: auto; }
.menu-item.danger, .menu-item.danger .icon { color: var(--danger); }
.menu-item[aria-checked="true"] .icon.tick { margin-left: auto; color: var(--accent-strong); }
.menu-label { padding: 8px 10px 4px; font-size: 0.8125rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.kbd { display: inline-flex; align-items: center; padding: 0 6px; min-width: 20px; height: 20px; justify-content: center; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-muted); }

/* ---------- Formulieren ---------- */
.field { margin-bottom: 16px; min-width: 0; }
.field > label, .label { display: block; margin-bottom: 6px; font-size: 0.9062rem; font-weight: 600; line-height: 1.2812rem; color: var(--text-muted); }
.hint { font-size: 0.8438rem; line-height: 1.125rem; color: var(--text-faint); margin-top: 6px; }
.field-error { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 0.875rem; line-height: 1.125rem; color: var(--danger); }
.field-error .icon { width: 16px; height: 16px; }
.input, .select, .textarea { display: block; width: 100%; min-height: var(--touch); padding: 10px 12px; border: 1px solid var(--border-control); border-radius: 8px; background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent-strong); box-shadow: 0 0 0 3px var(--accent-soft); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-sunken); color: var(--text-faint); border-color: var(--border-strong); cursor: not-allowed; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }
.field.has-error .input:focus { box-shadow: 0 0 0 3px var(--danger-soft); }
.select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer; }
.select-wrap, .input-icon { position: relative; }
.select-wrap > .icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--text-muted); }
.input-icon > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--text-faint); }
.input-icon > .input { padding-left: 38px; }
.input-icon > .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.searchbar { position: relative; }
.searchbar > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.searchbar > .input { padding-left: 38px; padding-right: 40px; background: var(--surface); }
.searchbar > .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.checkbox-row { display: flex; align-items: center; gap: 10px; min-height: 32px; font-size: 1rem; cursor: pointer; }
.checkbox-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent-strong); flex-shrink: 0; }
.choice-list { display: flex; flex-direction: column; gap: 4px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.switch-row:first-child { border-top: 0; }
.switch-row .text strong { display: block; font-size: 1rem; font-weight: 600; }
.switch-row .text span { display: block; font-size: 0.875rem; color: var(--text-muted); }
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 100px; background: var(--border-control); transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent-strong); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .55; }
.form-card { max-width: 520px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 32px; }
.form-section > .intro p { font-size: 0.9688rem; color: var(--text-muted); }
@media (min-width: 900px) { .form-section.split { grid-template-columns: 240px minmax(0, 1fr); } }
.savebar { position: sticky; bottom: var(--nav-h); margin-bottom: -12px; z-index: var(--z-nav); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; background: var(--surface); border-top: 1px solid var(--border); }
@media (min-width: 1024px) { .savebar { bottom: 0; margin-bottom: 0; padding: 12px 40px; } }
.layout.is-desktop .savebar { bottom: 0; margin-bottom: 0; padding: 12px 24px; }
.layout.is-mobile .savebar { bottom: var(--nav-h); margin-bottom: -12px; padding: 12px 20px; }

/* ---------- Status ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 100px; font-size: 0.8438rem; font-weight: 600; line-height: 1.125rem; white-space: nowrap; background: var(--surface-sunken); color: var(--text-muted); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-neutral { background: var(--surface-sunken); color: var(--text-muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 100px; background: var(--surface); color: var(--text-muted); font-size: 0.9062rem; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; }
.chip:hover { background: var(--surface-sunken); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.chip .count { font-size: 0.8125rem; opacity: .85; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.dot.success { background: var(--success); }
.dot.danger { background: var(--danger); }
.dot.warn { background: var(--warn); }
.dot.accent { background: var(--accent-strong); }
.avatar { width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; font-size: 0.875rem; font-weight: 700; flex-shrink: 0; }
.avatar.lg { width: 40px; height: 40px; border-radius: 12px; font-size: 1rem; }

.alert { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: 8px; font-size: 0.9688rem; line-height: 1.4062rem; }
.alert .icon { margin-top: 1px; }
.alert-title { font-weight: 600; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-neutral { background: var(--surface-sunken); color: var(--text-muted); }
.toast-wrap { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 26px); width: 92%; max-width: 380px; display: flex; flex-direction: column; gap: 8px; z-index: var(--z-toast); pointer-events: none; }
@media (min-width: 1024px) { .toast-wrap { bottom: 24px; } }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-radius: 100px; background: var(--text); color: var(--bg); box-shadow: var(--shadow); font-size: 0.9688rem; font-weight: 500; pointer-events: auto; animation: rs-toast-in .25s ease-out; }
.toast-success { background: var(--success); color: var(--on-solid); }
.toast-error { background: var(--danger); color: var(--on-solid); }
.toast .toast-action { margin-left: auto; padding-left: 10px; border: 0; background: transparent; color: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
@keyframes rs-toast-in { from { opacity: 0; transform: translateY(8px); } }
.toast-wrap.is-static { position: static; transform: none; width: auto; max-width: 380px; }

.progress { height: 8px; border-radius: 100px; background: var(--surface-sunken); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 100px; background: var(--accent-strong); transition: width .25s; }
.progress.success > span { background: var(--success); }
.progress.warn > span { background: var(--warn); }
.progress.danger > span { background: var(--danger); }
.progress-row { display: flex; justify-content: space-between; gap: 12px; font-size: 0.9062rem; margin-bottom: 6px; }
.progress-row span:last-child { color: var(--text-muted); font-weight: 600; }

.skeleton { display: block; height: 14px; border-radius: 6px; background: var(--border); animation: rs-pulse 1.4s ease-in-out infinite; }
.skeleton.title { height: 20px; width: 40%; }
.skeleton.block { height: 84px; border-radius: 8px; }
.skeleton.short { width: 55%; }
.skeleton-stack { display: flex; flex-direction: column; gap: 10px; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .icon-box { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 14px; background: var(--surface-sunken); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.empty-state .icon-box.danger { background: var(--danger-soft); color: var(--danger); }
.empty-state h3 { font-size: 1.125rem; margin-bottom: 4px; }
.empty-state p { font-size: 0.9688rem; max-width: 360px; margin: 0 auto 16px; }

/* ---------- Tabs, segmented, paginering, stappen ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: var(--touch); padding: 10px 14px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-muted); font-size: 1rem; font-weight: 600; white-space: nowrap; cursor: pointer; transition: color .15s, border-color .15s; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--accent-text); border-bottom-color: var(--accent-strong); }
.tab .count { padding: 0 7px; border-radius: 100px; background: var(--surface-sunken); font-size: 0.8125rem; line-height: 1.2812rem; color: var(--text-muted); }
.range-toggle { display: inline-flex; padding: 3px; gap: 2px; border-radius: 100px; background: var(--surface-sunken); }
.range-toggle button { min-height: 28px; padding: 5px 12px; border: 0; border-radius: 100px; background: transparent; color: var(--text-muted); font-size: 0.8438rem; font-weight: 600; cursor: pointer; }
.range-toggle button.active, .range-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; font-size: 0.9062rem; color: var(--text-muted); }
.pagination .pages { display: flex; gap: 6px; }
.page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: var(--touch); height: var(--touch); padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 0.9688rem; font-weight: 600; cursor: pointer; }
.page-btn:hover { background: var(--surface-sunken); }
.page-btn[aria-current="page"] { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.page-btn[disabled] { opacity: .45; cursor: not-allowed; }
.stepper { display: flex; align-items: center; }
.step { display: flex; align-items: center; gap: 10px; flex: 1; font-size: 0.9062rem; font-weight: 600; color: var(--text-muted); }
.step:last-child { flex: 0 0 auto; }
.step .num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-sunken); font-size: 0.9062rem; flex-shrink: 0; }
.step::after { content: ""; flex: 1; height: 1px; margin: 0 6px; background: var(--border-strong); }
.step:last-child::after { display: none; }
.step.done { color: var(--text); }
.step.done .num { background: var(--success-soft); color: var(--success); }
.step.current { color: var(--text); }
.step.current .num { background: var(--accent-strong); color: var(--on-accent); }
@media (max-width: 600px) { .step:not(.current) .label-text { display: none; } }

/* ---------- Tabellen en lijsten ---------- */
.table-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.table-toolbar .searchbar { flex: 1 1 220px; max-width: 360px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; min-width: 560px; border-collapse: collapse; }
th, td { padding: 11px 16px; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.9688rem; white-space: nowrap; }
th { background: var(--surface-sunken); font-size: 0.8438rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--text-muted); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.strong { font-weight: 600; }
tbody tr:hover td { background: var(--surface-sunken); }
tbody tr[aria-selected="true"] td { background: var(--accent-soft); }
th.sortable { cursor: pointer; }
th.sortable button { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: transparent; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--text); }
td.actions, th.actions { width: 1%; text-align: right; }
.log-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.log-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--surface-sunken); font-size: 0.9062rem; }
.log-item .msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.log-item time { font-size: 0.8125rem; color: var(--text-faint); white-space: nowrap; }
.activity { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); font-size: 0.9688rem; }
.activity-item:first-child { border-top: 0; }
.activity-item .body { flex: 1; min-width: 0; }
.activity-item .body strong { font-weight: 600; }
.activity-item time { display: block; margin-top: 2px; font-size: 0.8438rem; color: var(--text-faint); }

/* ---------- Grafieken ---------- */
.sparkline-wrap { margin: 10px 0 2px; }
.sparkline { display: block; width: 100%; height: 84px; overflow: visible; }
.spark-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: currentColor; }
.spark-up { color: var(--success); }
.spark-down { color: var(--danger); }
.spark-flat { color: var(--text-muted); }
.spark-brand { color: var(--accent-strong); }
.sparkline-empty { height: 84px; border-radius: 8px; background: var(--surface-sunken); display: flex; align-items: center; justify-content: center; font-size: 0.8438rem; color: var(--text-faint); }
.chart-label { font-family: var(--font-sans); font-size: 9px; fill: var(--text-faint); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 96px; }
.bar { flex: 1; min-width: 0; border-radius: 4px 4px 2px 2px; background: var(--border-control); }
.bar.current { background: var(--accent-strong); }
.bar-labels { display: flex; gap: 6px; margin-top: 6px; font-size: 0.7812rem; color: var(--text-faint); text-align: center; }
.bar-labels span { flex: 1; min-width: 0; }
.trend-meter { position: relative; height: 8px; border-radius: 100px; background: linear-gradient(90deg, var(--danger) 0%, var(--surface-sunken) 35%, var(--surface-sunken) 65%, var(--success) 100%); opacity: .85; margin: 12px 0 6px; }
.trend-meter .marker { position: absolute; top: -4px; width: 4px; height: 16px; margin-left: -2px; border-radius: 2px; background: var(--text); }
.trend-labels { display: flex; justify-content: space-between; font-size: 0.7812rem; color: var(--text-faint); }

/* ---------- Overlays ---------- */
.scrim { position: fixed; inset: 0; z-index: var(--z-modal); background: var(--scrim); display: flex; align-items: center; justify-content: center; padding: 20px; }
.scrim.is-static { position: relative; inset: auto; min-height: 280px; border-radius: var(--radius); z-index: 0; }
.modal { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.modal-head h2 { font-size: 1.35rem; line-height: 1.2; margin: 0; }
.modal-body { padding: 10px 22px 6px; font-size: 1rem; color: var(--text-muted); }
.modal-body .field { margin-top: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 16px 22px 20px; }
.modal-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--danger-soft); color: var(--danger); margin-bottom: 12px; }
@media (max-width: 600px) {
  .scrim.sheet { align-items: flex-end; padding: 0; }
  .scrim.sheet .modal { max-width: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding-bottom: env(safe-area-inset-bottom); }
}
.scrim.sheet.force .modal { max-width: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.scrim.sheet.force { align-items: flex-end; padding: 0; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 100%); z-index: var(--z-modal); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow); }
.panel.is-static { position: relative; inset: auto; height: 520px; border: 1px solid var(--border); border-radius: var(--radius-lg); z-index: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 0 20px; }
.panel-head h2 { margin: 0; font-size: 1.35rem; }
.panel-body { flex: 1; overflow-y: auto; padding: 8px 10px; }
.panel-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 10px; }
.notice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 10px; border-radius: 8px; font-size: 0.9688rem; cursor: pointer; }
.notice:hover { background: var(--surface-sunken); }
.notice .body { flex: 1; min-width: 0; }
.notice .body strong { font-weight: 600; }
.notice time { display: block; margin-top: 2px; font-size: 0.8438rem; color: var(--text-faint); }
.notice .dot { margin-top: 7px; }

/* ---------- Inloggen ---------- */
.auth-bg { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(circle at 20% 0%, var(--accent-soft), transparent 55%), var(--bg); }
.auth-card { width: 100%; max-width: 380px; padding: 36px 32px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.auth-card .brand { padding: 0 0 18px; }
.auth-card h1 { font-size: 2rem; line-height: 1.15; }
.auth-card .sub { font-size: 0.9688rem; color: var(--text-muted); margin-bottom: 20px; }
.auth-switch { margin-top: 16px; text-align: center; }

/* ---------- Toestanden om te tonen (alleen voor documentatie en tests) ---------- */
.is-focus { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.input.is-focus, .select.is-focus, .textarea.is-focus { outline: none; border-color: var(--accent-strong); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn-primary.is-hover { background: var(--accent-hover); }
.btn-secondary.is-hover { background: var(--surface-sunken); }
.btn-ghost.is-hover { background: var(--surface-sunken); color: var(--text); }
.btn-danger.is-hover { opacity: .85; }
.nav-link.is-hover { background: var(--bg-alt); color: var(--text); }
.chip.is-hover, .menu-item.is-hover, .page-btn.is-hover { background: var(--surface-sunken); }
.tab.is-hover { color: var(--text); }
.clickable-card.is-hover { border-color: var(--accent-strong); box-shadow: var(--shadow); }
.switch.is-focus { outline: none; }
.switch.is-focus .track { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.chip .icon { width: 14px; height: 14px; }

/* ---------- Voorbeeldkaders (alleen voor documentatie en tests) ---------- */
.device { position: relative; width: 390px; height: 700px; flex-shrink: 0; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 28px; background: var(--bg); }
.device .layout { height: 100%; min-height: 0; }
.device .main { height: 100%; overflow-y: auto; }
.device .bottom-nav, .device .toast-wrap, .device .scrim, .device .panel, .device .nav-drawer { position: absolute; }
.device .toast-wrap { bottom: calc(var(--nav-h) + 16px); }
.browser { position: relative; flex: 1; min-width: 0; height: 700px; overflow: hidden; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); }
.browser .layout { height: 100%; min-height: 0; }
.browser .sidebar { position: static; height: 100%; }
.browser .main { height: 100%; overflow-y: auto; }
.browser .page { padding: 24px 24px 32px; }
.browser .appbar { padding: 12px 24px; }
.browser .app-footer { padding: 14px 24px; }
.browser .scrim, .browser .panel, .browser .toast-wrap { position: absolute; }
.stage { display: flex; gap: 24px; align-items: flex-start; }
.stage-caption { font-size: 0.8438rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 8px 4px; }
