/* ==================================================
   PEDIDOS - CSS COMPLETO LIMPIO
   Vista: Centro de pedidos
================================================== */

/* =========================
   BASE / LAYOUT
========================= */
body {
  font-family: "Inter", sans-serif;
  background: #f4f7fb;
}

.content-wrapper {
  padding: 20px 25px !important;
}

.main-panel {
  padding-top: 10px;
}

.pedidos-page {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* =========================
   HEADER
========================= */
.pedidos-header-pro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.breadcrumb-custom {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.breadcrumb-custom span {
  color: #6d5dfc;
  font-weight: 800;
}

.titulo-modulo {
  margin: 0;
  font-size: 30px;
  font-weight: 850;
  color: #0f172a;
}

.subtitulo-modulo {
  margin-top: 6px;
  color: #64748b;
  font-size: 15px;
}

.header-actions-pedidos {
  display: flex;
  align-items: center;
  gap: 14px;
}

.fecha-panel,
.btn-refresh-pedidos {
  height: 48px;
  border: none;
  border-radius: 16px;
  padding: 0 18px;
  background: #fff;
  color: #0f172a;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.btn-refresh-pedidos {
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-refresh-pedidos:hover {
  transform: translateY(-2px);
}

/* =========================
   KPIS
========================= */
.stats-pedidos {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
}

.pedido-stat {
  background: #fff;
  border-radius: 22px;
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid #eef2f7;
  border-bottom: 4px solid #6366f1;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  transition: 0.22s ease;
}

.pedido-stat:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.09);
}

.pedido-stat h4 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #64748b;
  font-weight: 850;
}

.pedido-stat strong {
  display: block;
  font-size: 27px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}

.pedido-stat span {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
}

.stat-icon {
  width: 60px;
  height: 60px;
  min-width: 60px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 27px;
}

.stat-icon.pedidos {
  background: #eef2ff;
  color: #4f46e5;
}

.stat-icon.ventas {
  background: #dcfce7;
  color: #16a34a;
}

.stat-icon.pendientes {
  background: #fee2e2;
  color: #dc2626;
}

.stat-icon.delivery {
  background: #dbeafe;
  color: #2563eb;
}

.stat-icon.pickup {
  background: #fef3c7;
  color: #d97706;
}

/* =========================
   TOOLBAR / FILTROS
========================= */
.pedidos-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.buscador-pedidos-pro {
  flex: 1;
  min-width: 330px;
  height: 58px;
  background: #fff;
  border-radius: 18px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);
  border: 1px solid #eef2f7;
}

.buscador-pedidos-pro span {
  font-size: 19px;
}

.buscador-pedidos-pro input {
  border: none;
  outline: none;
  width: 100%;
  height: 100%;
  background: transparent;
  color: #0f172a;
  font-size: 15px;
}

.filtro-fecha-chips,
.filtros-chips {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filtro-fecha-chips button,
.filtros-chips select {
  height: 46px;
  border: 1px solid #eef2f7;
  border-radius: 15px;
  background: #fff;
  color: #475569;
  padding: 0 17px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  outline: none;
}

.filtro-fecha-chips button.active {
  background: linear-gradient(135deg, #ff7a18, #ff4d00);
  color: #fff;
  border-color: transparent;
}

#fechaInicio,
#fechaFin {
  display: none;
  height: 46px;
  border: 1px solid #eef2f7;
  border-radius: 15px;
  padding: 0 12px;
  background: #fff;
  opacity: 0;
  transform: scale(0.96);
  transition: 0.2s ease;
}

#fechaInicio:focus,
#fechaFin:focus {
  outline: none;
  border-color: #ff6a00;
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.14);
}

.filtro-activo {
  opacity: 1 !important;
  transform: scale(1) !important;
}

/* =========================
   BOARD / COLUMNAS
========================= */
.pedidos-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(280px, 1fr));
  gap: 22px;
  align-items: start;
}

.pedido-column {
  min-height: 620px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid #eef2f7;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.07);
}

.pedido-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
}

.column-title {
  display: flex;
  align-items: center;
  gap: 13px;
}

.column-title h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  color: #0f172a;
}

.column-title span {
  color: #64748b;
  font-size: 13px;
}

.column-icon {
  width: 50px;
  height: 50px;
  min-width: 50px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.column-icon.pendiente {
  background: #fff7ed;
  color: #ea580c;
}

.column-icon.preparando {
  background: #dbeafe;
  color: #2563eb;
}

.column-icon.camino {
  background: #ede9fe;
  color: #7c3aed;
}

.column-icon.entregado {
  background: #dcfce7;
  color: #16a34a;
}

.column-counter {
  text-align: right;
}

.column-counter strong {
  min-width: 42px;
  min-height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 950;
  line-height: 1;
  color: #111827;
}

.column-counter small {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.pedido-column-pendiente .column-counter strong {
  background: #facc15;
  color: #111827;
}

.pedido-column-preparando .column-counter strong {
  background: #dbeafe;
  color: #2563eb;
}

.pedido-column-camino .column-counter strong {
  background: #ede9fe;
  color: #7c3aed;
}

.pedido-column-entregado .column-counter strong {
  background: #dcfce7;
  color: #16a34a;
}

.column-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: #f8fafc;
  color: #64748b;
  font-size: 14px;
  border-bottom: 1px solid #eef2f7;
}

.column-summary strong {
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
}

.pedidos-col {
  flex: 1;
  min-height: 430px;
  max-height: none !important;
  overflow-y: visible !important;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

/* =========================
   CARD PEDIDO COLLAPSE
========================= */
.pedido-card-app {
  min-height: auto;
  background: #fff;
  border: 1px solid #eef2f7;
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
  position: relative;
  transition: 0.22s ease;
  cursor: grab;
  overflow: visible !important;
}

.pedido-card-app:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.1);
}

.pedido-card-app:active {
  cursor: grabbing;
}

.pedido-card-app::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 5px;
  border-radius: 0 999px 999px 0;
  background: #22c55e;
}

.pedido-reciente::before {
  background: #22c55e;
}

.pedido-medio::before {
  background: #eab308;
}

.pedido-urgente::before {
  background: #f97316;
}

.pedido-critico::before {
  background: #ef4444;
}

.pedido-urgente {
  animation: pulseOrange 1.6s infinite;
}

.pedido-critico {
  animation: pulseRed 1.2s infinite;
}

.pedido-mini {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.pedido-mini-left {
  flex: 1;
  min-width: 0;
}

.pedido-mini-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.pedido-titulo {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pedido-codigo,
.pedido-mini .pedido-codigo {
  margin-top: 4px;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
  word-break: break-word;
}

.pedido-fecha {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.pedido-total,
.pedido-mini .pedido-total {
  color: #7c3aed;
  font-size: 28px;
  font-weight: 950;
  line-height: 1;
  margin: 0;
}

.collapse-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-weight: 900;
  transition: transform 0.2s ease;
}

/* Cerrado por default */
.pedido-card-app.pedido-collapse .pedido-collapse-body {
  display: none !important;
}

.pedido-card-app.pedido-collapse.abierto .pedido-collapse-body {
  display: block !important;
}

.pedido-card-app.pedido-collapse.abierto .collapse-icon {
  transform: rotate(180deg);
}

.pedido-collapse-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #eef2f7;
}

/* =========================
   BADGES CARD / MODAL
========================= */
.pedido-envio,
.pedido-pago-metodo,
.pedido-status-pago,
.entrega-modal,
.estado-modal,
.pago-badge,
.metodo-badge {
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.pedido-envio,
.entrega-modal,
.estado-modal {
  min-width: 110px;
  padding: 8px 14px;
}

.pedido-envio.delivery,
.entrega-modal.delivery {
  background: #dbeafe;
  color: #2563eb;
}

.pedido-envio.pickup,
.entrega-modal.pickup {
  background: #fef3c7;
  color: #b45309;
}

.pedido-pago-metodo {
  background: #f1f5f9;
  color: #334155;
}

.pedido-pago-metodo.efectivo {
  background: #dcfce7;
  color: #166534;
}

.pedido-pago-metodo.transferencia {
  background: #dbeafe;
  color: #1e3a8a;
}

.pedido-pago-metodo.mercado,
.pedido-pago-metodo.mercado_pago {
  background: #e0f2fe;
  color: #0369a1;
}

.pedido-status-pago.pendiente,
.pago-badge.pendiente,
.pago-pendiente {
  background: #fee2e2;
  color: #dc2626;
}

.pedido-status-pago.pagado,
.pago-badge.pagado,
.alerta-pagado {
  background: #dcfce7;
  color: #16a34a;
}

.pedido-mini-badges {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #eef2f7;
}

.pedido-mini-badges .pedido-pago-metodo,
.pedido-mini-badges .pedido-status-pago {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.pedido-mini-badges .pedido-status-pago {
  min-width: 170px;
}

.pedido-info-row {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.pedido-info-row .pedido-pago-metodo,
.pedido-info-row .pedido-status-pago {
  width: 100%;
  height: 32px;
  padding: 0 12px;
}

.estado-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.estado-pendiente {
  background: #fff7ed;
  color: #ea580c;
}

.estado-preparando {
  background: #dbeafe;
  color: #2563eb;
}

.estado-listo {
  background: #fef3c7;
  color: #d97706;
}

.estado-camino {
  background: #ede9fe;
  color: #7c3aed;
}

.estado-entregado {
  background: #dcfce7;
  color: #16a34a;
}

.estado-cancelado {
  background: #e5e7eb;
  color: #374151;
}

.estado-default {
  background: #f1f5f9;
  color: #475569;
}

/* =========================
   BOTONES
========================= */
.pedido-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.btn-rastrear,
.btn-detalle,
.btn-accion,
.btn-asignar,
.btn-ticket-pro {
  border: none;
  border-radius: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-rastrear,
.btn-detalle,
.btn-accion {
  min-height: 46px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-rastrear {
  background: #f0fdfa;
  color: #0f766e;
}

.btn-detalle {
  background: #eef2ff;
  color: #4f46e5;
}

.btn-accion.preparar {
  background: #ffedd5;
  color: #ea580c;
}

.btn-accion.enviar {
  background: #ede9fe;
  color: #7c3aed;
}

.btn-accion.entregar {
  background: #dcfce7;
  color: #16a34a;
}

.btn-rastrear:hover,
.btn-detalle:hover,
.btn-accion:hover,
.btn-refresh-pedidos:hover {
  transform: translateY(-2px);
  filter: brightness(0.98);
}

.pedido-repartidor {
  background: #eef2ff;
  color: #4f46e5;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 900;
  width: fit-content;
  margin-bottom: 10px;
}

/* Elementos viejos ocultos */
.alerta-pago,
.alerta-pagado,
.pedido-meta,
.pedido-bottom,
.pedido-acciones-rapidas {
  display: none !important;
}

/* =========================
   EMPTY / DRAG / NOTIFICACIONES
========================= */
.sin-pedidos {
  min-height: 140px;
  border: 2px dashed #e5e7eb;
  border-radius: 20px;
  background: #f8fafc;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
}

.sin-pedidos i {
  font-size: 30px;
  opacity: 0.8;
}

.dragging,
.pedido-card-app.dragging {
  opacity: 0.55;
  transform: rotate(2deg) scale(1.02);
}

.pedidos-col.drag-over,
.drag-over {
  background: #eef2ff;
  outline: 2px dashed #6366f1;
  outline-offset: -6px;
  border-radius: 20px;
}

#notificacionesPedidos {
  position: fixed;
  top: 85px;
  right: 22px;
  z-index: 99999;
  width: 330px;
  pointer-events: none;
}

.alertaPedido {
  position: relative;
  background: #fff;
  border-radius: 22px;
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.22);
  pointer-events: auto;
  overflow: hidden;
  animation: slideIn 0.3s ease;
}

.alertaPedido::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, #ff7a18, #ff4d00);
}

.alertaPedido h5 {
  margin: 0 0 6px;
  font-weight: 900;
  color: #0f172a;
}

.alertaPedido small {
  color: #64748b;
  font-weight: 800;
}

.alertaPedido button {
  margin-top: 10px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
}

.fadeOut {
  animation: fadeOut 0.3s forwards;
}

/* =========================
   MODAL DETALLE PEDIDO
========================= */
.modal-ticket {
  max-width: 600px;
  margin: auto;
}

.modal-ticket .modal-content,
.modal-mapa-pro {
  border: none;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 25px 70px rgba(15, 23, 42, 0.24);
}

.modal-ticket .modal-header,
.mapa-header {
  background: #4f46e5;
  color: #fff;
  border: none;
  padding: 18px 24px;
}

.modal-ticket .modal-body {
  padding: 0;
}

.pedido-detalle-pro,
.pedido-detalle-app {
  padding: 24px;
}

.detalle-folio {
  text-align: center;
  margin-bottom: 18px;
}

.detalle-folio small {
  color: #64748b;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detalle-folio h3 {
  margin: 4px 0 0;
  font-size: 24px;
  font-weight: 950;
  color: #0f172a;
}

.detalle-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.detalle-info-card {
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 18px;
  padding: 14px;
}

.detalle-info-card span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
}

.detalle-info-card strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
}

.detalle-badges-pro {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.pago-badge,
.metodo-badge {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

.metodo-badge {
  background: #eef2ff;
  color: #4f46e5;
}

.detalle-section-title {
  font-weight: 950;
  color: #0f172a;
  margin: 16px 0 8px;
}

.productos-modal-list {
  border-top: 1px dashed #cbd5e1;
  border-bottom: 1px dashed #cbd5e1;
  margin-bottom: 16px;
}

.ticket-line {
  border-top: 1px dashed #cbd5e1;
  margin: 14px 0;
}

.producto-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
}

.producto-img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  overflow: hidden;
  background: #f1f5f9;
  flex-shrink: 0;
}

.producto-foto {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.producto-info {
  flex: 1;
}

.producto-nombre {
  font-size: 16px;
  font-weight: 900;
  color: #0f172a;
}

.producto-detalle {
  color: #64748b;
  font-size: 13px;
  margin-top: 3px;
}

.producto-total {
  font-size: 17px;
  font-weight: 950;
  color: #0f172a;
}

.totales-box {
  background: #f8fafc;
  border-radius: 18px;
  padding: 14px;
  border: 1px solid #eef2f7;
}

.modal-totales-pro {
  margin-top: 12px;
}

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

.total-row {
  padding: 7px 0;
  color: #64748b;
  font-size: 14px;
}

.total-row span:last-child {
  color: #0f172a;
  font-weight: 850;
}

.total-row.descuento {
  color: #16a34a;
}

.total-final {
  margin-top: 10px;
  padding: 14px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #111827, #334155);
  font-size: 18px;
  font-weight: 950;
}

.ticket-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: 16px;
  margin-top: 18px;
}

.ticket-status {
  margin-bottom: 10px;
  text-align: center;
  color: #16a34a;
  font-weight: 900;
}

.btn-ticket-pro {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 18px;
  font-size: 16px;
}

.ticket-solid {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
}

.ticket-outline {
  background: #eef2ff;
  color: #4f46e5;
}

/* =========================
   MODAL REPARTIDOR
========================= */
.modal-repartidor {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-repartidor h5 {
  margin: 0;
  font-weight: 950;
  color: #0f172a;
}

.lista-repartidores {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.repartidor-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 16px;
  border-radius: 18px;
  background: #f8fafc;
  border: 2px solid transparent;
  cursor: pointer;
  transition: 0.2s ease;
}

.repartidor-card:hover {
  background: #eef2ff;
  transform: translateY(-2px);
}

.repartidor-card.activo {
  border-color: #6366f1;
  background: #eef2ff;
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.18);
}

.repartidor-icon {
  font-size: 30px;
}

.repartidor-info .nombre {
  font-weight: 900;
  color: #0f172a;
}

.repartidor-info .estado {
  font-size: 12px;
  font-weight: 800;
}

.estado.ok {
  color: #16a34a;
}

.estado.busy {
  color: #dc2626;
}

.btn-asignar {
  min-height: 50px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
}

.btn-asignar:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

/* =========================
   MAPA
========================= */
.mapa-pro {
  width: 100%;
  height: 340px;
}

.info-pedido-mapa {
  background: #fff;
  padding: 18px;
}

.card-mapa {
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 20px;
  padding: 18px;
  font-size: 14px;
}

.card-mapa .titulo {
  font-weight: 950;
  color: #0f172a;
  margin-bottom: 8px;
}

.card-mapa .dato {
  margin-bottom: 8px;
  color: #475569;
}

.eta-box {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: #0f172a;
  color: #fff;
  padding: 9px 14px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
}

/* =========================
   ANIMACIONES
========================= */
.nuevo-pedido {
  animation: nuevoPedido 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.columna-alerta {
  animation: flashColumna 1s ease 3;
}

.badge-alerta {
  background: #dc2626 !important;
  color: #fff !important;
  animation: pulsoAlerta 1s infinite;
}

.badge-warning-soft {
  background: #facc15 !important;
  color: #111827 !important;
}

.badge-naranja {
  background: #f97316 !important;
  color: #fff !important;
}

@keyframes nuevoPedido {
  from {
    transform: scale(0.88);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes flashColumna {
  0% {
    box-shadow: 0 0 0 rgba(99, 102, 241, 0);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.22);
  }

  100% {
    box-shadow: 0 0 0 rgba(99, 102, 241, 0);
  }
}

@keyframes pulsoAlerta {
  50% {
    transform: scale(1.15);
  }
}

@keyframes pulseOrange {
  70% {
    box-shadow: 0 0 0 10px rgba(249, 115, 22, 0);
  }
}

@keyframes pulseRed {
  70% {
    box-shadow: 0 0 0 12px rgba(239, 68, 68, 0);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(110%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(110%);
  }
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1500px) {
  .stats-pedidos {
    grid-template-columns: repeat(3, 1fr);
  }

  .pedidos-board {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }
}

@media (max-width: 992px) {
  .pedidos-header-pro {
    flex-direction: column;
  }

  .header-actions-pedidos {
    width: 100%;
    justify-content: space-between;
  }

  .stats-pedidos {
    grid-template-columns: repeat(2, 1fr);
  }

  .pedidos-board {
    grid-template-columns: 1fr;
  }

  .pedidos-col {
    max-height: none;
  }
}

@media (max-width: 650px) {
  .content-wrapper {
    padding: 14px !important;
  }

  .stats-pedidos {
    grid-template-columns: 1fr;
  }

  .pedidos-toolbar,
  .filtro-fecha-chips,
  .filtros-chips {
    width: 100%;
  }

  .buscador-pedidos-pro {
    min-width: 100%;
  }

  .filtros-chips select,
  .filtro-fecha-chips button {
    flex: 1;
  }

  .pedido-mini {
    flex-direction: column;
  }

  .pedido-mini-right {
    align-items: flex-start;
    width: 100%;
  }

  .pedido-mini-badges,
  .pedido-info-row,
  .pedido-actions-grid,
  .detalle-info-grid,
  .lista-repartidores {
    grid-template-columns: 1fr;
  }

  .pedido-mini-badges .pedido-status-pago {
    min-width: 0;
  }

  #notificacionesPedidos {
    width: calc(100% - 30px);
    right: 15px;
  }

  .pedido-detalle-pro,
  .pedido-detalle-app {
    padding: 18px;
  }
}
/* =========================
   MODAL REPARTIDOR PRO
========================= */
#modalRepartidor .modal-dialog {
  max-width: 980px;
}

#modalRepartidor .modal-content {
  border: none;
  border-radius: 32px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 35px 90px rgba(15, 23, 42, 0.35);
}

#modalRepartidor .modal-header {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  border: none;
  padding: 22px 30px;
}

#modalRepartidor .modal-title,
#modalRepartidor .modal-header h5 {
  font-size: 24px;
  font-weight: 950;
}

#modalRepartidor .modal-repartidor-pro {
  padding: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.repartidor-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 8px 0 28px;
  border-bottom: 1px solid #eef2ff;
}

.hero-icon {
  width: 86px;
  height: 86px;
  min-width: 86px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eef2ff, #ede9fe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  box-shadow: 0 16px 35px rgba(99, 102, 241, 0.18);
}

.repartidor-hero h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 700;
  color: #0f172a;
}

.repartidor-hero p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
}

.section-repartidores-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 18px;
  color: #312e81;
  font-size: 22px;
  font-weight: 950;
}

.section-repartidores-title::after {
  content: "";
  height: 2px;
  flex: 1;
  background: linear-gradient(90deg, #c4b5fd, transparent);
}

#modalRepartidor .lista-repartidores-pro {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px;
  max-height: 420px;
  overflow-y: auto;
  padding: 2px 6px 6px 2px;
}

#modalRepartidor .repartidor-card-pro {
  position: relative;
  display: grid;
  grid-template-columns: 110px 1fr 34px;
  align-items: center;
  gap: 18px;
  min-height: 150px;
  padding: 22px;
  border-radius: 24px;
  background: #fff;
  border: 2px solid #eef2f7;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: 0.22s ease;
}

.repartidor-card-pro:hover {
  transform: translateY(-3px);
  border-color: #c4b5fd;
  box-shadow: 0 24px 48px rgba(99, 102, 241, 0.16);
}

.repartidor-card-pro.activo {
  border-color: #6366f1;
  background: linear-gradient(135deg, #ffffff, #eef2ff);
  box-shadow: 0 25px 55px rgba(99, 102, 241, 0.25);
}

.repartidor-card-pro.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.repartidor-avatar {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  font-size: 46px;
}

.avatar-0 {
  background: #dbeafe;
}

.avatar-1 {
  background: #dcfce7;
}

.avatar-2 {
  background: #ffedd5;
}

.online-dot {
  position: absolute;
  right: 7px;
  bottom: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #22c55e;
  border: 4px solid #fff;
}

.repartidor-data h4 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 21px;
  font-weight: 950;
}

.repartidor-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.repartidor-status.ok {
  background: #dcfce7;
  color: #16a34a;
}

.repartidor-status.busy {
  background: #fee2e2;
  color: #dc2626;
}

.repartidor-meta {
  margin-top: 12px;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
}

.repartidor-stats {
  display: flex;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #eef2f7;
  color: #475569;
  font-size: 14px;
  font-weight: 850;
}

.radio-repartidor {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid #cbd5e1;
}

.repartidor-card-pro.activo .radio-repartidor {
  border-color: #6366f1;
  background: radial-gradient(circle, #6366f1 45%, transparent 48%);
}

.repartidor-check {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #4f46e5;
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.repartidor-card-pro.activo .repartidor-check {
  display: flex;
}

.repartidor-footer-info {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background: #eef2ff;
  color: #312e81;
}

.repartidor-footer-info .info-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 14px;
  background: #ddd6fe;
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  font-size: 20px;
}

.repartidor-footer-info strong {
  display: block;
  font-size: 15px;
  font-weight: 950;
}

.repartidor-footer-info span {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
}

.repartidor-footer-actions {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 14px;
  margin-top: 24px;
}

.btn-cancelar-repartidor,
.btn-asignar-pro {
  height: 56px;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 950;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-cancelar-repartidor {
  background: #fff;
  color: #334155;
  border: 2px solid #e2e8f0;
}

.btn-asignar-pro {
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #7c3aed);
  box-shadow: 0 16px 35px rgba(99, 102, 241, 0.3);
}

.btn-asignar-pro:disabled {
  background: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-cancelar-repartidor:hover,
.btn-asignar-pro:not(:disabled):hover {
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  #modalPedido:has(.modal-repartidor-pro) .modal-dialog.modal-ticket {
    max-width: calc(100vw - 24px);
    margin: 12px auto;
  }

  .lista-repartidores-pro {
    grid-template-columns: 1fr;
  }

  .repartidor-card-pro {
    grid-template-columns: 82px 1fr 28px;
    padding: 18px;
  }

  .repartidor-avatar {
    width: 76px;
    height: 76px;
    font-size: 36px;
  }

  .repartidor-footer-actions {
    grid-template-columns: 1fr;
  }
}
