/* ===== Design token — sinh từ logo AMERICAN STAR (AS_logo.png) =====
   navy #041E42 (55% logo) · crimson #BF0C3E (28%) · cool grey #D9D9D6 (16%)
   Đỏ thương hiệu trùng nghĩa "vượt kế hoạch / lỗ" nên màu "tốt" dùng teal ngoài brand. */
:root {
  --navy: #041E42;
  --navy-700: #0A2F5E;
  --navy-500: #1F4E79;
  --navy-300: #6FA8DC;
  --crimson: #BF0C3E;
  --crimson-50: #FDECF1;
  --grey: #D9D9D6;
  --good: #0E7C66;
  --good-50: #E7F4F1;
  --warn: #B8860B;

  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --surface-2: #F1F3F6;
  --text: #10213A;
  --text-dim: #5A6B82;
  --text-faint: #8A97A8;
  --border: #E2E6EC;
  --border-strong: #CBD2DC;

  --radius: 6px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --sidebar-w: 232px;
  --header-h: 56px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  --bg: #0B1420; --surface: #111E2E; --surface-2: #17273A;
  --text: #E8EDF4; --text-dim: #9FB0C4; --text-faint: #6E8299;
  --border: #223449; --border-strong: #2E4560;
  --navy-300: #8FC0F0; --good-50: #10312A; --crimson-50: #34101C;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--navy-500); outline-offset: 2px; }

/* ===== Khung ===== */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--navy); color: #fff; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { padding: var(--s4) var(--s4) var(--s3); border-bottom: 1px solid rgba(255,255,255,.12); }
.brand img { width: 100%; max-width: 168px; display: block; background: #fff; padding: 6px 8px; border-radius: 4px; }
.brand small { display: block; margin-top: var(--s2); color: rgba(255,255,255,.62); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }

.nav { padding: var(--s3) var(--s2); display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: var(--s3); padding: 9px var(--s3);
  color: rgba(255,255,255,.78); text-decoration: none; border-radius: var(--radius);
  font-size: 13.5px; transition: background 150ms, color 150ms;
}
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a[aria-current="page"] { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
.nav a[aria-current="page"] .ico { color: var(--navy-300); }
.nav .ico { width: 18px; height: 18px; flex: 0 0 18px; color: rgba(255,255,255,.55); }
.nav .no { margin-left: auto; font-size: 11px; color: rgba(255,255,255,.4); }

.side-status { margin-top: auto; padding: var(--s4); border-top: 1px solid rgba(255,255,255,.12); font-size: 12px; color: rgba(255,255,255,.6); }
.side-status b { color: #fff; font-weight: 600; }
.side-status .row { display: flex; justify-content: space-between; gap: var(--s2); padding: 3px 0; }

/* ===== Header ===== */
.main { display: flex; flex-direction: column; min-width: 0; }
.header {
  height: var(--header-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: var(--s4); padding: 0 var(--s5);
  position: sticky; top: 0; z-index: 20;
}
.header h1 { font-size: 15px; font-weight: 600; margin: 0; white-space: nowrap; }
.filters { display: flex; align-items: center; gap: var(--s4); margin-left: auto; flex-wrap: wrap; }
.fgroup { display: flex; align-items: center; gap: var(--s2); }
.fgroup > label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); }
select, .btn {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 5px var(--s2); font-size: 13px;
}
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.seg button { background: var(--surface); border: 0; padding: 5px 11px; font-size: 12.5px; color: var(--text-dim); border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; font-weight: 600; }
.btn:hover { border-color: var(--navy-500); }
.btn-sm { padding: 3px 8px; font-size: 12px; }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 500; }
.btn-primary:hover { background: var(--navy-700); }

/* ===== Nội dung ===== */
.content { padding: var(--s5); flex: 1; min-width: 0; }
.page-head { margin-bottom: var(--s4); }
.page-head h2 { margin: 0 0 var(--s1); font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.page-head p { margin: 0; color: var(--text-dim); font-size: 13px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-head { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: var(--s3); }
.card-head h3 { margin: 0; font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }
.card-body { padding: var(--s4); }

.empty { text-align: center; padding: var(--s6) var(--s4); color: var(--text-dim); }
.empty .big { font-size: 15px; color: var(--text); font-weight: 600; margin-bottom: var(--s2); }
.empty svg { width: 40px; height: 40px; color: var(--border-strong); margin-bottom: var(--s3); }

/* ===== Cảnh báo chân trang ===== */
.notices { position: sticky; bottom: 0; z-index: 15; display: flex; flex-direction: column; gap: 1px; }
.notice {
  display: flex; align-items: center; gap: var(--s3); padding: 10px var(--s5);
  font-size: 13px; border-top: 1px solid var(--border);
}
.notice.warning { background: #FFF8E6; color: #6B4E00; }
.notice.danger { background: var(--crimson-50); color: #7A0827; }
.notice.ok { background: var(--good-50); color: #0A5548; }
:root[data-theme="dark"] .notice.warning { background: #33280A; color: #F5D98A; }
.notice svg { width: 16px; height: 16px; flex: 0 0 16px; }
.notice .act { margin-left: auto; }
.notice .act button { background: transparent; border: 1px solid currentColor; color: inherit; border-radius: var(--radius); padding: 3px 10px; font-size: 12px; }

.pos { color: var(--good); }
.neg { color: var(--crimson); }
.dim { color: var(--text-dim); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.tag.good { background: var(--good-50); color: var(--good); }
.tag.bad { background: var(--crimson-50); color: var(--crimson); }
.tag.neutral { background: var(--surface-2); color: var(--text-dim); }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav { flex-direction: row; overflow-x: auto; }
  .side-status { display: none; }
}

/* ===== Bảng ===== */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 6px var(--s3); border-bottom: 1px solid var(--border); text-align: left; }
.tbl thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); font-weight: 600; background: var(--surface-2); }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 1px 4px; border-radius: 3px; }

/* ===== Lưới P&L (3 tầng tiêu đề: tháng > ngành > chỉ tiêu) ===== */
.grid-wrap {
  overflow: auto; max-height: calc(100vh - 232px);
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  scrollbar-gutter: stable;
  overflow-anchor: none;   /* tắt neo cuộn của Chrome, tránh nó tự dịch khi bảng vẽ lại */
}
/* Thanh cuộn ngang của macOS nổi lên đè mất dòng cuối (LỢI NHUẬN RÒNG).
   Ô đệm này nằm trong vùng cuộn nên luôn chừa đủ chỗ cho thanh cuộn. */
.grid-pad { height: 18px; }
table.pl { border-collapse: separate; border-spacing: 0; font-size: 12px; width: max-content; min-width: 100%; }
table.pl th, table.pl td { padding: 0 6px; height: 26px; white-space: nowrap; border-bottom: 1px solid var(--border); }

table.pl thead th { position: sticky; z-index: 3; color: #fff; text-align: center; font-weight: 600; }
table.pl thead th.lvl1 { top: 0; height: 26px; background: var(--navy); font-size: 11.5px; letter-spacing: .06em; }
table.pl thead th.lvl2 { top: 26px; height: 24px; background: var(--navy-700); font-size: 10.5px; letter-spacing: .04em; font-weight: 500; }
table.pl thead th.lvl3 { top: 50px; height: 24px; background: var(--navy-500); font-size: 10.5px; text-align: right; font-weight: 500; }
table.pl thead th .sub-pct { color: rgba(255,255,255,.6); font-weight: 400; font-size: 9.5px; }

/* $ và % trong CÙNG một ô: $ là số chính, % là chữ nhỏ mờ để tham khảo.
   KHÔNG dùng flex trên <td> — sẽ phá layout bảng. Dùng inline-block bề rộng cố định
   cho phần %, nhờ vậy các cột số $ vẫn thẳng hàng nhau. */
table.pl td.num { text-align: right; }
table.pl td.num > .p {
  display: inline-block; width: 32px; margin-left: 3px; text-align: right;
  font-size: 9px; letter-spacing: -0.02em;
  /* đậm hơn 1 bậc so với trước (faint -> dim) và weight 400 -> 500 để dễ đọc */
  font-weight: 500; color: var(--text-dim);
}

table.pl th.line, table.pl td.line {
  position: sticky; left: 0; z-index: 2; background: var(--surface); text-align: left;
  min-width: 258px; max-width: 258px; border-right: 2px solid var(--border-strong);
  overflow: hidden; text-overflow: ellipsis;
}
/* ô CHỈ TIÊU gộp 3 dòng: phải ghim CẢ dọc lẫn ngang, nếu không nó trôi đè lên dữ liệu */
table.pl thead th.line {
  z-index: 5; top: 0; height: 74px; background: var(--navy);
  vertical-align: bottom; padding-bottom: 6px; font-size: 11px; text-align: left;
  border-bottom: 1px solid var(--navy-700);
}
table.pl td { text-align: right; }
table.pl td.num { font-variant-numeric: tabular-nums; }

/* vạch phân cách: đậm ở đầu mỗi tháng, nhạt ở đầu mỗi khối ngành */
table.pl .pstart { border-left: 2px solid var(--border-strong); }
table.pl .istart { border-left: 1px solid var(--border); }
table.pl thead th.pstart { border-left: 2px solid rgba(255,255,255,.35); }
table.pl thead th.istart { border-left: 1px solid rgba(255,255,255,.18); }

table.pl tr.g > td { font-weight: 650; background: var(--surface-2); }
table.pl tr.g > td.line { background: var(--surface-2); }
table.pl tr.total > td { font-weight: 700; background: #EDF1F7; border-top: 2px solid var(--navy); }
table.pl tr.total > td.line { background: #EDF1F7; }
:root[data-theme="dark"] table.pl tr.total > td,
:root[data-theme="dark"] table.pl tr.total > td.line { background: #16283C; }
table.pl td.line .in { padding-left: 15px; color: var(--text-dim); }
table.pl tbody tr:hover > td { background: #F5F8FC; }
:root[data-theme="dark"] table.pl tbody tr:hover > td { background: #17273A; }
table.pl .col-ytd { background: #FAFBFD; }
table.pl tr.g .col-ytd { background: #F2F5F9; }
:root[data-theme="dark"] table.pl .col-ytd { background: #142234; }
table.pl .sys td.line { color: var(--warn); font-style: italic; }
/* dòng lãi lỗ: số tô màu theo dấu nên cho đậm hơn để đọc nhanh */
table.pl tr.total td.pos, table.pl tr.total td.neg { font-weight: 700; }
.legend { flex-wrap: wrap; row-gap: 4px; }
.caret { display: inline-block; width: 12px; color: var(--text-faint); cursor: pointer; user-select: none; }
.toolbar { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s3); }
.toolbar .chk { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-dim); }
.legend { display: flex; gap: var(--s4); font-size: 12px; color: var(--text-dim); margin-top: var(--s2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ===== Panel đào sâu ===== */
#drill-back { position: fixed; inset: 0; background: rgba(4,30,66,.34); z-index: 40; }
#drill {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(940px, 68vw);
  background: var(--bg); z-index: 41; display: flex; flex-direction: column;
  box-shadow: -12px 0 34px rgba(4,30,66,.22); animation: slidein 180ms ease-out;
}
@keyframes slidein { from { transform: translateX(24px); opacity: .6 } to { transform: none; opacity: 1 } }
@media (prefers-reduced-motion: reduce) { #drill { animation: none } }

.drill-head { padding: var(--s4) var(--s5) var(--s3); background: var(--surface); border-bottom: 1px solid var(--border); }
.drill-head h3 { margin: 4px 0 0; font-size: 17px; font-weight: 650; }
.drill-crumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); flex-wrap: wrap; }
.drill-crumb button[data-act="close"] {
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 4px;
  width: 22px; height: 22px; line-height: 1; margin-right: 4px; color: var(--text-dim);
}
.crumb-link { background: none; border: 0; color: var(--navy-500); text-decoration: underline; padding: 0; font-size: 12px; }
.drill-kpis { display: flex; gap: var(--s4); margin-top: var(--s3); align-items: center; }
.dk-jump { margin-left: auto; align-self: flex-end; font-size: 12px; }
.dk { background: var(--surface-2); border-radius: var(--radius); padding: 7px 12px; min-width: 130px; }
.dk span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); }
.dk b { font-size: 16px; font-weight: 650; }
.dk i { font-style: normal; font-size: 11px; color: var(--text-faint); margin-left: 5px; }

.drill-body { padding: var(--s4) var(--s5) var(--s6); overflow: auto; display: flex; flex-direction: column; gap: var(--s3); }
.dcard .card-head { gap: var(--s3); flex-wrap: wrap; }
.dcard .card-head h3 { margin-right: auto; }
.dcard .card-head .chk { white-space: nowrap; font-size: 12px; }
.dcard .card-head input[type="text"], .dcard .card-head input:not([type]) {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 4px 8px; font-size: 12px; width: 230px;
}
.card-body.p0 { padding: 0; }

ul.why { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
ul.why li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; }
ul.why li svg { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 2px; }
ul.why li.pos { color: var(--good); } ul.why li.neg { color: var(--crimson); } ul.why li.warn { color: var(--warn); }
ul.why li b { color: inherit; }

.chart { width: 100%; height: 132px; color: var(--text); }
.sharebar { width: 100%; height: 12px; }
.legend-inline { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: 8px; font-size: 11.5px; color: var(--text-dim); }
.legend-inline .lg i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.legend-inline .lg b { margin-left: 5px; color: var(--text); }
.lg-inline { margin-left: auto; font-size: 11px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.lg-inline i.bar { display: inline-block; width: 9px; height: 9px; background: var(--navy-500); border-radius: 1px; }
.lg-inline i.tick { display: inline-block; width: 12px; border-top: 2px dashed var(--text-dim); }

.hbars { display: flex; flex-direction: column; gap: 4px; }
.hbar { display: grid; grid-template-columns: 200px 1fr 92px 42px; align-items: center; gap: 10px; font-size: 12.5px; }
.hbar[data-drill] { cursor: pointer; border-radius: 4px; }
.hbar[data-drill]:hover { background: var(--surface-2); }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { background: var(--surface-2); border-radius: 3px; height: 12px; overflow: hidden; }
.hb-track i { display: block; height: 100%; border-radius: 0 3px 3px 0; }
.hb-val { text-align: right; }
.hb-share { text-align: right; color: var(--text-faint); font-size: 11px; }

table.tbl.mini td { padding: 4px 10px; font-size: 12.5px; }
table.tbl.mini .sumrow td { border-top: 2px solid var(--border-strong); border-bottom: 0; }
table.tbl .r, table.pl .r { text-align: right; }
/* bảng giao dịch: cho cuộn ngang trong thẻ, và KHÔNG để cột số tiền bị cắt */
.txn-scroll { overflow-x: auto; }
table.tbl.txn { font-size: 12px; width: 100%; min-width: 880px; table-layout: fixed; }
table.tbl.txn td, table.tbl.txn th { padding: 4px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.tbl.txn col.c-date { width: 96px; } table.tbl.txn col.c-num { width: 96px; }
table.tbl.txn col.c-ven { width: 168px; } table.tbl.txn col.c-acct { width: 150px; }
table.tbl.txn col.c-amt { width: 104px; }
table.tbl.txn .memo { color: var(--text); }
/* ghim cột Số tiền vào lề phải: bảng có cuộn ngang thì số tiền vẫn luôn thấy */
table.tbl.txn th:last-child, table.tbl.txn td:last-child {
  position: sticky; right: 0; background: var(--surface); box-shadow: -6px 0 8px -6px rgba(4,30,66,.2);
}
table.tbl.txn thead th:last-child { background: var(--surface-2); }
table.tbl.txn tbody tr:hover td:last-child { background: var(--surface-2); }
table.tbl.txn .acct { color: var(--text-dim); }
.pager { display: flex; align-items: center; justify-content: center; gap: var(--s3); padding: 8px; font-size: 12px; color: var(--text-dim); }
.pager button { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 4px; padding: 3px 10px; }

/* Nút ↺ hoàn nguyên về số lúc nạp file — chỉ ô đã sửa mới có. */
.qf .qrev { color: var(--navy-500); font-weight: 600; }
.qf .qrev:hover { background: var(--navy-500); color: #fff; }
/* Thẻ ghi chú trong panel đào sâu — nền vàng nhạt như giấy nhớ để đập vào mắt trước tiên. */
.drill-note { background: #FFFBF0; border-color: #EBDCB4; }
:root[data-theme="dark"] .drill-note { background: #241D08; border-color: #4A3C12; }
.drill-note textarea { width: 100%; padding: 7px 9px; border: 1px solid var(--border-strong);
  border-radius: 4px; font: inherit; font-size: 13px; resize: vertical; background: var(--surface); color: var(--text); }
.drill-note.has .card-head h4 { color: #6B4E00; }

/* Ô có GHI CHÚ: gấp góc trên-trái, hover ra tooltip đầy đủ. */
table.pl td.hasnote { position: relative; }
table.pl td.hasnote::before { content: ""; position: absolute; top: 0; left: 0;
  border-top: 7px solid var(--navy-500); border-right: 7px solid transparent; }
.qf .qnote { color: var(--navy); }
td.cellhit { cursor: pointer; }
/* Ô có khoản CỘNG THÊM NGOÀI SỔ: chấm nhỏ góc trên phải để không bao giờ bị giấu. */
table.pl td.hasadj { position: relative; }
table.pl td.hasadj::after { content: ""; position: absolute; top: 2px; right: 2px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--warn); }
td.cellhit:hover { outline: 2px solid var(--navy-500); outline-offset: -2px; }

#chart-tip {
  position: fixed; z-index: 60; pointer-events: none; opacity: 0; transition: opacity 120ms;
  background: var(--navy); color: #fff; font-size: 11.5px; padding: 4px 8px; border-radius: 4px;
  box-shadow: 0 4px 12px rgba(4,30,66,.28); white-space: nowrap;
}
@media (max-width: 900px) { #drill { width: 100vw; } .hbar { grid-template-columns: 120px 1fr 80px 36px; } }

/* chart cột theo tháng — HTML/CSS nên chữ không bị méo */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 136px; padding-top: 14px; }
.bcol { flex: 1 1 0; display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
.bplot { position: relative; height: 100px; border-bottom: 1px solid var(--border-strong); }
.bfill { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 2px 2px 0 0; display: block; }
.btick { position: absolute; left: -2px; right: -2px; border-top: 2px dashed; }
.bpeak { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 2px;
         font-size: 10px; font-weight: 650; color: var(--text); white-space: nowrap; }
.blab { text-align: center; font-size: 10px; color: var(--text-faint); padding-top: 3px; }
.bcol:hover .bfill { filter: brightness(1.12); }
/* tháng chưa tới: tiêu đề nhạt hơn + ghi rõ đang xem kế hoạch */
table.pl thead th.lvl1.future { background: var(--navy-700); }
table.pl thead th .fut { font-weight: 400; text-transform: none; letter-spacing: 0; opacity: .72; font-size: 10px; }

/* ===== Chế độ Sửa số — chia 3 vùng: Thực hiện · Kế hoạch · Chung ===== */
.editbar { background: #FFFBF0; border: 1px solid #EBDCB4; border-radius: var(--radius); padding: 10px 12px; margin-bottom: var(--s3); }
:root[data-theme="dark"] .editbar { background: #241D08; border-color: #4A3C12; }

.eb-head { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: #6B4E00; line-height: 1.45; }
:root[data-theme="dark"] .eb-head { color: #F5D98A; }
.eb-head svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; }

.eb-zones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
@media (max-width: 1180px) { .eb-zones { grid-template-columns: 1fr; } }

.eb-zone { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 11px 11px; }
.eb-zone h5 { margin: 0 0 3px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.eb-zone h5 span { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text-faint); margin-left: 6px; }
.eb-zone.z-actual { border-left: 3px solid var(--navy); }
.eb-zone.z-actual h5 { color: var(--navy); }
.eb-zone.z-plan { border-left: 3px solid var(--navy-300); }
.eb-zone.z-plan h5 { color: var(--navy-500); }
.eb-hint { margin: 0 0 8px; font-size: 11.5px; color: var(--text-dim); line-height: 1.45; }

.eb-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 12.5px; margin-top: 6px; }
.eb-row > label { color: var(--text-dim); }
.eb-row select, .eb-row input[type="text"] {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 4px;
  padding: 3px 6px; font-size: 12.5px;
}
.eb-row input#eb-split-pct, .eb-row input#eb-factor { width: 48px; text-align: right; }
.eb-row .btn { padding: 3px 12px; }

.eb-foot { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; margin-top: 10px;
           padding-top: 9px; border-top: 1px dashed #E0CE9A; }
:root[data-theme="dark"] .eb-foot { border-top-color: #4A3C12; }
.eb-undo-hint { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-dim); }
.eb-undo-hint svg { width: 14px; height: 14px; color: var(--good); }
.eb-foot .btn-danger { margin-left: auto; }

td.editcell { padding: 0 2px; background: #FFFCF2; }
:root[data-theme="dark"] td.editcell { background: #241D08; }
td.editcell input {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--surface);
  padding: 2px 5px; font-size: 12px; text-align: right; font-variant-numeric: tabular-nums;
}
td.editcell input:focus { border-color: var(--navy); box-shadow: 0 0 0 2px rgba(4,30,66,.12); outline: none; }
td.editcell input.saving { background: var(--good-50); }
/* ô nhập kế hoạch theo % doanh thu: [ % ] kèm số tiền quy ra bên cạnh */
td.editcell.pctmode { white-space: nowrap; }
td.editcell.pctmode input.pctin { width: 44px; text-align: right; }
td.editcell.pctmode input.pctin:disabled { background: var(--surface-2); color: var(--text-faint); }
td.editcell.pctmode .pu { font-size: 9px; color: var(--text-faint); margin: 0 2px 0 1px; }
td.editcell.pctmode .p.money { width: auto; min-width: 34px; font-size: 9px; }
.eb-sep { width: 1px; height: 18px; background: #E0CE9A; margin: 0 4px; }
:root[data-theme="dark"] .eb-sep { background: #5C4A15; }

/* ===== Màn Tổng quan ===== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 11px var(--s4) 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.kpi[role="button"] { cursor: pointer; transition: border-color 150ms, box-shadow 150ms; }
.kpi[role="button"]:hover { border-color: var(--navy-500); box-shadow: 0 2px 10px rgba(4,30,66,.08); }
.k-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); }
.k-val { font-size: 22px; font-weight: 680; letter-spacing: -0.02em; line-height: 1.15; }
.k-val.warnc { color: var(--warn); }
.k-vs { font-size: 11.5px; color: var(--text-dim); }
.k-split { font-size: 10.5px; color: var(--text-faint); border-top: 1px dashed var(--border); padding-top: 4px; margin-top: 2px; }

.spark { display: flex; align-items: flex-end; gap: 1.5px; height: 24px; margin-top: 4px; }
.spark i { flex: 1 1 0; position: relative; border-radius: 1px 1px 0 0; min-height: 1px; }
.spark i u { position: absolute; left: -1px; right: -1px; border-top: 1.5px solid var(--text-faint); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-bottom: var(--s3); }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

/* waterfall ngang */
.cascade { display: flex; flex-direction: column; gap: 3px; }
.cs-row { display: grid; grid-template-columns: 178px 1fr 96px; align-items: center; gap: 10px; font-size: 12.5px; padding: 1px 0; border-radius: 3px; }
.cs-row[role="button"] { cursor: pointer; }
.cs-row[role="button"]:hover { background: var(--surface-2); }
.cs-row.is-total { font-weight: 650; }
.cs-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-track { position: relative; height: 14px; background: var(--surface-2); border-radius: 3px; }
.cs-track i { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.cs-track .cs-total { background: var(--navy); }
.cs-track .cs-step { background: var(--navy-300); }
.cs-track .cs-good { background: var(--good); }
.cs-track .cs-bad { background: var(--crimson); }
.cs-track .cs-zero { position: absolute; top: -2px; bottom: -2px; width: 1px; background: var(--border-strong); }
.cs-val { text-align: right; }

/* cột chồng theo tháng */
.stackbar { display: flex; align-items: flex-end; gap: 4px; height: 168px; }
.sb-col { flex: 1 1 0; display: flex; flex-direction: column; min-width: 0; }
.sb-stack { position: relative; height: 142px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.sb-stack i { display: block; border-radius: 1px; min-height: 1px; }
.sb-stack i:first-of-type { border-radius: 2px 2px 1px 1px; }
.sb-tot { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 2px; font-size: 9.5px; font-weight: 600; color: var(--text-dim); }
.sb-lab { text-align: center; font-size: 10px; color: var(--text-faint); padding-top: 4px; }

tr.clickrow { cursor: pointer; }
tr.clickrow:hover > td { background: var(--surface-2); }

.insights { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
@media (max-width: 1100px) { .insights { grid-template-columns: 1fr; } }
.ins-col h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.ins-col h4 svg { width: 15px; height: 15px; }
.ins-col.ok h4 { color: var(--good); } .ins-col.bad h4 { color: var(--crimson); } .ins-col.rec h4 { color: var(--navy-500); }
.ins-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ins-col li { font-size: 12.5px; line-height: 1.45; padding-left: 11px; position: relative; }
.ins-col li::before { content: "•"; position: absolute; left: 0; color: var(--text-faint); }

/* chart cột + đường (2 trục): cột CSS, đường SVG nét không giãn, mốc & nhãn bằng HTML */
.combo { padding-top: 16px; }
.cb-plot { position: relative; }
.cb-bars { display: flex; align-items: flex-end; gap: 4px; height: 172px; }
.cb-col { flex: 1 1 0; display: flex; flex-direction: column; min-width: 0; }
.cb-slot { position: relative; height: 148px; border-bottom: 1px solid var(--border-strong); }
.cb-slot i { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 2px 2px 0 0; display: block; }
.cb-lab { text-align: center; font-size: 10px; color: var(--text-faint); padding-top: 4px; }
/* lớp phủ cao đúng bằng vùng cột, để đường và mốc định vị theo % của vùng đó */
.cb-overlay { position: absolute; left: 0; right: 0; top: 0; height: 148px; pointer-events: none; }
/* SVG là phần tử replaced: `inset:0` KHÔNG kéo giãn được nó (vẫn giữ chiều cao nội tại
   = bề rộng vì viewBox vuông), nên phải đặt width/height 100% tường minh. */
.cb-line { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
.cb-dot { position: absolute; width: 6px; height: 6px; border-radius: 50%; transform: translate(-50%, -50%);
          box-shadow: 0 0 0 2px var(--surface); }
/* nhãn % có nền chip: khi mốc nằm thấp, nhãn đè lên cột navy vẫn đọc được */
.cb-tag { position: absolute; transform: translate(-50%, -170%); font-size: 9.5px; font-weight: 650;
          color: var(--text); white-space: nowrap; pointer-events: none;
          background: var(--surface); padding: 0 3px; border-radius: 2px; box-shadow: 0 0 0 1px var(--border); }
.legend-inline .lg i.ln { width: 14px; height: 2px; border-radius: 1px; }
/* Nút bấm nhanh trong ô: ½ chia đều · % cân bằng · × xoá · + cộng ngoài sổ · ↺ về số lúc nạp file.
   Chỉ hiện khi trỏ vào ô. Áp cho MỌI ô sửa được, không riêng ô Foam, vì nút ↺ có ở cả ô
   nhập tay và ô kế hoạch. */
td.editcell { position: relative; }
td.editcell .qf { position: absolute; left: 3px; top: 50%; transform: translateY(-50%);
                  display: none; gap: 2px; z-index: 1; }
td.editcell:hover .qf, td.editcell:focus-within .qf { display: flex; }
td.editcell .qf button {
  width: 17px; height: 17px; line-height: 1; padding: 0; font-size: 10.5px;
  border: 1px solid var(--border-strong); border-radius: 3px;
  background: var(--surface); color: var(--text-dim);
}
td.editcell .qf button:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
td.editcell .qf button:disabled { opacity: .4; cursor: not-allowed; }
td.editcell .qf button[data-qf="ratio"] { font-weight: 700; }
/* thông báo ngắn khi hoàn tác */
#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 12px);
  background: var(--navy); color: #fff; font-size: 13px; padding: 9px 16px; border-radius: 6px;
  box-shadow: 0 6px 20px rgba(4,30,66,.3); opacity: 0; pointer-events: none;
  transition: opacity 180ms, transform 180ms; z-index: 70; max-width: 70vw;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
.btn-danger { border-color: var(--crimson); color: var(--crimson); font-weight: 500; }
.btn-danger:hover { background: var(--crimson); color: #fff; border-color: var(--crimson); }

/* ===== Hộp xác nhận trong app (thay confirm() của browser — nó bị tự huỷ trong khung xem trước) ===== */
.ask-back { position: fixed; inset: 0; background: rgba(4,30,66,.42); z-index: 80;
            display: flex; align-items: center; justify-content: center; padding: 24px; }
.ask { background: var(--surface); border-radius: 8px; max-width: 480px; width: 100%;
       box-shadow: 0 18px 48px rgba(4,30,66,.32); overflow: hidden; }
.ask h4 { display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px 18px 12px;
          font-size: 14px; border-bottom: 1px solid var(--border); }
.ask h4 svg { width: 17px; height: 17px; }
.ask-body { padding: 16px 18px; font-size: 13.5px; line-height: 1.55; color: var(--text); }
.ask-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; }
.ask-foot .btn { padding: 6px 16px; }

.fold-note { margin-left: auto; font-size: 11.5px; }

.txn-tools { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: 0 0 10px; }
.txn-tools input#drill-search {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 4px 8px; font-size: 12px; width: 260px;
}
.txn-tools .dim { margin-left: auto; font-size: 11.5px; }
#txncard .card-body { padding: 12px 0 0; }
#txncard .txn-tools { padding: 0 var(--s4) 10px; }
.eb-lock { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-dim); }
.eb-lock svg { width: 14px; height: 14px; color: var(--text-faint); }
.eb-lock select { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 4px; padding: 2px 5px; font-size: 11.5px; }
.eb-lock b { font-weight: 400; }
.set-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 7px; }
.set-row > label { color: var(--text-dim); min-width: 190px; }
.set-row input, .set-row select {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 4px;
  padding: 4px 7px; font-size: 13px; text-align: right;
}
.set-row select { text-align: left; }
.card-head input { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 4px 8px; font-size: 12px; width: 220px; }

/* ===== Màn Hướng dẫn ===== */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
@media (max-width: 1100px) { .steps { grid-template-columns: 1fr; } }
.step { display: flex; gap: var(--s3); align-items: flex-start; }
.step-n { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff;
          display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.step h4 { margin: 2px 0 5px; font-size: 13.5px; }
.step p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--text-dim); }
.faq { margin-bottom: 12px; }
.faq h4 { margin: 0 0 3px; font-size: 13px; }
.faq p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--text-dim); }

/* ===== Cây danh mục chi phí (Thiết lập) ===== */
table.tbl.cat td { vertical-align: top; padding: 5px 12px; }
tr.cat-lv1 > td { background: var(--navy); color: #fff; font-size: 11px; font-weight: 700;
                  text-transform: uppercase; letter-spacing: .06em; padding: 5px 12px; }
tr.cat-lv2 > td { background: var(--surface-2); font-size: 13px; }
tr.cat-lv2.cat-missing > td { background: var(--crimson-50); }
tr.cat-lv2.cat-missing .cat-name b { color: var(--crimson); }
tr.cat-lv2.cat-missing .cat-acc { color: var(--crimson); }
tr.cat-lv3 > td { font-size: 12.5px; }
.cat-name { min-width: 300px; }
.cat-ind2 { display: inline-block; width: 10px; }
.cat-ind3 { display: inline-block; width: 26px; border-left: 1px solid var(--border-strong); margin-right: 6px; }
.cat-acc { display: flex; flex-wrap: wrap; gap: 6px; }
.acc-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--surface-2);
            border: 1px solid var(--border); border-radius: 20px; padding: 2px 4px 2px 9px; }
.acc-chip code { font-size: 11.5px; background: none; padding: 0; }
.acc-chip select { border: 1px solid var(--border-strong); border-radius: 4px; padding: 1px 4px; font-size: 11px; max-width: 170px; }
.acc-chip .btn { padding: 1px 8px; font-size: 11px; }

/* ===== Bản in / xem trước bản in ===== */
#printview { position: fixed; inset: 0; z-index: 90; background: #6B7280; overflow: auto; }
.pv-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: var(--s3);
          background: var(--navy); color: #fff; padding: 9px var(--s5); font-size: 13px; }
.pv-bar .dim { color: rgba(255,255,255,.7); margin-right: auto; }
/* overflow: auto + flex none để trang xem trước ĐÚNG kích thước A4 thật,
   không bị co lại theo bề rộng cửa sổ (co lại thì kiểm tra vừa trang sẽ sai). */
.pv-sheets { padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 22px; overflow: auto; }
/* --pv-zoom: chỉ để xem trước cho vừa cửa sổ; @media print đặt lại 1. */
.pv-sheet { zoom: var(--pv-zoom, 1); flex: none; background: #fff; color: #10213A; width: 1122px; min-height: 793px; padding: 26px 30px;
            box-shadow: 0 6px 26px rgba(0,0,0,.28); }
#printview[data-orient="portrait"] .pv-sheet { width: 793px; min-height: 1122px; }

.pv-head { display: flex; align-items: flex-start; gap: var(--s4); border-bottom: 2px solid #041E42; padding-bottom: 10px; }
.pv-head img { height: 34px; }
.pv-title { flex: 1; }
.pv-title h1 { margin: 0; font-size: 17px; letter-spacing: .01em; }
.pv-title p { margin: 3px 0 0; font-size: 12px; color: #5A6B82; }
.pv-meta { text-align: right; font-size: 10.5px; color: #5A6B82; line-height: 1.6; }

.pv-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 12px 0 4px; }
.pv-kpi { border: 1px solid #E2E6EC; border-radius: 4px; padding: 7px 9px; }
.pv-kpi span { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: #5A6B82; }
.pv-kpi b { font-size: 15px; font-weight: 700; }
.pv-kpi i { display: block; font-style: normal; font-size: 9.5px; color: #5A6B82; margin-top: 1px; }

.pv-block { margin-top: 14px; }
.pv-block h2 { margin: 0 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
               color: #041E42; border-bottom: 1px solid #E2E6EC; padding-bottom: 3px; }
.pv-tbl { width: 100%; border-collapse: collapse; font-size: 11px; }
.pv-tbl th { background: var(--navy); color: #fff; text-align: left; padding: 4px 6px; font-size: 9.5px;
             text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--navy-700); }
.pv-tbl td { padding: 3px 6px; border-bottom: 1px solid #EDF0F4; }
.pv-tbl .r { text-align: right; }
.pv-tbl .num { font-variant-numeric: tabular-nums; }
.pv-tbl tr.grp td { font-weight: 600; background: var(--surface-2); }
.pv-tbl tr.grp td:first-child { font-weight: 650; }
/* dòng tổng khai SAU dòng nhóm để thắng khi một dòng vừa là nhóm vừa là tổng (như trên app) */
.pv-tbl tr.strong td { font-weight: 700; background: #EDF1F7; border-top: 1px solid var(--navy); }
.pv-tbl tr.sub td:first-child { color: #3C4A5E; }
.pv-tbl .dim { color: #8A97A8; }
.pv-pl { font-size: 10.5px; }

.pv-ins { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); }
.pv-ins h3 { margin: 0 0 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: #5A6B82; }
.pv-ins ul { margin: 0; padding-left: 15px; }
.pv-ins li { font-size: 11px; line-height: 1.5; margin-bottom: 2px; }

.pv-foot { display: flex; justify-content: space-between; margin-top: 16px; padding-top: 7px;
           border-top: 1px solid #E2E6EC; font-size: 9.5px; color: #8A97A8; }
.pv-sheet .bars, .pv-sheet .stackbar, .pv-sheet .cb-bars { height: 118px; }
.pv-sheet .bplot, .pv-sheet .sb-stack, .pv-sheet .cb-slot, .pv-sheet .cb-overlay { height: 96px; }
.pv-sheet .cs-row { grid-template-columns: 190px 1fr 92px; font-size: 11px; }

@media print {
  /* Không có dòng này thì browser BỎ nền màu khi in -> dải navy thành trắng. */
  #printview, #printview * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* Khổ giấy do #printview chèn style riêng theo lựa chọn; đây chỉ là mặc định. */
  @page { size: A4 landscape; margin: 8mm; }
  body > *:not(#printview) { display: none !important; }
  #printview { position: static; background: #fff; overflow: visible; }
  .pv-bar, .no-print { display: none !important; }
  .pv-sheets { padding: 0; }
  .pv-sheet { zoom: 1; width: auto; min-height: 0; box-shadow: none; padding: 0; }
  .pv-break { break-before: page; }
  .pv-block { break-inside: avoid; }
  .pv-tbl tr { break-inside: avoid; }
}
.p-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.p-checks .chk { font-size: 12.5px; }
/* bảng Actual & Plan trên bản in: nhiều cột nên chữ nhỏ, cột chật */
/* Bảng Actual & Plan in ra: RẤT nhiều cột (13 kỳ × 3 ngành) nên chữ phải nhỏ,
   số căn phải và tô màu lãi/lỗ giống trên màn hình làm việc. */
.pv-grid { font-size: 7px; table-layout: auto; }
.pv-grid th, .pv-grid td { padding: 1.5px 2px; white-space: nowrap; }
/* Tên chỉ tiêu được xuống dòng (trang còn thừa chiều cao) để không cắt mất chữ. */
.pv-grid th.line, .pv-grid td.line { width: 132px; max-width: 132px; text-align: left;
            white-space: normal; line-height: 1.15; word-break: break-word; background: #fff; }
/* Giữ NGUYÊN bộ màu của bảng làm việc: 3 dải tiêu đề navy đậm→nhạt, chữ trắng. */
.pv-grid thead th { font-size: 6.5px; letter-spacing: 0; padding: 2px 2px; color: #fff; font-weight: 600; }
.pv-grid thead th.lvl1 { text-align: center; background: var(--navy); font-size: 7.5px;
            text-transform: uppercase; letter-spacing: .05em; }
.pv-grid thead th.lvl2 { text-align: center; background: var(--navy-700); font-weight: 500; letter-spacing: .03em; }
.pv-grid thead th.lvl3 { text-align: right; background: var(--navy-500); font-weight: 500; }
.pv-grid thead th.line { background: var(--navy); color: #fff; vertical-align: bottom; text-align: left; }
.pv-grid thead th.lvl1.fut { background: var(--navy-700); }
.pv-grid thead th.pstart { border-left: 1px solid rgba(255,255,255,.35); }
.pv-grid tbody .pstart { border-left: 1px solid var(--border-strong); }
.pv-grid tbody .fut { background: #FAFBFD; }
.pv-grid tbody .ytd { background: #FAFBFD; font-weight: 600; }
.pv-grid tbody tr.grp .ytd, .pv-grid tbody tr.grp .fut { background: #F2F5F9; }
.pv-grid tr.grp td.line { background: var(--surface-2); }
.pv-grid tr.strong td, .pv-grid tr.strong td.line { background: #EDF1F7; border-top: 1px solid var(--navy); }
/* $ và % CHUNG một ô, y như trên màn: % là chữ nhỏ mờ, bề rộng cố định để các cột $ thẳng hàng. */
.pv-grid td.num { text-align: right; }
.pv-grid td.num > .p { display: inline-block; width: 26px; margin-left: 2px; text-align: right;
            font-size: 5.5px; font-weight: 500; color: var(--text-dim); letter-spacing: -0.02em; }
.pv-grid thead th .sub-pct { color: rgba(255,255,255,.6); font-weight: 400; font-size: 5.5px; }
.pv-grid .istart { border-left: 1px solid var(--border); }
.pv-grid thead th.istart { border-left: 1px solid rgba(255,255,255,.18); }
.pv-grid td.pos { color: var(--good); }
.pv-grid td.neg { color: var(--crimson); }
.pv-grid tr.strong td.pos, .pv-grid tr.strong td.neg { font-weight: 700; }
.pv-grid tr.sys td.line { color: var(--warn); font-style: italic; }
.pv-grid tr.sub td.line { padding-left: 6px; }
/* Trang in bảng: chừa lề hẹp hơn để nhồi đủ cột */
.pv-sheet-grid { padding: 16px 14px; }
.pv-notes { margin: 6px 0 0; font-size: 8px; color: #3C4A5E; border-top: 1px solid #E2E6EC; padding-top: 4px; }
.pv-notes b { color: #041E42; }
.pv-notes ul { margin: 2px 0 0; padding-left: 14px; }
.pv-notes li { margin-bottom: 1px; }
.pv-note { margin: 5px 0 0; font-size: 8.5px; color: #8A97A8; }

/* ===== Cửa vào app: hỏi mật khẩu ===== */
#login { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
         background: var(--navy); padding: 24px; }
.login-card { width: 340px; background: var(--surface); border-radius: 10px; padding: 24px;
              box-shadow: 0 18px 50px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 4px; }
.login-card img { height: 30px; align-self: flex-start; margin-bottom: 10px; }
.login-card h1 { margin: 0; font-size: 17px; color: var(--text); }
.login-card > p.dim { margin: 2px 0 14px; font-size: 12.5px; }
.login-card label { font-size: 12px; color: var(--text-dim); margin-top: 8px; }
.login-card input { padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 5px;
                    font: inherit; font-size: 14px; background: var(--surface); color: var(--text); }
.login-card input:focus { outline: 2px solid var(--navy-500); outline-offset: -1px; }
.login-card .btn { margin-top: 16px; padding: 9px; font-size: 14px; }
.login-err { margin-top: 10px; padding: 7px 9px; border-radius: 5px; font-size: 12.5px;
             background: var(--crimson-50); color: var(--crimson); }
.login-foot { margin: 14px 0 0; font-size: 11.5px; display: flex; align-items: center; gap: 5px; }
.login-foot svg { width: 13px; height: 13px; flex: 0 0 13px; }

.lg-switch { background: none; border: 0; padding: 0; color: var(--navy-500); font: inherit;
             font-size: 11.5px; text-decoration: underline; cursor: pointer; }
