:root {
    --bg: #0f172a;
    --bg2: #111827;
    --surface: #1e293b;
    --cyan: #06b6d4;
    --blue: #3b82f6;
    --purple: #8b5cf6;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --danger: #ef4444;
    --success: #22c55e;
    --glass: rgba(30, 41, 59, 0.65);
    --border: rgba(148, 163, 184, 0.15);
    --radius: 14px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.bg-gradient {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.15), transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.12), transparent 40%),
        linear-gradient(160deg, #0f172a, #111827 50%, #0f172a);
    z-index: -2;
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(148,163,184,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148,163,184,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
}

.glass {
    background: var(--glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

a { color: var(--cyan); text-decoration: none; transition: color 0.2s; }
a:hover { color: #67e8f9; }

/* Layout */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: rgba(17, 24, 39, 0.9);
    border-right: 1px solid var(--border);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    font-weight: 800;
}

.logo-text {
    line-height: 1.1;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

.sidebar-nav { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }

.nav-link {
    padding: 0.65rem 1rem;
    border-radius: 10px;
    color: var(--muted);
    transition: all 0.25s;
}

.nav-link:hover, .nav-link.active {
    background: rgba(6, 182, 212, 0.12);
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.25);
}

.sidebar-footer { border-top: 1px solid var(--border); padding-top: 1rem; }

.user-mini { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.75rem; }

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-name { font-size: 0.9rem; font-weight: 600; }
.user-role { font-size: 0.75rem; color: var(--muted); text-transform: capitalize; }

.main-wrapper {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.5rem;
    margin: 1rem 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title { font-weight: 700; font-size: 1.1rem; flex: 1; }

.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    cursor: pointer;
}

.main-content { padding: 1.5rem; }

/* Public */
.public-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    margin: 1rem;
}

.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; color: var(--text); }

.nav-links { display: flex; gap: 0.75rem; align-items: center; }

.public-main { padding: 0 2rem 3rem; max-width: 1200px; margin: 0 auto; }

.hero {
    text-align: center;
    padding: 4rem 1rem 2rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    background: linear-gradient(135deg, var(--cyan), var(--blue), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub { color: var(--muted); font-size: 1.15rem; margin: 1rem 0 2rem; }

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.hero-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 600px;
}

.stat-item { text-align: center; }
.stat-item .neon { font-size: 1.5rem; font-weight: 800; color: var(--cyan); text-shadow: 0 0 20px rgba(6,182,212,0.6); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.1rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s;
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.35);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(6, 182, 212, 0.5); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--cyan);
    color: var(--cyan);
}

.btn-ghost { background: rgba(255,255,255,0.05); color: var(--text); border: 1px solid var(--border); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.5rem; }
.btn-block { width: 100%; }

.neon-btn { animation: pulse 2s infinite; }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(6,182,212,0.4); }
    50% { box-shadow: 0 0 35px rgba(139,92,246,0.5); }
}

/* Cards & grids */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.25rem;
    text-align: center;
    transition: transform 0.3s;
}

.stat-card:hover { transform: translateY(-4px); }

.stat-card span {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.stat-card small { color: var(--muted); }

.neon-cyan span { color: var(--cyan); text-shadow: 0 0 15px rgba(6,182,212,0.5); }
.neon-blue span { color: var(--blue); }
.neon-purple span { color: var(--purple); }

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.course-card {
    overflow: hidden;
    color: inherit;
    display: block;
    transition: transform 0.3s, box-shadow 0.3s;
}

.course-card img, .course-placeholder {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.course-placeholder {
    background: linear-gradient(135deg, var(--surface), #334155);
}

.course-card-body { padding: 1rem; }

.course-card h3 { margin: 0.5rem 0; color: var(--text); }

.tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: rgba(6, 182, 212, 0.15);
    color: var(--cyan);
}

.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(6, 182, 212, 0.15);
}

/* Forms */
.auth-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card { width: 100%; max-width: 420px; padding: 2rem; }

.auth-card h1 { margin-bottom: 1.5rem; text-align: center; }

.form label { display: block; margin: 0.75rem 0 0.35rem; font-size: 0.85rem; color: var(--muted); }

.form input, .form textarea, .form select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text);
    font-family: inherit;
}

.form input:focus, .form textarea:focus, .form select:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.form-card { padding: 1.5rem; margin-bottom: 1.5rem; max-width: 700px; }

.filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.filters input,
.filters select,
.search-input,
.search-select,
.user-edit-form input {
    flex: 1;
    min-width: 140px;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.75);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filters input::placeholder,
.search-input::placeholder {
    color: var(--muted);
}

.filters input:focus,
.filters select:focus,
.search-input:focus,
.search-select:focus,
.user-edit-form input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.filters select option,
.search-select option {
    background: var(--surface);
    color: var(--text);
}

/* Search bar */
.search-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
    margin-bottom: 1.75rem;
    align-items: stretch;
}

.search-field {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.75);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-field:focus-within {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.search-field .search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 0.7rem 0;
    box-shadow: none;
}

.search-field .search-input:focus {
    box-shadow: none;
}

.search-icon {
    color: var(--muted);
    flex-shrink: 0;
}

.search-select {
    flex: 0 1 220px;
    min-width: 160px;
    cursor: pointer;
}

.search-btn {
    flex-shrink: 0;
    min-width: 110px;
}

/* Admin users */
.role-tabs {
    display: inline-flex;
    gap: 0.35rem;
    padding: 0.35rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
}

.role-tab {
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    transition: all 0.2s;
}

.role-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.role-tab.active {
    color: var(--text);
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(59, 130, 246, 0.2));
    box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.35);
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.user-admin-card {
    overflow: hidden;
    transition: border-color 0.2s;
}

.user-admin-card:hover {
    border-color: rgba(6, 182, 212, 0.25);
}

.user-admin-main {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1rem 1.25rem;
    align-items: center;
    padding: 1.15rem 1.25rem;
}

.user-admin-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.user-admin-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.user-admin-name {
    font-size: 1rem;
}

.user-admin-email {
    font-size: 0.85rem;
    color: var(--muted);
    word-break: break-all;
}

.user-admin-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
}

.tag-role { text-transform: capitalize; }

.tag-teacher {
    background: rgba(139, 92, 246, 0.18);
    color: #c4b5fd;
}

.tag-student {
    background: rgba(6, 182, 212, 0.18);
    color: var(--cyan);
}

.status-pill {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}

.status-active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-blocked {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.user-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-end;
}

.user-edit-details {
    border-top: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.35);
}

.user-edit-details summary {
    padding: 0.65rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cyan);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background 0.2s;
}

.user-edit-details summary::-webkit-details-marker { display: none; }

.user-edit-details summary::before {
    content: "▸ ";
    display: inline-block;
    transition: transform 0.2s;
}

.user-edit-details[open] summary::before {
    transform: rotate(90deg);
}

.user-edit-details summary:hover {
    background: rgba(6, 182, 212, 0.06);
}

.user-edit-form {
    padding: 0 1.25rem 1.25rem;
}

.user-edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.user-edit-form .field label {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.user-edit-form input {
    width: 100%;
    min-width: 0;
}

/* Tables */
.table-wrap { overflow-x: auto; padding: 0.5rem; }

table { width: 100%; border-collapse: collapse; }

th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }

th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; }

/* Progress */
.progress-bar {
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-bar.small { height: 5px; }

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    border-radius: 999px;
    transition: width 0.8s ease;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

.progress-card { padding: 1rem; margin-bottom: 1rem; }

.progress-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }

/* Lesson & quiz */
.lesson-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 2rem; }

.lesson-item {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    color: inherit;
    margin-bottom: 0.5rem;
}

.lesson-content { padding: 2rem; max-width: 900px; }

.content-text { white-space: pre-wrap; margin: 1rem 0; }

.video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    margin: 1.5rem 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-player { width: 100%; border-radius: var(--radius); margin: 1rem 0; }

.question-block {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.option-label {
    display: block;
    padding: 0.5rem;
    margin: 0.35rem 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.option-label:hover { background: rgba(6, 182, 212, 0.08); }

/* Student quiz page */
.page-quiz .main-content { max-width: 820px; margin: 0 auto; }

.quiz-page { display: flex; flex-direction: column; gap: 1.25rem; padding-bottom: 2rem; }

.quiz-header {
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quiz-back {
    font-size: 0.9rem;
    color: var(--muted);
    align-self: flex-start;
}

.quiz-back:hover { color: var(--cyan); }

.quiz-title {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.25;
}

.quiz-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quiz-meta-pill {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.25);
    color: #a5f3fc;
}

.quiz-form { display: flex; flex-direction: column; gap: 1.25rem; }

.quiz-progress {
    padding: 1rem 1.25rem;
    position: sticky;
    top: 0.5rem;
    z-index: 20;
}

.quiz-progress-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
    font-size: 0.9rem;
}

.quiz-progress-labels strong { color: var(--cyan); font-size: 1rem; }

.quiz-progress-track {
    height: 8px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.quiz-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    border-radius: 999px;
    transition: width 0.35s ease;
    box-shadow: 0 0 14px rgba(6, 182, 212, 0.45);
}

.question-card {
    padding: 1.35rem 1.5rem;
    animation: fadeIn 0.35s ease;
}

.question-card-head {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.15rem;
}

.question-num {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    color: #0f172a;
}

.question-text {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.5;
    padding-top: 0.15rem;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.quiz-option {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.95rem 1rem 0.95rem 0.95rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.35);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
    user-select: none;
}

.quiz-option:hover {
    border-color: rgba(6, 182, 212, 0.45);
    background: rgba(6, 182, 212, 0.06);
}

.quiz-option-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.quiz-option:has(.quiz-option-input:checked) {
    border-color: var(--cyan);
    background: rgba(6, 182, 212, 0.12);
    box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.35), 0 4px 20px rgba(6, 182, 212, 0.15);
}

.quiz-option:has(.quiz-option-input:focus-visible) {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

.quiz-option-marker {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.15);
    color: var(--text);
    transition: background 0.2s, color 0.2s;
}

.quiz-option:has(.quiz-option-input:checked) .quiz-option-marker {
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    color: #0f172a;
}

.quiz-option-text {
    flex: 1;
    line-height: 1.5;
    padding-top: 0.35rem;
    font-size: 0.98rem;
}

.quiz-option-check {
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    margin-top: 0.35rem;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.4);
    transition: border-color 0.2s, background 0.2s;
}

.quiz-option:has(.quiz-option-input:checked) .quiz-option-check {
    border-color: var(--cyan);
    background: var(--cyan);
    box-shadow: inset 0 0 0 3px #0f172a;
}

.question-card.is-answered {
    border-color: rgba(34, 197, 94, 0.25);
}

.quiz-submit-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.5rem;
    position: sticky;
    bottom: 0.75rem;
    z-index: 20;
}

.quiz-submit-hint { font-size: 0.9rem; margin: 0; }

.quiz-submit-bar .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

@keyframes quizShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.question-card.quiz-shake {
    animation: quizShake 0.45s ease;
    border-color: rgba(239, 68, 68, 0.5) !important;
}

@media (max-width: 600px) {
    .quiz-header { padding: 1.15rem; }
    .question-card { padding: 1rem; }
    .quiz-option { padding: 0.85rem; }
    .quiz-submit-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .quiz-submit-bar .btn { width: 100%; }
}

.result-card { padding: 2rem; text-align: center; max-width: 500px; margin: 0 auto 2rem; }

.result-card.passed { border-color: rgba(34, 197, 94, 0.4); }
.result-card.failed { border-color: rgba(239, 68, 68, 0.4); }

.result-score { font-size: 2.5rem; font-weight: 800; margin: 1rem 0; }

/* Notifications */
.notifications-dropdown { position: relative; }

.notif-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.4rem 0.7rem;
    cursor: pointer;
    position: relative;
}

.notif-btn .badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 999px;
}

.notif-panel {
    display: none;
    position: absolute;
    right: 0;
    top: 110%;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 200;
}

.notif-panel.open { display: block; animation: fadeIn 0.2s; }

.notif-header {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.notif-item { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.notif-item.unread { background: rgba(6, 182, 212, 0.08); }

.link-btn { background: none; border: none; color: var(--cyan); cursor: pointer; font-size: 0.8rem; }

/* Misc */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }

.section-title { margin: 1.5rem 0 1rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }

.inline-form { display: inline; }

.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }

.question-card { padding: 1rem; margin-bottom: 1rem; }

.course-hero { display: grid; gap: 1.5rem; padding: 1.5rem; margin-bottom: 2rem; }

.course-hero-img { width: 100%; border-radius: var(--radius); object-fit: cover; }

.course-cover-preview { max-width: 200px; border-radius: var(--radius); margin-bottom: 1rem; }

.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }

.cert-card { padding: 1.5rem; text-align: center; }

.cert-badge {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.4);
}

.achievements-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }

.achievement { padding: 1rem; }
.achievement small { display: block; color: var(--muted); margin-top: 0.35rem; }

.badge-success { color: var(--success); }
.badge-danger { color: var(--danger); }

.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.p-3 { padding: 1rem; }

.flash-container { margin-bottom: 1rem; }

.flash {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
}

.flash-success { background: rgba(34, 197, 94, 0.15); border-color: var(--success); }
.flash-danger { background: rgba(239, 68, 68, 0.15); border-color: var(--danger); }
.flash-warning { background: rgba(234, 179, 8, 0.15); }
.flash-info { background: rgba(59, 130, 246, 0.15); }

.verify-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.verify-card { padding: 2rem; max-width: 480px; text-align: center; }

.verify-valid { color: var(--success); font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; }
.verify-invalid { color: var(--danger); font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; }

.animate-in { animation: fadeIn 0.5s ease; }
.delay-1 { animation-delay: 0.15s; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loader */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Lesson progress & cards */
.course-hero-body { display: flex; flex-direction: column; gap: 0.75rem; }

.progress-section { margin: 0.5rem 0; }

.progress-bar-lg { height: 12px; }

.progress-percent {
    font-weight: 700;
    color: var(--cyan);
    text-shadow: 0 0 12px rgba(6, 182, 212, 0.45);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.status-complete {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.35);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
}

.status-progress {
    background: rgba(59, 130, 246, 0.12);
    color: var(--blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-pending {
    background: rgba(234, 179, 8, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(234, 179, 8, 0.35);
}

.status-rejected {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.lesson-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.lesson-card-student {
    padding: 1.25rem;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.lesson-card-student.lesson-done {
    border-color: rgba(34, 197, 94, 0.35);
    box-shadow: 0 0 24px rgba(34, 197, 94, 0.08);
}

.lesson-card-top {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.lesson-number {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.lesson-card-info h4 { margin-bottom: 0.35rem; }

.lesson-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.complete-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    color: var(--muted);
    transition: color 0.25s;
}

.complete-check input { display: none; }

.complete-check .checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
}

.complete-check.checked,
.complete-check:has(input:checked) {
    color: var(--success);
}

.complete-check.checked .checkmark,
.complete-check:has(input:checked) .checkmark {
    background: linear-gradient(135deg, var(--cyan), var(--success));
    border-color: transparent;
    box-shadow: 0 0 16px rgba(6, 182, 212, 0.45);
}

.complete-check.checked .checkmark::after,
.complete-check:has(input:checked) .checkmark::after {
    content: "✓";
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
}

.complete-check-lg .checkmark { width: 28px; height: 28px; }

.btn-animated {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-animated:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}

.lesson-page { max-width: 920px; }

.lesson-header { padding: 1.75rem; margin-bottom: 1.5rem; }

.lesson-lead {
    font-size: 1.05rem;
    color: var(--muted);
    margin: 0.75rem 0;
}

.lesson-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.9rem;
}

.lecture-block, .video-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.lecture-block h2, .video-card h2 {
    margin-bottom: 1rem;
    font-size: 1.15rem;
    color: var(--cyan);
}

.lecture-text {
    white-space: pre-wrap;
    line-height: 1.85;
    font-size: 1rem;
    color: #cbd5e1;
    border-left: 3px solid var(--purple);
    padding-left: 1rem;
}

.video-wrap-animated {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(6, 182, 212, 0.15);
    animation: videoGlow 3s ease-in-out infinite alternate;
}

@keyframes videoGlow {
    from { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 20px rgba(6, 182, 212, 0.15); }
    to { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 28px rgba(139, 92, 246, 0.25); }
}

.video-description {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
    border: 1px solid var(--border);
    color: var(--muted);
    line-height: 1.7;
}

.lesson-complete-bar {
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
}

.complete-form-inline { display: flex; align-items: center; }

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--muted);
}

.back-link:hover { color: var(--cyan); }

.lang-switch {
    display: inline-flex;
    gap: 0.2rem;
    padding: 0.2rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid var(--border);
}

.lang-btn {
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.lang-btn:hover { color: var(--text); }

.lang-btn.active {
    color: var(--text);
    background: rgba(6, 182, 212, 0.22);
    box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.35);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-footer .lang-switch {
    margin-bottom: 0.65rem;
    width: 100%;
    justify-content: center;
}

.verify-topbar {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

/* Course management */
.page-heading {
    font-size: 1.65rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    background: linear-gradient(90deg, var(--text), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-sub { font-size: 0.9rem; }

.course-manage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.course-manage-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.course-manage-cover {
    position: relative;
    height: 170px;
    overflow: hidden;
}

.course-manage-cover img,
.course-manage-cover .course-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-manage-cover .course-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: rgba(6, 182, 212, 0.35);
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #1e3a5f 100%);
}

.course-manage-tag {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    backdrop-filter: blur(8px);
}

.course-manage-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.65rem;
}

.course-manage-body h3 {
    font-size: 1.1rem;
    line-height: 1.35;
}

.course-manage-desc {
    font-size: 0.85rem;
    line-height: 1.5;
    flex: 1;
}

.course-manage-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--muted);
    padding: 0.65rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.course-manage-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding-top: 0.25rem;
}

.lesson-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.inline-quiz-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}

.course-manage-actions form { margin: 0; }

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.inline-quiz-form input[type="text"] { flex: 1; min-width: 140px; }
.inline-quiz-form input[type="number"] { width: 80px; }

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(239, 68, 68, 0.45);
}

.btn-danger-outline {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #fca5a5;
    width: 100%;
}

.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.22);
    color: white;
}

.course-delete-form { width: 100%; }

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    max-width: 480px;
    margin: 2rem auto;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 20px rgba(6, 182, 212, 0.4));
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

.edit-course-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    align-items: start;
}

.edit-course-form { max-width: none; }

.course-cover-wrap {
    margin-bottom: 1.25rem;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.danger-zone {
    padding: 1.25rem;
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.06);
}

.danger-zone h3 {
    color: #fca5a5;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.danger-zone p { margin-bottom: 1rem; }

.lessons-panel {
    padding: 1.25rem;
}

.lessons-panel h3 {
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.lessons-panel hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

/* Responsive */
@media (max-width: 900px) {
    .two-col { grid-template-columns: 1fr; }
    .course-hero { grid-template-columns: 1fr; }
    .edit-course-layout { grid-template-columns: 1fr; }
    .user-admin-main {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
    }
    .user-admin-meta { align-items: flex-start; }
    .user-admin-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
    .search-bar { flex-direction: column; }
    .search-select, .search-btn { width: 100%; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .menu-toggle { display: block; }
    .public-nav { flex-direction: column; gap: 1rem; }
}

@media print {
    .sidebar, .topbar, .public-nav { display: none !important; }
    .main-wrapper { margin: 0 !important; }
    body { background: white; color: black; }
}
