/* NEW-190 — trang phụ lục CHIA MỤC ở site crm (khung ERP; views/appendix_sections.js). Tiền tố aps-; chỉ token màu của app.css
   (sáng + tối), không gradient / glow; thanh nhảy mục dính ngay dưới hàng đường dẫn (.fv-cp, 33 px trên desktop; dưới thanh trên cùng ≤ 760 px). */
.aps { --aps-top: 33px; --aps-nav-h: 46px; }   /* --aps-nav-h: JS (bind) ghi chiều cao thật của thanh nhảy mục — 2 hàng khi xuống dòng */
.aps-nav { position: sticky; top: var(--aps-top); z-index: 15; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin-top: 14px; }
/* Điện thoại (≤ 760 px): một hàng cuộn ngang (nút cuối lộ một nửa ⇒ biết còn mục). Rộng hơn: xuống dòng — mọi mục luôn thấy + bấm được
   (laptop 1280–1366 px có sidebar + cột Trao đổi chỉ còn ~680 px cho 9 nút; rà soát 09/11: chuột không cuộn ngang được thì mục cuối bị khuất) */
.aps-nav-in { display: flex; flex-wrap: wrap; gap: 0 2px; padding: 0 16px; }
.aps-jump { flex: none; min-height: 44px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted);
  font: inherit; font-size: 14px; white-space: nowrap; cursor: pointer; }
.aps-jump:hover { color: var(--ink); background: var(--hover); }
.aps-jump.on { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 600; }
.aps-jump:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
/* NEW-205: số mục S1…S7 (mẫu CEO) — chữ nhỏ đậm, cùng màu chữ của nút / tiêu đề (không thêm màu mới) */
.aps-no { font-size: 12px; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums; opacity: .75; }
.aps-sh h2 .aps-no { font-size: 13px; opacity: .6; }
.aps-jump.on .aps-no { opacity: 1; }
/* NEW-205: giữ sẵn bề rộng chữ ĐẬM (::after ẩn, cao 0) ⇒ nút đang chọn không rộng ra, thanh nhảy mục không đổi số hàng khi cuộn / bấm (laptop 1280) */
.aps-jump { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; }
.aps-jump::after { content: attr(data-w); font-weight: 600; height: 0; overflow: hidden; visibility: hidden; pointer-events: none; }
@media (min-width: 761px) { .aps-nav-in { padding: 0 10px; } .aps-jump { padding: 0 9px; } }   /* NEW-205: thêm số mục mà laptop 1280 vẫn 2 hàng */

.aps-sec { margin: 14px 24px 0; padding: 16px 20px 12px; border: 1px solid var(--zone-line); border-radius: calc(var(--radius) + 2px); background: var(--zone);
  scroll-margin-top: calc(var(--aps-top) + var(--aps-nav-h) + 18px); }
/* Khu màu (chủ dự án 11/11/2026 — cùng quy tắc bảng Xem nhanh, peek.css): mục TIỀN (SECTIONS money: Chỉ số, Revenue, COGS, Gross Profit — S7 Other Cost bỏ NEW-206)
   nền --zone-money; mục khác --zone; "Khác" (các tab cũ, mục cuối kéo dài để nhảy mục được) giữ nền trang, chỉ kẻ trên. Bảng / ô trong khu giữ --surface. */
.aps-sec[data-aps-sec="chi-so"], .aps-sec[data-aps-sec="revenue"], .aps-sec[data-aps-sec="cogs"],
.aps-sec[data-aps-sec="gross-profit"] { background: var(--zone-money); border-color: var(--zone-money-line); }
.aps-sec[data-aps-sec="khac"] { margin: 14px 0 0; padding: 18px 24px 8px; border: 0; border-top: 1px solid var(--line-2); border-radius: 0; background: none; }
.aps-sec .table-wrap, .aps-sec table.data { background: var(--surface); }
/* 2.58.1: link ?tab=finance&ads=1 dừng ở khối Bảng tỉ lệ ads (trong Khác › Nghiệm thu & thu tiền) — không lọt dưới thanh nhảy mục dính */
.aps tr.apr-mh { scroll-margin-top: calc(var(--aps-top) + var(--aps-nav-h) + 28px); }   /* ?muc=revenue&thang= (NEW-238 đợt 4 B6) — tiêu đề tháng của S4 */
.aps #adsCard { scroll-margin-top: calc(var(--aps-top) + var(--aps-nav-h) + 28px); }   /* +28: đo E2E 98i — +12 còn lọt ~4 px dưới thanh */
.aps-sec:last-child { padding-bottom: 20px; min-height: calc(100vh - var(--aps-top) - var(--aps-nav-h) - 10px); }   /* mục cuối cũng cuộn được lên đầu (nhảy mục, ?tab=paperwork) */
.aps-sh { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.aps-sh h2 { margin: 0; font-size: 17px; line-height: 24px; font-weight: 700; letter-spacing: -.005em; }
.aps-sh h2:focus { outline: none; }
.aps-sh h2:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.aps-sub { font-size: 13px; color: var(--muted); }
.aps-h3 { margin: 14px 0 6px; font-size: 14px; font-weight: 600; }
.aps-s { font-size: 13px; margin: 8px 0 0; }
.aps-th { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.aps-note { font-size: 13px; margin: 10px 0 0; padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-btn); }
.aps-negt { color: var(--err); }

/* Trạng thái: thanh bước (của đầu trang cũ) + hướng dẫn + vài dòng sự thật */
.aps-stb { overflow-x: auto; scrollbar-width: none; }
.aps-stb::-webkit-scrollbar { display: none; }
.aps-stb .fv-stb { margin-left: 0; width: max-content; }
.aps .fv-guide.path-guide { margin: 10px 0 0; }
.aps-sec > .aps-body > .msg { margin: 10px 0 0; }
.aps-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 24px; margin: 12px 0 0; }
.aps-fact { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.aps-fact dt { font-size: 12px; color: var(--muted); }
.aps-fact dd { margin: 0; overflow-wrap: anywhere; }
.aps-months { margin: 12px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.aps-k { color: var(--muted); }

/* Thông tin chung: lưới trường + Team xử lý + form tab Thông tin cũ */
.aps .fv-fields { padding: 0 0 4px; }
/* NEW-235: S2 gọn — hàng 4 ô chính, nhóm (dịch vụ ký dạng thẻ, người phụ trách, hợp đồng & tài liệu), "Thêm thông tin" gấp; số cột theo bề rộng KHUNG
   mục (container query — laptop 1280 có menu + Trao đổi ⇒ khung ~436 px: 2 cột; khung ≥ 760 px: 4 cột như mẫu; < 340 px: 1 cột). Chỉ token màu. */
.aps-info { container: n235s2 / inline-size; }
.s2-keys { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; margin: 0 0 16px; background: var(--zone-line); border: 1px solid var(--zone-line);
  border-radius: var(--radius); overflow: hidden; }
.s2-key { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 14px; background: var(--surface); }
.s2-key dt { font-size: 13px; color: var(--muted); }
.s2-key dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.s2-kv { font-size: 16px; line-height: 22px; font-weight: 600; }
.s2-kv .vm-p { display: block; font-size: 13px; }
.s2-ks { font-size: 13px; line-height: 18px; color: var(--muted); }
.s2-fee { display: block; }
.s2-fee .vm { font-weight: 600; color: var(--ink); }
.s2-who { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.s2-who > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.s2-g { margin: 0 0 14px; }
.s2-gh { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.s2-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.s2-chip { display: inline-flex; align-items: center; min-height: 30px; max-width: 100%; padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.s2-empty { margin: 0; font-size: 14px; }
.s2-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 24px; margin: 0; }
.s2-f { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.s2-f dt { font-size: 13px; color: var(--muted); }
.s2-f dd { margin: 0; font-size: 14px; line-height: 20px; min-width: 0; overflow-wrap: anywhere; }
.s2-lbad { color: var(--muted); }
.s2-note { white-space: pre-wrap; }
@container n235s2 (min-width: 280px) { .s2-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .s2-w { grid-column: 1 / -1; } }
@container n235s2 (min-width: 340px) {
  .s2-keys { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s2-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s2-w { grid-column: 1 / -1; }
}
/* "Hợp đồng & tài liệu" khung < 760 px: MỘT cột (số HĐ khung + dòng link đều đủ bề ngang — số HĐ / nhãn không bị bẻ giữa chừng) */
@container n235s2 (min-width: 280px) and (max-width: 759.98px) { [data-s2-g="docs"] > .s2-grid { grid-template-columns: minmax(0, 1fr); } }
.s2-f[data-s2="contract_number"] dd { overflow-wrap: break-word; }   /* chỉ bẻ khi một dòng không đủ chỗ, không bẻ giữa mã như "anywhere" */
@container n235s2 (min-width: 760px) {
  .s2-keys, .s2-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .s2-w { grid-column: span 3; }
  [data-s2="project"].s2-w, [data-s2="note"].s2-w { grid-column: 1 / -1; }
}
.s2-more { margin: 2px 0 0; border-top: 1px dashed var(--zone-line); }
.s2-more > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-height: 44px; padding: 11px 0; cursor: pointer; list-style: none; }
.s2-more > summary::-webkit-details-marker { display: none; }
.s2-more-t { color: var(--brand-dark); font-weight: 600; }
.s2-more-t::before { content: "▸"; display: inline-block; width: 1.1em; }
.s2-more[open] .s2-more-t::before { content: "▾"; }
.s2-more-h { font-size: 13px; color: var(--muted); }
.s2-more > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.s2-more > .s2-grid { margin: 2px 0 6px; }
/* NEW-243: ô đang nhập tại chỗ (Sales.peek.inline) chiếm cả hàng lưới — đủ chỗ ô nhập + ✓ ✕ */
.s2-f:has(.qv-ie-box), .s2-key:has(.qv-ie-box) { grid-column: 1 / -1; }
@media (pointer: coarse), (max-width: 760px) { .s2 a.ct-doc-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; } }   /* NEW-243: mỗi link một ô */
/* nút "✎ Sửa" đầu mục (chỉ khi có quyền) + chữ "Đang sửa" */
.s2-edit-btn, .s2-editing { margin-left: auto; align-self: center; }
.s2-edit-btn { gap: 6px; }
@media (pointer: coarse) { .s2-edit-btn { min-height: 44px; } }
/* Form sửa chia nhóm (dùng nguyên ô của #ctEdit) */
.aps-info > .s2e > .card { margin: 0; padding: 4px 16px 12px; box-shadow: none; }
.s2e-groups { container: n235e / inline-size; }
.s2e-g { padding: 12px 0 4px; border-bottom: 1px solid var(--line-2); min-width: 0; }
.s2e-gh { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--ink); }
.s2e-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 14px; }
.s2e-grid > * { min-width: 0; }
.s2e-grid > .s2e-wide { grid-column: 1 / -1; }
/* 2 cột từ khung 360 px (laptop 1280: khung form ~404 px — ô ngày / chọn mỗi cột ~195 px vẫn đủ); 3 cột từ 660 px */
@container n235e (min-width: 360px) { .s2e-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container n235e (min-width: 660px) { .s2e-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.s2e-more { border-bottom: 0; }
.s2e-more > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-height: 44px; margin: 0; padding: 8px 0; cursor: pointer; list-style: none; }
.s2e-more > summary::-webkit-details-marker { display: none; }
.s2e-more > summary::before { content: "▸"; width: 1em; }
.s2e-more[open] > summary::before { content: "▾"; }
.s2e-gs { font-size: 13px; font-weight: 400; color: var(--muted); }
.s2e-more[open] > .s2e-grid { padding-top: 4px; }
/* ô link (type=url) chưa có kiểu chung của app.css ⇒ cùng kiểu ô chữ trong form này */
.s2e input[type=url] { width: 100%; min-height: 36px; padding: 7px 11px; border: 1px solid var(--btn-border); border-radius: var(--radius-btn); background: var(--surface);
  color: var(--ink); font: inherit; min-width: 0; }
.s2e input[type=url]:focus { outline: none; border-color: var(--brand); }
.s2e input[type=url]:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 760px) { .s2e input[type=url] { font-size: 16px; } }
/* nhóm "Dịch vụ ký" đã có tiêu đề ⇒ nhãn của ô chỉ còn cho trình đọc màn hình (ô vẫn aria-labelledby nhãn đó) */
.s2e-g[data-s2e="dich-vu"] .svp > .field-label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.s2e .section-actions { gap: 8px; flex-wrap: wrap; }
/* form dài ⇒ thanh Huỷ / Lưu dính đáy màn khi cuộn (máy tính; điện thoại không dính — bàn phím ảo che ô đang gõ) */
@media (min-width: 761px) {
  .s2e .section-actions { position: sticky; bottom: 0; z-index: 2; margin: 0 -16px -12px; padding: 10px 16px 12px; background: var(--surface);
    border-top: 1px solid var(--line-2); border-radius: 0 0 var(--radius) var(--radius); }
}
.s2e .section-actions > .muted { margin-right: auto; }
.s2e-btns { display: inline-flex; gap: 8px; margin-left: auto; }
@media (pointer: coarse) { .s2e .section-actions .btn { min-height: 44px; } }
/* Ô chọn dịch vụ có tìm kiếm (Sales.servicePicker) */
.svp-wrap { position: relative; }
.svp-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 42px; padding: 4px 6px; border: 1px solid var(--btn-border);
  border-radius: var(--radius-btn); background: var(--surface); cursor: text; }
.svp-box:focus-within { border-color: var(--brand); outline: 2px solid var(--brand); outline-offset: -1px; }
.svp-tags { display: contents; }
.svp-tag { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; min-height: 30px; padding: 0 2px 0 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark); font-size: 14px; font-weight: 500; }
.svp-tn { min-width: 0; overflow-wrap: anywhere; }
.svp-x { display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit;
  font-size: 12px; cursor: pointer; }
.svp-x:hover { background: var(--hover); }
.svp-x:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.svp .svp-q, .svp .svp-q:focus { flex: 1 1 160px; min-width: 120px; min-height: 32px; padding: 4px; border: 0; outline: 0; box-shadow: none; background: transparent; color: var(--ink); }
.svp-list { position: absolute; z-index: 30; left: 0; top: calc(100% + 4px); width: min(100%, 460px); max-height: 280px; overflow-y: auto; margin: 0; padding: 4px 0;
  list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.svp-list[hidden] { display: none; }
.svp-opt { display: flex; align-items: baseline; gap: 10px; min-height: 40px; padding: 9px 12px; cursor: pointer; }
.svp-opt:hover { background: var(--hover); }
.svp-opt.active { background: var(--brand-soft); color: var(--brand-dark); }
.svp-on { min-width: 0; overflow-wrap: anywhere; }
.svp-code { margin-left: auto; flex: none; font-size: 12px; color: var(--muted); }
.svp-msg { padding: 9px 12px; font-size: 13px; color: var(--muted); }
/* màn cảm ứng: ✕ đủ 44 × 44 và nằm TRỌN trong thẻ (thẻ cao 44, không margin âm), thẻ cách nhau 8 px ⇒ hai vùng bấm ✕ không sát nhau */
@media (pointer: coarse) {
  .svp-opt { min-height: 44px; }
  .svp-box { gap: 8px; }
  .svp-tag { min-height: 44px; padding-right: 0; }
  .svp-x { width: 44px; height: 44px; margin: 0; }
}
@media (max-width: 760px) { .svp .svp-q { font-size: 16px; } }   /* iOS không phóng to khi chạm ô */
.aps #ctTeams:not(:empty) { padding: 12px 0 0; }

/* Chỉ số */
.aps-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.aps-tile { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; background: var(--surface); }
.aps-tl { font-size: 12px; color: var(--muted); }
.aps-tv { font-size: 18px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* NEW-261c (chủ dự án 17/11: "số với chữ chỗ S3 bị lộn xộn"): ô chỉ còn nhãn + số; mọi ô cùng hàng cùng cao, nhãn chiếm cùng chiều cao ⇒ số thẳng
   hàng ngang (subgrid: mỗi ô = 2 hàng của lưới cha); trình duyệt chưa có subgrid ⇒ nhãn giữ chỗ đúng 2 dòng */
.aps-tl { line-height: 1.5; min-height: 3em; }
.aps-tvw { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.aps-tsub { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
@supports (grid-template-rows: subgrid) {
  .aps-tiles { row-gap: 10px; }
  .aps-tile { display: grid; grid-template-rows: subgrid; grid-row: span 2; row-gap: 2px; align-content: start; }
  .aps-tl { min-height: 0; align-self: end; }
}
.aps-tile.aps-neg .aps-tv { color: var(--err); }
.aps-tile.aps-warn { border-color: var(--warn); background: var(--warn-soft); }
.aps-tile.aps-muted .aps-tv { color: var(--muted); }

/* Revenue: hai khối giá trị / doanh thu + bảng tháng */
/* hai cột chỉ khi mỗi cột ≥ 320 px — trang phụ lục trên laptop (menu + cột Trao đổi, khung 436–600 px ở 1280–1440) thành một cột, nhãn không vỡ từng chữ */
.aps-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px 32px; }
.aps-kv { margin: 0; display: flex; flex-direction: column; }
.aps-kv-r { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.aps-kv-r dt { min-width: 0; }
.aps-kv-r dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.aps-kv-r.aps-kv-sum dd { font-weight: 700; }
.aps-t th[scope="row"] { font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--ink); background: none; position: static; font-weight: 500; }
.aps-t tfoot th, .aps-t tfoot td { border-top: 2px solid var(--line); }
.aps-t tr.aps-sum th, .aps-t tr.aps-sum td { font-weight: 700; border-top: 2px solid var(--line); }

/* Gross Profit: thanh so sánh đơn giản (màu đặc, không gradient) */
.aps-gp .aps-h3 { margin-top: 0; }
.aps-bar-r { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 10px; padding: 4px 0; }
.aps-bar-l { grid-row: 1; font-size: 13px; color: var(--muted); }
.aps-bar { grid-column: 1 / -1; grid-row: 2; height: 10px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.aps-bar i { display: block; height: 100%; }
.aps-b-rev { background: var(--chart-1); }
.aps-b-cost { background: var(--chart-4); }
.aps-b-gp { background: var(--ok); }
.aps-b-neg { background: var(--err); }
.aps-bar-v { grid-row: 1; grid-column: 2; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 14px; }

.aps-err { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Khác / Hoạt động: tab nhỏ trong mục */
.aps-tabs { margin-bottom: 12px; }
.aps-body > section[data-panel] { padding: 0; }


@media (max-width: 900px) {
  .aps-two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .aps { --aps-top: var(--shell-top, 48px); }
  .aps-nav-in { flex-wrap: nowrap; padding: 0 8px; overflow-x: auto; scrollbar-width: none; }
  .aps-nav-in::-webkit-scrollbar { display: none; }
  .aps-sec { margin: 12px 10px 0; padding: 14px 12px 8px; }
  .aps-sec[data-aps-sec="khac"] { margin: 12px 0 0; padding: 14px 14px 6px; }
  .aps-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .aps-tv { font-size: 16px; }
  .aps-facts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 400px) {
  .aps-tiles { grid-template-columns: minmax(0, 1fr); }
}
/* Màn cảm ứng: nút nhỏ trong trang (Xem bảng tháng, Thử lại…) đủ 44 px để chạm — như .sc-row .btn.small của app.css */
@media (pointer: coarse) {
  .aps .btn.small { min-height: 44px; padding: 6px 14px; }
}
/* In: bỏ thanh nhảy mục, thanh bước (trang cũ cũng ẩn khi in — .fv-sbar), nút thao tác; mục cuối không kéo dài thành trang trống */
@media print {
  .aps-nav, .aps-stb, [data-aps-retry], [data-aps-open], .aps-tabs { display: none !important; }
  .aps-sec { scroll-margin-top: 0; margin: 0; padding: 12px 0 4px; border: 0; border-radius: 0; background: none; }
  .aps-sec:last-child { min-height: 0; }
  .aps-sh { break-after: avoid; }
  .aps-tile, .aps-kv-r, .aps-bar-r { break-inside: avoid; }
}
/* NEW-200: tfoot 3 dòng (Cộng trước VAT · Thuế GTGT · Tổng gồm VAT) + dòng phụ trong ô số */
.aps-t tfoot tr.aps-sum th, .aps-t tfoot tr.aps-sum td { border-top: 1px solid var(--line); }
.aps-tv .vm-p { font-weight: 400; }
.aps-budget { display: block; }
/* NEW-215: ô Gross Profit dự kiến dưới ngưỡng GP (35 %) — viền + số đỏ, nhãn "Dưới mức 35 %" (chỉ khi cờ hạng mục theo phụ lục bật) */
.aps-tile.aps-below { border-color: var(--err); }
.aps-tv .aps-below-b { font-size: 12px; vertical-align: middle; }
/* NEW-207: "Giá vốn theo nhà cung cấp" (mục COGS) — bảng 4 cột khi khung mục ≥ 521 px; khung hẹp hơn (laptop 1280 có menu + cột Trao đổi ⇒ khung
   ~436 px, điện thoại) ⇒ mỗi NCC một thẻ: tên cả hàng, dưới là Số khoản · Dự kiến · Thực tế có nhãn — không cuộn ngang. Theo bề rộng KHUNG. */
.aps-sup { container: n207sup / inline-size; }
.aps-sup-t th[scope="row"] { overflow-wrap: anywhere; }
.aps-sup-t td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.aps-sup-t thead th.num { white-space: normal; }
.aps-sup-t tr.aps-sup-x th[scope="row"] { color: var(--muted); font-weight: 400; }
@container n207sup (max-width: 520px) {
  .aps-sup .aps-tw { overflow: visible; border: 0; box-shadow: none; background: none; }
  .aps-sup-t, .aps-sup-t tbody, .aps-sup-t tfoot { display: block; }
  .aps-sup-t thead { display: none; }
  .aps-sup-t tr { display: grid; grid-template-columns: minmax(56px, auto) minmax(0, 1fr) minmax(0, 1fr); gap: 4px 12px; padding: 8px 12px; margin: 0 0 6px;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .aps-sup-t tr > * { display: block; padding: 0; border: 0 !important; min-width: 0; position: static; background: none; text-align: left; }
  .aps-sup-t th[scope="row"] { grid-column: 1 / -1; }
  .aps-sup-t td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
  .aps-sup .aps-sup-t td.num { white-space: normal; overflow-wrap: anywhere; text-align: left; }
  .aps-sup-t tfoot tr { border-width: 2px; border-color: var(--line); }
  .aps-sup-t.data tbody tr:hover td, .aps-sup-t.data tbody tr:hover th { background: none; }
}
/* NEW-205: nút "Phụ lục trên Drive ↗" dưới tiêu đề phụ lục (khung ERP) — nút phụ (viền), không dùng màu nhấn */
.ct-drive { margin-top: 10px; }
.ct-drive-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); text-decoration: none; font-weight: 600; }
.ct-drive-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (pointer: coarse) { .ct-drive-btn { min-height: 44px; } }
/* NEW-245 H4: S6 chỉ phần thực tế — một khối cả bề rộng (thay .aps-two Dự kiến | Thực tế) */
.aps-gp1 { margin: 0 0 12px; }
