/* ==========================================================================
   Xeno Seller - Warehouse, QR Packing, Shelf Location, Handover & Returns
   ========================================================================== */

.wh-container {
  max-width: 1140px;
  margin: 0 auto;
  padding-bottom: 48px;
}

/* Sub-tabs Navigation Bar (Quét gói đơn | Quét bàn giao & Báo cáo | Quét đơn trả hàng | Vị trí kệ) */
.wh-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--app-card, #ffffff);
  border: 1px solid var(--app-card-border, #e2e8f0);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.wh-tab-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.wh-tab-btn {
  padding: 8px 15px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--app-muted, #64748b);
  cursor: pointer;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.wh-tab-btn:hover {
  background: var(--app-bg, #f1f5f9);
  color: var(--app-ink, #0f172a);
}

.wh-tab-btn.active {
  background: #281a14;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(40, 26, 20, 0.22);
}

.wh-tab-badge {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
}

.wh-tab-btn:not(.active) .wh-tab-badge {
  background: #e2e8f0;
  color: #334155;
}

.wh-staff-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--app-ink, #0f172a);
}

.wh-staff-select {
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid var(--app-card-border, #cbd5e1);
  background: var(--app-bg, #f8fafc);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--app-ink, #0f172a);
}

/* Scan Box & Camera Viewport */
.wh-scan-card {
  background: var(--app-card, #ffffff);
  border: 1px solid var(--app-card-border, #e2e8f0);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.wh-scan-input-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.wh-scan-input {
  flex: 1;
  min-width: 240px;
  padding: 12px 16px;
  border-radius: 11px;
  border: 2px solid #cbd5e1;
  background: var(--app-bg, #f8fafc);
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--app-ink, #0f172a);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.wh-scan-input:focus {
  border-color: #281a14;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(40, 26, 20, 0.12);
}

.wh-btn-dark {
  background: #281a14;
  color: #ffffff;
  border: none;
  padding: 11px 20px;
  border-radius: 11px;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: opacity 0.15s, transform 0.12s;
}

.wh-btn-dark:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.wh-btn-outline {
  background: var(--app-card, #ffffff);
  color: var(--app-ink, #0f172a);
  border: 1.5px solid var(--app-card-border, #cbd5e1);
  padding: 10px 16px;
  border-radius: 11px;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s;
}

.wh-btn-outline:hover {
  border-color: #281a14;
  background: var(--app-bg, #f8fafc);
}

.wh-btn-outline.cam-active {
  background: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
}

/* Camera Frame (Matching video 00:04) */
.wh-camera-box {
  position: relative;
  width: 100%;
  max-width: 520px;
  height: 310px;
  margin: 14px auto;
  background: #0f172a;
  border-radius: 16px;
  overflow: hidden;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
}

.wh-camera-box.active {
  display: flex;
}

.wh-camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wh-camera-reticle {
  position: absolute;
  width: 210px;
  height: 210px;
  border: 2.5px solid rgba(255, 255, 255, 0.88);
  border-radius: 18px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.42);
  pointer-events: none;
}

.wh-camera-laser {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #10b981, transparent);
  animation: whScanLaser 2s infinite ease-in-out;
}

@keyframes whScanLaser {
  0%, 100% { top: 18px; }
  50% { top: 188px; }
}

.wh-camera-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Quick Sample QR Strip */
.wh-sample-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--app-muted, #64748b);
  margin-top: 8px;
}

.wh-sample-chip {
  background: var(--app-bg, #f1f5f9);
  border: 1px dashed #94a3b8;
  color: var(--app-ink, #0f172a);
  padding: 4px 10px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.14s;
}

.wh-sample-chip:hover {
  background: #281a14;
  color: #ffffff;
  border-color: #281a14;
}

.wh-ready-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--app-line, #e2e8f0);
  font-size: 0.82rem;
}

/* Scanned Order Result Card (Matching Video Frame 00:07-00:10) */
.wh-order-card {
  background: var(--app-card, #ffffff);
  border: 2px solid #281a14;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(40, 26, 20, 0.12);
  margin-bottom: 20px;
  animation: fadeInOrder 0.2s ease-out;
}

@keyframes fadeInOrder {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.wh-order-header {
  background: #18181b;
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.wh-order-id {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.wh-order-meta {
  font-size: 0.8rem;
  color: #d4d4d8;
  margin-top: 2px;
}

.wh-order-count-box {
  text-align: right;
  background: rgba(255, 255, 255, 0.12);
  padding: 6px 14px;
  border-radius: 10px;
}

.wh-order-items-list {
  padding: 8px 18px;
}

.wh-item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--app-line, #e2e8f0);
}

.wh-item-row:last-child {
  border-bottom: none;
}

.wh-item-row.checked {
  background: rgba(16, 185, 129, 0.05);
  border-radius: 10px;
  padding: 14px 10px;
}

.wh-item-thumb-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--app-card-border, #cbd5e1);
  background: #f8fafc;
  cursor: pointer;
}

.wh-item-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wh-zoom-btn {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.82);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
}

.wh-zoom-btn:hover {
  background: #e11d48;
  transform: scale(1.08);
}

.wh-item-info {
  flex: 1;
  min-width: 0;
}

.wh-item-title {
  font-size: 0.84rem;
  color: var(--app-muted, #475569);
  margin-bottom: 5px;
  line-height: 1.35;
}

.wh-item-variant {
  display: inline-block;
  font-size: 0.98rem;
  font-weight: 900;
  color: var(--app-ink, #0f172a);
  background: #fef3c7;
  border: 1px solid #fcd34d;
  padding: 3px 10px;
  border-radius: 7px;
  margin-bottom: 8px;
}

.wh-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wh-qty-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 5px 11px;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 900;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  color: #0f172a;
}

.wh-qty-pill.multi {
  background: #ffe4e6;
  border-color: #f43f5e;
  color: #be123c;
}

.wh-shelf-btn {
  padding: 5px 12px;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1.5px dashed #94a3b8;
  background: var(--app-card, #ffffff);
  color: var(--app-ink, #0f172a);
  transition: all 0.14s;
}

.wh-shelf-btn:hover {
  border-color: #281a14;
  background: #fef3c7;
}

.wh-shelf-btn.assigned {
  border-style: solid;
  border-color: #10b981;
  background: #dcfce7;
  color: #065f46;
}

.wh-pick-check {
  width: 22px;
  height: 22px;
  accent-color: #10b981;
  cursor: pointer;
  flex-shrink: 0;
}

.wh-order-footer {
  background: var(--app-bg, #f8fafc);
  padding: 14px 20px;
  border-top: 1px solid var(--app-line, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* Lightbox Zoom Modal */
.wh-zoom-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.86);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.wh-zoom-overlay.active {
  display: flex;
}

.wh-zoom-card {
  background: #ffffff;
  border-radius: 18px;
  max-width: 620px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  color: #0f172a;
}

.wh-zoom-img-stage {
  background: #f8fafc;
  height: 410px;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.wh-zoom-img-stage img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  transition: transform 0.2s ease;
  transform-origin: center center;
}

/* Handover & Reports Grids */
.wh-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.wh-kpi-card {
  background: var(--app-card, #ffffff);
  border: 1px solid var(--app-card-border, #e2e8f0);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}

.wh-kpi-label {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--app-muted, #64748b);
  margin-bottom: 5px;
}

.wh-kpi-num {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--app-ink, #0f172a);
}

.wh-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

@media (max-width: 900px) {
  .wh-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .wh-two-col { grid-template-columns: 1fr; }
}
