/* ========================================
   EFZ-Preventa - estilos.css
   Archivo CSS unificado para toda la aplicación
   ======================================== */

/* ===== ESTILOS GENERALES ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ✅ Accesibilidad: respeta el tamaño de fuente del usuario */
html {
  font-size: 100%; /* Clave: usa el tamaño del sistema (pequeño, mediano, grande, etc.) */
  -webkit-text-size-adjust: 100%;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: #f8f9fa; /* Ghost White - claro con tono azulado */
  color: #333; /* Gris oscuro, excelente contraste */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 12px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.logo {
  display: block;
  margin: 0 auto;          /* Centrado horizontal */
  width: 45%;             /* Ocupa el 45% del contenedor padre */
  max-width: 150px;        /* Límite máximo de ancho */
  height: auto;            /* Altura automática (proporcional) */
  border-radius: 8px;
  /* Se elimina max-height para evitar deformación */
}

/* Encabezado de página */
.page-header {
  text-align: center;
  padding: 16px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.page-header h1 {
  font-size: 1.5rem; /* Escala con el sistema */
  color: #4a148c; /* Morado profundo de marca */
  margin: 0;
}

.page-header p {
  color: #666;
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Botones responsivos */
.btn {
  display: block;
  width: 100%;
  padding: 14px;
  margin: 10px 0;
  background: #4a148c;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem; /* ✅ rem: escala con el sistema */
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.btn:hover {
  background: #381466;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* Listas responsivas */
.list {
  list-style: none;
  margin: 15px 0;
}

.list-item {
  background: white;
  padding: 14px;
  border-radius: 10px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
  border: 1px solid #eee;
  margin-bottom: 10px;
}

.list-item header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.list-item .title {
  font-weight: 600;
  color: #1976d2;
  font-size: 1.1rem;
}

.list-item .subtitle {
  font-size: 0.9rem;
  color: #666;
}

.list-item .actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.list-item .actions button {
  padding: 6px 10px;
  font-size: 0.85rem;
  min-width: 60px;
}

/* Inputs responsivos */
.input-group {
  margin: 12px 0;
}

.input-group label {
  display: block;
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 6px;
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  padding: 11px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem; /* ✅ rem: accesible */
  background: white;
  transition: border 0.2s;
  color: #333;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  outline: none;
  border-color: #4a148c;
  box-shadow: 0 0 0 2px rgba(74, 20, 140, 0.2);
}

.input-group input::placeholder,
.input-group select::placeholder,
.input-group textarea::placeholder {
  color: #aaa;
  font-style: italic;
  font-size: 0.9rem;
}

.input-group textarea {
  min-height: 80px;
  resize: vertical;
}

/* Alertas */
.alert {
  padding: 14px;
  background: #e3f2fd;
  border-left: 4px solid #1976d2;
  border-radius: 8px;
  margin: 15px 0;
  font-size: 0.95rem;
}

/* footer */
.footer {
  text-align: center;
  padding: 15px;
  font-size: 0.8rem;
  color: #666;
  background: #f3e5f5;
  border-top: 1px solid #e1bee7;
  margin-top: auto;
  width: 100%;
  box-sizing: border-box;
}

/* ===== TEMA OSCURO ===== */
body.dark,
body.dark .container {
  background: #121212;
  color: #e0e0e0;
}

body.dark .page-header {
  border-bottom-color: #333;
}

body.dark .btn {
  background: #bb86fc;
}

body.dark .btn:hover {
  background: #9b68d9;
}

body.dark .list-item {
  background: #1e1e1e;
  border-color: #333;
}

body.dark .input-group input,
body.dark .input-group select,
body.dark .input-group textarea {
  background: #2d2d2d;
  color: #e0e0e0;
  border-color: #555;
}

body.dark .footer {
  background: #1e1e1e;
  color: #aaa;
}

body.dark .alert {
  background: #334155;
  color: #e0e0e0;
}

/* ===== ESTILOS HOME ===== */
/* Diseño del panel principal (index.html) */
.header {
  background: #4a148c;
  color: white;
  text-align: center;
  padding: 20px 15px;
  border-bottom: 4px solid #381466;
}

.logo-wrapper {
  margin-bottom: 10px;
}

.app-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.app-subtitle {
  font-size: 0.9rem;
  opacity: 0.9;
  margin: 0;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 15px;
}

.action-card {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 12px;
  padding: 16px;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  color: #333;
  border: 1px solid #eee;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.action-card .icon {
  font-size: 1.8rem;
  margin-right: 15px;
  min-width: 50px;
  text-align: center;
}

.action-card .text {
  flex: 1;
}

.action-card .text strong {
  font-size: 1rem;
  display: block;
}

.action-card .text small {
  color: #666;
  font-size: 0.85rem;
}

/* Colores por tarjeta */
.action-card.clientes { border-top: 4px solid #1976d2; }
.action-card.productos { border-top: 4px solid #2e7d32; }
.action-card.ruta { border-top: 4px solid #c62828; }
.action-card.reportes { border-top: 4px solid #5d4037; }
.action-card.facturas { border-top: 4px solid #f57c00; }
.action-card.config { border-top: 4px solid #546e7a; }

/* Sección de métricas */
.stats-section {
  padding: 15px;
  background: #f3e5f5;
  border-top: 1px solid #e1bee7;
}

.section-title {
  font-size: 1.1rem;
  color: #4a148c;
  margin-bottom: 12px;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.stat-item {
  background: white;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
  font-size: 0.95rem;
}

.stat-item.alert {
  background: #ffebee;
  border-left: 4px solid #c62828;
}

.stat-item.clickable {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-item.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.click-hint {
  display: block;
  color: #999;
  font-size: 0.75rem;
  margin-top: 4px;
  font-style: italic;
}

.stat-number {
  font-size: 1.4rem;
  font-weight: bold;
  color: #4a148c;
  display: block;
}

.stat-label {
  font-size: 0.85rem;
  color: #666;
  display: block;
}

/* Clientes del día */
.today-clients {
  padding: 15px;
  flex: 1;
}

#lista-visitas {
  list-style: none;
  margin-top: 10px;
}

#lista-visitas li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.client-info strong {
  color: #1976d2;
}

.client-info small {
  color: #666;
  font-size: 0.85rem;
}

.whatsapp-btn {
  color: #25d366;
  font-size: 1.4rem;
  text-decoration: none;
}

.whatsapp-btn:hover {
  transform: scale(1.2);
}

.empty-state {
  text-align: center;
  color: #999;
  font-style: italic;
  padding: 20px;
}

/* Productos con bajo stock */
.low-stock-section {
  padding: 15px;
  background: #fff3e0;
  border-top: 1px solid #ffcc02;
}

.low-stock-section .section-title {
  color: #e65100;
}

#lista-bajo-stock {
  margin-top: 10px;
}

.low-stock-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: white;
  border: 1px solid #ffcc02;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 0.95rem;
  padding: 15px;
  margin-bottom: 12px;
  background: white;
  border-radius: 8px;
  border-left: 4px solid #ffc107;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}

.low-stock-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.low-stock-item.agotado {
  border-left-color: #dc3545;
  background: #fff5f5;
}

.low-stock-item.bajo-stock {
  border-left-color: #ffc107;
  background: #fffbf0;
}

.product-details {
  width: 100%;
}

.product-name {
  margin-bottom: 8px;
}

.low-stock-item .product-info {
  flex: 1;
}

.low-stock-item .product-info strong {
  color: #e65100;
  display: block;
}

.low-stock-item .product-info small {
  color: #666;
  font-size: 0.85rem;
}

.low-stock-item .stock-info {
  text-align: right;
  min-width: 100px;
}

.low-stock-item .stock-info.warning {
  color: #f57c00;
}

.low-stock-item .stock-info.critical {
  color: #c62828;
  font-weight: bold;
}

.low-stock-item .stock-current {
  display: block;
  font-weight: 600;
}

.low-stock-item .stock-info small {
  color: #666;
  font-size: 0.8rem;
}

/* ===== ESTILOS RUTA ===== */
.filtro-ruta {
  margin: 15px 0;
}

.filtro-ruta label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.menu-opciones {
  display: grid;
  gap: 10px;
}

.btn-menu {
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
}

.btn-menu.facturar { background: #4a148c; color: white; }
.btn-menu.historial { background: #1976d2; color: white; }
.btn-menu.llamar { background: #00796b; color: white; }
.btn-menu.whatsapp { background: #25d366; color: white; }
.btn-menu.nota { background: #f57c00; color: white; }
.btn-menu.cancelar { background: #757575; color: white; }
.btn-menu.no-compra { background: #ff6b6b; color: white; }

.btn-menu:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.btn-menu.no-compra:hover {
  background: #ff5252;
}

.flecha {
  color: #aaa;
  font-size: 1.2rem;
  align-self: center;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

/* Estilos específicos para el modal de historial */
.historial-modal {
  max-width: 600px;
  width: 95%;
}

.historial-header {
  text-align: center;
  margin-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 15px;
}

.historial-header h2 {
  margin: 0 0 10px 0;
  color: #1976d2;
}

.historial-header h3 {
  margin: 0 0 15px 0;
  color: #333;
  font-weight: 500;
}

.resumen-compras {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.no-compra-modal {
  max-width: 500px;
  width: 90%;
}

.motivos-lista {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

.btn-motivo {
  padding: 15px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.3s ease;
  font-size: 14px;
}

.btn-motivo:hover {
  background: #f0f0f0;
  border-color: #007bff;
}

.no-compra-header h3 {
  color: #666;
}

/* ===== ESTILOS FACTURAR ===== */

/* --- NUEVA CUADRÍCULA DE ÍTEM DE FACTURA --- */

.factura-item-grid {
  display: flex; /* Activa flexbox (columnas) */
  flex-wrap: wrap; /* En pantallas pequeñas, se apilarán */
  align-items: flex-end; /* Alinea todo en la base */
  gap: 10px; /* Espacio entre columnas */
  width: 100%;
  margin-top: 10px; /* Espacio arriba del ítem */
  padding-bottom: 15px; /* Espacio de abajo (reemplaza el border-bottom) */
  border-bottom: 1px solid #eee; /* Línea separadora */
}

.factura-item-col {
  display: flex;
  flex-direction: column; /* Label arriba, valor abajo */
}

.factura-item-col label {
  font-size: 0.8em;
  color: #666;
  margin-bottom: 4px;
  font-weight: 500;
}

/* --- COLUMNAS (Anchos y Alineación) --- */

/* Col 1: Cantidad */
.factura-item-col:nth-child(1) {
  flex: 2; /* 2 partes de espacio */
  min-width: 80px; /* Ancho mínimo */
}
.factura-item-col:nth-child(1) .cantidad {
  width: 100%; /* Rellena la columna */
}

/* Col 2 & 3: Sin Impuestos y Total */
.factura-item-col:nth-child(2),
.factura-item-col:nth-child(3) {
  flex: 3; /* 3 partes de espacio */
  min-width: 100px; /* Ancho mínimo */
}

/* Col 4: Botón */
.factura-item-col-btn {
  flex: 1; /* 1 parte de espacio */
  min-width: 40px;
  text-align: right; /* Alinea el botón a la derecha de su columna */
}


/* --- ALINEACIÓN DE TEXTO --- */
/* Centra la columna de Cantidad */
.factura-item-col.align-center {
  text-align: center;
}
.factura-item-col.align-center .cantidad {
  text-align: center; /* Centra el texto del input */
}

/* Alinea a la derecha las columnas de dinero */
.factura-item-col.align-right {
  text-align: right;
}


/* --- ESTILOS DE VALORES --- */

/* Input de cantidad (tomado de tu CSS) */
.factura-item-grid .cantidad {
  height: 40px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  padding: 8px;
  box-sizing: border-box; /* Importante para width: 100% */
}

/* Span "Sin Impuestos" */
.factura-item-grid .precio-display {
  font-size: 1em;
  color: #555;
  font-weight: 500;
}

/* Span "Total" (azul) */
.factura-item-grid .subtotal {
  font-weight: bold;
  font-size: 1.1rem;
  color: #1976d2; /* Mantenemos el azul */
}


.cliente-detalle {
  background: #f3f3f3;
  padding: 15px;
  border-radius: 10px;
  margin: 15px 0;
  font-size: 0.95rem;
  color: #555;
}

/* Estilos mejorados para la búsqueda de productos */
.busqueda-producto-container {
  position: relative;
  margin-bottom: 20px;
}

#resultadosBusqueda {
  position: absolute;
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  background: white;
  border: 1px solid #ddd;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.resultado-item {
  padding: 12px 15px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee; /* Línea separadora entre opciones */
  transition: background-color 0.2s;
}

.resultado-item:last-child {
  border-bottom: none;
}

.resultado-item:hover {
  background-color: #f5f5f5;
}

.resultado-item .nombre {
  font-weight: 500;
}

.resultado-item .precio {
  color: #1976d2;
  font-weight: 600;
}

/* Mejoras para los elementos de producto */
/*.producto-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  padding: 15px;
  border-bottom: 1px solid #eee;
  gap: 15px;
  align-items: center;
}*/

.producto-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-weight: 500;
}

.stock-info {
  margin-top: 5px;
  font-size: 0.85em;
  display: flex;
  gap: 10px;
  align-items: center;
}

.stock-disponible {
  color: #666;
  font-weight: normal;
}

.stock-warning {
  color: #ff6b35;
  font-weight: bold;
  font-size: 0.8em;
}

.iva-tag {
  background: #e3f2fd;
  color: #1976d2;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75em;
  margin-left: 8px;
}

/*.producto-controles {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}*/

.producto-controles .cantidad {
  width: 70px; /* Aumentado de 60px */
  height: 40px; /* Altura explícita para mejor usabilidad */
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  padding: 8px;
}

/*.precio-display {
  font-size: 0.9em;
  color: #555;
  min-width: 80px;
}

.producto-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.subtotal {
  font-weight: bold;
  font-size: 1.1rem;
  color: #1976d2;
}*/

.btn-small {
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.btn-danger {
  background-color: #f44336;
  color: white;
}

.btn-danger:hover {
  background-color: #d32f2f;
}

.btn-danger svg {
  vertical-align: middle;
}

.totales-container {
  margin-top: 20px;
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #eee;
}

.total-line {
  display: flex;
  justify-content: space-between;
  font-size: 1.1em;
}

/* ===== ESTILOS FACTURAS ===== */
/* Contenedor de filtros */
.filters-container {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  margin: 20px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  min-width: 150px;
}

.filter-group label {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 5px;
  font-weight: 500;
}

.form-control {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  background: white;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: #4a148c;
  box-shadow: 0 0 0 2px rgba(74, 20, 140, 0.2);
}

/* Botón aplicar filtros - mismo estilo que reportes.html */
.apply-filters {
  margin-top: 10px;
  text-align: center;
}

#aplicar-filtros {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
  font-size: 0.95rem;
  font-weight: 500;
}

#aplicar-filtros:hover {
  background-color: #0056b3;
}

.btn-primary {
  background-color: #007bff !important;
}

.btn-primary:hover {
  background-color: #0056b3 !important;
}

/* Tarjetas de resumen */
.summary-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.summary-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  text-align: center;
  border-top: 4px solid #4a148c;
  transition: transform 0.3s ease;
}

.summary-card:hover {
  transform: translateY(-3px);
}

.summary-card h3 {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 10px;
  font-weight: 600;
}

/* ===== ESTILOS CLIENTES ===== */
.clientes-container .list-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Contenedor principal de cada cliente en la lista */
.cliente-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  font-size: 1rem;
}

.cliente-info small {
  color: #555;
  margin: 2px 0;
}

/* Contactos: Llamada y WhatsApp */
.cliente-contactos {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.btn-contacto {
  display: inline-block;
  padding: 4px 8px;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 6px;
  text-align: center;
  min-width: 65px;
}

.btn-contacto.llamada {
  background: #1565c0;
  color: white;
}

.btn-contacto.whatsapp {
  background: #25d366;
  color: white;
}

.btn-contacto:hover {
  filter: brightness(1.1);
}

/* Botones de acción y estado en una sola línea */
.acciones {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 180px;
  font-size: 1rem;
  margin-top: 8px; /* ← Igual al margin-top de .cliente-contactos */
}

.acciones button,
.acciones .status {
  padding: 4px 6px;
  margin: 0;
}

.acciones button {
  font-size: 1rem;
  min-width: 60px;
}

/* Estado del cliente */
.status {
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 4px;
  background: #e8f5e8;
  color: #2e7d32;
}

.status.bloqueado {
  background: #ffebee;
  color: #c62828;
}

/* ===== ESTILOS PRODUCTOS ===== */
.productos-container .list-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.productos-container .price-stock {
  font-size: 1rem;
  color: #555;
}

.productos-container .category {
  font-size: 1rem;
  color: #777;
  background: #f3f3f3;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 4px;
}

.productos-container .description {
  font-style: italic;
  color: #666;
  margin-top: 4px;
}

.productos-container .alerta-stock {
  color: #c62828;
  font-weight: bold;
}

/* Estilos para campos de búsqueda */
.search-bar {
  width: 100%;
  padding: 12px;
  margin: 15px 0;
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar:focus {
  outline: none;
  border-color: #4a148c;
  box-shadow: 0 0 0 2px rgba(74, 20, 140, 0.2);
}

.search-bar::placeholder {
  color: #aaa;
  font-style: italic;
  font-size: 0.9rem;
}

.productos-container .search-bar {
  /* Mantener estilos específicos si es necesario */
}

/* ===== ESTILOS REPORTES ===== */
/* Animación para el botón de aplicar filtros */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

.period-selector, .specific-selector {
    display: flex;
    flex-direction: column;
}

/* Estilo para los botones de exportación */
.mass-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.mass-actions button {
  flex: 1;
}

.container .metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.container .metric-card {
  background: white;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  text-align: center;
  border-top: 4px solid #1976d2;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.container .metric-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.container .metric-card:nth-child(1) { border-top-color: #1565C0; } /* Azul fuerte – Ventas del periodo */
.container .metric-card:nth-child(2) { border-top-color: #2E7D32; } /* Verde – Ganancias */
.container .metric-card:nth-child(3) { border-top-color: #FFB300; } /* Amarillo oro – Impuestos */
.container .metric-card:nth-child(4) { border-top-color: #8E24AA; } /* Púrpura – Nº Ventas */
.container .metric-card:nth-child(5) { border-top-color: #E53935; } /* Rojo – Productos vendidos */
.container .metric-card:nth-child(6) { border-top-color: #00ACC1; } /* Cian – Referencias vendidas */
.container .metric-card:nth-child(7) { border-top-color: #FB8C00; } /* Naranja – Ticket más alto */
.container .metric-card:nth-child(8) { border-top-color: #6D4C41; } /* Marrón – Ticket promedio */
.container .metric-card:nth-child(9) { border-top-color: #3949AB; } /* Azul índigo – Ticket más bajo */
.container .metric-card:nth-child(10) { border-top-color: #C0CA33; } /* Verde lima – Clientes atendidos */

.container .metric-card h3 {
  font-size: 0.9rem;
  color: #333;
  margin-bottom: 8px;
  font-weight: 600;
}

.container .metric-card p {
  font-size: 1.5rem;
}

/* Estilos para los gráficos */
.charts-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 20px 0;
  width: 100%;
}

.chart-card {
  background: white;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chart-card h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.1rem;
  text-align: center;
  font-weight: 600;
  color: #333;
}

/* Contenedor responsivo para los gráficos */
.chart-responsive-container {
  position: relative;
  height: 0;
  width: 100%;
  padding-bottom: 60%; /* Proporción de aspecto 5:3 */
}

.chart-responsive-container canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  max-height: 300px;
}

/* Estilos específicos para los gráficos de top 5 */
.chart-card canvas {
  width: 100% !important;
  height: auto !important;
  max-height: 300px;
}

/* Hacer que los gráficos de ventas sean más anchos en pantallas grandes */
@media (min-width: 768px) {
  .charts-container {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .sales-chart-card {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1200px) {
  .charts-container {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .sales-chart-card {
    grid-column: auto; /* Vuelve a su comportamiento normal */
  }
}

/* ===== ESTILOS CONFIG ===== */
.config-container .input-group { margin: 15px 0; }

.config-container .input-group label { font-weight: 500; }

.config-container .logo-preview { margin: 15px 0; text-align: center; }

.config-container .logo-preview img { max-width: 150px; border-radius: 10px; border: 2px dashed #bbdefb; padding: 5px; }

.config-container .checkbox-group { display: flex; align-items: center; gap: 8px; margin: 15px 0; }

.config-container .checkbox-group input { transform: scale(1.2); }

.config-container .btn-reset { background: #c62828; margin-top: 20px; }

.config-container .btn-reset:hover { background: #b71c1c; }

/* 🔄 Switch de modo oscuro */ 
.config-container .switch { position: relative; display: inline-block; width: 50px; height: 24px; }

.config-container .switch input { opacity: 0; width: 0; height: 0; }

.config-container .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: 0.4s; border-radius: 24px; }

.config-container .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: 0.4s; border-radius: 50%; }

.config-container input:checked + .slider { background-color: #2e7d32; }

.config-container input:checked + .slider:before { transform: translateX(26px); }


/* =======================================
   Ajuste para el interruptor en config.html
   ======================================== */
.switch-container {
  display: flex;            /* Pone los elementos en línea */
  justify-content: space-between; /* Texto a la izquierda, switch a la derecha */
  align-items: center;      /* Los centra verticalmente */
  
  /* Anulamos los estilos de .input-group que no queremos */
  padding: 10px 0;
  border: none;
  background: none;
  margin-bottom: 10px;
}

.switch-container .switch-label {
  /* Anulamos los estilos de 'label' que no queremos */
  margin: 0;
  font-weight: 600;
  color: #555;
}

.dark .switch-container .switch-label {
  color: #ccc;
}


/* ===== MEDIA QUERIES RESPONSIVAS ===== */

/* Media queries para mejorar responsividad de productos */
@media (max-width: 480px) {
  .producto-item {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "info info"
      "controles total";
    padding: 12px 10px;
  }
  
  .producto-info {
    grid-area: info;
    margin-bottom: 10px;
  }
  
  .producto-controles {
    grid-area: controles;
    flex-direction: row;
    align-items: center;
  }
  
  .producto-total {
    grid-area: total;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
  }
  
  .subtotal {
    margin-right: 10px;
  }

  /* Móviles pequeños (320px - 480px) */
  .container {
    padding: 10px;
  }

  .page-header h1 {
    font-size: 1.3rem;
  }

  .btn {
    padding: 12px;
    font-size: 0.95rem;
  }

  .input-group input,
  .input-group select {
    padding: 10px;
    font-size: 0.95rem;
  }

  .list-item {
    padding: 12px;
  }

  .list-item .title {
    font-size: 1.05rem;
  }

  .list-item .actions {
    gap: 6px;
  }

  .list-item .actions button {
    padding: 5px 8px;
    font-size: 0.8rem;
  }
}

/* Tablets (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .btn {
    font-size: 1.05rem;
    padding: 15px;
  }

  .input-group input,
  .input-group select {
    font-size: 1rem;
  }

  .list-item .actions {
    flex-direction: row;
  }
  
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablets horizontales y escritorio pequeño (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    padding: 20px;
  }

  .page-header h1 {
    font-size: 1.7rem;
  }

  .list-item header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .list-item .actions {
    margin-top: 0;
  }
  
  .quick-actions {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Escritorio (1025px+) */
@media (min-width: 1025px) {
  html {
    font-size: 100%; /* ✅ Mantiene coherencia con el sistema */
  }

  .container {
    padding: 30px;
  }

  .page-header h1 {
    font-size: 1.8rem;
  }

  .btn {
    font-size: 1.1rem;
    max-width: 300px;
    margin: 10px auto;
  }
  
  .quick-actions {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}