/* ============================================================
   CSBU Engineering Academy — STYLES
   Modern, high-tech, encouraging. Light + dark aware.
   ============================================================ */
:root {
  --bg: #0b1020;
  --bg-2: #10182f;
  --panel: #151d38;
  --panel-2: #1b2547;
  --line: #273256;
  --text: #eaf0ff;
  --muted: #93a0c8;
  --brand: #4f8cff;
  --brand-2: #7c5cff;
  --accent: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --grad: linear-gradient(135deg, #4f8cff 0%, #7c5cff 55%, #22d3ee 130%);
  --grad-soft: linear-gradient(135deg, rgba(79,140,255,.16), rgba(124,92,255,.16));
  --radius: 16px;
  --shadow: 0 18px 50px -20px rgba(0,0,0,.6);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(124,92,255,.18), transparent 60%),
    radial-gradient(1000px 500px at -10% 10%, rgba(34,211,238,.12), transparent 55%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.2; }
.muted { color: var(--muted); }
.sm { font-size: 12px; }
.hidden { display: none !important; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--grad); border: none; color: white; box-shadow: 0 10px 26px -10px rgba(79,140,255,.7); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 12px; font-size: 12px; border-radius: 10px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); }
.badge.ok { color: #062; background: rgba(52,211,153,.16); border-color: rgba(52,211,153,.4); color: var(--ok); }
.badge.warn { color: var(--warn); background: rgba(251,191,36,.14); border-color: rgba(251,191,36,.35); }
.badge.muted-badge { color: var(--muted); }
.badge.role-admin { color: var(--brand-2); background: rgba(124,92,255,.16); border-color: rgba(124,92,255,.4); }
.badge.lvl-1 { color: #7ee0ff; background: rgba(34,211,238,.12); border-color: rgba(34,211,238,.35); }
.badge.lvl-2 { color: #9db4ff; background: rgba(79,140,255,.14); border-color: rgba(79,140,255,.4); }
.badge.lvl-3 { color: #d3b6ff; background: rgba(124,92,255,.16); border-color: rgba(124,92,255,.4); }

/* ============================================================
   AUTH
   ============================================================ */
.auth-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
  max-width: 1100px; margin: 0 auto; align-items: center; gap: 40px; padding: 40px 24px;
}
.auth-hero .hero-logo {
  width: 66px; height: 66px; border-radius: 18px; display: grid; place-items: center;
  font-size: 34px; background: var(--grad); box-shadow: var(--shadow); margin-bottom: 22px;
}
.auth-hero h1 { font-size: 40px; margin: 0 0 10px; letter-spacing: -.5px;
  background: linear-gradient(120deg,#fff, #b9c8ff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-tag { font-size: 18px; color: var(--muted); margin: 0 0 26px; max-width: 440px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.hero-points li { font-size: 15px; color: var(--text); padding: 12px 16px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--grad-soft); }

.auth-card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: var(--shadow); }
.tabs { display: flex; gap: 6px; background: var(--bg-2); padding: 5px; border-radius: 12px; margin-bottom: 22px; }
.tab { flex: 1; border: none; background: transparent; color: var(--muted); padding: 10px; border-radius: 9px;
  font-weight: 600; font-size: 14px; cursor: pointer; }
.tab.active { background: var(--panel-2); color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.auth-form { display: grid; gap: 16px; }
.auth-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.auth-form input {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  padding: 13px 14px; border-radius: 11px; font-size: 15px; outline: none; transition: border .2s, box-shadow .2s;
}
.auth-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,140,255,.2); }
.auth-card-head { margin-bottom: 22px; }
.auth-card-head h2 { margin: 0 0 4px; font-size: 22px; }
.auth-card-head p { margin: 0; font-size: 13px; }

/* password field with show/hide toggle */
.pw-field { position: relative; display: flex; }
.pw-field input { flex: 1; padding-right: 46px; width: 100%; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; cursor: pointer; font-size: 17px; line-height: 1;
  padding: 8px; border-radius: 9px; opacity: .8; transition: opacity .15s, background .15s; }
.pw-toggle:hover { opacity: 1; background: var(--panel-2); }
.auth-error { color: var(--err); font-size: 13px; min-height: 16px; font-weight: 600; }
.hint { font-size: 12px; color: var(--muted); text-align: center; margin-top: 4px; }
.hint b { color: var(--text); }

/* ============================================================
   SHELL
   ============================================================ */
.topbar {
  display: flex; align-items: center; gap: 20px; padding: 14px 26px;
  background: rgba(16,24,47,.7); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.brand .logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--grad); }
.brand-title { font-weight: 800; font-size: 16px; letter-spacing: -.2px; }
.brand-sub { font-size: 11px; color: var(--muted); }
.mainnav { display: flex; gap: 4px; margin-left: 12px; }
.mainnav a { padding: 9px 15px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; }
.mainnav a:hover { color: var(--text); background: var(--panel); }
.mainnav a.active { color: var(--text); background: var(--panel-2); }
.userchip { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  background: var(--grad); color: #fff; }
.avatar.big { width: 64px; height: 64px; font-size: 26px; }
.userchip-meta .uc-name { font-size: 13px; font-weight: 700; }
.userchip-meta .uc-id { font-size: 11px; color: var(--muted); }

.page { max-width: 1080px; margin: 0 auto; padding: 30px 24px 60px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 30px; border-top: 1px solid var(--line); }

.hello h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: -.4px; }
.encourage { font-size: 16px; color: var(--muted); margin: 0 0 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 34px 0 16px; }
.section-head h2 { font-size: 20px; margin: 0; }
.back { display: inline-block; color: var(--muted); font-weight: 600; margin-bottom: 16px; font-size: 14px; }
.back:hover { color: var(--text); }

/* ---------- stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 22px 0; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; inset: 0; background: var(--grad-soft); opacity: .5; pointer-events: none; }
.sc-icon { font-size: 22px; margin-bottom: 8px; position: relative; }
.sc-big { font-size: 30px; font-weight: 800; letter-spacing: -1px; position: relative; }
.sc-label { font-size: 12px; color: var(--muted); margin-top: 4px; position: relative; }

/* ---------- module cards ---------- */
.module-list { display: grid; gap: 14px; }
.module-card { display: flex; gap: 16px; align-items: center; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; transition: transform .14s, border-color .2s; }
.module-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.module-card.done { border-color: rgba(52,211,153,.4); }
.mc-icon { font-size: 30px; width: 56px; height: 56px; display: grid; place-items: center; background: var(--grad-soft);
  border-radius: 14px; border: 1px solid var(--line); }
.mc-body { flex: 1; }
.mc-title { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.mc-sub { color: var(--muted); font-size: 13px; margin: 3px 0 10px; }
.mc-meta { font-size: 12px; color: var(--muted); margin-top: 8px; }
.bar { height: 8px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width .5s; }
.cta-row { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }

/* ============================================================
   LEARN
   ============================================================ */
.learn-module { margin-bottom: 30px; }
.lm-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.lm-icon { font-size: 26px; }
.lm-head h2 { font-size: 20px; margin: 0; }
.lm-count { margin-left: auto; font-weight: 800; color: var(--muted); background: var(--panel); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; }
.topic-list { display: grid; gap: 10px; }
.topic-row { display: flex; align-items: center; gap: 16px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 15px 18px; transition: transform .12s, border-color .2s; }
.topic-row:hover { transform: translateX(3px); border-color: var(--brand); }
.tr-num { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800;
  background: var(--grad-soft); border: 1px solid var(--line); color: var(--text); }
.tr-main { flex: 1; }
.tr-title { font-weight: 700; font-size: 15px; }
.tr-meta { margin-top: 5px; font-size: 12px; }
.tr-arrow { font-size: 22px; color: var(--muted); }

/* ============================================================
   LECTURE
   ============================================================ */
.lecture { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 34px; box-shadow: var(--shadow); }
.lec-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 22px;
  border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.lec-module { color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .3px; }
.lec-title { font-size: 30px; margin: 6px 0 10px; letter-spacing: -.5px; }
.timer { background: var(--bg-2); border: 1px solid var(--line); padding: 10px 14px; border-radius: 12px;
  font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent); white-space: nowrap; }

.lec-body { font-size: 16.5px; line-height: 1.75; color: #dbe3ff; }
.lec-body h2 { font-size: 24px; margin: 28px 0 12px; letter-spacing: -.3px; }
.lec-body h3 { font-size: 18px; margin: 24px 0 8px; color: #fff; }
.lec-body p { margin: 12px 0; }
.lec-body ul { margin: 12px 0; padding-left: 4px; list-style: none; }
.lec-body li { position: relative; padding-left: 26px; margin: 8px 0; }
.lec-body li::before { content: "▸"; position: absolute; left: 4px; color: var(--brand); font-weight: 900; }
.lec-body strong { color: #fff; }
.lec-body blockquote { margin: 18px 0; padding: 14px 18px; border-left: 3px solid var(--brand);
  background: var(--grad-soft); border-radius: 0 12px 12px 0; color: #eaf0ff; font-size: 15.5px; }
.formula { font-family: "SF Mono", ui-monospace, "Cascadia Code", monospace; background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin: 18px 0; text-align: center;
  font-size: 18px; color: var(--accent); letter-spacing: .5px; }

.lec-divider { text-align: center; margin: 34px 0 22px; position: relative; }
.lec-divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--line); }
.lec-divider span { position: relative; background: var(--panel); padding: 0 16px; color: var(--muted); font-size: 13px; font-weight: 600; }

.quiz-gate { text-align: center; padding: 24px; background: var(--grad-soft); border: 1px solid var(--line); border-radius: 16px; }
.quiz-gate h2 { margin: 0 0 6px; font-size: 22px; }

/* ---------- quiz ---------- */
.quiz { margin-top: 8px; }
.quiz > h2 { font-size: 22px; margin: 10px 0 18px; }
.q { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 14px; }
.q-text { font-weight: 700; font-size: 16px; display: flex; gap: 10px; margin-bottom: 14px; align-items: flex-start; }
.q-num { flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-size: 13px; }
.q-opts { display: grid; gap: 9px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 11px; cursor: pointer; transition: border-color .15s, background .15s; }
.opt:hover { border-color: var(--brand); }
.opt input { display: none; }
.opt-mark { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); flex: none; transition: .15s; position: relative; }
.opt input:checked + .opt-mark { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 4px var(--bg-2); }
.opt-text { font-size: 15px; }
.opt.correct { border-color: var(--ok); background: rgba(52,211,153,.12); }
.opt.correct .opt-mark { border-color: var(--ok); background: var(--ok); box-shadow: inset 0 0 0 4px var(--bg-2); }
.opt.wrong { border-color: var(--err); background: rgba(248,113,113,.12); }
.opt.wrong .opt-mark { border-color: var(--err); background: var(--err); box-shadow: inset 0 0 0 4px var(--bg-2); }

.quiz-foot { margin-top: 18px; }
.quiz-msg { margin-bottom: 14px; }
.quiz-msg .err { color: var(--err); font-weight: 600; }
.score-badge { display: inline-block; padding: 12px 18px; border-radius: 12px; font-size: 16px; margin-bottom: 10px; border: 1px solid var(--line); }
.score-badge.great { background: rgba(52,211,153,.14); border-color: rgba(52,211,153,.45); }
.score-badge.ok { background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.4); }
.pass-line { color: var(--ok); font-weight: 700; font-size: 16px; }
.quiz-actions { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- congrats overlay ---------- */
.congrats-overlay { position: fixed; inset: 0; background: rgba(6,9,20,.8); backdrop-filter: blur(8px);
  display: grid; place-items: center; z-index: 200; padding: 24px; animation: fade .3s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.congrats-card { background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 40px;
  max-width: 500px; text-align: center; box-shadow: var(--shadow); animation: pop .4s cubic-bezier(.2,.9,.3,1.3); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.confetti { font-size: 60px; animation: bounce 1s infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-10px);} }
.congrats-card h1 { font-size: 30px; margin: 8px 0 4px; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.cc-mod { font-weight: 700; font-size: 16px; color: var(--accent); margin: 0 0 14px; }
.cc-msg { color: var(--muted); font-size: 15px; line-height: 1.6; }
.cc-stats { display: flex; justify-content: center; gap: 26px; margin: 22px 0; }
.cc-stats div { display: grid; }
.cc-stats b { font-size: 24px; }
.cc-stats span { font-size: 11px; color: var(--muted); }
.cc-actions { display: flex; gap: 12px; justify-content: center; }

/* ============================================================
   ACCOUNT
   ============================================================ */
.account-head { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
.account-head h1 { margin: 0; font-size: 28px; }
.progress-ring-row { display: flex; align-items: center; gap: 34px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px; margin: 22px 0; flex-wrap: wrap; }
.ring { --pct: 0; width: 150px; height: 150px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--brand) calc(var(--pct) * 1%), var(--bg-2) 0);
  display: grid; place-items: center; position: relative; }
.ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--panel); }
.ring-center { position: relative; text-align: center; }
.ring-center b { font-size: 30px; display: block; }
.ring-center span { font-size: 12px; color: var(--muted); }
.ring-note h3 { margin: 0 0 8px; font-size: 20px; }
.ring-note { max-width: 460px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.data-table thead th { text-align: left; padding: 14px 16px; background: var(--bg-2); color: var(--muted);
  font-size: 12px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--line); }
.data-table tbody td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--panel-2); }
.mini-bar { display: inline-block; width: 90px; height: 7px; background: var(--bg-2); border-radius: 999px; overflow: hidden; vertical-align: middle; margin-right: 8px; }
.mini-bar span { display: block; height: 100%; background: var(--grad); }

/* ============================================================
   MY PROGRESS
   ============================================================ */
.prog-overview { display: flex; align-items: center; gap: 30px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; margin: 22px 0 28px; flex-wrap: wrap; }
.prog-overview .ring { width: 130px; height: 130px; }
.prog-overview-body { flex: 1; min-width: 260px; }
.prog-ov-stats { display: flex; gap: 26px; flex-wrap: wrap; margin-bottom: 14px; }
.prog-ov-stats div { display: grid; }
.prog-ov-stats b { font-size: 22px; }
.prog-ov-stats span { font-size: 11px; color: var(--muted); }
.prog-banner { font-size: 15px; color: var(--muted); margin: 0 0 14px; }
.prog-banner b { color: var(--text); }

.prog-module { margin-bottom: 26px; }
.pm-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.pm-icon { font-size: 24px; }
.pm-title-wrap { flex: 1; }
.pm-title-wrap h2 { font-size: 18px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.pm-title-wrap .bar { height: 6px; }
.pm-count { font-weight: 800; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line);
  padding: 5px 11px; border-radius: 999px; font-size: 12px; white-space: nowrap; }

.prog-topic-list { display: grid; gap: 8px; padding-left: 4px; }
.prog-topic { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; transition: transform .12s, border-color .2s; }
.prog-topic:hover { transform: translateX(3px); border-color: var(--brand); }
.pt-check { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-weight: 800; font-size: 13px; border: 2px solid var(--line); color: var(--muted); background: var(--bg-2); }
.prog-topic.done .pt-check { background: var(--ok); border-color: var(--ok); color: #04231a; }
.prog-topic.started .pt-check { background: var(--warn); border-color: var(--warn); color: #3a2a02; }
.prog-topic.done { border-color: rgba(52,211,153,.35); }
.pt-main { flex: 1; display: grid; gap: 4px; }
.pt-title { font-weight: 700; font-size: 14.5px; }
.prog-topic.done .pt-title { color: var(--muted); }
.pt-meta { font-size: 12px; }
.pt-arrow { font-size: 20px; color: var(--muted); }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-tabs { max-width: 460px; margin-bottom: 22px; }
.admin-note { background: var(--grad-soft); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px;
  color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.admin-module { margin-bottom: 26px; }
.admin-module h2 { font-size: 18px; margin: 0 0 14px; }
.admin-topic-list { display: grid; gap: 10px; }
.admin-topic-row { display: flex; align-items: center; gap: 18px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 15px 18px; transition: opacity .2s; }
.admin-topic-row.is-hidden { opacity: .55; }
.atr-title { flex: 1; }
.atr-name { font-weight: 700; font-size: 15px; }
.atr-levels { display: flex; gap: 6px; }
.lvl-radio { position: relative; }
.lvl-radio input { display: none; }
.lvl-radio span { display: block; padding: 7px 13px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; transition: .15s; }
.lvl-radio input:checked + span { background: var(--grad); color: #fff; border-color: transparent; }

.hide-toggle { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; min-width: 96px; }
.hide-toggle input { display: none; }
.tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--muted); flex: none; position: relative; transition: .15s; }
.tick::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 900; opacity: 0; transition: .15s; }
.hide-toggle input:checked + .tick { background: var(--err); border-color: var(--err); }
.hide-toggle input:checked + .tick::after { opacity: 1; }
.hide-label { font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---------- creation status ---------- */
.cs-module-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; }
.cs-module-head h3 { font-size: 16px; margin: 0; }
.data-table tr.cs-pending td { opacity: .75; }
.data-table tr.cs-complete td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.data-table tr.cs-partial td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.data-table tr.cs-pending td:first-child { box-shadow: inset 3px 0 0 var(--muted); }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); padding: 12px 20px;
  border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; z-index: 300; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { text-align: center; }
  .hero-tag { margin-left: auto; margin-right: auto; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .topbar { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .mainnav { order: 3; width: 100%; overflow-x: auto; margin-left: 0; }
  .userchip { margin-left: auto; }
  .userchip-meta { display: none; }
  .page { padding: 22px 14px 50px; }
  .lecture { padding: 22px; }
  .lec-head { flex-direction: column; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-topic-row { flex-wrap: wrap; }
  .atr-title { flex-basis: 100%; }
  .hello h1 { font-size: 24px; }
  .lec-title { font-size: 24px; }
}

/* ============================================================
   LIGHT THEME (respects OS preference)
   ============================================================ */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #eef2fb; --bg-2: #e3e9f7; --panel: #ffffff; --panel-2: #f4f7ff;
    --line: #dbe2f2; --text: #16203a; --muted: #5b6890;
    --grad-soft: linear-gradient(135deg, rgba(79,140,255,.10), rgba(124,92,255,.10));
    --shadow: 0 18px 40px -24px rgba(40,60,120,.35);
  }
  body { background:
    radial-gradient(1200px 600px at 80% -10%, rgba(124,92,255,.12), transparent 60%),
    radial-gradient(1000px 500px at -10% 10%, rgba(34,211,238,.10), transparent 55%),
    var(--bg); }
  .lec-body { color: #2a3557; }
  .lec-body blockquote { color: #23304f; }
  .auth-hero h1 { background: linear-gradient(120deg,#16203a,#4f8cff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
}
