/* ============================================
   DESIGN TOKENS — Custom Properties
   NewCo SaaS Hub
   ============================================ */

:root {
    /* --- Typography --- */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /*
     * Typography Scale — WCAG 2.1 AA + ABNT NBR 17060 compliant
     * Minimum body text: 14px (0.875rem)
     * Minimum secondary: 12px (0.75rem)
     * Icons/badges only: 11px (0.6875rem)
     * NEVER below 11px for any readable text
     */
    --text-2xs: 0.75rem;    /* 12px — badges, labels only */
    --text-xs: 0.8125rem;   /* 13px — secondary text, hints */
    --text-sm: 0.9375rem;   /* 15px — body text (ABNT min 14px) */
    --text-base: 1rem;      /* 16px — default body */
    --text-lg: 1.125rem;    /* 18px */
    --text-xl: 1.25rem;     /* 20px */
    --text-2xl: 1.5rem;     /* 24px */
    --text-3xl: 1.875rem;   /* 30px */
    --text-4xl: 2.25rem;    /* 36px */

    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-black: 900;

    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;

    /* --- Spacing --- */
    --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;

    /* --- Border Radius --- */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* --- Shadows --- */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

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

    /* --- Layout --- */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --header-height: 64px;
    --drawer-height: 64px;
    --max-content-width: 1280px;

    /* --- Shorthand Aliases (used across views) --- */
    --radius: var(--radius-md);

    /* --- Z-Index Scale --- */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-toast: 500;
}

/* ============================================
   LIGHT THEME (default)
   ============================================ */
:root,
[data-theme="light"] {
    /* Brand */
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-light: #dbeafe;
    --color-primary-dark: #1e40af;

    --color-secondary: #7c3aed;
    --color-secondary-hover: #6d28d9;
    --color-secondary-light: #ede9fe;

    /* Semantic */
    --color-success: #16a34a;
    --color-success-light: #dcfce7;
    --color-warning: #d97706;
    --color-warning-light: #fef3c7;
    --color-danger: #dc2626;
    --color-danger-light: #fee2e2;
    --color-info: #0891b2;
    --color-info-light: #cffafe;

    /* Surfaces */
    --color-bg: #f8fafc;
    --color-bg-alt: #f1f5f9;
    --color-surface: #ffffff;
    --color-surface-hover: #f8fafc;
    --color-surface-active: #f1f5f9;
    --color-surface-raised: #ffffff;

    /* Text */
    --color-text: #0f172a;
    --color-text-secondary: #475569;
    --color-text-muted: #94a3b8;
    --color-text-inverse: #ffffff;

    /* Borders */
    --color-border: #e2e8f0;
    --color-border-hover: #cbd5e1;
    --color-border-focus: #2563eb;

    /* Sidebar */
    --sidebar-bg: #0f172a;
    --sidebar-text: #cbd5e1;
    --sidebar-text-active: #ffffff;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: rgba(37, 99, 235, 0.2);
    --sidebar-accent: #2563eb;
    --sidebar-divider: rgba(255, 255, 255, 0.08);

    /* Input */
    --input-bg: #ffffff;
    --input-border: #d1d5db;
    --input-focus-border: #2563eb;
    --input-focus-ring: rgba(37, 99, 235, 0.25);
    --input-placeholder: #9ca3af;

    /* Scrollbar */
    --scrollbar-track: #f1f5f9;
    --scrollbar-thumb: #cbd5e1;
    --scrollbar-thumb-hover: #94a3b8;

    /* --- Shorthand Aliases (views use these without color- prefix) --- */
    --primary: var(--color-primary);
    --primary-bg: var(--color-primary-light);
    --success: var(--color-success);
    --success-bg: var(--color-success-light);
    --warning: var(--color-warning);
    --warning-bg: var(--color-warning-light);
    --danger: var(--color-danger);
    --danger-bg: var(--color-danger-light);
    --info: var(--color-info);
    --info-bg: var(--color-info-light);
    --text: var(--color-text);
    --text-muted: var(--color-text-muted);
    --text-secondary: var(--color-text-secondary);
    --surface: var(--color-surface);
    --surface-alt: var(--color-bg-alt);
    --border: var(--color-border);
}

/* ============================================
   DARK THEME
   ============================================ */
[data-theme="dark"] {
    /* Brand */
    --color-primary: #3b82f6;
    --color-primary-hover: #60a5fa;
    --color-primary-light: rgba(59, 130, 246, 0.15);
    --color-primary-dark: #2563eb;

    --color-secondary: #8b5cf6;
    --color-secondary-hover: #a78bfa;
    --color-secondary-light: rgba(139, 92, 246, 0.15);

    /* Semantic */
    --color-success: #22c55e;
    --color-success-light: rgba(34, 197, 94, 0.15);
    --color-warning: #f59e0b;
    --color-warning-light: rgba(245, 158, 11, 0.15);
    --color-danger: #ef4444;
    --color-danger-light: rgba(239, 68, 68, 0.15);
    --color-info: #06b6d4;
    --color-info-light: rgba(6, 182, 212, 0.15);

    /* Surfaces */
    --color-bg: #0b1120;
    --color-bg-alt: #111827;
    --color-surface: #1e293b;
    --color-surface-hover: #263347;
    --color-surface-active: #334155;
    --color-surface-raised: #1e293b;

    /* Text */
    --color-text: #f1f5f9;
    --color-text-secondary: #94a3b8;
    --color-text-muted: #64748b;
    --color-text-inverse: #0f172a;

    /* Borders */
    --color-border: #334155;
    --color-border-hover: #475569;
    --color-border-focus: #3b82f6;

    /* Sidebar */
    --sidebar-bg: #0b1120;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #f1f5f9;
    --sidebar-hover: rgba(255, 255, 255, 0.05);
    --sidebar-active: rgba(59, 130, 246, 0.2);
    --sidebar-accent: #3b82f6;
    --sidebar-divider: rgba(255, 255, 255, 0.06);

    /* Input */
    --input-bg: #1e293b;
    --input-border: #475569;
    --input-focus-border: #3b82f6;
    --input-focus-ring: rgba(59, 130, 246, 0.3);
    --input-placeholder: #64748b;

    /* Scrollbar */
    --scrollbar-track: #1e293b;
    --scrollbar-thumb: #475569;
    --scrollbar-thumb-hover: #64748b;

    /* Shadow adjustments */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);

    /* --- Shorthand Aliases (dark) --- */
    --primary: var(--color-primary);
    --primary-bg: var(--color-primary-light);
    --success: var(--color-success);
    --success-bg: var(--color-success-light);
    --warning: var(--color-warning);
    --warning-bg: var(--color-warning-light);
    --danger: var(--color-danger);
    --danger-bg: var(--color-danger-light);
    --info: var(--color-info);
    --info-bg: var(--color-info-light);
    --text: var(--color-text);
    --text-muted: var(--color-text-muted);
    --text-secondary: var(--color-text-secondary);
    --surface: var(--color-surface);
    --surface-alt: var(--color-bg-alt);
    --border: var(--color-border);
}
