:root {
  --navy: #1F3A5F;
  --navy-2: #2E5C8A;
  --gold: #C9A227;
  --bg: #F3F5F9;
  --card: #FFFFFF;
  --ink: #1E2A38;
  --muted: #6B7A8F;
  --line: #DCE3EC;
  --soft: #EEF3FA;
  --ok: #1E8E5A;
  --err: #C0392B;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.req { color: var(--err); }

/* ---- Thanh tiêu đề ---- */
.topbar {
  background: linear-gradient(90deg, var(--navy), var(--navy-2));
  color: #fff;
  padding: 14px 16px;
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
.brand { display: flex; gap: 12px; align-items: center; }
.logo {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--gold); color: var(--navy);
  font-weight: 800; font-size: 12px; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center;
}
.brand-title { font-weight: 700; font-size: 16px; letter-spacing: .3px; }
.brand-sub { opacity: .85; font-size: 12px; }
.tabs { display: flex; gap: 6px; background: rgba(255, 255, 255, .12); padding: 4px; border-radius: 10px; }
.tab {
  background: transparent; border: 0; color: #fff; cursor: pointer;
  padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600; font-size: 13px;
}
.tab.active { background: #fff; color: var(--navy); }

/* ---- Bố cục ---- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 16px; }
.page { display: none; }
.page.active { display: block; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.card h2 { font-size: 15px; margin: 0 0 12px; color: var(--navy); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.fields .full { grid-column: 1 / -1; }
.grid-2 .card .fields { grid-template-columns: 1fr 1fr; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: #33415c; min-width: 0; }
input, select {
  font: inherit; font-weight: 400; color: var(--ink);
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; width: 100%; min-width: 0;
}
input[readonly] { background: var(--soft); color: var(--navy); font-weight: 700; }
input:focus, select:focus { outline: 2px solid #9CC3EA; border-color: var(--navy-2); }

/* ---- Nút ---- */
.btn {
  border: 0; border-radius: 9px; padding: 10px 18px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 14px;
}
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--soft); }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--navy);
  padding: 6px 12px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
}
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* ---- Danh mục hành vi (ô chọn nhiều) ---- */
.pk-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.pk-toolbar input { flex: 1 1 260px; }
.pk-count { font-size: 13px; font-weight: 700; color: var(--navy); }
.pk-list {
  max-height: 300px; overflow: auto; border: 1px solid var(--line);
  border-radius: 8px; padding: 6px;
}
.pk-item {
  display: flex; flex-direction: row; gap: 10px; align-items: flex-start;
  padding: 7px 8px; border-radius: 6px; cursor: pointer; font-weight: 400;
}
.pk-item:hover { background: var(--soft); }
.pk-item input { width: auto; margin-top: 3px; flex: 0 0 auto; }
.pk-box { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.pk-box summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.pk-box input[type=search] { margin: 10px 0; }
.hint {
  background: #FFF8E1; border: 1px solid #F3E0A0; border-radius: 8px;
  padding: 10px 12px; font-size: 13px; margin-top: 10px;
}
.hint ul { margin: 6px 0 0; padding-left: 18px; }

/* ---- Bảng ---- */
.tbl-wrap { overflow: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  background: var(--soft); color: var(--navy); text-align: left;
  padding: 8px; border-bottom: 1px solid var(--line); font-weight: 700; white-space: nowrap;
}
.tbl td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl .n { text-align: right; white-space: nowrap; }
.tbl .c { text-align: center; }
.tbl tr.tot td { font-weight: 800; background: #F7F9FC; border-top: 2px solid var(--navy); }
.note { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.empty { color: var(--muted); font-style: italic; }

/* ---- Thanh tỷ lệ ---- */
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.bar { flex: 1; background: #E8EEF6; border-radius: 6px; height: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--navy-2), var(--navy)); }
.bar-cell span { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---- Báo cáo ---- */
.report-wrap { overflow: auto; }
.rpt { color: var(--ink); }
.rpt-head { width: 100%; font-size: 13px; margin-bottom: 4px; }
.rpt-head td.r { text-align: right; }
.rpt-title { text-align: center; color: var(--navy); font-size: 18px; font-weight: 800; margin: 14px 0 6px; }
.rpt-sub { text-align: center; font-size: 13px; color: #33415c; margin: 2px 0; }
.sec-title {
  font-size: 14px; font-weight: 700; color: var(--navy);
  margin: 18px 0 8px; padding-left: 8px; border-left: 4px solid var(--gold);
}
.kpi { width: 100%; border-collapse: separate; border-spacing: 8px; margin: 0 -8px; }
.kpi td {
  background: var(--soft); border-left: 4px solid var(--navy);
  border-radius: 8px; padding: 10px; text-align: center; width: 25%;
}
.kv { font-size: 17px; font-weight: 800; color: var(--navy); }
.kl { font-size: 12px; color: var(--muted); }
.sig { width: 100%; margin-top: 24px; font-size: 13px; }
.sig td.c { text-align: center; width: 45%; }

/* ---- Thông báo, hộp thoại, chờ ---- */
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(120px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px;
  max-width: 92vw; white-space: pre-line; font-weight: 600; z-index: 30;
  opacity: 0; visibility: hidden; transition: transform .25s ease, opacity .25s ease, visibility .25s;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--err); }
.modal {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; z-index: 40; padding: 16px;
}
.modal-box { background: #fff; border-radius: 12px; padding: 20px; max-width: 460px; width: 100%; }
.modal-box p { margin: 0 0 8px; white-space: pre-line; }
.busy {
  position: fixed; inset: 0; background: rgba(255, 255, 255, .6);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.busy-box {
  background: var(--navy); color: #fff; padding: 14px 20px; border-radius: 10px; font-weight: 700;
}
.loading { padding: 24px; text-align: center; color: var(--muted); }
.error { padding: 16px; color: var(--err); font-weight: 700; }

/* ---- Form kiểu sheet NHAPLIEU ---- */
.xcard { padding: 14px 16px; }
.xnote { font-size: 12px; color: var(--muted); margin: 4px 0 12px; }
.xrow {
  display: grid; grid-template-columns: 300px 1fr; gap: 12px; align-items: center;
  padding: 6px 0; border-bottom: 1px dashed var(--line);
}
.xrow:last-of-type { border-bottom: 0; }
.xlabel { font-size: 13px; font-weight: 700; color: var(--navy); }
.xhint { font-weight: 400; color: var(--muted); font-size: 12px; }
.xinput { position: relative; min-width: 0; }
.xinput input, .xinput select, .dd-btn { background: #FFF9DB; border-color: #E9DFA6; }
.xauto input { background: var(--soft); color: var(--navy); font-weight: 600; }
.xbuttons { display: flex; gap: 12px; justify-content: center; margin: 16px 0 6px; flex-wrap: wrap; }
.xbuttons .btn { min-width: 180px; letter-spacing: .3px; }
.dd { position: relative; }
.dd-btn {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  border: 1px solid #E9DFA6; border-radius: 8px; padding: 9px 10px; cursor: pointer;
  font: inherit; font-size: 14px; text-align: left; color: var(--ink);
}
.dd-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-placeholder { color: var(--muted); }
.dd-arrow { color: var(--navy); font-size: 12px; }
.dd-panel {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 24px rgba(16, 24, 40, .18); padding: 10px;
}
.dd-panel input[type=search] { margin-bottom: 8px; }
.pk-top { margin-bottom: 6px; }
.dd-panel .pk-list { max-height: 260px; }
@media (max-width: 780px), (pointer: coarse) {
  .xrow { grid-template-columns: 1fr; gap: 6px; }
  .xbuttons .btn { min-width: 0; flex: 1 1 140px; }
}

/* ---- Báo cáo chuyên nghiệp ---- */
.rpt { color: #1B2430; font-size: 12.5px; }
.rpt-top { width: 100%; border-bottom: 2px solid var(--navy); padding-bottom: 8px; }
.rpt-top td { vertical-align: top; }
.org-name { font-weight: 800; color: var(--navy); font-size: 13px; letter-spacing: .3px; }
.org-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.rpt-meta { text-align: right; font-size: 11px; color: var(--muted); white-space: nowrap; }
.rpt-title {
  text-align: center; color: var(--navy); font-size: 19px; font-weight: 800;
  margin: 16px 0 4px; letter-spacing: .4px;
}
.rpt-period { text-align: center; font-size: 13px; color: #33415c; margin-bottom: 12px; font-style: italic; }
.scope { width: 100%; border-collapse: collapse; margin-bottom: 10px; border: 1px solid var(--line); }
.scope td { padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 12px; }
.scope tr:last-child td { border-bottom: 0; }
.sb-k { width: 180px; background: var(--soft); font-weight: 700; color: var(--navy); }
.insight { border-left: 4px solid var(--gold); background: #FFFBEA; padding: 10px 14px; border-radius: 6px; margin-bottom: 4px; }
.ins-title { font-weight: 800; color: var(--navy); margin-bottom: 4px; font-size: 12.5px; }
.insight ul { margin: 0; padding-left: 18px; }
.insight li { margin: 3px 0; }
.sec-title {
  display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 800;
  color: var(--navy); margin: 20px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line);
  page-break-after: avoid; break-after: avoid;
}
.sec-num {
  display: inline-block; background: var(--navy); color: #fff; border-radius: 4px;
  padding: 1px 7px; font-size: 12px; min-width: 22px; text-align: center;
}
.kpi { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 8px; margin: 0 -8px 4px; }
.kcard {
  background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--navy);
  border-radius: 8px; padding: 10px 8px; text-align: center; width: 25%;
}
.kc-navy { border-top-color: var(--navy); }
.kc-gold { border-top-color: var(--gold); }
.kc-blue { border-top-color: #2E7DD7; }
.kc-green { border-top-color: var(--ok); }
.kc-red { border-top-color: var(--err); }
.kv { font-size: 16px; font-weight: 800; color: var(--navy); }
.kl { font-size: 11px; color: #4A5568; margin-top: 2px; }
.ks { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.rpt .tbl { font-size: 12px; border: 1px solid var(--line); }
.rpt .tbl thead th {
  background: var(--navy); color: #fff; border-bottom: 0; padding: 7px 8px; font-size: 11.5px;
  text-transform: none; font-weight: 700;
}
.rpt .tbl tbody tr:nth-child(even) td { background: #F7F9FC; }
.rpt .tbl td { padding: 6px 8px; border-bottom: 1px solid #E6EBF2; }
.rpt .tbl tr.tot td { background: #EEF3FA; font-weight: 800; border-top: 2px solid var(--navy); color: var(--navy); }
.rpt .tbl tr { page-break-inside: avoid; break-inside: avoid; }
.rpt .tbl thead { display: table-header-group; }
.rpt .tbl .nowrap { white-space: nowrap; }
.bar-txt { font-size: 11.5px; color: var(--navy); font-weight: 700; }
.note { font-size: 11px; color: var(--muted); margin: 6px 0 0; font-style: italic; }
.sig { width: 100%; margin-top: 26px; border-collapse: collapse; page-break-inside: avoid; }
.sig td { vertical-align: top; width: 50%; font-size: 12px; }
.sig-r { text-align: center; }
.sig-title { font-weight: 800; color: var(--navy); margin-top: 4px; }
.sig-small { font-size: 11px; color: var(--muted); margin-top: 4px; }
.sig-space { height: 60px; }
.foot { font-size: 10.5px; color: var(--muted); text-align: center; margin-top: 22px; border-top: 1px solid var(--line); padding-top: 6px; }

/* ---- Đăng nhập, người dùng, tài khoản ---- */
.topright { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.who { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.who span { font-weight: 700; }
.btn-sm {
  border: 1px solid rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .1); color: #fff;
  border-radius: 7px; padding: 5px 10px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600;
}
.btn-sm:hover { background: rgba(255, 255, 255, .22); }
.tbl .act { white-space: nowrap; }
.tbl .act .btn-sm {
  border: 1px solid var(--line); background: #fff; color: var(--navy); margin: 2px 4px 2px 0;
}
.tbl .act .btn-sm:hover { background: var(--soft); }
.btn-del { border: 1px solid #F1C4BE !important; background: #FFF5F4 !important; color: var(--err) !important; }
.btn-del:hover { background: #FBE3E0 !important; }
.badge { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.ok { background: #E3F5EC; color: var(--ok); }
.badge.off { background: #FBE9E7; color: var(--err); }
.login {
  position: fixed; inset: 0; background: linear-gradient(160deg, var(--navy), var(--navy-2));
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 60;
}
.login-box {
  background: #fff; border-radius: 14px; padding: 26px 24px; width: 100%; max-width: 380px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .25); display: flex; flex-direction: column; gap: 12px;
}
.login-box h2 { margin: 4px 0 0; color: var(--navy); font-size: 20px; text-align: center; }
.login-box p { margin: 0 0 4px; text-align: center; }
.logo.big { width: 56px; height: 56px; font-size: 15px; margin: 0 auto; }
.login-msg { color: var(--err); font-size: 13px; font-weight: 600; min-height: 18px; }
.login-logo { display: block; margin: 0 auto 6px; width: 120px; height: auto; max-width: 60%; }
.btn.wide { width: 100%; }
.modal-box h3 { margin: 0 0 12px; color: var(--navy); font-size: 16px; }
.fm-fields { display: flex; flex-direction: column; gap: 10px; }
.fm-fields label { font-size: 13px; }
@media (max-width: 780px), (pointer: coarse) {
  .topright { width: 100%; justify-content: space-between; }
}

/* ---- Di động ---- */
@media (max-width: 780px), (pointer: coarse) {
  .grid-2 { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .brand-title { font-size: 14px; }
  .tbl { font-size: 12px; }
  .kv { font-size: 15px; }
  .kpi td { width: 50%; }
}

.tbl.detail td { font-size: 12px; }

/* ---- Ô đánh dấu, ô nhập nhiều dòng, nút xóa ---- */
input[type=checkbox] { width: auto; margin: 0; padding: 0; accent-color: var(--navy); }
textarea {
  font: inherit; font-weight: 400; color: var(--ink);
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; width: 100%; min-width: 0; resize: vertical;
}
textarea:focus { outline: 2px solid #9CC3EA; border-color: var(--navy-2); }
.xinput textarea { background: #FFF9DB; border-color: #E9DFA6; }
.chk-list { display: flex; flex-direction: column; gap: 6px; }
.chk-list .chk { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.chk-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px 14px; margin-top: 6px;
}
.chk-grid .chk { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
.opt-fields { margin-top: 10px; }
.opt-label { margin: 14px 0 4px; }
.search-full { margin-bottom: 10px; }
.mgr-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.mgr-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.danger { background: var(--err); color: #fff; }
.btn.danger:hover { background: #A93226; }
.btn.danger:disabled { background: #E7B3AD; cursor: not-allowed; }
.rpt-note { text-align: center; font-size: 12px; color: var(--muted); margin: -6px 0 10px; }
.sig-name { font-weight: 700; color: var(--ink); margin-top: 6px; }
.ks { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
#m_body td.nowrap, #recentBody td.n { white-space: nowrap; }

.chk-list.chk-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.gt-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gt-item .chk { min-width: 190px; }
.gt-item .gt-info { flex: 1 1 200px; min-width: 0; width: auto; }
.gt-item .gt-info:disabled { background: #F2F4F7; }

/* ---- Biểu đồ trong báo cáo ---- */
.chart-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 10px 0 14px; background: #fff; page-break-inside: avoid; }
.chart-title { font-weight: 700; font-size: 12.5px; color: var(--navy); margin-bottom: 8px; }
.hbar { display: grid; grid-template-columns: 200px 1fr 64px; gap: 8px; align-items: center; font-size: 11.5px; margin: 5px 0; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { background: #EEF2F7; height: 12px; border-radius: 6px; overflow: hidden; }
.hb-track i { display: block; height: 100%; background: var(--navy-2); border-radius: 6px; }
.hb-v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.colchart { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding: 4px 4px 0; border-bottom: 1px solid var(--line); }
.cc-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.cc-bar { width: 70%; background: var(--gold); border-radius: 3px 3px 0 0; }
.cc-val { font-size: 10px; font-weight: 700; margin-bottom: 2px; }
.cc-lab { font-size: 10px; color: var(--muted); margin-top: 4px; }

/* ---- Thanh tab cuộn ngang được trên điện thoại ---- */
.tabs { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; }

/* ---- Điện thoại: không tràn ngang trang, bảng cuộn trong khung riêng ---- */
@media (max-width: 780px), (pointer: coarse) {
  .wrap { padding: 10px; }
  .card { padding: 12px; margin-bottom: 12px; }
  .card h2 { font-size: 14px; }
  .hide-sm { display: none !important; }
  .topright { flex-direction: column; align-items: stretch; width: 100%; }
  .tabs { width: 100%; }
  .tab { padding: 7px 10px; font-size: 12px; flex: 0 0 auto; }
  .who { justify-content: space-between; }
  .brand-title { font-size: 13px; }
  .tbl { font-size: 12px; }
  .tbl th, .tbl td { padding: 6px 5px; }
  .tbl-wrap { -webkit-overflow-scrolling: touch; }
  .xbuttons { flex-direction: column; }
  .xbuttons .btn, .actions .btn { width: 100%; min-width: 0; }
  .actions { flex-direction: column-reverse; }
  .mgr-bar { flex-direction: column; align-items: stretch; }
  .mgr-actions .btn { flex: 1 1 auto; }
  .quick .chip { flex: 1 1 auto; text-align: center; }
  .fields { grid-template-columns: 1fr; }
  .chk-list.chk-grid-2 { grid-template-columns: 1fr; }
  /* Thẻ chỉ số: 2 thẻ mỗi hàng */
  .kpi, .kpi tbody, .kpi tr { display: block; width: 100%; margin: 0; }
  .kpi tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
  .kcard { display: block; width: auto; padding: 8px; }
  .kv { font-size: 15px; }
  .rpt-top td { display: block; text-align: left; }
  .rpt-meta { text-align: left; }
  .rpt-title { font-size: 15px; }
  .sig td { display: block; width: 100%; }
  .scope .sb-k { width: 110px; }
  .modal-box { padding: 16px; }

  /* iPhone (Safari): ô nhập 16px để không bị phóng to khi chạm; nút đủ lớn để bấm */
  input, select, textarea { font-size: 16px; }
  input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; height: 44px; }
  .xinput input, .xinput select, .dd-btn { min-height: 44px; }
  .btn, .tab, .chip { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .wrap, .topbar { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .toast { bottom: calc(14px + env(safe-area-inset-bottom)); }
  body { -webkit-text-size-adjust: 100%; }
  .hbar { grid-template-columns: 110px 1fr 56px; }
  .colchart { height: 150px; }
  .gt-item .chk { min-width: 0; width: 100%; }
  .gt-item .gt-info { flex-basis: 100%; }
}

/* ---- In / xuất PDF ---- */
@page { size: A4 landscape; margin: 10mm; }
.subtabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.rpt > .rpt-off { display: none; }
@media print {
  .rpt > .rpt-off { display: block !important; }
  #rptSubtabs, #rptPanelBieu { display: none !important; }
  body { background: #fff; font-size: 11px; }
  .topbar, .login, .toast, .modal, .busy, .xcard, .card.no-print,
  .page:not(.active), #tab-bao-cao > .card:not(.report-wrap) { display: none !important; }
  .wrap { max-width: none; padding: 0; margin-left: 0 !important; }
  .card { border: 0; box-shadow: none; margin: 0; padding: 0; }
  .report-wrap, .tbl-wrap { overflow: visible !important; }
  .rpt { font-size: 10.5px; }
  .rpt .tbl { font-size: 10px; }
  .kv { font-size: 14px; }
  .sec-title { margin-top: 12px; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .tbl tr { page-break-inside: avoid; }
}

/* ---- Máy tính: thanh công cụ dọc bên trái, trang toàn chiều rộng ---- */
@media (min-width: 901px) and (pointer: fine) {
  html, body { height: 100%; }
  .topbar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 230px; z-index: 20;
    flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start;
    gap: 18px; padding: 18px 14px; overflow-y: auto;
    border-radius: 0; box-shadow: 2px 0 10px rgba(0, 0, 0, .18);
  }
  .brand { align-items: center; }
  .topright { display: flex; flex-direction: column; align-items: stretch; gap: 14px; flex: 1; min-height: 0; }
  .tabs { flex-direction: column; gap: 4px; background: transparent; padding: 0; overflow: visible; }
  .tab { text-align: left; padding: 11px 14px; font-size: 14px; color: #fff; }
  .tab:hover { background: rgba(255, 255, 255, .15); }
  .tab.active { background: #fff; color: var(--navy); }
  .who { flex-direction: column; align-items: stretch; margin-top: auto; gap: 8px; }
  .who .btn-sm { text-align: center; }
  .wrap { max-width: none; margin: 0 0 0 230px; padding: 20px 28px; min-height: 100vh; box-sizing: border-box; }
}

/* ==== GIAO DIỆN MỚI: sinh động, rõ ràng (ghi đè các quy tắc phía trên) ==== */
:root {
  --shadow-sm: 0 2px 8px rgba(20, 40, 80, .06);
  --shadow-md: 0 10px 28px rgba(20, 40, 80, .10);
  --sky: #2E6DB0;
  --gold-2: #F6C453;
}
body {
  min-height: 100vh;
  background:
    radial-gradient(1000px 480px at 105% -8%, rgba(46, 109, 176, .16), transparent 60%),
    radial-gradient(900px 460px at -8% 108%, rgba(232, 163, 23, .12), transparent 60%),
    #F1F5FB;
}
@keyframes vphcFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes vphcShake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.page.active { animation: vphcFadeUp .35s ease both; }

/* Thanh tiêu đề và tab */
.topbar {
  background: linear-gradient(160deg, #0F2A4A 0%, #1F3A5F 50%, #2E6DB0 100%);
  box-shadow: 0 6px 24px rgba(15, 42, 74, .35);
}
.logo {
  background: linear-gradient(135deg, var(--gold-2), #E8A317);
  box-shadow: 0 6px 14px rgba(232, 163, 23, .45);
}
.brand-title { letter-spacing: .6px; }
.tabs { background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .14); }
.tab { border-radius: 10px; transition: background .2s ease, transform .15s ease, box-shadow .2s ease; }
.tab:hover { background: rgba(255, 255, 255, .16); }
.tab.active {
  background: linear-gradient(135deg, #FFFFFF, #EAF2FF);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  color: var(--navy);
}
.btn-sm { border-radius: 10px; transition: background .2s ease; }

/* Thẻ nội dung */
.card {
  background: #fff;
  border: 1px solid rgba(31, 58, 95, .06);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  position: relative;
  animation: vphcFadeUp .4s ease both;
}
.card::before {
  content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 4px; border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, #1F3A5F, #2E6DB0, #E8A317);
}
.card h2 {
  font-size: 16px; letter-spacing: .2px; padding-bottom: 10px; margin-bottom: 14px;
  border-bottom: 1px dashed #DCE6F2;
}

/* Ô nhập liệu */
input, select, textarea {
  border-radius: 10px; border: 1.5px solid #D5DEEB; background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px rgba(46, 109, 176, .16);
}
.xinput input, .xinput select, .dd-btn, .xinput textarea { background: #FFFBEA; border-color: #EEDFA0; }
.xrow { border-radius: 12px; transition: background .2s ease; }
.xrow:hover { background: #F7FAFF; }
.xlabel { color: #1F3A5F; font-size: 12.5px; letter-spacing: .3px; }
.req { color: #D9485F; font-weight: 800; }
.xrow.miss { background: #FFF1F2; box-shadow: inset 4px 0 0 #D9485F; animation: vphcShake .35s ease; }
.xrow.miss .xlabel { color: #B92B43; }

/* Nút bấm */
.btn { border-radius: 12px; transition: transform .12s ease, box-shadow .2s ease, background .2s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.99); }
.btn.primary {
  background: linear-gradient(135deg, #1F3A5F, #2E6DB0); color: #fff;
  box-shadow: 0 6px 16px rgba(46, 109, 176, .30);
}
.btn.primary:hover { background: linear-gradient(135deg, #2E6DB0, #1F3A5F); }
.btn.ghost { background: #fff; border-radius: 12px; }
.btn.danger { background: linear-gradient(135deg, #E0526A, #B92B43); color: #fff; }
.xbuttons .btn.primary { padding: 12px 24px; font-size: 15px; }
.xbuttons .btn.ghost { padding: 12px 20px; }

/* Bảng */
.tbl th {
  background: linear-gradient(180deg, #F4F8FD, #E8EFF9);
  color: #1F3A5F; border-bottom: 2px solid #D5E2F2;
}
.tbl td { border-bottom: 1px solid #E8EEF6; }
.tbl tbody tr { transition: background .15s ease; }
.tbl tbody tr:nth-child(even) td { background: #FAFCFF; }
.tbl tbody tr:hover td { background: #EEF5FF; }
.tbl tr.tot td { background: linear-gradient(180deg, #F7F9FC, #EEF3FA); }

/* Thẻ chỉ số (báo cáo, tổng quan) */
.kpi td.kcard { border: 0; border-radius: 14px; padding: 14px 14px; color: #fff; box-shadow: var(--shadow-md); }
.kpi td.kc-navy { background: linear-gradient(135deg, #1F3A5F, #2E6DB0); }
.kpi td.kc-gold { background: linear-gradient(135deg, #F6C453, #E8A317); color: #2B2110; }
.kpi td.kc-blue { background: linear-gradient(135deg, #3B82F6, #1D4ED8); }
.kpi td.kc-green { background: linear-gradient(135deg, #34D399, #059669); }
.kpi td.kc-red { background: linear-gradient(135deg, #F87171, #DC2626); }
.kpi td.kcard .kv { color: inherit; font-size: 20px; }
.kpi td.kcard .kl, .kpi td.kcard .ks { color: inherit; opacity: .92; }
.kpi td.kc-gold .kl, .kpi td.kc-gold .ks { color: #2B2110; }

/* Thanh biểu đồ */
.hb-track { border-radius: 8px; background: #E9EFF8; }
.hb-track i { background: linear-gradient(90deg, #2E6DB0, #1F3A5F); }
.cc-bar { background: linear-gradient(180deg, #F6C453, #E8A317); }

/* Thông báo và hộp thoại */
.toast { border-radius: 14px; box-shadow: 0 12px 30px rgba(15, 42, 74, .28); }
.modal-box { border-radius: 18px; box-shadow: 0 24px 60px rgba(15, 42, 74, .30); }
.login {
  background:
    radial-gradient(700px 400px at 20% 0%, rgba(246, 196, 83, .20), transparent 60%),
    linear-gradient(160deg, #0F2A4A 0%, #1F3A5F 50%, #2E6DB0 100%);
}
.login-box { border-radius: 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }

/* Màn hình máy tính: thanh dọc có nền sâu hơn */
@media (min-width: 901px) and (pointer: fine) {
  .topbar { background: linear-gradient(180deg, #0F2A4A 0%, #1B3A62 55%, #2A64A8 100%); }
  .tab { font-size: 14.5px; }
  .tab.active { transform: translateX(4px); }
  .wrap { padding: 24px 32px; }
}

/* ---- Quản lý KPI ---- */
.kpi-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 18px; margin-bottom: 8px; }
.kpi-title { border: 0 !important; margin: 0 0 4px !important; padding: 0 !important; }
.kpi-period { font-weight: 700; color: var(--navy); font-size: 14px; }
.kpi-days { font-size: 13px; color: #B7791F; font-weight: 700; margin-top: 2px; }
.kpi-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.kpi-input { width: 110px; text-align: center; font-weight: 700; }
.kpi-bar-cell { min-width: 120px; }
.kbar { height: 10px; border-radius: 999px; background: #E9EFF8; overflow: hidden; }
.kbar-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.kbar-ok { background: linear-gradient(90deg, #34D399, #059669); }
.kbar-info { background: linear-gradient(90deg, #60A5FA, #2563EB); }
.kbar-off { background: linear-gradient(90deg, #F87171, #DC2626); }
.kbar-txt { font-size: 11px; color: var(--muted); margin-top: 3px; }
.badge.warn { background: #FEF3C7; color: #92400E; }
.badge.info { background: #DBEAFE; color: #1E40AF; }
.acc-sel { min-width: 200px; }
.kc-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.kc-row label { min-width: 200px; flex: 1; }
.tbl tr.me td { background: #FFF8DC; font-weight: 700; }
.kn { border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; border-left: 5px solid; }
.kn.ok { background: #ECFDF5; border-color: #059669; color: #065F46; }
.kn.warn { background: #FFFBEB; border-color: #E8A317; color: #7C4A03; }
.kn.off { background: #FEF2F2; border-color: #DC2626; color: #7F1D1D; }
.kn-title { font-weight: 800; font-size: 14px; }
.kn-body { font-size: 13px; margin-top: 3px; line-height: 1.5; }
.edit-banner { display:flex; gap:12px; flex-wrap:wrap; align-items:center; justify-content:space-between; background:#FFF7E0; border:1px solid #E0B000; border-radius:12px; padding:10px 14px; margin-bottom:12px; font-weight:700; color:#7A5A00; }
/* Cập nhật xử lý: thẻ hồ sơ, chỉ số tóm tắt, chip trạng thái */
.cu-stats { display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap:10px; margin-bottom:12px; }
.cu-tile { border:1px solid var(--line); border-radius:12px; padding:10px 12px; background:var(--soft); }
.cu-tile.warn { background:#FFF7E0; border-color:#E0B000; }
.cu-tile.ok { background:#E6F6EC; border-color:#9FD8B4; }
.cu-num { font-size:22px; font-weight:800; color:var(--navy); }
.cu-lbl { font-size:12px; color:var(--muted); font-weight:600; }
.cu-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap:12px; }
.cu-grid.hidden { display:none !important; }
.cu-card { border:1px solid var(--line); border-radius:14px; padding:12px 14px; background:#fff; display:flex; flex-direction:column; gap:8px; }
.cu-card.needs { border-left:4px solid #E0B000; }
.cu-head { display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; }
.cu-stt { font-size:12px; font-weight:800; color:#fff; background:var(--navy); padding:2px 9px; border-radius:999px; }
.cu-date { font-size:13px; color:var(--muted); font-weight:600; flex:1; text-align:right; }
.cu-name { font-weight:800; font-size:15px; }
.cu-sub { font-size:13px; color:var(--muted); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.cu-chips { display:flex; flex-wrap:wrap; gap:6px; }
.cu-chip { font-size:12px; font-weight:700; padding:3px 9px; border-radius:999px; border:1px solid transparent; }
.cu-chip.ok { background:#E6F6EC; color:#1E6B3A; border-color:#B9E2C7; }
.cu-chip.warn { background:#FFF7E0; color:#7A5A00; border-color:#E8CF7A; }
.cu-chip.info { background:#E8F0FB; color:#1F4E8C; border-color:#BFD4F2; }
.cu-extra { display:grid; gap:6px; border-top:1px dashed var(--line); padding-top:8px; }
.cu-k { font-size:12px; color:var(--muted); font-weight:700; }
.cu-v { font-size:13px; }
.view-toggle { display:flex; gap:6px; }
.btn[aria-pressed="true"] { background: var(--navy); color:#fff; border-color: var(--navy); }
@media (max-width: 600px) { .cu-stats { grid-template-columns: repeat(2, minmax(0,1fr)); } .cu-date { text-align:left; } }
/* Hộp cập nhật xử lý: đầu và chân cố định, thân cuộn, chia theo mục */
.modal-box.cu-box { max-width: 680px; padding: 0; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.cu-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; padding:16px 20px 12px; border-bottom:1px solid var(--line); }
.cu-head h3 { margin:0 0 4px; }
.cu-body { padding:14px 20px; overflow-y:auto; flex:1; display:grid; gap:12px; }
.cu-sec { border:1px solid var(--line); border-radius:12px; padding:12px 14px; display:grid; gap:10px; }
.cu-sec h4 { margin:0; font-size:12px; color:var(--navy); text-transform:uppercase; letter-spacing:.4px; }
.cu-sec label { display:grid; gap:4px; font-weight:600; font-size:13px; }
.cu-hint { margin:0; }
.cu-grid2 { display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
.cu-grid-ret { display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
.cu-ret { display:grid; gap:6px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; align-content:start; }
.cu-ret-name { font-weight:700; font-size:13px; }
.cu-ret-in { display:flex; gap:6px; flex-wrap:wrap; }
.cu-ret-in input { flex:1 1 140px; min-width:0; }
.cu-pill { justify-self:start; font-size:12px; font-weight:700; padding:2px 9px; border-radius:999px; background:#FFF7E0; color:#7A5A00; border:1px solid #E8CF7A; }
.cu-pill.ok { background:#E6F6EC; color:#1E6B3A; border-color:#B9E2C7; }
.cu-foot { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; padding:12px 20px; border-top:1px solid var(--line); background:#fff; }
.cu-foot .login-msg { flex:1 1 200px; margin:0; }
.cu-foot .actions { margin-left:auto; }
@media (max-width: 600px) {
  .modal-box.cu-box { max-height: 94vh; }
  .cu-grid2, .cu-grid-ret { grid-template-columns: 1fr; }
  .cu-foot .actions { width:100%; }
  .cu-foot .actions .btn { flex:1; }
}
.bb-sub { font-size: 13px; color: var(--navy); margin: 14px 0 8px; }
.bb-note { font-size: 12.5px; line-height: 1.5; }
.bb-in { border-collapse: collapse; font-size: 12.5px; margin: 6px 0 12px; }
.bb-in th, .bb-in td { border: 1px solid var(--line); padding: 4px 6px; text-align: center; }
.bb-in input { width: 84px; text-align: right; }
.bb-h { font-size: 14px; color: var(--navy); margin: 18px 0 8px; }
.bb-t { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-bottom: 10px; }
.bb-t th, .bb-t td { border: 1px solid #C9D3E0; padding: 5px 7px; vertical-align: top; }
.bb-t th { background: #EEF3FA; color: var(--navy); text-align: left; }
.bb-t td.num, .bb-t th.num { text-align: right; }
.bb-t .bb-title td { border: none; font-weight: 800; text-align: center; font-size: 13.5px; }
.bb-t .bb-row td { border: none; }
.bb-t .bb-sec td { border: none; font-weight: 800; color: var(--navy); padding-top: 10px; }
.bb-t .bb-tot td { font-weight: 800; background: #F7F9FC; }
.bb-t .bb-loi td.st { color: #B42318; font-weight: 700; }
.bb-t .bb-warn td.st { color: #9A6700; font-weight: 700; }
.bb-t .bb-ok td.st { color: #137333; font-weight: 700; }
@media (max-width: 720px) { .bb-in input { width: 64px; } }

/* ---- Điện thoại (iPhone): nút chạm đủ lớn, tiêu đề gọn, bảng và chip không bị cắt ---- */
@media (max-width: 780px), (pointer: coarse) {
  .btn { min-height: 44px; }
  .tab { min-height: 44px; display: inline-flex; align-items: center; }
  .chip { min-height: 40px; }
  .who .btn, .topright .btn, .who button { min-height: 40px; }
  .quick { flex-wrap: wrap; overflow: visible; margin-left: 0; margin-right: 0; }
  .quick .chip { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .xinput select, .fields select, .fields input, .xinput input { min-height: 44px; }
  .tbl .btn, .tbl button, .cu-card .btn, .cu-card button, .mgr-actions .btn { min-height: 40px; }
  summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
}
@media (max-width: 480px) {
  .brand-sub { display: none; }
  .topbar { padding: 10px 12px; }
  .brand-title { font-size: 14px; }
  .who { flex-wrap: wrap; gap: 6px; }
  .who .btn { padding: 8px 10px; font-size: 12px; }
  .card h2 { font-size: 15px; }
}

/* ---- Điện thoại (v2): tiêu đề không dính, nút đủ lớn nhưng không phình, bảng nhập gọn ---- */
@media (max-width: 780px), (pointer: coarse) {
  .topbar { position: static; padding: 10px 12px; gap: 8px; box-shadow: none; }
  .brand { gap: 8px; }
  .brand-sub { display: none; }
  .brand-title { font-size: 14px; }
  .topright { gap: 8px; }
  .tabs { padding: 3px; gap: 4px; }
  .tab { min-height: 40px; padding: 8px 12px; font-size: 13px; }
  .who { font-size: 12.5px; gap: 6px; }
  .who .btn, .who button { min-height: 36px; padding: 6px 10px; font-size: 12px; }
  .xbuttons { flex-direction: column; align-items: stretch; gap: 8px; margin: 12px 0 4px; }
  .xbuttons .btn { flex: none; width: 100%; min-width: 0; min-height: 46px; padding: 12px 16px; font-size: 14px; }
  .xlabel { font-size: 13px; }
  .bb-in { table-layout: fixed; width: 100%; }
  .bb-in th:first-child { width: 30%; font-size: 12px; text-align: left; }
  .bb-in td { padding: 3px; }
  .bb-in input { width: 100%; min-width: 0; padding: 8px 2px; font-size: 16px; text-align: center; }
  .bb-h { font-size: 14px; }
  .bb-t { font-size: 12px; }
  #btnFull { display: none !important; }
  .topbar .logo { width: 40px; height: 40px; font-size: 11px; }
  summary { flex-wrap: wrap; gap: 4px; line-height: 1.35; }
  .topbar { flex-direction: column; align-items: stretch; }
  .who { justify-content: space-between; flex-wrap: nowrap; }
}
.gio-row { display: flex; gap: 8px; align-items: center; }
.gio-row input { flex: 1 1 auto; min-width: 0; }
/* Tab con của báo cáo: điện thoại cuộn ngang một hàng */
@media (max-width: 780px), (pointer: coarse) {
  .subtabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .subtabs .chip { flex: 0 0 auto; white-space: nowrap; }
}
.rpt-sum { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; font-size: 14px; }
.rpt-sum.hidden { display: none; }
#rptFilterBody.hidden { display: none; }

/* ===== Báo cáo trên điện thoại: chữ lớn, một cột, bảng thành từng khối ===== */
@media (max-width: 780px), (pointer: coarse) {
  .rpt { font-size: 16px; line-height: 1.5; color: #1B2430; }
  .rpt-top { font-size: 15px; }
  .rpt-title { font-size: 19px !important; line-height: 1.35; }
  .rpt .sec-title { font-size: 18px; margin: 22px 0 12px; padding-bottom: 8px; }
  .rpt .sec-num { width: 30px; height: 30px; line-height: 30px; font-size: 15px; }

  /* Khung nhận định */
  .rpt .insight { font-size: 16px; padding: 12px 14px; }
  .rpt .ins-title { font-size: 17px; }
  .rpt .insight li { margin: 6px 0; line-height: 1.5; }

  /* Ô số liệu tổng quan: 2 cột, số lớn */
  .rpt .kpi { display: grid !important; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; width: 100% !important; margin: 0 !important; }
  .rpt .kpi tbody, .rpt .kpi tr { display: contents; }
  .rpt .kpi td { display: block; width: 100% !important; min-width: 0; border-spacing: 0; padding: 0 !important; }
  .rpt .kpi td.kcard { padding: 14px 10px !important; min-height: 112px; border-radius: 14px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; white-space: normal; }
  .rpt .kpi td.kcard .kv { font-size: 30px !important; line-height: 1.1; overflow-wrap: anywhere; font-weight: 800; line-height: 1.15; }
  .rpt .kcard .kl { font-size: 15px !important; line-height: 1.35; white-space: normal; }
  .rpt .kcard .ks { font-size: 13px !important; }

  /* Thanh so sánh: nhãn một dòng, thanh bên dưới */
  .rpt .hbar { grid-template-columns: 1fr 70px; gap: 4px 10px; font-size: 15px; margin: 10px 0; }
  .rpt .hb-l { grid-column: 1 / -1; white-space: normal; overflow: visible; font-weight: 600; }
  .rpt .hb-track { height: 14px; }
  .rpt .hb-v { text-align: right; font-weight: 700; }

  /* Bảng: mỗi dòng thành một khối, nhãn ở bên trái, số ở bên phải */
  .rpt .tbl-wrap { overflow: visible; }
  .rpt .tbl, .rpt .tbl tbody { display: block; width: 100%; font-size: 16px; border: 0; }
  .rpt .tbl thead { display: none; }
  .rpt .tbl tr { display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 0 0 10px; box-shadow: 0 1px 2px rgba(15,42,74,.06); }
  .rpt .tbl tbody tr:nth-child(even) td { background: transparent; }
  .rpt .tbl tr.tot { background: #EEF3FA; border-top: 2px solid var(--navy); }
  .rpt .tbl td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border: 0; padding: 6px 0; text-align: right; font-size: 16px; }
  .rpt .tbl td::before { content: attr(data-label); color: #4A5568; font-weight: 600; text-align: left; flex: 1 1 auto; font-size: 15px; }
  .rpt .tbl td:first-child { display: block; text-align: left; font-weight: 800; color: var(--navy); font-size: 17px; padding-bottom: 6px; border-bottom: 1px solid #E6EBF2; margin-bottom: 4px; }
  .rpt .tbl td:first-child::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 600; color: #4A5568; margin-bottom: 2px; }
  .rpt .tbl td:empty { display: none; }
  .rpt .tbl .n, .rpt .tbl .nowrap { white-space: normal; }

  /* Bộ lọc và nút trên điện thoại */
  #tab-bao-cao .card h2 { font-size: 18px; }
  #tab-bao-cao .chip, #tab-bao-cao .btn { font-size: 15px; }
  .rpt-sum { font-size: 15px; }
  .rpt .scope { font-size: 15px; }
  .rpt .scope td { padding: 8px 6px; }
  .rpt-note, .note { font-size: 14px; }
}
