/* ═══════════════════════════════════════════════════════
   TheTrackerElite — Complete Stylesheet
   Default theme: Black & White (bw)
═══════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────── */
:root {
    --primary:        #ffffff;
    --primary-dark:   #dddddd;
    --primary-light:  #f0f0f0;
    --bg-dark:        #000000;
    --bg-card:        #0f0f0f;
    --bg-input:       #1a1a1a;
    --bg-surface:     #111111;
    --text-primary:   #ffffff;
    --text-secondary: #aaaaaa;
    --text-muted:     #555555;
    --border:         rgba(255,255,255,0.12);
    --border-strong:  rgba(255,255,255,0.25);
    --success:        #22c55e;
    --warning:        #f59e0b;
    --danger:         #ef4444;
    --info:           #3b82f6;
    --sidebar-w:      260px;
    --topbar-h:       64px;
    --radius:         16px;
    --radius-sm:      10px;
    --shadow:         0 8px 32px rgba(0,0,0,0.5);
    --shadow-lg:      0 20px 60px rgba(0,0,0,0.7);
    --glow:           0 0 20px rgba(255,255,255,0.08);
    --transition:     0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ── Theme: Gold Elite ─────────────────────────────── */
[data-theme="gold"] {
    --primary:       #D4AF37;
    --primary-dark:  #B8962E;
    --primary-light: #E8C967;
    --border:        rgba(212,175,55,0.18);
    --glow:          0 0 24px rgba(212,175,55,0.15);
}
/* ── Theme: Midnight Blue ──────────────────────────── */
[data-theme="midnight"] {
    --primary:       #3b82f6;
    --primary-dark:  #2563eb;
    --primary-light: #60a5fa;
    --border:        rgba(59,130,246,0.18);
    --glow:          0 0 24px rgba(59,130,246,0.15);
}
/* ── Theme: Forest ─────────────────────────────────── */
[data-theme="forest"] {
    --primary:       #22c55e;
    --primary-dark:  #16a34a;
    --primary-light: #4ade80;
    --border:        rgba(34,197,94,0.18);
    --glow:          0 0 24px rgba(34,197,94,0.12);
}
/* ── Theme: Light ──────────────────────────────────── */
[data-theme="light"] {
    --bg-dark:       #f0f2f5;
    --bg-card:       #ffffff;
    --bg-input:      #f4f6f8;
    --bg-surface:    #fafafa;
    --text-primary:  #0a0a0a;
    --text-secondary:#555555;
    --text-muted:    #999999;
    --border:        rgba(0,0,0,0.1);
    --border-strong: rgba(0,0,0,0.2);
    --shadow:        0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg:     0 12px 40px rgba(0,0,0,0.12);
    --glow:          0 0 12px rgba(0,0,0,0.05);
}

/* ── Reset ─────────────────────────────────────────── */
*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition), color var(--transition);
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, textarea, select { font-family: inherit; outline: none; }
img { max-width: 100%; }

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ══════════════════════════════════════════════════════
   ANIMATED BACKGROUND
══════════════════════════════════════════════════════ */
.bg-particles {
    position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.bg-particles::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 80% 60% at 20% -10%, rgba(255,255,255,0.04) 0%, transparent 50%),
                radial-gradient(ellipse 60% 40% at 80% 100%, rgba(255,255,255,0.03) 0%, transparent 50%);
    animation: bgPulse 12s ease-in-out infinite alternate;
}
[data-theme="gold"] .bg-particles::before {
    background: radial-gradient(ellipse 80% 60% at 20% -10%, rgba(212,175,55,0.06) 0%, transparent 50%),
                radial-gradient(ellipse 60% 40% at 80% 100%, rgba(212,175,55,0.04) 0%, transparent 50%);
}
[data-theme="midnight"] .bg-particles::before {
    background: radial-gradient(ellipse 80% 60% at 20% -10%, rgba(59,130,246,0.07) 0%, transparent 50%),
                radial-gradient(ellipse 60% 40% at 80% 100%, rgba(59,130,246,0.05) 0%, transparent 50%);
}
[data-theme="forest"] .bg-particles::before {
    background: radial-gradient(ellipse 80% 60% at 20% -10%, rgba(34,197,94,0.06) 0%, transparent 50%),
                radial-gradient(ellipse 60% 40% at 80% 100%, rgba(34,197,94,0.04) 0%, transparent 50%);
}
.particle {
    position: absolute;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.04;
    animation: floatParticle linear infinite;
}
@keyframes bgPulse {
    0%   { opacity: 0.8; transform: scale(1); }
    100% { opacity: 1;   transform: scale(1.05); }
}
@keyframes floatParticle {
    0%   { transform: translateY(100vh) scale(0); opacity: 0; }
    10%  { opacity: 0.06; }
    90%  { opacity: 0.06; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}
@keyframes gridFloat {
    0%,100% { transform: translateY(0px); }
    50%      { transform: translateY(-8px); }
}

/* ══════════════════════════════════════════════════════
   TOAST NOTIFICATION
══════════════════════════════════════════════════════ */
.toast {
    position: fixed; bottom: 28px; right: 28px;
    background: var(--bg-card); border: 1px solid var(--border-strong);
    color: var(--text-primary); padding: 14px 22px; border-radius: var(--radius-sm);
    z-index: 9999; transform: translateY(120px); opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
    font-size: 14px; font-weight: 500; max-width: 320px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: var(--shadow-lg); backdrop-filter: blur(16px);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(34,197,94,0.5); }
.toast.error   { border-color: rgba(239, 68, 68, 0.5); }
.toast.info    { border-color: rgba(59,130,246,0.5); }

/* ══════════════════════════════════════════════════════
   SPLASH SCREEN
══════════════════════════════════════════════════════ */
.splash-page {
    position: fixed; inset: 0;
    background: #000000;
    display: flex; justify-content: center; align-items: center;
    z-index: 9000; transition: opacity 0.6s ease, visibility 0.6s ease;
}
.splash-page.fade-out { opacity: 0; visibility: hidden; }
.splash-inner { text-align: center; animation: splashFadeIn 1s ease both; }
.logo-ring {
    width: 180px; height: 180px; margin: 0 auto 32px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    position: relative; animation: logoRotate 8s linear infinite;
    box-shadow: 0 0 40px rgba(255,255,255,0.08), inset 0 0 40px rgba(255,255,255,0.04);
}
.logo-ring::before {
    content: ''; position: absolute; inset: 8px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    animation: logoRotate 4s linear infinite reverse;
}
.logo-ring::after {
    content: ''; position: absolute; width: 12px; height: 12px;
    background: var(--primary); border-radius: 50%; top: 8px; left: 50%;
    transform: translateX(-50%); box-shadow: 0 0 12px var(--primary);
}
.logo-core {
    width: 80px; height: 80px; border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
}
[data-theme="gold"]     .logo-ring::after { background: #D4AF37; box-shadow: 0 0 12px #D4AF37; }
[data-theme="midnight"] .logo-ring::after { background: #3b82f6; box-shadow: 0 0 12px #3b82f6; }
[data-theme="forest"]   .logo-ring::after { background: #22c55e; box-shadow: 0 0 12px #22c55e; }

.splash-title {
    font-size: 52px; font-weight: 800; letter-spacing: 0.06em;
    color: #ffffff; margin-bottom: 12px;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.7) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.splash-quote { color: var(--text-secondary); font-size: 16px; margin-bottom: 40px; min-height: 24px; }
.splash-progress-wrap { max-width: 320px; margin: 0 auto; }
.splash-progress { height: 3px; background: rgba(255,255,255,0.08); border-radius: 99px; overflow: hidden; margin-bottom: 12px; }
.splash-progress-fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width 0.1s linear; box-shadow: 0 0 8px var(--primary); }
.splash-percent { color: var(--text-muted); font-size: 13px; font-weight: 600; }

@keyframes splashFadeIn { from { opacity:0; transform: translateY(24px); } to { opacity:1; transform: translateY(0); } }
@keyframes logoRotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════
   AUTH GUARD OVERLAY
══════════════════════════════════════════════════════ */
.auth-guard-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
    z-index: 8000; display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.2s ease;
}
.auth-guard-modal {
    background: var(--bg-card); border: 1px solid var(--border-strong);
    border-radius: 24px; padding: 48px 40px; max-width: 420px; width: 90%;
    text-align: center; box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.auth-guard-icon { font-size: 56px; margin-bottom: 20px; animation: pulse 2s ease infinite; }
.auth-guard-modal h2 { font-size: 24px; font-weight: 800; margin-bottom: 12px; }
.auth-guard-modal p  { color: var(--text-secondary); font-size: 15px; line-height: 1.6; margin-bottom: 28px; }
.auth-guard-btn {
    width: 100%; padding: 16px; background: var(--primary); color: var(--bg-dark);
    border-radius: var(--radius-sm); font-weight: 700; font-size: 16px;
    margin-bottom: 12px; transition: all var(--transition);
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.auth-guard-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,255,255,0.15); }
.auth-guard-skip {
    width: 100%; padding: 14px; background: transparent;
    border: 1px solid var(--border); color: var(--text-secondary);
    border-radius: var(--radius-sm); font-weight: 500; font-size: 15px;
    transition: all var(--transition);
}
.auth-guard-skip:hover { background: var(--bg-input); color: var(--text-primary); }

/* ══════════════════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════════════════ */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 40px 20px; position: relative; overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(255,255,255,0.06) 0%, transparent 60%);
    pointer-events: none;
}
[data-theme="gold"] .login-page::before { background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(212,175,55,0.1) 0%, transparent 60%); }
[data-theme="midnight"] .login-page::before { background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(59,130,246,0.1) 0%, transparent 60%); }
[data-theme="forest"] .login-page::before { background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(34,197,94,0.08) 0%, transparent 60%); }

.login-box {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 28px; padding: 56px 48px; max-width: 440px; width: 100%;
    box-shadow: var(--shadow-lg); position: relative; z-index: 1;
    animation: slideUp 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
.login-logo { text-align: center; margin-bottom: 40px; }
.login-logo-ring { width: 80px; height: 80px; margin: 0 auto 20px; border-radius: 50%;
    border: 2px solid var(--border-strong); display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    animation: logoRotate 8s linear infinite; position: relative; }
.login-logo-ring::after { content:''; position:absolute; width:10px; height:10px;
    background: var(--primary); border-radius:50%; top: 0; left:50%; transform:translateX(-50%);
    box-shadow: 0 0 8px var(--primary); }
.login-title { font-size: 28px; font-weight: 800; letter-spacing: 0.04em; }
.login-subtitle { color: var(--text-secondary); font-size: 14px; margin-top: 6px; }
.login-divider { margin: 28px 0; text-align: center; color: var(--text-muted); font-size: 13px; position: relative; }
.login-divider::before, .login-divider::after { content:''; position:absolute; top:50%; width: 40%; height:1px; background: var(--border); }
.login-divider::before { left:0; }
.login-divider::after { right:0; }
.google-btn {
    width: 100%; padding: 16px; background: #ffffff; color: #111827;
    border-radius: var(--radius-sm); font-weight: 700; font-size: 15px;
    display: flex; align-items: center; justify-content: center; gap: 12px;
    transition: all var(--transition); border: 1px solid rgba(0,0,0,0.08);
}
.google-btn:hover { background: #f3f4f6; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.login-terms { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 20px; line-height: 1.6; }

/* ══════════════════════════════════════════════════════
   MAIN APP LAYOUT
══════════════════════════════════════════════════════ */
.app-layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w); min-height: 100vh;
    background: var(--bg-card); border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 500;
    transition: transform var(--transition), width var(--transition);
    backdrop-filter: blur(20px);
}
.sidebar.collapsed { width: 68px; }
.sidebar.mobile-open { transform: translateX(0) !important; }
.sidebar-header {
    padding: 20px 16px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px; min-height: var(--topbar-h);
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; flex: 1; overflow: hidden; }
.sidebar-logo-icon {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    background: var(--primary); display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 900; color: var(--bg-dark);
    box-shadow: 0 4px 12px rgba(255,255,255,0.15);
}
.sidebar-logo-text { font-size: 15px; font-weight: 800; letter-spacing: 0.03em; white-space: nowrap; transition: opacity var(--transition); }
.sidebar.collapsed .sidebar-logo-text { opacity: 0; width: 0; overflow: hidden; }
.sidebar-collapse-btn {
    width: 28px; height: 28px; border-radius: 8px; background: var(--bg-input);
    border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); transition: all var(--transition); flex-shrink: 0; font-size: 12px;
}
.sidebar-collapse-btn:hover { background: var(--primary); color: var(--bg-dark); border-color: var(--primary); }
.sidebar.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }

.sidebar-nav { flex: 1; padding: 16px 10px; overflow-y: auto; overflow-x: hidden; }
.nav-section-label {
    font-size: 10px; font-weight: 700; letter-spacing: 0.12em; color: var(--text-muted);
    text-transform: uppercase; padding: 8px 10px 6px; white-space: nowrap;
    transition: opacity var(--transition);
}
.sidebar.collapsed .nav-section-label { opacity: 0; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 10px; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 14px; font-weight: 500;
    cursor: pointer; transition: all var(--transition);
    margin-bottom: 2px; white-space: nowrap; overflow: hidden;
    position: relative;
}
.nav-item:hover { background: var(--bg-input); color: var(--text-primary); }
.nav-item.active {
    background: rgba(255,255,255,0.08); color: var(--primary);
    font-weight: 600;
}
.nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 60%; background: var(--primary); border-radius: 0 3px 3px 0;
    box-shadow: 0 0 8px var(--primary);
}
[data-theme="gold"] .nav-item.active { background: rgba(212,175,55,0.08); }
[data-theme="midnight"] .nav-item.active { background: rgba(59,130,246,0.08); }
[data-theme="forest"] .nav-item.active { background: rgba(34,197,94,0.08); }
.nav-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 18px; }
.nav-label { flex: 1; transition: opacity var(--transition); min-width: 0; }
.sidebar.collapsed .nav-label { opacity: 0; width: 0; overflow: hidden; }
.nav-badge {
    background: var(--primary); color: var(--bg-dark);
    font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px;
    min-width: 20px; text-align: center; transition: opacity var(--transition);
}
.sidebar.collapsed .nav-badge { opacity: 0; }

.sidebar-user {
    padding: 16px; border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px; overflow: hidden;
    cursor: pointer; transition: background var(--transition); border-radius: 0 0 0 0;
}
.sidebar-user:hover { background: var(--bg-input); }
.sidebar-user-avatar {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    background: var(--bg-input); border: 2px solid var(--border-strong);
    display: flex; align-items: center; justify-content: center; font-size: 16px;
    overflow: hidden; object-fit: cover;
}
.sidebar-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user-info { flex: 1; overflow: hidden; transition: opacity var(--transition); }
.sidebar-user-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-level { font-size: 11px; color: var(--primary); font-weight: 600; }
.sidebar.collapsed .sidebar-user-info { opacity: 0; width: 0; }

/* ── Topbar ──────────────────────────────────────────── */
.topbar {
    position: fixed; top: 0; right: 0; left: var(--sidebar-w);
    height: var(--topbar-h); background: rgba(0,0,0,0.7); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border); z-index: 400;
    display: flex; align-items: center; padding: 0 28px; gap: 16px;
    transition: left var(--transition);
}
.sidebar.collapsed ~ .topbar,
body.sidebar-collapsed .topbar { left: 68px; }
.topbar-title { font-size: 18px; font-weight: 700; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

/* Clock widget */
.clock-widget {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 6px 14px;
    font-size: 13px; font-weight: 600; cursor: pointer; position: relative;
    transition: all var(--transition); user-select: none;
}
.clock-widget:hover { border-color: var(--primary); }
.clock-time { font-size: 15px; font-weight: 700; letter-spacing: 0.04em; }
.clock-date { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.clock-arrow { color: var(--text-muted); font-size: 10px; transition: transform var(--transition); }
.clock-widget.open .clock-arrow { transform: rotate(180deg); }
.clock-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: var(--bg-card); border: 1px solid var(--border-strong);
    border-radius: var(--radius); padding: 8px; min-width: 260px;
    box-shadow: var(--shadow-lg); z-index: 1000;
    display: none; flex-direction: column; gap: 2px;
    max-height: 320px; overflow-y: auto;
}
.clock-widget.open .clock-dropdown { display: flex; animation: fadeIn 0.15s ease; }
.clock-tz-option {
    padding: 10px 12px; border-radius: 8px; font-size: 13px;
    cursor: pointer; transition: background var(--transition); display: flex; align-items: center; gap: 8px;
}
.clock-tz-option:hover { background: var(--bg-input); }
.clock-tz-option.active { background: rgba(255,255,255,0.06); color: var(--primary); font-weight: 600; }
.clock-calendar-mini { padding: 12px; border-top: 1px solid var(--border); margin-top: 8px; }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-weight: 600; font-size: 13px; }
.cal-nav { background: none; color: var(--text-secondary); font-size: 16px; padding: 2px 6px; border-radius: 6px; transition: all var(--transition); }
.cal-nav:hover { background: var(--bg-input); color: var(--text-primary); }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.cal-day-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-align: center; padding: 2px 0; }
.cal-day {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    font-size: 11px; border-radius: 6px; cursor: pointer; transition: all var(--transition);
}
.cal-day:hover { background: var(--bg-input); }
.cal-day.today { background: var(--primary); color: var(--bg-dark); font-weight: 700; }
.cal-day.other-month { opacity: 0.3; }

/* Notification bell */
.notif-btn {
    width: 38px; height: 38px; border-radius: 10px; background: var(--bg-input);
    border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); font-size: 16px; transition: all var(--transition); position: relative;
}
.notif-btn:hover { border-color: var(--primary); color: var(--primary); }
.notif-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; border: 2px solid var(--bg-card); }
.mobile-menu-btn { display: none; width: 38px; height: 38px; border-radius: 10px; background: var(--bg-input); border: 1px solid var(--border); align-items: center; justify-content: center; color: var(--text-secondary); font-size: 20px; }

/* ── Main Content ─────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w); margin-top: var(--topbar-h);
    min-height: calc(100vh - var(--topbar-h)); transition: margin-left var(--transition);
    position: relative; z-index: 1;
}
.sidebar.collapsed ~ .main-content,
body.sidebar-collapsed .main-content { margin-left: 68px; }

.page {
    display: none; padding: 32px 36px; min-height: calc(100vh - var(--topbar-h));
    animation: pageEnter 0.3s ease;
}
.page.active { display: block; }
.page-header { margin-bottom: 28px; }
.page-title { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.page-subtitle { color: var(--text-secondary); font-size: 15px; }
@keyframes pageEnter { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

/* ── Cards & Grids ────────────────────────────────────── */
.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--glow); }
.section-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.section-title .count { font-size: 12px; background: var(--bg-input); color: var(--text-muted); padding: 2px 8px; border-radius: 99px; font-weight: 600; }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px; text-align: center;
    transition: all var(--transition); position: relative; overflow: hidden;
}
.stat-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--glow); }
.stat-card::before { content:''; position:absolute; inset:0; background: linear-gradient(135deg, rgba(255,255,255,0.03), transparent); pointer-events:none; }
.stat-value { font-size: 36px; font-weight: 800; color: var(--primary); line-height:1; }
.stat-label { color: var(--text-secondary); font-size: 13px; margin-top: 6px; font-weight: 500; }
.stat-change { font-size: 12px; margin-top: 4px; font-weight: 600; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── Form Elements ────────────────────────────────────── */
input, textarea, select {
    width: 100%; padding: 12px 16px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-primary); font-size: 14px;
    transition: all var(--transition); resize: vertical;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,255,255,0.06); }
[data-theme="gold"] input:focus,[data-theme="gold"] textarea:focus,[data-theme="gold"] select:focus { box-shadow: 0 0 0 3px rgba(212,175,55,0.12); }
[data-theme="midnight"] input:focus,[data-theme="midnight"] textarea:focus,[data-theme="midnight"] select:focus { box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
[data-theme="forest"] input:focus,[data-theme="forest"] textarea:focus,[data-theme="forest"] select:focus { box-shadow: 0 0 0 3px rgba(34,197,94,0.1); }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
select option { background: var(--bg-card); }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-group { margin-bottom: 16px; }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
    padding: 11px 22px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 14px; transition: all var(--transition);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: var(--primary); color: var(--bg-dark); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,255,255,0.2); }
[data-theme="gold"] .btn-primary:hover { box-shadow: 0 6px 20px rgba(212,175,55,0.3); }
[data-theme="midnight"] .btn-primary:hover { box-shadow: 0 6px 20px rgba(59,130,246,0.3); }
[data-theme="forest"] .btn-primary:hover { box-shadow: 0 6px 20px rgba(34,197,94,0.25); }
.btn-secondary { background: var(--bg-input); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: rgba(239,68,68,0.1); color: var(--danger); border-color: rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; font-size: 16px; }

/* ── FAB (Floating Action Button) ────────────────────── */
.fab {
    position: fixed; bottom: 32px; left: calc(var(--sidebar-w) + 24px);
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--primary); color: var(--bg-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 300; box-shadow: 0 8px 24px rgba(255,255,255,0.2);
    transition: all var(--transition); z-index: 300; cursor: pointer; border: none;
}
.fab:hover { transform: scale(1.12) rotate(45deg); box-shadow: 0 12px 32px rgba(255,255,255,0.3); }
[data-theme="gold"] .fab { box-shadow: 0 8px 24px rgba(212,175,55,0.4); }
[data-theme="midnight"] .fab { box-shadow: 0 8px 24px rgba(59,130,246,0.4); }
[data-theme="forest"] .fab { box-shadow: 0 8px 24px rgba(34,197,94,0.3); }
.sidebar.collapsed ~ .fab,
body.sidebar-collapsed .fab { left: 80px; }

/* ══════════════════════════════════════════════════════
   DASHBOARD
══════════════════════════════════════════════════════ */
.dashboard-hero {
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid var(--border); border-radius: 24px; padding: 36px;
    margin-bottom: 28px; display: flex; justify-content: space-between; align-items: center; gap: 32px;
    position: relative; overflow: hidden;
}
[data-theme="gold"] .dashboard-hero { background: linear-gradient(135deg, rgba(212,175,55,0.1), rgba(212,175,55,0.03)); }
[data-theme="midnight"] .dashboard-hero { background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(59,130,246,0.03)); }
[data-theme="forest"] .dashboard-hero { background: linear-gradient(135deg, rgba(34,197,94,0.08), rgba(34,197,94,0.02)); }
.dashboard-hero::after {
    content:''; position:absolute; right:-60px; top:-60px; width:280px; height:280px;
    border-radius:50%; background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    pointer-events:none;
}
.hero-greeting { font-size: 32px; font-weight: 800; margin-bottom: 8px; }
.hero-greeting span { color: var(--primary); }
.hero-meta { color: var(--text-secondary); font-size: 15px; }
.hero-stats { display: flex; gap: 24px; flex-shrink: 0; }
.hero-stat { text-align: center; }
.hero-stat-value { font-size: 32px; font-weight: 800; color: var(--primary); line-height: 1; }
.hero-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.dashboard-wide { grid-column: span 2; }

/* Heatmap */
.heatmap-wrap { overflow-x: auto; }
.heatmap-grid { display: flex; gap: 4px; }
.heatmap-week { display: flex; flex-direction: column; gap: 4px; }
.heatmap-cell {
    width: 14px; height: 14px; border-radius: 3px;
    background: var(--bg-input); transition: all var(--transition);
    cursor: pointer;
}
.heatmap-cell:hover { transform: scale(1.3); }
.heatmap-cell.l1 { background: rgba(255,255,255,0.15); }
.heatmap-cell.l2 { background: rgba(255,255,255,0.35); }
.heatmap-cell.l3 { background: rgba(255,255,255,0.6); }
.heatmap-cell.l4 { background: var(--primary); box-shadow: 0 0 6px var(--primary); }
[data-theme="gold"] .heatmap-cell.l4 { box-shadow: 0 0 6px #D4AF37; }
[data-theme="midnight"] .heatmap-cell.l4 { box-shadow: 0 0 6px #3b82f6; }
[data-theme="forest"] .heatmap-cell.l4 { box-shadow: 0 0 6px #22c55e; }

/* XP Progress */
.xp-bar-wrap { background: var(--bg-input); border-radius: 99px; height: 8px; margin: 12px 0 4px; overflow: hidden; }
.xp-bar-fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width 0.8s cubic-bezier(0.34,1.56,0.64,1); box-shadow: 0 0 8px var(--primary); }
.xp-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }

/* Recent activity */
.activity-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 0;
    border-bottom: 1px solid var(--border); animation: slideUp 0.3s ease both;
}
.activity-item:last-child { border-bottom: none; }
.activity-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--bg-input); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.activity-text { flex: 1; }
.activity-title { font-size: 14px; font-weight: 500; }
.activity-time  { font-size: 12px; color: var(--text-muted); }

/* Streak ring */
.streak-ring { width: 120px; height: 120px; margin: 0 auto; position: relative; }
.streak-ring svg { transform: rotate(-90deg); }
.streak-ring-bg { stroke: var(--bg-input); }
.streak-ring-fill { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(0.34,1.56,0.64,1); }
.streak-ring-value { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.streak-ring-num { font-size: 28px; font-weight: 800; }
.streak-ring-label { font-size: 11px; color: var(--text-muted); font-weight: 600; }

/* ══════════════════════════════════════════════════════
   MISSIONS (TASKS)
══════════════════════════════════════════════════════ */
.missions-layout { display: grid; grid-template-columns: 1fr 380px; gap: 24px; }
.task-form-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.task-item {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 10px;
    display: flex; align-items: flex-start; gap: 12px;
    transition: all var(--transition); animation: slideUp 0.25s ease both;
}
.task-item:hover { border-color: var(--border-strong); transform: translateX(4px); }
.task-item.completed { opacity: 0.55; }
.task-item.completed .task-title { text-decoration: line-through; color: var(--text-muted); }
.task-checkbox {
    width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border-strong);
    flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all var(--transition); margin-top: 2px;
}
.task-checkbox.checked { background: var(--primary); border-color: var(--primary); }
.task-checkbox.checked::after { content: '✓'; font-size: 12px; color: var(--bg-dark); font-weight: 700; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.task-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; font-weight: 600; }
.task-tag.high { background: rgba(239,68,68,0.12); color: var(--danger); }
.task-tag.medium { background: rgba(245,158,11,0.12); color: var(--warning); }
.task-tag.low { background: rgba(34,197,94,0.12); color: var(--success); }
.task-tag.cat { background: var(--bg-input); color: var(--text-muted); }
.task-due { font-size: 12px; color: var(--text-muted); }
.task-due.overdue { color: var(--danger); }
.task-actions { display: flex; gap: 6px; }
.task-actions button { width: 30px; height: 30px; border-radius: 8px; background: var(--bg-input); border: none; color: var(--text-muted); font-size: 13px; display: flex; align-items: center; justify-content: center; transition: all var(--transition); cursor: pointer; }
.task-actions button:hover { background: var(--danger); color: white; }
.priority-badge { display: inline-flex; align-items: center; gap: 4px; }
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-btn { padding: 6px 14px; border-radius: 99px; font-size: 13px; font-weight: 500; background: var(--bg-input); border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer; transition: all var(--transition); }
.filter-btn.active { background: var(--primary); color: var(--bg-dark); border-color: var(--primary); }
.chart-type-select { padding: 6px 12px; border-radius: 8px; font-size: 12px; width: auto; }
.chart-container { height: 220px; position: relative; margin-top: 12px; }
.chart-container canvas { border-radius: 12px; }

/* ══════════════════════════════════════════════════════
   HABITS
══════════════════════════════════════════════════════ */
.habits-layout { display: grid; grid-template-columns: 1fr 380px; gap: 24px; }
.habit-item {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 18px 20px; margin-bottom: 10px;
    display: flex; align-items: center; gap: 14px;
    transition: all var(--transition); animation: slideUp 0.25s ease both; cursor: default;
}
.habit-item:hover { border-color: var(--primary); transform: translateX(4px); }
.habit-check-btn {
    width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--border-strong);
    background: var(--bg-input); display: flex; align-items: center; justify-content: center;
    font-size: 20px; cursor: pointer; transition: all var(--transition); flex-shrink: 0;
}
.habit-check-btn.checked { background: var(--success); border-color: var(--success); animation: checkBounce 0.4s cubic-bezier(0.34,1.56,0.64,1); }
.habit-check-btn.checked::after { content: '✓'; font-size: 20px; color: white; font-weight: 700; }
.habit-body { flex: 1; min-width: 0; }
.habit-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.habit-meta { display: flex; align-items: center; gap: 8px; }
.habit-streak-badge { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--warning); }
.habit-mini-bar { flex: 1; height: 4px; background: var(--bg-input); border-radius: 99px; overflow: hidden; margin: 6px 0 0; }
.habit-mini-bar-fill { height: 100%; background: var(--success); border-radius: 99px; }
.habit-freq { font-size: 11px; color: var(--text-muted); padding: 2px 8px; background: var(--bg-input); border-radius: 99px; }
.habit-actions { display: flex; gap: 6px; flex-shrink: 0; }
.habit-actions button { width: 30px; height: 30px; border-radius: 8px; background: var(--bg-input); border: none; color: var(--text-muted); font-size: 13px; cursor: pointer; transition: all var(--transition); display: flex; align-items: center; justify-content: center; }
.habit-actions button:hover { background: var(--danger); color: white; }
.habit-add-form { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.habits-chart-section { margin-top: 24px; }
@keyframes checkBounce { 0%{transform:scale(0.8)} 60%{transform:scale(1.15)} 100%{transform:scale(1)} }

/* ══════════════════════════════════════════════════════
   FOCUS TIMER
══════════════════════════════════════════════════════ */
.focus-layout { display: grid; grid-template-columns: 1fr 380px; gap: 24px; max-width: 1000px; }
.timer-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 24px; padding: 48px; text-align: center; }
.timer-circle { width: 220px; height: 220px; margin: 0 auto 32px; position: relative; }
.timer-circle svg { transform: rotate(-90deg); }
.timer-circle-bg { stroke: var(--bg-input); }
.timer-circle-fill { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset 0.5s linear; filter: drop-shadow(0 0 8px var(--primary)); }
.timer-display { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.timer-time { font-size: 52px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.timer-session-type { font-size: 13px; color: var(--text-muted); font-weight: 600; margin-top: 4px; }
.timer-presets { display: flex; justify-content: center; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.timer-preset { padding: 8px 18px; border-radius: 99px; background: var(--bg-input); border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: all var(--transition); }
.timer-preset:hover,.timer-preset.active { background: var(--primary); color: var(--bg-dark); border-color: var(--primary); }
.timer-controls { display: flex; justify-content: center; gap: 12px; }
.timer-btn { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--bg-input); color: var(--text-primary); font-size: 22px; cursor: pointer; transition: all var(--transition); display: flex; align-items: center; justify-content: center; }
.timer-btn.main { width: 72px; height: 72px; background: var(--primary); color: var(--bg-dark); border-color: var(--primary); font-size: 28px; }
.timer-btn:hover { transform: scale(1.1); }
.timer-btn.main:hover { box-shadow: 0 8px 24px rgba(255,255,255,0.2); }
.focus-sessions-list { max-height: 400px; overflow-y: auto; }
.focus-session-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.focus-session-item:last-child { border-bottom: none; }

/* ══════════════════════════════════════════════════════
   STUDY NOTES
══════════════════════════════════════════════════════ */
.study-layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; height: calc(100vh - 180px); }
.notes-sidebar { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.notes-sidebar-header { padding: 16px; border-bottom: 1px solid var(--border); }
.notes-search { margin-top: 10px; }
.notes-list { flex: 1; overflow-y: auto; padding: 8px; }
.note-list-item {
    padding: 12px 14px; border-radius: var(--radius-sm); cursor: pointer;
    transition: all var(--transition); margin-bottom: 4px; border: 1px solid transparent;
}
.note-list-item:hover { background: var(--bg-input); }
.note-list-item.active { background: rgba(255,255,255,0.05); border-color: var(--border-strong); }
.note-list-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-list-preview { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-list-date { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.notes-editor { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.notes-editor-toolbar { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.notes-editor-toolbar input { flex: 1; min-width: 160px; background: var(--bg-input); border-radius: 8px; font-size: 16px; font-weight: 700; }
.note-tag-input { max-width: 140px; font-size: 12px; }
.note-body { flex: 1; padding: 0; }
.note-body textarea { height: 100%; border: none; background: transparent; padding: 24px; font-size: 15px; line-height: 1.7; resize: none; border-radius: 0; }
.note-body textarea:focus { box-shadow: none; }
.notes-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.notes-autosave { font-size: 12px; color: var(--text-muted); }
.notes-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 16px; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════
   FLASHCARDS
══════════════════════════════════════════════════════ */
.flashcards-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; }
.flashcard-arena { text-align: center; }
.flashcard-wrap { perspective: 1000px; height: 280px; margin: 0 auto 24px; max-width: 500px; cursor: pointer; }
.flashcard-inner {
    width: 100%; height: 100%; position: relative;
    transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
.flashcard-inner.flipped { transform: rotateY(180deg); }
.flashcard-face {
    position: absolute; inset: 0; backface-visibility: hidden;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 32px; box-shadow: var(--shadow);
}
.flashcard-face.back { transform: rotateY(180deg); background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)); }
.flashcard-label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 16px; }
.flashcard-text { font-size: 22px; font-weight: 700; line-height: 1.4; }
.flashcard-hint { font-size: 12px; color: var(--text-muted); margin-top: 16px; }
.flashcard-controls { display: flex; justify-content: center; gap: 12px; margin-bottom: 20px; }
.flashcard-counter { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; font-weight: 600; }
.flashcard-rate-btns { display: flex; justify-content: center; gap: 10px; }
.fc-rate { padding: 10px 24px; border-radius: 99px; font-weight: 700; font-size: 14px; cursor: pointer; transition: all var(--transition); border: 2px solid; }
.fc-rate.hard { border-color: var(--danger); color: var(--danger); background: rgba(239,68,68,0.08); }
.fc-rate.hard:hover { background: rgba(239,68,68,0.2); }
.fc-rate.ok { border-color: var(--warning); color: var(--warning); background: rgba(245,158,11,0.08); }
.fc-rate.ok:hover { background: rgba(245,158,11,0.2); }
.fc-rate.easy { border-color: var(--success); color: var(--success); background: rgba(34,197,94,0.08); }
.fc-rate.easy:hover { background: rgba(34,197,94,0.2); }
.fc-form { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.fc-list { margin-top: 16px; max-height: 320px; overflow-y: auto; }
.fc-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-input); border-radius: var(--radius-sm); margin-bottom: 6px; }
.fc-item-text { flex: 1; font-size: 13px; }
.fc-item-q { font-weight: 600; }
.fc-item-a { color: var(--text-muted); font-size: 12px; }

/* ══════════════════════════════════════════════════════
   COMMUNITY CHAT
══════════════════════════════════════════════════════ */
.chat-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; height: calc(100vh - 180px); }
.chat-sidebar { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.chat-room-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition); margin-bottom: 4px; }
.chat-room-item:hover { background: var(--bg-input); }
.chat-room-item.active { background: rgba(255,255,255,0.06); border: 1px solid var(--border-strong); }
.chat-room-icon { font-size: 20px; }
.chat-room-name { font-weight: 600; font-size: 14px; }
.chat-online { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--success); margin-top: 16px; }
.chat-main { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.chat-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.chat-header h3 { font-weight: 700; font-size: 16px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.chat-msg { display: flex; gap: 10px; align-items: flex-start; animation: fadeIn 0.2s ease; }
.chat-msg.own { flex-direction: row-reverse; }
.chat-msg-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-input); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; overflow: hidden; }
.chat-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-msg-bubble { max-width: 70%; }
.chat-msg-name { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; font-weight: 600; }
.chat-msg-own .chat-msg-name { text-align: right; }
.chat-msg-text { background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px 12px 12px 2px; padding: 10px 14px; font-size: 14px; line-height: 1.5; }
.chat-msg.own .chat-msg-text { background: var(--primary); color: var(--bg-dark); border-color: var(--primary); border-radius: 12px 12px 2px 12px; }
.chat-msg-time { font-size: 10px; color: var(--text-muted); margin-top: 4px; }
.chat-input-row { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-end; }
.chat-input-row textarea { flex: 1; min-height: 44px; max-height: 120px; resize: none; border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; }
.chat-send-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: var(--bg-dark); border: none; font-size: 18px; cursor: pointer; transition: all var(--transition); flex-shrink: 0; }
.chat-send-btn:hover { transform: scale(1.1); }

/* ══════════════════════════════════════════════════════
   AI ASSISTANT
══════════════════════════════════════════════════════ */
.ai-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
.ai-chat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 24px; display: flex; flex-direction: column; height: calc(100vh - 200px); min-height: 500px; overflow: hidden; }
.ai-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; }
.ai-avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); display: flex; align-items: center; justify-content: center; font-size: 20px; box-shadow: 0 4px 12px rgba(255,255,255,0.15); animation: pulse 3s ease infinite; flex-shrink: 0; }
.ai-info h3 { font-size: 16px; font-weight: 700; }
.ai-info span { font-size: 12px; color: var(--success); }
.ai-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.ai-msg { display: flex; gap: 10px; align-items: flex-start; animation: slideUp 0.25s ease; }
.ai-msg.user { flex-direction: row-reverse; }
.ai-msg-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-input); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.ai-msg.user .ai-msg-icon { background: var(--primary); color: var(--bg-dark); font-weight: 700; }
.ai-msg-text { max-width: 80%; background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px 12px 12px 2px; padding: 12px 16px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.ai-msg.user .ai-msg-text { background: var(--primary); color: var(--bg-dark); border-radius: 12px 12px 2px 12px; border-color: transparent; }
.ai-typing { display: flex; gap: 4px; padding: 12px 16px; }
.ai-typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); animation: typingDot 1.2s ease infinite; }
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot { 0%,60%,100%{transform:translateY(0);opacity:0.5} 30%{transform:translateY(-6px);opacity:1} }
.ai-input-row { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; }
.ai-input { flex: 1; border-radius: var(--radius-sm); font-size: 14px; min-height: 44px; }
.ai-send { width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: var(--bg-dark); border: none; font-size: 18px; cursor: pointer; transition: all var(--transition); flex-shrink: 0; }
.ai-send:hover { transform: scale(1.1); }
.ai-suggestions { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.ai-suggestion-btn { width: 100%; text-align: left; padding: 12px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary); cursor: pointer; margin-bottom: 8px; transition: all var(--transition); display: flex; align-items: center; gap: 8px; }
.ai-suggestion-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateX(4px); }

/* ══════════════════════════════════════════════════════
   ANALYTICS
══════════════════════════════════════════════════════ */
.analytics-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-bottom: 24px; }
.analytics-full { grid-column: 1/-1; }
.analytics-half { grid-column: span 1; }
.analytics-two { grid-column: span 2; }
.progress-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.progress-item:last-child { border-bottom: none; }
.progress-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.progress-bar { height: 6px; background: var(--bg-input); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--primary); transition: width 0.8s cubic-bezier(0.34,1.56,0.64,1); }
.analytics-select-wrap { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }

/* ══════════════════════════════════════════════════════
   NEWS
══════════════════════════════════════════════════════ */
.news-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.news-tab { padding: 8px 18px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--bg-input); border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer; transition: all var(--transition); }
.news-tab.active { background: var(--primary); color: var(--bg-dark); border-color: var(--primary); }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.news-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px; transition: all var(--transition); cursor: pointer;
    display: flex; flex-direction: column; gap: 10px;
    animation: slideUp 0.3s ease both;
}
.news-card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: var(--glow); }
.news-card-source { font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.08em; }
.news-card-title { font-size: 15px; font-weight: 700; line-height: 1.4; }
.news-card-summary { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.news-card-date { font-size: 11px; color: var(--text-muted); margin-top: auto; }

/* ══════════════════════════════════════════════════════
   ACCOUNT / PROFILE
══════════════════════════════════════════════════════ */
.profile-layout { display: grid; grid-template-columns: 320px 1fr; gap: 24px; }
.profile-card-main { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; text-align: center; }
.profile-avatar-wrap { position: relative; width: 110px; margin: 0 auto 20px; }
.profile-avatar { width: 110px; height: 110px; border-radius: 50%; background: var(--bg-input); border: 3px solid var(--primary); display: flex; align-items: center; justify-content: center; font-size: 48px; overflow: hidden; box-shadow: 0 0 24px rgba(255,255,255,0.1); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-edit { position: absolute; bottom: 0; right: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: var(--bg-dark); border: 2px solid var(--bg-card); display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; }
.profile-name-display { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.profile-level-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 99px; background: rgba(255,255,255,0.06); border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--primary); margin-bottom: 16px; }
.profile-bio { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; }
.profile-stats-mini { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 16px; }
.profile-stat-mini { background: var(--bg-input); border-radius: var(--radius-sm); padding: 14px 10px; text-align: center; }
.profile-stat-mini .val { font-size: 22px; font-weight: 800; color: var(--primary); }
.profile-stat-mini .lbl { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-top: 3px; }
.profile-right { display: flex; flex-direction: column; gap: 20px; }
.badges-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(100px,1fr)); gap: 12px; }
.badge-item { background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 12px; text-align: center; transition: all var(--transition); }
.badge-item:hover { border-color: var(--primary); transform: translateY(-3px); }
.badge-item.locked { opacity: 0.35; filter: grayscale(1); }
.badge-icon { font-size: 32px; margin-bottom: 8px; }
.badge-name { font-size: 12px; font-weight: 600; color: var(--text-secondary); }

/* ══════════════════════════════════════════════════════
   SETTINGS
══════════════════════════════════════════════════════ */
.settings-container { max-width: 720px; }
.settings-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; margin-bottom: 20px; }
.settings-section-title { font-size: 16px; font-weight: 700; color: var(--primary); margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.setting-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); gap: 16px; }
.setting-item:last-child { border-bottom: none; }
.setting-info h4 { font-size: 14px; font-weight: 600; }
.setting-info p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.setting-item select, .setting-item input { width: auto; min-width: 140px; margin: 0; }
.theme-swatches { display: flex; gap: 10px; }
.theme-swatch { width: 36px; height: 36px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: all var(--transition); }
.theme-swatch:hover { transform: scale(1.15); }
.theme-swatch.active { border-color: var(--text-primary); box-shadow: 0 0 12px var(--primary); }
.toggle { width: 44px; height: 24px; border-radius: 99px; background: var(--bg-input); border: 1px solid var(--border); position: relative; cursor: pointer; transition: all var(--transition); flex-shrink: 0; }
.toggle.on { background: var(--success); border-color: var(--success); }
.toggle::after { content:''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: white; top: 2px; left: 2px; transition: transform var(--transition); }
.toggle.on::after { transform: translateX(20px); }
.danger-zone { border-color: rgba(239,68,68,0.3); }
.danger-zone .settings-section-title { color: var(--danger); }

/* ══════════════════════════════════════════════════════
   ADMIN DASHBOARD
══════════════════════════════════════════════════════ */
.admin-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.admin-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.admin-stat-val { font-size: 36px; font-weight: 800; color: var(--primary); }
.admin-stat-lbl { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.admin-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.admin-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: var(--primary); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-input); }
.admin-activity-feed { max-height: 400px; overflow-y: auto; }
.admin-activity-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.admin-activity-item:last-child { border-bottom: none; }
.admin-activity-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.admin-activity-text { flex: 1; }
.admin-activity-time { color: var(--text-muted); font-size: 11px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════
   TUTORIAL OVERLAY
══════════════════════════════════════════════════════ */
.tutorial-overlay { position: fixed; inset: 0; z-index: 7000; pointer-events: none; }
.tutorial-overlay.active { pointer-events: all; }
.tutorial-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); }
.tutorial-card {
    position: absolute; background: var(--bg-card); border: 1px solid var(--border-strong);
    border-radius: 20px; padding: 28px 32px; max-width: 360px; box-shadow: var(--shadow-lg);
    z-index: 7002; animation: tutorialFadeIn 0.3s ease;
    pointer-events: all;
}
.tutorial-step-badge { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: var(--primary); text-transform: uppercase; margin-bottom: 8px; }
.tutorial-card h2 { font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.tutorial-card p { color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin-bottom: 20px; }
.tutorial-actions { display: flex; gap: 10px; }
.tutorial-progress { display: flex; gap: 6px; margin-bottom: 16px; }
.tutorial-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bg-input); transition: all var(--transition); }
.tutorial-dot.active { background: var(--primary); width: 24px; border-radius: 99px; }
.tutorial-arrow { position: absolute; z-index: 7003; font-size: 28px; animation: bounce 1s ease infinite; pointer-events: none; }
.tutorial-highlight { position: absolute; border: 3px solid var(--primary); border-radius: var(--radius-sm); box-shadow: 0 0 0 4000px rgba(0,0,0,0.6), 0 0 24px var(--primary); z-index: 7001; transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1); pointer-events: none; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
@keyframes tutorialFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ══════════════════════════════════════════════════════
   MODAL / DIALOG
══════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
    z-index: 6000; display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
.modal { background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 24px; padding: 36px; max-width: 520px; width: 100%; box-shadow: var(--shadow-lg); animation: slideUp 0.35s cubic-bezier(0.34,1.56,0.64,1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-size: 20px; font-weight: 800; }
.modal-close { width: 32px; height: 32px; border-radius: 8px; background: var(--bg-input); border: 1px solid var(--border); color: var(--text-secondary); font-size: 16px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--transition); }
.modal-close:hover { background: var(--danger); color: white; }

/* ══════════════════════════════════════════════════════
   MISC UTILITIES
══════════════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }
.loading-spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 20px auto; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.fw-700 { font-weight: 700; }
.fs-13 { font-size: 13px; }
.fs-12 { font-size: 12px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--bg-input); border: 1px solid var(--border); color: var(--text-secondary); }

@keyframes fadeIn  { from{opacity:0} to{opacity:1} }
@keyframes slideUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
@keyframes spin    { to{transform:rotate(360deg)} }
@keyframes pulse   { 0%,100%{transform:scale(1)} 50%{transform:scale(1.05)} }
@keyframes shimmer { 0%{background-position:-200% 0} 100%{background-position:200% 0} }
.skeleton { background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-surface) 50%, var(--bg-input) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤1200px)
══════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2,1fr); }
    .missions-layout, .habits-layout, .ai-layout, .profile-layout { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-wide { grid-column: span 2; }
    .analytics-grid { grid-template-columns: repeat(2,1fr); }
    .analytics-two { grid-column: span 2; }
    .admin-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 1024px) {
    .focus-layout { grid-template-columns: 1fr; }
    .flashcards-layout { grid-template-columns: 1fr; }
    .chat-layout { grid-template-columns: 1fr; }
    .study-layout { grid-template-columns: 1fr; height: auto; }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤768px)
══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    :root { --sidebar-w: 260px; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.mobile-open { transform: translateX(0); box-shadow: 4px 0 40px rgba(0,0,0,0.5); }
    .topbar { left: 0 !important; padding: 0 16px; gap: 12px; }
    .main-content { margin-left: 0 !important; }
    .mobile-menu-btn { display: flex; }
    .fab { left: 16px; bottom: 20px; }
    .page { padding: 20px 16px 80px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-wide { grid-column: span 1; }
    .analytics-grid { grid-template-columns: 1fr; }
    .analytics-two, .analytics-full { grid-column: span 1; }
    .hero-stats { display: none; }
    .dashboard-hero { padding: 24px; }
    .hero-greeting { font-size: 22px; }
    .admin-grid { grid-template-columns: 1fr 1fr; }
    .login-box { padding: 36px 24px; }
    .flash-card-wrap { height: 220px; }
    .topbar-title { font-size: 15px; }
    .clock-widget { padding: 5px 10px; }
    .clock-time { font-size: 13px; }
    .clock-date { display: none; }
    .chat-layout { grid-template-columns: 1fr; }
    .chat-sidebar { display: none; }
    .profile-layout { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .modal { padding: 24px 20px; }
    .sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 499; display: none; }
    .sidebar-overlay.show { display: block; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .splash-title { font-size: 36px; }
    .logo-ring { width: 120px; height: 120px; }
    .timer-circle { width: 180px; height: 180px; }
    .timer-time { font-size: 40px; }
    .admin-grid { grid-template-columns: 1fr; }
}
