/* ============ Vue scan (workflow type app Electron) ============ */

/* Stepper 1 Tablette · 2 Produit · 3 Bac · 4 Quantité */
.swf-steps {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.swf-step {
  flex: 1;
  min-width: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 0.4rem;
  border-radius: 10px;
  background: var(--gray-100, #f3f4f6);
  color: var(--gray-500, #6b7280);
  font-size: 0.85rem;
  font-weight: 600;
  border: 2px solid transparent;
}
.swf-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--gray-300, #d1d5db);
  color: #fff;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.swf-step.step-active {
  background: var(--primary-light, #dbeafe);
  color: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
}
.swf-step.step-active .swf-step-num { background: var(--primary, #2563eb); }
.swf-step.step-done {
  background: #ecfdf5;
  color: #059669;
}
.swf-step.step-done .swf-step-num { background: #10b981; }

.swf-main-card { max-width: 640px; }

/* Emplacement */
.swf-location-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.swf-location-badge { font-size: 1rem; padding: 0.4rem 0.7rem; }

/* Bouton caméra principal (mobile d'abord) */
.swf-cam-main {
  display: block;
  width: 100%;
  padding: 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  border-radius: 12px;
}
.swf-manual-label {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--gray-500, #6b7280);
}

/* Champ scan + caméra */
.swf-scan-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.swf-scan-input-row input {
  flex: 1;
  min-width: 0;
  font-size: 16px; /* évite le zoom auto iOS au focus */
}
.swf-go-btn { flex-shrink: 0; min-width: 3.4rem; }
.swf-cam-btn {
  flex-shrink: 0;
  min-width: 3.2rem;
  font-size: 1.2rem;
}

/* Produit scanné */
.swf-product-block {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-200, #e5e7eb);
}
.swf-product-hit {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.swf-product-photo {
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--gray-100, #f3f4f6);
  display: flex;
  align-items: center;
  justify-content: center;
}
.swf-product-photo img { width: 100%; height: 100%; object-fit: contain; }
.swf-photo-ph {
  font-size: 0.7rem;
  color: var(--gray-400, #9ca3af);
  text-align: center;
  padding: 0.25rem;
}
.swf-product-text { min-width: 0; }
.swf-product-name { font-weight: 700; line-height: 1.25; }
.swf-product-pk { color: var(--primary, #2563eb); font-weight: 600; font-size: 0.9rem; }

.swf-line-banner {
  margin-top: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.9rem;
}
.swf-warn-banner {
  margin-top: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.9rem;
}
.swf-warn-text { color: #92400e; font-size: 0.85rem; margin-top: 0.4rem; }
.swf-product-miss {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.9rem;
}

/* Étape 3 : type de bac */
.swf-panel-title { margin: 0 0 0.25rem; font-size: 1.05rem; }
.swf-bac-panel {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--gray-200, #e5e7eb);
}
.swf-bac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.swf-bac-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  border: 2px solid var(--gray-200, #e5e7eb);
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  text-align: left;
  line-height: 1.2;
}
.swf-bac-btn .swf-bac-code {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gray-400, #9ca3af);
}
.swf-bac-btn.selected {
  border-color: var(--primary, #2563eb);
  background: var(--primary-light, #dbeafe);
}
.swf-bac-btn.selected .swf-bac-code { color: var(--primary, #2563eb); }
.swf-bac-none {
  border-style: dashed;
  color: var(--gray-500, #6b7280);
}
.swf-bac-none.selected {
  border-style: solid;
  border-color: #dc2626;
  background: #fef2f2;
  color: #991b1b;
}
.swf-bac-none.selected .swf-bac-code { color: #dc2626; }
.swf-actions-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.swf-bac-summary {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

/* Étape 4 : quantité */
.swf-qty-panel {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--gray-200, #e5e7eb);
}
.swf-qty-book { margin-bottom: 0.5rem; }
.swf-qty-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.swf-qty-input {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
}
.swf-qty-step {
  flex-shrink: 0;
  min-width: 3.2rem;
  font-size: 1.3rem;
  font-weight: 700;
}

/* Historique session */
.swf-history { max-height: 320px; overflow-y: auto; }
.swf-history-row {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
  font-size: 0.9rem;
}
.swf-history-row:last-child { border-bottom: none; }
.swf-history-loc {
  font-weight: 700;
  color: var(--primary, #2563eb);
  flex-shrink: 0;
}
.swf-history-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gray-600, #4b5563);
}
.swf-history-qty { flex-shrink: 0; }

/* Mobile : gros points de contact, caméra en premier */
@media (max-width: 600px) {
  .swf-step { font-size: 0.72rem; min-width: 0; padding: 0.4rem 0.2rem; flex-direction: column; gap: 0.2rem; }
  .swf-main-card .card-body { padding: 0.85rem; }

  .swf-cam-main { padding: 1.15rem; font-size: 1.25rem; }

  .swf-bac-grid { grid-template-columns: repeat(2, 1fr); }
  .swf-bac-btn { padding: 0.8rem 0.65rem; font-size: 0.95rem; min-height: 3.4rem; }

  .swf-actions-row { flex-direction: column; }
  .swf-actions-row .btn { width: 100%; padding: 0.85rem; font-size: 1.05rem; }

  .swf-qty-input { font-size: 1.7rem; padding: 0.6rem; }
  .swf-qty-step { min-width: 4rem; font-size: 1.6rem; }

  .swf-product-photo { width: 72px; height: 72px; }

  .swf-location-badge { font-size: 1.1rem; }
}
