/* ========================================================
   MAYORISTA ZUIN - SISTEMA DE GESTION & TOMA DE PEDIDOS
   ESTILOS GENERALES Y RESPONSIVOS
   ======================================================== */

:root {
  --primary: #1e3a8a;
  --primary-hover: #172554;
  --secondary: #475569;
  --accent: #f59e0b;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #0284c7;
  --bg-body: #f1f5f9;
  --card-bg: #ffffff;
  --border-color: #cbd5e1;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-body);
  color: #1e293b;
  min-height: 100vh;
}

/* NAVBAR */
.navbar-zuin {
  background: linear-gradient(90deg, #0f172a 0%, #1e3a8a 100%);
  border-bottom: 2px solid #3b82f6;
}
.navbar-brand-zuin {
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
}
.navbar-logo {
  height: 38px;
  width: auto;
  border-radius: 6px;
  margin-right: 12px;
  background-color: #ffffff;
  padding: 2px;
}

/* TABS DE NAVEGACION */
.custom-tabs {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 2px solid #cbd5e1;
  gap: 6px;
  scrollbar-width: thin;
  padding-bottom: 2px;
}
.custom-tabs::-webkit-scrollbar {
  height: 4px;
}
.custom-tabs::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 4px;
}
.custom-tabs .nav-item {
  flex: 0 0 auto;
}
.custom-tabs .nav-link {
  font-weight: 700;
  font-size: 0.80rem;
  white-space: nowrap !important;
  color: #475569;
  background-color: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 6px 11px;
  transition: all 0.2s ease-in-out;
  display: flex;
  align-items: center;
}
.custom-tabs .nav-link:hover {
  background-color: #cbd5e1;
  color: #0f172a;
}
.custom-tabs .nav-link.active {
  background-color: #1e3a8a !important;
  color: #ffffff !important;
  border-color: #1e3a8a #1e3a8a transparent;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.08);
}
.custom-tabs .nav-link.tab-nuevo-pedido.active {
  background-color: #059669 !important;
  border-color: #059669 #059669 transparent;
}

/* CARDS & KPIS */
.kpi-card {
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
  background: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}
.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #ffffff !important;
}

.kpi-ventas { border-left: 5px solid #1d4ed8; }
.kpi-ventas .kpi-icon { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.kpi-ventas .kpi-value { color: #1d4ed8; }

.kpi-pedidos { border-left: 5px solid #15803d; }
.kpi-pedidos .kpi-icon { background: linear-gradient(135deg, #16a34a, #15803d); }
.kpi-pedidos .kpi-value { color: #15803d; }

.kpi-ticket { border-left: 5px solid #b45309; }
.kpi-ticket .kpi-icon { background: linear-gradient(135deg, #d97706, #b45309); }
.kpi-ticket .kpi-value { color: #b45309; }

.kpi-articulos { border-left: 5px solid #0e7490; }
.kpi-articulos .kpi-icon { background: linear-gradient(135deg, #0891b2, #0e7490); }
.kpi-articulos .kpi-value { color: #0e7490; }

.card-custom {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

/* FILTROS EN LINEA */
.filter-bar-container {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.filter-item-single { flex: 1 1 0; min-width: 130px; }
.filter-bar-container .form-label {
  font-size: 0.75rem;
  margin-bottom: 3px;
  white-space: nowrap;
  font-weight: 700;
  color: #475569;
}
.filter-bar-container .form-control,
.filter-bar-container .form-select {
  font-size: 0.8rem;
  padding: 5px 8px;
  border-color: #cbd5e1;
}

/* BOTONES RAPIDOS DE ESTADO */
.btn-quick-estado {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px !important;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #334155;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.btn-quick-estado:hover {
  background-color: #f1f5f9;
  transform: translateY(-1px);
}
.btn-quick-estado.active {
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}
.btn-quick-estado[data-estado="todos"].active { background-color: #1e293b !important; }
.btn-quick-estado[data-estado="pedido"].active { background-color: #d97706 !important; }
.btn-quick-estado[data-estado="preparacion"].active { background-color: #9333ea !important; }
.btn-quick-estado[data-estado="facturado"].active { background-color: #0891b2 !important; }
.btn-quick-estado[data-estado="camino"].active { background-color: #2563eb !important; }
.btn-quick-estado[data-estado="entregado"].active { background-color: #16a34a !important; }
.btn-quick-estado[data-estado="cancelado"].active { background-color: #dc2626 !important; }

.badge-contador-estado {
  background-color: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.12);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 2px;
}
.btn-quick-estado:not(.active) .badge-contador-estado {
  background-color: #e2e8f0;
  color: #334155;
  border: none;
}

/* BADGES DE ESTADO EN TABLA */
.estado-badge-custom {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
}
.estado-badge-pedido { background-color: #d97706; }
.estado-badge-preparacion { background-color: #9333ea; }
.estado-badge-camino { background-color: #2563eb; }
.estado-badge-entregado { background-color: #16a34a; }
.estado-badge-cancelado { background-color: #dc2626; }

/* BADGES DE RENTABILIDAD (EXACTO GOOGLE APPS SCRIPT) */
.badge-rentabilidad {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
  white-space: nowrap;
}
.badge-rentabilidad-alta {
  background-color: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #bbf7d0 !important;
}
.badge-rentabilidad-media {
  background-color: #fef9c3 !important;
  color: #854d0e !important;
  border: 1px solid #fef08a !important;
}
.badge-rentabilidad-baja {
  background-color: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fecaca !important;
}

.btn-historial-clock {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  transition: all 0.2s ease;
  line-height: 1;
  color: #475569;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  cursor: pointer;
}
.btn-historial-clock:hover {
  background-color: #1e3a8a;
  color: #ffffff;
  transform: scale(1.1);
}

.btn-table-action {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.78rem;
  transition: all 0.15s ease;
}
.btn-table-action:hover {
  transform: scale(1.08);
}

.estado-pill-container {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* TIMELINE DE HISTORIAL DE ESTADOS (EXACTO GAS) */
.timeline {
  position: relative;
  padding-left: 28px;
  list-style: none;
  margin: 0;
}
.timeline:before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 9px;
  width: 2px;
  background: #cbd5e1;
}
.timeline-item {
  position: relative;
  margin-bottom: 20px;
}
.timeline-item:last-child {
  margin-bottom: 0;
}
.timeline-badge {
  position: absolute;
  left: -28px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #cbd5e1;
}

/* TABLAS */
.table-custom-header th {
  background-color: #cbd5e1 !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  border-bottom: 2px solid #94a3b8 !important;
  padding: 10px 8px !important;
  font-size: 0.84rem;
}
.table tbody tr:hover {
  background-color: #f8fafc;
}

/* ========================================================
   ESTILOS EXCLUSIVOS DEL MODULO NUEVO: TOMA DE PEDIDOS
   ======================================================== */
.vendedor-panel-header {
  background: linear-gradient(135deg, #065f46 0%, #059669 100%);
  color: #ffffff;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

.client-info-badge {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 14px;
}

.product-order-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  padding: 12px;
  transition: all 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.product-order-card:hover {
  border-color: #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
}
.product-order-card .prod-code {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
}
.product-order-card .prod-desc {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1e293b;
  min-height: 42px;
  line-height: 1.3;
}
.product-order-card .prod-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: #047857;
}

/* STEPPER CONTROLS */
.stepper-control {
  display: flex;
  align-items: center;
  gap: 4px;
}
.stepper-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.stepper-btn:hover {
  background: #e2e8f0;
}
.stepper-input {
  width: 50px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px;
}

/* CATEGORY PILLS */
.category-pills-container {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
.category-pill {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}
.category-pill:hover,
.category-pill.active {
  background-color: #059669;
  color: #ffffff;
  border-color: #059669;
}

/* CART SIDEBAR / DRAWER */
.cart-summary-box {
  background-color: #ffffff;
  border: 2px solid #059669;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 75px;
}
.cart-item-row {
  border-bottom: 1px solid #f1f5f9;
  padding: 8px 0;
  font-size: 0.85rem;
}
.cart-total-badge {
  font-size: 1.4rem;
  font-weight: 800;
  color: #047857;
}

/* BARRA FLOTANTE INFERIOR EN MOVIL */
.mobile-floating-cart-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 18px;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.25);
  z-index: 1040;
}
@media (max-width: 991.98px) {
  .mobile-floating-cart-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

/* IMPRESIONES / COMPROBANTES */
@media print {
  body {
    background-color: #ffffff !important;
  }
  .navbar, .custom-tabs, .btn, .filter-bar-container, .mobile-floating-cart-bar {
    display: none !important;
  }
  .print-container {
    display: block !important;
    width: 100% !important;
  }
}

/* ========================================================
   ESTILOS APPSHEET: PedidoDetalleDA Form
   ======================================================== */
.appsheet-form-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  padding: 1.5rem;
}

.appsheet-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.appsheet-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-appsheet-cancel {
  border: 1px solid #7e22ce !important;
  color: #7e22ce !important;
  background: transparent !important;
  font-weight: 600;
  border-radius: 6px;
  padding: 6px 18px;
  font-size: 0.88rem;
  transition: all 0.2s ease;
}
.btn-appsheet-cancel:hover {
  background: #f3e8ff !important;
}

.btn-appsheet-save {
  background-color: #7e22ce !important;
  border-color: #7e22ce !important;
  color: #ffffff !important;
  font-weight: 600;
  border-radius: 6px;
  padding: 6px 20px;
  font-size: 0.88rem;
  box-shadow: 0 2px 6px rgba(126, 34, 206, 0.25);
  transition: all 0.2s ease;
}
.btn-appsheet-save:hover {
  background-color: #6b21a8 !important;
}

.appsheet-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* TOGGLE TIPO DE PRECIO */
.appsheet-toggle-group {
  display: flex;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  background-color: #ffffff;
}

.appsheet-toggle-btn {
  flex: 1;
  text-align: center;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  background-color: #ffffff;
  color: #475569;
  border: none;
  transition: all 0.2s ease;
}
.appsheet-toggle-btn:not(:last-child) {
  border-right: 1px solid #cbd5e1;
}
.appsheet-toggle-btn.active {
  background-color: #7e22ce !important;
  color: #ffffff !important;
  font-weight: 700;
}

/* STEPPERS DE APPSHEET (- y + a la derecha) */
.appsheet-input-stepper {
  display: flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.appsheet-input-stepper:focus-within {
  border-color: #7e22ce;
  box-shadow: 0 0 0 3px rgba(126, 34, 206, 0.15);
}

.appsheet-input-stepper input {
  border: none !important;
  outline: none !important;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  width: 100%;
}
.appsheet-input-stepper input:focus {
  box-shadow: none !important;
}

.appsheet-stepper-btn {
  background: transparent;
  border: none;
  padding: 8px 14px;
  font-size: 1.1rem;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.appsheet-stepper-btn:hover {
  background-color: #f3e8ff;
  color: #7e22ce;
}

/* CAJA DE LECTURA DE VALORES ($ IMPORTE Y SUBTOTAL) */
.appsheet-readonly-box {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.98rem;
  font-weight: 700;
  color: #1e293b;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* SLIDER MORADO APPSHEET */
.appsheet-slider-purple {
  accent-color: #7e22ce;
  cursor: pointer;
}

.btn-outline-purple {
  color: #7e22ce !important;
  border-color: #7e22ce !important;
  background-color: transparent !important;
  font-weight: 600;
  border-radius: 6px;
  padding: 6px 18px;
  transition: all 0.2s ease;
}
.btn-outline-purple:hover {
  background-color: #f3e8ff !important;
  color: #6b21a8 !important;
}

.text-purple {
  color: #7e22ce !important;
}

.bg-purple-subtle {
  background-color: #f3e8ff !important;
}

.border-purple-subtle {
  border-color: #d8b4fe !important;
}

.cursor-pointer {
  cursor: pointer;
}

/* ITEMS DENTRO DEL MENU DESPLEGABLE DE ARTICULOS */
.as-dropdown-item {
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.88rem;
  white-space: normal !important;
  word-break: break-word;
  transition: all 0.15s ease;
  border-bottom: 1px solid #f1f5f9;
}
.as-dropdown-item:hover {
  background-color: #f3e8ff !important;
  color: #7e22ce !important;
}
.as-dropdown-item:hover .text-dark {
  color: #7e22ce !important;
}
.as-dropdown-item.active {
  background-color: #f3e8ff !important;
  color: #7e22ce !important;
  font-weight: 600;
}

/* ========================================================
   CUENTAS CORRIENTES ESTILOS ESPECIFICOS
   ======================================================== */
.badge-cant-pedidos {
  background-color: #64748b;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}
.btn-ver-ctacte {
  background-color: #0d6efd;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.btn-ver-ctacte:hover {
  background-color: #0b5ed7;
  color: #ffffff;
  transform: translateY(-1px);
}
.btn-pagar-pedido {
  background-color: #ffffff;
  border: 1.5px solid #198754;
  color: #198754;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
}
.btn-pagar-pedido:hover {
  background-color: #198754;
  color: #ffffff;
}
.btn-pago-icon {
  padding: 2px 7px;
  font-size: 0.75rem;
  border-radius: 4px;
  line-height: 1.2;
  margin-left: 3px;
  border: 1px solid transparent;
}
.btn-pago-icon:hover {
  transform: scale(1.08);
}

/* FILTRO RAPIDO DE SALDO CC (RESUMEN) */
#btnGroupFiltroSaldoCC .btn {
  font-weight: 700;
  font-size: 0.82rem;
  padding: 5px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}
#btnGroupFiltroSaldoCC .btn-dark.active {
  background-color: #334155 !important;
  color: #ffffff !important;
  border-color: #334155 !important;
}
#btnGroupFiltroSaldoCC .btn-outline-danger {
  border-color: #dc2626 !important;
  color: #dc2626 !important;
  background-color: #ffffff;
}
#btnGroupFiltroSaldoCC .btn-outline-danger.active {
  background-color: #dc2626 !important;
  color: #ffffff !important;
}
#btnGroupFiltroSaldoCC .btn-outline-success {
  border-color: #16a34a !important;
  color: #16a34a !important;
  background-color: #ffffff;
}
#btnGroupFiltroSaldoCC .btn-outline-success.active {
  background-color: #16a34a !important;
  color: #ffffff !important;
}

/* ========================================================
   CALENDARIO DE VENCIMIENTOS DE CHEQUES (FONDOS & CHEQUES)
   ======================================================== */
.calendario-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  width: 100%;
}

.calendario-dia-header {
  text-align: center;
  font-weight: 700;
  font-size: 0.78rem;
  color: #64748b;
  text-transform: uppercase;
  padding: 6px 2px;
  background: #f1f5f9;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.calendario-celda-dia {
  min-height: 86px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.15s ease-in-out;
  position: relative;
  overflow: hidden;
}

.calendario-celda-dia:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.calendario-celda-dia.otro-mes {
  background: #f8fafc;
  opacity: 0.4;
}

.calendario-celda-dia.hoy {
  border: 2px solid #3b82f6 !important;
  background-color: #f0f7ff;
}

.calendario-celda-dia.dia-seleccionado {
  border: 2px solid #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25) !important;
}

.calendario-celda-dia.con-cheques {
  cursor: pointer;
  background-color: #fffdf5;
  border-color: #fde68a;
}

.calendario-celda-dia.con-cheques:hover {
  background-color: #fef9c3;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(217, 119, 6, 0.15);
}

.calendario-celda-dia.con-cheques.todos-cobrados {
  background-color: #f0fdf4;
  border-color: #bbf7d0;
}

.calendario-celda-dia.con-cheques.con-rechazos {
  background-color: #fef2f2;
  border-color: #fecaca;
}

.calendario-badge-total {
  font-size: 0.73rem;
  font-weight: 700;
  border-radius: 5px;
  padding: 3px 4px;
  text-align: center;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========================================================
   ESTILOS DE SEGURIDAD, LOGIN Y ROLES
   ======================================================== */
.login-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #090d16 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background-color: #ffffff;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.login-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  padding: 30px 24px;
  text-align: center;
  color: #ffffff;
  border-bottom: 3px solid #f59e0b;
}

.login-logo {
  max-height: 64px;
  border-radius: 8px;
  margin-bottom: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.login-body {
  padding: 28px 24px 20px 24px;
}

.bg-purple-subtle {
  background-color: #f3e8ff !important;
}
.text-purple {
  color: #7e22ce !important;
}
.border-purple {
  border-color: #d8b4fe !important;
}

/* ========================================================
   DISEÑO RESPONSIVO AVANZADO PARA PC, TABLET Y CELULAR
   ======================================================== */

/* Dispositivos táctiles: tamaños de toque confortables */
@media (hover: none) and (pointer: coarse) {
  .btn, .nav-link, .form-control, .form-select {
    min-height: 38px;
  }
}

/* Tablets y Celulares (< 992px) */
@media (max-width: 991.98px) {
  #paneTomaPedidos {
    padding-bottom: 75px; /* Espacio para barra flotante móvil de carrito */
  }
  
  .table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
  }
}

/* Celulares Medianos y Pequeños (< 768px) */
@media (max-width: 767.98px) {
  /* Evitar auto-zoom no deseado en Safari iOS al enfocar inputs */
  input[type="text"],
  input[type="password"],
  input[type="number"],
  input[type="email"],
  input[type="search"],
  select.form-select,
  textarea.form-control {
    font-size: 16px !important;
  }

  /* Barra de Navegación Móvil */
  .navbar-zuin {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }
  .navbar-brand-zuin {
    font-size: 0.95rem !important;
  }
  .navbar-logo {
    max-height: 32px !important;
  }

  /* Solapas con scroll horizontal táctil ultra-suave */
  .custom-tabs {
    gap: 4px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .custom-tabs::-webkit-scrollbar {
    display: none;
  }
  .custom-tabs .nav-link {
    font-size: 0.76rem !important;
    padding: 7px 10px !important;
    border-radius: 6px 6px 0 0 !important;
  }

  /* Tarjetas KPI compactas en celular */
  .kpi-card {
    padding: 0.5rem 0.65rem !important;
  }
  .kpi-card .kpi-value {
    font-size: 1.05rem !important;
  }
  .kpi-card .kpi-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.9rem !important;
  }

  /* Botones de acción en tablas */
  .btn-group-sm > .btn, .btn-sm {
    padding: 5px 8px;
    font-size: 0.78rem;
  }

  /* Modales optimizados para pantalla móvil */
  .modal-dialog {
    margin: 0.5rem;
  }
  .modal-content {
    border-radius: 12px;
  }

  /* Tarjeta de Login en Celular */
  .login-card {
    max-width: 100%;
    margin: 0 4px;
  }
  .login-header {
    padding: 22px 18px;
  }
  .login-body {
    padding: 20px 16px;
  }

  /* ========================================================
     MODULO PEDIDOS: AJUSTE TIPOGRÁFICO PARA PANTALLAS MÓVILES
     ======================================================== */
  #panePedidos {
    font-size: 0.8rem;
  }

  #btnCrearPedidoPedidosHeader {
    font-size: 0.88rem !important;
    padding: 8px 16px !important;
  }
  #btnCrearPedidoPedidosHeader i {
    font-size: 1rem !important;
  }

  #panePedidos .table {
    font-size: 0.77rem !important;
  }

  #panePedidos .table-custom-header th {
    font-size: 0.73rem !important;
    padding: 6px 5px !important;
    white-space: nowrap;
  }

  #panePedidos #pedidosTableBody td {
    padding: 6px 5px !important;
    font-size: 0.76rem !important;
    vertical-align: middle;
  }

  #panePedidos .estado-badge-custom {
    font-size: 0.69rem !important;
    padding: 2px 6px !important;
    gap: 3px;
  }

  #panePedidos .badge-rentabilidad {
    font-size: 0.69rem !important;
    padding: 2px 5px !important;
  }

  #panePedidos .btn-table-action {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.75rem !important;
  }

  #panePedidos .btn-historial-clock {
    font-size: 0.68rem !important;
    padding: 1px 4px !important;
  }

  #panePedidos .card h6 {
    font-size: 0.85rem !important;
  }

  #lblTotalPedidosMostrados,
  #lblTotalPedidosMostradosHeader {
    font-size: 0.72rem !important;
    padding: 3px 6px !important;
  }

  /* Modales de Pedidos en Celular */
  #modalCrearPedidoVendedor .modal-body,
  #modalDetallePedido .modal-body,
  #modalEditarPedidoAdmin .modal-body {
    padding: 10px !important;
    font-size: 0.82rem;
  }

  #modalCrearPedidoVendedor .appsheet-label,
  #modalDetallePedido label {
    font-size: 0.76rem !important;
  }

  #modalCrearPedidoVendedor .table,
  #modalDetallePedido .table {
    font-size: 0.74rem !important;
  }
}

/* Celulares Muy Pequeños (< 420px) */
@media (max-width: 419.98px) {
  .navbar-brand-zuin span {
    font-size: 0.85rem;
  }
  #badgeConexionServidor {
    font-size: 0.65rem !important;
    padding: 2px 4px !important;
  }
  .custom-tabs .nav-link {
    font-size: 0.72rem !important;
    padding: 6px 8px !important;
  }
}

/* ========================================================
   BOTÓN FLOTANTE ELEGANTE PARA INSTALAR APP (PWA)
   ======================================================== */
.btn-instalar-flotante-wrapper {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 100000;
  animation: slideInInstallBtn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInInstallBtn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.btn-instalar-flotante {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #ffffff;
  border: 1.5px solid rgba(245, 158, 11, 0.7);
  border-radius: 50px;
  padding: 8px 18px 8px 10px;
  box-shadow: 0 10px 25px -3px rgba(15, 23, 42, 0.5), 0 4px 12px rgba(245, 158, 11, 0.25);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn-instalar-flotante:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 28px -2px rgba(15, 23, 42, 0.6), 0 6px 18px rgba(245, 158, 11, 0.4);
  border-color: #f59e0b;
}

.btn-instalar-flotante:active {
  transform: translateY(0) scale(0.98);
}

.btn-instalar-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
  animation: pulseIconInstall 2.2s infinite ease-in-out;
}

@keyframes pulseIconInstall {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.btn-instalar-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
}

.btn-instalar-title {
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: -0.2px;
  color: #ffffff;
}

.btn-instalar-sub {
  font-size: 0.72rem;
  color: #fcd34d;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Ajustes Responsive para el Botón de Instalación */
@media (max-width: 575.98px) {
  .btn-instalar-flotante-wrapper {
    bottom: 16px;
    left: 14px;
  }
  .btn-instalar-flotante {
    padding: 6px 14px 6px 8px;
    gap: 9px;
  }
  .btn-instalar-icon-box {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }
  .btn-instalar-title {
    font-size: 0.82rem;
  }
  .btn-instalar-sub {
    font-size: 0.65rem;
  }
}

/* ========================================================
   REGLAS ESTRICTAS DE VISIBILIDAD PARA ROL VENDEDOR
   ======================================================== */
body.role-vendedor #pedidosHeaderHerramientasAdmin,
body.role-vendedor #pedidosFiltrosRapidosEstadosAdmin,
body.role-vendedor #pedidosFiltrosBarraAdmin,
body.role-vendedor #contenedorKpisGenerales,
body.role-vendedor #lblTotalPedidosMostrados,
body.role-vendedor #lblTotalPedidosMostradosHeader {
  display: none !important;
}

/* ========================================================
   ESTILOS PARA DETALLE DE PAGOS Y SELECTOR DE BANCOS
   ======================================================== */
.item-pago-prov {
  transition: all 0.15s ease-in-out;
}
.item-pago-prov:hover {
  background-color: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  transform: translateY(-1px);
}
#dropdownListaBancosCC .dropdown-item:hover {
  background-color: #e2e8f0;
}
#dropdownListaBancosCC .dropdown-item.active {
  background-color: #0d6efd !important;
  color: #fff !important;
}


