/* ════════════════════════════════════════════════════════
   TRASLADO.CSS — Traslados entre Unidades
   ════════════════════════════════════════════════════════ */

/* ── Page header ─────────────────────────────────────── */
.tras-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 12px;
  flex-wrap: wrap;
}
.tras-titulo {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 4px;
}
.tras-subtitulo {
  font-size: .85rem;
  color: #64748b;
  margin: 0;
}

/* ── Stat cards ──────────────────────────────────────── */
.tras-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  border: 1px solid #f1f5f9;
}
.stat-icon { font-size: 1.4rem; flex-shrink: 0; }
.stat-card > div { display: flex; flex-direction: column; gap: 1px; }
.stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1;
}
.stat-lbl {
  font-size: .72rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Filtros ─────────────────────────────────────────── */
.tras-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
}
.filtro-btn {
  padding: 6px 14px;
  border-radius: 99px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.filtro-btn:hover { border-color: #3b82f6; color: #3b82f6; }
.filtro-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

/* ── Solicitud cards (lista) ─────────────────────────── */
.tras-solicitud-card {
  background: #fff;
  border-radius: 12px;
  border: 1.5px solid #f1f5f9;
  padding: 16px 20px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.tras-solicitud-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 3px 12px rgba(59,130,246,.12);
  transform: translateY(-1px);
}
.tras-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.tras-card-info { flex: 1; min-width: 0; }
.tras-card-titulo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.tras-card-id {
  font-size: .72rem;
  font-weight: 700;
  color: #94a3b8;
  background: #f8fafc;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.tras-card-origen {
  font-size: .9rem;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tras-card-meta {
  font-size: .78rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tras-card-items {
  font-size: .75rem;
  color: #94a3b8;
}
.tras-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.tras-card-fecha {
  font-size: .72rem;
  color: #94a3b8;
  white-space: nowrap;
}

/* Estado chips */
.tras-estado {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
}
.tras-estado-0 { background: #f1f5f9; color: #64748b; }       /* Borrador */
.tras-estado-1 { background: #fef3c7; color: #b45309; }       /* Pendiente */
.tras-estado-2 { background: #d1fae5; color: #065f46; }       /* Autorizado */
.tras-estado-3 { background: #fee2e2; color: #991b1b; }       /* Rechazado */
.tras-estado-4 { background: #dbeafe; color: #1d4ed8; }       /* En SAP */

/* Acciones de tarjeta */
.tras-card-acciones {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.btn-saul {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  transition: all .15s;
}
.btn-sm  { padding: 5px 12px; font-size: .75rem; }
.btn-md  { padding: 8px 18px; font-size: .82rem; }
.btn-primary   { background: #3b82f6; color: #fff; }
.btn-primary:hover   { background: #2563eb; }
.btn-secondary { background: #f1f5f9; color: #475569; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-success   { background: #10b981; color: #fff; }
.btn-success:hover   { background: #059669; }
.btn-danger    { background: #ef4444; color: #fff; }
.btn-danger:hover    { background: #dc2626; }
.btn-warn      { background: #f59e0b; color: #fff; }
.btn-warn:hover      { background: #d97706; }

/* ── Lista vacía ─────────────────────────────────────── */
.tras-empty {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}
.tras-empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.tras-empty-titulo { font-size: 1rem; font-weight: 700; color: #64748b; margin-bottom: 6px; }
.tras-empty-sub { font-size: .85rem; }

/* ── Form views ──────────────────────────────────────── */
.tr-oculto { display: none !important; }

.tras-form-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.tras-form-titulo {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
  flex: 1;
}
.tras-form-acciones {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Card del formulario ─────────────────────────────── */
.tras-card {
  background: #fff;
  border-radius: 12px;
  border: 1.5px solid #f1f5f9;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.tras-card-titulo {
  font-size: .85rem;
  font-weight: 800;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tras-card-hint {
  font-size: .8rem;
  color: #94a3b8;
  margin: -8px 0 12px;
}

/* ── Almacen selector ────────────────────────────────── */
.almacen-wrap { position: relative; }
.almacen-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.almacen-input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: .85rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
  background: #fff;
}
.almacen-input:focus { border-color: #3b82f6; }
.almacen-clear {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all .15s;
}
.almacen-clear:hover { border-color: #ef4444; color: #ef4444; }

.almacen-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
}
.almacen-dropdown::-webkit-scrollbar { width: 4px; }
.almacen-dropdown::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.almacen-grupo-header {
  padding: 8px 14px 4px;
  font-size: .68rem;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  position: sticky;
  top: 0;
}
.almacen-option {
  padding: 10px 14px;
  cursor: pointer;
  transition: background .12s;
  border-bottom: 1px solid #f8fafc;
}
.almacen-option:last-child { border-bottom: none; }
.almacen-option:hover { background: #eff6ff; }
.almacen-option-nombre {
  font-size: .85rem;
  font-weight: 600;
  color: #1e293b;
}
.almacen-option-codigo {
  font-size: .72rem;
  color: #94a3b8;
  margin-top: 1px;
}

.almacen-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 8px;
  margin-top: 6px;
}
.almacen-badge-icon { font-size: 1.1rem; }
.almacen-badge-nombre {
  font-size: .88rem;
  font-weight: 700;
  color: #1d4ed8;
}
.almacen-badge-codigo {
  font-size: .75rem;
  color: #60a5fa;
  margin-top: 1px;
}

/* ── Buscador de productos ───────────────────────────── */
.busq-prod-wrap { position: relative; }
.busq-prod-input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: .85rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.busq-prod-input:focus { border-color: #3b82f6; }

.prod-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 100;
  max-height: 260px;
  overflow-y: auto;
}
.prod-dropdown::-webkit-scrollbar { width: 4px; }
.prod-dropdown::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.prod-option {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f8fafc;
  transition: background .12s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.prod-option:last-child { border-bottom: none; }
.prod-option:hover { background: #eff6ff; }
.prod-option-codigo {
  font-size: .72rem;
  font-weight: 700;
  color: #3b82f6;
  background: #eff6ff;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}
.prod-option-nombre {
  font-size: .83rem;
  color: #1e293b;
  font-weight: 500;
}
.prod-option-uom {
  font-size: .72rem;
  color: #94a3b8;
  margin-top: 1px;
}
.prod-no-results {
  padding: 16px 14px;
  text-align: center;
  color: #94a3b8;
  font-size: .82rem;
}

/* ── Contador de items ───────────────────────────────── */
.cont-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
}

/* ── Tabla items ─────────────────────────────────────── */
.tabla-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 8px;
}
.qty-input {
  width: 80px;
  padding: 5px 8px;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  font-size: .82rem;
  font-family: inherit;
  text-align: center;
  outline: none;
  transition: border-color .15s;
}
.qty-input:focus { border-color: #3b82f6; }
.btn-eliminar-item {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 6px;
  border-radius: 6px;
  color: #94a3b8;
  transition: all .15s;
}
.btn-eliminar-item:hover { background: #fee2e2; color: #ef4444; }

/* ── Textarea justificación ──────────────────────────── */
.tras-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: .85rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color .15s;
  color: #334155;
}
.tras-textarea:focus { border-color: #3b82f6; }

/* ── Modal detalle ───────────────────────────────────── */
.tr-modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.tr-modal-contenido {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  width: 100%;
  max-width: 620px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tr-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #f1f5f9;
}
.tr-modal-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #1e293b;
}
.tr-modal-close {
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: .85rem;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.tr-modal-close:hover { background: #fee2e2; color: #ef4444; }
.tr-modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}
.tr-modal-body::-webkit-scrollbar { width: 4px; }
.tr-modal-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* Modal detalle — secciones */
.modal-seccion { margin-bottom: 18px; }
.modal-seccion-titulo {
  font-size: .72rem;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}
.modal-kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 6px 10px;
  font-size: .83rem;
}
.modal-kv-key { color: #64748b; font-weight: 600; }
.modal-kv-val { color: #1e293b; }
.modal-tabla { width: 100%; border-collapse: collapse; font-size: .82rem; margin-top: 6px; }
.modal-tabla th {
  background: #f8fafc;
  padding: 7px 10px;
  text-align: left;
  font-size: .7rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  border-bottom: 2px solid #e2e8f0;
}
.modal-tabla td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}
.modal-tabla tbody tr:last-child td { border-bottom: none; }

/* Modal footer de acciones */
.modal-acciones {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 22px;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 640px) {
  .tras-form-top { flex-direction: column; align-items: flex-start; }
  .tras-form-acciones { width: 100%; }
  .tras-form-acciones .btn-saul { flex: 1; justify-content: center; }
  .tras-solicitud-card { flex-wrap: wrap; }
  .tras-card-right { align-items: flex-start; }
  .tras-stats { grid-template-columns: 1fr 1fr; }
}
