/* ============================================================
   Triton LMS — Main Stylesheet
   Server path: httpdocs/assets/css/style.css
   Design: Dark theme, purple/cyan accent, Inter + Space Grotesk
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:          #0D1117;
  --surface:     #161B22;
  --surface2:    #1C2230;
  --surface3:    #21262D;
  --border:      #30363D;
  --border2:     #3D444D;
  --primary:     #7C3AED;
  --primary-h:   #6D28D9;
  --primary-l:   #A78BFA;
  --accent:      #06B6D4;
  --accent-h:    #0891B2;
  --green:       #10B981;
  --red:         #EF4444;
  --yellow:      #F59E0B;
  --text:        #E6EDF3;
  --text-muted:  #8B949E;
  --text-dim:    #6E7681;
  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   16px;
  --shadow:      0 4px 24px rgba(0,0,0,.45);
  --shadow-sm:   0 2px 8px rgba(0,0,0,.3);
  --transition:  0.2s ease;
  --font-body:   'Inter', system-ui, sans-serif;
  --font-head:   'Space Grotesk', 'Inter', sans-serif;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary-l); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

img { max-width: 100%; display: block; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

main { flex: 1; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Utility ────────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-success { color: var(--green) !important; }
.text-danger  { color: var(--red) !important; }
.text-muted   { color: var(--text-muted) !important; }
.mb-3         { margin-bottom: 1rem; }
.small-email  { font-size: .75rem; color: var(--text-muted); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-h); color: #fff; box-shadow: 0 0 16px rgba(124,58,237,.4); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { background: var(--surface3); color: var(--text); }

.btn-danger  { background: var(--red);   color: #fff; }
.btn-success { background: var(--green); color: #fff; }

.btn-sm  { padding: .35rem .9rem; font-size: .8rem; }
.btn-xs  { padding: .2rem .6rem;  font-size: .75rem; }
.btn-lg  { padding: .75rem 1.75rem; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 1rem;
}
.alert-error   { background: rgba(239,68,68,.15);  color: #FCA5A5; border: 1px solid rgba(239,68,68,.3); }
.alert-success { background: rgba(16,185,129,.15); color: #6EE7B7; border: 1px solid rgba(16,185,129,.3); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.badge-beginner     { background: rgba(16,185,129,.2);  color: #6EE7B7; }
.badge-intermediate { background: rgba(245,158,11,.2);  color: #FCD34D; }
.badge-advanced     { background: rgba(239,68,68,.2);   color: #FCA5A5; }
.badge-final        { background: rgba(124,58,237,.25); color: var(--primary-l); }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: .4rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: .65rem .9rem;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: .9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,.2);
}

.form-hint { font-size: .78rem; color: var(--text-dim); margin-top: .35rem; }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.input-icon-wrap { position: relative; }
.input-icon-wrap input { padding-right: 2.5rem; }
.toggle-pw {
  position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1rem; color: var(--text-muted);
}

.honeypot { display: none !important; }

.form-label-link { font-size: .8rem; color: var(--primary-l); font-weight: 400; }
.form-footer { text-align: center; font-size: .85rem; color: var(--text-muted); margin-top: 1rem; }

.input-sm   { padding: .35rem .6rem; font-size: .85rem; width: auto; }
.input-search { min-width: 240px; }

/* Password strength meter */
.password-strength { height: 4px; border-radius: 2px; margin-top: .5rem; background: var(--border); overflow: hidden; }
.password-strength::after {
  content: ''; display: block; height: 100%;
  width: var(--pw-width, 0%); background: var(--pw-color, var(--red));
  transition: width .3s, background .3s;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,17,23,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 60px;
  display: flex; align-items: center;
}

.nav-inner {
  max-width: 1280px; margin: 0 auto; width: 100%;
  display: flex; align-items: center; gap: 1.5rem;
}

.nav-logo {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--font-head); font-weight: 700; font-size: 1.05rem;
  color: var(--text); text-decoration: none;
}
.nav-logo:hover { color: var(--text); }

.nav-links {
  display: flex; align-items: center; gap: .25rem;
  list-style: none; margin-left: .5rem;
}

.nav-links a {
  display: block; padding: .4rem .75rem;
  font-size: .875rem; color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface2); }

.nav-spacer { flex: 1; }

.nav-xp {
  display: flex; align-items: center; gap: .4rem;
  font-size: .8rem; color: var(--text-muted);
  background: var(--surface3); padding: .3rem .7rem;
  border-radius: 999px; border: 1px solid var(--border);
}
.nav-xp strong { color: var(--primary-l); }

.nav-avatar-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--border2); cursor: pointer;
  font-size: .8rem; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); position: relative;
  transition: border-color var(--transition);
}
.nav-avatar-btn:hover { border-color: var(--primary-l); }

.nav-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); width: 200px;
  box-shadow: var(--shadow); overflow: hidden;
  display: none;
}
.nav-dropdown.open { display: block; }

.nav-dropdown-user { padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.nav-dropdown-user strong { font-size: .9rem; display: block; }
.nav-dropdown-user span  { font-size: .78rem; color: var(--text-muted); }

.nav-dropdown a, .nav-dropdown button {
  display: block; width: 100%; text-align: left;
  padding: .6rem 1rem; font-size: .875rem; color: var(--text);
  background: none; border: none; cursor: pointer;
  transition: background var(--transition);
}
.nav-dropdown a:hover, .nav-dropdown button:hover { background: var(--surface3); }
.nav-dropdown .dd-divider { height: 1px; background: var(--border); }
.nav-dropdown .dd-logout { color: var(--red); }

.nav-hamburger {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--text); font-size: 1.25rem; margin-left: auto;
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  margin-top: auto;
}
.footer-container {
  max-width: 1280px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
  text-align: center;
}
.footer-brand { display: flex; align-items: center; gap: .5rem; font-family: var(--font-head); font-size: 1rem; }
.footer-tagline { font-size: .85rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; justify-content: center; }
.footer-links a { font-size: .85rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: .78rem; color: var(--text-dim); }

/* ── Toasts ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999;
  display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .75rem 1rem;
  display: flex; align-items: flex-start; gap: .75rem;
  box-shadow: var(--shadow); min-width: 280px; max-width: 380px;
  animation: slideIn .3s ease;
}
.toast-success { border-left: 3px solid var(--green); }
.toast-icon    { font-size: 1.25rem; }
.toast-body strong { display: block; font-size: .9rem; }
.toast-body p  { font-size: .82rem; color: var(--text-muted); margin-top: .2rem; }
.toast-close   { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: .9rem; margin-left: auto; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Auth pages ─────────────────────────────────────────────── */
.page-auth body { background: var(--bg); }
.auth-container {
  min-height: calc(100vh - 60px);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2.5rem 2rem;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow);
}
.auth-logo   { display: flex; justify-content: center; margin-bottom: 1.25rem; }
.auth-title  { font-size: 1.6rem; text-align: center; margin-bottom: .35rem; }
.auth-sub    { text-align: center; color: var(--text-muted); font-size: .9rem; margin-bottom: 1.75rem; }
.auth-footer { text-align: center; font-size: .85rem; color: var(--text-muted); margin-top: 1.25rem; }

/* ── Landing page ───────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  padding: 6rem 1.5rem 5rem;
  text-align: center;
}
.hero-bg-grid {
  position: absolute; inset: 0; z-index: 0;
  background-image: linear-gradient(rgba(124,58,237,.06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(124,58,237,.06) 1px, transparent 1px);
  background-size: 40px 40px;
}
.hero-container { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }

.hero-badge {
  display: inline-block; background: rgba(124,58,237,.15);
  border: 1px solid rgba(124,58,237,.3); border-radius: 999px;
  padding: .35rem 1rem; font-size: .82rem; color: var(--primary-l);
  margin-bottom: 1.5rem;
}
.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.15; margin-bottom: 1rem;
}
.gradient-text {
  background: linear-gradient(90deg, var(--primary-l), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub { font-size: 1.1rem; color: var(--text-muted); max-width: 560px; margin: 0 auto 2rem; }

.hero-stats {
  display: flex; align-items: center; justify-content: center; gap: 1.5rem;
  margin-bottom: 2.5rem; flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.stat-n { display: block; font-family: var(--font-head); font-size: 1.75rem; font-weight: 700; color: var(--text); }
.stat-l { display: block; font-size: .8rem; color: var(--text-muted); }
.hero-stat-div { width: 1px; height: 40px; background: var(--border); }

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

.hero-scroll-indicator {
  position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
}
.scroll-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-dim);
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%       { transform: translateY(-8px); opacity: .5; }
}

/* Features */
.features-section, .courses-preview-section, .register-section {
  padding: 5rem 1.5rem;
}
.features-section   { background: var(--surface); }
.register-section   { background: var(--surface); }

.section-container  { max-width: 1100px; margin: 0 auto; }
.section-label {
  display: inline-block; font-size: .8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent); margin-bottom: .75rem;
}
.section-title { font-size: clamp(1.5rem, 3vw, 2.25rem); margin-bottom: 2.5rem; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.feature-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border2); }
.feature-icon { font-size: 2rem; margin-bottom: .75rem; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: .5rem; }
.feature-card p  { font-size: .875rem; color: var(--text-muted); }

/* Course preview */
.course-preview-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem;
  display: flex; align-items: center; gap: 2rem; flex-wrap: wrap;
  position: relative;
}
.cpc-badge {
  position: absolute; top: -12px; left: 1.5rem;
  background: var(--primary); color: #fff; font-size: .7rem;
  font-weight: 700; padding: .2rem .6rem; border-radius: 999px;
}
.cpc-icon { font-size: 3.5rem; }
.cpc-body { flex: 1; }
.cpc-meta { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.cpc-duration, .cpc-xp { font-size: .82rem; color: var(--text-muted); }
.cpc-body h3 { font-size: 1.3rem; margin-bottom: .5rem; }
.cpc-body p  { font-size: .9rem; color: var(--text-muted); margin-bottom: 1rem; }
.cpc-modules { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: var(--text-dim); }

/* Register section */
.register-wrap {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 3rem; align-items: start;
}
.register-info h2    { font-size: 2rem; margin-bottom: 1rem; }
.register-info p     { color: var(--text-muted); margin-bottom: 1.25rem; }
.register-perks      { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.register-perks li   { font-size: .9rem; color: var(--text-muted); }
.register-form-wrap  {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem;
}
.register-form-wrap h3 { font-size: 1.25rem; margin-bottom: 1.5rem; }

/* ── Dashboard ──────────────────────────────────────────────── */
.dashboard-main    { padding: 2rem 1.5rem; }
.dashboard-container { max-width: 1280px; margin: 0 auto; }

.dash-hero {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap; margin-bottom: 2rem;
}
.dash-hero-left { display: flex; align-items: center; gap: 1.25rem; }

.dash-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 1.5rem; font-weight: 700;
  color: #fff; position: relative; flex-shrink: 0;
}
.dash-level-badge {
  position: absolute; bottom: -4px; right: -4px;
  background: var(--primary); color: #fff; font-size: .65rem;
  font-weight: 700; padding: .15rem .45rem; border-radius: 999px;
  border: 2px solid var(--bg);
}
.dash-user-info h1 { font-size: 1.4rem; margin-bottom: .25rem; }
.dash-role { font-size: .875rem; color: var(--text-muted); margin-bottom: .75rem; }

.dash-xp-bar-wrap  { min-width: 220px; }
.dash-xp-label     { display: flex; justify-content: space-between; font-size: .78rem; color: var(--text-muted); margin-bottom: .4rem; }
.dash-xp-bar       { height: 8px; background: var(--surface3); border-radius: 4px; overflow: hidden; }
.dash-xp-fill      { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 4px; transition: width .5s ease; }

.dash-hero-stats   { display: flex; gap: 2rem; flex-wrap: wrap; }
.dash-stat         { text-align: center; }
.ds-num { display: block; font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; }
.ds-lbl { display: block; font-size: .78rem; color: var(--text-muted); }

.dash-grid {
  display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem;
  align-items: start;
}

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.section-header h2 { font-size: 1.2rem; }
.section-link      { font-size: .85rem; color: var(--primary-l); }

/* Course cards */
.course-cards { display: grid; gap: 1.25rem; }

.course-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  transition: transform var(--transition), border-color var(--transition);
}
.course-card:hover { transform: translateY(-2px); border-color: var(--border2); }
.course-passed { border-color: rgba(16,185,129,.3) !important; }

.cc-header      { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.cc-icon        { font-size: 1.75rem; }
.cc-meta        { display: flex; align-items: center; gap: .5rem; flex: 1; }
.cc-duration    { font-size: .78rem; color: var(--text-dim); }
.cc-passed-badge { font-size: .78rem; color: var(--green); }

.cc-title { font-size: 1rem; margin-bottom: .4rem; }
.cc-desc  { font-size: .83rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.5; }

.cc-progress      { margin-bottom: 1rem; }
.cc-progress-bar  { height: 6px; background: var(--surface3); border-radius: 3px; overflow: hidden; margin-bottom: .35rem; }
.cc-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 3px; }
.cc-progress-pct  { font-size: .78rem; color: var(--text-muted); }

.cc-footer { display: flex; align-items: center; justify-content: space-between; }
.cc-xp     { font-size: .82rem; color: var(--accent); font-weight: 600; }

/* Sidebar widgets */
.dash-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }

.widget-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
}
.widget-title { font-size: .95rem; margin-bottom: 1rem; display: flex; align-items: center; justify-content: space-between; }
.badge-count  { font-size: .78rem; background: var(--surface3); padding: .15rem .5rem; border-radius: 999px; color: var(--text-muted); }

/* Streak card */
.streak-card { text-align: center; }
.streak-num   { font-family: var(--font-head); font-size: 2.5rem; font-weight: 800; }
.streak-label { font-size: .85rem; color: var(--text-muted); margin-bottom: .5rem; }
.streak-cta   { font-size: .82rem; color: var(--text-muted); }

/* Activity list */
.activity-list { list-style: none; display: flex; flex-direction: column; gap: .6rem; }
.activity-item { display: flex; align-items: flex-start; gap: .6rem; }
.act-icon      { font-size: 1rem; flex-shrink: 0; margin-top: .1rem; }
.act-body      { display: flex; flex-direction: column; }
.act-title     { font-size: .85rem; }
.act-time      { font-size: .75rem; color: var(--text-dim); }
.empty-sm      { font-size: .85rem; color: var(--text-muted); }

/* Badge grid */
.badge-grid     { display: flex; flex-wrap: wrap; gap: .75rem; }
.badge-item     { display: flex; flex-direction: column; align-items: center; gap: .35rem; cursor: default; }
.badge-icon-wrap {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid; display: flex; align-items: center; justify-content: center;
  background: var(--surface3);
}
.badge-emoji  { font-size: 1.3rem; }
.badge-name   { font-size: .65rem; color: var(--text-muted); text-align: center; max-width: 56px; }

/* ── Leaderboard ────────────────────────────────────────────── */
.leaderboard-main { padding: 2rem 1.5rem; }
.lb-container     { max-width: 960px; margin: 0 auto; }

.lb-header { text-align: center; margin-bottom: 2rem; }
.lb-header h1 { font-size: 2rem; margin-bottom: .5rem; }
.lb-sub { color: var(--text-muted); margin-bottom: 1rem; }
.my-rank-badge {
  display: inline-block; background: rgba(124,58,237,.15);
  border: 1px solid rgba(124,58,237,.3); border-radius: 999px;
  padding: .3rem 1rem; font-size: .85rem;
}

.lb-tabs { display: flex; gap: .5rem; margin-bottom: 1.5rem; }
.lb-tab  {
  padding: .5rem 1.25rem; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); cursor: pointer; font-size: .875rem;
  transition: all var(--transition);
}
.lb-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Podium */
.podium {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 1rem; margin-bottom: 2rem; padding: 1rem 0;
}
.podium-slot  { display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.podium-crown { font-size: 1.5rem; }
.podium-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; color: #fff; font-size: .9rem;
}
.podium-1 .podium-avatar { width: 64px; height: 64px; font-size: 1.1rem; }
.podium-name  { font-size: .82rem; font-weight: 600; }
.podium-xp    { font-size: .75rem; color: var(--text-muted); }
.podium-block {
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  width: 80px;
}
.podium-rank  { font-family: var(--font-head); font-size: 1.5rem; font-weight: 800; }
.podium-block-1 { background: linear-gradient(180deg, #F59E0B, #D97706); height: 80px; }
.podium-block-2 { background: var(--surface3); height: 60px; }
.podium-block-3 { background: var(--surface3); height: 44px; }

/* Leaderboard table */
.lb-table-wrap { overflow-x: auto; }
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th, .lb-table td {
  padding: .75rem 1rem; text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
}
.lb-table th { color: var(--text-muted); font-weight: 500; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.lb-table tr:last-child td { border-bottom: none; }

.lb-row { transition: background var(--transition); }
.lb-row:hover { background: var(--surface2); }
.lb-row-me    { background: rgba(124,58,237,.08) !important; }

.td-rank { font-family: var(--font-head); font-size: 1rem; width: 60px; }
.td-user { min-width: 200px; }

.lb-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; color: #fff;
}
.lb-avatar-sm  { width: 30px; height: 30px; font-size: .65rem; }
.lb-avatar-lg  { width: 56px; height: 56px; font-size: 1rem; }

.lb-user-info  { display: flex; flex-direction: column; }
.lb-name       { font-weight: 600; font-size: .9rem; }
.lb-dept       { font-size: .75rem; color: var(--text-muted); }
.lb-level      { font-size: .82rem; color: var(--text-muted); }
.lb-xp         { font-size: .875rem; color: var(--accent); font-weight: 600; }
.you-tag       { background: var(--primary); color: #fff; font-size: .65rem; padding: .1rem .4rem; border-radius: 999px; margin-left: .4rem; }

.td-user .lb-avatar { display: inline-flex; vertical-align: middle; margin-right: .6rem; }
td.td-user { display: flex; align-items: center; }

/* ── Course view ────────────────────────────────────────────── */
.course-view-main  { padding: 2rem 1.5rem; }
.cv-container      { max-width: 1100px; margin: 0 auto; }

.cv-hero {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem;
  display: flex; align-items: flex-start; gap: 1.5rem; margin-bottom: 2rem;
}
.cv-hero-icon { font-size: 3rem; flex-shrink: 0; }
.cv-hero-body { flex: 1; }
.cv-meta       { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; font-size: .82rem; }
.cv-cat, .cv-dur, .cv-xp { color: var(--text-muted); }
.cv-xp         { color: var(--accent); font-weight: 600; }
.cv-hero-body h1 { font-size: 1.75rem; margin-bottom: .5rem; }
.cv-desc       { color: var(--text-muted); margin-bottom: 1.25rem; font-size: .925rem; }

.cv-progress-row { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.cv-progress-bar-wrap { flex: 1; }
.cv-progress-bar  { height: 8px; background: var(--surface3); border-radius: 4px; overflow: hidden; margin-bottom: .35rem; }
.cv-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.cv-progress-pct  { font-size: .8rem; color: var(--text-muted); }
.cv-passed        { font-size: .9rem; color: var(--green); font-weight: 600; }

.cv-grid    { display: grid; grid-template-columns: 1fr 280px; gap: 1.5rem; align-items: start; }
.cv-modules { display: flex; flex-direction: column; gap: 1rem; }
.cv-section-title { font-size: 1.1rem; margin-bottom: .75rem; }

/* Module cards */
.module-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.module-card.module-done { border-color: rgba(16,185,129,.25); }
.exam-card { border-color: rgba(124,58,237,.3); }

.module-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; gap: 1rem;
}
.module-header-left { display: flex; align-items: center; gap: .75rem; }
.module-icon        { font-size: 1.25rem; }
.module-title       { font-weight: 600; font-size: .95rem; }
.module-desc        { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }
.module-progress-info { font-size: .8rem; color: var(--text-muted); white-space: nowrap; }

.lesson-list { list-style: none; border-top: 1px solid var(--border); }
.lesson-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.lesson-item:last-child  { border-bottom: none; }
.lesson-item:hover       { background: var(--surface2); }
.lesson-item.lesson-done { color: var(--text-muted); }
.lesson-quiz-item        { background: rgba(124,58,237,.05); }

.lesson-status-icon { font-size: .9rem; flex-shrink: 0; }
.lesson-item-body   { flex: 1; display: flex; align-items: center; gap: .75rem; }
.lesson-title-link  { font-size: .875rem; color: var(--text); }
.lesson-title-link:hover { color: var(--primary-l); }
.lesson-dur         { font-size: .75rem; color: var(--text-dim); }
.lesson-done-tag    { font-size: .72rem; color: var(--green); font-weight: 600; }

.exam-action { padding: 1rem 1.25rem; display: flex; align-items: center; gap: 1rem; }
.exam-passed-msg { color: var(--green); font-size: .9rem; font-weight: 600; }
.exam-attempts   { font-size: .82rem; color: var(--text-muted); }

/* cv-sidebar */
.cv-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }
.cv-stat-list { list-style: none; display: flex; flex-direction: column; gap: .6rem; }
.cv-stat-list li { display: flex; justify-content: space-between; font-size: .875rem; }
.cv-stat-list li span { color: var(--text-muted); }

.cert-widget { text-align: center; border-color: rgba(16,185,129,.3); }
.cert-icon   { font-size: 2.5rem; margin-bottom: .5rem; }

/* ── Lesson page ────────────────────────────────────────────── */
.lesson-main    { flex: 1; }
.lesson-layout  { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 60px); }

/* Sidebar */
.lesson-sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  overflow-y: auto; position: sticky; top: 60px; height: calc(100vh - 60px);
}
.lesson-sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.back-link    { font-size: .82rem; color: var(--text-muted); }
.back-link:hover { color: var(--text); }
.sidebar-toggle { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; }

.sidebar-module      { border-bottom: 1px solid var(--border); padding: .5rem 0; }
.sidebar-module-title {
  padding: .6rem 1.25rem; font-size: .78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim);
}
.sidebar-lesson-list { list-style: none; }
.sidebar-lesson-item a {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem 1.25rem; font-size: .83rem; color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.sidebar-lesson-item a:hover       { background: var(--surface2); color: var(--text); }
.sidebar-lesson-item.active a      { background: rgba(124,58,237,.12); color: var(--text); }
.sidebar-lesson-item.done a        { color: var(--text-dim); }
.sli-icon { font-size: .8rem; flex-shrink: 0; }

/* Lesson content */
.lesson-content-wrap {
  padding: 2.5rem 3rem;
  max-width: 820px;
}
.lesson-breadcrumb { font-size: .8rem; color: var(--text-muted); margin-bottom: .75rem; }
.lesson-breadcrumb a { color: var(--text-muted); }
.lesson-breadcrumb span { margin: 0 .4rem; }
.lesson-title      { font-size: 1.75rem; margin-bottom: .5rem; }
.lesson-meta       { display: flex; align-items: center; gap: .75rem; font-size: .82rem; color: var(--text-muted); margin-bottom: 2rem; }
.lesson-complete-badge { color: var(--green); font-weight: 600; }

/* Lesson body typography */
.lesson-body { line-height: 1.8; }
.lesson-body h2 { font-size: 1.35rem; margin: 2rem 0 .75rem; }
.lesson-body h3 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
.lesson-body p  { margin-bottom: 1rem; color: var(--text-muted); }
.lesson-body ul, .lesson-body ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.lesson-body li { margin-bottom: .4rem; color: var(--text-muted); }
.lesson-body strong { color: var(--text); }
.lesson-body code {
  background: var(--surface3); padding: .15rem .4rem;
  border-radius: 4px; font-size: .875em;
}
.lesson-body pre {
  background: var(--surface3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1.25rem;
  overflow-x: auto; margin: 1.25rem 0;
}
.lesson-body pre code { background: none; padding: 0; }
.lesson-body blockquote {
  border-left: 3px solid var(--primary); padding-left: 1rem;
  color: var(--text-muted); margin: 1rem 0; font-style: italic;
}
.lesson-body table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; }
.lesson-body th, .lesson-body td { padding: .6rem 1rem; border: 1px solid var(--border); font-size: .875rem; }
.lesson-body th { background: var(--surface2); font-weight: 600; }

/* Lesson nav */
.lesson-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
  gap: 1rem; flex-wrap: wrap;
}
.lesson-complete-form { margin: 0; }

/* ── Quiz page ──────────────────────────────────────────────── */
.quiz-main      { padding: 2.5rem 1.5rem; }
.quiz-container { max-width: 760px; margin: 0 auto; }

.quiz-header  { margin-bottom: 2rem; }
.quiz-breadcrumb { font-size: .8rem; color: var(--text-muted); margin-bottom: .5rem; }
.quiz-breadcrumb a { color: var(--text-muted); }
.quiz-title   { font-size: 1.75rem; margin-bottom: .5rem; }
.quiz-meta    { display: flex; gap: .75rem; flex-wrap: wrap; font-size: .82rem; color: var(--text-muted); margin-bottom: .5rem; }
.quiz-desc    { color: var(--text-muted); font-size: .9rem; }

.prev-attempts { margin-bottom: 1.25rem; font-size: .82rem; color: var(--text-muted); }
.pa-badge { display: inline-block; padding: .2rem .5rem; border-radius: 4px; margin-left: .3rem; font-size: .78rem; font-weight: 700; }
.pa-pass  { background: rgba(16,185,129,.2); color: var(--green); }
.pa-fail  { background: rgba(239,68,68,.2);  color: var(--red); }

/* Quiz progress bar */
.quiz-progress-bar {
  height: 6px; background: var(--surface3); border-radius: 3px;
  overflow: hidden; margin-bottom: .4rem; position: relative;
}
.quiz-progress-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s; }
.quiz-progress-text { font-size: .78rem; color: var(--text-muted); margin-bottom: 1.75rem; }

/* Questions */
.quiz-question {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: border-color var(--transition);
}
.quiz-question.answered { border-color: var(--border2); }
.qq-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.qq-num    { font-size: .78rem; font-weight: 600; color: var(--primary-l); text-transform: uppercase; }
.qq-status { font-size: .75rem; color: var(--text-dim); }
.qq-text   { font-weight: 600; font-size: 1rem; margin-bottom: 1rem; line-height: 1.5; }
.qq-answers { display: flex; flex-direction: column; gap: .5rem; }

.qq-answer {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .75rem 1rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.qq-answer:hover   { background: var(--surface2); border-color: var(--border2); }
.qq-answer input[type=radio] { margin-top: .15rem; accent-color: var(--primary); flex-shrink: 0; }
.qq-answer-text    { font-size: .9rem; line-height: 1.5; }
.qq-answer.selected { background: rgba(124,58,237,.08); border-color: var(--primary); }

/* Quiz submit */
.quiz-submit-wrap { margin-top: 2rem; text-align: center; }
.quiz-unanswered-warning { color: var(--yellow); font-size: .875rem; margin-bottom: 1rem; }

/* Results */
.quiz-results { }
.result-score-card {
  text-align: center; padding: 2.5rem 2rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); margin-bottom: 1.5rem;
}
.result-pass  { border-color: rgba(16,185,129,.3); background: rgba(16,185,129,.04); }
.result-fail  { border-color: rgba(239,68,68,.25); }
.result-icon  { font-size: 3rem; margin-bottom: .75rem; }
.result-score { font-family: var(--font-head); font-size: 4rem; font-weight: 800; line-height: 1; margin-bottom: .5rem; }
.result-pass .result-score { color: var(--green); }
.result-fail .result-score { color: var(--red); }
.result-label    { font-size: 1.1rem; font-weight: 600; margin-bottom: .5rem; }
.result-xp-earned { font-size: .9rem; color: var(--accent); font-weight: 600; }

.result-actions { display: flex; gap: 1rem; justify-content: center; margin-bottom: 2rem; flex-wrap: wrap; }

.result-breakdown { }
.result-breakdown h3 { font-size: 1.1rem; margin-bottom: 1rem; }
.result-question {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: .75rem;
}
.rq-correct { border-color: rgba(16,185,129,.25); }
.rq-wrong   { border-color: rgba(239,68,68,.2); }
.rq-num     { font-size: .82rem; font-weight: 700; margin-bottom: .4rem; }
.rq-text    { font-size: .9rem; font-weight: 600; margin-bottom: .5rem; }
.rq-your-answer  { font-size: .82rem; color: var(--red); }
.rq-correct-answer { font-size: .82rem; color: var(--green); }
.rq-explanation { font-size: .82rem; color: var(--text-muted); margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--border); }

/* ── Admin pages ────────────────────────────────────────────── */
.admin-main      { padding: 2rem 1.5rem; }
.admin-container { max-width: 1280px; margin: 0 auto; }

.admin-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.75rem;
}
.admin-page-header h1 { font-size: 1.5rem; }

/* Stat cards */
.admin-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.admin-stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  display: flex; align-items: center; gap: .75rem;
}
.asc-icon { font-size: 1.5rem; }
.asc-num  { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; }
.asc-lbl  { font-size: .78rem; color: var(--text-muted); }

/* Charts */
.admin-charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 2rem; }
.admin-chart-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
}
.admin-chart-card h3 { font-size: .95rem; margin-bottom: 1rem; }

.mini-chart {
  display: flex; align-items: flex-end; gap: 3px; height: 80px;
  overflow: hidden;
}
.mc-bar-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; }
.mc-bar      { width: 100%; border-radius: 2px 2px 0 0; background: var(--primary); min-height: 2px; }
.mc-bar-accent { background: var(--accent); }
.mc-label    { font-size: .6rem; color: var(--text-dim); }

/* Admin grid + cards */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 1.25rem; }
.admin-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
}
.admin-card-title { font-size: .95rem; margin-bottom: 1rem; display: flex; align-items: center; justify-content: space-between; }
.admin-card-link  { font-size: .8rem; color: var(--primary-l); font-weight: 400; }

/* Admin table */
.admin-table      { width: 100%; border-collapse: collapse; font-size: .85rem; }
.admin-table th, .admin-table td {
  padding: .6rem .75rem; text-align: left;
  border-bottom: 1px solid var(--border);
}
.admin-table th    { color: var(--text-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 500; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface2); }
.admin-table a     { color: var(--text); }
.admin-table a:hover { color: var(--primary-l); }
.admin-table-wrap  { overflow-x: auto; }
.row-inactive td   { opacity: .55; }

/* Mini progress in table */
.mini-progress      { display: inline-block; width: 80px; height: 5px; background: var(--surface3); border-radius: 3px; overflow: hidden; vertical-align: middle; margin-right: .4rem; }
.mini-progress-fill { height: 100%; background: var(--primary); }

/* Top learner list */
.top-learner-list { list-style: none; display: flex; flex-direction: column; gap: .6rem; }
.tl-item { display: flex; align-items: center; gap: .75rem; }
.tl-rank { font-family: var(--font-head); font-size: .9rem; width: 1.5rem; color: var(--text-muted); }
.tl-info { flex: 1; display: flex; flex-direction: column; }
.tl-name { font-size: .875rem; font-weight: 600; color: var(--text); }
.tl-dept { font-size: .75rem; color: var(--text-muted); }
.tl-xp   { font-size: .82rem; color: var(--accent); font-weight: 600; }

/* Admin filter form */
.admin-filter-form { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.admin-filter-form select { width: auto; }
.filter-count { font-size: .82rem; color: var(--text-muted); margin-left: .5rem; }

/* User detail */
.user-detail-wrap  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.user-detail-header {
  display: flex; align-items: flex-start; gap: 1.5rem; padding: 1.75rem;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.user-detail-info { flex: 1; }
.user-detail-info h2 { font-size: 1.25rem; margin-bottom: .25rem; }
.user-detail-info p  { font-size: .875rem; color: var(--text-muted); margin-bottom: .25rem; }
.user-detail-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.user-detail-tabs { padding: .75rem 1.75rem; border-bottom: 1px solid var(--border); display: flex; gap: .4rem; }
.lb-panel { padding: 1.25rem 1.75rem; }

/* Status dots */
.status-dot { font-size: .78rem; font-weight: 600; }
.status-active   { color: var(--green); }
.status-inactive { color: var(--red); }

/* User cell */
.user-cell { display: flex; align-items: center; gap: .6rem; }
.user-name-link { font-weight: 600; }

/* Pagination */
.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.page-link  {
  display: inline-block; padding: .35rem .75rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: .85rem; color: var(--text-muted);
  transition: all var(--transition);
}
.page-link:hover  { background: var(--surface3); color: var(--text); }
.page-active      { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Empty states */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); font-size: .9rem; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .cv-grid   { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .admin-charts-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .form-row     { grid-template-columns: 1fr; }
  .register-wrap { grid-template-columns: 1fr; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-sidebar { display: none; position: relative; height: auto; }
  .lesson-sidebar.open { display: block; }
  .lesson-content-wrap { padding: 1.5rem 1rem; }
  .hide-sm { display: none; }
  .nav-links { display: none; }
  .nav-hamburger { display: block; }
  .podium-slot { transform: scale(.85); }
  .cv-hero { flex-direction: column; }
}

@media (max-width: 480px) {
  .dash-hero       { flex-direction: column; align-items: flex-start; }
  .dash-hero-stats { gap: 1rem; }
  .hero-actions    { flex-direction: column; }
  .auth-card       { padding: 1.75rem 1.25rem; }
  .register-form-wrap { padding: 1.5rem 1.25rem; }
}
