/* ============================================
   tokens.css — Design Tokens
   Single source of truth voor het visuele systeem.
   Alle waarden als CSS custom properties op :root.
   ============================================ */

:root {
  /* --- Kleuren: Brand (styleguide teal #33707b is canoniek) --- */
  --color-primary: #33707b;
  --color-primary-light: #4a8c97;
  --color-primary-hover: #15616d;
  --color-on-primary: #ffffff;

  /* --- Kleuren: Interactive --- */
  --color-link: #33707b;
  --color-link-hover: #15616d;
  --color-accent: #33707b;
  --color-focus-ring: rgba(51, 112, 123, 0.25);

  /* --- Kleuren: Brand tones (avatar / accent swatches, from styleguide $brand-*) --- */
  --color-tone-teal: var(--color-primary);
  --color-tone-blue: #4682b4;
  --color-tone-coral: #f54927;
  --color-tone-purple: #5c2d91;
  --color-tone-orange: #ff6f00;
  --color-tone-cyan: #0094a1;

  /* --- Kleuren: Semantic (matched to S2C styleguide = Bootstrap 5.3 defaults) --- */
  --color-error: #dc3545;
  --color-error-light: #f8d7da;
  --color-success: #198754;
  --color-success-light: #d1e7dd;
  --color-warning: #ffc107;
  --color-warning-light: #fff3cd;
  --color-info: #0dcaf0;
  --color-info-light: #cff4fc;

  /* --- Kleuren: Neutrals (Slate schaal) --- */
  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-tertiary: #64748b;
  --color-text-muted: #94a3b8;
  --color-text-inverse: #ffffff;

  --color-border: #e2e8f0;
  --color-border-light: #e8edf3;
  --color-border-strong: #cbd5e1;

  --color-bg-page: #f5f7fa;
  --color-bg-surface: #ffffff;
  --color-bg-surface-alt: #f8fafc;
  --color-bg-subtle: #f1f5f9;
  --color-bg-hover: #f0f4f8;
  --color-bg-selected: #e8f4fd;
  --color-bg-overlay: rgba(15, 23, 42, 0.5); /* slate scrim (styleguide modal backdrop) */
  --color-bg-inverse: #1e1e2e; /* styleguide dark sidebar / tooltip surface */

  /* --- Inline edit (data-table batch mode) --- */
  --color-edit-dirty: #e8f5e9;
  --color-edit-dirty-border: #66bb6a;

  /* --- Typography: Font families (styleguide: Inter + JetBrains Mono, self-hosted via fonts.css) --- */
  --font-family:
    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
  --font-family-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Consolas', 'Monaco', monospace;
  /* --- Typography: Font sizes (rem voor schaalbaarheid) --- */
  --font-size-xs: 0.6875rem; /* 11px */
  --font-size-sm: 0.75rem; /* 12px */
  --font-size-md: 0.8125rem; /* 13px */
  --font-size-base: 0.9375rem; /* 15px — styleguide $font-size-base */
  --font-size-lg: 1rem; /* 16px */
  --font-size-xl: 1.25rem; /* 20px */
  --font-size-2xl: 1.5rem; /* 24px */

  /* --- Typography: Heading scale (styleguide $h1..$h6) --- */
  --font-size-h1: 2.25rem; /* 36px */
  --font-size-h2: 1.75rem; /* 28px */
  --font-size-h3: 1.375rem; /* 22px */
  --font-size-h4: 1.125rem; /* 18px */
  --font-size-h5: 1rem; /* 16px */
  --font-size-h6: 0.875rem; /* 14px */
  --heading-font-weight: 600;
  --heading-line-height: 1.25;
  --heading-letter-spacing: -0.01em;

  /* --- Typography: Font weights --- */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* --- Typography: Line heights --- */
  --line-height-tight: 1;
  --line-height-snug: 1.3;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.6;

  /* --- Spacing (4px grid) --- */
  --spacing-2xs: 0.125rem; /* 2px */
  --spacing-xs: 0.25rem; /* 4px */
  --spacing-sm: 0.5rem; /* 8px */
  --spacing-md: 0.75rem; /* 12px */
  --spacing-lg: 1rem; /* 16px */
  --spacing-xl: 1.5rem; /* 24px */
  --spacing-2xl: 2.5rem; /* 40px */
  --indent-step: 20px; /* tree/nesting indent per level (scales with density) */

  /* --- Density: semantic spacing for data-dense components ---
   * Single knobs that cascade through Shadow DOM into every component.
   * Override these on a container (e.g. `.dt-compact`) for local density. */
  --density-cell-block: var(--spacing-xs); /* 4px — table cell vertical */
  --density-cell-inline: var(--spacing-sm); /* 8px — table cell horizontal */
  --density-header-block: var(--spacing-sm); /* 8px — table header vertical */
  --density-header-inline: var(--spacing-md); /* 12px — table header horizontal */
  --density-input-block: var(--spacing-xs); /* 4px — form input vertical */
  --density-input-inline: var(--spacing-sm); /* 8px — form input horizontal */
  --density-field-gap: var(--spacing-sm); /* 8px — between form fields */

  /* --- Border radius --- */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-full: 50%;
  --radius-pill: 999px; /* stadium / fully-rounded bars & chips; shape themes may flatten it */

  /* --- Icon / fixed widget sizes (scale with density) --- */
  --icon-size-sm: 16px;
  --icon-size-md: 20px;
  --icon-size-lg: 24px;

  /* --- Control heights (inputs / buttons / selects; scale with density) --- */
  --control-height-sm: 24px;
  --control-height-md: 30px;

  /* --- Shadows --- */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12), 0 4px 8px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 24px 48px rgba(15, 23, 42, 0.16);
  --shadow-sidebar: 2px 0 8px rgba(0, 0, 0, 0.05);

  /* --- Transitions --- */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.3s ease;
  --duration-loop: 1.4s; /* decorative loop animations (shimmer/pulse); scales with motion */

  /* --- Z-index schaal --- */
  --z-sticky: 10;
  --z-dropdown: 100;
  --z-modal-backdrop: 300;
  --z-modal: 400;
  --z-notification: 500;
  --z-tooltip: 600;
}

/* Dark theme overrides are now in styles/themes/color/ CSS files.
   Loaded dynamically by the theme-loader via <link> tags. */
