/* ============================================================
   GIAO DIỆN HỆ THỐNG PHIẾU XUẤT KHO D&D LONG AN
   ============================================================ */

:root {
  --primary: #0c5776;       /* Xanh công nghiệp chuyên nghiệp */
  --primary-hover: #001c44;
  --primary-light: #e8f7fa;
  --secondary: #4c6177;
  --success: #0c5776;
  --warning: #a4492a;
  --danger: #b91c1c;
  --bg-app: #eef5f8;
  --bg-card: #ffffff;
  --border: #c8d6e0;
  --border-focus: #2d99ae;
  --text-main: #001c44;
  --text-muted: #5f7184;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.4;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

/* Header & thanh điều hướng: xem v3.css (mục "THANH ĐẦU TRANG") */

/* Khung nội dung chính */
.main-container {
  max-width: 1380px;
  margin: 16px auto;
  padding: 0 16px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Thẻ card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  padding: 18px;
  margin-bottom: 16px;
}

/* ============================================================
   GIAO DIỆN TAB LẬP PHIẾU XUẤT KHO (KHỚP 100% ẢNH MẪU)
   ============================================================ */
.pxk-ui-panel {
  width: 100%;
}

/* DÒNG 1: MẪU PHIẾU */
.pxk-row-mau {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.pxk-lbl-mau {
  font-size: 13px;
  font-weight: 700;
  color: #4c6177;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.pxk-seg-group {
  display: inline-flex;
  background: #ebf2f6;
  padding: 4px;
  border-radius: 8px;
  gap: 2px;
}

.pxk-seg-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #22344f;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.pxk-seg-btn:hover {
  color: #001c44;
}

.pxk-seg-btn.active {
  background: #ffffff;
  color: #001c44;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.pxk-txt-desc {
  font-size: 12.5px;
  color: #4c6177;
  margin-left: 2px;
  line-height: 1.4;
}

/* DÒNG 2: DẢI SIZE (MẪU 3) */
.pxk-row-size {
  display: none;
  margin-bottom: 14px;
}

.pxk-row-size.show {
  display: block;
}

.pxk-size-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pxk-lbl-size {
  font-size: 13px;
  font-weight: 700;
  color: #001c44;
  white-space: nowrap;
}

.pxk-size-input {
  flex: 1;
  min-width: 280px;
  height: 36px;
  padding: 6px 12px;
  border: 1px solid #c8d6e0;
  border-radius: 6px;
  font-size: 13px;
  color: #0d2647;
  background: #ffffff;
  outline: none;
  box-sizing: border-box;
}

.pxk-size-input:focus {
  border-color: #2d99ae;
  box-shadow: 0 0 0 2px rgba(45, 153, 174, 0.15);
}

.pxk-size-pill {
  height: 32px;
  padding: 0 14px;
  border-radius: 9999px;
  border: 1px solid #c8d6e0;
  background: #ffffff;
  color: #22344f;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.pxk-size-pill.active,
.pxk-size-pill:hover {
  border: 1.5px solid #2d99ae;
  background: #e8f7fa;
  color: #0c5776;
  font-weight: 600;
}

.pxk-size-step {
  width: 32px;
  height: 32px;
  border: 1px solid #c8d6e0;
  border-radius: 6px;
  background: #ffffff;
  color: #22344f;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.pxk-size-step:hover {
  background: #f5f9fb;
  border-color: #93a3b4;
}

.pxk-size-btn-apply {
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 6px;
  background: #0c5776;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.pxk-size-btn-apply:hover {
  background: #001c44;
}

.pxk-size-hint {
  font-size: 12px;
  color: #5f7184;
  margin-top: 6px;
}

/* DÒNG 3 & 4: 8 Ô NHẬP LIỆU (GRID 4 CỘT X 2 HÀNG) */
.pxk-fields-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 16px;
  margin-bottom: 14px;
}

@media (max-width: 900px) {
  .pxk-fields-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .pxk-fields-grid {
    grid-template-columns: 1fr;
  }
}

.pxk-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pxk-field-lbl {
  font-size: 12px;
  font-weight: 600;
  color: #22344f;
}

.pxk-star {
  color: #b5532f;
  font-weight: 700;
  margin-left: 2px;
}

.pxk-input {
  height: 36px;
  padding: 6px 12px;
  border: 1px solid #c8d6e0;
  border-radius: 6px;
  font-size: 13px;
  color: #0d2647;
  background: #ffffff;
  outline: none;
  box-sizing: border-box;
  width: 100%;
}

.pxk-input:focus {
  border-color: #2d99ae;
  box-shadow: 0 0 0 2px rgba(45, 153, 174, 0.15);
}

.pxk-input::placeholder {
  color: #93a3b4;
}

select.pxk-input {
  cursor: pointer;
}

/* DÒNG 5: ĐỊA CHỈ IN ĐẦU PHIẾU */
.pxk-address-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.pxk-addr-lbl {
  font-size: 12.5px;
  font-weight: 600;
  color: #4c6177;
  white-space: nowrap;
}

.pxk-addr-input {
  flex: 1;
  min-width: 300px;
  height: 36px;
  padding: 6px 12px;
  border: 1px solid #c8d6e0;
  border-radius: 6px;
  font-size: 13px;
  color: #0d2647;
  outline: none;
  background: #ffffff;
  box-sizing: border-box;
}

.pxk-addr-input:focus {
  border-color: #2d99ae;
  box-shadow: 0 0 0 2px rgba(45, 153, 174, 0.15);
}

.pxk-addr-pill {
  height: 34px;
  padding: 0 16px;
  border-radius: 9999px;
  border: 1px solid #c8d6e0;
  background: #ffffff;
  color: #22344f;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.pxk-addr-pill:hover {
  background: #f5f9fb;
  border-color: #93a3b4;
}

.pxk-addr-pill.active {
  border: 1.5px solid #2d99ae;
  background: #e8f7fa;
  color: #0c5776;
  font-weight: 600;
}

.pxk-pin-svg {
  flex-shrink: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
}

.form-control {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: #ffffff;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(45, 153, 174,0.15);
}

.form-control[readonly] {
  background: #eef5f8;
  cursor: not-allowed;
  font-weight: 600;
}

/* Thanh công cụ bảng */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-group {
  display: inline-flex;
  gap: 6px;
}

.btn {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #0c5776; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #7a3317; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #991b1b; }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text-main); }
.btn-outline:hover { background: #f5f9fb; border-color: #93a3b4; }

/* BẢNG NHẬP LIỆU KIỂU EXCEL */
.excel-table-container {
  overflow-x: auto;
  border: 1px solid #93a3b4;
  border-radius: 4px;
  background: #fff;
  max-height: 480px;
  position: relative;
}

.excel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  user-select: text;
}

.excel-table th {
  background: #dfe8ee;
  color: #0d2647;
  font-weight: 700;
  text-align: center;
  padding: 6px 4px;
  border: 1px solid #93a3b4;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Cột trong bảng Model 3: cố định độ rộng để gõ phím không bị co giật */
.excel-table th.th-stt-col {
  width: 38px;
  min-width: 38px;
  white-space: nowrap;
  padding: 6px 2px;
}

.excel-table th.th-po-col {
  width: 135px;
  min-width: 135px;
  white-space: nowrap;
  padding: 6px 6px;
}

.excel-table th.th-ma-col {
  width: 90px;
  min-width: 90px;
  white-space: nowrap;
  padding: 6px 6px;
}

.excel-table th.th-chitiet-col {
  width: 110px;
  min-width: 110px;
  white-space: nowrap;
  padding: 6px 6px;
}

.excel-table th.th-dvt-col {
  width: 48px;
  min-width: 48px;
  white-space: nowrap;
  padding: 6px 2px;
}

/* Cột size & tổng trên web grid: co khít tối đa theo độ dài con số */
.excel-table th.th-size-col {
  width: 1%;
  min-width: 24px;
  padding: 2px 1px;
}

.excel-table th.th-total-col {
  width: 1%;
  min-width: 44px;
  padding: 2px 2px;
}

/* Ô nhập sửa trực tiếp tiêu đề Size trên dòng Header */
.size-header-input {
  width: 100%;
  min-width: 22px;
  max-width: 32px;
  text-align: center;
  font-weight: 700;
  font-size: 11px;
  color: #0c5776;
  background: #ffffff;
  border: 1px dashed #2d99ae;
  border-radius: 2px;
  padding: 1px 1px;
  outline: none;
  cursor: text;
  box-sizing: border-box;
}

.size-header-input:hover {
  background: #e8f7fa;
  border-color: #001c44;
}

.size-header-input:focus {
  background: #fdf0ea;
  border: 1px solid #b5532f;
  color: #6b2f1a;
  box-shadow: 0 0 0 2px rgba(224, 138, 107, 0.3);
}

.excel-table td {
  border: 1px solid #c8d6e0;
  padding: 0;
  background: #ffffff;
  position: relative;
}

.excel-cell {
  width: 100%;
  height: 100%;
  min-height: 28px;
  border: none;
  outline: none;
  padding: 4px 6px;
  font-family: inherit;
  font-size: 12px;
  background: transparent;
  box-sizing: border-box;
}

.excel-cell:focus {
  background: #e8f7fa;
  box-shadow: inset 0 0 0 2px #2d99ae;
  font-weight: 600;
}

.excel-cell.cell-center { text-align: center; }
.excel-cell.cell-right { text-align: right; }
.excel-cell.size-val-cell {
  padding: 4px 1px;
  text-align: center;
  font-weight: 500;
  min-width: 24px;
}
.excel-cell.textarea {
  resize: vertical;
  min-height: 38px;
  line-height: 1.3;
}

.excel-table tr:hover td {
  background-color: #f5f9fb;
}

.excel-table tr.selected-row td {
  background-color: #dcf4f7;
}

/* Dòng tổng cộng */
.excel-table tfoot td {
  background: #eef5f8;
  font-weight: 700;
  padding: 6px 8px;
  border: 1px solid #93a3b4;
}

/* Cảnh báo lệch size */
.mismatch-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.match-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #d3f3f7;
  color: #0c5776;
  border: 1px solid #8fd3e0;
}

/* Dashboard cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  border-left: 4px solid var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.stat-card.tc { border-left-color: #2d99ae; }
.stat-card.cma { border-left-color: #0c5776; }
.stat-card.cmb { border-left-color: #b5532f; }
.stat-card.total { border-left-color: #7c3aed; }

.stat-card .label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-card .value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin: 4px 0;
}

.stat-card .sub {
  font-size: 11px;
  color: var(--secondary);
}

/* Toast thông báo */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 10px 16px;
  border-radius: 6px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.2s ease-out;
}

.toast-success { background: #0c5776; }
.toast-error { background: #b91c1c; }
.toast-info { background: #001c44; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Modal in phiếu */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: #ffffff;
  border-radius: 8px;
  width: 900px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.modal-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ============================================================
   GIAO DIỆN CHUYÊN BIỆT CHO TRẠM KIỂM ĐỊNH QC / KCS
   (Thiết kế độc lập, khác biệt hoàn toàn với Phiếu Xuất Kho)
   ============================================================ */
.qc-station-card {
  background: #ffffff;
  border: 1px solid #2d99ae;
  border-top: 5px solid #2d99ae;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(45, 153, 174, 0.08);
  padding: 20px;
  margin-bottom: 20px;
}

.qc-station-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #d3f3f7;
  flex-wrap: wrap;
  gap: 10px;
}

.qc-station-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qc-station-title h2 {
  font-size: 16px;
  font-weight: 800;
  color: #0c5776;
  letter-spacing: -0.2px;
}

.qc-badge-pass {
  background: #d3f3f7;
  color: #0c5776;
  border: 1px solid #8fd3e0;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.qc-summary-pill {
  background: #eef9fb;
  border: 1px solid #8fd3e0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  color: #0c5776;
  font-weight: 700;
}

.qc-audit-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  background: #eef9fb;
  border: 1px solid #b9e6ee;
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}
/* ============================================================
   GIAO DIỆN TRẠM KIỂM ĐỊNH CHẤT LƯỢNG (QC / KCS CHUYỀN)
   Thiết kế chuyên biệt sản xuất, khác biệt hoàn toàn phiếu xuất kho
   ============================================================ */
.qc-station-card {
  border: 1px solid #b9e6ee !important;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(45, 153, 174, 0.08);
  padding: 18px;
  margin-bottom: 20px;
}

.qc-header-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e8f7fa;
}

.qc-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qc-header-title h2 {
  font-size: 16px;
  font-weight: 800;
  color: #0c5776;
  margin: 0;
  letter-spacing: -0.3px;
}

.qc-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #d3f3f7;
  color: #0c5776;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid #8fd3e0;
  text-transform: uppercase;
}

.qc-meta-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  background: #eef9fb;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid #b9e6ee;
  margin-bottom: 16px;
}

.qc-meta-bar .form-group label {
  font-size: 11px;
  font-weight: 700;
  color: #0c5776;
  text-transform: uppercase;
}

.qc-meta-bar .form-control {
  border-color: #8fd3e0;
  background: #ffffff;
  font-size: 13px;
}

.qc-meta-bar .form-control:focus {
  border-color: #0c5776;
  box-shadow: 0 0 0 2px rgba(45, 153, 174, 0.25);
}

/* Bảng ma trận mã hàng x cỡ size QC */
.qc-matrix-wrapper {
  overflow-x: auto;
  border: 1px solid #b9e6ee;
  border-radius: 6px;
  background: #ffffff;
  margin-bottom: 14px;
}

.qc-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 900px;
}

.qc-matrix-table th {
  background: #0c5776;
  color: #ffffff;
  font-weight: 700;
  padding: 8px 6px;
  text-align: center;
  border: 1px solid #001c44;
  white-space: nowrap;
}

.qc-matrix-table th.th-style {
  text-align: left;
  padding-left: 10px;
  width: 170px;
}

.qc-matrix-table th.th-color {
  text-align: left;
  padding-left: 10px;
  width: 120px;
}

.qc-size-head-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 12px;
  min-width: 24px;
}

.qc-matrix-table td {
  border: 1px solid #dfe8ee;
  padding: 3px;
  background: #ffffff;
  vertical-align: middle;
}

.qc-matrix-table tr:hover td {
  background: #f5f9fb;
}

.qc-matrix-table input.qc-style-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #c8d6e0;
  border-radius: 4px;
  font-weight: 700;
  font-size: 13px;
  color: #001c44;
  text-transform: uppercase;
  outline: none;
  box-sizing: border-box;
}

.qc-matrix-table input.qc-style-input:focus {
  border-color: #0c5776;
  background: #e8f7fa;
}

.qc-matrix-table input.qc-color-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #c8d6e0;
  border-radius: 4px;
  font-size: 12px;
  color: #22344f;
  outline: none;
  box-sizing: border-box;
}

.qc-matrix-table input.qc-color-input:focus {
  border-color: #0c5776;
  background: #e8f7fa;
}

.qc-matrix-table input.qc-size-input {
  width: 100%;
  height: 32px;
  padding: 2px;
  text-align: center;
  border: 1px solid #c8d6e0;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #0d2647;
  outline: none;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.qc-matrix-table input.qc-size-input:focus {
  border-color: #0c5776;
  background: #f8dad0;
  color: #000000;
  font-weight: 700;
}

.qc-matrix-table input.qc-size-input.has-val {
  background: #e8f7fa;
  border-color: #2d99ae;
  color: #0c5776;
  font-weight: 800;
}

.qc-row-total-badge {
  display: block;
  text-align: right;
  padding: 5px 8px;
  font-weight: 800;
  font-size: 13px;
  color: #0c5776;
}

.qc-btn-del-row {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 15px;
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.qc-btn-del-row:hover {
  background: #fee2e2;
}

.qc-matrix-table tfoot td {
  background: #eef9fb;
  font-weight: 800;
  padding: 8px 6px;
  border-top: 2px solid #0c5776;
  color: #0c5776;
}

/* Thanh điều khiển dưới bảng QC */
.qc-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #f5f9fb;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid #dfe8ee;
}

.qc-kpi-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e8f7fa;
  border: 1px solid #8fd3e0;
  color: #0c5776;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 16px;
}

.qc-btn-add {
  background: #ffffff;
  border: 1px dashed #0c5776;
  color: #0c5776;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.qc-btn-add:hover {
  background: #e8f7fa;
  border-color: #001c44;
}

.qc-btn-save {
  background: #0c5776;
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 7px 18px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(12, 87, 118, 0.3);
  transition: all 0.15s ease;
}

.qc-btn-save:hover {
  background: #001c44;
  box-shadow: 0 2px 6px rgba(12, 87, 118, 0.4);
}

/* ============================================================
   BẢNG SẢN LƯỢNG TỔ TRƯỞNG & DÒNG TĂNG CA LINH HOẠT
   ============================================================ */
.tt-overtime-row td {
  background: #fffaf8 !important;
}

.tt-overtime-row:hover td {
  background: #fdf0ea !important;
}

.tt-slot-input {
  width: 100%;
  border: 1px dashed #e08a6b;
  background: #ffffff;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #7a3317;
  outline: none;
  box-sizing: border-box;
}

.tt-slot-input:focus {
  border-color: #b5532f;
  background: #fdf0ea;
  box-shadow: 0 0 0 2px rgba(224, 138, 107, 0.25);
}

.quick-ot-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: #fbe6dd;
  color: #7a3317;
  border: 1px solid #f3c9b9;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.quick-ot-pill:hover {
  background: #f3c9b9;
  border-color: #e08a6b;
}

/* ============================================================
   CẬP NHẬT 10/2026: KHÁCH HÀNG · BỘ CHI TIẾT · DÒNG CAO · DANH MỤC
   ============================================================ */

/* --- Hàng chọn khách hàng --- */
.pxk-row-kh {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #dfe8ee;
}
.pxk-kh-pills, .pxk-kh-days { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pxk-kh-pill {
  height: 36px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1.5px solid #c8d6e0;
  background: #fff;
  color: #0d2647;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pxk-kh-pill:hover { border-color: #2d99ae; color: #0c5776; }
.pxk-kh-pill.active { background: #0c5776; border-color: #0c5776; color: #fff; box-shadow: 0 2px 6px rgba(12, 87, 118, 0.25); }
.pxk-kh-pill.pxk-kh-none { font-weight: 500; color: #5f7184; border-style: dashed; }
.pxk-kh-pill.pxk-kh-none.active { background: #eef5f8; color: #22344f; border-color: #93a3b4; box-shadow: none; }
.pxk-kh-days { margin-left: 6px; padding-left: 14px; border-left: 2px solid #dfe8ee; }
.pxk-kh-days:empty { display: none; }
.pxk-day-lbl { font-size: 12.5px; font-weight: 700; color: #001c44; }
.pxk-day-pill {
  height: 32px; padding: 0 14px; border-radius: 9999px; border: 1px solid #c8d6e0;
  background: #fff; color: #22344f; font-size: 13px; font-weight: 500; cursor: pointer;
}
.pxk-day-pill.active, .pxk-day-pill:hover { border: 1.5px solid #0c5776; background: #e8f7fa; color: #001c44; font-weight: 700; }

/* --- Panel bộ chi tiết (JiaYu) --- */
.pxk-bo-panel {
  display: none;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #fff7f3;
  border: 1px solid #f3c9b9;
  border-radius: 8px;
}
.pxk-bo-panel.show { display: flex; }
.pxk-bo-lbl { font-size: 13px; font-weight: 700; color: #7a3317; }
.pxk-bo-list { display: flex; gap: 8px; flex-wrap: wrap; }
.pxk-bo-btn {
  height: 34px; padding: 0 14px; border-radius: 6px; border: 1px solid #e08a6b;
  background: #fff; color: #7a3317; font-size: 13px; font-weight: 700; cursor: pointer;
}
.pxk-bo-btn small { font-weight: 500; color: #a4492a; }
.pxk-bo-btn:hover { background: #e08a6b; color: #fff; }
.pxk-bo-btn:hover small { color: #fff; }
.pxk-bo-empty { font-size: 12.5px; color: #7a3317; }

/* --- Bảng lập phiếu: dòng cao hơn, chữ to hơn --- */
.excel-table-container { max-height: 620px; }
#excel-grid { font-size: 14px; }
#excel-grid th { padding: 9px 6px; font-size: 13.5px; }
#excel-grid tbody td { height: 44px; }
#excel-grid .excel-cell { min-height: 42px; font-size: 14px; padding: 6px 8px; }
#excel-grid .excel-cell.size-val-cell { padding: 6px 2px; font-size: 14.5px; min-width: 34px; }
#excel-grid th.th-size-col { min-width: 52px; }
#excel-grid th.th-total-col { min-width: 84px; }
#excel-grid th.th-po-col { width: 130px; min-width: 130px; }
#excel-grid th.th-chitiet-col { min-width: 140px; }
#excel-grid .td-total-cell { font-size: 16px !important; color: var(--primary); }
.size-header-input { max-width: 72px; font-size: 13px; padding: 2px 3px; }

#excel-grid tfoot td { height: 48px; font-size: 16px; }
#excel-grid tfoot .foot-size-total { text-align: center; font-size: 17px; font-weight: 800; padding: 4px 2px; color: #001c44; }
#excel-grid tfoot .foot-grand-total { text-align: center; font-size: 20px; font-weight: 800; padding: 4px 4px; color: #fff; background: #0c5776; }

/* Dòng chi tiết & đồng bộ đôi (bộ JiaYu) */
#excel-grid tr.row-chitiet td:first-child { border-left: 4px solid #e08a6b; }
#excel-grid tr.row-chitiet td { background: #fffaf8; }
#excel-grid tr.row-dongbo td { background: #fbe6dd; border-top: 2px solid #e08a6b; }
#excel-grid tr.row-dongbo td:first-child { border-left: 4px solid #e08a6b; }
#excel-grid tr.row-dongbo .excel-cell { font-weight: 800; font-style: italic; color: #5a2614; }
#excel-grid tr.row-dongbo .td-total-cell { font-size: 17px !important; }
.btn-del-block {
  display: block; margin: 2px auto 0; border: none; background: transparent; color: #b91c1c;
  font-size: 12px; cursor: pointer; line-height: 1;
}
.btn-del-block:hover { color: #7f1d1d; transform: scale(1.2); }

/* --- Dashboard: chuyển chế độ xem --- */
.dash-view-switch { display: inline-flex; gap: 4px; padding: 4px; background: #dfe8ee; border-radius: 8px; margin-bottom: 14px; }
.dash-view-btn { border: none; background: transparent; padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 600; color: #4c6177; cursor: pointer; }
.dash-view-btn.active { background: #fff; color: #0c5776; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* --- Tab Danh mục --- */
.cat-sub-tabs { display: flex; gap: 6px; border-bottom: 2px solid #dfe8ee; margin-bottom: 16px; flex-wrap: wrap; }
.cat-sub-btn {
  border: none; background: transparent; padding: 10px 16px; font-size: 14px; font-weight: 600;
  color: #5f7184; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.cat-sub-btn.active { color: #0c5776; border-bottom-color: #0c5776; }
.cat-pane { display: none; }
.cat-pane.active { display: block; }
.cat-muted { color: #5f7184; font-size: 12px; }
.cat-table-wrap { overflow-x: auto; border: 1px solid #c8d6e0; border-radius: 6px; max-height: 520px; overflow-y: auto; }
.cat-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cat-table th { background: #dfe8ee; padding: 8px 6px; border: 1px solid #c8d6e0; position: sticky; top: 0; z-index: 2; white-space: nowrap; }
.cat-table td { padding: 6px; border: 1px solid #dfe8ee; vertical-align: top; }
.cat-table td.c { text-align: center; }
.cat-table-edit td { padding: 0; vertical-align: middle; }
.cat-table-edit td.c { padding: 0 4px; }
.cat-cell { width: 100%; height: 36px; border: none; background: transparent; padding: 4px 8px; font-size: 13px; font-family: inherit; outline: none; }
.cat-cell.r { text-align: right; }
.cat-cell:focus { background: #e8f7fa; box-shadow: inset 0 0 0 2px #2d99ae; }
.cat-row-hidden td { opacity: 0.5; }
.cat-row-new td { background: #eef9fb; }
.cat-row-saved td { background: #d3f3f7 !important; transition: background 0.3s; }
.btn-xs { padding: 3px 8px !important; font-size: 11px !important; }
.cat-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.cat-paste { margin-bottom: 10px; padding: 8px 12px; background: #f5f9fb; border: 1px dashed #c8d6e0; border-radius: 6px; }
.cat-paste summary { cursor: pointer; font-weight: 600; color: #001c44; }
.cat-textarea { height: auto !important; min-height: 70px; font-family: inherit; resize: vertical; width: 100%; }
.cat-form { margin-top: 16px; padding: 14px; border: 1px solid #c8d6e0; border-radius: 8px; background: #f5f9fb; display: flex; flex-direction: column; gap: 10px; }
.cat-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: #22344f; }
.cat-form-title { font-size: 15px; font-weight: 700; color: #0c5776; }
.cat-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cat-form-grid .span2 { grid-column: span 2; }
.cat-form-actions { display: flex; gap: 8px; justify-content: flex-end; }
.cat-sub-lbl { font-size: 12.5px; font-weight: 600; color: #22344f; margin-bottom: 6px; }
.cat-checks { display: flex; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 8px; }
.cat-form label.cat-check, .cat-check { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; font-size: 13px; }
.cat-bo-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cat-bo-layout .cat-form { margin-top: 0; }
.cat-bo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cat-bo-card { border: 1px solid #f3c9b9; background: #fff7f3; border-radius: 8px; padding: 10px; }
.cat-bo-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.cat-mini { width: 100%; border-collapse: collapse; font-size: 12.5px; background: #fff; }
.cat-mini th, .cat-mini td { border: 1px solid #f3c9b9; padding: 4px 6px; }
.cat-mini th { background: #fbe6dd; }
.cat-mini td.c { text-align: center; }
@media (max-width: 900px) {
  .cat-form-grid { grid-template-columns: 1fr 1fr; }
  .cat-bo-layout { grid-template-columns: 1fr; }
}


/* ============================================================
   HỘP HƯỚNG DẪN CÀI ỨNG DỤNG (PWA) – nút "Cài ứng dụng" nằm trong menu người dùng trên header
   ============================================================ */
.install-guide {
  max-width: 460px; width: calc(100% - 32px); margin: auto;
  border: none; border-radius: 14px; padding: 22px 24px;
  font-family: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif; color: #001c44;
  box-shadow: 0 20px 60px rgba(0, 28, 68, 0.25);
}
.install-guide::backdrop { background: rgba(0, 28, 68, 0.45); }
.install-guide h3 { font-size: 20px; margin-bottom: 14px; }
.install-guide-block { margin-bottom: 14px; font-size: 15px; line-height: 1.55; }
.install-guide-block ol { margin: 6px 0 0 20px; }
.install-guide-actions { display: flex; justify-content: flex-end; }
.install-guide-actions button { height: 42px; padding: 0 22px; border: none; border-radius: 8px; background: #0c5776; color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; }
@media (display-mode: standalone) { #btn-install-app { display: none !important; } }
