/* ============================================================
   QuizMaster – app.css
   Mobile-first, ultra-fast, distinctive design
   Font: Sora (headings) + DM Sans (body)
   Palette: Deep Indigo + Amber accent + Slate grays
============================================================ */

/* ---- Variables ----------------------------------------- */
:root {
  --primary:    #4338ca;
  --primary-d:  #3730a3;
  --primary-l:  #e0e7ff;
  --accent:     #f59e0b;
  --accent-d:   #d97706;
  --success:    #16a34a;
  --danger:     #dc2626;
  --bg:         #f8fafc;
  --surface:    #ffffff;
  --border:     #e2e8f0;
  --text:       #0f172a;
  --muted:      #64748b;
  --muted-l:    #94a3b8;
  --radius:     12px;
  --radius-sm:  8px;
  --radius-lg:  20px;
  --shadow:     0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-md:  0 4px 24px rgba(0,0,0,.1);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.14);
  --nav-h:      64px;
  --font-head:  'Sora', sans-serif;
  --font-body:  'DM Sans', sans-serif;
  --max-w:      1200px;
  --transition: .2s ease;
}

/* ---- Reset --------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
ul { list-style: none; }
input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

/* ---- Container ----------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1rem;
}
@media (min-width: 640px)  { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

/* ---- Buttons ------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-size: .875rem;
  font-weight: 600;
  border: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none !important;
}
.btn-primary  { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover  { background: var(--primary-d); border-color: var(--primary-d); transform: translateY(-1px); }
.btn-outline  { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover  { background: var(--primary-l); }
.btn-success  { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover  { filter: brightness(1.1); }
.btn-danger   { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-ghost    { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { background: var(--border); }
.btn-white    { background: #fff; color: var(--primary); }
.btn-white:hover { background: var(--primary-l); }
.btn-sm       { padding: .4rem .9rem; font-size: .8rem; }
.btn-lg       { padding: .8rem 1.75rem; font-size: 1rem; }
.btn-full     { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ---- Navbar -------------------------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
}
.logo {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--font-head);
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo-icon { font-size: 1.4rem; }
.logo-text strong { color: var(--primary); }

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 360px;
}
.search-wrap input {
  width: 100%;
  padding: .5rem 1rem .5rem 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: var(--bg);
  font-size: .875rem;
  transition: border-color var(--transition);
}
.search-wrap input:focus { outline: none; border-color: var(--primary); }
.search-icon {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: .9rem;
  pointer-events: none;
}
.search-results {
  position: absolute;
  top: calc(100% + .5rem);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-height: 340px;
  overflow-y: auto;
  z-index: 200;
}
.search-results.hidden { display: none; }
.sr-item {
  display: block;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
  color: var(--text);
  text-decoration: none !important;
}
.sr-item:hover { background: var(--primary-l); }
.sr-item:last-child { border: 0; }
.sr-item small { color: var(--muted); display: block; }

.nav-links {
  display: none;
  gap: .25rem;
}
@media (min-width: 1024px) { .nav-links { display: flex; } }
.nav-links a {
  padding: .4rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none !important;
  transition: all var(--transition);
}
.nav-links a:hover { color: var(--primary); background: var(--primary-l); }

.nav-auth { display: none; align-items: center; gap: .5rem; margin-left: auto; }
@media (min-width: 768px) { .nav-auth { display: flex; } }
.user-name { font-size: .875rem; font-weight: 600; color: var(--muted); }

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: .4rem;
  margin-left: auto;
}
@media (min-width: 768px) { .hamburger { display: none; } }
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .2s;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: .25rem;
  padding: .75rem 1rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--text);
  text-decoration: none !important;
}
.mobile-nav a:hover { background: var(--primary-l); color: var(--primary); }

/* ---- Hero ---------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  color: #fff;
  padding: 4rem 0 3rem;
}
.hero-bg-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(99,102,241,.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(245,158,11,.2) 0%, transparent 40%);
  pointer-events: none;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  position: relative;
  z-index: 1;
}
@media (min-width: 900px) { .hero-inner { grid-template-columns: 1fr 1fr; align-items: center; } }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(245,158,11,.2);
  border: 1px solid rgba(245,158,11,.4);
  color: #fcd34d;
  font-size: .8rem;
  font-weight: 600;
  padding: .35rem .9rem;
  border-radius: 50px;
  margin-bottom: 1.25rem;
}
.hero-title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.hero-highlight {
  background: linear-gradient(90deg, #fcd34d, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: 1.05rem;
  color: rgba(255,255,255,.8);
  margin-bottom: 2rem;
  max-width: 480px;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.hero-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.hero-stat strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 800;
  color: #fcd34d;
}
.hero-stat span { font-size: .8rem; color: rgba(255,255,255,.7); }

.hero-visual {
  position: relative;
  height: 300px;
  display: none;
}
@media (min-width: 900px) { .hero-visual { display: block; } }

.hero-card-float {
  position: absolute;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius);
  padding: .9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  animation: float 4s ease-in-out infinite;
}
.hero-card-float small { font-weight: 400; opacity: .75; display: block; font-size: .75rem; }
.hc-icon { font-size: 1.5rem; }
.hc-badge { background: #22c55e; color: #fff; font-size: .7rem; padding: .15rem .5rem; border-radius: 50px; }
.hc-badge.badge-new { background: var(--accent); }
.hc-score { color: #fcd34d; font-size: 1.1rem; }
.card-1 { top: 10%; left: 5%; animation-delay: 0s; }
.card-2 { top: 45%; right: 5%; animation-delay: 1.2s; }
.card-3 { bottom: 5%; left: 20%; animation-delay: 2.4s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.hero-score-ring {
  position: absolute;
  top: 5%; right: 10%;
  width: 110px; height: 110px;
}
.hero-score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg   { fill: none; stroke: rgba(255,255,255,.15); stroke-width: 8; }
.ring-fill { fill: none; stroke: #fcd34d; stroke-width: 8; stroke-linecap: round; transition: stroke-dasharray 1s; }
.ring-text {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #fff;
}
.ring-text strong { font-size: 1.3rem; font-family: var(--font-head); }
.ring-text small  { font-size: .65rem; opacity: .7; }

/* ---- Daily Banner -------------------------------------- */
.daily-banner {
  background: linear-gradient(90deg, var(--accent-d), var(--accent));
  color: #fff;
  padding: .9rem 0;
}
.daily-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.daily-label {
  font-weight: 700;
  font-size: .85rem;
  background: rgba(0,0,0,.15);
  padding: .2rem .7rem;
  border-radius: 50px;
  white-space: nowrap;
}
.daily-title { font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daily-meta  { font-size: .8rem; opacity: .85; white-space: nowrap; }

/* ---- Sections ------------------------------------------ */
.section { padding: 4rem 0; }
.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: .5rem;
}
.section-title span { color: var(--primary); }
.section-sub { color: var(--muted); font-size: 1rem; }
.section-more {
  display: block;
  text-align: right;
  font-weight: 600;
  font-size: .9rem;
  margin-top: -.5rem;
  margin-bottom: 1.5rem;
}

/* ---- Exam Grid ----------------------------------------- */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (min-width: 640px)  { .exam-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .exam-grid { grid-template-columns: repeat(6, 1fr); } }

.exam-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  text-align: center;
  text-decoration: none !important;
  color: var(--text);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.exam-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--ec, var(--primary));
  transform: scaleX(0);
  transition: transform var(--transition);
}
.exam-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--ec, var(--primary)); text-decoration: none !important; }
.exam-card:hover::before { transform: scaleX(1); }
.exam-card-icon { font-size: 2rem; }
.exam-card-body h3 { font-size: .9rem; font-weight: 700; font-family: var(--font-head); }
.exam-card-body p  { font-size: .72rem; color: var(--muted); display: none; }
@media (min-width: 1024px) { .exam-card-body p { display: block; } }
.exam-quiz-count {
  font-size: .72rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-l);
  padding: .2rem .6rem;
  border-radius: 50px;
}
.exam-arrow { position: absolute; top: .75rem; right: .75rem; font-size: .8rem; opacity: .3; }

/* ---- Quiz Grid ----------------------------------------- */
.quiz-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 640px)  { .quiz-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .quiz-grid { grid-template-columns: repeat(3, 1fr); } }

.quiz-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  transition: all var(--transition);
  border-left: 4px solid var(--accent, var(--primary));
}
.quiz-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.quiz-card-badges { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .2rem; }
.badge-exam {
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .65rem;
  border-radius: 50px;
  background: var(--primary-l);
  color: var(--primary);
  text-decoration: none !important;
}
.badge-exam:hover { background: var(--primary); color: #fff; }
.badge-diff {
  font-size: .7rem;
  font-weight: 600;
  padding: .2rem .65rem;
  border-radius: 50px;
  background: #f1f5f9;
}
.diff-easy   { background: #dcfce7; color: #15803d; }
.diff-medium { background: #fef9c3; color: #a16207; }
.diff-hard   { background: #fee2e2; color: #b91c1c; }

.quiz-card-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: block;
  line-height: 1.4;
  text-decoration: none !important;
}
.quiz-card-title:hover { color: var(--primary); }
.quiz-card-cat { font-size: .78rem; color: var(--muted); }
.quiz-card-meta {
  display: flex;
  gap: .75rem;
  font-size: .78rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.quiz-card-cta { margin-top: auto; }

/* ---- Subject Grid -------------------------------------- */
.subject-section { background: linear-gradient(135deg, #f0f9ff, #e0e7ff); }
.subject-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (min-width: 480px)  { .subject-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 768px)  { .subject-grid { grid-template-columns: repeat(8, 1fr); } }

.subject-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem .75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  text-align: center;
  text-decoration: none !important;
  color: var(--text);
  transition: all var(--transition);
  font-size: .8rem;
}
.subject-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary); color: var(--primary); text-decoration: none !important; }
.subject-icon { font-size: 1.75rem; }
.subject-card strong { font-family: var(--font-head); font-size: .8rem; }
.subject-card small  { color: var(--muted); font-size: .7rem; display: none; }
@media (min-width: 640px) { .subject-card small { display: block; } }

/* ---- Performers ---------------------------------------- */
.performers-section { background: var(--surface); }
.performers-list { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: .75rem; }
.performer-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.25rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
}
.performer-rank { font-size: 1.25rem; min-width: 2rem; text-align: center; }
.performer-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .9rem;
}
.performer-info { flex: 1; }
.performer-info strong { font-size: .95rem; display: block; }
.performer-xp {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--primary);
  font-size: .9rem;
}
.badge-pill {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  padding: .15rem .55rem;
  border-radius: 50px;
  background: linear-gradient(90deg, var(--accent), var(--accent-d));
  color: #fff;
  margin-left: .4rem;
}

/* ---- How It Works -------------------------------------- */
.hiw-section { background: var(--bg); }
.hiw-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 640px) { .hiw-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .hiw-grid { grid-template-columns: repeat(4, 1fr); } }

.hiw-step {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  position: relative;
  overflow: hidden;
}
.hiw-num {
  font-family: var(--font-head);
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--primary-l);
  position: absolute;
  top: .5rem; right: 1rem;
  line-height: 1;
}
.hiw-icon { font-size: 2.25rem; margin-bottom: .75rem; }
.hiw-step h3 { font-family: var(--font-head); font-size: 1rem; font-weight: 700; margin-bottom: .5rem; }
.hiw-step p  { font-size: .875rem; color: var(--muted); }

/* ---- SEO Link Section ---------------------------------- */
.seo-link-section { background: #1e293b; color: #e2e8f0; padding: 3rem 0; }
.seo-link-title { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; margin-bottom: 1.5rem; }
.seo-link-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 640px)  { .seo-link-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .seo-link-grid { grid-template-columns: repeat(4, 1fr); } }
.seo-link-grid h3 { font-size: .9rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .75rem; }
.seo-link-grid ul { display: flex; flex-direction: column; gap: .4rem; }
.seo-link-grid a  { font-size: .85rem; color: #cbd5e1; text-decoration: none !important; transition: color var(--transition); }
.seo-link-grid a:hover { color: #fcd34d; }

/* ---- Footer -------------------------------------------- */
.footer { background: #0f172a; color: #cbd5e1; padding: 4rem 0 0; }
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}
@media (min-width: 640px)  { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }

.footer-brand .logo { color: #fff; margin-bottom: 1rem; }
.footer-brand p { font-size: .85rem; color: #94a3b8; line-height: 1.7; max-width: 300px; }
.footer-social { display: flex; gap: .75rem; margin-top: 1rem; }
.footer-social a { font-size: 1.3rem; opacity: .7; text-decoration: none !important; transition: opacity var(--transition); }
.footer-social a:hover { opacity: 1; }
.footer-col h3 { font-size: .85rem; font-weight: 700; color: #f1f5f9; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 1rem; }
.footer-col ul { display: flex; flex-direction: column; gap: .5rem; }
.footer-col a { font-size: .85rem; color: #94a3b8; text-decoration: none !important; transition: color var(--transition); }
.footer-col a:hover { color: #fcd34d; }

.footer-seo-links { border-top: 1px solid #1e293b; padding: 1.5rem 0; }
.footer-seo-links h4 { font-size: .8rem; color: #64748b; margin-bottom: .75rem; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-cloud a {
  font-size: .75rem;
  color: #64748b;
  border: 1px solid #1e293b;
  padding: .25rem .7rem;
  border-radius: 50px;
  text-decoration: none !important;
  transition: all var(--transition);
}
.tag-cloud a:hover { color: #fcd34d; border-color: #fcd34d; }

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding: 1.25rem 0;
  text-align: center;
}
.footer-bottom p { font-size: .8rem; color: #475569; }

/* ---- Breadcrumb ---------------------------------------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: rgba(255,255,255,.6);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: rgba(255,255,255,.75); text-decoration: none !important; }
.breadcrumb a:hover { color: #fff; }

/* ---- Page Hero ----------------------------------------- */
.page-hero {
  background: linear-gradient(135deg, var(--ph-color, #4338ca), color-mix(in srgb, var(--ph-color, #4338ca) 70%, #000));
  color: #fff;
  padding: 2.5rem 0;
}
.page-hero-inner {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.page-hero-icon { font-size: 3rem; flex-shrink: 0; }
.page-hero-inner h1 { font-family: var(--font-head); font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 800; margin-bottom: .5rem; }
.page-hero-inner p  { opacity: .85; font-size: .95rem; margin-bottom: .75rem; }
.page-hero-meta { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .82rem; opacity: .8; }

/* ---- Sidebar Layout ------------------------------------ */
.layout-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2.5rem 0;
}
@media (min-width: 1024px) { .layout-sidebar { grid-template-columns: 1fr 300px; } }

.main-content { min-width: 0; }
.content-title {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--border);
}

/* ---- Sidebar ------------------------------------------- */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.sidebar-card h3 { font-family: var(--font-head); font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.sidebar-exam-list { display: flex; flex-direction: column; gap: .3rem; }
.sidebar-exam-list a {
  display: block;
  padding: .45rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--text);
  text-decoration: none !important;
  transition: all var(--transition);
}
.sidebar-exam-list a:hover,
.sidebar-exam-list a.active { background: var(--primary-l); color: var(--primary); font-weight: 600; }
.sidebar-cta { background: linear-gradient(135deg, var(--primary), var(--primary-d)); color: #fff; }
.sidebar-cta h3, .sidebar-cta p { color: #fff; }
.sidebar-cta p  { font-size: .875rem; opacity: .85; margin-bottom: 1rem; }
.sidebar-quiz-cta-icon { font-size: 2rem; margin-bottom: .5rem; }

/* ---- SEO Content Block --------------------------------- */
.seo-content-block {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
}
.seo-content-block h2 { font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; margin-bottom: .75rem; }
.seo-content-block h3 { font-family: var(--font-head); font-size: 1rem; font-weight: 700; margin: 1.5rem 0 .75rem; }
.seo-content-block p  { color: var(--muted); font-size: .9rem; line-height: 1.8; margin-bottom: 1rem; }
.seo-content-block ul { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.seo-content-block li { font-size: .9rem; color: var(--muted); padding-left: .5rem; }
.inline-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.inline-link-grid a {
  font-size: .82rem;
  padding: .35rem .9rem;
  background: var(--primary-l);
  color: var(--primary);
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none !important;
  transition: all var(--transition);
}
.inline-link-grid a:hover { background: var(--primary); color: #fff; }

/* ---- Pagination ---------------------------------------- */
.pagination {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none !important;
  transition: all var(--transition);
}
.page-btn:hover,
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- Empty State --------------------------------------- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}
.empty-state span { font-size: 3rem; display: block; margin-bottom: 1rem; }

/* ---- Quiz Detail --------------------------------------- */
.quiz-detail-wrap { padding: 1.5rem 0 3rem; }
.quiz-detail-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border-top: 5px solid var(--accent, var(--primary));
  margin-bottom: 2rem;
}
.quiz-detail-badges { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.badge-cat { font-size: .75rem; padding: .2rem .65rem; border-radius: 50px; background: #f1f5f9; color: var(--muted); font-weight: 600; }
.quiz-detail-title { font-family: var(--font-head); font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 800; margin-bottom: .75rem; }
.quiz-detail-desc   { color: var(--muted); margin-bottom: 1.5rem; }
.quiz-detail-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 480px) { .quiz-detail-stats { grid-template-columns: repeat(4, 1fr); } }
.qs-item {
  text-align: center;
  background: var(--bg);
  border-radius: var(--radius);
  padding: .9rem;
}
.qs-item strong { display: block; font-family: var(--font-head); font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.qs-item span   { font-size: .75rem; color: var(--muted); }
.quiz-detail-rules { margin-bottom: 1.5rem; }
.quiz-detail-rules h3 { font-family: var(--font-head); font-size: .9rem; font-weight: 700; margin-bottom: .6rem; }
.quiz-detail-rules li { font-size: .875rem; color: var(--muted); padding: .2rem 0; }
.quiz-detail-cta { display: flex; gap: .75rem; flex-wrap: wrap; }

.quiz-leaderboard-mini { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.quiz-leaderboard-mini h2 { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }

/* ---- Tables -------------------------------------------- */
.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  margin-bottom: 1rem;
}
.lb-table th, .lb-table td {
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.lb-table th {
  font-weight: 700;
  font-size: .8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--bg);
}
.lb-table tr:hover { background: var(--bg); }
.rank-medal { font-size: 1.2rem; }

/* ---- Leaderboard --------------------------------------- */
.lb-wrap { padding: 2rem 0 4rem; }
.lb-header { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.lb-header h1 { font-family: var(--font-head); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; flex: 1; }
.lb-tabs { display: flex; gap: .5rem; }
.lb-tab { padding: .4rem 1rem; border-radius: 50px; font-size: .85rem; font-weight: 600; background: var(--border); color: var(--muted); text-decoration: none !important; }
.lb-tab.active { background: var(--primary); color: #fff; }

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
}
.podium-item { display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.podium-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
}
.podium-avatar-1 { width: 64px; height: 64px; font-size: 1.3rem; border: 3px solid #fcd34d; }
.podium-name  { font-size: .8rem; font-weight: 600; text-align: center; max-width: 80px; }
.podium-score { font-size: .75rem; color: var(--muted); }
.podium-block { font-size: 1.75rem; }
.podium-crown { font-size: 1.4rem; }

.lb-table-wrap { overflow-x: auto; }
.lb-table-full { min-width: 600px; }
.lb-player { display: flex; align-items: center; gap: .75rem; }
.lb-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary-l);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}
.lb-me { background: #fffbeb; }
.you-tag {
  font-size: .65rem;
  background: var(--accent);
  color: #fff;
  padding: .1rem .45rem;
  border-radius: 50px;
  font-weight: 700;
  margin-left: .4rem;
}

.lb-register-cta {
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, var(--primary-l), #e0e7ff);
  border-radius: var(--radius-lg);
  margin-top: 2rem;
}
.lb-register-cta h3 { font-family: var(--font-head); font-size: 1.3rem; font-weight: 800; margin-bottom: .5rem; }
.lb-register-cta p  { color: var(--muted); margin-bottom: 1.5rem; }

/* ---- Auth ---------------------------------------------- */
.auth-wrap {
  min-height: calc(100vh - var(--nav-h) - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}
.auth-logo { font-size: 2.5rem; text-align: center; margin-bottom: .75rem; }
.auth-title { font-family: var(--font-head); font-size: 1.75rem; font-weight: 800; text-align: center; margin-bottom: .25rem; }
.auth-sub   { text-align: center; color: var(--muted); font-size: .875rem; margin-bottom: 1.75rem; }
.auth-switch { text-align: center; color: var(--muted); font-size: .875rem; margin-top: 1.25rem; }
.auth-demo {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: .78rem;
  color: var(--muted);
  border: 1px solid var(--border);
}

.auth-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group label { font-size: .875rem; font-weight: 600; color: var(--text); }
.form-group input,
.form-group select,
.form-group textarea {
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  background: var(--bg);
  transition: border-color var(--transition);
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.form-group small { font-size: .75rem; color: var(--muted); }

.input-pw-wrap { position: relative; }
.input-pw-wrap input { padding-right: 3rem; width: 100%; }
.pw-toggle {
  position: absolute;
  right: .75rem; top: 50%; transform: translateY(-50%);
  background: none; border: none;
  font-size: 1rem; opacity: .5;
  cursor: pointer;
}
.pw-toggle:hover { opacity: 1; }

.role-options { display: flex; gap: 1rem; }
.role-option {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-size: .875rem;
  font-weight: 600;
}
.role-option:has(input:checked) { border-color: var(--primary); background: var(--primary-l); color: var(--primary); }

/* ---- Alerts -------------------------------------------- */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
}
.alert-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }

/* ---- Result -------------------------------------------- */
.result-wrap { max-width: 800px; margin: 0 auto; padding: 2rem 0 4rem; }
.result-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}
.result-pass { border-top: 5px solid var(--success); }
.result-fail { border-top: 5px solid var(--accent); }
.result-emoji { font-size: 3.5rem; margin-bottom: .75rem; }
.result-title { font-family: var(--font-head); font-size: 2rem; font-weight: 800; margin-bottom: .25rem; }
.result-quiz-name { color: var(--muted); margin-bottom: 1.75rem; }

.result-score-ring {
  position: relative;
  width: 150px; height: 150px;
  margin: 0 auto 2rem;
}
.result-score-ring svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.result-score-ring .ring-bg   { fill: none; stroke: var(--border); stroke-width: 10; }
.result-score-ring .ring-fill { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray 1.2s ease; }
.ring-center {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.ring-center strong { font-family: var(--font-head); font-size: 2rem; font-weight: 800; }
.ring-center small  { color: var(--muted); font-size: .8rem; }

.result-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 480px) { .result-stats { grid-template-columns: repeat(4, 1fr); } }
.rs-item { padding: 1rem; border-radius: var(--radius); border: 1.5px solid var(--border); }
.rs-item strong { display: block; font-family: var(--font-head); font-size: 1.75rem; font-weight: 800; }
.rs-item span   { font-size: .78rem; color: var(--muted); }
.rs-correct strong { color: var(--success); }
.rs-wrong strong   { color: var(--danger); }

.result-xp {
  background: linear-gradient(90deg, var(--accent), var(--accent-d));
  color: #fff;
  padding: .75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  display: inline-block;
}
.result-actions { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }

.answer-review { margin-bottom: 2rem; }
.answer-review h2 { font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; margin-bottom: 1.25rem; }
.ar-item { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.ar-correct { border-left: 4px solid var(--success); }
.ar-wrong   { border-left: 4px solid var(--danger); }
.ar-skipped { border-left: 4px solid var(--muted-l); }
.ar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.ar-num    { font-weight: 700; color: var(--muted); font-size: .85rem; }
.ar-status { font-size: .8rem; font-weight: 600; }
.ar-question { font-weight: 600; margin-bottom: .75rem; font-size: .95rem; }
.ar-options  { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .75rem; }
.ar-option   { font-size: .875rem; color: var(--muted); padding: .4rem .6rem; border-radius: var(--radius-sm); }
.opt-correct { background: #dcfce7; color: #15803d; font-weight: 600; }
.opt-wrong   { background: #fee2e2; color: #b91c1c; }
.ar-explanation { background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius-sm); padding: .75rem; font-size: .85rem; color: #92400e; }

.result-bottom-cta { display: flex; gap: 1rem; justify-content: space-between; flex-wrap: wrap; }

/* ---- Share Buttons ------------------------------------- */
.share-btns { display: flex; flex-direction: column; gap: .5rem; }
.share-btn {
  display: block;
  padding: .6rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
  text-decoration: none !important;
  transition: all var(--transition);
}
.share-wa   { background: #dcfce7; color: #15803d; }
.share-wa:hover { background: #16a34a; color: #fff; }
.share-tg   { background: #e0f2fe; color: #0369a1; }
.share-tg:hover { background: #0369a1; color: #fff; }
.share-copy { background: var(--bg); color: var(--muted); }
.share-copy:hover { background: var(--border); }

/* ---- Teacher ------------------------------------------- */
.teacher-wrap { padding: 2rem 0 4rem; }
.teacher-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem; }
.teacher-header h1 { font-family: var(--font-head); font-size: 1.75rem; font-weight: 800; }
.teacher-header p  { color: var(--muted); }

.teacher-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (min-width: 640px) { .teacher-stats { grid-template-columns: repeat(4, 1fr); } }
.ts-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1.25rem; text-align: center; }
.ts-card strong { display: block; font-family: var(--font-head); font-size: 2rem; font-weight: 800; color: var(--primary); }
.ts-card span   { font-size: .8rem; color: var(--muted); }

.teacher-table-wrap { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.teacher-table-wrap h2 { font-family: var(--font-head); font-size: 1.15rem; font-weight: 700; margin-bottom: 1.25rem; }
.teacher-table { width: 100%; border-collapse: collapse; font-size: .875rem; min-width: 700px; }
.teacher-table th, .teacher-table td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.teacher-table th { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; background: var(--bg); }
.teacher-table tr:hover { background: var(--bg); }
.quiz-link { font-weight: 600; color: var(--primary); text-decoration: none !important; }
.actions-cell { display: flex; gap: .4rem; flex-wrap: wrap; }
.status-badge { font-size: .72rem; padding: .2rem .65rem; border-radius: 50px; font-weight: 700; }
.status-draft  { background: #fef9c3; color: #a16207; }
.status-pub    { background: #dcfce7; color: #15803d; }
.status-arc    { background: #f1f5f9; color: var(--muted); }

/* Create quiz */
.create-quiz-form { max-width: 720px; }
.cqf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.cqf-full { grid-column: 1 / -1; }
.cqf-actions { margin-top: 2rem; }

/* Add questions */
.aq-wrap { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1024px) { .aq-wrap { grid-template-columns: 1.2fr 1fr; } }
.aq-form-card, .aq-saved-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.aq-form-card h2, .aq-saved-card h2 { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem; }
.option-input-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.option-input-row input[type=text] { flex: 1; padding: .55rem .75rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: .875rem; }
.option-input-row input[type=radio] { width: 16px; height: 16px; accent-color: var(--success); flex-shrink: 0; }
.aq-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.sq-item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .9rem;
  margin-bottom: .75rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.sq-item-new { animation: highlightNew .8s ease; }
@keyframes highlightNew { 0% { background: #dcfce7; } 100% { background: transparent; } }
.sq-num  { font-size: .75rem; font-weight: 700; color: var(--muted); }
.sq-text { font-size: .9rem; font-weight: 600; }
.sq-options { display: flex; flex-direction: column; gap: .3rem; }
.sq-opt { font-size: .8rem; color: var(--muted); padding: .2rem .4rem; border-radius: 4px; }
.sq-opt-correct { color: var(--success); font-weight: 600; background: #dcfce7; }

/* ---- Modals -------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal.hidden { display: none; }
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 380px;
  width: 100%;
  position: relative;
  z-index: 2;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.modal-box h3 { font-family: var(--font-head); font-size: 1.25rem; font-weight: 800; margin-bottom: .5rem; }
.modal-box p  { color: var(--muted); margin-bottom: 1.5rem; }
.modal-btns   { display: flex; gap: .75rem; justify-content: center; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1;
}

/* ---- Utilities ----------------------------------------- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }

/* ---- Profile ------------------------------------------- */
.profile-wrap { padding: 2rem 0 4rem; }
.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.profile-avatar-lg {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 800;
  flex-shrink: 0;
}
.profile-info { flex: 1; min-width: 0; }
.profile-info h1 { font-family: var(--font-head); font-size: 1.6rem; font-weight: 800; }
.profile-email { color: var(--muted); font-size: .875rem; margin: .25rem 0 .75rem; }
.profile-badges-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.badge-pill-lg { font-size: .8rem; padding: .25rem .8rem; }
.profile-role-tag {
  font-size: .75rem; font-weight: 700;
  background: var(--primary-l); color: var(--primary);
  padding: .2rem .7rem; border-radius: 50px;
  text-transform: capitalize;
}
.profile-joined { font-size: .78rem; color: var(--muted); }

.profile-xp-card {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  min-width: 200px;
  text-align: center;
}
.xp-number { font-family: var(--font-head); font-size: 2.25rem; font-weight: 800; color: #fcd34d; }
.xp-label  { font-size: .8rem; color: rgba(255,255,255,.7); margin-bottom: 1rem; }
.xp-progress-wrap {
  height: 6px; background: rgba(255,255,255,.15); border-radius: 50px; margin-bottom: .5rem; overflow: hidden;
}
.xp-progress-bar  { height: 100%; background: #fcd34d; border-radius: 50px; transition: width .6s ease; }
.xp-next { font-size: .72rem; color: rgba(255,255,255,.6); }

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (min-width: 640px) { .profile-stats-grid { grid-template-columns: repeat(4, 1fr); } }
.pstat {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}
.pstat strong { display: block; font-family: var(--font-head); font-size: 1.75rem; font-weight: 800; color: var(--primary); }
.pstat span   { font-size: .78rem; color: var(--muted); }

.profile-tabs-wrap { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.profile-tabs { display: flex; border-bottom: 1.5px solid var(--border); }
.ptab {
  flex: 1;
  padding: 1rem;
  background: none;
  border: none;
  font-family: var(--font-head);
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
  border-bottom: 3px solid transparent;
}
.ptab:hover { color: var(--primary); background: var(--primary-l); }
.ptab.active { color: var(--primary); border-bottom-color: var(--primary); }
.ptab-content { display: none; padding: 1.5rem; }
.ptab-content.active { display: block; }

.history-list { display: flex; flex-direction: column; gap: .75rem; }
.history-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.hist-info { flex: 1; min-width: 0; }
.hist-title { font-weight: 700; font-size: .9rem; color: var(--text); display: block; text-decoration: none !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-title:hover { color: var(--primary); }
.hist-exam  { font-size: .75rem; color: var(--primary); font-weight: 600; margin-right: .5rem; }
.hist-date  { font-size: .75rem; color: var(--muted); }
.hist-score { text-align: center; min-width: 60px; }
.hist-score strong { display: block; font-family: var(--font-head); font-size: 1.25rem; font-weight: 800; }
.hist-score small  { font-size: .7rem; color: var(--muted); }
.hist-good  strong { color: var(--success); }
.hist-ok    strong { color: var(--accent-d); }
.hist-low   strong { color: var(--danger); }
.hist-actions { display: flex; gap: .4rem; }

/* ---- Static page misc ---------------------------------- */
.quiz-detail-wrap .breadcrumb { color: var(--muted); }
.quiz-detail-wrap .breadcrumb a { color: var(--muted); }
.quiz-detail-wrap .breadcrumb a:hover { color: var(--primary); }

/* ---- Access Type Cards (create/edit quiz) ------------- */
.access-type-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
}
@media (max-width: 640px) { .access-type-cards { grid-template-columns: 1fr; } }

.access-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: 1.1rem .75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  background: var(--surface);
}
.access-card input[type="radio"] { display: none; }
.access-card .ac-icon { font-size: 1.75rem; }
.access-card strong  { font-family: var(--font-head); font-size: .875rem; font-weight: 700; }
.access-card small   { color: var(--muted); font-size: .75rem; line-height: 1.4; }
.access-card:hover   { border-color: var(--primary); background: var(--primary-l); }
.access-card.selected{ border-color: var(--primary); background: var(--primary-l); box-shadow: 0 0 0 3px rgba(67,56,202,.12); }
.access-card.selected strong { color: var(--primary); }

/* ---- Card form sections (create/edit quiz) ------------ */
.card-form { display: flex; flex-direction: column; gap: 1.5rem; }
.cqf-section {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.cqf-section-title {
  font-family: var(--font-head);
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: .6rem;
  border-bottom: 1.5px solid var(--border);
}
.cqf-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.req { color: var(--danger); }

/* ---- Add questions sq-header -------------------------- */
.sq-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .4rem;
}
.sq-actions { display: flex; gap: .3rem; }

/* ---- Flash messages ----------------------------------- */
.alert-info { background: #e0f2fe; color: #0369a1; border: 1px solid #7dd3fc; }

/* ---- Admin sidebar nav links (more items) ------------- */
.admin-nav li a[href="/admin/payments"]  { }
.admin-nav li a[href="/admin/analytics"] { }
.admin-nav li a[href="/admin/settings"]  { }

/* ---- Quiz page access badge ----------------------------- */
.quiz-access-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  font-weight: 700;
  padding: .3rem .9rem;
  border-radius: 50px;
}
.quiz-access-free { background: #f1f5f9; color: var(--muted); }
.quiz-access-reg  { background: #e0f2fe; color: #0369a1; }
.quiz-access-paid { background: #fef9c3; color: #a16207; border: 1px solid #fde68a; font-size: .9rem; }

/* ---- Checkout ----------------------------------------- */
.result-card .quiz-detail-stats { grid-template-columns: repeat(4,1fr); }
