/* ==========================================================================
   CoreLMS - Application stylesheet
   Layered on top of Bootstrap 5.3. Supports light and dark colour schemes
   through CSS custom properties and [data-bs-theme].
   ========================================================================== */

:root {
  --lms-primary: #4f46e5;
  --lms-primary-rgb: 79, 70, 229;
  --lms-primary-dark: #4338ca;
  --lms-primary-light: #eef2ff;
  --lms-secondary: #0ea5e9;
  --lms-success: #10b981;
  --lms-warning: #f59e0b;
  --lms-danger: #ef4444;
  --lms-info: #06b6d4;
  --lms-dark: #0f172a;

  --lms-body-bg: #f5f6fa;
  --lms-surface: #ffffff;
  --lms-surface-2: #f8fafc;
  --lms-border: #e5e7eb;
  --lms-text: #1f2937;
  --lms-muted: #6b7280;

  --lms-radius: 14px;
  --lms-radius-sm: 10px;
  --lms-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --lms-shadow: 0 4px 16px rgba(16, 24, 40, .07);
  --lms-shadow-lg: 0 12px 40px rgba(16, 24, 40, .12);

  --lms-sidebar-w: 264px;
  --lms-sidebar-collapsed: 76px;
  --lms-header-h: 66px;

  --lms-sidebar-bg: #111827;
  --lms-sidebar-text: #cbd5e1;
  --lms-sidebar-active: #ffffff;
  --lms-sidebar-hover: rgba(255, 255, 255, .07);
}

[data-bs-theme="dark"] {
  --lms-body-bg: #0b1120;
  --lms-surface: #131c31;
  --lms-surface-2: #182238;
  --lms-border: #24304a;
  --lms-text: #e2e8f0;
  --lms-muted: #94a3b8;
  --lms-primary-light: rgba(79, 70, 229, .16);
  --lms-sidebar-bg: #0d1424;
  --lms-shadow: 0 4px 16px rgba(0, 0, 0, .35);
  --lms-shadow-lg: 0 12px 40px rgba(0, 0, 0, .45);
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--lms-body-bg);
  color: var(--lms-text);
  font-size: .935rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-weight: 650; letter-spacing: -.015em; color: var(--lms-text); }
a { color: var(--lms-primary); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--lms-primary-dark); }
.text-muted, .text-secondary { color: var(--lms-muted) !important; }
::selection { background: rgba(var(--lms-primary-rgb), .18); }

/* Custom scrollbar */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .45); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, .75); }

/* ---------- Buttons ---------- */
.btn { border-radius: var(--lms-radius-sm); font-weight: 550; padding: .55rem 1.15rem; transition: all .18s ease; }
.btn-sm { padding: .35rem .8rem; font-size: .82rem; border-radius: 8px; }
.btn-lg { padding: .8rem 1.7rem; font-size: 1rem; }
.btn-primary { background: var(--lms-primary); border-color: var(--lms-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--lms-primary-dark); border-color: var(--lms-primary-dark); }
.btn-outline-primary { color: var(--lms-primary); border-color: var(--lms-primary); }
.btn-outline-primary:hover { background: var(--lms-primary); border-color: var(--lms-primary); }
.btn-soft-primary { background: var(--lms-primary-light); color: var(--lms-primary); border: 0; }
.btn-soft-primary:hover { background: var(--lms-primary); color: #fff; }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn:focus-visible { outline: 3px solid rgba(var(--lms-primary-rgb), .35); outline-offset: 1px; box-shadow: none; }

/* ---------- Cards ---------- */
.card {
  background: var(--lms-surface);
  border: 1px solid var(--lms-border);
  border-radius: var(--lms-radius);
  box-shadow: var(--lms-shadow-sm);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--lms-border);
  padding: 1rem 1.25rem;
  font-weight: 620;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
}
.card-body { padding: 1.25rem; }
.card-hover { transition: transform .2s ease, box-shadow .2s ease; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--lms-shadow-lg); }

/* ---------- Stat cards ---------- */
.stat-card { position: relative; overflow: hidden; }
.stat-card .stat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex: 0 0 52px;
}
.stat-card .stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1.15; letter-spacing: -.03em; }
.stat-card .stat-label { font-size: .8rem; color: var(--lms-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat-trend { font-size: .78rem; font-weight: 600; }
.stat-trend.up { color: var(--lms-success); }
.stat-trend.down { color: var(--lms-danger); }

/* ---------- Soft badges ---------- */
.badge { font-weight: 600; padding: .38em .7em; border-radius: 7px; font-size: .74rem; letter-spacing: .01em; }
.badge-soft-primary   { background: rgba(79,70,229,.12);  color: #4f46e5; }
.badge-soft-success   { background: rgba(16,185,129,.13); color: #059669; }
.badge-soft-warning   { background: rgba(245,158,11,.15); color: #b45309; }
.badge-soft-danger    { background: rgba(239,68,68,.13);  color: #dc2626; }
.badge-soft-info      { background: rgba(6,182,212,.13);  color: #0891b2; }
.badge-soft-secondary { background: rgba(107,114,128,.14);color: #4b5563; }
.badge-soft-dark      { background: rgba(15,23,42,.12);   color: #1e293b; }
[data-bs-theme="dark"] .badge-soft-warning { color: #fbbf24; }
[data-bs-theme="dark"] .badge-soft-secondary { color: #cbd5e1; }
[data-bs-theme="dark"] .badge-soft-dark { background: rgba(226,232,240,.14); color: #e2e8f0; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .845rem; margin-bottom: .38rem; color: var(--lms-text); }
.form-control, .form-select {
  border-radius: var(--lms-radius-sm);
  border: 1px solid var(--lms-border);
  padding: .58rem .85rem;
  background: var(--lms-surface);
  color: var(--lms-text);
  font-size: .9rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--lms-primary);
  box-shadow: 0 0 0 3px rgba(var(--lms-primary-rgb), .13);
  background: var(--lms-surface);
  color: var(--lms-text);
}
.form-control::placeholder { color: var(--lms-muted); opacity: .8; }
.input-group-text { background: var(--lms-surface-2); border-color: var(--lms-border); color: var(--lms-muted); border-radius: var(--lms-radius-sm); }
.form-check-input:checked { background-color: var(--lms-primary); border-color: var(--lms-primary); }
.form-text { font-size: .8rem; color: var(--lms-muted); }
.required::after { content: " *"; color: var(--lms-danger); }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; color: var(--lms-text); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .8rem 1rem; border-bottom-color: var(--lms-border); }
.table thead th {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  font-weight: 700; color: var(--lms-muted); background: var(--lms-surface-2);
  border-bottom: 1px solid var(--lms-border); white-space: nowrap;
}
.table-hover > tbody > tr:hover > * { background: var(--lms-primary-light); }
.table-responsive { border-radius: var(--lms-radius); }
.table td .avatar-sm { vertical-align: middle; }

/* ---------- Avatars ---------- */
.avatar { border-radius: 50%; object-fit: cover; background: var(--lms-surface-2); }
.avatar-xs { width: 26px; height: 26px; }
.avatar-sm { width: 36px; height: 36px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 72px; height: 72px; }
.avatar-xl { width: 120px; height: 120px; }

/* ---------- Panel layout ---------- */
.lms-app { min-height: 100vh; }

.lms-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--lms-sidebar-w); z-index: 1040;
  background: var(--lms-sidebar-bg); color: var(--lms-sidebar-text);
  display: flex; flex-direction: column;
  transition: transform .25s ease, width .25s ease;
}
.lms-sidebar .sidebar-brand {
  height: var(--lms-header-h); display: flex; align-items: center; gap: .65rem;
  padding: 0 1.15rem; border-bottom: 1px solid rgba(255,255,255,.07); flex: 0 0 auto;
}
.lms-sidebar .sidebar-brand .brand-text { color: #fff; font-weight: 700; font-size: 1.08rem; letter-spacing: -.02em; white-space: nowrap; }
.lms-sidebar .sidebar-brand img { max-height: 34px; }
.lms-sidebar .sidebar-scroll { flex: 1 1 auto; overflow-y: auto; padding: .85rem 0 1.5rem; }
.lms-sidebar .nav-section {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700;
  color: rgba(255,255,255,.35); padding: 1rem 1.35rem .4rem;
}
.lms-sidebar .nav-link {
  color: var(--lms-sidebar-text); padding: .6rem 1.35rem; display: flex; align-items: center;
  gap: .75rem; font-size: .885rem; font-weight: 500; border-left: 3px solid transparent;
  transition: all .15s ease; white-space: nowrap;
}
.lms-sidebar .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; flex: 0 0 20px; }
.lms-sidebar .nav-link:hover { background: var(--lms-sidebar-hover); color: #fff; }
.lms-sidebar .nav-link.active {
  background: linear-gradient(90deg, rgba(var(--lms-primary-rgb), .28), transparent);
  color: var(--lms-sidebar-active); border-left-color: var(--lms-primary);
}
.lms-sidebar .nav-link .badge { margin-left: auto; }
.lms-sidebar .submenu { list-style: none; padding: 0; margin: 0; }
.lms-sidebar .submenu .nav-link { padding-left: 3.3rem; font-size: .84rem; }
.lms-sidebar .nav-toggle::after {
  content: "\F282"; font-family: "bootstrap-icons"; margin-left: auto; font-size: .75rem;
  transition: transform .2s ease;
}
.lms-sidebar .nav-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
.lms-sidebar .sidebar-footer { padding: .9rem 1.35rem; border-top: 1px solid rgba(255,255,255,.07); font-size: .78rem; color: rgba(255,255,255,.4); }

.lms-main { margin-left: var(--lms-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin .25s ease; }

.lms-header {
  height: var(--lms-header-h); background: var(--lms-surface); border-bottom: 1px solid var(--lms-border);
  display: flex; align-items: center; gap: .85rem; padding: 0 1.25rem;
  position: sticky; top: 0; z-index: 1030;
}
.lms-header .header-search { max-width: 340px; flex: 1 1 auto; }
.lms-header .header-search .form-control { background: var(--lms-surface-2); border-color: transparent; }
.lms-content { flex: 1 1 auto; padding: 1.5rem; }
.lms-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--lms-border); color: var(--lms-muted); font-size: .84rem; background: var(--lms-surface); }

/* Collapsed sidebar (desktop) */
body.sidebar-collapsed .lms-sidebar { width: var(--lms-sidebar-collapsed); }
body.sidebar-collapsed .lms-sidebar .brand-text,
body.sidebar-collapsed .lms-sidebar .nav-link span,
body.sidebar-collapsed .lms-sidebar .nav-section,
body.sidebar-collapsed .lms-sidebar .sidebar-footer,
body.sidebar-collapsed .lms-sidebar .nav-toggle::after { display: none; }
body.sidebar-collapsed .lms-sidebar .nav-link { justify-content: center; padding: .7rem; }
body.sidebar-collapsed .lms-sidebar .submenu { display: none !important; }
body.sidebar-collapsed .lms-main { margin-left: var(--lms-sidebar-collapsed); }

.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1035; display: none;
  backdrop-filter: blur(2px);
}

@media (max-width: 991.98px) {
  .lms-sidebar { transform: translateX(-100%); }
  body.sidebar-open .lms-sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .lms-main { margin-left: 0 !important; }
  .lms-content { padding: 1rem; }
  .lms-header .header-search { display: none; }
}

/* ---------- Page header ---------- */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-header h1 { font-size: 1.45rem; margin: 0; font-weight: 680; }
.page-header .breadcrumb { margin: .25rem 0 0; font-size: .82rem; --bs-breadcrumb-divider-color: var(--lms-muted); }
.page-header .breadcrumb-item + .breadcrumb-item::before { content: "/"; color: var(--lms-muted); }

/* ---------- Notification dropdown ---------- */
.notif-dropdown { width: 360px; max-width: 92vw; padding: 0; border-radius: var(--lms-radius); overflow: hidden; box-shadow: var(--lms-shadow-lg); border: 1px solid var(--lms-border); }
.notif-dropdown .notif-head { padding: .85rem 1rem; border-bottom: 1px solid var(--lms-border); display: flex; justify-content: space-between; align-items: center; }
.notif-dropdown .notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--lms-border); transition: background .15s; }
.notif-item:hover { background: var(--lms-surface-2); }
.notif-item.unread { background: var(--lms-primary-light); }
.notif-item .notif-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: 0 0 36px; background: var(--lms-surface-2); }
.notif-badge { position: absolute; top: 4px; right: 4px; font-size: .6rem; padding: .18em .38em; }

/* ---------- Course cards ---------- */
.course-card { overflow: hidden; height: 100%; display: flex; flex-direction: column; }
.course-card .course-thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--lms-surface-2); }
.course-card .course-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.course-card:hover .course-thumb img { transform: scale(1.06); }
.course-card .course-badges { position: absolute; top: .6rem; left: .6rem; display: flex; gap: .35rem; flex-wrap: wrap; }
.course-card .wishlist-btn {
  position: absolute; top: .6rem; right: .6rem; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: 0; display: flex; align-items: center; justify-content: center;
  color: #64748b; transition: all .2s;
}
.course-card .wishlist-btn:hover, .course-card .wishlist-btn.active { background: var(--lms-danger); color: #fff; }
.course-card .card-body { flex: 1 1 auto; display: flex; flex-direction: column; }
.course-card .course-title { font-size: .98rem; font-weight: 650; line-height: 1.4; margin-bottom: .4rem; }
.course-card .course-title a { color: var(--lms-text); }
.course-card .course-title a:hover { color: var(--lms-primary); }
.course-card .course-meta { font-size: .78rem; color: var(--lms-muted); display: flex; gap: .85rem; flex-wrap: wrap; }
.course-card .course-price { font-size: 1.12rem; font-weight: 700; color: var(--lms-primary); }
.course-card .course-price del { font-size: .85rem; font-weight: 400; color: var(--lms-muted); margin-left: .35rem; }

.star-rating { color: #f59e0b; font-size: .82rem; letter-spacing: .5px; }
.rating-value { font-weight: 650; font-size: .82rem; color: var(--lms-text); }

/* ---------- Progress ---------- */
.progress { height: 7px; border-radius: 20px; background: var(--lms-border); }
.progress-bar { background: var(--lms-primary); border-radius: 20px; }
.progress-lg { height: 11px; }
.progress-ring { transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }

/* ---------- Empty / loading / error states ---------- */
.state-box { text-align: center; padding: 3rem 1.25rem; }
.state-box .state-icon {
  width: 84px; height: 84px; border-radius: 50%; background: var(--lms-surface-2);
  display: inline-flex; align-items: center; justify-content: center; font-size: 2.1rem;
  color: var(--lms-muted); margin-bottom: 1rem;
}
.state-box h5 { font-weight: 650; margin-bottom: .4rem; }
.state-box p { color: var(--lms-muted); max-width: 420px; margin: 0 auto 1.15rem; font-size: .9rem; }

.skeleton {
  background: linear-gradient(90deg, var(--lms-surface-2) 25%, var(--lms-border) 37%, var(--lms-surface-2) 63%);
  background-size: 400% 100%; animation: skeleton 1.3s ease infinite; border-radius: 8px;
}
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.lms-loader {
  position: fixed; inset: 0; background: rgba(255,255,255,.72); z-index: 2000;
  display: none; align-items: center; justify-content: center; backdrop-filter: blur(3px);
}
[data-bs-theme="dark"] .lms-loader { background: rgba(11,17,32,.75); }
.lms-loader.show { display: flex; }

.btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Alerts / toasts ---------- */
.alert { border: 0; border-radius: var(--lms-radius-sm); border-left: 4px solid; font-size: .9rem; padding: .85rem 1.1rem; }
.alert-success { background: rgba(16,185,129,.11); color: #047857; border-left-color: #10b981; }
.alert-danger  { background: rgba(239,68,68,.1);   color: #b91c1c; border-left-color: #ef4444; }
.alert-warning { background: rgba(245,158,11,.12); color: #92400e; border-left-color: #f59e0b; }
.alert-info    { background: rgba(6,182,212,.11);  color: #0e7490; border-left-color: #06b6d4; }
[data-bs-theme="dark"] .alert-success { color: #6ee7b7; }
[data-bs-theme="dark"] .alert-danger  { color: #fca5a5; }
[data-bs-theme="dark"] .alert-warning { color: #fcd34d; }
[data-bs-theme="dark"] .alert-info    { color: #67e8f9; }

.toast-stack { position: fixed; top: 82px; right: 20px; z-index: 1090; display: flex; flex-direction: column; gap: .6rem; max-width: 360px; }

/* ---------- Public site ---------- */
.site-navbar { background: var(--lms-surface); border-bottom: 1px solid var(--lms-border); padding: .65rem 0; }
.site-navbar.sticky-top { box-shadow: var(--lms-shadow-sm); }
.site-navbar .navbar-brand { font-weight: 750; font-size: 1.28rem; letter-spacing: -.03em; color: var(--lms-text); }
.site-navbar .navbar-brand span { color: var(--lms-primary); }
.site-navbar .nav-link { font-weight: 550; color: var(--lms-text); padding: .5rem .9rem !important; border-radius: 8px; }
.site-navbar .nav-link:hover, .site-navbar .nav-link.active { color: var(--lms-primary); background: var(--lms-primary-light); }

.hero {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #0ea5e9 100%);
  color: #fff; padding: 4.5rem 0 5rem; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -8%; top: -35%; width: 620px; height: 620px;
  background: radial-gradient(circle, rgba(255,255,255,.14), transparent 62%); border-radius: 50%;
}
.hero h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 3.05rem); font-weight: 780; line-height: 1.15; }
.hero p.lead { color: rgba(255,255,255,.9); font-size: 1.06rem; }
.hero .hero-search { background: #fff; border-radius: 50px; padding: .35rem .35rem .35rem 1.25rem; box-shadow: var(--lms-shadow-lg); }
.hero .hero-search input { border: 0; box-shadow: none !important; background: transparent; color: #1f2937; }
.hero-stat { text-align: center; }
.hero-stat .value { font-size: 1.8rem; font-weight: 750; color: #fff; }
.hero-stat .label { font-size: .8rem; color: rgba(255,255,255,.75); text-transform: uppercase; letter-spacing: .06em; }

.section { padding: 3.5rem 0; }
.section-title { text-align: center; margin-bottom: 2.25rem; }
.section-title .eyebrow { color: var(--lms-primary); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; }
.section-title h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 720; margin: .35rem 0 .5rem; }
.section-title p { color: var(--lms-muted); max-width: 620px; margin: 0 auto; }

.category-tile {
  display: block; padding: 1.4rem 1.1rem; border-radius: var(--lms-radius); text-align: center;
  background: var(--lms-surface); border: 1px solid var(--lms-border); transition: all .22s ease; height: 100%;
}
.category-tile:hover { transform: translateY(-5px); box-shadow: var(--lms-shadow-lg); border-color: var(--lms-primary); }
.category-tile .cat-icon {
  width: 56px; height: 56px; border-radius: 16px; display: inline-flex; align-items: center;
  justify-content: center; font-size: 1.5rem; margin-bottom: .75rem;
}
.category-tile h6 { margin: 0 0 .2rem; font-weight: 650; color: var(--lms-text); font-size: .95rem; }
.category-tile small { color: var(--lms-muted); }

.site-footer { background: #0f172a; color: #94a3b8; padding: 3.25rem 0 0; }
.site-footer h6 { color: #fff; font-size: .9rem; font-weight: 680; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: .06em; }
.site-footer a { color: #94a3b8; font-size: .89rem; display: inline-block; padding: .22rem 0; }
.site-footer a:hover { color: #fff; }
.site-footer .footer-bottom { border-top: 1px solid rgba(255,255,255,.09); margin-top: 2.25rem; padding: 1.15rem 0; font-size: .84rem; }
.site-footer .social-link {
  width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.07);
  display: inline-flex; align-items: center; justify-content: center; margin-right: .45rem;
}
.site-footer .social-link:hover { background: var(--lms-primary); color: #fff; }

/* ---------- Course detail ---------- */
.course-hero { background: var(--lms-dark); color: #fff; padding: 2.75rem 0; }
.course-hero h1 { color: #fff; font-size: clamp(1.4rem, 3vw, 2.15rem); }
.course-hero .text-muted { color: #94a3b8 !important; }
.course-purchase-card { position: sticky; top: 88px; }
.curriculum-chapter { border: 1px solid var(--lms-border); border-radius: var(--lms-radius-sm); margin-bottom: .7rem; overflow: hidden; }
.curriculum-chapter .chapter-head {
  background: var(--lms-surface-2); padding: .85rem 1.1rem; display: flex; align-items: center;
  gap: .7rem; cursor: pointer; font-weight: 620; font-size: .92rem;
}
.curriculum-lesson {
  display: flex; align-items: center; gap: .7rem; padding: .68rem 1.1rem;
  border-top: 1px solid var(--lms-border); font-size: .88rem;
}
.curriculum-lesson:hover { background: var(--lms-surface-2); }
.curriculum-lesson .lesson-duration { margin-left: auto; color: var(--lms-muted); font-size: .8rem; white-space: nowrap; }

/* ---------- Learning player ---------- */
.player-layout { display: grid; grid-template-columns: 1fr 350px; gap: 0; min-height: calc(100vh - var(--lms-header-h)); }
.player-main { padding: 1.25rem 1.5rem 3rem; overflow-y: auto; }
.player-sidebar { border-left: 1px solid var(--lms-border); background: var(--lms-surface); overflow-y: auto; max-height: calc(100vh - var(--lms-header-h)); position: sticky; top: var(--lms-header-h); }
.video-frame { position: relative; padding-top: 56.25%; background: #000; border-radius: var(--lms-radius); overflow: hidden; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.playlist-item { display: flex; gap: .65rem; padding: .65rem .9rem; border-bottom: 1px solid var(--lms-border); font-size: .86rem; cursor: pointer; }
.playlist-item:hover { background: var(--lms-surface-2); }
.playlist-item.active { background: var(--lms-primary-light); border-left: 3px solid var(--lms-primary); }
.playlist-item .done { color: var(--lms-success); }
@media (max-width: 991.98px) {
  .player-layout { grid-template-columns: 1fr; }
  .player-sidebar { border-left: 0; border-top: 1px solid var(--lms-border); position: static; max-height: none; }
}

/* ---------- Quiz ---------- */
.quiz-timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.05rem; }
.quiz-timer.danger { color: var(--lms-danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.quiz-option {
  display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border: 2px solid var(--lms-border);
  border-radius: var(--lms-radius-sm); margin-bottom: .6rem; cursor: pointer; transition: all .15s;
}
.quiz-option:hover { border-color: var(--lms-primary); background: var(--lms-primary-light); }
.quiz-option.selected { border-color: var(--lms-primary); background: var(--lms-primary-light); }
.quiz-option.correct { border-color: var(--lms-success); background: rgba(16,185,129,.1); }
.quiz-option.incorrect { border-color: var(--lms-danger); background: rgba(239,68,68,.09); }
.quiz-nav-btn { width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--lms-border); background: var(--lms-surface); font-weight: 600; font-size: .84rem; }
.quiz-nav-btn.answered { background: var(--lms-primary); color: #fff; border-color: var(--lms-primary); }
.quiz-nav-btn.current { outline: 3px solid rgba(var(--lms-primary-rgb),.35); }

/* ---------- AI panel ---------- */
.ai-panel { border: 1px solid var(--lms-border); border-radius: var(--lms-radius); overflow: hidden; }
.ai-panel .ai-head { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; padding: .8rem 1rem; font-weight: 620; display: flex; align-items: center; gap: .5rem; }
.ai-chat { max-height: 420px; overflow-y: auto; padding: 1rem; background: var(--lms-surface-2); }
.ai-msg { margin-bottom: .85rem; display: flex; gap: .6rem; }
.ai-msg .bubble { padding: .7rem .95rem; border-radius: 14px; font-size: .88rem; max-width: 85%; line-height: 1.6; }
.ai-msg.user { flex-direction: row-reverse; }
.ai-msg.user .bubble { background: var(--lms-primary); color: #fff; border-bottom-right-radius: 4px; }
.ai-msg.assistant .bubble { background: var(--lms-surface); border: 1px solid var(--lms-border); border-bottom-left-radius: 4px; }
.ai-typing span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--lms-muted); margin: 0 2px; animation: bounce 1.2s infinite; }
.ai-typing span:nth-child(2) { animation-delay: .18s; }
.ai-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-6px); opacity: 1; } }

/* ---------- Certificate ---------- */
.certificate-preview { border: 1px solid var(--lms-border); border-radius: var(--lms-radius); overflow: hidden; background: #fff; }
.verify-badge { display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1.15rem; border-radius: 50px; font-weight: 650; }
.verify-badge.valid { background: rgba(16,185,129,.13); color: #047857; }
.verify-badge.invalid { background: rgba(239,68,68,.12); color: #b91c1c; }

/* ---------- Misc ---------- */
.divider-text { display: flex; align-items: center; gap: 1rem; color: var(--lms-muted); font-size: .82rem; margin: 1.2rem 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--lms-border); }
.dropdown-menu { border: 1px solid var(--lms-border); border-radius: var(--lms-radius-sm); box-shadow: var(--lms-shadow-lg); background: var(--lms-surface); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; font-size: .88rem; color: var(--lms-text); }
.dropdown-item:hover { background: var(--lms-primary-light); color: var(--lms-primary); }
.dropdown-item.text-danger:hover { background: rgba(239,68,68,.1); color: var(--lms-danger); }
.nav-tabs { border-bottom: 1px solid var(--lms-border); gap: .2rem; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--lms-muted); font-weight: 600; font-size: .89rem; padding: .65rem 1rem; }
.nav-tabs .nav-link:hover { color: var(--lms-primary); border-bottom-color: var(--lms-border); }
.nav-tabs .nav-link.active { color: var(--lms-primary); background: transparent; border-bottom-color: var(--lms-primary); }
.pagination .page-link { border: 1px solid var(--lms-border); color: var(--lms-text); border-radius: 8px !important; margin: 0 2px; background: var(--lms-surface); }
.pagination .page-item.active .page-link { background: var(--lms-primary); border-color: var(--lms-primary); color: #fff; }
.modal-content { border: 0; border-radius: var(--lms-radius); background: var(--lms-surface); box-shadow: var(--lms-shadow-lg); }
.modal-header, .modal-footer { border-color: var(--lms-border); }
.offcanvas { background: var(--lms-surface); color: var(--lms-text); }
.list-group-item { background: var(--lms-surface); border-color: var(--lms-border); color: var(--lms-text); }
.accordion-item { background: var(--lms-surface); border-color: var(--lms-border); }
.accordion-button { background: var(--lms-surface); color: var(--lms-text); font-weight: 600; font-size: .93rem; }
.accordion-button:not(.collapsed) { background: var(--lms-primary-light); color: var(--lms-primary); box-shadow: none; }
.accordion-button:focus { box-shadow: none; border-color: var(--lms-border); }
.form-switch .form-check-input { width: 2.4em; height: 1.25em; }
.cursor-pointer { cursor: pointer; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.text-truncate-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sortable-handle { cursor: grab; color: var(--lms-muted); }
.sortable-ghost { opacity: .45; }
.chart-wrap { position: relative; height: 300px; }
.chart-wrap.sm { height: 220px; }

@media print {
  .lms-sidebar, .lms-header, .lms-footer, .no-print, .site-navbar, .site-footer { display: none !important; }
  .lms-main { margin: 0 !important; }
  body { background: #fff; }
}
