:root {
  /* === BEONE COLOR PALETTE (MATCH INDEX) === */
  --color-primary: #1A1729;
  --color-primary-light: #323335;
  --color-primary-rgb: 26, 23, 41;
  --color-accent: #E4A84B;
  --color-accent-rgb: 228, 168, 75;
  
  /* FIXED: Legacy vars should match their names in Dark Mode Default */
  --color-bg-light: #0f0d1a; 
  --color-bg-sidebar: rgba(20, 18, 30, 0.8);
  --color-text-main: #FFFFFF;
  --color-text-muted: rgba(255, 255, 255, 0.6);
  --color-border: rgba(255, 255, 255, 0.1);
  --color-white: #FFFFFF;
  --color-bg-subtle: rgba(255, 255, 255, 0.05);

  /* Theme semantic tokens (Dark Default) */
  --theme-bg-main: #0f0d1a;
  --theme-bg-sidebar: rgba(20, 18, 30, 0.8);
  --theme-bg-sidebar-active: rgba(228, 168, 75, 0.12);
  --theme-bg-header: rgba(20, 18, 30, 0.6);
  --theme-bg-card: rgba(255, 255, 255, 0.02);
  --theme-bg-card-hover: rgba(255, 255, 255, 0.04);
  --theme-bg-input: rgba(255, 255, 255, 0.05);
  --theme-bg-panel: rgba(22, 19, 33, 0.98);

  --theme-text-primary: #FFFFFF;
  --theme-text-secondary: rgba(255, 255, 255, 0.7);
  --theme-text-muted: rgba(255, 255, 255, 0.45);

  --theme-border-subtle: rgba(255, 255, 255, 0.06);
  --theme-border-medium: rgba(255, 255, 255, 0.1);
  --theme-border-strong: rgba(255, 255, 255, 0.2);

  /* Semantic Status Tokens (Dark Mode) */
  --theme-status-success: #7dd88e;
  --theme-status-success-bg: rgba(40, 167, 69, 0.16);
  --theme-status-warning: #f1be70;
  --theme-status-warning-bg: rgba(228, 168, 75, 0.16);
  --theme-status-danger: #ff8a95;
  --theme-status-danger-bg: rgba(220, 53, 69, 0.16);
  --theme-status-info: #7ab8ff;
  --theme-status-info-bg: rgba(59, 130, 246, 0.12);

  /* Semantic statuses (Legacy Compatibility) */
  --color-success: #28A745;
  --color-success-bg: #E7F5EE;
  --color-warning: #E4A84B;
  --color-warning-bg: #FFF4E5;
  --color-info: #007BFF;
  --color-info-bg: #E7F0FF;
  --color-danger: #DC3545;
  --color-danger-bg: #FDE8E8;

  /* Overlay helpers */
  --color-hover-primary-05: rgba(var(--color-primary-rgb), 0.05);
  --color-hover-primary-02: rgba(var(--color-primary-rgb), 0.02);
  --color-hover-danger-05: rgba(220, 53, 69, 0.05);
  --color-primary-focus-ring: rgba(var(--color-primary-rgb), 0.1);
  --color-primary-subtle-bg: rgba(var(--color-primary-rgb), 0.03);
  --color-primary-subtle-bg-strong: rgba(var(--color-primary-rgb), 0.08);
  --color-backdrop: rgba(0, 0, 0, 0.5);

  /* Illustration palette */
  --color-accent-soft: #f1be70;
  --color-primary-soft: #2a263d;
  --color-surface-muted: #efedeb;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-logo: 'Montserrat', var(--font-sans);

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 70px;
  
  /* Modern rounded corners */
  --radius-sm: 10px;
  --radius-md: 20px;
  --radius-lg: 32px;
  
  /* Softer, layered shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.08), 0 8px 16px rgba(0, 0, 0, 0.04);

  /* Compatibility tokens */
  --color-yellow: var(--color-accent);
  --color-dark-blue: var(--color-primary);
  --color-black: var(--color-text-main);
  --color-light-gray: var(--color-bg-light);
}

/* === LIGHT THEME OVERRIDES === */
:root[data-theme="light"] {
  /* Brand Adjustments for Light Mode */
  --color-primary: #1A1729;
  --color-primary-light: #323335;
  --color-primary-rgb: 26, 23, 41;

  /* Accent stays Gold/Yellow as per design brand in dark mode */
  --color-accent: #E4A84B;
  --color-accent-rgb: 228, 168, 75;

  /* FIXED: Legacy vars in Light Mode */
  --color-bg-light: #F6F5F4;
  --color-bg-sidebar: #FFFFFF;
  --color-text-main: #1A1729;
  --color-text-muted: rgba(26, 23, 41, 0.7);
  --color-border: rgba(0, 0, 0, 0.08);
  --color-bg-subtle: #E9ECEF;

  /* Theme semantic tokens (Light Mode) */
  --theme-bg-main: #F6F5F4;
  --theme-bg-sidebar: rgba(255, 255, 255, 0.9);
  --theme-bg-sidebar-active: rgba(212, 150, 63, 0.12);
  --theme-bg-header: rgba(255, 255, 255, 0.85);
  --theme-bg-card: #FFFFFF;
  --theme-bg-card-hover: #fafafa;
  --theme-bg-input: rgba(0, 0, 0, 0.04);
  --theme-bg-panel: #FFFFFF;

  --theme-text-primary: #1A1729;
  --theme-text-secondary: rgba(26, 23, 41, 0.7);
  --theme-text-muted: rgba(26, 23, 41, 0.5);

  --theme-border-subtle: rgba(0, 0, 0, 0.06);
  --theme-border-medium: rgba(0, 0, 0, 0.1);
  --theme-border-strong: rgba(0, 0, 0, 0.15);

  /* Use Red accent in light mode for better visibility on white background */
  --color-accent: #dc3545;
  --color-accent-rgb: 220, 53, 69;
  --color-accent-soft: #f06a76;

  /* Semantic Status Tokens (Light Mode - High Contrast) */
  --theme-status-success: #1e7e34;
  --theme-status-success-bg: #eafaf1;
  --theme-status-warning: #856404;
  --theme-status-warning-bg: #fffcf0;
  --theme-status-danger: #bd2130;
  --theme-status-danger-bg: #fff5f5;
  --theme-status-info: #0056b3;
  --theme-status-info-bg: #f0f7ff;

  /* Alert/Status tweaks for contrast */
  --color-warning: #d4963f;
  --color-danger-bg: #FDE8E8;
}
