/* =========================================================================
   ASSE DESIGNSYSTEEM — v1.0
   Basislaag voor digitale toepassingen van de gemeente Asse.
   Bevat uitsluitend generieke tokens en componenten (geen toepassings-
   specifieke regels), zodat dit bestand ongewijzigd hergebruikt kan worden.

   Naamgeving: ds-<component>[__deel][--variant]
   Tokens:     --color-*, --font-*, --text-*, --space-*, --radius-*,
               --shadow-*, --border-*, --z-*, --motion-*
   ========================================================================= */

/* ------------------------------------------------------------------ 1. Tokens */
:root {
  color-scheme: light dark;

  /* Merkkleur — afgeleid van de huisstijl van de gemeente Asse (#247fa0) */
  --color-primary-50:  #f1f8fb;
  --color-primary-100: #dcedf4;
  --color-primary-200: #b5dae8;
  --color-primary-300: #7cc0d6;
  --color-primary-400: #41a0be;
  --color-primary-500: #247fa0;
  --color-primary-600: #1b6480;  /* tekst/links op wit — AA */
  --color-primary-700: #17526a;
  --color-primary-800: #143f52;
  --color-primary-900: #10303d;

  /* Eén accentkleur, warm, spaarzaam te gebruiken */
  --color-accent-100: #fdf0df;
  --color-accent-300: #f3bd77;
  --color-accent-500: #d4770f;
  --color-accent-600: #a95c06;

  /* Neutralen */
  --color-neutral-0:   #ffffff;
  --color-neutral-25:  #fafbfc;
  --color-neutral-50:  #f4f6f8;
  --color-neutral-100: #e9edf1;
  --color-neutral-200: #dde3e9;
  --color-neutral-300: #c3ccd5;
  --color-neutral-400: #97a3b0;
  --color-neutral-500: #6b7783;
  --color-neutral-600: #515c68;
  --color-neutral-700: #3b444e;
  --color-neutral-800: #262d35;
  --color-neutral-900: #151a20;

  /* Status */
  --color-success-100: #dcf0e6;
  --color-success-500: #17805a;
  --color-success-700: #0f5f43;
  --color-warning-100: #fbeed6;
  --color-warning-500: #8a5b00;
  --color-warning-700: #6d4800;
  --color-danger-100:  #fbe2e0;
  --color-danger-500:  #b02a20;
  --color-danger-700:  #8b1f18;
  --color-info-100:    var(--color-primary-100);
  --color-info-500:    var(--color-primary-600);

  /* Rollen — gebruik in toepassingen altijd deze, nooit de schalen hierboven */
  --primary:        var(--color-primary-600);
  --primary-hover:  var(--color-primary-700);
  --primary-soft:   var(--color-primary-50);
  --primary-border: var(--color-primary-200);
  --on-primary:     #ffffff;
  --accent:         var(--color-accent-600);
  --accent-soft:    var(--color-accent-100);

  --canvas:       var(--color-neutral-50);
  --surface:      var(--color-neutral-0);
  --surface-sunk: var(--color-neutral-25);
  --surface-alt:  var(--color-neutral-50);

  --text:         var(--color-neutral-900);
  --text-muted:   var(--color-neutral-600);
  --text-subtle:  var(--color-neutral-500);
  --text-on-dark: #ffffff;

  --border:        var(--color-neutral-200);
  --border-strong: var(--color-neutral-300);

  --success: var(--color-success-500);
  --warning: var(--color-warning-500);
  --danger:  var(--color-danger-500);

  /* Typografie */
  --font-sans: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --text-xs:   0.75rem;    /* 12 */
  --text-sm:   0.8125rem;  /* 13 */
  --text-base: 0.9375rem;  /* 15 */
  --text-md:   1.0625rem;  /* 17 */
  --text-lg:   1.375rem;   /* 22 */
  --text-xl:   1.75rem;    /* 28 */
  --text-2xl:  2.25rem;    /* 36 */
  --leading-tight: 1.2;
  --leading-normal: 1.55;
  --tracking-caps: .06em;

  /* Ruimte — 4-punts schaal */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;

  /* Vorm */
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 16px; --radius-pill: 999px;
  --border-width: 1px;

  /* Schaduw — subtiel */
  --shadow-sm: 0 1px 2px rgba(21,26,32,.06);
  --shadow-md: 0 1px 2px rgba(21,26,32,.05), 0 6px 16px -10px rgba(21,26,32,.25);
  --shadow-lg: 0 2px 4px rgba(21,26,32,.06), 0 18px 40px -18px rgba(21,26,32,.35);

  /* Lagen */
  --z-sticky: 20; --z-nav: 30; --z-overlay: 40; --z-toast: 50;

  /* Beweging */
  --motion-fast: 120ms; --motion-base: 200ms;
  --ease: cubic-bezier(.2,0,.2,1);

  /* Aanraakvlak (WCAG 2.2 — 2.5.8) */
  --target-min: 44px;
}

/* Donkere modus: dezelfde rollen, andere waarden */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary:        var(--color-primary-300);
    --primary-hover:  var(--color-primary-200);
    --primary-soft:   #12242c;
    --primary-border: #1d3d4a;
    --on-primary:     #06222c;
    --accent:         var(--color-accent-300);
    --accent-soft:    #33240f;

    --canvas:       #0e1216;
    --surface:      #161b21;
    --surface-sunk: #11161b;
    --surface-alt:  #1d242b;

    --text:        #eef2f5;
    --text-muted:  #b2bcc6;
    --text-subtle: #8c97a2;

    --border:        #2a323b;
    --border-strong: #3a444f;

    --success: #4cbb8b;
    --warning: #e0aa4e;
    --danger:  #ef8079;

    --color-success-100: #143026;
    --color-warning-100: #332814;
    --color-danger-100:  #331d1b;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
    --shadow-md: 0 1px 2px rgba(0,0,0,.45), 0 8px 20px -12px rgba(0,0,0,.8);
    --shadow-lg: 0 2px 6px rgba(0,0,0,.5), 0 22px 44px -20px rgba(0,0,0,.9);
  }
}
:root[data-theme="dark"] {
  --primary: var(--color-primary-300); --primary-hover: var(--color-primary-200);
  --primary-soft: #12242c; --primary-border: #1d3d4a; --on-primary: #06222c;
  --accent: var(--color-accent-300); --accent-soft: #33240f;
  --canvas: #0e1216; --surface: #161b21; --surface-sunk: #11161b; --surface-alt: #1d242b;
  --text: #eef2f5; --text-muted: #b2bcc6; --text-subtle: #8c97a2;
  --border: #2a323b; --border-strong: #3a444f;
  --success: #4cbb8b; --warning: #e0aa4e; --danger: #ef8079;
  --color-success-100: #143026; --color-warning-100: #332814; --color-danger-100: #331d1b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
  --shadow-md: 0 1px 2px rgba(0,0,0,.45), 0 8px 20px -12px rgba(0,0,0,.8);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.5), 0 22px 44px -20px rgba(0,0,0,.9);
}

/* ------------------------------------------------------------------ 2. Basis */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-synthesis-weight: none;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: var(--leading-tight); text-wrap: balance; }
h1 { font-size: var(--text-lg); }
h2 { font-size: var(--text-md); }
h3 { font-size: var(--text-base); }
p  { margin: 0; }
img, svg, canvas { max-width: 100%; }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
::selection { background: var(--primary-soft); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* Alleen voor schermlezers */
.ds-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ds-skip {
  position: absolute; left: var(--space-3); top: -60px; z-index: var(--z-toast);
  background: var(--surface); color: var(--text); padding: var(--space-2) var(--space-4);
  border: var(--border-width) solid var(--border-strong); border-radius: var(--radius-sm);
  transition: top var(--motion-fast) var(--ease);
}
.ds-skip:focus { top: var(--space-3); }

/* ------------------------------------------------------------------ 3. Typografie-helpers */
.ds-eyebrow {
  font-size: var(--text-xs); font-weight: 600; letter-spacing: var(--tracking-caps);
  text-transform: uppercase; color: var(--text-subtle);
}
.ds-muted  { color: var(--text-muted); }
.ds-small  { font-size: var(--text-sm); }
.ds-num    { font-variant-numeric: tabular-nums; }
.ds-mono   { font-family: var(--font-mono); font-size: var(--text-sm); }
.ds-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-break  { overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ 4. Kaart (card) */
.ds-card {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.ds-card__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  flex-wrap: wrap; padding: var(--space-4) var(--space-4) 0;
}
.ds-card__body { padding: var(--space-4); }
.ds-card__foot {
  padding: var(--space-3) var(--space-4);
  border-top: var(--border-width) solid var(--border);
  background: var(--surface-sunk);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.ds-card--flat { box-shadow: none; }

/* ------------------------------------------------------------------ 5. Knoppen */
.ds-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--target-min);
  padding: 10px var(--space-4);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-base); font-weight: 500;
  cursor: pointer; text-decoration: none;
  transition: background var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
.ds-btn:hover { background: var(--surface-alt); }
.ds-btn:active { transform: translateY(1px); }
.ds-btn[disabled], .ds-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.ds-btn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.ds-btn--primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.ds-btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.ds-btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.ds-btn--danger:hover { filter: brightness(.93); }
.ds-btn--ghost { background: transparent; border-color: transparent; color: var(--primary); }
.ds-btn--ghost:hover { background: var(--primary-soft); }
.ds-btn--sm { min-height: 40px; padding: 6px var(--space-3); font-size: var(--text-sm); }
.ds-btn--lg { min-height: 52px; padding: 14px var(--space-5); font-size: var(--text-md); font-weight: 600; }
.ds-btn--block { width: 100%; }
.ds-btn-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* Icoonknop houdt het minimale aanraakvlak */
.ds-iconbtn {
  display: inline-grid; place-items: center;
  width: var(--target-min); height: var(--target-min);
  border: 0; background: transparent; color: var(--text-muted);
  border-radius: var(--radius-sm); cursor: pointer;
}
.ds-iconbtn:hover { background: var(--surface-alt); color: var(--text); }
.ds-iconbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ 6. Formulieren */
.ds-field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.ds-label { font-size: var(--text-sm); font-weight: 600; color: var(--text); }
.ds-hint  { font-size: var(--text-xs); color: var(--text-muted); }
.ds-input, .ds-select, .ds-textarea {
  width: 100%; min-height: var(--target-min);
  padding: 10px var(--space-3);
  background: var(--surface); color: var(--text);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
}
.ds-input::placeholder { color: var(--text-subtle); }
.ds-input:hover, .ds-select:hover { border-color: var(--color-neutral-400); }
.ds-select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7783' stroke-width='2' stroke-linecap='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
  padding-right: 34px;
}
.ds-input[aria-invalid="true"], .ds-select[aria-invalid="true"] { border-color: var(--danger); }
.ds-error { display: flex; gap: var(--space-1); font-size: var(--text-sm); color: var(--danger); font-weight: 500; }
.ds-range { width: 100%; accent-color: var(--primary); min-height: var(--target-min); }
.ds-search { position: relative; }
.ds-search .ds-input { padding-left: 38px; }
.ds-search svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; fill: none; stroke: var(--text-subtle); stroke-width: 1.8; pointer-events: none;
}
.ds-form-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* Keuzevakjes als filterknoppen */
.ds-toggle {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 40px; padding: 6px var(--space-3);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface); color: var(--text-muted);
  font-size: var(--text-sm); font-weight: 500; cursor: pointer;
}
.ds-toggle:hover { background: var(--surface-alt); }
.ds-toggle[aria-pressed="true"] {
  background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary);
}
.ds-toggle[aria-pressed="true"]::before { content: "✓"; font-weight: 700; }

/* ------------------------------------------------------------------ 7. Statuslabels — kleur nooit alleen */
.ds-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px var(--space-2); border-radius: var(--radius-pill);
  background: var(--surface-alt); color: var(--text-muted);
  border: var(--border-width) solid var(--border);
  font-size: var(--text-xs); font-weight: 600; white-space: nowrap;
}
.ds-badge__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.ds-badge--success { background: var(--color-success-100); color: var(--color-success-700); border-color: transparent; }
.ds-badge--warning { background: var(--color-warning-100); color: var(--color-warning-700); border-color: transparent; }
.ds-badge--danger  { background: var(--color-danger-100);  color: var(--color-danger-700);  border-color: transparent; }
.ds-badge--info    { background: var(--primary-soft);      color: var(--primary);           border-color: transparent; }
:root[data-theme="dark"] .ds-badge--success,
:root[data-theme="dark"] .ds-badge--warning,
:root[data-theme="dark"] .ds-badge--danger { color: var(--text); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ds-badge--success,
  :root:not([data-theme="light"]) .ds-badge--warning,
  :root:not([data-theme="light"]) .ds-badge--danger { color: var(--text); }
}

/* ------------------------------------------------------------------ 8. Kerncijfers */
.ds-stats { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ds-stat {
  background: var(--surface); border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md); padding: var(--space-4); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 2px;
}
.ds-stat__value { font-size: var(--text-xl); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.ds-stat__label { font-size: var(--text-sm); color: var(--text-muted); }
.ds-stat__note  { font-size: var(--text-xs); color: var(--text-subtle); margin-top: var(--space-1); }
.ds-stat--success .ds-stat__value { color: var(--color-success-700); }
.ds-stat--warning .ds-stat__value { color: var(--color-warning-700); }
.ds-stat--danger  .ds-stat__value { color: var(--color-danger-700); }
:root[data-theme="dark"] .ds-stat--success .ds-stat__value { color: var(--success); }
:root[data-theme="dark"] .ds-stat--warning .ds-stat__value { color: var(--warning); }
:root[data-theme="dark"] .ds-stat--danger  .ds-stat__value { color: var(--danger); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ds-stat--success .ds-stat__value { color: var(--success); }
  :root:not([data-theme="light"]) .ds-stat--warning .ds-stat__value { color: var(--warning); }
  :root:not([data-theme="light"]) .ds-stat--danger  .ds-stat__value { color: var(--danger); }
}

/* ------------------------------------------------------------------ 9. Grafieken (CSS, geen bibliotheek) */
.ds-chart { display: flex; flex-direction: column; gap: var(--space-3); }
.ds-chart__row { display: grid; grid-template-columns: minmax(84px, 26%) 1fr auto; align-items: center; gap: var(--space-3); }
.ds-chart__key { font-size: var(--text-sm); font-weight: 500; }
.ds-chart__track { height: 10px; background: var(--surface-alt); border-radius: var(--radius-pill); overflow: hidden; }
.ds-chart__fill { display: block; height: 100%; background: var(--primary); border-radius: inherit; transition: width var(--motion-base) var(--ease); }
.ds-chart__fill--success { background: var(--success); }
.ds-chart__fill--warning { background: var(--warning); }
.ds-chart__fill--danger  { background: var(--danger); }
.ds-chart__val { font-size: var(--text-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }

.ds-progress { height: 10px; border-radius: var(--radius-pill); background: var(--surface-alt); overflow: hidden; border: var(--border-width) solid var(--border); }
.ds-progress__fill { display: block; height: 100%; width: 0; background: var(--primary); transition: width var(--motion-base) var(--ease); }

.ds-legend { display: flex; flex-wrap: wrap; gap: var(--space-3); font-size: var(--text-sm); color: var(--text-muted); }
.ds-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ds-legend i { width: 10px; height: 10px; border-radius: 50%; display: block; flex: none; }

/* ------------------------------------------------------------------ 10. Tabellen */
.ds-tablewrap { overflow-x: auto; border-radius: var(--radius-md); }
.ds-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.ds-table th {
  text-align: left; font-size: var(--text-xs); font-weight: 700;
  letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-subtle);
  padding: var(--space-2) var(--space-3); border-bottom: var(--border-width) solid var(--border-strong);
  white-space: nowrap; background: var(--surface);
}
.ds-table td { padding: var(--space-3); border-bottom: var(--border-width) solid var(--border); vertical-align: top; }
.ds-table tbody tr:hover { background: var(--surface-sunk); }
.ds-table__sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; text-transform: inherit; letter-spacing: inherit; }
.ds-table__sort[aria-sort="ascending"]::after  { content: "▲"; font-size: 8px; }
.ds-table__sort[aria-sort="descending"]::after { content: "▼"; font-size: 8px; }

/* Op smalle schermen wordt elke rij een kaartje met labels ervoor */
@media (max-width: 720px) {
  .ds-table--stack thead { display: none; }
  .ds-table--stack tr {
    display: block; border: var(--border-width) solid var(--border);
    border-radius: var(--radius-md); margin-bottom: var(--space-2); background: var(--surface);
  }
  .ds-table--stack td { display: grid; grid-template-columns: 38% 1fr; gap: var(--space-3); border: 0; padding: var(--space-2) var(--space-3); }
  .ds-table--stack td::before { content: attr(data-label); font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-subtle); }
  .ds-table--stack td + td { border-top: var(--border-width) solid var(--border); }
}

/* ------------------------------------------------------------------ 11. Lijst met rijen die aanklikbaar zijn */
.ds-rows { display: flex; flex-direction: column; gap: var(--space-2); }
.ds-row {
  display: flex; gap: var(--space-3); align-items: flex-start; width: 100%; text-align: left;
  background: var(--surface); border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md); padding: var(--space-3); cursor: pointer;
  transition: border-color var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.ds-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.ds-row__rail { width: 4px; align-self: stretch; border-radius: var(--radius-pill); background: var(--border-strong); flex: none; }
.ds-row__rail--success { background: var(--success); }
.ds-row__rail--warning { background: var(--warning); }
.ds-row__rail--danger  { background: var(--danger); }
.ds-row__media { width: 84px; height: 58px; flex: none; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-alt); border: var(--border-width) solid var(--border); }
.ds-row__body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.ds-row__title { font-weight: 600; font-size: var(--text-base); }
.ds-row__meta { font-size: var(--text-xs); color: var(--text-subtle); }
.ds-row__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }

/* ------------------------------------------------------------------ 12. Paginering */
.ds-pager { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.ds-pager__info { font-size: var(--text-sm); color: var(--text-muted); }
.ds-pager__nav { display: flex; gap: var(--space-2); align-items: center; }

/* ------------------------------------------------------------------ 13. Navigatie */
.ds-nav { display: flex; flex-direction: column; gap: 2px; }
.ds-nav__item {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--target-min); padding: 0 var(--space-3);
  border: 0; background: none; color: var(--text-muted);
  border-radius: var(--radius-sm); cursor: pointer; font-size: var(--text-base); font-weight: 500; text-align: left; width: 100%;
}
.ds-nav__item:hover { background: var(--surface-alt); color: var(--text); }
.ds-nav__item svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ds-nav__item[aria-selected="true"] {
  background: var(--primary-soft); color: var(--primary); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary);
}
.ds-nav__count { margin-left: auto; font-size: var(--text-xs); font-variant-numeric: tabular-nums; color: var(--text-subtle); }

.ds-tabbar {
  position: fixed; inset: auto 0 0 0; display: flex; z-index: var(--z-nav);
  background: var(--surface); border-top: var(--border-width) solid var(--border);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
}
.ds-tabbar__item {
  flex: 1; min-height: var(--target-min); border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--text-subtle); font-size: 10.5px; font-weight: 600; border-radius: var(--radius-sm); padding: 4px 2px;
}
.ds-tabbar__item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ds-tabbar__item[aria-selected="true"] { color: var(--primary); background: var(--primary-soft); }

/* ------------------------------------------------------------------ 14. Meldingen */
.ds-alert {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  background: var(--primary-soft); color: var(--text); font-size: var(--text-sm);
  border: var(--border-width) solid var(--primary-border);
}
.ds-alert__icon { flex: none; width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; margin-top: 1px; }
.ds-alert--warning { background: var(--color-warning-100); border-color: transparent; }
.ds-alert--danger  { background: var(--color-danger-100);  border-color: transparent; }
.ds-alert--success { background: var(--color-success-100); border-color: transparent; }
.ds-alert b { font-weight: 700; }

.ds-toast {
  position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: var(--z-toast);
  max-width: min(520px, calc(100vw - 32px));
  background: var(--color-neutral-900); color: #fff;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); font-size: var(--text-sm);
}
:root[data-theme="dark"] .ds-toast { background: var(--color-neutral-100); color: var(--color-neutral-900); }

/* ------------------------------------------------------------------ 15. Modaal venster */
.ds-modal {
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg); background: var(--surface); color: var(--text);
  padding: 0; width: min(620px, calc(100vw - 32px)); max-width: 100%;
  box-shadow: var(--shadow-lg);
}
.ds-modal::backdrop { background: rgba(10,14,18,.55); backdrop-filter: blur(2px); }
.ds-modal__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-4); border-bottom: var(--border-width) solid var(--border);
  position: sticky; top: 0; background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.ds-modal__body { padding: var(--space-4); max-height: min(70vh, 640px); overflow: auto; display: flex; flex-direction: column; gap: var(--space-3); }
@media (max-width: 600px) {
  .ds-modal { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}

/* Definitielijst voor detailgegevens */
.ds-dl { display: grid; grid-template-columns: minmax(96px, 30%) 1fr; gap: var(--space-2) var(--space-3); font-size: var(--text-sm); margin: 0; }
.ds-dl dt { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-subtle); }
.ds-dl dd { margin: 0; }

/* ------------------------------------------------------------------ 16. Lege, ladende en foutstatus */
.ds-empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  text-align: center; padding: var(--space-6) var(--space-4); color: var(--text-muted);
}
.ds-empty svg { width: 40px; height: 40px; stroke: var(--border-strong); fill: none; stroke-width: 1.4; }
.ds-empty h3 { color: var(--text); }

.ds-skeleton {
  background: linear-gradient(90deg, var(--surface-alt) 25%, var(--surface-sunk) 37%, var(--surface-alt) 63%);
  background-size: 400% 100%; border-radius: var(--radius-sm);
  animation: ds-shimmer 1.4s ease infinite; min-height: 14px;
}
@keyframes ds-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.ds-spinner {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2px solid var(--border-strong); border-top-color: var(--primary);
  animation: ds-spin .8s linear infinite;
}
@keyframes ds-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ 17. Lay-outhelpers */
.ds-stack   { display: flex; flex-direction: column; gap: var(--space-4); }
.ds-stack--tight { gap: var(--space-2); }
.ds-cluster { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.ds-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.ds-grid-2  { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
.ds-divider { height: var(--border-width); background: var(--border); border: 0; margin: 0; }
