/* === CSS Variables === */
:root {
  --primary: #ff9900;
  --primary-dark: #e88b00;
  --border: #e0e0e0;
  --text-muted: #86868b;
}

/* === Reset & Base === */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* === Navigation === */
.nav {
  background: #232f3e;
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  height: 56px;
  gap: 24px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}
.nav-menu {
  margin-left: auto;
  position: relative;
}
.nav-menu-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 22px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  line-height: 1;
}
.nav-menu-btn:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  min-width: 200px;
  z-index: 200;
  overflow: hidden;
}
.nav-dropdown.open { display: block; }
.nav-dropdown-item {
  display: block;
  padding: 12px 16px;
  color: #1d1d1f;
  text-decoration: none;
  font-size: 14px;
}
.nav-dropdown-item:hover { background: #f5f5f7; }
.nav-icon { font-size: 24px; }
.nav-links { display: flex; gap: 4px; }
.nav-link {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}
.nav-link:hover { color: white; background: rgba(255,255,255,0.1); }
.nav-link.active { color: white; background: rgba(255,255,255,0.15); }
.nav-badge {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ff9900;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.badge-dot {
  width: 6px; height: 6px;
  background: white;
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* === Pages === */
.page { display: none; max-width: 1200px; margin: 0 auto; padding: 16px; }
.page.active { display: block; }

/* === Stats Bar === */
.list-total {
  font-size: 12px;
  font-weight: 600;
  color: #999;
  padding: 4px 4px 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.location-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 4px 6px;
  font-size: 14px;
  font-weight: 700;
  color: #444;
}
.location-subtotal {
  font-size: 12px;
  font-weight: 400;
  color: #aaa;
  margin-left: 2px;
}

/* === Messages Banner === */
.messages-banner {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}
.messages-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}
.messages-icon { font-size: 20px; }
.messages-text { flex: 1; font-size: 14px; font-weight: 500; color: #856404; }

/* === Filter Row (tabs + select button) === */
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.filter-row .filter-tabs {
  margin-left: auto;
  margin-bottom: 0;
}
.select-mode-btn {
  flex-shrink: 0;
  white-space: nowrap;
}
.select-mode-btn.active {
  background: #232f3e;
  color: white;
  border-color: #232f3e;
}

/* === Select Toolbar === */
.select-toolbar {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: #f0f2f5;
  border-radius: 12px;
  margin-bottom: 12px;
}
.select-toolbar.active { display: flex; }
.select-count {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  flex-shrink: 0;
}
.select-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}

/* === Return card select state === */
.return-card.selectable { position: relative; cursor: pointer; }
.return-card.selectable:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.return-card.selected { outline: 2px solid #ff9900; }
.select-checkbox {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #ddd;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: transparent;
  z-index: 2;
  flex-shrink: 0;
  transition: all 0.15s;
}
.return-card.selected .select-checkbox {
  background: #ff9900;
  border-color: #ff9900;
  color: white;
}

/* === Filter Tabs === */
.filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.filter-tab {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.filter-tab:hover { border-color: #999; }
.filter-tab.active {
  background: #232f3e;
  color: white;
  border-color: #232f3e;
}
.filter-count {
  display: inline-block;
  background: rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
  margin-left: 2px;
}
.filter-tab.active .filter-count {
  background: rgba(255,255,255,0.2);
}

/* === Returns List === */
.returns-list { display: flex; flex-direction: column; gap: 12px; }

/* === Return Card === */
.return-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.return-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.return-card-inner {
  display: flex;
  gap: 12px;
  padding: 16px;
  align-items: flex-start;
}
.return-info { flex: 1; min-width: 0; }
.return-card-images {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  flex-shrink: 0;
}
.return-thumb {
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  flex-shrink: 0;
}
.return-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #ccc;
  border-style: dashed;
}
.return-name {
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.return-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
}
.tag-status {
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-size: 10px;
  font-weight: 700;
}
.tag-pending { background: #fff3cd; color: #856404; }
.tag-processing { background: #e3f2fd; color: #1565c0; animation: pulse-tag 1.4s ease-in-out infinite; }
.tag-dropoff_ready { background: #d4edda; color: #155724; }
.tag-dropped_off { background: #d1ecf1; color: #0c5460; }
.tag-refunded { background: #c3e6cb; color: #155724; }
.tag-awaiting_info { background: #f8d7da; color: #721c24; }
.tag-error { background: #f5c6cb; color: #721c24; }
.tag-reason { background: #f0f2f5; color: #555; }
.tag-refund { background: #d4edda; color: #155724; font-weight: 600; }
.tag-deadline { background: #fff0f0; color: #c0392b; }
.tag-location { background: #e8f5e9; color: #2e7d32; }
.return-order {
  font-size: 11px;
  color: #aaa;
}

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #86868b;
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 20px; color: #1d1d1f; margin-bottom: 8px; }
.empty-state p { margin-bottom: 20px; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  gap: 6px;
}
.btn-primary {
  background: #ff9900;
  color: #111;
}
.btn-primary:hover { background: #e88b00; }
.btn-outline {
  background: transparent;
  border: 1.5px solid #ddd;
  color: #555;
}
.btn-outline:hover { border-color: #999; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 32px; font-size: 16px; width: 100%; margin-top: 16px; }
.btn-danger { background: #d32f2f; color: white; }
.btn-danger:hover { background: #b71c1c; }
.btn-success { background: #067d62; color: white; }
.btn-success:hover { background: #056652; }

/* === Upload Page === */
.upload-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 0;
}
.upload-container h2 { font-size: 22px; margin-bottom: 4px; }
.upload-subtitle { color: #86868b; margin-bottom: 20px; font-size: 14px; }
.upload-zone {
  border: 2px dashed #ccc;
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: #ff9900;
  background: #fff8ee;
}
.upload-icon { font-size: 48px; margin-bottom: 12px; }
.upload-text { font-size: 16px; font-weight: 600; color: #333; }
.upload-subtext { font-size: 14px; color: #86868b; margin-top: 4px; }
.upload-formats { font-size: 12px; color: #aaa; margin-top: 12px; }

/* === Preview Area === */
.preview-area { margin-top: 20px; }
.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.preview-header h3 { font-size: 16px; }
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}
.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f0f0f0;
}
.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* === Form Group === */
.form-group { margin-top: 16px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}
.form-group select, .form-group input, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
  background: white;
  color: #333;
  -webkit-appearance: none;
}
.form-group select:focus, .form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: #ff9900;
  box-shadow: 0 0 0 3px rgba(255,153,0,0.15);
}

/* === Upload Progress === */
.upload-progress { margin-top: 20px; text-align: center; }
.progress-bar {
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}
@keyframes pulse-tag {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@keyframes analyzing-shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.progress-fill {
  height: 100%;
  background: #ff9900;
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s;
}
.progress-text { font-size: 14px; color: #86868b; }
.progress-fill-analyzing {
  background: linear-gradient(90deg, #ff9900 0%, #ffcc66 40%, #ff9900 60%, #ff9900 100%);
  background-size: 200% auto;
  animation: analyzing-shimmer 1.4s linear infinite;
}

/* === Upload Success === */
.upload-success { text-align: center; margin-top: 32px; }
.success-icon { font-size: 48px; margin-bottom: 12px; }
.upload-success h3 { font-size: 20px; margin-bottom: 8px; }
.upload-success p { color: #86868b; margin-bottom: 20px; }
.success-actions { display: flex; gap: 12px; justify-content: center; }

/* === Modal === */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}
.modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-lg { max-width: 700px; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}
.modal-header h3 { font-size: 18px; }
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 0 4px;
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* === Detail Modal === */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.detail-images {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.detail-images img {
  border-radius: 10px;
  border: 1px solid #eee;
  max-height: 200px;
  object-fit: contain;
}
.detail-field { margin-bottom: 12px; }
.detail-label {
  font-size: 11px;
  color: #86868b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.detail-value { font-size: 15px; margin-top: 2px; }
.detail-qr {
  text-align: center;
  margin: 16px 0;
  padding: 16px;
  background: #fafafa;
  border-radius: 12px;
}
.detail-qr img {
  width: 180px;
  height: 180px;
  border: 2px solid #ddd;
  border-radius: 10px;
  padding: 6px;
  background: white;
}
.detail-qr p { font-size: 13px; color: #888; margin-top: 8px; }
.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

/* === Messages === */
.message-item {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}
.message-item:last-child { border-bottom: none; }
.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.message-direction {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.message-direction.from-claude { color: #0066cc; }
.message-direction.from-user { color: #067d62; }
.message-time { font-size: 11px; color: #aaa; }
.message-text { font-size: 14px; color: #333; line-height: 1.5; }
.message-product { font-size: 12px; color: #86868b; margin-top: 4px; }
.message-reply {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}
.message-reply input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}
.message-reply input:focus {
  outline: none;
  border-color: #ff9900;
}

/* === Loading Spinner === */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid #ddd;
  border-top-color: #ff9900;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Responsive === */
@media (max-width: 768px) {
  .nav-title { display: block; }
  .return-card-inner {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .preview-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-actions { flex-direction: column; }
  .success-actions { flex-direction: column; }
}

/* === Camera FAB === */
.camera-fab {
  position: fixed;
  bottom: 28px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ff9900;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  transition: transform 0.15s, box-shadow 0.15s;
}
.camera-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.camera-fab:active { transform: scale(0.95); }

/* === Print Modal === */
.print-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.print-modal-backdrop {
  position: absolute;
  inset: 0;
}
.print-modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
}
.print-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.print-modal-header h3 { font-size: 17px; }
.print-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}
.print-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}
.print-modal-footer .btn { min-width: 120px; }

/* Template picker grid */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.template-card {
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.template-card:hover { border-color: #ff9900; background: #fffdf7; }
.template-card.active { border-color: #ff9900; background: #fff8ee; }
.template-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
}
.thumb-page {
  position: relative;
  background: white;
  border: 1px solid #888;
  flex-shrink: 0;
  overflow: hidden;
}
.thumb-label {
  position: absolute;
  background: #e8f4fd;
  border: 0.5px solid #90c8f0;
}
.template-info { text-align: center; }
.template-name { font-size: 13px; font-weight: 700; color: #1d1d1f; }
.template-desc { font-size: 11px; color: #86868b; margin-top: 2px; }
.print-preview-scroll { overflow-x: auto; padding-bottom: 8px; }

/* === Upload Toast === */
.fab-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(0,0,0,0.82);
  color: white;
  padding: 10px 22px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 200;
}
.fab-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === Candidate Picker === */
.candidates-picker {
  border-top: 1px solid #e0e0e0;
  padding: 12px 16px;
  background: #fffdf7;
}
.candidates-header {
  font-size: 12px;
  font-weight: 600;
  color: #86868b;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 10px;
}
.candidate-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}
.candidate-row:last-of-type { border-bottom: none; }
.candidate-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 6px;
  background: #f5f5f5;
  flex-shrink: 0;
}
.candidate-img-placeholder {
  width: 52px; height: 52px;
  background: #f0f0f0;
  border-radius: 6px;
  flex-shrink: 0;
}
.candidate-info { flex: 1; min-width: 0; }
.candidate-name {
  font-size: 13px;
  font-weight: 500;
  color: #1d1d1f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.candidate-meta {
  font-size: 11px;
  color: #86868b;
  margin-top: 2px;
}
.candidates-none-wrap { margin-top: 10px; }
.candidates-none-input {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.candidates-notes-input {
  flex: 1;
  padding: 6px 10px;
  border: 1.5px solid #d0d0d0;
  border-radius: 8px;
  font-size: 13px;
}

/* === Full-screen Carousel Modal === */
.carousel-modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* On desktop: dark backdrop, phone-width content column */
@media (min-width: 600px) {
  .carousel-modal {
    background: rgba(0, 0, 0, 0.65);
    align-items: center;
    justify-content: center;
  }

  .carousel-header,
  .carousel-body,
  .carousel-dots {
    width: 100%;
    max-width: 430px;
  }

  .carousel-header {
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
  }

  .carousel-body {
    background: #f5f5f5;
    max-height: calc(100vh - 160px);
  }

  .carousel-dots {
    background: #f5f5f5;
    border-radius: 0 0 20px 20px;
  }
}

.carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: #232f3e;
  flex-shrink: 0;
}

.carousel-close {
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.carousel-close:hover { background: rgba(255,255,255,0.25); }

.carousel-counter {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 500;
}

.carousel-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}
.carousel-body.slide-right { animation: slideInRight 0.22s ease; }
.carousel-body.slide-left  { animation: slideInLeft  0.22s ease; }

.carousel-slide {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

/* QR Code — hero element */
.slide-qr {
  background: white;
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: zoom-in;
}
.slide-qr img {
  width: min(140px, calc(50vw - 32px));
  height: min(140px, calc(50vw - 32px));
  object-fit: contain;
  display: block;
}
.slide-qr-label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.slide-qr-placeholder {
  background: #ebebeb;
  border: 2px dashed #ccc;
  border-radius: 20px;
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #aaa;
  font-size: 14px;
}
.slide-qr-placeholder-icon { font-size: 48px; }

/* Product photos */
.slide-photo {
  border-radius: 16px;
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
}
.slide-photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

/* Side-by-side photos when both package photo and Amazon image are present */
.slide-photos-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.slide-photo-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.85);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 500;
}

/* Details card */
.slide-details {
  background: white;
  border: 1px solid #e8e8e8;
  border-radius: 16px;
  padding: 12px;
}
.slide-product-name {
  font-size: 15px;
  font-weight: 600;
  color: #111;
  margin-bottom: 8px;
  line-height: 1.4;
}
.slide-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.slide-detail-rows { display: flex; flex-direction: column; }
.slide-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid #f0f0f0;
}
.slide-detail-row:first-child { border-top: none; }
.slide-detail-key {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
  flex-shrink: 0;
}
.slide-detail-val {
  font-size: 13px;
  color: #222;
  text-align: right;
  word-break: break-word;
}

/* Error */
.slide-error {
  background: #fff5f5;
  border: 1px solid #ffc5c5;
  border-radius: 12px;
  padding: 12px 16px;
  color: #c62828;
  font-size: 13px;
  line-height: 1.5;
}

/* Actions */
.slide-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  flex-shrink: 0;
  min-height: 28px;
}
.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0,0,0,0.18);
  transition: all 0.2s;
  cursor: pointer;
}
.carousel-dot.active {
  background: #232f3e;
  width: 18px;
  border-radius: 3px;
}

/* QR Drop Zone — desktop only */
.slide-qr-drop-hint,
.slide-qr-replace-hint {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .slide-qr-drop-hint {
    display: block;
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
  }
  .slide-qr-replace-hint {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 6px;
  }
  .slide-qr-placeholder:hover {
    border-color: rgba(255,153,0,0.5);
    background: #e0e0e0;
  }
  .slide-qr.drag-over,
  .slide-qr-placeholder.drag-over {
    outline: 2px dashed #ff9900;
    outline-offset: 4px;
    background: rgba(255,153,0,0.06);
  }
}

/* Dropoff logos — Kohl's and UPS brand marks */
.logo-kohls {
  font-family: 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  color: #CC0000;
  letter-spacing: -0.02em;
}
.logo-ups {
  display: inline-block;
  background: #301506;
  color: #FFB500;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  font-size: 0.85em;
}

/* Logo in carousel QR section (white background) */
.slide-dropoff-logo {
  font-size: 22px;
}

/* Location logo tag in dashboard cards */
.tag-location-logo {
  background: #f5f5f5;
  border: 1px solid #ddd;
}

/* Notes for Claude — carousel */
.slide-notes-section {
  background: white;
  border: 1px solid #e8e8e8;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.slide-notes-label {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.slide-notes-input {
  background: #f8f8f8;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  color: #222;
  font-size: 14px;
  font-family: inherit;
  padding: 10px 12px;
  width: 100%;
}
.slide-notes-input:focus {
  outline: none;
  border-color: #ff9900;
}
.slide-notes-input::placeholder {
  color: #bbb;
}

/* Notes for Claude — full-width strip at bottom of card */
.card-notes-section {
  border-top: 1px solid #f0f0f0;
  padding: 10px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-notes-input {
  background: #f8f8f8;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  color: #222;
  font-size: 13px;
  font-family: inherit;
  padding: 8px 10px;
  width: 100%;
}
.card-notes-input:focus {
  outline: none;
  border-color: #ff9900;
}
.card-notes-input::placeholder { color: #bbb; }

/* Shared saved indicator */
.notes-saved-indicator {
  font-size: 11px;
  font-weight: 600;
  color: #2e7d32;
  opacity: 0;
  transition: opacity 0.2s;
}
.notes-saved-indicator.visible { opacity: 1; }

/* Image lightbox */
.img-lightbox {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(0,0,0,0.95);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.img-lightbox.active { display: flex; }
.img-lightbox img {
  width: min(90vw, 90vh);
  height: min(90vw, 90vh);
  object-fit: contain;
}

/* Candidate confirmation */
.candidate-confirmation {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.candidate-prompt {
  font-weight: 600;
  margin: 0 0 10px;
  font-size: 0.95rem;
}
.candidate-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.candidate-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.candidate-option:has(.candidate-radio:checked) {
  border-color: var(--primary);
  background: #fff8f0;
}
.candidate-radio {
  margin-top: 3px;
  flex-shrink: 0;
}
.candidate-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
  background: #f5f5f5;
}
.candidate-info {
  flex: 1;
  min-width: 0;
}
.candidate-title {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
}
.candidate-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.candidate-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}
.opened-toggle {
  display: flex;
  gap: 8px;
}
.opened-btn {
  flex: 1;
  background: transparent;
  border: 1.5px solid var(--border);
  color: #555;
}
.opened-btn:hover {
  border-color: #999;
}
.opened-btn.active {
  background: var(--primary);
  color: #111;
  border-color: var(--primary);
}

.msg-screenshot {
  display: block;
  max-width: 100%;
  border-radius: 6px;
  margin-top: 8px;
  cursor: zoom-in;
  border: 1px solid var(--border);
}

/* === Training Mode === */
.training-badge {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #ff9900;
  border-radius: 50%;
  position: absolute;
  top: 6px;
  right: 6px;
}
.nav-menu-btn { position: relative; }

.slide-training-section {
  background: #fff8ee;
  border: 1px solid #ffd280;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.training-messages {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.training-loading, .training-empty {
  font-size: 13px;
  color: #999;
  text-align: center;
  padding: 8px 0;
}

.training-msg {
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.4;
}
.training-msg-system {
  background: white;
  border: 1px solid #ffe0a0;
}
.training-msg-user {
  background: #232f3e;
  color: white;
  align-self: flex-end;
  max-width: 85%;
}
.training-msg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.training-msg-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  opacity: 0.7;
}
.training-msg-time {
  font-size: 11px;
  opacity: 0.5;
}
.training-msg-body img {
  max-width: 100%;
  border-radius: 6px;
  margin-top: 6px;
  cursor: zoom-in;
}

.training-reply-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.training-reply-input {
  flex: 1;
  margin: 0;
}
.training-send-btn {
  flex-shrink: 0;
  padding: 10px 14px;
  font-size: 14px;
}
