:root {
    /* --- LIGHT MODE --- */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-input: #f1f5f9;
    --bg-sidebar: #1e293b;
    --text-main: #0f172a; 
    --text-muted: #475569;
    --text-contrast: #1e293b; /* Màu nổi bật cho chế độ sáng */
    --border-color: #cbd5e1;
    --accent-primary: #2563eb;
    --bg-card-rgb: 255, 255, 255;
    --shadow-md: 0 10px 25px -5px rgba(0,0,0,0.05);
}

.dark-mode {
    /* --- DARK MODE --- */
    --bg-body: #020617;
    --bg-card: #0f172a;
    --bg-input: #1e293b;
    --bg-sidebar: #020617;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --text-contrast: #ffffff; /* Trắng tinh cho chế độ tối */
    --border-color: #334155;
    --accent-primary: #3b82f6;
    --bg-card-rgb: 15, 23, 42;
    --shadow-md: 0 20px 50px rgba(0,0,0,0.5);
}

/* --- ADAPTIVE UTILITIES --- */
.text-main { color: var(--text-main) !important; }
.text-contrast { color: var(--text-contrast) !important; }
.text-muted { color: var(--text-muted) !important; }

html, body { height: 100%; margin: 0; }
body { 
    display: block !important; 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    background-color: var(--bg-body); 
    color: var(--text-main); 
    transition: background-color 0.3s ease, color 0.3s ease; 
}

.main-content { display: flex; flex-direction: column; min-height: 100vh; margin-left: 0 !important; }
.content-wrapper { flex: 1; padding: 2rem; }

/* --- COMPONENT SYNC --- */
.dark-card, .bg-card-theme, .stat-card, .premium-card, .modal-solid {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    box-shadow: var(--shadow-md) !important;
    border-radius: 1.25rem;
}

.dark-input, select.dark-input, textarea.dark-input {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    border-radius: 0.75rem;
}

/* --- TABLE THEME --- */
thead th {
    background-color: var(--table-header-bg, rgba(var(--bg-card-rgb), 0.8)) !important;
    color: var(--text-muted) !important;
    border-bottom: 2px solid var(--border-color) !important;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
}

.table-row {
    background-color: var(--bg-card) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.table-row:hover { background-color: rgba(59, 130, 246, 0.05) !important; }

/* --- TYPOGRAPHY INTER --- */
h1, h2, h3, .modal-title, .font-bold { font-family: 'Inter', sans-serif !important; }
h1, h2, h3, .modal-title { font-size: 16px !important; font-weight: 700 !important; text-transform: uppercase !important; letter-spacing: 0.05em !important; }
label.uppercase { font-family: 'Inter', sans-serif !important; font-size: 11px !important; font-weight: 700 !important; color: var(--text-muted) !important; }

/* --- THEME SWITCH 3D CINEMATIC --- */
.theme-switch-3d { width: 72px; height: 36px; position: relative; cursor: pointer; user-select: none; }
.switch-track { position: absolute; inset: 0; background: linear-gradient(to bottom, #4facfe 0%, #00f2fe 100%); border-radius: 20px; box-shadow: inset 0 4px 8px rgba(0,0,0,0.1); transition: all 0.6s ease; overflow: hidden; border: 1px solid rgba(255,255,255,0.2); }
.dark-mode .switch-track { background: linear-gradient(to bottom, #0f172a 0%, #1e293b 100%); }
.switch-thumb { position: absolute; top: 4px; left: 4px; width: 28px; height: 28px; background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 10; transition: all 0.6s cubic-bezier(0.68, -0.6, 0.32, 1.6); box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.dark-mode .switch-thumb { left: calc(100% - 32px); background: #e2e8f0; box-shadow: 0 0 20px rgba(129, 140, 248, 0.6); }
.sun-icon { color: #f59e0b; }
.moon-icon { color: #4338ca; opacity: 0; transform: translateY(20px) rotate(-120deg); position: absolute; }
.dark-mode .sun-icon { opacity: 0; transform: translateY(-20px) rotate(120deg); }
.dark-mode .moon-icon { opacity: 1; transform: translateY(0) rotate(0); }

.top-bar { background: rgba(var(--bg-card-rgb), 0.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 100; }
