/* 
 * Premium Enterprise UI Design System
 * Notion-Inspired Minimal Design
 * Version 3.0 - Black & White Theme
 */

/* ============================================
   1. DESIGN TOKENS & CSS VARIABLES
   ============================================ */

:root {
    /* Notion-Style Grayscale Palette - DARK MODE DEFAULT */
    --gray-0: #000000;
    --gray-50: #0e0e0e;
    --gray-100: #151515;
    --gray-150: #1a1a1a;
    --gray-200: #2a2a2a;
    --gray-300: #3a3a3a;
    --gray-400: #6f6f6f;
    --gray-500: #9a9a9a;
    --gray-600: #cfcfcf;
    --gray-700: #e5e5e5;
    --gray-800: #f5f5f5;
    --gray-900: #fafafa;
    --gray-1000: #ffffff;
    
    /* Icon Accent Colors - ONLY ICONS USE THESE */
    --icon-blue: #2EAADC;
    --icon-red: #E03E3E;
    --icon-orange: #F7B731;
    --icon-green: #0F7B6C;
    --icon-purple: #9B59B6;
    --icon-pink: #E91E8C;
    --icon-yellow: #DFAB01;
    --icon-brown: #64473A;
    
    /* Status Colors - For icons and minimal accents only */
    --status-success: #0F7B6C;
    --status-warning: #F7B731;
    --status-error: #E03E3E;
    --status-info: #2EAADC;
    
    /* Legacy color mappings for compatibility */
    --primary-500: #2EAADC;
    --primary-600: #2596BE;
    --accent-500: #0F7B6C;
    --success-500: #0F7B6C;
    --warning-500: #F7B731;
    --error-500: #E03E3E;
    
    /* Neutral - Mapped to grayscale */
    --neutral-50: #fafafa;
    --neutral-100: #f5f5f5;
    --neutral-200: #e5e5e5;
    --neutral-300: #cfcfcf;
    --neutral-400: #9a9a9a;
    --neutral-500: #6f6f6f;
    --neutral-600: #3a3a3a;
    --neutral-700: #2a2a2a;
    --neutral-800: #1a1a1a;
    --neutral-850: #151515;
    --neutral-900: #0e0e0e;
    --neutral-950: #000000;
    
    /* Surface Colors - Dark Mode Default */
    --surface-base: #000000;
    --surface-elevated: #0e0e0e;
    --surface-overlay: #151515;
    --surface-glass: #1a1a1a;
    --surface-glass-border: #2a2a2a;
    --surface-glass-hover: #1a1a1a;
    
    /* Theme-aware semantic colors - DARK MODE */
    --theme-bg-base: #000000;
    --theme-bg-elevated: #0e0e0e;
    --theme-bg-surface: #151515;
    --theme-bg-card: #151515;
    --theme-text-primary: #f5f5f5;
    --theme-text-secondary: #cfcfcf;
    --theme-text-muted: #6f6f6f;
    --theme-text-heading: #ffffff;
    --theme-border: #2a2a2a;
    --theme-border-hover: #3a3a3a;
    --theme-shadow: rgba(0, 0, 0, 0.5);
    --theme-navbar-bg: #000000;
    --theme-sidebar-bg: #0e0e0e;
    --theme-input-bg: #151515;
    --theme-input-border: #2a2a2a;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Monaco', 'Inconsolata', monospace;
    
    /* Font Sizes - 8pt scale */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.875rem;   /* 14px */
    --text-base: 1rem;     /* 16px */
    --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 */
    --text-5xl: 3rem;      /* 48px */
    
    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    
    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    
    /* Letter Spacing */
    --tracking-tighter: -0.05em;
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
    --tracking-wider: 0.05em;
    --tracking-widest: 0.1em;
    
    /* Spacing Scale - 8pt */
    --space-0: 0;
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */
    
    /* Border Radius */
    --radius-none: 0;
    --radius-sm: 0.25rem;    /* 4px */
    --radius-md: 0.5rem;     /* 8px */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-xl: 1rem;       /* 16px */
    --radius-2xl: 1.25rem;   /* 20px */
    --radius-3xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-glow-primary: 0 0 40px rgba(0, 0, 0, 0.15);
    --shadow-glow-accent: 0 0 40px rgba(0, 0, 0, 0.15);
    --shadow-glow-success: 0 0 40px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out-expo: cubic-bezier(0.87, 0, 0.13, 1);
    
    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ============================================
   LIGHT MODE - Notion-Style Clean White
   ============================================ */

    /* Override surface colors for light mode */
    --surface-base: #ffffff;
    --surface-elevated: #fafafa;
    --surface-overlay: #f7f7f7;
    --surface-glass: #fbfbfb;
    --surface-glass-border: #e5e5e5;
    --surface-glass-hover: #f5f5f5;
    
    /* Theme-aware semantic colors - Light Mode */
    --theme-bg-base: #ffffff;
    --theme-bg-elevated: #fafafa;
    --theme-bg-surface: #f7f7f7;
    --theme-bg-card: #fbfbfb;
    --theme-text-primary: #111111;
    --theme-text-secondary: #2b2b2b;
    --theme-text-muted: #6f6f6f;
    --theme-text-heading: #000000;
    --theme-border: #e5e5e5;
    --theme-border-hover: #cfcfcf;
    --theme-shadow: rgba(0, 0, 0, 0.08);
    --theme-navbar-bg: #ffffff;
    --theme-sidebar-bg: #fafafa;
    --theme-input-bg: #ffffff;
    --theme-input-border: #e5e5e5;
    
    /* Keep neutral colors LIGHT in light mode for backgrounds */
    --neutral-100: #f7f7f7;
    --neutral-200: #f0f0f0;
    --neutral-300: #e5e5e5;
    --neutral-400: #cfcfcf;
    --neutral-500: #6f6f6f;
    --neutral-600: #2b2b2b;
    --neutral-700: #1a1a1a;
    --neutral-800: #111111;
    --neutral-900: #000000;
    
    /* Light mode text overrides - dark text on light backgrounds */
    --text-heading: #000000;
    --text-body: #111111;
    --text-secondary: #2b2b2b;
    --text-muted: #6f6f6f;
    
    /* Light mode table colors */
    --table-header-bg: #f7f7f7;
    --table-header-text: #2b2b2b;
    --table-row-hover: #f0f0f0;
    --table-row-alt: #fbfbfb;
}

/* Light mode body styles */
    background: linear-gradient(135deg, #ffffff 0%, #f7f7f7 30%, #fbfbfb 70%, #f0f0f0 100%) !important;
    color: #111111 !important;
}

/* Light mode override for all text using neutral colors */
    color: #111111 !important;
}

/* Light mode navbar */
    background: var(--theme-navbar-bg) !important;
    border-bottom: 1px solid #e5e5e5 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
}

    color: #111111 !important;
}

/* Light mode sidebar */
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 250, 250, 0.95) 100%) !important;
    border-right: 1px solid #e5e5e5 !important;
}

    color: #2b2b2b !important;
}

    background: #f0f0f0 !important;
    color: #111111 !important;
}

    color: #6f6f6f !important;
}

/* Light mode cards */
    background: #ffffff !important;
    border: 1px solid #e5e5e5 !important;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.8) inset !important;
}

    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.9) inset !important;
}

    background: #f7f7f7 !important;
    border-bottom: 1px solid #e5e5e5 !important;
    color: #111111 !important;
}

    background: transparent !important;
    color: #2b2b2b !important;
}

/* Light mode text */
    color: #000000 !important;
}

    color: #6f6f6f !important;
}

    color: #2b2b2b !important;
}

/* Light mode forms */
    background: #ffffff !important;
    border: 1px solid #e5e5e5 !important;
    color: #111111 !important;
}

    border-color: #cfcfcf !important;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08) !important;
}

    color: #9a9a9a !important;
}

/* Light mode input group */
    background: #f7f7f7 !important;
    border-color: #e5e5e5 !important;
    color: #6f6f6f !important;
}

/* Light mode buttons */
    color: #2b2b2b !important;
    border-color: #e5e5e5 !important;
}

    background: #f0f0f0 !important;
    border-color: #cfcfcf !important;
    color: #111111 !important;
}

/* Light mode tables */
    color: #2b2b2b !important;
}

    background: #f7f7f7 !important;
    color: #111111 !important;
    border-color: #e5e5e5 !important;
}

    border-color: #f0f0f0 !important;
}

    background: #f7f7f7 !important;
}

/* Light mode modals */
    background: #ffffff !important;
    border: 1px solid #e5e5e5 !important;
}

    border-bottom-color: #e5e5e5 !important;
}

    border-top-color: #e5e5e5 !important;
}

/* Light mode dropdowns */
    background: #ffffff !important;
    border: 1px solid #e5e5e5 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12) !important;
}

    color: #2b2b2b !important;
}

    background: #f0f0f0 !important;
    color: #111111 !important;
}

/* Light mode badges */
    background: #f0f0f0 !important;
    color: #111111 !important;
}

/* Light mode quick access bar - Full override */
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 250, 250, 0.95) 100%) !important;
    border-bottom: 1px solid #e5e5e5 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06) !important;
}

    background: #ffffff !important;
    color: #2b2b2b !important;
    border: 1px solid #e5e5e5 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

    background: #f0f0f0 !important;
    color: #111111 !important;
    border-color: #cfcfcf !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
}

    background: #111111 !important;
    color: #ffffff !important;
    border-color: #111111 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
}

    color: inherit !important;
}

/* Light mode sidebar toggle button */
    background: #ffffff !important;
    border: 1px solid #e5e5e5 !important;
    color: #2b2b2b !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

    background: #f0f0f0 !important;
    border-color: #cfcfcf !important;
    color: #111111 !important;
}

/* Light mode KPI cards */
    background: #ffffff !important;
    border: 1px solid #e5e5e5 !important;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.9) inset !important;
}

    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 1) inset !important;
    transform: translateY(-2px);
}

    color: #000000 !important;
}

    color: #6f6f6f !important;
}

/* Light mode main content area */
    background: transparent !important;
}

/* Light mode page titles */
    color: #000000 !important;
}

/* Light mode list groups */
    background: #ffffff !important;
    border-color: #e5e5e5 !important;
    color: #2b2b2b !important;
}

    background: #f7f7f7 !important;
}

/* Light mode alerts */
    border: 1px solid #e5e5e5 !important;
}

/* Light mode panel/section headers */
    background: #f7f7f7 !important;
    border-bottom: 1px solid #e5e5e5 !important;
    color: #111111 !important;
}

/* Light mode links */
    color: #111111 !important;
}

    color: #000000 !important;
}

/* Light mode Bootstrap overrides */
    --bs-body-bg: #fbfbfb !important;
    --bs-body-color: #111111 !important;
    --bs-card-bg: #ffffff !important;
    --bs-border-color: #e5e5e5 !important;
}

/* Light mode scrollbars */
    background: #f7f7f7;
}

    background: #cfcfcf;
    border-radius: 4px;
}

    background: #9a9a9a;
}

/* Light mode quick icon bar */
    background: #ffffff !important;
    border: 1px solid #e5e5e5 !important;
}

    color: #2b2b2b !important;
}

    background: #f0f0f0 !important;
    color: #111111 !important;
}

/* Global theme toggle button */
.global-theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #cfcfcf;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.global-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

.global-theme-toggle i {
    font-size: 0.9rem;
}

    background: #f0f0f0;
    border-color: #e5e5e5;
    color: #111111;
}

    background: #e5e5e5;
    border-color: #cfcfcf;
}

/* ============================================
   2. BASE STYLES & RESETS
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--neutral-100);
    background: linear-gradient(135deg, var(--neutral-950) 0%, var(--neutral-900) 50%, var(--neutral-850) 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   3. GLASSMORPHISM COMPONENTS
   ============================================ */

.glass-panel {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-glass-border);
    border-radius: var(--radius-2xl);
}

.glass-panel-elevated {
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255,255,255,0.05);
}

.glass-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-xl);
    transition: all var(--transition-base);
}

.glass-card:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
    border-color: rgba(255,255,255,0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   4. INSIGHT PANELS (Premium Cards)
   ============================================ */

.insight-panel {
    position: relative;
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    transition: all var(--transition-slow) var(--ease-out-expo);
}

.insight-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-500), var(--accent-500));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.insight-panel:hover {
    transform: translateY(-4px);
    border-color: rgba(255,255,255,0.12);
    box-shadow: var(--shadow-2xl), var(--shadow-glow-primary);
}

.insight-panel:hover::before {
    opacity: 1;
}

.insight-panel-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.insight-panel-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--neutral-400);
}

.insight-panel-body {
    padding: var(--space-6);
}

.insight-panel-footer {
    padding: var(--space-4) var(--space-6);
    background: rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255,255,255,0.04);
}

/* KPI Variants */
.insight-panel.kpi-primary {
    background: #151515;
    border-color: #2a2a2a;
}

.insight-panel.kpi-primary:hover {
    box-shadow: var(--shadow-2xl), var(--shadow-glow-primary);
}

.insight-panel.kpi-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.04) 100%);
    border-color: rgba(16, 185, 129, 0.2);
}

.insight-panel.kpi-success:hover {
    box-shadow: var(--shadow-2xl), var(--shadow-glow-success);
}

.insight-panel.kpi-accent {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.12) 0%, rgba(20, 184, 166, 0.04) 100%);
    border-color: rgba(20, 184, 166, 0.2);
}

.insight-panel.kpi-accent:hover {
    box-shadow: var(--shadow-2xl), var(--shadow-glow-accent);
}

.insight-panel.kpi-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(245, 158, 11, 0.04) 100%);
    border-color: rgba(245, 158, 11, 0.2);
}

/* ============================================
   5. DATA LOOM TABLES
   ============================================ */

.data-loom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-loom thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-loom thead th {
    padding: var(--space-4) var(--space-5);
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--neutral-400);
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
}

.data-loom thead th:first-child {
    border-top-left-radius: var(--radius-xl);
}

.data-loom thead th:last-child {
    border-top-right-radius: var(--radius-xl);
}

.data-loom tbody tr {
    transition: all var(--transition-fast);
}

.data-loom tbody tr:hover {
    background: #1a1a1a;
}

.data-loom tbody td {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    vertical-align: middle;
}

.data-loom tbody tr:last-child td {
    border-bottom: none;
}

.data-loom tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius-xl);
}

.data-loom tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius-xl);
}

/* ============================================
   6. PREMIUM BUTTONS
   ============================================ */

.btn-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out-expo);
    text-decoration: none;
}

.btn-premium-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.btn-premium-primary:hover {
    background: linear-gradient(135deg, var(--primary-400) 0%, var(--primary-500) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
    color: white;
}

.btn-premium-success {
    background: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-premium-success:hover {
    background: linear-gradient(135deg, var(--success-400) 0%, var(--success-500) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.45);
    color: white;
}

.btn-premium-ghost {
    background: rgba(255,255,255,0.04);
    color: var(--neutral-200);
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-premium-ghost:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
    color: white;
}

/* ============================================
   7. STATUS INDICATORS
   ============================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    border-radius: var(--radius-full);
    text-transform: capitalize;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

.status-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-400);
}

.status-success::before {
    background: var(--success-400);
}

.status-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-400);
}

.status-warning::before {
    background: var(--warning-400);
}

.status-error {
    background: rgba(244, 63, 94, 0.15);
    color: var(--error-400);
}

.status-error::before {
    background: var(--error-400);
}

.status-info {
    background: #1a1a1a;
    color: var(--primary-400);
}

.status-info::before {
    background: var(--primary-400);
}

.status-neutral {
    background: rgba(100, 116, 139, 0.15);
    color: var(--neutral-400);
}

.status-neutral::before {
    background: var(--neutral-400);
    animation: none;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   8. AVATAR COMPONENTS
   ============================================ */

.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--accent-500) 100%);
    color: white;
    text-transform: uppercase;
    flex-shrink: 0;
}

.avatar-xs { width: 24px; height: 24px; font-size: var(--text-xs); }
.avatar-sm { width: 32px; height: 32px; font-size: var(--text-sm); }
.avatar-md { width: 40px; height: 40px; font-size: var(--text-base); }
.avatar-lg { width: 48px; height: 48px; font-size: var(--text-lg); }
.avatar-xl { width: 64px; height: 64px; font-size: var(--text-2xl); }

.avatar-ring {
    box-shadow: 0 0 0 3px var(--neutral-900), 0 0 0 5px var(--primary-500);
}

/* ============================================
   9. PROGRESS COMPONENTS
   ============================================ */

.progress-bar-premium {
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-premium .progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary-500) 0%, var(--accent-500) 100%);
    transition: width var(--transition-slower) var(--ease-out-expo);
    position: relative;
}

.progress-bar-premium .progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-radial {
    position: relative;
    width: 80px;
    height: 80px;
}

.progress-radial svg {
    transform: rotate(-90deg);
}

.progress-radial .track {
    stroke: rgba(255,255,255,0.08);
}

.progress-radial .fill {
    stroke: url(#gradient);
    stroke-linecap: round;
    transition: stroke-dashoffset var(--transition-slower) var(--ease-out-expo);
}

.progress-radial .value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
}

/* ============================================
   10. METRIC COMPONENTS
   ============================================ */

.metric-value {
    font-family: var(--font-mono);
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    line-height: var(--leading-none);
    background: linear-gradient(135deg, var(--neutral-100) 0%, var(--neutral-300) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-value-success {
    background: linear-gradient(135deg, var(--success-300) 0%, var(--success-500) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-label {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--neutral-500);
}

.metric-trend {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
}

.metric-trend-up {
    color: var(--success-400);
}

.metric-trend-down {
    color: var(--error-400);
}

/* ============================================
   11. FORM COMPONENTS
   ============================================ */

.form-input-premium {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--neutral-100);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.form-input-premium::placeholder {
    color: var(--neutral-500);
}

.form-input-premium:focus {
    outline: none;
    background: rgba(255,255,255,0.06);
    border-color: #3a3a3a;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.15);
}

.form-label-premium {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--neutral-300);
}

/* Global select styling - removes native arrows and applies single clean dropdown arrow */
select,
.form-select,
.form-control[type="select"],
.form-select-premium {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 12px !important;
    padding-right: 36px !important;
}

/* Hide IE/Edge native dropdown arrow */
select::-ms-expand,
.form-select::-ms-expand {
    display: none;
}

.form-select-premium {
    background-color: rgba(255,255,255,0.04);
}

/* ============================================
   12. NAVIGATION COMPONENTS
   ============================================ */

.nav-item-premium {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--neutral-400);
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.nav-item-premium:hover {
    background: rgba(255,255,255,0.04);
    color: var(--neutral-100);
}

.nav-item-premium.active {
    background: #1a1a1a;
    color: var(--primary-400);
    position: relative;
}

.nav-item-premium.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: linear-gradient(180deg, var(--primary-400), var(--accent-400));
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.nav-item-premium:hover .nav-icon,
.nav-item-premium.active .nav-icon {
    opacity: 1;
}

/* ============================================
   13. ANIMATIONS & MICRO-INTERACTIONS
   ============================================ */

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-down {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scale-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slide-in-right {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes count-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in { animation: fade-in var(--transition-slow) var(--ease-out-expo); }
.animate-fade-in-up { animation: fade-in-up var(--transition-slow) var(--ease-out-expo); }
.animate-fade-in-down { animation: fade-in-down var(--transition-slow) var(--ease-out-expo); }
.animate-scale-in { animation: scale-in var(--transition-slow) var(--ease-out-expo); }
.animate-slide-in-right { animation: slide-in-right var(--transition-slow) var(--ease-out-expo); }

.animate-delay-1 { animation-delay: 50ms; }
.animate-delay-2 { animation-delay: 100ms; }
.animate-delay-3 { animation-delay: 150ms; }
.animate-delay-4 { animation-delay: 200ms; }
.animate-delay-5 { animation-delay: 250ms; }

/* Hover lift effect */
.hover-lift {
    transition: transform var(--transition-base) var(--ease-out-expo);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

/* Glow effect */
.hover-glow {
    transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow-primary);
}

/* ============================================
   14. UTILITY CLASSES
   ============================================ */

.text-gradient-primary {
    background: linear-gradient(135deg, var(--primary-400) 0%, var(--accent-400) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-success {
    background: linear-gradient(135deg, var(--success-400) 0%, var(--accent-400) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success-500) 0%, var(--success-700) 100%);
}

.bg-gradient-accent {
    background: linear-gradient(135deg, var(--accent-500) 0%, var(--accent-700) 100%);
}

.border-gradient {
    border: 1px solid transparent;
    background: linear-gradient(var(--neutral-900), var(--neutral-900)) padding-box,
                linear-gradient(135deg, var(--primary-500), var(--accent-500)) border-box;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   15. RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 768px) {
    :root {
        --text-4xl: 1.875rem;
        --text-5xl: 2.25rem;
    }
    
    .insight-panel-body {
        padding: var(--space-4);
    }
    
    .data-loom thead th,
    .data-loom tbody td {
        padding: var(--space-3);
    }
}

/* ============================================
   16. COMPREHENSIVE LIGHT THEME FIXES
   ============================================ */

/* General text and paragraph colors for light mode */
    color: inherit;
}

/* Force dark text on light backgrounds */
    color: #111111;
}

/* Fix all cards and card-like elements */
    background: #ffffff !important;
    border-color: #e5e5e5 !important;
    color: #111111 !important;
}

/* Fix Bootstrap gray backgrounds */
    background: #f0f0f0 !important;
    color: #111111 !important;
}

    background: #f0f0f0 !important;
    color: #2b2b2b !important;
}

    background: #fbfbfb !important;
    color: #111111 !important;
}

/* Fix nav-pills and tabs */
    color: #2b2b2b !important;
}

    background: #f0f0f0 !important;
    color: #111111 !important;
}

    background: #111111 !important;
    color: #ffffff !important;
}

/* Fix tab content areas */
    background: transparent !important;
    color: #111111 !important;
}

/* Fix progress bars */
    background: #f0f0f0 !important;
}

/* Fix breadcrumbs */
    background: transparent !important;
}

    color: #6f6f6f !important;
}

    color: #111111 !important;
}

/* Fix pagination */
    background: #ffffff !important;
    border-color: #e5e5e5 !important;
    color: #2b2b2b !important;
}

    background: #f0f0f0 !important;
    color: #111111 !important;
}

    background: #111111 !important;
    border-color: #111111 !important;
    color: #ffffff !important;
}

/* Fix close buttons */
    filter: none !important;
    opacity: 0.6;
}

/* Fix icons in light mode */
    color: inherit;
}

/* Fix accent sections */
    background: #f7f7f7 !important;
    border: 1px solid #e5e5e5 !important;
}

/* Fix stat cards and metric displays */
    background: #ffffff !important;
    border: 1px solid #e5e5e5 !important;
}

/* Fix activity feed items */
    background: #ffffff !important;
    border-color: #f0f0f0 !important;
}

/* Fix input groups */
    background: transparent !important;
}

/* Fix all form labels */
    color: #2b2b2b !important;
}

/* Fix checkboxes and radios */
    color: #2b2b2b !important;
}

/* Fix toast messages */
    background: #ffffff !important;
    border-color: #e5e5e5 !important;
    color: #111111 !important;
}

/* Fix popovers */
    background: #ffffff !important;
    border-color: #e5e5e5 !important;
}

    color: #2b2b2b !important;
}

/* Fix tooltips */
    background: #111111 !important;
    color: #ffffff !important;
}

/* Fix offcanvas */
    background: #ffffff !important;
    color: #111111 !important;
}

/* Fix accordion */
    background: #ffffff !important;
    border-color: #e5e5e5 !important;
}

    background: #fbfbfb !important;
    color: #111111 !important;
}

    background: #f0f0f0 !important;
    color: #111111 !important;
}

/* Fix textarea */
    background: #ffffff !important;
    border-color: #e5e5e5 !important;
    color: #111111 !important;
}

/* Fix code blocks */
    background: #f7f7f7 !important;
    color: #111111 !important;
    border: 1px solid #e5e5e5 !important;
}

/* Ensure all icons have proper contrast */
    color: #111111 !important;
}

/* Fix filter/sort controls */
    background: #ffffff !important;
    border-color: #e5e5e5 !important;
    color: #2b2b2b !important;
}

    background: #f0f0f0 !important;
    color: #111111 !important;
}
