/* NEW-238 đợt 4 (A1) — kiểu của thành phần chung dòng nghiệm thu theo Mục (views/acceptance_line_ui.js: nhãn Agency Fee / nguồn / Out Net / cần
   xác nhận, chú thích "Agency Fee x % — chờ Ads Spend", dòng thêm mới, hộp sửa tay / xoá) + bảng S4 theo Mục (views/appendix_rows.js, lớp apr-mh /
   apr-ln). Tiền tố al-. CHỈ token màu của app.css; phẳng (không gradient / bóng phát sáng); nhãn wrap, không nới bảng (min-width: 0). Chỉ giao diện
   sáng (chủ dự án 13/11). */

/* ---- nhãn trên dòng: xuống dòng thay vì nới cột ---- */
.al-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; min-width: 0; max-width: 100%; vertical-align: middle; }
.al-badges .badge { white-space: normal; line-height: 1.35; min-width: 0; }
.badge.al-fee { background: var(--brand-soft); color: var(--brand-dark); }
.badge.al-fee[data-fee="override"] { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.badge.al-src { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
.badge.al-out { background: var(--surface-2); color: var(--ink); border: 1px dashed var(--line); font-weight: 500; }
/* cần xác nhận: chấm cảnh báo + CHỮ (không chỉ màu) — không phải nhãn hạn (đỏ / vàng của hạn ở urgentParts) */
.al-review { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink); line-height: 1.35; }
.al-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
/* chú thích xám dưới tiêu đề tháng: Agency Fee 0 ₫ chờ Ads Spend (chủ dự án 15/11 — không vẽ dòng) */
.al-cap { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; }
/* chú thích có nút (S4 / Xem nhanh — dòng chờ Ads vẫn đổi % / xoá được) */
.al-cap.al-cap-has { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.al-cap .al-cap-act { font-size: 12px; padding: 2px 8px; min-height: 28px; }
.al-cap .rv-ie-box { flex-basis: 100%; }
/* dòng Lark người xem không sửa được: gợi ý hiện ra (màn cảm ứng không có tooltip) */
.al-lark-hint { flex-basis: 100%; font-size: 12px; color: var(--muted); line-height: 1.35; }

/* ---- dòng thêm mới ---- */
.al-add .apr-f[hidden] { display: none; }
.al-amt { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.al-amt .apr-in { flex: 1 1 120px; min-width: 0; }
.al-sw { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); white-space: normal; min-height: 32px; cursor: pointer; }
.al-sw input { margin: 0; }
.al-addbox { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--brand-soft); }
.al-addbox.busy { opacity: .6; pointer-events: none; }
.al-addbox > * + * { margin-top: 6px; }
.al-reason { flex-basis: 100%; width: 100%; }
.al-mf textarea { width: 100%; }
/* NEW-249 (chủ dự án 17/11): dòng thêm trong bảng = tbody.apr-new.al-add (tr.al-addrow + tr.apr-new-msg). Nhóm ô div.al-cg[data-al-col] — khung
   ≥ 760 px: mỗi nhóm một ô theo cột (Kỳ = Tháng + Tuần dưới · Hạng mục (+ Mục) · Ghi chú · Số tiền + "gồm VAT" · VAT · số gồm VAT xem trước · ✓ Esc),
   nhãn nhỏ ẩn (tiêu đề cột đã nói, ô có aria-label), không ô nào tràn khỏi ô bảng; khung hẹp / hộp: nhóm "display: contents" ⇒ form nhỏ như cũ.
   Ô phụ (% Agency Fee · Out Net · Lý do) ở dòng tin dưới, trải hết bề rộng. Dáng đổi bằng JS (AcceptLineUI layoutAdd — đo khung .apr-wrap). */
tbody.apr-new.busy { opacity: .6; pointer-events: none; }
.al-cg { min-width: 0; }
.al-nf .al-cg { display: contents; }
.al-nf .al-cg[data-al-col="ac"] { display: none; }                  /* số gồm VAT xem trước: form nhỏ đã có ở dòng gợi ý */
.al-nf .apr-nf-acts { grid-column: -2 / -1; justify-self: end; justify-content: flex-end; }
.al-add-pv { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.al-add-pv:empty { display: none; }
/* dòng tin: ô phụ theo Mục một hàng (xuống hàng khi thiếu chỗ) trên gợi ý / lỗi; không ô nào hiện ⇒ không chiếm chỗ */
.al-add-x { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; min-width: 0; }
.al-add-x:not(:has(> .apr-f:not([hidden]))) { display: none; }
.al-add-x > .apr-f { flex: 0 1 auto; min-width: 0; }
.al-add-x > .apr-f > .apr-in[name="fee_rate_pct"] { width: 120px; min-width: 0; }
.al-add-x > .al-add-why { flex: 1 1 260px; max-width: 520px; }
.al-add-x .apr-in { min-width: 0; }
/* khung rộng: một hàng theo cột */
.apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) > td { vertical-align: top; padding: 8px 5px; }
.apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) > td:first-child { padding-left: 8px; }
.apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) > td:last-child { padding-right: 8px; }
.apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) .al-cg { display: flex; flex-direction: column; gap: 4px; }
.apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) .apr-f { gap: 0; }
.apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) .apr-fl { display: none; }
/* thắng luật ô của dòng thêm khoản chi (appendix_rows.css: .apr-t > tbody > tr.apr-new:not(.apr-new-f) select.apr-in { min-width: 108px }) */
.apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) .apr-in { min-width: 0; }
/* bề rộng cố định cho ô có bề rộng sẵn lớn (ô tháng của trình duyệt ~170 px, ô chọn theo chữ dài nhất) ⇒ bảng vừa khung từ 760 px */
.apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) > td.apr-c-month .apr-in { width: 152px; }
.apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) > td.apr-c-month .apr-in[type="month"] { padding-left: 6px; padding-right: 6px; }
.apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) > td.apr-c-note .apr-in { min-width: 88px; }
.apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) > td.apr-c-pre .apr-in { min-width: 100px; }
.apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) > td.apr-c-vat .apr-in { width: 96px; padding-right: 26px; background-position: right 6px center; }
.apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) > td.apr-c-item .apr-in { min-width: 100px; }
.apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) .al-amt { flex-direction: column; align-items: stretch; gap: 2px; }
.apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) .al-amt .apr-in { flex: none; }
.apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) .al-sw { min-height: 24px; font-size: 12px; white-space: nowrap; }
.apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) > td.apr-c-ac { text-align: right; padding-top: 14px; }   /* số xem trước thẳng chữ ô nhập */
.apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) > td.apr-c-act .apr-nf-acts { justify-content: flex-end; }
/* khung hẹp hơn ~920 px (trang 1280 ~790, Xem nhanh 1440 ~860): đang thêm ⇒ Hạng mục / Ghi chú co lại; < 840 px thêm: tiêu đề tiền được xuống
   2 dòng, ✓ / Esc xếp dọc — một hàng vẫn vừa khung (bảng không cuộn ngang) từ 760 px */
@container aprtable (min-width: 760px) and (max-width: 919.98px) {
  .apr-t.apr-lines:has(> tbody > tr.al-addrow:not(.apr-new-f)) > * > tr > .apr-c-item:not(.apr-fill) { min-width: 120px; }
  .apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) > td.apr-c-note .apr-in { min-width: 80px; }
}
/* NEW-262: tiêu đề "Số tiền (trước VAT)" / "Số tiền (gồm VAT)" dài hơn "Amount (…)" cũ ⇒ khi đang có dòng thêm theo cột (ô nhập rộng), MỌI khung
   ≥ 760 px cho tiêu đề tiền xuống 2 dòng gọn "Số tiền" / "(… VAT)" thay vì nới bảng (trước: chỉ khung 760–839) */
@container aprtable (min-width: 760px) {
  .apr-t.apr-lines:has(> tbody > tr.al-addrow:not(.apr-new-f)) thead th:is(.apr-c-pre, .apr-c-ac) { white-space: normal; }
}
@container aprtable (min-width: 760px) and (max-width: 839.98px) {
  .apr-t.apr-lines:has(> tbody > tr.al-addrow:not(.apr-new-f)) > * > tr > .apr-c-item:not(.apr-fill) { min-width: 110px; }
  .apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) > td.apr-c-note .apr-in { min-width: 72px; }
  .apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) > td.apr-c-act .apr-nf-acts { flex-direction: column; align-items: stretch; }
}
/* khung vừa hẹp lại dưới 760 px, trước khi JS đổi sang form nhỏ (cùng khung hình): ô của dáng rộng KHÔNG bị luật ẩn cột Ghi chú / Trước VAT / VAT
   giấu đi — ô đang gõ bị ẩn thì trình duyệt bỏ focus (mất con trỏ khi thu nhỏ cửa sổ) */
@container aprtable (max-width: 759.98px) {
  .apr-t.apr-acc > tbody.al-add > tr.al-addrow:not(.apr-new-f) > td { display: table-cell; }
}
.apr-t > tbody.al-add > tr.apr-new-msg > td { border-bottom: 1px solid var(--line-2); }   /* tbody riêng: dòng cuối (luật :last-child bỏ viền) */

/* 409 on_quote: link tới đề nghị TT đang giữ dòng (B4 — K5) */
.al-qlinks { color: var(--ink); }
.al-qlinks a { font-weight: 600; }
.al-qlinks-slot { margin: 6px 0 0; font-size: 13px; }

/* ---- bảng S4 theo Mục (appendix_rows.js): tiêu đề tháng + dòng theo Mục ---- */
.apr-t tr.apr-mh > td { background: var(--surface-2); border-top: 2px solid var(--line); white-space: normal; }   /* tiêu đề tháng xuống dòng, không nới bảng (khung 400–480 px: ngăn Kỳ vận hành ở 430) */
.apr-mh-sum strong, .apr-mh-due strong { white-space: nowrap; }
.apr-mh-in { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-width: 0; }
.apr-mh-m { font-weight: 700; white-space: nowrap; }
.apr-mh-sum { font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.apr-mh-sum strong { font-weight: 700; }
.apr-mh-due { white-space: normal; }
.apr-mh-side { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-left: auto; }
/* khung ≥ 760 px: BBNT ở cột BBNT, "+ Dòng" ở cột ⋯ (ô apr-mh-w) — bản trong ô gộp chỉ cho khung hẹp */
.apr-t tr.apr-mh > td.apr-mh-w { vertical-align: top; white-space: nowrap; }
.apr-t tr.apr-mh > td.apr-mh-act { text-align: right; }
.apr-t tr.apr-mh > td.apr-mh-act .apr-mh-side { justify-content: flex-end; }
/* S4 gọn (chủ dự án 16/11): cột Ghi chú — chữ thường (không mờ), cắt 3 dòng — đủ ở tooltip, bấm ô để sửa xem toàn bộ.
   S4 tinh chỉnh (16/11, ảnh Xem nhanh ~980 px + trang 1440): bỏ "Ghi chú 42 %" (ghi chú trống "—" vẫn chiếm gần hết, Kỳ / Hạng mục bị dồn, tiêu
   đề tiền xuống 2 dòng). Khung ≥ 760 px: Kỳ · tiền · VAT · ⋯ co theo nội dung (width 1 % + nowrap — tiêu đề "Số tiền (trước VAT)" một dòng, các cột
   tiền đứng liền nhau); Hạng mục ~28 % (≥ 170 px — "Meta Ads · Ads Spend Meta" một dòng ở bảng ~1190 px); Ghi chú (auto) nhận phần còn lại. Bảng KHÔNG có ghi chú nào
   (apr-nonote — appendix_rows.js) ⇒ Ghi chú co theo "—", Hạng mục nhận phần còn lại. Khung < 760: Ghi chú / Trước VAT / VAT ẩn (khối dưới). */
.apr-t.apr-lines td.apr-c-note:not(.apr-fill) { min-width: 120px; max-width: none; white-space: normal; }   /* ô đệm (apr-fill) mang lớp cột khác vị trí — không tính */
.apr-t.apr-lines.apr-nonote td.apr-c-note:not(.apr-fill) { min-width: 0; }
.apr-t.apr-lines thead th.apr-c-vat { width: 1%; }
@container aprtable (min-width: 760px) {
  .apr-t.apr-lines thead th:is(.apr-c-month, .apr-c-pre, .apr-c-vat, .apr-c-ac, .apr-c-act) { width: 1%; white-space: nowrap; }
  .apr-t.apr-lines thead th.apr-c-item { width: 28%; }
  .apr-t.apr-lines .apr-c-item:not(.apr-fill) { min-width: 170px; }
  .apr-t.apr-lines td.apr-c-note:not(.apr-fill) { min-width: 160px; }   /* ghi chú hay dài (chủ dự án 16/11) — không ép xuống ~96 px */
  .apr-t.apr-lines thead th.apr-c-note { width: auto; white-space: nowrap; }
  .apr-t.apr-lines.apr-nonote thead th.apr-c-item { width: auto; }
  .apr-t.apr-lines.apr-nonote thead th.apr-c-note { width: 1%; }
  /* Kỳ: "Tuần 1 (01–07/11)" một dòng (nút sửa .rv-ie / .al-ky-w vốn white-space normal) */
  .apr-t.apr-lines tr:is(.apr-ln, .apr-lg) > td.apr-c-month, .apr-t.apr-lines tr:is(.apr-ln, .apr-lg) > td.apr-c-month * { white-space: nowrap; }
  /* chữ trong ô gộp (tiêu đề tháng / dòng "Cả phụ lục") KHÔNG góp vào bề rộng cột (width 0 + min-width 100 %: xếp theo bề rộng ô, xuống dòng nếu
     thiếu) — tổng tháng dài / chú thích không nới cột Kỳ / Hạng mục */
  .apr-t.apr-lines tr.apr-mh > td:first-child > .apr-mh-in, .apr-t.apr-lines tr.apr-sum-l > td:first-child > .apr-sum-in { width: 0; min-width: 100%; }
  .apr-t.apr-lines tr.apr-ln > td.apr-c-item .apr-desc { display: none; }   /* ghi chú dưới tên chỉ cho khung hẹp (đã có cột Ghi chú) — luật -webkit-box ở dưới từng làm nó hiện cả khung rộng */
  /* tiêu đề tháng MỘT hàng: tháng · tổng trước VAT ··· (phải) BBNT · 🔒 · + Dòng — nhãn / nút không xuống dòng, "Đã khoá" chỉ còn 🔒 (chữ cho trình
     đọc màn hình + tooltip); mở 🔒 xem lý do thì lý do xuống hàng riêng */
  .apr-t.apr-acc tr.apr-mh > td.apr-mh-act .apr-mh-side { flex-wrap: nowrap; align-items: center; }
  .apr-t.apr-acc tr.apr-mh > td.apr-mh-act .badge.al-bbnt { white-space: nowrap; }
  .apr-t.apr-acc tr.apr-mh > td.apr-mh-act .apr-lock { margin: 0; }
  .apr-t.apr-acc tr.apr-mh > td.apr-mh-act .apr-lock-t { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .apr-t.apr-acc tr.apr-mh > td.apr-mh-act .apr-mh-side:has(> .apr-lock[open]) { flex-wrap: wrap; }
  .apr-t.apr-acc tr.apr-mh > td.apr-mh-act .apr-lock[open] { flex-basis: 100%; }
  .apr-t.apr-acc tr.apr-mh > td.apr-mh-act .apr-lock > p { white-space: normal; max-width: 280px; margin-left: auto; text-align: left; }
}
.apr-note { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink); font-size: 13px;
  line-height: 1.45; overflow-wrap: anywhere; text-align: left; }
.apr-t.apr-lines td.apr-c-item { white-space: normal; }
.apr-ln .apr-c-item .apr-desc { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* dòng Lark còn quản: biểu tượng nhỏ (tooltip "Từ Lark — Kế toán / admin sửa") */
.al-lark-ic { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 6px; border: 1px solid var(--line);
  border-radius: 50%; font-size: 10px; font-weight: 700; line-height: 1; color: var(--muted); vertical-align: 1px; cursor: help; }
@container aprtable (min-width: 760px) {
  .apr-t.apr-acc .apr-mh-side.apr-mh-n { display: none; }
}
/* dòng cuối bảng theo Mục: số cả phụ lục (không phải tổng một cột) */
.apr-sum-l .apr-sum-in { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.apr-sum-l .apr-sum-h { font-weight: 700; }
.apr-sum-l .apr-sum-v { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.apr-nw { white-space: nowrap; }
.apr-mh-sub { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--muted); }
.apr-mh-sub .rv-item { color: var(--ink); }
.apr-ln-name { font-weight: 600; }
.apr-ln .apr-c-item .al-badges { margin-top: 2px; display: flex; }
.apr-ln td.apr-c-vat { white-space: nowrap; }
.apr-ln .apr-vsrc { display: block; font-size: 12px; color: var(--muted); white-space: normal; }
.apr-ln .apr-fc-l { color: var(--muted); }
.apr-t .apr-c-pre, .apr-t .apr-c-vat { white-space: nowrap; }
.apr-ro-note { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
/* chủ dự án 15/11: cột Kỳ (tháng + tuần tuỳ chọn, hai dòng) · nhãn BBNT nhỏ trên từng dòng · số sau VAT của máy chủ */
.al-ky { display: inline-flex; flex-direction: column; align-items: flex-start; min-width: 0; text-align: left; }
.al-ky-m { white-space: nowrap; }
.al-ky-w { font-size: 12px; color: var(--muted); white-space: normal; line-height: 1.35; }
.al-ky .al-nw, .al-ky-w .al-nw { white-space: nowrap; }   /* "Tuần 1" · "(01–07/11)": chỉ ngắt giữa hai mảnh, không giữa khoảng ngày */
.badge.al-bbnt { font-size: 12px; font-weight: 500; white-space: normal; line-height: 1.35; max-width: 100%; }
.al-gross { white-space: nowrap; font-variant-numeric: tabular-nums; }
.al-add .apr-in[name="week"] { min-width: 0; }
.apr-fcbtn[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-dark); }
/* khung hẹp: cột Trước VAT / VAT ẩn — số trước VAT + VAT là dòng phụ dưới Mục (apr-n-only) */
/* A5 (ảnh 320 → 1920, 15/11): dòng phụ "trước VAT X   VAT 8%" — vế VAT không ngắt giữa (nút VAT từng vỡ "VAT" / "8%"), hai vế cách bằng gap (không
   dấu "·" đứng đầu dòng khi xuống dòng); số Gồm VAT không ngắt giữa nhóm nghìn ("32.400." / "000 ₫"); cột BBNT của bảng theo Mục co theo nội dung
   (BBNT nằm ở tiêu đề tháng — dòng Mục để trống) để Mục + Gồm VAT có chỗ ở khung laptop 436–644 px */
@container aprtable (max-width: 759.98px) {
  /* bảng gọn 400–759 (ngăn Kỳ vận hành ở 430 / laptop có Trao đổi): Mục + ghi chú dòng và chữ "n nhóm — máy chủ cộng" xuống dòng, số tiền gồm VAT
     KHÔNG ngắt giữa chữ số ⇒ bảng vừa khung, cột BBNT / ✎ ⋯ không bị đẩy ra ngoài (rà soát luồng B — trước: bảng 488 px trong khung 400) */
  .apr-t.apr-acc tr.apr-ln > td.apr-c-item, .apr-t.apr-acc:has(tr.apr-ln) > tfoot > tr > th { white-space: normal; }
  .apr-t.apr-acc tr.apr-ln > td.apr-c-item .al-badges { max-width: 100%; }
  .apr-t.apr-acc tr.apr-ln > td.apr-c-ac .vm-g, .apr-t.apr-acc:has(tr.apr-ln) > tfoot > tr > td.num strong { white-space: nowrap; }
  .apr-t.apr-acc tr.apr-ln > td.apr-c-ac .vm-g wbr, .apr-t.apr-acc:has(tr.apr-ln) > tfoot > tr > td.num strong wbr { display: none; }   /* <wbr> ngắt cả khi nowrap */
  .apr-t.apr-acc tr.apr-ln .apr-n-only .al-ie { white-space: nowrap; overflow-wrap: normal; }
  .apr-t.apr-acc .apr-c-pre, .apr-t.apr-acc .apr-c-vat, .apr-t.apr-acc .apr-c-note { display: none; }
  .apr-t.apr-acc .apr-ln .apr-n-only { display: flex; flex-wrap: wrap; gap: 0 10px; align-items: baseline; }
  .apr-t.apr-acc .apr-ln .apr-n-only > span + span { white-space: nowrap; }      /* "trước VAT" được xuống dòng trước số (khung 422 px + nút 44 px) */
  .apr-t.apr-acc .apr-ln .apr-n-only .rv-ie { white-space: nowrap; margin: 0; }
  .apr-t.apr-acc .apr-ln .apr-c-ac .vm-g { white-space: nowrap; }
  .apr-t.apr-acc.apr-lines thead th.apr-c-st { width: 1%; }        /* MỘT luật cho cột BBNT mọi khung < 760 (co theo nội dung — nhãn ngắn / 🔒) */
  .apr-t.apr-acc.apr-lines thead th.apr-c-ac { width: 112px; white-space: normal; }   /* "Số tiền (gồm VAT)" (NEW-262) dài hơn "Amount (VAT)" cũ ⇒ 2 dòng
     gọn "Số tiền" / "(gồm VAT)" (ngoặc giữ liền — span .apr-nw) thay vì nới cột */
}
@container aprtable (min-width: 560px) and (max-width: 759.98px) {
  .apr-t.apr-acc.apr-lines thead th.apr-c-ac { width: 136px; }
}
@container aprtable (min-width: 440px) and (max-width: 759.98px) {
  .apr-t.apr-acc tr.apr-ln .apr-n-only > span:first-child { white-space: nowrap; }   /* đủ chỗ ⇒ "trước VAT 40.000.000 ₫" một dòng (không rơi "₫") */
}
@container aprtable (max-width: 399.98px) {
  .apr-t.apr-acc tr.apr-mh { background: var(--surface-2); border-width: 2px; }
  .apr-t.apr-acc tr.apr-mh > td { background: none; border-top: 0; }
  /* thẻ dòng (S4 gọn 16/11): Hạng mục · ⋯ / Kỳ (dòng đầu tháng, tuần) / Sau VAT — ghi chú + trước VAT + VAT ở dòng phụ dưới Hạng mục; BBNT ở tiêu đề tháng */
  .apr-t.apr-acc tr:is(.apr-ln, .apr-lg) > .apr-c-item { grid-column: 1 / 3; grid-row: 1; }
  .apr-t.apr-acc tr:is(.apr-ln, .apr-lg) > .apr-c-act { grid-column: 3; grid-row: 1; }
  .apr-t.apr-acc tr:is(.apr-ln, .apr-lg) > .apr-c-month { grid-column: 1 / -1; grid-row: 2; font-weight: 400; }
  .apr-t.apr-acc tr:is(.apr-ln, .apr-lg) > .apr-c-ac { grid-row: 3; }
  .apr-t.apr-acc tbody tr:is(.apr-ln, .apr-lg) > .apr-c-ac::before { content: "Số tiền (gồm VAT)"; }
  .apr-t.apr-acc tr.apr-ln .al-ky { flex-direction: row; flex-wrap: wrap; gap: 0 6px; }
  .apr-t.apr-acc tr.apr-ln .al-bbnt-none { display: none; }
  .apr-t.apr-acc tr:is(.apr-ln, .apr-lg) > td.apr-c-month:empty { display: none; }   /* ô Kỳ trống (dòng cả tháng — tháng ở tiêu đề tháng) */
  .apr-mh-side { margin-left: 0; }
}
@media (pointer: coarse) {
  .al-sw { min-height: 44px; }
  .apr .al-add select.apr-in, .apr .al-add input.apr-in, .al-addbox input, .al-addbox select { font-size: 16px; min-height: 44px; }
  .apr-t > tbody.al-add > tr.al-addrow:not(.apr-new-f) .al-sw { min-height: 44px; }
  .apr .rv-ie.al-ie, .apr-mh .rv-ie, .apr-fcbtn, .al-cap .al-cap-act { min-height: 44px; }
}
@media print {
  .apr-fcbtn, .apr-mh-add, .al-cap-act { display: none !important; }
}

/* chủ dự án 16/11: bấm thẳng ô Hạng mục để đổi dịch vụ — nút sửa căn trái, chữ đậm như tên hạng mục */
.apr-t.apr-lines td.apr-c-item > .rv-ie.al-ie { text-align: left; }

/* ô chọn dịch vụ có tìm (chủ dự án 16/11 — UI.searchSelect trong ô sửa Hạng mục): ô hiện co trong ô sửa, nút ✓ ✕ cùng hàng */
.rv-ie-box.al-ie-ss .ss-btn { flex: 1 1 180px; width: auto; min-width: 0; max-width: 320px; }

/* NEW-245 H2 — S4 "Theo hạng mục" | "Theo tháng" (chủ dự án chốt Q3 16/11/2026): nút chọn cách xem + dòng tiêu đề hạng mục (cùng khung tiêu đề tháng
   .apr-mh) + ô Kỳ có tháng (chế độ hạng mục). Chỉ token màu. */
.apr-viewbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.apr-t tr.apr-ih > td { border-top-width: 2px; }
.apr-ih .apr-mh-m { white-space: normal; overflow-wrap: anywhere; }
.apr-ih-gp { font-variant-numeric: tabular-nums; white-space: nowrap; }
.apr-ih-gp strong { font-weight: 700; }
.al-ky-m { font-variant-numeric: tabular-nums; white-space: nowrap; }
.apr-byitem .al-ky-w { display: block; font-size: 12px; color: var(--muted); }
