body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #ffffff;
}

header {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.header-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.header-btn {
  padding: 8px 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.header-btn.active {
  background: white;
  color: #0ea5e9;
  border-color: white;
}

.admin-link {
  padding: 8px 16px;
  color: white;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.admin-link:hover {
  background: rgba(255, 255, 255, 0.3);
}

.search-panel {
  margin: 20px;
  background: #f8f9fb;
  border: 1px solid #dfe3eb;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.search-grid label,
.barcode-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: #374151;
}

.search-grid input,
.barcode-field input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 14px;
}

.barcode-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.barcode-row button,
.search-actions button {
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid #0ea5e9;
  background: #0ea5e9;
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.search-actions button.ghost {
  background: white;
  color: #0ea5e9;
}

.search-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.action-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-messages {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.result-card.unassigned {
  border-left: 4px solid #f97316;
}

.result-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.result-meta {
  margin: 4px 0;
  color: #4b5563;
  font-size: 14px;
}

.map-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  padding: 20px;
  margin: 0 20px 20px;
  align-items: start;
  transition: grid-template-columns 0.3s ease;
}

.map-layout:has(.inbound-panel:not([style*="display: none"])) {
  grid-template-columns: 360px 1fr;
}

.map-layout:not(:has(.inbound-panel:not([style*="display: none"]))) {
  grid-template-columns: 1fr;
}

@media (max-width: 960px) {
  .map-layout {
    grid-template-columns: 1fr;
  }
}

.inbound-panel,
.map-panel {
  background: #f8f9fb;
  border: 1px solid #dfe3eb;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.inbound-panel {
  animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
  margin: 0 0 4px;
}

.section-heading h2 {
  margin: 0;
  font-size: 22px;
}

.sort-control {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: #374151;
}

.sort-control select {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

/* Zones container for side-by-side layout */
.zones-container {
  display: flex;
  flex-direction: row;
  gap: 20px;
  overflow-x: auto;
  padding: 0 0 12px 0;
  margin: 0 -18px 0 -18px;
  padding-left: 18px;
  padding-right: 18px;
}

.zone-section {
  flex: 0 0 auto;
  min-width: 0;
}

.zone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #0ea5e9;
}

.zone-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
}

.zone-count {
  font-size: 12px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 4px 8px;
  border-radius: 4px;
}

.section-subtitle {
  margin: 0 0 12px;
  color: #4b5563;
}

.info-box {
  background: white;
  border-radius: 8px;
  padding: 12px;
  border: 1px dashed #cbd5e1;
  color: #4b5563;
}

.inbound-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 80vh;
  overflow: auto;
}

.inbound-group {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.group-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.group-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.group-meta {
  color: #6b7280;
  font-size: 13px;
}

.group-qty {
  text-align: right;
  min-width: 70px;
}

.group-qty .qty {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.group-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inbound-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.inbound-row input[type="radio"] {
  width: 18px;
  height: 18px;
}

.inbound-row .row-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.row-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.row-sub {
  color: #6b7280;
  font-size: 13px;
}

.pill {
  background: #e0f2fe;
  color: #0ea5e9;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.inbound-row.selected {
  border-color: #0ea5e9;
  background: #f0f9ff;
}

.inbound-row:hover {
  border-color: #94a3b8;

.inbound-row .row-body {
  flex: 1;
  cursor: grab;
}

.inbound-row .row-body:active {
  cursor: grabbing;
}

.inbound-row .row-body.dragging {
  opacity: 0.6;
  background: rgba(167, 139, 250, 0.2);
  border-radius: 4px;
}
}

.map-actions {
  margin-top: 16px;

  .selection-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #374151;
    flex: 1;
  }

  .selection-summary strong {
    font-weight: 700;
  }

  .selection-summary .muted {
    color: #9ca3af;
  }
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: white;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.map-actions button {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: #22c55e;
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.map-actions button:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.map-actions .ghost {
  background: white;
  color: #0ea5e9;
  border: 1px solid #0ea5e9;
}

.selection-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #374151;
}

.muted {
  color: #6b7280;
}

.warehouse {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.warehouse-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.row-label {
  width: 70px;
  font-weight: bold;
  text-align: right;
}

.row-cells {
  display: flex;
  gap: 8px;
}

.stack {
  display: flex;
  flex-direction: column;
  width: 160px;
  border: 1px solid #999;
  flex-shrink: 0;
}

.tier {
  min-height: 54px;
  padding: 6px;
  font-size: 10px;
  line-height: 1.2;
  text-align: left;
  border-bottom: 1px solid #bbb;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.15s ease;
}

.tier * {
  pointer-events: none;
}

.product-code {
  font-weight: bold;
  font-size: 11px;
}

.lot {
  font-size: 9px;
  opacity: 0.8;
}

.item-line {
  font-size: 9px;
  line-height: 1.25;
  opacity: 0.9;
}

.tier:last-child {
  border-bottom: none;
}

.t { background: #f0f0f0; }
.m { background: #e0e0e0; }
.b { background: #d0d0d0; }


.empty {
  font-size: 10px;
  color: #777;
  font-style: italic;
}

.tier.occupied {
  background: #0ea5e9 !important;
  color: white;
}

.tier:not(.occupied):hover {
  background: #b2e5b2;
}

.tier.selected {
  outline: 3px solid #007bff;
  background: #cce5ff !important;
  color: black;

.tier.occupied {
  cursor: grab;
}

.tier.occupied:active {
  cursor: grabbing;
}

.tier.dragging {
  opacity: 0.6;
  background: #a78bfa !important;
}

.tier:not(.occupied) {
  cursor: pointer;
}

.tier:not(.occupied):hover {
  background: #c6f6d5 !important;
}
}

.tier.search-hit {
  outline: 3px solid #51f13c;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.25);
}

.tier.source {
  outline: 3px solid #6f42c1;
  background: #e9d8fd !important;
  color: #2d0a6a;
}

.tier.destination {
  outline: 3px solid #10b981;
  background: #d1fae5 !important;
  color: #064e3b;
}

/* Responsive design for tablets and mobile */
@media (max-width: 1200px) {
  .zones-container {
    gap: 16px;
  }

  .zone-section {
    min-width: auto;
  }

  .stack {
    width: 150px;
  }

  .row-label {
    width: 60px;
    font-size: 12px;
  }

  .row-cells {
    gap: 6px;
  }

  .product-code {
    font-size: 10px;
  }

  .lot {
    font-size: 8px;
  }
}

@media (max-width: 960px) {
  .map-layout {
    grid-template-columns: 1fr;
  }

  .zones-container {
    flex-direction: row;
    gap: 16px;
    overflow-x: auto;
  }

  .zone-section {
    flex: 0 0 auto;
    min-width: auto;
  }

  .zone-header {
    margin-bottom: 10px;
    padding-bottom: 6px;
  }

  .zone-title {
    font-size: 15px;
  }

  .zone-count {
    font-size: 11px;
  }

  .stack {
    width: 135px;
  }

  .row-label {
    width: 50px;
    font-size: 11px;
  }

  .warehouse-row {
    gap: 10px;
  }

  .row-cells {
    gap: 5px;
  }
}

@media (max-width: 768px) {
  header h1 {
    font-size: 18px;
  }

  .header-controls {
    gap: 8px;
  }

  .header-btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .admin-link {
    padding: 6px 12px;
    font-size: 13px;
  }

  .zones-container {
    flex-direction: column;
    gap: 20px;
    overflow-x: visible;
    margin: 0;
    padding: 0;
  }

  .zone-section {
    min-width: 100%;
  }

  .zone-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
  }

  .zone-title {
    font-size: 16px;
  }

  .stack {
    width: 135px;
  }

  .row-label {
    width: 55px;
    font-size: 12px;
  }

  .warehouse-row {
    gap: 12px;
  }

  .row-cells {
    gap: 8px;
  }

  .warehouse {
    gap: 12px;
  }
}

/* ===== Camera Scanner Styles ===== */

/* Scanner modal overlay */
.scanner-modal {
  display: flex; /* Changed from none - Vue v-if handles visibility */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.scanner-container {
  position: relative;
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.scanner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8f9fb;
}

.scanner-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.close-btn:hover {
  background: #e5e7eb;
}

.scanner-video {
  width: 100%;
  min-height: 300px;
  background: #000;
  position: relative;
}

/* Scanning guide overlay */
.scan-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 400px;
  height: 120px;
  border: 3px solid rgba(34, 197, 94, 0.7);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 10;
}

/* Visual feedback when scanning */
#scanner-video.scanning-flash {
  border: 3px solid #22c55e;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.6);
}

/* Override html5-qrcode default styles */
#qr-reader {
  border: none !important;
}

#qr-reader video {
  width: 100% !important;
  height: auto !important;
  object-fit: cover;
}

#qr-reader__dashboard {
  display: none !important;
}

.scanner-footer {
  padding: 16px 20px;
  border-top: 1px solid #e5e7eb;
  background: #f8f9fb;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.scanner-buttons {
  display: flex;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
  justify-content: center;
}

.scanner-status {
  margin: 0;
  font-size: 14px;
  color: #374151;
  text-align: center;
  font-weight: 500;
}

.scanner-footer button {
  padding: 10px 24px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.scanner-footer button.secondary-btn {
  background: #0ea5e9;
  color: white;
  border-color: #0ea5e9;
}

.scanner-footer button.secondary-btn:hover {
  background: #0284c7;
}

.scanner-footer button:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* Camera button styling */
.camera-btn {
  white-space: nowrap;
  min-width: fit-content;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .scanner-container {
    width: 95%;
    max-height: 95vh;
  }

  .scanner-video {
    min-height: 250px;
  }

  .barcode-row {
    flex-direction: column;
    align-items: stretch;
  }

  .barcode-row .action-buttons {
    width: 100%;
    justify-content: stretch;
  }

  .barcode-row .action-buttons button {
    flex: 1;
  }

  .camera-btn {
    flex: 0 0 auto !important;
    min-width: 80px;
  }
}

/* iPhone and mobile device specific optimizations */
@media (max-width: 480px) {
  .scanner-header {
    padding: 12px 16px;
  }

  .scanner-header h3 {
    font-size: 16px;
  }

  .scanner-footer {
    padding: 12px 16px;
  }

  .scanner-status {
    font-size: 13px;
  }
}

/* Improve button visibility on mobile */
@media (hover: none) and (pointer: coarse) {
  /* Touch device - make buttons bigger */
  .barcode-row button,
  .search-actions button,
  .action-buttons button {
    padding: 12px 16px;
    font-size: 15px;
    min-height: 44px; /* iOS recommended touch target size */
  }

  .camera-btn {
    min-width: 90px;
  }
}
/* Multi-select and staging styles */
.mode-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  margin: 16px 20px;
  padding: 12px;
  background: #f8f9fb;
  border: 1px solid #dfe3eb;
  border-radius: 10px;
  flex-wrap: wrap;
}

.mode-btn {
  padding: 10px 18px;
  border-radius: 8px;
  border: 2px solid #64748b;
  background: white;
  color: #64748b;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn:hover {
  background: #f1f5f9;
}

.mode-btn.active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: white;
}

.filter-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.customer-filter {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
  color: #374151;
}

.customer-filter select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 14px;
}

.clear-filter-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: white;
  color: #64748b;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.clear-filter-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.multi-select-action-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 24px;
  background: white;
  border: 2px solid #f59e0b;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 1000;
}

.multi-select-action-bar .selection-info {
  font-size: 16px;
  color: #1f2937;
}

.multi-select-action-bar .selection-info strong {
  color: #f59e0b;
  font-size: 20px;
}

.multi-select-action-bar .action-buttons {
  display: flex;
  gap: 10px;
}

.multi-select-action-bar button {
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid;
  transition: all 0.2s ease;
}

.stage-btn {
  background: #f59e0b;
  border-color: #f59e0b;
  color: white;
}

.stage-btn:hover {
  background: #d97706;
  border-color: #d97706;
}

.unstage-btn {
  background: #10b981;
  border-color: #10b981;
  color: white;
}

.unstage-btn:hover {
  background: #059669;
  border-color: #059669;
}

.dispatch-btn {
  background: #dc2626;
  border-color: #dc2626;
  color: white;
}

.dispatch-btn:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.multi-select-action-bar button.ghost {
  background: white;
  border-color: #cbd5e1;
  color: #64748b;
}

.multi-select-action-bar button.ghost:hover {
  background: #f1f5f9;
}

.tier-checkbox {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  z-index: 10;
  pointer-events: auto;
}

.tier {
  position: relative;
}

.tier.checked {
  outline: 3px solid #f59e0b;
  background: #fef3c7 !important;
  color: #78350f;
}

.tier.staged {
  border-left: 4px solid #10b981;
  background: #d1fae5 !important;
  color: #064e3b;
}

.tier.staged.occupied {
  background: #059669 !important;
  color: white;
}

.customer-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #10b981;
  color: white;
  font-size: 8px;
  padding: 2px 4px;
  border-radius: 4px;
  font-weight: 700;
  pointer-events: none;
  z-index: 5;
  max-width: 60px;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.2;
  text-align: center;
}

.tier.multi-move-dest {
  outline: 3px solid #8b5cf6;
  background: #ede9fe !important;
  color: #5b21b6;
}

.dest-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #8b5cf6;
  color: white;
  font-size: 24px;
  font-weight: 900;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.5);
}

.move-btn {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.move-btn:hover:not(:disabled) {
  background: #2563eb;
  border-color: #2563eb;
}

.move-btn:disabled {
  background: #cbd5e1;
  border-color: #cbd5e1;
  cursor: not-allowed;
  opacity: 0.6;
}

.multi-move-bar {
  border-color: #8b5cf6;
}

.multi-move-bar .selection-info strong {
  color: #8b5cf6;
}

.inbound-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin-right: 8px;
}

.inbound-row.checked {
  border-color: #f59e0b;
  background: #fef3c7;
}

@media (max-width: 768px) {
  .multi-select-action-bar {
    left: 10px;
    right: 10px;
    transform: none;
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }

  .multi-select-action-bar .action-buttons {
    width: 100%;
    flex-direction: column;
  }

  .multi-select-action-bar button {
    width: 100%;
  }

  .mode-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .mode-btn {
    width: 100%;
  }
}