/* Design Tokens */

:root {
  /* Sidebar */
  --sidebar-bg: #1b2541;
  --sidebar-width: 260px;
  --sidebar-text: #a0aec0;
  --sidebar-text-hover: #ffffff;
  --sidebar-active-bg: rgba(112, 145, 230, 0.15);

  /* Primary palette */
  --primary: #3d52a0;
  --primary-light: #7091e6;
  --primary-dark: #2d3e7a;

  /* Backgrounds */
  --content-bg: #f5f7fa;
  --surface: #ffffff;
  --topbar-bg: #ffffff;

  /* Text */
  --text-primary: #1a1d2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  /* Status colors */
  --success-bg: #d1fae5;
  --success-text: #065f46;
  --warning-bg: #fef3c7;
  --warning-text: #92400e;
  --error-bg: #fee2e2;
  --error-text: #991b1b;

  /* Borders & shadows */
  --border-color: #e5e7eb;
  --border: var(--border-color);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

  /* Semantic tokens */
  --focus-ring: rgba(112, 145, 230, 0.15);
  --overlay-bg: rgba(0, 0, 0, 0.5);
  --success-bg-hover: #a7f3d0;
  --warning-bg-hover: #fde68a;
  --error-bg-hover: #fecaca;
  --color-on-primary: #ffffff;

  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Spacing aliases (some pages use --spacing-*) */
  --spacing-xs: var(--space-xs);
  --spacing-sm: var(--space-sm);
  --spacing-md: var(--space-md);
  --spacing-lg: var(--space-lg);
  --spacing-xl: var(--space-xl);

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

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;

  /* Topbar */
  --topbar-height: 64px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Backgrounds */
    --content-bg: #111318;
    --surface: #1a1d24;
    --topbar-bg: #1a1d24;

    /* Text */
    --text-primary: #e4e6eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    /* Primary (keep hues, brighten slightly) */
    --primary: #5b72c0;
    --primary-light: #8aa4f0;
    --primary-dark: #4a62b0;

    /* Status colors (muted backgrounds, brighter text) */
    --success-bg: rgba(6, 95, 70, 0.2);
    --success-text: #6ee7b7;
    --warning-bg: rgba(146, 64, 14, 0.2);
    --warning-text: #fcd34d;
    --error-bg: rgba(153, 27, 27, 0.2);
    --error-text: #fca5a5;

    /* Borders & shadows */
    --border-color: #2d3039;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);

    /* Semantic tokens */
    --focus-ring: rgba(138, 164, 240, 0.25);
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --success-bg-hover: rgba(6, 95, 70, 0.35);
    --warning-bg-hover: rgba(146, 64, 14, 0.35);
    --error-bg-hover: rgba(153, 27, 27, 0.35);
  }
}
