/* Giao diện theo phong cách hệ thống cũ (BMS): thanh trên xanh, menu trái xám nhạt, bảng viền mảnh */
:root {
  --xanh: #3c8dbc; --xanh-dam: #367fa9; --xanh-nhat: #eaf2f8;
  --nen: #ffffff; --nen-xam: #f5f5f5; --vien: #dddddd; --vien-nhat: #e8e8e8;
  --chu: #333333; --phu: #777777;
  --ok: #2e7d32; --ok-nen: #e8f5e9; --loi: #c62828; --loi-nen: #fdecea;
  --canh-bao: #8a6d3b; --canh-bao-nen: #fcf8e3; --do: #dd4b39;
  --rong-menu: 250px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 13px/1.45 "Segoe UI", Roboto, Arial, sans-serif; color: var(--chu); background: var(--nen); }
a { color: var(--xanh); text-decoration: none; }
a:hover { text-decoration: underline; }
.ic { width: 15px; height: 15px; vertical-align: -3px; flex-shrink: 0; }
.ic.nho { width: 12px; height: 12px; }

/* ---------- thanh trên ---------- */
.dau-trang { height: 44px; background: var(--xanh); color: #fff; display: flex; align-items: stretch;
  justify-content: space-between; position: sticky; top: 0; z-index: 20; }
.logo { width: var(--rong-menu); display: flex; align-items: center; gap: 8px; padding: 0 20px;
  color: #fff; font-size: 19px; font-weight: 600; }
.logo:hover { text-decoration: none; }
.logo-o { width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--xanh); display: grid;
  place-items: center; font-size: 15px; font-weight: 700; }
.logo-anh { width: 34px; height: 34px; border-radius: 6px; background: #fff; display: grid; place-items: center;
  padding: 2px; flex-shrink: 0; }
.logo-anh img { max-width: 100%; max-height: 100%; display: block; }
.trang-dang-nhap { min-height: 100vh; background: #e9eef4 center / cover no-repeat; display: flex; align-items: flex-start; }
.trang-dang-nhap.co-nen { background-color: #33475b; }
.trang-dang-nhap .dang-nhap { box-shadow: 0 8px 30px rgba(0, 0, 0, .25); background: rgba(255, 255, 255, .95); }
.tai-khoan { position: relative; background: var(--xanh-dam); }
.tai-khoan summary { list-style: none; cursor: pointer; height: 44px; display: flex; align-items: center; gap: 8px;
  padding: 0 16px; font-size: 14px; }
.tai-khoan summary::-webkit-details-marker { display: none; }
.tai-khoan-menu { position: absolute; right: 0; top: 44px; min-width: 190px; background: #fff; border: 1px solid var(--vien);
  box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.tai-khoan-menu a, .tai-khoan-menu button.link { display: flex; gap: 8px; align-items: center; width: 100%; padding: 9px 14px;
  color: var(--chu); font: inherit; background: none; border: 0; text-align: left; cursor: pointer; }
.tai-khoan-menu a:hover, .tai-khoan-menu button.link:hover { background: var(--nen-xam); text-decoration: none; }
.tai-khoan-menu form { margin: 0; }

/* ---------- menu trái ---------- */
.khung { display: flex; min-height: calc(100vh - 44px); }
.menu { width: var(--rong-menu); flex-shrink: 0; background: var(--nen-xam); border-right: 1px solid var(--vien); }
.menu .nhom { border-bottom: 1px solid var(--vien-nhat); }
.menu .nhom summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 14px; color: var(--chu); font-size: 13.5px; }
.menu .nhom summary::-webkit-details-marker { display: none; }
.menu .nhom summary span { flex: 1; }
.menu .nhom summary:hover { background: #ececec; }
.menu .nhom.dang-mo summary { color: var(--xanh); font-weight: 600; }
.menu .nhom .mui-ten { width: 14px; height: 14px; color: #666; transition: transform .15s; }
.menu .nhom[open] .mui-ten { transform: rotate(180deg); }
.menu .nhom a { display: block; position: relative; padding: 8px 14px 8px 37px; color: var(--chu); background: #fff;
  border-top: 1px solid #f0f0f0; }
.menu .nhom a::before { content: ""; position: absolute; left: 22px; top: 0; bottom: 0; border-left: 1px dotted #bbb; }
.menu .nhom a:hover { background: #f3f7fb; text-decoration: none; }
.menu .nhom a.dang-mo { background: var(--xanh-nhat); color: var(--xanh); }
.menu .nhom a.dang-mo::after { content: "»"; position: absolute; left: 15px; color: var(--do); }
.menu .nhom a.dang-mo { box-shadow: inset -4px 0 0 var(--xanh); }

/* ---------- vùng nội dung ---------- */
.noi-dung { flex: 1; min-width: 0; }
.duong-dan { padding: 10px 20px; background: var(--nen-xam); border-bottom: 1px solid var(--vien-nhat);
  color: var(--xanh); font-weight: 600; font-size: 12.5px; }
main { padding: 14px 20px 40px; }
h1 { font-size: 18px; font-weight: 600; margin: 0 0 14px; }
h2 { font-size: 15px; font-weight: 600; margin: 20px 0 10px; }

/* thanh công cụ kiểu BMS */
.cong-cu { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding-bottom: 12px;
  border-bottom: 1px solid var(--vien-nhat); margin-bottom: 12px; }
.cong-cu form { margin: 0; display: contents; }
.btn, button, .nut { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid #ccc; background: #fff; color: var(--chu); border-radius: 2px; font: inherit;
  cursor: pointer; white-space: nowrap; }
.btn:hover, button:hover, .nut:hover { background: #f0f0f0; border-color: #adadad; text-decoration: none; }
.btn:disabled, button:disabled { opacity: .45; cursor: not-allowed; background: #fff; }
.btn.chinh, button.chinh { background: var(--xanh); border-color: var(--xanh-dam); color: #fff; }
.btn.chinh:hover, button.chinh:hover { background: var(--xanh-dam); }
.btn.nguy-hiem, button.nguy-hiem { color: var(--loi); }
.btn.nho, button.nho { height: 24px; padding: 0 8px; font-size: 12px; }
.nhom-tim { display: inline-flex; margin-left: 6px; }
.nhom-tim input { height: 32px; width: 240px; border: 1px solid #ccc; border-right: 0; padding: 0 8px; font: inherit;
  border-radius: 2px 0 0 2px; }
.nhom-tim .btn { border-radius: 0; margin-left: -1px; padding: 0 10px; }

/* bộ lọc nâng cao */
.bo-loc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 24px; padding: 4px 12px 14px;
  border-bottom: 1px solid var(--vien-nhat); margin-bottom: 12px; }
.bo-loc label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--chu); font-size: 13px; }
.bo-loc input, .bo-loc select { width: 100%; }
.an { display: none !important; }

label { display: block; font-size: 12px; color: var(--phu); margin-bottom: 3px; }
input[type=text], input[type=password], input[type=search], input[type=date], select, textarea {
  height: 34px; padding: 0 8px; border: 1px solid #ccc; border-radius: 2px; font: inherit; background: #fff;
  color: var(--chu); min-width: 0; }
textarea { height: auto; padding: 6px 8px; width: 100%; resize: vertical; background: #f3f3f3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #66afe9; box-shadow: 0 0 0 2px rgba(102,175,233,.25); }

/* bảng dữ liệu */
.bang { border: 1px solid var(--vien); }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 8px 9px; border: 1px solid var(--vien-nhat); text-align: left; vertical-align: middle; }
th { background: #f7f7f7; font-weight: 600; border-bottom: 2px solid var(--vien); white-space: nowrap; }
tbody tr:hover td { background: #f6f9fc; }
tr.chon td { background: #ddeeff !important; }
td.chk, th.chk { width: 44px; text-align: center; }
td.so, th.so { text-align: right; font-variant-numeric: tabular-nums; }
td.trong { color: var(--phu); text-align: center; padding: 24px; }
.ma { font-family: Consolas, monospace; font-size: 12px; word-break: break-all; }
tbody tr[data-href] { cursor: pointer; }

/* phân trang kiểu BMS */
.chan-bang { display: flex; justify-content: flex-end; align-items: center; gap: 4px; padding: 8px 10px;
  background: #eeeeee; border-top: 1px solid var(--vien); }
.chan-bang .btn { height: 30px; min-width: 38px; justify-content: center; }
.chan-bang select { height: 30px; }
.chan-bang .tong { margin-left: 6px; color: #555; }

/* khối thông tin (header chi tiết) */
.muc-tieu-de { display: inline-block; font-size: 15px; padding: 0 2px 5px; margin: 16px 0 10px;
  border-bottom: 2px solid var(--xanh); }
.luoi-tt { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.tt { display: grid; grid-template-columns: 240px 1fr; border-bottom: 1px solid var(--vien-nhat); padding: 9px 12px; }
.tt b { font-weight: 600; }
.tt .ic { color: #555; margin-right: 3px; }

/* tab theo loại */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--vien); margin-top: 6px; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--vien);
  border-bottom: 0; background: #f7f7f7; color: #c0392b; font-weight: 600; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; background: #fff; }
.tabs a.dang-mo { background: #fff; border-top: 2px solid var(--xanh); }
.tabs .dem { background: var(--xanh); color: #fff; border-radius: 2px; padding: 1px 12px; font-weight: 600; }
.khung-tab { border: 1px solid var(--vien); border-top: 0; padding: 12px; }

/* thông báo, nhãn */
.tb { padding: 9px 14px; border-radius: 2px; margin-bottom: 12px; border: 1px solid transparent; }
.tb.ok { background: var(--ok-nen); color: var(--ok); border-color: #c8e6c9; }
.tb.loi { background: var(--loi-nen); color: var(--loi); border-color: #f5c6c6; }
.tb.canh-bao { background: var(--canh-bao-nen); color: var(--canh-bao); border-color: #faebcc; }
.ds-loi { max-height: 320px; overflow: auto; margin: 6px 0 0; padding-left: 22px; font-size: 12.5px; }
.nhan { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; }
.nhan.xanh { background: var(--ok-nen); color: var(--ok); }
.nhan.vang { background: var(--canh-bao-nen); color: var(--canh-bao); }
.nhan.xam { background: #e4e7eb; color: var(--phu); }
.nhan.do { background: var(--loi-nen); color: var(--loi); }
.muted { color: var(--phu); }

/* các khối dùng ở trang khác */
.the { background: #fff; border: 1px solid var(--vien); border-radius: 2px; padding: 14px; margin-bottom: 14px; }
.hang { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.hang form { margin: 0; }
.luoi-so { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.luoi-so .the b { display: block; font-size: 24px; }
.luoi-o { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.o { border: 1px solid var(--vien); border-radius: 2px; padding: 4px 6px; background: #fff; font-size: 12px; }
.o.inactive { background: #eceff1; color: #9aa5b1; }
.o form { margin-top: 2px; }
.phan-trang { margin-top: 10px; display: flex; gap: 6px; align-items: center; }
.cot-quyen { columns: 3 260px; }
.nhom-quyen { break-inside: avoid; margin-bottom: 12px; }
.nhom-quyen label { color: var(--chu); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.dang-nhap { max-width: 360px; margin: 12vh auto; }
.dang-nhap input { width: 100%; margin-bottom: 10px; }
.dang-nhap button { width: 100%; justify-content: center; }

@media (max-width: 900px) {
  .menu { display: none; }
  .bo-loc, .luoi-tt { grid-template-columns: 1fr; }
  .tt { grid-template-columns: 140px 1fr; }
}

/* ô tick có mô tả */
.chk-dong { display: flex; gap: 8px; align-items: flex-start; color: var(--chu); font-size: 13px; margin: 0; }
.chk-dong input { margin-top: 3px; }
tr.muted td { color: #999; }
.o.co-hang { background: #e8f1fb; border-color: #9cc3e6; }
.nhan { white-space: nowrap; }
td.ma-gd { font-family: Consolas, monospace; font-size: 12px; white-space: nowrap; }

/* ---------- màn hình quét barcode (kiểu BMS) ---------- */
.man-hinh-quet { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 20px; align-items: start; }
.o-quet { width: 100%; height: 38px !important; font-size: 15px; border: 1px solid #f0ad4e !important; margin-bottom: 10px; }
.o-quet:focus { box-shadow: 0 0 0 3px rgba(240,173,78,.25) !important; }
.bang-quet { min-height: 420px; border: 1px solid var(--vien); overflow-x: auto; }
.bang-quet td input[type=text] { height: 28px; width: 72px; }
.panel-phai { background: #f7f7f7; border: 1px solid var(--vien); padding: 8px 16px 16px; }
.panel-phai .tt { grid-template-columns: 150px 1fr; padding: 9px 4px; }
.dem-cuon { display: inline-block; min-width: 48px; text-align: center; background: #dd4b39; color: #fff; font-weight: 700;
  padding: 2px 10px; border-radius: 2px; }
.bang-log { max-height: 300px; overflow: auto; border: 1px solid var(--vien); background: #fff; }
.bang-log table th, .bang-log table td { padding: 5px 7px; font-size: 12.5px; }
tr.log-loi td { color: var(--loi); }
tr.log-ok td { color: var(--ok); }
tr.log-canh-bao td { color: var(--canh-bao); background: var(--canh-bao-nen); }
.chon-xl { display: inline-flex; border: 1px solid #ccc; border-radius: 2px; overflow: hidden; }
.chon-xl button { height: 26px; border: 0; border-right: 1px solid #ccc; border-radius: 0; padding: 0 8px; font-size: 12px; }
.chon-xl button:last-child { border-right: 0; }
.chon-xl button.dang-chon { background: var(--xanh); color: #fff; }
.chon-xl button.dang-chon.ng { background: var(--loi); }
.ket-qua-luu { margin-top: 10px; }
@media (max-width: 1200px) { .man-hinh-quet { grid-template-columns: minmax(0, 1fr); } }

/* thanh thao tác trên các dòng đã chọn (chi tiết lô) */
.thanh-chon { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 2px;
  padding: 8px 10px; background: #f7f9fb; border: 1px solid #dfe5ea; }
.thanh-chon select { width: auto; min-width: 200px; }

/* nhập kho */
.o-pallet { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.o-pallet input { width: 170px; }
.o-pallet small { flex-basis: 100%; }
.chu-xanh { color: #2e7d32; }
.chu-do { color: #c62828; }
.bang-sp-xuat { width: 100%; border-collapse: collapse; margin: 6px 0; background: #fff; }
.bang-sp-xuat th, .bang-sp-xuat td { border: 1px solid var(--vien); padding: 6px 8px; font-size: 13px; text-align: left; }
.bang-sp-xuat td.so, .bang-sp-xuat th.so { text-align: center; }
.dem-xanh { display: inline-block; min-width: 40px; text-align: center; background: #3c8dbc; color: #fff; font-weight: 700;
  border-radius: 2px; padding: 1px 6px; }
@media print {
  .dau-trang, .menu, .duong-dan, .khong-in, .cong-cu { display: none !important; }
  .khung, .noi-dung, main { display: block !important; margin: 0 !important; padding: 0 !important; }
  .chi-tiet-2cot { grid-template-columns: minmax(0, 1fr) 300px; }
}
.chi-tiet-2cot { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .chi-tiet-2cot { grid-template-columns: 1fr; } }
.buoc-quet { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.buoc-quet label { flex-basis: 100%; font-weight: 600; font-size: 13px; }
.buoc-quet .o-quet { flex: 1; margin: 0; }
.buoc-quet .o-quet:disabled { background: #f1f1f1; border-color: #ddd !important; }
/* nút ⌨ gõ tay cạnh ô quét (chỉ màn hình cảm ứng — quet.js) */
.o-quet-boc { display: flex; gap: 6px; align-items: flex-start; width: 100%; }
.o-quet-boc .o-quet { flex: 1; min-width: 0; }
.buoc-quet .o-quet-boc { flex: 1; align-items: center; }
.nut-ban-phim { flex: none; height: 38px; min-width: 44px; padding: 0 8px; font-size: 20px; line-height: 1; }
.so-buoc { display: inline-block; width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 50%;
  background: var(--xanh); color: #fff; font-size: 12px; margin-right: 4px; }
.qr-lenh { display: flex; gap: 24px; justify-content: center; padding: 10px 4px; border-bottom: 1px solid var(--vien); }
.qr-lenh div { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.qr-lenh svg { border: 1px solid #ddd; }
[hidden] { display: none !important; }
.tieu-de-fgi { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* chia FGI thủ công */
.luoi-fgi { display: grid; grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); gap: 12px; }
.the-fgi { border: 1px solid var(--vien); background: #fff; margin-bottom: 12px; }
.the-fgi.vuot { border-color: #e57373; }
.the-fgi.rong { border-style: dashed; }
.the-fgi .dau-fgi { display: flex; gap: 10px; align-items: center; padding: 6px 10px; background: #f5f7f9; border-bottom: 1px solid var(--vien); }
.the-fgi .dau-fgi .nut-fgi { margin-left: auto; display: flex; gap: 4px; }
.the-fgi table { width: 100%; border-collapse: collapse; }
.the-fgi td { padding: 3px 8px; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.the-fgi .o-so { width: 64px; padding: 2px 4px; }
.the-fgi td.chuyen { white-space: nowrap; color: #666; }
.the-fgi td.chuyen select { width: auto; padding: 2px; }
.tb.loi div { margin-top: 3px; }
/* chi tiết FGI trong packing list (gợi ý / cuộn đã đóng) */
details.chi-tiet-fgi { margin: 4px 0 8px; }
details.chi-tiet-fgi summary { cursor: pointer; padding: 4px 2px; color: var(--xanh); }
.tieu-de-fgi form { display: inline-flex; }
dialog.hop-thoai { border: 1px solid var(--vien); border-radius: 4px; padding: 16px 20px; min-width: 340px; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
dialog.hop-thoai::backdrop { background: rgba(0,0,0,.3); }
dialog.hop-thoai label { display: inline-flex; gap: 6px; align-items: center; margin: 3px 0; cursor: pointer; }
/* thông báo lớn giữa màn hình quét (~1/4 màn hình) */
.tb-lon { position: fixed; left: 25vw; top: 25vh; width: 50vw; min-height: 50vh; max-height: 70vh; overflow: auto; z-index: 900;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 28px 36px;
  border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.35); text-align: center; cursor: pointer; }
.tb-lon[hidden] { display: none !important; }
.tb-lon.ok { background: #2e9d4f; color: #fff; }
.tb-lon.loi, .tb-lon.khoa { background: #fde2e1; color: #9b1c1c; border: 3px solid #e57373; }
.tb-lon.khoa { cursor: default; border-width: 5px; }
.tb-lon-tieu-de { font-size: clamp(26px, 3.4vw, 46px); font-weight: 800; letter-spacing: .5px; }
.tb-lon-noi-dung { font-size: clamp(16px, 1.7vw, 24px); line-height: 1.45; }
.tb-lon-goi-y { font-size: 15px; opacity: .85; font-weight: 600; }
@media (max-width: 900px) { .tb-lon { left: 5vw; width: 90vw; top: 20vh; } }
tr.dang-chon td { background: var(--xanh-nhat); }
/* ô chọn gõ được (chon_go.js) */
.chon-go { position: relative; display: inline-block; }
.chon-go:not(.tu-do) > input { padding-right: 22px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23555'/%3E%3C/svg%3E") no-repeat right 8px center; cursor: pointer; }
.chon-go:not(.tu-do) > input:focus { cursor: text; }
.chon-go ul { position: absolute; z-index: 30; left: 0; top: 100%; min-width: 100%; max-height: 260px; overflow: auto;
  margin: 2px 0 0; padding: 2px 0; list-style: none; background: #fff; border: 1px solid var(--vien);
  box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.chon-go li { padding: 5px 10px; cursor: pointer; white-space: nowrap; }
.chon-go li:hover, .chon-go li.sang { background: var(--xanh-nhat); }


/* ---------- máy handy / điện thoại (Zebra TC200J = TC20: 4.3" 480×800, Android) ---------- */
.nut-menu { display: none; background: transparent; border: 0; color: #fff; font-size: 22px; width: 44px; height: 44px;
  padding: 0; cursor: pointer; flex-shrink: 0; }
.luoi-handy { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.luoi-handy a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 96px;
  background: #fff; border: 1px solid var(--vien); border-radius: 6px; font-size: 16px; font-weight: 600; color: var(--xanh);
  text-align: center; padding: 10px; }
.luoi-handy a .ic { width: 28px; height: 28px; }
@media (max-width: 900px) {
  .nut-menu { display: block; }
  body.mo-menu .menu { display: block; position: fixed; top: 44px; left: 0; bottom: 0; z-index: 30; overflow-y: auto;
    width: min(300px, 85vw); box-shadow: 4px 0 18px rgba(0,0,0,.25); }
}
@media (max-width: 600px) {
  .logo { width: auto; padding: 0 6px; font-size: 16px; }
  .tai-khoan summary { padding: 0 10px; font-size: 13px; }
  .duong-dan { display: none; }
  main { padding: 8px 8px 30px; }
  h1 { font-size: 18px; }
  input, select, textarea, button, .btn { font-size: 16px; }          /* >= 16px: trình duyệt không tự phóng to */
  .btn, button { min-height: 40px; }
  .o-quet { height: 48px !important; font-size: 18px; }
  .nut-ban-phim { height: 48px; }
  .cong-cu { gap: 6px; }
  .cong-cu .btn, .cong-cu button { flex: 1 1 auto; justify-content: center; }
  .man-hinh-quet { gap: 10px; }
  .bang-quet { min-height: 0; max-height: 45vh; overflow: auto; }
  .panel-phai { padding: 6px 8px 10px; }
  .panel-phai .tt, .tt { grid-template-columns: 110px 1fr; padding: 7px 4px; font-size: 14px; }
  .qr-lenh, .khong-handy { display: none !important; }
  .noi-dung, main { min-width: 0; max-width: 100vw; overflow-x: hidden; }                                         /* máy handy quét bằng nút cứng, không cần QR lệnh */
  .bang-log { max-height: 160px; }
  .bang { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .bang table th, .bang table td { padding: 6px 6px; font-size: 13px; }
  .hang { flex-wrap: wrap; }
  .hang > div { flex: 1 1 100%; }
  .the { padding: 10px; }
  .tb-lon { left: 3vw; width: 94vw; top: 15vh; font-size: 20px; }
}

/* ===== Xử lý hàng (giống hệ thống cũ): cột tick OK / NG / Recall + bảng mối nối bên phải ===== */
.bang-xu-ly th.o-tick, .bang-xu-ly td.o-tick { width: 46px; text-align: center; padding-left: 4px; padding-right: 4px; }
.bang-xu-ly td.o-tick input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; margin: 0; }
.bang-xu-ly td.o-tick input[type=checkbox]:disabled { cursor: default; }
.bang-xu-ly tbody tr { cursor: pointer; }
.nut-cot { display: inline-grid; place-items: center; width: 30px; height: 28px; border: 1px solid transparent;
  border-radius: 3px; background: none; padding: 0; color: inherit; }
button.nut-cot { cursor: pointer; }
button.nut-cot:hover { background: #fff; border-color: var(--vien); }
.nut-cot svg { width: 18px; height: 18px; }
.nut-cot.ok { color: var(--xanh); }
.nut-cot.ng { color: var(--loi); }
.nut-cot.rc { color: var(--ok); }
.bang-xu-ly .tick-ok { accent-color: var(--xanh); }
.bang-xu-ly .tick-ng { accent-color: var(--loi); }
.bang-xu-ly .tick-recall { accent-color: var(--ok); }
.bang-moi-noi { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
.bang-moi-noi th, .bang-moi-noi td { border: 1px solid var(--vien); padding: 5px 8px; text-align: left; }
.bang-moi-noi th { background: var(--nen-xam); font-weight: 600; }
.bang-moi-noi td:first-child { width: 48%; white-space: nowrap; }
.bang-moi-noi input { width: 100%; box-sizing: border-box; padding: 4px 6px; border: 1px solid var(--vien); border-radius: 2px; }
.bang-moi-noi input:disabled, .bang-moi-noi input[readonly] { background: var(--nen-xam); color: #555; }

/* ===== Ô ngày dd/mm/yyyy (static/ngay.js): ô chữ + nút lịch, ô date gốc ẩn phía sau (vẫn gửi form) ===== */
.o-ngay { position: relative; display: inline-flex; align-items: center; vertical-align: middle; }
.o-ngay input[type=text] { width: 140px; padding-right: 30px; }
.o-ngay input[type=text][maxlength="16"] { width: 180px; }
.o-ngay input[type=text].sai { border-color: var(--loi); background: var(--loi-nen); }
.o-ngay .nut-lich { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px;
  border: 0; background: none; color: #777; cursor: pointer; display: grid; place-items: center; padding: 0; }
.o-ngay .nut-lich:hover { color: var(--xanh); }
.o-ngay .o-ngay-goc { position: absolute; right: 0; bottom: 0; width: 28px; height: 100%; opacity: 0;
  pointer-events: none; padding: 0; border: 0; min-width: 0; }
/* v111: bảng chọn ngày giờ 24h (ngay.js) */
.bang-gio { position: absolute; top: 100%; left: 0; z-index: 50; margin-top: 4px; background: var(--nen);
  border: 1px solid var(--vien); border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.15); padding: 8px; min-width: 250px; }
.bang-gio .hang-bg { display: flex; align-items: center; gap: 6px; margin: 4px 0; position: relative; }
.bang-gio label { margin: 0; font-weight: normal; }
.bang-gio select { width: auto; min-width: 58px; }
.bang-gio .lich-an { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none;
  padding: 0; border: 0; }
/* v100: nhập kho — danh sách cuộn đã bỏ qua (đã ở kho thành phẩm) */
details.bo-qua { margin-top: 10px; }
details.bo-qua > summary { cursor: pointer; color: var(--canh-bao); background: var(--canh-bao-nen); padding: 6px 8px; border-radius: 4px; }
