/* Design tokens – palette B "Clean". Single source of truth for colours, spacing, type, radii, shadow. */
:root {
  color-scheme: light;

  /* Neutrals */
  --gray-900: #111827;
  --gray-700: #374151;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50: #f9fafb;
  --white: #ffffff;

  /* Brand */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-subtle: #eff6ff;
  --primary-border: #bfdbfe;
  --accent: #0d9488;
  --accent-text: #0f766e; /* AA-safe teal for text on white */

  /* Status (text colours are >= 4.5:1 on white and on their -bg tint) */
  --success: #15803d;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --danger: #b91c1c;
  --danger-hover: #991b1b;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --info: #1d4ed8;
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;

  /* Semantic */
  --bg: var(--gray-50);
  --surface: var(--white);
  --text: var(--gray-900);
  --text-muted: var(--gray-500);
  --text-strong: var(--gray-700);
  --border: var(--gray-200);
  --border-strong: var(--gray-300);
  --border-input: #858fa0; /* 3.26:1 on white – WCAG 1.4.11 for form control boundaries */
  --focus-ring: var(--primary);

  /* Spacing – 4 px grid */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;

  /* One subtle shadow for floating elements only */
  --shadow-float: 0 8px 24px rgba(17, 24, 39, 0.12), 0 1px 3px rgba(17, 24, 39, 0.08);

  /* Typography */
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-xs: 0.75rem;   /* 12 */
  --text-sm: 0.875rem;  /* 14 */
  --text-base: 1rem;    /* 16 */
  --text-lg: 1.25rem;   /* 20 */
  --text-xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);  /* 20 -> 24 */
  --text-2xl: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);    /* 24 -> 32 */
  --leading-tight: 1.25;
  --leading-normal: 1.5;

  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 56px;
  --touch: 44px;
  --row-height: 40px;
  --content-max: none; /* full width: tables and dashboards use the whole screen */
  --content-medium: none; /* forms and settings pages also use the whole screen (user decision 4.11.2026.) */

  /* Motion */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --duration: 160ms;

  /* Z layers */
  --z-sticky: 20;
  --z-sidebar: 40;
  --z-dropdown: 50;
  --z-modal: 60;
  --z-toast: 70;
}

/* Hook for dark theme in phase 2 */
:root[data-theme="dark"] {
  color-scheme: dark;
}
