/* SPV — 15/10 (L144, CEO): GIAO DIỆN GỌN cho mọi màn — nạp SAU style.css.
 * Mục tiêu: màn 1366–1920 px thấy nhiều dòng hơn (~gấp đôi), ít khoảng trắng; không đổi chức năng.
 *   Thanh trên + thanh phụ thấp hơn · khung lọc 1 hàng sát · ô nhập / nút thấp 30 px · dòng bảng ~32 px
 *   Dòng giải thích dài (dưới khung lọc) gói 1 dòng — rê chuột / bấm để xem hết · thẻ PPXD / thông báo mỏng. */
body { font-size: 13px; }
main { padding: 8px 12px 24px; }
.topbar { padding-top: 4px !important; padding-bottom: 4px !important; min-height: 0; }
.tab, .subtab { padding-top: 6px !important; padding-bottom: 6px !important; }
.subtabs, #subtabs { min-height: 0; }

/* khung lọc: ô + nút cùng 1 hàng (tràn thì xuống hàng), ô nhỏ */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 8px; padding: 6px 10px; }
.filters > label { flex: 0 0 132px; min-width: 0; }
.filters > label.grow { flex: 1 1 200px; max-width: 340px; }
.filters > label[hidden], .filters > label.loc-bo { display: none; }
.filters .filter-actions { grid-column: auto; flex: 0 1 auto; flex-wrap: wrap; gap: 6px; align-items: flex-end; }
.filters .filter-actions.bulk { flex-basis: 100%; }
.filters label, .form-row label { font-size: 11px; gap: 1px; }
input, select { padding: 4px 8px; font-size: 13px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select { min-height: 30px; }
.btn { padding: 4px 12px; min-height: 30px; }
.btn.small { padding: 2px 8px; min-height: 24px; }
.filters .btn { align-self: end; }

/* thẻ / thông báo mỏng */
.card { padding: 8px 12px; }
.pad-card { padding: 6px 12px !important; }
.hint { padding: 4px 8px; margin-bottom: 6px; font-size: 12px; }
.summary { margin: 6px 2px 4px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: help; }
.summary:hover, .summary:focus, .summary.mo { white-space: normal; }

/* bảng: dòng thấp, ô nhập trong bảng thấp */
.grid th, .grid td { padding: 3px 6px; line-height: 1.25; }
.grid th { padding-top: 5px; padding-bottom: 5px; }
.grid td input:not([type=checkbox]), .grid td select { min-height: 26px; padding: 2px 6px; font-size: 12.5px; }
.grid td .btn { min-height: 24px; padding: 1px 8px; }
.table-wrap { max-height: calc(100vh - 190px); }
.bk-tag, .status, .chip { line-height: 1.5; }
.grid td select.ht-sel { min-height: 22px; height: 22px; margin-top: 0; }
/* "dự kiến" dưới ngày → cùng dòng */
.grid td > br:has(+ small.muted) { display: none; }
.grid td > br + small.muted { margin-left: 4px; }
/* ô Lưu ý / nhiều nhãn: 1 dòng */
.grid td .ly-wrap { flex-wrap: nowrap; overflow: hidden; }

/* khung chi tiết (bên phải) */
.drawer-head { padding: 8px 14px; }
.drawer-body { padding: 10px 14px 24px; gap: 8px; }

/* điện thoại: giữ chữ / ô to dễ bấm */
@media (max-width: 700px) {
  body { font-size: 14px; }
  input:not([type=checkbox]):not([type=radio]), select, .btn { min-height: 38px; font-size: 16px; }
  .summary { white-space: normal; }
}

/* Nhập giá bán (CEO 16:24): nút Lọc ngay sau ô Tìm, cùng hàng */
#gb-filters > label { order: 1; }
#gb-filters > label.grow { order: 2; flex: 1 1 180px; max-width: 300px; }
#gb-filters > .filter-actions { order: 3; }
#gb-filters > #gb-sale-wrap { order: 4; }
#gb-customer { min-width: 0 !important; }

/* 16/10 (L148): điện thoại — nút ☰ + danh sách dọc thay thanh công cụ ngang */
.menu-btn, .menu-dd { display: none; }
@media (max-width: 760px) {
  .topbar { flex-wrap: nowrap !important; gap: 8px; }
  .topbar .tabs, .topbar .user, #subtabs { display: none !important; }
  .menu-btn { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; border: 1px solid rgba(255,255,255,.35); background: transparent;
    color: #fff; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 15px; font-weight: 600; max-width: 70vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .menu-dd:not([hidden]) { display: block; position: fixed; top: 52px; left: 8px; right: 8px; bottom: 8px; z-index: 50; overflow-y: auto;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(20,33,61,.25); padding: 6px 0; }
  .menu-nhom { padding: 6px 0; border-bottom: 1px solid var(--line); }
  .menu-nhom-ten { padding: 4px 16px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
  .menu-muc { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 11px 24px; font: inherit; font-size: 16px; color: var(--ink); text-decoration: none; }
  .menu-muc.on { color: #e8681a; font-weight: 700; background: #fff4ea; }
  .menu-cuoi { border-bottom: 0; }
}

/* 16/10 (L139 mục 6): ghi số HĐ khách lẻ ngay trên dòng Công nợ theo lô */
.cnl-hd { white-space: nowrap; }
.cnl-hd .hd-them { margin-left: 4px; padding: 1px 8px; }
.hd-o { display: inline-flex; gap: 4px; align-items: center; }
.hd-o input { height: 28px; padding: 2px 6px; }
.hd-o .hd-ngay { width: 132px; }
/* 23/10 (L219): nhập / sửa giá ngay ở Công nợ theo lô */
.cnl-gia { white-space: nowrap; }
.cnl-gia .gia-nhap, .cnl-gia .gia-sua { margin-left: 4px; padding: 1px 8px; }
.cnl-gia .gia-nhap { background: #fff1e6; border-color: #f08a3c; color: #b4530f; }
.gia-o { display: inline-flex; gap: 4px; align-items: center; }
.gia-o input, .gia-o select { height: 28px; padding: 2px 6px; }
.gia-o .gia-so { width: 110px; text-align: right; }

/* 16/10 (L152): Danh sách lô — cột rộng theo ô dài nhất trong cả nghìn lô (1 khách nhiều nhãn, "Chọn zone TQ", tuyến dài)
   → cột Khách hàng / Tuyến / Zone / Khách con quá rộng, số liệu xa tiêu đề. Giới hạn bề rộng, nội dung dài xuống dòng. */
#ship-table > thead > tr > th { white-space: nowrap; }
#ship-table > tbody > tr > td:nth-child(n) { vertical-align: middle; }
#ship-table td.col-khach { max-width: 190px; white-space: normal; }
#ship-table td.col-khach .bk-tag, #ship-table td.col-khach .chip { white-space: nowrap; }
#ship-table td.col-kc { max-width: 140px; white-space: normal; }
#ship-table td.col-tuyen { max-width: 170px; white-space: normal; }
#ship-table td.col-zone { max-width: 70px; white-space: normal; }
#ship-table td.col-zone .bk-tag { white-space: normal; display: inline-block; line-height: 1.15; }
#ship-table > tbody > tr > td.fees { white-space: normal; max-width: 300px; }
/* L152 — MỌI MÀN (CEO 16:44): cột rộng theo ô dài nhất → giới hạn bề rộng ô chữ, chữ dài xuống dòng; tiêu đề, số, ngày giữ 1 dòng */
main[id$="-view"] .table-wrap > table.grid > tbody > tr > td:not(.num):not(.mono):not(:has(input, select, textarea, button)) { white-space: normal; max-width: 170px; overflow-wrap: break-word; }
main[id$="-view"] .table-wrap > table.grid > tbody > tr > td.mono:not(:has(input, select, textarea, button)) { max-width: 200px; overflow-wrap: anywhere; }
main[id$="-view"] .table-wrap > table.grid > tbody > tr > td.num { white-space: nowrap; }
main[id$="-view"] .table-wrap > table.grid td .bk-tag, main[id$="-view"] .table-wrap > table.grid td .chip { white-space: nowrap; }
/* L152 hết */

/* 16/10 (L155): bảng có lô — bấm dòng mở Chi tiết lô */
table.bam-mo-lo > tbody > tr:not([data-for]) > td { cursor: pointer; }
table.bam-mo-lo > tbody > tr > td:has(input, select, textarea, button) { cursor: auto; }

/* 16/10 (L158): khung lọc cột — danh sách giá trị co lại, nút OK luôn thấy; điện thoại: nút Xoá lọc / OK lên đầu khung (bàn phím không che) */
.loc-pop .loc-ds { flex: 1 1 auto; min-height: 60px; }
@media (max-width: 700px) {
  .loc-pop .loc-dau { order: 0; } .loc-pop .loc-nut { order: 1; } .loc-pop > :not(.loc-dau):not(.loc-nut) { order: 2; }
  .loc-pop .loc-nut .btn { padding: 8px 16px; }
}

/* 16/10 (L159): ĐIỆN THOẠI — Danh sách lô dạng THẺ (1 lô = 1 thẻ, không kéo ngang). Bấm thẻ = mở lô.
   ☐ AWB ...................... Trạng thái
     Khách ........................ Ngày
     Khách con (nếu có)
     Hãng · DV · NCC · Tuyến · Zone ... KL kg
     Giá bán · Bảng kê · Phí · Sale (chữ nhỏ) */
@media (max-width: 700px) {
  #ship-table { --l: 30px; }
  #ship-table:not(.co-tick) { --l: 0px; }
  #ship-table, #ship-table > tbody { display: block; width: 100% !important; min-width: 0 !important; }
  .table-wrap:has(> #ship-table) { overflow-x: hidden; }
  #ship-table > thead { display: none; }
  #ship-table > tbody > tr[data-id] { display: flex; flex-wrap: wrap; align-items: baseline; padding: 9px 10px; border-bottom: 1px solid #e6e9ef; }
  #ship-table > tbody > tr[data-id].loc-an, #ship-table > tbody > tr[data-id][hidden] { display: none; }
  #ship-table > tbody > tr[data-id]::after { content: ""; order: 13; flex-basis: 100%; height: 0; }
  #ship-table > tbody > tr[data-id] > td { display: block; padding: 1px 0 !important; border: 0 !important; max-width: none !important; min-width: 0; white-space: normal; text-align: left; background: none; }
  #ship-table > tbody > tr > td.col-chon { order: 1; width: var(--l); align-self: center; }
  #ship-table > tbody > tr > td.mono { order: 2; width: calc(100% - var(--l) - 120px); font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
  #ship-table > tbody > tr > td.col-tt { order: 3; width: 120px; text-align: right; }
  #ship-table > tbody > tr > td.col-khach { order: 4; width: calc(100% - var(--l) - 120px); margin-left: var(--l); font-weight: 600; }
  #ship-table > tbody > tr > td.col-ngay { order: 5; width: 120px; text-align: right; font-size: 12px; color: #6b7385; }
  #ship-table > tbody > tr > td.col-kc { order: 6; width: calc(100% - var(--l)); margin-left: var(--l); font-size: 13px; }
  #ship-table > tbody > tr > td.col-kc:not(:has(.kc)) { display: none; }
  #ship-table > tbody > tr > td.col-hang { order: 7; margin-left: var(--l); }
  #ship-table > tbody > tr > td.col-dv { order: 8; } #ship-table > tbody > tr > td.col-ncc { order: 9; }
  #ship-table > tbody > tr > td.col-tuyen { order: 10; } #ship-table > tbody > tr > td.col-zone { order: 11; }
  #ship-table > tbody > tr > td:is(.col-hang, .col-dv, .col-ncc, .col-tuyen, .col-zone) { font-size: 13px; color: #3c4559; margin-right: 8px; }
  #ship-table > tbody > tr > td.col-zone::before { content: "zone "; color: #9aa3b2; }
  #ship-table > tbody > tr > td.col-kl { order: 12; margin-left: auto; font-weight: 600; }
  #ship-table > tbody > tr > td.col-kl::after { content: " kg"; font-weight: 400; color: #6b7385; }
  #ship-table > tbody > tr > td:is(.col-giaban, .col-bk, .fees, .col-sale) { font-size: 12px; color: #6b7385; margin-right: 10px; }
  #ship-table > tbody > tr > td.col-giaban { order: 14; margin-left: var(--l); } #ship-table > tbody > tr > td.col-bk { order: 15; }
  #ship-table > tbody > tr > td.fees { order: 16; } #ship-table > tbody > tr > td.col-sale { order: 17; margin-left: auto; margin-right: 0; }
  #ship-table > tbody > tr > td:is(.col-kien, .col-chenh) { display: none; }
  #ship-table > tbody > tr > td:empty, #ship-table > tbody > tr > td.rong { display: none; }
  #ship-table > tbody > tr > td.col-tt .ht-sel { max-width: 100%; font-size: 12px; }
  .table-wrap:has(> #ship-table) { max-height: none; height: auto; }
}

/* 16/10 (L159): ĐIỆN THOẠI — các bảng danh sách khác dạng THẺ: mỗi dòng 1 thẻ, 2 cột "tên cột / giá trị" */
@media (max-width: 700px) {
  table.grid.the-dt, table.grid.the-dt > tbody { display: block; width: 100% !important; min-width: 0 !important; }
  .table-wrap:has(> table.grid.the-dt) { overflow-x: hidden; max-height: none; height: auto; }
  table.grid.the-dt > thead { display: none; }
  table.grid.the-dt > tbody > tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 10px; border-bottom: 1px solid #e6e9ef; }
  table.grid.the-dt > tbody > tr.loc-an, table.grid.the-dt > tbody > tr[hidden] { display: none; }
  table.grid.the-dt > tbody > tr > td { display: block; padding: 0 !important; border: 0 !important; max-width: none !important; min-width: 0; white-space: normal; text-align: left; overflow-wrap: anywhere; }
  table.grid.the-dt > tbody > tr > td[data-l]:not([data-l=""])::before { content: attr(data-l); display: block; font-size: 11px; color: #8a93a3; font-weight: 500; }
  table.grid.the-dt > tbody > tr > td:first-child, table.grid.the-dt > tbody > tr > td.mono { font-weight: 600; }
  table.grid.the-dt > tbody > tr > td[colspan] { grid-column: 1 / -1; }
  table.grid.the-dt > tbody > tr > td.rong { display: none; }
  table.grid.the-dt > tbody > tr > td { position: static !important; box-shadow: none !important; background: none; }
  table.grid.the-dt > tbody > tr > td:first-child:has(> input[type=checkbox]:only-child) { grid-column: 1 / -1; }
  table.grid.the-dt > tbody > tr > td:first-child:has(> input[type=checkbox]:only-child)::before { display: none !important; }
  table.grid.the-dt > tbody > tr > td:has(textarea) { grid-column: 1 / -1; }
  table.grid.the-dt > tbody > tr > td input:not([type=checkbox]):not([type=radio]), table.grid.the-dt > tbody > tr > td select { width: 100%; max-width: none; }
  table.grid.the-dt > tbody > tr > td[data-l=""]:empty { display: none; }
  table.grid.the-dt > tfoot { display: block; }
}

/* 16/10 (L159): ĐIỆN THOẠI — Việc hôm nay: mỗi lô 2 dòng gọn (không tràn ngang); Chi tiết lô: thông tin 2 cột */
@media (max-width: 700px) {
  .viec-ds { grid-template-columns: 1fr; }
  .viec-the { padding: 10px; overflow: hidden; }
  table.viec-bang, table.viec-bang > tbody { display: block; width: 100%; }
  table.viec-bang > tbody > tr { display: flex; flex-wrap: wrap; gap: 0 10px; padding: 7px 0; border-bottom: 1px solid #eef0f3; }
  table.viec-bang > tbody > tr > td { display: block; padding: 0 !important; border: 0 !important; white-space: normal; }
  table.viec-bang > tbody > tr > td.mono { font-weight: 600; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
  table.viec-bang > tbody > tr > td.viec-ngay { order: 3; font-size: 12px; color: #6b7385; }
  table.viec-bang > tbody > tr > td:nth-child(3) { order: 1; font-weight: 600; }
  table.viec-bang > tbody > tr > td:nth-child(n+4) { order: 4; font-size: 13px; }
  table.viec-bang > tbody > tr > td:empty { display: none; }
  #d-body .kv-grid { grid-template-columns: 1fr 1fr; gap: 8px 12px; }
}
/* 24/10 (L227): bảng kê mở ngay dưới dòng khách (Phải thu · khách) */
#cn-table tr.cn-dang-mo > td { background: #fff3e8; font-weight: 600; }
#cn-table tr.cn-mo > td { background: #fbfaf7; padding: 8px 10px 14px; border-left: 3px solid #f08a3c; }
.cn-bk-dau { display: flex; align-items: center; gap: 10px; margin: 2px 0 6px; flex-wrap: wrap; }
.cn-bk-dau b { font-size: 15px; }
.cn-bk #bk-filters { margin: 0 0 6px; }
.cn-bk .table-wrap { max-height: 60vh; }
#cn-bk-chung { margin: 0 0 12px; padding: 8px 10px; background: #fbfaf7; border: 1px solid #f9c99a; border-radius: 8px; }

/* ====================================================================================
 * 04/11 (CEO 08:54): GỌN LẦN 2 — tối ưu khoảng cách cột / dòng, hiển thị tối đa trên máy tính + điện thoại
 * Máy tính: dòng bảng đều ~28 px (không còn dòng cao 2–3 tầng vì cột Phí), ô hành trình gọn, khung lọc sát.
 * Điện thoại: khung lọc gọn (chỉ ô Tìm + nút; bấm "⚙ Lọc" mới hiện các ô lọc khác), thẻ lô sát hơn, chữ vừa.
 * ==================================================================================== */
.fee-tag { white-space: nowrap; display: inline-block; vertical-align: middle; max-width: 200px; }
.grid th, .grid td { padding: 2px 6px; }
.grid th { padding-top: 4px; padding-bottom: 4px; }
.grid td select.ht-sel { height: 22px; min-height: 22px; padding: 0 2px; font-size: 12px; border-color: transparent; background-color: transparent; }
.grid tr:hover td select.ht-sel, .grid td select.ht-sel:focus { border-color: var(--line); background-color: #fff; }
.grid td .bk-tag, .grid td .status, .grid td .chip, .grid td .ld-nh { line-height: 1.35; padding-top: 0; padding-bottom: 0; }
.grid .col-chon input[type=checkbox] { margin: 0; vertical-align: middle; }
.summary { margin: 4px 2px 3px; }
main { padding: 6px 10px 20px; }
.subtab { padding: 7px 12px; }
.filters { padding: 5px 8px; gap: 3px 6px; }
.filters > label { flex-basis: 124px; }
.card { padding: 7px 10px; }
.card h4 { margin-bottom: 6px; }
.kv-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px 12px; }
.drawer-body { gap: 6px; padding: 8px 12px 20px; }
.ld-hd { margin-bottom: 6px; }
.ld-viec { padding: 6px 12px; margin-bottom: 6px; }
.ld-viec ul { gap: 3px; margin-top: 4px; }
.ld-sec { margin-bottom: 6px; }
.ld-sec h5 { padding: 5px 12px; }
.ld-o { padding: 6px 12px; }
.ld-v { font-size: 16px; margin-top: 1px; }
.loc-mo { display: none; }
.ld-viec li { display: block; position: relative; padding-left: 16px; line-height: 1.45; }
.ld-viec li .ld-dot { position: absolute; left: 0; top: .5em; }
.ld-viec li .ld-act { float: right; margin-left: 8px; }

@media (max-width: 700px) {
  main { padding: 4px 6px 16px; }
  input:not([type=checkbox]):not([type=radio]), select, .btn { min-height: 36px; }
  .btn { padding: 4px 12px; font-size: 15px; }
  .btn.small { min-height: 30px; font-size: 13px; }
  /* khung lọc: chỉ ô Tìm + nút; "⚙ Lọc" mở các ô còn lại */
  .filters { padding: 6px; gap: 4px 6px; }
  .filters:not(.mo) > label:not(.grow) { display: none; }
  .filters > label.grow { flex: 1 1 100%; max-width: none; }
  .filters > label { flex: 1 1 46%; }
  .filters label { font-size: 11px; }
  .filters .filter-actions { gap: 4px; }
  .filters:not(.mo) .filter-actions > .btn.ghost:not(.loc-mo), .filters:not(.mo) .filter-actions > .awb-xuat { display: none !important; }
  .filters .filter-actions > .btn { padding: 4px 10px; font-size: 14px; }
  .loc-mo { display: inline-flex; align-items: center; }
  .filters.mo .loc-mo { background: #fff4ea; border-color: #f4b37a; }
  .summary { margin: 4px 4px 2px; }
  .card { padding: 8px; }
  .drawer-head { padding: 6px 10px; }
  .drawer-body { padding: 6px 8px 16px; }
  /* thẻ lô */
  #ship-table > tbody > tr[data-id] { padding: 6px 8px; }
  #ship-table > tbody > tr > td.mono { font-size: 14px; }
  #ship-table > tbody > tr > td.col-tt .ht-sel { height: 26px; min-height: 26px; font-size: 12px; }
  table.grid.the-dt > tbody > tr { padding: 7px 8px; gap: 2px 10px; }
  .viec-the { padding: 8px; }
  .ld-g4 { grid-template-columns: 1fr 1fr; }
  .ld-o { border-bottom: 1px solid var(--line); }
  .ld-ph { margin-left: 0; text-align: left; width: 100%; }
  .ld-tools { justify-content: flex-start; }
  .ld-v .btn, .ld-act .btn { min-height: 26px; padding: 0 8px; font-size: 13px; }
}
/* 04/11: Theo dõi hàng gọn */
.td-tieu { font-size: 18px; }
.td-o { margin: 6px 0 4px; gap: 6px; }
.td-so { padding: 5px 10px; } .td-so b { font-size: 20px; }
.td-canh { padding: 5px 10px; margin: 5px 0; }
.td-muc { margin: 8px 0 3px; }
.td-the { padding: 5px 10px; margin: 4px 0; }
.td-h2, .td-h3 { margin-top: 1px; }
.td-nut { margin-top: 4px; }
.td-nut .btn { min-height: 26px; padding: 1px 10px; }
.td-sel, .td-tim { padding: 4px 8px; font-size: 13px; }
@media (max-width: 700px) { .td-nut .btn { min-height: 32px; font-size: 14px; } }
/* 04/11: điện thoại — Nhập cân theo ngày dạng thẻ (không kéo ngang), nút chọn chế độ gọn */
@media (max-width: 700px) {
  .kho-che { display: flex; gap: 4px; overflow-x: auto; }
  .kho-che .tab { flex: 0 0 auto; font-size: 13px; padding: 6px 10px; }
  .kn-hd { font-size: 12px; line-height: 1.35; }
  .table-wrap:has(> table.kn-bang) { overflow-x: hidden; max-height: none; }
  table.kn-bang, table.kn-bang > tbody { display: block; width: 100% !important; min-width: 0 !important; }
  table.kn-bang > tbody > tr > td.kn-cot, table.kn-bang .kn-cot { min-width: 0 !important; }
  table.kn-bang > tbody > tr { width: 100%; box-sizing: border-box; }
  table.kn-bang > thead { display: none; }
  table.kn-bang > tbody > tr { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
  table.kn-bang > tbody > tr > td { display: block; padding: 0 !important; border: 0 !important; max-width: none !important; white-space: normal; text-align: left !important; }
  table.kn-bang > tbody > tr > td:nth-child(1) { display: none; }
  table.kn-bang > tbody > tr > td:nth-child(2) { flex: 1 1 auto; }
  table.kn-bang > tbody > tr > td:nth-child(3) { font-size: 12px; text-align: right !important; }
  table.kn-bang > tbody > tr > td:nth-child(4) { flex: 0 0 100%; font-size: 12px; color: var(--muted); }
  table.kn-bang > tbody > tr > td:nth-child(4)::before { content: "① cân vận đơn: "; }
  table.kn-bang > tbody > tr > td:nth-child(5) { flex: 0 0 100%; }
  table.kn-bang > tbody > tr > td:nth-child(5) input { width: 100% !important; }
  table.kn-bang > tbody > tr > td:nth-child(6) { flex: 1 1 auto; }
  table.kn-bang > tbody > tr > td:nth-child(6) br { display: none; }
  table.kn-bang > tbody > tr > td:nth-child(6)::before { content: "② "; color: var(--muted); }
  table.kn-bang > tbody > tr > td:nth-child(7)::before { content: "④ NCC "; color: var(--muted); font-size: 12px; }
  table.kn-bang > tbody > tr > td:nth-child(7) input { width: 72px !important; }
  table.kn-bang > tbody > tr > td:nth-child(8) { flex: 0 0 100%; font-size: 12px; }
  table.kn-bang > tbody > tr > td.empty { grid-column: 1 / -1; display: block; }
}
/* 04/11: cột cố định khi kéo ngang — vạch phân cách sau cột ghim cuối */
.grid td.ghim-cuoi, .grid th.ghim-cuoi { box-shadow: inset -1px 0 0 var(--line), 4px 0 6px -4px rgba(0,0,0,.18); }
.grid tbody tr:hover td[data-ghim-on] { background: #f2f6fb !important; }

/* 13/11 (CEO duyệt A): Danh sách lô vừa 1 màn hình — gộp Khách con vào Khách hàng, DV + NCC vào Hãng, Zone vào Tuyến,
   Kiện + Chênh cân vào ② Cân, Bảng kê vào Giá bán; phí phát sinh chỉ hiện tổng (rê chuột xem từng khoản). Dòng phụ chữ nhỏ, xám. */
#ship-table .dong2 { font-size: 12px; color: #6b7385; line-height: 1.25; margin-top: 1px; white-space: nowrap; }
#ship-table .dong2:empty { display: none; }
#ship-table td.col-khach { max-width: 170px; }
#ship-table td.col-khach .col-kc { font-size: 12px; line-height: 1.25; margin-top: 1px; }
#ship-table td.col-khach .col-kc.kc-sua { cursor: text; }
#ship-table tr:not(:hover) .col-kc .kc-trong { display: none; }
#ship-table .col-kc .kc-trong { font-weight: 400; font-size: 11px; }
#ship-table td.col-tuyen { max-width: 150px; }
#ship-table td.col-hang { white-space: nowrap; }
#ship-table td.mono { font-size: 12.5px; }
#ship-table td.col-giaban .gb-sua { cursor: text; }
#ship-table td.col-giaban .dong2 .bk-tag { font-size: 11px; }
#ship-table > tbody > tr > td.fees { max-width: 130px; white-space: nowrap; }
#ship-table td.fees .fee-tag { display: block; }
#ship-table td.col-tt { max-width: 170px; white-space: normal; }
#ship-table td.fees .dong2 { overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
@media (max-width: 700px) {
  #ship-table > tbody > tr > td.col-kl::after { content: none; }
  #ship-table > tbody > tr > td.col-kl { text-align: right; }
  #ship-table td.col-hang, #ship-table td.col-tuyen, #ship-table td.col-giaban, #ship-table td.fees { white-space: normal; max-width: none; }
  #ship-table td.col-hang .dong2, #ship-table td.col-tuyen .dong2 { display: inline; margin-left: 4px; }
}

/* 13/11 (CEO duyệt): chi tiết lô gọn — thẻ chi tiết gập / mở, nút "+ Thêm phí" mở ô nhập phí */
#d-body details.ld-ct > summary { list-style: none; cursor: pointer; }
#d-body details.ld-ct > summary::-webkit-details-marker { display: none; }
#d-body details.ld-ct > summary h4 { display: block; margin: 0; }
#d-body details.ld-ct > summary h4::before { content: "▸ "; color: #6b7385; }
#d-body details.ld-ct[open] > summary h4::before { content: "▾ "; }
#d-body details.ld-ct[open] > summary { margin-bottom: 8px; }
#d-body details.ld-kien { margin: 6px 0 10px; }
#d-body details.ld-kien > summary { cursor: pointer; font-size: 13px; color: #3c4559; }
#d-body details.fee-them { margin-top: 8px; }
#d-body details.fee-them > summary { list-style: none; display: inline-flex; }
#d-body details.fee-them > summary::-webkit-details-marker { display: none; }
#d-body details.fee-them[open] > summary { margin-bottom: 8px; }
#d-body section.ld-tt h4 { font-size: 14px; }
#d-body .ld-sub .kc { font-size: 12px; font-weight: 600; color: #b45309; }

/* 14/11 (CEO duyệt): Nhập giá bán vừa 1 màn hình — dòng phụ chữ nhỏ; cảnh báo phí kiện 1 dòng */
#gb-table .gb-d2 { font-size: 12px; color: #6b7385; line-height: 1.25; margin-top: 1px; white-space: nowrap; }
#gb-table td.mono { font-size: 12.5px; }
#gb-table .gb-chia { min-width: 0; max-width: 230px; white-space: normal; }
#gb-table .gb-chia:empty { display: none; }
#gb-table .gb-chia small { display: block; font-size: 11.5px; line-height: 1.3; text-align: left; margin-top: 3px; }
#gb-table .gb-in { width: 86px; }
#gb-table .gb-tongin { min-width: 104px; }
#gb-phikien .gb-1dong { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#gb-phikien { padding-top: 6px; padding-bottom: 6px; }

/* 16/11 (CEO duyệt): Sổ quỹ gọn — sổ = hàng nút nhỏ; "+ Ghi 1 khoản" gập; lọc + tổng 1 hàng; bảng mỗi dòng 1 hàng chữ */
#sq-view .quy-head { padding: 8px 16px 4px; display: flex; align-items: center; gap: 8px; }
#sq-view .quy-cards { gap: 6px; }
#sq-view .sq-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 12px; border: 1px solid #d9dee7; border-radius: 999px; background: #fff; font-size: 13.5px; cursor: pointer; color: #2b3445; }
#sq-view .sq-chip b { font-size: 14px; color: var(--brand); }
#sq-view .sq-chip.active { border-color: var(--brand-2); background: #eef5fc; box-shadow: 0 0 0 2px rgba(46, 117, 182, .15); }
#sq-view .sq-chip.low b { color: var(--bad); }
#sq-view .sq-chip.sum { background: #f4f7fb; cursor: default; }
#sq-view details.sq-ghi { margin: 0 16px 6px; }
#sq-view details.sq-ghi > summary { list-style: none; cursor: pointer; padding: 2px 0; }
#sq-view details.sq-ghi > summary::-webkit-details-marker { display: none; }
#sq-view details.sq-ghi[open] .sq-ghi-nut { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
#sq-view details.sq-ghi > section.card { margin: 6px 0 0; }
#sq-view #sq-form { padding: 0; }
#sq-view #sq-filters { padding-top: 6px; padding-bottom: 6px; align-items: flex-end; }
#sq-view .sq-sum { align-self: center; font-size: 13px; color: #3c4559; margin-left: 6px; }
#sq-table td { white-space: nowrap; }
#sq-table td.sq-dg { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
#sq-table td.sq-ct { max-width: 150px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: #4a5468; }
#sq-table td.sq-hd { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
#sq-table td:nth-child(3) { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
#sq-table .btn.small { padding: 2px 9px; min-height: 0; line-height: 1.5; }
#sq-table .btn.ic { padding: 2px 6px; }
#sq-table .chip { font-size: 10.5px; padding: 0 5px; }
@media (max-width: 700px) { #sq-table td { white-space: normal; } #sq-table td.sq-dg { max-width: none; } }

/* 17/11: ô số HĐ gọn (Nhập giá bán · Công nợ theo lô) */
.gb-hdso-o { display: inline-flex; gap: 4px; margin-right: 10px; }
.gb-hdso-o .gb-hd-so { width: 92px; font-weight: 600; }
.gb-hdso-o .gb-hd-ngay { width: 128px; font-size: 12px; }
.gb-hd-so.gb-hd-co { background: #e2efda; border-color: #7bb26b; }
.cnl-hd-nhieu { display: inline-flex; gap: 4px; align-items: center; margin-left: 8px; }
.cnl-hd-nhieu input[type=date] { width: 128px; font-size: 12px; }

/* 18/11 (154): Báo cáo kinh doanh */
#bc-view .bc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 10px; }
#bc-view .bc-bar .seg { margin: 0; }
#bc-view .bc-the { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
#bc-view .bc-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 10px 0; }
#bc-view .bc-tiles.bc-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#bc-view .bc-o { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 12px; }
#bc-view .bc-l { color: var(--muted); font-size: 12px; }
#bc-view .bc-v { font-size: 21px; font-weight: 700; margin: 2px 0; color: var(--ink); }
#bc-view .bc-d { font-size: 12px; }
#bc-view .bc-len { color: var(--ok); } #bc-view .bc-xuong { color: var(--bad); }
#bc-view .bc-2 { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 12px; align-items: start; }
#bc-view .bc-2 > div { display: grid; gap: 12px; }
#bc-view .bc-2 + .card { margin-top: 12px; }
#bc-view .bc-svg { width: 100%; height: auto; display: block; }
#bc-view .bc-chu { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 4px; }
#bc-view .bc-chu i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
#bc-view tr.bc-tong td { font-weight: 700; background: #f1f4fa; }
#bc-view tr.bc-dam td { font-weight: 600; }
#bc-view tr.bc-con td:first-child { padding-left: 22px; color: #3a4256; }
#bc-view .bc-bam tbody tr[data-act] { cursor: pointer; }
#bc-view .bc-bam tbody tr[data-act]:hover td { background: var(--cam-nhat, #fff3e9); }
#bc-view .bc-cuon { max-height: 560px; overflow: auto; }
#bc-view .bc-canh { margin: 6px 0; font-size: 13px; }
#bc-view .bc-cam { color: var(--warn); }
@media (max-width: 900px) {
  #bc-view .bc-tiles, #bc-view .bc-tiles.bc-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #bc-view .bc-2 { grid-template-columns: 1fr; }
}
#bc-view .bc-ghi { color: var(--muted); font-size: 12px; margin: 6px 2px 0; }
#bc-view .bc-canh { background: #fff8e6; border: 1px solid #f3dca4; color: #7a5200; border-radius: var(--radius); padding: 6px 10px; margin: 8px 0; font-size: 13px; }
#bc-view .bc-bar select { width: auto; }

/* 02/12 (CEO duyệt mẫu 2): chi tiết lô gọn — đầu lô · băng cảnh báo · Cân · Giá bán · Giá trả (1 dòng như Sổ lô) · chi tiết gập */
#d-body .lx-dau { margin-bottom: 2px; }
#d-body .lx-dong1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#d-body .lx-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; position: relative; }
#d-body .lx-chip { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; background: #eef1f5; color: #3c4559; }
#d-body .lx-tt-da_ban_giao, #d-body .lx-tt-da_book { background: #1d2733; color: #fff; }
#d-body .lx-tt-cho_bill { background: #fff3e0; color: #b45309; }
#d-body .lx-tt-huy { background: #fde8e8; color: #b42318; }
#d-body .lx-ht { background: #e7f1fb; color: #1c5a96; }
#d-body .lx-ht.ht-da_giao { background: #e3f4ea; color: #1e7b4d; }
#d-body .lx-ht.ht-giu_hang, #d-body .lx-ht.ht-hoan_hang { background: #fde8e8; color: #b42318; }
#d-body .lx-ev { font-size: 12px; color: #556; margin-top: 2px; }
#d-body .ld-sub { margin-top: 5px; font-size: 13px; line-height: 1.5; }
#d-body .ld-sub b { color: #1d2733; }
#d-body .lx-xuat { display: inline-flex; gap: 4px; align-items: center; }
#d-body .lx-xuat input { padding: 3px 6px; font-size: 12px; }
#d-body details.lx-dd { position: relative; }
#d-body details.lx-dd > summary { list-style: none; }
#d-body details.lx-dd > summary::-webkit-details-marker { display: none; }
#d-body .lx-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; background: #fff; border: 1px solid #c9d2de; border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,.14); padding: 8px 10px; min-width: 260px; max-width: min(560px, calc(100vw - 24px)); }
#d-body .lx-pop .ht-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#d-body .lx-pop p { margin: 0 0 6px; }
#d-body .lx-mi { padding: 4px 0; border-bottom: 1px solid #eef1f5; }
#d-body .lx-mi:last-child { border-bottom: 0; }
#d-body #lo-ls { max-height: 260px; overflow: auto; }
#d-body .lx-bang { display: flex; gap: 6px; flex-wrap: wrap; background: #fff8ec; border: 1px solid #f5d9a8; border-radius: 8px; padding: 6px 8px; }
#d-body .lx-chip.c-cam { background: #fff3e0; color: #b45309; }
#d-body .lx-chip.c-do { background: #fde8e8; color: #b42318; }
#d-body .lx-chip.c-bang, #d-body .lx-bang .lx-chip { font-weight: 600; white-space: normal; }
#d-body .lx-h { font-weight: 700; font-size: 13px; margin: 6px 0 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#d-body .lx-m { font-weight: 400; color: #7a8494; font-size: 12px; }
#d-body .lx-mu { color: #7a8494; font-size: 11.5px; line-height: 1.3; font-weight: 400; }
#d-body .lx-can { margin-bottom: 0; }
#d-body .lx-can .ld-o { padding: 5px 12px; }
#d-body .lx-can .ld-lb { text-transform: none; letter-spacing: 0; font-size: 11.5px; }
#d-body .lx-so-wrap { overflow-x: auto; }
#d-body table.lx-so { width: 100%; border-collapse: collapse; font-size: 13px; }
#d-body table.lx-so th { font-size: 11px; color: #556; background: #f6f8fb; text-align: right; padding: 5px 7px; font-weight: 600; white-space: nowrap; }
#d-body table.lx-so td { text-align: right; padding: 6px 7px; vertical-align: top; border-bottom: 1px solid #eef1f5; }
#d-body table.lx-so .l { text-align: left; }
#d-body table.lx-so .tra { background: #f7f9fc; }
#d-body table.lx-so th.tra { background: #eef2f7; }
#d-body table.lx-so .lai { background: #eef8f0; color: #1a7f37; }
#d-body table.lx-so th.lai { background: #e2f3e6; }
#d-body .ld-so, #d-body .lx-gia { border: 1px solid #c9d2de; border-radius: 5px; padding: 3px 6px; width: 104px; text-align: right; font-weight: 600; font: inherit; font-weight: 600; }
#d-body .ld-so[data-cot="hd"] { width: 90px; text-align: left; }
#d-body .ld-so[readonly] { background: #f3f5f8; color: #556; }
#d-body .lx-gia { width: 150px; font-weight: 700; border-color: #e8740c; }
#d-body .lx-gia-o { min-width: 170px; }
#d-body .lx-gia-o .lx-mu { color: #b45309; max-width: 260px; margin-left: auto; }
#d-body .lx-big { font-size: 15px; }
#d-body .lx-ok { color: #1a7f37; font-weight: 600; }
#d-body .lx-hang { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 6px 0 2px; }
#d-body .lx-hang .lx-gian { margin-left: auto; }
#d-body .lx-hang details.fee-them { margin-top: 0; }
#d-body .lx-hang details.fee-them[open] { flex-basis: 100%; order: 9; }
#d-body .lx-vx { font-size: 12px; }
#d-body .lx-gat-on { border-color: #f4a261; background: #fff1e6; color: #b45309; font-weight: 600; }
#d-body details.lx-ctd { margin-top: 4px; }
#d-body details.lx-ctd > summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: #3c4559; padding: 3px 0; }
#d-body table.lx-ct td { vertical-align: top; }
#d-body table.lx-ct .lx-nut { white-space: nowrap; text-align: right; }
#d-body table.lx-ct .lx-nut .btn { padding: 1px 6px; font-size: 11.5px; }
#d-body table.lx-ct tr.lx-tvat td { border-top: 2px solid #d6dde6; }
#d-body table.lx-ct tr.lx-tong td { font-weight: 700; background: #f6f8fb; }
#d-body table.lx-ct tr.lx-them td { background: #fcfcfd; }
#d-body .lx-hdk { margin-top: 6px; }
#d-body details.lx-party > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#d-body details.lx-party > summary::-webkit-details-marker { display: none; }
#d-body details.lx-party > summary::before { content: "▸"; color: #7a8494; }
#d-body details.lx-party[open] > summary::before { content: "▾"; }
#d-body details.lx-party > summary .btn { margin-left: auto; }
#d-body .lx-tom { flex-basis: 100%; font-size: 13px; color: #334; padding-left: 16px; }
#d-body details.lx-party[open] .lx-tom { display: none; }
@media (max-width: 700px) {
  #d-body .lx-tools { margin-left: 0; width: 100%; }
  #d-body .lx-pop { position: fixed; left: 12px; right: 12px; top: auto; max-width: none; }
  #d-body .lx-can .ld-g4 { grid-template-columns: repeat(2, 1fr); }
  #d-body .lx-can .ld-o:nth-child(2) { border-right: 0; }
  #d-body .lx-can .ld-o:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  /* dòng Sổ lô → xếp dọc: mỗi ô 1 hàng nhãn | giá trị */
  #d-body table.lx-so thead { display: none; }
  #d-body table.lx-so, #d-body table.lx-so tbody, #d-body table.lx-so tr { display: block; }
  #d-body table.lx-so td { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; text-align: right; }
  #d-body table.lx-so td::before { content: attr(data-nh); color: #556; font-size: 12px; text-align: left; flex: none; }
  #d-body table.lx-so td.l { text-align: right; }
}
#d-body .lx-pop-ht { width: 470px; }

/* 03/12 (gói 185): Nhập cân theo ngày — phí / lưu ý của lô (ký hiệu từ danh mục phí) + số tờ khai */
.kn-bang td.kn-phi { min-width: 170px; }
.kn-kh { display: inline; }
.kn-k { display: inline-block; border: 1px solid #1d2733; border-radius: 4px; padding: 0 5px; margin: 0 3px 3px 0; font-weight: 700; font-size: 12px; background: #fff; }
.kn-bang .kn-phi .btn { padding: 1px 7px; font-size: 12px; }
.kn-bang input.kn-tk { width: 110px; margin-top: 3px; display: block; font-size: 12px; }
.kn-hop { position: absolute; z-index: 9999; background: #fff; border: 1px solid #c9d2de; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.15); padding: 6px; }
.kn-hop .kn-hop-tim { width: 100%; box-sizing: border-box; margin-bottom: 4px; }
.kn-hop-ds { max-height: 300px; overflow: auto; }
.kn-hop-ds div { padding: 6px 8px; border-radius: 5px; cursor: pointer; font-size: 13px; }
.kn-hop-ds div:hover { background: #e7f1fb; }
.kn-hop-ten { font-size: 13px; margin: 2px 0 6px; }
.kn-hop-so input { width: 160px; }
