/*
  Ontwerptokens voor Stoel.
  Eén bron voor kleur, ruimte, radius, schaduw, typografie, lagen en beweging.
  Figtree, zeven grijstinten, één accent (#0584FF) en één radius van 5 px.
  Licht is de standaard. Donker via [data-theme="dark"] of via het systeem,
  tenzij de gebruiker expliciet voor licht heeft gekozen ([data-theme="light"]).
*/

:root {
  color-scheme: light;

  /* Zeven grijstinten — licht */
  --bg: #f5f5f6;
  --surface: #ffffff;
  --surface-2: #eeeff1;
  --line: #dfe0e3;
  --muted: #6b6b73;
  --ink: #1b1b1f;
  --strong: #0b0b0e;

  /* Nieuwe namen uit het ontwerp, als alias van de bestaande tokens. */
  --fill: var(--surface-2);
  --border: var(--line);
  --text: var(--ink);

  /* Eén accent: #0584FF. Voor kleine witte tekst is dat te licht (3,65:1),
     daarom een donkerder vul- en tekstvariant in dezelfde tint. */
  --accent: #0584ff;
  --accent-fill: #0071e3;
  --accent-hover: #0069d9;
  --accent-text: #005fcc;
  --accent-soft: #e7f2ff;
  --accent-fg: #ffffff;

  /* Statuskleuren — altijd samen met een icoon of tekst, nooit kleur alleen. */
  --ok: #1f7a4d;
  --ok-soft: #e6f1ea;
  --warn: #8a5a10;
  --warn-soft: #f6eee0;
  --danger: #b3261e;
  --danger-soft: #f8e8e6;

  /* Merk-tokens blijven bestaan en volgen het ene accent. */
  --brand: var(--accent-fill);
  --brand-ink: var(--accent-fg);

  /* Tekst op gevulde knoppen en meldingen */
  --on-brand: var(--accent-fg);
  --on-accent: var(--accent-fg);
  --on-ok: #ffffff;
  --on-warn: #ffffff;
  --on-danger: #ffffff;

  /* Links: accenttekst, zodat ook op de lichte achtergrond 4,5:1 gehaald wordt. */
  --link: var(--accent-text);
  --link-hover: var(--text);

  /* Overlays en subtiele effecten */
  --overlay: rgba(11, 11, 14, 0.48);
  --skeleton-shine: rgba(255, 255, 255, 0.65);
  --selection-bg: var(--accent-soft);
  --selection-ink: var(--text);

  /* Categoriekleuren — neutraal systeem: tekst is tekst, vulling is vulling. */
  --cat-knippen: var(--ink);
  --cat-knippen-soft: var(--fill);
  --cat-kleuren: var(--ink);
  --cat-kleuren-soft: var(--fill);
  --cat-nagels: var(--ink);
  --cat-nagels-soft: var(--fill);
  --cat-baard: var(--ink);
  --cat-baard-soft: var(--fill);

  /* Statuslabels: per status een tekst- en achtergrondkleur die samen 4,5:1 halen. */
  --status-gepland-text: var(--muted);
  --status-gepland-bg: var(--fill);
  --status-bevestigd-text: var(--ok);
  --status-bevestigd-bg: var(--ok-soft);
  --status-aangekomen-text: var(--accent-text);
  --status-aangekomen-bg: var(--accent-soft);
  --status-bezig-text: var(--warn);
  --status-bezig-bg: var(--warn-soft);
  --status-afgerond-text: var(--ok);
  --status-afgerond-bg: var(--ok-soft);
  --status-geannuleerd-text: var(--muted);
  --status-geannuleerd-bg: var(--fill);
  --status-no_show-text: var(--danger);
  --status-no_show-bg: var(--danger-soft);

  /* Aliassen voor de afgeronde laadtoestand van een knop. */
  --ok-rand: var(--ok);
  --ok-tekst: var(--ok);

  /* Ruimteschaal: 4 / 8 / 12 / 16 / 24 / 32 / 48 */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  /* Eén radius: 5 px. Rond blijft alleen wat van nature rond is. */
  --radius-sm: 5px;
  --radius: 5px;
  --radius-lg: 5px;
  --radius-pill: 5px;
  --r-xs: 5px;
  --r-sm: 5px;
  --r-md: 5px;
  --r-lg: 5px;
  --r-pill: 5px;
  --r: 5px;
  --r-round: 999px;

  /* Schaduwen — alleen voor zwevende lagen en de hover-lift van knoppen. */
  --shadow-sm: none;
  --shadow-md: 0 10px 28px rgba(11, 11, 14, 0.12), 0 1px 0 rgba(11, 11, 14, 0.05);
  --shadow-lg: 0 18px 48px rgba(11, 11, 14, 0.16), 0 2px 8px rgba(11, 11, 14, 0.08);
  --shadow-panel: none;
  --shadow-focus: 0 0 0 3px var(--accent-soft);
  --sh-menu: var(--shadow-md);
  --sh-lift: 0 6px 16px rgba(11, 11, 14, 0.14);

  /* Typografie */
  --font-ui: "Figtree", system-ui, sans-serif;
  --font-display: "Figtree", system-ui, sans-serif;
  --text-xs: 13px;
  --text-sm: 14px;
  --text-md: 16px;
  --text-base: var(--text-md);
  --text-lg: 20px;
  --text-xl: 24px;
  --text-2xl: 32px;
  --text-3xl: 40px;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-normal: 1.55;
  --leading-relaxed: 1.7;

  /* Lijndiktes en focus */
  --line-thin: 1px;
  --line-medium: 2px;
  --line-thick: 3px;
  --line-heavy: 4px;
  --focus-width: 2px;
  --focus-offset: 2px;
  --focus-color: var(--accent);

  /* Tikdoelen */
  --tap-min: 44px;
  --tap-sm: 36px;

  /* Lagen */
  --z-base: 0;
  --z-sticky: 100;
  --z-dropdown: 200;
  --z-overlay: 400;
  --z-panel: 500;
  --z-sheet: 600;
  --z-modal: 700;
  --z-toast: 800;
  --z-tooltip: 900;

  /* Beweging: druk 90 ms, reacties 160–280 ms, veren waar iets verschijnt. */
  --dur-fast: 150ms;
  --dur-base: 200ms;
  --dur-slow: 250ms;
  --dur-panel: 350ms;
  --dur-panel-out: 300ms;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --spring: cubic-bezier(0.34, 1.3, 0.64, 1);
  --t-press: 90ms;
  --t-fast: 160ms;
  --t-mid: 220ms;
  --t-slow: 280ms;
  --toast-life: 8s;

  /* Schilmaten */
  --sidebar-width: 248px;
  --detail-width: 380px;
  --fab-size: 56px;
  --bottomnav-height: 64px;
  --content-max: 1200px;
}

/* Donker — expliciete keuze van de gebruiker */
[data-theme="dark"] {
  color-scheme: dark;

  /* Zeven grijstinten — donker */
  --bg: #0d0d0f;
  --surface: #16161a;
  --surface-2: #1f1f24;
  --line: #2c2c33;
  --muted: #9a9aa3;
  --ink: #e9e9ee;
  --strong: #ffffff;

  --accent: #4fa6ff;
  --accent-fill: #3d9bff;
  --accent-hover: #5aaeff;
  --accent-text: #7cc0ff;
  --accent-soft: #14243a;
  --accent-fg: #06121f;

  --ok: #74c39a;
  --ok-soft: #14251c;
  --warn: #d3a95f;
  --warn-soft: #251f14;
  --danger: #f09289;
  --danger-soft: #2a1917;

  --on-ok: #06121f;
  --on-warn: #251f14;
  --on-danger: #2a1917;

  --overlay: rgba(0, 0, 0, 0.64);
  --skeleton-shine: rgba(255, 255, 255, 0.08);

  --shadow-sm: none;
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.45);
  --shadow-panel: none;
  --shadow-focus: 0 0 0 3px var(--accent-soft);
  --sh-menu: var(--shadow-md);
  --sh-lift: 0 6px 16px rgba(0, 0, 0, 0.45);
}

/* Donker via systeemvoorkeur, alleen als er geen expliciete lichte keuze is. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #0d0d0f;
    --surface: #16161a;
    --surface-2: #1f1f24;
    --line: #2c2c33;
    --muted: #9a9aa3;
    --ink: #e9e9ee;
    --strong: #ffffff;

    --accent: #4fa6ff;
    --accent-fill: #3d9bff;
    --accent-hover: #5aaeff;
    --accent-text: #7cc0ff;
    --accent-soft: #14243a;
    --accent-fg: #06121f;

    --ok: #74c39a;
    --ok-soft: #14251c;
    --warn: #d3a95f;
    --warn-soft: #251f14;
    --danger: #f09289;
    --danger-soft: #2a1917;

    --on-ok: #06121f;
    --on-warn: #251f14;
    --on-danger: #2a1917;

    --overlay: rgba(0, 0, 0, 0.64);
    --skeleton-shine: rgba(255, 255, 255, 0.08);

    --shadow-sm: none;
    --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.04);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.45);
    --shadow-panel: none;
    --shadow-focus: 0 0 0 3px var(--accent-soft);
    --sh-menu: var(--shadow-md);
    --sh-lift: 0 6px 16px rgba(0, 0, 0, 0.45);
  }
}
