/* Giao diện chuẩn HV Holdings — BẮT BUỘC theo tools/design-system/QUY-DINH-GIAO-DIEN.md (kho hv-x-operations, chốt 12/11/2026).
   Kiểu GitHub: nền trắng, viền mỏng nhẹ, bo 6px; nút chính xanh lá, mục chọn / link xanh dương;
   mọi nút / ô nhập / ô chọn / thanh tab cao 26px (--ctl-h); thanh tab kiểu nhóm nút; nhãn kiểu B. Sửa giao diện app: dùng biến + class dưới đây. */
:root {
  color-scheme: light;
  --page: #ffffff; --surface: #ffffff; --surface-2: #f6f8fa; --header: #f6f8fa;
  --text: #1f2328; --text-2: #59636e; --muted: #6e7781;
  --border: #e5e8ec; --grid: #eef1f4; --axis: #d8dee4; --wash: rgba(129, 139, 152, .10);
  --accent: #0969da; --primary: #1f883d; --primary-hover: #1c8139; --btn-bg: #f6f8fa; --btn-hover: #eff2f5;
  --good: #1a7f37; --bad: #d1242f; --err-bg: #ffebe9; --err-ink: #a40e26;
  --radius: 6px; --ctl-h: 26px; --ctl-fs: 12.5px;
  --lb-good-bg: #eaf7ee; --lb-good-ink: #1f7a3a; --lb-good-line: #c6e8d0;
  --lb-info-bg: #eaf3fe; --lb-info-ink: #1662c4; --lb-info-line: #c8ddfa;
  --lb-warn-bg: #fdf6e3; --lb-warn-ink: #8a5a00; --lb-warn-line: #f0dfab;
  --lb-err-bg: #fdeeee; --lb-err-ink: #c0362c; --lb-err-line: #f6cdca;
  --lb-mute-bg: #f3f5f7; --lb-mute-ink: #5b6570; --lb-mute-line: #e3e7eb;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0d1117; --surface: #0d1117; --surface-2: #151b23; --header: #010409;
    --text: #f0f6fc; --text-2: #9198a1; --muted: #848d97;
    --border: #262c34; --grid: #1c2129; --axis: #30363d; --wash: rgba(101, 108, 118, .18);
    --accent: #4493f8; --primary: #238636; --primary-hover: #29903b; --btn-bg: #212830; --btn-hover: #262c36;
    --good: #3fb950; --bad: #f85149; --err-bg: rgba(248, 81, 73, .1); --err-ink: #f85149;
    --lb-good-bg: rgba(63, 185, 80, .12); --lb-good-ink: #6ad37a; --lb-good-line: rgba(63, 185, 80, .28);
    --lb-info-bg: rgba(68, 147, 248, .13); --lb-info-ink: #79b4ff; --lb-info-line: rgba(68, 147, 248, .3);
    --lb-warn-bg: rgba(210, 153, 34, .13); --lb-warn-ink: #e3b341; --lb-warn-line: rgba(210, 153, 34, .3);
    --lb-err-bg: rgba(248, 81, 73, .12); --lb-err-ink: #ff7b72; --lb-err-line: rgba(248, 81, 73, .3);
    --lb-mute-bg: rgba(139, 148, 158, .12); --lb-mute-ink: #9da7b3; --lb-mute-line: rgba(139, 148, 158, .25);
  }
}
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { margin: 0; background: var(--page); color: var(--text); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif; }
b, strong, th { font-weight: 600; }
header { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--header); flex-wrap: wrap; }
.spacer { flex: 1; }
main { max-width: 960px; margin: 0 auto; padding: 16px; }
h2 { font-size: 15px; margin: 20px 0 8px; }
.muted { color: var(--text-2); }
a { color: var(--accent); }

/* nút & ô nhập — cùng cao 26px */
button, input, select, textarea { font: inherit; color: inherit; }
button, .btn { min-height: var(--ctl-h); padding: 2px 10px; font-size: var(--ctl-fs); font-weight: 500; border: 1px solid var(--border); border-radius: var(--radius); background: var(--btn-bg); cursor: pointer; white-space: nowrap; }
button:hover, .btn:hover { background: var(--btn-hover); border-color: var(--axis); }
button.primary, .btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
button.primary:hover, .btn.primary:hover { background: var(--primary-hover); }
button.danger, .btn.danger { color: var(--bad); }
button.danger:hover, .btn.danger:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
button.ghost { background: transparent; }
button:disabled { opacity: .5; cursor: default; }
input:not([type="checkbox"]):not([type="radio"]), select { min-height: var(--ctl-h); padding: 2px 8px; font-size: var(--ctl-fs); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--axis); }

/* thanh tab — một kiểu: khung xám, mục chọn nền trắng có viền (<nav class="tabs"><button aria-selected="true">) */
.tabs { display: flex; width: fit-content; max-width: 100%; gap: 2px; padding: 2px; overflow-x: auto; scrollbar-width: none; margin: 2px 0 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.tabs button { flex: none; border: 0; border-radius: 5px; background: transparent; min-height: calc(var(--ctl-h) - 6px); padding: 0 10px; color: var(--text-2); font-weight: 400; }
.tabs button:hover { background: transparent; color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--border); }

/* nhãn tình trạng kiểu B: <span class="badge good|info|warn|err"> (không class = xám) */
.badge { display: inline-block; font-size: 12px; font-weight: 500; line-height: 20px; padding: 0 9px; border-radius: 999px; white-space: nowrap; background: var(--lb-mute-bg); color: var(--lb-mute-ink); border: 1px solid var(--lb-mute-line); }
.badge.good { background: var(--lb-good-bg); color: var(--lb-good-ink); border-color: var(--lb-good-line); }
.badge.info { background: var(--lb-info-bg); color: var(--lb-info-ink); border-color: var(--lb-info-line); }
.badge.warn { background: var(--lb-warn-bg); color: var(--lb-warn-ink); border-color: var(--lb-warn-line); }
.badge.err { background: var(--lb-err-bg); color: var(--lb-err-ink); border-color: var(--lb-err-line); }

.error { padding: 10px 12px; border-radius: var(--radius); background: var(--err-bg); color: var(--err-ink); }

/* thẻ & bảng */
.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 12px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.card .table-wrap { border: 0; border-radius: 0; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th { color: var(--text-2); font-size: 12px; border-bottom-color: var(--border); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; } /* cột số: tên cột cũng căn phải */
tbody tr:hover td { background: var(--surface-2); }
.empty { padding: 40px 16px; text-align: center; color: var(--text-2); border: 1px solid var(--border); border-radius: var(--radius); }

/* ===== Phần riêng của app hvh-bod (chỉ dùng biến chuẩn ở trên) ===== */
main.wide { max-width: 1280px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 12px; }
.toolbar .tabs { margin: 0; }
.page-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 8px 0 4px; }
.page-title h1 { font-size: 18px; margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 10px 14px; }
.kpi .l { font-size: 12px; color: var(--text-2); }
.kpi .v { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 2px 0; }
.kpi .s { font-size: 12px; color: var(--text-2); }
.up { color: var(--good); } .down { color: var(--bad); }
td.sub, th.sub { color: var(--text-2); }
td.warn { color: var(--bad); }
tr.total td { font-weight: 600; background: var(--surface-2); }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding: 24px 16px 0; overflow-x: auto; }
.chart .col { flex: 1 0 34px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; }
.chart .val { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .bar { width: 100%; max-width: 44px; background: var(--accent); border-radius: 3px 3px 0 0; display: flex; justify-content: center; }
.chart .bar span { font-size: 10px; color: #fff; padding-top: 3px; }
.chart .bar.partial { opacity: .55; }
.chart .bar.rr { background: transparent; border: 1px dashed var(--accent); }
.chart .bar.rr span { color: var(--accent); }
.chart-x { display: flex; gap: 6px; padding: 4px 16px 10px; }
.chart-x span { flex: 1 0 34px; text-align: center; font-size: 11px; color: var(--muted); }
.note { font-size: 12px; color: var(--text-2); margin: 8px 0 24px; line-height: 1.6; }

/* ===== Khung web hvh-bod: thanh trên + menu trái (ẩn mặc định, bấm ☰ để mở) + vùng dữ liệu (màu theo logo HV) ===== */
:root { --hv-green: #62ba49; --hv-teal: #08aad8; --hv-grey: #58585a; --accent: #0a84ad; --primary: #2f8f3c; --primary-hover: #2a8036; --good: #2f8f3c; --top-h: 52px; --side-w: 236px; }
@media (prefers-color-scheme: dark) { :root { --accent: #3fb6dc; --primary: #3a9d46; --primary-hover: #43a94f; --good: #5cc26a; } }
body.app { min-height: 100vh; }
body.app > header { height: var(--top-h); padding: 0 14px; flex-wrap: nowrap; background: var(--surface); gap: 8px; }
.brand { display: flex; align-items: center; text-decoration: none; padding: 2px 4px; border-radius: var(--radius); }
.brand-logo { display: block; width: 60px; height: 36px; background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAABICAMAAAAKwMFNAAAAYFBMVEUAAABeXmBPtFj3+PgqsaF5eXmdnZ+qqqsXr848qVdnxF50dHaIiIqk56ic0Z1Kupxaw5kAfwBarKpftWdycnRvuHGIyXg7vTtyxp6y6OaOzpF3w3eZ2c8A/wBlytk5wKQ54E3OAAAAIHRSTlMA+f0N/gRWGf3++KqUHVf37QIFo28DtgOhIZCvWAGZ/2SEKhMAAATISURBVHjaxZqNkqIwDIADAYqCwO2ue6Kr+/5veUn6QymUxZvZ2hkFS+nXpEmaggA/lBJeUtB8Epf7mbCfV/iTGHsi7PV4/EwMZmx3POaJwec/hIVjnufJJdbYxOASu0+NTQs+wclik4FLFHCXGIxnI3FaMJ7kg6nBZ3HcGx2Tgt/YcSlcvMPfpGDqm8NUavBfMqibxiSW2GCpbIHL5RK9Y7nGMtIQS7w6TJ5Q4jc/Tm2AS1BNk1FpcJK9yriqyRoSoMn05awC5aUSaG9aAecb4NyAS8DMFJwU15iqhqrsOTfw5qLSDbB8Eiye7fUQBysH9kUGW/U0uNsHhkkjMgwrsFooYa+qT3r4P4K9BplnBa1UfKyY9U9gnE/WBhg9XZfWtBa3bIMnTV+1pneo2krnadaZ1pof/wBGk1j74NIVH6w8XVd2fqKmpcGHKPjE6eZC4tBmBTw3L5ChONOKGNfh4IPP924y6dAhudcPV2aghXlZ5bexyBWAFVzML+J23cKqV0oTxBhRrmdaGAVbNIHPgPr8xjuY42nhxzFwGL02TWsCHwyYuEejZr2DWah6Azy1ofm145gFshgY7oAXq2XewXT3824werpuN6PWDCxw0BZ9o5TvdtTuVIbgaipzcGBexrSqyKodgG/kW0bL3hIRc6cmBPsib0StJdjTsglcyzmOBBAIolfWbpkWp7VvE5jQV4RuOAZr056QqcvCEiKmxeDOk/gyknENU8QEe9teMIbg+KOM+3vuFM2TO3hLU+58fyd4pmtr3bGU+n3CkpaHvM+Xa8ReMIYix0yLWxo3viB8DUMxXLrh/8Gz6LVlWnC6yxTn7ycYL0PRD18Az4MnX6VsuZmZVhnfqzG3Y5sqSFz0ufnggVVrij8YXVPNVwHX0mu7qukcWMvfRfF9oZFgvwZ+Zne/b3Pa5e+jTC6VgTfH2B/6NbCLGz5Dl8BT1RRh4r4EV17sBcsCvxGJZrpfkxjRPWeUb/+nOaJrh8GTSXsJ0bty+RZu0Y9wMuB+l6rVZtVikzevIOsqTOmRn76giK/RgcSox+wP3UqAOKuScz4A2mvgnehb+jWwJk9gySFbms4so1taF4clo6LO2mxW1cgpsu9VLoZVgYsVAdgMhPR9GOZ+TAxe3JnSVJxhKiXBAyXdbCvGKWmnHZ7ByqaHFce0ik9KEWQsImD6XYRgpQSsYz9VfKAH1kt/pRy4oQPKOBQXNEmE0n0+6g1wvxa5NJh8hbpE2YHqTqmq5cFpMDenD8+KyVSwnYWzDXARgkFnOwwG0TpL7DL7ucSlodGhQjYNuq5I3MoslQjFfnCr11s2nUqpRs9x5tQonSoL1tsM1HUCFoX/H9jMMTpDtbvxKvNtl8EfupVy9q7chkdUvQmWNcNGH9YTHfW30lbCP6UoZY6mhXJnJei21JNpYxy/joIHXiKjb2eeXiGCCIZ1Xa+CCYuzJ000ReKA/I0yX/qndpVSH0vTDtV0h1ziB9Jo2oIF1ytgxlLq+4sPi+vaoR34e2Btjr/7lNoDgyQ1FKsfvyytBxZ0LeAxzZs9B64tGNK8UJzAVDDh21MfDC8Cw9eY8HUxTti0b4ot+JH6BTVO2PQSP17xSh7rx/iSfwKM4+v++/D2AuY/dLlHhlNy8RoAAAAASUVORK5CYII=") no-repeat center / contain; }
@media (prefers-color-scheme: dark) { .brand { background: #fff; } }
.navbtn { width: var(--ctl-h); min-height: var(--ctl-h); padding: 0; display: grid; place-items: center; border: 0; background: transparent; color: var(--text-2); }
.navbtn:hover, body.nav-open .navbtn { background: var(--wash); color: var(--text); }
.navbtn svg { width: 16px; height: 16px; }
.navbtn svg, .side svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.layout { display: flex; align-items: flex-start; }
.side { display: none; width: var(--side-w); flex: none; position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
  padding: 12px 10px; border-right: 1px solid var(--border); background: var(--surface-2); }
body.nav-open .side { display: block; }
.side a { position: relative; display: flex; align-items: center; gap: 11px; height: 34px; padding: 0 10px; margin: 1px 0; border-radius: var(--radius);
  color: var(--text-2); text-decoration: none; font-size: 13px; white-space: nowrap; overflow: hidden; }
.side a:hover { background: var(--wash); color: var(--text); }
.side a.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--border); }
.side a.on::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: linear-gradient(var(--hv-green), var(--hv-teal)); }
.side a.on svg, .side a.open svg { color: var(--hv-green); }
.side .sub a { height: 31px; padding-left: 39px; font-size: 12.5px; }
.side .caret { margin-left: auto; width: 14px !important; height: 14px !important; transition: transform .15s; }
.side a.open .caret { transform: rotate(90deg); }
/* Thanh icon luôn hiện (shell.js); ẩn khi mở menu đầy đủ bằng ☰ và trên điện thoại */
.rail { width: 44px; flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0; border-right: 1px solid var(--border); background: var(--surface-2); }
.rail a { position: relative; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--text-2); text-decoration: none; }
.rail a:hover { background: var(--wash); color: var(--text); }
.rail a.on { background: var(--surface); color: var(--hv-green); box-shadow: 0 0 0 1px var(--border); }
.rail a.open { background: var(--wash); color: var(--text); }
.rail svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail a.has-sub::after { content: ""; position: absolute; right: 3px; bottom: 3px; border-style: solid; border-width: 0 0 4px 4px; border-color: transparent transparent currentColor transparent; opacity: .55; }
.rail { z-index: 30; }
.rail a::before { content: attr(data-label); position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%); z-index: 61; white-space: nowrap;
  padding: 4px 8px; border-radius: 6px; background: var(--text); color: var(--surface); font-size: 12px; line-height: 1.3; pointer-events: none; opacity: 0; transition: opacity .08s; }
.rail a:hover::before { opacity: 1; }
.rail a.open::before { opacity: 0; }
body.nav-open .rail { display: none; }
.fly { position: fixed; z-index: 60; min-width: 180px; max-width: 260px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.10); }
.fly-h { padding: 5px 9px 4px; font-size: 10.5px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; }
.fly a { display: block; padding: 5px 9px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 12.5px; }
.fly a:hover { background: var(--wash); }
.fly a.on { background: var(--wash); color: var(--hv-green); font-weight: 600; }
@media (max-width: 600px) { .rail { display: none; } }
main.content { flex: 1; min-width: 0; max-width: none; margin: 0; padding: 18px clamp(12px, 2.2vw, 32px) 32px; }
.crumb { font-size: 12px; color: var(--text-2); margin: 0 0 2px; }
/* Phần cần giữ khi cuộn (bộ lọc của từng báo cáo): thêm class "stick" */
.stick { position: sticky; top: 0; z-index: 10; background: var(--page); margin-left: -4px; margin-right: -4px; padding: 8px 4px; border-bottom: 1px solid transparent; }
.stick.stuck { border-bottom-color: var(--border); }
.scrim { display: none; }
@media (max-width: 860px) {
  .side { position: fixed; left: 0; top: 0; z-index: 40; width: 270px; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.28); }
  .brand-logo { width: 50px; height: 30px; }
  #who { display: none; }
}
@media (prefers-reduced-motion: reduce) { .side .caret { transition: none; } }
.chart-x { overflow: hidden; }
@media (max-width: 600px) {
  .chart, .chart-x { gap: 3px; padding-left: 8px; padding-right: 8px; }
  .chart .col, .chart-x span { flex-basis: 22px; }
  .chart .val { font-size: 10px; }
}
.fl { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.asof { font-size: 12px; }
/* Ô chọn trên điện thoại: danh sách dạng tấm dưới đáy (shell.js) */
.sheet-scrim { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.28); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 60vh; overflow-y: auto; background: var(--surface);
  border-top: 1px solid var(--border); border-radius: 12px 12px 0 0; padding: 4px 0 calc(8px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px rgba(0,0,0,.12); }
.sheet-head { position: sticky; top: 0; background: var(--surface); font-size: 12px; color: var(--text-2); padding: 10px 16px 6px; border-bottom: 1px solid var(--grid); }
.sheet [role="option"] { display: flex; align-items: center; min-height: 40px; padding: 0 16px; font-size: 14px; cursor: pointer; border-bottom: 1px solid var(--grid); }
.sheet [role="option"][aria-selected="true"] { color: var(--accent); font-weight: 600; }
@media (max-width: 600px) { select.sheet-sel { pointer-events: none; } .fl:has(select.sheet-sel) { cursor: pointer; } }
.welcome { min-height: calc(100vh - 140px); display: grid; place-items: center; text-align: center; margin: 0; padding: 0 12px;
  font-size: clamp(18px, 2.4vw, 28px); font-weight: 600; line-height: 1.35; text-wrap: balance; color: var(--text); }

/* ---- Kết quả kinh doanh: bảng nhóm cột, cột đầu dính, dòng BU thu gọn trên điện thoại ---- */
.kpi .v small { font-size: 13px; font-weight: 400; color: var(--text-2); margin-left: 4px; }
.kpi .v.neg, .neg { color: var(--bad); }
.pos { color: var(--good); }
.kq-wrap { max-height: 76vh; }
table.kq { border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
table.kq th, table.kq td { text-align: right; }
table.kq thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); }
table.kq thead tr:first-child th:first-child, table.kq td:first-child { text-align: left; position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 150px; box-shadow: 1px 0 0 var(--border); }
table.kq thead tr:first-child th:first-child { z-index: 3; vertical-align: bottom; }
table.kq th.grp { text-align: center; color: var(--primary); font-weight: 600; font-size: 11px; letter-spacing: .6px; text-transform: uppercase; border-bottom: 0; box-shadow: inset 0 -2px 0 var(--primary); }
table.kq .gap { padding: 0; width: 10px; min-width: 10px; border-bottom-color: transparent; background: var(--surface); }
table.kq th.band, table.kq td.band { background: var(--surface-2); }
table.kq tr.total td { font-weight: 600; background: var(--surface-2); }
table.kq tr.bu td { font-weight: 600; }
table.kq tr.sec td { height: 12px; padding: 0; border: 0; box-shadow: none; }
table.kq td.child { padding-left: 22px; color: var(--text-2); }
table.kq td.big { font-size: 1.06em; font-weight: 600; }
table.kq td.ord { color: var(--text-2); }
table.kq .sm { display: block; font-size: 11px; font-weight: 400; margin-top: 1px; }
table.kq th .sm { color: var(--muted); }
.tm { color: var(--muted); font-weight: 400; white-space: nowrap; }
.tm.bad { color: var(--bad); font-weight: 500; }
.tk { font-weight: 600; white-space: nowrap; }
.tk s { text-decoration: none; font-size: .65em; margin-right: 2px; vertical-align: 1px; }
.tk.up { color: var(--good); } .tk.dn { color: var(--bad); }
.na { color: var(--muted); }
.prog { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.prog i { width: 80px; height: 6px; border-radius: 3px; background: var(--grid); overflow: hidden; flex: none; }
.prog i b { display: block; height: 100%; background: var(--primary); }
.prog i b.lo { background: var(--bad); opacity: .65; }
.chev { display: none; width: 10px; margin-right: 3px; color: var(--muted); font-size: 9px; transition: transform .15s; }
tr.bu.open .chev { transform: rotate(90deg); }
.hint { display: none; margin: 0; padding: 6px 12px 0; font-size: 11px; color: var(--text-2); }
.chart .bar span.hi { background: #fff; color: var(--bad); border-radius: 3px; padding: 1px 3px; margin-top: 3px; height: fit-content; font-weight: 600; }
.chart.dense .col, .chart-x.dense span { flex-basis: 26px; }
.chart.dense .val { font-size: 9.5px; }
.chart.dense .bar span { font-size: 9px; writing-mode: vertical-rl; transform: rotate(180deg); padding: 3px 0; }
@media (max-width: 760px) {
  .kq-wrap { max-height: none; }
  table.kq th, table.kq td { padding: 6px 7px; font-size: 12px; }
  table.kq th { font-size: 10.5px; }
  table.kq thead tr:first-child th:first-child, table.kq td:first-child { min-width: 96px; max-width: 118px; white-space: normal; line-height: 1.25; }
  table.kq td.child { padding-left: 12px; }
  table.kq .gap { width: 6px; min-width: 6px; }
  table.kq tr.kid { display: none; }
  table.kq tr.kid.open { display: table-row; }
  table.kq tr.bu td:first-child { cursor: pointer; }
  .chev { display: inline-block; }
  .hint { display: block; }
  .prog i { width: 40px; }
}

/* ---- Xếp hạng BU - Thị trường: bục vinh danh, danh sách, thanh điểm ---- */
.rk-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.rk-grid[hidden], .rk-doc[hidden] { display: none; }
@media (min-width: 1100px) { .rk-grid { grid-template-columns: 1fr 1fr; } }
.rk-grid .card { margin-bottom: 0; min-width: 0; }
.rk-body { padding: 12px 16px 14px; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 8px; }
.podium .pd { display: grid; gap: 2px; min-width: 0; border-radius: var(--radius); padding: 12px 6px 10px; text-align: center; background: var(--surface-2); }
.podium .pd.k0 { order: 2; background: var(--lb-warn-bg); padding: 16px 6px 12px; }
.podium .pd.k1 { order: 1; } .podium .pd.k2 { order: 3; }
.podium svg, .rk-t3 svg { display: block; margin: 0 auto; filter: drop-shadow(0 2px 2px rgba(0,0,0,.15)); }
.podium .n { font-size: 13px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .s { font-size: 11px; color: var(--text-2); min-height: 1em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .v { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.podium .k0 .v { font-size: 21px; color: var(--primary); }
.podium .v.neg, .rk-list .v.neg { color: var(--bad); }
.podium .u { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.rk-list { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--grid); }
.rk-list li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--grid); }
.rk-list li:last-child { border-bottom: 0; }
.rk-list .rk { text-align: center; font-weight: 700; font-size: 16px; color: var(--text-2); line-height: 22px; }
.rk-list .body { min-width: 0; display: grid; gap: 5px; }
.rk-list .top { display: flex; align-items: baseline; gap: 10px; }
.rk-list .top .n { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-list .top .v { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rk-list .top .v small { margin-left: 4px; font-size: 10px; font-weight: 500; color: var(--text-2); text-transform: uppercase; }
.rk-list .chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11.5px; }
.rk-list .chips:empty { display: none; }
.rk-list .chip { border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; font-size: 10px; font-weight: 600; color: var(--text-2); }
.rk-list .mv { font-weight: 600; color: var(--text-2); } .rk-list .mv.up { color: var(--good); } .rk-list .mv.dn { color: var(--bad); }
.rk-bar { position: relative; display: block; height: 5px; border-radius: 3px; background: var(--grid); }
.rk-bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--primary); }
.rk-bar i.neg { background: var(--bad); opacity: .85; }
.rk-list .meta { font-size: 12px; color: var(--text-2); }
.rk-list .meta b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.rk-list .trio { display: grid; grid-template-columns: repeat(3, 1fr); border-radius: var(--radius); background: var(--surface-2); padding: 6px 0; font-size: 12px; }
.rk-list .trio div { min-width: 0; padding: 0 10px; } .rk-list .trio div + div { border-left: 1px solid var(--border); }
.rk-list .trio span { display: block; font-size: 10.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-list .trio b { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
.rk-list .trio .rr b { color: var(--primary); font-weight: 700; } .rk-list .trio .rr.neg b { color: var(--bad); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-right: 6px; vertical-align: middle; }
.dot.near { background: #d39b1f; } .dot.over { background: var(--bad); }
.rk-foot { margin-top: 6px; border-top: 1px solid var(--grid); padding-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 11.5px; color: var(--text-2); }
.rk-doc .card { margin-bottom: 12px; }
.rk-lead { margin: 0; border-radius: var(--radius); background: var(--surface-2); padding: 12px 14px; font-weight: 500; line-height: 1.6; }
.rk-lead b { color: var(--primary); }
.rk-blk { border-top: 1px solid var(--grid); padding-top: 14px; margin-top: 14px; font-size: 13px; line-height: 1.6; color: var(--text-2); }
.rk-blk h3 { margin: 0 0 6px; font-size: 14px; color: var(--text); }
.rk-blk ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.rk-blk b { color: var(--text); }
.rk-blk p { margin: 0 0 8px; }
.rk-blk pre { overflow-x: auto; border-radius: var(--radius); background: var(--surface-2); padding: 12px; font: 12px/1.6 ui-monospace, Menlo, monospace; color: var(--text); margin: 6px 0; }
.rk-blk .table-wrap { margin: 6px 0; }
.rk-blk td:first-child { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--text); }
.rk-t3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rk-t3 div { border-radius: var(--radius); background: var(--surface-2); padding: 10px 6px; text-align: center; }
.rk-t3 div.k0 { background: var(--lb-warn-bg); }
.rk-t3 p { margin: 4px 0 0; font-size: 12px; font-weight: 600; color: var(--text); } .rk-t3 small { font-size: 11px; }
.rk-rules { display: grid; gap: 20px; font-size: 13px; color: var(--text-2); }
@media (min-width: 1000px) { .rk-rules { grid-template-columns: 1fr 1fr; } }
.rk-rules h3 { margin: 0; font-size: 14px; color: var(--text); }
.rk-rules ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 4px; line-height: 1.6; }
.rk-eq { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; margin-top: 6px; }
.rk-eq span { border-radius: 6px; padding: 3px 8px; background: var(--surface-2); color: var(--text); }
.rk-eq span.r { background: var(--lb-ok-bg, #e8f5ea); color: var(--primary); font-weight: 600; }
.rk-eq i { font-style: normal; font-weight: 600; }
@media (max-width: 600px) {
  .podium .k0 .v { font-size: 18px; } .podium .v { font-size: 14px; }
  .rk-list .trio { font-size: 11.5px; } .rk-list .trio div { padding: 0 8px; }
}

/* ---- Xếp hạng chiến tướng: dòng bấm được, bảng chi tiết team ---- */
.ct-sec[hidden] { display: none; }
.ct-click { cursor: pointer; }
.rk-list li.ct-click:hover .n, .podium .pd.ct-click:hover .n { color: var(--accent); }
.ct-chev { color: var(--muted); font-size: 18px; line-height: 1; }
.rk-list .meta { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.ct-go { font-size: 11px; color: var(--accent); margin-top: 2px; }
.ct-more-li { display: block !important; text-align: center; border-bottom: 0 !important; }
.ct-empty { display: block !important; color: var(--text-2); text-align: center; padding: 24px 0 !important; }
.ct-note { font-size: 12px; margin: 10px 0 0; }
.ct-first { border-top: 0; margin-top: 0; padding-top: 0; }
.ct-up { color: var(--good) !important; } .ct-dn { color: var(--bad) !important; }
.ct-pillars { display: grid; gap: 8px; margin: 6px 0 0; }
.ct-pillars div { display: grid; gap: 2px; background: var(--surface-2); border-radius: var(--radius); padding: 8px 12px; border-left: 3px solid var(--primary); }
.ct-pillars b { font-size: 13.5px; } .ct-pillars span { font-size: 12.5px; }
.ct-sheet { border: 1px solid var(--border); padding: 0; width: min(640px, 100%); max-height: 84vh; border-radius: var(--radius); background: var(--surface); color: var(--text); flex-direction: column; overflow: hidden; }
.ct-sheet[open] { display: flex; }
.ct-sheet::backdrop { background: rgba(0, 0, 0, .45); }
.ct-sh-h { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); display: grid; gap: 10px; }
.ct-sh-t { display: flex; align-items: flex-start; gap: 10px; }
.ct-sh-tt { flex: 1; min-width: 0; }
.ct-sh-t h3 { margin: 0; font-size: 16px; }
.ct-sh-t p { margin: 2px 0 0; font-size: 12px; }
.ct-sh-t button { font-size: 18px; line-height: 1; }
.ct-kpis { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface-2); border-radius: var(--radius); padding: 8px 0; }
.ct-kpis div { text-align: center; min-width: 0; padding: 0 8px; } .ct-kpis div + div { border-left: 1px solid var(--border); }
.ct-kpis span { display: block; font-size: 10.5px; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }
.ct-kpis b { font-size: 15px; font-variant-numeric: tabular-nums; } .ct-kpis b.neg { color: var(--bad); }
.ct-sort { margin: 0; }
.ct-sh-b { overflow-y: auto; padding: 0 16px 16px; }
.ct-sh-b .sub-h { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); margin: 14px 0 2px; }
.mem { list-style: none; margin: 0; padding: 0; }
.mem li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--grid); }
.mem li:last-child { border-bottom: 0; }
.mem .mn { font-weight: 600; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem .me { font-size: 10px; font-weight: 700; color: #b07400; margin-left: 6px; text-transform: uppercase; letter-spacing: .05em; }
.mem .mvv { font-weight: 700; font-size: 15px; text-align: right; font-variant-numeric: tabular-nums; } .mem .mvv.neg { color: var(--bad); }
.mem .mt { grid-column: 1 / -1; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem .mm { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 11.5px; color: var(--text-2); }
.mem .mm b { color: var(--text); font-weight: 600; }
.mem li.zero .mn, .mem li.zero .mvv { color: var(--text-2); font-weight: 500; }
@media (max-width: 600px) { .ct-sheet { margin: auto auto 0; width: 100%; max-width: 100%; border-radius: 12px 12px 0 0; max-height: 88vh; } }

/* ---- Cấu hình chỉ số: bảng 12 tháng + điền nhanh ---- */
.cf-bulk { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 14px; padding: 12px 16px 14px; align-items: end; }
.cf-f { display: grid; gap: 4px; font-size: 12px; color: var(--text-2); min-width: 0; }
.cf-f select, .cf-f input { width: 100%; }
.cf-in { position: relative; display: block; min-width: 0; }
.cf-in input { width: 100%; padding-right: 24px; text-align: right; font-variant-numeric: tabular-nums; }
.cf-in i { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--text-2); font-size: 12px; pointer-events: none; }
.cf-err { margin: 0 16px 12px; }
.cf-dirty { font-size: 12px; }
.cf-grid { display: grid; }
.cf-row { display: grid; grid-template-columns: 90px repeat(3, minmax(0, 1fr)) 110px 150px; gap: 10px; align-items: center; padding: 6px 16px; border-bottom: 1px solid var(--grid); font-size: 13px; }
.cf-row:last-child { border-bottom: 0; }
.cf-head { font-size: 12px; color: var(--text-2); padding-top: 8px; padding-bottom: 8px; border-bottom-color: var(--border); }
.cf-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.cf-m { font-weight: 600; }
.cf-m small { display: block; font-size: 10.5px; font-weight: 500; color: var(--accent); }
.cf-now { background: var(--surface-2); }
.cf-inherit input { color: var(--text-2); }
.cf-draft { background: var(--lb-warn-bg); }
.cf-draft .cf-st { color: var(--lb-warn-ink); font-weight: 600; }
.cf-st { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-bulk-act button { width: 100%; }
.cf-row.cf-vrow { grid-template-columns: 140px minmax(0, 220px) 1fr; }
.cf-inherit select { color: var(--text-2); }
.cf-vact { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-top: 1px solid var(--grid); font-size: 12px; }
.cf-vact:has(button:not([hidden])) { display: flex; }
.cf-vact:not(:has(button:not([hidden]))):not(:has(#v-dirty:not(:empty))) { display: none; }
/* ô bị ẩn vì trước mốc số đúng của thị trường; dấu * = tổng chưa gồm thị trường chưa đúng số */
.vm-na { color: var(--text-2); }
.vm-star { color: var(--text-2); font-size: 10px; margin-left: 2px; vertical-align: super; }
@media (max-width: 600px) {
  .cf-row.cf-vrow { grid-template-columns: 110px minmax(0, 1fr); }
  .cf-row { grid-template-columns: 44px repeat(3, minmax(0, 1fr)); gap: 6px; padding: 6px 10px; }
  .cf-hide-m { display: none; }
  .cf-in input { padding-right: 18px; padding-left: 4px; }
  .cf-in i { right: 5px; font-size: 11px; }
}

/* ---- Xuất PDF (nút ở thanh trên + bản in) ---- */
.pdf-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; }
.pdf-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.print-head { display: none; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  html, body { background: #fff !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  header, nav.side, nav.rail, .fly, .scrim, .toolbar, nav.tabs, button, .sheet, .sheet-scrim, #need-login { display: none !important; }
  .layout { display: block !important; }
  main.content { padding: 0 !important; max-width: none !important; margin: 0 !important; width: 100% !important; }
  .print-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 0 0 6px; margin: 0 0 10px; border-bottom: 2px solid #00A125; font-size: 11px; color: #555; }
  .print-head b { font-size: 14px; color: #111; }
  .card, .kpi, tr, .podium .pd, .rk-list li { break-inside: avoid; page-break-inside: avoid; }
  .card { box-shadow: none !important; }
  .table-wrap { overflow: visible !important; }
  table { font-size: 10.5px; }
  .kpis { grid-template-columns: repeat(4, 1fr) !important; }
  .stick, .stuck { position: static !important; }
  a { color: inherit; text-decoration: none; }
}

/* ---- Sắp xếp bảng khi bấm tiêu đề cột ---- */
table thead th { cursor: pointer; user-select: none; }
table thead th:hover { color: var(--text); }
table thead th[data-sort]::after { content: ' ▼'; font-size: 9px; color: var(--accent); }
table thead th[data-sort="asc"]::after { content: ' ▲'; }
@media print { table thead th[data-sort]::after { content: ''; } }
/* dòng phụ dưới số trong bảng (tỉ trọng, tăng / giảm) */
td .tsub { font-size: 11px; color: var(--text-2); line-height: 1.35; font-weight: 400; }
td .tsub.up { color: var(--good); } td .tsub.down { color: var(--bad); }

/* ---- Điện thoại (≤ 600px): bảng thành thẻ, ô số 2 cột, tiêu đề khối xuống dòng gọn (shell.js gắn class mc) ---- */
@media (max-width: 600px) {
  main.content { padding: 12px 10px 28px; }
  .page-title h1 { font-size: 17px; }
  .kpis, .fn .kpis, .fn .kpis.k5 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 8px 10px; min-width: 0; }
  .kpi .l { font-size: 11.5px; line-height: 1.3; }
  .kpi .v { font-size: 19px; }
  .kpi .s { font-size: 11.5px; line-height: 1.4; }
  .toolbar { gap: 8px; }
  .toolbar .fl { flex: 1 1 calc(50% - 30px); min-width: 0; }
  .toolbar .fl select { flex: 1; min-width: 0; width: 100%; }
  .card-head { flex-wrap: wrap; gap: 2px 8px; padding: 8px 12px; }
  .card-head .spacer { display: none; }
  .card-head .asof { flex-basis: 100%; line-height: 1.4; }
  .table-wrap:has(> table.mc), .tw:has(> table.mc) { border: 0; background: transparent; overflow: visible; }
  table.mc, table.mc tbody, table.mc tr { display: block; width: auto; }
  table.mc thead { display: none; }
  table.mc tr { border: 1px solid var(--border); border-radius: 8px; margin: 0 0 8px; padding: 8px 12px; background: var(--surface); }
  table.mc tr.total, table.mc tr.tot { background: var(--surface-2); }
  table.mc td { display: grid; grid-template-columns: minmax(0, 48%) 1fr; column-gap: 12px; justify-items: end; align-items: baseline;
    padding: 3px 0 !important; border: 0 !important; white-space: normal; text-align: right; font-size: 13px; min-width: 0 !important; position: static !important; background: none; }
  table.mc td::before { content: attr(data-l); grid-row: 1 / span 4; justify-self: start; text-align: left; color: var(--text-2); font-size: 12px; font-weight: 400; }
  table.mc td > * { grid-column: 2; }
  table.mc td:first-child { display: block; text-align: left; font-weight: 600; font-size: 14px; padding: 0 0 6px !important; margin-bottom: 4px; border-bottom: 1px solid var(--grid) !important; }
  table.mc td:first-child::before { content: none; }
  table.mc td:empty { display: none; }
  table.mc tr.sp, table.mc tr.sec:not(:has(td:nth-child(2))) { display: none; }
  table.mc tr.mc-x:not(.open) td.mc-h { display: none; }
  .card table.mc tbody { padding: 8px 8px 0; }
  table.mc tr.mc-x { cursor: pointer; }
  table.mc tr.mc-x::after { content: 'Xem đủ ▾'; display: block; font-size: 12px; color: var(--accent); padding-top: 4px; }
  table.mc tr.mc-x.open::after { content: 'Thu gọn ▴'; }
  table.mc td .tsub { text-align: right; }
  /* bảng giữ dạng bảng: chữ nhỏ, đệm hẹp, cột tên được xuống dòng */
  main table:not(.mc):not(.kq) th, main table:not(.mc):not(.kq) td { padding: 6px 5px; font-size: 12px; }
  main table:not(.mc):not(.kq) td:first-child { white-space: normal; min-width: 96px; }
}

/* Biểu đồ KQKD: % MKT trong thân cột — chữ trắng mảnh, > 45% hồng đậm, không khung (27/11) */
.chart .bar { align-items: flex-start; overflow: hidden; }
.chart .bar span, .chart.dense .bar span { font-size: 10px; font-weight: 500; color: rgba(255,255,255,.92); padding: 4px 0 0; letter-spacing: .1px; font-variant-numeric: tabular-nums; writing-mode: horizontal-tb; transform: none; white-space: nowrap; }
.chart .bar span.hi, .chart.dense .bar span.hi { background: none; color: #ffd0c9; font-weight: 700; border-radius: 0; margin: 0; padding: 4px 0 0; }
@media (max-width: 1100px) {
  .chart.dense .bar span, .chart.dense .bar span.hi { font-size: 9px; writing-mode: vertical-rl; transform: rotate(180deg); padding: 4px 0; }
}
.chart .bar.rr span { color: var(--accent); }
/* Icon "Đang xây dựng" trên thanh trên cùng (27/11) */
.wip { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #fff4e0; border: 1px solid #f3dcae; color: #b7791f; cursor: help; flex: none; }
.wip svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media print { .wip { display: none; } }

/* ---- Điện thoại: thanh chọn gọn 2 hàng (mọi trang có .toolbar với nav.tabs) — 27/11 ---- */
@media (max-width: 600px) {
  .toolbar > .spacer { display: none; }
  .toolbar > nav.tabs:first-child { flex: 1 1 100%; width: 100%; }
  .toolbar > nav.tabs:first-child button { flex: 1 1 0; padding: 0 4px; }
  .toolbar:has(> nav.tabs:first-child) > nav.tabs:not(:first-child) { flex: 1 1 0; min-width: 0; }
  .toolbar:has(> nav.tabs:first-child) > nav.tabs:not(:first-child) button { flex: 1 1 0; padding: 0 6px; white-space: nowrap; }
  .toolbar > .fl ~ nav.tabs { flex: 1 1 100%; width: 100%; order: 5; }
  .toolbar > .fl ~ nav.tabs button { flex: 1 1 0; }
  .toolbar > #reload { flex: none; width: var(--ctl-h); padding: 0; font-size: 0; }
  .toolbar > #reload::before { content: "↻"; font-size: 15px; line-height: 1; }
  .stick { padding: 6px 4px; }
  .page-title { flex-wrap: wrap; row-gap: 2px; }
  .page-title .asof { flex-basis: 100%; }
}
.tabs .sm { display: none; }
@media (max-width: 600px) { .tabs .lg { display: none; } .tabs .sm { display: inline; } }
/* KQKD: các cột số đều nhau; "chi MKT … tr" xuống 2 dòng thay vì kéo rộng cột (27/11) */
table.kq thead tr:last-child th:not(.gap), table.kq td:not(:first-child):not(.gap) { min-width: 88px; }
table.kq .cp { display: inline-block; white-space: normal; max-width: 72px; line-height: 1.25; text-align: right; }
@media (max-width: 760px) { table.kq thead tr:last-child th:not(.gap), table.kq td:not(:first-child):not(.gap) { min-width: 66px; } table.kq .cp { max-width: 56px; } }

/* ---- Rà điện thoại theo impeccable (adapt) + emil-design-eng (27/11) ---- */
@media (max-width: 600px) {
  /* Bỏ chữ "Kỳ", "Xem theo"… trước ô chọn (ô đã có aria-label) để ô chọn đủ chỗ, không cắt chữ */
  .toolbar .fl { font-size: 0; gap: 0; }
  .toolbar .fl select { font-size: 13px; }
  .toolbar .fl:first-child { flex-grow: 1.7; }
  /* Bảng lãi lỗ: giữ Khoản mục · Kỳ này · So với kỳ trước */
  table.pl th:nth-child(3), table.pl td:nth-child(3), table.pl th:nth-child(4), table.pl td:nth-child(4) { display: none; }
}
/* Bấm có phản hồi (thu nhẹ 0,97) — chỉ màn cảm ứng, không đổi chiều cao chuẩn 26px */
@media (pointer: coarse) {
  button, .tabs button, select { transition: transform 160ms cubic-bezier(.23, 1, .32, 1); }
  button:active, .tabs button:active { transform: scale(.97); }
}
@media (prefers-reduced-motion: reduce) { button:active, .tabs button:active { transform: none; } }

/* ---- Điện thoại theo skill hv-toi-uu-giao-dien-dien-thoai (27/11/2026) ----
   Đại Sư chốt: nút / ô chọn / tab trên điện thoại cao tối thiểu 44px (máy tính giữ chuẩn 26px của khung mẫu). */
@media (max-width: 600px) {
  button, select, input:not([type="checkbox"]):not([type="radio"]), a.btn { min-height: 44px; }
  .tabs { padding: 2px; }
  .tabs button { min-height: 40px; }
  header button, header .pdf-btn { min-height: 40px; }
  .toolbar > #reload { width: 44px; }
  .wip { width: 28px; height: 28px; }
  /* Ô nhập ≥ 16px để iPhone không tự phóng to khi chạm */
  input:not([type="checkbox"]):not([type="radio"]), textarea { font-size: 16px; }
  /* Ô số: bỏ nút tăng/giảm của trình duyệt (che mất số và đơn vị) */
  input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
  input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
  .cf-in input { padding-left: 6px; padding-right: 20px; }
  .cf-in i { right: 6px; }
  /* Tấm chọn dưới đáy: chừa vùng tai thỏ / thanh home */
  .sheet [role="option"] { min-height: 48px; }
}
/* Hover chỉ cho chuột: màn cảm ứng không giữ trạng thái hover sau khi chạm */
@media (hover: none) {
  .tabs button:hover { color: var(--text-2); }
  .tabs button[aria-selected="true"]:hover { color: var(--text); }
}
@media (max-width: 600px) {
  .navbtn { width: 44px; height: 44px; }
  /* Chữ không nhỏ hơn ~10,5px (skill: không thu chữ để nhồi) */
  .chart .val, .chart.dense .val { font-size: 10.5px; }
  .chart.dense .bar span, .chart.dense .bar span.hi { font-size: 10px; }
  .chip, .pd .u, .v small { font-size: 11px; }
}
@media (max-width: 600px) {
  .cf-in input:not([type="checkbox"]):not([type="radio"]) { padding: 2px 17px 2px 4px; letter-spacing: -.2px; }
  .cf-in i { right: 5px; font-size: 12px; }
  .cf-in input::placeholder { font-size: 13px; }
}

/* Menu: dấu "đang xây dựng" (cờ lê nhỏ màu hổ phách) — trang Chủ tịch chưa nghiệm thu (27/11) */
.side a .mwip, .side a.on .mwip, .side a.open .mwip, .fly a .mwip { width: 13px; height: 13px; flex: none; margin-left: -4px; color: #c08a2b; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.fly a .mwip { margin-left: 6px; vertical-align: -2px; }
.rail a .rwip { position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: #e0a43c; box-shadow: 0 0 0 1.5px var(--surface-2, #fff); }
@media (max-width: 600px) {
  /* Nút tải lại: chỉ biểu tượng, không khung nặng (Chủ tịch góp ý 27/11) */
  .toolbar > #reload { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
  .toolbar > #reload:active { background: var(--wash); }
  .toolbar > .fl ~ nav.tabs { margin-top: 2px; }
}
@media (max-width: 600px) { .side a { height: 44px; } }

/* Dấu "đang xây dựng" bản tinh gọn (27/11, Chủ tịch góp ý icon thô): chấm hổ phách nhỏ + chữ xám, không khung, không icon */
.wip { width: auto; height: auto; background: none; border: 0; border-radius: 0; display: inline-flex; align-items: center; gap: 6px; padding: 0 4px; font-size: 12px; color: var(--text-2); cursor: default; }
.wip i { width: 6px; height: 6px; border-radius: 50%; background: #d9a441; box-shadow: 0 0 0 3px rgba(217, 164, 65, .16); flex: none; }
.side a .mwip, .side a.on .mwip, .side a.open .mwip, .fly a .mwip { display: inline-block; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #d9a441; flex: none; vertical-align: middle; }
.fly a .mwip { margin-left: 8px; }
.rail a .rwip { width: 5px; height: 5px; top: 4px; right: 4px; background: #d9a441; box-shadow: none; }
@media (max-width: 600px) { .wip span { display: none; } .wip { width: auto; height: auto; padding: 0 6px; } .wip i { width: 7px; height: 7px; } }
/* Bỏ chấm ở menu (Chủ tịch: chấm vẫn xấu) → mục chưa nghiệm thu chỉ nhạt màu hơn, rê chuột ghi "đang xây dựng" (27/11) */
.rail a.is-wip { color: var(--muted, #9aa3ad); opacity: .62; }
.rail a.is-wip:hover, .rail a.is-wip.on, .rail a.is-wip.open { opacity: 1; }
.side a.is-wip:not(.on) { color: var(--muted, #8b949e); }
.side a.is-wip:not(.on) svg { opacity: .6; }
.fly a.is-wip:not(.on) { color: var(--muted, #8b949e); }
.wip-legend { margin: 14px 10px 0; font-size: 11px; color: var(--muted, #8b949e); }
.rail a.is-wip.on { color: var(--hv-green); }

/* Nhãn "Đang xây dựng" cạnh PDF: icon cờ lê tròn hổ phách (bản cũ) + chữ (27/11) */
.wip i { width: 22px; height: 22px; border-radius: 50%; background: #fff4e0; border: 1px solid #f3dcae; color: #b7791f; display: inline-grid; place-items: center; box-shadow: none; }
.wip i svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.wip span { color: #9a6a1c; font-size: 12px; }
@media (max-width: 600px) { .wip span { display: inline; font-size: 11.5px; } .wip i { width: 22px; height: 22px; } .wip { gap: 5px; padding: 0 2px; } }

/* ---- Điện thoại: thanh chọn phía trên nhẹ hơn (Chủ tịch: "khu vực phía trên vẫn xấu", 27/11) ----
   Ô chọn nền xám nhạt không viền; tab nội dung + tab kỳ (KQKD) dạng gạch chân thay khối hộp. */
@media (max-width: 600px) {
  .toolbar.stick { padding: 8px 4px 0; gap: 8px; }
  .toolbar select { border: 0; background-color: var(--surface-2); border-radius: 10px; font-size: 14px; padding-left: 12px; color: var(--text); }
  .toolbar > #reload { border-radius: 10px; }
  .toolbar > nav.tabs:first-child, .toolbar > .fl ~ nav.tabs {
    background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 0; gap: 0; margin: 0 -4px; width: calc(100% + 8px); }
  .toolbar > nav.tabs:first-child button, .toolbar > .fl ~ nav.tabs button {
    min-height: 42px; border-radius: 0; background: transparent; box-shadow: none; color: var(--text-2); font-weight: 500; font-size: 14px; }
  .toolbar > nav.tabs:first-child button[aria-selected="true"], .toolbar > .fl ~ nav.tabs button[aria-selected="true"] {
    color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--hv-green); background: transparent; }
  .toolbar:has(> nav.tabs:first-child) > nav.tabs:not(:first-child) { border: 0; background: var(--surface-2); border-radius: 10px; padding: 3px; }
  .toolbar:has(> nav.tabs:first-child) > nav.tabs:not(:first-child) button { min-height: 38px; border-radius: 8px; font-size: 13.5px; }
  .toolbar:has(> nav.tabs:first-child) > nav.tabs:first-child { order: -1; }
}

/* Xếp hạng: bảng giải mã điểm của 1 BU theo thị trường (27/11) */
.rk-pdetail:not(:empty) { margin: 12px 0 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.rk-pdetail > b { display: block; font-size: 13px; margin-bottom: 6px; }
.rk-detail { margin-top: 8px; overflow-x: auto; }
.rk-detail table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rk-detail th { font-size: 11.5px; font-weight: 500; color: var(--text-2); text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.rk-detail td { padding: 5px 6px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.rk-detail th.num, .rk-detail td.num { text-align: right; }
.rk-detail td.b { font-weight: 600; } .rk-detail td.neg { color: var(--bad); } .rk-detail td.muted { color: var(--text-2); }
.rk-detail p { margin: 6px 0 0; font-size: 11.5px; white-space: normal; }
.podium .pd.sel, .rk-list li.sel { box-shadow: 0 0 0 1.5px var(--accent) inset; }
@media (max-width: 600px) { .rk-detail table { font-size: 12px; } .rk-detail th, .rk-detail td { padding: 4px 4px; } }

/* ---- Điện thoại: thanh chọn phía trên làm lại (Chủ tịch: "vẫn xấu lắm", 27/11) ----
   Thanh trắng tràn mép, 1 hàng ô chọn gọn + hàng tab gạch chân; ô chọn tự vẽ mũi tên (bỏ ⌃⌄ của iPhone). */
@media (max-width: 600px) {
  .toolbar.stick { margin-left: -10px; margin-right: -10px; padding: 8px 10px 0; background: var(--surface); border-bottom: 1px solid var(--border); gap: 8px; }
  .toolbar.stick.stuck { box-shadow: 0 4px 12px rgba(16, 24, 40, .06); }
  .toolbar select {
    -webkit-appearance: none; appearance: none; height: 40px; min-height: 40px; padding: 0 30px 0 12px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 14px;
    font-size: 14px; font-weight: 500; color: var(--text); text-overflow: ellipsis; }
  .toolbar > #reload { width: 40px; min-height: 40px; height: 40px; }
  .toolbar > nav.tabs:first-child, .toolbar > .fl ~ nav.tabs { margin: 0 -10px; width: calc(100% + 20px); border-bottom: 0; }
  .toolbar > nav.tabs:first-child button, .toolbar > .fl ~ nav.tabs button { min-height: 40px; font-size: 13.5px; }
  .toolbar:has(> nav.tabs:first-child) { padding-bottom: 8px; }
  .toolbar:has(> nav.tabs:first-child) > nav.tabs:first-child { border-bottom: 1px solid var(--border); margin-bottom: 0; }
}
@media (max-width: 600px) {
  .toolbar > nav.tabs:first-child, .toolbar > .fl ~ nav.tabs { flex: 0 0 calc(100% + 20px); max-width: none; }
}
