:root {
  --navy: #1B2A4A; --navy2: #24375f; --gold: #C9A227; --gold2: #e6c65a; --cream: #F7F4EC; --paper: #fffdf8;
  --ink: #1d2330; --mute: #6b7280; --line: #e3dccb; --blue: #1F3864; --red: #C00000; --green: #1a7f37;
  --r: 10px; --sh: 0 1px 2px #0000000d, 0 4px 16px #1b2a4a12;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--cream); color: var(--ink); font-size: 15px; }
a { color: var(--navy2); }
button, input, select, textarea { font: inherit; }
input, select, textarea { border: 1px solid #d6cfbd; border-radius: 7px; padding: 7px 9px; background: #fff; color: var(--ink); max-width: 100%; }
textarea { width: 100%; font-family: Consolas, "Courier New", monospace; font-size: 13.5px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold2); border-color: var(--gold); }
label { display: block; font-size: 13px; color: #4b5162; margin: 6px 0; }
label > input:not([type=checkbox]):not([type=radio]), label > select, label > textarea { display: block; width: 100%; margin-top: 3px; }
label.tg { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; color: var(--ink); margin-right: 12px; }
code { background: #f1ece0; padding: 1px 5px; border-radius: 4px; font-size: .88em; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; color: var(--navy); }
h2 { font-size: 19px; margin: 0 0 10px; }
.hint { color: var(--mute); font-size: 13px; } .c { text-align: center; } .red { color: var(--red); } .green { color: var(--green); }
.sp { flex: 1; }

/* nút */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--navy); background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
.btn:hover { background: var(--navy2); } .btn:disabled { opacity: .55; cursor: default; }
.btn.gold { background: linear-gradient(180deg, #e2c25b, var(--gold)); border-color: #b08b1a; color: #1b1606; }
.btn.gold:hover { background: linear-gradient(180deg, #ecd06e, #d4ad31); }
.btn.ghost { background: #fff; color: var(--navy); border-color: #cfc6ae; } .btn.ghost:hover { background: #faf6ea; }
.btn.danger { color: var(--red); } .btn.sm { padding: 5px 10px; font-size: 13px; } .btn.block { width: 100%; justify-content: center; padding: 11px; margin-top: 8px; }
.ic { border: 1px solid #d9d1bc; background: #fff; border-radius: 6px; width: 30px; height: 28px; cursor: pointer; color: var(--navy); }
.ic:hover { background: #faf3dd; }

/* đầu trang */
#top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 8px 20px; background: linear-gradient(90deg, #14203a, var(--navy) 60%, #23365c); border-bottom: 3px solid var(--gold); color: #fff; box-shadow: 0 2px 10px #0003; }
.brand { display: flex; gap: 10px; align-items: center; color: #fff; text-decoration: none; }
.brand .logo { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--gold); color: var(--gold2); font: 26px Georgia, serif; background: #0f1a30; }
.brand b { display: block; font-family: Georgia, serif; font-size: 17px; color: #f6e3a1; letter-spacing: .2px; }
.brand small { display: block; font-size: 11.5px; color: #c6cfe4; }
#top nav { display: flex; gap: 4px; flex: 1; }
#top nav a { color: #e8ecf6; text-decoration: none; padding: 7px 12px; border-radius: 7px; font-weight: 600; font-size: 14px; }
#top nav a:hover { background: #ffffff14; } #top nav a.on { background: var(--gold); color: #1b1606; }
#top nav a.adm { border: 1px dashed #c9a22788; }
.badge { background: var(--gold); color: #1b1606; border-radius: 10px; padding: 0 7px; font-size: 12px; margin-left: 3px; }
#top nav a.on .badge { background: var(--navy); color: #fff; }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.who .plan { background: #ffffff1a; border: 1px solid #c9a22766; padding: 3px 9px; border-radius: 12px; color: #f6e3a1; } .who .plan.off { color: #ffb4b4; border-color: #ff8a8a88; }
.who .btn.ghost { background: transparent; color: #fff; border-color: #ffffff44; }
main { max-width: 1480px; margin: 0 auto; padding: 18px 20px 80px; }
.foot { text-align: center; color: var(--mute); font-size: 12.5px; padding: 18px; border-top: 1px solid var(--line); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh); margin-bottom: 14px; }
.card.warn { border-color: #e7c66a; background: #fff8e1; } .card.err { border-color: #f1a7a7; background: #fff0f0; color: var(--red); } .card.ok { border-color: #9bd3a8; background: #effaf1; }
.loading, .empty { color: var(--mute); padding: 24px; text-align: center; }

/* trang chủ */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: start; padding: 20px 0; }
.kicker { color: #9a7a12; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; font-size: 12.5px; }
.hero h1 { font-size: 36px; line-height: 1.2; margin: 8px 0 12px; } .hero h1 span { color: #9a7a12; }
.hero p { font-size: 16px; line-height: 1.6; color: #39404f; }
.stats { display: flex; gap: 12px; margin: 16px 0; flex-wrap: wrap; }
.stats div { background: var(--navy); color: #fff; border-radius: 10px; padding: 10px 16px; border-bottom: 3px solid var(--gold); min-width: 130px; }
.stats b { display: block; font-size: 24px; color: var(--gold2); font-family: Georgia, serif; } .stats span { font-size: 12.5px; color: #d4dbec; }
.feat { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.feat div { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; line-height: 1.45; color: #4b5162; }
.feat b { color: var(--navy); }
.auth { position: sticky; top: 80px; border-top: 4px solid var(--gold); }
.tabs { display: flex; gap: 4px; margin-bottom: 10px; } .tabs button { flex: 1; border: 0; background: #efe9d8; padding: 9px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--navy); }
.tabs button.on { background: var(--navy); color: #fff; }
.pricing h2 { text-align: center; font-size: 26px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.plan { text-align: center; border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #fff; border-top: 4px solid var(--navy); }
.plan h3 { margin: 0 0 6px; } .plan .price { font-size: 26px; font-weight: 800; color: #9a7a12; font-family: Georgia, serif; }
.plan ul { text-align: left; font-size: 13.5px; color: #4b5162; padding-left: 18px; }
.page-h h1 { margin: 4px 0; } .page-h p { color: var(--mute); }

/* cây phân dạng công khai */
.taxo details { margin: 3px 0; } .taxo summary { cursor: pointer; font-weight: 600; color: var(--navy); padding: 3px 0; }
.taxo .kho > summary { font-size: 18px; font-family: Georgia, serif; border-bottom: 2px solid var(--gold); padding: 6px 0; }
.taxo ul { list-style: none; padding-left: 18px; margin: 2px 0; } .taxo li.d { font-size: 14px; padding: 2px 0; color: #374151; }
.taxo em { color: #9a7a12; font-size: 12px; font-style: normal; background: #fbf3d6; padding: 0 5px; border-radius: 4px; }
.code { font-family: Consolas, monospace; font-size: 11.5px; color: #7a6a3a; background: #f3ecd9; border-radius: 4px; padding: 0 4px; margin-right: 6px; }
.ct { background: var(--navy); color: #fff; font-size: 11px; border-radius: 9px; padding: 0 6px; margin-left: 4px; font-weight: 600; }
.ct:empty { display: none; }

/* ngân hàng */
.bank { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.side { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; padding: 12px; }
.lop { display: flex; gap: 4px; margin-bottom: 8px; } .lop button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 6px; font-weight: 700; color: var(--navy); cursor: pointer; }
.lop button.on { background: var(--navy); color: var(--gold2); } .lop button:disabled { opacity: .45; cursor: not-allowed; }
.khos { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; border-bottom: 2px solid var(--gold); padding-bottom: 8px; }
.khos button { text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: 7px; cursor: pointer; font-weight: 600; color: #374151; display: flex; justify-content: space-between; }
.khos button span { color: var(--mute); font-weight: 500; font-size: 12.5px; } .khos button:hover { background: #f4efdf; }
.khos button.on { background: linear-gradient(90deg, var(--navy), var(--navy2)); color: #fff; } .khos button.on span { color: var(--gold2); }
.tree ul { list-style: none; margin: 0; padding-left: 12px; } .tree > ul { padding-left: 0; }
.tree a { display: flex; gap: 4px; align-items: baseline; padding: 4px 6px; border-radius: 6px; cursor: pointer; font-size: 13.5px; color: #2b3242; text-decoration: none; line-height: 1.35; }
.tree a i { margin-left: auto; font-style: normal; font-size: 11.5px; color: var(--mute); padding-left: 6px; }
.tree a:hover { background: #f4efdf; } .tree a.on { background: #fbf0c9; color: #1b1606; font-weight: 600; box-shadow: inset 3px 0 0 var(--gold); }
.tree a.empty { color: #9aa0ab; } .tree a.all { font-weight: 700; color: var(--navy); }
.tree summary { list-style: none; cursor: pointer; } .tree summary::-webkit-details-marker { display: none; }
.tree summary > a { font-weight: 600; } .tree details > summary > a::before { content: '▸'; color: var(--gold); margin-right: 2px; } .tree details[open] > summary > a::before { content: '▾'; }
.crumb { font-size: 13.5px; color: var(--mute); margin: 0 0 8px; } .crumb span { color: var(--navy); font-weight: 600; } .crumb b { margin: 0 6px; color: var(--gold); }
.muc { font-style: normal; background: #fbf3d6; color: #8a6d0f; padding: 1px 6px; border-radius: 5px; margin-left: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; position: sticky; top: 70px; z-index: 5; }
.filters #fQ { flex: 1; min-width: 180px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; } .chips button { border: 1px solid #d6cfbd; background: #fff; padding: 5px 10px; border-radius: 16px; cursor: pointer; font-size: 13px; font-weight: 600; color: #374151; }
.chips button i { font-style: normal; color: var(--mute); font-weight: 500; } .chips button.on { background: var(--navy); color: #fff; border-color: var(--navy); } .chips button.on i { color: var(--gold2); }
#fMuc button.on { background: var(--gold); color: #1b1606; border-color: #b08b1a; }

.qlist { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 1250px) { .qlist { grid-template-columns: 1fr; } }
.qc { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); display: flex; flex-direction: column; overflow: hidden; }
.qc header { display: flex; gap: 6px; align-items: center; background: linear-gradient(90deg, var(--navy), var(--navy2)); color: #fff; padding: 6px 10px; font-size: 12.5px; flex-wrap: wrap; }
.qc header b { color: var(--gold2); } .qc header .dn { flex: 1; min-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #dfe5f3; }
.qc header .src { color: #f6e3a1; font-size: 11.5px; } .usedtag { background: #fff3; padding: 0 6px; border-radius: 4px; font-size: 11px; }
.lo, .mu { padding: 1px 7px; border-radius: 10px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.lo { background: #e5ecfa; color: #1F3864; } .lo.DS { background: #e6f5ea; color: #1a6b33; } .lo.TLN { background: #fdf0de; color: #8a4b00; } .lo.TL { background: #f2e8fb; color: #5b2a86; }
.mu.m1 { background: #e8f5e9; color: #1b5e20; } .mu.m2 { background: #e3f2fd; color: #0d47a1; } .mu.m3 { background: #fff3e0; color: #b45309; } .mu.m4 { background: #fde8e8; color: #b91c1c; }
.qb { padding: 10px 14px; font-family: "Times New Roman", Times, serif; font-size: 16.5px; line-height: 1.5; text-align: justify; }
.qb p { margin: 0 0 4px; } .qb .c { text-align: center; } .qb .dmath { text-align: center; margin: 4px 0; overflow-x: auto; }
.qimg { max-width: 100%; vertical-align: middle; }
.opts { display: grid; gap: 2px 12px; margin-top: 4px; padding-left: 10px; } .opts.c4 { grid-template-columns: repeat(4, 1fr); } .opts.c2 { grid-template-columns: 1fr 1fr; }
.opt b, .st b { color: var(--blue); } .opt.right { background: #eaf7ec; border-radius: 5px; box-shadow: 0 0 0 1px #9bd3a8; }
.stmts { padding-left: 10px; margin-top: 4px; } .ds { font-size: 12px; font-family: system-ui; padding: 0 6px; border-radius: 4px; } .ds.d { background: #e6f5ea; color: var(--green); } .ds.s { background: #fde8e8; color: var(--red); }
.qtbl { border-collapse: collapse; margin: 6px auto; } .qtbl td, .qtbl th { border: 1px solid #5B7DB1; padding: 2px 8px; text-align: center; } .qtbl th { background: #DEEAF6; }
.sol { border-top: 1px dashed var(--gold); background: #fffbef; padding: 10px 14px; font-family: "Times New Roman", serif; font-size: 16px; line-height: 1.5; }
.slh { font-weight: 700; color: var(--navy); font-style: italic; margin-bottom: 4px; }
.buoc { font-weight: 700; color: #0070C0; } .ketluan { font-weight: 700; } .kl-line { color: var(--red); }
.al { font-weight: 700; color: var(--red); text-align: right; margin: 4px 0 0; } .lock { color: #8a6d0f; }
.qc footer { display: flex; gap: 6px; align-items: center; padding: 7px 10px; border-top: 1px solid #efe8d6; margin-top: auto; background: #fdfbf5; }
.fav { font-size: 16px; } .fav.on { color: #d4a00f; }
.pick.in { background: #1a7f37; border-color: #1a7f37; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 16px 0; color: var(--mute); }
.pager button { border: 1px solid #d6cfbd; background: #fff; padding: 6px 14px; border-radius: 7px; cursor: pointer; } .pager button:disabled { opacity: .4; }
#fab { position: fixed; right: 22px; bottom: 22px; z-index: 30; background: var(--navy); color: #fff; text-decoration: none; padding: 12px 18px; border-radius: 30px; box-shadow: 0 6px 20px #1b2a4a66; border: 2px solid var(--gold); font-weight: 600; }
#fab b { color: var(--gold2); font-size: 17px; } #fab span { display: block; font-size: 12px; color: #cfd8ea; font-weight: 500; }

/* soạn đề */
.paper { display: grid; grid-template-columns: minmax(560px, 640px) 1fr; gap: 16px; align-items: start; }
.pcol .card h2 { border-bottom: 2px solid var(--gold); padding-bottom: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; } .row3 { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 8px; } .row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 10px; }
.paper .row2 { grid-template-columns: 2fr 1fr 1fr; }
.tpl { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; } .tpl select { max-width: 260px; }
.mtxw { overflow-x: auto; } .mtx { width: 100%; border-collapse: collapse; font-size: 13px; } .mtx th { text-align: left; color: var(--mute); font-weight: 600; padding: 4px; border-bottom: 1px solid var(--line); }
.mtx td { padding: 4px; border-bottom: 1px solid #f1ebdb; vertical-align: middle; } .mtx select.np { width: 175px; } .mtx select.ml { width: 108px; } .mtx .mN { width: 56px; }
.mm { white-space: nowrap; } .mm label { display: inline-flex; gap: 2px; margin: 0 4px 0 0; font-size: 12px; align-items: center; }
.mact, .xrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.exp .xrow b { width: 48px; color: var(--navy); }
.ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; } .ph h2 span { font-family: system-ui; font-size: 14px; color: var(--mute); font-weight: 500; }
.ph3 { font-size: 15px; margin: 14px 0 6px; padding: 4px 10px; background: #f3ecd9; border-left: 4px solid var(--gold); border-radius: 4px; }
.pi { border: 1px solid #ece4cf; border-radius: 8px; margin-bottom: 8px; background: #fff; }
.pih { display: flex; gap: 6px; align-items: center; padding: 5px 8px; background: #faf6ea; border-bottom: 1px solid #ece4cf; font-size: 13px; }
.pih b { color: var(--navy); } .pih .dn { color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }
.pih .del { color: var(--red); }

/* tài khoản */
.acc { max-width: 1000px; margin: 0 auto; } .kv td { padding: 5px 12px 5px 0; vertical-align: top; } .kv td:first-child { color: var(--mute); white-space: nowrap; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; } .tbl th { text-align: left; background: #f3ecd9; color: var(--navy); padding: 7px 8px; } .tbl td { padding: 7px 8px; border-bottom: 1px solid #efe8d6; vertical-align: middle; }
.tbl input { width: 100%; } .st-pending { color: #b45309; font-weight: 600; } .st-paid { color: var(--green); } .st-cancel { color: var(--mute); }
.pay { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; } .pay img { width: 240px; border-radius: 8px; border: 1px solid var(--line); }

/* quản trị */
.atabs { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; } .atabs a { padding: 8px 14px; border-radius: 8px; background: #fff; border: 1px solid var(--line); text-decoration: none; font-weight: 600; color: var(--navy); }
.atabs a.on { background: var(--navy); color: var(--gold2); border-color: var(--navy); }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; } .kpis .card { text-align: center; } .kpis b { display: block; font-size: 26px; color: var(--navy); font-family: Georgia, serif; } .kpis span { color: var(--mute); font-size: 13px; }
.kpis .hot { border-color: var(--gold); background: #fff6d8; }
.emptyd { display: flex; flex-wrap: wrap; gap: 4px; } .emptyd span { font-family: Consolas, monospace; font-size: 11.5px; background: #f3ecd9; padding: 2px 6px; border-radius: 4px; color: #6b5a2a; }
.adm-t { background: var(--gold); color: #1b1606; font-size: 10.5px; padding: 0 5px; border-radius: 4px; font-weight: 700; }
.tadm, .tadm ul { list-style: none; padding-left: 18px; } .tadm { padding-left: 0; }
.tn { display: flex; gap: 6px; align-items: center; padding: 3px 0; border-bottom: 1px dotted #eee4cc; font-size: 14px; } .tn .nm { flex: 1; }
.tn em { font-style: normal; font-size: 12px; color: #8a6d0f; background: #fbf3d6; padding: 0 5px; border-radius: 4px; } .tn .ic { width: 26px; height: 24px; }
.imp { border: 1px solid #dcefe0; border-left: 4px solid var(--green); border-radius: 8px; margin: 8px 0; background: #fff; }
.imp.bad { border-color: #f3c4c4; border-left-color: var(--red); } .imh { padding: 6px 10px; background: #faf6ea; font-size: 13px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.wn { color: var(--red); font-size: 12.5px; } .imp details { padding: 4px 14px 10px; font-family: "Times New Roman", serif; }

/* hộp thoại */
.modal { position: fixed; inset: 0; z-index: 100; background: #0f172a88; display: grid; place-items: center; padding: 20px; }
.mbox { position: relative; background: var(--paper); border-radius: 12px; padding: 20px 22px; width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-top: 4px solid var(--gold); box-shadow: 0 20px 60px #0006; }
.mbox.wide { width: min(1280px, 100%); } .mbox h3 { margin-top: 0; }
.mx { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; font-size: 18px; cursor: pointer; color: var(--mute); }
.ed { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .edr { position: sticky; top: 0; align-self: start; } .edr .qc { margin-top: 4px; }
.pa4 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; } .pa4 label { display: flex; gap: 6px; align-items: center; margin: 2px 0; } .pa4 label span { white-space: nowrap; display: flex; gap: 4px; align-items: center; font-weight: 700; color: var(--navy); } .pa4 input.paI { flex: 1; }
.imgbar { display: flex; gap: 8px; }
#toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(30px); opacity: 0; background: var(--navy); color: #fff; padding: 11px 20px; border-radius: 9px; z-index: 200; transition: .25s; border-left: 5px solid var(--gold); box-shadow: 0 8px 30px #0005; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); } #toast.bad { border-left-color: #ff6b6b; }

@media (max-width: 1100px) { .bank, .paper, .hero, .ed { grid-template-columns: 1fr; } .side, .auth { position: static; max-height: none; } .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) {
  #top { flex-wrap: wrap; padding: 8px 12px; gap: 8px; position: static; } #top nav { order: 3; flex-basis: 100%; overflow-x: auto; } #top nav a { white-space: nowrap; } .filters { position: static; } .brand small { display: none; } .who .nm { display: none; }
  main { padding: 12px 10px 80px; } .hero h1 { font-size: 26px; } .feat, .row2, .row4, .paper .row2, .pa4 { grid-template-columns: 1fr; } .opts.c4 { grid-template-columns: 1fr 1fr; } .opts.c2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; } .mtx select.np { width: 150px; }
}
