:root {
    /* Brand */
    --color-primary: #6C5CE7;
    --color-primary-light: #A29BFE;
    --color-primary-dark: #5041C2;
    --color-primary-rgb: 108, 92, 231;
    --color-accent: #00CEC9;
    --color-accent-light: #55EFC4;

    /* Semantic */
    --color-success: #00B894;
    --color-success-light: #55efc4;
    --color-warning: #FDCB6E;
    --color-warning-light: #ffeaa7;
    --color-danger: #FF7675;
    --color-danger-light: #fab1a0;
    --color-info: #74B9FF;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6C5CE7, #A29BFE);
    --gradient-accent: linear-gradient(135deg, #00CEC9, #55EFC4);
    --gradient-danger: linear-gradient(135deg, #FF7675, #fab1a0);

    /* Dark theme (default) */
    --bg-primary: #0a0a14;
    --bg-secondary: #12121f;
    --bg-card: #1a1a2e;
    --bg-card-hover: #222240;
    --bg-hover: #1e1e35;
    --bg-input: #16162a;
    --bg-sidebar: #0e0e1a;
    --bg-modal-overlay: rgba(0, 0, 0, 0.7);
    --text-primary: #EAEAEA;
    --text-secondary: #8892B0;
    --text-muted: #5a6380;
    --border-color: #2a2a4a;
    --border-light: #1e1e38;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --fs-xs: 0.6875rem;
    --fs-sm: 0.8125rem;
    --fs-base: 0.9375rem;
    --fs-md: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.375rem;
    --fs-2xl: 1.75rem;
    --fs-3xl: 2.25rem;
    --fs-4xl: 3rem;
    --fw-light: 300;
    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-extrabold: 800;
    --lh-tight: 1.2;
    --lh-normal: 1.5;
    --lh-relaxed: 1.7;

    /* Spacing */
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.25rem;
    --sp-6: 1.5rem;
    --sp-8: 2rem;
    --sp-10: 2.5rem;
    --sp-12: 3rem;
    --sp-16: 4rem;
    --sp-20: 5rem;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px rgba(var(--color-primary-rgb), 0.3);

    /* Border radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --t-fast: 120ms ease;
    --t-normal: 200ms ease;
    --t-slow: 350ms ease;
    --t-spring: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Layout */
    --sidebar-width: 220px;
    --sidebar-collapsed: 72px;
    --topbar-height: 60px;
    --content-max-width: 1600px;

    /* Z-index */
    --z-sidebar: 100;
    --z-topbar: 110;
    --z-dropdown: 200;
    --z-modal: 300;
    --z-toast: 400;
    --z-tooltip: 500;

    /* ── Theme-aware helper tokens (dark defaults) ── */
    --glass-bg: rgba(255,255,255,0.015);
    --glass-bg-hover: rgba(255,255,255,0.03);
    --glass-border: rgba(255,255,255,0.08);
    --glass-track: rgba(255,255,255,0.06);
    --glass-detail-bg: rgba(0,0,0,0.2);
    --dim: #888;
    --mid: #aaa;
    --faint: #666;
    --heading-on-dark: #fff;
    --text-on-card: #E2E2EF;
    --detail-text: #B0B0C0;
    --auto-text: #A0C8B8;
}

/* Light theme */
[data-theme="light"] {
    --bg-primary: #F5F6FA;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F0F0F5;
    --bg-hover: #F0F0F5;
    --bg-input: #F7F8FC;
    --bg-sidebar: #FFFFFF;
    --bg-modal-overlay: rgba(0, 0, 0, 0.4);
    --text-primary: #1a1a2e;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #E2E8F0;
    --border-light: #F0F0F5;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);

    /* Light-mode helper tokens */
    --glass-bg: rgba(0,0,0,0.02);
    --glass-bg-hover: rgba(0,0,0,0.04);
    --glass-border: rgba(0,0,0,0.08);
    --glass-track: rgba(0,0,0,0.06);
    --glass-detail-bg: rgba(0,0,0,0.03);
    --dim: #6b7280;
    --mid: #4b5563;
    --faint: #9ca3af;
    --heading-on-dark: #1a1a2e;
    --text-on-card: #1a1a2e;
    --detail-text: #4b5563;
    --auto-text: #065f46;
}
