:root {
    /* Color Palette - Light Mode (SaaS UI) */
    --primary: #0F172A; /* Slate 900 */
    --primary-light: #F1F5F9;
    --primary-hover: #1E293B;
    
    --bg-main: #FAFAFA;
    --bg-panel: #FFFFFF;
    --bg-panel-rgb: 255, 255, 255;
    --bg-hover: #F4F4F5;
    
    --text-primary: #171717;
    --text-secondary: #666666;
    --text-tertiary: #A1A1AA;
    
    --border-color: #E5E7EB;
    
    /* Semantic Colors */
    --success: #10B981;
    --success-bg: #D1FAE5;
    --warning: #F59E0B;
    --warning-bg: #FEF3C7;
    --danger: #EF4444;
    --danger-bg: #FEE2E2;
    --info: #3B82F6;
    --info-bg: #DBEAFE;
    
    /* Status Colors */
    --status-new: var(--info);
    --status-new-bg: var(--info-bg);
    --status-replied: var(--success);
    --status-replied-bg: var(--success-bg);
    --status-interested: #8B5CF6;
    --status-interested-bg: #EDE9FE;
    --status-followup: var(--warning);
    --status-followup-bg: var(--warning-bg);

    /* Typography */
    --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    
    /* Metrics */
    --sidebar-width: 250px;
    --sidebar-collapsed: 80px;
    --topbar-height: 60px;
    --border-radius: 8px; /* SaaS crisp UI */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
    
    /* Transitions */
    --transition: all 0.15s ease-in-out;
    --theme-transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Dark Mode Variables */
html.dark-theme :root,
body.dark-theme {
    --primary: #F8FAFC; 
    --primary-light: #1E293B;
    --primary-hover: #E2E8F0;
    
    --bg-main: #0A0A0A;
    --bg-panel: #111111;
    --bg-panel-rgb: 17, 17, 17;
    --bg-hover: #1A1A1A;
    
    --text-primary: #EDEDED;
    --text-secondary: #A1A1AA; 
    --text-tertiary: #52525B;
    
    --border-color: #27272A;
    
    /* Semantic Colors - slightly muted backgrounds for dark mode */
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger-bg: rgba(239, 68, 68, 0.15);
    --info-bg: rgba(59, 130, 246, 0.15);
    
    /* Status Colors */
    --status-new-bg: rgba(59, 130, 246, 0.15);
    --status-replied-bg: rgba(16, 185, 129, 0.15);
    --status-interested: #A78BFA;
    --status-interested-bg: rgba(139, 92, 246, 0.15);
    --status-followup-bg: rgba(245, 158, 11, 0.15);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    overflow-y: auto;
    transition: var(--theme-transition);
}

/* Global Keyframes */
@keyframes spin {
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Spinner Global */
.spinner {
    animation: spin 1s linear infinite;
}
