/* Trang Phiếu ĐKDV (dkdv.js): danh sách, tóm tắt phiếu, lập / sửa phiếu. Giao diện theo CRM mới (11/2026, docs/SALES-DESKTOP-UI-SYNC.md):
   chữ #25211C / phụ #6F655A, viền thẻ #E4DACA, kẻ #EFE9DD, nền phụ #FAF7F2, nút đặc #9A6A2E. Ô nhập dùng chung lớp .hh-* của commissions.css. */
@media screen {
  .dk-more-src { display:none !important; }   /* nút gốc của menu ⋯ (giữ id + sự kiện) */
  .dk-top-gap { flex:1 1 auto; }

  /* ---------- Đầu màn ---------- */
  /* Danh sách: tiêu đề "Phiếu ĐKDV" của office.js + chip số phiếu; màn tóm tắt / lập phiếu ẩn tiêu đề đó (dùng .dk-top). */
  #appView .hub-heading.dk-head-off, #appView #workWorkspace .hub-heading.dk-head-off { display:none; }
  #appView .hub-heading > div:has(> .dk-count) { display:flex; align-items:center; gap:12px; min-width:0; }
  #appView .hub-heading .dk-count { 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; font-variant-numeric:tabular-nums; }
  #appView .hub-heading .dk-head-new { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
  #appView :is(.dk-head-new, .dk-top-acts, .dk-foot) > button:not(.ui-more) { display:inline-flex; align-items:center; gap:8px; 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; white-space:nowrap; }
  #appView :is(.dk-head-new, .dk-top-acts, .dk-foot) > button:not(.ui-more):hover { background:#FAF7F2; border-color:#B89F7E; }
  #appView :is(.dk-head-new, .dk-top-acts, .dk-foot) > button.primary { border-color:#9A6A2E; background:#9A6A2E; color:#fff; font-weight:700; }
  #appView :is(.dk-head-new, .dk-top-acts, .dk-foot) > button.primary:hover { border-color:#7E5523; background:#7E5523; color:#fff; }
  #appView :is(.dk-head-new, .dk-top-acts, .dk-foot) > button:disabled { opacity:.5; }

  #appView .dk-top { display:flex; flex-direction:column; align-items:stretch; gap:6px; margin:0 0 16px; }
  #appView button.dk-back { align-self:flex-start; display:inline-flex; align-items:center; gap:6px; height:auto; min-height:0; padding:2px 0; border:0; border-radius:4px; background:none; box-shadow:none; color:#8A5F27; font-size:14px; font-weight:600; }
  #appView button.dk-back:hover { background:none; color:#6E4A1C; }
  #appView .dk-top-row { display:flex; flex-wrap:wrap; align-items:center; gap:10px 12px; min-height:40px; }
  #appView .dk-top-row h1 { margin:0; color:#25211C; font-size:24px; font-weight:700; letter-spacing:-.3px; line-height:1.3; overflow-wrap:anywhere; }
  #appView .dk-top-acts { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
  #appView .dk-top-sub { margin:0; color:#6F655A; font-size:13px; }

  /* Chip trạng thái (bo 12, cao 24, 12/600) */
  #appView :is(.dk-top, .dk-list, .dk-receipts, .dk-exp-box, .dk-sum) .tag { height:24px; padding:0 10px; box-sizing:border-box; border:0; border-radius:12px; background:#F1ECE4; color:#6F655A; font-size:12px; font-weight:600; letter-spacing:0; }
  #appView :is(.dk-top, .dk-list, .dk-receipts, .dk-exp-box, .dk-sum) .tag.ok { background:#E6F2E8; color:#1F5E2E; }
  #appView :is(.dk-top, .dk-list, .dk-receipts, .dk-exp-box, .dk-sum) .tag.warn { background:#FFF2E0; color:#8A4B0C; }
  #appView :is(.dk-top, .dk-list, .dk-receipts, .dk-exp-box, .dk-sum) .tag.info { background:#E7EEF9; color:#24498A; }
  #appView :is(.dk-top, .dk-list, .dk-receipts, .dk-exp-box, .dk-sum) .tag.danger { background:#FBE7E5; color:#9B2F23; }
  #appView .dk-banner { margin:0 0 16px; padding:10px 14px; border-radius:10px; font-weight:600; font-size:14px; }
  #appView .dk-banner.is-ok { background:#E6F2E8; color:#1F5E2E; }
  #appView .dk-banner.is-bad { background:#FBE7E5; color:#9B2F23; }
  #appView .dk-link { border:0; background:none; padding:0; min-height:0; font:inherit; font-weight:700; color:#8A5F27; text-decoration:underline; text-underline-offset:2px; cursor:pointer; }
  #appView .dk-link:hover { background:none; color:#6E4A1C; }

  /* ---------- Danh sách ---------- */
  /* Hàng công cụ: ‹ Tháng › · ô tìm viên thuốc · chip lọc */
  #appView .hh-bar.dk-bar { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:0 0 16px; }
  #appView .dk-bar .dk-month { display:inline-flex; align-items:center; gap:0; height:40px; box-sizing:border-box; border:1px solid #E4DACA; border-radius:10px; overflow:hidden; background:#fff; }
  #appView .dk-bar .dk-month button { width:36px; height:38px; min-height:0; padding:0; border:0; border-radius:0; background:#fff; color:#25211C; font-size:16px; font-weight:600; }
  #appView .dk-bar .dk-month button:hover { background:#FAF1E1; }
  #appView .dk-bar .dk-month strong { min-width:0; padding:0 10px; color:#25211C; font-size:14px; font-weight:700; white-space:nowrap; }
  #appView .dk-search { display:flex; align-items:center; gap:8px; flex:1 1 280px; min-width:0; max-width:420px; height:40px; margin:0; padding:0 14px; box-sizing:border-box; border:1px solid #E4DACA; border-radius:20px; background:#fff; color:#6F655A; cursor:text; }
  #appView .dk-search:focus-within { border-color:#9A6A2E; box-shadow:0 0 0 3px #9a6a2e1f; }
  #appView .dk-search svg { flex:0 0 16px; }
  #appView .dk-bar .dk-search input[type="search"] { flex:1 1 auto; min-width:0; max-width:none; width:auto; height:38px; min-height:0; margin:0; padding:0; border:0; border-radius:0; outline:0; background:transparent; box-shadow:none; color:#25211C; font:inherit; font-size:14px; }
  #appView .dk-bar select.dk-chipsel { -webkit-appearance:none; appearance:none; width:auto; max-width:240px; height:36px; min-height:36px; padding:0 32px 0 14px; border:1px solid #E4DACA; border-radius:18px; background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236F655A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 13px center / 10px 6px; color:#25211C; font:inherit; font-size:13px; font-weight:600; cursor:pointer; box-shadow:none; }
  #appView .dk-bar select.dk-chipsel.is-on { border-color:#EFE2CC; background-color:#EFE2CC; color:#6E4A1C; }

  /* Dải "Khoản thu chờ xác nhận" (Sales Admin) / "bị từ chối" (Sales): một dòng nền kem */
  #appView .dk-queue { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; margin:0 0 16px; padding:12px 16px; border:1px solid #F1D9B5; border-radius:12px; background:#FFF8EE; }
  #appView .dk-queue h2 { display:inline-flex; align-items:center; gap:8px; flex:0 0 auto; margin:0; padding:0; border:0; color:#8A4B0C; font-size:14px; font-weight:700; line-height:1.3; white-space:nowrap; }
  #appView .dk-queue h2::before { content:none; }
  #appView .dk-q-list { flex:1 1 360px; min-width:0; margin:0; padding:0; color:#25211C; font-size:13px; line-height:1.5; }
  #appView .dk-q-list .more { color:#6F655A; font-weight:600; }
  #appView .dk-queue > button { flex:0 0 auto; height:34px; min-height:34px; margin:0 0 0 auto; padding:0 14px; border-radius:10px; font-size:13px; font-weight:700; }
  .dk-q-badge { display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:20px; padding:0 6px; box-sizing:border-box; border-radius:10px; background:#C2362B; color:#fff; font-size:11px; font-weight:700; line-height:1; font-variant-numeric:tabular-nums; }
  .dk-q-badge:empty { display:none; }

  /* 5 số tổng → dải tóm tắt một dòng */
  #appView .dk-strip { display:flex; flex-wrap:wrap; align-items:center; min-height:48px; margin:0 0 16px; padding:6px 4px; box-sizing:border-box; border-radius:12px; background:#FAF7F2; }
  #appView .dk-strip > div { display:flex; align-items:baseline; gap:6px; padding:6px 16px; border-left:1px solid #EFE9DD; }
  #appView .dk-strip > div:first-child { border-left:0; }
  #appView .dk-strip span { color:#6F655A; font-size:13px; font-weight:500; }
  #appView .dk-strip b { color:#25211C; font-size:15px; font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; }
  #appView .dk-strip .ok b { color:#1F5E2E; } #appView .dk-strip .due b { color:#8A4B0C; }

  /* Bảng phiếu: thẻ viền, đầu bảng nền nhạt, dòng ≥ 56, thao tác "Xem phiếu" + ⋯ */
  #appView .hub-card.dk-listcard { padding:0; overflow:hidden; }
  #appView .dk-listcard > .tbl-wrap { margin:0; border:0; border-radius:0; }
  #appView .dk-listcard > .srp-empty { margin:16px; }
  #appView table.dk-list { width:100%; min-width:1100px; border-collapse:collapse; font-size:14px; }
  #appView .dk-list > thead > tr > th { padding:12px 8px; border:0; background:#FAF7F2; color:#6F655A; font-size:13px; font-weight:600; text-align:left; text-transform:none; letter-spacing:0; white-space:nowrap; }
  #appView .dk-list > thead > tr > th.r { text-align:right; }
  #appView .dk-list > tbody > tr[data-open] > td { padding:16px 8px; border:0; border-top:1px solid #EFE9DD; background:#fff; color:#25211C; font-size:14px; font-weight:400; text-align:left; vertical-align:top; cursor:pointer; }
  #appView .dk-list > thead > tr > th:first-child, #appView .dk-list > tbody > tr[data-open] > td:first-child { padding-left:16px; }
  #appView .dk-list > tbody > tr[data-open] > td:first-child { white-space:nowrap; }
  #appView .dk-list > tbody > tr[data-open] > td.r { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
  #appView .dk-list > tbody > tr[data-open]:hover > td { background:#FAF1E1; }
  #appView .dk-list > tbody > tr.is-open > td { background:#FAF7F2; }
  #appView .dk-list > tbody > tr[data-open]:focus-visible { outline:2px solid #9A6A2E; outline-offset:-2px; }
  #appView .dk-list td strong, #appView .dk-list td b { font-weight:700; color:#25211C; }
  #appView .dk-list td:nth-child(2) strong { white-space:nowrap; }
  #appView .dk-list td .hub-sub { display:block; margin-top:2px; color:#6F655A; font-size:12px; font-weight:500; }
  #appView .dk-list > tbody > tr[data-open] > td:nth-child(3) { min-width:110px; }
  #appView .dk-list .dk-svc { min-width:150px; max-width:280px; white-space:normal; overflow-wrap:anywhere; line-height:1.45; }
  #appView .dk-list .dk-svc span { display:block; }
  #appView .dk-list .dk-paidcell .hub-sub { margin-top:4px; }
  #appView .dk-list > tbody > tr[data-open] > td.dk-paidcell { white-space:normal; }
  #appView .dk-list tr.is-cancel td, #appView .dk-list tr.is-cancel td b { color:#8a8078; }
  #appView .dk-list tr.is-cancel strong { color:#8a8078; text-decoration:line-through; }
  #appView .dk-list > thead > tr > th.dk-acts-h { position:sticky; right:0; z-index:1; }
  #appView .dk-list > tbody > tr[data-open] > td.dk-acts { position:sticky; right:0; z-index:1; padding:12px 12px 12px 6px; white-space:nowrap; text-align:right; cursor:default; }
  #appView .dk-list button.dk-view { height:32px; min-height:32px; padding:0 12px; border:1px solid #E4DACA; border-radius:10px; background:#fff; color:#25211C; font-size:13px; font-weight:600; vertical-align:top; }
  #appView .dk-list button.dk-view:hover { border-color:#B89F7E; background:#FAF7F2; }
  #appView .dk-list .dk-acts .ui-more { margin-left:4px; vertical-align:top; }
  /* bảng phải cuộn ngang (màn hẹp): cột thao tác bám mép phải, có bóng mờ ngăn cách */
  #appView .dk-listcard > .tbl-wrap.is-scroll .dk-list :is(th.dk-acts-h, td.dk-acts) { box-shadow:-10px 0 10px -10px #392e2240; }
  /* Ô trổ ra "Theo dõi thu tiền dịch vụ": rộng đúng khung đang nhìn (dkdv.js đặt width), bám mép trái khi cuộn ngang */
  #appView .dk-list > tbody > tr.dk-exp-row > td { padding:0 16px 16px; border:0; background:#FAF7F2; text-align:left; }
  #appView .dk-list > tbody > tr.dk-exp-row:hover { background:none; }
  #appView .dk-exp-box { position:sticky; left:16px; box-sizing:border-box; max-width:100%; padding:16px 20px; border:1px solid #E4DACA; border-radius:12px; background:#fff; text-align:left; cursor:default; }
  #appView .dk-exp-box th, #appView .dk-exp-box td { text-align:left; }
  #appView .dk-exp-box .dk-rc-table .r { text-align:right; }
  #appView .dk-exp-box tr:hover td { background:inherit; }

  /* ---------- Theo dõi thu tiền (tóm tắt phiếu + ô trổ ra của danh sách) ---------- */
  #appView .hub-card.dk-receipts { margin-top:16px; padding:20px 24px; }
  #appView .dk-rc-head { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; justify-content:space-between; margin:0 0 12px; }
  #appView .dk-rc-head h2 { display:flex; align-items:center; gap:10px; margin:0; padding:0; border:0; color:#25211C; font-size:16px; font-weight:700; }
  #appView .dk-rc-head h2::before { content:none; }
  #appView .dk-rc-head > button { height:36px; min-height:36px; padding:0 14px; border-radius:10px; font-size:13px; font-weight:700; }
  #appView .dk-crm { display:flex; align-items:center; flex-wrap:wrap; gap:6px 10px; margin:0 0 12px; padding:8px 12px; border-radius:10px; background:#FAF7F2; color:#6F655A; font-size:13px; }
  #appView .dk-crm b { color:#25211C; }
  #appView .dk-crm.ok { background:#E6F2E8; color:#1F5E2E; } #appView .dk-crm.warn { background:#FFF2E0; color:#8A4B0C; } #appView .dk-crm.bad { background:#FBE7E5; color:#9B2F23; }
  #appView .dk-crm button.dk-btn { margin:0; height:28px; min-height:28px; }
  /* 4 ô số → dải tóm tắt */
  #appView .dk-rc-stats { display:flex; flex-wrap:wrap; align-items:center; gap:0; min-height:48px; margin:0 0 12px; padding:6px 4px; box-sizing:border-box; border-radius:12px; background:#FAF7F2; }
  #appView .dk-rc-stats .dk-rc-stat { display:flex; align-items:baseline; gap:6px; padding:6px 16px; border:0; border-left:1px solid #EFE9DD; border-radius:0; background:none; }
  #appView .dk-rc-stats .dk-rc-stat:first-child { border-left:0; }
  #appView .dk-rc-stats .dk-rc-stat span { display:inline; color:#6F655A; font-size:13px; font-weight:500; }
  #appView .dk-rc-stats .dk-rc-stat b { color:#25211C; font-size:15px; font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; }
  #appView .dk-rc-stats .dk-rc-stat small { color:inherit; font-size:inherit; font-weight:inherit; }
  #appView .dk-rc-stats .dk-rc-stat.ok b { color:#1F5E2E; } #appView .dk-rc-stats .dk-rc-stat.warn b, #appView .dk-rc-stats .dk-rc-stat.due b { color:#8A4B0C; } #appView .dk-rc-stats .dk-rc-stat.bad b { color:#9B2F23; }
  #appView :is(.dk-receipts, .dk-exp-box) .tbl-wrap { border:1px solid #EFE9DD; border-radius:12px; }
  /* chữ ẩn (.sr-only, position:absolute) nằm trong khung cuộn, không đẩy tràn cả trang khi màn hẹp */
  #appView :is(.dk-receipts, .dk-exp-box, .dk-sum, .dk-listcard) .tbl-wrap { position:relative; }
  #appView .dk-rc-table { width:100%; min-width:760px; border-collapse:collapse; font-size:14px; }
  #appView .dk-rc-table th { padding:10px 12px; border:0; background:#FAF7F2; color:#6F655A; font-size:13px; font-weight:600; text-align:left; text-transform:none; letter-spacing:0; white-space:nowrap; }
  #appView .dk-rc-table th.r, #appView .dk-rc-table td.r { text-align:right; }
  #appView .dk-rc-table td { padding:12px; border:0; border-top:1px solid #EFE9DD; background:#fff; color:#25211C; vertical-align:top; }
  #appView .dk-rc-table td small { display:block; margin-top:2px; color:#6F655A; font-size:12px; }
  #appView .dk-rc-table td.r b { font-variant-numeric:tabular-nums; }
  #appView .dk-rc-table tr.is-rejected td { background:#FDF3F2; }
  #appView .dk-rc-table td:nth-child(5) { min-width:220px; }
  #appView .dk-rc-table tbody tr:hover td { background:#FAF1E1; }
  #appView .dk-rc-table tbody tr.is-rejected:hover td { background:#FDF3F2; }
  #appView .dk-ract { white-space:nowrap; text-align:right; vertical-align:top; }
  #appView .dk-ract > div { display:inline-flex; align-items:center; gap:4px; }
  #appView .dk-bad, #appView .dk-rc-table td small.dk-bad { color:#9B2F23; font-weight:600; }
  /* Nút thao tác khoản thu: cao 32, bo 10; Xác nhận nền đồng, Từ chối / Xóa chữ đỏ */
  #appView button.dk-btn, .dk-ovl button.dk-btn { display:inline-flex; align-items:center; justify-content:center; height:32px; min-height:32px; margin:0; padding:0 12px; border:1px solid #E4DACA; border-radius:10px; background:#fff; color:#25211C; font:inherit; font-size:13px; font-weight:600; line-height:1; box-shadow:none; vertical-align:middle; white-space:nowrap; }
  #appView button.dk-btn:hover, .dk-ovl button.dk-btn:hover { background:#FAF7F2; border-color:#B89F7E; }
  #appView button.dk-btn.ok, .dk-ovl button.dk-btn.ok { background:#9A6A2E; border-color:#9A6A2E; color:#fff; font-weight:700; }
  #appView button.dk-btn.ok:hover, .dk-ovl button.dk-btn.ok:hover { background:#7E5523; border-color:#7E5523; }
  #appView button.dk-btn.bad, .dk-ovl button.dk-btn.bad { border-color:#E9C9C4; color:#9B2F23; }
  #appView button.dk-btn.bad:hover, .dk-ovl button.dk-btn.bad:hover { background:#FBE7E5; border-color:#D9A09A; }
  #appView button.dk-btn:disabled, .dk-ovl button.dk-btn:disabled { opacity:.5; cursor:not-allowed; }

  /* ---------- Tóm tắt phiếu đã lưu ---------- */
  #appView .hub-card.dk-sum { margin-bottom:16px; padding:20px 24px; }
  #appView .dk-sum-head { display:flex; justify-content:space-between; align-items:flex-start; flex-wrap:wrap; gap:12px 24px; padding-bottom:16px; margin-bottom:16px; border-bottom:1px solid #EFE9DD; }
  #appView .dk-sum .dk-sum-head h2 { margin:0; color:#25211C; font-size:16px; font-weight:700; }
  #appView .dk-sum-total { text-align:right; }
  #appView .dk-sum-total span { display:block; color:#6F655A; font-size:13px; font-weight:500; }
  #appView .dk-sum-total b { color:#8A5F27; font-size:26px; font-weight:800; font-variant-numeric:tabular-nums; }
  #appView .dk-sum-total b small { color:#6F655A; font-size:14px; font-weight:600; }
  #appView .dk-sum-total > small { display:block; color:#6F655A; font-size:12px; }
  #appView .dk-facts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px 20px; margin-bottom:16px; }
  #appView .dk-fact span { display:block; margin-bottom:2px; color:#6F655A; font-size:13px; font-weight:500; }
  #appView .dk-fact b { color:#25211C; font-size:14px; font-weight:700; }
  #appView .dk-fact small { display:block; margin-top:2px; color:#6F655A; font-size:12px; }
  #appView .dk-sum .tbl-wrap { border:1px solid #EFE9DD; border-radius:12px; }
  #appView .dk-sum-table { width:100%; min-width:720px; border-collapse:collapse; font-size:14px; }
  #appView .dk-sum-table th { padding:10px 12px; border:0; background:#FAF7F2; color:#6F655A; font-size:13px; font-weight:600; text-align:left; text-transform:none; letter-spacing:0; white-space:nowrap; }
  #appView .dk-sum-table td { padding:12px; border:0; border-top:1px solid #EFE9DD; background:#fff; color:#25211C; vertical-align:middle; }
  #appView .dk-sum-table td small { display:block; margin-top:2px; color:#6F655A; font-size:12px; }
  #appView .dk-sum-table .r { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; } #appView .dk-sum-table .c { text-align:center; width:36px; }
  #appView .dk-sum-table tfoot td { background:#FAF7F2; font-weight:700; }
  #appView .dk-sum-table tbody tr:hover td { background:#FAF1E1; }
  #appView .dk-sum-gifts { display:flex; flex-wrap:wrap; align-items:center; gap:6px 8px; margin-top:14px; font-size:14px; }
  #appView .dk-sum-gifts span { padding:4px 12px; border-radius:14px; background:#FAF7F2; }
  #appView .dk-sum-gifts em { font-style:normal; font-weight:700; color:#8A5F27; }
  #appView .dk-sum-pays { margin-top:14px; font-size:14px; }
  #appView .dk-sum-pays ul { display:flex; flex-wrap:wrap; gap:8px 10px; margin:8px 0 0; padding:0; list-style:none; }
  #appView .dk-sum-pays li { display:flex; gap:8px; padding:6px 12px; border:1px solid #EFE9DD; border-radius:10px; }
  #appView .dk-sum-pays li b { font-variant-numeric:tabular-nums; }
  @media (max-width:900px) { #appView .dk-facts { grid-template-columns:1fr 1fr; } }
  @media (max-width:560px) { #appView .dk-facts { grid-template-columns:1fr; } #appView .dk-sum-total { text-align:left; } }

  /* ---------- Lập / sửa phiếu: các khối thẻ phẳng, chân cố định ở đáy màn ---------- */
  #appView form.dk-paper { margin:0; padding:0; border:0; border-radius:0; background:none; box-shadow:none; }
  #appView .dk-paper > .hh-fs { display:flex; flex-direction:column; gap:16px; }
  #appView .hub-card.dk-sec { display:flex; flex-direction:column; gap:14px; min-width:0; margin:0; padding:20px 24px; }
  /* Thẻ ngoài: góc vuông, viền đậm hơn ô nhập; chỉ các ô bên trong bo tròn (Chủ dự án 05/11) */
  #appView .hub-card.dk-sec, #appView #dkHistory.hub-card { border:1px solid #B89F7E; border-radius:0; }
  #appView .dk-sec-head { display:flex; align-items:center; gap:16px; }
  #appView .dk-sec-head h2 { flex:1 1 auto; margin:0; padding:0; border:0; color:#25211C; font-size:16px; font-weight:700; text-transform:none; letter-spacing:0; }
  #appView .dk-sec-head h2::before { content:none; }
  /* Ô tìm thêm dịch vụ / quà nằm giữa tiêu đề và nút "+ … tự nhập" */
  /* Lưới 3 cột đối xứng: ô tìm nằm đúng giữa thẻ, 2 ô (dịch vụ, quà) thẳng hàng nhau */
  #appView .dk-sec-head.has-mid { display:grid; grid-template-columns:minmax(230px,1fr) minmax(0,560px) minmax(230px,1fr); }
  #appView .dk-sec-head.has-mid h2 { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  #appView .dk-sec-head.has-mid .dk-addbtn { justify-self:end; }
  #appView .dk-sec-head .dk-add { display:flex; min-width:0; }
  #appView .dk-sec-head .hh-ac.dk-add-box { width:100%; }
  #appView .dk-sec-head .dk-addbtn, #appView #dkAddPay { flex:0 0 auto; height:36px; min-height:36px; padding:0 14px; border:1px solid #E4DACA; border-radius:10px; background:#fff; color:#25211C; font-size:13px; font-weight:600; }
  #appView .dk-sec-head .dk-addbtn:hover, #appView #dkAddPay:hover { border-color:#B89F7E; background:#FAF7F2; color:#25211C; }
  #appView .hub-card.dk-sec.is-missing { border-color:#9B2F23; box-shadow:0 0 0 3px #FBE7E5; }
  #appView .dk-sec.is-missing .dk-sec-head h2 { color:#9B2F23; }
  #appView .dk-paper + .hub-error, #appView .dk-paper .hub-error { margin:0; }
  #appView #dkHistory.hub-card { margin-top:16px; padding:20px 24px; }
  #appView #dkHistory > h2 { margin:0 0 10px; font-size:16px; font-weight:700; color:#25211C; }
  /* Nhãn viết thường 13/600 trên ô; ô nhập cao 40, bo 10 */
  #appView .dk-paper .hh-grid { margin:0; gap:16px 20px; }
  #appView .dk-paper .hh-f { gap:6px; }
  #appView .dk-paper .hh-f > label { color:#6F655A; font-size:13px; font-weight:600; text-transform:none; letter-spacing:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  #appView .dk-paper .hh-f input, #appView .dk-paper .hh-f select { height:40px; min-height:40px; border-radius:10px; font-size:14px; }
  #appView .dk-paper .hh-ac-info { margin-top:0; color:#6F655A; font-size:12px; font-weight:500; }
  #appView .dk-paper .hh-ac-info.is-warn { color:#8A4B0C; }
  #appView .dk-no input { font-weight:700; font-variant-numeric:tabular-nums; }
  #appView .dk-rate { display:flex; gap:6px; }
  #appView .dk-rate input { flex:1 1 auto; min-width:0; text-align:right; font-weight:700; font-variant-numeric:tabular-nums; }
  /* Ô tỷ giá đọc như "1 USD = 25.800": tiền tố cố định nằm trong ô, số ngay sau */
  #appView .dk-rate-in { position:relative; display:flex; flex:1 1 auto; min-width:0; }
  #appView .dk-rate-pre { position:absolute; z-index:1; left:12px; top:50%; transform:translateY(-50%); color:#6F655A; font-size:14px; font-weight:500; white-space:nowrap; pointer-events:none; }
  #appView .dk-paper .dk-rate-in input { width:100%; padding-left:68px; text-align:left; }
  #appView .dk-rate-vcb { pointer-events:none; } /* bấm trúng chữ vẫn là bấm nút (dkdv.js so e.target.id) */
  #appView .dk-rate button { flex:0 0 auto; height:40px; min-height:40px; padding:0 10px; border-radius:10px; font-size:13px; white-space:nowrap; }
  #appView .hh-grid.dk-row1 { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #appView .hh-grid.dk-cust { grid-template-columns:repeat(2,minmax(0,1fr)); }
  @media (max-width:700px) { #appView .hh-grid.dk-row1, #appView .hh-grid.dk-cust { grid-template-columns:1fr; } }

  /* Ô tìm viên thuốc: thêm dịch vụ / quà từ bảng giá */
  #appView .dk-add { margin:0; }
  #appView .hh-ac.dk-add-box { display:flex; align-items:center; gap:8px; max-width:560px; height:40px; padding:0 14px; box-sizing:border-box; border:1px solid #E4DACA; border-radius:20px; background:#fff; color:#6F655A; }
  #appView .hh-ac.dk-add-box:focus-within { border-color:#9A6A2E; box-shadow:0 0 0 3px #9a6a2e1f; }
  #appView .hh-ac.dk-add-box > svg { flex:0 0 16px; }
  #appView .hh-ac.dk-add-box > input[type="search"] { flex:1 1 auto; min-width:0; width:auto; height:38px; min-height:0; margin:0; padding:0; border:0; border-radius:0; outline:0; background:transparent; box-shadow:none; color:#25211C; font:inherit; font-size:14px; }
  #appView .hh-ac-pop.dk-pick { min-width:min(560px,calc(100vw - 48px)); max-height:min(420px,55vh); border-color:#EFE9DD; box-shadow:0 8px 24px #392e221f; }
  #appView .dk-pick .dk-pick-g { position:sticky; top:-6px; z-index:1; margin:4px 0 2px; padding:5px 10px; border-radius:6px; background:#FAF7F2; color:#6F655A; font-size:12px; font-weight:700; }
  #appView .dk-pick button em { white-space:nowrap; color:#8A5F27; }
  #appView .dk-sec .srp-empty.dk-empty { display:grid; place-items:center; min-height:64px; margin:0; padding:8px; box-sizing:border-box; border:1px dashed #E4DACA; border-radius:12px; background:#FAF7F2; color:#6F655A; font-size:14px; }

  /* Bảng dòng dịch vụ / quà / lịch thanh toán: khung kẻ mảnh, đầu nền nhạt, chữ thường */
  /* Bảng nhập cuộn ngang trong .tbl-wrap; chữ ẩn (.sr-only, position:absolute) phải nằm trong khung cuộn, không đẩy tràn cả trang khi màn hẹp */
  #appView .dk-sec .tbl-wrap { position:relative; margin:0; border:1px solid #EFE9DD; border-radius:12px; }
  /* app.css ẩn cột thứ 4 mọi bảng .tbl-wrap ở ≤480px (bảng xét nghiệm) — bảng nhập phiếu / Quản lý sản phẩm giữ đủ cột (cột 4 là Đơn giá) */
  @media (max-width:480px) { #appView .dk-sec .tbl-wrap table th:nth-child(4), #appView .dk-sec .tbl-wrap table td:nth-child(4), .dk-pm .tbl-wrap table th:nth-child(4), .dk-pm .tbl-wrap table td:nth-child(4) { display:table-cell; } }
  #appView .hh-ac-info .dk-link { margin-left:4px; font-weight:700; }
  #appView table.dk-lines { width:100%; min-width:1060px; border-collapse:collapse; table-layout:fixed; font-size:14px; }
  #appView table.dk-gifts { min-width:820px; }
  #appView table.dk-pays { min-width:700px; }
  #appView .dk-lines .c-stt { width:48px; } #appView .dk-lines .c-unit { width:92px; } #appView .dk-lines .c-price { width:112px; } #appView .dk-lines .c-qty { width:58px; }
  #appView .dk-lines .c-amt { width:102px; } #appView .dk-lines .c-pct { width:84px; } #appView .dk-lines .c-vnd { width:130px; } #appView .dk-lines .c-del { width:40px; } #appView .dk-lines .c-mode { width:170px; } #appView .dk-lines .c-pval { width:190px; }
  #appView .dk-lines th { padding:10px 8px; border:0; background:#FAF7F2; color:#6F655A; font-size:13px; font-weight:600; text-transform:none; letter-spacing:0; text-align:center; white-space:normal; line-height:1.3; }
  #appView .dk-lines th:first-child, #appView .dk-lines td:first-child { padding-left:14px; }
  #appView .dk-lines th.l { text-align:left; }
  /* mọi ô trong bảng nhập căn giữa theo chiều dọc: ô nhập, số tiền, nút ✕ thẳng hàng với ô tên nhiều dòng */
  #appView .dk-lines td { padding:8px; border:0; border-top:1px solid #EFE9DD; background:#fff; color:#25211C; font-size:14px; vertical-align:middle; }
  #appView .dk-lines td > select, #appView .dk-lines td > input, #appView .dk-lines td .hh-vnd input, #appView .dk-lines td .dk-pct input { height:36px; min-height:36px; }
  #appView .dk-lines td input, #appView .dk-lines td select { width:100%; min-height:36px; box-sizing:border-box; margin:0; border-radius:10px; font-size:14px; }
  #appView .dk-lines td select[data-f="unit"] { padding-left:10px; padding-right:24px; }
  /* dòng "Phần còn lại" của lịch thanh toán: % / số tiền còn lại, ô chỉ đọc cùng cỡ ô nhập */
  #appView .dk-rest { display:flex; align-items:center; justify-content:flex-end; height:36px; padding:0 10px; box-sizing:border-box; border:1px solid #EFE9DD; border-radius:10px; background:#FAF7F2; color:#25211C; font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; }
  #appView .dk-lines td.c { text-align:center; }
  #appView .dk-lines td:first-child.c { text-align:left; }
  #appView .dk-lines td.r { text-align:right; font-weight:700; }
  #appView .dk-lines td.m { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
  #appView .dk-lines td.m.b { color:#25211C; font-weight:700; }
  #appView .dk-lines td.m small { color:#6F655A; font-size:12px; }
  #appView .dk-lines td.m .dk-under { display:block; }
  #appView .dk-lines tr.dk-grp td { background:#FAF7F2; color:#25211C; font-size:13px; font-weight:700; }
  #appView .dk-lines td input[data-f="price"], #appView .dk-lines td input[data-f="qty"] { text-align:right; font-variant-numeric:tabular-nums; font-weight:600; }
  #appView .dk-lines td.dk-after input { text-align:right; font-variant-numeric:tabular-nums; font-weight:600; }
  #appView .dk-lines td.dk-after input::placeholder { color:#9A8F82; font-weight:500; }
  #appView .dk-lines td input.is-empty { border-color:#E0A052; background:#FFF8EE; }
  #appView .dk-lines td textarea { width:100%; min-height:36px; box-sizing:border-box; margin:0; padding:7px 10px; border-radius:10px; font:inherit; font-size:14px; font-weight:600; line-height:1.4; resize:vertical; }
  #appView .dk-lines .dk-grpsel { min-height:32px; height:32px; margin-bottom:4px; color:#8A5F27; font-size:12px; font-weight:700; }
  #appView .dk-lines tfoot td { padding:10px 8px; background:#FAF7F2; font-size:14px; font-weight:700; }
  #appView .dk-x { display:inline-grid; place-items:center; width:28px; height:28px; min-height:28px; padding:0; border:0; border-radius:8px; background:none; color:#6F655A; font-size:14px; cursor:pointer; }
  #appView .dk-x:hover { background:#FBE7E5; color:#9B2F23; }
  #appView .dk-pct { position:relative; display:block; }
  #appView .dk-pct input { padding-right:22px !important; text-align:right; }
  #appView .dk-pct span { position:absolute; right:9px; top:50%; transform:translateY(-50%); color:#6F655A; font-size:12px; font-weight:600; pointer-events:none; }
  /* "Sửa %": nút ở tiêu đề cột; chế độ sửa thì ô % viền đồng nét đứt; ô đã sửa tay có chấm đồng góc trên */
  #appView .dk-pctedit { display:block; margin:4px auto 0; min-height:24px; padding:2px 8px; border:1px solid #d8c4a4; border-radius:999px; background:#fff; color:#8a5f2a; font:inherit; font-size:11.5px; font-weight:700; white-space:nowrap; cursor:pointer; }
  #appView .dk-pctedit:hover { background:#f6ecdd; }
  #appView .dk-pctedit[aria-pressed="true"] { background:#a9783a; border-color:#a9783a; color:#fff; }
  #appView .dk-lines.is-pctedit .dk-pct input { border:1px dashed #a9783a !important; background:#fffaf2; }
  #appView .dk-lines.is-vndedit .c-vnd { width:150px; }
  #appView .dk-lines.is-vndedit td.dk-after input[data-f="aftervnd"] { border:1px dashed #a9783a !important; background:#fffaf2; }
  #appView .dk-pct.is-label::after { content:""; position:absolute; top:-3px; right:-3px; width:8px; height:8px; border-radius:50%; background:#a9783a; box-shadow:0 0 0 2px #fff; }
  #appView .dk-pays .hh-vnd input { min-height:36px; }
  #appView #dkPays .dk-quick { display:flex; margin-top:14px; }
  #appView #dkPayWarn { margin:10px 0 0; }

  /* Tổng chi phí: ô nền nhạt, số lớn 26/800 */
  #appView .dk-total { display:flex; flex-wrap:wrap; gap:16px; margin:0 0 16px; }
  #appView .dk-total > div { display:block; flex:0 1 240px; min-width:200px; padding:14px 18px; border:0; border-radius:12px; background:#FAF7F2; }
  #appView .dk-total > div:nth-child(2) { flex-basis:340px; }
  #appView .dk-total span { display:block; color:#6F655A; font-size:13px; font-weight:500; text-transform:none; letter-spacing:0; }
  #appView .dk-total b { display:block; margin-top:4px; color:#8A5F27; font-size:26px; font-weight:800; font-variant-numeric:tabular-nums; }
  #appView .dk-total b small { color:#6F655A; font-size:14px; font-weight:600; }
  #appView .dk-total > div.dk-gift-sum b { color:#25211C; font-size:20px; font-weight:700; }

  #appView #dkNotes { width:100%; min-height:150px; padding:12px; box-sizing:border-box; border-radius:10px; color:#25211C; font-size:14px; line-height:1.5; resize:vertical; }
  #appView .dk-check { display:flex; align-items:center; gap:10px; margin:0; color:#25211C; font-size:14px; font-weight:500; cursor:pointer; }
  #appView .dk-check[hidden] { display:none; }
  #appView .dk-check input { width:18px; height:18px; margin:0; accent-color:#9A6A2E; }

  /* Chân cố định: Hủy · Xem trước · ⋯ · Lưu phiếu */
  #appView .dk-foot { position:sticky; bottom:0; z-index:20; display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-top:16px; padding:14px 0; background:#fff; border-top:1px solid #EFE9DD; }
  #appView .dk-foot > button.primary { padding:0 22px; }
  #appView .dk-foot-more { display:inline-flex; }
  #appView .dk-paper .hh-fs:disabled input, #appView .dk-paper .hh-fs:disabled select, #appView .dk-paper .hh-fs:disabled textarea { background:#FAF7F2; }
}

/* Màn rộng (≥ 901px): hàng công cụ một dòng; "Thông tin phiếu" 5 ô một hàng (Pháp nhân · Số phiếu · Ngày · Tỷ giá · Nơi lập);
   "Người đăng ký" 4 ô một hàng (Họ tên · Sale phụ trách · SĐT · Địa chỉ); chân cố định tràn hết vùng nội dung */
@media screen and (min-width:901px) {
  #appView .hh-bar.dk-bar { flex-wrap:nowrap; }
  #appView .hh-grid.dk-row1 { grid-template-columns:minmax(0,1fr) minmax(0,1.75fr) minmax(0,.95fr) minmax(0,1.25fr) minmax(0,.8fr); gap:16px; }
  #appView .hh-grid.dk-cust { grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.6fr); }
  #appView .dk-foot { margin-left:-32px; margin-right:-32px; padding:14px 32px; }
}
/* Màn 901–1180px: 5 ô vẫn một hàng — khít khe, số phiếu chữ nhỏ hơn chút để không bị cắt */
@media screen and (min-width:901px) and (max-width:1180px) {
  #appView .hh-grid.dk-row1 { gap:12px; }
  #appView .dk-row1 #dkNo { font-size:13px; padding-left:10px; padding-right:10px; }
  #appView .dk-rate-vcb { display:none; } /* nút chỉ còn ↻, nhường chỗ cho "1 USD = …" */
  #appView .dk-rate button { width:40px; padding:0; }
  #appView .hh-grid.dk-row1 { grid-template-columns:minmax(0,.95fr) minmax(0,1.75fr) minmax(0,.95fr) minmax(0,1.35fr) minmax(0,.75fr); }
  #appView .dk-paper .dk-rate-in input { padding-left:60px; padding-right:10px; }
  #appView .dk-rate-pre { left:10px; font-size:13px; }
  #appView .dk-paper .dk-row1 select { font-size:13px; }
}

/* Bản in Phiếu ĐKDV — A4 dọc như file Excel ("PHIẾU XÁC NHẬN ĐẶT HÀNG" / "ĐĂNG KÝ DỊCH VỤ").
   Dòng và ô bảng giãn rộng, nét kẻ đen rõ cho dễ đọc khi in (Chủ dự án 25/10). Xuất PDF dùng chung các luật này. */
@page dkp { size: A4 portrait; margin: 0; }   /* lề nằm trong #printRoot (app.css --pm, 14/11/2026) */
@media print {
  #printRoot .dk-print { page:dkp; box-sizing:border-box; padding:0 1px; color:#000; font-family:'Plus Jakarta Sans','Inter',Arial,sans-serif; font-size:9pt; line-height:1.5; }
  #printRoot .dk-print * { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  #printRoot .dk-print tr { break-inside:avoid; page-break-inside:avoid; }
  #printRoot .dk-p-logos { display:flex; align-items:center; justify-content:flex-start; height:17mm; margin-bottom:2mm; }
  #printRoot .dk-p-logos.two { justify-content:space-between; }
  #printRoot .dk-p-logos img { display:block; height:16mm; width:auto; }
  #printRoot .dk-p-logos.two img + img { height:12mm; }
  #printRoot .dk-p-title { display:flex; align-items:center; justify-content:space-between; gap:6mm; margin:0 0 4mm; }
  #printRoot .dk-p-title h1 { margin:0; font-size:15pt; font-weight:800; letter-spacing:.01em; color:#000; }
  #printRoot .dk-p-title dl { display:grid; grid-template-columns:auto auto; gap:1.2mm 6px; margin:0; font-size:9pt; }
  #printRoot .dk-p-title dt { font-weight:700; } #printRoot .dk-p-title dd { margin:0; font-weight:800; white-space:nowrap; }
  #printRoot .dk-print h2 { margin:4mm 0 2mm; font-size:10pt; font-weight:800; color:#000; }
  #printRoot table.dk-p-info { width:100%; border-collapse:collapse; table-layout:fixed; }
  #printRoot .dk-p-info th, #printRoot .dk-p-info td { padding:2.4mm 2.6mm; border:0.6px solid #000; text-align:left; vertical-align:middle; line-height:1.4; }
  /* app.css in mọi tiêu đề bảng chữ hoa + giãn chữ: bỏ cho phiếu (giữ đúng chữ như Excel, không tràn mép giấy) */
  #printRoot .dk-p-info th, #printRoot .dk-p-tbl th, #printRoot .dk-p-signs th { letter-spacing:0; color:#000; white-space:normal; }
  #printRoot .dk-p-info th { font-weight:700; background:#f2ebdd; text-transform:none; }
  #printRoot .dk-p-info td.b { font-weight:800; font-size:10.5pt; }
  #printRoot .dk-p-info .up { text-transform:uppercase; }
  #printRoot .dk-p-auth { margin:2.5mm 0 0; font-style:italic; line-height:1.55; }
  #printRoot .dk-p-sec2 { display:flex; align-items:baseline; justify-content:space-between; }
  #printRoot .dk-p-sec2 span { font-weight:700; }
  #printRoot .dk-p-sec2 span b { color:#b3261e; font-size:10.5pt; }
  #printRoot table.dk-p-tbl { width:100%; border-collapse:collapse; table-layout:fixed; font-size:7.8pt; }
  #printRoot .dk-p-tbl th, #printRoot .dk-p-tbl td { padding:1.5mm 1.4mm; border:0.6px solid #000; vertical-align:middle; line-height:1.4; overflow-wrap:anywhere; }
  #printRoot .dk-p-tbl th { padding:1.8mm 1mm; background:#f2ebdd; font-weight:800; text-align:center; font-size:7.4pt; line-height:1.3; text-transform:none; }
  #printRoot .dk-p-tbl td.c { text-align:center; } #printRoot .dk-p-tbl td.r { padding-left:1mm; padding-right:1.2mm; text-align:right; white-space:nowrap; }
  #printRoot .dk-p-tbl td.b, #printRoot .dk-p-tbl td.r.b { font-weight:800; }
  #printRoot .dk-p-tbl td.nm { font-size:7.6pt; line-height:1.45; }
  #printRoot .dk-p-tbl tr.g td { font-weight:800; background:#fbf7f0; }
  #printRoot .dk-p-tbl tr.t td, #printRoot .dk-p-tbl tr.s td { padding-top:2mm; padding-bottom:2mm; font-weight:800; background:#fff59d; }
  #printRoot .dk-p-tbl tr.t td.r, #printRoot .dk-p-tbl tr.s td.r { color:#b3261e; }
  #printRoot .dk-p-notes { margin:3.5mm 0 0; font-size:8.2pt; line-height:1.6; }
  /* Mục III: khung chuyển khoản — thông tin bên trái, mã QR ngay cạnh (cả cụm canh giữa khung), không bị cắt trang */
  #printRoot .dk-p-bankblock { margin-top:3mm; break-inside:avoid; page-break-inside:avoid; }
  #printRoot .dk-p-bankblock h2 { margin-top:0; }
  #printRoot .dk-p-bankbox { display:flex; align-items:center; justify-content:center; gap:14mm; padding:3mm 6mm; border:0.6px solid #000; background:#fbf7f0; font-size:8.6pt; line-height:1.6; }
  #printRoot .dk-p-bankinfo { display:flex; flex-direction:column; }
  #printRoot .dk-p-bankinfo > b { margin-bottom:0.8mm; font-size:9pt; }
  #printRoot .dk-p-qr { display:flex; flex-direction:column; align-items:center; gap:1mm; margin:0; }
  #printRoot .dk-p-qr figcaption { font-weight:700; font-size:8pt; }
  #printRoot .dk-p-qr img { display:block; width:26mm; height:auto; }
  #printRoot .dk-p-refund { margin:1.2mm 0 0; font-size:8.2pt; line-height:1.55; }
  #printRoot .dk-p-refund.h { margin-top:2.2mm; font-weight:700; }
  #printRoot .dk-p-rate { margin:2.5mm 0 0; font-style:italic; font-size:8.2pt; }
  /* Khu ký tên: khung kẻ như Excel — tên ô nền xám, ô trống để ký; cả khu không bị cắt sang trang khác */
  #printRoot .dk-p-end { margin-top:3mm; break-inside:avoid; page-break-inside:avoid; }
  #printRoot .dk-p-date { margin:0 0 2mm; text-align:right; font-style:italic; font-weight:700; font-size:10pt; }
  #printRoot table.dk-p-signs { width:100%; border-collapse:collapse; table-layout:fixed; }
  #printRoot .dk-p-signs th { padding:2.6mm 2mm; border:0.8px solid #000; background:#e6e6e6; font-size:8.6pt; font-weight:800; text-align:center; text-transform:uppercase; line-height:1.3; }
  #printRoot .dk-p-signs td { padding:0; border:0.8px solid #000; vertical-align:top; }
  #printRoot .dk-p-signs .box { display:flex; flex-direction:column; align-items:center; padding:1.6mm 2mm 2mm; box-sizing:border-box; }
  #printRoot .dk-p-signs .box.b1 { height:30mm; }
  #printRoot .dk-p-signs .box.b2 { height:24mm; }
  #printRoot .dk-p-signs small { font-style:italic; font-weight:700; font-size:8pt; }
  #printRoot .dk-p-signs .nm { margin-top:auto; font-weight:700; font-size:8.6pt; }
  #printRoot .dk-p-signs tr.gap td { height:6mm; border-top:0; border-bottom:0; }
  /* Kiểu gọn (.dense, dkdv.js fitPage): phiếu ít dịch vụ vừa 1 trang A4 — chỉ bớt khoảng trống, chữ gần như giữ nguyên */
  #printRoot .dk-print.dense { font-size:8.8pt; line-height:1.4; }
  #printRoot .dense .dk-p-logos { height:14mm; margin-bottom:1mm; }
  #printRoot .dense .dk-p-logos img { height:13mm; } #printRoot .dense .dk-p-logos.two img + img { height:10mm; }
  #printRoot .dense .dk-p-title { margin-bottom:2.5mm; } #printRoot .dense .dk-p-title h1 { font-size:14pt; }
  #printRoot .dense h2 { margin:3mm 0 1.5mm; }
  #printRoot .dense .dk-p-info th, #printRoot .dense .dk-p-info td { padding:1.6mm 2.4mm; }
  #printRoot .dense .dk-p-auth { margin-top:1.8mm; line-height:1.45; }
  #printRoot .dense .dk-p-tbl th { padding:1.3mm 1mm; }
  #printRoot .dense .dk-p-tbl td { padding-top:1mm; padding-bottom:1mm; }
  #printRoot .dense .dk-p-tbl tr.t td, #printRoot .dense .dk-p-tbl tr.s td { padding-top:1.4mm; padding-bottom:1.4mm; }
  #printRoot .dense .dk-p-notes { margin-top:2.5mm; line-height:1.45; }
  #printRoot .dense .dk-p-bankblock { margin-top:2mm; } #printRoot .dense .dk-p-bankbox { padding:2mm 5mm; line-height:1.45; } #printRoot .dense .dk-p-qr img { width:22mm; }
  #printRoot .dense .dk-p-refund { line-height:1.4; }
  #printRoot .dense .dk-p-rate { margin-top:2mm; }
  #printRoot .dense .dk-p-end { margin-top:2.5mm; } #printRoot .dense .dk-p-date { margin-bottom:1.5mm; }
  #printRoot .dense .dk-p-signs th { padding:1.8mm 2mm; }
  #printRoot .dense .dk-p-signs .box.b1 { height:24mm; } #printRoot .dense .dk-p-signs .box.b2 { height:18mm; }
  #printRoot .dense .dk-p-signs tr.gap td { height:3mm; }
}

/* Xem trước phiếu (dkdv.js openPreview): lớp phủ toàn màn hình, trang A4 trắng; chữ / bảng dùng lại đúng luật in
   (dkdv.js chép các luật "#printRoot …" trong @media print sang ".dk-pv-page …"). */
@media screen {
  .dk-pv { position:fixed; inset:0; z-index:1000; display:flex; flex-direction:column; background:rgba(40,34,28,.9); font-family:'Plus Jakarta Sans',system-ui,sans-serif; }
  .dk-pv-bar { display:flex; align-items:center; justify-content:space-between; gap:10px 16px; flex-wrap:wrap; padding:10px 16px; background:#fff; border-bottom:1px solid #e3d6c4; }
  .dk-pv-title { display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; }
  .dk-pv-title strong { font-size:16px; color:#1f1f1f; }
  .dk-pv-title span { color:#5b524a; font-size:13px; }
  .dk-pv-acts { display:flex; gap:8px; flex-wrap:wrap; }
  .dk-pv-acts button { min-height:36px; }
  .dk-pv-acts button.primary { background:#a9783a; border-color:#a9783a; color:#fff; }
  .dk-pv-acts button.primary:hover { background:#8f6430; border-color:#8f6430; }
  .dk-pv-body { flex:1; overflow:auto; padding:16px 12px 24px; }
  .dk-pv-zoom { width:max-content; margin:0 auto; }
  .dk-pv-page { width:210mm; min-height:297mm; margin:0 auto 16px; padding:10mm 12mm; box-sizing:border-box; background:#fff; color:#000; box-shadow:0 6px 24px rgba(0,0,0,.35); }
}
/* khung đo khi chia trang (ngoài màn hình) */
.dk-pv-measure { position:absolute !important; left:-10000px; top:0; visibility:hidden; width:210mm; padding:10mm 12mm; box-sizing:border-box; }

/* ---------- Hộp thoại (gắn vào body, ngoài #appView) — quy ước popup: bo 16, đầu 17/700 + nút đóng, thân cuộn, chân Hủy + nút đặc ---------- */
@media screen {
  .dk-pv-acts button.primary { background:#9A6A2E; border-color:#9A6A2E; color:#fff; }
  .dk-pv-acts button.primary:hover { background:#7E5523; border-color:#7E5523; }
  .dk-pv-acts button { min-height:36px; border-radius:10px; }

  .dk-ovl { position:fixed; inset:0; z-index:1000; display:flex; align-items:center; justify-content:center; padding:24px; background:rgb(28 23 18 / 45%); font-family:'Plus Jakarta Sans',system-ui,sans-serif; color:#25211C; }
  .dk-ovl small { display:block; margin-top:2px; color:#6F655A; font-size:12px; }
  .dk-ovl .tag { display:inline-flex; align-items:center; height:24px; padding:0 10px; box-sizing:border-box; border:0; border-radius:12px; background:#F1ECE4; color:#6F655A; font-size:12px; font-weight:600; white-space:nowrap; }
  .dk-ovl .tag.ok { background:#E6F2E8; color:#1F5E2E; } .dk-ovl .tag.warn { background:#FFF2E0; color:#8A4B0C; } .dk-ovl .tag.info { background:#E7EEF9; color:#24498A; } .dk-ovl .tag.danger { background:#FBE7E5; color:#9B2F23; }
  .dk-ovl .dk-bad { color:#9B2F23; font-weight:600; }
  .dk-ovl button.primary { background:#9A6A2E; border-color:#9A6A2E; color:#fff; font-weight:700; }
  .dk-ovl button.primary:hover { background:#7E5523; border-color:#7E5523; color:#fff; }
  .dk-ovl input:not([type="checkbox"]):not([type="file"]), .dk-ovl select, .dk-ovl textarea { border-color:#E4DACA; border-radius:10px; }
  .dk-ovl input:not([type="checkbox"]):not([type="file"]):focus, .dk-ovl select:focus, .dk-ovl textarea:focus { border-color:#9A6A2E; box-shadow:0 0 0 3px #9a6a2e1f; outline:0; }
  .dk-rq-card { display:flex; flex-direction:column; width:min(1180px,100%); max-height:calc(100vh - 48px); background:#fff; border-radius:16px; box-shadow:0 8px 24px rgba(57,46,34,.12); overflow:hidden; }
  .dk-rq-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 20px; border-bottom:1px solid #EFE9DD; }
  .dk-rq-head h2 { display:flex; align-items:center; gap:8px; margin:0; color:#25211C; font-size:17px; font-weight:700; }
  .dk-ovl button.dk-close { display:grid; place-items:center; flex:0 0 auto; width:36px; height:36px; min-height:36px; padding:0; border:1px solid #E4DACA; border-radius:10px; background:#fff; color:#25211C; }
  .dk-ovl button.dk-close:hover { background:#FAF7F2; }
  .dk-rq-body { overflow:auto; padding:16px 20px 20px; }
  .dk-rq-table { width:100%; min-width:900px; border-collapse:collapse; font-size:14px; }
  .dk-rq-table th { padding:10px 12px; background:#FAF7F2; color:#6F655A; font-size:13px; font-weight:600; text-align:left; text-transform:none; letter-spacing:0; white-space:nowrap; }
  .dk-rq-table td { padding:12px; border-top:1px solid #EFE9DD; vertical-align:middle; }
  .dk-rq-table .r { text-align:right; font-variant-numeric:tabular-nums; }
  .dk-rq-table tbody tr { cursor:pointer; } .dk-rq-table tbody tr:hover td { background:#FAF1E1; }
  .dk-rq-table tbody tr:focus-visible { outline:2px solid #9A6A2E; outline-offset:-2px; }

  /* Đối chiếu khoản thu: phiếu như bản in bên trái, khoản thu bên phải */
  .dk-cmp { padding:0; align-items:stretch; background:rgb(40 34 28 / 90%); z-index:1001; }
  .dk-cmp-card { display:flex; flex-direction:column; width:100%; height:100%; }
  .dk-cmp-main { flex:1; min-height:0; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  .dk-cmp-doc { overflow:auto; padding:16px 12px 24px; background:#5b524a; }
  .dk-cmp-load { color:#fff; text-align:center; margin-top:40px; }
  .dk-cmp-side { overflow:auto; padding:20px 24px 24px; background:#fff; border-left:1px solid #EFE9DD; }
  .dk-cmp-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
  .dk-cmp-head h3 { margin:0; font-size:17px; font-weight:700; }
  .dk-cmp-amount { margin:14px 0; padding:14px 18px; border-radius:12px; background:#FAF7F2; }
  .dk-cmp-amount span { display:block; color:#6F655A; font-size:13px; }
  .dk-cmp-amount b { color:#8A5F27; font-size:26px; font-weight:800; font-variant-numeric:tabular-nums; } .dk-cmp-amount b small { display:inline; font-size:14px; color:#6F655A; }
  .dk-cmp-facts { display:grid; grid-template-columns:1fr 1fr; gap:12px 18px; margin:0 0 16px; }
  .dk-cmp-facts dt { color:#6F655A; font-size:13px; } .dk-cmp-facts dd { margin:2px 0 0; font-size:14px; font-weight:600; overflow-wrap:anywhere; }
  .dk-cmp-side h4 { margin:18px 0 8px; color:#25211C; font-size:14px; font-weight:700; text-transform:none; letter-spacing:0; }
  .dk-cmp-stats { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
  .dk-cmp-stats .dk-rc-stat { padding:10px 12px; border-radius:12px; background:#FAF7F2; }
  .dk-cmp-stats .dk-rc-stat span { display:block; color:#6F655A; font-size:13px; }
  .dk-cmp-stats .dk-rc-stat b { font-size:16px; font-variant-numeric:tabular-nums; } .dk-cmp-stats .dk-rc-stat small { display:inline; }
  .dk-cmp-stats .ok b { color:#1F5E2E; } .dk-cmp-stats .warn b { color:#8A4B0C; } .dk-cmp-stats .due b { color:#9B2F23; }
  .dk-cmp-list { margin:0; padding:0; list-style:none; }
  .dk-cmp-list li { display:flex; align-items:center; gap:10px; margin-bottom:6px; padding:8px 12px; border:1px solid #EFE9DD; border-radius:10px; font-size:14px; }
  .dk-cmp-list li span:first-child { flex:1; } .dk-cmp-list li b { font-variant-numeric:tabular-nums; }
  .dk-cmp-list li.is-hit { border-color:#E4DACA; background:#FAF1E1; }
  .dk-cmp-acts { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
  .dk-cmp-acts button.dk-btn { height:40px; min-height:40px; padding:0 16px; font-size:14px; }
  .dk-cmp-reject { margin-top:16px; }
  .dk-cmp-reject label { display:block; margin-bottom:6px; color:#6F655A; font-size:13px; font-weight:600; }
  .dk-cmp-reject textarea { width:100%; box-sizing:border-box; padding:10px 12px; font:inherit; font-size:14px; }
  .dk-cmp-reject[hidden], .dk-cmp-acts[hidden] { display:none; }
  @media (max-width:900px) { .dk-cmp-main { grid-template-columns:1fr; grid-template-rows:50vh auto; overflow:auto; } .dk-cmp-side { overflow:visible; border-left:0; border-top:1px solid #EFE9DD; } .dk-ovl:not(.dk-cmp) { padding:10px; } }

  /* Ghi nhận / sửa khoản thu (dialog.ot-pop) */
  dialog.ot-pop.dk-rc-dlg { width:min(640px, calc(100vw - 24px)); border-color:#E4DACA; border-radius:16px; box-shadow:0 8px 24px rgba(57,46,34,.12); }
  .dk-rc-dlg form { padding:0; }
  .dk-rc-dlg header { margin:0; padding:16px 20px; border-bottom:1px solid #EFE9DD; }
  .dk-rc-dlg header h2 { margin:0 0 2px; color:#25211C; font-size:17px; font-weight:700; }
  .dk-rc-dlg header .hub-sub { color:#6F655A; font-size:13px; }
  .dk-rc-dlg .dk-rc-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px 16px; padding:16px 20px; }
  .dk-rc-dlg .dk-rc-grid label { display:flex; flex-direction:column; gap:6px; color:#6F655A; font-size:13px; font-weight:600; }
  .dk-rc-dlg .dk-rc-grid label.wide { grid-column:1 / -1; }
  .dk-rc-dlg .dk-rc-grid input, .dk-rc-dlg .dk-rc-grid select { height:40px; min-height:40px; box-sizing:border-box; border-color:#E4DACA; border-radius:10px; color:#25211C; font-size:14px; font-weight:500; }
  .dk-rc-dlg #rcVnd, .dk-rc-dlg #rcUsd, .dk-rc-dlg #rcRate { text-align:right; font-weight:700; font-variant-numeric:tabular-nums; }
  .dk-rc-dlg .rc-conv { grid-column:1 / -1; margin:-4px 0 0; color:#8A5F27; font-weight:700; font-size:13px; text-align:right; }
  .dk-rc-dlg [hidden] { display:none !important; }
  .dk-rc-dlg #rcErr { margin:0 20px 12px; }
  .dk-rc-dlg .btn-row { display:flex; justify-content:flex-end; gap:10px; margin:0; padding:14px 20px; border-top:1px solid #EFE9DD; }
  .dk-rc-dlg .btn-row button { height:40px; min-height:40px; padding:0 18px; border-radius:10px; font-size:14px; }
  .dk-rc-dlg .btn-row button:not(.primary) { border-color:#E4DACA; background:#fff; color:#25211C; }
  @media (max-width:560px) { .dk-rc-dlg .dk-rc-grid { grid-template-columns:1fr; } }

  /* Quản lý sản phẩm (dkdv.js openProducts): bảng giá 3 pháp nhân */
  .dk-rq-card.dk-pm-card { width:min(1180px,100%); }
  .dk-pm-body { font-size:14px; color:#25211C; }
  .dk-pm-bar { display:flex; align-items:center; gap:10px 14px; flex-wrap:wrap; margin-bottom:14px; }
  .dk-pm-bar input[type="search"] { flex:1 1 200px; min-width:0; max-width:320px; height:40px; min-height:40px; padding:0 14px; border-radius:20px !important; }
  .dk-pm-bar > button.primary { height:40px; min-height:40px; padding:0 16px; border-radius:10px; font-size:14px; }
  .dk-seg { display:inline-flex; border:1px solid #E4DACA; border-radius:10px; overflow:hidden; }
  .dk-seg button { height:38px; min-height:38px; padding:0 12px; border:0; border-radius:0; background:#fff; color:#25211C; font-weight:600; font-size:13px; cursor:pointer; }
  .dk-seg button + button { border-left:1px solid #E4DACA; }
  .dk-seg button[aria-pressed="true"] { background:#EFE2CC; color:#6E4A1C; }
  .dk-pm .dk-seg button small { display:inline; margin:0 0 0 4px; color:#6F655A; font-weight:600; }
  .dk-pm .dk-check { display:inline-flex; align-items:center; gap:8px; margin:0; font-size:14px; font-weight:500; cursor:pointer; }
  .dk-pm .dk-check input { width:17px; height:17px; margin:0; accent-color:#9A6A2E; }
  .dk-pm .hh-prior { margin:0 0 12px; padding:9px 12px; border-radius:10px; background:#FFF2E0; color:#8A4B0C; font-size:13px; }
  .dk-pm .srp-empty { margin:6px 0; padding:22px; border:1px dashed #E4DACA; border-radius:12px; background:#FAF7F2; text-align:center; color:#6F655A; }
  .dk-pm .tbl-wrap { overflow-x:auto; border:1px solid #EFE9DD; border-radius:12px; }
  table.dk-pm-table { width:100%; min-width:820px; border-collapse:collapse; }
  .dk-pm-table th { padding:10px 12px; background:#FAF7F2; color:#6F655A; font-size:13px; font-weight:600; text-transform:none; letter-spacing:0; text-align:center; white-space:nowrap; }
  .dk-pm-table th.l, .dk-pm-table td.l { text-align:left; }
  .dk-pm-table td { padding:10px 12px; border-top:1px solid #EFE9DD; vertical-align:middle; text-align:center; }
  .dk-pm-table td.r { text-align:right; white-space:nowrap; font-weight:700; font-variant-numeric:tabular-nums; }
  .dk-pm-table td.l b { display:block; font-weight:700; }
  .dk-pm-table td small { display:block; color:#6F655A; font-size:12px; }
  .dk-pm-table tr.dk-pm-grp td { padding:8px 12px; background:#FAF7F2; color:#25211C; font-size:13px; font-weight:700; text-align:left; }
  .dk-pm-table tr.is-off td { color:#a39a90; }
  .dk-pm-table tbody tr:not(.dk-pm-grp):hover td { background:#FAF1E1; }
  .dk-pm-table td button { height:32px; min-height:32px; padding:0 12px; border-color:#E4DACA; border-radius:10px; background:#fff; color:#25211C; }
  .dk-pm-table td.dk-pm-act { white-space:nowrap; } .dk-pm-table td.dk-pm-act button + button { margin-left:6px; }
  .dk-pm-table td button.hh-del { border-color:#E8CFC9; color:#9B2F23; } .dk-pm-table td button.hh-del:hover { background:#FBEDEA; }
  .dk-chip { display:inline-block; margin:2px; padding:2px 10px; border-radius:12px; background:#EFE2CC; color:#6E4A1C; font-size:12px; font-weight:600; white-space:nowrap; }
  .dk-pm-form h3 { margin:0 0 16px; color:#25211C; font-size:16px; font-weight:700; }
  .dk-pm-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px 16px; align-items:end; }
  .dk-pm-grid .w2, .dk-pm-ents { grid-column:1 / -1; }
  .dk-pm-ents > div { display:flex; gap:10px 20px; flex-wrap:wrap; padding-top:4px; }
  .dk-pm-form .hh-f { display:flex; flex-direction:column; gap:6px; min-width:0; }
  .dk-pm-form .hh-f > label, .dk-pm-form .hh-lbl { color:#6F655A; font-size:13px; font-weight:600; text-transform:none; letter-spacing:0; }
  .dk-pm-form input:not([type="checkbox"]), .dk-pm-form select { height:40px; min-height:40px; width:100%; box-sizing:border-box; font-size:14px; }
  .dk-pm-form textarea { width:100%; min-height:92px; box-sizing:border-box; padding:10px 12px; font-size:14px; line-height:1.45; }
  .dk-pm-form .hh-ac-info { display:block; min-height:14px; color:#6F655A; font-size:12px; font-weight:500; }
  .dk-pm-active { grid-column:1 / -1; }
  .dk-pm-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:16px; padding-top:16px; border-top:1px solid #EFE9DD; }
  .dk-pm-actions button { height:40px; min-height:40px; padding:0 18px; border-radius:10px; font-size:14px; }
  .dk-pm-actions button:not(.primary):not(.ghost) { border-color:#E4DACA; background:#fff; color:#25211C; }
  .dk-pm-actions button.hh-del { color:#9B2F23; }
  .dk-pm .hub-error { margin:12px 0 0; }
  @media (max-width:760px) { .dk-pm-grid { grid-template-columns:1fr 1fr; } }

  /* Nhập phiếu cũ (Sales Admin): khung thả file, danh sách file đang đọc, bảng duyệt bản nháp, chân nhập */
  .dk-imp-card { width:min(1320px,100%); }
  .dk-imp-body { flex:1; min-height:0; overflow:auto; padding:16px 20px; }
  .dk-imp-drop { position:relative; display:flex; flex-direction:column; gap:4px; padding:18px 20px; border:2px dashed #E4DACA; border-radius:12px; background:#FAF7F2; cursor:pointer; text-align:center; }
  .dk-imp-drop.is-over { border-color:#9A6A2E; background:#FAF1E1; }
  .dk-imp-drop input { position:absolute; inset:0; opacity:0; cursor:pointer; }
  .dk-imp-drop b { font-size:15px; } .dk-imp-drop span { color:#25211C; font-size:13px; } .dk-imp-drop small { color:#6F655A; font-size:12px; }
  .dk-imp-files { margin:12px 0 0; padding:0; list-style:none; display:grid; gap:6px; }
  .dk-imp-files li { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:8px 12px; border:1px solid #EFE9DD; border-radius:10px; font-size:13px; }
  .dk-imp-files li b { flex:0 1 auto; overflow-wrap:anywhere; } .dk-imp-files li span { flex:1; color:#6F655A; }
  .dk-imp-files li.is-busy { background:#FFF8EE; } .dk-imp-files li.is-ok span { color:#1F5E2E; } .dk-imp-files li.is-warn span { color:#8A4B0C; } .dk-imp-files li.is-bad span { color:#9B2F23; }
  .dk-imp-bar { display:flex; align-items:center; flex-wrap:wrap; gap:8px 14px; margin:14px 0 8px; font-size:13px; }
  .dk-imp-bar select { height:36px; min-height:36px; }
  .dk-imp-table { min-width:1100px; }
  .dk-imp-table tbody tr { cursor:default; }
  .dk-imp-table td { vertical-align:top; } .dk-imp-table td em { font-style:normal; font-weight:700; color:#8A5F27; }
  .dk-imp-table tr.is-off td { color:#8a8078; background:#FAF7F2; } .dk-imp-table tr.is-done td { background:#E6F2E8; }
  .dk-imp-table select { min-height:32px; max-width:170px; font-size:13px; }
  .dk-imp-ok { color:#1F5E2E !important; font-weight:600; } .dk-imp-new { color:#8A5F27 !important; font-weight:600; } .dk-imp-warn { color:#8A4B0C !important; }
  .dk-imp-foot { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:14px 20px; border-top:1px solid #EFE9DD; background:#fff; font-size:13px; }
  .dk-imp-foot button.dk-btn { height:40px; min-height:40px; padding:0 18px; font-size:14px; }
}

/* ==========================================================================
   Điện thoại / màn hẹp (≤ 900px), theo CRM mobile: đầu màn một dòng (← · tiêu đề · 1 nút đặc + ⋯), bộ lọc 1 hàng chip cuộn ngang,
   dải tóm tắt lưới 2 cột, mỗi phiếu / dòng dịch vụ / khoản thu một thẻ, chân phiếu cố định nằm trên thanh tab, popup rộng hết màn.
   Máy tính (≥ 901px) không đổi: .dk-chips = display:contents, ⋯ đầu màn của Sales chỉ hiện ở điện thoại (.dk-m-only).
   ========================================================================== */
.dk-chips { display:contents; }
@media screen and (min-width:901px) { #appView .dk-m-only { display:none !important; } }
@media screen and (max-width:900px) {
  /* Đầu màn danh sách: Phiếu ĐKDV · số · + Lập phiếu · ⋯ (Quản lý sản phẩm, Nhập phiếu cũ) */
  #appView .hub-heading:has(> .dk-head-new) { display:flex; flex-wrap:nowrap; align-items:center; justify-content:flex-start; gap:8px; }
  #appView .hub-heading:has(> .dk-head-new) > div:first-child { flex:1 1 auto; min-width:0; gap:8px; }
  #appView .hub-heading .dk-head-new { flex:0 0 auto; flex-wrap:nowrap; gap:8px; margin:0; }
  #appView .hub-heading .dk-head-new > #dkProducts, #appView .dk-m-hide { display:none; }
  #appView .hub-heading .dk-head-new > button.primary { gap:6px; padding:0 14px; }

  /* Hàng công cụ: ô tìm cả hàng · ‹ Tháng › gọn + chip lọc cuộn ngang */
  #appView .hh-bar.dk-bar { flex-wrap:wrap; gap:8px; margin:0 0 12px; }
  #appView .dk-bar .dk-search { order:-1; flex:1 1 100%; max-width:none; height:44px; }
  #appView .dk-bar .dk-search input[type="search"] { height:42px; font-size:16px; }
  #appView .dk-bar .dk-month { flex:0 0 auto; height:36px; }
  #appView .dk-bar .dk-month button { width:32px; height:34px; }
  #appView .dk-bar .dk-month strong { padding:0 4px; font-size:13px; }
  #appView .dk-bar .dk-chips { display:flex; flex:1 1 0; min-width:0; gap:8px; overflow-x:auto; scrollbar-width:none; }
  #appView .dk-bar .dk-chips::-webkit-scrollbar { display:none; }
  #appView .dk-bar select.dk-chipsel { flex:0 0 auto; max-width:none; font-size:16px; }

  /* Dải khoản thu chờ xác nhận: tiêu đề + nút một dòng, các khoản tối đa 2 dòng */
  #appView .dk-queue { gap:6px 10px; margin:0 0 12px; padding:10px 12px; }
  #appView .dk-queue h2 { flex:1 1 auto; min-width:0; white-space:normal; }
  #appView .dk-queue > button { order:2; margin:0; }
  #appView .dk-q-list { order:3; flex:1 1 100%; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }

  /* Dải tóm tắt: lưới 2 cột (nhãn trên, số dưới); Tổng VNĐ cả hàng */
  #appView .dk-strip, #appView .dk-rc-stats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); padding:4px; margin-bottom:12px; }
  #appView .dk-strip > div, #appView .dk-rc-stats .dk-rc-stat { flex-direction:column; align-items:flex-start; gap:2px; min-width:0; padding:8px 12px; border-left:0; }
  #appView .dk-strip > div:nth-child(2), #appView .dk-strip > div:nth-child(5), #appView .dk-rc-stats .dk-rc-stat:nth-child(even) { border-left:1px solid #EFE9DD; }
  #appView .dk-strip > div:nth-child(3) { grid-column:1 / -1; }
  #appView .dk-strip > div:nth-child(n+3), #appView .dk-rc-stats .dk-rc-stat:nth-child(n+3) { border-top:1px solid #EFE9DD; }
  #appView .dk-strip span, #appView .dk-rc-stats .dk-rc-stat span { font-size:12px; }
  #appView .dk-strip b, #appView .dk-rc-stats .dk-rc-stat b { font-size:15px; }

  /* Danh sách phiếu → thẻ: số phiếu + ngày · khách · dịch vụ (2 dòng) · tổng VNĐ + chip thu tiền · Sale + Xem phiếu ⋯ */
  #appView .hub-card.dk-listcard { padding:0; border:0; border-radius:0; background:none; overflow:visible; }
  #appView .dk-listcard > .tbl-wrap { overflow:visible; border:0; background:none; }
  #appView .dk-listcard > .srp-empty { margin:0; }
  #appView table.dk-list { display:block; width:100%; min-width:0; }
  #appView .dk-list > thead { display:none; }
  #appView .dk-list > tbody { display:flex; flex-direction:column; gap:10px; }
  #appView .dk-list > tbody > tr[data-open] { display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"no date" "cust cust" "svc svc" "vnd paid" "sale acts"; column-gap:12px; padding:14px 14px 12px; border:1px solid #E4DACA; border-radius:16px; background:#fff; }
  #appView .dk-list > tbody > tr[data-open]:hover, #appView .dk-list > tbody > tr.is-open { background:#FAF7F2; }
  #appView .dk-list > tbody > tr[data-open] > td, #appView .dk-list > tbody > tr[data-open] > td:first-child { display:block; min-width:0; padding:0; border:0; background:none !important; font-size:14px; }
  #appView .dk-list > tbody > tr[data-open] > td:nth-child(1) { grid-area:date; color:#6F655A; font-size:12px; text-align:right; }
  #appView .dk-list > tbody > tr[data-open] > td:nth-child(2) { grid-area:no; }
  #appView .dk-list td:nth-child(2) strong { font-size:15px; white-space:normal; overflow-wrap:anywhere; }
  #appView .dk-list > tbody > tr[data-open] > td:nth-child(3) { grid-area:cust; min-width:0; margin-top:8px; }
  #appView .dk-list > tbody > tr[data-open] > td:nth-child(3) .hub-sub { display:inline; margin:0 0 0 6px; }
  #appView .dk-list > tbody > tr[data-open] > td.dk-svc { grid-area:svc; max-width:none; margin-top:4px; color:#6F655A; font-size:13px; line-height:1.45; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
  #appView .dk-list > tbody > tr[data-open] > td:nth-child(5) { display:none; }
  #appView .dk-list > tbody > tr[data-open] > td:nth-child(6) { grid-area:vnd; align-self:end; margin-top:10px; text-align:left; }
  #appView .dk-list > tbody > tr[data-open] > td:nth-child(6)::before { content:"Tổng VNĐ"; display:block; color:#6F655A; font-size:12px; font-weight:500; }
  #appView .dk-list > tbody > tr[data-open] > td:nth-child(6) b { font-size:16px; font-weight:800; }
  #appView .dk-list > tbody > tr[data-open] > td.dk-paidcell { grid-area:paid; display:flex; flex-direction:column; align-items:flex-end; justify-content:flex-end; gap:2px; margin-top:10px; color:#6F655A; font-size:12px; }
  #appView .dk-list td.dk-paidcell > b { order:2; font-size:13px; font-weight:600; color:#25211C; }
  #appView .dk-list td.dk-paidcell > b::before { content:"đã thu "; color:#6F655A; font-weight:500; }
  #appView .dk-list td.dk-paidcell > .hub-sub { order:1; margin:0; }
  #appView .dk-list td.dk-paidcell > .hub-sub + .hub-sub { order:3; }
  #appView .dk-list > tbody > tr[data-open] > td:nth-child(8) { grid-area:sale; align-self:center; margin:10px -12px 0 0; padding:10px 12px 0 0; border-top:1px solid #EFE9DD; color:#6F655A; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  #appView .dk-list > tbody > tr[data-open] > td:nth-child(8) .hub-sub { display:inline; margin-left:4px; }
  #appView .dk-list > tbody > tr[data-open] > td.dk-acts { grid-area:acts; position:static; margin-top:10px; padding:10px 0 0; border-top:1px solid #EFE9DD; box-shadow:none !important; }
  #appView .dk-list button.dk-view { height:36px; min-height:36px; padding:0 14px; }
  #appView .dk-list .dk-acts .ui-more { width:36px; min-width:36px; height:36px; min-height:36px; }
  #appView .dk-list > tbody > tr.dk-exp-row { display:block; margin-top:-4px; }
  #appView .dk-list > tbody > tr.dk-exp-row > td { display:block; padding:0; background:none; }
  #appView .dk-list .dk-exp-box { position:static; width:auto !important; padding:14px; }

  /* Theo dõi thu tiền (tóm tắt phiếu + ô trổ ra): mỗi khoản thu một thẻ */
  #appView .hub-card.dk-receipts { padding:16px; }
  #appView .dk-rc-head > button { height:40px; min-height:40px; }
  #appView :is(.dk-receipts, .dk-exp-box) .tbl-wrap { overflow:visible; border:0; }
  #appView table.dk-rc-table { display:block; min-width:0; }
  #appView .dk-rc-table thead { display:none; }
  #appView .dk-rc-table tbody { display:flex; flex-direction:column; gap:8px; }
  #appView .dk-rc-table tbody tr { display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"amt date" "meth meth" "acc acc" "st st" "act act"; gap:2px 10px; padding:12px; border:1px solid #EFE9DD; border-radius:12px; background:#fff; }
  #appView .dk-rc-table tbody tr.is-rejected { background:#FDF3F2; }
  #appView .dk-rc-table tbody td, #appView .dk-rc-table tbody tr:hover td { display:block; min-width:0 !important; padding:0; border:0; background:none; text-align:left; }
  #appView .dk-rc-table td:nth-child(1) { grid-area:date; color:#6F655A; font-size:13px; text-align:right; }
  #appView .dk-rc-table td:nth-child(2) { grid-area:amt; text-align:left !important; }
  #appView .dk-rc-table td:nth-child(2) b { font-size:16px; }
  #appView .dk-rc-table td:nth-child(3) { grid-area:meth; font-size:13px; }
  #appView .dk-rc-table td:nth-child(3) small, #appView .dk-rc-table td:nth-child(4) small { display:inline; margin-left:6px; }
  #appView .dk-rc-table td:nth-child(4) { grid-area:acc; color:#6F655A; font-size:13px; overflow-wrap:anywhere; }
  #appView .dk-rc-table td:nth-child(5) { grid-area:st; margin-top:6px; }
  #appView .dk-rc-table td.dk-ract { grid-area:act; text-align:right; }
  #appView .dk-rc-table td.dk-ract:empty { display:none; }
  #appView .dk-rc-table td.dk-ract > div { margin-top:6px; }
  #appView .dk-ract button.dk-btn { height:36px; min-height:36px; }

  /* Tóm tắt phiếu: ← · số phiếu · Chi tiết phiếu · ⋯ (Hành trình / Xem trước, In phiếu vào ⋯) */
  #appView .dk-top { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:start; gap:4px 4px; margin:0 0 12px; }
  #appView button.dk-back { grid-row:1; align-self:start; justify-content:center; width:40px; height:40px; min-height:40px; margin-left:-8px; padding:0; gap:0; border-radius:10px; color:#25211C; font-size:0; }
  #appView button.dk-back svg { width:22px; height:22px; }
  #appView .dk-top-row { flex-wrap:wrap; gap:6px 8px; min-width:0; min-height:40px; }
  #appView .dk-top-row h1 { flex:1 1 100%; min-width:0; padding-top:7px; font-size:17px; font-weight:800; letter-spacing:-.2px; line-height:1.3; }
  #appView .dk-top-row > .tag { order:2; }
  #appView .dk-top-row > .dk-top-gap { display:none; }
  #appView .dk-top-acts { order:3; flex-wrap:nowrap; gap:8px; margin-left:auto; }
  #appView .dk-top-acts > button:not(.primary):not(.ui-more) { display:none; }
  #appView .dk-top-acts > button.primary { padding:0 14px; }
  #appView .dk-top-sub { grid-column:1 / -1; font-size:13px; }
  #appView .dk-banner { margin-bottom:12px; }
  #appView .hub-card.dk-sum { padding:16px; margin-bottom:12px; }
  #appView .dk-sum-head { flex-direction:column; gap:8px; padding-bottom:12px; margin-bottom:12px; }
  #appView .dk-sum-total { text-align:left; }
  #appView .dk-sum-total b { font-size:24px; }
  #appView .dk-facts { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 14px; }
  #appView .dk-fact:first-child { grid-column:1 / -1; }
  #appView .dk-fact b { overflow-wrap:anywhere; }
  /* bảng dịch vụ của phiếu → thẻ: tên cả hàng, SL · đơn giá · sau giảm USD · VNĐ thành lưới 2 cột */
  #appView .dk-sum .tbl-wrap { overflow:visible; border:0; }
  #appView table.dk-sum-table { display:block; min-width:0; }
  #appView .dk-sum-table thead { display:none; }
  #appView .dk-sum-table tbody { display:flex; flex-direction:column; gap:8px; }
  #appView .dk-sum-table tbody tr { display:grid; grid-template-columns:24px minmax(0,1fr) minmax(0,1fr); gap:6px 10px; padding:12px; border:1px solid #EFE9DD; border-radius:12px; background:#fff; }
  #appView .dk-sum-table tbody td, #appView .dk-sum-table tbody tr:hover td { display:block; min-width:0; padding:0; border:0; background:none; text-align:left; font-size:13px; }
  #appView .dk-sum-table tbody td.c { width:auto; color:#6F655A; font-weight:700; }
  #appView .dk-sum-table tbody td:nth-child(2) { grid-column:2 / -1; font-size:14px; overflow-wrap:anywhere; }
  #appView .dk-sum-table tbody td:nth-child(3) { grid-column:2; }
  #appView .dk-sum-table tbody td:nth-child(5) { grid-column:2; }
  #appView .dk-sum-table tbody td.r { white-space:normal; text-align:left; }
  #appView .dk-sum-table tbody td:nth-child(n+3)::before { display:block; color:#6F655A; font-size:12px; font-weight:500; }
  #appView .dk-sum-table tbody td:nth-child(3)::before { content:"SL"; }
  #appView .dk-sum-table tbody td:nth-child(4)::before { content:"Đơn giá"; }
  #appView .dk-sum-table tbody td:nth-child(5)::before { content:"Sau giảm (USD)"; }
  #appView .dk-sum-table tbody td:nth-child(6)::before { content:"Sau giảm (VNĐ)"; }
  #appView .dk-sum-table tfoot { display:block; margin-top:8px; }
  #appView .dk-sum-table tfoot tr { display:flex; align-items:baseline; gap:12px; padding:10px 12px; border-radius:12px; background:#FAF7F2; }
  #appView .dk-sum-table tfoot td { display:block; padding:0; border:0; background:none; }
  #appView .dk-sum-table tfoot td:first-child { flex:1 1 auto; }
  #appView .dk-sum-pays ul { flex-direction:column; }
  #appView .dk-sum-pays li { justify-content:space-between; }
  #appView #dkHistory.hub-card { margin-top:12px; padding:16px; }

  /* Lập / sửa phiếu: khối 1 cột, ô nhập 16px cao 44, mỗi dòng dịch vụ / quà / đợt thanh toán một thẻ */
  #appView .dk-paper > .hh-fs { gap:12px; }
  #appView .hub-card.dk-sec { gap:12px; padding:16px; }
  #appView .dk-sec-head { gap:10px; }
  #appView .dk-sec-head .dk-addbtn { height:40px; min-height:40px; }
  /* Màn hẹp: ô tìm xuống dòng riêng dưới tiêu đề + nút */
  #appView .dk-sec-head.has-mid { display:flex; flex-wrap:wrap; }
  #appView .dk-sec-head.has-mid h2 { flex:1 1 0; min-width:0; white-space:normal; }
  #appView .dk-sec-head .dk-add { order:3; flex:1 0 100%; }
  #appView .dk-paper .hh-grid, #appView .hh-grid.dk-row1, #appView .hh-grid.dk-cust { grid-template-columns:minmax(0,1fr); gap:12px; }
  #appView .dk-paper .hh-f > label { white-space:normal; }
  #appView .dk-paper .hh-f input, #appView .dk-paper .hh-f select, #appView .dk-rate button { height:44px; min-height:44px; font-size:16px; }
  #appView .hh-ac.dk-add-box { max-width:none; height:44px; }
  #appView .hh-ac.dk-add-box > input[type="search"] { height:42px; font-size:16px; }
  #appView .hh-ac-pop.dk-pick { min-width:0; max-width:calc(100vw - 24px); }
  #appView .dk-sec .tbl-wrap { overflow:visible; border:0; border-radius:0; }
  #appView table.dk-lines, #appView table.dk-gifts, #appView table.dk-pays { display:block; width:100%; min-width:0; table-layout:auto; }
  #appView .dk-lines colgroup, #appView .dk-lines thead { display:none; }
  #appView .dk-lines tbody { display:flex; flex-direction:column; gap:8px; }
  #appView .dk-lines tbody tr[data-i], #appView .dk-lines tbody tr[data-g], #appView .dk-lines tbody tr[data-p] { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px; padding:12px; border:1px solid #EFE9DD; border-radius:12px; background:#fff; }
  #appView .dk-lines tbody td, #appView .dk-lines tfoot td { display:block; min-width:0; padding:0 !important; border:0; background:none; }
  #appView .dk-lines td input, #appView .dk-lines td select, #appView .dk-lines td textarea, #appView .dk-lines td > select, #appView .dk-lines td > input, #appView .dk-lines td .hh-vnd input, #appView .dk-lines td .dk-pct input { height:44px; min-height:44px; font-size:16px; }
  #appView .dk-lines td textarea { height:auto; }
  #appView .dk-lines .dk-grpsel { height:36px; min-height:36px; font-size:14px; }
  #appView .dk-rest { height:44px; }
  #appView .dk-lines tbody td:first-child { align-self:center; color:#6F655A; font-size:13px; font-weight:700; }
  #appView .dk-lines tbody td.dk-name, #appView .dk-pays tbody td:nth-child(2) { grid-column:2 / 6; }
  #appView .dk-lines tbody td:first-child { grid-column:1; grid-row:1; }
  #appView .dk-lines tbody td:last-child { grid-column:6; grid-row:1; display:flex; align-items:flex-start; justify-content:flex-end; }
  #appView .dk-x { width:40px; height:40px; min-height:40px; font-size:16px; }
  #appView .dk-lines tr[data-i] td:nth-child(3), #appView .dk-lines tr[data-g] td:nth-child(3) { grid-column:1 / 3; }
  #appView .dk-lines tr[data-i] td:nth-child(4), #appView .dk-lines tr[data-g] td:nth-child(4) { grid-column:3 / 5; }
  #appView .dk-lines tr[data-i] td:nth-child(5), #appView .dk-lines tr[data-g] td:nth-child(5) { grid-column:5 / 7; }
  #appView .dk-lines tr[data-i] td:nth-child(6) { grid-column:1 / 3; }
  #appView .dk-lines tr[data-i] td:nth-child(7) { grid-column:3 / 5; }
  #appView .dk-lines tr[data-i] td:nth-child(8) { grid-column:5 / 7; }
  #appView .dk-lines tr[data-i] td:nth-child(9), #appView .dk-lines tr[data-g] td:nth-child(6) { grid-column:1 / 4; }
  #appView .dk-lines tr[data-i] td:nth-child(10), #appView .dk-lines tr[data-g] td:nth-child(7) { grid-column:4 / 7; }
  #appView .dk-pays tr[data-p] td:nth-child(3) { grid-column:1 / 4; }
  #appView .dk-pays tr[data-p] td:nth-child(4) { grid-column:4 / 7; }
  #appView .dk-pays tr[data-p] td:nth-child(5) { grid-column:1 / 6; }
  #appView .dk-lines tbody td.m, #appView .dk-lines tbody td.r { align-self:start; text-align:left; white-space:normal; }
  #appView .dk-lines tr:is([data-i], [data-g], [data-p]) td:not(:first-child):not(:last-child):not(.dk-name)::before { display:block; margin-bottom:4px; color:#6F655A; font-size:12px; font-weight:600; }
  #appView .dk-lines tr:is([data-i], [data-g]) td:nth-child(3)::before { content:"Đơn vị"; }
  #appView .dk-lines tr:is([data-i], [data-g]) td:nth-child(4)::before { content:"Đơn giá"; }
  #appView .dk-lines tr:is([data-i], [data-g]) td:nth-child(5)::before { content:"SL"; }
  #appView .dk-lines tr[data-i] td:nth-child(6)::before { content:"Thành tiền"; }
  #appView .dk-lines tr[data-i] td:nth-child(7)::before { content:"Giảm %"; }
  #appView .dk-lines tr[data-i] td:nth-child(8)::before { content:"Tiền giảm"; }
  #appView .dk-lines tr[data-i] td:nth-child(9)::before { content:"Sau giảm (USD)"; }
  #appView .dk-lines tr[data-i] td:nth-child(10)::before { content:"Sau giảm (VNĐ)"; }
  #appView .dk-lines tr[data-g] td:nth-child(6)::before { content:"Giá trị (USD)"; }
  #appView .dk-lines tr[data-g] td:nth-child(7)::before { content:"Giá trị (VNĐ)"; }
  #appView .dk-pays tr[data-p] td:nth-child(2)::before { content:none; }
  #appView .dk-pays tr[data-p] td:nth-child(3)::before { content:"Cách tính"; }
  #appView .dk-pays tr[data-p] td:nth-child(4)::before { content:"Giá trị"; }
  #appView .dk-pays tr[data-p] td:nth-child(5)::before { content:"Số tiền (VNĐ)"; }
  #appView .dk-lines tr.dk-grp { display:flex; gap:8px; margin-top:4px; padding:8px 12px; border-radius:10px; background:#FAF7F2; }
  #appView .dk-lines tr.dk-grp td { display:block; padding:0 !important; background:none; }
  #appView .dk-lines tfoot { display:block; margin-top:8px; }
  #appView .dk-lines tfoot tr { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; padding:10px 12px; border-radius:12px; background:#FAF7F2; }
  #appView .dk-lines tfoot td:empty { display:none; }
  #appView .dk-lines tfoot td:first-child { flex:1 1 100%; text-align:left; }
  #appView #dkPays .dk-quick button { height:40px; min-height:40px; }
  #appView .dk-total { flex-direction:column; gap:8px; margin-bottom:12px; }
  #appView .dk-total > div, #appView .dk-total > div:nth-child(2) { flex:0 0 auto; min-width:0; padding:12px 14px; }
  #appView .dk-total b { font-size:22px; }
  #appView #dkNotes { font-size:16px; }
  #appView .dk-check { align-items:flex-start; min-height:44px; }
  #appView .dk-check input { flex:0 0 auto; margin-top:2px; }
  /* Chân cố định nằm trên thanh tab nổi: Hủy · ⋯ (Xem trước, Lưu và in, Xuất PDF…) · Lưu phiếu */
  #appView .dk-foot { bottom:calc(76px + env(safe-area-inset-bottom, 0px)); flex-wrap:nowrap; gap:8px; margin:12px -4px 0; padding:10px 12px; border:1px solid #EFE9DD; border-radius:16px; box-shadow:0 8px 24px #392e221f; }
  #appView .dk-foot > .dk-top-gap, #appView .dk-foot > #dkPreview { display:none; }
  #appView .dk-foot > button:not(.ui-more) { flex:1 1 0; justify-content:center; min-width:0; height:44px; min-height:44px; padding:0 12px; }
  #appView .dk-foot > button.primary { flex:1.6 1 0; padding:0 12px; }
  #appView .dk-foot .ui-more.is-lg { width:44px; min-width:44px; height:44px; min-height:44px; }
}
/* Hộp thoại ở điện thoại: rộng hết màn, bo trên 16, che thanh tab; bảng khoản thu chờ → thẻ; ô nhập 16px */
@media screen and (max-width:900px) {
  .dk-ovl:not(.dk-cmp) { align-items:flex-end; padding:0; }
  .dk-rq-card, .dk-rq-card.dk-pm-card, .dk-imp-card { width:100%; max-height:calc(100dvh - 24px); border-radius:16px 16px 0 0; }
  .dk-rq-head { padding:12px 16px; }
  .dk-ovl button.dk-close { width:40px; height:40px; min-height:40px; }
  .dk-rq-body { padding:12px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .dk-rq > .dk-rq-card .dk-rq-table { display:block; min-width:0; }
  .dk-rq > .dk-rq-card .dk-rq-table thead { display:none; }
  .dk-rq > .dk-rq-card .dk-rq-table tbody { display:flex; flex-direction:column; gap:8px; }
  .dk-rq > .dk-rq-card .dk-rq-table tbody tr { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 10px; padding:12px; border:1px solid #EFE9DD; border-radius:12px; }
  .dk-rq > .dk-rq-card .dk-rq-table td { display:block; min-width:0; padding:0; border:0; text-align:left; font-size:13px; }
  .dk-rq > .dk-rq-card .dk-rq-table td:nth-child(1) { grid-column:2; grid-row:2; color:#6F655A; text-align:right; }
  .dk-rq > .dk-rq-card .dk-rq-table td:nth-child(2) { grid-column:1; grid-row:1; font-size:14px; overflow-wrap:anywhere; }
  .dk-rq > .dk-rq-card .dk-rq-table td:nth-child(3) { grid-column:1; grid-row:2; color:#6F655A; }
  .dk-rq > .dk-rq-card .dk-rq-table td:nth-child(4) { grid-column:2; grid-row:1; text-align:right; font-size:15px; }
  .dk-rq > .dk-rq-card .dk-rq-table td:nth-child(5), .dk-rq > .dk-rq-card .dk-rq-table td:nth-child(6), .dk-rq > .dk-rq-card .dk-rq-table td:nth-child(7) { grid-column:1 / -1; }
  .dk-rq > .dk-rq-card .dk-rq-table td:nth-child(5) small, .dk-rq > .dk-rq-card .dk-rq-table td:nth-child(6) small, .dk-rq > .dk-rq-card .dk-rq-table td:nth-child(7) small:not(.dk-bad) { display:inline; margin-left:6px; }
  .dk-rq > .dk-rq-card .dk-rq-table td:nth-child(8) { grid-column:1 / -1; text-align:right; }
  .dk-rq > .dk-rq-card .dk-rq-table td:nth-child(8) button.dk-btn { height:40px; min-height:40px; padding:0 16px; }
  .dk-ovl input:not([type="checkbox"]):not([type="file"]), .dk-ovl select, .dk-ovl textarea { font-size:16px; }
  .dk-pm-bar input[type="search"] { flex:1 1 100%; max-width:none; height:44px; }
  .dk-cmp-acts button.dk-btn { flex:1 1 auto; height:44px; min-height:44px; }
  .dk-cmp-side { padding:16px 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
  /* Ghi nhận / sửa khoản thu: tấm trượt từ đáy, thân cuộn, chân Hủy + nút đặc */
  dialog.ot-pop.dk-rc-dlg { width:100%; max-width:100%; max-height:calc(100dvh - 24px); margin:auto 0 0; border-width:1px 0 0; border-radius:16px 16px 0 0; }
  .dk-rc-dlg form { display:flex; flex-direction:column; max-height:calc(100dvh - 24px); }
  .dk-rc-dlg header { flex:0 0 auto; padding:14px 16px; }
  .dk-rc-dlg .dk-rc-grid { flex:1 1 auto; min-height:0; overflow:auto; grid-template-columns:minmax(0,1fr); gap:12px; padding:14px 16px; }
  .dk-rc-dlg .dk-rc-grid input, .dk-rc-dlg .dk-rc-grid select { height:44px; min-height:44px; font-size:16px; }
  .dk-rc-dlg #rcErr { margin:0 16px 10px; }
  .dk-rc-dlg .btn-row { flex:0 0 auto; gap:8px; padding:12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .dk-rc-dlg .btn-row button { flex:1 1 0; min-width:0; height:auto; min-height:44px; padding:8px 12px; line-height:1.3; white-space:normal; }
  .dk-rc-dlg .btn-row button.primary { flex:2 1 0; }
}

/* ===== MOBILE 11/2026 (≤ 760px) — docs/MOBILE-UI-SPEC.md ===== */
@media screen and (max-width: 760px) {
  /* ---------- Danh sách phiếu: thẻ 3 tầng (số phiếu + ngày · khách · dịch vụ · tiền phải · Sale + nút) ---------- */
  body.sales-shell #appView .dk-bar .dk-search { height:46px; border-radius:12px; }
  body.sales-shell #appView .dk-bar .dk-search input[type="search"] { height:44px; min-height:0; border:0; box-shadow:none !important; }
  body.sales-shell #appView .dk-bar .dk-month { height:36px; border-radius:18px; }
  body.sales-shell #appView .dk-bar select.dk-chipsel { height:36px; min-height:36px; padding:0 30px 0 14px; border:1px solid var(--m-line); border-radius:18px; background-color:#fff; font-size:14px; font-weight:600; }
  body.sales-shell #appView .dk-bar select.dk-chipsel.is-on { background-color:var(--m-accent-wash); border-color:#E3C79E; color:#6E4A1C; }
  body.sales-shell #appView .dk-strip { gap:8px; padding:0; border:0; background:none; }
  body.sales-shell #appView .dk-strip > div { padding:12px; border:0 !important; border-radius:12px; background:var(--m-wash); }
  body.sales-shell #appView .dk-strip > div:nth-child(5) { grid-column:auto; }
  body.sales-shell #appView .dk-strip b { font-size:18px; font-weight:800; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] { grid-template-areas:"no date" "cust cust" "svc svc" "paid vnd" "sale acts"; padding:14px; border-color:var(--m-line); border-radius:14px; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open]:hover { background:#fff; }
  body.sales-shell #appView .dk-list > tbody > tr.is-open, body.sales-shell #appView .dk-list > tbody > tr.is-open:hover { background:#fff; border-color:#C9A877; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(1) { padding-top:2px; font-size:12px; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(2) .hub-sub { font-size:12px; }
  body.sales-shell #appView .dk-list td:nth-child(2) strong { font-size:14.5px; letter-spacing:-.2px; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(3) { margin-top:6px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(3) strong { font-size:14px; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td.dk-svc { margin-top:2px; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(6) { align-self:end; text-align:right; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(6)::before { content:"Tổng VNĐ"; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td.dk-paidcell { align-items:flex-start; justify-content:flex-end; }
  body.sales-shell #appView .dk-list td.dk-paidcell > .hub-sub .tag { font-size:12px; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(8) { align-self:stretch; display:flex !important; align-items:center; margin-right:-12px; padding-right:20px; border-top-color:var(--m-line-soft); }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(8) .hub-sub { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td.dk-acts { display:flex; align-items:center; justify-content:flex-end; gap:6px; border-top-color:var(--m-line-soft); }
  body.sales-shell #appView .dk-list button.dk-view { height:36px; min-height:36px; border-radius:10px; font-size:13px; }
  body.sales-shell #appView .dk-list .dk-acts .ui-more { width:40px; min-width:40px; height:36px; min-height:36px; }
  body.sales-shell #appView .dk-list .dk-exp-box { border-color:var(--m-line); border-radius:14px; }
  body.sales-shell #appView .dk-queue { border-radius:14px; }
  body.sales-shell #appView .dk-queue > button { height:40px; min-height:40px; border-radius:12px; }

  /* ---------- Đầu màn tóm tắt / lập phiếu: ← · tiêu đề · chip cùng hàng ---------- */
  body.sales-shell #appView .dk-top { gap:2px 6px; }
  body.sales-shell #appView button.dk-back { margin-left:-6px; border-radius:20px; }
  body.sales-shell #appView .dk-top-row h1 { flex:0 1 auto; max-width:100%; padding-top:8px; font-size:18px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  body.sales-shell #appView .dk-top-row > .tag { order:1; align-self:center; margin-top:6px; }
  body.sales-shell #appView .dk-top-acts { flex:1 1 auto; justify-content:flex-end; }
  body.sales-shell #appView .dk-top-acts > button.primary { height:40px; min-height:40px; border-radius:12px; }

  /* ---------- Tóm tắt phiếu: một lớp thẻ, các dòng bên trong phân cách bằng kẻ mảnh ---------- */
  body.sales-shell #appView .hub-card.dk-sum, body.sales-shell #appView .hub-card.dk-receipts, body.sales-shell #appView #dkHistory.hub-card { padding:14px; border:1px solid var(--m-line); border-radius:14px; }
  body.sales-shell #appView .dk-sum-head { border-bottom-color:var(--m-line-soft); }
  body.sales-shell #appView .dk-sum-table tbody { gap:0; }
  body.sales-shell #appView .dk-sum-table tbody tr { padding:12px 0; border:0; border-top:1px solid var(--m-line-soft); border-radius:0; }
  body.sales-shell #appView .dk-sum-table tbody td:nth-child(6) { font-weight:700; }
  body.sales-shell #appView .dk-sum-table tfoot tr { background:var(--m-wash); }
  body.sales-shell #appView .dk-sum-table tfoot td:nth-child(2) { color:var(--m-sub); font-size:13px; }
  body.sales-shell #appView .dk-sum-table tfoot td:nth-child(2)::after { content:" USD"; }
  body.sales-shell #appView .dk-sum-table tfoot td:nth-child(3)::after { content:" đ"; font-weight:600; }
  body.sales-shell #appView .dk-sum-pays li { border-color:var(--m-line-soft); }
  body.sales-shell #appView .dk-rc-stats { gap:8px; padding:0; border:0; background:none; }
  body.sales-shell #appView .dk-rc-stats .dk-rc-stat { padding:10px 12px; border:0 !important; border-radius:12px; background:var(--m-wash); }
  body.sales-shell #appView .dk-rc-table tbody { gap:0; }
  body.sales-shell #appView .dk-rc-table tbody tr { padding:12px 0; border:0; border-top:1px solid var(--m-line-soft); border-radius:0; background:none; }
  body.sales-shell #appView .dk-rc-table tbody tr.is-rejected { background:none; }
  body.sales-shell #appView .dk-rc-table td.dk-ract > div { display:flex; justify-content:flex-end; gap:6px; }
  body.sales-shell #appView .dk-ract button.dk-btn { height:40px; min-height:40px; border-radius:12px; }
  body.sales-shell #appView .dk-rc-head > button { border-radius:12px; }

  /* ---------- Lập / sửa phiếu: khối phẳng (tiêu đề + khoảng trắng), dòng dịch vụ / quà / đợt là thẻ duy nhất ---------- */
  body.sales-shell #appView .dk-paper > .hh-fs { gap:0; }
  body.sales-shell #appView .dk-paper .hub-card.dk-sec { gap:12px; padding:20px 0; border:0; border-top:1px solid var(--m-line-soft); border-radius:0; background:none; box-shadow:none; }
  body.sales-shell #appView .dk-paper .hub-card.dk-sec:first-child { padding-top:4px; border-top:0; }
  body.sales-shell #appView .dk-paper .hub-card.dk-sec.is-missing { box-shadow:none; }
  body.sales-shell #appView .dk-sec-head.has-mid { align-items:center; }
  body.sales-shell #appView .dk-sec-head h2 { font-size:15px; font-weight:700; line-height:1.3; }
  body.sales-shell #appView .dk-sec-head .dk-addbtn { height:40px; min-height:40px; padding:0 12px; border-color:var(--m-line); border-radius:12px; font-size:13px; }
  body.sales-shell #appView .hh-ac.dk-add-box { height:46px; padding:0 14px; border-color:var(--m-line); border-radius:12px; }
  body.sales-shell #appView .hh-ac.dk-add-box > input[type="search"] { height:44px; min-height:0; border:0 !important; box-shadow:none !important; text-overflow:ellipsis; }
  body.sales-shell #appView .dk-sec .srp-empty.dk-empty { min-height:52px; border-color:var(--m-line); background:#fff; font-size:13px; }
  body.sales-shell #appView .dk-paper .hh-f :is(input, select) { height:46px; min-height:46px; }
  body.sales-shell #appView .dk-rate button { height:46px; min-height:46px; border-radius:12px; }
  body.sales-shell #appView .dk-paper .hh-ac-info { font-size:12px; }

  /* thẻ dòng: lưới 6 cột — tên + ✕ · 3 ô nhập · 3 ô (ô nhập / số tự tính cùng cao) · chân: Sau giảm USD | VNĐ (đậm, căn phải) */
  body.sales-shell #appView .dk-lines tbody { gap:10px; }
  body.sales-shell #appView .dk-lines tbody tr:is([data-i], [data-g], [data-p]) { grid-template-columns:repeat(6, minmax(0, 1fr)); gap:10px 8px; padding:12px; border:1px solid var(--m-line); border-radius:14px; }
  body.sales-shell #appView .dk-lines tbody tr:is([data-i], [data-g], [data-p]) > td:first-child { display:none; }
  body.sales-shell #appView .dk-lines tbody tr:is([data-i], [data-g], [data-p]) > td.dk-name,
  body.sales-shell #appView .dk-pays tbody tr[data-p] > td:nth-child(2) { grid-column:1 / 6; grid-row:1; }
  body.sales-shell #appView .dk-lines tbody tr:is([data-i], [data-g], [data-p]) > td:last-child { grid-column:6; grid-row:1; align-items:flex-start; justify-content:flex-end; }
  body.sales-shell #appView .dk-x { width:40px; height:40px; min-height:40px; margin:3px -4px 0 0; border-radius:12px; color:var(--m-sub); font-size:15px; }
  body.sales-shell #appView .dk-lines td textarea { min-height:46px; max-height:190px; padding:11px 12px; font-size:15px; line-height:1.4; resize:none; field-sizing:content; }
  body.sales-shell #appView .dk-lines .dk-grpsel { height:36px; min-height:36px; margin-bottom:6px; font-size:13px; }
  body.sales-shell #appView .dk-lines td :is(input, select), body.sales-shell #appView .dk-lines td .hh-vnd input, body.sales-shell #appView .dk-lines td .dk-pct input { height:46px; min-height:46px; font-size:16px; }
  body.sales-shell #appView .dk-lines td select[data-f="unit"] { padding-left:12px; }
  body.sales-shell #appView .dk-lines td.m:not(.dk-name) { color:var(--m-ink); font-size:14px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  body.sales-shell #appView .dk-lines td.m small { font-size:12px; }
  body.sales-shell #appView .dk-lines tr:is([data-i], [data-g], [data-p]) td:not(:first-child):not(:last-child):not(.dk-name)::before { margin-bottom:5px; font-size:12px; font-weight:600; line-height:1.2; white-space:nowrap; }
  /* dòng dịch vụ: hàng 2 Đơn vị · Đơn giá · SL; hàng 3 Giảm % · Thành tiền · Tiền giảm; chân Sau giảm */
  body.sales-shell #appView .dk-lines tr[data-i] td:nth-child(3), body.sales-shell #appView .dk-lines tr[data-g] td:nth-child(3) { grid-column:1 / 3; grid-row:2; }
  body.sales-shell #appView .dk-lines tr[data-i] td:nth-child(4), body.sales-shell #appView .dk-lines tr[data-g] td:nth-child(4) { grid-column:3 / 5; grid-row:2; }
  body.sales-shell #appView .dk-lines tr[data-i] td:nth-child(5), body.sales-shell #appView .dk-lines tr[data-g] td:nth-child(5) { grid-column:5 / 7; grid-row:2; }
  body.sales-shell #appView .dk-lines tr[data-i] td:nth-child(7) { grid-column:1 / 3; grid-row:3; }
  body.sales-shell #appView .dk-lines tr[data-i] td:nth-child(6) { grid-column:3 / 5; grid-row:3; }
  body.sales-shell #appView .dk-lines tr[data-i] td:nth-child(8) { grid-column:5 / 7; grid-row:3; }
  body.sales-shell #appView .dk-lines tr[data-i] td:is(:nth-child(6), :nth-child(8)) { line-height:46px; text-align:left; }
  body.sales-shell #appView .dk-lines tr[data-i] td:nth-child(8):empty::after { content:"—"; color:var(--m-faint); font-weight:500; }
  body.sales-shell #appView .dk-lines td.m .dk-under { margin-top:-12px; color:var(--m-sub); font-weight:500; line-height:1.2; }
  /* chân thẻ: số tiền sau giảm */
  body.sales-shell #appView .dk-lines tr[data-i] td:nth-child(9), body.sales-shell #appView .dk-lines tr[data-g] td:nth-child(6) { grid-column:1 / 4; grid-row:4; align-self:stretch; margin:0 -12px -12px; padding:10px 12px 12px !important; border-top:1px solid var(--m-line-soft); border-radius:0 0 0 14px; background:var(--m-wash); font-weight:600; text-align:left; }
  body.sales-shell #appView .dk-lines tr[data-i] td:nth-child(10), body.sales-shell #appView .dk-lines tr[data-g] td:nth-child(7) { grid-column:4 / 7; grid-row:4; align-self:stretch; margin:0 -12px -12px; padding:10px 12px 12px !important; border-top:1px solid var(--m-line-soft); border-radius:0 0 14px 0; background:var(--m-wash); text-align:right; font-size:16px; font-weight:800; }
  body.sales-shell #appView .dk-lines tr[data-g] td:nth-child(6), body.sales-shell #appView .dk-lines tr[data-g] td:nth-child(7) { grid-row:3; }
  body.sales-shell #appView .dk-lines tr[data-i] td:nth-child(9)::before, body.sales-shell #appView .dk-lines tr[data-i] td:nth-child(10)::before,
  body.sales-shell #appView .dk-lines tr[data-g] td:nth-child(6)::before, body.sales-shell #appView .dk-lines tr[data-g] td:nth-child(7)::before { font-weight:600; }
  body.sales-shell #appView .dk-lines tr[data-i] td:nth-child(9)::before { content:"Sau giảm (USD)"; }
  body.sales-shell #appView .dk-lines tr[data-i] td:nth-child(10)::before { content:"Sau giảm (VNĐ)"; }
  /* đợt thanh toán: tên đợt cả hàng · Cách tính | Giá trị · chân Số tiền */
  body.sales-shell #appView .dk-pays tr[data-p] td:nth-child(3) { grid-column:1 / 4; grid-row:2; }
  body.sales-shell #appView .dk-pays tr[data-p] td:nth-child(4) { grid-column:4 / 7; grid-row:2; }
  body.sales-shell #appView .dk-pays tr[data-p] td:nth-child(5) { grid-column:1 / 7; grid-row:3; display:flex; align-items:baseline; justify-content:space-between; margin:0 -12px -12px; padding:10px 12px 12px !important; border-top:1px solid var(--m-line-soft); border-radius:0 0 14px 14px; background:var(--m-wash); font-size:16px; font-weight:800; }
  body.sales-shell #appView .dk-pays tr[data-p] td:nth-child(5)::before { margin:0; color:var(--m-sub); font-size:13px; }
  body.sales-shell #appView .dk-pays tr[data-p] td:nth-child(5)::before { content:"Số tiền"; }
  body.sales-shell #appView .dk-rest { height:46px; padding:0 12px; border-radius:12px; font-size:15px; }
  body.sales-shell #appView .dk-pct span, body.sales-shell #appView .dk-lines .hh-vnd span { right:12px; font-size:14px; }
  body.sales-shell #appView .dk-pct input { padding-right:30px !important; }
  /* nhóm dịch vụ: nhãn nhỏ chữ đồng, không khung */
  body.sales-shell #appView .dk-lines tr.dk-grp { margin:6px 0 -2px; padding:0 2px; border-radius:0; background:none; }
  body.sales-shell #appView .dk-lines tr.dk-grp:first-child { margin-top:0; }
  body.sales-shell #appView .dk-lines tr.dk-grp td { color:var(--m-accent); font-size:12px; font-weight:800; letter-spacing:.2px; }
  /* dòng tổng của bảng → các cặp nhãn | số */
  body.sales-shell #appView .dk-lines tfoot tr { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px 12px; padding:12px 14px; border-radius:12px; background:var(--m-wash); }
  body.sales-shell #appView .dk-lines tfoot td { display:contents; font-size:14px; }
  body.sales-shell #appView .dk-lines tfoot td:first-child { display:block; grid-column:1 / -1; font-size:14px; font-weight:800; text-align:left; }
  body.sales-shell #appView .dk-lines tfoot td.m { display:block; grid-column:1 / -1; font-weight:700; text-align:right; }
  body.sales-shell #appView .dk-lines tfoot td.m:empty { display:none; }
  body.sales-shell #appView .dk-lines tfoot td.m::before { float:left; color:var(--m-sub); font-size:13px; font-weight:500; line-height:1.6; }
  body.sales-shell #appView #dkTGross::before { content:"Thành tiền"; }
  body.sales-shell #appView #dkTDisc::before { content:"Tiền giảm"; }
  body.sales-shell #appView #dkTUsd::before { content:"Sau giảm (USD)"; }
  body.sales-shell #appView #dkTVnd::before { content:"Sau giảm (VNĐ)"; }
  body.sales-shell #appView #dkGTotalUsd::before { content:"Giá trị (USD)"; }
  body.sales-shell #appView #dkGTotalVnd::before { content:"Giá trị (VNĐ)"; }
  body.sales-shell #appView :is(#dkTVnd, #dkGTotalVnd) { font-size:16px; font-weight:800 !important; }
  body.sales-shell #appView #dkPays .dk-quick { margin-top:10px; }
  body.sales-shell #appView #dkPays .dk-quick button, body.sales-shell #appView #dkAddPay { width:100%; height:44px; min-height:44px; justify-content:center; border-style:dashed; border-color:var(--m-line); border-radius:12px; font-size:14px; }
  /* tổng chi phí: 2 ô số cạnh nhau, quà tặng cả hàng */
  body.sales-shell #appView .dk-total { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:8px; margin:0 0 4px; }
  body.sales-shell #appView .dk-total > div, body.sales-shell #appView .dk-total > div:nth-child(2) { padding:12px; border-radius:12px; background:var(--m-wash); }
  body.sales-shell #appView .dk-total > div:nth-child(2) { grid-column:1 / -1; order:-1; }
  body.sales-shell #appView .dk-total > div.dk-gift-sum { grid-column:auto; }
  body.sales-shell #appView .dk-total > div:first-child:nth-last-child(2) { grid-column:1 / -1; }
  body.sales-shell #appView .dk-total span { font-size:12px; }
  body.sales-shell #appView .dk-total b { font-size:20px; overflow-wrap:anywhere; }
  body.sales-shell #appView .dk-total > div:nth-child(2) b { font-size:24px; }
  body.sales-shell #appView .dk-total > div.dk-gift-sum b { font-size:16px; }
  body.sales-shell #appView #dkNotes { min-height:160px; padding:12px; font-size:15px; }
  body.sales-shell #appView .dk-check { gap:12px; font-size:14px; line-height:1.45; }
  /* lịch sử */
  body.sales-shell #appView .dk-paper ~ #dkHistory.hub-card { margin-top:8px; }
  /* dải đáy (mobile.js đặt dính đáy khi form mở): Hủy gọn · ⋯ · Lưu phiếu chiếm phần lớn */
  body.sales-shell #appView .dk-foot { flex-wrap:nowrap; gap:8px; }
  body.sales-shell #appView .dk-foot > button:not(.ui-more) { flex:0 0 auto; height:46px; min-height:46px; padding:0 18px; border-radius:12px; font-size:15px; }
  body.sales-shell #appView .dk-foot > button.primary { flex:1 1 auto; justify-content:center; }
  body.sales-shell #appView .dk-foot .dk-foot-more { flex:0 0 auto; }
  body.sales-shell #appView .dk-foot .ui-more.is-lg { width:46px; min-width:46px; height:46px; min-height:46px; border-radius:12px; }
  body.sales-shell:not(.m-form) #appView .dk-foot { bottom:calc(var(--m-tabbar) - 4px); }
}
/* Hộp thoại Phiếu ĐKDV ở điện thoại (khoản thu chờ, đối chiếu, quản lý sản phẩm): viền thẻ đồng nhạt, bo 14 */
@media screen and (max-width: 760px) {
  body.sales-shell .dk-rq > .dk-rq-card .dk-rq-table tbody tr { padding:14px; border-color:#E2D6C4; border-radius:14px; }
  body.sales-shell .dk-rq > .dk-rq-card .dk-rq-table td:nth-child(8) button.dk-btn { height:40px; min-height:40px; border-radius:12px; }
  body.sales-shell .dk-cmp-list li { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 10px; padding:10px 12px; border-color:#E2D6C4; border-radius:12px; }
  body.sales-shell .dk-cmp-list li > span:first-child { grid-column:1 / -1; color:#6F655A; font-size:13px; }
  body.sales-shell .dk-cmp-list li > b { font-size:15px; }
  body.sales-shell .dk-cmp-list li > .tag { justify-self:end; }
  body.sales-shell .dk-cmp-acts button.dk-btn { border-radius:12px; }
}

/* ===== 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) {
  /* Dải số: một hộp nền nhạt, kẻ ngăn; hàng 1 Số phiếu | Tổng USD | Tổng VNĐ, hàng 2 Đã thu | Còn phải thu */
  body.sales-shell #appView .dk-strip { display:grid; grid-template-columns:minmax(0,.75fr) minmax(0,1fr) minmax(0,1.55fr); gap:0; margin:0 0 12px; padding:0; border:0; border-radius:12px; background:var(--m-wash); overflow:hidden; }
  body.sales-shell #appView .dk-strip > div, body.sales-shell #appView .dk-strip > div:nth-child(n) { display:flex; flex-direction:column; align-items:flex-start; gap:2px; grid-column:auto; min-width:0; padding:8px 12px; border:0 !important; border-radius:0; background:none; }
  body.sales-shell #appView .dk-strip > div:nth-child(2), body.sales-shell #appView .dk-strip > div:nth-child(3), body.sales-shell #appView .dk-strip > div:nth-child(5) { border-left:1px solid #EADFCF !important; }
  body.sales-shell #appView .dk-strip > div:nth-child(4) { grid-column:1 / 3; border-top:1px solid #EADFCF !important; }
  body.sales-shell #appView .dk-strip > div:nth-child(5) { border-top:1px solid #EADFCF !important; }
  body.sales-shell #appView .dk-strip span { color:var(--m-sub); font-size:12px; font-weight:600; line-height:1.35; white-space:nowrap; }
  body.sales-shell #appView .dk-strip b { font-size:17px; font-weight:800; line-height:1.25; white-space:nowrap; overflow-wrap:normal; }
  /* Hàng chờ khoản thu: tiêu đề + nút một hàng, các khoản 1 dòng "…" */
  body.sales-shell #appView .dk-queue { flex-wrap:wrap; gap:4px 8px; margin:0 0 12px; padding:8px 12px; border-radius:12px; }
  body.sales-shell #appView .dk-queue h2 { flex:1 1 0; font-size:14px; line-height:1.35; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  body.sales-shell #appView .dk-queue > button { height:32px; min-height:32px; padding:0 12px; border-radius:10px; font-size:12px; }
  body.sales-shell #appView .dk-q-list { -webkit-line-clamp:1; font-size:13px; line-height:1.35; }

  /* Thẻ phiếu (≤ 130px): số phiếu + nhãn | ngày · khách · SĐT | tổng VNĐ · dịch vụ "…" | đã thu · trạng thái + Sale | Xem phiếu ⋯ */
  body.sales-shell #appView .dk-list > tbody { gap:8px; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] { grid-template-columns:auto minmax(0,1fr) auto; grid-template-areas:"no no no" "cust cust vnd" "svc svc paid" "chip sale acts"; gap:4px 8px; padding:12px; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td, body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:first-child { margin:0; padding:0; border:0; font-size:14px; line-height:1.35; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(1) { grid-area:no; align-self:center; justify-self:end; padding:0; color:var(--m-sub); font-size:12px; white-space:nowrap; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(2) { display:flex; align-items:center; gap:6px; min-width:0; padding-right:80px; overflow:hidden; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(2) strong { flex:0 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; font-weight:700; letter-spacing:-.1px; overflow-wrap:normal; }
  /* pháp nhân đã nằm trong đuôi số phiếu (…-EVERVN / -BIOISC): ẩn chữ, giữ nhãn Đã hủy / Phiếu cũ */
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(2) .hub-sub { display:inline-flex; flex:0 0 auto; gap:4px; margin:0; font-size:0; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(2) .hub-sub .tag { font-size:12px; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(n) { margin:0; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(3) { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(3) strong { font-size:14px; font-weight:600; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(3) .hub-sub { display:inline; margin:0 0 0 4px; color:var(--m-sub); font-size:13px; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(3) .hub-sub::before { content:"· "; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td.dk-svc { -webkit-line-clamp:1; color:var(--m-sub); font-size:13px; line-height:1.35; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(6) { align-self:center; text-align:right; white-space:nowrap; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(6)::before { content:none; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(6), body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(6) b { font-size:15px; font-weight:800; line-height:1.25; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(6) b::after { content:" đ"; font-size:12px; font-weight:600; color:var(--m-sub); }
  /* ô "Đã thu": số đã thu (phải, hàng 3) + nhãn trạng thái (trái, hàng 4); "chờ XN …" xem ở phần theo dõi thu tiền */
  body.sales-shell #appView .dk-list > tbody > tr[data-open]:not(.is-cancel) > td.dk-paidcell { display:contents; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td.dk-paidcell > b { grid-area:paid; align-self:center; justify-self:end; color:var(--m-sub); font-size:12px; font-weight:600; white-space:nowrap; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td.dk-paidcell > b::before { content:"đã thu "; font-weight:500; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td.dk-paidcell > .hub-sub:first-of-type { grid-area:chip; align-self:center; margin:0; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td.dk-paidcell > .hub-sub:first-of-type .tag { font-size:12px; white-space:nowrap; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td.dk-paidcell > .hub-sub + .hub-sub { display:none; }
  body.sales-shell #appView .dk-list > tbody > tr.is-cancel > td.dk-paidcell { grid-area:paid; display:block; margin:0; text-align:right; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(8) { grid-area:sale; align-self:center; display:block !important; margin:0; padding:0; border:0; color:var(--m-sub); font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td:nth-child(8) .hub-sub { display:none; }
  body.sales-shell #appView .dk-list > tbody > tr[data-open] > td.dk-acts { display:flex; align-items:center; gap:4px; margin:0; padding:0; border:0; }
  body.sales-shell #appView .dk-list button.dk-view { height:32px; min-height:32px; padding:0 10px; border-radius:10px; font-size:12px; }
  body.sales-shell #appView .dk-list .dk-acts .ui-more { width:32px; min-width:32px; height:32px; min-height:32px; border-radius:10px; }

  /* Tóm tắt phiếu: đầu gọn, cặp nhãn | giá trị khít, dòng sản phẩm 2 tầng, quà + lịch thanh toán là danh sách kẻ mảnh */
  body.sales-shell #appView .dk-top { margin:0 0 8px; }
  body.sales-shell #appView .dk-top-sub { font-size:13px; line-height:1.35; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  body.sales-shell #appView .hub-card.dk-sum, body.sales-shell #appView .hub-card.dk-receipts, body.sales-shell #appView #dkHistory.hub-card { padding:12px; margin-bottom:12px; }
  body.sales-shell #appView .dk-sum-head { gap:2px; margin-bottom:8px; padding-bottom:8px; }
  body.sales-shell #appView .dk-sum .dk-sum-head h2 { font-size:15px; }
  body.sales-shell #appView .dk-sum-total span { font-size:12px; font-weight:600; }
  body.sales-shell #appView .dk-sum-total b { font-size:20px; line-height:1.25; }
  body.sales-shell #appView .dk-facts { gap:8px 12px; margin-bottom:8px; }
  body.sales-shell #appView .dk-fact span { margin-bottom:2px; font-size:12px; font-weight:600; line-height:1.35; }
  body.sales-shell #appView .dk-fact b { font-size:14px; font-weight:600; line-height:1.35; }
  body.sales-shell #appView .dk-fact small { margin-top:0; font-size:12px; line-height:1.35; }
  body.sales-shell #appView .dk-sum-table tbody tr { grid-template-columns:auto minmax(0,1fr) auto; gap:2px 6px; padding:8px 0; }
  body.sales-shell #appView .dk-sum-table tbody td:nth-child(n)::before { content:none !important; }
  body.sales-shell #appView .dk-sum-table tbody td.c { display:none; }
  body.sales-shell #appView .dk-sum-table tbody td:nth-child(2) { grid-column:1 / 3; grid-row:1; font-size:14px; line-height:1.35; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
  body.sales-shell #appView .dk-sum-table tbody td:nth-child(2) b { font-weight:600; }
  body.sales-shell #appView .dk-sum-table tbody td:nth-child(2) small { display:none; }
  body.sales-shell #appView .dk-sum-table tbody td:nth-child(6) { grid-column:3; grid-row:1; font-size:14px; text-align:right; white-space:nowrap; }
  body.sales-shell #appView .dk-sum-table tbody td:nth-child(3) { grid-column:1; grid-row:2; color:var(--m-sub); font-size:13px; white-space:nowrap; }
  body.sales-shell #appView .dk-sum-table tbody td:nth-child(3)::after { content:" ×"; }
  body.sales-shell #appView .dk-sum-table tbody td:nth-child(4) { grid-column:2 / 4; grid-row:2; color:var(--m-sub); font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  body.sales-shell #appView .dk-sum-table tbody td:nth-child(4) small { display:inline; margin-left:4px; font-size:12px; }
  body.sales-shell #appView .dk-sum-table tbody td:nth-child(4) small::before { content:"· "; }
  body.sales-shell #appView .dk-sum-table tbody td:nth-child(5) { display:none; }
  body.sales-shell #appView .dk-sum-table tfoot { margin-top:4px; }
  body.sales-shell #appView .dk-sum-table tfoot tr { padding:8px 12px; }
  body.sales-shell #appView .dk-sum-gifts { display:block; margin-top:12px; }
  body.sales-shell #appView .dk-sum-gifts > b { display:block; margin-bottom:4px; font-size:14px; font-weight:700; }
  body.sales-shell #appView .dk-sum-gifts span { display:flex; justify-content:space-between; gap:12px; padding:6px 0; border-top:1px solid var(--m-line-soft); border-radius:0; background:none; font-size:14px; line-height:1.35; }
  body.sales-shell #appView .dk-sum-gifts em { flex:0 0 auto; white-space:nowrap; }
  body.sales-shell #appView .dk-sum-pays { margin-top:12px; }
  body.sales-shell #appView .dk-sum-pays > b { display:block; margin-bottom:4px; font-size:14px; }
  body.sales-shell #appView .dk-sum-pays ul { gap:0; margin:0; }
  body.sales-shell #appView .dk-sum-pays li { gap:12px; padding:6px 0; border:0; border-top:1px solid var(--m-line-soft); border-radius:0; font-size:14px; line-height:1.35; }
  body.sales-shell #appView .dk-sum-pays li b { flex:0 0 auto; white-space:nowrap; }
  /* Theo dõi thu tiền: dải số 2 cột, khoản thu khít */
  body.sales-shell #appView .dk-rc-head { gap:8px; margin-bottom:8px; }
  body.sales-shell #appView .dk-rc-head h2 { font-size:15px; }
  body.sales-shell #appView .dk-rc-head > button { height:36px; min-height:36px; font-size:13px; }
  body.sales-shell #appView .dk-receipts > p, body.sales-shell #appView .dk-receipts .hh-prior { margin:0 0 8px; padding:8px 12px; font-size:13px; line-height:1.35; }
  body.sales-shell #appView .dk-rc-stats { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:0; margin:0 0 8px; padding:0; border-radius:12px; background:var(--m-wash); overflow:hidden; }
  body.sales-shell #appView .dk-rc-stats .dk-rc-stat { gap:2px; padding:8px 12px; border:0 !important; border-radius:0; background:none; }
  body.sales-shell #appView .dk-rc-stats .dk-rc-stat:nth-child(even) { border-left:1px solid #EADFCF !important; }
  body.sales-shell #appView .dk-rc-stats .dk-rc-stat:nth-child(n+3) { border-top:1px solid #EADFCF !important; }
  body.sales-shell #appView .dk-rc-stats .dk-rc-stat span { font-size:12px; font-weight:600; }
  body.sales-shell #appView .dk-rc-stats .dk-rc-stat b { font-size:17px; font-weight:800; }
  body.sales-shell #appView .dk-rc-table tbody tr { gap:2px 10px; padding:8px 0; }
  body.sales-shell #appView .dk-rc-table td:nth-child(2) b { font-size:15px; }
  body.sales-shell #appView .dk-rc-table td:nth-child(5) { margin-top:2px; }
  body.sales-shell #appView .dk-rc-table td.dk-ract > div { margin-top:2px; }
  body.sales-shell #appView .dk-ract button.dk-btn { height:32px; min-height:32px; font-size:13px; }
  body.sales-shell #appView #dkHistory h2 { font-size:15px; }

  /* Lập / sửa phiếu: tiêu đề nhóm trên 16 dưới 8, nhãn 12/600, khoảng giữa ô 10 */
  body.sales-shell #appView .dk-paper .hub-card.dk-sec { gap:8px; padding:16px 0; }
  body.sales-shell #appView .dk-top:has(+ .dk-paper, + .dk-banner) { margin-bottom:12px; }
  body.sales-shell #appView .dk-sec-head .dk-addbtn { height:36px; min-height:36px; margin:0; font-size:12px; }
  body.sales-shell #appView .dk-paper .hub-card.dk-sec:first-child { padding-top:0; }
  body.sales-shell #appView .dk-paper .hh-grid, body.sales-shell #appView .hh-grid.dk-row1, body.sales-shell #appView .hh-grid.dk-cust { gap:10px; }
  body.sales-shell #appView .dk-paper .hh-f > label { margin-bottom:2px; color:var(--m-sub); font-size:12px; font-weight:600; line-height:1.35; }
  body.sales-shell #appView .dk-paper .hh-ac-info { margin-top:2px; line-height:1.35; }
  body.sales-shell #appView .dk-paper .hh-ac-info:empty { display:none; }
  body.sales-shell #appView .dk-lines tbody { gap:8px; }
  body.sales-shell #appView .dk-lines tbody tr:is([data-i], [data-g], [data-p]) { gap:8px 8px; }
  body.sales-shell #appView .dk-lines tr:is([data-i], [data-g], [data-p]) td:not(:first-child):not(:last-child):not(.dk-name)::before { margin-bottom:2px; }
  body.sales-shell #appView .dk-lines tr[data-i] td:nth-child(9), body.sales-shell #appView .dk-lines tr[data-g] td:nth-child(6),
  body.sales-shell #appView .dk-lines tr[data-i] td:nth-child(10), body.sales-shell #appView .dk-lines tr[data-g] td:nth-child(7) { padding:8px 12px !important; font-size:14px; }
  body.sales-shell #appView .dk-lines tr[data-i] td:nth-child(10), body.sales-shell #appView .dk-lines tr[data-g] td:nth-child(7) { font-size:15px; }
  body.sales-shell #appView .dk-pays tr[data-p] td:nth-child(5) { padding:8px 12px !important; font-size:15px; }
  body.sales-shell #appView .dk-lines tfoot tr { gap:2px 12px; padding:8px 12px; }
  body.sales-shell #appView :is(#dkTVnd, #dkGTotalVnd) { font-size:15px; }
  body.sales-shell #appView .dk-total > div, body.sales-shell #appView .dk-total > div:nth-child(2) { padding:8px 12px; }
  body.sales-shell #appView .dk-total span { font-weight:600; }
  body.sales-shell #appView .dk-total b { font-size:17px; }
  body.sales-shell #appView .dk-total > div:nth-child(2) b { font-size:20px; }
  body.sales-shell #appView .dk-total > div.dk-gift-sum b { font-size:15px; }
  body.sales-shell #appView .dk-check { font-size:13px; line-height:1.35; }
}
