/* Trang Visa (visa.js): đầu màn + hàng tab, Tổng hợp (nhịp độ), danh sách hồ sơ, chi tiết hồ sơ, kho visa & hộ chiếu, danh mục, thẻ trong hồ sơ khách. Tiền tố vs-.
   11/2026 theo CRM mới (docs/SALES-DESKTOP-UI-SYNC.md 4.1–4.7, phác thảo VisaOverview / VisaCases / VisaDetail): thẻ phẳng viền #E4DACA, chip trạng thái bo 12, bảng 1 nút + ⋯. */
@media screen {
  /* ---------- Đầu màn (4.1): [← Visa] · h1 · chip · dòng phụ · nút; màn danh sách: h1 · nút tạo / hàng tab ---------- */
  #appView .vs-back { display:inline-flex; align-items:center; gap:6px; justify-self:start; align-self:start; min-height:0; padding:0; border:0; background:none; color:#8A5F27; font:inherit; font-size:13px; font-weight:600; cursor:pointer; box-shadow:none; }
  #appView .vs-back:hover { background:none; color:#6E4A1C; }
  #appView .vs-hd-title { min-width:0; }
  #appView .vs-h1 { display:flex; align-items:center; gap:8px 12px; flex-wrap:wrap; }
  #appView .vs-h1 h1 { margin:0; overflow-wrap:anywhere; }
  #appView .vs-h1 .vs-hcust, #appView .vs-h1 button.vs-hcust { color:#8A5F27; font-size:inherit; font-weight:inherit; letter-spacing:inherit; text-decoration:none; }
  #appView .vs-h1 button.vs-hcust:hover { color:#6E4A1C; text-decoration:underline; text-underline-offset:3px; }
  #appView .vs-hsub { margin-top:4px; color:#6F655A; font-size:13px; }
  #appView .vs-hact { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:8px 12px; }
  #appView button.vs-hbtn { height:40px; min-height:40px; padding:0 16px; border:1px solid #E4DACA; border-radius:10px; background:#fff; color:#25211C; font:inherit; font-size:14px; font-weight:600; white-space:nowrap; cursor:pointer; box-shadow:none; }
  #appView button.vs-hbtn:hover { border-color:#B89F7E; background:#FAF7F2; }
  #appView .vs-hact .primary { height:40px; min-height:40px; padding:0 16px; border-radius:10px; font-size:14px; font-weight:700; white-space:nowrap; }
  #appView .vs-hact .primary.is-off { opacity:.5; cursor:not-allowed; }
  #appView .hub-heading.vs-hd-d { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px 16px; }
  #appView .vs-hd-d .vs-back { grid-column:1 / -1; }
  #appView .hub-heading.vs-hd { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:16px 12px; }
  #appView .vs-hd .vs-new { display:inline-flex; align-items:center; gap:8px; height:40px; min-height:40px; padding:0 16px; border-radius:10px; font-size:14px; font-weight:700; white-space:nowrap; }
  #appView .vs-hd-body { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:10px; margin-bottom:16px; }
  /* Hàng tab (4.2): chữ 14/600, tab mở gạch dưới 2px đồng, kẻ dưới #EFE9DD */
  #appView .vs-seg { display:flex; gap:28px; max-width:100%; padding:0; border-bottom:1px solid #EFE9DD; border-radius:0; background:none; overflow-x:auto; scrollbar-width:none; }
  #appView .vs-hd .vs-seg { grid-column:1 / -1; grid-row:2; }
  #appView .vs-hd-body .vs-seg { flex:1 1 100%; order:2; }
  #appView .vs-seg::-webkit-scrollbar { display:none; }
  #appView .vs-seg button { flex:0 0 auto; height:44px; min-height:44px; margin-bottom:-1px; padding:0; border:0; border-bottom:2px solid transparent; border-radius:0; background:none; color:#6F655A; font:inherit; font-size:14px; font-weight:600; white-space:nowrap; cursor:pointer; box-shadow:none; }
  #appView .vs-seg button:hover { background:none; color:#25211C; }
  #appView .vs-seg button[aria-selected="true"] { border-bottom-color:#9A6A2E; background:none; color:#25211C; box-shadow:none; }
  #appView .vs-seg button:focus-visible { outline:2px solid #9A6A2E; outline-offset:-2px; }
  /* shell.css tô viền mọi nút #E4DACA (độ ưu tiên cao): giữ màu viền riêng của các nút Visa */
  #appView .vs-seg button { border-color:transparent !important; }
  #appView .vs-seg button[aria-selected="true"] { border-bottom-color:#9A6A2E !important; }
  #appView :is(button.vs-ob, button.vs-hbtn, button.vs-fc, button.vs-kpi, button.vs-got, button.vs-pen):hover { border-color:#B89F7E !important; }
  #appView button.vs-fc.is-on { border-color:#EFE2CC !important; }
  #appView button.vs-add, #appView button.vs-s1up { border-color:#B89F7E !important; }

  /* ---------- Thành phần dùng chung ---------- */
  #appView .vs-ov .tag, #appView .vs-tblcard .tag, #appView .vs-h1 .tag, #appView .vs-head .tag, #appView .vs-grid .tag, #appView .vs-two .tag, #appView .vs-card .tag, #appView .vs-flow .tag {
    height:24px; padding:0 10px; box-sizing:border-box; border:0; border-radius:12px; font-size:12px; font-weight:600; letter-spacing:0; white-space:nowrap; }
  #appView .tag:not(.ok):not(.warn):not(.danger):not(.info):not(.brand):not(.low) { background:#F1ECE4; color:#6F655A; }
  #appView .tag.danger { background:#FBE7E5; color:#9B2F23; }
  #appView .tag.info { background:#E7EEF9; color:#24498A; }
  #appView .vs-cnt { display:inline-grid; place-items:center; min-width:26px; height:24px; margin:0; 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; vertical-align:middle; }
  #appView .vs-cnt.is-warn { background:#FFF2E0; color:#8A4B0C; }
  #appView .vs-cnt.is-ok { background:#E6F2E8; color:#1F5E2E; }
  /* Nút viền nhỏ trong thẻ / dòng bảng (Mở, Sửa, + Thêm giấy tờ, Mở kho visa…) */
  #appView button.vs-ob { display:inline-flex; align-items:center; justify-content:center; gap:6px; height:32px; min-height:32px; padding:0 12px; border:1px solid #E4DACA; border-radius:10px; background:#fff; color:#25211C; font:inherit; font-size:13px; font-weight:600; white-space:nowrap; cursor:pointer; box-shadow:none; }
  #appView button.vs-ob:hover { border-color:#B89F7E; background:#FAF7F2; color:#25211C; }
  #appView .vs-sech button.vs-ob, #appView .vs-side button.vs-ob { height:34px; min-height:34px; padding:0 14px; }
  #appView button.vs-hlink { min-height:0; padding:0; border:0; background:none; color:#8A5F27; font:inherit; font-size:13px; font-weight:600; cursor:pointer; box-shadow:none; }
  #appView button.vs-hlink:hover { background:none; color:#6E4A1C; text-decoration:underline; text-underline-offset:3px; }
  #appView .vs-none { margin:0; color:#6F655A; font-size:13px; }
  #appView .vs-pad { padding:16px; }
  #appView .vs-late { color:#9B2F23; font-weight:700; }
  #appView .vs-dash { color:#6F655A; }
  #appView .vs-sub { display:block; margin-top:4px; color:#6F655A; font-size:12px; font-weight:400; }
  #appView .vs-empty, #appView .hub-card.vs-empty { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:18px 20px; }
  #appView .vs-empty p { margin:0; color:#6F655A; font-size:14px; }
  #appView .vs-sec .vs-empty, #appView #vsTable .vs-empty { padding:6px 0 2px; }
  #appView .vs-sec h2, #appView .vs-sec h3 { margin:0 0 12px; font-size:16px; font-weight:700; }
  #appView .vs-link, #appView button.vs-link { min-height:0; padding:0; border:0; background:none; color:#8A5F27; font:inherit; font-weight:700; text-decoration:none; cursor:pointer; text-align:left; box-shadow:none; }
  #appView button.vs-link:hover { background:none; color:#6E4A1C; text-decoration:underline; text-underline-offset:3px; }

  /* ---------- TỔNG HỢP ---------- */
  #appView .vs-ov { --f-new:#E4DCD0; --f-collecting:#F2D9B3; --f-complete:#E2C08E; --f-handed:#D4A86C; --f-submitted:#C9D7EE; --f-result:#BFDDC6; --f-returned:#9FCBA9; display:flex; flex-direction:column; gap:24px; }
  #appView .vs-ov section { display:flex; flex-direction:column; gap:12px; min-width:0; }
  #appView .vs-ch { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:0; }
  #appView .vs-ch h2 { display:flex; align-items:center; gap:10px; margin:0; color:#25211C; font-size:16px; font-weight:700; letter-spacing:0; }
  #appView .vs-ch h2::before { content:none; }
  #appView .hub-card.vs-ovcard { padding:0; overflow:hidden; }

  /* Ô số kiểu thẻ trang chủ (bấm = lọc tab Hồ sơ) */
  #appView .vs-kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:12px; }
  #appView button.vs-kpi { display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start; gap:6px; min-width:0; min-height:0; padding:14px 16px; border:1px solid #E4DACA; border-radius:16px; background:#fff; color:#25211C; font:inherit; text-align:left; cursor:pointer; box-shadow:none; }
  #appView button.vs-kpi:hover { border-color:#B89F7E; background:#fff; }
  #appView button.vs-kpi:focus-visible { outline:2px solid #9A6A2E; outline-offset:1px; }
  #appView .vs-kl { display:flex; align-items:center; gap:6px; color:#6F655A; font-size:12px; font-weight:500; }
  #appView .vs-kl svg { flex:0 0 auto; }
  #appView .vs-kn { display:flex; align-items:baseline; gap:5px; }
  #appView .vs-kn .vs-d { margin-left:4px; align-self:center; }
  #appView .vs-kn b { font-size:26px; font-weight:800; line-height:1.1; letter-spacing:-.4px; font-variant-numeric:tabular-nums; }
  #appView .vs-kn small { color:#6F655A; font-size:13px; font-weight:400; }
  #appView .vs-ks { display:flex; align-items:center; flex-wrap:wrap; gap:6px; color:#6F655A; font-size:12px; font-weight:400; }
  #appView .vs-d { display:inline-flex; align-items:center; height:18px; padding:0 6px; border-radius:9px; background:#F1ECE4; color:#6F655A; font-style:normal; font-size:11px; font-weight:700; white-space:nowrap; }
  #appView .vs-d.up { background:#E6F2E8; color:#1F5E2E; }
  #appView .vs-kpi.is-od .vs-kl, #appView .vs-kpi.is-od .vs-kn b { color:#9B2F23; }

  /* Dòng chảy: thanh 7 bước + chú thích · nhịp độ 90 ngày */
  #appView .hub-card.vs-flowcard { display:flex; flex-wrap:wrap; align-items:center; gap:24px; padding:18px 20px; }
  #appView .vs-fl-main { flex:999 1 560px; min-width:0; display:flex; flex-direction:column; gap:12px; }
  #appView .vs-fbar { display:flex; gap:4px; height:36px; }
  #appView button.vs-fs { flex:1 1 0; min-width:28px; min-height:0; height:100%; padding:0 6px; border:0; border-radius:8px; background:var(--c, var(--f-new)); color:#25211C; font:inherit; font-size:13px; font-weight:700; font-variant-numeric:tabular-nums; cursor:pointer; box-shadow:none; transition:filter .12s; }
  #appView button.vs-fs:hover { filter:brightness(.95); }
  #appView button.vs-fs:focus-visible { outline:2px solid #25211C; outline-offset:1px; }
  #appView .vs-fs-empty { display:flex; align-items:center; justify-content:center; flex:1; border-radius:8px; background:#F1ECE4; color:#6F655A; font-size:13px; }
  #appView .vs-flegend { display:flex; flex-wrap:wrap; gap:6px 18px; }
  #appView button.vs-fk { display:inline-flex; align-items:center; gap:6px; min-height:24px; padding:0; border:0; background:none; color:#25211C; font:inherit; font-size:13px; font-weight:400; cursor:pointer; box-shadow:none; }
  #appView button.vs-fk:hover { background:none; text-decoration:underline; text-underline-offset:3px; }
  #appView .vs-fk i { flex:0 0 auto; width:10px; height:10px; border-radius:3px; background:var(--c, var(--f-new)); }
  #appView .vs-fk b { color:#25211C; font-weight:700; font-variant-numeric:tabular-nums; }
  #appView .vs-fk.is-zero { color:#6F655A; }
  #appView .is-new { --c:var(--f-new); } #appView .is-collecting { --c:var(--f-collecting); } #appView .is-complete { --c:var(--f-complete); } #appView .is-handed { --c:var(--f-handed); }
  #appView .is-submitted { --c:var(--f-submitted); } #appView .is-result { --c:var(--f-result); } #appView .is-returned { --c:var(--f-returned); }
  #appView .vs-pace { flex:0 1 auto; display:flex; min-width:0; }
  #appView .vs-pm { flex:1 1 0; min-width:0; display:flex; flex-direction:column; padding:0 16px; border-left:1px solid #EFE9DD; }
  #appView .vs-pm b { font-size:26px; font-weight:800; line-height:1.1; letter-spacing:-.4px; font-variant-numeric:tabular-nums; white-space:nowrap; }
  #appView .vs-pm b small { margin-left:4px; color:#6F655A; font-size:13px; font-weight:400; letter-spacing:0; }
  #appView .vs-pm > span { margin-top:4px; font-size:13px; font-weight:600; white-space:nowrap; }
  #appView .vs-pm > small { color:#6F655A; font-size:12px; white-space:nowrap; }

  /* Cần làm hôm nay (trái) · đang xử lý + tháng này (phải) */
  #appView .vs-ovgrid { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); gap:16px; align-items:start; }
  #appView .vs-ovside { display:flex; flex-direction:column; gap:20px; min-width:0; }
  #appView .vs-tg + .vs-tg { border-top:1px solid #EFE9DD; }
  #appView .vs-tg h3 { display:flex; align-items:center; gap:8px; margin:0; padding:10px 16px; background:#FAF7F2; color:#25211C; font-size:13px; font-weight:600; text-transform:none; letter-spacing:0; }
  #appView .vs-tg.is-overdue h3 { color:#9B2F23; }
  #appView .vs-tg.is-due h3 { color:#8A4B0C; }
  #appView .vs-tg h3 b { color:#6F655A; font-weight:600; font-variant-numeric:tabular-nums; }
  #appView .vs-dot { display:none; }
  #appView .vs-tg ul { margin:0; padding:0; list-style:none; }
  #appView .vs-trow { display:flex; align-items:center; gap:12px; min-height:56px; padding:8px 16px; box-sizing:border-box; border-top:1px solid #EFE9DD; font-size:14px; }
  #appView .vs-trow[hidden] { display:none; }
  #appView .vs-no { flex:0 0 auto; font-weight:700; white-space:nowrap; font-variant-numeric:tabular-nums; }
  #appView span.vs-no { color:#8A5F27; }
  #appView .vs-tname { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  #appView .vs-tname .vs-link { color:#25211C; font-weight:400; }
  #appView .vs-tname .vs-link:hover { color:#6E4A1C; }
  #appView .vs-tchips { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
  #appView .vs-trow .vs-open { flex:0 0 auto; }
  #appView .vs-more { margin:0 16px 10px; }
  #appView .vs-todo-none { padding:16px; font-size:14px; }
  #appView .vs-ip .tbl-wrap { margin:0; border:0; border-radius:0; }
  #appView .vs-ip .tbl-wrap table.vs-ip-tbl { width:100%; min-width:0; }
  #appView .hub-table.vs-ip-tbl th, #appView .hub-table.vs-ip-tbl td { padding:10px 12px; font-size:14px; vertical-align:middle; text-align:left; }
  #appView .hub-table.vs-ip-tbl th { padding-top:12px; padding-bottom:12px; font-size:13px; white-space:nowrap; }
  #appView .hub-table.vs-ip-tbl .r { text-align:right; }
  #appView .hub-table.vs-ip-tbl th:first-child, #appView .hub-table.vs-ip-tbl td:first-child { padding-left:16px; }
  #appView .hub-table.vs-ip-tbl th:last-child, #appView .hub-table.vs-ip-tbl td:last-child { padding-right:16px; }
  #appView .vs-ip-tbl td { height:56px; box-sizing:border-box; white-space:nowrap; }
  #appView .vs-ip-tbl td:first-child { white-space:normal; }
  #appView .vs-ip-tbl tbody tr { cursor:pointer; }
  #appView .vs-ip-tbl tbody tr:hover { background:#FAF1E1; }
  #appView .vs-ip-tbl tbody tr:focus-visible { outline:2px solid #9A6A2E; outline-offset:-2px; }
  #appView .vs-ip-tbl tbody tr:last-child td { border-bottom:0; }
  #appView .vs-ip-tbl td:first-child b { white-space:nowrap; }
  #appView .vs-ipd { display:none; margin-top:3px; color:#6F655A; font-size:12px; }
  #appView .vs-ipc { display:block; color:#6F655A; font-size:12px; font-weight:400; }
  #appView .vs-ipc .vs-link { color:#6F655A; font-weight:400; }
  #appView .vs-mtbl { width:100%; border-collapse:collapse; font-size:14px; }
  #appView .vs-mtbl th, #appView .vs-mtbl td { padding:12px 16px; border:0; border-top:1px solid #EFE9DD; background:none; color:#25211C; font-size:14px; font-weight:400; text-align:left; text-transform:none; letter-spacing:0; }
  #appView .vs-mtbl tr:first-child th, #appView .vs-mtbl tr:first-child td { border-top:0; }
  #appView .vs-mtbl td { padding-left:12px; font-variant-numeric:tabular-nums; white-space:nowrap; }
  #appView .vs-mtbl td:last-child { padding-right:16px; }
  #appView .vs-mtbl .r { text-align:right; }
  #appView .vs-mtbl tbody tr:hover { background:none; }
  #appView .vs-mtbl .vs-mtot th, #appView .vs-mtbl .vs-mtot td { font-weight:700; }
  #appView .vs-out { display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:12px 16px; border-top:1px solid #EFE9DD; background:#FAF7F2; font-size:14px; font-weight:700; }
  #appView .vs-out > span:first-child { flex:1 1 auto; }
  #appView .vs-out-chips { display:flex; flex-wrap:wrap; gap:6px; }

  /* ---------- HỒ SƠ: hàng công cụ (4.3) + chip lọc + bảng (4.5) ---------- */
  #appView .vs-filters { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:16px; }
  #appView .vs-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; font-weight:400; cursor:text; }
  #appView .vs-search:focus-within { border-color:#9A6A2E; box-shadow:0 0 0 3px #9a6a2e1f; }
  #appView .vs-search svg { flex:0 0 auto; }
  #appView .vs-search input, #appView .vs-search .vs-ac input { flex:1 1 auto; width:100%; min-width:0; max-width:none; height:38px; min-height:0; padding:0; border:0; border-radius:0; background:transparent; color:#25211C; font:inherit; font-size:14px; box-shadow:none; outline:0; }
  #appView .vs-search input:focus { border:0; box-shadow:none; }
  #appView .vs-search .vs-ac { flex:1 1 auto; min-width:0; }
  #appView .vs-month { display:inline-flex; align-items:center; gap:2px; height:36px; margin:0; padding:0 4px 0 14px; box-sizing:border-box; border:1px solid #E4DACA; border-radius:18px; background:#fff; overflow:visible; }
  #appView .vs-month span { color:#25211C; font-size:13px; font-weight:600; white-space:nowrap; }
  #appView .vs-month select { width:auto; min-width:0; height:32px; min-height:0; padding:0 26px 0 2px; border:0; background-color:transparent; color:#25211C; font-size:13px; font-weight:600; box-shadow:none; }
  #appView .vs-month select:focus { border:0; box-shadow:none; }
  #appView .vs-month:focus-within { border-color:#9A6A2E; }
  #appView .vs-chips { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
  #appView .vs-fc, #appView button.vs-fc { display:inline-flex; align-items:center; gap:6px; height:34px; min-height:34px; padding:0 14px; border:1px solid #E4DACA; border-radius:17px; background:#fff; color:#25211C; font:inherit; font-size:13px; font-weight:600; white-space:nowrap; cursor:pointer; box-shadow:none; }
  #appView .vs-fc b { color:inherit; font-weight:700; font-variant-numeric:tabular-nums; }
  #appView .vs-fc b.is-zero { color:#6F655A; }
  #appView button.vs-fc:hover { border-color:#B89F7E; background:#FAF7F2; color:#25211C; }
  #appView button.vs-fc.is-on, #appView button.vs-fc.is-on:hover { border-color:#EFE2CC; background:#EFE2CC; color:#6E4A1C; }
  #appView .vs-fc-od b, #appView button.vs-fc.vs-fc-od.is-on b { color:#9B2F23; }
  #appView .hub-card.vs-tblcard { padding:0; overflow:hidden; }
  #appView .vs-tblcard > .tbl-wrap { margin:0; border:0; border-radius:0; }
  #appView .hub-card.vs-tblcard > h2 { margin:0; padding:14px 16px; font-size:16px; font-weight:700; }
  #appView .vs-tblcard .vs-empty { padding:10px 16px 18px; }
  #appView .vs-tfoot { padding:12px 16px; border-top:1px solid #EFE9DD; color:#6F655A; font-size:13px; }
  #appView .vs-list-tbl, #appView .vs-rec-tbl, #appView .vs-tpl-tbl { min-width:640px; }
  #appView .hub-table:is(.vs-list-tbl, .vs-rec-tbl, .vs-tpl-tbl) th { padding:12px; text-align:left; white-space:nowrap; }
  #appView .hub-table:is(.vs-list-tbl, .vs-rec-tbl, .vs-tpl-tbl) td { padding:14px 12px; font-size:14px; text-align:left; vertical-align:middle; }
  #appView .hub-table:is(.vs-list-tbl, .vs-rec-tbl, .vs-tpl-tbl) :is(th, td):first-child { padding-left:16px; }
  #appView .hub-table:is(.vs-list-tbl, .vs-rec-tbl, .vs-tpl-tbl) :is(th, td):last-child { padding-right:16px; }
  #appView .hub-table:is(.vs-list-tbl, .vs-rec-tbl, .vs-tpl-tbl) .r { text-align:right; }
  #appView .hub-table .vs-actc, #appView .hub-table td.vs-actc { width:1%; text-align:right; white-space:nowrap; }
  #appView .vs-actc .ui-more { margin-left:4px; vertical-align:middle; }
  #appView .vs-actv { display:inline-flex; flex-direction:column; align-items:stretch; gap:6px; }
  #appView button.vs-delcase { color:#9B2F23; }
  #appView button.vs-delcase:hover { border-color:#9B2F23; background:#FBF1EF; }
  #appView .vs-list-tbl td { height:60px; box-sizing:border-box; }
  #appView .vs-list-tbl td:first-child, #appView .vs-list-tbl td:nth-child(6) { white-space:nowrap; }
  #appView .vs-list-tbl td:first-child b { font-weight:700; }
  #appView .vs-list-tbl .vs-link { font-weight:700; }
  #appView .vs-list-tbl tbody tr, #appView .vs-tpl-tbl tbody tr, #appView .vs-rec-tbl tbody tr[data-cid] { cursor:pointer; }
  #appView .vs-list-tbl tbody tr:hover, #appView .vs-tpl-tbl tbody tr:hover, #appView .vs-rec-tbl tbody tr:hover { background:#FAF1E1; }
  #appView .vs-list-tbl tbody tr:focus-visible, #appView .vs-tpl-tbl tbody tr:focus-visible, #appView .vs-rec-tbl tbody tr:focus-visible { outline:2px solid #9A6A2E; outline-offset:-2px; }
  #appView .hub-table .r { text-align:right; } #appView .hub-table .c { text-align:center; }
  #appView .vs-type { white-space:nowrap; }

  /* Ô tìm khách */
  #appView .vs-ac, .vs-dlg .vs-ac { position:relative; }
  #appView .vs-ac-pop { position:absolute; z-index:30; top:calc(100% + 6px); left:0; min-width:min(460px,calc(100vw - 48px)); max-width:calc(100vw - 48px); max-height:min(320px,45vh); overflow-y:auto; padding:6px; border:1px solid #E4DACA; border-radius:12px; background:#fff; box-shadow:0 8px 24px rgba(57,46,34,.12); }
  #appView .vs-search .vs-ac-pop { left:-36px; }
  #appView .vs-ac-pop[hidden] { display:none; }
  #appView .vs-ac-pop button { display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; min-height:40px; padding:7px 10px; border:0; border-radius:8px; background:none; text-align:left; font:inherit; color:#25211C; cursor:pointer; }
  #appView .vs-ac-pop button:hover, #appView .vs-ac-pop button.is-active { background:#FAF1E1; }
  #appView .vs-ac-pop b { display:block; font-size:14px; }
  #appView .vs-ac-pop small { display:block; color:#6F655A; font-size:12px; }
  #appView .vs-ac-pop em { flex:0 0 auto; max-width:40%; font-style:normal; font-size:12px; font-weight:600; color:#8A5F27; text-align:right; }
  #appView .vs-ac-empty { padding:8px 10px; color:#6F655A; font-size:13px; }

  /* Form tạo hồ sơ (một cột) + trường nhập dùng chung; nhãn 13/600 viết thường (4.7) */
  #appView .hub-card.vs-form { display:grid; gap:16px; max-width:640px; padding:22px 24px; }
  #appView .vs-row3 { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
  #appView .vs-row2 { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  #appView .vs-fgrid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 16px; }
  #appView .vs-f, .vs-dlg .vs-f { display:flex; flex-direction:column; gap:6px; min-width:0; }
  #appView .vs-f[hidden], .vs-dlg .vs-f[hidden] { display:none; }
  #appView .vs-wide, .vs-dlg .vs-wide { grid-column:1 / -1; }
  #appView .vs-f > label, .vs-dlg .vs-f > label, .vs-dlg .vs-flabel { margin:0; color:#25211C; font-size:13px; font-weight:600; text-transform:none; letter-spacing:0; }
  #appView .vs-f input, #appView .vs-f select, #appView .vs-f textarea, .vs-dlg .vs-f input, .vs-dlg .vs-f select, .vs-dlg .vs-f textarea { width:100%; min-height:40px; box-sizing:border-box; border-radius:10px; }
  #appView .vs-hint, .vs-dlg .vs-hint { margin:0; min-height:14px; color:#6F655A; font-size:12px; font-weight:400; }
  #appView .vs-preview { min-height:20px; padding:10px 12px; border-radius:10px; background:#FAF7F2; color:#25211C; font-size:14px; }
  #appView .vs-preview:empty { display:none; }
  #appView .vs-preview b { color:#8A5F27; }
  #appView .vs-form .btn-row { margin:0; }
  #appView .vs-form .hub-error { margin:0; padding:0; }

  /* ---------- CHI TIẾT HỒ SƠ (4.6) ---------- */
  /* Dải thông tin một dòng nền #FAF7F2: Hành trình · Loại · Nơi nộp · Chi phí */
  #appView section.vs-head { min-height:48px; margin:0 0 16px; padding:6px 4px; box-sizing:border-box; border:0; border-radius:12px; background:#FAF7F2; }
  #appView .vs-facts { display:flex; flex-wrap:wrap; align-items:center; gap:4px 0; }
  #appView .vs-fact { display:flex; flex:none; align-items:baseline; gap:6px; min-width:0; padding:6px 16px; border-left:1px solid #EFE9DD; }
  #appView .vs-fact:first-child { border-left:0; }
  #appView .vs-fact.is-in { align-items:center; padding-top:2px; padding-bottom:2px; }
  #appView .vs-fact > span { flex:none; color:#6F655A; font-size:13px; font-weight:400; }
  #appView .vs-fact > div { color:#25211C; font-size:15px; font-weight:700; overflow-wrap:anywhere; }
  #appView .vs-fact .vs-dash { color:#6F655A; }
  #appView .vs-fact-j { flex:0 1 auto; }
  #appView .vs-fact-j > div { display:flex; align-items:baseline; min-width:0; white-space:nowrap; }
  #appView .vs-fact-j .vs-link { min-width:0; overflow:hidden; text-overflow:ellipsis; }
  #appView .vs-fact small { margin-left:6px; color:#6F655A; font-size:12px; font-weight:400; }
  #appView .vs-fact select { width:auto; min-width:120px; height:34px; min-height:34px; padding-top:0; padding-bottom:0; border-radius:10px; background-color:#fff; color:#25211C; font-size:14px; font-weight:600; }
  #appView .vs-money { display:inline-flex; align-items:center; gap:6px; height:34px; padding:0 10px; box-sizing:border-box; border:1px solid #E4DACA; border-radius:10px; background:#fff; }
  #appView .vs-money:focus-within { border-color:#9A6A2E; box-shadow:0 0 0 3px #9a6a2e1f; }
  #appView .vs-money input { width:92px; height:30px; min-height:0; padding:0; border:0; background:transparent; color:#25211C; font-size:14px; font-weight:700; text-align:right; font-variant-numeric:tabular-nums; box-shadow:none; }
  #appView .vs-money input:focus { border:0; box-shadow:none; }
  #appView .vs-money span { color:#6F655A; font-size:13px; font-weight:400; }

  /* Thanh 7 bước: vòng tròn số + đường nối */
  #appView section.vs-flow { margin:0 0 16px; padding:16px 8px; }
  #appView .vs-strip { display:flex; margin:0; padding:0; list-style:none; }
  #appView .vs-strip li { position:relative; flex:1 1 0; min-width:0; display:flex; flex-direction:column; align-items:center; gap:6px; padding:0 4px; color:#6F655A; text-align:center; }
  #appView .vs-strip li::before, #appView .vs-strip li::after { content:""; position:absolute; top:15px; width:50%; height:2px; background:#EFE9DD; }
  #appView .vs-strip li::before { left:0; } #appView .vs-strip li::after { right:0; }
  #appView .vs-strip li:first-child::before, #appView .vs-strip li:last-child::after { content:none; }
  #appView .vs-strip li.d::before, #appView .vs-strip li.d::after, #appView .vs-strip li.c::before { background:#1F5E2E; }
  #appView .vs-sn { position:relative; z-index:1; display:grid; place-items:center; width:32px; height:32px; box-sizing:border-box; border:2px solid #E4DACA; border-radius:50%; background:#fff; color:#6F655A; font-size:13px; font-weight:700; }
  #appView .vs-strip li.d .vs-sn { border-color:#1F5E2E; background:#E6F2E8; color:#1F5E2E; }
  #appView .vs-strip li.c .vs-sn { border-color:#9A6A2E; background:#9A6A2E; color:#fff; }
  #appView .vs-sl { color:#6F655A; font-size:13px; font-weight:600; line-height:1.3; }
  #appView .vs-strip li.d .vs-sl, #appView .vs-strip li.c .vs-sl { color:#25211C; }
  #appView .vs-strip li.c .vs-sl { font-weight:700; }
  #appView .vs-strip small { min-height:16px; color:#6F655A; font-size:12px; font-weight:400; }
  #appView .vs-strip small.is-late { color:#9B2F23; font-weight:600; }
  #appView .vs-strip.is-cancelled li { opacity:.55; }
  #appView button.vs-stepb { position:relative; display:flex; flex-direction:column; align-items:center; gap:6px; width:100%; min-height:0; padding:0; border:0; border-radius:8px; background:none; color:inherit; font:inherit; box-shadow:none; cursor:pointer; }
  #appView button.vs-stepb:hover { background:none; }
  #appView button.vs-stepb:hover .vs-sl { text-decoration:underline; text-underline-offset:3px; }
  #appView button.vs-stepb:focus-visible { outline:2px solid #9A6A2E; outline-offset:2px; }
  #appView .vs-strip li.is-viewing .vs-sn { box-shadow:0 0 0 4px #EFE2CC; }
  /* Bước đang làm "đang chạy": vòng sáng lan ra từ chấm đồng + vệt sáng chạy dọc đoạn nối sang bước kế (Chủ dự án 05/11).
     Vòng sáng dùng ::after để không đè box-shadow "đang xem" của chính chấm. */
  #appView .vs-strip:not(.is-cancelled) li.c .vs-sn::after { content:""; position:absolute; inset:-2px; border-radius:50%; pointer-events:none; animation:vs-glow 1.8s ease-out infinite; }
  #appView .vs-strip:not(.is-cancelled) li.c::after { top:14.5px; height:3px; border-radius:2px; background:#EFE2CC linear-gradient(90deg, transparent, #9A6A2E 50%, transparent) no-repeat; background-size:45% 100%; animation:vs-flow 1.6s linear infinite; }
  @keyframes vs-glow { 0% { box-shadow:0 0 0 0 rgba(154,106,46,.6); } 70% { box-shadow:0 0 0 12px rgba(154,106,46,0); } 100% { box-shadow:0 0 0 0 rgba(154,106,46,0); } }
  @keyframes vs-flow { from { background-position:-80% 0; } to { background-position:180% 0; } }
  @media (prefers-reduced-motion:reduce) { #appView .vs-strip li.c .vs-sn::after, #appView .vs-strip li.c::after { animation:none; } }
  #appView .vs-viewing { font-weight:600; color:#8A5F27; }
  #appView .vs-next { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:16px 8px 0; }
  #appView .vs-why { color:#9B2F23; font-size:13px; font-weight:600; }
  #appView .vs-flow .vs-alert { margin:12px 8px 0; }

  /* Bố cục hai cột: nội dung chính · cột phải tóm tắt / việc cần làm */
  #appView .vs-grid { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:16px; align-items:start; }
  #appView .vs-main { display:grid; gap:16px; min-width:0; }
  #appView .vs-grid.is-step1 { grid-template-columns:minmax(0,1fr); }
  #appView .vs-grid.is-step2 { grid-template-columns:minmax(0,1fr) 300px; }
  #appView .vs-grid.is-step3 { grid-template-columns:minmax(0,1fr); }
  #appView .vs-grid.is-step1 .vs-side, #appView .vs-grid.is-step1 #vsLog, #appView .vs-grid.is-step3 .vs-side, #appView .vs-grid.is-step3 #vsLog { display:none; }
  #appView .vs-grid.is-step5, #appView .vs-grid.is-step6, #appView .vs-grid.is-step7, #appView .vs-grid.is-closed { grid-template-columns:minmax(0,1fr); }
  #appView .vs-grid.is-closed .vs-side, #appView .vs-grid.is-closed #vsLog, #appView #vsStrip.vs-hide { display:none; }
  #appView .vs-cl-h { flex-wrap:wrap; gap:10px; }
  #appView .vs-cl-top { display:grid; grid-template-columns:minmax(0,3fr) minmax(0,2fr); gap:24px; align-items:start; }
  #appView .vs-cl-who { display:grid; gap:18px; }
  #appView .vs-cl-top h3, #appView .vs-cl-docs h3 { margin:0 0 10px; font-size:16px; }
  #appView .vs-cl-docs { margin-top:22px; padding-top:18px; border-top:1px solid #EFE9DD; }
  #appView .vs-s7btns { justify-self:start; margin:0; }
  @media (max-width:760px) { #appView .vs-cl-top { grid-template-columns:minmax(0,1fr); } }
  #appView .vs-s7 { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; align-items:start; }
  #appView #vsTable .vs-s7 h2 { margin:0 0 12px; }
  #appView .vs-s7form { display:grid; gap:12px; }
  #appView .vs-s7form .vs-f { margin:0; }
  #appView .vs-s7form input, #appView .vs-s7form select { width:100%; }
  #appView .vs-s7tbl { min-width:0; }
  #appView .vs-s7tbl td:first-child { font-weight:600; }
  #appView .vs-s7tbl tfoot td { border-top:1px solid #EFE9DD; font-weight:700; }
  @media (max-width:760px) { #appView .vs-s7 { grid-template-columns:minmax(0,1fr); } }
  #appView .vs-grid.is-step7 .vs-side, #appView .vs-grid.is-step5 .vs-side, #appView .vs-grid.is-step6 .vs-side, #appView .vs-grid.is-step6 #vsLog { display:none; }
  #appView #vsTable.vs-hide { display:none; }
  #appView .vs-s6h { margin-bottom:16px; }
  #appView .vs-s6h h2 { margin:0 0 4px; font-size:18px; color:#1F5E2E; }
  #appView .vs-s6h p { margin:0; color:#6F655A; }
  #appView .vs-s6 { display:grid; grid-template-columns:minmax(0,2fr) minmax(260px,1fr); gap:20px; align-items:start; }
  #appView .vs-s6img { display:grid; gap:10px; justify-items:start; min-height:240px; padding:14px; border:1px solid #EFE9DD; border-radius:12px; background:#FAF7F2; }
  #appView .vs-s6img .vs-thumbs { display:grid; width:100%; gap:10px; }
  #appView .vs-s6img .vs-thw { display:block; }
  #appView .vs-s6img .vs-th { width:100%; height:auto; background:#fff; }
  #appView .vs-s6img .vs-th img { height:auto; max-height:560px; object-fit:contain; }
  #appView .vs-s6img .vs-pdf { height:180px; }
  #appView .vs-s6img .vs-pdf svg { width:90px; height:90px; }
  #appView .vs-s6info h3 { margin:0 0 8px; font-size:16px; }
  #appView .vs-s6no { margin:0; }
  @media (max-width:760px) { #appView .vs-s6 { grid-template-columns:minmax(0,1fr); } }
  #appView .vs-s5form { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:14px; }
  #appView .vs-s5form .vs-f { grid-column:span 2; margin:0; }
  #appView .vs-s5form .vs-f:nth-child(-n+2) { grid-column:span 3; }
  #appView .vs-s5form input, #appView .vs-s5form select { width:100%; }
  @media (max-width:760px) { #appView .vs-s5form { grid-template-columns:minmax(0,1fr); } #appView .vs-s5form .vs-f, #appView .vs-s5form .vs-f:nth-child(-n+2) { grid-column:auto; } }
  #appView .vs-s4tbl { min-width:640px; }
  #appView .vs-have { white-space:nowrap; }
  #appView .vs-have .vs-thumbs { margin-top:4px; max-width:150px; }
  #appView .vs-pick { width:auto; min-width:136px; height:32px; min-height:32px; padding:0 8px; border-radius:10px; font:inherit; font-size:13px; font-weight:600; }
  #appView .vs-pick.ok { border-color:#1F5E2E; background-color:#E6F2E8; color:#1F5E2E; }
  #appView .vs-pick.danger { border-color:#9B2F23; color:#9B2F23; }
  #appView .vs-ptf { display:grid; gap:10px; }
  #appView .vs-ptf .vs-f { margin:0; }
  #appView .vs-ptf input { width:100%; }
  #appView .vs-dcards { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:12px; }
  #appView .vs-dcard { display:flex; flex-direction:column; gap:10px; min-width:0; padding:14px; border:1px solid #E4DACA; border-radius:12px; background:#fff; }
  #appView .vs-dcard header { display:flex; align-items:baseline; gap:6px; }
  #appView .vs-dcard header small { color:#6F655A; font-size:12px; }
  #appView .vs-dcard .vs-none { margin:0; }
  #appView .vs-dcard .vs-thumbs { gap:8px; }
  #appView .vs-dcard .vs-th, #appView .vs-dcard .vs-add { width:72px; height:72px; }
  #appView .vs-s1h { margin:0 0 12px; font-size:16px; }
  #appView .vs-s1sech .vs-s1h { margin:0; }
  /* Bước 1: mọi ô cùng cỡ chữ / dòng, căn đầu ô để dòng đầu các cột thẳng hàng */
  #appView .vs-s1tbl { min-width:820px; table-layout:fixed; }
  #appView .hub-table.vs-s1tbl td { vertical-align:top; font-size:14px; line-height:22px; }
  #appView .vs-s1tbl td.vs-req { min-width:0; max-width:none; font-size:14px; line-height:22px; }
  #appView .vs-s1tbl .vs-doc b { line-height:22px; }
  #appView .vs-s1tbl .vs-doc small { margin-top:0; line-height:18px; }
  #appView .vs-s1tbl .vs-reqs li { margin:0; }
  #appView .vs-s1tbl th:nth-child(1) { width:170px; }
  #appView .vs-s1tbl th.vs-qcell { width:96px; }
  #appView .vs-s1tbl th:nth-child(3) { width:42%; }
  #appView .vs-s1tbl th.vs-s1x { width:76px; }
  #appView .hub-table.vs-s1tbl tbody td.vs-s1x { padding-top:10px; padding-bottom:10px; text-align:right; }
  #appView button.vs-s1del { height:30px; min-height:30px; padding:0 12px; border:1px solid #E4D9CB; border-radius:8px; background:#fff; color:#9B2F23; font:inherit; font-size:13px; font-weight:600; cursor:pointer; box-shadow:none; }
  #appView button.vs-s1del:hover { border-color:#9B2F23; background:#FBF1EF; }
  #appView .vs-s1pp { margin-top:22px; padding-top:18px; border-top:1px solid #EFE9DD; }
  #appView .vs-s1pp .vs-sech { justify-content:flex-start; gap:12px; flex-wrap:wrap; }
  #appView button.vs-s1up { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; min-height:96px; border:1px dashed #B89F7E; border-radius:12px; background:none; color:#8A5F27; font:inherit; font-weight:700; cursor:pointer; box-shadow:none; }
  #appView button.vs-s1up:hover { background:#FAF7F2; }
  #appView button.vs-s1up b { font-size:20px; }
  #appView .vs-s1ppb { display:grid; grid-template-columns:150px minmax(0,1fr); gap:18px; align-items:start; }
  #appView .vs-s1th { display:grid; gap:8px; justify-items:start; }
  #appView .vs-s1th .vs-th { width:150px; height:104px; }
  #appView .vs-s1form { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px 14px; }
  #appView .vs-s1form input { width:100%; }
  #appView .vs-s1foot { display:grid; gap:12px; justify-items:start; margin-top:22px; padding-top:18px; border-top:1px solid #EFE9DD; }
  #appView .vs-s1ack { font-weight:700; }
  #appView .vs-s1foot .vs-why { margin:0; }
  #appView .vs-s1foot button[disabled] { opacity:.5; cursor:not-allowed; }
  @media (max-width:760px) { #appView .vs-s1ppb, #appView .vs-s1form { grid-template-columns:minmax(0,1fr); } }
  #appView .vs-side { display:flex; flex-direction:column; gap:12px; min-width:0; }
  #appView .vs-main > .hub-card h2 { margin:0; font-size:16px; font-weight:700; }
  #appView .vs-main > #vsLog h2 { margin-bottom:0; }
  #appView .vs-sech { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
  #appView .vs-sech h2 { display:flex; align-items:center; gap:10px; margin:0; }
  #appView .hub-card.vs-sec { padding:16px; }
  #appView .vs-sec .btn-row { margin-top:8px; }
  #appView .vs-note { margin:8px 0 0; font-size:13px; overflow-wrap:anywhere; }
  #appView .vs-notice { margin:0 0 12px; padding:8px 12px; border-radius:10px; background:#F1ECE4; color:#6F655A; font-size:13px; }
  /* Bảng giấy tờ tràn sát mép thẻ (Bước 2, Bước 4) */
  #appView #vsTable.is-flush { padding:0; overflow:hidden; }
  #appView #vsTable.is-flush > .vs-sech { margin:0; padding:14px 16px; }
  #appView #vsTable.is-flush > .tbl-wrap { margin:0; border:0; border-radius:0; }
  #appView #vsTable.is-flush > .vs-notice { margin:0 16px 12px; }
  #appView #vsTable.is-flush > .vs-empty { padding:0 16px 16px; }

  /* Bảng giấy tờ */
  #appView .vs-tbl { min-width:760px; }
  #appView .hub-table.vs-tbl th { padding:12px; text-align:left; white-space:nowrap; }
  #appView .vs-tbl th, #appView .vs-rec-tbl th { position:relative; }   /* .sr-only (absolute) nằm trong khung cuộn, không đẩy tràn trang */
  #appView .hub-table.vs-tbl td { padding:14px 12px; vertical-align:top; text-align:left; font-size:14px; }
  #appView .hub-table.vs-tbl :is(th, td):first-child { padding-left:16px; }
  #appView .hub-table.vs-tbl :is(th, td):last-child { padding-right:16px; }
  #appView .hub-table.vs-tbl .vs-qcell { text-align:center; }
  #appView .hub-table.vs-tbl .vs-act { text-align:right; }
  #appView .hub-table.vs-tbl td.vs-act, #appView .hub-table.vs-tbl td:has(> .vs-thumbs), #appView .hub-table.vs-tbl td.vs-rmk { padding-top:12px; padding-bottom:12px; }
  #appView .vs-tbl .vs-thumbs { flex-wrap:nowrap; width:max-content; max-width:136px; padding:0 6px 2px 0; overflow-x:auto; }
  #appView .vs-tbl .vs-thw, #appView .vs-tbl .vs-add { flex:none; }
  #appView .vs-tbl tbody tr:last-child td { border-bottom:0; }
  #appView .vs-tbl tr.is-bad td:first-child { box-shadow:inset 3px 0 0 #9B2F23; }
  #appView .vs-tbl tr.is-na td { color:#6F655A; }
  #appView .vs-tbl td.vs-doc { width:150px; }
  #appView .vs-doc b { display:block; font-weight:700; }
  #appView .vs-doc small, #appView .vs-req small { display:block; margin-top:2px; color:#6F655A; font-size:12px; line-height:1.4; }
  #appView .vs-req { min-width:184px; max-width:300px; font-size:13px; line-height:1.45; }
  #appView .vs-clamp { max-height:2.9em; overflow:hidden; }
  #appView .vs-clamp > div { white-space:pre-line; }
  #appView .vs-clamp.is-open { max-height:none; }
  #appView .vs-more-t, #appView button.vs-more-t { min-height:0; margin-top:2px; padding:0; border:0; background:none; color:#8A5F27; font:inherit; font-size:12px; font-weight:600; cursor:pointer; box-shadow:none; }
  #appView .vs-req .vs-lnote { font-style:normal; }
  #appView .vs-reqs { margin:0; padding:0 0 0 12px; list-style-type:'– '; }
  #appView .vs-reqs li { margin:0 0 2px; padding:0; }
  #appView .vs-req-or { margin:3px 0; color:#6F655A; font-size:12px; font-weight:700; }
  #appView .vs-req-head { margin:0 0 3px; font-weight:700; }
  #appView .vs-tbl th.vs-qcell, #appView .vs-tbl td.vs-qcell { width:76px; white-space:nowrap; }
  #appView .vs-qtyw { display:inline-flex; align-items:center; justify-content:center; gap:6px; font-variant-numeric:tabular-nums; }
  #appView .vs-qtyt { font-weight:600; font-variant-numeric:tabular-nums; }
  #appView tr.is-done .vs-qtyt { color:#1F5E2E; }
  #appView .vs-qty { width:44px; height:32px; min-height:32px; padding:0 4px; box-sizing:border-box; border-radius:10px; text-align:center; -moz-appearance:textfield; appearance:textfield; font-size:14px; font-variant-numeric:tabular-nums; }
  #appView button.vs-cyc { height:24px; min-height:0; padding:0 10px; border:0; border-radius:12px; cursor:pointer; font:inherit; font-size:12px; font-weight:600; white-space:nowrap; box-shadow:none; }
  #appView button.vs-cyc:not(.ok):not(.danger):not(.warn) { background:#F1ECE4; color:#6F655A; }
  #appView button.vs-cyc:hover { outline:1px solid currentColor; }
  #appView .vs-rmk { min-width:80px; }
  #appView .vs-remark { width:100%; max-width:130px; min-width:84px; height:32px; min-height:32px; padding:0 10px; box-sizing:border-box; border:1px solid #E4DACA; border-radius:10px; background:#fff; font-size:13px; text-align:left; }
  #appView .vs-qty::-webkit-inner-spin-button, #appView .vs-qty::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
  #appView .vs-tbl .vs-act { white-space:nowrap; }
  #appView .vs-actw { display:flex; justify-content:flex-end; align-items:center; gap:4px; }
  #appView button.vs-got { width:auto; 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; box-shadow:none; }
  #appView button.vs-got:hover { border-color:#B89F7E; background:#FAF7F2; }

  /* Ảnh / tệp */
  #appView .vs-thumbs { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
  #appView .vs-thw { position:relative; display:inline-flex; }
  #appView .vs-th { display:block; width:32px; height:32px; overflow:hidden; border:1px solid #EFE9DD; border-radius:8px; background:#EFE9DD; }
  #appView .vs-pdf { display:grid; place-items:center; background:#fff; color:#c0392b; }
  #appView .vs-pdf svg { width:78%; height:78%; }
  #appView .vs-th img { display:block; width:100%; height:100%; object-fit:cover; }
  #appView .vs-fchip { display:inline-block; max-width:130px; padding:5px 8px; overflow:hidden; border:1px solid #EFE9DD; border-radius:8px; background:#FAF7F2; color:#8A5F27; font-size:12px; font-weight:600; text-overflow:ellipsis; white-space:nowrap; text-decoration:none; }
  #appView .vs-fchip.is-locked { color:#6F655A; cursor:default; font-weight:400; }
  #appView .vs-x { position:absolute; top:-6px; right:-6px; display:grid; place-items:center; width:18px; height:18px; min-height:0; padding:0; border:1px solid #E4DACA; border-radius:50%; background:#fff; color:#9B2F23; font-size:12px; line-height:1; cursor:pointer; }
  #appView .vs-add { display:grid; place-items:center; width:32px; height:32px; min-height:0; padding:0; border:1px dashed #B89F7E; border-radius:8px; background:#fff; color:#8A5F27; font-size:16px; font-weight:600; cursor:pointer; box-shadow:none; }
  #appView .vs-add:hover { background:#FAF7F2; }

  /* Cột phải: cảnh báo · kiểm tra · kho visa */
  #appView .vs-alert, .vs-dlg .vs-alert { display:flex; gap:10px; align-items:flex-start; padding:12px 14px; border-radius:12px; background:#F1ECE4; color:#6F655A; font-size:13px; font-weight:600; line-height:1.45; }
  #appView .vs-alert .vs-aico, .vs-dlg .vs-alert .vs-aico { flex:0 0 18px; }
  #appView .vs-alert.bad, .vs-dlg .vs-alert.bad { background:#FBE7E5; color:#9B2F23; }
  #appView .vs-alert.warn, .vs-dlg .vs-alert.warn { background:#FFF2E0; color:#8A4B0C; }
  #appView .vs-alert.info, .vs-dlg .vs-alert.info { background:#E7EEF9; color:#24498A; }
  #appView .vs-photos { display:grid; grid-template-columns:1fr; gap:10px; }
  #appView .vs-photo { display:grid; gap:6px; padding:10px 12px; border:1px dashed #E4DACA; border-radius:12px; background:#FAF7F2; }
  #appView .vs-photo b { font-size:13px; }
  #appView .vs-photo small { color:#6F655A; font-size:12px; }
  #appView .vs-kvs { display:grid; }
  #appView .vs-kv { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:44px; padding:4px 0; box-sizing:border-box; border-bottom:1px solid #EFE9DD; font-size:14px; }
  #appView .vs-kv > span { color:#6F655A; font-size:13px; }
  #appView .vs-kv-v { display:flex; align-items:center; justify-content:flex-end; gap:8px; min-width:0; text-align:right; }
  #appView .vs-dv { font-weight:600; font-variant-numeric:tabular-nums; }
  #appView .vs-dv small { display:block; color:#6F655A; font-size:11px; font-weight:400; }
  #appView .vs-pen, #appView button.vs-pen { height:30px; min-height:30px; padding:0 10px; border:1px solid #E4DACA; border-radius:10px; background:#fff; color:#25211C; font:inherit; font-size:12px; font-weight:600; cursor:pointer; box-shadow:none; }
  #appView button.vs-pen:hover { border-color:#B89F7E; background:#FAF7F2; color:#25211C; }
  #appView .vs-pin { width:150px; height:32px; min-height:32px; border-radius:10px; font-size:13px; }
  #appView .vs-cb, .vs-dlg .vs-cb { display:flex; align-items:center; gap:10px; margin:0; color:#25211C; font-size:14px; font-weight:600; cursor:pointer; }
  #appView .vs-kvs .vs-cb { min-height:44px; }
  #appView .vs-cb input, .vs-dlg .vs-cb input { width:18px; height:18px; min-height:0; margin:0; accent-color:#9A6A2E; }
  #appView .vs-okline { margin-top:10px; }
  #appView .vs-kho { display:grid; }
  #appView .vs-kho > div { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:44px; border-bottom:1px solid #EFE9DD; font-size:14px; }
  #appView .vs-kho > div:last-child { border-bottom:0; }

  /* Nhật ký */
  #appView #vsLog { padding:14px 16px; }
  #appView .vs-logd summary { display:flex; align-items:center; gap:10px; cursor:pointer; list-style:none; }
  #appView .vs-logd summary::-webkit-details-marker { display:none; }
  #appView .vs-logd summary::after { content:''; width:7px; height:7px; margin:0 4px 0 auto; border:solid #25211C; border-width:0 2px 2px 0; transform:translateY(-2px) rotate(45deg); transition:transform .15s; }
  #appView .vs-logd[open] summary::after { transform:translateY(1px) rotate(-135deg); }
  #appView .vs-main > #vsLog .vs-logd h2 { margin:0; }
  #appView .vs-logd[open] .vs-log { margin-top:10px; }
  #appView .vs-log { display:grid; margin:0; padding:0; list-style:none; }
  #appView .vs-log li { padding:10px 0; border-top:1px solid #EFE9DD; }
  #appView .vs-log p { margin:0; font-size:14px; line-height:1.45; overflow-wrap:anywhere; }
  #appView .vs-when { color:#6F655A; font-size:12px; }

  /* Kho visa & hộ chiếu */
  #appView .vs-two { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.6fr); gap:16px; align-items:start; }
  #appView .vs-pp-no { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:6px; }
  #appView .vs-pp-no b { font-size:20px; letter-spacing:.02em; font-variant-numeric:tabular-nums; }
  #appView .vs-muted { margin-top:10px; }
  #appView .vs-two .tbl-wrap { border:0; border-radius:0; }
  #appView .vs-rec-tbl td.r { white-space:nowrap; }
  #appView .vs-edit-tbl { min-width:0; }

  /* Thẻ trong hồ sơ khách */
  #appView .vs-card h2 { margin:0 0 10px; font-size:16px; }
  #appView .vs-crow { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 0; border-bottom:1px solid #EFE9DD; font-size:13px; }
  #appView .vs-crow > span:first-child { flex:0 0 auto; color:#6F655A; font-size:12px; }
  #appView .vs-crow > span:last-child { text-align:right; line-height:1.9; }
  #appView .vs-cnew { margin-top:12px; gap:8px; }

  /* ---------- màn hẹp hơn ---------- */
  @media (max-width:1100px) {
    #appView .vs-ovgrid { grid-template-columns:minmax(0,1fr); }
    #appView .vs-two { grid-template-columns:minmax(0,1fr); }
  }
  @media (max-width:960px) {
    #appView .vs-grid, #appView .vs-grid.is-step2 { grid-template-columns:minmax(0,1fr); }
  }
  @media (max-width:900px) {
    #appView .hub-heading.vs-hd-d { grid-template-columns:minmax(0,1fr); }
    #appView .vs-hd-d .vs-hact { justify-content:flex-start; }
  }
  @media (max-width:760px) {
    #appView .vs-seg { gap:20px; }
    #appView .vs-ov { gap:16px; }
    #appView .vs-kpis, #appView .vs-kpis.has-od { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
    #appView button.vs-kpi { padding:12px 14px; }
    #appView .vs-kn b, #appView .vs-pm b { font-size:22px; }
    #appView .hub-card.vs-flowcard { padding:14px; gap:16px; }
    #appView .vs-pace { flex:1 1 100%; }
    #appView .vs-pm { padding:0 8px; }
    #appView .vs-pm > span, #appView .vs-pm > small { white-space:normal; }
    #appView .vs-pm:first-child { padding-left:0; border-left:0; }
    #appView .vs-trow { display:grid; grid-template-columns:auto minmax(0,1fr) auto; grid-template-areas:"no name open" "chips chips chips"; gap:4px 10px; padding:8px 14px; }
    #appView .vs-trow .vs-no { grid-area:no; } #appView .vs-trow .vs-tname { grid-area:name; } #appView .vs-trow .vs-open { grid-area:open; }
    #appView .vs-trow .vs-tchips { grid-area:chips; justify-content:flex-start; }
    #appView .vs-ip-tbl .vs-ipdays { display:none; }
    #appView .vs-ipd { display:block; }
    #appView .vs-fgrid, #appView .vs-row2, #appView .vs-row3 { grid-template-columns:1fr; }
    #appView .hub-card.vs-form { padding:16px; }
    #appView .vs-strip { overflow-x:auto; padding-bottom:4px; }
    #appView .vs-strip li { flex:0 0 92px; }
    #appView .vs-search, #appView .vs-filters .vs-search-ac { flex:1 1 100%; max-width:none; }
    #appView .vs-ac-pop { min-width:0; width:calc(100% + 36px); }
  }

  /* ---------- Máy tính (≥ 901px): theo phác thảo ở 1440 ---------- */
  @media (min-width:901px) {
    #appView .vs-grid, #appView .vs-grid.is-step2 { grid-template-columns:minmax(0,1fr) 320px; gap:20px; }
    #appView .vs-grid.is-step1, #appView .vs-grid.is-step3, #appView .vs-grid.is-step5, #appView .vs-grid.is-step6, #appView .vs-grid.is-step7, #appView .vs-grid.is-closed { grid-template-columns:minmax(0,1fr); }
    #appView .vs-list-tbl { min-width:980px; }
    #appView .vs-hact > .ui-more { display:none; }   /* máy tính: mọi nút đã nằm ngoài, ⋯ chỉ dùng trên điện thoại */
  }
  /* Nút đầu màn "Hủy hồ sơ": viền như nút khác, chữ đỏ */
  #appView button.vs-hbtn.vs-hcancel { color:#9B2F23; }
  #appView button.vs-hbtn.vs-hcancel:hover { border-color:#D9A39B !important; background:#FBEFEC; }
  /* Khung Giấy tờ: + Thêm giấy tờ · Ép chuyển với lý do… · Đánh dấu đủ hồ sơ (cùng cỡ 34px) */
  #appView .vs-sech-acts { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:8px; }
  #appView .vs-sech-acts button.vs-hbtn, #appView .vs-sech-acts .primary { height:34px; min-height:34px; padding:0 14px; border-radius:10px; font-size:13px; white-space:nowrap; }
  #appView .vs-sech-acts .primary { font-weight:700; }
  #appView .vs-sech-acts .primary.is-off { opacity:.5; cursor:not-allowed; }
}

/* Hộp thoại (gắn vào body), mẫu 4.7 */
.vs-viewer { width:min(1100px, calc(100vw - 24px)); height:calc(100dvh - 48px); padding:0; overflow:hidden; border:0; border-radius:16px; background:#fff; }
.vs-viewer[open] { display:flex; flex-direction:column; }
.vs-viewer::backdrop { background:rgba(20, 16, 10, .6); }
.vs-viewer header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px 10px 18px; border-bottom:1px solid #EFE9DD; }
.vs-viewer header b { overflow:hidden; font-size:14px; text-overflow:ellipsis; white-space:nowrap; }
.vs-viewer header button { flex:none; width:32px; height:32px; padding:0; border:0; border-radius:10px; background:none; color:inherit; font-size:22px; line-height:1; cursor:pointer; }
.vs-viewer header button:hover { background:#F1ECE4; }
.vs-viewer-b { display:grid; flex:1 1 auto; min-height:0; place-items:center; overflow:auto; background:#FAF7F2; }
.vs-viewer-b img { display:block; max-width:100%; max-height:100%; object-fit:contain; }
.vs-viewer-b iframe { width:100%; height:100%; border:0; background:#fff; }
.vs-viewer-b p { padding:20px; }
.vs-dlg { width:min(560px, calc(100vw - 24px)); border-radius:16px; }
.vs-dlg.is-wide { width:min(980px, calc(100vw - 24px)); }
.vs-dlg form { display:flex; flex-direction:column; max-height:calc(100dvh - 48px); padding:20px 22px; }
.vs-dlg header { margin-bottom:14px; }
.vs-dlg header h2 { margin:0 0 2px; font-size:17px; font-weight:700; }
.vs-dlg .vs-dlg-body { flex:1 1 auto; min-height:0; overflow:auto; padding:2px; }
.vs-dlg .vs-dlg-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px 14px; }
.vs-dlg .vs-f { margin-bottom:0; }
.vs-dlg .vs-f textarea { padding:8px 10px; font:inherit; resize:vertical; }
.vs-dlg .vs-alert { margin-bottom:12px; }
.vs-dlg .vs-hint { margin:0 0 10px; }
.vs-dlg .vs-dlg-grid .vs-hint { margin:0; }
.vs-dlg .vs-cmsg { margin:0; font-size:14px; line-height:1.5; }
.vs-dlg .vs-seg { display:flex; gap:6px; flex-wrap:wrap; }
.vs-dlg .vs-seg label { position:relative; cursor:pointer; }
.vs-dlg .vs-seg input { position:absolute; opacity:0; pointer-events:none; }
.vs-dlg .vs-seg span { display:inline-flex; align-items:center; min-height:36px; padding:0 16px; border:1px solid #E4DACA; border-radius:10px; font-size:14px; font-weight:600; }
.vs-dlg .vs-seg input:checked + span { border-color:#EFE2CC; background:#EFE2CC; color:#6E4A1C; }
.vs-dlg .vs-seg input:focus-visible + span { outline:2px solid #9A6A2E; outline-offset:2px; }
.vs-dlg .vs-fee { max-width:220px; margin-bottom:12px; }
.vs-dlg .vs-edit-tbl { width:100%; min-width:720px; border-collapse:collapse; table-layout:fixed; }
.vs-dlg .vs-edit-tbl th { padding:8px 6px; text-align:left; font-size:12px; font-weight:600; text-transform:none; letter-spacing:0; }
.vs-dlg .vs-edit-tbl td { padding:6px; border-top:1px solid #EFE9DD; vertical-align:top; }
.vs-dlg .vs-edit-tbl th:nth-child(1) { width:22%; } .vs-dlg .vs-edit-tbl th:nth-child(2) { width:64px; } .vs-dlg .vs-edit-tbl th:nth-child(5) { width:96px; }
.vs-dlg .vs-edit-tbl input:not([type="checkbox"]), .vs-dlg .vs-edit-tbl textarea { width:100%; box-sizing:border-box; font:inherit; font-size:13px; }
.vs-dlg .vs-edit-tbl textarea { min-height:60px; padding:6px 8px; resize:vertical; }
.vs-dlg .vs-edit-tbl .vs-cb { padding-top:8px; font-size:13px; white-space:nowrap; }
.vs-dlg .hub-error { padding:8px 0 0; color:#9B2F23; font-size:13px; }
.vs-dlg .btn-row { display:flex; justify-content:flex-end; gap:8px; margin-top:16px; }
.vs-dlg .primary.vs-danger { background:#9B2F23; border-color:#9B2F23; }
.vs-dlg [hidden] { display:none !important; }
@media (max-width:560px) { .vs-dlg .vs-dlg-grid { grid-template-columns:1fr; } .vs-dlg form { padding:16px; } }

/* ==========================================================================
   Điện thoại / màn hẹp (≤ 900px), theo CRM mobile (MOBILE-UI-GUIDELINE): đầu màn chi tiết [←] · tiêu đề · ⋯ (nút viền vào ⋯, nút đặc dưới tiêu đề),
   bộ lọc một hàng chip cuộn ngang, bảng danh sách → thẻ theo dòng, bảng giấy tờ → mục theo dòng, cột phải xuống dưới, popup toàn màn, ô nhập 16px.
   ========================================================================== */
@media screen and (max-width:900px) {
  /* ---- đầu màn chi tiết / tạo hồ sơ ---- */
  #appView .hub-heading.vs-hd-d, #appView :is(#workWorkspace, #customerWorkspace, #rpRoot) .hub-heading.vs-hd-d { display:grid; grid-template-columns:40px minmax(0,1fr) auto; grid-template-areas:"back title more" "next next next"; align-items:center; gap:10px 6px; }
  #appView .vs-hd-d .vs-back { grid-area:back; display:grid; place-items:center; align-self:start; width:40px; height:40px; min-height:40px; margin:-4px 0 0 -10px; border-radius:10px; color:#25211C; font-size:0; gap:0; }
  #appView .vs-hd-d .vs-back svg { width:20px; height:20px; }
  #appView .vs-hd-d .vs-back:hover { background:#FAF7F2; color:#25211C; }
  #appView .vs-hd-d .vs-hd-title { grid-area:title; }
  #appView .vs-hd-d:not(:has(.vs-hact)) { grid-template-areas:"back title title"; }
  #appView .vs-hd-d:not(:has(.vs-hact)) .vs-back { align-self:center; margin-top:0; }
  #appView .vs-hd-d .vs-h1 { gap:6px 8px; }
  #appView .vs-hd-d .vs-h1 h1 { flex:1 1 100%; font-size:17px; line-height:1.3; }
  #appView .vs-hd-d .vs-hsub { margin-top:2px; font-size:12px; }
  #appView .vs-hd-d .vs-hact { display:contents; }
  #appView .vs-hd-d .vs-hact:has(.ui-more) .vs-hbtn { display:none; }
  #appView .vs-hd-d .vs-hact .vs-hbtn { grid-area:next; justify-self:start; height:44px; min-height:44px; }
  #appView .vs-hd-d .vs-hact .ui-more { grid-area:more; align-self:start; }
  #appView .vs-hd-d .vs-hact .primary { grid-area:next; width:100%; height:44px; min-height:44px; }
  /* màn danh sách: Visa · nút tạo; hàng tab cuộn ngang */
  #appView .hub-heading.vs-hd { gap:12px 10px; }
  #appView .vs-seg { gap:22px; margin:0 -12px; padding:0 12px; }
  #appView .vs-hd .vs-new { padding:0 14px; }

  /* ---- Tổng hợp ---- */
  #appView .vs-ov { gap:20px; }
  #appView .vs-kpis, #appView .vs-kpis.has-od { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  #appView .vs-kpis > .vs-kpi:last-child:nth-child(odd) { grid-column:1 / -1; }
  #appView button.vs-kpi { gap:4px; padding:12px 14px; }
  #appView .vs-kn b, #appView .vs-pm b { font-size:22px; }
  #appView .vs-ch h2 { font-size:15px; }
  #appView .hub-card.vs-flowcard { gap:16px; padding:14px; }
  #appView .vs-pace { flex:1 1 100%; }
  #appView .vs-pm { padding:0 8px; }
  #appView .vs-pm:first-child { padding-left:0; border-left:0; }
  #appView .vs-pm > span, #appView .vs-pm > small { white-space:normal; }

  /* ---- Hồ sơ: ô tìm cả hàng; dưới là tháng + hàng chip trạng thái cuộn ngang ---- */
  #appView #vsBody:has(> #vsChips) { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
  #appView #vsBody:has(> #vsChips) > .vs-filters { display:contents; }
  #appView #vsBody:has(> #vsChips) > #vsCases { flex:1 1 100%; min-width:0; margin-top:4px; }
  #appView .vs-search, #appView .vs-filters .vs-search-ac { flex:1 1 100%; max-width:none; height:44px; }
  #appView .vs-search input, #appView .vs-search .vs-ac input { height:42px; font-size:16px; }
  #appView .vs-month { flex:none; }
  #appView .vs-month select { font-size:16px; font-weight:500; }
  #appView .vs-filters #vsClear { flex:none; height:36px; min-height:36px; }
  #appView .vs-chips { flex:1 1 0; flex-wrap:nowrap; min-width:0; margin:0 -12px 0 0; padding-right:12px; overflow-x:auto; scrollbar-width:none; }
  #appView .vs-chips::-webkit-scrollbar { display:none; }
  #appView .vs-chips > .vs-fc { flex:0 0 auto; }
  #appView .vs-filters { gap:8px; margin-bottom:12px; }
  #appView .vs-ac-pop { min-width:0; width:calc(100% + 36px); }

  /* bảng danh sách hồ sơ → thẻ theo dòng */
  #appView .hub-card.vs-tblcard:has(> .tbl-wrap > .vs-list-tbl) { overflow:visible; border:0; border-radius:0; background:none; }
  #appView .vs-tblcard > .tbl-wrap { overflow:visible; }
  #appView .hub-table.vs-list-tbl { display:block; width:100%; min-width:0; }
  #appView .hub-table:is(.vs-list-tbl, .vs-rec-tbl, .vs-tpl-tbl) thead { display:none; }
  #appView .vs-list-tbl tbody { display:flex; flex-direction:column; gap:8px; }
  #appView .vs-list-tbl tbody tr { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; grid-template-areas:"no no open" "cust cust open" "type type type" "st st st" "via due out"; gap:6px 12px; padding:14px 14px 14px 16px; border:1px solid #E4DACA; border-radius:16px; background:#fff; }
  #appView .hub-table:is(.vs-list-tbl, .vs-rec-tbl, .vs-tpl-tbl) tbody td, #appView .hub-table:is(.vs-list-tbl, .vs-rec-tbl, .vs-tpl-tbl) tbody :is(td:first-child, td:last-child) { display:block; height:auto; min-width:0; padding:0; border:0; text-align:left; white-space:normal; }
  #appView .vs-list-tbl td.vs-c-no { grid-area:no; white-space:nowrap; }
  #appView .vs-list-tbl td.vs-c-cust { grid-area:cust; }
  #appView .vs-list-tbl td.vs-c-type { grid-area:type; font-size:13px; }
  #appView .vs-list-tbl td.vs-c-via { grid-area:via; font-size:13px; }
  #appView .vs-list-tbl td.vs-c-st { grid-area:st; }
  #appView .vs-list-tbl td.vs-c-due { grid-area:due; font-size:13px; }
  #appView .vs-list-tbl td.vs-c-out { grid-area:out; }
  #appView .vs-list-tbl td.vs-actc { grid-area:open; align-self:start; }
  #appView .vs-list-tbl tbody tr:hover { background:#fff; }
  #appView .hub-table:is(.vs-list-tbl, .vs-rec-tbl, .vs-tpl-tbl, .vs-tbl) td[data-label]::before { content:attr(data-label); display:block; margin-bottom:3px; color:#6F655A; font-size:12px; font-weight:500; }
  #appView .vs-tblcard:has(> .tbl-wrap > .vs-list-tbl) > .vs-tfoot { padding:10px 4px 0; border-top:0; }
  #appView :is(.vs-list-tbl, .vs-rec-tbl, .vs-tpl-tbl) button.vs-ob { height:36px; min-height:36px; padding:0 14px; }
  #appView .vs-type { white-space:normal; }

  /* Kho visa & hộ chiếu: bảng → mục theo dòng trong thẻ */
  #appView .vs-two { grid-template-columns:minmax(0,1fr); }
  #appView .hub-table.vs-rec-tbl { display:block; width:100%; min-width:0; }
  #appView .vs-rec-tbl tbody { display:block; }
  #appView .vs-rec-tbl tbody tr { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; gap:8px 12px; padding:14px 16px; border-top:1px solid #EFE9DD; }
  #appView .vs-tblcard .vs-rec-tbl tbody tr { grid-template-areas:"cust cust open" "kind vno vno" "iss exp exp" "src src src"; }
  #appView .vs-two .vs-rec-tbl tbody tr { grid-template-areas:"vno exp act" "kind iss act" "src img img"; padding:12px 0; }
  #appView .vs-rec-tbl tbody tr:hover { background:transparent; }
  #appView .vs-rec-tbl td.vs-c-cust { grid-area:cust; }
  #appView .vs-rec-tbl td.vs-c-kind { grid-area:kind; }
  #appView .vs-rec-tbl td.vs-c-vno { grid-area:vno; overflow-wrap:anywhere; }
  #appView .vs-rec-tbl td.vs-c-iss { grid-area:iss; }
  #appView .vs-rec-tbl td.vs-c-exp { grid-area:exp; }
  #appView .vs-rec-tbl td.vs-c-src { grid-area:src; }
  #appView .vs-rec-tbl td.vs-c-img { grid-area:img; }
  #appView .vs-rec-tbl td.vs-actc { grid-area:open; align-self:start; text-align:right; }
  #appView .vs-two .vs-rec-tbl td.vs-actc { grid-area:act; }
  #appView .vs-tblcard .vs-rec-tbl td.vs-c-exp::before { content:"Hạn"; display:block; margin-bottom:3px; color:#6F655A; font-size:12px; font-weight:500; }
  #appView .vs-two .vs-rec-tbl td.vs-c-kind::before { content:"Loại"; display:block; margin-bottom:3px; color:#6F655A; font-size:12px; font-weight:500; }
  #appView .vs-two .vs-rec-tbl td.vs-c-vno::before { content:"Số visa"; display:block; margin-bottom:3px; color:#6F655A; font-size:12px; font-weight:500; }
  #appView .vs-two .vs-rec-tbl td.vs-c-exp { align-self:end; }
  #appView .vs-two .vs-rec-tbl td.vs-c-img:has(.vs-thumbs:empty) { display:none; }
  #appView .vs-two .tbl-wrap { overflow:visible; }
  #appView .vs-tblcard .vs-rec-tbl tbody tr:first-child, #appView .vs-two .vs-rec-tbl tbody tr:first-child { border-top:1px solid #EFE9DD; }
  #appView .vs-pp-no b { font-size:18px; }

  /* Danh mục: bảng → mục theo dòng trong thẻ */
  #appView .hub-table.vs-tpl-tbl { display:block; width:100%; min-width:0; }
  #appView .vs-tpl-tbl tbody { display:block; }
  #appView .vs-tpl-tbl tbody tr { display:grid; grid-template-columns:auto auto minmax(0,1fr) auto; grid-template-areas:"name name name open" "n fee ed open"; align-items:center; gap:6px 12px; padding:12px 14px 12px 16px; border-top:1px solid #EFE9DD; }
  #appView .vs-tpl-tbl tbody tr:first-child { border-top:0; }
  #appView .vs-tpl-tbl td.vs-c-name { grid-area:name; }
  #appView .vs-tpl-tbl td.vs-c-n { grid-area:n; color:#6F655A; font-size:13px; }
  #appView .vs-tpl-tbl td.vs-c-fee { grid-area:fee; color:#6F655A; font-size:13px; }
  #appView .vs-tpl-tbl td.vs-c-ed { grid-area:ed; }
  #appView .vs-tpl-tbl td.vs-actc { grid-area:open; }
  #appView .vs-tpl-tbl td.vs-c-n.r, #appView .vs-tpl-tbl td.vs-c-fee.r, #appView .vs-tpl-tbl td.vs-c-ed.r { text-align:left; }

  /* ---- chi tiết hồ sơ ---- */
  #appView section.vs-head { padding:4px 0; }
  #appView .vs-facts { display:grid; grid-template-columns:minmax(0,1fr); gap:0; }
  #appView .vs-fact { align-items:center; min-height:44px; padding:6px 14px; border-left:0; border-top:1px solid #EFE9DD; }
  #appView .vs-fact:first-child { border-top:0; }
  #appView .vs-fact > span { flex:0 0 76px; }
  #appView .vs-fact > div { min-width:0; font-size:14px; }
  #appView .vs-fact select { height:40px; min-height:40px; font-size:16px; }
  #appView .vs-money { height:40px; }
  #appView .vs-money input { height:36px; font-size:16px; }
  /* thanh 7 bước cuộn ngang */
  #appView section.vs-flow { padding:14px 0; }
  #appView .vs-strip { overflow-x:auto; padding:0 8px 4px; scrollbar-width:none; }
  #appView .vs-strip::-webkit-scrollbar { display:none; }
  #appView .vs-strip li { flex:1 0 92px; }
  #appView .vs-next { margin:14px 12px 0; }
  #appView .vs-next button { height:44px; min-height:44px; }
  #appView .vs-flow .vs-alert { margin:12px 12px 0; }
  /* cột phải xuống dưới */
  #appView .vs-grid, #appView .vs-grid.is-step2 { grid-template-columns:minmax(0,1fr); gap:12px; }
  #appView .hub-card.vs-sec, #appView #vsLog { padding:14px; }
  #appView .vs-pen, #appView button.vs-pen { height:36px; min-height:36px; padding:0 12px; }
  #appView .vs-pin { width:160px; height:40px; min-height:40px; font-size:16px; }
  #appView .vs-cb input { width:20px; height:20px; }
  #appView .vs-kvs .vs-cb { min-height:48px; }
  #appView .vs-sech button.vs-ob, #appView .vs-side button.vs-ob { height:40px; min-height:40px; }
  #appView .vs-sech-acts { justify-content:flex-start; }
  #appView .vs-sech-acts button.vs-hbtn, #appView .vs-sech-acts .primary { height:40px; min-height:40px; }

  /* bảng giấy tờ (bước 1, 2, 4) → mục theo dòng trong thẻ */
  #appView #vsTable { padding:14px; }
  #appView #vsTable.is-flush > .vs-sech { padding:14px; }
  #appView #vsTable .tbl-wrap:has(> .vs-tbl:not(.vs-s7tbl)) { overflow:visible; }
  #appView .hub-table.vs-tbl:not(.vs-s7tbl) { display:block; width:100%; min-width:0; }
  #appView .vs-tbl:not(.vs-s7tbl) thead { display:none; }
  #appView .vs-tbl:not(.vs-s7tbl) tbody { display:block; }
  #appView .vs-tbl:not(.vs-s7tbl) tbody tr { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:10px 12px; padding:14px 0; border-top:1px solid #EFE9DD; }
  #appView #vsTable.is-flush .vs-tbl:not(.vs-s7tbl) tbody tr { padding:14px; }
  #appView .vs-tbl:not(.vs-s7tbl) tbody tr:first-child { border-top:0; }
  #appView #vsTable.is-flush .vs-tbl:not(.vs-s7tbl) tbody tr:first-child { border-top:1px solid #EFE9DD; }
  #appView .hub-table.vs-tbl:not(.vs-s7tbl) tbody :is(td, td:first-child, td:last-child) { display:block; width:auto; min-width:0; max-width:none; padding:0; border:0; text-align:left; white-space:normal; }
  #appView .vs-tbl:not(.vs-s7tbl) tr.is-bad td:first-child { box-shadow:none; }
  #appView .vs-tbl:not(.vs-s7tbl) tr.is-bad { box-shadow:inset 3px 0 0 #9B2F23; }
  #appView .vs-tbl:not(.vs-s7tbl) td.vs-doc { grid-column:1 / 3; }
  #appView .vs-tbl:not(.vs-s7tbl) td.vs-req { grid-column:1 / -1; }
  #appView .vs-tbl:not(.vs-s7tbl) td.vs-rmk { grid-column:1 / -1; }
  #appView .vs-tbl:not(.vs-s7tbl) td.vs-req:empty { display:none; }
  #appView .vs-tbl .vs-thumbs { flex-wrap:wrap; width:auto; max-width:none; padding:0; overflow:visible; }
  #appView .vs-tbl .vs-th, #appView .vs-tbl .vs-add { width:44px; height:44px; }
  #appView .vs-remark { max-width:none; height:44px; min-height:44px; font-size:16px; }
  #appView .vs-qty { width:56px; height:40px; min-height:40px; font-size:16px; }
  #appView button.vs-got { height:40px; min-height:40px; }
  #appView button.vs-cyc { height:28px; }
  /* bước 2: tên · trạng thái / yêu cầu / nhận · ảnh · thao tác / ghi chú */
  #appView .vs-tbl:not(.vs-s1tbl):not(.vs-s4tbl):not(.vs-s7tbl) td.vs-c-st { grid-column:3; grid-row:1; justify-self:end; }
  #appView .vs-tbl:not(.vs-s1tbl):not(.vs-s4tbl):not(.vs-s7tbl) td.vs-qcell { grid-column:1; text-align:left; }
  #appView .vs-tbl:not(.vs-s1tbl):not(.vs-s4tbl):not(.vs-s7tbl) td.vs-c-img { grid-column:2; align-self:end; }
  #appView .vs-tbl:not(.vs-s1tbl):not(.vs-s4tbl):not(.vs-s7tbl) td.vs-act { grid-column:3; align-self:end; }
  #appView .vs-tbl:not(.vs-s1tbl):not(.vs-s4tbl):not(.vs-s7tbl) td.vs-rmk { grid-row:4; }
  /* bước 1: tên · số lượng / yêu cầu / lưu ý */
  #appView .vs-s1tbl td.vs-qcell { grid-column:3; grid-row:1; text-align:right; }
  #appView .vs-s1tbl td.vs-c-note:has(.vs-lnote:empty) { display:none; }
  #appView .hub-table.vs-s1tbl tbody td.vs-s1x { grid-column:1 / -1; justify-self:end; padding:0; }
  /* bước 4: tên · hiện có / bàn giao · chất lượng / ghi chú */
  #appView .vs-s4tbl td.vs-have { grid-column:3; grid-row:1; }
  #appView .vs-s4tbl td.vs-c-hand { grid-column:1 / 3; }
  #appView .vs-s4tbl td.vs-c-qual { grid-column:3; }
  #appView .vs-pick { height:40px; min-height:40px; font-size:16px; }
  /* thẻ giấy tờ (bước 3, hồ sơ đã kết thúc) và các biểu mẫu bước 1/5/7 */
  #appView .vs-dcards { grid-template-columns:minmax(0,1fr); }
  #appView .vs-dcard .vs-th, #appView .vs-dcard .vs-add { width:64px; height:64px; }
  #appView :is(.vs-s1form, .vs-s5form, .vs-s7form, .vs-form, .vs-fgrid) :is(input, select, textarea) { min-height:44px; font-size:16px; }
  #appView .vs-s1foot button, #appView .vs-s7btns button, #appView .vs-form .btn-row button { height:44px; min-height:44px; }
  #appView .vs-s1ppb, #appView .vs-s1form, #appView .vs-s5form, #appView .vs-s6, #appView .vs-s7, #appView .vs-cl-top { grid-template-columns:minmax(0,1fr); }
  #appView .vs-s5form .vs-f, #appView .vs-s5form .vs-f:nth-child(-n+2) { grid-column:auto; }
  #appView .vs-fgrid, #appView .vs-row2, #appView .vs-row3 { grid-template-columns:minmax(0,1fr); }
  #appView .hub-card.vs-form { padding:16px; }

  /* ---- hộp thoại: toàn chiều ngang, bo trên 16, nút ở chân ---- */
  dialog.ot-pop.vs-dlg, dialog.ot-pop.vs-dlg.is-wide { width:100%; max-width:none; max-height:calc(100dvh - 12px); margin:auto 0 0; border:0; border-radius:16px 16px 0 0; }
  .vs-dlg form { max-height:calc(100dvh - 12px); padding:18px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .vs-dlg .vs-dlg-grid { grid-template-columns:minmax(0,1fr); }
  .vs-dlg .vs-f :is(input, select, textarea), .vs-dlg .vs-edit-tbl :is(input, textarea) { min-height:44px; font-size:16px; }
  .vs-dlg .btn-row { margin-top:12px; }
  .vs-dlg .btn-row button { flex:1 1 0; height:44px; min-height:44px; }
  .vs-viewer { width:100%; max-width:none; height:100dvh; max-height:none; margin:0; border-radius:0; }
  .vs-viewer header button { width:44px; height:44px; }
}

/* Nhãn tab rút gọn (visa.js showTab): chỉ hiện ở điện thoại */
#appView .vs-seg .vs-tl-s { display:none; }

/* ===== MOBILE 11/2026 (≤ 760px) — docs/MOBILE-UI-SPEC.md ===== */
@media screen and (max-width: 760px) {
  /* ---- đầu màn + tab: nút "+ Tạo hồ sơ", nhãn tab ngắn để cả hàng vừa màn ---- */
  body.sales-shell #appView .vs-hd .vs-lbl-x { display:none; }
  body.sales-shell #appView .vs-hd .vs-new { height:40px; min-height:40px; padding:0 14px; border-radius:12px; }
  body.sales-shell #appView .vs-seg { flex:0 0 calc(100% + 24px); width:calc(100% + 24px); max-width:none; box-sizing:border-box; gap:20px; }
  body.sales-shell #appView .vs-seg .vs-tl-l { display:none; }
  body.sales-shell #appView .vs-seg .vs-tl-s { display:inline; }
  body.sales-shell #appView .vs-hd-d .vs-h1 h1 { font-weight:800; }

  /* ---- Tổng hợp: ô số nền nhạt không viền; dòng chảy: thanh màu + chú thích 2 cột; nhịp độ 3 cột ---- */
  body.sales-shell #appView .vs-kpis, body.sales-shell #appView .vs-kpis.has-od { gap:8px; }
  body.sales-shell #appView button.vs-kpi, body.sales-shell #appView button.vs-kpi:hover { gap:4px; padding:12px; border:0 !important; border-radius:12px; background:var(--m-wash) !important; }
  body.sales-shell #appView .vs-kl { align-items:flex-start; font-size:12px; line-height:1.3; }
  body.sales-shell #appView .vs-kl svg { margin-top:1px; }
  body.sales-shell #appView .vs-kn b { font-size:20px; }
  body.sales-shell #appView .vs-kn small { font-size:12px; }
  body.sales-shell #appView .vs-ks { gap:4px 6px; font-size:12px; line-height:1.35; }
  body.sales-shell #appView .hub-card.vs-flowcard { gap:14px; padding:14px; border-color:var(--m-line); border-radius:14px; }
  body.sales-shell #appView .vs-fl-main { display:grid; gap:12px; width:100%; }
  body.sales-shell #appView .vs-fbar { height:30px; gap:3px; }
  body.sales-shell #appView button.vs-fs { min-width:24px; padding:0 4px; border-radius:6px; font-size:12px; }
  body.sales-shell #appView .vs-flegend { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:2px 14px; }
  body.sales-shell #appView button.vs-fk { min-width:0; min-height:32px; font-size:13px; text-align:left; }
  body.sales-shell #appView button.vs-fk span { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  body.sales-shell #appView .vs-pace { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); width:100%; padding-top:12px; border-top:1px solid var(--m-line-soft); }
  body.sales-shell #appView .vs-pm { padding:0 8px; }
  body.sales-shell #appView .vs-pm:first-child { padding-left:0; border-left:0; }
  body.sales-shell #appView .vs-pm b { font-size:18px; }
  body.sales-shell #appView .vs-pm b small { margin-left:2px; font-size:12px; }
  body.sales-shell #appView .vs-pm > span { font-size:12px; line-height:1.3; }
  body.sales-shell #appView .vs-pm > small { font-size:12px; line-height:1.3; }
  body.sales-shell #appView .hub-card.vs-ovcard { border-color:var(--m-line); border-radius:14px; }
  /* Hồ sơ đang xử lý: bảng → thẻ (số hồ sơ · hạn nộp / khách / trạng thái) */
  body.sales-shell #appView .vs-ip .hub-card.vs-ovcard { overflow:visible; border:0; border-radius:0; background:none; box-shadow:none; }
  body.sales-shell #appView .vs-ip .tbl-wrap { overflow:visible; }
  body.sales-shell #appView .vs-ip .tbl-wrap table.vs-ip-tbl { display:block; }
  body.sales-shell #appView .vs-ip-tbl thead { display:none; }
  body.sales-shell #appView .vs-ip-tbl tbody { display:flex; flex-direction:column; gap:10px; }
  body.sales-shell #appView .vs-ip-tbl tbody tr { display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"no due" "st st"; gap:8px 12px; padding:14px; border:1px solid var(--m-line); border-radius:14px; background:#fff; }
  body.sales-shell #appView .vs-ip-tbl tbody tr:hover { background:#fff; }
  body.sales-shell #appView .hub-table.vs-ip-tbl tbody td, body.sales-shell #appView .hub-table.vs-ip-tbl tbody :is(td:first-child, td:last-child) { display:block; height:auto; min-width:0; padding:0; border:0; background:none; text-align:left; white-space:normal; }
  body.sales-shell #appView .vs-ip-tbl td:first-child { grid-area:no; }
  body.sales-shell #appView .vs-ip-tbl td:first-child > b { font-size:15px; }
  body.sales-shell #appView .vs-ip-tbl .vs-ipc { display:block; margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
  body.sales-shell #appView .hub-table.vs-ip-tbl tbody td:nth-child(2) { grid-area:st; display:flex; align-items:center; flex-wrap:wrap; gap:6px 10px; }
  body.sales-shell #appView .vs-ip-tbl td:nth-child(2) .vs-ipd { display:inline; margin:0; font-size:12px; }
  body.sales-shell #appView .hub-table.vs-ip-tbl td.vs-ipdays { display:none; }
  body.sales-shell #appView .hub-table.vs-ip-tbl tbody td.vs-ipdue { grid-area:due; font-size:13px; text-align:right; }
  body.sales-shell #appView .vs-ip-tbl td.vs-ipdue::before { content:"Hạn nộp "; color:var(--m-sub); font-weight:500; }
  body.sales-shell #appView .hub-table.vs-ip-tbl tbody td.vs-ipdue:has(.vs-dash) { display:none; }
  body.sales-shell #appView .vs-mtbl :is(th, td) { padding:10px 12px; font-size:13px; }

  /* ---- Hồ sơ: thẻ 3 tầng (số hồ sơ · trạng thái / khách, loại / nơi nộp · hạn), cả thẻ bấm được ---- */
  body.sales-shell #appView .vs-list-tbl tbody { gap:10px; }
  body.sales-shell #appView .vs-list-tbl tbody tr { grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"no st" "cust st" "type type" "via due" "out out"; gap:4px 0; padding:14px; border-color:var(--m-line); border-radius:14px; }
  body.sales-shell #appView .vs-list-tbl td.vs-actc { display:none; }
  body.sales-shell #appView .vs-list-tbl td.vs-c-no b { font-size:15px; }
  body.sales-shell #appView .vs-list-tbl td.vs-c-st { display:flex; flex-direction:column; align-items:flex-end; gap:2px; padding-left:12px; text-align:right; }
  body.sales-shell #appView .vs-list-tbl td.vs-c-st .vs-sub { margin:0; font-size:12px; }
  body.sales-shell #appView .vs-list-tbl td.vs-c-cust { font-size:14px; }
  body.sales-shell #appView .vs-list-tbl td.vs-c-type { color:var(--m-sub); font-size:13px; line-height:1.4; }
  body.sales-shell #appView .vs-list-tbl td:is(.vs-c-via, .vs-c-due) { margin-top:6px; padding-top:8px; border-top:1px solid var(--m-line-soft); font-size:13px; }
  body.sales-shell #appView .vs-list-tbl td.vs-c-due { text-align:right; }
  body.sales-shell #appView .hub-table.vs-list-tbl td:is(.vs-c-via, .vs-c-due)[data-label]::before { display:inline; margin:0 4px 0 0; }
  body.sales-shell #appView .vs-list-tbl td.vs-c-out:empty { display:none; }
  body.sales-shell #appView .vs-chips > .vs-fc, body.sales-shell #appView .vs-month { height:36px; min-height:36px; border-radius:18px; }
  body.sales-shell #appView .vs-month select { min-height:0; height:34px; }

  /* ---- Kho visa & hộ chiếu, Danh mục ---- */
  body.sales-shell #appView .vs-two .vs-rec-tbl tbody tr { grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-template-areas:"vno act" "exp exp" "kind iss" "src img"; }
  body.sales-shell #appView .vs-two .vs-rec-tbl td.vs-c-exp { align-self:start; }
  body.sales-shell #appView .hub-table.vs-rec-tbl tbody td.vs-actc { display:flex; align-items:flex-start; justify-content:flex-end; gap:4px; width:auto; max-width:none; }
  body.sales-shell #appView :is(.vs-rec-tbl, .vs-tpl-tbl) button:is(.vs-ob, .ui-more) { height:40px; min-height:40px; }
  body.sales-shell #appView .vs-rec-tbl .ui-more { width:40px; min-width:40px; }

  /* ---- Tạo hồ sơ: khối phẳng, cặp trường ngắn 2 cột, nút Tạo ở thanh dính đáy ---- */
  body.sales-shell #appView .hub-card.vs-form { padding:0; border:0; border-radius:0; background:none; box-shadow:none; }
  body.sales-shell #appView .vs-form .vs-row3 { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 10px; }
  body.sales-shell #appView .vs-form .vs-row3 > .vs-f:nth-child(3) { grid-column:1 / -1; }
  body.sales-shell #appView .vs-form .vs-row2 { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 10px; }
  body.sales-shell #appView .vs-form .btn-row button.primary { flex:1 1 auto; }
  body.sales-shell #appView .vs-form .btn-row button.ghost { order:-1; flex:0 0 96px; }

  /* ---- chi tiết hồ sơ ---- */
  body.sales-shell #appView .vs-fact-j > div { white-space:normal; }
  body.sales-shell #appView .vs-fact-j .vs-link { overflow:visible; text-align:left; white-space:normal; }
  /* dải 7 bước vừa một màn: vòng số đều nhau, chỉ bước hiện tại có nhãn (cột rộng hơn) */
  body.sales-shell #appView .vs-strip { overflow:visible; padding:0 6px; }
  body.sales-shell #appView .vs-strip li { flex:1 1 0; min-width:0; gap:4px; padding:0; }
  body.sales-shell #appView .vs-strip li.c { flex:3 1 0; }
  body.sales-shell #appView .vs-strip li:not(.c) :is(.vs-sl, small) { display:none; }
  body.sales-shell #appView .vs-strip li.c .vs-sl { font-size:12px; }
  body.sales-shell #appView .vs-strip.is-cancelled li :is(.vs-sl, small) { display:none; }
  body.sales-shell #appView .vs-strip.is-cancelled li.c :is(.vs-sl, small) { display:block; }
  body.sales-shell #appView .vs-strip li.c button.vs-stepb { gap:4px; }

  /* ---- hộp thoại: tiêu đề trên, nội dung cuộn, nút luôn ở đáy ---- */
  body.sales-shell dialog.vs-dlg[open] { display:flex; flex-direction:column; overflow:hidden; padding-bottom:0; }
  body.sales-shell .vs-dlg form { flex:1 1 auto; min-height:0; max-height:92dvh; box-sizing:border-box; }
  body.sales-shell .vs-dlg header h2 { font-size:16px; font-weight:800; overflow-wrap:anywhere; }
  body.sales-shell .vs-dlg .btn-row { flex:none; padding-top:10px; border-top:1px solid #EFE9DD; }
  body.sales-shell .vs-dlg .btn-row button { height:46px; min-height:46px; border-radius:12px; font-size:15px; }
  body.sales-shell .vs-dlg .btn-row button.primary { flex-grow:1.6; }
  body.sales-shell .vs-dlg .vs-fee { max-width:none; }
  /* Sửa danh mục giấy tờ: bảng → mỗi giấy tờ một khối (tên · SL / yêu cầu / lưu ý / tùy chọn) */
  body.sales-shell .vs-dlg .tbl-wrap:has(> .vs-edit-tbl) { overflow:visible; border:0; }
  body.sales-shell .vs-dlg .vs-edit-tbl { display:block; width:100%; min-width:0; table-layout:auto; }
  body.sales-shell .vs-dlg .vs-edit-tbl thead { display:none; }
  body.sales-shell .vs-dlg .vs-edit-tbl tbody { display:block; }
  body.sales-shell .vs-dlg .vs-edit-tbl tr { display:grid; grid-template-columns:minmax(0,1fr) 76px; grid-template-areas:"name qty" "req req" "note note" "opt opt"; align-items:end; gap:10px; padding:14px 0; border-top:1px solid #EFE9DD; }
  body.sales-shell .vs-dlg .vs-edit-tbl td { display:block; min-width:0; padding:0; border:0; }
  body.sales-shell .vs-dlg .vs-edit-tbl td[data-label]::before { content:attr(data-label); display:block; margin-bottom:4px; color:var(--m-sub); font-size:13px; font-weight:600; }
  body.sales-shell .vs-dlg .vs-edit-tbl td.vs-e-name { grid-area:name; }
  body.sales-shell .vs-dlg .vs-edit-tbl td.vs-e-qty { grid-area:qty; }
  body.sales-shell .vs-dlg .vs-edit-tbl td.vs-e-req { grid-area:req; }
  body.sales-shell .vs-dlg .vs-edit-tbl td.vs-e-note { grid-area:note; }
  body.sales-shell .vs-dlg .vs-edit-tbl td.vs-e-opt { grid-area:opt; }
  body.sales-shell .vs-dlg .vs-edit-tbl .vs-qty { width:100%; }
  body.sales-shell .vs-dlg .vs-edit-tbl textarea { min-height:72px; }
  body.sales-shell .vs-dlg .vs-edit-tbl .vs-cb { display:inline-flex; align-items:center; gap:8px; min-height:40px; padding:0; font-size:14px; }
}

/* ===== MOBILE 11/2026 — ĐỢT 2: mật độ & căn chữ (docs/MOBILE-UI-SPEC.md "Đợt 2") ===== */
@media screen and (max-width: 760px) {
  body.sales-shell #appView .vs-ov { gap:16px; }
  body.sales-shell #appView .vs-flowsec { display:grid; gap:8px; }
  body.sales-shell #appView .vs-ch h2 { gap:8px; font-size:15px; }
  /* ---- dòng chảy: ô số → một dải số 2 cột kẻ ngăn ---- */
  body.sales-shell #appView .vs-kpis, body.sales-shell #appView .vs-kpis.has-od { grid-template-columns:repeat(2,minmax(0,1fr)); gap:1px; overflow:hidden; border-radius:12px; background:#EADFCF; }
  body.sales-shell #appView .vs-kpis > .vs-kpi:last-child:nth-child(odd) { grid-column:auto; }
  body.sales-shell #appView .vs-kpis:has(> .vs-kpi:last-child:nth-child(odd))::after { content:""; background:var(--m-wash); }
  body.sales-shell #appView button.vs-kpi, body.sales-shell #appView button.vs-kpi:hover { gap:2px; min-width:0; padding:8px 12px; border-radius:0; }
  body.sales-shell #appView .vs-kl { align-items:center; gap:4px; min-width:0; font-size:12px; font-weight:600; line-height:1.35; }
  body.sales-shell #appView .vs-kl svg { display:none; }
  body.sales-shell #appView .vs-kl > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  body.sales-shell #appView .vs-kn { gap:4px; }
  body.sales-shell #appView .vs-kn b { font-size:17px; line-height:1.25; }
  body.sales-shell #appView .vs-kn small { font-size:12px; }
  body.sales-shell #appView .vs-ks { flex-wrap:nowrap; gap:4px; min-width:0; overflow:hidden; font-size:12px; line-height:1.35; white-space:nowrap; }
  body.sales-shell #appView .vs-ks > span { min-width:0; overflow:hidden; text-overflow:ellipsis; }
  body.sales-shell #appView .vs-ks > :not(span), body.sales-shell #appView .vs-kn > .vs-d { flex:none; }
  /* thanh màu + chú thích gọn + nhịp độ */
  body.sales-shell #appView .hub-card.vs-flowcard { gap:8px; padding:12px; }
  body.sales-shell #appView .vs-fl-main { gap:8px; }
  body.sales-shell #appView .vs-fbar { height:24px; }
  body.sales-shell #appView button.vs-fs { font-size:12px; }
  body.sales-shell #appView .vs-flegend { gap:0 12px; }
  body.sales-shell #appView button.vs-fk { min-height:24px; font-size:13px; line-height:1.35; }
  body.sales-shell #appView .vs-pace { padding-top:8px; }
  body.sales-shell #appView .vs-pm { gap:0; }
  body.sales-shell #appView .vs-pm b { font-size:17px; line-height:1.25; }
  body.sales-shell #appView .vs-pm > span { margin-top:2px; font-size:12px; font-weight:600; line-height:1.35; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  body.sales-shell #appView .vs-pm > small { overflow:hidden; font-size:12px; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
  /* Cần làm hôm nay: dòng 1 số hồ sơ · khách | Mở, dòng 2 chip */
  body.sales-shell #appView .vs-tg h3 { padding:6px 12px; font-size:12px; line-height:1.35; }
  body.sales-shell #appView .vs-trow { grid-template-columns:auto minmax(0,1fr) auto; grid-template-areas:"no name open" "chips chips open"; align-items:center; gap:4px 8px; min-height:0; padding:8px 12px; }
  body.sales-shell #appView .vs-trow .vs-no { font-size:14px; font-weight:700; }
  body.sales-shell #appView .vs-trow .vs-tname { font-size:14px; }
  body.sales-shell #appView .vs-trow .vs-tchips { flex-wrap:nowrap; gap:4px; min-width:0; overflow:hidden; }
  body.sales-shell #appView .vs-trow .vs-tchips .tag { flex:none; }
  body.sales-shell #appView .vs-trow button.vs-open { align-self:center; height:32px; min-height:32px; padding:0 12px; border-radius:10px; font-size:13px; }
  body.sales-shell #appView .vs-more { margin:4px 12px 8px; }
  /* Hồ sơ đang xử lý: 2 dòng — số · khách | hạn nộp / trạng thái · số ngày */
  body.sales-shell #appView .vs-ip-tbl tbody { gap:8px; }
  body.sales-shell #appView .vs-ip-tbl tbody tr { gap:4px 10px; padding:10px 12px; }
  body.sales-shell #appView .hub-table.vs-ip-tbl tbody td:first-child { display:flex; align-items:baseline; gap:6px; min-width:0; overflow:hidden; white-space:nowrap; }
  body.sales-shell #appView .vs-ip-tbl td:first-child > b { flex:none; font-size:15px; line-height:1.25; }
  body.sales-shell #appView .vs-ip-tbl .vs-ipc { flex:0 1 auto; min-width:0; margin:0; color:var(--m-sub); }
  body.sales-shell #appView .vs-ip-tbl .vs-ipc::before { content:"· "; }
  body.sales-shell #appView .vs-ip-tbl .vs-ipc .vs-link { font-weight:500; }
  body.sales-shell #appView .hub-table.vs-ip-tbl tbody td.vs-ipdue { align-self:center; white-space:nowrap; }
  body.sales-shell #appView .hub-table.vs-ip-tbl tbody td:nth-child(2) { gap:6px; }
  body.sales-shell #appView .vs-mtbl :is(th, td) { padding:8px 12px; }
  body.sales-shell #appView .vs-out { padding:8px 12px; }

  /* ---- thẻ hồ sơ: 3 dòng — số hồ sơ | trạng thái / khách · loại · nhóm | giấy tờ / nơi nộp | hạn nộp ---- */
  body.sales-shell #appView .vs-list-tbl tbody { gap:8px; }
  body.sales-shell #appView .vs-list-tbl tbody tr { grid-template-columns:auto minmax(0,1fr) auto; grid-template-areas:"no no st" "cust type st" "via via due" "out out out"; gap:4px 0; padding:12px; }
  body.sales-shell #appView .vs-list-tbl td.vs-c-no b { font-size:15px; line-height:1.25; }
  body.sales-shell #appView .vs-list-tbl tbody td.vs-c-cust { max-width:180px; min-width:0; overflow:hidden; font-size:14px; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
  body.sales-shell #appView .vs-list-tbl td.vs-c-cust .vs-link { display:inline; font-size:14px; }
  body.sales-shell #appView .vs-list-tbl tbody td.vs-c-type { min-width:0; overflow:hidden; font-size:13px; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
  body.sales-shell #appView .vs-list-tbl td.vs-c-type::before { content:"\00a0· "; }
  body.sales-shell #appView .vs-list-tbl td.vs-c-type > * { display:inline; margin:0; font-size:13px; white-space:nowrap; }
  body.sales-shell #appView .vs-list-tbl td.vs-c-type > .vs-sub::before { content:" · "; }
  body.sales-shell #appView .vs-list-tbl tbody td.vs-c-st { align-self:start; gap:2px; padding-left:8px; }
  body.sales-shell #appView .vs-list-tbl td:is(.vs-c-via, .vs-c-due) { margin-top:0; padding-top:0; border-top:0; font-size:13px; line-height:1.35; }
  body.sales-shell #appView .hub-table.vs-list-tbl td:is(.vs-c-via, .vs-c-due)[data-label]::before { font-size:12px; font-weight:600; }

  /* ---- chi tiết hồ sơ: tiêu đề 1 dòng 18/800, chip + dòng phụ cùng một hàng ---- */
  body.sales-shell #appView .vs-hd-d .vs-hd-title { display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; min-width:0; }
  body.sales-shell #appView .vs-hd-d .vs-h1 { display:contents; }
  body.sales-shell #appView :is(#workWorkspace, #rpRoot, #customerWorkspace) .vs-hd-d .vs-h1 h1, body.sales-shell #appView .vs-hd-d .vs-h1 h1 { display:block; flex:1 1 100%; min-width:0; overflow:hidden; font-size:18px; font-weight:800; line-height:1.25; text-overflow:ellipsis; white-space:nowrap; -webkit-line-clamp:unset; }
  body.sales-shell #appView .vs-hd-d .vs-hsub { flex:0 1 auto; min-width:0; margin:0; overflow:hidden; font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
  body.sales-shell #appView .hub-heading.vs-hd-d { row-gap:8px; }
  /* ô thông tin: hàng 40px "nhãn | giá trị" */
  body.sales-shell #appView section.vs-head { margin:0 0 12px; padding:2px 0; }
  body.sales-shell #appView .vs-fact { min-height:40px; padding:4px 12px; }
  body.sales-shell #appView .vs-fact > span { flex-basis:72px; font-size:12px; font-weight:600; }
  body.sales-shell #appView .vs-fact > div { font-size:14px; font-weight:600; line-height:1.35; }
  body.sales-shell #appView .vs-fact select { height:36px; min-height:36px; }
  body.sales-shell #appView .vs-money { height:36px; }
  body.sales-shell #appView .vs-money input { height:32px; min-height:32px; }
  body.sales-shell #appView section.vs-flow { margin:0 0 12px; padding:10px 0; }
  body.sales-shell #appView .vs-next { margin:10px 12px 0; }
  /* khung giấy tờ: dòng gọn */
  body.sales-shell #appView .hub-card.vs-sec, body.sales-shell #appView #vsLog, body.sales-shell #appView #vsTable { padding:12px; }
  body.sales-shell #appView .vs-grid, body.sales-shell #appView .vs-grid.is-step2 { gap:12px; }
  body.sales-shell #appView .vs-sech { gap:8px; margin-bottom:4px; }
  body.sales-shell #appView .vs-sech h3 { font-size:15px; }
  body.sales-shell #appView .vs-sech-acts button.vs-hbtn, body.sales-shell #appView .vs-sech-acts .primary { height:36px; min-height:36px; padding:0 12px; font-size:13px; }
  body.sales-shell #appView .vs-tbl:not(.vs-s7tbl) tbody tr { gap:6px 12px; padding:10px 0; }
  body.sales-shell #appView #vsTable.is-flush .vs-tbl:not(.vs-s7tbl) tbody tr { padding:10px 12px; }
  body.sales-shell #appView .vs-tbl td.vs-doc b { font-size:14px; }
  body.sales-shell #appView .vs-tbl td.vs-req { font-size:13px; line-height:1.35; }
  body.sales-shell #appView .vs-remark { height:40px; min-height:40px; }
  body.sales-shell #appView .vs-tbl .vs-th, body.sales-shell #appView .vs-tbl .vs-add { width:40px; height:40px; }
  body.sales-shell #appView .hub-table:is(.vs-tbl) td[data-label]::before { margin-bottom:2px; font-size:12px; font-weight:600; }

  /* ---- form tạo hồ sơ, hộp thoại ---- */
  body.sales-shell #appView .vs-form .vs-hint:empty, body.sales-shell .vs-dlg .vs-hint:empty { display:none; }
  body.sales-shell #appView .vs-form { gap:12px; }
  body.sales-shell #appView .vs-form .vs-f > label, body.sales-shell .vs-dlg .vs-f > label { margin-bottom:2px; font-size:12px; font-weight:600; }
  body.sales-shell .vs-dlg form { padding-top:14px; }
  body.sales-shell .vs-dlg header { margin-bottom:10px; }
  body.sales-shell .vs-dlg .vs-edit-tbl tr { gap:8px 10px; padding:12px 0; }
  body.sales-shell .vs-dlg .vs-edit-tbl td[data-label]::before { margin-bottom:2px; font-size:12px; }
}
@media screen and (max-width: 760px) {
  /* work.css (≤ 760px) đặt mọi "#workWorkspace .hub-heading" thành flex một hàng: giữ lưới của đầu màn Visa (tiêu đề | nút, hàng tab bên dưới) */
  body.sales-shell #appView #workWorkspace .hub-heading.vs-hd:not(.vs-hd-d) { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; }
}
@media screen and (max-width: 760px) {
  body.sales-shell #appView .vs-trow .vs-tchips .tag, body.sales-shell #appView .vs-ip-tbl .tag { height:20px; min-height:0; padding:0 8px; font-size:12px; line-height:20px; }
}
@media screen and (max-width: 760px) {
  /* thẻ hồ sơ: số giấy tờ đứng cạnh chip trạng thái ở dòng 1 để dòng 2 (khách · loại) đủ rộng */
  body.sales-shell #appView .vs-list-tbl tbody tr { grid-template-areas:"no no st" "cust type type" "via via due" "out out out"; }
  body.sales-shell #appView .hub-table.vs-list-tbl tbody td.vs-c-st { flex-direction:row; align-items:center; align-self:center; gap:6px; white-space:nowrap; }
  body.sales-shell #appView .vs-list-tbl td.vs-c-st .vs-sub { order:-1; }
}
@media screen and (max-width: 760px) {
  body.sales-shell #appView .vs-list-tbl tbody tr { grid-template-areas:"no no st" "cust type type" "via via via" "out out out"; }
  body.sales-shell #appView .hub-table.vs-list-tbl tbody td.vs-c-via { justify-self:start; max-width:58%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  body.sales-shell #appView .hub-table.vs-list-tbl tbody td.vs-c-due { grid-area:via; justify-self:end; white-space:nowrap; }
}
@media screen and (max-width: 760px) {
  /* chip kết quả (Đậu/Trượt) đứng ngay sau số hồ sơ, không chiếm một hàng riêng */
  body.sales-shell #appView .vs-list-tbl tbody tr { grid-template-areas:"no out st" "cust type type" "via via via"; }
  body.sales-shell #appView .hub-table.vs-list-tbl tbody td.vs-c-out { grid-area:out; justify-self:start; align-self:center; padding-left:8px; }
}
@media screen and (max-width: 760px) {
  body.sales-shell #appView .vs-hd-d .vs-h1 h1 .vs-hcust { display:inline; }
  body.sales-shell #appView #vsTable.is-flush { padding:0; }
  body.sales-shell #appView #vsTable.is-flush > .vs-sech { padding:12px 12px 8px; }
  body.sales-shell #appView .vs-fact-j > div { flex:1 1 auto; min-width:0; }
  /* "Nhận 1/1": nhãn cùng dòng với số */
  body.sales-shell #appView .hub-table.vs-tbl tbody td.vs-qcell { align-self:center; white-space:nowrap; }
  body.sales-shell #appView .hub-table.vs-tbl td.vs-qcell[data-label]::before { display:inline; margin:0 4px 0 0; }
}
@media screen and (max-width: 760px) {
  /* bước 2: "Nhận 1/1 · ảnh · ô ghi chú · ⋯" trên cùng một hàng */
  body.sales-shell #appView .vs-tbl:not(.vs-s1tbl):not(.vs-s4tbl):not(.vs-s7tbl) tbody tr { grid-template-columns:auto auto minmax(0,1fr) auto; align-items:center; }
  body.sales-shell #appView .vs-tbl:not(.vs-s1tbl):not(.vs-s4tbl):not(.vs-s7tbl) td.vs-doc { grid-column:1 / 4; }
  body.sales-shell #appView .vs-tbl:not(.vs-s1tbl):not(.vs-s4tbl):not(.vs-s7tbl) td.vs-c-st { grid-column:4; grid-row:1; }
  body.sales-shell #appView .vs-tbl:not(.vs-s1tbl):not(.vs-s4tbl):not(.vs-s7tbl) td.vs-req { grid-column:1 / -1; }
  body.sales-shell #appView .vs-tbl:not(.vs-s1tbl):not(.vs-s4tbl):not(.vs-s7tbl) td.vs-qcell { grid-column:1; grid-row:3; }
  body.sales-shell #appView .vs-tbl:not(.vs-s1tbl):not(.vs-s4tbl):not(.vs-s7tbl) td.vs-c-img { grid-column:2; grid-row:3; align-self:center; }
  body.sales-shell #appView .vs-tbl:not(.vs-s1tbl):not(.vs-s4tbl):not(.vs-s7tbl) td.vs-rmk { grid-column:3; grid-row:3; }
  body.sales-shell #appView .vs-tbl:not(.vs-s1tbl):not(.vs-s4tbl):not(.vs-s7tbl) td.vs-act { grid-column:4; grid-row:3; align-self:center; }
}
@media screen and (max-width: 760px) {
  body.sales-shell #appView .vs-tbl td.vs-rmk .vs-remark { width:100%; max-width:none; }
  /* nút của khung Giấy tờ: một hàng cuộn ngang, không để nút lẻ rớt hàng */
  body.sales-shell #appView .vs-sech-acts { flex:1 1 100%; min-width:0; flex-wrap:nowrap; justify-content:flex-start; margin:0 -12px; padding:0 12px; overflow-x:auto; scrollbar-width:none; }
  body.sales-shell #appView .vs-sech-acts::-webkit-scrollbar { display:none; }
  body.sales-shell #appView .vs-sech-acts > * { flex:none; }
}
@media screen and (max-width: 760px) {
  /* tiêu đề "VS-… · tên khách": tên khách (nút) tự cắt "…" */
  body.sales-shell #appView :is(#workWorkspace, #rpRoot, #customerWorkspace) .vs-hd-d .vs-h1 h1, body.sales-shell #appView .vs-hd-d .vs-h1 h1 { display:flex; align-items:baseline; white-space:pre; }
  body.sales-shell #appView .vs-hd-d .vs-h1 h1 .vs-hcust { flex:0 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
}

/* Tạo hồ sơ visa dạng popup (10/11/2026): ô tìm khách + "Khách hàng mới" → ô nhập tên; hỏi Có / Không trước khi thêm khách. */
@media screen {
  .vs-cdlg { width:min(680px, calc(100vw - 24px)); overflow:visible; }
  .vs-cdlg .vs-dlg-body { overflow:visible; }
  .vs-cdlg .vs-cform { display:grid; gap:14px; }
  .vs-cdlg .vs-row3 { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
  .vs-cdlg .vs-row2 { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  .vs-cdlg .vs-hint { margin:0; }
  .vs-cdlg .vs-hint:empty { display:none; }
  .vs-cdlg .vs-preview { padding:10px 12px; border-radius:10px; background:#FAF7F2; color:#25211C; font-size:14px; }
  .vs-cdlg .vs-preview:empty { display:none; }
  .vs-cdlg .vs-preview b { color:#8A5F27; }
  .vs-cdlg .btn-row { margin:16px 0 0; justify-content:flex-end; }
  .vs-cdlg .vs-ac input { width:100%; }
  .vs-cdlg .vs-ac-pop { position:absolute; z-index:30; top:calc(100% + 6px); left:0; right:0; max-height:min(300px,40vh); overflow-y:auto; padding:6px; border:1px solid #E4DACA; border-radius:12px; background:#fff; box-shadow:0 8px 24px rgba(57,46,34,.12); }
  .vs-cdlg .vs-ac-pop[hidden] { display:none; }
  .vs-cdlg .vs-ac-pop button { display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; min-height:40px; padding:7px 10px; border:0; border-radius:8px; background:none; text-align:left; font:inherit; color:#25211C; cursor:pointer; }
  .vs-cdlg .vs-ac-pop button:hover, .vs-cdlg .vs-ac-pop button.is-active { background:#FAF1E1; }
  .vs-cdlg .vs-ac-pop b { display:block; font-size:14px; }
  .vs-cdlg .vs-ac-pop small { display:block; color:#6F655A; font-size:12px; }
  .vs-cdlg .vs-ac-pop em { flex:0 0 auto; max-width:40%; font-style:normal; font-size:12px; font-weight:600; color:#8A5F27; text-align:right; }
  .vs-cdlg .vs-ac-empty { padding:8px 10px; color:#6F655A; font-size:13px; }
  .vs-cdlg .vs-newc { align-self:flex-start; margin:2px 0 0; padding:0; border:0; background:none; color:#8A5F27; font:inherit; font-size:13px; font-weight:600; text-align:left; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
  .vs-cdlg .vs-newc[hidden] { display:none; }
  .vs-cdlg .vs-newc.is-back { display:block; margin-top:8px; color:#6F655A; font-weight:500; }
  .vs-ask { width:min(420px, calc(100vw - 24px)); }
  .vs-ask form { padding:20px 22px; }
  .vs-ask .btn-row { margin:18px 0 0; justify-content:flex-end; }
  @media (max-width:640px) {
    .vs-cdlg .vs-row3, .vs-cdlg .vs-row2 { grid-template-columns:minmax(0,1fr); }
    .vs-cdlg, .vs-cdlg .vs-dlg-body { overflow:auto; }
  }
}
