/* ==========================================================================
   Thu phí sát hạch — trang tra cứu "/" và quản trị "/tp-admin" (mockup thu phí v3, 25/09/2026).
   Cùng bộ token với phần mềm quản lý thí sinh (assets/qlts-giao-dien.css): xanh navy, vạch vàng,
   có chế độ tối (theo hệ điều hành, hoặc data-theme="dark|light" trên <html>).
   Chỉ đổi giao diện — quy trình, nội dung, tên trường form giữ nguyên bản production.
   Góp ý 26/09: logo chuẩn (assets/qlts/logo*.png), hộp kết quả tra cứu làm lại cho điện thoại,
   /tp-admin/login luôn sáng + Turnstile; Portal học viên đã gỡ (bỏ CSS của Portal).
   ========================================================================== */

:root {
  --primary: #1e3a8a; --primary-hover: #1d4ed8; --primary-light: #eff6ff;
  --vang: #d8a820; --vang-dam: #8a6608; --vang-nhat: #fdf7e6;
  --bg: #f8fafc; --surface: #ffffff; --surface-2: #f1f5f9;
  --border: #cbd5e1; --border-light: #e2e8f0;
  --text: #1e293b; --text-2: #475569; --text-3: #64748b;
  --ok: #047857; --ok-bg: #f0fdf4; --ok-bd: #6ee7b7;
  --warn: #b45309; --warn-bg: #fffbeb; --warn-bd: #fcd34d;
  --err: #b91c1c; --err-bg: #fff1f2; --err-bd: #fca5a5;
  --info: #0369a1; --info-bg: #f0f9ff; --info-bd: #7dd3fc;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 0 0 1px rgba(15,23,42,.03);
  --shadow-lg: 0 16px 40px rgba(15,23,42,.18);
  --backdrop: rgba(15,23,42,.45);
  --hero-a: #eaf1fa; --hero-b: #ccdcef;
  --r: 8px; --r-lg: 12px; --k2: 8px; --k3: 12px; --k4: 16px; --k5: 24px; --k6: 32px; --cham: 40px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #5b9fd4; --primary-hover: #7eb3de; --primary-light: #1a2d42;
    --vang: #f0d060; --vang-dam: #f5dfa0; --vang-nhat: #3d3420;
    --bg: #0f1419; --surface: #1a222d; --surface-2: #151b24; --border: #2a3544; --border-light: #1f2834;
    --text: #f1f5f9; --text-2: #cbd5e1; --text-3: #94a3b8;
    --ok: #6ee7b7; --ok-bg: #022c22; --ok-bd: #047857; --warn: #fbbf24; --warn-bg: #3f2e0a; --warn-bd: #92400e;
    --err: #fca5a5; --err-bg: #450a0a; --err-bd: #b91c1c; --info: #7dd3fc; --info-bg: #082f49; --info-bd: #075985;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 16px 40px rgba(0,0,0,.5); --backdrop: rgba(0,0,0,.6);
    --hero-a: #121a24; --hero-b: #0f1419;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --primary: #5b9fd4; --primary-hover: #7eb3de; --primary-light: #1a2d42;
  --vang: #f0d060; --vang-dam: #f5dfa0; --vang-nhat: #3d3420;
  --bg: #0f1419; --surface: #1a222d; --surface-2: #151b24; --border: #2a3544; --border-light: #1f2834;
  --text: #f1f5f9; --text-2: #cbd5e1; --text-3: #94a3b8;
  --ok: #6ee7b7; --ok-bg: #022c22; --ok-bd: #047857; --warn: #fbbf24; --warn-bg: #3f2e0a; --warn-bd: #92400e;
  --err: #fca5a5; --err-bg: #450a0a; --err-bd: #b91c1c; --info: #7dd3fc; --info-bg: #082f49; --info-bd: #075985;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 16px 40px rgba(0,0,0,.5); --backdrop: rgba(0,0,0,.6);
  --hero-a: #121a24; --hero-b: #0f1419;
  color-scheme: dark;
}

/* ---------- nền ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--bg); color: var(--text); }
body { margin: 0; font-family: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif; font-size: 14px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--vang-dam); outline-offset: 2px; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn svg.i, .huy svg.i { width: 15px; height: 15px; }
.so { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ma { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; letter-spacing: .02em; }
.muted { color: var(--text-3); }
.nho-chu { font-size: 12.5px; }
.no { color: var(--err); font-weight: 600; }
.du { color: var(--ok); font-weight: 600; }
.canh { color: var(--warn); font-weight: 600; }
body.khoa-cuon { overflow: hidden; }
/* ô ẩn của WebForms (__VIEWSTATE…) không được chiếm một hàng trong lưới form */
.aspNetHidden { display: none; }

/* ---------- khối dùng chung ---------- */
.card { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card-h { display: flex; flex-wrap: wrap; align-items: center; gap: var(--k2); padding: var(--k3) var(--k4); border-bottom: 1px solid var(--border-light); }
.card-h h2 { font-size: 15px; font-weight: 600; flex: 1; min-width: 140px; }
.card-b { padding: var(--k4); }
.ngan-doc { display: grid; gap: var(--k3); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--cham); padding: 0 14px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-weight: 500; white-space: nowrap; font-size: 13.5px; text-decoration: none; line-height: 1.2; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.chinh { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.chinh:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn.nguy { color: var(--err); border-color: var(--err-bd); }
.btn.nguy:hover { background: var(--err-bg); color: var(--err); border-color: var(--err); }
.btn.nguy.dang-hoi { background: var(--err); border-color: var(--err); color: #fff; }
:root[data-theme="dark"] .btn.nguy.dang-hoi { color: #1a222d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.nguy.dang-hoi { color: #1a222d; } }
.btn.nho { height: 32px; padding: 0 10px; font-size: 12.5px; }
.btn[disabled], .btn.aspNetDisabled, .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.chinh[disabled]:hover, .btn.chinh:disabled:hover { background: var(--primary); border-color: var(--primary); }
.hang-nut { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hang-nut.nho { gap: 6px; }
.hang-nut.sat { gap: 4px; flex-wrap: nowrap; }
.hang-nut.phai { justify-content: flex-end; }

.input, .select { height: var(--cham); border: 1px solid var(--border); border-radius: var(--r); padding: 0 10px; background: var(--surface); width: 100%; min-width: 0; }
.input:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.input::placeholder { color: var(--text-3); opacity: 1; }
.select:disabled, .input:disabled { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; }
.field { display: grid; gap: 4px; min-width: 0; align-content: start; }
.field > label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field small { color: var(--text-3); font-size: 12px; }
/* Kiểm form trước khi gửi (28/09 — assets/thu-phi.js): ô sai viền đỏ, câu báo đỏ ngay dưới ô / nút. */
.input.sai-o, .input.sai-o:focus, .select.sai-o, .select.sai-o:focus { border-color: var(--err); box-shadow: 0 0 0 3px var(--err-bg); }
.loi-o, .field small.loi-o { display: block; color: var(--err); font-size: 12.5px; font-weight: 500; line-height: 1.4; }
.loi-o[hidden] { display: none; }
.hang-nut > .loi-o, .tb-nut > .loi-o { flex: 1 0 100%; }
.tb-nut:has(> .loi-o:not([hidden])) { flex-wrap: wrap; }
.turnstile-wrap + .loi-o { margin-top: -6px; text-align: center; }

.huy { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid; white-space: nowrap; vertical-align: middle; }
.huy.xanh { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-bd); }
.huy.vang { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-bd); }
.huy.do { color: var(--err); background: var(--err-bg); border-color: var(--err-bd); }
.huy.xam { color: var(--text-3); background: var(--surface-2); border-color: var(--border); }

/* Thông báo (Support.PullFlashHtml → .notice success|warn|error) — dạng "dải" của mockup. */
.notice { display: flex; gap: var(--k3); align-items: flex-start; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--info-bd); background: var(--info-bg); color: var(--info); font-size: 13px; line-height: 1.5; }
.notice::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 1px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l10 18H2z'/%3E%3Cpath d='M12 10v5M12 18v.01'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l10 18H2z'/%3E%3Cpath d='M12 10v5M12 18v.01'/%3E%3C/svg%3E") center / contain no-repeat; }
.notice.success { border-color: var(--ok-bd); background: var(--ok-bg); color: var(--ok); }
.notice.success::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E"); }
.notice.warn { border-color: var(--warn-bd); background: var(--warn-bg); color: var(--warn); }
.notice.error { border-color: var(--err-bd); background: var(--err-bg); color: var(--err); }
.notice a { color: inherit; font-weight: 600; }

/* Công tắc Thu phí / Đã đóng (ô ẩn "closed" + checkbox "published" giữ nguyên tên trường). */
.cong-tac { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; width: fit-content; }
.cong-tac input[type="checkbox"] { position: absolute; opacity: 0; width: 40px; height: 22px; margin: 0; cursor: pointer; left: 0; top: 50%; transform: translateY(-50%); }
.cong-tac span { width: 40px; height: 22px; border-radius: 11px; background: var(--border); position: relative; transition: background .15s; flex: none; }
.cong-tac span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.cong-tac input:checked + span { background: var(--ok); }
.cong-tac input:checked + span::after { left: 21px; }
.cong-tac input:focus-visible + span { outline: 2px solid var(--vang-dam); outline-offset: 2px; }
.cong-tac .bat { display: none; color: var(--ok); }
.cong-tac .tat { color: var(--text-3); }
.cong-tac input:checked ~ .bat { display: inline; }
.cong-tac input:checked ~ .tat { display: none; }

/* Ô ngày dd/mm/yyyy + lịch (assets/thu-phi.js) */
.o-ngay { position: relative; display: flex; }
.o-ngay .input { padding-right: 42px; font-variant-numeric: tabular-nums; }
.o-ngay button { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--text-3); display: grid; place-items: center; }
.o-ngay button:hover { background: var(--primary-light); color: var(--primary); }
.o-ngay.sai .input { border-color: var(--err); }
.o-ngay-hep { max-width: 220px; }
.lich { position: fixed; z-index: 90; width: 292px; background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 10px; display: grid; gap: 8px; }
.lich-h { display: flex; gap: 6px; }
.lich-h select { height: 32px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); flex: 1; min-width: 0; }
.lich-h button { width: 32px; height: 32px; border: 1px solid var(--border-light); background: var(--surface); border-radius: 6px; cursor: pointer; flex: none; }
.lich-luoi { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.lich-luoi span { font-size: 11px; color: var(--text-3); padding: 4px 0; font-weight: 600; }
.lich-luoi button { height: 34px; border: 0; background: none; border-radius: 6px; cursor: pointer; font-size: 13px; }
.lich-luoi button:hover { background: var(--primary-light); }
.lich-luoi button.ngoai { opacity: .45; }
.lich-luoi button.hom-nay { box-shadow: inset 0 0 0 1px var(--vang); }
.lich-luoi button[aria-selected="true"] { background: var(--primary); color: #fff; font-weight: 700; }
.lich-chan { display: flex; justify-content: space-between; gap: 8px; }
.lich-chan button { border: 0; background: none; color: var(--primary); cursor: pointer; font-size: 12.5px; font-weight: 600; padding: 4px 6px; border-radius: 6px; }
.lich-chan button:hover { background: var(--primary-light); }

/* ==========================================================================
   Logo chuẩn (assets/qlts/logo.png, logo-mark.png — chữ đen trên nền trong suốt).
   Chế độ tối: đặt logo lên một tấm sáng để chữ đen không chìm vào nền tối.
   ========================================================================== */
.logo-tp { display: inline-block; line-height: 0; text-decoration: none; flex: none; }
.logo-tp img { display: block; height: auto; max-width: 100%; }
:root[data-theme="dark"] .logo-tp img { background: #fff; border-radius: 10px; padding: 4px 8px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-tp img { background: #fff; border-radius: 10px; padding: 4px 8px; } }

/* ==========================================================================
   Trang tra cứu công khai "/" — người dùng chủ yếu dùng điện thoại.
   ========================================================================== */
.cong { min-height: 100vh; min-height: 100dvh; background: linear-gradient(180deg, var(--hero-a), var(--hero-b)); padding-inline: var(--k4); padding-block: calc(var(--k4) + env(safe-area-inset-top, 0px)) calc(var(--k6) + env(safe-area-inset-bottom, 0px)); overflow-x: hidden; }
.cong-top { max-width: 920px; margin: 0 auto var(--k5); display: flex; align-items: center; gap: var(--k3); }
.cong-top.hep { max-width: 560px; }
.cong-top small { display: block; font-size: 10.5px; letter-spacing: .1em; color: var(--text-3); text-transform: uppercase; }
.cong-top b { display: block; }
.cong-dau { justify-content: center; margin-bottom: var(--k4); }
.cong-logo img { width: 168px; aspect-ratio: 900 / 449; }
@media (min-width: 768px) { .cong-logo img { width: 196px; } .cong-dau { margin-bottom: var(--k5); } }
.cong-the { max-width: 920px; margin: 0 auto; display: grid; gap: var(--k4); }
.cong-the.hep { max-width: 560px; }
.tra-the { display: grid; gap: var(--k4); }
.tra-eyebrow { color: var(--text-3); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.tra-tieu-de { font-size: 24px; }

.buoc3 { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.buoc3 li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r); background: var(--surface-2); color: var(--text-3); font-size: 13px; font-weight: 500; min-width: 0; }
.buoc3 li span { min-width: 0; line-height: 1.3; }
.buoc3 li i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--border); font-size: 12px; font-weight: 700; flex: none; background: var(--surface); }
.buoc3 li.dang { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.buoc3 li.dang i { border-color: var(--primary); background: var(--primary); color: #fff; }
.buoc3 li.xong { color: var(--ok); }
.buoc3 li.xong i { border-color: var(--ok); background: var(--ok); color: #fff; }

.tra-luoi { display: grid; gap: var(--k3); }
.tra-luoi .field > label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.so-buoc { font-style: normal; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--primary-light); color: var(--primary); font-size: 11.5px; font-weight: 700; flex: none; }
.tra-luoi .input, .tra-luoi .select { height: 48px; font-size: 15px; }
.tra-luoi .input.cccd { font-size: 16px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.tra-loi:empty { display: none; }
/* Turnstile "flexible": rộng theo khung, tối thiểu 300px, cao 65px. */
.turnstile-wrap { min-height: 65px; width: 100%; max-width: 100%; }
.turnstile-wrap .cf-turnstile { width: 100%; }
.nut-tra-vo { position: relative; display: block; }
.nut-tra-vo > svg.i { position: absolute; left: calc(50% - 38px); top: 50%; transform: translateY(-50%); color: #fff; pointer-events: none; z-index: 1; }
.nut-tra { width: 100%; height: 48px; font-size: 16px; font-weight: 600; padding-left: 36px; }
.nut-tra-vo:has(.nut-tra[disabled]) > svg.i { opacity: .7; }
@media (max-width: 767px) {
  /* iOS Safari phóng to trang khi chạm vào ô có chữ < 16px. */
  .tra-luoi .input, .tra-luoi .select { font-size: 16px; }
}
@media (max-width: 400px) {
  /* 360px: 16 + 16 + viền mỗi bên chỉ còn ~294px — ô Turnstile cần 300px. */
  .cong { padding-inline: 10px; }
  .tra-the.card-b { padding: 14px; }
  .buoc3 li { padding: 8px 6px; gap: 6px; font-size: 12.5px; }
  .tra-tieu-de { font-size: 22px; }
}

/* ---------- Hộp kết quả tra cứu v4 (mockup thu phí v4, duyệt 27/09) ----------
   Điện thoại (< 720px): tấm trượt từ đáy — thông tin → lưu ý → mã QR → số tiền → Lưu ảnh QR; chân hộp có nút Đóng.
   Máy tính: hộp giữa màn, QR trái · thông tin phải, cao ~560px (vừa màn 1366×768 không cuộn); không chân hộp —
   đóng bằng ×, Esc hoặc bấm nền. Luôn sáng, kể cả khi mở từ /tp-admin đang để nền tối.
   Markup: App_Code/KetQuaTraCuu.cs. Khóa cuộn nền, lưu ảnh QR: assets/thu-phi.js. */
html.khoa-cuon, body.khoa-cuon { overflow: hidden; }
.kq-phu {
  --primary: #1e3a8a; --primary-hover: #1d4ed8; --primary-light: #eff6ff;
  --bg: #f8fafc; --surface: #ffffff; --surface-2: #f1f5f9; --border: #cbd5e1; --border-light: #e2e8f0;
  --text: #1e293b; --text-2: #475569; --text-3: #64748b;
  --ok: #047857; --ok-bg: #f0fdf4; --ok-bd: #6ee7b7; --warn: #b45309; --warn-bg: #fffbeb; --warn-bd: #fcd34d;
  --err: #b91c1c; --err-bg: #fff1f2; --err-bd: #fca5a5; --info: #0369a1; --info-bg: #f0f9ff; --info-bd: #7dd3fc;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 0 0 1px rgba(15,23,42,.03); --shadow-lg: 0 16px 40px rgba(15,23,42,.18);
  color-scheme: light; color: var(--text);
  position: fixed; inset: 0; z-index: 70; background: rgba(15,23,42,.5); display: flex; align-items: flex-end; justify-content: center;
  padding: max(10px, env(safe-area-inset-top, 0px)) 0 0;
}
.kq-nen { position: absolute; inset: 0; z-index: 0; }
.kq-hop { position: relative; z-index: 1; width: 100%; max-height: 100%; display: flex; flex-direction: column; background: var(--surface); border-radius: 16px 16px 0 0; box-shadow: var(--shadow-lg); overflow: hidden; animation: kq-len .2s ease-out; }
.kq-hop:focus { outline: none; }
.kq-h { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-top: 4px solid var(--primary); border-bottom: 1px solid var(--border-light); }
.kq-h > div { flex: 1; min-width: 0; display: grid; gap: 1px; }
.kq-nhan { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.kq-h h2 { font-size: 18px; font-weight: 700; line-height: 1.3; }
.kq-h .huy { flex: none; font-size: 12px; padding: 2px 9px; }
.kq-dong { flex: none; width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; color: var(--text-3); text-decoration: none; }
.kq-dong:hover { background: var(--primary-light); color: var(--primary); }
.kq-dong svg.i { width: 22px; height: 22px; }
.kq-b { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 16px; display: grid; gap: 16px; align-content: start; }
.kq-tt { display: grid; gap: 12px; align-content: start; min-width: 0; }
.kq-ten { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r); background: var(--primary-light); }
.kq-ten span { font-size: 13px; color: var(--text-2); }
.kq-ten b { font-size: 21px; font-weight: 800; letter-spacing: .01em; line-height: 1.3; color: var(--primary); overflow-wrap: anywhere; }
.kq-dl { margin: 0; border: 1px solid var(--border-light); border-radius: var(--r); }
.kq-dl > div { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 11px 14px; border-bottom: 1px solid var(--border-light); }
.kq-dl > div:last-child { border-bottom: 0; }
.kq-dl dt { font-size: 14px; color: var(--text-3); }
.kq-dl dd { margin: 0; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .01em; overflow-wrap: anywhere; }
.kq-dl dd.qh { color: var(--err); }
.kq-kiem { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--info-bd); background: var(--info-bg); font-size: 13.5px; line-height: 1.55; }
.kq-kiem > svg.i { width: 24px; height: 24px; color: var(--info); margin-top: 1px; }
.kq-kiem b { display: block; font-size: 14.5px; color: var(--info); margin-bottom: 2px; }
.kq-kiem.qh { border-color: var(--err-bd); background: var(--err-bg); }
.kq-kiem.qh > svg.i, .kq-kiem.qh b { color: var(--err); }
.kq-qr { display: grid; gap: 12px; justify-items: center; align-content: start; min-width: 0; padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--border-light); background: var(--surface-2); }
.kq-qr-nhan { font-size: 14px; font-weight: 600; color: var(--text-2); display: flex; gap: 6px; align-items: center; }
.kq-qr-nhan svg.i { width: 17px; height: 17px; }
.kq-qr .qr { width: min(100%, 320px); background: #fff; border-radius: 10px; padding: 10px; box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.kq-qr .qr img { display: block; width: 100%; height: auto; -webkit-touch-callout: default; }
.kq-tien { width: 100%; text-align: center; display: grid; gap: 2px; }
.kq-tien span { font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.kq-tien b { font-size: 32px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; color: var(--primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kq-tien b small { font-size: 16px; font-weight: 700; margin-left: 4px; }
.kq-luu { width: 100%; height: 46px; font-size: 15px; }
.kq-luu svg.i { width: 18px; height: 18px; }
.kq-khong-qr { width: 100%; }
.kq-f { flex: none; display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border-light); background: var(--surface-2); }
.kq-f .btn { flex: 1; height: 46px; font-size: 15px; font-weight: 600; }
@media (min-width: 720px) {
  .kq-phu { align-items: center; padding: 16px; }
  .kq-hop { max-width: 880px; border-radius: 16px; animation: none; }
  .kq-h { padding: 10px 12px 10px 22px; }
  .kq-h h2 { font-size: 19px; }
  .kq-b { grid-template-columns: 290px minmax(0, 1fr); gap: 22px; padding: 20px 22px 22px; }
  .kq-b > .kq-qr { order: -1; padding: 14px; gap: 10px; }
  .kq-qr .qr { width: 250px; }
  .kq-qr .qr img { max-height: 300px; object-fit: contain; }
  .kq-tien b { font-size: 28px; }
  .kq-luu { height: 42px; }
  .kq-dl > div { padding: 9px 14px; }
  .kq-f { display: none; }
}
@keyframes kq-len { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .kq-hop { animation: none; } }

/* Lưu ảnh QR khi máy không lưu thẳng được (iPhone không có bảng chia sẻ, trình duyệt trong Zalo / Facebook…):
   mở ảnh to toàn màn hình để nhấn giữ → "Lưu vào Ảnh" / "Tải hình ảnh xuống". */
.kq-xem { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: #0f172a; color: #f1f5f9; }
.kq-xem:focus { outline: none; }
.kq-xem-h { flex: none; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px 16px; }
.kq-xem-h b { flex: 1; min-width: 0; font-size: 16px; }
.kq-xem-h button { width: 44px; height: 44px; border: 0; border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; cursor: pointer; }
.kq-xem-h button svg.i { width: 22px; height: 22px; }
.kq-xem-anh { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px 16px; }
.kq-xem-anh img { display: block; max-width: min(100%, 440px); max-height: 100%; background: #fff; border-radius: 12px; padding: 10px; -webkit-touch-callout: default; -webkit-user-select: auto; user-select: auto; }
.kq-xem-hd { flex: none; display: grid; gap: 6px; padding: 14px 20px calc(18px + env(safe-area-inset-bottom, 0px)); text-align: center; font-size: 15px; line-height: 1.5; }
.kq-xem-hd b { color: #fde68a; }
.kq-xem-hd small { font-size: 13px; color: #cbd5e1; }
.tp-bao { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 95; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 10px; background: #1e293b; color: #fff; box-shadow: 0 16px 40px rgba(15,23,42,.25); font-size: 14px; line-height: 1.45; text-align: center; }

/* ==========================================================================
   Đăng nhập quản trị "/tp-admin/login" — luôn sáng (data-theme="light" ở AdminLogin.aspx).
   ========================================================================== */
.dang-nhap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: calc(var(--k4) + env(safe-area-inset-top, 0px)) var(--k4) calc(var(--k4) + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, var(--hero-a), var(--hero-b)); }
.login-the { width: 100%; max-width: 400px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: var(--k6) var(--k5); display: grid; gap: var(--k4); }
.login-dau { display: grid; justify-items: center; gap: 6px; text-align: center; }
.login-logo img { width: 128px; aspect-ratio: 602 / 562; height: auto; display: block; }
.login-cty { font-size: 15px; font-weight: 700; color: var(--text); margin-top: 2px; text-wrap: balance; }
.login-dau h1 { font-size: 18px; margin-top: var(--k2); }
.login-the .input { height: 44px; }
.login-nho { display: flex; gap: 8px; align-items: center; cursor: pointer; color: var(--text-2); min-height: 32px; }
.login-nho input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.login-nut { height: 44px; width: 100%; font-size: 14px; font-weight: 600; }
.ban-quyen { padding-top: var(--k3); border-top: 1px solid var(--border-light); text-align: center; font-size: 12px; color: var(--text-3); }
.ban-quyen span { display: inline-block; }
@media (max-width: 767px) {
  .login-the .input { font-size: 16px; }
  .login-logo img { width: 112px; }
}
@media (max-width: 400px) {
  .dang-nhap { padding-left: 10px; padding-right: 10px; }
  .login-the { padding: var(--k5) 14px; }
}

/* ==========================================================================
   Quản trị "/tp-admin" (mockup thu phí v4, duyệt 27/09) — khung giống phần mềm quản lý:
   thanh bên trái khi ≥ 1024px, thanh tab dưới trên điện thoại; bảng khi ≥ 768px, thẻ trên điện thoại.
   Hộp thoại (tạo / sửa khóa, xem trước nhập Excel) do máy chủ mở theo địa chỉ; hành vi ở assets/thu-phi.js.
   ========================================================================== */
body.tp-admin { --sidebar-bg: #eef1f5; --sidebar-text: #334155; --sidebar-muted: #64748b; --sidebar-hover: rgba(15,23,42,.06); }
:root[data-theme="dark"] body.tp-admin { --sidebar-bg: #121820; --sidebar-text: #a8b4c4; --sidebar-muted: #6b7788; --sidebar-hover: rgba(255,255,255,.06); }
.ad { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
.ad-sb { display: none; }
.ad-main { min-width: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.ad-tb { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: env(safe-area-inset-top, 0px) 12px 0; background: var(--surface); border-bottom: 1px solid var(--border-light); }
.ad-tb-mark img { display: block; width: 40px; height: auto; }
.ad-tb h1 { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-tb-tim { display: none; width: 300px; }
.khi-toi { display: none; }
:root[data-theme="dark"] .khi-sang { display: none; }
:root[data-theme="dark"] .khi-toi { display: contents; }
.btn-icon { width: 36px; height: 36px; flex: none; display: inline-grid; place-items: center; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text-3); cursor: pointer; text-decoration: none; }
.btn-icon:hover { background: var(--primary-light); color: var(--primary); }
.btn-icon svg.i { width: 20px; height: 20px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 2px 4px 2px 2px; }
.user-chip .av { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--vang-nhat); color: var(--vang-dam); font-size: 12px; font-weight: 700; }
.user-chip .who { display: none; line-height: 1.25; }
.user-chip .who b { display: block; font-size: 13px; }
.chong-bot { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.chong-bot svg.i { width: 12px; height: 12px; color: var(--warn); }
.chong-bot.bat svg.i { color: var(--ok); }
.ad-nd { flex: 1 0 auto; min-width: 0; padding: 12px 12px 16px; display: grid; gap: 12px; align-content: start; }
.ad-nd > form { min-width: 0; display: grid; gap: 12px; align-content: start; }
.flash { display: grid; gap: 8px; }
.flash:empty { display: none; }
.ad-tab { position: sticky; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-top: 1px solid var(--border-light); padding-bottom: env(safe-area-inset-bottom, 0px); }
.ad-tab a { display: grid; justify-items: center; gap: 2px; padding: 8px 4px 10px; font-size: 11.5px; color: var(--text-3); text-decoration: none; }
.ad-tab a svg.i { width: 20px; height: 20px; }
.ad-tab a[aria-current="page"] { color: var(--primary); font-weight: 600; }
.ad-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; margin-bottom: 2px; border-bottom: 1px solid var(--border-light); color: var(--text); text-decoration: none; }
.ad-mark { width: 42px; height: auto; flex: none; }
.ad-brand b { display: block; font-size: 14px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.ad-brand small { display: block; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--sidebar-muted); }
.ad-nav { display: grid; gap: 2px; }
.ad-nhom { padding: 12px 10px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--sidebar-muted); }
.ad-muc { position: relative; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 6px; color: var(--sidebar-text); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.ad-muc svg.i { width: 18px; height: 18px; }
.ad-muc:hover { background: var(--sidebar-hover); }
.ad-muc[aria-current="page"] { background: var(--surface); color: var(--primary); font-weight: 600; box-shadow: var(--shadow-sm); }
.ad-muc[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--vang); }
.ad-sb-chan { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border-light); }
@media (min-width: 768px) {
  .user-chip .who { display: grid; }
}
@media (min-width: 1024px) {
  .ad { grid-template-columns: 236px minmax(0, 1fr); }
  .ad-sb { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; background: var(--sidebar-bg); border-right: 1px solid var(--border-light); overflow-y: auto; }
  .ad-tab, .ad-tb-mark { display: none; }
  .ad-tb { min-height: 60px; padding: 0 20px; }
  .ad-tb-tim { display: block; }
  .ad-nd { padding: 20px 24px 24px; gap: 16px; }
  .ad-nd > form { gap: 16px; }
}

/* ---------- mảnh dùng chung ---------- */
.o-tim { position: relative; min-width: 0; }
.o-tim > svg.i { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.o-tim .input { height: 36px; padding-left: 34px; }
.chip-nhom { display: flex; flex-wrap: nowrap; gap: 6px; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip b { font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.tb-h { padding: 8px 12px; }
.tb-gon { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.tb-gon .o-tim { grid-column: 1; grid-row: 1; }
.tb-gon .tb-nut { grid-column: 2; grid-row: 1; display: flex; gap: 8px; }
.tb-gon .tb-loc { grid-column: 1 / -1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tb-gon .tb-loc::-webkit-scrollbar { display: none; }
.tb-gon .btn { height: 36px; }
.tb-nut .chu { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nut-excel svg.i { color: var(--ok); }
.stat-grid { display: grid; gap: var(--k3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { padding: 14px 16px; display: grid; gap: 2px; align-content: start; }
.stat > span { color: var(--text-3); font-size: 12.5px; }
.stat > b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat small { font-size: 12px; color: var(--warn); }
.dam { color: var(--text); }
.lien-ket { color: var(--primary); text-decoration: none; }
.lien-ket:hover { text-decoration: underline; }
.nhan-nho { color: var(--text-3); letter-spacing: .08em; text-transform: uppercase; font-size: 11px; font-weight: 600; }
.nhan-o { font-size: 13px; font-weight: 600; color: var(--text-2); }
.an-tep { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.an-tep:focus-visible + label { outline: 2px solid var(--vang-dam); outline-offset: 2px; }
label.btn { cursor: pointer; }
.o-trong { padding: 24px 16px; text-align: center; color: var(--text-3); }
.tbl td.o-trong { padding: 24px 12px; text-align: center; }

/* ---------- bảng / thẻ ---------- */
.bang-khung { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 12.5px; background: var(--surface-2); padding: 10px 12px; border-bottom: 1px solid var(--border-light); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--border-light); vertical-align: middle; background: var(--surface); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--primary-light); }
.tbl .r, .tbl th.r { text-align: right; }
.tbl .c, .tbl th.c { text-align: center; }
.tbl td.ten { font-weight: 600; white-space: nowrap; }
.tbl td.nw { white-space: nowrap; }
.tbl tr.trung td { background: var(--warn-bg); }
.tbl tr.loi td { background: var(--err-bg); }
.khung-vien { border: 1px solid var(--border-light); border-radius: var(--r); }
.chi-bang { display: none; }
.the-ds { display: grid; }
.the-dong { display: grid; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border-light); }
.the-dong:last-child { border-bottom: 0; }
.the-dau { display: flex; align-items: center; gap: 8px; }
.the-dau > a, .the-dau > b { flex: 1; min-width: 0; }
.the-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 13px; }
.the-meta span { display: block; font-size: 11.5px; color: var(--text-3); }
.the-meta .rong { grid-column: 1 / -1; }
.the-nhan { display: flex; flex-wrap: wrap; gap: 4px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border-light); font-size: 12.5px; color: var(--text-3); }
.pager b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- nút ⋯ và menu thao tác ---------- */
.tt { display: inline-flex; }
.nut-tt { width: 32px; height: 32px; flex: none; display: inline-grid; place-items: center; border: 1px solid var(--border-light); border-radius: 6px; background: var(--surface); color: var(--text-2); cursor: pointer; }
.nut-tt:hover, .nut-tt[aria-expanded="true"] { border-color: var(--primary); color: var(--primary); }
.menu-tt { position: fixed; z-index: 60; min-width: 200px; display: grid; padding: 4px; background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--r); box-shadow: var(--shadow-lg); }
.menu-tt a, .menu-tt button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: none; color: var(--text); font-size: 13.5px; text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer; }
.menu-tt a:hover, .menu-tt button:hover, .menu-tt a:focus-visible, .menu-tt button:focus-visible { background: var(--primary-light); color: var(--primary); outline: none; }
.menu-tt svg.i { width: 16px; height: 16px; }
.menu-tt .nguy, .menu-tt .nguy:hover { color: var(--err); }
.menu-tt .nguy:hover { background: var(--err-bg); }
.menu-tt .nguy.dang-hoi { background: var(--err); color: #fff; font-weight: 600; }
.menu-tt hr { margin: 4px 0; border: 0; border-top: 1px solid var(--border-light); }

/* ---------- thu phí của một khóa ---------- */
.khoa-h { gap: 12px; }
.khoa-dau { flex: 1; min-width: 200px; display: grid; gap: 4px; }
.khoa-dau h2 { font-size: 18px; font-weight: 700; }
.phi-luoi { display: grid; gap: var(--k3); grid-template-columns: minmax(0, 1fr); }
.the-phi { min-width: 0; padding: var(--k4); display: grid; gap: var(--k3); align-content: start; border-top: 3px solid var(--border); }
.the-phi.mo { border-top-color: var(--ok); }
.the-phi-dau { display: flex; gap: 8px; align-items: flex-start; }
.the-phi-dau > div { flex: 1; min-width: 0; }
.the-phi-dau > .tt { flex: none; }
.the-phi h3 { font-size: 15.5px; font-weight: 700; }
.so3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.so3 div { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.so3 span { display: block; font-size: 11.5px; color: var(--text-3); }
.so3 b { font-size: 18px; font-variant-numeric: tabular-nums; }
.so3 b.thieu { color: var(--warn); }

/* ---------- thí sinh ---------- */
.ts-h { gap: 10px; }
.ts-khoa { width: 100%; height: 36px; }
.ts-b { display: grid; gap: 12px; border-bottom: 1px solid var(--border-light); }
.phi-seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.phi-seg::-webkit-scrollbar { display: none; }
.phi-seg a { flex: none; display: grid; gap: 1px; padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--text); text-decoration: none; }
.phi-seg a b { font-size: 13px; }
.phi-seg a span { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.phi-seg a:hover { border-color: var(--primary); }
.phi-seg a[aria-current] { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; background: var(--primary-light); }

/* ---------- hộp thoại ---------- */
.phu-hop { position: fixed; inset: 0; z-index: 65; display: flex; align-items: flex-end; justify-content: center; padding-top: max(10px, env(safe-area-inset-top, 0px)); background: var(--backdrop); }
.hop { width: 100%; max-height: 100%; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border-radius: 16px 16px 0 0; box-shadow: var(--shadow-lg); }
.hop:focus { outline: none; }
.hop-h { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--border-light); }
.hop-h h2 { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; }
.hop-b { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: grid; gap: 14px; align-content: start; }
.hop-f { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border-light); background: var(--surface-2); }
.nhap-tt { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 16px; }
.nhap-tt span { display: block; font-size: 12px; color: var(--text-3); }
.nhap-tt b { overflow-wrap: anywhere; }
.tong-nhap { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tong-nhap div { padding: 10px 12px; border: 1px solid; border-radius: var(--r); }
.tong-nhap b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.tong-nhap span { font-size: 12px; }
.tong-nhap .a { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-bd); }
.tong-nhap .b { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-bd); }
.tong-nhap .c { color: var(--err); background: var(--err-bg); border-color: var(--err-bd); }
.tong-nhap .d { color: var(--text-2); background: var(--surface-2); border-color: var(--border); }

@media (min-width: 768px) {
  .tb-gon { display: flex; flex-wrap: nowrap; }
  .tb-gon .o-tim { flex: 1 1 220px; max-width: 320px; }
  .tb-gon .tb-loc { overflow: visible; }
  .tb-gon .tb-nut { margin-left: auto; }
  .tb-nut .chu { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .chi-bang { display: block; }
  .chi-the { display: none; }
  .ts-khoa { width: auto; max-width: 340px; }
  .tong-nhap { grid-template-columns: repeat(4, 1fr); }
  .phu-hop { align-items: center; padding: 24px; }
  .hop { max-width: 560px; border-radius: 14px; }
  .hop.rong { max-width: 920px; }
}
@media (min-width: 1024px) {
  .phi-luoi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.card > .bang-khung:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* =====================================================================
   Góp ý 26/09 (lần 3) — trang tra cứu theo khung trang chuẩn: đầu trang dính trên (chỉ logo — v4 27/09 bỏ Trang chủ),
   thẻ tra cứu ở giữa vùng còn lại, chân trang ghi tên công ty. Luôn nền sáng.
   ===================================================================== */
.tp-cong .cong { display: flex; flex-direction: column; padding: 0; }
.cong-dau-trang { position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top, 0px); background: rgba(255, 255, 255, .88); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid rgba(15, 23, 42, .07); box-shadow: 0 1px 2px rgba(15, 23, 42, .03); }
.cong-dau-trong { max-width: 920px; height: 68px; margin: 0 auto; padding: 0 var(--k4); display: flex; align-items: center; justify-content: space-between; gap: var(--k3); }
.cong-hieu img { width: auto; height: 64px; aspect-ratio: 602 / 562; }
.cong-giua { flex: 1 0 auto; width: 100%; display: flex; flex-direction: column; justify-content: center; padding: var(--k6) var(--k4); }
.cong-giua > .cong-the { width: 100%; }
.cong-chan { padding: var(--k4) var(--k4) calc(var(--k4) + env(safe-area-inset-bottom, 0px)); text-align: center; font-size: 12.5px; color: var(--text-3); border-top: 1px solid rgba(15, 23, 42, .06); background: rgba(255, 255, 255, .45); }
@media (max-width: 767px) {
  .cong-dau-trong { height: 60px; padding: 0 12px; }
  .cong-hieu img { height: 56px; }
  .cong-giua { justify-content: flex-start; padding: var(--k4) 12px var(--k5); }
  .cong-chan { font-size: 12px; padding-inline: 12px; }
}
@media (max-width: 400px) {
  .cong-giua { padding-inline: 10px; }
}
.tra-dau { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border-light); }
.tra-dau-chu { min-width: 0; display: grid; gap: 2px; }
.tra-dau .tra-eyebrow { font-size: 12px; letter-spacing: .06em; }
/* Tên công ty: màn nhỏ viết gọn "CTY TNHH ĐTLX THUẬN PHÁT" trên một dòng (26/09). */
.tra-eyebrow .cty-ngan { display: none; }
@media (max-width: 767px) {
  .tra-eyebrow .cty-dai { display: none; }
  .tra-eyebrow .cty-ngan { display: inline; }
  .tra-dau .tra-eyebrow { white-space: nowrap; letter-spacing: .03em; }
}
.tra-dau .tra-tieu-de { font-size: 22px; line-height: 1.25; }
@media (min-width: 768px) {
  .tra-dau .tra-tieu-de { font-size: 26px; }
}
@media (max-width: 420px) {
  .tra-dau { justify-content: center; text-align: center; }
  .tra-dau .tra-tieu-de { font-size: 21px; }
}
.tp-cong .logo-tp img { background: none; padding: 0; }

/* =====================================================================
   Góp ý 28/09 — màn tra cứu không có thanh cuộn trên máy tính. Trang cao 744px (đầu 69 · giữa 32 + 559 + 32 · chân 52,
   tính cả ô Cloudflare 65px) nên laptop 1366×768 (khung nhìn ~650px) và 1536×864 ở 125% (~730px) phải cuộn. Màn máy
   tính thấp: gọn đầu / chân trang, khoảng cách và ô nhập (633px, còn dải 3 bước); khung nhìn dưới 633px mới bỏ dải 3 bước
   (nhãn ô đã đánh số 1-2-3).
   ===================================================================== */
@media (min-width: 768px) and (max-height: 860px) {
  .cong-dau-trong { height: 56px; }
  .cong-hieu img { height: 52px; }
  .cong-giua { padding-top: 12px; padding-bottom: 12px; }
  .cong-chan { padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .tra-the { gap: 12px; }
  .tra-dau { padding-bottom: 10px; }
  .tra-dau .tra-tieu-de { font-size: 22px; }
  .tra-luoi { gap: 10px; }
  .tra-luoi .input, .tra-luoi .select { height: 44px; }
  .buoc3 li { padding-top: 5px; padding-bottom: 5px; }
  .nut-tra { height: 44px; }
}
@media (min-width: 768px) and (max-height: 632px) {
  .buoc3 { display: none; }
  .cong-giua { padding-top: 8px; padding-bottom: 8px; }
}
/* Hộp kết quả: ảnh QR co theo chiều cao màn để cả hộp vừa khung nhìn; màn thấp gọn khoảng cách dòng. */
@media (min-width: 720px) {
  .kq-qr .qr img { max-height: min(300px, calc(100vh - 340px)); max-height: min(300px, calc(100dvh - 340px)); }
}
@media (min-width: 720px) and (max-height: 700px) {
  .kq-phu { padding: 8px 16px; }
  .kq-b { padding-top: 14px; padding-bottom: 14px; gap: 18px; }
  .kq-tt { gap: 10px; }
  .kq-ten { padding: 8px 14px; }
  .kq-dl > div { padding: 7px 14px; }
  .kq-kiem { padding: 9px 12px; }
  .kq-b > .kq-qr { gap: 8px; }
}
