:root {
    /* Premium Modern Palette (HSL-aligned for depth) */
    --primary: #4F46E5; /* Saturated Indigo */
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --secondary: #10B981; /* Emerald 500 */
    --accent: #F43F5E; /* Rose 500 */
    --warning: #F59E0B; /* Amber 500 */
    --info: #3B82F6; /* Blue 500 */
    
    /* Neutral Palette (Premium Light Mode) */
    --bg-main: #F6F8FC;
    --bg-card: rgba(255, 255, 255, 0.65);
    --bg-input: rgba(255, 255, 255, 0.8);
    
    /* Text Colors */
    --text-primary: #0F172A; /* Slate 900 */
    --text-secondary: #334155; /* Slate 700 */
    --text-muted: #64748B; /* Slate 500 */
    
    /* Borders & Shadows */
    --border-color: rgba(226, 232, 240, 0.8);
    --glass-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.04),
        0 1px 3px 0 rgba(0, 0, 0, 0.01),
        inset 0 1px 1px 0 rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.7);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 12px -1px rgba(0, 0, 0, 0.03), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 20px 40px -3px rgba(0, 0, 0, 0.04), 0 4px 12px -2px rgba(0, 0, 0, 0.02);
    
    /* Spacing & Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

[data-theme="dark"] {
    /* Premium Modern Dark Palette */
    --bg-main: #070913; /* Deep navy-black */
    --bg-card: rgba(15, 23, 42, 0.45);
    --bg-input: rgba(30, 41, 59, 0.5);
    
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #64748B;
    
    --border-color: rgba(255, 255, 255, 0.05);
    --glass-shadow: 
        0 12px 40px 0 rgba(0, 0, 0, 0.5),
        0 1px 3px 0 rgba(0, 0, 0, 0.2),
        inset 0 1px 0px 0 rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.06) 0px, transparent 50%),
        radial-gradient(at 50% 0%, rgba(16, 185, 129, 0.04) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(244, 63, 94, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.5;
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

[data-theme="dark"] body {
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.16) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(244, 63, 94, 0.08) 0px, transparent 50%);
}

/* Glassmorphism Utilities */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Typography Refinement */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    margin-bottom: 0.75rem;
}

p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

a:hover {
    color: var(--primary-dark);
}

/* Utility Classes */
.p-0 { padding: 0 !important; }
.p-1 { padding: 1rem !important; }
.p-2 { padding: 2rem !important; }
.m-0 { margin: 0 !important; }
.mt-1 { margin-top: 1rem !important; }
.mb-1 { margin-bottom: 1rem !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 1rem; }

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }

@media (max-width: 1024px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { gap: 1rem; }
}

@media (max-width: 640px) {
    .p-2 { padding: 1.25rem !important; }
    .grid-2, .grid-3, .grid-4 { 
        grid-template-columns: 1fr;
        gap: 1rem !important; 
    }
}

