/* ============================================================
   Sổ Xuất/Nhập/Tồn POSM & Thiết bị — tab `xnt` của Kho vận
   Bám đúng ngôn ngữ thiết kế đang chạy của workspace Kho vận
   (Bloomberg Light: navy #0a2540 · cyan #0891b2 · amber #d97706,
    JetBrains Mono cho mã & số). KHÔNG dựng bảng màu mới.

   Anti-bleed: mọi rule nằm dưới #workspace-warehouse …[data-wh-tab="xnt"],
   riêng modal gắn ở <body> nên khoá bằng class .xnt-modal.
   ============================================================ */

#workspace-warehouse .wh-tab-content[data-wh-tab="xnt"] .xnt-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Thanh chọn kho ─────────────────────────────────────── */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-bar-sp { flex: 1; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-hint,
.xnt-modal .xnt-hint {
  font-size: 12px;
  color: var(--text-muted, #697386);
  font-weight: 600;
}

.xnt-seg,
#workspace-warehouse [data-wh-tab="xnt"] .xnt-seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: #f1f5f9;
  border: 1px solid #e3e8ee;
  border-radius: 10px;
}
.xnt-seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 7px 15px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #697386;
  border-radius: 8px;
  cursor: pointer;
  transition: background .14s, color .14s;
  white-space: nowrap;
}
.xnt-seg-btn:hover { color: #0a2540; }
.xnt-seg-btn.on {
  background: #0a2540;
  color: #fff;
  box-shadow: 0 1px 3px rgba(10, 37, 64, .28);
}
.xnt-seg-sm .xnt-seg-btn { padding: 5px 12px; font-size: 12.5px; }

/* ── 3 chế độ: Xuất · Nhập · Tồn ───────────────────────── */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-modes {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e3e8ee;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-mode {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 9px 20px 10px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: #697386;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .14s, border-color .14s;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-mode:hover { color: #0a2540; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-mode.on {
  color: #0a2540;
  border-bottom-color: #0891b2;
}

/* ── Thẻ nội dung ───────────────────────────────────────── */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-card { margin-bottom: 0; padding: 16px 18px; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-head { align-items: flex-start; gap: 16px; flex-wrap: wrap; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-head-l { display: flex; flex-direction: column; gap: 2px; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-sub,
.xnt-modal .xnt-sub { font-size: 11.5px; color: #697386; font-weight: 500; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-acts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-input,
.xnt-modal .xnt-input {
  height: 34px;
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  color: #0a2540;
  background: #fff;
  border: 1px solid #e3e8ee;
  border-radius: 6px;
}
#workspace-warehouse [data-wh-tab="xnt"] #xnt-search { min-width: 250px; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-input:focus {
  outline: none;
  border-color: #0891b2;
  box-shadow: 0 0 0 3px rgba(8, 145, 178, .14);
}

/* ── KPI ────────────────────────────────────────────────── */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 2px 0 14px;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-kpi {
  border: 1px solid #e3e8ee;
  border-left: 4px solid var(--xk, #0a2540);
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-kpi-l {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #94a4b6;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-kpi-v {
  font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  font-size: 21px;
  font-weight: 700;
  color: #0a2540;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-kpi-s { font-size: 11.5px; color: #697386; }

/* ── Bảng ───────────────────────────────────────────────── */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-scroll {
  max-height: calc(100vh - 430px);
  min-height: 220px;
  overflow: auto;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-scroll-sm { max-height: 280px; min-height: 0; }

.xnt-table { width: 100%; }
.xnt-table th { white-space: nowrap; }
.xnt-table td { vertical-align: top; }
.xnt-table tbody tr:hover td { background: #f6f9fb; }
.xnt-c { text-align: center; }
.xnt-r { text-align: right; }
.xnt-mut { color: #94a4b6; }
.xnt-num, .xnt-code {
  font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  font-variant-numeric: tabular-nums;
}
.xnt-code { font-size: 12px; color: #0a2540; }
.xnt-num { font-weight: 600; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-doc-top td { border-top: 2px solid #dfe6ee; }

.xnt-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.xnt-tag-posm { background: #e0f2fe; color: #0e6f8a; }
.xnt-tag-equipment { background: #fef3c7; color: #92600a; }
.xnt-draft {
  background: #fef9c3;
  color: #854d0e;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
}

/* Bảng Tồn: 2 khối cột POSM / Thiết bị */
.xnt-stock .xnt-grp {
  text-align: center;
  font-size: 11px;
  letter-spacing: .08em;
  border-bottom: 1px solid #e3e8ee;
}
.xnt-stock .xnt-grp-posm { background: #eaf6fd; color: #0e6f8a; }
.xnt-stock .xnt-grp-eq { background: #fdf4e3; color: #92600a; }
.xnt-stock .xnt-blank { background: #fbfcfd; }
.xnt-stock .xnt-out { color: #b45309; }
.xnt-stock .xnt-in { color: #0e7490; }
.xnt-stock .xnt-bal { color: #0a2540; font-weight: 700; }
.xnt-stock .xnt-bal.neg { color: #b42318; }
.xnt-stock tfoot td {
  position: sticky;
  bottom: 0;
  background: #f1f5f9;
  border-top: 2px solid #cfd7df;
  font-weight: 700;
  color: #0a2540;
}

.xnt-icon {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: #697386;
  font: inherit;
  font-size: 12px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 6px;
  cursor: pointer;
}
.xnt-icon:hover { background: #f1f5f9; border-color: #e3e8ee; color: #b42318; }

/* ── Modal lập phiếu / tạo biên bản ─────────────────────── */
.xnt-modal {
  --accent: #0a2540;
  --border: #e3e8ee;
  --text: #0a2540;
  --text-muted: #697386;
  --bg-card: #ffffff;
  --bg-soft: #f6f9fb;
  --border-soft: #f1f5f9;
  font-size: 13px;
  color: #0a2540;
}
.xnt-modal .wh-modal-content { max-width: 1020px; }
.xnt-modal .wh-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #e3e8ee;
  border-top: 3px solid #0a2540;
  border-radius: 12px 12px 0 0;
}
.xnt-modal .wh-modal-header h3 { margin: 0; font-size: 15px; font-weight: 700; color: #0a2540; }
.xnt-modal .wh-modal-close {
  appearance: none; border: 0; background: transparent;
  font-size: 15px; color: #697386; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.xnt-modal .wh-modal-close:hover { background: #f1f5f9; color: #0a2540; }
.xnt-modal .wh-modal-body { padding: 18px 20px; overflow-y: auto; background: #fbfcfd; }
.xnt-modal .wh-modal-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-top: 1px solid #e3e8ee; background: #fff;
  border-radius: 0 0 12px 12px;
}
.xnt-modal .wh-modal-backdrop { position: absolute; inset: 0; background: rgba(10, 37, 64, .42); }
.xnt-modal .wh-btn.primary { background: #0a2540; border-color: #0a2540; color: #fff; }
.xnt-modal .wh-btn.primary:hover { background: #17395f; }

.xnt-fgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.xnt-modal .wh-form-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.xnt-modal .wh-form-field > label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #697386;
}
.xnt-modal .wh-form-field input[type="text"],
.xnt-modal .wh-form-field input[type="date"],
.xnt-modal .wh-form-field input[type="number"],
.xnt-modal .wh-form-field select {
  height: 36px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 13px;
  color: #0a2540;
  background: #fff;
  border: 1px solid #e3e8ee;
  border-radius: 6px;
  width: 100%;
}
.xnt-modal .wh-form-field input:focus,
.xnt-modal .wh-form-field select:focus {
  outline: none; border-color: #0891b2; box-shadow: 0 0 0 3px rgba(8, 145, 178, .14);
}
.xnt-modal .wh-form-field input[readonly] { background: #f1f5f9; color: #475569; }
.xnt-modal .xnt-party-mode { margin-bottom: 12px; }
.xnt-warn { font-size: 11.5px; color: #b45309; min-height: 14px; }
.xnt-builder-hint { font-size: 12px; color: #697386; margin: 2px 0 10px; }
.xnt-builder-prev { margin-top: 14px; }

/* ── Bảng dòng hàng trong modal ─────────────────────────── */
.xnt-lines {
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px 4px;
  margin-bottom: 14px;
}
.xnt-lines-hd {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #697386; margin-bottom: 8px;
}
.xnt-line-table { font-size: 12.5px; }
.xnt-line-table th {
  background: #f6f9fb; color: #697386; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .04em; padding: 7px 8px;
  border-bottom: 1px solid #e3e8ee; text-align: left;
}
.xnt-line-table td { padding: 5px 8px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.xnt-line-table input {
  width: 100%; height: 32px; padding: 0 8px;
  font-family: inherit; font-size: 12.5px; color: #0a2540;
  border: 1px solid #e3e8ee; border-radius: 5px; background: #fff;
}
.xnt-line-table input:focus { outline: none; border-color: #0891b2; box-shadow: 0 0 0 2px rgba(8, 145, 178, .14); }
.xnt-line-table input.bad { border-color: #e2b4ab; background: #fff7f6; }
.xnt-line-table .xnt-qty { text-align: right; font-family: 'JetBrains Mono', Consolas, monospace; font-weight: 600; }
.xnt-line-table .xnt-unit { font-size: 12px; }

/* Gợi ý mã ⇄ tên (2 ô tự đồng bộ) */
.xnt-cell { position: relative; }
.xnt-sug {
  position: absolute;
  z-index: 40;
  top: calc(100% - 2px);
  left: 4px;
  right: 4px;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #cfd7df;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(10, 37, 64, .18);
}
.xnt-sug-i {
  display: grid;
  grid-template-columns: 116px 1fr 48px;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12.5px;
  border-bottom: 1px solid #f1f5f9;
}
.xnt-sug-i:hover { background: #eaf6fd; }
.xnt-sug-c { font-family: 'JetBrains Mono', Consolas, monospace; font-size: 11.5px; color: #0e6f8a; font-weight: 600; }
.xnt-sug-n { color: #0a2540; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xnt-sug-u { color: #94a4b6; font-size: 11px; text-align: right; }
.xnt-sug-empty { padding: 10px; font-size: 12px; color: #94a4b6; }

@media (max-width: 1180px) {
  #workspace-warehouse [data-wh-tab="xnt"] #xnt-search { min-width: 170px; }
  #workspace-warehouse [data-wh-tab="xnt"] .xnt-scroll { max-height: none; }
}

/* Chip báo tab đang bị bộ lọc 🏢 Kho của workspace ghim */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-pin {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  background: #e0f2fe;
  color: #0e6f8a;
  border: 1px solid #b6e3f5;
  font-size: 11.5px;
  font-weight: 600;
}

/* ── Cột Đơn giá / Thành tiền ──────────────────────────────
   Giá trị bàn giao (Điều 1 biên bản) — căn cứ bồi thường, không phải giá bán. */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-price,
#workspace-warehouse [data-wh-tab="xnt"] .xnt-amt {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-amt { font-weight: 600; color: #5b21b6; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-price { color: #475569; }

/* Ô Đơn giá sửa thẳng trên bảng Tồn = bảng giá bàn giao */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-pcell { padding: 3px 6px; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-pedit {
  width: 100%; min-width: 92px; height: 28px; padding: 0 7px;
  text-align: right;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 12px; font-weight: 600; color: #0a2540;
  background: #fbfcfe; border: 1px solid #e3e8ee; border-radius: 5px;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-pedit:hover { border-color: #cbd5e1; background: #fff; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-pedit:focus {
  outline: none; background: #fff;
  border-color: #0891b2; box-shadow: 0 0 0 2px rgba(8, 145, 178, .14);
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-pedit::placeholder { font-weight: 400; color: #b7c2d0; }

/* Ô Đơn giá trong bảng dòng hàng (lập phiếu · trình tạo biên bản) */
.xnt-line-table .xnt-price-in {
  text-align: right;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
/* Giá do hệ thống tự điền — viền xanh nhạt để phân biệt với giá gõ tay */
.xnt-line-table .xnt-price-in.xnt-auto { border-color: #a5d8e8; background: #f4fbfd; }
.xnt-line-table .xnt-line-amt {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 600; color: #5b21b6; white-space: nowrap;
}
.xnt-warn-inline { color: #b45309; font-weight: 600; }

/* Đơn giá TRÍCH TỪ BẢNG GIÁ (phiếu chưa chốt giá) — phải nhìn ra ngay là chưa
   chốt, không được trông y hệt giá đã ký trên phiếu. */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-price-ref {
  color: #94a4b6;
  font-style: italic;
  text-decoration: underline dotted #cbd5e1;
  text-underline-offset: 3px;
  cursor: help;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-amt.xnt-price-ref { color: #a28bd4; }

/* ── Bảng dòng hàng: một dòng = MỘT hàng ngang, cuộn ngang khi hẹp ──
   Trước đây cột khai theo %, gặp 8 cột là chữ gãy xuống dòng. */
.xnt-lines-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 -2px;
  padding-bottom: 2px;
}
.xnt-lines-scroll::-webkit-scrollbar { height: 9px; }
.xnt-lines-scroll::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 99px; }
.xnt-lines-scroll::-webkit-scrollbar-thumb { background: #c6d0dc; border-radius: 99px; }
.xnt-lines-scroll::-webkit-scrollbar-thumb:hover { background: #a9b6c6; }

.xnt-line-table { table-layout: fixed; width: 100%; min-width: 1044px; }
.xnt-line-table.xnt-line-table-wide { min-width: 1166px; }
.xnt-line-table th,
.xnt-line-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xnt-line-table td > input { min-width: 0; }

/* Bảng gợi ý tách ra khỏi ô, neo theo màn hình — khung cuộn không xén được nữa */
.xnt-sug.xnt-sug-float {
  position: fixed;
  left: 0;
  top: 0;
  right: auto;
  z-index: 3200;
  width: 300px;
}

/* ── Cột STT: nút thêm dòng + nút chép dòng ──────────────── */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-stt-h {
  white-space: nowrap;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-addrow {
  width: 20px; height: 20px; margin-left: 5px; vertical-align: -4px;
  color: #0891b2; background: #e0f2fe; border: 1px solid #b6e3f5;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-addrow:hover { background: #0891b2; color: #fff; border-color: #0891b2; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-stt {
  white-space: nowrap;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-stt-n { margin-right: 3px; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-copy {
  width: 19px; height: 19px; vertical-align: -4px;
  color: #94a4b6; opacity: 0; transition: opacity .12s ease, color .12s ease;
}
#workspace-warehouse [data-wh-tab="xnt"] tr:hover .xnt-copy { opacity: 1; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-copy:hover { color: #0891b2; background: #e0f2fe; opacity: 1; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-copy:focus-visible { opacity: 1; }

/* ── Dòng đang nhập dở ngay trên sổ ──────────────────────── */
#workspace-warehouse [data-wh-tab="xnt"] tr.xnt-pend > td {
  background: #f2fbfe;
  border-bottom: 1px solid #cbeaf6;
  padding: 4px 6px;
  vertical-align: middle;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-pend-tag {
  display: inline-block; padding: 1px 7px; border-radius: 99px;
  background: #0891b2; color: #fff;
  font-size: 9.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-ed {
  width: 100%; min-width: 74px; height: 28px; padding: 0 7px;
  font-family: inherit; font-size: 12px; color: #0a2540;
  background: #fff; border: 1px solid #cfe3ec; border-radius: 5px;
}
#workspace-warehouse [data-wh-tab="xnt"] select.xnt-ed { padding: 0 4px; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-ed:focus {
  outline: none; border-color: #0891b2; box-shadow: 0 0 0 2px rgba(8, 145, 178, .14);
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-ed.bad { border-color: #e2b4ab; background: #fff7f6; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-ed-num {
  text-align: right;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-variant-numeric: tabular-nums; font-weight: 600;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-pend-kh {
  font-size: 11.5px; white-space: nowrap;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-pend-act { white-space: nowrap; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-ok {
  color: #0f7b6c; background: #e6f6f2; border: 1px solid #bce3da; margin-right: 3px;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-ok:hover:not(:disabled) { background: #0f7b6c; color: #fff; border-color: #0f7b6c; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-ok:disabled { opacity: .4; cursor: not-allowed; }

/* ── Dòng TRÙNG: đỏ hẳn lên, không lưu được ──────────────── */
#workspace-warehouse [data-wh-tab="xnt"] tr.xnt-pend.xnt-dup > td {
  background: #fdeeec;
  border-bottom-color: #f3c6bf;
}
#workspace-warehouse [data-wh-tab="xnt"] tr.xnt-pend.xnt-dup .xnt-pend-tag { background: #b42318; }
#workspace-warehouse [data-wh-tab="xnt"] tr.xnt-pend.xnt-dup .xnt-ed { border-color: #e6a79e; }
#workspace-warehouse [data-wh-tab="xnt"] tr.xnt-pend-warn > td {
  background: #fdeeec;
  border-bottom: 1px solid #f3c6bf;
  padding: 5px 12px 7px 46px;
  color: #b42318;
  font-size: 11.5px;
  font-weight: 600;
}

/* ── Nút xoá RIÊNG một dòng hạng mục ─────────────────────── */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-acts-cell { white-space: nowrap; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-linedel {
  width: 20px; height: 20px; vertical-align: -4px; margin-right: 2px;
  color: #94a4b6; opacity: 0; transition: opacity .12s ease, color .12s ease, background .12s ease;
}
#workspace-warehouse [data-wh-tab="xnt"] tr:hover .xnt-linedel { opacity: 1; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-linedel:hover:not(:disabled) {
  color: #b42318; background: #fdeeec; opacity: 1;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-linedel:focus-visible { opacity: 1; }
/* Dòng thuộc chứng từ khác: vẫn thấy nút nhưng mờ + con trỏ cấm, kèm lời giải
   thích ở tooltip — ẩn hẳn thì người dùng tưởng app quên làm. */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-linedel:disabled {
  opacity: .32; cursor: not-allowed; color: #94a4b6; background: transparent;
}
#workspace-warehouse [data-wh-tab="xnt"] tr:hover .xnt-linedel:disabled { opacity: .32; }

/* ── Nới chiều cao bảng sổ: thấy nhiều hàng hơn trên cùng màn hình ──
   Đo bằng Playwright trước khi sửa (1536×730): khung bảng 302px, hàng 39px,
   tiêu đề 44px → chỉ 6 hàng. Nén phần khung quanh bảng rồi trả chỗ đó cho bảng. */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-scroll {
  max-height: calc(100vh - 352px);
  min-height: 260px;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-scroll-sm { max-height: 210px; }

/* Hàng gọn lại: 39px → ~30px, tức thêm ~30% số hàng mà chữ vẫn nguyên cỡ */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-table td { padding: 6px 10px; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-table th { padding: 7px 10px; }
/* warehouse.css ghim cứng thead th { height: 44px } — không gỡ thì nén padding
   tiêu đề không ăn thua. Gỡ TRONG PHẠM VI tab này thôi, tab khác giữ nguyên. */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-table thead th { height: auto; }

/* Dải KPI: 77px → ~58px */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-kpis { gap: 8px; margin: 0 0 10px; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-kpi { padding: 7px 12px; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-kpi-v { font-size: 17px; line-height: 1.2; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-kpi-s { font-size: 11px; }

/* Hai hàng nút và khung thẻ: mỗi chỗ vài pixel, cộng lại đủ thêm một hàng */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-mode { padding: 6px 18px 7px; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-seg-btn { padding: 5px 14px; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-card { padding: 12px 16px; }
#workspace-warehouse .wh-tab-content[data-wh-tab="xnt"] .xnt-wrap { gap: 9px; }

/* Màn hình hẹp: bỏ trần, để cả trang cuộn thay vì nhốt bảng trong ô tí hon */
@media (max-width: 1180px) {
  #workspace-warehouse [data-wh-tab="xnt"] .xnt-scroll { max-height: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LỚP QUẢN LÍ POSM & THIẾT BỊ (24/09/2026)
   Trạng thái · Tiến độ · Ảnh xác nhận thực tế · Đối tượng xuất 5 loại.
   Append vào CUỐI file theo đúng luật anti-bleed: không sửa rule cũ, mọi
   selector vẫn nằm dưới #workspace-warehouse […data-wh-tab="xnt"].
   ═══════════════════════════════════════════════════════════════════════════ */

/* Bảng 18 cột không nhét vừa bề ngang nữa — cho cuộn ngang và ghim cột STT lại
   để cuộn sang phải vẫn biết đang ở dòng nào. table-layout auto giữ nguyên:
   đặt fixed ở đây là mọi rule co giãn cột bên trên thành vô nghĩa. */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-scroll { overflow-x: auto; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-table-wf { min-width: 1760px; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-table-wf td,
#workspace-warehouse [data-wh-tab="xnt"] .xnt-table-wf th { white-space: nowrap; }

/* ── Trạng thái: pill tô đầy nền, 2 bậc ─────────────────────────────────── */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-st {
  display: inline-block; padding: 2px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 700; line-height: 1.6; white-space: nowrap;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-st-proposed { background: #EEF2F7; color: #52525B; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-st-approved { background: #E5EDFF; color: #1D4ED8; }

/* ── Tiến độ: select tô theo NHÓM việc, không phải mỗi bậc một màu ──────── */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-prog-cell { min-width: 232px; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-prog {
  max-width: 218px; padding: 3px 6px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--bg-card);
  font-family: inherit; font-size: 11.5px; font-weight: 700; color: inherit;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-prog:disabled { opacity: .75; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-prog-todo  { background: #FFF7ED; border-color: #FED7AA; color: #B45309; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-prog-doing { background: #EFF6FF; border-color: #BFDBFE; color: #1D4ED8; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-prog-ok    { background: #ECFDF5; border-color: #A7F3D0; color: #047857; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-prog-bad   { background: #FEF2F2; border-color: #FECACA; color: #B91C1C; }

/* Nút lập phiếu: chỉ hiện ở dòng đã duyệt mà chưa có bút toán */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-issue {
  margin-left: 6px; padding: 3px 10px; font-size: 11.5px; font-weight: 700;
  background: #2563EB; border-color: #2563EB; color: #fff; border-radius: 4px;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-issue:hover { background: #1D4ED8; border-color: #1D4ED8; }

/* Dòng việc chưa lập phiếu: viền trái cobalt cho nổi khỏi phần lịch sử */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-row-todo > td:first-child { box-shadow: inset 3px 0 0 #2563EB; }

/* ── Ô Đối tượng xuất ───────────────────────────────────────────────────── */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-party { min-width: 108px; }

/* ── Nút ảnh xác nhận thực tế ───────────────────────────────────────────── */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-photo {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 99px; cursor: pointer;
  border: 1px dashed var(--border); background: transparent;
  color: var(--text-muted); font-family: inherit; font-size: 11.5px; font-weight: 700;
}
#workspace-warehouse [data-wh-tab="xnt"] .xnt-photo:hover { border-color: #2563EB; color: #2563EB; }
#workspace-warehouse [data-wh-tab="xnt"] .xnt-photo.has {
  border-style: solid; border-color: #A7F3D0; background: #ECFDF5; color: #047857;
}
/* Đang đứng đúng bậc đòi ảnh mà chưa có ảnh — đây là thứ chặn tiến độ đi tiếp */
#workspace-warehouse [data-wh-tab="xnt"] .xnt-photo.need {
  border-style: solid; border-color: #FECACA; background: #FEF2F2; color: #B91C1C;
}

/* ── Modal ảnh ──────────────────────────────────────────────────────────── */
#xnt-photo-modal .xnt-ph-head { margin-bottom: 10px; font-size: 13px; }
#xnt-photo-modal .xnt-ph-drop {
  padding: 18px; border: 2px dashed var(--border); border-radius: 8px;
  text-align: center; font-size: 12.5px; color: var(--text-muted);
  background: var(--bg-soft, #F7F7F9); outline: none;
}
#xnt-photo-modal .xnt-ph-drop.over { border-color: #2563EB; background: #EFF6FF; color: #1D4ED8; }
#xnt-photo-modal .xnt-ph-drop.need { border-color: #FECACA; background: #FEF2F2; }
#xnt-photo-modal .xnt-ph-drop.busy { opacity: .55; pointer-events: none; }
#xnt-photo-modal .xnt-ph-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px; margin-top: 12px;
}
#xnt-photo-modal .xnt-ph-item { margin: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
#xnt-photo-modal .xnt-ph-item img { display: block; width: 100%; height: 118px; object-fit: cover; }
#xnt-photo-modal .xnt-ph-miss { height: 118px; display: grid; place-items: center; font-size: 11.5px; color: var(--text-muted); }
#xnt-photo-modal .xnt-ph-item figcaption {
  display: flex; align-items: center; gap: 6px; justify-content: space-between;
  padding: 4px 6px; font-size: 10.5px; color: var(--text-muted);
}
#xnt-photo-modal .xnt-ph-note { margin-top: 10px; font-size: 11.5px; color: var(--text-muted); }
#xnt-photo-modal .xnt-btn-bad { color: #B91C1C; border-color: #FECACA; }
#xnt-photo-modal .xnt-btn-bad:disabled,
#xnt-photo-modal .wh-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Khung "lập phiếu cho dòng đã duyệt" trong modal phiếu ──────────────── */
#xnt-entry-modal .xnt-frombox {
  margin-bottom: 12px; padding: 9px 12px; border-radius: 8px;
  border-left: 3px solid #2563EB; background: #F4F6FF; font-size: 12.5px;
}
