/* ==========================================================================
   Variables — Design Tokens
   All visual values must originate from this file.
   Direct hardcoded values are prohibited outside this file.
   ========================================================================== */

:root {
  /* --------------------------------------------------------------------
     Colors — Primary
     -------------------------------------------------------------------- */
  --color-primary-50: #eff6ff;
  --color-primary-100: #dbeafe;
  --color-primary-200: #bfdbfe;
  --color-primary-300: #93c5fd;
  --color-primary-400: #60a5fa;
  --color-primary-500: #3b82f6;
  --color-primary-600: #2563eb;
  --color-primary-700: #1d4ed8;
  --color-primary-800: #1e40af;
  --color-primary-900: #1e3a8a;

  /* --------------------------------------------------------------------
     Colors — Neutral
     -------------------------------------------------------------------- */
  --color-gray-50: #f8fafc;
  --color-gray-100: #f1f5f9;
  --color-gray-200: #e2e8f0;
  --color-gray-300: #cbd5e1;
  --color-gray-400: #94a3b8;
  --color-gray-500: #64748b;
  --color-gray-600: #475569;
  --color-gray-700: #334155;
  --color-gray-800: #1e293b;
  --color-gray-900: #0f172a;

  /* --------------------------------------------------------------------
     Colors — Success
     -------------------------------------------------------------------- */
  --color-success-50: #ecfdf5;
  --color-success-100: #d1fae5;
  --color-success-200: #a7f3d0;
  --color-success-300: #6ee7b7;
  --color-success-400: #34d399;
  --color-success-500: #10b981;
  --color-success-600: #059669;
  --color-success-700: #047857;
  --color-success-800: #065f46;
  --color-success-900: #064e3b;

  /* --------------------------------------------------------------------
     Colors — Warning
     -------------------------------------------------------------------- */
  --color-warning-50: #fffbeb;
  --color-warning-100: #fef3c7;
  --color-warning-200: #fde68a;
  --color-warning-300: #fcd34d;
  --color-warning-400: #fbbf24;
  --color-warning-500: #f59e0b;
  --color-warning-600: #d97706;
  --color-warning-700: #b45309;
  --color-warning-800: #92400e;
  --color-warning-900: #78350f;

  /* --------------------------------------------------------------------
     Colors — Danger
     -------------------------------------------------------------------- */
  --color-danger-50: #fef2f2;
  --color-danger-100: #fee2e2;
  --color-danger-200: #fecaca;
  --color-danger-300: #fca5a5;
  --color-danger-400: #f87171;
  --color-danger-500: #ef4444;
  --color-danger-600: #dc2626;
  --color-danger-700: #b91c1c;
  --color-danger-800: #991b1b;
  --color-danger-900: #7f1d1d;

  /* --------------------------------------------------------------------
     Colors — Information
     -------------------------------------------------------------------- */
  --color-info-50: #f0f9ff;
  --color-info-100: #e0f2fe;
  --color-info-200: #bae6fd;
  --color-info-300: #7dd3fc;
  --color-info-400: #38bdf8;
  --color-info-500: #0ea5e9;
  --color-info-600: #0284c7;
  --color-info-700: #0369a1;
  --color-info-800: #075985;
  --color-info-900: #0c4a6e;

  /* --------------------------------------------------------------------
     Colors — Background
     -------------------------------------------------------------------- */
  --color-bg-app: var(--color-gray-100);
  --color-bg-sidebar: var(--color-gray-900);
  --color-bg-header: #ffffff;
  --color-bg-card: #ffffff;
  --color-bg-widget: #ffffff;
  --color-bg-modal: #ffffff;

  /* --------------------------------------------------------------------
     Colors — Text
     -------------------------------------------------------------------- */
  --color-text-primary: var(--color-gray-900);
  --color-text-secondary: var(--color-gray-600);
  --color-text-muted: var(--color-gray-500);
  --color-text-disabled: var(--color-gray-400);
  --color-text-inverse: #ffffff;
  --color-text-link: var(--color-primary-600);

  /* --------------------------------------------------------------------
     Colors — Border
     -------------------------------------------------------------------- */
  --color-border-default: var(--color-gray-200);
  --color-border-strong: var(--color-gray-300);
  --color-border-focus: var(--color-primary-500);
  --color-border-divider: var(--color-gray-100);

  /* --------------------------------------------------------------------
     Colors — Chart
     -------------------------------------------------------------------- */
  --color-chart-1: var(--color-primary-500);
  --color-chart-2: var(--color-success-500);
  --color-chart-3: var(--color-warning-500);
  --color-chart-4: var(--color-danger-500);
  --color-chart-5: var(--color-info-500);
  --color-chart-6: var(--color-gray-500);

  /* --------------------------------------------------------------------
     Typography — Font Family
     -------------------------------------------------------------------- */
  --font-family-primary: "Inter", system-ui, sans-serif;

  /* --------------------------------------------------------------------
     Typography — Font Weight
     -------------------------------------------------------------------- */
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* --------------------------------------------------------------------
     Typography — Font Size
     -------------------------------------------------------------------- */
  --font-size-caption: 0.6875rem; /* 11px */
  --font-size-xs: 0.75rem; /* 12px */
  --font-size-sm: 0.8125rem; /* 13px */
  --font-size-base: 0.875rem; /* 14px */
  --font-size-md: 1rem; /* 16px */
  --font-size-lg: 1.125rem; /* 18px */
  --font-size-xl: 1.25rem; /* 20px */
  --font-size-2xl: 1.5rem; /* 24px */
  --font-size-3xl: 1.75rem; /* 28px */
  --font-size-4xl: 2rem; /* 32px */
  --font-size-5xl: 2.25rem; /* 36px */
  --font-size-6xl: 2.5rem; /* 40px */
  --font-size-7xl: 3rem; /* 48px */

  /* --------------------------------------------------------------------
     Typography — Line Height
     -------------------------------------------------------------------- */
  --line-height-xs: 1.125rem; /* 18px */
  --line-height-sm: 1.25rem; /* 20px */
  --line-height-base: 1.375rem; /* 22px */
  --line-height-md: 1.5rem; /* 24px */
  --line-height-lg: 1.625rem; /* 26px */
  --line-height-xl: 1.75rem; /* 28px */
  --line-height-2xl: 2rem; /* 32px */
  --line-height-3xl: 2.25rem; /* 36px */
  --line-height-4xl: 2.5rem; /* 40px */
  --line-height-5xl: 3rem; /* 48px */
  --line-height-6xl: 3.5rem; /* 56px */

  /* --------------------------------------------------------------------
     Typography — Letter Spacing
     -------------------------------------------------------------------- */
  --letter-spacing-display: -0.02em;
  --letter-spacing-heading: -0.01em;
  --letter-spacing-body: 0;
  --letter-spacing-caption: 0.02em;

  /* --------------------------------------------------------------------
     Spacing — Scale (Base: 4px)
     -------------------------------------------------------------------- */
  --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: 2rem; /* 32px */
  --spacing-3xl: 2.5rem; /* 40px */
  --spacing-4xl: 3rem; /* 48px */
  --spacing-5xl: 4rem; /* 64px */
  --spacing-6xl: 5rem; /* 80px */

  /* --------------------------------------------------------------------
     Border Radius
     -------------------------------------------------------------------- */
  --radius-none: 0;
  --radius-xs: 0.25rem; /* 4px */
  --radius-sm: 0.375rem; /* 6px */
  --radius-md: 0.5rem; /* 8px */
  --radius-lg: 0.75rem; /* 12px */
  --radius-xl: 1rem; /* 16px */
  --radius-2xl: 1.25rem; /* 20px */
  --radius-full: 9999px;

  /* --------------------------------------------------------------------
     Shadows
     -------------------------------------------------------------------- */
  --shadow-none: none;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-xl: 0 18px 48px rgba(15, 23, 42, 0.1);

  /* --------------------------------------------------------------------
     Animation — Duration
     -------------------------------------------------------------------- */
  --duration-fast: 120ms;
  --duration-normal: 180ms;
  --duration-slow: 240ms;
  --duration-sidebar: 220ms;
  --duration-shimmer: 1.5s;

  /* --------------------------------------------------------------------
     Animation — Easing
     -------------------------------------------------------------------- */
  --easing-default: ease;
  --easing-hover: ease-out;
  --easing-exit: ease-in;

  /* --------------------------------------------------------------------
     Z-Index
     -------------------------------------------------------------------- */
  --z-header: 100;
  --z-sidebar: 200;
  --z-dropdown: 500;
  --z-overlay: 900;
  --z-modal: 1000;
  --z-tooltip: 1100;
  --z-notification: 1200;

  /* --------------------------------------------------------------------
     Breakpoints (for reference — used in responsive.css)
     -------------------------------------------------------------------- */
  --bp-desktop: 1920px;
  --bp-laptop: 1600px;
  --bp-laptop-sm: 1440px;
  --bp-laptop-xs: 1366px;
  --bp-tablet-lg: 1280px;
  --bp-tablet: 1024px;
  --bp-mobile: 768px;
  --bp-mobile-sm: 480px;

  /* --------------------------------------------------------------------
     Layout — Sizing
     -------------------------------------------------------------------- */
  --sidebar-width-expanded: 280px;
  --sidebar-width-collapsed: 88px;
  --header-height: 72px;
  --footer-height: 56px;
  --content-max-width: 1640px;
  --content-min-width: 1280px;
  --content-padding: 24px;
  --grid-gap: 24px;
  --widget-gap: 24px;
  --section-margin: 32px;

  /* --------------------------------------------------------------------
     Opacity
     -------------------------------------------------------------------- */
  --opacity-disabled: 0.5;
  --opacity-kpi-icon: 0.15;
}

/* ==========================================================================
   Dark Theme Overrides
   Applied when [data-theme="dark"] is set on <html>
   ========================================================================== */

[data-theme="dark"] {
  /* Colors — Background */
  --color-bg-app: #0f172a;
  --color-bg-sidebar: #0f172a;
  --color-bg-header: #1e293b;
  --color-bg-card: #1e293b;
  --color-bg-widget: #1e293b;
  --color-bg-modal: #1e293b;
  --color-bg-white: #1e293b;

  /* Colors — Neutral (inverted for dark mode) */
  --color-gray-50: #0f172a;
  --color-gray-100: #1e293b;
  --color-gray-200: #334155;
  --color-gray-300: #475569;
  --color-gray-400: #64748b;
  --color-gray-500: #94a3b8;
  --color-gray-600: #cbd5e1;
  --color-gray-700: #e2e8f0;
  --color-gray-800: #f1f5f9;
  --color-gray-900: #f8fafc;

  /* Colors — Text */
  --color-text-primary: #f1f5f9;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --color-text-disabled: #475569;
  --color-text-inverse: #0f172a;
  --color-text-link: #60a5fa;

  /* Colors — Border */
  --color-border-default: #334155;
  --color-border-strong: #475569;
  --color-border-focus: #3b82f6;
  --color-border-divider: #1e293b;

  /* Shadows — Dark mode uses lighter shadows on dark backgrounds */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-xl: 0 18px 48px rgba(0, 0, 0, 0.5);
}
