.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--amber-600);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding: 8px 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

body.has-offline-banner {
  padding-top: 38px;
}

:root {
  --blue-900: #0f2d63;
  --blue-800: #16357a;
  --blue-700: #1e40af;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --green-600: #16a34a;
  --green-100: #dcfce7;
  --amber-600: #d97706;
  --amber-100: #fef3c7;
  --red-600: #dc2626;
  --red-100: #fee2e2;
  --gray-900: #111827;
  --gray-700: #374151;
  --gray-500: #6b7280;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50: #f8fafc;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 45, 99, 0.08), 0 1px 2px rgba(15, 45, 99, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 45, 99, 0.1);
}

* {
  box-sizing: border-box;
}

/* ---------- Animation keyframes ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes popIn {
  0% {
    transform: scale(0.94);
  }
  60% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes shakeX {
  10%,
  90% {
    transform: translateX(-1px);
  }
  20%,
  80% {
    transform: translateX(2px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-4px);
  }
  40%,
  60% {
    transform: translateX(4px);
  }
}
@keyframes bounceIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  60% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}
@keyframes confettiPop {
  0% {
    transform: translateY(6px) scale(0.6);
    opacity: 0;
  }
  60% {
    transform: translateY(-3px) scale(1.15);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
  }
}
@keyframes dotPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(37, 99, 235, 0);
  }
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.55;
}

#app {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(135deg, var(--blue-900), var(--blue-700));
  color: white;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
}

.topbar .brand-icon {
  width: auto;
  height: 30px;
  border-radius: 7px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 7px;
}
.brand-logo-img {
  height: 100%;
  width: auto;
  display: block;
  object-fit: contain;
}

.spacer {
  flex: 1;
}

.topbar .back-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar .back-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.lang-switch-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.lang-switch-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.admin-nav-btn,
.logout-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.admin-nav-btn:hover,
.logout-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* ---------- Language picker ---------- */
.lang-picker-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--blue-900), var(--blue-600));
  padding: 24px 16px;
}
.lang-picker-box {
  background: white;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: 40px 28px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  animation: fadeInUp 0.5s ease both;
}
.lang-picker-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.lang-picker-logo-img {
  height: 48px;
  width: auto;
}
.lang-picker-box h1 {
  margin: 0 0 8px;
  font-size: 22px;
  color: var(--blue-900);
}
.lang-picker-box p {
  margin: 0 0 24px;
  font-size: 14.5px;
  color: var(--gray-500);
}
.lang-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.lang-card {
  background: var(--blue-50);
  border: 2px solid var(--blue-100);
  border-radius: 14px;
  padding: 18px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lang-card:hover {
  border-color: var(--blue-600);
  background: var(--blue-100);
  transform: translateY(-2px);
}
.lang-native {
  font-size: 20px;
  font-weight: 800;
  color: var(--blue-900);
  margin-bottom: 4px;
}
.lang-label {
  font-size: 12.5px;
  color: var(--gray-500);
}
.lang-cancel {
  margin-top: 20px;
}

/* ---------- Landing page ---------- */
.landing-page {
  min-height: 100vh;
  background: var(--gray-50);
}
.landing-hero {
  background: linear-gradient(135deg, var(--blue-900), var(--blue-600));
  color: white;
  text-align: center;
  padding: 64px 20px 72px;
}
.landing-logo {
  display: inline-flex;
  background: white;
  border-radius: 14px;
  padding: 10px 18px;
  margin-bottom: 24px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.landing-logo img {
  height: 44px;
  width: auto;
  display: block;
}
.landing-hero h1 {
  margin: 0 auto 14px;
  max-width: 620px;
  font-size: 32px;
  line-height: 1.25;
}
.landing-hero p {
  margin: 0 auto 28px;
  max-width: 520px;
  font-size: 15.5px;
  opacity: 0.92;
}
.landing-cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.landing-cta {
  font-size: 16px;
  padding: 13px 30px;
  box-shadow: 0 6px 18px rgba(15, 45, 99, 0.25);
}
.landing-cta-row .btn-outline {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}
.landing-cta-row .btn-outline:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: white;
  color: white;
}
.landing-body {
  padding-top: 40px;
}
.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-top: -56px;
  margin-bottom: 40px;
}
.landing-feature {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 22px 20px;
  text-align: center;
}
.landing-feature-icon {
  font-size: 30px;
  margin-bottom: 10px;
}
.landing-feature h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--blue-900);
}
.landing-feature p {
  margin: 0;
  font-size: 13.5px;
  color: var(--gray-600);
}
.landing-supported {
  text-align: center;
  padding: 12px 0 40px;
}
.landing-supported-label {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
  margin-bottom: 18px;
}
.landing-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  flex-wrap: wrap;
}
.landing-logo-img {
  height: 46px;
  width: auto;
  object-fit: contain;
  filter: grayscale(15%);
}

/* ---------- Layout ---------- */
.page {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 18px 64px;
}

.page-narrow {
  max-width: 760px;
}

/* ---------- Dashboard ---------- */
.dash-header {
  margin-bottom: 22px;
}
.dash-header h1 {
  font-size: 26px;
  margin: 0 0 6px;
  color: var(--blue-900);
}
.dash-header p {
  margin: 0;
  color: var(--gray-500);
  font-size: 15px;
}

.overall-progress {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.ring {
  --pct: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(var(--blue-600) calc(var(--pct) * 1%), var(--gray-200) 0);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ring::after {
  content: attr(data-label);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-800);
}

.module-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.module-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1px solid transparent;
}
.module-card.available {
  cursor: pointer;
}
.module-card.available:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--blue-100);
}
.module-card.locked {
  opacity: 0.6;
}

.module-number {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--blue-50);
  color: var(--blue-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 16px;
}
.module-card.locked .module-number {
  background: var(--gray-100);
  color: var(--gray-500);
}

.module-info {
  flex: 1;
  min-width: 0;
}
.module-info h3 {
  margin: 0 0 3px;
  font-size: 16px;
  color: var(--gray-900);
}
.module-info .meta {
  font-size: 13px;
  color: var(--gray-500);
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge.complete {
  background: var(--green-100);
  color: var(--green-600);
}
.badge.progress {
  background: var(--blue-100);
  color: var(--blue-700);
}
.badge.locked {
  background: var(--gray-100);
  color: var(--gray-500);
}

.mini-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--gray-200);
  overflow: hidden;
  margin-top: 6px;
}
.mini-bar > div {
  height: 100%;
  background: var(--blue-600);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ---------- Module lesson list ---------- */
.module-hero {
  background: linear-gradient(135deg, var(--blue-800), var(--blue-600));
  color: white;
  border-radius: var(--radius);
  padding: 26px 24px;
  margin-bottom: 22px;
}
.module-hero h1 {
  margin: 0 0 8px;
  font-size: 24px;
}
.module-hero p {
  margin: 0;
  opacity: 0.92;
  font-size: 14.5px;
}
.module-hero .progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.module-hero .bar-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}
.module-hero .bar-track > div {
  height: 100%;
  background: white;
  border-radius: 999px;
  transition: width 0.4s ease;
}
.module-hero .progress-label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lesson-row {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.lesson-row.unlocked {
  cursor: pointer;
}
.lesson-row.unlocked:hover {
  box-shadow: var(--shadow-md);
}
.lesson-row.locked {
  opacity: 0.55;
}

.lesson-status-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 700;
}
.lesson-status-icon.done {
  background: var(--green-100);
  color: var(--green-600);
}
.lesson-status-icon.next {
  background: var(--blue-100);
  color: var(--blue-700);
}
.lesson-status-icon.locked {
  background: var(--gray-100);
  color: var(--gray-400);
}

.lesson-info {
  flex: 1;
  min-width: 0;
}
.lesson-info h4 {
  margin: 0 0 2px;
  font-size: 15.5px;
}
.lesson-info .meta {
  font-size: 13px;
  color: var(--gray-500);
}

.chev {
  color: var(--gray-300);
  font-size: 20px;
}

/* ---------- Lesson content blocks ---------- */
.lesson-title-bar {
  margin-bottom: 22px;
}
.lesson-title-bar .kicker {
  font-size: 13px;
  color: var(--blue-600);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.lesson-title-bar h1 {
  margin: 0;
  font-size: 24px;
  color: var(--gray-900);
}

.block {
  margin-bottom: 20px;
  animation: fadeInUp 0.5s ease both;
}
.block:nth-of-type(1) {
  animation-delay: 0.03s;
}
.block:nth-of-type(2) {
  animation-delay: 0.09s;
}
.block:nth-of-type(3) {
  animation-delay: 0.15s;
}
.block:nth-of-type(4) {
  animation-delay: 0.21s;
}
.block:nth-of-type(5) {
  animation-delay: 0.27s;
}
.block:nth-of-type(6) {
  animation-delay: 0.33s;
}
.block:nth-of-type(7) {
  animation-delay: 0.39s;
}
.block:nth-of-type(8) {
  animation-delay: 0.45s;
}
.block:nth-of-type(n + 9) {
  animation-delay: 0.5s;
}

.block-hero {
  background: linear-gradient(135deg, var(--blue-900), var(--blue-600));
  color: white;
  padding: 30px 26px;
  border-radius: var(--radius);
}
.block-hero h2 {
  margin: 0 0 8px;
  font-size: 22px;
}
.block-hero p {
  margin: 0;
  opacity: 0.92;
}

.block-text {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.block-text h3 {
  margin: 0 0 8px;
  font-size: 17px;
  color: var(--blue-900);
}
.block-text .body {
  color: var(--gray-700);
  font-size: 15px;
}

.callout {
  border-radius: var(--radius);
  padding: 16px 18px;
  border-left: 5px solid var(--blue-600);
  background: var(--blue-50);
}
.callout h4 {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--blue-800);
  display: flex;
  align-items: center;
  gap: 6px;
}
.callout p {
  margin: 0;
  font-size: 14.5px;
  color: var(--gray-700);
}
.callout.tip {
  border-left-color: var(--green-600);
  background: var(--green-100);
}
.callout.tip h4 {
  color: var(--green-600);
}
.callout.warning {
  border-left-color: var(--amber-600);
  background: var(--amber-100);
}

.example-box {
  background: white;
  border: 1.5px dashed var(--blue-300, var(--blue-500));
  border-radius: var(--radius);
  padding: 18px 20px;
}
.example-box h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--blue-700);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.example-box p {
  margin: 0;
  font-size: 14.5px;
  color: var(--gray-700);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.stat-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.stat-card .label {
  font-weight: 700;
  font-size: 14px;
  color: var(--blue-800);
  margin-bottom: 4px;
}
.stat-card .text {
  font-size: 13.5px;
  color: var(--gray-700);
}

/* ---------- Bar chart ---------- */
.chart-box {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.chart-box h3 {
  margin: 0 0 2px;
  font-size: 16px;
  color: var(--blue-900);
}
.chart-source {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 14px;
}
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}
.bar-row .bar-label {
  width: 118px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--gray-700);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-row .bar-track {
  flex: 1;
  background: var(--gray-100);
  border-radius: 6px;
  overflow: hidden;
  height: 22px;
  position: relative;
}
.bar-row .bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-700));
  border-radius: 6px;
  width: 0;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-row .bar-value {
  width: 54px;
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--blue-800);
}

/* ---------- Timeline ---------- */
.timeline-box {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.timeline-box h3 {
  margin: 0 0 16px;
  font-size: 16px;
  color: var(--blue-900);
}
.timeline {
  position: relative;
  padding-left: 26px;
  border-left: 3px solid var(--blue-100);
}
.timeline-item {
  position: relative;
  padding-bottom: 18px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--blue-600);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--blue-600);
}
.timeline-item .year {
  font-weight: 700;
  color: var(--blue-700);
  font-size: 13.5px;
}
.timeline-item .text {
  font-size: 14px;
  color: var(--gray-700);
  margin-top: 2px;
}
.timeline-result {
  margin-top: 16px;
  background: var(--blue-900);
  color: white;
  text-align: center;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 10px;
  letter-spacing: 0.02em;
}

/* ---------- Poll (ungraded quick questions) ---------- */
.poll-box {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.poll-box > h3 {
  margin: 0 0 14px;
  font-size: 16px;
  color: var(--blue-900);
}
.poll-q {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--gray-100);
}
.poll-q:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.poll-q .q-text {
  font-weight: 600;
  font-size: 14.5px;
  margin-bottom: 10px;
  color: var(--gray-900);
}
.opt-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.opt-btn {
  text-align: left;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--gray-200);
  background: white;
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-800);
  transition: all 0.15s ease;
}
.opt-btn:hover:not(:disabled) {
  border-color: var(--blue-400, var(--blue-500));
  background: var(--blue-50);
}
.opt-btn:disabled {
  cursor: default;
}
.opt-btn.correct {
  border-color: var(--green-600);
  background: var(--green-100);
  color: #14532d;
  font-weight: 600;
  animation: popIn 0.25s ease both;
}
.opt-btn.incorrect {
  border-color: var(--red-600);
  background: var(--red-100);
  color: #7f1d1d;
  font-weight: 600;
  animation: shakeX 0.4s ease both;
}
.opt-btn.selected {
  border-color: var(--blue-600);
  background: var(--blue-50);
  animation: popIn 0.2s ease both;
}
.poll-reveal {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--gray-600);
  background: var(--gray-50);
  padding: 10px 12px;
  border-radius: 8px;
}

/* ---------- Quiz ---------- */
.quiz-section {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 24px 24px 26px;
  border: 2px solid var(--blue-100);
}
.quiz-section > h2 {
  margin: 0 0 4px;
  font-size: 19px;
  color: var(--blue-900);
}
.quiz-section > .sub {
  font-size: 13.5px;
  color: var(--gray-500);
  margin-bottom: 18px;
}
.quiz-q {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--gray-100);
}
.quiz-q:last-of-type {
  border-bottom: none;
}
.quiz-q .q-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-600);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}
.quiz-q .q-text {
  font-weight: 600;
  font-size: 15px;
  color: var(--gray-900);
  margin-bottom: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: none;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-primary {
  background: var(--blue-600);
  color: white;
}
.btn-primary:hover {
  background: var(--blue-700);
}
.btn-primary:disabled {
  background: var(--gray-300);
  cursor: not-allowed;
}
.btn-outline {
  background: white;
  border: 1.5px solid var(--gray-300);
  color: var(--gray-700);
}
.btn-outline:hover {
  border-color: var(--blue-500);
  color: var(--blue-700);
}
.btn-success {
  background: var(--green-600);
  color: white;
}
.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.quiz-result {
  text-align: center;
  padding: 10px 0 6px;
}
.quiz-result .score-circle {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-weight: 800;
}
.quiz-result.pass .score-circle {
  background: var(--green-100);
  color: var(--green-600);
  border: 4px solid var(--green-600);
}
.quiz-result.fail .score-circle {
  background: var(--amber-100);
  color: var(--amber-600);
  border: 4px solid var(--amber-600);
}
.quiz-result .score-circle .pct {
  font-size: 26px;
  line-height: 1;
}
.quiz-result .score-circle .lbl {
  font-size: 10px;
  text-transform: uppercase;
  margin-top: 2px;
}
.quiz-result h3 {
  margin: 0 0 6px;
  font-size: 19px;
}
.quiz-result p {
  margin: 0 0 18px;
  color: var(--gray-600);
  font-size: 14.5px;
}

.quiz-review {
  text-align: left;
  margin-top: 18px;
  border-top: 1px solid var(--gray-100);
  padding-top: 16px;
}
.review-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  font-size: 13.5px;
}
.review-item .mark {
  flex-shrink: 0;
  font-weight: 800;
  animation: bounceIn 0.4s ease both;
}

.confetti-row {
  font-size: 22px;
  letter-spacing: 6px;
  margin-bottom: 6px;
}
.confetti-row span,
.confetti-row {
  animation: confettiPop 0.6s ease both;
}
.review-item.correct .mark {
  color: var(--green-600);
}
.review-item.incorrect .mark {
  color: var(--red-600);
}
.review-item .exp {
  color: var(--gray-500);
  margin-top: 2px;
}

/* ---------- Completion screen ---------- */
.completion-box {
  text-align: center;
  background: linear-gradient(135deg, var(--blue-900), var(--blue-600));
  color: white;
  border-radius: var(--radius);
  padding: 44px 24px;
}
.completion-box .icon {
  font-size: 56px;
  margin-bottom: 10px;
}
.completion-box h2 {
  margin: 0 0 8px;
  font-size: 24px;
}
.completion-box p {
  margin: 0 auto 20px;
  max-width: 440px;
  opacity: 0.92;
  font-size: 15px;
}

/* ---------- Glossary & ledger blocks ---------- */
.glossary-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff7ed;
  border: 1.5px dashed var(--amber-600);
  border-radius: var(--radius);
  padding: 14px 18px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.glossary-box:hover {
  background: #ffedd5;
}
.glossary-box:active {
  transform: scale(0.99);
}
.gloss-icon {
  font-size: 20px;
  flex-shrink: 0;
  animation: bounceIn 0.5s ease both;
}
.gloss-term {
  font-weight: 800;
  color: #92400e;
}
.gloss-hint {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: #b45309;
  font-weight: 600;
}
.glossary-box.revealed .gloss-hint {
  display: none;
}
.gloss-meaning {
  display: none;
  color: var(--gray-700);
  font-size: 14.5px;
  margin-top: 4px;
}
.glossary-box.revealed .gloss-meaning {
  display: block;
  animation: fadeInUp 0.3s ease both;
}

.ledger-box {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.ledger-box h3 {
  margin: 0 0 12px;
  font-size: 15.5px;
  color: var(--blue-900);
}
.ledger-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 14.5px;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
}
.ledger-row:last-of-type {
  border-bottom: none;
}
.ledger-row span:last-child {
  font-weight: 700;
  color: var(--gray-900);
  white-space: nowrap;
}
.ledger-row.ledger-total {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 2px solid var(--blue-100);
  border-bottom: none;
  font-weight: 700;
}
.ledger-row.ledger-total span:first-child {
  color: var(--blue-900);
}
.ledger-row.ledger-total span:last-child {
  color: var(--green-600);
  font-size: 16px;
}

/* ---------- Topic flow (guided lesson) ---------- */
.topic-dots {
  display: flex;
  gap: 7px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gray-200);
}
.dot.dot-active {
  background: var(--blue-600);
  transform: scale(1.3);
  animation: dotPulse 1.6s ease-in-out infinite;
}
.dot.dot-done {
  background: var(--green-600);
}

.topic-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  gap: 10px;
}

.topic-kicker {
  font-size: 13px;
  color: var(--blue-600);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.topic-title {
  margin: 0 0 18px;
  font-size: 21px;
  color: var(--gray-900);
}

.check-box {
  background: var(--blue-50);
  border: 1.5px solid var(--blue-100);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-top: 22px;
}
.check-box > h3 {
  margin: 0 0 3px;
  font-size: 16px;
  color: var(--blue-900);
}
.check-box > .sub {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 14px;
}

.check-pass {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--green-100);
  border-radius: 10px;
  padding: 12px 16px;
}
.check-pass-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green-600);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.check-pass-title {
  font-weight: 700;
  color: #14532d;
  font-size: 14.5px;
}
.check-pass-sub {
  font-size: 13px;
  color: #166534;
}

.check-fail {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--amber-100);
  border-radius: 10px;
  padding: 12px 16px;
}
.check-fail-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--amber-600);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  animation: bounceIn 0.4s ease both;
}
.check-fail-title {
  font-weight: 700;
  color: #92400e;
  font-size: 14.5px;
}
.check-fail-sub {
  font-size: 13px;
  color: #92400e;
  margin-top: 2px;
}

.review-banner {
  background: linear-gradient(135deg, var(--amber-600), #f59e0b);
  color: white;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 18px;
}
.review-banner-title {
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 3px;
}
.review-banner-sub {
  font-size: 13.5px;
  opacity: 0.95;
}

/* ---------- Footer nav on lesson page ---------- */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
}

/* ---------- Auth pages (login, change password) ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--blue-900), var(--blue-600));
}
.auth-box {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 34px 30px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.auth-logo {
  margin-bottom: 14px;
}
.auth-logo img {
  height: 44px;
  width: auto;
}
.auth-box h1 {
  font-size: 21px;
  margin: 0 0 6px;
  color: var(--blue-900);
}
.auth-box .sub {
  font-size: 13.5px;
  color: var(--gray-500);
  margin: 0 0 22px;
}
.auth-box form {
  text-align: left;
}
.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 5px;
}
.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--gray-300);
  border-radius: 9px;
  font-size: 14.5px;
  font-family: inherit;
}
.field input:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px var(--blue-100);
}
.hint {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}
.auth-box .btn {
  width: 100%;
}
.auth-error {
  background: var(--red-100);
  color: var(--red-600);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: left;
}
.auth-note {
  background: var(--green-100);
  color: var(--green-600);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 13px;
  margin-top: 10px;
  text-align: left;
}

.btn-danger {
  background: white;
  border: 1.5px solid var(--red-600);
  color: var(--red-600);
}
.btn-danger:hover {
  background: var(--red-100);
}

/* ---------- Course-completion certificate banner ---------- */
.course-cert-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--blue-900), var(--blue-600));
  color: white;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 24px;
  cursor: pointer;
}
.course-cert-banner .icon {
  font-size: 36px;
  flex-shrink: 0;
}
.course-cert-banner .text {
  flex: 1;
}
.course-cert-banner h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.course-cert-banner p {
  margin: 0;
  font-size: 13.5px;
  opacity: 0.92;
}
.course-cert-banner .btn {
  flex-shrink: 0;
}

/* ---------- Admin portal ---------- */
.admin-header {
  margin-bottom: 20px;
}
.admin-header h1 {
  font-size: 24px;
  margin: 0 0 6px;
  color: var(--blue-900);
}
.admin-header p {
  margin: 0;
  color: var(--gray-500);
  font-size: 14px;
}
.admin-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.admin-search {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
}
.admin-search:focus {
  outline: none;
  border-color: var(--blue-600);
}
.admin-table-wrap {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.admin-table th {
  text-align: left;
  padding: 12px 16px;
  color: var(--gray-500);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--gray-100);
  white-space: nowrap;
}
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.admin-table tr:last-child td {
  border-bottom: none;
}
.admin-table tr.clickable {
  cursor: pointer;
}
.admin-table tr.clickable:hover {
  background: var(--blue-50);
}
.name-cell {
  font-weight: 600;
  color: var(--gray-900);
}
.login-id-cell {
  color: var(--gray-500);
  font-size: 13px;
}
.admin-progress-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}
.admin-progress-cell .mini-bar {
  flex: 1;
  margin-top: 0;
}
.admin-progress-cell .pct-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--blue-700);
  width: 34px;
  text-align: right;
}
.admin-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-500);
  font-size: 14.5px;
}

.admin-detail-box {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.admin-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.admin-detail-header h2 {
  margin: 0;
  font-size: 20px;
  color: var(--blue-900);
}
.admin-detail-meta {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 18px;
}
.admin-detail-overall {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.admin-module-progress-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}
.admin-module-progress-row .label {
  width: 140px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
}
.admin-module-progress-row .mini-bar {
  flex: 1;
  margin-top: 0;
}
.admin-module-progress-row .count {
  width: 70px;
  flex-shrink: 0;
  text-align: right;
  font-size: 12.5px;
  color: var(--gray-500);
}

/* Admin: expandable per-lesson checklist */
.admin-expand-hint {
  font-size: 12.5px;
  color: var(--gray-500);
  margin-bottom: 4px;
}
.admin-module-details {
  border-bottom: 1px solid var(--gray-100);
}
.admin-module-details:last-child {
  border-bottom: none;
}
.admin-module-details summary {
  cursor: pointer;
  list-style: none;
  border-bottom: none;
}
.admin-module-details summary::-webkit-details-marker {
  display: none;
}
.admin-chevron {
  display: inline-block;
  flex-shrink: 0;
  width: 14px;
  color: var(--gray-500);
  transition: transform 0.15s ease;
}
.admin-module-details[open] .admin-chevron {
  transform: rotate(90deg);
}
.admin-lesson-list {
  padding: 2px 0 14px 28px;
}
.admin-lesson-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px dashed var(--gray-100);
}
.admin-lesson-row:last-child {
  border-bottom: none;
}
.admin-lesson-title {
  font-size: 13.5px;
  color: var(--gray-700);
}
.admin-lesson-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.admin-lesson-extra {
  font-size: 12px;
  color: var(--gray-500);
  white-space: nowrap;
}

.admin-form-box {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 24px;
  max-width: 460px;
}
.admin-form-box h2 {
  margin: 0 0 4px;
  font-size: 19px;
  color: var(--blue-900);
}
.admin-form-box .sub {
  font-size: 13.5px;
  color: var(--gray-500);
  margin-bottom: 20px;
}

.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-pill.active {
  background: var(--green-100);
  color: var(--green-600);
}
.status-pill.inactive {
  background: var(--gray-100);
  color: var(--gray-500);
}

/* ---------- Certificates list page ---------- */
.cert-list-course {
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.cert-list-course.earned {
  background: linear-gradient(135deg, var(--blue-900), var(--blue-600));
  color: white;
}
.cert-list-course.locked {
  background: white;
  box-shadow: var(--shadow);
  color: var(--gray-700);
}
.cert-list-course-icon {
  font-size: 34px;
  flex-shrink: 0;
}
.cert-list-course-info {
  flex: 1;
  min-width: 200px;
}
.cert-list-course-info h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.cert-list-course.earned .cert-list-course-info p {
  margin: 0;
  font-size: 13.5px;
  opacity: 0.92;
}
.cert-list-course.locked .cert-list-course-info p {
  margin: 0;
  font-size: 13.5px;
  color: var(--gray-500);
}
.cert-list-modules {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cert-list-module {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 4px 18px;
}
.cert-list-module summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  cursor: pointer;
  list-style: none;
}
.cert-list-module summary::-webkit-details-marker {
  display: none;
}
.cert-list-module summary .label {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--blue-900);
}
.cert-list-module summary .count {
  font-size: 12.5px;
  color: var(--gray-500);
  flex-shrink: 0;
}
.cert-list-lessons {
  padding: 0 0 12px;
}
.cert-list-lesson-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-top: 1px dashed var(--gray-100);
}
.cert-list-lesson-title {
  font-size: 13.5px;
  color: var(--gray-700);
}
.btn-small {
  padding: 6px 12px;
  font-size: 12.5px;
}

/* ---------- Certificate (view + print) ---------- */
.cert-toolbar {
  display: flex;
  justify-content: center;
  margin: 18px auto;
  max-width: 800px;
}
.cert-page {
  max-width: 800px;
  margin: 0 auto 60px;
  padding: 0 18px;
}
.cert-card {
  position: relative;
  background: #fffdf7;
  border: 2px solid var(--blue-600);
  border-radius: 10px;
  padding: 52px 40px 38px;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.cert-corner {
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: var(--blue-600);
  border-style: solid;
  border-width: 0;
}
.cert-corner-tl {
  top: 10px;
  left: 10px;
  border-top-width: 3px;
  border-left-width: 3px;
}
.cert-corner-tr {
  top: 10px;
  right: 10px;
  border-top-width: 3px;
  border-right-width: 3px;
}
.cert-corner-bl {
  bottom: 10px;
  left: 10px;
  border-bottom-width: 3px;
  border-left-width: 3px;
}
.cert-corner-br {
  bottom: 10px;
  right: 10px;
  border-bottom-width: 3px;
  border-right-width: 3px;
}
.cert-logo {
  margin-bottom: 8px;
}
.cert-logo img {
  height: 44px;
  width: auto;
}
.cert-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--blue-700);
  margin-bottom: 6px;
}
.cert-seal {
  font-size: 34px;
  margin-bottom: 4px;
}
.cert-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  color: var(--blue-900);
  margin: 0 0 18px;
  letter-spacing: 0.02em;
}
.cert-presented {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 8px;
}
.cert-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--blue-800);
  border-bottom: 2px solid var(--blue-100);
  display: inline-block;
  padding: 0 12px 10px;
  margin-bottom: 18px;
}
.cert-body {
  font-size: 15px;
  color: var(--gray-700);
  line-height: 1.7;
  margin-bottom: 14px;
}
.cert-program {
  font-size: 12.5px;
  color: var(--gray-500);
  font-style: italic;
  margin-bottom: 22px;
}
.cert-meta-row {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  border-top: 1px dashed var(--gray-300);
  padding-top: 14px;
  margin-bottom: 10px;
}
.cert-meta-item {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-700);
}
.cert-id {
  font-size: 11px;
  color: var(--gray-500);
  font-family: "Courier New", monospace;
  letter-spacing: 0.03em;
}

/* ---------- Print (certificates) ---------- */
@media print {
  .no-print {
    display: none !important;
  }
  body {
    background: white;
  }
  .cert-page {
    padding: 0;
    margin: 0;
    max-width: 100%;
  }
  .cert-card {
    box-shadow: none;
    border: 2px solid var(--blue-900);
  }
}
@page {
  margin: 1.2cm;
}

.progress-note {
  text-align: center;
  font-size: 12.5px;
  color: var(--gray-400);
  margin-top: 30px;
}

@media (max-width: 520px) {
  .bar-row .bar-label {
    width: 84px;
    font-size: 11.5px;
  }
  .page {
    padding: 18px 12px 50px;
  }
}
