/* Trang Đại lý & CTV và Hoa hồng Đại lý & CTV (partners.js) — dùng chung lớp hh-* của commissions.css */
@media screen {
  #appView .hh-tag.pt-tag-dai_ly { background:#f4eadb; color:var(--bronze-deep); }
  #appView .hh-tag.pt-tag-ctv { background:#e4f0ea; color:#1f5e43; }
  #appView .hh-tag.pt-tag-ddtm { background:#e8ecf7; color:#2c3f7a; }
  #appView .pt-list tr.is-off td { color:#8a8078; }
  #appView .pt-list tr.is-off strong { color:#5b524a; }
  #appView .hh-grid.pt-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
  #appView .hh-grid.pt-grid5 { grid-template-columns:repeat(5,minmax(0,1fr)); }
  #appView .hh-stats.pt-stats5 { grid-template-columns:repeat(5,minmax(0,1fr)); }
  #appView .pt-form .hh-head h2 { text-transform:none; letter-spacing:0; }
  #appView #rpBody { position:relative; }
  #appView .pt-pop { min-width:min(460px,calc(100vw - 80px)); }
  /* bảng dòng khách hàng (nhập trực tiếp trong ô) */
  #appView .pt-rows-wrap { margin-bottom:10px; }
  #appView table.pt-rows { width:2330px; min-width:2330px; border-collapse:collapse; table-layout:fixed; font-size:12.5px; }
  #appView .pt-rows th { padding:6px 5px; border:1px solid #c9b89e; border-bottom:2px solid #8a6a3c; background:#fff; color:#111; font-size:10.5px; font-weight:800; text-transform:uppercase; text-align:center; white-space:normal; line-height:1.25; }
  #appView .pt-rows td { padding:4px 4px; border:1px solid #d9cbb6; vertical-align:middle; background:#fff; }
  /* Số căn giữa, luôn đủ chữ số (cột đủ rộng, không cắt) */
  #appView .pt-rows td.c { text-align:center; } #appView .pt-rows td.m { text-align:center; font-variant-numeric:tabular-nums; font-weight:700; white-space:nowrap; }
  #appView .pt-rows td.net { color:#b3261e; background:#fff8e1; }
  #appView .pt-rows input { width:100%; min-height:32px; box-sizing:border-box; margin:0; padding:4px 5px; font-size:12.5px; text-overflow:clip; }
  #appView .pt-rows input.n { text-align:center; font-variant-numeric:tabular-nums; }
  #appView .pt-rows td.pt-namecell { white-space:nowrap; }
  /* ô chữ tự xuống dòng, giãn cao theo nội dung */
  #appView .pt-rows textarea.pt-ta { display:block; width:100%; min-height:32px; height:32px; box-sizing:border-box; margin:0; padding:6px 6px; font-size:12.5px; line-height:1.35; resize:none; overflow:hidden; white-space:pre-wrap; overflow-wrap:anywhere; }
  /* ô % : số căn giữa, ký hiệu % cố định ở đuôi */
  #appView .pt-pct { position:relative; display:block; }
  #appView .pt-pct input { padding-right:18px !important; padding-left:14px !important; }
  #appView .pt-pct i { position:absolute; right:7px; top:50%; transform:translateY(-50%); font-style:normal; font-size:12px; font-weight:700; color:#5b524a; pointer-events:none; }
  /* 19 cột biểu mẫu + cột nút bỏ dòng */
  #appView .pt-rows .pt-c0 { width:36px; } #appView .pt-rows .pt-c1 { width:250px; } #appView .pt-rows .pt-c2 { width:170px; } #appView .pt-rows .pt-c3 { width:180px; } #appView .pt-rows .pt-c4 { width:60px; }
  #appView .pt-rows .pt-c5 { width:96px; } #appView .pt-rows .pt-c6 { width:90px; }
  #appView .pt-rows .pt-c7, #appView .pt-rows .pt-c9, #appView .pt-rows .pt-c10, #appView .pt-rows .pt-c12, #appView .pt-rows .pt-c14, #appView .pt-rows .pt-c16, #appView .pt-rows .pt-c17 { width:128px; }
  #appView .pt-rows .pt-c11 { width:138px; } #appView .pt-rows .pt-c8, #appView .pt-rows .pt-c13, #appView .pt-rows .pt-c15 { width:84px; } #appView .pt-rows .pt-c18 { width:150px; } #appView .pt-rows .pt-c19 { width:36px; }
  #appView .pt-rows td select { text-align:center; text-align-last:center; padding-left:6px; padding-right:22px; }
  #appView .pt-rows thead th { white-space:normal; font-size:10px; }
  #appView .pt-rows select { width:100%; min-height:32px; padding:2px 4px; font-size:12px; }
  #appView .pt-form .hh-f .hh-sub { display:block; margin-top:3px; color:#8a8078; font-size:11px; font-weight:600; text-transform:none; letter-spacing:0; }
  #appView .pt-del { min-height:28px; padding:0 6px; color:var(--crit); }
  /* Tổng hợp: 4 ô một dòng + dòng Tổng hoa hồng chi trả thực tế */
  #appView .pt-tot-grid { display:block; }
  #appView .pt-tot-row { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px 14px; align-items:end; }
  #appView .pt-tot-i { display:flex; flex-direction:column; gap:6px; min-width:0; }
  #appView .pt-tot-i .hh-lbl { display:flex; align-items:center; gap:8px; min-height:34px; }
  #appView .pt-tot-v { justify-content:center; text-align:center; font-size:16px; }
  #appView .pt-tax-w { display:inline-block; width:74px; }
  #appView .pt-tax-w input { min-height:32px; padding-top:3px; padding-bottom:3px; text-align:center; font-weight:700; }
  #appView .pt-tot-pay { display:flex; align-items:center; justify-content:flex-end; gap:16px; margin-top:14px; padding-top:14px; border-top:1px dashed #d9cbb6; }
  #appView .pt-tot-pay > span { font-size:15px; font-weight:800; text-transform:uppercase; letter-spacing:.02em; color:#1f1f1f; }
  #appView .pt-tot-pay .hh-alloc { min-width:240px; justify-content:center; font-size:20px; }
  #appView .hh-sec.is-missing .pt-rows { outline:2px solid var(--crit); }
  #appView .hh-detail.pt-sum th.l, #appView .hh-detail.pt-sum td.l { text-align:left; }
  /* Tổng hợp hoa hồng ĐL-CTV (sheet "Tổng") trên màn hình */
  #appView table.hh-sum.pt-sum2 { width:100%; min-width:1250px; }
  #appView .hh-sum.pt-sum2 small { color:#5b524a; font-weight:600; font-size:11px; }
  @media (max-width:1100px) { #appView .hh-grid.pt-grid, #appView .hh-grid.pt-grid5 { grid-template-columns:repeat(3,minmax(0,1fr)); } #appView .pt-tot-row { grid-template-columns:repeat(2,minmax(0,1fr)); } }
  @media (max-width:560px) { #appView .pt-tot-row { grid-template-columns:1fr; } #appView .pt-tot-pay { flex-direction:column; align-items:stretch; gap:8px; } #appView .pt-tot-pay .hh-alloc { min-width:0; } }
  @media (max-width:900px) { #appView .hh-grid.pt-grid, #appView .hh-grid.pt-grid5 { grid-template-columns:1fr 1fr; } #appView .hh-stats.pt-stats5 { grid-template-columns:1fr 1fr 1fr; } }
  @media (max-width:560px) { #appView .hh-grid.pt-grid, #appView .hh-grid.pt-grid5, #appView .hh-stats.pt-stats5 { grid-template-columns:1fr; } #appView .hh-grid.pt-grid .hh-f.w2, #appView .hh-grid.pt-grid5 .hh-f.w2 { grid-column:auto; } }
}

/* Bản in bảng đối chiếu hoa hồng đại lý / CTV và bảng tổng hợp tháng — A4 ngang (page hhp của commissions.css) */
@media print {
  #printRoot .pt-p-who { margin:3px 0 4px; font-size:8.5pt; }
  #printRoot table.pt-p-table { width:280mm; border-collapse:collapse; table-layout:fixed; font-size:7pt; }
  #printRoot .pt-p-table th, #printRoot .pt-p-table td { padding:1px 2px; border:1px solid #555; vertical-align:middle; line-height:1.2; white-space:normal; overflow-wrap:anywhere; height:auto; letter-spacing:0; }
  /* tiêu đề chỉ xuống dòng ở khoảng trắng (không bẻ giữa chữ như "LƯỢN G") */
  #printRoot .pt-p-table th { background:#fff; font-size:6.2pt; font-weight:800; text-align:center; overflow-wrap:normal; word-break:normal; hyphens:none; }
  #printRoot .pt-p-table .pt-p-num td { text-align:center; font-size:5.8pt; color:#444; }
  /* số căn giữa, không xuống dòng, chữ số đều; cột đủ rộng nên không tràn sang ô bên cạnh */
  /* KHÔNG dùng font-variant-numeric (tabular-nums) ở bản in: html2canvas (Xuất PDF) vẽ chữ số thường nên lệch độ rộng → số tràn ô / hở chữ. */
  #printRoot .pt-p-table td.c, #printRoot .pt-p-table td.r { text-align:center; white-space:nowrap; font-variant-numeric:normal; font-feature-settings:normal; overflow-wrap:normal; word-break:keep-all; }
  #printRoot .pt-p-table td.l { text-align:left; }
  #printRoot .pt-p-table .pt-nw { white-space:nowrap; }
  #printRoot .pt-p-table td.pt-name { white-space:nowrap; overflow-wrap:normal; word-break:keep-all; }
  #printRoot .pt-p-table td.pt-dkdv { overflow-wrap:normal; word-break:keep-all; font-size:6pt; line-height:1.25; }
  #printRoot .pt-p-table td small { font-size:5.8pt; }
  #printRoot .pt-p-table tbody td { height:5mm; }
  #printRoot .pt-p-table tfoot td.r { text-align:right; }
  #printRoot .pt-p-table tfoot td:nth-last-child(2) { text-align:center; }
  #printRoot .pt-p-table tfoot td { font-weight:700; } #printRoot .pt-p-table tr.pt-p-pay td { background:#fff59d; }
  #printRoot .pt-p-table tr { break-inside:avoid; }
  #printRoot .pt-p-terms { margin-top:5px; font-size:7pt; line-height:1.35; }
  #printRoot .pt-p-date { margin:5px 0 0; text-align:right; font-size:8pt; font-style:italic; }
  #printRoot .hh-p-sigs.n7 { grid-template-columns:repeat(7,minmax(0,1fr)); margin-top:5px; }
  #printRoot .hh-p-sigs.n6 { grid-template-columns:repeat(6,minmax(0,1fr)); margin-top:10mm; }
  #printRoot .pt-print .hh-p-sig .s { min-height:12mm; }
  #printRoot .hh-detail.pt-sum th.l, #printRoot .hh-detail.pt-sum td.l { text-align:left; }
  /* Bảng in dễ đọc: nét kẻ mảnh, ô có đệm, chữ đen thuần (trừ ô vàng tổng chi trả) */
  #printRoot .pt-p-table th, #printRoot .pt-p-table td { border:0.3px solid #000; color:#000; padding:1.5px 2px; line-height:1.3; }
  /* tiêu đề cột hẹp (CK %, Số lượng…): chữ 5,8pt, đệm 1px để từ dài nhất ("LƯỢNG", "KHÁCH" ≈ 7,5 mm) vừa cột 9–10 mm, không đè nét kẻ */
  #printRoot .pt-p-table thead th { padding:1.5px 1px; font-size:5.8pt; line-height:1.2; }
  #printRoot .pt-p-table td { font-weight:600; }
  #printRoot .pt-p-table .pt-p-num td { color:#000; font-weight:500; }
  #printRoot .pt-print .hh-p-foot, #printRoot .pt-p-who, #printRoot .pt-p-terms, #printRoot .pt-p-date { color:#000; }
}

/* Điện thoại (≤ 900px): danh sách Đại lý & CTV và bảng đối chiếu hoa hồng → thẻ (khung thẻ chung ở commissions.css) */
@media screen and (max-width: 900px) {
  /* Hoa hồng Đại lý & CTV: tên + kỳ · tình trạng / tổng thành tiền · HH thực nhận / thuế · phải chi / số dòng · Mở */
  #appView .pc-list > tbody > tr { grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-template-areas:"name st" "amt net" "tax pay" "rows act"; }
  #appView .pc-list > tbody > tr > td:nth-child(1) { grid-area:name; }
  #appView .pc-list > tbody > tr > td:nth-child(7) { grid-area:st; justify-self:end; text-align:right; }
  #appView .pc-list > tbody > tr > td:nth-child(7) .hub-sub { display:block; margin-top:2px; }
  #appView .pc-list > tbody > tr > td:nth-child(3) { grid-area:amt; margin-top:6px; }
  #appView .pc-list > tbody > tr > td:nth-child(4) { grid-area:net; margin-top:6px; text-align:right; }
  #appView .pc-list > tbody > tr > td:nth-child(5) { grid-area:tax; margin-top:6px; }
  #appView .pc-list > tbody > tr > td:nth-child(6) { grid-area:pay; margin-top:6px; text-align:right; }
  #appView .pc-list > tbody > tr > td:nth-child(6) b { font-size:16px; font-weight:800; }
  #appView .pc-list > tbody > tr > td:nth-child(2) { grid-area:rows; align-self:center; margin-right:-12px; padding:10px 12px 0 0; border-top:1px solid #EFE9DD; color:#6F655A; }
  #appView .pc-list > tbody > tr > td:nth-child(2)::after { content:" dòng khách"; }
  #appView .pc-list > tbody > tr > td.hh-act { grid-area:act; padding-top:10px; border-top:1px solid #EFE9DD; }
  #appView .pc-list > tbody > tr > td:nth-child(3)::before { content:"Tổng thành tiền"; }
  #appView .pc-list > tbody > tr > td:nth-child(4)::before { content:"HH thực nhận"; }
  #appView .pc-list > tbody > tr > td:nth-child(5)::before { content:"Thuế TNCN"; }
  #appView .pc-list > tbody > tr > td:nth-child(6)::before { content:"Phải chi"; }
  #appView .pc-list > tbody > tr > td:nth-child(2)::before, #appView .pc-list > tbody > tr > td:nth-child(7)::before { content:none; }
  /* Đại lý & CTV: tên + loại · trạng thái / liên hệ / HH · CK khách · CK sale / ngân hàng / bảng hoa hồng · Mở */
  #appView .pt-list > tbody > tr { grid-template-columns:repeat(3,minmax(0,1fr)); }
  #appView .pt-list > tbody > tr.is-off { background:#FAF7F2; }
  #appView .pt-list > tbody > tr > td:nth-child(1) { grid-column:1 / 3; grid-row:1; }
  #appView .pt-list > tbody > tr > td:nth-child(8) { grid-column:3; grid-row:1; justify-self:end; }
  #appView .pt-list > tbody > tr > td:nth-child(2) { grid-column:1 / -1; color:#25211C; }
  #appView .pt-list > tbody > tr > td:nth-child(2) .hub-sub { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  #appView .pt-list > tbody > tr > td:nth-child(3), #appView .pt-list > tbody > tr > td:nth-child(4), #appView .pt-list > tbody > tr > td:nth-child(5) { margin-top:6px; font-weight:700; color:#25211C; }
  #appView .pt-list > tbody > tr > td:nth-child(3)::before { content:"HH"; }
  #appView .pt-list > tbody > tr > td:nth-child(4)::before { content:"CK khách"; }
  #appView .pt-list > tbody > tr > td:nth-child(5)::before { content:"CK sale"; }
  #appView .pt-list > tbody > tr > td:nth-child(6) { grid-column:1 / -1; margin-top:6px; }
  #appView .pt-list > tbody > tr > td:nth-child(6)::before { content:"Ngân hàng"; }
  #appView .pt-list > tbody > tr > td:nth-child(7) { grid-column:1 / 3; align-self:center; margin-right:-12px; padding:10px 12px 0 0; border-top:1px solid #EFE9DD; }
  #appView .pt-list > tbody > tr > td:nth-child(7) .hub-sub { display:block; }
  #appView .pt-list > tbody > tr > td.hh-act { grid-column:3; padding-top:10px; border-top:1px solid #EFE9DD; }
  #appView .pt-list > tbody > tr > td:is(:nth-child(3), :nth-child(4), :nth-child(5), :nth-child(6))::before { display:block; color:#6F655A; font-size:12px; font-weight:500; }
}

/* ===== MOBILE 11/2026 (≤ 760px) — docs/MOBILE-UI-SPEC.md ===== */
#appView .pt-m-bar { display:none; }
@media screen and (max-width: 760px) {
  body.sales-shell #appView .pt-m-hide { display:none; }

  /* ---------- Đại lý & CTV: thẻ — tên + loại | trạng thái · liên hệ · HH | CK khách | CK sale · ngân hàng · bảng hoa hồng (cả thẻ bấm được → bỏ nút Mở) ---------- */
  body.sales-shell #appView .pt-list > tbody > tr { gap:4px 12px; }
  body.sales-shell #appView .pt-list > tbody > tr.is-off { background:#fff; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(1) { align-self:center; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(1) .hub-sub { display:block; margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(8) { align-self:start; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(2) { margin-top:2px; font-size:14px; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(2) .hub-sub { font-size:13px; }
  body.sales-shell #appView .pt-list > tbody > tr > td:is(:nth-child(3), :nth-child(4), :nth-child(5)) { margin-top:8px; font-size:14px; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(6) { font-size:14px; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(6) .hub-sub { display:block; color:var(--m-sub); font-size:12px; font-weight:500; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(7) { grid-column:1 / -1; margin:10px 0 0; padding:10px 0 0; border-top:1px solid var(--m-line-soft); font-size:14px; font-weight:600; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(7) .hub-sub { color:var(--m-sub); font-size:12px; font-weight:500; }
  body.sales-shell #appView .pt-list > tbody > tr > td.hh-act { display:none; }

  /* ---------- Hoa hồng Đại lý & CTV: thẻ — tên + loại | tình trạng · kỳ | ngày chi · 4 số · số dòng (bỏ nút Mở) ---------- */
  body.sales-shell #appView .pc-list > tbody > tr { grid-template-areas:"name st" "amt net" "tax pay" "rows rows"; gap:4px 12px; }
  body.sales-shell #appView .pc-list > tbody > tr > td:nth-child(1) .hub-sub { display:block; margin-top:2px; }
  body.sales-shell #appView .pc-list > tbody > tr > td:nth-child(7) { align-self:start; }
  body.sales-shell #appView .pc-list > tbody > tr > td:nth-child(7) .hub-sub { color:var(--m-sub); font-size:12px; }
  body.sales-shell #appView .pc-list > tbody > tr > td:is(:nth-child(3), :nth-child(4), :nth-child(5), :nth-child(6)) { margin-top:8px; font-size:14px; font-weight:600; }
  body.sales-shell #appView .pc-list > tbody > tr > td:nth-child(2) { margin:10px 0 0; padding:10px 0 0; border-top:1px solid var(--m-line-soft); font-size:13px; }
  body.sales-shell #appView .pc-list > tbody > tr > td.hh-act { display:none; }

  /* ---------- Đầu màn sửa (đại lý / bảng đối chiếu): ← tròn + nút ít dùng; Lưu ở dải đáy ---------- */
  body.sales-shell #appView .srp-top:has(#ptBack, #pcBack) { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 12px; }
  body.sales-shell #appView .srp-top :is(#ptBack, #pcBack) { height:40px; min-height:40px; padding:0 12px 0 6px; border:0; border-radius:20px; background:none; color:var(--m-ink); font-size:15px; font-weight:700; }
  body.sales-shell #appView .srp-top:has(#ptBack, #pcBack) .srp-actions { display:flex; flex:1 1 auto; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
  body.sales-shell #appView .srp-top:has(#ptBack, #pcBack) .srp-actions > button { height:40px; min-height:40px; padding:0 12px; border-radius:12px; font-size:13px; }
  body.sales-shell #appView .srp-top:has(#ptBack, #pcBack) .srp-actions > .ui-more { width:40px; padding:0; }
  body.sales-shell #appView .srp-top:has(~ .pt-m-bar) .srp-actions > :is(#ptSave, #pcSave, #pcPreview, #pcPdf, #pcPrint) { display:none; }
  body.sales-shell #appView .pt-m-bar { display:flex; gap:8px; margin-top:16px; }
  body.sales-shell #appView .pt-m-bar > button.primary { flex:1 1 auto; justify-content:center; height:46px; min-height:46px; border:1px solid var(--m-accent); border-radius:12px; background:var(--m-accent); color:#fff; font-size:15px; font-weight:700; }
  body.sales-shell #appView .pt-m-bar > .ui-more { flex:0 0 46px; width:46px; height:46px; min-height:46px; border-radius:12px; }

  /* ---------- Form (đại lý / bảng đối chiếu): phẳng, tiêu đề nhóm 15/700, ô 46px ---------- */
  body.sales-shell #appView form.hh-paper:is(#ptForm, #pcForm) { padding:0; border:0; border-radius:0; background:none; box-shadow:none; }
  body.sales-shell #appView :is(#ptForm, #pcForm) .hh-head { margin:0 0 12px; text-align:left; }
  body.sales-shell #appView :is(#ptForm, #pcForm) .hh-head h2 { color:var(--m-ink); font-size:17px; font-weight:800; letter-spacing:0; line-height:1.3; text-transform:none; }
  body.sales-shell #appView :is(#ptForm, #pcForm) .hh-head-sub { color:var(--m-sub); font-size:13px; }
  body.sales-shell #appView :is(#ptForm, #pcForm) .hh-grid { gap:12px; }
  body.sales-shell #appView :is(#ptForm, #pcForm) .hh-f :is(input:not([type="checkbox"]), select) { height:46px; min-height:46px; border-color:var(--m-line); border-radius:12px; font-size:16px; }
  body.sales-shell #appView :is(#ptForm, #pcForm) .hh-f > label { margin-bottom:6px; color:var(--m-sub); font-size:13px; font-weight:600; }
  body.sales-shell #appView :is(#ptForm, #pcForm) .hh-sec { margin:20px 0 0; padding:20px 0 0; border-top:1px solid var(--m-line-soft); }
  body.sales-shell #appView :is(#ptForm, #pcForm) .hh-sec > h3 { margin:0 0 12px; padding:0; border:0; color:var(--m-ink); font-size:15px; font-weight:700; letter-spacing:0; text-transform:none; }
  body.sales-shell #appView :is(#ptForm, #pcForm) .hh-vnd span { right:12px; color:var(--m-sub); font-size:14px; }
  body.sales-shell #appView :is(#ptForm, #pcForm) .hh-notef { margin-top:16px; }
  body.sales-shell #appView #pcForm > .hh-fs > .hh-grid:last-child { margin-top:20px; padding-top:20px; border-top:1px solid var(--m-line-soft); }
  body.sales-shell #appView #pcPartnerInfo { margin:8px 0 0; font-size:12px; line-height:1.5; }

  /* Dòng khách hàng của bảng đối chiếu → thẻ (19 cột → lưới 6 cột, nhãn trên ô) */
  body.sales-shell #appView .pt-rows-wrap { overflow:visible; margin:0 0 10px; border:0; border-radius:0; }
  body.sales-shell #appView table.pt-rows { display:block; width:100%; min-width:0; table-layout:auto; font-size:14px; }
  body.sales-shell #appView .pt-rows colgroup, body.sales-shell #appView .pt-rows thead { display:none; }
  body.sales-shell #appView .pt-rows tbody { display:flex; flex-direction:column; gap:10px; }
  body.sales-shell #appView .pt-rows tbody tr { display:grid; grid-template-columns:repeat(6, minmax(0,1fr)); gap:10px 8px; padding:12px; border:1px solid var(--m-line); border-radius:14px; background:#fff; }
  body.sales-shell #appView .pt-rows tbody td { display:block; min-width:0; padding:0; border:0; background:none; color:var(--m-ink); font-size:14px; text-align:left; white-space:normal; }
  body.sales-shell #appView .pt-rows tbody td.m { display:flex; flex-direction:column; justify-content:flex-start; font-weight:700; text-align:left; }
  body.sales-shell #appView .pt-rows tbody td::before { display:block; margin-bottom:5px; color:var(--m-sub); font-size:12px; font-weight:600; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(1) { display:none; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(2) { grid-column:1 / 6; grid-row:1; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(20) { grid-column:6; grid-row:1; display:flex; justify-content:flex-end; align-items:flex-start; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(20):empty { display:none; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(3) { grid-column:1 / 4; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(4) { grid-column:4 / 7; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(5) { grid-column:1 / 3; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(6) { grid-column:3 / 5; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(7) { grid-column:5 / 7; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(8) { grid-column:1 / 4; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(9) { grid-column:4 / 7; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(10) { grid-column:1 / 4; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(11) { grid-column:4 / 7; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(12) { grid-column:1 / 4; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(13) { grid-column:4 / 7; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(14) { grid-column:1 / 4; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(15) { grid-column:4 / 7; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(16) { grid-column:1 / 4; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(17) { grid-column:4 / 7; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(19) { grid-column:1 / -1; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(18) { grid-column:1 / -1; grid-row:auto; order:2; flex-direction:row; align-items:baseline; justify-content:space-between; margin:0 -12px -12px; padding:10px 12px 12px; border-top:1px solid var(--m-line-soft); border-radius:0 0 14px 14px; background:var(--m-wash); color:var(--m-ink); font-size:16px; font-weight:800; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(18)::before { margin:0; font-size:13px; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(3)::before { content:"Số phiếu"; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(4)::before { content:"Mô tả dịch vụ"; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(5)::before { content:"SL"; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(6)::before { content:"Giá ($)"; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(7)::before { content:"Tỷ giá"; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(8)::before { content:"Thành tiền (VNĐ)"; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(9)::before { content:"Giảm giá"; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(10)::before { content:"Sau chiết khấu"; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(11)::before { content:"Giá tính HH"; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(12)::before { content:"Chính sách HH"; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(13)::before { content:"HH nhận được"; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(14)::before { content:"CK cho khách"; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(15)::before { content:"Tiền CK khách"; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(16)::before { content:"CK cho sale"; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(17)::before { content:"Tiền CK sale"; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(18)::before { content:"HH thực nhận"; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(19)::before { content:"Ghi chú"; }
  body.sales-shell #appView .pt-rows tbody td.m > span, body.sales-shell #appView .pt-rows tbody td.m > b { display:flex; align-items:center; min-height:46px; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(18) > b { min-height:0; }
  body.sales-shell #appView .pt-rows :is(input, select) { height:46px; min-height:46px; padding:0 12px; border-color:var(--m-line); border-radius:12px; font-size:16px; }
  body.sales-shell #appView .pt-rows input.n { text-align:right; }
  body.sales-shell #appView .pt-rows td select { text-align:left; text-align-last:left; padding-right:28px; }
  body.sales-shell #appView .pt-rows textarea.pt-ta { min-height:46px; padding:12px; border-color:var(--m-line); border-radius:12px; font-size:16px; line-height:1.35; }
  body.sales-shell #appView .pt-rows .pt-pct input { padding-left:12px !important; padding-right:30px !important; text-align:right; }
  body.sales-shell #appView .pt-rows .pt-pct i { right:12px; font-size:14px; }
  body.sales-shell #appView .pt-rows td.net { color:var(--m-ink); }
  body.sales-shell #appView .pt-del { width:40px; height:40px; min-height:40px; margin:3px -4px 0 0; padding:0; border:0; border-radius:12px; font-size:15px; }
  body.sales-shell #appView #pcAddRow { width:100%; height:44px; min-height:44px; border:1px dashed var(--m-line); border-radius:12px; background:#fff; font-size:14px; }
  body.sales-shell #appView .pt-pop { min-width:0; max-width:calc(100vw - 24px); }
  /* Tổng hợp: 2 cột ô số nền nhạt, dòng chi trả thực tế nổi bật (bỏ nền vàng) */
  body.sales-shell #appView .pt-tot-row { grid-template-columns:repeat(2, minmax(0,1fr)); align-items:stretch; gap:8px; }
  body.sales-shell #appView .pt-tot-i { justify-content:space-between; gap:4px; padding:10px 12px; border-radius:12px; background:var(--m-wash); }
  body.sales-shell #appView .pt-tot-i .hh-lbl { min-height:0; color:var(--m-sub); font-size:12px; font-weight:600; line-height:1.3; }
  body.sales-shell #appView .pt-tot-v { justify-content:flex-start; min-height:0; height:auto; padding:0; border:0; background:none; font-size:16px; text-align:left; }
  body.sales-shell #appView .pt-tax-w { width:84px; }
  body.sales-shell #appView .pt-tax-w input { height:40px; min-height:40px; padding:0 26px 0 8px !important; text-align:right; }
  body.sales-shell #appView .pt-tot-pay { flex-direction:column; align-items:stretch; gap:6px; margin-top:12px; padding:12px; border:0; border-radius:12px; background:var(--m-wash); }
  body.sales-shell #appView .pt-tot-pay > span { color:var(--m-sub); font-size:13px; font-weight:600; letter-spacing:0; text-transform:none; }
  body.sales-shell #appView .pt-tot-pay .hh-alloc { justify-content:flex-start; min-width:0; min-height:0; height:auto; padding:0; border:0; background:none; color:var(--m-accent-deep); font-size:22px; }

  /* Trang đại lý: bảng đối chiếu / khách CRM → thẻ */
  body.sales-shell #appView .hh-card { padding:14px; border:1px solid var(--m-line); border-radius:14px; }
  body.sales-shell #appView .hh-card .srp-cardhead h2 { font-size:15px; }
  body.sales-shell #appView .hh-card .tbl-wrap { overflow:visible; border:0; }
  body.sales-shell #appView .hh-card table.hh-list { display:block; min-width:0; }
  body.sales-shell #appView .hh-card table.hh-list thead { display:none; }
  body.sales-shell #appView .hh-card table.hh-list tbody { display:flex; flex-direction:column; }
  body.sales-shell #appView .hh-card table.hh-list tbody tr { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:2px 12px; padding:12px 0; border-top:1px solid var(--m-line-soft); background:none; }
  body.sales-shell #appView .hh-card table.hh-list tbody tr:first-child { border-top:0; }
  body.sales-shell #appView .hh-card table.hh-list tbody td { display:block; min-width:0; padding:0; border:0; background:none !important; font-size:13px; text-align:left; }
  body.sales-shell #appView .hh-card table.hh-list tbody td:first-child { font-size:14px; }
  body.sales-shell #appView .hh-card table.hh-list tbody td:first-child .hub-sub { display:block; }
  body.sales-shell #appView .hh-card table.hh-list tbody td:nth-child(even) { text-align:right; }
  body.sales-shell #appView .hh-card table.hh-list tbody td:empty { display:none; }
  body.sales-shell #appView .hh-card { margin-top:12px; }
  /* bảng đối chiếu của đại lý: kỳ | tình trạng · HH thực nhận | thuế · số dòng | phải chi (bấm cả dòng) */
  body.sales-shell #appView .hh-card tr[data-stmt] > td:nth-child(1) { grid-column:1; grid-row:1; }
  body.sales-shell #appView .hh-card tr[data-stmt] > td:nth-child(6) { grid-column:2; grid-row:1; text-align:right; }
  body.sales-shell #appView .hh-card tr[data-stmt] > td:nth-child(3) { grid-column:1; grid-row:2; margin-top:6px; }
  body.sales-shell #appView .hh-card tr[data-stmt] > td:nth-child(4) { grid-column:2; grid-row:2; margin-top:6px; text-align:right; }
  body.sales-shell #appView .hh-card tr[data-stmt] > td:nth-child(2) { grid-column:1; grid-row:3; align-self:end; color:var(--m-sub); text-align:left; }
  body.sales-shell #appView .hh-card tr[data-stmt] > td:nth-child(5) { grid-column:2; grid-row:3; text-align:right; font-size:16px; }
  body.sales-shell #appView .hh-card tr[data-stmt] > td:nth-child(3)::before { content:"HH thực nhận"; display:block; color:var(--m-sub); font-size:12px; }
  body.sales-shell #appView .hh-card tr[data-stmt] > td:nth-child(4)::before { content:"Thuế TNCN"; display:block; color:var(--m-sub); font-size:12px; }
  body.sales-shell #appView .hh-card tr[data-stmt] > td:nth-child(5)::before { content:"Phải chi"; display:block; color:var(--m-sub); font-size:12px; font-weight:500; }
  body.sales-shell #appView .hh-card tr[data-stmt] > td:nth-child(2)::after { content:" dòng khách"; }
  body.sales-shell #appView .hh-card tr[data-stmt] > td:nth-child(n+7) { display:none; }
}

/* ===== MOBILE 11/2026 — ĐỢT 2: mật độ & căn chữ (docs/MOBILE-UI-SPEC.md, mục "Đợt 2") ===== */
@media screen and (max-width: 760px) {
  /* Thẻ đại lý (≤ 150px): tên + loại · đơn vị | trạng thái / SĐT · địa chỉ / HH · CK khách · CK sale / ngân hàng · STK / bảng hoa hồng */
  body.sales-shell #appView .pt-list > tbody > tr { grid-template-columns:max-content max-content max-content minmax(0,1fr) auto; gap:4px 12px; }
  body.sales-shell #appView .pt-list > tbody > tr > td, body.sales-shell #appView .hh-list.pt-list > tbody > tr:hover > td { margin:0 !important; padding:0 !important; border:0 !important; font-size:13px; font-weight:400; line-height:1.35; color:var(--m-sub); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(1) { grid-column:1 / 5; grid-row:1; align-self:center; color:var(--m-ink); }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(1) strong { font-size:15px; font-weight:700; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(1) .hub-sub { display:inline; margin:0 0 0 4px; font-size:13px; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(1) .hub-sub::before { content:"· "; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(8) { grid-column:5; grid-row:1; align-self:center; overflow:visible; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(2) { grid-column:1 / -1; grid-row:2; color:var(--m-ink); font-size:14px; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(2) .hub-sub { display:inline; margin-left:4px; color:var(--m-sub); font-size:13px; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(2) .hub-sub::before { content:"· "; }
  body.sales-shell #appView .pt-list > tbody > tr > td:is(:nth-child(3), :nth-child(4), :nth-child(5)) { grid-row:3; color:var(--m-ink); font-size:13px; font-weight:600; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(3) { grid-column:1; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(4) { grid-column:2; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(5) { grid-column:3; }
  body.sales-shell #appView .pt-list > tbody > tr > td:is(:nth-child(3), :nth-child(4), :nth-child(5), :nth-child(6))::before { display:inline; margin:0 4px 0 0; color:var(--m-sub); font-size:13px; font-weight:400; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(6) { grid-column:1 / -1; grid-row:4; color:var(--m-ink); font-size:13px; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(6)::before { content:"NH"; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(6):not(:has(.hub-sub)) { display:none; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(6) .hub-sub { display:inline; margin-left:4px; color:var(--m-sub); font-size:13px; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(6) .hub-sub::before { content:"· "; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(7) { grid-column:1 / -1; grid-row:5; color:var(--m-ink); font-size:13px; font-weight:600; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(7) .hub-sub { display:inline; margin-left:4px; color:var(--m-sub); font-size:13px; font-weight:400; }
  body.sales-shell #appView .pt-list > tbody > tr > td:nth-child(7) .hub-sub::before { content:"· "; }

  /* Thẻ bảng đối chiếu (≤ 130px): tên + loại / kỳ | tình trạng · ngày chi; Thành tiền | HH thực nhận | Thuế; số dòng | Phải chi */
  body.sales-shell #appView .pc-list > tbody > tr { grid-template-columns:repeat(3, minmax(0,1fr)); grid-template-areas:"name name st" "amt net tax" "rows rows pay"; gap:4px 8px; }
  body.sales-shell #appView .pc-list > tbody > tr > td, body.sales-shell #appView .hh-list.pc-list > tbody > tr:hover > td { margin:0 !important; padding:0 !important; border:0 !important; font-size:13px; font-weight:400; line-height:1.35; }
  body.sales-shell #appView .pc-list > tbody > tr > td:nth-child(1) { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  body.sales-shell #appView .pc-list > tbody > tr > td:nth-child(1) strong { font-size:15px; }
  body.sales-shell #appView .pc-list > tbody > tr > td:nth-child(1) .hub-sub { margin-top:0; color:var(--m-sub); font-size:13px; }
  body.sales-shell #appView .pc-list > tbody > tr > td:nth-child(7) { text-align:right; }
  body.sales-shell #appView .pc-list > tbody > tr > td:nth-child(7) { min-width:0; }
  body.sales-shell #appView .pc-list > tbody > tr > td:nth-child(7) .hub-sub { margin-top:2px; font-size:12px; line-height:1.35; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  body.sales-shell #appView .pc-list > tbody > tr > td:is(:nth-child(3), :nth-child(4), :nth-child(5)) { margin-top:4px !important; color:var(--m-ink); font-size:13px; font-weight:600; white-space:nowrap; text-align:left; }
  body.sales-shell #appView .pc-list > tbody > tr > td:nth-child(5) { text-align:right; }
  body.sales-shell #appView .pc-list > tbody > tr > td:nth-child(4) { text-align:center; }
  body.sales-shell #appView .pc-list > tbody > tr > td:is(:nth-child(3), :nth-child(4), :nth-child(5))::before { margin:0 0 2px; color:var(--m-sub); font-size:12px; font-weight:600; }
  body.sales-shell #appView .pc-list > tbody > tr > td:nth-child(3)::before { content:"Thành tiền"; }
  body.sales-shell #appView .pc-list > tbody > tr > td:nth-child(2) { align-self:center; color:var(--m-sub); }
  body.sales-shell #appView .pc-list > tbody > tr > td:nth-child(6) { display:flex; align-items:baseline; justify-content:flex-end; gap:4px; text-align:right; white-space:nowrap; }
  body.sales-shell #appView .pc-list > tbody > tr > td:nth-child(6)::before { content:"Phải chi"; display:inline; margin:0; color:var(--m-sub); font-size:12px; font-weight:600; }
  body.sales-shell #appView .pc-list > tbody > tr > td:nth-child(6) b { font-size:15px; }

  /* Màn sửa: khoảng cách khít hơn, nhãn 12/600 */
  body.sales-shell #appView .srp-top:has(#ptBack, #pcBack) { margin-bottom:8px; }
  body.sales-shell #appView :is(#ptForm, #pcForm) .hh-head { margin:0 0 8px; }
  body.sales-shell #appView :is(#ptForm, #pcForm) .hh-head h2 { font-size:18px; line-height:1.25; }
  body.sales-shell #appView :is(#ptForm, #pcForm) .hh-grid { gap:10px; }
  body.sales-shell #appView :is(#ptForm, #pcForm) .hh-f > label { margin-bottom:2px; font-size:12px; line-height:1.35; }
  body.sales-shell #appView :is(#ptForm, #pcForm) .hh-sec { margin:16px 0 0; padding:16px 0 0; }
  body.sales-shell #appView :is(#ptForm, #pcForm) .hh-sec > h3 { margin:0 0 8px; }
  body.sales-shell #appView .pt-form .hh-f .hh-sub { font-size:12px; line-height:1.35; }
  body.sales-shell #appView #pcForm > .hh-fs > .hh-grid:last-child { margin-top:16px; padding-top:16px; }
  body.sales-shell #appView .pt-rows tbody { gap:8px; }
  body.sales-shell #appView .pt-rows tbody tr { gap:8px 8px; }
  body.sales-shell #appView .pt-rows tbody td::before { margin-bottom:2px; }
  body.sales-shell #appView .pt-rows tbody td:nth-child(18) { padding:8px 12px; font-size:15px; }
  body.sales-shell #appView .pt-tot-i { padding:8px 12px; }
  body.sales-shell #appView .pt-tot-v { font-size:15px; }
  body.sales-shell #appView .pt-tot-pay { padding:8px 12px; }
  body.sales-shell #appView .pt-tot-pay .hh-alloc { font-size:20px; }
  body.sales-shell #appView .hh-card { padding:12px; }
  body.sales-shell #appView .hh-card table.hh-list tbody tr { padding:8px 0; }
}

/* ==========================================================================
   ĐẠI LÝ & CTV — danh bạ + theo dõi (11/2026). Cùng ngôn ngữ với Lịch hẹn (work.css .bk):
   khung giữa tối đa 1180px, đầu màn 3 phần (tiêu đề | năm | nút), dải số một hộp kẻ ngăn, bảng sạch không viền dọc.
   ========================================================================== */
@media screen {
  #appView #workWorkspace .ptx { display:flex; flex-direction:column; gap:16px; max-width:1180px; margin:0 auto; padding:8px 0 40px; color:#25211C; }
  #appView #workWorkspace .ptx-head { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; gap:16px; min-height:44px; }
  #appView #workWorkspace .ptx-title { display:flex; align-items:center; gap:10px; min-width:0; }
  #appView #workWorkspace .ptx-title h1 { min-width:0; margin:0; overflow:hidden; font-size:24px; font-weight:700; letter-spacing:-.3px; line-height:1.25; text-overflow:ellipsis; white-space:nowrap; }
  #appView #workWorkspace .ptx-pill { display:inline-grid; place-items:center; min-width:26px; height:24px; padding:0 8px; box-sizing:border-box; border-radius:12px; background:#F1ECE4; color:#6F655A; font-size:12px; font-weight:700; }
  #appView #workWorkspace .ptx-back { display:grid; place-items:center; flex:0 0 40px; width:40px; height:40px; min-height:40px; padding:0; border:1px solid #E2D6C4; border-radius:50%; background:#fff; color:#8A5F27; box-shadow:none; }
  #appView #workWorkspace .ptx-back:hover { border-color:#9A6A2E; background:#FAF1E1; }
  #appView #workWorkspace .ptx-year { justify-self:center; display:inline-flex; align-items:center; gap:2px; height:40px; padding:0 4px; box-sizing:border-box; border:1px solid #E4DACA; border-radius:20px; background:#fff; }
  #appView #workWorkspace .ptx-year button { display:grid; place-items:center; width:32px; height:32px; min-height:32px; padding:0; border:0; border-radius:16px; background:transparent; color:#25211C; font-size:18px; line-height:1; box-shadow:none; }
  #appView #workWorkspace .ptx-year button:hover:not(:disabled) { background:#F5EEE3; }
  #appView #workWorkspace .ptx-year button:disabled { opacity:.3; }
  #appView #workWorkspace .ptx-year strong { min-width:84px; font-size:14px; font-weight:700; text-align:center; font-variant-numeric:tabular-nums; }
  #appView #workWorkspace .ptx-acts { display:flex; justify-content:flex-end; gap:8px; min-width:0; }
  #appView #workWorkspace .ptx-primary { display:inline-flex; align-items:center; gap:8px; height:40px; min-height:40px; padding:0 16px; border:1px solid #9A6A2E; border-radius:10px; background:#9A6A2E; color:#fff; font-size:14px; font-weight:700; box-shadow:none; white-space:nowrap; }
  #appView #workWorkspace .ptx-primary:hover { border-color:#7E5523; background:#7E5523; }
  #appView #workWorkspace .ptx-ghost { height:40px; min-height:40px; padding:0 16px; border:1px solid #E4DACA; border-radius:10px; background:#fff; color:#25211C; font-size:14px; font-weight:600; box-shadow:none; }
  #appView #workWorkspace .ptx-ghost.is-danger { color:#9B2F23; }
  #appView #workWorkspace .ptx-meta { margin:-8px 0 0; color:#6F655A; font-size:13px; line-height:1.45; }

  /* Dải số */
  #appView #workWorkspace .ptx-strip { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); border-radius:14px; background:#FAF6EF; overflow:hidden; }
  #appView #workWorkspace .ptx-stat { display:flex; flex-direction:column; gap:2px; min-width:0; padding:12px 16px; border-left:1px solid #EADFCF; }
  #appView #workWorkspace .ptx-stat:first-child { border-left:0; }
  #appView #workWorkspace .ptx-stat span { overflow:hidden; color:#6F655A; font-size:12px; font-weight:600; text-overflow:ellipsis; white-space:nowrap; }
  #appView #workWorkspace .ptx-stat strong { font-size:20px; font-weight:800; line-height:1.2; font-variant-numeric:tabular-nums; white-space:nowrap; }
  #appView #workWorkspace .ptx-stat small { overflow:hidden; color:#6F655A; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
  #appView #workWorkspace .ptx-stat.is-ok strong { color:#1F5E2E; }
  #appView #workWorkspace .ptx-stat.is-warn strong { color:#9B2F23; }

  /* Lọc */
  #appView #workWorkspace .ptx-filters { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
  #appView #workWorkspace .ptx-search { display:flex; align-items:center; gap:8px; flex:1 1 260px; max-width:380px; height:40px; padding:0 14px; box-sizing:border-box; border:1px solid #E2D6C4; border-radius:20px; background:#fff; color:#6F655A; }
  #appView #workWorkspace .ptx-search input { flex:1; min-width:0; height:38px; min-height:0; padding:0; border:0; background:transparent; font-size:14px; box-shadow:none !important; }
  #appView #workWorkspace .ptx-seg { display:inline-flex; padding:3px; border-radius:12px; background:#F5EEE3; }
  #appView #workWorkspace .ptx-seg button { height:34px; min-height:34px; padding:0 12px; border:0; border-radius:9px; background:transparent; color:#6F655A; font-size:13px; font-weight:600; box-shadow:none; white-space:nowrap; }
  #appView #workWorkspace .ptx-seg button[aria-pressed="true"] { background:#fff; color:#25211C; box-shadow:0 1px 2px #392e2224; }

  /* Bảng */
  #appView #workWorkspace .ptx-box { border:1px solid #E2D6C4; border-radius:14px; background:#fff; overflow:hidden; overflow-x:auto; }
  #appView #workWorkspace .ptx-table { width:100%; border-collapse:collapse; font-size:14px; }
  #appView #workWorkspace .ptx-table th { padding:10px 14px; border:0; border-bottom:1px solid #EADFCF; background:#FAF6EF; color:#6F655A; font-size:12px; font-weight:700; text-align:left; text-transform:none; letter-spacing:0; white-space:nowrap; }
  #appView #workWorkspace .ptx-table td { padding:12px 14px; border:0; border-top:1px solid #EFE8DD; vertical-align:middle; font-variant-numeric:tabular-nums; }
  #appView #workWorkspace .ptx-table tbody tr:first-child td { border-top:0; }
  #appView #workWorkspace .ptx-table .r { text-align:right; white-space:nowrap; }
  #appView #workWorkspace .ptx-table td.r small { display:block; color:#1F5E2E; font-size:11.5px; font-weight:600; }
  #appView #workWorkspace .ptx-table tbody tr[tabindex] { cursor:pointer; }
  #appView #workWorkspace .ptx-table tbody tr[tabindex]:hover td { background:#FBF8F3; }
  #appView #workWorkspace .ptx-table tr.is-off td { color:#8A8078; }
  #appView #workWorkspace .ptx-who { min-width:200px; }
  #appView #workWorkspace .ptx-name { display:flex; align-items:center; gap:8px; min-width:0; }
  #appView #workWorkspace .ptx-name strong { overflow:hidden; font-size:14px; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
  #appView #workWorkspace .ptx-who > small { display:block; margin-top:2px; overflow:hidden; max-width:340px; color:#6F655A; font-size:12.5px; text-overflow:ellipsis; white-space:nowrap; }
  #appView #workWorkspace .ptx-pol { color:#6F655A; font-size:13px; white-space:nowrap; }
  #appView #workWorkspace .ptx-go { width:28px; padding-left:0 !important; color:#B3A595; text-align:right; }
  #appView #workWorkspace .ptx-nil { color:#B3A595; }
  #appView #workWorkspace .ptx-due { color:#9B2F23; font-weight:700; }
  #appView #workWorkspace .ptx-mono { font-variant-numeric:tabular-nums; letter-spacing:.1px; }
  #appView #workWorkspace .ptx-chip { display:inline-flex; align-items:center; height:22px; padding:0 9px; border-radius:11px; background:#F1ECE4; color:#6F655A; font-size:11.5px; font-weight:700; white-space:nowrap; }
  #appView #workWorkspace .ptx-chip.is-ok { background:#E6F2E8; color:#1F5E2E; }
  #appView #workWorkspace .ptx-chip.is-warn { background:#FFF2E0; color:#8A4B0C; }
  #appView #workWorkspace .ptx-table td small:not(.r small) { display:block; margin-top:2px; color:#6F655A; font-size:12px; }
  #appView #workWorkspace .ptx-none { margin:0; padding:28px 16px; border:1px dashed #E2D6C4; border-radius:14px; color:#6F655A; font-size:14px; text-align:center; }
  #appView #workWorkspace .ptx-foot { margin:-6px 0 0; color:#8A8078; font-size:12px; }

  /* Tab trang chi tiết */
  #appView #workWorkspace .ptx-tabs { display:flex; gap:4px; margin-top:-4px; border-bottom:1px solid #EADFCF; overflow-x:auto; scrollbar-width:none; }
  #appView #workWorkspace .ptx-tabs::-webkit-scrollbar { display:none; }
  #appView #workWorkspace .ptx-tabs button { display:inline-flex; align-items:center; gap:6px; height:42px; min-height:42px; margin-bottom:-1px; padding:0 14px; border:0; border-bottom:2px solid transparent; border-radius:0; background:transparent; color:#6F655A; font-size:14px; font-weight:600; box-shadow:none; white-space:nowrap; }
  #appView #workWorkspace .ptx-tabs button[aria-selected="true"] { border-bottom-color:#9A6A2E; color:#25211C; font-weight:700; }
  #appView #workWorkspace .ptx-tabs button span { display:inline-grid; place-items:center; min-width:20px; height:20px; padding:0 6px; box-sizing:border-box; border-radius:10px; background:#F1ECE4; color:#6F655A; font-size:11px; font-weight:700; }

  /* Tổng quan */
  #appView #workWorkspace .ptx-cols { display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:20px; align-items:start; }
  #appView #workWorkspace .ptx-side { display:flex; flex-direction:column; gap:16px; min-width:0; }
  #appView #workWorkspace .ptx-card { padding:18px 20px; box-sizing:border-box; border:1px solid #E2D6C4; border-radius:16px; background:#fff; box-shadow:none; }
  #appView #workWorkspace .ptx-card > h2 { margin:0 0 12px; font-size:15px; font-weight:700; }
  #appView #workWorkspace .ptx-months { padding:18px 0 0; overflow:hidden; }
  #appView #workWorkspace .ptx-months > h2 { padding:0 20px; }
  #appView #workWorkspace .ptx-months .ptx-box { border:0; border-top:1px solid #EADFCF; border-radius:0; }
  #appView #workWorkspace .ptx-mtable tr.is-empty td { color:#B3A595; }
  #appView #workWorkspace .ptx-mtable tr.is-now td:first-child b { color:#8A5F27; }
  #appView #workWorkspace .ptx-mtable tr.is-now td { background:#FBF6ED; }
  #appView #workWorkspace .ptx-mtable tr.is-total td { border-top:1px solid #EADFCF; background:#FAF6EF; font-weight:800; }
  #appView #workWorkspace .ptx-dl { display:flex; flex-direction:column; margin:0; }
  #appView #workWorkspace .ptx-dl > div { display:flex; align-items:baseline; justify-content:space-between; gap:12px; padding:7px 0; border-top:1px solid #EFE8DD; }
  #appView #workWorkspace .ptx-dl > div:first-child { border-top:0; padding-top:0; }
  #appView #workWorkspace .ptx-dl dt { color:#6F655A; font-size:13px; }
  #appView #workWorkspace .ptx-dl dd { margin:0; font-size:14px; font-weight:700; text-align:right; font-variant-numeric:tabular-nums; }
  #appView #workWorkspace .ptx-dl.is-text > div { flex-direction:column; gap:2px; }
  #appView #workWorkspace .ptx-dl.is-text dd { font-weight:500; text-align:left; overflow-wrap:anywhere; }

  /* Hồ sơ (form) trong tab */
  #appView #workWorkspace .ptx .ptx-form { max-width:none; margin:0; }
  #appView #workWorkspace .ptx .ptx-form-h { margin:0 0 12px; font-size:15px; font-weight:700; }
  #appView #workWorkspace .ptx .ptx-form .hh-sec { margin-top:20px; }
  #appView #workWorkspace .ptx-form-acts { display:flex; justify-content:flex-end; gap:8px; margin-top:16px; padding-top:16px; border-top:1px solid #EFE8DD; }
  #appView #workWorkspace .ptx-log { margin-top:16px; }
  #appView #workWorkspace .ptx-log ul { margin:0; padding:0; list-style:none; }
  #appView #workWorkspace .ptx-log li { padding:6px 0; border-top:1px solid #EFE8DD; font-size:13px; }
  #appView #workWorkspace .ptx-log li:first-child { border-top:0; }
  #appView #workWorkspace .ptx-log li small { display:block; color:#6F655A; }
}
@media screen and (max-width: 1100px) {
  #appView #workWorkspace .ptx-strip { grid-template-columns:repeat(3,minmax(0,1fr)); }
  #appView #workWorkspace .ptx-stat:nth-child(3n+1) { border-left:0; }
  #appView #workWorkspace .ptx-stat:nth-child(n+4) { border-top:1px solid #EADFCF; }
  #appView #workWorkspace .ptx-cols { grid-template-columns:minmax(0,1fr); }
  #appView #workWorkspace .ptx-pol { display:none; }
}
/* Điện thoại: đầu màn 2 hàng, dải số 2 cột, bảng thành thẻ (nhãn | giá trị) */
@media screen and (max-width: 760px) {
  #appView #workWorkspace .ptx { gap:12px; padding:4px 0 16px; }
  #appView #workWorkspace .ptx-head { grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"title acts" "year year"; gap:10px; }
  #appView #workWorkspace .ptx-title { grid-area:title; }
  #appView #workWorkspace .ptx-title h1 { font-size:20px; font-weight:800; }
  #appView #workWorkspace .ptx-detail .ptx-title h1 { font-size:18px; }
  #appView #workWorkspace .ptx-acts { grid-area:acts; }
  #appView #workWorkspace .ptx-year { grid-area:year; justify-self:stretch; justify-content:space-between; }
  #appView #workWorkspace .ptx-primary { height:40px; padding:0 12px; }
  #appView #workWorkspace .ptx-detail .ptx-primary span { display:none; }
  #appView #workWorkspace .ptx-detail .ptx-primary { width:40px; justify-content:center; padding:0; }
  #appView #workWorkspace .ptx-new .ptx-head { grid-template-areas:"title acts"; }
  #appView #workWorkspace .ptx-new .ptx-head > span { display:none; }
  #appView #workWorkspace .ptx-meta { margin:-4px 0 0; font-size:12.5px; }
  #appView #workWorkspace .ptx-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #appView #workWorkspace .ptx-stat { padding:8px 12px; border-left:0; }
  #appView #workWorkspace .ptx-stat:nth-child(even) { border-left:1px solid #EADFCF; }
  #appView #workWorkspace .ptx-stat:nth-child(n+3) { border-top:1px solid #EADFCF; }
  #appView #workWorkspace .ptx-stat strong { font-size:17px; }
  #appView #workWorkspace .ptx-filters { flex-wrap:nowrap; gap:8px; margin:0 -12px; padding:0 12px; overflow-x:auto; scrollbar-width:none; }
  #appView #workWorkspace .ptx-filters::-webkit-scrollbar { display:none; }
  #appView #workWorkspace .ptx-search { flex:0 0 100%; max-width:none; height:44px; border-radius:12px; }
  #appView #workWorkspace .ptx-search input { font-size:16px; }
  #appView #workWorkspace .ptx-filters { flex-wrap:wrap; overflow:visible; margin:0; padding:0; }
  #appView #workWorkspace .ptx-seg { flex:0 0 auto; }
  #appView #workWorkspace .ptx-seg button { height:32px; min-height:32px; padding:0 10px; }
  #appView #workWorkspace .ptx-foot { margin:0; }
  /* Bảng → thẻ */
  #appView #workWorkspace .ptx-box { border:0; border-radius:0; background:transparent; overflow:visible; }
  #appView #workWorkspace .ptx-table, #appView #workWorkspace .ptx-table tbody { display:block; }
  #appView #workWorkspace .ptx-table thead { display:none; }
  #appView #workWorkspace .ptx-table tbody tr { position:relative; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px 8px; margin-bottom:8px; padding:12px; border:1px solid #E2D6C4; border-radius:14px; background:#fff; }
  #appView #workWorkspace .ptx-table td { display:block; min-width:0; padding:0; border:0 !important; background:transparent !important; text-align:left !important; }
  #appView #workWorkspace .ptx-table td.ptx-who { grid-column:1 / -1; min-width:0; padding-right:20px; }
  #appView #workWorkspace .ptx-who > small { max-width:none; }
  #appView #workWorkspace .ptx-table td[data-label]::before { content:attr(data-label); display:block; overflow:hidden; color:#6F655A; font-size:11px; font-weight:600; text-overflow:ellipsis; white-space:nowrap; }
  #appView #workWorkspace .ptx-table td.r { font-size:13.5px; font-weight:700; }
  #appView #workWorkspace .ptx-table td.r small { display:inline; margin-left:4px; }
  #appView #workWorkspace .ptx-table td.ptx-go { position:absolute; top:12px; right:8px; width:auto; }
  #appView #workWorkspace .ptx-table td.ptx-pol { display:none; }
  #appView #workWorkspace .ptx-table tr.is-off { opacity:.75; }
  /* Danh sách đối tác: Khách | Doanh số | Doanh thu | HH; "Còn phải chi" chỉ hiện khi còn nợ (cả hàng) */
  #appView #workWorkspace .ptx-list-page .ptx-table td[data-label="Còn phải chi"] { grid-column:1 / -1; display:flex; align-items:baseline; justify-content:space-between; padding-top:6px !important; border-top:1px solid #EFE8DD !important; }
  #appView #workWorkspace .ptx-list-page .ptx-table td[data-label="Còn phải chi"]::before { display:inline; }
  #appView #workWorkspace .ptx-list-page .ptx-table td[data-label="Còn phải chi"]:has(.ptx-nil) { display:none; }
  /* Tổng quan theo tháng: tháng | doanh số | doanh thu | HH (ẩn khách mới, phiếu, đã chi) — dạng bảng gọn */
  #appView #workWorkspace .ptx-card.ptx-months { padding:14px 0 0; }
  #appView #workWorkspace .ptx-months > h2 { padding:0 14px; }
  #appView #workWorkspace .ptx-months .ptx-box { border-top:1px solid #EADFCF; }
  #appView #workWorkspace .ptx-mtable, #appView #workWorkspace .ptx-mtable tbody { display:table; width:100%; }
  #appView #workWorkspace .ptx-mtable tbody { display:table-row-group; }
  #appView #workWorkspace .ptx-mtable thead { display:table-header-group; }
  #appView #workWorkspace .ptx-mtable tbody tr { display:table-row; margin:0; padding:0; border:0; border-radius:0; }
  #appView #workWorkspace .ptx-mtable th, #appView #workWorkspace .ptx-mtable td { display:table-cell; padding:8px 10px !important; border-top:1px solid #EFE8DD !important; font-size:13px; }
  #appView #workWorkspace .ptx-mtable th { font-size:11.5px; }
  #appView #workWorkspace .ptx-mtable td[data-label]::before { content:none; }
  #appView #workWorkspace .ptx-mtable :is(th, td):nth-child(2), #appView #workWorkspace .ptx-mtable :is(th, td):nth-child(3), #appView #workWorkspace .ptx-mtable :is(th, td):nth-child(7) { display:none; }
  #appView #workWorkspace .ptx-mtable td.r { text-align:right !important; font-size:13px; }
  #appView #workWorkspace .ptx-mtable tr.is-now td { background:#FBF6ED !important; }
  #appView #workWorkspace .ptx-mtable tr.is-total td { background:#FAF6EF !important; }
  #appView #workWorkspace .ptx-card { padding:14px; border-radius:14px; }
  #appView #workWorkspace .ptx-tabs { margin:0 -12px; padding:0 12px; }
  #appView #workWorkspace .ptx-tabs button { height:40px; min-height:40px; padding:0 10px; font-size:13.5px; }
  #appView #workWorkspace .ptx-form-acts #ptSave { display:none; }
  #appView #workWorkspace .ptx-form-acts:not(:has(#ptDelete)) { display:none; }
}

/* ---------- Tổng hợp thông tin (dashboard Đại lý / CTV / ĐDTM, 11/2026) ---------- */
@media screen {
  #appView #workWorkspace .ptx.ptx-sum { gap:22px; }
  #appView #workWorkspace .ptx-sumbtn { display:inline-flex; align-items:center; gap:8px; color:#6E4A1C; border-color:#E3C79E; background:#FAF1E1; white-space:nowrap; }
  #appView #workWorkspace .ptx-sumbtn:hover { border-color:#9A6A2E; background:#F3E6D2; }
  #appView #workWorkspace .ptx-strip.is-8 { grid-template-columns:repeat(4,minmax(0,1fr)); }
  #appView #workWorkspace .ptx-strip.is-8 .ptx-stat:nth-child(4n+1) { border-left:0; }
  #appView #workWorkspace .ptx-strip.is-8 .ptx-stat:nth-child(n+5) { border-top:1px solid #EADFCF; }
  #appView #workWorkspace .ptx-sec > h2 { display:flex; align-items:center; gap:8px; margin:0 0 10px; font-size:15px; font-weight:700; }
  #appView #workWorkspace .ptx-cols2 { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; align-items:start; }
  #appView #workWorkspace .ptx-cols2 .ptx-foot { margin:8px 0 0; }
  #appView #workWorkspace .ptx-chartbox { padding:4px 20px 14px; }
  #appView #workWorkspace .ptx-chart { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:8px; height:150px; align-items:end; }
  #appView #workWorkspace .ptx-bar { display:flex; flex-direction:column; align-items:center; gap:6px; height:100%; min-width:0; }
  #appView #workWorkspace .ptx-bars { display:flex; align-items:flex-end; justify-content:center; gap:3px; flex:1; width:100%; border-bottom:1px solid #EADFCF; }
  #appView #workWorkspace .ptx-bars i { display:block; width:min(14px, 40%); min-height:2px; border-radius:4px 4px 0 0; }
  #appView #workWorkspace .ptx-bars i[style="height:0.0%"] { min-height:0; }
  #appView #workWorkspace .ptx-bars i.is-sales, #appView #workWorkspace .ptx-legend i.is-sales { background:#B88A4E; }
  #appView #workWorkspace .ptx-bars i.is-rev, #appView #workWorkspace .ptx-legend i.is-rev { background:#3E8E5E; }
  #appView #workWorkspace .ptx-bar span { color:#6F655A; font-size:11px; font-weight:600; }
  #appView #workWorkspace .ptx-bar.is-now span { color:#8A5F27; font-weight:800; }
  #appView #workWorkspace .ptx-legend { display:flex; flex-wrap:wrap; align-items:center; gap:6px 16px; margin:10px 0 0; color:#6F655A; font-size:12px; }
  #appView #workWorkspace .ptx-legend span { display:inline-flex; align-items:center; gap:6px; }
  #appView #workWorkspace .ptx-legend i { width:10px; height:10px; border-radius:3px; }
  #appView #workWorkspace .ptx-legend-max { margin-left:auto; }
  #appView #workWorkspace .ptx-rank { display:inline-grid; place-items:center; flex:0 0 22px; width:22px; height:22px; border-radius:50%; background:#F1ECE4; color:#6F655A; font-size:11px; font-weight:800; }
  #appView #workWorkspace .ptx-rtable tbody tr:nth-child(-n+3) .ptx-rank { background:#FAF1E1; color:#8A5F27; }
  #appView #workWorkspace .ptx-ttable tr.is-total td { border-top:1px solid #EADFCF; background:#FAF6EF; font-weight:800; }
}
@media screen and (max-width: 1100px) {
  #appView #workWorkspace .ptx-cols2 { grid-template-columns:minmax(0,1fr); }
  #appView #workWorkspace .ptx-smtable :is(th, td):nth-child(2), #appView #workWorkspace .ptx-smtable :is(th, td):nth-child(3), #appView #workWorkspace .ptx-smtable :is(th, td):nth-child(4) { display:none; }
}
@media screen and (max-width: 760px) {
  #appView #workWorkspace .ptx-list-page .ptx-head { grid-template-columns:minmax(0,1fr); grid-template-areas:"title" "acts" "year"; }
  #appView #workWorkspace .ptx-list-page .ptx-acts { justify-content:stretch; }
  #appView #workWorkspace .ptx-list-page .ptx-acts > button { flex:1 1 0; justify-content:center; }
  #appView #workWorkspace .ptx-sum .ptx-head { grid-template-areas:"title title" "year year"; }
  #appView #workWorkspace .ptx.ptx-sum { gap:16px; }
  #appView #workWorkspace .ptx-sum .ptx-acts { display:none; }
  #appView #workWorkspace .ptx-strip.is-8 { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #appView #workWorkspace .ptx-strip.is-8 .ptx-stat { border-left:0; border-top:0; }
  #appView #workWorkspace .ptx-strip.is-8 .ptx-stat:nth-child(even) { border-left:1px solid #EADFCF; }
  #appView #workWorkspace .ptx-strip.is-8 .ptx-stat:nth-child(n+3) { border-top:1px solid #EADFCF; }
  #appView #workWorkspace .ptx-chartbox { padding:2px 12px 12px; }
  #appView #workWorkspace .ptx-chart { gap:4px; height:120px; }
  #appView #workWorkspace .ptx-bars { gap:2px; }
  #appView #workWorkspace .ptx-bars i { width:42%; }
  #appView #workWorkspace .ptx-bar span { font-size:10px; }
  /* bảng tháng tổng hợp: Tháng | Doanh số | Doanh thu | HH (ẩn khách mới 3 loại, phiếu, đã chi) */
  #appView #workWorkspace .ptx-smtable :is(th, td):nth-child(2), #appView #workWorkspace .ptx-smtable :is(th, td):nth-child(3), #appView #workWorkspace .ptx-smtable :is(th, td):nth-child(4),
  #appView #workWorkspace .ptx-smtable :is(th, td):nth-child(5), #appView #workWorkspace .ptx-smtable :is(th, td):nth-child(9) { display:none; }
  #appView #workWorkspace .ptx-smtable :is(th, td):nth-child(7) { display:table-cell; }
  #appView #workWorkspace .ptx-sec > h2 { margin-bottom:8px; }
  #appView #workWorkspace .ptx-cols2 { gap:12px; }
  /* Thẻ chi trả: Phải chi | Chi trả trên 2 cột */
  #appView #workWorkspace .ptx-pytable tbody tr { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #appView #workWorkspace .ptx-kctable tbody tr { grid-template-columns:repeat(3,minmax(0,1fr)); }
  #appView #workWorkspace .ptx-ttable td[data-label="Còn phải chi"]:has(.ptx-nil), #appView #workWorkspace .ptx-rtable td[data-label="Còn phải chi"]:has(.ptx-nil) { display:none; }
}

/* Tổng hợp thông tin: mỗi góc xem là một chip dưới dải số, chỉ hiện một khối (mặc định Theo tháng). */
@media screen {
  #appView #workWorkspace .ptx-views { display:flex; gap:8px; flex-wrap:wrap; }
  #appView #workWorkspace .ptx-views button { display:inline-flex; align-items:center; gap:8px; height:38px; min-height:38px; padding:0 16px; border:1px solid #E2D6C4; border-radius:19px; background:#fff; color:#25211C; font-size:14px; font-weight:600; box-shadow:none; white-space:nowrap; }
  #appView #workWorkspace .ptx-views button:hover { border-color:#C9AE87; }
  #appView #workWorkspace .ptx-views button[aria-selected="true"] { border-color:#9A6A2E; background:#9A6A2E; color:#fff; }
  #appView #workWorkspace .ptx-views button span { display:inline-grid; place-items:center; min-width:20px; height:20px; padding:0 6px; box-sizing:border-box; border-radius:10px; background:#F1ECE4; color:#6F655A; font-size:11px; font-weight:800; }
  #appView #workWorkspace .ptx-views button[aria-selected="true"] span { background:#ffffff33; color:#fff; }
  #appView #workWorkspace .ptx-cellname { font-weight:600; }
  #appView #workWorkspace .ptx-sum #ptSumView .ptx-box { overflow-x:visible; }
}
@media screen and (max-width: 760px) {
  #appView #workWorkspace .ptx-views { flex-wrap:nowrap; margin:0 -12px; padding:0 12px; overflow-x:auto; scrollbar-width:none; }
  #appView #workWorkspace .ptx-views::-webkit-scrollbar { display:none; }
  #appView #workWorkspace .ptx-views button { flex:0 0 auto; height:36px; min-height:36px; padding:0 14px; font-size:13.5px; }
  #appView #workWorkspace .ptx-kctable tbody tr { grid-template-columns:repeat(3,minmax(0,1fr)); }
  #appView #workWorkspace .ptx-kctable td[data-label="Đối tác"] { grid-column:span 2; }
}

/* Bảng đối chiếu: nút "Lấy từ Phiếu ĐKDV" cạnh "+ Thêm dòng" (11/2026) */
@media screen {
  #appView .pt-rowbtns { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:10px; }
  #appView .pt-rowbtns .pt-fromdk { border-color:#E3C79E !important; background:#FAF1E1; color:#6E4A1C; font-weight:700; }
  #appView .pt-fromdk-note { color:#6F655A; font-size:13px; }
}
/* Trang Hoa hồng Đại lý: thông báo "khách đã làm dịch vụ chưa tính hoa hồng" (14/11/2026) */
@media screen {
  #appView .pt-alerts { margin:0 0 14px; padding:12px 14px; border:1px solid #E3C79E; border-radius:10px; background:#FDF8EF; }
  #appView .pt-alerts h3 { display:flex; align-items:center; gap:8px; margin:0 0 8px; font-size:14px; font-weight:700; color:#6E4A1C; }
  #appView .pt-alerts h3 .hh-count { font-size:12px; }
  #appView .pt-alerts ul { list-style:none; margin:0; padding:0; display:grid; gap:6px; }
  #appView .pt-al { display:flex; align-items:flex-start; gap:6px; }
  #appView .pt-al-main { display:block; flex:1; min-width:0; height:auto; min-height:0; justify-content:flex-start; text-align:left; white-space:normal; padding:8px 10px; border:1px solid #EFE2CC; border-radius:8px; background:#fff; color:#2B241C; font-size:13.5px; font-weight:400; line-height:1.45; cursor:pointer; }
  #appView .pt-al-main:hover { border-color:#a9783a; }
  #appView .pt-al.is-pending .pt-al-main { border-left:3px solid #a9783a; }
  #appView .pt-al:not(.is-pending) .pt-al-main { border-left:3px solid #C9A227; background:#FFFCF3; }
  #appView .pt-al-go { color:#8A5B22; font-weight:700; text-decoration:underline; text-underline-offset:2px; }
  #appView .pt-al-main small { color:#6F655A; }
  #appView .pt-al-hide { flex:none; margin-top:4px; }
  #appView .pt-al-more { margin-top:8px; }
}
/* Hồ sơ đối tác: khu "Giấy tờ cá nhân và hợp đồng đại lý / CTV" (12/11/2026) + popup xem file */
@media screen {
  #appView .pt-docs { margin:20px 0 0; padding:20px 0 0; border-top:1px solid #EFE8DD; }
  #appView .pt-docs > h3 { margin:0 0 12px; font-size:15px; font-weight:700; }
  #appView .pt-docs-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
  #appView .pt-doc-col { padding:14px 16px; border:1px solid #E2D6C4; border-radius:12px; background:#FDFBF7; min-width:0; }
  #appView .pt-doc-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:10px; }
  #appView .pt-doc-head strong { font-size:14px; }
  #appView .pt-doc-head small { display:block; margin-top:2px; color:#6F655A; font-size:12.5px; }
  #appView .pt-doc-n { display:inline-block; min-width:20px; padding:0 6px; border-radius:10px; background:#F1E6D4; color:#7E5523; font-size:12px; font-weight:700; text-align:center; }
  #appView .pt-doc-add { display:inline-flex; align-items:center; gap:6px; flex:none; height:34px; padding:0 12px; border:1px solid #E4DACA; border-radius:9px; background:#fff; color:#7E5523; font-size:13px; font-weight:700; cursor:pointer; }
  #appView .pt-doc-add:hover { border-color:#9A6A2E; }
  #appView .pt-doc-add.is-busy { opacity:.55; pointer-events:none; }
  #appView .pt-doc-list { display:flex; flex-direction:column; gap:6px; margin:0; padding:0; list-style:none; }
  #appView .pt-doc { display:flex; align-items:center; gap:4px; border:1px solid #EADFCF; border-radius:9px; background:#fff; }
  #appView .pt-doc.is-pending { border-style:dashed; }
  #appView .pt-doc-open { display:flex; align-items:center; gap:10px; flex:1; min-width:0; min-height:44px; padding:6px 10px; border:0; background:none; color:inherit; font:inherit; text-align:left; cursor:pointer; box-shadow:none; }
  #appView span.pt-doc-open { cursor:default; }
  #appView button.pt-doc-open:hover b { color:#8A5F27; text-decoration:underline; }
  #appView .pt-doc-ico { display:inline-flex; flex:none; color:#9A6A2E; }
  #appView .pt-doc-txt { display:flex; flex-direction:column; min-width:0; }
  #appView .pt-doc-txt b { overflow:hidden; font-size:13.5px; font-weight:600; text-overflow:ellipsis; white-space:nowrap; }
  #appView .pt-doc-txt small { color:#6F655A; font-size:12px; }
  #appView .pt-doc-del { display:inline-flex; align-items:center; justify-content:center; flex:none; width:36px; height:36px; min-height:36px; margin-right:4px; padding:0; border:0; border-radius:8px; background:none; color:#9B2F23; box-shadow:none; cursor:pointer; }
  #appView .pt-doc-del:hover { background:#FBEDEA; }
  #appView .pt-doc-none { margin:0; color:#8A8078; font-size:13px; }
  #appView .pt-doc-note { margin:10px 0 0; color:#8A8078; font-size:12.5px; }
  .pt-doc-ov { display:flex; align-items:center; justify-content:center; }
  .pt-doc-ov .pt-doc-modal { display:flex; flex-direction:column; width:min(1000px,100%); max-width:1000px; height:min(90dvh,1100px); margin:0; overflow:hidden; background:#fff; }
  .pt-doc-mhead { display:flex; align-items:center; gap:8px; padding:12px 16px; border-bottom:1px solid #EFE8DD; }
  .pt-doc-mhead strong { flex:1; min-width:0; overflow:hidden; font-size:15px; text-overflow:ellipsis; white-space:nowrap; }
  .pt-doc-mhead .ptx-ghost, .pt-doc-mhead .ptx-primary { display:inline-flex; align-items:center; height:38px; min-height:38px; padding:0 14px; border:1px solid #E4DACA; border-radius:10px; background:#fff; color:#25211C; font-size:14px; font-weight:600; text-decoration:none; box-shadow:none; cursor:pointer; }
  .pt-doc-mhead .ptx-primary { border-color:#9A6A2E; background:#9A6A2E; color:#fff; font-weight:700; }
  .pt-doc-mbody { flex:1; min-height:0; display:flex; align-items:center; justify-content:center; background:#F4EFE7; overflow:auto; }
  .pt-doc-mbody img { max-width:100%; max-height:100%; object-fit:contain; }
  .pt-doc-mbody iframe { width:100%; height:100%; border:0; background:#fff; }
}
@media screen and (max-width: 760px) {
  #appView .pt-docs-grid { grid-template-columns:minmax(0,1fr); }
  .pt-doc-ov { padding:0; align-items:flex-end; }
  .pt-doc-ov .pt-doc-modal { height:92dvh; border-radius:16px 16px 0 0; }
}
