/* module NPP (0.9.9 · s099-d): tấm "In phiếu" + in tại chỗ khi trình duyệt chặn cửa sổ in riêng. Tờ phiếu tự mang CSS riêng (npp.js CSS_IN). */
.np-chon{margin-top:4px}
.np-chon button{min-height:48px}
.np-nut-in{display:grid;gap:10px;margin:14px 0 8px}
.np-nut-in .hc-nut{justify-content:center}
.np-du-phong{margin:6px 0 10px}
.np-du-phong .hc-nhom-nut{flex-wrap:wrap}
.np-ct-in{margin-top:10px}
#np-vung-in{display:none}
@media print{
  body.np-dang-in > *:not(#np-vung-in){display:none!important}
  body.np-dang-in #np-vung-in{display:block!important}
  html:has(body.np-dang-in),body.np-dang-in{background:#fff!important}
}
/* màn Đơn NPP (web/app.js MAN.npp): nút "In phiếu" từng đơn + nút trên thanh chọn nhiều */
.npp-in-mot{display:flex;justify-content:flex-end;margin:2px 0 6px}
.npp-in-mot .hc-nut{min-height:44px;padding:6px 12px;display:inline-flex;align-items:center;gap:6px}
.npp-thanh #npp-in-nhieu[hidden],.npp-thanh #npp-duyet-nhieu[hidden]{display:none}
/* 1.1 (s11-e) — Đơn NPP: in phiếu = nhận đơn (D7 / L7), bộ lọc NPP + thẻ ghi tên NPP (B5), băng "Đơn cần quyết khi đổi NPP" (E4), cảnh báo tồn âm (L16) */
.np-nhan-dong{margin:0 0 10px;align-items:center}
.np-nhan-dong>span{flex:none;display:inline-flex;color:var(--cam)}
.npp-loc-npp{margin:0 0 8px}
.npp-loc-npp[hidden]{display:none}
.npp-loc-npp-o{display:flex;align-items:center;gap:8px;font-weight:700;color:var(--chu-2)}
.npp-loc-npp-o select{flex:1;min-width:0;min-height:44px;height:44px;padding:0 8px;font-size:14px;border-radius:12px}
body.hc-web .npp-loc-npp-o select{flex:0 1 460px}
.npp-nhan-loc{margin:0 0 8px}
.npp-nhan-loc>button{min-height:40px;padding:0 12px;font-size:14px}
.npp-nhan-loc b{font-weight:800;margin-left:2px}
.npp-ten-the,.npp-da-nhan{display:inline-flex;align-items:center;gap:4px}
.npp-doi-quyet{text-decoration:none;color:inherit;align-items:center}
.npp-doi-quyet>div{flex:1;min-width:0}
.npp-ton-am{display:block;margin-top:8px;color:var(--do);font-size:14px;line-height:1.45}
.npp-ton-am svg{vertical-align:-3px}
/* 1.1 (s11-e · E5 / D7g): bản web (≥ 1024 px, body.hc-web) — lưới thẻ gọn nhiều cột (45 đơn không còn dài 20.000 px): dòng hàng gọn một đoạn, nút trên một hàng.
   Điện thoại giữ nguyên (danh sách từng dòng hàng, nút to). */
.npp-dong-gon{display:none}
body.hc-web #npp-ds{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,420px),1fr));gap:12px;align-items:start}
body.hc-web #npp-ds>.npp-don{margin:0;padding:12px 14px}
body.hc-web #npp-ds .npp-don h3{font-size:15.5px}
body.hc-web #npp-ds .npp-chip{margin-top:6px}
body.hc-web #npp-ds .npp-dong-ds{display:none}
body.hc-web #npp-ds .npp-dong-gon{display:block;margin:8px 0 2px;font-size:13.5px;line-height:1.45;color:var(--chu-2)}
body.hc-web #npp-ds .npp-dong-gon b{color:var(--chu)}
body.hc-web #npp-ds .npp-tang-gon{color:var(--vang-dam)}
body.hc-web #npp-ds .npp-don>.npp-in-mot,
body.hc-web #npp-ds .npp-don>.npp-nut-giao{display:inline-flex;width:auto;margin:8px 8px 0 0;vertical-align:middle;gap:8px}
body.hc-web #npp-ds .npp-don>.npp-nut-giao>*{flex:0 0 auto;padding:0 12px}
body.hc-web #npp-ds .npp-don>.npp-nut-tc{display:inline-flex;width:auto;margin:8px 0 0!important;vertical-align:middle;padding:0 16px}
body.hc-web #npp-ds .npp-don .hc-nut{min-height:40px}
/* 1.3 (s13-f) — Đơn NPP: bộ lọc NPP dạng chip có số đơn (lỗi 🟠 2) · "Còn n đơn ở NPP khác" · Xuất Excel nhiều đơn (lỗi đội #5) · bảng bản web (F4.5)
   · tấm chi tiết đơn (N13) · xem trước Giao khác số lượng (lỗi 🟠 5) · tab Đã giao hôm nay (F4.6) */
.npp-loc-npp .npp-loc-chip{flex-wrap:wrap;gap:8px;margin:0}
.npp-loc-npp .npp-loc-chip>button{min-height:44px;padding:0 12px;font-size:14px;flex:0 1 auto;white-space:normal;text-align:left}
.npp-loc-npp .npp-loc-chip>button b{font-weight:800;margin-left:4px}
.npp-con-khac{align-items:center;gap:10px;margin:0 0 12px}
.npp-con-khac>div{flex:1;min-width:0}
.npp-con-khac .hc-nut{min-height:44px;flex:none}
.npp-thanh-phu{display:block;font-size:12.5px;color:var(--mo);margin-top:2px}
.npp-thanh #npp-excel-nhieu[hidden]{display:none}
.npp-da-giao{display:inline-flex;align-items:center;gap:4px;margin-top:8px}
.npp-tam-nut{margin:12px 0 4px}
.npp-tam-nut .hc-nhom-nut{flex-wrap:wrap}
.npp-don{cursor:pointer}
.npp-don .hc-nut,.npp-don label,.npp-don input{cursor:pointer}
/* xem trước Giao khác số lượng */
.npp-gk-xem{border:1px solid var(--vien-2);border-radius:var(--r-vua);background:var(--nen-2);padding:10px 12px;margin:0 0 12px;font-size:14px;line-height:1.5}
.npp-gk-xem h4{margin:0 0 6px;font-size:13px;text-transform:uppercase;letter-spacing:.04em;color:var(--mo);line-height:1.5}
.npp-gk-xem-ds{margin:0;padding:0;list-style:none;display:grid;gap:4px}
.npp-gk-xem-ds li{display:flex;gap:6px;align-items:flex-start}
.npp-gk-xem-ds li svg{flex:none;margin-top:3px}
.npp-gk-xem-ds li.mat{color:var(--cam-dam);font-weight:600}
.npp-gk-xem-ds li.them{color:var(--xanh)}
.npp-gk-xem-ds li.am{color:var(--do);font-weight:600}
.npp-gk-xem-ket{margin:8px 0 0;font-size:13.5px}
.npp-gk-xem-ket.cam{color:var(--cam-dam);font-weight:700}
.npp-gk-xem-tai{margin:0}
/* bảng bản web: một dòng / đơn — số đơn (+ In phiếu) · quán + hàng (gọn 3 dòng) · người đặt · tiền + thùng · trạng thái · việc (cột cố định bên phải khi bảng rộng hơn khung) */
body.hc-web #npp-ds>.npp-bang-cuon{grid-column:1 / -1;margin:0}
.npp-bang{font-size:13.5px;table-layout:fixed;width:100%;min-width:1000px}   /* cột cố định, cột "Quán · hàng" lấy phần còn lại; khung hẹp hơn → cuộn trong khung, cột Việc vẫn dính phải */
.npp-bang th,.npp-bang td{padding:10px 8px;vertical-align:middle;overflow-wrap:anywhere}
.npp-bang th,.npp-bang thead th.so{white-space:normal;line-height:1.3}   /* đầu cột hai chữ (Số đơn · ngày đặt, Tiền · thùng) xuống dòng thay vì bị cắt */
.npp-bang .npp-c-chon{width:44px;padding-left:12px}
.npp-bang .npp-c-so{width:132px}
.npp-bang .npp-c-sales{width:104px}
.npp-bang .npp-c-tien{width:92px;white-space:nowrap}
.npp-bang .npp-c-tt{width:150px}
.npp-bang .npp-o-chon{margin:0}
.npp-bang tr.npp-don.chon td{background:var(--vang-nhat)}
.npp-bang .npp-mo-don{appearance:none;border:0;background:none;padding:0;min-height:32px;font:700 14px/1.3 var(--noi-dung);color:var(--chinh);text-decoration:underline;cursor:pointer;text-align:left;overflow-wrap:anywhere}
.npp-bang .npp-in-dong{margin:2px 0 0 -8px;font-size:13px;gap:6px}
.npp-bang .npp-dong-gon{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;margin:4px 0 0;font-size:12.5px;line-height:1.45;color:var(--chu-2)}
.npp-bang .npp-chip{display:flex;flex-wrap:wrap;gap:4px;margin:0}
.npp-bang .npp-gk-chip,.npp-bang .hc-chip{font-size:12px}
.npp-bang th.npp-c-nut,.npp-bang td.npp-c-nut{position:sticky;right:0;background:var(--the);box-shadow:-6px 0 8px -6px rgba(0,0,0,.18);width:300px}
.npp-bang tbody tr:hover td.npp-c-nut{background:var(--nen)}
.npp-bang th.npp-c-nut{background:var(--nen-2);z-index:2}
.npp-bang td.npp-c-nut .hc-nhom-nut,.npp-bang td.npp-c-nut .npp-nut-giao{display:grid;grid-template-columns:repeat(auto-fit,minmax(0,1fr));gap:6px;margin:0}
.npp-bang td.npp-c-nut .hc-nut{min-height:44px;padding:0 8px;font-size:13px;line-height:1.2;white-space:normal;text-align:center;width:auto}
.npp-bang td.npp-c-nut .npp-nut-tc{margin:6px 0 0!important;width:100%}
.npp-bang td.npp-c-nut .hc-phu,.npp-bang td.npp-c-nut .hc-chip{margin:0}
/* chip dài (vd "Chờ ASM duyệt đơn nhập lớn — duyệt xong mới giao") xuống dòng trong ô — không tràn bảng */
.npp-bang .hc-chip{white-space:normal;height:auto;min-height:22px;line-height:1.3;padding-top:3px;padding-bottom:3px;max-width:100%}

/* 3.0 (s30-w · D06): tab chờ giao — lọc Huyện · Xã · Tuyến sales · Xe (điện thoại: hai ô một hàng, không cuộn ngang) + chip xe + tấm "Chia xe" */
.npp-loc-xe{flex-wrap:wrap}
.npp-loc-xe select{flex:1 1 calc(50% - 4px)}
body.hc-web .npp-loc-xe select{flex:1 1 160px}
.npp-xe-chip svg{vertical-align:-2px}
.npp-xe-goi-y{flex-wrap:wrap;gap:8px;margin:4px 0 12px}
.npp-xe-goi-y button{min-height:40px}
