/* Fondo pastel y centrado para login y registro */
#authSection, #registerSection {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #4F35F9;
  padding: 1rem;
  padding-top: 50px;
}

/* Tarjeta contenedora */
.card-box {
  background: white;
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  margin: auto;
}

/* Títulos */
#authSection h2,
#registerSection h2 {
  text-align: center;
  color: #4F35F9;
  font-weight: 700;
  margin-bottom: 1.5rem;
  font-family: sans-serif;
}

/* Inputs */
input.form-control {
  font-size: 1rem;
}

input:focus,
select:focus,
textarea:focus,
.form-select:focus,
.form-control:focus {
  border-color: #4F35F9 !important;
  box-shadow: 0 0 0 0.2rem rgba(79, 53, 249, 0.25) !important;
}

/* Botones elegantes */
#authSection .btn,
#registerSection .btn {
  font-size: 1.1rem;
  padding: 0.6rem;
}

.btn-primary {
  background-color: #4F35F8;
  border-color: #f0f8ff;
}
.btn-primary:hover {
  background-color: #f0f8ff;
  border-color: #4F35F8;
  color: #4F35F8;
}

.btn-success {
  background-color: #4F35F8 ;
  border-color: #4F35F8;
}

.btn-success:hover {
  background-color: #f0f8ff ;
  color: #4F35F8;
  border-color: #4F35F8;
}
  
.btn-secondary {
  background-color: #ffc107;
  color: #000;
  border-color: #f0f8ff;
  margin-top: 15px;
}

.btn-outline-primary {
border-color: #4F35F8;
color: #4F35F8;
}

.btn-outline-primary:hover {
    background-color: #4F35F8;
    color: #f0f8ff;
}

.btn-outline-secondary {
border-color: #4F35F8;
color: #4F35F8;
}

.btn-outline-secondary:hover {
    background-color: #4F35F8;
    color: #f0f8ff;
}

/* Fondo pastel para el dashboard */
#appSection {
  background-color: #f0f8ff; /* Azul pastel claro */
  padding-top: 2rem;
  padding-bottom: 2rem;
  min-height: 100vh;
}

/* Tarjetas con bordes suaves y sombra */
#appSection .card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
  color: #4F35F8;
}

/* Botón cerrar sesión en rojo suave */
#appSection .btn-danger {
  background-color: #ff6b6b;
  border-color: #ff6b6b;
}
#appSection .btn-danger:hover {
  background-color: #f0f8ff;
  border-color: #ff4c4c;
  color: #ff4c4c;
}

/* Título principal */
#appSection h1 {
  font-weight: bold;
  color: #4F35F8;
}

/* Subtítulo comercio */
#comercioNombre {
  font-size: 0.95rem;
  color: #6c757d;
}

/* Tablas */
#appSection table {
  font-size: 0.95rem;
}
#appSection th {
  background-color: #4f35f9;
  color: #f0f8ff;
}

.logo-img {
  max-width: 150px;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.form-group {
  max-width: fit-content;
}

@media (max-width: 768px) {
  body {
    background-image: url('fondo-movil.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }

  .card-box {
    background-color: rgba(255, 255, 255, 0.95); /* hace que el formulario sea legible */
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  }
}

@media (max-width: 768px) {
  #authSection, #registerSection {
    background-image: url('fondo-movil.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body {
    background: none; /* evita doble fondo */
  }
}

.card-box {
  background-color: rgba(255, 255, 255, 0.92);
  padding: 2rem;
  border-radius: 12px;
  max-width: 400px;
  margin: auto;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.form-label {
  color: #4F35F9;
  font-weight: 500;
}

@keyframes flash-success {
  0%   { background-color: #a1f0b3; }
  50%  { background-color: #89d69b; }
  100% { background-color: #59db78; }
}

.flash-success {
  animation: flash-success 1.5s ease;
}

@media (max-width: 576px) {
  /* Asegura que columnas del formulario no se desborden */
  .row.g-2 > .col-md-4,
  .row.g-2 > .col-md-2,
  .row.g-2 > .form-group {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Ajuste de botones y campos del buscador */
  .input-group {
    flex-wrap: wrap;
  }

  .input-group .form-control {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .input-group .btn {
    width: 100%;
  }

  /* Evita desbordamiento horizontal en tablas */
  .table-responsive {
    overflow-x: auto;
  }

  .table thead,
  .table tbody,
  .table th,
  .table td,
  .table tr {
    white-space: nowrap;
  }
}

/* 🔥 Prioriza el modal de error por encima de cualquier otro */
#errorModal {
  z-index: 2000 !important;
}

#errorModal .modal-dialog {
  z-index: 2001 !important;
  position: relative;
}

/* Asegura que su backdrop no tape el modal de error */
.modal-backdrop.show {
  z-index: 1050 !important;
}

.btn-venko {
  background-color: #7f6afc; /* violeta pastel principal */
  color: white;
  border: none;
  transition: background-color 0.3s, transform 0.2s;
}

.btn-venko:hover {
  background-color: #624ec9; /* tono más oscuro al pasar el mouse */
  transform: translateY(-2px);
  color: white;
}

.btn-venko:active {
  background-color: #5039b5;
  transform: translateY(0);
}

.btn-info{
  color: #f0f8ff;
}

.btn-info:hover{
  background-color: #f0f8ff;
  transform: translateY(-2px);
  color: #0DCAF0;
}

.btn-warning{
  color: #f0f8ff;
}

.btn-warning:hover{
  background-color: #f0f8ff;
  transform: translateY(-2px);
  color: #ffc107;
}

.container {
  max-width: 1200px; /* o más, según necesites */
}

#botonAnterior, #botonSiguiente {
  min-width: 120px;
  border-radius: 1rem;
}

.stat-card {
  background: #4f35f9;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  font-size: 18px;
  text-align: center;
}

.stat-card h3 {
  color: white;
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.stat-card p {
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
}

#adminStats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.spinner {
  border: 6px solid #e0e0e0;
  border-top: 6px solid #3b82f6;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}