/* CSDL kiểm tra CNTT – giao diện 11/11/2026.
   Nguyên tắc: (1) menu bên trái nhóm theo luồng việc; (2) màu ít, dùng có nghĩa (xanh = hành động, vàng = cần xem,
   đỏ = lỗi, xanh lá = ổn); (3) sáng/tối đều đạt tương phản; (4) chữ 15px, dòng 1.55 cho tiếng Việt có dấu;
   (5) mọi kiểu nằm trong tệp này vì CSP không cho style nội tuyến. */
:root {
  --bg:#f3f5f9; --surface:#fff; --surface-2:#f7f9fc; --ink:#152033; --muted:#566277; --line:#e2e7ef; --line-strong:#cbd4e1;
  --accent:#2152cc; --accent-hover:#183fa3; --accent-ink:#fff; --accent-soft:#e6edff; --focus:#7aa2ff;
  --side-bg:#0f1b33; --side-ink:#c5d0e6; --side-muted:#7f8fae; --side-hover:#1a2a4a; --side-on:#2c4a8f;
  --ok:#17692f; --ok-bg:#e4f4e9; --warn:#7a5200; --warn-bg:#fff3d1; --warn-line:#e8c766; --bad:#b3261e; --bad-bg:#fde8e7;
  --info-bg:#eaf1ff; --shadow:0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --radius:10px; --side-w:252px; --topbar-h:56px;
  --font:"Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;
  --mono:Consolas,"Cascadia Mono","Courier New",monospace;
  color-scheme:light;
}
:root[data-theme="dark"] {
  --bg:#0c1220; --surface:#141c2c; --surface-2:#192236; --ink:#e6ebf5; --muted:#9aa8c0; --line:#243049; --line-strong:#34425f;
  --accent:#7ea6ff; --accent-hover:#a3bfff; --accent-ink:#0a1220; --accent-soft:#1a2a50; --focus:#7ea6ff;
  --side-bg:#090f1c; --side-ink:#b9c6df; --side-muted:#71809f; --side-hover:#141f36; --side-on:#223a73;
  --ok:#62d08c; --ok-bg:#12301f; --warn:#f0c667; --warn-bg:#35290d; --warn-line:#6a5320; --bad:#ff948b; --bad-bg:#3a1917;
  --info-bg:#16264a; --shadow:0 1px 2px rgba(0,0,0,.4);
  color-scheme:dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#0c1220; --surface:#141c2c; --surface-2:#192236; --ink:#e6ebf5; --muted:#9aa8c0; --line:#243049; --line-strong:#34425f;
    --accent:#7ea6ff; --accent-hover:#a3bfff; --accent-ink:#0a1220; --accent-soft:#1a2a50; --focus:#7ea6ff;
    --side-bg:#090f1c; --side-ink:#b9c6df; --side-muted:#71809f; --side-hover:#141f36; --side-on:#223a73;
    --ok:#62d08c; --ok-bg:#12301f; --warn:#f0c667; --warn-bg:#35290d; --warn-line:#6a5320; --bad:#ff948b; --bad-bg:#3a1917;
    --info-bg:#16264a; --shadow:0 1px 2px rgba(0,0,0,.4);
    color-scheme:dark;
  }
}
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; font:15px/1.55 var(--font); background:var(--bg); color:var(--ink); }
a { color:var(--accent); text-underline-offset:2px; }
a:hover { color:var(--accent-hover); }
h1 { font-size:24px; line-height:1.3; margin:0 0 4px; letter-spacing:-.01em; }
h2 { font-size:18px; margin:20px 0 8px; }
h3 { font-size:15px; margin:14px 0 6px; }
p { margin:8px 0; }
hr { border:0; border-top:1px solid var(--line); margin:16px 0; }
:focus-visible { outline:2px solid var(--focus); outline-offset:2px; border-radius:4px; }
.skip { position:absolute; left:-999px; top:8px; background:var(--accent); color:var(--accent-ink); padding:8px 12px; border-radius:6px; z-index:100; }
.skip:focus { left:8px; }

[hidden] { display:none !important; }
/* ---------- khung ứng dụng ---------- */
.app { display:grid; grid-template-columns:var(--side-w) minmax(0,1fr); min-height:100vh; }
.app.anon { display:block; }
.side { background:var(--side-bg); color:var(--side-ink); position:sticky; top:0; height:100vh; overflow-y:auto; display:flex; flex-direction:column; padding:14px 10px; }
.brand { display:flex; flex-wrap:wrap; gap:6px 10px; align-items:center; padding:4px 8px 16px; text-decoration:none; color:#fff; }
.brand:hover { color:#fff; }
.brand-mark { width:34px; height:34px; border-radius:9px; background:linear-gradient(135deg,#3f73f0,#2152cc); display:grid; place-items:center; flex:none; }
.brand-mark svg { width:20px; height:20px; stroke:#fff; }
.brand b { display:block; font-size:15px; line-height:1.2; color:#fff; font-weight:700; }
.brand b.brand-sub { font-size:13px; line-height:1.25; color:#fff; font-weight:700; margin-top:1px; }
.brand-cuc { flex:0 0 100%; display:block; font-size:11.5px; color:var(--side-muted); line-height:1.35; }
.side-group { margin:10px 0 2px; padding:0 10px; font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--side-muted); font-weight:600; }
.side a.nav { display:flex; gap:10px; align-items:center; padding:8px 10px; border-radius:8px; color:var(--side-ink); text-decoration:none; font-size:14px; }
.side a.nav svg { width:18px; height:18px; flex:none; stroke:currentColor; opacity:.85; }
.side a.nav:hover { background:var(--side-hover); color:#fff; }
.side a.nav.on { background:var(--side-on); color:#fff; font-weight:600; }
.side a.nav.on svg { opacity:1; }
.side-foot { margin-top:auto; padding:12px 8px 0; font-size:12px; color:var(--side-muted); border-top:1px solid rgba(255,255,255,.08); }
.main { min-width:0; display:flex; flex-direction:column; }
.topbar { position:sticky; top:0; z-index:20; height:var(--topbar-h); display:flex; align-items:center; gap:12px; padding:0 20px; background:var(--surface); border-bottom:1px solid var(--line); }
.menu-btn { display:none; }
.gsearch { flex:1 1 360px; max-width:520px; position:relative; }
.gsearch input { padding-left:36px; background:var(--surface-2); height:38px; }
.gsearch svg { position:absolute; left:11px; top:10px; width:18px; height:18px; stroke:var(--muted); pointer-events:none; }
.gsearch kbd { position:absolute; right:10px; top:8px; font:12px var(--mono); color:var(--muted); border:1px solid var(--line-strong); border-radius:5px; padding:0 6px; background:var(--surface); }
.topbar .sp { flex:1; }
.iconbtn { width:38px; height:38px; display:grid; place-items:center; border:1px solid var(--line); background:var(--surface); color:var(--ink); border-radius:9px; padding:0; cursor:pointer; min-height:0; }
.iconbtn:hover { background:var(--surface-2); color:var(--ink); border-color:var(--line-strong); }
.iconbtn svg { width:18px; height:18px; stroke:currentColor; }
.user { position:relative; }
.user > summary { list-style:none; display:flex; gap:10px; align-items:center; cursor:pointer; padding:4px 6px 4px 4px; border-radius:10px; }
.user > summary::-webkit-details-marker { display:none; }
.user > summary:hover { background:var(--surface-2); }
.avatar { width:32px; height:32px; border-radius:50%; background:var(--accent-soft); color:var(--accent); display:grid; place-items:center; font-weight:700; font-size:13px; }
.who-name { font-size:13px; line-height:1.25; text-align:left; }
.who-name b { display:block; }
.who-name span { color:var(--muted); font-size:12px; }
.user-menu { position:absolute; right:0; top:calc(100% + 6px); min-width:210px; background:var(--surface); border:1px solid var(--line); border-radius:10px; box-shadow:0 8px 24px rgba(16,24,40,.18); padding:6px; z-index:30; }
.user-menu a, .user-menu button { display:block; width:100%; text-align:left; padding:8px 10px; border-radius:7px; color:var(--ink); text-decoration:none; background:none; border:0; font:inherit; font-weight:400; cursor:pointer; min-height:0; }
.user-menu a:hover, .user-menu button:hover { background:var(--surface-2); color:var(--ink); }
main { padding:22px 24px 8px; width:100%; max-width:1360px; margin:0 auto; flex:1; }
.foot { text-align:center; color:var(--muted); font-size:12px; padding:18px; }
.demo { background:var(--warn-bg); color:var(--warn); text-align:center; padding:5px; font-weight:600; font-size:13px; border-bottom:1px solid var(--warn-line); }
.page-head { display:flex; gap:16px; align-items:flex-end; justify-content:space-between; flex-wrap:wrap; margin-bottom:14px; }
.page-head p { margin:2px 0 0; color:var(--muted); }
.crumbs { color:var(--muted); font-size:13px; }
form.inline { display:inline; }

/* ---------- thành phần ---------- */
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:16px 18px; margin:12px 0; box-shadow:var(--shadow); }
.card > :first-child { margin-top:0; }
.card.sub { background:var(--surface-2); box-shadow:none; }
.narrow { max-width:420px; margin:40px auto; }
label { display:block; margin:10px 0; font-weight:500; font-size:14px; }
input, select, textarea { display:block; width:100%; padding:8px 10px; border:1px solid var(--line-strong); border-radius:8px; font:inherit; background:var(--surface); color:var(--ink); min-height:38px; }
input:hover, select:hover, textarea:hover { border-color:var(--muted); }
input:focus, select:focus, textarea:focus { outline:2px solid var(--focus); outline-offset:0; border-color:var(--accent); }
input[type=checkbox], input[type=radio] { width:auto; min-height:0; display:inline; accent-color:var(--accent); }
input::placeholder { color:var(--muted); opacity:.8; }
textarea { resize:vertical; }
button, .btn { display:inline-flex; gap:6px; align-items:center; justify-content:center; padding:8px 16px; border:1px solid var(--accent); background:var(--accent); color:var(--accent-ink); border-radius:8px; cursor:pointer; font:inherit; font-weight:600; text-decoration:none; min-height:38px; line-height:1.2; }
button svg, .btn svg { width:16px; height:16px; stroke:currentColor; flex:none; }
button, .btn { white-space:nowrap; }
button:hover, .btn:hover { background:var(--accent-hover); border-color:var(--accent-hover); color:var(--accent-ink); }
button.secondary, .btn.secondary { background:var(--surface); color:var(--ink); border-color:var(--line-strong); }
button.secondary:hover, .btn.secondary:hover { background:var(--surface-2); color:var(--ink); border-color:var(--muted); }
button.ghost { background:none; border-color:transparent; color:var(--accent); }
button.ghost:hover { background:var(--accent-soft); color:var(--accent); }
button.danger { background:var(--bad); border-color:var(--bad); color:#fff; }
button:disabled { opacity:.55; cursor:not-allowed; }
.flash { background:var(--warn-bg); border:1px solid var(--warn-line); color:var(--ink); padding:10px 14px; border-radius:8px; margin:8px 0; }
.flash.ai-ask { background:var(--info-bg); border-color:var(--line-strong); }
.muted { color:var(--muted); }
.small { font-size:12.5px; }
.err { color:var(--bad); }
.warn { background:var(--warn-bg); color:var(--ink); padding:6px 10px; border-radius:8px; border:1px solid var(--warn-line); }
.note { background:var(--info-bg); border-left:4px solid var(--accent); padding:10px 14px; border-radius:0 8px 8px 0; }
.alert { padding:10px 14px; border-radius:8px; border:1px solid; margin:8px 0; }
.alert.bad { background:var(--bad-bg); border-color:var(--bad); color:var(--ink); }
.alert.ok { background:var(--ok-bg); border-color:var(--ok); }
.alert.warn { background:var(--warn-bg); border-color:var(--warn-line); }
table { border-collapse:separate; border-spacing:0; width:100%; background:var(--surface); margin:8px 0 16px; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; }
th, td { padding:9px 12px; text-align:left; font-size:14px; vertical-align:top; border-bottom:1px solid var(--line); }
tr:last-child > td { border-bottom:0; }
th { background:var(--surface-2); color:var(--muted); font-weight:600; font-size:12.5px; letter-spacing:.02em; }
tbody tr:hover td { background:var(--surface-2); }
td.num, th.num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
tr.overdue td { background:var(--bad-bg); }
tr.subrow td { background:var(--surface-2); color:var(--muted); }
tr.subrow td:nth-child(2) { padding-left:28px; }
tr.warnrow td { background:var(--warn-bg); }
td.low { color:var(--bad); font-weight:600; }
tr.subtotal td { background:var(--surface-2); font-weight:600; }
tr.total td { background:var(--accent-soft); font-weight:700; }
tr.group td { background:var(--surface-2); font-weight:700; }
.tablewrap { overflow-x:auto; margin:8px 0 16px; border-radius:var(--radius); }
.tablewrap table { margin:0; min-width:640px; }
.stats { display:flex; gap:12px; flex-wrap:wrap; }
.stats .card { min-width:160px; }
.stats .card b { display:block; font-size:28px; }
.tiles { display:grid; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); gap:12px; margin:16px 0; }
.tile { text-decoration:none; color:var(--ink); }
.tile b { display:block; color:var(--accent); margin-bottom:6px; }
.tile:hover { border-color:var(--accent); }
form.row { display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end; }
form.row label { margin:0; min-width:150px; }
form.row label.grow { flex:1 1 280px; }
form.row label.chk { display:flex; gap:6px; align-items:center; min-width:0; font-weight:400; }
label.chk { display:flex; gap:8px; align-items:center; font-weight:400; }
label.chk input { width:auto; display:inline; }
.two { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.badge { display:inline-block; font-size:11.5px; padding:1px 8px; border-radius:999px; border:1px solid; white-space:nowrap; font-weight:600; }
.badge.de_xuat { color:var(--warn); background:var(--warn-bg); border-color:var(--warn-line); }
.badge.bi_bac { color:var(--bad); background:var(--bad-bg); border-color:var(--bad); }
.badge.ok { color:var(--ok); background:var(--ok-bg); border-color:var(--ok); }
.badge.loi { color:var(--bad); background:var(--bad-bg); border-color:var(--bad); }
.badge.canh_bao { color:var(--warn); background:var(--warn-bg); border-color:var(--warn-line); }
.badge.info { color:var(--accent); background:var(--accent-soft); border-color:var(--accent); }
.status.con_hieu_luc { color:var(--ok); }
.status.het_hieu_luc, .status.chua_co_can_cu { color:var(--bad); }
.status.het_hieu_luc_mot_phan, .status.chua_hieu_luc { color:var(--warn); }
p.status { font-weight:600; font-size:18px; }
.src { color:var(--muted); font-size:12px; word-break:break-all; }
.hits li { margin:10px 0; }
pre.text { white-space:pre-wrap; font-family:inherit; margin:0; }
.page.hl { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.split { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; align-items:start; }
.split .left { position:sticky; top:calc(var(--topbar-h) + 8px); max-height:calc(100vh - var(--topbar-h) - 16px); overflow:auto; }
.pageimg { width:100%; height:auto; border:1px solid var(--line); border-radius:8px; background:#fff; }
.actions { margin:10px 0; display:flex; gap:8px; flex-wrap:wrap; }
.code { font-family:var(--mono); font-size:12px; color:var(--accent); border:1px solid var(--line-strong); background:var(--accent-soft); border-radius:5px; padding:0 6px; white-space:nowrap; }
.code.big { font-size:15px; padding:1px 8px; vertical-align:middle; }

/* ---------- trang chủ ---------- */
.hero { display:flex; gap:16px; justify-content:space-between; align-items:flex-end; flex-wrap:wrap; margin-bottom:16px; }
.hero h1 { font-size:26px; }
.hero p { color:var(--muted); margin:2px 0 0; }
.kpis { display:grid; grid-template-columns:repeat(auto-fit, minmax(170px, 1fr)); gap:12px; margin:12px 0 18px; }
.kpi { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:14px 16px; box-shadow:var(--shadow); text-decoration:none; color:var(--ink); display:block; }
.kpi b { display:block; font-size:28px; line-height:1.15; font-variant-numeric:tabular-nums; }
.kpi span { color:var(--muted); font-size:13px; }
a.kpi:hover { border-color:var(--accent); color:var(--ink); }
.qa { display:grid; grid-template-columns:repeat(auto-fit, minmax(250px, 1fr)); gap:12px; margin:8px 0 20px; }
.qa a { display:flex; gap:12px; align-items:flex-start; padding:14px 16px; border-radius:var(--radius); border:1px solid var(--line); background:var(--surface); text-decoration:none; color:var(--ink); box-shadow:var(--shadow); }
.qa a:hover { border-color:var(--accent); transform:translateY(-1px); color:var(--ink); }
.qa .ic { width:38px; height:38px; border-radius:10px; background:var(--accent-soft); color:var(--accent); display:grid; place-items:center; flex:none; }
.qa .ic svg { width:20px; height:20px; stroke:currentColor; }
.qa b { display:block; }
.qa span.d { color:var(--muted); font-size:13px; }
.cols { display:grid; grid-template-columns:minmax(0,3fr) minmax(0,2fr); gap:16px; align-items:start; }
.todo { list-style:none; margin:0; padding:0; }
.todo li { display:flex; gap:10px; align-items:center; padding:9px 0; border-bottom:1px solid var(--line); }
.todo li:last-child { border-bottom:0; }
.todo .n { min-width:44px; text-align:center; font-weight:700; padding:2px 8px; border-radius:999px; background:var(--warn-bg); color:var(--warn); border:1px solid var(--warn-line); }
.todo .n.zero { background:var(--ok-bg); color:var(--ok); border-color:var(--ok); }
.feed { list-style:none; margin:0; padding:0; font-size:13px; }
.feed li { padding:6px 0; border-bottom:1px dashed var(--line); color:var(--muted); }
.feed time { color:var(--ink); font-variant-numeric:tabular-nums; margin-right:6px; }

/* ---------- kế hoạch, dự toán ---------- */
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.yearpick { display:flex; gap:8px; align-items:center; margin:6px 0 14px; }
.yearpick label { margin:0; color:var(--muted); font-weight:500; }
.yearpick select { width:auto; min-width:110px; font-weight:600; }
.yearpick .btn { min-width:38px; padding:8px 12px; font-size:18px; }
.yearpick span.btn { opacity:.4; cursor:not-allowed; }
.yearbar { display:flex; gap:6px; flex-wrap:wrap; margin:6px 0 14px; }
.yearbar a { padding:6px 14px; border-radius:999px; border:1px solid var(--line-strong); text-decoration:none; color:var(--ink); background:var(--surface); font-weight:600; }
.yearbar a.on { background:var(--accent); border-color:var(--accent); color:var(--accent-ink); }
.yearbar a:hover:not(.on) { background:var(--accent-soft); }
.plan-head { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.plan-head h2 { margin:0; }
.gantt { width:100%; height:auto; display:block; }
.gantt text { font:12px var(--font); fill:var(--muted); }
.gantt .lbl { fill:var(--ink); font-size:12.5px; }
.gantt .grid { stroke:var(--line); stroke-width:1; }
.gantt .bar { fill:var(--accent); }
.gantt .bar.loc { fill:#5f8aff; opacity:.75; }
.gantt .today { stroke:var(--bad); stroke-width:1.5; stroke-dasharray:4 3; }
.kv { display:grid; grid-template-columns:150px 1fr; gap:4px 14px; margin:6px 0; }
.kv dt { color:var(--muted); }
.kv dd { margin:0; }
.cmp td.flag { background:var(--warn-bg); font-weight:700; }
.cmp .chg { display:block; font-size:12px; color:var(--muted); font-weight:400; }
.cmp td.flag .chg { color:var(--warn); }
.checks { list-style:none; margin:0; padding:0; }
.checks li { display:flex; gap:10px; padding:7px 0; border-bottom:1px solid var(--line); align-items:flex-start; }
.checks li:last-child { border-bottom:0; }
.calc { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,3fr); gap:16px; align-items:start; }
.calc-stack { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; }
.param-group { padding:12px 0 8px; border-top:1px solid var(--line); }
.param-group:first-child { padding-top:0; border-top:0; }
.param-group-head { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:8px; margin-bottom:8px; }
.param-group h3 { margin:0; font-size:14px; color:var(--accent); text-transform:uppercase; letter-spacing:.03em; }
.param-sub { font-size:12.5px; color:var(--muted); }
.param-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(190px, 1fr)); gap:10px 12px; align-items:start; }
.param-grid label { margin:0; display:flex; flex-direction:column; gap:4px; font-size:13px; line-height:1.35; }
.param-grid label input, .param-grid label select { width:100%; font-size:14px; }
.param-grid label .hint { margin:0; font-size:12px; line-height:1.35; }
.param-grid input[data-money] { text-align:right; font-variant-numeric:tabular-nums; font-weight:600; }
.pccv-explain { margin-top:10px; padding:10px 12px; background:var(--info-bg); border:1px solid var(--line); border-left:4px solid var(--accent); border-radius:0 8px 8px 0; font-size:13px; line-height:1.5; }
.pccv-explain summary { cursor:pointer; font-weight:600; color:var(--ink); }
.norm-strip { display:grid; grid-template-columns:repeat(auto-fit, minmax(210px, 1fr)); gap:8px; margin-top:10px; }
.norm-card { background:var(--surface-2); border:1px solid var(--line); border-radius:8px; padding:8px 11px; font-size:12.5px; line-height:1.4; }
.norm-card.warn { background:var(--warn-bg); border-color:var(--warn-line); }
.norm-card.bad { background:var(--bad-bg); border-color:var(--bad); }
.norm-card b { display:block; font-size:14px; font-variant-numeric:tabular-nums; color:var(--ink); margin-top:2px; }
.fields { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:0 12px; }
.fields h3 { grid-column:1/-1; }
.result-total { font-size:26px; font-weight:700; font-variant-numeric:tabular-nums; }
.pillrow { display:flex; gap:8px; flex-wrap:wrap; margin:8px 0; }
.pill { padding:4px 12px; border-radius:999px; background:var(--accent-soft); color:var(--accent); font-size:13px; font-weight:600; }

/* ---------- Bảng dự toán kiểu Excel co dãn & chế độ nhiều đoàn ---------- */
.mode-bar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); }
.mode-tabs { display:flex; flex-wrap:wrap; gap:8px; }
.mode-tab { display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border-radius:8px; border:1px solid var(--line-strong); background:var(--surface-2); color:var(--ink); font-weight:600; font-size:13.5px; text-decoration:none; }
.mode-tab:hover { border-color:var(--accent); color:var(--accent); text-decoration:none; }
.mode-tab.active { background:var(--accent); border-color:var(--accent); color:var(--accent-ink); }
.mode-note { font-size:12.5px; color:var(--muted); }
.mt-10 { margin-top:10px; }
.m-0 { margin:0; }

.team-sum-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:8px; margin:10px 0 12px; }
.team-sum-card { background:var(--surface-2); border:1px solid var(--line); border-left:3px solid var(--accent); border-radius:6px; padding:8px 10px; font-size:12.5px; }
.team-sum-card b { display:block; font-size:13.5px; color:var(--ink); }
.team-sum-card .team-places { color:var(--muted); margin:2px 0 4px; }
.team-sum-card .team-money { font-variant-numeric:tabular-nums; font-weight:700; color:var(--accent); }

.excel-kpi-strip { display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:10px; margin:8px 0 12px; }
.excel-kpi { background:var(--surface-2); border:1px solid var(--line); border-radius:8px; padding:8px 12px; }
.excel-kpi span { display:block; font-size:12px; color:var(--muted); }
.excel-kpi b { display:block; font-size:17px; font-variant-numeric:tabular-nums; color:var(--ink); margin-top:2px; }
.excel-kpi.primary { background:var(--accent-soft); border-color:var(--accent); }
.excel-kpi.primary b { color:var(--accent); }
.excel-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; padding:8px 10px; background:var(--surface-2); border:1px solid var(--line-strong); border-bottom:0; border-radius:var(--radius) var(--radius) 0 0; }
.excel-toolbar .excel-tools-left, .excel-toolbar .excel-tools-right { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.excel-tip { font-size:12px; color:var(--muted); }
.excel-wrap { overflow-x:auto; border:1px solid var(--line-strong); border-radius:0 0 var(--radius) var(--radius); background:var(--surface); }
.excel-wrap.standalone { border-radius:var(--radius); }
table.excel-sheet { width:100%; min-width:960px; margin:0; border:0; border-radius:0; border-collapse:collapse; overflow:visible; background:var(--surface); }
table.excel-sheet.trips-sheet { min-width:1280px; }
table.excel-sheet th, table.excel-sheet td { border:1px solid var(--line-strong); padding:0; vertical-align:middle; }
table.excel-sheet thead th { position:relative; background:var(--surface-2); color:var(--ink); font-size:12px; font-weight:700; white-space:nowrap; user-select:none; padding:6px 14px 6px 8px; border-bottom:2px solid var(--line-strong); text-align:left; }
table.excel-sheet thead th.num { text-align:right; }
table.excel-sheet thead th.ctr { text-align:center; padding-right:8px; }
table.excel-sheet thead th .col-letter { display:inline-block; font-size:10px; font-weight:700; color:var(--accent); background:var(--accent-soft); padding:0 5px; border-radius:3px; margin-right:5px; font-family:var(--mono); }
table.excel-sheet .col-resizer { position:absolute; top:0; right:-3px; bottom:0; width:8px; cursor:col-resize; z-index:3; touch-action:none; }
table.excel-sheet .col-resizer::after { content:""; position:absolute; top:4px; bottom:4px; left:3px; width:2px; border-radius:2px; background:transparent; transition:background .12s; }
table.excel-sheet th:hover .col-resizer::after, table.excel-sheet .col-resizer.dragging::after { background:var(--accent); }
table.excel-sheet tbody tr.dt-row td, table.excel-sheet tbody tr.trip-row td { background:var(--surface); transition:box-shadow .08s ease; }
table.excel-sheet tbody tr.dt-row:nth-child(even) td { background:rgba(148, 163, 184, 0.04); }
table.excel-sheet tbody tr.dt-row:hover td, table.excel-sheet tbody tr.trip-row:hover td { background:rgba(37, 99, 235, 0.03); }
table.excel-sheet tbody tr.dt-row.warnrow td { background:var(--warn-bg); }
table.excel-sheet tbody td.excel-cell:hover { box-shadow:inset 0 0 0 1px var(--accent); }
table.excel-sheet tbody td.excel-cell:focus-within { box-shadow:inset 0 0 0 2px var(--accent); background:var(--surface); }
table.excel-sheet td.dt-tt { text-align:center; font-family:var(--mono); font-size:12px; font-weight:600; color:var(--muted); width:60px; min-width:58px; padding:4px; background:var(--surface-2) !important; vertical-align:middle; }
.dt-tt-wrap { display:flex; align-items:center; justify-content:center; gap:4px; }
.dt-tt-num { min-width:14px; text-align:center; }
.dt-move-btns { display:flex; flex-direction:column; gap:2px; }
.btn-move-row { border:1px solid var(--border); background:var(--surface); color:var(--text); font-size:10px; line-height:1; padding:2px 4px; border-radius:4px; cursor:pointer; }
.btn-move-row:hover:not(:disabled) { border-color:var(--accent); color:var(--accent); background:rgba(37, 99, 235, 0.08); }
.btn-move-row:disabled { opacity:0.35; cursor:not-allowed; }
table.excel-sheet td.dt-group-cell { padding:6px 8px; font-size:12.5px; line-height:1.35; vertical-align:top; min-width:155px; }
table.excel-sheet td.dt-group-cell.excel-cell { padding:0; }
table.excel-sheet td.dt-group-cell b { display:block; color:var(--ink); font-weight:600; }
.dt-group-meta { padding:0 9px 5px; }
table.excel-sheet td.dt-amt, table.excel-sheet td.dt-period-amt { padding:6px 9px; font-weight:700; font-variant-numeric:tabular-nums; text-align:right; white-space:nowrap; background:var(--surface-2) !important; }
table.excel-sheet td.dt-readonly-cell { padding:6px 9px; font-size:13px; line-height:1.4; vertical-align:top; }
table.excel-sheet td.dt-readonly-cell.num { text-align:right; font-variant-numeric:tabular-nums; font-weight:600; }
table.excel-sheet td.dt-readonly-cell.ctr { text-align:center; color:var(--muted); }
.excel-ta { width:100%; min-width:0; min-height:34px; box-sizing:border-box; padding:7px 9px; border:0; border-radius:0; background:transparent; color:var(--ink); font:inherit; line-height:1.42; resize:none; overflow:hidden; white-space:pre-wrap; word-break:break-word; display:block; }
.excel-ta:focus, .excel-cell-in:focus, .excel-cell-sel:focus { outline:none; }
.excel-ta-group { font-size:12.5px; font-weight:600; }
.excel-ta-item { font-weight:600; font-size:13.5px; }
.excel-ta-note { font-size:12.5px; color:var(--muted); }
.excel-cell-in, .excel-cell-sel { width:100%; min-width:0; min-height:34px; box-sizing:border-box; padding:6px 8px; border:0; border-radius:0; background:transparent; color:var(--ink); font:inherit; font-size:13px; }
.excel-cell-in.num { text-align:right; font-variant-numeric:tabular-nums; font-weight:600; }
.excel-cell-in.unit { text-align:center; font-size:12.5px; color:var(--ink); min-width:7ch; }
.excel-cell-in.yr { text-align:center; font-variant-numeric:tabular-nums; font-weight:600; min-width:5ch; }
.excel-money { text-align:right; font-variant-numeric:tabular-nums; font-weight:600; min-width:11ch; }
.excel-basis-cell { padding:6px 9px !important; font-size:12.5px; line-height:1.4; min-width:240px; vertical-align:top !important; }
.excel-basis-foot { margin-top:6px; display:flex; justify-content:flex-end; }
.basis-picker { margin-top:6px; display:flex; flex-direction:column; gap:5px; }
.basis-sel { width:100%; max-width:100%; min-height:28px; font-size:12px; padding:3px 6px; border:1px solid var(--line-strong); border-radius:6px; background:var(--surface-2); color:var(--ink); }
.basis-new-box { padding:7px 8px; border:1px dashed var(--accent); border-radius:6px; background:var(--surface); display:flex; flex-direction:column; gap:5px; }
.basis-new-box[hidden] { display:none; }
.basis-new-title { font-size:11.5px; font-weight:700; color:var(--accent); }
.basis-new-grid { display:grid; grid-template-columns:1fr 1fr; gap:4px; }
.basis-in { width:100%; min-width:0; box-sizing:border-box; padding:4px 6px; font-size:12px; border:1px solid var(--line-strong); border-radius:4px; background:var(--surface-2); color:var(--ink); }
.dt-trip-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; }
.dt-gop-opt { display:inline-flex; align-items:center; gap:7px; font-size:13px; font-weight:600; color:var(--ink); cursor:pointer; }
.dt-gop-opt input { width:auto; min-height:auto; margin:0; }
.excel-action-cell { padding:4px 6px !important; text-align:center; }
table.excel-sheet tr.subtotal td { padding:7px 9px; background:var(--surface-2); font-weight:700; }
table.excel-sheet tr.total td { padding:8px 9px; background:var(--accent-soft); font-weight:700; color:var(--ink); }
.excel-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; margin-top:10px; padding:10px 12px; background:var(--surface-2); border:1px solid var(--line); border-radius:8px; }

/* ---------- đăng nhập ---------- */
.login { min-height:100vh; display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); }
.login-art { background:radial-gradient(1200px 600px at 20% 10%, #25427f 0%, #0f1b33 60%); color:#dbe5fb; padding:48px 56px; display:flex; flex-direction:column; justify-content:space-between; }
.login-art .brand { padding:0; }
.login-art h2 { font-size:30px; line-height:1.25; margin:0 0 14px; color:#fff; letter-spacing:-.01em; }
.login-art p { color:#aebcdc; max-width:46ch; }
.login-art ul { list-style:none; padding:0; margin:24px 0 0; display:grid; gap:14px; }
.login-art li { display:flex; gap:12px; align-items:flex-start; }
.login-art li svg { width:22px; height:22px; stroke:#8fb0ff; flex:none; margin-top:2px; }
.login-art li b { color:#fff; display:block; }
.login-art li span { font-size:13.5px; color:#aebcdc; }
.login-art small { color:#7f8fae; }
.login-form { display:flex; align-items:center; justify-content:center; padding:32px 24px; background:var(--bg); }
.login-box { width:100%; max-width:380px; }
.login-box h1 { font-size:26px; }
.login-box .sub { color:var(--muted); margin:0 0 20px; }
.pw { position:relative; }
.pw input { padding-right:84px; }
.pw button { position:absolute; right:4px; top:3px; min-height:32px; padding:4px 10px; font-size:13px; }
.login-box .btn-block { width:100%; min-height:44px; font-size:16px; margin-top:6px; }
.hint { font-size:13px; color:var(--muted); margin:6px 0 0; }
.capshint { color:var(--warn); background:var(--warn-bg); border:1px solid var(--warn-line); border-radius:6px; padding:2px 8px; font-size:12.5px; margin-top:6px; display:none; }
.capshint.show { display:block; }
.login-box .tools { display:flex; justify-content:space-between; align-items:center; margin-top:18px; }

/* ---------- cẩm nang ---------- */
.tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); margin:4px 0 16px; flex-wrap:wrap; }
.tabs a { padding:8px 14px; text-decoration:none; color:var(--muted); border:1px solid transparent; border-bottom:none; border-radius:8px 8px 0 0; font-weight:500; }
.tabs a:hover { color:var(--ink); background:var(--surface-2); }
.tabs a.on { background:var(--surface); border-color:var(--line); color:var(--accent); font-weight:600; margin-bottom:-1px; }
.cn { display:grid; grid-template-columns:290px minmax(0,1fr); gap:16px; align-items:start; }
.cn-side { position:sticky; top:calc(var(--topbar-h) + 8px); max-height:calc(100vh - var(--topbar-h) - 16px); overflow:auto; }
.cn-ver { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); margin-bottom:10px; overflow:hidden; }
.cn-ver.on { border-color:var(--accent); }
.cn-ver-head { display:block; padding:10px 12px; text-decoration:none; color:var(--ink); }
.cn-ver-head span { display:block; }
.cn-ver.on .cn-ver-head { background:var(--accent-soft); }
.cn-areas { list-style:none; margin:0; padding:4px 0; }
.cn-areas a { display:flex; gap:6px; align-items:baseline; padding:6px 12px; text-decoration:none; color:var(--ink); }
.cn-areas a:hover { background:var(--surface-2); }
.cn-areas a.on { background:var(--accent); color:var(--accent-ink); }
.cn-areas a.on .code, .cn-areas a.on .count { color:var(--accent-ink); border-color:currentColor; background:transparent; }
.count { margin-left:auto; font-size:12px; color:var(--muted); border:1px solid var(--line-strong); border-radius:999px; padding:0 7px; }
.cn-head { display:flex; gap:16px; align-items:flex-end; justify-content:space-between; flex-wrap:wrap; }
.cn-head h2 { margin:2px 0; }
.cn-search { flex:1 1 360px; }
.legend { color:var(--muted); margin:8px 0 12px; }
.cn-group { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); margin:10px 0; overflow:hidden; }
.cn-group > summary { cursor:pointer; padding:10px 14px; font-weight:600; display:flex; gap:8px; align-items:baseline; list-style-position:inside; }
.cn-group[open] > summary { border-bottom:1px solid var(--line); background:var(--surface-2); }
.cn-items { list-style:none; margin:0; padding:0; }
.cn-item { padding:10px 14px; border-bottom:1px solid var(--line); }
.cn-item:last-child { border-bottom:none; }
.cn-item:hover { background:var(--surface-2); }
.cn-item-link { display:flex; gap:8px; align-items:baseline; text-decoration:none; color:var(--ink); }
.cn-item-link:hover .cn-title { color:var(--accent); text-decoration:underline; }
.cn-title { font-weight:500; }
.cn-crit { margin:4px 0 6px; color:var(--muted); font-size:13px; white-space:pre-line; }
.chips { display:flex; gap:6px; flex-wrap:wrap; align-items:center; margin-top:4px; }
.chip { font-size:11.5px; padding:1px 9px; border-radius:999px; background:var(--surface-2); border:1px solid var(--line-strong); color:var(--muted); white-space:nowrap; }
.chip.kt { background:var(--bad-bg); border-color:var(--bad); color:var(--bad); }
.chip.hs { background:var(--accent-soft); border-color:var(--accent); color:var(--accent); }
.chip.warnchip { background:var(--warn-bg); border-color:var(--warn-line); color:var(--warn); }
.cn-sources { margin-top:16px; }
.cn-item-head h1 { font-size:22px; line-height:1.35; }
.cn-detail { display:grid; grid-template-columns:minmax(0,3fr) minmax(0,2fr); gap:12px; align-items:start; }
.cn-cross { border-left:3px solid var(--accent); padding:4px 10px; margin:8px 0; }
.cn-pager { display:flex; justify-content:space-between; gap:12px; margin:16px 0; }
table.cmp td:nth-child(2) { white-space:nowrap; text-align:center; width:110px; }

/* ---------- đáp ứng và in ---------- */
@media (max-width: 980px) {
  .app { grid-template-columns:1fr; }
  .side { position:fixed; left:0; top:0; bottom:0; width:min(84vw, 300px); transform:translateX(-102%); transition:transform .2s; z-index:50; box-shadow:0 0 40px rgba(0,0,0,.4); }
  body.menu-open .side { transform:none; }
  body.menu-open::after { content:""; position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:40; }
  .menu-btn { display:grid; }
  .gsearch kbd, .who-name { display:none; }
  main { padding:16px 14px 6px; }
  .cols, .calc, .login, .cn, .cn-detail, .split, .two { grid-template-columns:minmax(0,1fr); }
  .cols > *, .calc > *, .cn > *, .split > * { min-width:0; }
  .login-art { display:none; }
  .split .left, .cn-side { position:static; max-height:none; }
}
@media (max-width: 560px) { .fields { grid-template-columns:1fr; } .kv { grid-template-columns:1fr; } h1 { font-size:21px; } }
@media (prefers-reduced-motion: reduce) { * { transition:none !important; } .qa a:hover { transform:none; } }
@media print {
  .side, .topbar, .tabs, .cn-side, .cn-search, .cn-pager, form, .foot, .skip, .actions { display:none !important; }
  .app { display:block; } body { background:#fff; color:#000; } main { max-width:none; padding:0; }
  .cn, .cn-detail { grid-template-columns:1fr; } details { display:block; } .card, .cn-group { border:none; box-shadow:none; }
}

/* Luồng K: cây đơn vị bóc tách (không dùng style nội tuyến vì CSP) */
.dv-d1 { padding-left:1.2em; } .dv-d2 { padding-left:2.4em; } .dv-d3 { padding-left:3.6em; } .dv-d4 { padding-left:4.8em; }

/* Trang Hướng dẫn – tab điều hướng */
.help-tabs { display:flex; gap:4px; margin-bottom:12px; border-bottom:2px solid var(--line); padding-bottom:0; }
.help-tabs a { padding:7px 16px; border-radius:8px 8px 0 0; text-decoration:none; color:var(--muted); font-size:14px; font-weight:500; border:1px solid transparent; border-bottom:none; }
.help-tabs a:hover { background:var(--surface-2); color:var(--ink); }
.help-tabs a.on { background:var(--surface); color:var(--accent); border-color:var(--line); border-bottom:2px solid var(--surface); margin-bottom:-2px; font-weight:600; }
.help-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.help-actions .btn { display:inline-flex; align-items:center; gap:5px; }
.help-actions .btn svg { width:15px; height:15px; }
.help-body { margin-top:0; border-top-left-radius:0; }
.help-body h2 { border-bottom:1px solid var(--line); padding-bottom:6px; }
.help-body pre.text { background:var(--surface-2); border:1px solid var(--line); border-radius:8px; padding:12px 16px; font:13px/1.6 var(--mono); overflow-x:auto; white-space:pre; }
.help-body table { border-collapse:collapse; width:100%; font-size:14px; }
.help-body td, .help-body th { border:1px solid var(--line); padding:6px 10px; text-align:left; vertical-align:top; }
.help-body tr:nth-child(even) td { background:var(--surface-2); }
/* Hướng dẫn – chế độ chỉnh sửa */
.help-editor-wrap { margin-top:0; border-top-left-radius:0; }
.help-editor { width:100%; min-height:72vh; padding:14px 16px; font:13px/1.65 var(--mono); background:var(--surface-2); border:1px solid var(--line); border-radius:8px; color:var(--ink); resize:vertical; display:block; }
.help-editor:focus { outline:2px solid var(--focus); border-color:var(--accent); }
.help-editor-bar { display:flex; gap:10px; align-items:center; margin-top:10px; flex-wrap:wrap; }
.help-charcount { margin-left:auto; }
tr.on > td { background:var(--accent-soft); }
/* Thanh quay lại màn hình trước */
.backbar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 12px; }
.backbar .crumbs { margin:0; }
.back-top-btn { min-height:34px; padding:5px 11px; font-size:13.5px; }
.flash.scan-done { background:var(--ok-bg); border-color:var(--ok); color:var(--ok); display:flex; flex-wrap:wrap; align-items:center; gap:8px; }

/* Trang Hướng dẫn – trình bày văn bản hành chính (mục lục, bước, hộp Ví dụ/Lưu ý) */
.help-body { line-height:1.65; }
.help-body h2 { font-size:22px; margin-top:4px; }
.help-body h3 { margin-top:28px; color:var(--accent); }
.help-body h4 { margin-top:18px; }
.help-anchor { display:block; position:relative; top:-70px; visibility:hidden; }
.help-toc { border:1px solid var(--line); background:var(--surface-2); border-radius:10px; padding:10px 18px; margin:12px 0 18px; }
.help-toc-title { font-weight:600; margin:0 0 4px; }
.help-toc ul { list-style:none; margin:0; padding:0; columns:2; column-gap:28px; }
.help-toc li { margin:3px 0; break-inside:avoid; }
.help-toc a { text-decoration:none; }
.help-toc a:hover { text-decoration:underline; }
ol.help-steps { counter-reset:buoc; list-style:none; padding-left:0; }
ol.help-steps > li { counter-increment:buoc; position:relative; padding:6px 10px 6px 76px; margin:4px 0; border-left:3px solid var(--accent); background:var(--surface-2); border-radius:0 8px 8px 0; }
ol.help-steps > li::before { content:"Bước " counter(buoc); position:absolute; left:10px; top:6px; font-weight:600; color:var(--accent); }
ol.help-alpha { list-style:none; padding-left:6px; } ol.help-alpha > li { margin:5px 0; padding-left:1.6em; text-indent:-1.6em; }
.help-k { display:inline-block; min-width:1.6em; text-indent:0; font-weight:600; }
.help-box { border-radius:10px; padding:10px 14px; margin:12px 0; border:1px solid var(--line); }
.help-box p { margin:4px 0; }
/* Hộp luôn nền sáng, chữ sẫm: đọc rõ ở cả giao diện sáng lẫn tối (kể cả tối theo hệ điều hành) */
.help-box, .help-box p, .help-box li { color:#1d2433; }
.help-box code { color:#1d2433; background:rgba(0,0,0,.06); }
.help-box.vi-du { background:#eef4ff; border-color:#b9cdf5; }
.help-box.luu-y, .help-box.goi-y { background:#fff7e8; border-color:#f0d19a; }
.help-box.quan-trong { background:#fdeeee; border-color:#eab4b4; }
.help-box-label { color:#1f3f8f; }
.help-box.luu-y .help-box-label, .help-box.goi-y .help-box-label { color:#8a5a00; }
.help-box.quan-trong .help-box-label { color:#9b1c1c; }
.help-table { overflow-x:auto; margin:10px 0; }
.help-body th { background:var(--surface-2); font-weight:600; border:1px solid var(--line); padding:6px 10px; text-align:left; }
@media print {
  .help-actions, .help-tabs { display:none !important; }
  .help-toc ul { columns:1; } .help-box, ol.help-steps > li { break-inside:avoid; }
  .help-box.vi-du, .help-box.luu-y, .help-box.goi-y, .help-box.quan-trong, ol.help-steps > li { background:#fff !important; }
}
