/* Admin dashboard — same design language as the public site */
:root {
  --bg: #070b14; --bg-2: #0b111d;
  --card: #0e1524; --card-2: #0b1220;
  --text: #e8eefb; --muted: #a6b3c8; --faint: #8190a8;
  --border: rgba(148, 163, 184, .14); --border-strong: rgba(148, 163, 184, .28);
  --accent: #6f9bff; --accent-2: #ff9a5c; --accent-3: #a08bff;
  --blue: #2f5fe6; --violet: #5b3fe0;
  --ok: #4ade80; --warn: #fbbf24; --danger: #f87171;
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Bricolage Grotesque', var(--font);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); margin: 0 0 .5em; color: var(--text); }
:focus-visible { outline: 3px solid rgba(111, 155, 255, .7); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .82em; }

/* ---------- shell ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: rgba(7, 11, 20, .86); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.topbar-inner { width: min(100% - 32px, 1280px); margin: 0 auto; height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar .brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.topbar .brand:hover { text-decoration: none; }
.topbar .brand img { height: 26px; width: auto; }
.topbar .brand-txt { font-family: var(--display); font-weight: 700; font-size: .95rem; line-height: 1.25; }
.topbar .brand-txt small { display: block; font-family: var(--mono); font-weight: 400; font-size: .66rem; color: var(--faint); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.who { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; background: linear-gradient(135deg, var(--blue), var(--violet)); }
.who .n { font-size: .88rem; font-weight: 600; color: #fff; line-height: 1.2; }
.who .e { font-size: .72rem; color: var(--faint); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 42px; padding: .55em 1.2em; border-radius: 999px; font-family: var(--font); font-weight: 600; font-size: .88rem; cursor: pointer; border: 1px solid transparent; transition: transform .15s, box-shadow .2s, background .15s, border-color .15s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: linear-gradient(120deg, var(--blue), var(--violet)); color: #fff; box-shadow: 0 10px 26px -10px rgba(79, 124, 255, .65); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { background: rgba(255, 255, 255, .04); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, .09); }
.btn-danger { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .35); color: var(--danger); }
.btn-danger:hover { background: rgba(248, 113, 113, .2); }
.btn-sm { min-height: 34px; padding: .35em .9em; font-size: .8rem; }

/* ---------- layout ---------- */
.shell { width: min(100% - 32px, 1280px); margin: 0 auto; padding: 26px 0 70px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.flashes { display: grid; gap: 10px; margin-bottom: 18px; }
.flash { border-radius: 12px; padding: 11px 16px; font-size: .9rem; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.flash.ok { background: rgba(74, 222, 128, .1); border: 1px solid rgba(74, 222, 128, .32); color: #bbf7d0; }
.flash.error { background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .35); color: #fecaca; }
.flash a { color: inherit; font-weight: 600; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tabs a {
  display: inline-flex; align-items: center; gap: .5em;
  padding: 11px 16px; font-weight: 600; font-size: .92rem; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.tabs a:hover { color: #fff; text-decoration: none; }
.tabs a.on { color: #fff; border-bottom-color: var(--accent); }
.tabs .pill { font-family: var(--mono); font-size: .72rem; font-weight: 700; padding: .1em .55em; border-radius: 999px; background: var(--x-chip, rgba(111,155,255,.14)); border: 1px solid rgba(111,155,255,.4); color: #9fbcff; }
.tabs a.on .pill.hot { background: rgba(255, 154, 92, .16); border-color: rgba(255, 154, 92, .5); color: #ffc39e; }

/* ---------- cards / stats ---------- */
.card { background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015)); border: 1px solid var(--border); border-radius: 18px; padding: 20px; }
.card h3 { font-size: 1rem; margin-bottom: 14px; }
.grid-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { border-radius: 18px; padding: 18px 20px; background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015)); border: 1px solid var(--border); }
.stat .k { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.stat .v { font-family: var(--display); font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin-top: 4px; background: linear-gradient(120deg, #fff, #8fb0ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .s { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .grid-stats { grid-template-columns: repeat(2, 1fr); } .grid-2 { grid-template-columns: 1fr; } }
.grid-2 > *, .grid-stats > * { min-width: 0; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid var(--border); }
table.tbl { width: 100%; border-collapse: collapse; min-width: 720px; }
.tbl th { text-align: left; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 12px 16px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, .025); white-space: nowrap; }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: .9rem; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: rgba(255, 255, 255, .02); }
.tbl .name { font-weight: 650; color: #fff; }
.tbl .sub { color: var(--faint); font-size: .8rem; }
.tbl .actions { white-space: nowrap; text-align: right; }
.tbl .actions form { display: inline; }

.badge { display: inline-flex; align-items: center; gap: .4em; font-size: .74rem; font-weight: 700; padding: .22em .7em; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.badge.b-student { background: rgba(111, 155, 255, .12); border-color: rgba(111, 155, 255, .4); color: #9fbcff; }
.badge.b-company { background: rgba(255, 154, 92, .12); border-color: rgba(255, 154, 92, .45); color: #ffc39e; }
.badge.b-other { background: rgba(160, 139, 255, .12); border-color: rgba(160, 139, 255, .4); color: #c8baff; }
.badge.b-new { background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .45); color: #fcd34d; }
.badge.b-answered { background: rgba(74, 222, 128, .12); border-color: rgba(74, 222, 128, .4); color: #86efac; }
.badge.b-off { background: rgba(148, 163, 184, .12); border-color: rgba(148, 163, 184, .35); color: var(--muted); }
.badge.b-temp { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .4); color: #fca5a5; }

/* ---------- filters / misc ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.fchip { display: inline-flex; align-items: center; gap: .45em; font-size: .82rem; font-weight: 600; padding: .45em 1em; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--muted); background: rgba(255, 255, 255, .03); transition: all .15s; }
.fchip:hover { color: #fff; border-color: rgba(255, 255, 255, .4); text-decoration: none; }
.fchip.on { background: rgba(111, 155, 255, .14); border-color: rgba(111, 155, 255, .5); color: #cfe0ff; }
.empty { text-align: center; padding: 46px 20px; color: var(--faint); }
.empty .big { font-size: 2rem; margin-bottom: 8px; }

/* ---------- question list ---------- */
.q-list { display: grid; gap: 12px; }
.q-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: start; background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015)); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; }
.q-item.solo { grid-template-columns: 1fr; }
.q-item.answered { opacity: .62; }
.q-item.answered .q-text { text-decoration: line-through; text-decoration-color: rgba(148, 163, 184, .5); }
.q-num { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: .95rem; background: rgba(111, 155, 255, .14); border: 1px solid rgba(111, 155, 255, .4); color: #9fbcff; }
.q-item.answered .q-num { background: rgba(74, 222, 128, .1); border-color: rgba(74, 222, 128, .35); color: #86efac; }
.q-text { font-size: .98rem; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.q-meta { margin-top: 8px; display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--faint); }
.q-meta b { color: var(--muted); font-weight: 600; }
@media (max-width: 640px) { .q-item { grid-template-columns: 1fr; } .q-num { display: none; } }

/* ---------- forms (admin) ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: .86rem; color: #c9d4e8; }
.field .hint { font-size: .78rem; color: var(--faint); }
.field input, .field select {
  min-height: 46px; font-family: var(--font); font-size: .95rem; color: var(--text);
  background: rgba(255, 255, 255, .045); border: 1px solid var(--border-strong); border-radius: 12px;
  padding: .55em 1em; width: 100%;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(111, 155, 255, .16); }
.field input::placeholder { color: #5f6d84; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; position: relative; overflow: hidden; }
.auth-wrap .blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .4; pointer-events: none; }
.auth-wrap .b1 { width: 480px; height: 480px; left: -140px; top: -120px; background: #2f5fe6; }
.auth-wrap .b2 { width: 420px; height: 420px; right: -120px; bottom: -120px; background: #7a4df0; opacity: .35; }
.auth-card { position: relative; width: min(100%, 430px); background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02)); border: 1px solid var(--border-strong); border-radius: 24px; padding: clamp(26px, 5vw, 38px); backdrop-filter: blur(10px); box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .8); }
.auth-card .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-card .brand-txt { font-family: var(--display); font-weight: 700; font-size: .95rem; line-height: 1.25; }
.auth-card .brand-txt small { display: block; font-family: var(--mono); font-weight: 400; font-size: .66rem; color: var(--faint); }
.auth-card .brand img { height: 26px; width: auto; }
.auth-card h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: .9rem; margin-bottom: 22px; }
.auth-card .btn-primary { width: 100%; margin-top: 6px; min-height: 48px; font-size: .98rem; }
.auth-foot { margin-top: 20px; text-align: center; font-size: .8rem; color: var(--faint); }
.auth-foot a { color: var(--muted); }
.auth-foot a:hover { color: #fff; }

/* ---------- temp password reveal ---------- */
.temp-reveal { margin-bottom: 20px; border: 1px solid rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .08); border-radius: 16px; padding: 18px; }
.temp-reveal h3 { margin-bottom: 6px; color: #fcd34d; font-size: 1rem; }
.temp-reveal p { margin: 0 0 12px; font-size: .85rem; color: var(--muted); }
.temp-code { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.temp-code code { flex: 1; min-width: 200px; font-family: var(--mono); font-size: 1.05rem; font-weight: 700; letter-spacing: .08em; color: #fff; background: rgba(0, 0, 0, .4); border: 1px dashed rgba(251, 191, 36, .5); border-radius: 10px; padding: 10px 14px; }
.temp-code button { white-space: nowrap; }

/* ---------- mobile: topbar ---------- */
@media (max-width: 560px) {
  .topbar .brand-txt { font-size: .82rem; }
  .topbar .brand-txt small { display: none; }
  .who .e { display: none; }
  .topbar-right { gap: 10px; }
  .topbar .btn-ghost.btn-sm { min-height: 36px; padding: .4em .9em; font-size: .8rem; }
}
