/* ==================== VARIABLES ==================== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #10b981;
    --accent: #f59e0b;
    --danger: #ef4444;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --border: #475569;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #64748b;
    --success: #22c55e;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* ==================== RESET ==================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ==================== LOADING ==================== */
.loading-screen {
    position: fixed; inset: 0; background: var(--bg);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
    z-index: 9999; transition: opacity 0.3s;
}
.loading-screen.hidden { opacity: 0; pointer-events: none; }
.loader {
    width: 48px; height: 48px; border: 4px solid var(--bg-card);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== PAGES ==================== */
.page { display: none; min-height: 100vh; }
.page.active { display: block; }
.player-page.active { display: flex; flex-direction: column; height: 100vh; }

/* ==================== AUTH ==================== */
.auth-page { display: none; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, var(--bg) 0%, #1a1a3e 100%); }
.auth-page.active { display: flex; }
.auth-card { width: 100%; max-width: 420px; background: var(--bg-card); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow); }
.auth-header { text-align: center; margin-bottom: 32px; }
.logo-icon { font-size: 48px; margin-bottom: 12px; }
.auth-header h1 { font-size: 24px; margin-bottom: 8px; }
.auth-header p { color: var(--text-muted); }
.auth-links { text-align: center; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.auth-links p { margin: 8px 0; color: var(--text-muted); }

/* ==================== FORMS ==================== */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--text-muted); font-size: 14px; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 12px 16px; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-family: inherit; font-size: 16px; transition: all 0.2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.form-group textarea { min-height: 100px; resize: vertical; }
.form-group small { display: block; margin-top: 6px; color: var(--text-dark); font-size: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.input-with-icon { position: relative; }
.input-with-icon input { padding-right: 48px; }
.icon-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 18px; opacity: 0.6; }
.icon-btn:hover { opacity: 1; }
.check-label { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.check-label input { width: 20px; height: 20px; accent-color: var(--primary); }

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border: none; border-radius: 8px; font-family: inherit;
    font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:disabled { background: var(--text-dark); cursor: not-allowed; transform: none; }
.btn-secondary { background: var(--secondary); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg-input); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg-input); }
.btn-danger { background: var(--danger); color: white; }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ==================== HEADER ==================== */
.header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px; background: var(--bg-card); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100; gap: 16px;
}
.header-left, .header-right { display: flex; align-items: center; gap: 12px; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; font-size: 18px; }
.logo:hover { text-decoration: none; }
.admin-tag { background: var(--accent); color: #000; padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.nav { display: flex; gap: 4px; }
.nav-link { padding: 8px 16px; color: var(--text-muted); border-radius: 8px; font-weight: 500; font-size: 14px; transition: all 0.2s; }
.nav-link:hover { color: var(--text); background: var(--bg-input); text-decoration: none; }
.nav-link.active { color: var(--primary); background: rgba(99,102,241,0.1); }
.user-name { color: var(--text-muted); font-size: 14px; }
.menu-btn { display: none; background: none; border: none; color: var(--text); font-size: 24px; cursor: pointer; padding: 8px; }
.menu-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 99; }
.menu-overlay.active { display: block; }
.admin-header { background: linear-gradient(90deg, var(--bg-card) 0%, #1e1e3f 100%); }
.player-header { background: rgba(15,23,42,0.98); flex-shrink: 0; }
.player-title { font-weight: 600; font-size: 14px; color: var(--text-muted); }
.progress-pill { background: var(--secondary); color: white; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }

@media (max-width: 900px) {
    .menu-btn { display: block; }
    .nav { position: fixed; top: 0; left: -280px; width: 280px; height: 100vh; background: var(--bg-card); flex-direction: column; padding: 80px 20px 20px; gap: 8px; z-index: 101; transition: left 0.3s; border-right: 1px solid var(--border); }
    .nav.active { left: 0; }
    .nav-link { padding: 12px 16px; width: 100%; }
    .user-name { display: none; }
}

/* ==================== MAIN CONTENT ==================== */
.main { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
@media (max-width: 600px) { .main { padding: 20px 16px; } }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.section { margin-bottom: 40px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-head h2 { font-size: 20px; }
.link { color: var(--primary); font-size: 14px; font-weight: 500; }
.subtitle { color: var(--text-muted); margin-bottom: 24px; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }

/* ==================== WELCOME BANNER ==================== */
.welcome-banner { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); padding: 32px; border-radius: var(--radius); margin-bottom: 32px; }
.welcome-banner h1 { font-size: 24px; margin-bottom: 8px; }
.welcome-banner p { opacity: 0.9; }

/* ==================== STATS ==================== */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.stat-icon.blue { background: rgba(99,102,241,0.1); }
.stat-icon.orange { background: rgba(245,158,11,0.1); }
.stat-icon.green { background: rgba(16,185,129,0.1); }
.stat-info { display: flex; flex-direction: column; }
.stat-num { font-size: 28px; font-weight: 700; }
.stat-label { font-size: 13px; color: var(--text-muted); }

/* ==================== COURSE GRID ==================== */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.course-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: all 0.2s; }
.course-card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 12px 40px rgba(99,102,241,0.15); }
.course-thumb { position: relative; aspect-ratio: 16/9; background: var(--bg-input); overflow: hidden; }
.course-thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-badge { position: absolute; top: 12px; left: 12px; background: var(--primary); color: white; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.course-badge.owned { background: var(--secondary); }
.course-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 4px; background: rgba(255,255,255,0.2); }
.course-progress-fill { height: 100%; background: var(--secondary); }
.course-body { padding: 16px; }
.course-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.course-meta { display: flex; gap: 16px; color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }
.course-price { font-size: 18px; font-weight: 700; color: var(--primary); }
.course-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* ==================== ENROLLED LIST ==================== */
.enrolled-list { display: flex; flex-direction: column; gap: 12px; }
.enrolled-item { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: all 0.2s; }
.enrolled-item:hover { border-color: var(--primary); }
.enrolled-thumb { width: 120px; height: 68px; border-radius: 8px; object-fit: cover; background: var(--bg-input); flex-shrink: 0; }
.enrolled-info { flex: 1; min-width: 0; }
.enrolled-info h4 { margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.enrolled-info .meta { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.status-badge.completed { background: rgba(16,185,129,0.2); color: var(--secondary); }
.status-badge.in-progress { background: rgba(245,158,11,0.2); color: var(--accent); }
.status-badge.not-started { background: rgba(148,163,184,0.2); color: var(--text-muted); }
.enrolled-pct { width: 80px; text-align: right; flex-shrink: 0; }
.enrolled-pct .pct { font-size: 18px; font-weight: 700; color: var(--secondary); }
.enrolled-pct .mini-bar { height: 4px; background: var(--bg-input); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.enrolled-pct .mini-fill { height: 100%; background: var(--secondary); }
@media (max-width: 600px) {
    .enrolled-item { flex-direction: column; align-items: flex-start; }
    .enrolled-thumb { width: 100%; height: auto; aspect-ratio: 16/9; }
    .enrolled-pct { width: 100%; text-align: left; margin-top: 8px; }
}

/* ==================== COURSE DETAIL ==================== */
.course-detail { display: grid; grid-template-columns: 280px 1fr 320px; gap: 24px; margin-bottom: 32px; }
@media (max-width: 1000px) { .course-detail { grid-template-columns: 1fr; } }
.cd-thumb { aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; background: var(--bg-card); border: 1px solid var(--border); }
.cd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cd-center { display: flex; flex-direction: column; gap: 16px; }
.cd-center h1 { font-size: 24px; }
.cd-about { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.cd-about h3 { font-size: 14px; margin-bottom: 8px; }
.cd-about p { color: var(--text-muted); font-size: 14px; line-height: 1.6; }
.cd-facilitator { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.cd-facilitator h4 { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.cd-facilitator .bio { color: var(--text-muted); margin-top: 8px; font-size: 13px; }
.cd-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.completion-pill { background: var(--secondary); color: white; padding: 12px 20px; border-radius: var(--radius); font-weight: 600; }
.cd-stats { display: flex; gap: 16px; }
.cd-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 20px; text-align: center; }
.cd-stat-num { display: block; font-size: 20px; font-weight: 700; color: var(--primary); }
.cd-stat-stars { display: block; font-size: 16px; color: var(--accent); }
.cd-stat-label { display: block; font-size: 12px; color: var(--text-muted); }
.lessons-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.lessons-head { padding: 12px 16px; font-weight: 600; font-size: 14px; border-bottom: 2px solid var(--primary); }
.lessons-body { max-height: 400px; overflow-y: auto; }
.lesson-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: all 0.2s; }
.lesson-row:hover { background: var(--bg-input); }
.lesson-row.completed { background: rgba(16,185,129,0.1); }
.lesson-row.locked { opacity: 0.5; cursor: not-allowed; }
.lesson-num { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-input); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.lesson-row.completed .lesson-num { background: var(--secondary); color: white; }
.lesson-name { flex: 1; font-size: 13px; }
.lesson-dur { font-size: 11px; color: var(--text-muted); }
.reviews-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.reviews-panel h3 { margin-bottom: 16px; }
.reviews-list { max-height: 300px; overflow-y: auto; }
.review-item { background: var(--bg-input); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.review-head { display: flex; justify-content: space-between; margin-bottom: 4px; }
.review-name { font-weight: 600; font-size: 13px; }
.review-date { font-size: 11px; color: var(--text-muted); }
.review-stars { color: var(--accent); font-size: 12px; }
.review-text { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ==================== VIDEO PLAYER ==================== */
.player-layout { display: flex; flex: 1; overflow: hidden; position: relative; }
.player-main { flex: 1; overflow-y: auto; background: var(--bg); }
.video-box { background: #000; }
.video-wrapper { position: relative; width: 100%; aspect-ratio: 16/9; max-height: 70vh; background: #000; user-select: none; }
#ytPlayer { width: 100%; height: 100%; pointer-events: none; }
#ytPlayer iframe { width: 100% !important; height: 100% !important; }
.video-overlay { position: absolute; inset: 0; bottom: 60px; cursor: pointer; z-index: 5; }
.video-controls { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,0.9)); padding: 40px 16px 12px; z-index: 10; }
.video-wrapper.hide-controls .video-controls { opacity: 0; pointer-events: none; }
.progress-bar { position: relative; height: 20px; cursor: pointer; margin-bottom: 8px; display: flex; align-items: center; }
.progress-bar::before { content: ''; position: absolute; left: 0; right: 0; height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px; }
.progress-fill { position: absolute; left: 0; height: 4px; background: var(--primary); border-radius: 2px; width: 0%; pointer-events: none; }
.progress-knob { position: absolute; width: 12px; height: 12px; background: var(--primary); border-radius: 50%; left: 0%; transform: translateX(-50%); opacity: 0; pointer-events: none; }
.progress-bar:hover .progress-knob { opacity: 1; }
.controls-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.controls-left, .controls-right { display: flex; align-items: center; gap: 8px; }
.ctrl-btn { width: 40px; height: 40px; background: rgba(255,255,255,0.1); border: none; border-radius: 50%; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all 0.2s; }
.ctrl-btn:hover { background: rgba(255,255,255,0.2); }
.play-btn { width: 48px; height: 48px; background: var(--primary); font-size: 18px; }
.play-btn:hover { background: var(--primary-dark); }
.vol-slider { width: 80px; height: 4px; accent-color: var(--primary); }
.time-display { color: white; font-size: 13px; font-variant-numeric: tabular-nums; }
.speed-wrap { position: relative; }
.speed-btn { width: auto; padding: 0 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.speed-menu { display: none; position: absolute; bottom: 100%; right: 0; margin-bottom: 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; z-index: 30; }
.speed-menu.active { display: block; }
.speed-menu button { display: block; width: 100%; padding: 10px 20px; background: none; border: none; color: white; cursor: pointer; font-size: 13px; }
.speed-menu button:hover, .speed-menu button.active { background: var(--primary); }
@media (max-width: 600px) { .vol-slider { display: none; } .time-display { font-size: 11px; } }

/* ==================== PLAYER SIDEBAR ==================== */
.player-sidebar { width: 340px; background: var(--bg-card); border-left: 1px solid var(--border); display: flex; flex-direction: column; }
.sidebar-head { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--border); }
.sidebar-head h3 { font-size: 16px; }
.close-btn { display: none; background: none; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer; }
.sidebar-body { flex: 1; overflow-y: auto; }
.sidebar-lesson { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: all 0.2s; }
.sidebar-lesson:hover { background: var(--bg-input); }
.sidebar-lesson.active { background: rgba(99,102,241,0.1); border-left: 3px solid var(--primary); }
.sidebar-lesson.completed .lesson-num { background: var(--secondary); color: white; }
.sidebar-lesson.locked { opacity: 0.4; cursor: not-allowed; }
.sidebar-toggle { display: none; position: fixed; bottom: 20px; right: 20px; width: 56px; height: 56px; background: var(--primary); border: none; border-radius: 50%; color: white; font-size: 24px; cursor: pointer; box-shadow: var(--shadow); z-index: 50; }
@media (max-width: 900px) {
    .player-sidebar { position: fixed; top: 57px; right: -340px; height: calc(100vh - 57px); z-index: 100; transition: right 0.3s; }
    .player-sidebar.active { right: 0; }
    .close-btn { display: block; }
    .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
}

/* ==================== LESSON CONTENT ==================== */
.lesson-info { max-width: 800px; margin: 0 auto; padding: 24px 20px; }
.lesson-info h2 { font-size: 22px; margin-bottom: 8px; }
.lesson-desc { color: var(--text-muted); margin-bottom: 24px; }
.activities-box, .feedback-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 24px; }
.activities-box h3, .feedback-box h3 { margin-bottom: 16px; }
.activity-item { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.activity-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.activity-prompt { font-weight: 500; margin-bottom: 10px; }
.activity-input { width: 100%; padding: 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; }
.checkbox-group { display: flex; flex-direction: column; gap: 8px; }
.feedback-list { max-height: 300px; overflow-y: auto; margin-bottom: 20px; }
.feedback-item { background: var(--bg-input); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.feedback-form { border-top: 1px solid var(--border); padding-top: 16px; }
.stars-input { display: flex; gap: 6px; margin-bottom: 12px; }
.star { font-size: 28px; color: var(--text-dark); cursor: pointer; transition: all 0.2s; }
.star:hover, .star.active { color: var(--accent); transform: scale(1.1); }
.feedback-form textarea { width: 100%; padding: 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; min-height: 80px; margin-bottom: 12px; resize: vertical; }
.lesson-nav { display: flex; justify-content: space-between; padding-top: 20px; border-top: 1px solid var(--border); gap: 12px; }
.lesson-nav .btn { flex: 1; max-width: 200px; }
@media (max-width: 500px) { .lesson-nav { flex-direction: column; } .lesson-nav .btn { max-width: 100%; } }

/* ==================== CERTIFICATE ==================== */
.cert-main { display: flex; flex-direction: column; align-items: center; padding: 40px 20px; }
.certificate { background: white; padding: 16px; border-radius: var(--radius); max-width: 700px; width: 100%; }
.cert-inner { border: 3px solid var(--primary); padding: 40px; text-align: center; color: #1a1a2e; }
.cert-logo { font-size: 48px; margin-bottom: 16px; }
.cert-inner h1 { font-size: 28px; color: var(--primary); margin-bottom: 20px; }
.cert-sub { font-size: 14px; color: #666; margin-bottom: 8px; }
.cert-name { font-size: 32px; font-style: italic; margin-bottom: 20px; }
.cert-course { font-size: 22px; color: var(--primary); margin-bottom: 20px; }
.cert-date { color: #666; margin-bottom: 24px; }
.cert-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 20px; border-top: 2px solid #eee; }
.cert-brand { font-size: 20px; font-weight: 800; color: var(--primary); }
.cert-id { font-size: 11px; color: #999; }
.cert-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; justify-content: center; }
@media print { .cert-actions, .header { display: none !important; } .certificate { box-shadow: none; } }

/* ==================== ADMIN ==================== */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.admin-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-align: center; cursor: pointer; transition: all 0.2s; }
.admin-stat:hover { border-color: var(--primary); transform: translateY(-2px); }
.admin-stat.revenue { cursor: default; }
.admin-stat.revenue:hover { transform: none; }
.admin-stat-val { font-size: 32px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.admin-stat-label { color: var(--text-muted); font-size: 14px; }
.admin-stat-sub { color: var(--text-dark); font-size: 12px; margin-top: 8px; }
.payment-summary { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.sum-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 16px 24px; display: flex; flex-direction: column; gap: 4px; }
.sum-label { font-size: 12px; color: var(--text-muted); }
.sum-val { font-size: 20px; font-weight: 700; }
.sum-val.red { color: var(--danger); }
.sum-val.green { color: var(--success); }
.fb-stats { display: flex; gap: 24px; margin-bottom: 24px; }
.fb-stat { display: flex; align-items: center; gap: 8px; }
.fb-stat-val { font-size: 24px; font-weight: 700; color: var(--primary); }
.fb-stat-label { font-size: 13px; color: var(--text-muted); }
.fb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.fb-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.fb-card .course-name { font-size: 11px; color: var(--primary); margin-bottom: 4px; }
.fb-card .lesson-name { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.filters { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.filters select, .filters input { padding: 10px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 14px; min-width: 180px; }
.table-wrap { overflow-x: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.data-table { width: 100%; min-width: 600px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { background: var(--bg-input); font-weight: 600; font-size: 12px; text-transform: uppercase; color: var(--text-muted); }
.data-table tbody tr:hover { background: var(--bg-input); }
.data-table code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.status { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.status.success { background: rgba(34,197,94,0.2); color: var(--success); }
.status.failed { background: rgba(239,68,68,0.2); color: var(--danger); }
.status.abandoned { background: rgba(234,179,8,0.2); color: var(--accent); }
.student-detail { max-width: 900px; }
.student-head { display: flex; align-items: center; gap: 20px; margin-bottom: 32px; }
.student-avatar { width: 72px; height: 72px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; }
.student-section { margin-bottom: 32px; }
.student-section h2 { margin-bottom: 16px; }
.progress-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.progress-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.progress-card-title { font-weight: 600; }
.progress-card-pct { color: var(--secondary); font-weight: 600; }
.progress-track { height: 8px; background: var(--bg-input); border-radius: 4px; overflow: hidden; }
.progress-track-fill { height: 100%; background: var(--secondary); }
.settings-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.settings-card h2 { margin-bottom: 16px; color: var(--primary); }
.about-main { max-width: 800px; }
.about-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.about-card h2 { margin-bottom: 16px; color: var(--primary); }
.about-card p { color: var(--text-muted); line-height: 1.8; margin-bottom: 12px; }
.contact-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.contact-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--bg-input); border-radius: 8px; }
.contact-item .icon { font-size: 24px; }
.contact-item .label { font-size: 12px; color: var(--text-muted); }
.contact-item .value { font-weight: 600; }

/* ==================== MODALS ==================== */
.modal { display: none; position: fixed; inset: 0; z-index: 1000; align-items: flex-start; justify-content: center; padding: 20px; overflow-y: auto; }
.modal.active { display: flex; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.7); }
.modal-box { position: relative; background: var(--bg-card); border-radius: var(--radius); width: 100%; max-width: 500px; margin: auto; display: flex; flex-direction: column; max-height: 90vh; }
.modal-lg { max-width: 650px; }
.modal-xl { max-width: 900px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 18px; }
.modal-close { width: 32px; height: 32px; background: var(--bg-input); border: none; border-radius: 50%; color: var(--text); font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--danger); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--border); }
.editor-body { padding: 0 !important; }
.editor-tabs { display: flex; gap: 4px; padding: 12px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tab-btn { padding: 10px 20px; background: none; border: none; color: var(--text-muted); font-size: 14px; font-weight: 600; cursor: pointer; border-radius: 8px; }
.tab-btn:hover { color: var(--text); background: var(--bg-input); }
.tab-btn.active { color: var(--primary); background: rgba(99,102,241,0.1); }
.tab-content { padding: 20px; }
.tab-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.editor-list { display: flex; flex-direction: column; gap: 10px; }
.editor-item { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--bg-input); border-radius: 8px; }
.editor-item-info { flex: 1; min-width: 0; }
.editor-item-title { font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor-item-meta { font-size: 12px; color: var(--text-muted); }
.editor-item-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ==================== TOASTS ==================== */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; max-width: 90vw; }
.toast { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; box-shadow: var(--shadow); animation: slideIn 0.3s ease; font-size: 14px; }
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--primary); }
@keyframes slideIn { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dark); }
