:root {
  --purple: #6C5CE7; --purple-d: #5A4BD4;
  --pink: #FD79A8; --pink-d: #E84393;
  --teal: #00CEC9; --teal-d: #00B5B1;
  --green: #00B894; --green-d: #00A085;
  --blue: #0984E3; --yellow: #FDCB6E; --coral: #FF7675;
  --ink: #2D3436; --muted: #7A8290; --line: #ECEAF6;
  --card: #ffffff; --bg1: #efeaff; --bg2: #ffeaf4;
  --shadow: 0 12px 30px rgba(108,92,231,.16);
  --shadow-sm: 0 6px 16px rgba(108,92,231,.12);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--ink); min-height: 100vh;
  background: linear-gradient(135deg, var(--bg1), var(--bg2) 55%, #eafff7);
  overflow-x: hidden;
}
h1, h2, h3, .btn-3d, .brand, .greet-title { font-family: "Fredoka", sans-serif; }
.hidden { display: none !important; }

/* ---------- animated background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .5; animation: float 16s ease-in-out infinite; }
.b1 { width: 380px; height: 380px; background: #c4b5ff; top: -80px; left: -60px; }
.b2 { width: 320px; height: 320px; background: #ffc2dd; bottom: -60px; right: -40px; animation-delay: -4s; }
.b3 { width: 280px; height: 280px; background: #9af6ee; top: 40%; right: 12%; animation-delay: -8s; }
.b4 { width: 240px; height: 240px; background: #ffe0a3; bottom: 20%; left: 8%; animation-delay: -12s; }
@keyframes float { 0%,100% { transform: translateY(0) translateX(0) scale(1); } 33% { transform: translateY(-30px) translateX(20px) scale(1.06); } 66% { transform: translateY(20px) translateX(-15px) scale(.96); } }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; justify-content: space-between;
  align-items: center; padding: 12px 22px; backdrop-filter: blur(10px);
  background: rgba(255,255,255,.7); border-bottom: 1px solid rgba(255,255,255,.6);
}
.brand { font-size: 24px; font-weight: 700; color: var(--purple); display: flex; align-items: center; gap: 6px; }
.brand .logo { animation: wiggle 3s ease-in-out infinite; display: inline-block; }
.brand-accent { color: var(--pink); }
@keyframes wiggle { 0%,90%,100% { transform: rotate(0); } 93% { transform: rotate(-12deg); } 96% { transform: rotate(12deg); } }
.header-right { display: flex; align-items: center; gap: 14px; }
.subject-pills { display: flex; gap: 6px; background: #f1eefc; padding: 4px; border-radius: 999px; }
.subj-pill { border: none; background: transparent; color: var(--muted); font-weight: 700; font-family: "Nunito";
  padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: .2s; font-size: 13px; }
.subj-pill.on { background: var(--purple); color: #fff; box-shadow: var(--shadow-sm); }
.subj-pill:not(.on):hover { color: var(--purple); }
.user-chip { background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 13px; color: var(--ink); }
.icon-btn { background: #fff; border: 2px solid var(--line); width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 16px; color: var(--muted); transition: .2s; }
.icon-btn:hover { border-color: var(--pink); color: var(--pink); transform: scale(1.08); }

main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }
.view { animation: fadeUp .5s cubic-bezier(.2,.8,.2,1); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.85); } 60% { transform: scale(1.03); } 100% { opacity: 1; transform: scale(1); } }
.pop-in { animation: popIn .5s cubic-bezier(.2,.8,.2,1); }

/* ---------- buttons ---------- */
.btn-3d {
  border: none; color: #fff; font-weight: 700; font-size: 16px; padding: 13px 24px;
  border-radius: 16px; cursor: pointer; transition: transform .12s, box-shadow .12s, filter .12s;
  box-shadow: 0 5px 0 rgba(0,0,0,.16); letter-spacing: .2px;
}
.btn-3d:hover { filter: brightness(1.05); transform: translateY(-2px); }
.btn-3d:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.16); }
.btn-3d:disabled { filter: grayscale(.5) brightness(.95); cursor: default; transform: none; }
.btn-purple { background: var(--purple); box-shadow: 0 5px 0 var(--purple-d); }
.btn-pink { background: var(--pink); box-shadow: 0 5px 0 var(--pink-d); }
.btn-teal { background: var(--teal); box-shadow: 0 5px 0 var(--teal-d); }
.btn-green { background: var(--green); box-shadow: 0 5px 0 var(--green-d); }
.btn-3d.big { font-size: 18px; padding: 15px 30px; width: 100%; }
.btn-3d.wide { width: 100%; }
.btn-ghost { background: transparent; border: none; color: var(--purple); font-weight: 700; cursor: pointer; padding: 10px; font-size: 14px; }
.btn-ghost:hover { text-decoration: underline; }

/* ---------- login ---------- */
.login-view { display: flex; justify-content: center; align-items: center; min-height: 78vh; }
.login-card { background: var(--card); border-radius: 28px; padding: 38px 34px; width: 380px; max-width: 92vw; text-align: center; box-shadow: var(--shadow); }
.mascot { font-size: 66px; animation: bounce 2.4s ease-in-out infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.login-title { font-size: 26px; margin: 6px 0 2px; }
.grad-text { background: linear-gradient(90deg, var(--purple), var(--pink)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.login-sub { color: var(--muted); margin: 0 0 20px; font-weight: 600; }
.field { margin-bottom: 12px; }
input { width: 100%; padding: 13px 16px; border: 2px solid var(--line); border-radius: 14px; font-size: 15px; font-family: "Nunito"; font-weight: 600; transition: .2s; background: #faf9ff; }
input:focus { outline: none; border-color: var(--purple); background: #fff; box-shadow: 0 0 0 4px rgba(108,92,231,.12); }
.demo-hint { color: var(--muted); font-size: 13px; margin-top: 14px; }
.msg { color: var(--coral); font-weight: 700; min-height: 20px; font-size: 14px; margin: 8px 0 0; }

/* ---------- home ---------- */
.greeting { margin: 4px 0 22px; }
.greet-title { font-size: 32px; margin: 0; }
.greet-sub { color: var(--muted); font-weight: 600; margin: 4px 0 0; }
.mode-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 22px; }
@media (max-width: 900px) { .mode-grid { grid-template-columns: 1fr; } }
.mode-card { background: var(--card); border-radius: 26px; padding: 26px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.mode-card::before { content: ""; position: absolute; top: -40px; right: -40px; width: 140px; height: 140px; border-radius: 50%; opacity: .14; }
.card-topic::before { background: var(--pink); }
.card-mock::before { background: var(--teal); }
.mode-icon { font-size: 40px; }
.mode-card h2 { font-size: 23px; margin: 8px 0 2px; }
.mode-desc { color: var(--muted); font-weight: 600; margin: 0 0 16px; }

.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.topic-chip { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-radius: 16px; background: #faf9ff;
  border: 2px solid var(--line); cursor: pointer; transition: transform .15s, border-color .15s, background .15s; user-select: none; }
.topic-chip:hover { transform: translateY(-3px) scale(1.02); }
.topic-chip.on { border-color: var(--tc, var(--purple)); background: var(--tcbg, #f0edff); box-shadow: var(--shadow-sm); }
.topic-chip .tc-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; color: #fff; flex: none; }
.topic-chip .tc-name { font-weight: 700; font-size: 13.5px; line-height: 1.1; }
.topic-chip .tc-count { font-size: 11px; color: var(--muted); font-weight: 700; }
.topic-chip .tc-check { margin-left: auto; opacity: 0; transform: scale(.5); transition: .2s; color: var(--tc, var(--purple)); font-weight: 900; }
.topic-chip.on .tc-check { opacity: 1; transform: scale(1); }

.mode-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stepper { display: flex; align-items: center; gap: 8px; background: #faf9ff; border: 2px solid var(--line); border-radius: 14px; padding: 5px 8px; }
.step-btn { width: 30px; height: 30px; border-radius: 9px; border: none; background: var(--purple); color: #fff; font-size: 18px; font-weight: 700; cursor: pointer; transition: .15s; }
.step-btn:hover { transform: scale(1.1); }
.stepper > span#numQ { font-weight: 800; min-width: 26px; text-align: center; font-size: 17px; }
.step-label { color: var(--muted); font-weight: 700; font-size: 13px; }

.paper-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.paper-opt { border: 3px solid var(--line); border-radius: 18px; padding: 16px; cursor: pointer; background: #faf9ff; transition: .2s; }
.paper-opt:hover { transform: translateY(-3px); }
.paper-opt.on { border-color: var(--teal); background: #e8fffe; }
.paper-opt h4 { margin: 0 0 6px; font-family: "Fredoka"; font-size: 17px; }
.paper-opt .p-meta { color: var(--muted); font-weight: 700; font-size: 12.5px; line-height: 1.5; }
.paper-opt .calc-yes { color: var(--green); } .paper-opt .calc-no { color: var(--coral); }

.mini-h { font-size: 15px; color: var(--ink); margin: 22px 0 10px; }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item { display: flex; align-items: center; gap: 10px; background: #faf9ff; border-radius: 14px; padding: 10px 12px; font-weight: 700; font-size: 13px; }
.history-item .h-grade { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-family: "Fredoka"; font-size: 15px; flex: none; }
.history-item .h-title { flex: 1; }
.history-item .h-score { color: var(--muted); }
.history-empty { color: var(--muted); font-weight: 600; }

/* ---------- admin ---------- */
.admin-card { background: var(--card); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); margin-top: 22px; }
.admin-card h2 { font-size: 18px; margin: 0 0 14px; }
.bank-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.bank-stats .stat { background: #faf9ff; border: 2px solid var(--line); border-radius: 14px; padding: 10px 16px; text-align: center; min-width: 92px; }
.bank-stats .stat .n { font-size: 22px; font-weight: 800; color: var(--purple); font-family: "Fredoka"; }
.bank-stats .stat .l { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 800; }
.pipeline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pipeline .arrow { color: var(--muted); font-weight: 800; }
.btn-mini { background: #f1eefc; border: 2px solid var(--line); color: var(--purple); font-weight: 700; padding: 8px 14px; border-radius: 12px; cursor: pointer; transition: .15s; font-family: "Nunito"; }
.btn-mini:hover { background: var(--purple); color: #fff; }
.btn-mini:disabled { opacity: .5; }

/* ---------- exam ---------- */
.exam-bar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center;
  gap: 14px; background: rgba(255,255,255,.85); backdrop-filter: blur(10px); border-radius: 18px; padding: 12px 16px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.exam-bar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.exam-titles { min-width: 0; }
.exam-title { font-family: "Fredoka"; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.exam-meta { color: var(--muted); font-weight: 700; font-size: 12px; }
.exam-bar-right { display: flex; align-items: center; gap: 12px; }
.progress-wrap { width: 160px; height: 12px; background: #eee; border-radius: 999px; overflow: hidden; }
@media (max-width: 700px) { .progress-wrap { width: 80px; } .exam-title { max-width: 34vw; } }
.progress-bar { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--purple), var(--pink)); transition: width .4s ease; }
.answered { font-weight: 800; font-size: 13px; color: var(--muted); }
.timer-chip { background: var(--purple); color: #fff; font-family: "Fredoka"; font-weight: 600; font-size: 18px; padding: 6px 14px; border-radius: 12px; min-width: 76px; text-align: center; }
.timer-chip.danger { background: var(--coral); animation: pulse .8s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* question navigator */
.qnav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 16px; }
.qnav-dot { width: 38px; height: 38px; border-radius: 12px; border: 2px solid var(--line); background: #fff;
  color: var(--muted); font-weight: 800; font-family: "Fredoka"; font-size: 14px; cursor: pointer; transition: .15s; }
.qnav-dot:hover { transform: translateY(-2px); border-color: var(--purple); }
.qnav-dot.answered { background: var(--green); border-color: var(--green); color: #fff; }
.qnav-dot.current { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(108,92,231,.18); transform: scale(1.08); }
.qnav-dot.current.answered { background: var(--green); }

/* single-question stage */
.qstage { display: flex; justify-content: center; }
.qcard-stage { background: var(--card); border-radius: 24px; padding: 30px 32px; box-shadow: var(--shadow);
  border-top: 7px solid var(--qc, var(--purple)); width: 100%; max-width: 720px; min-height: 320px; }
.qcard-stage .qhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 8px; flex-wrap: wrap; }
.qnum-badge { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.qnum-circle { width: 30px; height: 30px; border-radius: 10px; background: var(--qc, var(--purple)); color: #fff; display: grid; place-items: center; font-family: "Fredoka"; }
.qtopic { color: var(--muted); font-weight: 700; font-size: 13px; }
.qbadges { display: flex; gap: 6px; align-items: center; }
.badge { font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 999px; }
.badge-src { background: #f1eefc; color: var(--purple); }
.badge-marks { background: #fff3d6; color: #c98a00; }
.qimg { max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 4px auto 18px; display: block; }
.prompt { font-size: 21px; font-weight: 700; line-height: 1.55; white-space: pre-wrap; margin-bottom: 22px; color: var(--ink); }
.answer-box { background: #f7f5ff; border: 2px dashed #d9d2f7; border-radius: 18px; padding: 16px 18px; }
.answer-label { display: block; font-weight: 800; color: var(--purple); font-size: 13px; margin-bottom: 8px; }
.ansInput { font-size: 20px; font-weight: 700; padding: 14px 16px; border: 2px solid var(--line); border-radius: 14px; background: #fff; }
.ansInput:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 4px rgba(108,92,231,.12); }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { padding: 14px 16px; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; font-weight: 700; font-size: 16px; transition: .15s; background: #faf9ff; }
.choice:hover { border-color: var(--purple); transform: translateX(3px); }
.choice.on { border-color: var(--purple); background: #f0edff; }

/* bottom controls */
.nav-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 720px; margin: 22px auto 0; }
.nav-mid { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.qposition { color: var(--muted); font-weight: 800; font-size: 13px; }
.btn-nav { background: #fff; border: 2px solid var(--line); color: var(--ink); font-weight: 800; font-family: "Fredoka"; font-size: 15px;
  padding: 12px 22px; border-radius: 14px; cursor: pointer; transition: .15s; }
.btn-nav:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--purple); color: var(--purple); }
.btn-nav.primary { background: var(--purple); color: #fff; border-color: var(--purple); box-shadow: 0 4px 0 var(--purple-d); }
.btn-nav.primary:hover:not(:disabled) { color: #fff; filter: brightness(1.05); }
.btn-nav:disabled { opacity: .35; cursor: default; }
@media (max-width: 560px) { .nav-controls { flex-wrap: wrap; } .btn-nav { flex: 1; } .nav-mid { order: 3; width: 100%; } .prompt { font-size: 18px; } }

/* ---------- results ---------- */
.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.result-hero { background: var(--card); border-radius: 28px; padding: 34px; text-align: center; box-shadow: var(--shadow); max-width: 560px; margin: 0 auto; }
.grade-ring { width: 168px; height: 168px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center;
  background: conic-gradient(var(--gc, var(--green)) var(--deg, 0deg), #eee 0deg); transition: --deg 1s; }
.grade-inner { width: 134px; height: 134px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.grade-letter { font-family: "Fredoka"; font-size: 46px; font-weight: 700; color: var(--gc, var(--green)); line-height: 1; }
.grade-pct { font-weight: 800; color: var(--muted); font-size: 16px; }
.grade-emoji { font-size: 46px; animation: bounce 1.6s ease-in-out infinite; }
.grade-msg { font-size: 24px; margin: 6px 0 4px; }
.score-line { color: var(--muted); font-weight: 700; font-size: 15px; margin-bottom: 18px; }
.score-line b { color: var(--ink); }
.result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.review-wrap { max-width: 760px; margin: 26px auto 0; }
.review-h { font-size: 18px; margin: 0 0 12px; }
.review-list { display: flex; flex-direction: column; gap: 8px; }
.review-item { background: var(--card); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-sm); border-left: 5px solid var(--line); font-weight: 700; animation: fadeUp .35s backwards; }
.review-item.correct { border-left-color: var(--green); }
.review-item.wrong { border-left-color: var(--coral); }
.review-item.review { border-left-color: var(--yellow); }
.review-item .ri-head { display: flex; align-items: center; gap: 8px; }
.review-item .ri-ic { font-size: 17px; }
.review-item .ri-detail { color: var(--muted); font-weight: 600; font-size: 13px; margin-top: 4px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(40px);
  background: var(--ink); color: #fff; font-weight: 700; padding: 13px 22px; border-radius: 14px;
  box-shadow: var(--shadow); z-index: 60; opacity: 0; transition: .3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- hints ---------- */
.hint-row { margin-top: 16px; }
.hint-btn { background: #fff7e6; color: #c98a00; border: 2px solid #ffe6a8; border-radius: 12px;
  padding: 9px 16px; font-weight: 800; font-family: "Nunito"; cursor: pointer; transition: .15s; }
.hint-btn:hover { background: #ffefc4; transform: translateY(-2px); }
.hint-btn.hidden { display: none; }
.hint-text { margin-top: 10px; background: #fff7e6; border-left: 4px solid var(--yellow);
  border-radius: 10px; padding: 12px 14px; font-weight: 700; color: #6b5a1f; max-height: 0;
  overflow: hidden; opacity: 0; transition: .35s; }
.hint-text.show { max-height: 240px; opacity: 1; }

/* ---------- analytics ---------- */
.analytics { max-width: 560px; margin: 18px auto 0; background: var(--card); border-radius: 20px;
  padding: 22px; box-shadow: var(--shadow); }
.an-h { font-size: 17px; margin: 0 0 14px; }
.an-row { display: grid; grid-template-columns: 120px 1fr 44px; align-items: center; gap: 10px; margin-bottom: 8px; }
.an-topic { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: capitalize;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-bar { height: 12px; background: #eee; border-radius: 999px; overflow: hidden; }
.an-fill { height: 100%; border-radius: 999px; transition: width .8s ease; }
.an-pct { font-size: 12px; font-weight: 800; color: var(--ink); text-align: right; }
.an-advice { margin-top: 12px; border-radius: 12px; padding: 11px 14px; font-weight: 700; font-size: 14px; }
.an-focus { background: #fff0f0; color: #c0392b; }
.an-strong { background: #eafff5; color: #00875a; }
.an-great { background: #eafff5; color: #00875a; }

/* ---------- leaderboard ---------- */
.lb-card { max-width: 640px; margin: 0 auto; background: var(--card); border-radius: 24px;
  padding: 24px; box-shadow: var(--shadow); }
.lb-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.lb-head h2 { font-size: 24px; margin: 0; }
.lb-controls { display: flex; gap: 10px; align-items: center; }
.lb-list { display: flex; flex-direction: column; gap: 8px; }
.lb-item { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px;
  background: #faf9ff; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.lb-item.me { border-color: var(--purple); background: #f0edff; }
.lb-pos { font-size: 22px; text-align: center; }
.lb-rank { font-family: "Fredoka"; font-weight: 700; color: var(--muted); font-size: 16px; }
.lb-name { font-weight: 800; }
.lb-you { background: var(--purple); color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 999px; vertical-align: middle; }
.lb-stats { font-size: 12.5px; color: var(--muted); font-weight: 700; text-align: right; }
.lb-stats b { color: var(--ink); }
.lb-empty { color: var(--muted); font-weight: 600; text-align: center; padding: 24px; }

/* ---------- admin content manager ---------- */
.admin-subj { font-size: 14px; font-weight: 700; color: var(--muted); }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 12px 0; }
.admin-tool { background: #faf9ff; border: 2px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.admin-tool h3 { margin: 0; font-size: 15px; }
.tool-hint { margin: 0; font-size: 12px; color: var(--muted); }
.admin-tool input[type="file"], .admin-tool input[type="text"], .admin-tool input:not([type]), .admin-tool textarea {
  width: 100%; padding: 8px 10px; border: 2px solid var(--line); border-radius: 10px; font: inherit; font-size: 13px; box-sizing: border-box; }
.admin-tool textarea { min-height: 60px; resize: vertical; }
.admin-tool .btn-mini { align-self: flex-start; }
.btn-mini.ghost { background: #fff; color: var(--purple); }

/* ---------- users & roles ---------- */
.user-new { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.user-new input, .user-new select { padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px;
  font: inherit; font-size: 14px; flex: 1 1 130px; min-width: 0; }
.user-new select { flex: 0 0 auto; }
.user-new button { flex: 0 0 auto; }
.user-list { display: flex; flex-direction: column; gap: 8px; }
.user-item { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px;
  background: #faf9ff; border: 2px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.user-item.off { opacity: 0.55; }
.u-name { font-weight: 800; }
.u-handle { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.u-meta { display: flex; gap: 8px; align-items: center; }
.u-role { padding: 6px 8px; border: 2px solid var(--line); border-radius: 10px; font: inherit; font-size: 13px; }
.u-on { background: #eafff5; color: #00875a; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.u-off { background: #ffecec; color: #d63031; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.u-actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 620px) {
  .user-item { grid-template-columns: 1fr; gap: 8px; }
  .u-actions { justify-content: flex-start; }
}
.u-status { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; text-transform: capitalize; }
.u-pending { background: #fff4e0; color: #b8860b; }
.u-rejected { background: #ffecec; color: #d63031; }

/* ---------- registration + pending approvals ---------- */
.reg-select { width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px;
  font: inherit; font-size: 15px; background: #fff; }
.pending-count { display: inline-block; min-width: 22px; text-align: center; background: var(--pink, #FD79A8);
  color: #fff; font-size: 13px; font-weight: 800; padding: 1px 8px; border-radius: 999px; vertical-align: middle; }
.pending-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.pending-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #faf9ff; border: 2px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.pi-meta { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.pi-actions { display: flex; gap: 6px; }
.pi-approve { background: #00b894; color: #fff; }
.pi-reject { background: #fff; color: #d63031; }

/* ---------- admin console ---------- */
#brandHome { cursor: pointer; }
.admin-dash { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stile { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 16px 18px;
  box-shadow: var(--shadow); }
.stile.good { border-color: #00b894; }
.stile.warn { border-color: #FDCB6E; background: #fffdf5; }
.st-n { font-family: "Fredoka"; font-weight: 700; font-size: 30px; line-height: 1; }
.st-l { font-size: 12.5px; color: var(--muted); font-weight: 700; margin-top: 4px; }
.dash-panel { background: var(--card); border-radius: 22px; padding: 20px 22px; box-shadow: var(--shadow); }
.dash-panel > h2 { margin: 0 0 14px; font-size: 20px; }
.subj-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.subj-card { background: #faf9ff; border: 2px solid var(--line); border-radius: 16px; padding: 14px; cursor: pointer;
  transition: border-color .15s, transform .15s; }
.subj-card:hover { transform: translateY(-2px); }
.subj-card.on { border-color: var(--purple); background: #f0edff; }
.sc-head { font-size: 15px; }
.sc-q { font-weight: 800; color: var(--purple); margin: 6px 0; }
.sc-papers { display: flex; flex-wrap: wrap; gap: 5px; }
.p-chip { font-size: 11px; font-weight: 700; color: var(--muted); background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 8px; }
.dash-users { overflow-x: auto; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dash-table th { text-align: left; color: var(--muted); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .03em; padding: 6px 10px; border-bottom: 2px solid var(--line); }
.dash-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dash-table td.num { font-weight: 800; text-align: center; }
.dash-table td.last { color: var(--muted); font-size: 12px; white-space: nowrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #cfd3dc; margin-right: 4px; }
.dot.on { background: #00b894; box-shadow: 0 0 0 3px #00b89433; }
.rb { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; text-transform: capitalize; }
.rb-superadmin { background: #efeaff; color: #6C5CE7; }
.rb-admin { background: #e7f6ff; color: #0984E3; }
.rb-student { background: #eafff5; color: #00875a; }
