@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── TOKENS ────────────────────────────────────────────── */
:root {
  --bg:       #0f1117;
  --bg-2:     #161b27;
  --bg-card:  #1a2030;
  --border:   rgba(255,255,255,0.08);
  --border-2: rgba(255,255,255,0.13);

  --accent:   #4f8ef7;
  --accent-2: #7c3aed;
  --green:    #22c55e;
  --yellow:   #f59e0b;
  --red:      #ef4444;

  --text:     #e8ecf3;
  --muted:    #6b7280;
  --subtle:   #374151;

  --radius:   12px;
  --shadow:   0 2px 12px rgba(0,0,0,0.4);
  --shadow-lg:0 8px 32px rgba(0,0,0,0.5);
}

/* ─── BASE ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.lms-body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

a { color: var(--accent); }
a:hover { color: var(--text); }

/* ─── LAYOUT ────────────────────────────────────────────── */
.lms-shell { min-height: 100vh; position: relative; z-index: 2; }
.lms-main  { min-width: 0; }

.lms-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 100px;
}

/* ─── NAVBAR ────────────────────────────────────────────── */
.lms-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  height: 58px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1030;
  transition: background 0.2s, border-color 0.2s;
}

.brand-cluster { display: flex; align-items: center; gap: 10px; }

.brand-link {
  display: flex; align-items: center; gap: 9px;
  text-decoration: none; color: var(--text);
  font-weight: 600; font-size: 0.95rem;
}

.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent-2);
  color: #fff; font-size: 0.9rem;
  flex-shrink: 0;
}

.brand-text .brand-sub {
  display: block; font-size: 0.58rem;
  color: var(--muted); letter-spacing: 0.1em;
  text-transform: uppercase; margin-top: -1px;
}

.navbar-left, .navbar-actions { display: flex; align-items: center; gap: 8px; }
.navbar-center { display: flex; align-items: center; gap: 4px; }

.search-wrap { min-width: 280px; position: relative; }
.search-wrap i {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%); color: var(--muted);
  font-size: 0.8rem; pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 12px 8px 32px;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus { border-color: var(--accent); }

.top-nav-item {
  display: flex; align-items: center; gap: 6px;
  color: var(--muted); text-decoration: none;
  padding: 6px 11px; border-radius: var(--radius);
  font-size: 0.85rem; font-weight: 500;
  transition: color 0.15s, background 0.15s;
}
.top-nav-item i { font-size: 0.8rem; }
.top-nav-item:hover { color: var(--text); background: var(--border); }
.top-nav-item.active { color: var(--text); background: var(--border); font-weight: 600; }

.icon-btn {
  width: 34px; height: 34px; border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  display: grid; place-items: center;
  cursor: pointer; transition: color 0.15s, border-color 0.15s;
  font-size: 0.85rem;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); }

.notif-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
  position: absolute; top: 7px; right: 7px;
}
.icon-btn { position: relative; }

.profile-btn {
  border: 1px solid var(--border);
  background: transparent;
  border-radius: var(--radius);
  padding: 5px 10px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text); cursor: pointer;
  font-size: 0.875rem;
  transition: border-color 0.15s, background 0.15s;
}
.profile-btn:hover { border-color: var(--border-2); background: rgba(255,255,255,0.04); }

.profile-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff;
  background: var(--accent-2); flex-shrink: 0;
}

.profile-meta { text-align: left; line-height: 1.15; }
.profile-meta strong { display: block; font-size: 0.82rem; }
.profile-meta small { color: var(--muted); font-size: 0.72rem; }

.glass-menu {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 5px;
  min-width: 170px;
  box-shadow: var(--shadow-lg);
}
.glass-menu .dropdown-item {
  color: var(--text); border-radius: 8px;
  padding: 8px 11px; font-size: 0.85rem;
}
.glass-menu .dropdown-item:hover { background: var(--border); color: var(--text); }
.glass-menu .dropdown-divider { border-color: var(--border); margin: 4px 0; }

.nav-menu-toggle {
  width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--border); background: transparent;
  color: var(--muted); display: grid; place-items: center; cursor: pointer;
}

.mobile-bottom-nav { display: none; }
.mobile-bottom-item {
  flex: 1; text-align: center; color: var(--muted);
  text-decoration: none; font-size: 0.7rem;
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 7px 4px; border-radius: 10px;
  transition: color 0.15s;
}
.mobile-bottom-item i { font-size: 1rem; }
.mobile-bottom-item.active { color: var(--accent); }

/* ─── CARDS ─────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow);
  color: var(--text);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.card:hover {
  border-color: var(--border-2) !important;
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.card .card-body { padding: 16px; }
.card .text-muted, .card .text-secondary { color: var(--muted) !important; }

.glass-card, .soft-panel, .accordion-item, .exam-kpi,
.stat-card, .dashboard-sidebar, .toolkit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ─── HERO ──────────────────────────────────────────────── */
.hero-panel {
  background: linear-gradient(145deg, #141c2e 0%, #1a1f35 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  color: #e8ecf3;
}
.hero-title { color: #f1f5f9; }
.hero-subtitle { color: rgba(255,255,255,0.6); }
.hero-panel::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 50% 70% at 90% 20%, rgba(124,58,237,0.12), transparent),
    radial-gradient(ellipse 40% 50% at 10% 80%, rgba(79,142,247,0.08), transparent);
}

/* ─── LEVEL CHIPS ────────────────────────────────────────── */
.level-chip {
  color: rgba(255,255,255,0.7); text-decoration: none;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  border-radius: 999px; padding: 5px 14px;
  font-size: 0.8rem; font-weight: 500;
  transition: all 0.15s;
}
.level-chip:hover {
  background: rgba(79,142,247,0.15);
  border-color: rgba(79,142,247,0.4);
  color: #fff;
}

/* ─── KPI STRIP ─────────────────────────────────────────── */
.exam-kpi {
  padding: 16px 18px;
  border-radius: var(--radius);
}
.exam-kpi span {
  display: block; color: var(--muted);
  font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.07em; margin-bottom: 4px;
}
.exam-kpi strong { font-size: 1.25rem; font-weight: 700; color: var(--text); }

/* ─── SUBJECT IMAGE ─────────────────────────────────────── */
.subject-image {
  width: 100%; height: 165px; object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.card:hover .subject-image { transform: scale(1.03); }

/* ─── TOOLKIT ────────────────────────────────────────────── */
.toolkit-card {
  padding: 20px; height: 100%;
  color: var(--text); text-decoration: none;
  display: block;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.toolkit-card:hover {
  border-color: var(--border-2) !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}
.toolkit-card i { font-size: 1.3rem; color: var(--accent); margin-bottom: 10px; display: block; }
.toolkit-card h3 { font-size: 0.9rem; font-weight: 600; margin: 0 0 5px; }
.toolkit-card p { margin: 0; color: var(--muted); font-size: 0.83rem; }

/* ─── STAT CARDS ─────────────────────────────────────────── */
.stat-card { padding: 16px 18px; }
.stat-card .text-muted { color: var(--muted) !important; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-card .fs-3 { font-size: 1.8rem !important; font-weight: 700; }

/* ─── SIDEBAR ────────────────────────────────────────────── */
.dashboard-sidebar { padding: 18px; position: sticky; top: 72px; }

.sidebar-nav-link {
  display: flex; align-items: center; gap: 9px;
  color: var(--muted); text-decoration: none;
  padding: 9px 12px; border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 500;
  margin-bottom: 2px;
  transition: color 0.15s, background 0.15s;
}
.sidebar-nav-link i { width: 16px; text-align: center; font-size: 0.85rem; }
.sidebar-nav-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.sidebar-nav-link.active {
  color: var(--text);
  background: rgba(79,142,247,0.12);
  font-weight: 600;
}
.sidebar-nav-link.active i { color: var(--accent); }

/* ─── PROGRESS BAR ───────────────────────────────────────── */
.progress {
  background: rgba(255,255,255,0.07);
  border-radius: 999px; overflow: hidden; height: 5px;
}
.progress-bar {
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 999px;
  position: relative; overflow: hidden;
  transition: width 0.6s ease;
}
.progress-bar::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  background-size: 200% 100%;
  animation: shimmerBar 2s linear infinite;
}

.progress-35 { width: 35%; }
.progress-20 { width: 20%; }
.progress-55 { width: 55%; }

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn { border-radius: var(--radius); font-weight: 500; font-size: 0.875rem; transition: all 0.15s; }

.btn-gradient {
  background: var(--accent-2);
  color: #fff; border: 0;
}
.btn-gradient:hover { background: #6d28d9; color: #fff; transform: translateY(-1px); }

.btn-outline-primary {
  border-color: rgba(79,142,247,0.4); color: var(--accent);
  background: rgba(79,142,247,0.06);
}
.btn-outline-primary:hover { background: rgba(79,142,247,0.14); color: var(--accent); border-color: var(--accent); }

.btn-outline-light {
  border-color: rgba(255,255,255,0.15); color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.04);
}
.btn-outline-light:hover { background: rgba(255,255,255,0.09); color: #fff; border-color: rgba(255,255,255,0.25); }

.btn-outline-danger {
  border-color: rgba(239,68,68,0.35); color: var(--red);
  background: rgba(239,68,68,0.04);
}
.btn-outline-danger:hover { background: rgba(239,68,68,0.12); }

.btn-outline-secondary { border-color: var(--border); color: var(--muted); background: transparent; }
.btn-outline-secondary:hover { background: rgba(255,255,255,0.05); color: var(--text); border-color: var(--border-2); }

.btn-light, .btn-secondary {
  background: rgba(255,255,255,0.07); color: var(--text); border-color: var(--border);
}
.btn-light:hover, .btn-secondary:hover { background: rgba(255,255,255,0.11); color: var(--text); }

.btn-sm { padding: 5px 12px; font-size: 0.82rem; }
.btn-lg { padding: 10px 22px; font-size: 0.95rem; }

/* ─── FORMS ──────────────────────────────────────────────── */
.form-control, .form-select, .form-floating .form-control {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.form-control::placeholder { color: var(--muted); }
.form-control:focus, .form-select:focus {
  background: var(--bg-2);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,142,247,0.15);
  color: var(--text);
}
.form-floating label { color: var(--muted); font-size: 0.875rem; }
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label { color: var(--accent); }
.form-select option { background: var(--bg-2); color: var(--text); }
.form-label { color: var(--muted); font-size: 0.82rem; font-weight: 500; }

/* ─── BADGES ─────────────────────────────────────────────── */
.badge { font-weight: 500; border-radius: 6px; font-size: 0.72rem; }
.text-bg-primary  { background: rgba(124,58,237,0.18) !important; color: #a78bfa !important; }
.text-bg-success  { background: rgba(34,197,94,0.15)  !important; color: #4ade80 !important; }
.text-bg-warning  { background: rgba(245,158,11,0.15) !important; color: #fbbf24 !important; }
.text-bg-danger   { background: rgba(239,68,68,0.15)  !important; color: #f87171 !important; }
.text-bg-dark     { background: rgba(255,255,255,0.07) !important; color: var(--muted) !important; }
.text-bg-light    { background: rgba(255,255,255,0.08) !important; color: var(--text) !important; }
.text-bg-info     { background: rgba(79,142,247,0.15)  !important; color: #93c5fd !important; }

/* ─── TABLE ──────────────────────────────────────────────── */
.table { color: var(--text); font-size: 0.875rem; }
.table thead th {
  color: var(--muted); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.07em;
  border-color: var(--border); font-weight: 600;
}
.table td, .table th { border-color: var(--border); }
.table-hover tbody tr:hover td { background: rgba(255,255,255,0.03); }

/* ─── NAV PILLS ──────────────────────────────────────────── */
.nav-pills .nav-link { color: var(--muted); border-radius: var(--radius); font-size: 0.875rem; }
.nav-pills .nav-link.active { background: var(--accent-2); color: #fff; }

/* ─── ACCORDION ──────────────────────────────────────────── */
.accordion-button { background: var(--bg-card) !important; color: var(--text) !important; font-size: 0.9rem; border-color: var(--border) !important; }
.accordion-button:not(.collapsed) { color: var(--accent) !important; box-shadow: none !important; }
.accordion-button::after { filter: invert(1) opacity(0.4); }
.accordion-body { background: var(--bg-2); color: var(--text); font-size: 0.875rem; }
.accordion-item { border-color: var(--border) !important; }

/* ─── TOAST ──────────────────────────────────────────────── */
.soft-toast {
  background: var(--bg-card) !important; color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}

/* ─── VIDEO ──────────────────────────────────────────────── */
.video-shell { position: relative; border-radius: var(--radius); overflow: hidden; }
.video-locked iframe { filter: blur(8px) saturate(0.4); }
.locked-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,17,23,0.1), rgba(15,17,23,0.75));
}
.locked-card { position: relative; }
.locked-card::after {
  content: '\f023'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--text); font-size: 1.1rem;
  background: rgba(15,17,23,0.5); pointer-events: none;
}

/* ─── AVATAR ─────────────────────────────────────────────── */
.avatar-circle {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 1rem;
  background: var(--accent-2); color: #fff; flex-shrink: 0;
}

/* ─── MISC ───────────────────────────────────────────────── */
.text-secondary { color: var(--muted) !important; }
.text-muted { color: var(--muted) !important; }
.border-bottom { border-color: var(--border) !important; }
hr { border-color: var(--border); }
.dropdown-divider { border-color: var(--border); }

.soft-panel { padding: 0; }
.trust-item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.trust-item i { color: var(--green); margin-top: 2px; font-size: 0.85rem; flex-shrink: 0; }
.trust-item span { color: var(--muted); font-size: 0.875rem; }

.section-title {
  font-size: 1.1rem; font-weight: 600; margin-bottom: 4px; color: var(--text);
}
.section-sub { font-size: 0.82rem; color: var(--muted); margin: 0 0 20px; }

/* ─── PAGE TRANSITION ────────────────────────────────────── */
.fade-in-page { animation: fadeIn 0.25s ease; }

/* ─── SKELETON ───────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03), rgba(255,255,255,0.05));
  background-size: 220% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

/* ─── ANIMATIONS ─────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  to { background-position: -220% 0; }
}
@keyframes shimmerBar {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1199.98px) { .search-wrap { min-width: 220px; } }

@media (max-width: 991.98px) {
  .lms-navbar { flex-wrap: wrap; padding: 8px 16px; height: auto; gap: 8px; }
  .brand-cluster, .navbar-left { width: 100%; justify-content: space-between; }
  .navbar-actions { margin-left: auto; }
  .search-wrap { min-width: 1px; width: 100%; }
  .lms-content { padding: 20px 16px 100px; }
  .mobile-bottom-nav {
    display: flex; gap: 4px;
    position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 1040;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 16px; padding: 5px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
  }
}

@media (max-width: 575.98px) {
  .profile-meta { display: none; }
  .navbar-actions { gap: 6px; }
  .icon-btn, .profile-btn, .nav-menu-toggle {
    width: 34px; height: 34px; padding: 0; display: grid; place-items: center;
  }
}

/* ─── ADMIN SIDEBAR LAYOUT ──────────────────────────────── */
body.admin-body { margin:0; font-family:'Inter',system-ui,sans-serif; background:var(--admin-bg); min-height:100vh; }
.admin-shell { display:flex; min-height:100vh; }

.admin-sidebar {
  width:240px; flex-shrink:0;
  background:var(--admin-sidebar-bg);
  border-right:1px solid var(--admin-border);
  display:flex; flex-direction:column;
  position:fixed; top:0; left:0; bottom:0;
  z-index:1040; overflow-y:auto;
  transition:transform .25s;
}
.admin-sidebar.collapsed { transform:translateX(-240px); }
.admin-main { flex:1; min-width:0; margin-left:240px; transition:margin-left .25s; }
.admin-main.sidebar-collapsed { margin-left:0; }

.admin-sidebar-header { padding:16px; border-bottom:1px solid var(--admin-border); }
.admin-brand { display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--admin-text);font-weight:700;font-size:.95rem; }
.admin-brand-icon { width:32px;height:32px;border-radius:8px;background:#7c3aed;display:grid;place-items:center;color:#fff;font-size:.85rem;flex-shrink:0; }
.admin-brand-text {}

.admin-sidebar-nav { flex:1;padding:12px 10px;display:flex;flex-direction:column;gap:2px; }
.admin-nav-section { font-size:.65rem;text-transform:uppercase;letter-spacing:.12em;color:var(--muted-admin);padding:12px 8px 4px;font-weight:600; }
.admin-nav-link { display:flex;align-items:center;gap:9px;color:var(--muted-admin);text-decoration:none;padding:8px 10px;border-radius:10px;font-size:.875rem;font-weight:500;transition:color .15s,background .15s; }
.admin-nav-link i { width:16px;text-align:center;font-size:.85rem;flex-shrink:0; }
.admin-nav-link span:not(.admin-nav-badge) { flex:1; }
.admin-nav-link:hover { color:var(--admin-text);background:var(--admin-hover); }
.admin-nav-link.active { color:var(--admin-text);background:rgba(79,142,247,.12);font-weight:600; }
.admin-nav-link.active i { color:#4f8ef7; }
.admin-nav-badge { background:#ef4444;color:#fff;font-size:.65rem;font-weight:700;padding:1px 6px;border-radius:999px; }

.admin-sidebar-footer { padding:12px;border-top:1px solid var(--admin-border); }
.admin-user-avatar { width:30px;height:30px;border-radius:50%;background:#7c3aed;display:grid;place-items:center;color:#fff;font-size:.82rem;font-weight:700;flex-shrink:0; }
.admin-logout-btn { display:flex;align-items:center;gap:9px;width:100%;padding:8px 10px;background:transparent;border:none;color:var(--muted-admin);border-radius:10px;font-size:.875rem;cursor:pointer;transition:color .15s,background .15s; }
.admin-logout-btn:hover { color:#ef4444;background:rgba(239,68,68,.08); }

.admin-topbar { display:flex;align-items:center;gap:12px;padding:0 20px;height:56px;background:var(--admin-sidebar-bg);border-bottom:1px solid var(--admin-border);position:sticky;top:0;z-index:1020; }
.admin-topbar-title { flex:1;font-weight:600;font-size:.95rem;color:var(--admin-text); }
.admin-topbar-actions { display:flex;align-items:center;gap:8px; }
.admin-sidebar-toggle, .admin-theme-btn { width:34px;height:34px;background:transparent;border:1px solid var(--admin-border);color:var(--muted-admin);border-radius:10px;display:grid;place-items:center;cursor:pointer;font-size:.85rem;transition:color .15s;text-decoration:none; }
.admin-sidebar-toggle:hover, .admin-theme-btn:hover { color:var(--admin-text); }

.admin-flash { padding:12px 24px 0; }
.admin-content { padding:24px;min-height:calc(100vh - 56px); }

/* Admin panel card (used across admin views) */
.admin-panel-card { background:var(--admin-sidebar-bg);border:1px solid var(--admin-border);border-radius:14px;overflow:hidden; }
.admin-panel-header { padding:14px 16px;border-bottom:1px solid var(--admin-border);font-weight:600;font-size:.875rem;color:var(--admin-text); }

/* Admin stat cards */
.admin-stat-card { background:var(--admin-sidebar-bg);border:1px solid var(--admin-border);border-radius:14px;padding:16px;position:relative; }
.admin-stat-card--alert { border-color:rgba(245,158,11,0.4); }
.admin-stat-icon { width:40px;height:40px;border-radius:10px;display:grid;place-items:center;font-size:1rem;margin-bottom:10px; }
.admin-stat-num { font-size:1.6rem;font-weight:700;color:var(--admin-text);line-height:1; }
.admin-stat-label { font-size:.78rem;color:var(--muted-admin);margin-top:4px; }
.admin-stat-action { display:inline-block;margin-top:8px;font-size:.75rem;color:#4f8ef7;text-decoration:none; }

/* Subject tree styles */
.admin-tree-icon { width:28px;height:28px;border-radius:7px;display:grid;place-items:center;font-size:.75rem;flex-shrink:0; }
.admin-tree-icon.subject { background:rgba(124,58,237,.15);color:#7c3aed; }
.admin-tree-icon.course  { background:rgba(79,142,247,.15);color:#4f8ef7; }
.admin-tree-icon.chapter { background:rgba(34,197,94,.15);color:#22c55e; }
.admin-tree-icon.lesson  { background:rgba(245,158,11,.15);color:#f59e0b; }
.admin-chapter-card { background:var(--admin-bg);border:1px solid var(--admin-border);border-radius:10px;overflow:hidden;margin-bottom:2px; }
.admin-lessons-list { border-top:1px solid var(--admin-border); }
.admin-lesson-row { padding:8px 12px;border-bottom:1px solid var(--admin-border); }
.admin-lesson-row:last-child { border-bottom:none; }

/* Admin modal */
.admin-modal { background:var(--admin-sidebar-bg);color:var(--admin-text);border:1px solid var(--admin-border); }
.admin-modal .modal-header,.admin-modal .modal-footer { border-color:var(--admin-border); }
.admin-modal .form-control,.admin-modal .form-select { background:var(--admin-bg);color:var(--admin-text);border-color:var(--admin-border); }
.admin-modal .form-control::placeholder { color:var(--muted-admin); }
.admin-modal .form-label { color:var(--admin-text); }
.admin-modal .form-text { color:var(--muted-admin); }
.admin-modal .btn-close { filter:invert(1); }

/* xs button */
.btn-xs { padding:2px 8px;font-size:.75rem;border-radius:6px; }

/* ─── THEME TOKENS ─────────────────────────────────────────
   Both admin and student variables are set here so any
   page that sets data-bs-theme on <html> gets correct vars.
──────────────────────────────────────────────────────────── */
[data-bs-theme="light"] {
  /* admin */
  --admin-bg:#f1f5f9; --admin-sidebar-bg:#ffffff;
  --admin-border:rgba(0,0,0,.08); --admin-text:#1e293b;
  --admin-hover:rgba(0,0,0,.04); --muted-admin:#64748b;
  /* student */
  --bg:#f8fafc; --bg-2:#ffffff; --bg-card:#ffffff;
  --border:rgba(0,0,0,0.08); --border-2:rgba(0,0,0,0.14);
  --text:#0f172a; --muted:#64748b; --subtle:#e2e8f0;
  --shadow:0 2px 8px rgba(0,0,0,0.07);
  --shadow-lg:0 8px 24px rgba(0,0,0,0.10);
}
[data-bs-theme="dark"] {
  /* admin */
  --admin-bg:#0f1117; --admin-sidebar-bg:#161b27;
  --admin-border:rgba(255,255,255,.08); --admin-text:#e8ecf3;
  --admin-hover:rgba(255,255,255,.05); --muted-admin:#6b7280;
  /* student (same as :root defaults) */
  --bg:#0f1117; --bg-2:#161b27; --bg-card:#1a2030;
  --border:rgba(255,255,255,0.08); --border-2:rgba(255,255,255,0.13);
  --text:#e8ecf3; --muted:#6b7280; --subtle:#374151;
  --shadow:0 2px 12px rgba(0,0,0,0.4);
  --shadow-lg:0 8px 32px rgba(0,0,0,0.5);
}

@media (max-width:767.98px) {
  .admin-sidebar { transform:translateX(-240px); }
  .admin-sidebar.open { transform:translateX(0); box-shadow:4px 0 20px rgba(0,0,0,.4); }
  .admin-main { margin-left:0!important; }
  .admin-content { padding:16px; }
}

/* ─── NOTIFICATION BELL ──────────────────────────────────── */
.notif-btn { position:relative; }
.notif-badge { position:absolute;top:-4px;right:-4px;width:18px;height:18px;border-radius:50%;background:#ef4444;color:#fff;font-size:.6rem;font-weight:700;display:grid;place-items:center;border:2px solid var(--bg-2); }
.notif-dropdown { width:320px;padding:0;overflow:hidden; background:var(--bg-card);border:1px solid var(--border); }
.notif-dropdown-header { padding:12px 16px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center; }
.notif-item { padding:12px 16px;border-bottom:1px solid var(--border);font-size:.82rem;transition:background .15s; }
.notif-item:hover { background:var(--border); }
.notif-item:last-child { border-bottom:none; }
.notif-item.unread { border-left:3px solid #f59e0b;padding-left:13px; }

/* ─── LIGHT MODE COMPONENT OVERRIDES ───────────────────────
   Overrides for elements with hardcoded dark or rgba-white
   values that look wrong in [data-bs-theme="light"].
──────────────────────────────────────────────────────────── */
[data-bs-theme="light"] .hero-panel {
  background: linear-gradient(145deg, #1e3a5f 0%, #1a2e50 100%);
  border-color: rgba(79,142,247,0.25);
}
[data-bs-theme="light"] .hero-panel::before {
  background:
    radial-gradient(ellipse 50% 70% at 90% 20%, rgba(124,58,237,0.07), transparent),
    radial-gradient(ellipse 40% 50% at 10% 80%, rgba(79,142,247,0.06), transparent);
}
[data-bs-theme="light"] .level-chip {
  color: #475569;
  border-color: rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.04);
}
[data-bs-theme="light"] .level-chip:hover {
  background: rgba(79,142,247,0.1);
  border-color: rgba(79,142,247,0.3);
  color: #1d4ed8;
}
[data-bs-theme="light"] .accordion-button::after { filter: none; opacity: 0.5; }
[data-bs-theme="light"] .soft-toast {
  background: #ffffff !important;
  color: #1e293b !important;
  border-color: rgba(0,0,0,0.1) !important;
}
[data-bs-theme="light"] .btn-outline-light {
  border-color: rgba(0,0,0,0.15);
  color: #475569;
  background: transparent;
}
[data-bs-theme="light"] .btn-outline-light:hover { background: rgba(0,0,0,0.05); color: #1e293b; }
[data-bs-theme="light"] .btn-outline-secondary {
  border-color: rgba(0,0,0,0.15); color: #475569;
}
[data-bs-theme="light"] .btn-outline-secondary:hover {
  background: rgba(0,0,0,0.06); color: #1e293b; border-color: rgba(0,0,0,0.25);
}
/* Badges in light mode — readable dark-on-light colors */
[data-bs-theme="light"] .text-bg-primary  { background: rgba(124,58,237,0.10) !important; color: #5b21b6 !important; }
[data-bs-theme="light"] .text-bg-success  { background: rgba(34,197,94,0.10)  !important; color: #166534 !important; }
[data-bs-theme="light"] .text-bg-warning  { background: rgba(245,158,11,0.12) !important; color: #92400e !important; }
[data-bs-theme="light"] .text-bg-danger   { background: rgba(239,68,68,0.10)  !important; color: #991b1b !important; }
[data-bs-theme="light"] .text-bg-info     { background: rgba(79,142,247,0.10)  !important; color: #1e40af !important; }
[data-bs-theme="light"] .text-bg-dark     { background: rgba(0,0,0,0.07) !important; color: #374151 !important; }
[data-bs-theme="light"] .text-bg-light    { background: rgba(0,0,0,0.05) !important; color: #374151 !important; }
/* Table in light mode */
[data-bs-theme="light"] .table thead th { color: #64748b; }
[data-bs-theme="light"] .table td, [data-bs-theme="light"] .table th { border-color: rgba(0,0,0,0.07); }
[data-bs-theme="light"] .table-hover tbody tr:hover td { background: rgba(0,0,0,0.025); }
/* Nav items, sidebar links in light mode */
[data-bs-theme="light"] .sidebar-nav-link:hover { background: rgba(0,0,0,0.05); color: #1e293b; }
[data-bs-theme="light"] .sidebar-nav-link.active { background: rgba(79,142,247,0.1); }
[data-bs-theme="light"] .mobile-sheet-item:hover,
[data-bs-theme="light"] .mobile-sheet-item.active { background: rgba(0,0,0,0.05); color: #1e293b; }
[data-bs-theme="light"] .icon-btn { border-color:rgba(0,0,0,0.12); color:#64748b; }
[data-bs-theme="light"] .icon-btn:hover { color:#1e293b; border-color:rgba(0,0,0,0.2); }
[data-bs-theme="light"] .profile-btn { border-color:rgba(0,0,0,0.12); color:#1e293b; }
[data-bs-theme="light"] .profile-btn:hover { background:rgba(0,0,0,0.04); border-color:rgba(0,0,0,0.2); }
[data-bs-theme="light"] .nav-menu-toggle { border-color:rgba(0,0,0,0.12); color:#64748b; }
[data-bs-theme="light"] .progress { background: rgba(0,0,0,0.08); }
/* Admin modal close button: don't invert in light mode */
[data-bs-theme="light"] .admin-modal .btn-close { filter: none; }

/* ─── ADMIN DESKTOP RESPONSIVE ─────────────────────────── */
.admin-main { overflow-x: hidden; }
.admin-content > * { min-width: 0; }
/* On tablets (768-1024px) reduce sidebar & tighten padding */
@media (min-width:768px) and (max-width:1023.98px) {
  .admin-sidebar { width:200px; }
  .admin-main { margin-left:200px; }
  .admin-main:not(.sidebar-collapsed) { margin-left:200px; }
  .admin-sidebar.collapsed + .admin-main,
  .admin-main.sidebar-collapsed { margin-left:0; }
  .admin-content { padding:16px; }
}
/* Ensure tree view button rows wrap on smaller desktops */
.admin-chapter-card .d-flex.gap-1 { flex-wrap:wrap; }

/* ─── LMS TABLE (theme-safe hover) ─────────────────────── */
.lms-table { color: var(--text); }
.lms-table thead th {
  color: var(--muted); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.07em;
  border-color: var(--border); font-weight: 600;
}
.lms-table td, .lms-table th { border-color: var(--border); }
.lms-table tbody tr:hover td { background: var(--bg-hover, rgba(124,58,237,0.05)); }
[data-bs-theme="light"] .lms-table tbody tr:hover td { background: rgba(0,0,0,0.04); }

/* ─── DASHBOARD STAT CARDS ──────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform 0.15s;
}
.stat-card:hover { transform: translateY(-2px); }

/* ─── FOOTER ────────────────────────────────────────────── */
.lms-footer {
  margin-top: auto;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--muted);
}
.lms-footer a { color: var(--muted); text-decoration: none; }
.lms-footer a:hover { color: var(--accent); }
