/* Thiên Ân Education – giao diện hệ thống trắc nghiệm.
   Bố cục: dải đầu navy viền vàng như bìa tài liệu Thiên Ân; thân trang cột 1120px;
   bảng và thẻ nền trắng; vàng chỉ dùng làm điểm nhấn (logo, nút nộp bài, điểm số). */
:root {
  --bg: #F3F5FA;
  --surface: #FFFFFF;
  --surface-2: #F8F9FC;
  --ink: #16203A;
  --muted: #5A6580;
  --line: #DCE1EC;
  --band: #1B2A4E;
  --band-2: #24365F;
  --band-ink: #F4F1E8;
  --gold: #A87A06;
  --gold-bright: #E2B23C;
  --gold-soft: #FFF5DA;
  --accent: #1B2A4E;
  --on-accent: #FFFFFF;
  --accent-soft: #E7ECF7;
  --ok: #1D7A45;
  --ok-soft: #E2F3E9;
  --bad: #B3261E;
  --bad-soft: #FBE7E5;
  --warn: #8A5A00;
  --warn-soft: #FFF1D6;
  /* Một font duy nhất cho toàn trang: Be Vietnam Pro, thiết kế cho tiếng Việt, dấu rõ, dễ đọc trên điện thoại */
  --f-display: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
  --f-body: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
  --f-mono: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1322; --surface: #161F35; --surface-2: #1A2440; --ink: #E6EBF5; --muted: #9AA5BE; --line: #2A3552;
    --band: #0A1020; --band-2: #121B33; --band-ink: #EFEBDF; --gold: #E2B23C; --gold-bright: #E9BE52; --gold-soft: #2E2714;
    --accent: #9DB6F2; --on-accent: #0D1322; --accent-soft: #1F2A47;
    --ok: #5CC98A; --ok-soft: #12301F; --bad: #F08A80; --bad-soft: #3A1916; --warn: #F0C060; --warn-soft: #33270F;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 17px; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; text-wrap: balance; margin: 0; line-height: 1.3; letter-spacing: -0.01em; }
h1 { font-size: clamp(24px, 3.4vw, 30px); }
h2 { font-size: 21px; }
h3 { font-size: 18px; }
.mono { letter-spacing: .02em; font-weight: 600; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font-family: var(--f-mono); }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }

/* ---------- Dải đầu ---------- */
.band { background: var(--band); color: var(--band-ink); border-bottom: 3px solid var(--gold-bright); }
.band-in { display: flex; align-items: center; gap: 12px 20px; padding-block: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.logo { width: 44px; height: 44px; border-radius: 50%; border: 2.5px solid var(--gold-bright); display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 17px; color: var(--gold-bright); flex: none; }
.brand-t { display: flex; flex-direction: column; line-height: 1.3; }
.brand-t b { font-size: 13px; letter-spacing: .14em; }
.brand-t i { font-family: var(--f-display); color: var(--gold-bright); font-size: 14px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--band-ink); text-decoration: none; padding: 7px 12px; border-radius: 6px; font-size: 15px; opacity: .85; }
.nav a:hover { background: var(--band-2); opacity: 1; }
.nav a.on { background: var(--band-2); opacity: 1; box-shadow: inset 0 -2px 0 var(--gold-bright); }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; flex-wrap: wrap; }
.who .ten { font-weight: 600; }
.who .vt { font-size: 12px; padding: 2px 8px; border: 1px solid var(--gold-bright); color: var(--gold-bright); border-radius: 999px; }
.who a, .who button { color: var(--band-ink); background: none; border: 0; padding: 4px 6px; cursor: pointer; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; opacity: .85; }
.who form { margin: 0; }

main.main { padding-block: 28px 56px; flex: 1; }
footer.foot { padding-block: 18px 28px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- Thành phần chung ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .t { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 65ch; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; padding: 9px 18px; font-weight: 600; cursor: pointer; border: 1.5px solid var(--accent); background: var(--accent); color: var(--on-accent); min-height: 42px; text-decoration: none; font-size: 15px; white-space: nowrap; }
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.gold { background: var(--gold-bright); border-color: var(--gold-bright); color: #1B2A4E; }
.btn.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.sm { min-height: 34px; padding: 5px 12px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.linkbtn.danger { color: var(--bad); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; }
.panel { max-width: 640px; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.info { background: var(--accent-soft); color: var(--accent); }
.pill.mute { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-weight: 500; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.bad { background: var(--bad-soft); color: var(--bad); }

/* Biểu mẫu */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field label { font-weight: 600; font-size: 14px; }
.field .hint { font-size: 13px; color: var(--muted); }
.input, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea { border: 1.5px solid var(--line); border-radius: 8px; padding: 9px 12px; background: var(--surface); min-height: 42px; width: 100%; }
.field textarea { min-height: 180px; font-family: var(--f-mono); font-size: 14px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
.check { display: flex; gap: 8px; align-items: center; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.err { color: var(--bad); font-size: 14px; }
.field-validation-error { color: var(--bad); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* Thanh lọc */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .field { margin: 0; }
.filters .input, .filters select { min-height: 40px; }

/* Bảng */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table.tbl { border-collapse: collapse; width: 100%; font-size: 14px; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-variant-numeric: tabular-nums; }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl td.c, .tbl th.c { text-align: center; }
.tbl .nowrap { white-space: nowrap; }
.tbl .acts { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.tbl .acts form { margin: 0; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }

/* Ô số liệu */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat b { display: block; font-family: var(--f-display); font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat span { font-size: 13px; color: var(--muted); }

/* ---------- Đăng nhập ---------- */
.login { display: grid; grid-template-columns: 1.05fr 1fr; max-width: 920px; margin: 12px auto 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.login .side { background: var(--band); color: var(--band-ink); padding: 40px 36px; display: flex; flex-direction: column; gap: 18px; position: relative; overflow: hidden; }
.login .side::after { content: ""; position: absolute; right: -70px; bottom: -70px; width: 220px; height: 220px; border-radius: 50%; border: 2px solid var(--gold-bright); opacity: .35; }
.login .side .logo { width: 64px; height: 64px; font-size: 24px; }
.login .side h1 { font-size: 30px; color: var(--band-ink); }
.login .side .slogan { font-family: var(--f-display); font-style: italic; color: var(--gold-bright); font-size: 18px; }
.login .side ul { margin: 0; padding-left: 18px; opacity: .9; font-size: 15px; display: flex; flex-direction: column; gap: 6px; }
.login .form { padding: 40px 36px; }
.login .form h2 { margin-bottom: 4px; }
.login .form p.muted { margin: 0 0 22px; font-size: 15px; }
.pick { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.pick label { display: flex; gap: 10px; align-items: center; border: 1.5px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.pick label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 760px) { .login { grid-template-columns: 1fr; } .login .side { padding: 26px 22px; } .login .side ul { display: none; } .login .form { padding: 26px 22px; } }

/* ---------- Học sinh: danh sách bài ---------- */
.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.exam { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.exam .meta { display: flex; gap: 4px 14px; flex-wrap: wrap; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.exam .best { display: flex; align-items: baseline; gap: 8px; font-size: 14px; color: var(--muted); }
.exam .best b { font-family: var(--f-display); font-size: 22px; color: var(--ink); }
.exam .foot { margin-top: auto; padding-top: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.exam .foot form { margin: 0; }

/* ---------- Làm bài ---------- */
.qbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.qbar .wrap { display: flex; align-items: center; gap: 14px; padding-block: 10px; }
.qbar .t { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qbar .sub { font-size: 13px; color: var(--muted); font-weight: 400; }
.save { font-size: 13px; color: var(--muted); white-space: nowrap; }
.save.loi { color: var(--bad); font-weight: 600; }
.clock { font-family: var(--f-mono); font-weight: 700; font-size: 18px; padding: 4px 12px; border-radius: 8px; background: var(--accent-soft); font-variant-numeric: tabular-nums; }
.clock.warn { background: var(--bad-soft); color: var(--bad); }
.prog { height: 4px; background: var(--line); }
.prog i { display: block; height: 100%; width: 0; background: var(--gold-bright); transition: width .25s; }
.quiz { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 920px) { .quiz { grid-template-columns: minmax(0, 1fr) 270px; align-items: start; } .sheet { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 78px); } }
.qs { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; scroll-margin-top: 90px; }
.q .text { font-weight: 600; margin: 0 0 12px; }
.qn { font-family: var(--f-display); font-weight: 700; color: var(--gold); margin-right: 6px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: flex-start; gap: 12px; text-align: left; width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: transparent; cursor: pointer; min-height: 44px; }
button.opt:hover { border-color: var(--accent); }
.bub { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--muted); }
.opt .ot { padding-top: 2px; }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.opt[aria-pressed="true"] .bub { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.sheet h3 { font-family: var(--f-body); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.cells { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.cell { border: 1.5px solid var(--line); border-radius: 6px; background: transparent; padding: 4px 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.2; font-variant-numeric: tabular-nums; }
.cell small { font-size: 11px; color: var(--muted); }
.cell b { font-family: var(--f-mono); font-size: 14px; min-height: 1.2em; }
.cell.on { border-color: var(--accent); background: var(--accent-soft); }

.dlg { position: fixed; inset: 0; background: rgba(8, 12, 24, .55); display: grid; place-items: center; z-index: 20; padding: 16px; }
.dlg .box { background: var(--surface); border-radius: var(--r); padding: 22px; max-width: 440px; width: 100%; display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--line); }
.dlg p { margin: 0; }

/* ---------- Kết quả ---------- */
.rcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; max-width: 760px; }
.rcard .top { background: var(--band); color: var(--band-ink); padding: 16px 22px; display: flex; gap: 14px; align-items: center; }
.rcard .top b { display: block; font-size: 12px; letter-spacing: .14em; color: var(--gold-bright); }
.rcard .body { padding: 22px; display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
@media (max-width: 600px) { .rcard .body { grid-template-columns: 1fr; } }
.score { text-align: center; padding: 12px 24px; border: 3px solid var(--gold-bright); border-radius: 14px; }
.score b { display: block; font-family: var(--f-display); font-size: 56px; line-height: 1; font-variant-numeric: tabular-nums; }
.score span { font-size: 14px; color: var(--muted); }
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 15px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.review { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.rv { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--ok); border-radius: var(--r); padding: 14px 16px; }
.rv.sai { border-left-color: var(--bad); }
.rv.bo { border-left-color: var(--muted); }
.rv .head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.rv .head p { margin: 0; font-weight: 600; }
.rv .opt { cursor: default; }
.rv .opt.dung { border-color: var(--ok); background: var(--ok-soft); }
.rv .opt.dung .bub { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.rv .opt.chonsai { border-color: var(--bad); background: var(--bad-soft); }
.rv .opt.chonsai .bub { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.rv .why { margin-top: 10px; font-size: 14px; color: var(--muted); }

/* ---------- Thành phần thêm ở bản 1.1 ---------- */
.who .tdn { font-weight: 400; opacity: .75; }
.sp { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; display: flex; gap: 8px; align-items: center; }
.tabs a span { font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--gold-bright); }
.tabs a:hover { color: var(--ink); }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.choices { display: grid; gap: 8px; }
.choice { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin-top: 5px; accent-color: var(--accent); width: 17px; height: 17px; }
.choice span { display: flex; flex-direction: column; }
.choice small { color: var(--muted); font-size: 14px; }
.pick-list { max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.pick-hs { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick-hs:last-child { border-bottom: 0; }
.pick-hs:has(input:checked) { background: var(--accent-soft); }
.pick-hs input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
a.exam.doc { text-decoration: none; color: inherit; }
a.exam.doc:hover { border-color: var(--accent); }
.logo.sm { width: 34px; height: 34px; font-size: 13px; border-width: 2px; color: var(--gold); border-color: var(--gold); }

/* ---------- Logo (ảnh từ Cài đặt; link hỏng thì hiện chữ TA) ---------- */
.logo-o { width: 46px; height: 46px; flex: none; border-radius: 10px; background: #fff; display: grid; place-items: center; overflow: hidden; box-shadow: 0 0 0 2px var(--gold-bright); }
.logo-o img { width: 100%; height: 100%; object-fit: contain; }
.logo-o > span { display: none; font-weight: 700; color: #1B2A4E; }
.logo-o.hong img { display: none; }
.logo-o.hong > span { display: block; }
.logo-o.sm { width: 34px; height: 34px; border-radius: 8px; box-shadow: 0 0 0 1.5px #A87A06; }
.brand-xem { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: -4px 0 16px; border-radius: 10px; background: #1B2A4E; color: #F4F1E8; }
.brand-xem img { width: 52px; height: 52px; object-fit: contain; background: #fff; border-radius: 10px; }
.brand-xem div { display: flex; flex-direction: column; }
.brand-xem i { color: #E9BE52; }

/* ---------- Màn hình đăng nhập ----------
   Nền navy sâu như bìa tài liệu Thiên Ân, ánh vàng nhẹ của logo; khối giới thiệu bên trái, thẻ đăng nhập trắng bên phải. */
body.trang-dang-nhap {
  min-height: 100vh;
  /* Nền sáng với các khối lục giác navy – xanh – điểm vàng ở góc trên phải và dưới trái */
  background: #F2F6FC url("/img/nen-dang-nhap.svg") center / cover no-repeat fixed;
  color: #14264A;
  color-scheme: light;
}
.main-dn { flex: 1; display: grid; place-items: center; padding: 32px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.main-dn > .flash { max-width: 1000px; width: 100%; }
.foot-dn { text-align: center; font-size: 13px; color: #4A5875; padding: 0 16px 22px; }
.dn { width: 100%; max-width: 1000px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.dn-gioi-thieu { display: flex; flex-direction: column; gap: 22px; padding: 28px 30px; border-radius: 16px; background: rgba(255, 255, 255, .78); backdrop-filter: blur(4px); box-shadow: 0 10px 30px rgba(27, 42, 78, .10); }
.dn-thuong-hieu { display: flex; align-items: center; gap: 16px; }
.dn-logo { width: 84px; height: 84px; flex: none; border-radius: 18px; background: #fff; display: grid; place-items: center; overflow: hidden; box-shadow: 0 8px 22px rgba(27, 42, 78, .22), 0 0 0 3px rgba(226,178,60,.9); }
.dn-logo img { width: 100%; height: 100%; object-fit: contain; }
.dn-logo > span { display: none; font-size: 30px; font-weight: 700; color: #1B2A4E; }
.dn-logo.hong img { display: none; }
.dn-logo.hong > span { display: block; }
.dn-ten { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dn-ten b { font-size: clamp(20px, 2.3vw, 27px); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; white-space: nowrap; }
@media (max-width: 480px) { .dn-ten b { white-space: normal; } }
.dn-ten b { color: #1B2A4E; }
.dn-ten i { font-size: 18px; font-weight: 600; color: #A87A06; }
.dn-gioi-thieu h1 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; color: #1B2A4E; max-width: 22ch; line-height: 1.35; padding-top: 18px; border-top: 2px solid #E9BE52; }
.dn-y { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 16px; color: #2C3A58; }
.dn-y li { display: flex; gap: 12px; align-items: flex-start; }
.dn-y li span { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #E9BE52; background: #1B2A4E; margin-top: 1px; }
.dn-cam-ket { margin: 0; font-size: 14px; color: #5A6580; max-width: 46ch; }
.dn-the { background: #fff; color: #16203A; border-radius: 16px; padding: 34px 32px; box-shadow: 0 24px 60px rgba(4, 10, 25, .45); border-top: 4px solid #E2B23C; color-scheme: light; }
.dn-the h2 { font-size: 24px; margin-bottom: 4px; color: #1B2A4E; }
.dn-the .muted { color: #5A6580; }
.dn-the p.muted { margin: 0 0 22px; font-size: 15px; }
.dn-the .field label { color: #16203A; }
.dn-the .field input:not([type=checkbox]) { background: #fff; border-color: #DCE1EC; color: #16203A; }
.dn-the .field input:focus { border-color: #1B2A4E; }
.dn-the .check { color: #16203A; }
.dn-the .check input { accent-color: #1B2A4E; }
.dn-the .flash.bad { background: #FBE7E5; color: #B3261E; }
.dn-nut { width: 100%; background: #1B2A4E; border-color: #1B2A4E; color: #fff; min-height: 48px; font-size: 16px; }
.dn-nut:hover { background: #24365F; }
@media (max-width: 820px) {
  .dn { grid-template-columns: 1fr; gap: 26px; }
  .dn-gioi-thieu h1, .dn-y, .dn-cam-ket { display: none; }
  .dn-thuong-hieu { justify-content: center; }
  .dn-logo { width: 64px; height: 64px; border-radius: 14px; }
  .dn-the { padding: 26px 22px; }
}

/* Menu admin chia nhóm Giáo viên / Quản trị */
.band .wrap { max-width: 1400px; }
.nav-nhom { display: inline-flex; align-items: center; gap: 2px; flex-wrap: nowrap; white-space: nowrap; padding: 2px 4px; border-radius: 8px; }
@media (max-width: 700px) { .nav-nhom { flex-wrap: wrap; white-space: normal; } .nav-nhom + .nav-nhom { margin-left: 0; padding-left: 4px; border-left: 0; } }
.nav-nhom + .nav-nhom { margin-left: 6px; padding-left: 10px; border-left: 1px solid rgba(233, 190, 82, .45); }
.nav-nhan { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-bright); padding: 0 6px 0 2px; }
.nav-dem { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: #D93025; color: #fff; font-size: 12px; font-weight: 700; }

/* Cảnh báo dùng chung tài khoản */
.cb { border-left: 5px solid var(--tt-do); }
.cb.cb-cao { border-left-color: var(--bad); }
.cb-ly-do { margin: 10px 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.cb-cao .cb-ly-do { color: var(--bad); }
.cb .row form { margin: 0; }

/* Trang sửa đề */
.sua-cau { scroll-margin-top: 20px; }
.sua-cau:target { box-shadow: 0 0 0 3px var(--gold-bright); }
.sua-tx { min-height: 0 !important; font-family: var(--f-body) !important; font-size: 15px !important; }
.sua-pa { display: flex; flex-direction: column; gap: 8px; }
.sua-dong { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer; }
.sua-dong input[type=radio] { width: 18px; height: 18px; accent-color: var(--ok); flex: none; }
.sua-dong .input { flex: 1; min-width: 0; min-height: 38px; }
.sua-dong .opt-img { max-height: 80px; }
.sua-dong.dung { border-color: var(--ok); background: var(--ok-soft); }
.sua-dong.dung .bub { background: var(--ok); border-color: var(--ok); color: var(--surface); }

/* Trạng thái học tập: xám = chưa làm/chưa xem, cam = chưa hoàn thành, xanh lá = hoàn thành/đã xem */
:root { --tt-chua: #6B7385; --tt-chua-nen: #EEF0F4; --tt-do: #B45309; --tt-do-nen: #FFF1DC; --tt-xong: #1D7A45; --tt-xong-nen: #E2F3E9; }
@media (prefers-color-scheme: dark) { :root { --tt-chua: #A3ACBF; --tt-chua-nen: #232C44; --tt-do: #F5A54A; --tt-do-nen: #3A2812; --tt-xong: #5CC98A; --tt-xong-nen: #12301F; } }
.tt { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.tt::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tt.tt-chua { color: var(--tt-chua); background: var(--tt-chua-nen); }
.tt.tt-do { color: var(--tt-do); background: var(--tt-do-nen); }
.tt.tt-xong { color: var(--tt-xong); background: var(--tt-xong-nen); }
.exam.tt-chua { border-left: 5px solid var(--tt-chua); }
.exam.tt-do { border-left: 5px solid var(--tt-do); }
.exam.tt-xong { border-left: 5px solid var(--tt-xong); }
a.tt { text-decoration: none; }
a.tt:hover { filter: brightness(.95); outline: 1px solid currentColor; }
.tt-dong { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.xem-info { font-size: 14px; color: var(--muted); line-height: 1.6; }
.xem-info b { color: var(--ink); }
.dem-tt { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

/* Câu hỏi có hình: nền ảnh luôn trắng để nét vẽ kĩ thuật rõ cả khi máy để chế độ tối */
.q-img { display: block; max-width: min(100%, 380px); max-height: 300px; height: auto; margin: 0 0 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.opt-img { display: block; max-width: 100%; max-height: 130px; height: auto; background: #fff; border-radius: 6px; padding: 4px; }
.opts-hinh { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.opts-hinh .opt { align-items: center; }
.opts-hinh .ot { display: flex; flex-direction: column; gap: 4px; }

/* Phiếu tài khoản: 2 cột × 5 dòng trên A4 */
.slips { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.slip { background: #fff; color: #16203A; border: 1.5px dashed #9AA5BE; border-radius: 8px; padding: 12px 16px; break-inside: avoid; display: flex; flex-direction: column; gap: 4px; }
.slip-h { display: flex; gap: 10px; align-items: center; border-bottom: 1px solid #DCE1EC; padding-bottom: 6px; }
.slip-h b { display: block; font-size: 12px; letter-spacing: .12em; }
.slip-h i { font-size: 12px; color: #A87A06; }
.slip-ten { font-size: 18px; font-weight: 700; margin-top: 4px; }
.slip-lop { font-size: 13px; color: #5A6580; }
.slip dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 6px 0 0; font-size: 14px; }
.slip dt { color: #5A6580; }
.slip dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.slip dd.big { font-size: 18px; letter-spacing: .03em; }
.slip-note { font-size: 12px; color: #5A6580; margin-top: 4px; }
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; display: block; }
  .band, footer.foot, .no-print, .flash { display: none !important; }
  main.main { padding: 0; max-width: none; }
  .slips { grid-template-columns: 1fr 1fr; gap: 6mm; }
  .slip { height: 50mm; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
