/* =====================================================================
   BRAND v2 – chuẩn hóa theo bộ 36 mockup + Brand Guidelines HVCDT 01/2026
   navy #2A398B · kem #FFFDE9 · đỏ cam #F04123 · đỏ rượu #9E2024 · gradient #FCEE21→#E62327
   Nạp sau app.css để ghi đè thành phần dùng chung.
   ===================================================================== */
:root {
  --navy: #2a398b; --navy-ink: #1d2a6b; --navy-soft: #eceffa; --navy-tint: #eef0f7;
  --orange: #f04123; --orange-2: #d63414; --orange-soft: #fdeae5; --wine: #9e2024; --wine-soft: #f9e4e4;
  --cream: #fffde9; --bg: #fffde9; --grad: linear-gradient(90deg, #fcee21 0%, #f9b51c 30%, #f04123 70%, #e62327 100%);
  --line: #ece8d4; --line-2: #f2efe2; --text: #1d2340; --radius: 14px;
  --shadow: 0 1px 2px rgba(42, 57, 139, .06), 0 4px 14px rgba(42, 57, 139, .05);
}
body { background: var(--cream); }
[hidden] { display: none !important; }

/* ---------- Thanh điều hướng ---------- */
.shell { grid-template-columns: 236px 1fr; }
.side { padding: 22px 14px 14px; background: var(--navy); }
.brand { display: block; padding: 0 8px 22px; }
.brand b { font-size: 30px; letter-spacing: -.6px; line-height: 1; }
.brand small { display: block; font-size: 14px; font-weight: 600; margin-top: 6px; opacity: 1; }
.gbar { display: block; height: 5px; border-radius: 3px; background: var(--grad); margin-top: 10px; }
.nav a { font-size: 15px; padding: 10px 12px; gap: 12px; border-radius: 10px; }
.nav a.on { background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.nav details { margin-top: 6px; }
.nav details summary { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; opacity: .72; padding: 12px 12px 6px; font-weight: 700; }
.nav details summary::after { content: '▾'; font-size: 12px; }
.nav details:not([open]) summary::after { content: '▸'; }
.side-search { position: relative; margin: 0 4px 14px; }
.side-search input { width: 100%; height: 36px; border-radius: 9px; border: 0; background: rgba(255, 255, 255, .12); color: #fff; padding: 0 10px 0 34px; font-size: 13px; }
.side-search input::placeholder { color: rgba(255, 255, 255, .72); }
.side-search > svg { position: absolute; left: 10px; top: 9px; width: 17px; height: 17px; color: rgba(255, 255, 255, .85); }
.side-search .pop { left: 0; width: 340px; top: 40px; color: var(--text); }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 12px 6px 2px; border-top: 1px solid rgba(255, 255, 255, .14); }
.side-user .avatar { width: 36px; height: 36px; background: rgba(255, 255, 255, .16); color: #fff; font-size: 13px; }
.side-user .who2 { flex: 1; min-width: 0; line-height: 1.25; background: none; border: 0; color: #fff; text-align: left; cursor: pointer; padding: 0; }
.side-user .who2 b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who2 small { opacity: .75; font-size: 12px; }
.side-user .ib { background: none; border: 0; color: #fff; cursor: pointer; padding: 6px; border-radius: 8px; position: relative; }
.side-user .ib:hover { background: rgba(255, 255, 255, .1); }
.side-user .ib svg { width: 20px; height: 20px; }
.side-user .dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: #fcee21; }
.mtop { display: none; }
.content { padding: 28px 30px 48px; }

/* ---------- Tiêu đề trang ---------- */
.ph { align-items: center; }
.ph h1 { font-size: 36px; font-weight: 800; color: var(--navy-ink); letter-spacing: -.8px; }
.ph p { color: #555d78; }
.crumb b, .crumb a:hover { color: var(--navy); }
.back { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: var(--navy-ink); margin-right: 4px; }
.back:hover { background: var(--navy-soft); text-decoration: none; }
.back svg { width: 24px; height: 24px; }
h2, h3 { color: var(--navy-ink); }

/* ---------- Thẻ ---------- */
.card { border-radius: var(--radius); border-color: var(--line); box-shadow: var(--shadow); }
.card-h { border-bottom: 0; padding: 18px 20px 8px; }
.card-h h2 { font-size: 19px; }
.card.hl { background: #fff4f1; border-color: #f7cfc4; }
.card.hl-navy { background: var(--navy-soft); border-color: #d9def3; }

/* ---------- Nút ---------- */
.btn { border-radius: 9px; height: 42px; font-weight: 600; border-color: #cfd4e2; color: var(--navy-ink); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; box-shadow: 0 2px 6px rgba(240, 65, 35, .25); }
.btn.primary:hover { background: var(--orange-2); }
.btn.outline { border-color: var(--orange); color: var(--orange); background: #fff; }
.btn.outline:hover { background: #fff5f2; }
.btn.wine { background: var(--wine); border-color: var(--wine); color: #fff; }
.btn.wine:hover { background: #861a1e; }
.btn.danger { color: var(--wine); border-color: #e9b9ba; }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.sm { height: 32px; border-radius: 8px; }
.link { color: var(--wine); }

/* ---------- Nhãn trạng thái dạng viên ---------- */
.tag { border-radius: 999px; padding: 3px 12px; font-size: 12.5px; }
.tag.red { background: #fde4e3; color: #b42318; } .tag.green { background: #e1f5e6; color: #157a35; } .tag.yellow { background: #fff2cc; color: #8a5a00; }
.tag.blue { background: #e2ebff; color: #2350c7; } .tag.orange { background: #ffe9df; color: #c2410c; } .tag.gray { background: #eceef3; color: #4b5470; }
.tag.navy { background: var(--navy-soft); color: var(--navy); } .tag.wine { background: var(--wine-soft); color: var(--wine); } .tag.purple { background: #efe8ff; color: #6a3fd1; }

/* ---------- Tab ---------- */
.tabs { border-bottom: 1px solid var(--line); }
.tabs a, .tabs button { color: var(--navy-ink); font-size: 15.5px; font-weight: 600; padding: 10px 16px 12px; }
.tabs .on { color: var(--orange); border-bottom-color: var(--orange); }
.seg { display: inline-flex; border: 1px solid #d9dceb; border-radius: 10px; background: #fff; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a, .seg button { border: 0; background: none; padding: 8px 18px; border-radius: 8px; font-weight: 600; color: var(--navy-ink); cursor: pointer; font-size: 14px; }
.seg a:hover { text-decoration: none; background: #f6f6f0; }
.seg .on, .seg a.on:hover { background: var(--orange); color: #fff; box-shadow: 0 2px 6px rgba(240, 65, 35, .25); }
.seg.boxed { display: flex; width: 100%; padding: 0; border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.seg.boxed a { flex: 1; text-align: center; border-radius: 0; border-left: 1px solid #e4e6f0; padding: 11px; }
.seg.boxed a:first-child { border-left: 0; }
.pilltabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pilltabs a { padding: 9px 22px; border-radius: 10px; border: 1px solid #d9dceb; background: #fff; font-weight: 600; color: var(--navy-ink); }
.pilltabs a:hover { text-decoration: none; border-color: var(--orange); }
.pilltabs a.on { border-color: var(--orange); color: var(--orange); background: #fff5f2; box-shadow: inset 0 0 0 1px var(--orange); }

/* ---------- Bảng ---------- */
.tbl th { background: var(--navy-tint); color: var(--navy-ink); font-weight: 700; border-bottom: 0; }
.tbl thead tr th:first-child { border-top-left-radius: 10px; } .tbl thead tr th:last-child { border-top-right-radius: 10px; }
.tbl td { border-bottom: 1px solid #eeece2; }
.tbl tbody tr.sel, .tbl tbody tr.sel:hover { background: #fdeeea !important; }
.tbl tfoot td, .tbl tr.total td { background: #fbe8e6; color: var(--wine); font-weight: 800; font-size: 14.5px; }
.card > .tbl-wrap { padding: 4px 14px 12px; }
.card > .empty { margin: 0 14px 12px; }

/* ---------- KPI ---------- */
.kpi { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: var(--radius); }
.kpi > div { min-width: 0; }
.kpi .ic { width: 50px; height: 50px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.kpi .ic svg { width: 26px; height: 26px; color: inherit; }
.ic.c-blue { background: #e7edff; color: #3456d1; } .ic.c-purple { background: #efe8ff; color: #6a3fd1; } .ic.c-green { background: #e2f5e7; color: #188a3d; }
.ic.c-red { background: #fde5e2; color: #e0452b; } .ic.c-yellow { background: #fff3d1; color: #c17a00; } .ic.c-navy { background: var(--navy-soft); color: var(--navy); }
.kpi .v { margin: 0; font-size: 30px; color: var(--navy-ink); line-height: 1.1; }
.kpi .lb { color: #3e4664; font-size: 14px; font-weight: 600; }
.kpi .s { font-size: 12px; color: #6b7290; }
.kpi.tile { display: block; }
.kpi.tile .v { font-size: 24px; margin-top: 6px; }
.kpi.tone-red { background: #fff3f1; border-color: #f7cfc6; } .kpi.tone-red .v, .kpi.tone-red .lb { color: var(--wine); }
.kpi.tone-green .v, .kpi.tone-green .lb { color: #157a35; } .kpi.tone-blue { background: #f3f6ff; }
.kpi .chev { margin-left: auto; color: var(--navy-ink); width: 22px; height: 22px; }
.num-red { color: var(--wine); }

/* ---------- Bố cục chia danh sách – chi tiết ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.split.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split.r-narrow { grid-template-columns: minmax(0, 2fr) minmax(280px, .9fr); }
.split .detail { position: sticky; top: 20px; }
.kv.lined { gap: 0; } .kv.lined dt, .kv.lined dd { padding: 10px 0; border-bottom: 1px solid #efede3; }

/* ---------- Biểu mẫu ---------- */
.inp, select.inp, textarea.inp { border-color: #cfd4e2; border-radius: 9px; height: 42px; }
.field > span { color: var(--navy-ink); font-weight: 700; }

/* ---------- Bước nhập dữ liệu (D18) ---------- */
.stepper { display: flex; align-items: flex-start; justify-content: space-between; margin: 4px 30px 22px; position: relative; }
.stepper::before { content: ''; position: absolute; left: 60px; right: 60px; top: 22px; height: 3px; background: #d7d9e3; }
.stepper .bar { position: absolute; left: 60px; top: 22px; height: 3px; background: var(--wine); }
.stepper .st { position: relative; z-index: 1; text-align: center; width: 120px; font-weight: 700; color: var(--navy-ink); }
.stepper .st i { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 8px; background: #fff; border: 3px solid #bfc3d2; color: #8f95aa; font-style: normal; font-size: 18px; font-weight: 800; }
.stepper .st.done i { background: var(--orange); border-color: var(--orange); color: #fff; } .stepper .st.cur i { border-color: var(--wine); color: var(--wine); }

/* ---------- Đăng nhập (D11) ---------- */
.login2 { min-height: 100vh; display: grid; place-items: center; background: var(--cream); padding: 24px; }
.login2 .brandc { text-align: center; margin-bottom: 26px; }
.login2 .brandc b { font-size: 52px; font-weight: 800; color: var(--navy-ink); letter-spacing: -1.4px; display: block; line-height: 1; }
.login2 .brandc small { font-size: 22px; font-weight: 600; color: var(--navy-ink); display: block; margin-top: 8px; }
.login2 .brandc .gbar { width: 240px; margin: 12px auto 0; }
.login2 .box { width: min(450px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 26px 24px; box-shadow: var(--shadow); }
.login2 h2 { text-align: center; font-size: 22px; margin-bottom: 16px; }
.inp-ico { position: relative; } .inp-ico > svg { position: absolute; left: 12px; top: 12px; width: 18px; height: 18px; color: #6b7290; }
.inp-ico .inp { padding-left: 40px; } .inp-ico .eye { position: absolute; right: 8px; top: 8px; background: none; border: 0; cursor: pointer; color: #6b7290; padding: 3px; }
.inp-ico .eye svg { width: 20px; height: 20px; }

/* ---------- Lịch rảnh (D21) ---------- */
.avail { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-align: center; }
.avail > div { padding: 8px 4px; border-left: 1px solid var(--line-2); } .avail > div:first-child { border-left: 0; }
.avail b { display: block; font-size: 13px; margin-bottom: 6px; color: var(--navy-ink); }

/* ---------- Mẫu thông báo (D31) ---------- */
.var-chip { background: #fff1c2; border-radius: 6px; padding: 1px 6px; color: #7a4b00; font-weight: 600; }
.editor { border: 1px solid #cfd4e2; border-radius: 10px; overflow: hidden; background: #fff; }
.editor .tb { display: flex; gap: 4px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--line); background: #fafaf6; }
.editor .tb button, .editor .tb select { background: none; border: 0; padding: 4px 8px; border-radius: 6px; cursor: pointer; font-weight: 700; }
.editor textarea { border: 0; width: 100%; min-height: 220px; padding: 12px; resize: vertical; font: inherit; line-height: 1.7; }
.preview-bubble { background: #f3f4f8; border-radius: 14px; padding: 14px; white-space: pre-wrap; line-height: 1.6; }
.tpl-item { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; }
.tpl-item.on { background: #fdeeea; border-color: #f4c5bb; }
.tpl-item b { display: block; color: var(--navy-ink); }

/* ---------- So sánh trước/sau (D29) ---------- */
.diff { display: grid; grid-template-columns: 1fr 40px 1fr; gap: 10px; align-items: center; }
.diff .box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #f5f6f9; font-size: 13.5px; }
.diff .box.after { background: #fff4f2; border-color: #f4c5bb; }
.diff .box h4 { margin: 0 0 8px; color: var(--navy-ink); } .diff .box.after h4 { color: var(--wine); }
.diff .arrow { text-align: center; font-size: 22px; color: #6b7290; }
.diff pre { margin: 0; white-space: pre-wrap; font-family: inherit; }

/* ---------- Banner chào (D35) ---------- */
.hello { background: linear-gradient(90deg, #fde6db, #fff3ea); border-radius: 16px; padding: 22px 24px; position: relative; overflow: hidden; border: 1px solid #f6d6c8; }
.hello h2 { font-size: 26px; margin-bottom: 4px; }
.hello::after { content: ''; position: absolute; right: -40px; bottom: -80px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(252, 238, 33, .4), rgba(240, 65, 35, .18) 60%, transparent 70%); }

/* ---------- Ô chọn trạng thái dạng viên (D07) ---------- */
.stsel { appearance: none; border-radius: 999px; border: 0; padding: 5px 30px 5px 12px; font-weight: 700; font-size: 13px; cursor: pointer; background-repeat: no-repeat; background-position: right 10px center; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%231d2a6b' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.stsel.s-present { background-color: #e1f5e6; color: #157a35; } .stsel.s-late { background-color: #fff2cc; color: #8a5a00; } .stsel.s-excused { background-color: #e2ebff; color: #2350c7; }
.stsel.s-unexcused { background-color: #fde4e3; color: #b42318; } .stsel.s-none { background-color: #eceef3; color: #4b5470; }
.stsel:disabled { cursor: default; background-image: none; padding-right: 12px; }
.cnt { border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; }
.cnt svg { width: 26px; height: 26px; flex: none; } .cnt b { display: block; font-size: 20px; } .cnt small { font-weight: 600; font-size: 13px; }
.cnt.green { background: #e7f6ea; color: #157a35; } .cnt.yellow { background: #fff4d6; color: #a15c00; } .cnt.blue { background: #e7eeff; color: #2350c7; } .cnt.red { background: #fde8e6; color: #b42318; }

/* ---------- Biểu đồ ---------- */
.linechart svg { width: 100%; height: 230px; display: block; }
.bars2 { display: flex; align-items: flex-end; justify-content: center; gap: 40px; height: 170px; padding: 0 10px; border-bottom: 1px solid var(--line); }
.bars2 > div { width: 70px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bars2 i { width: 100%; border-radius: 6px 6px 0 0; } .bars2 b { font-size: 18px; margin-bottom: 4px; color: var(--navy-ink); }

/* ---------- Tích hợp (D36) ---------- */
.integ { display: flex; gap: 14px; align-items: center; padding: 18px; }
.integ .logo { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 18px; }

/* ---------- Di động ---------- */
@media (max-width: 860px) {
  .mtop { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 25; }
  .mtop b { font-size: 20px; } .mtop .menu-btn { color: #fff; display: block; background: none; border: 0; }
  .split, .split.even, .split.r-narrow, .diff { grid-template-columns: 1fr; } .split .detail { position: static; }
  .content { padding: 16px 12px 40px; } .ph h1 { font-size: 26px; }
  .stepper { margin: 0 0 18px; } .stepper .st { width: 90px; font-size: 13px; }
  .seg.boxed { flex-wrap: wrap; } .seg.boxed a { flex: 1 0 33%; }
  .login2 .brandc b { font-size: 40px; }
}

/* Thanh tiến độ Luyện chữ */
.pbar { flex: 1; height: 10px; min-width: 90px; background: #eceef3; border-radius: 99px; overflow: hidden; }
.pbar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #fcee21, #f04123); }
.pbar.done > span { background: var(--navy, #2a398b); }
.pbar.slow > span { background: #9e2024; }
.pbar.lg { height: 14px; }

/* Điểm danh video Luyện chữ */
.vdots { display: flex; flex-wrap: wrap; gap: 3px; max-width: 330px; }
.vdots i { font-style: normal; width: 19px; height: 19px; border-radius: 5px; border: 1px solid #d9dceb; background: #fff; color: #9aa0b8; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.vdots i.on { background: linear-gradient(135deg, #fcee21, #f04123); border-color: #f04123; color: #fff; }
.vdots.done i.on { background: var(--navy, #2a398b); border-color: var(--navy, #2a398b); }
.vdots.slow i.on { background: #9e2024; border-color: #9e2024; }
.vdots.lg { max-width: none; } .vdots.lg i { width: 26px; height: 26px; font-size: 12px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.vcell { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid #d9dceb; border-radius: 10px; cursor: pointer; background: #fff; position: relative; }
.vcell input { position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; accent-color: #f04123; }
.vcell small { color: #7a8099; } .vcell.on { border-color: #f04123; background: #fff5f2; }
.vtable th.c, .vtable td.c { text-align: center; padding-left: 3px; padding-right: 3px; }
.vbox { width: 30px; height: 30px; border-radius: 7px; border: 1px solid #d9dceb; background: #fff; color: #b5bacb; font-weight: 800; cursor: pointer; display: inline-grid; place-items: center; padding: 0; }
.vbox:hover { border-color: #f04123; }
.vbox.on { background: linear-gradient(135deg, #fcee21, #f04123); border-color: #f04123; color: #fff; }
.vbox.add { background: #e1f5e6; border: 2px dashed #157a35; color: #157a35; }
.vbox.del { background: #fff1f0; border: 2px dashed #9e2024; color: #9e2024; }
.vbox.na { background: #eceef3; border-color: #eceef3; cursor: default; width: 30px; height: 30px; }
.vlg { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; border: 1px solid #d9dceb; font-weight: 800; font-size: 11px; color: #b5bacb; vertical-align: -5px; }
.vlg.on { background: #f04123; color: #fff; border-color: #f04123; } .vlg.add { background: #e1f5e6; color: #157a35; border: 2px dashed #157a35; } .vlg.del { background: #fff1f0; color: #9e2024; border: 2px dashed #9e2024; }
