/* ========================================================================== */
/* SISTEMA DE INVENTARIO Y VENTAS - TALLERMOTOV */
/* Archivo CSS consolidado con toda la funcionalidad */
/* ========================================================================== */

/* ========================================================================== */
/* VARIABLES CSS Y CONFIGURACIÓN BASE */
/* ========================================================================== */

:root {
  --primary-color: #2563eb; /* Azul principal */
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --accent-color: #10b981; /* Verde para acciones positivas */
  --danger-color: #ef4444; /* Rojo para inventario agotado */
  --warning-color: #ff8c00; /* Naranja para stock bajo */
  --bg-light: #f8fafc;
  --bg-card: #ffffff;
  --text-dark: #1e293b;
  --text-light: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --transition: all 0.3s ease;
}

/* ========================================================================== */
/* RESETEO Y ESTILOS BASE */
/* ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  font-size: 16px;
}

/* ========================================================================== */
/* HEADER Y NAVEGACIÓN */
/* ========================================================================== */

header {
  background: linear-gradient(135deg, var(--primary-color), #3b82f6);
  color: white;
  padding: 1.5rem 1rem;
  box-shadow: var(--shadow-md);
  position: relative;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  text-align: center;
}

/* Contenedor del logo y títulos principales */
.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 1rem;
}

/* Logo de la empresa */
.company-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 0.75rem;
  filter: brightness(0) invert(1); /* Convierte el logo a blanco */
  transition: var(--transition);
}

.company-logo:hover {
  transform: scale(1.05);
}

/* Título principal del header */
.logo-container h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: white;
  text-align: center;
  line-height: 1.2;
}

/* Subtítulo del header */
.logo-container h2 {
  font-size: 1.1rem;
  font-weight: 400;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  line-height: 1.3;
}

/* Navegación principal */
.main-nav {
  margin-top: 1.25rem;
  display: flex;
  justify-content: center;
}

.main-nav ul {
  display: flex;
  list-style: none;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 0.25rem;
}

.main-nav li {
  margin: 0;
}

.main-nav a {
  display: block;
  color: white;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: var(--transition);
}

.main-nav a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.main-nav a.active {
  background-color: white;
  color: var(--primary-color);
  font-weight: 600;
}

/* Controles del header */
.header-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.search-container {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 600px;
}

.search-container input {
  padding: 0.75rem;
  border: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  width: 100%;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
}

.search-container button {
  padding: 0.75rem 1rem;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  cursor: pointer;
  transition: var(--transition);
}

.search-container button:hover {
  background-color: #059669;
}

.search-container button {
  padding: 0.5rem 1rem;
  background-color: #fff;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

header h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.header-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.search-container {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 600px;
}

.search-container input {
  padding: 0.5rem;
  border: none;
  border-radius: 4px 0 0 4px;
  width: 100%;
}

.search-container button {
  padding: 0.5rem 1rem;
  background-color: #fff;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

.export-btn {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.3s;
  font-size: 0.9rem;
}

.export-btn:hover {
  background-color: #218838;
}

.export-icon {
  font-size: 1.2rem;
}

@media (min-width: 768px) {
  .header-controls {
    flex-direction: row;
    justify-content: space-between;
    max-width: 800px;
    margin: 1rem auto;
  }
  /* Adjusts the generic search container for larger screens if it's in header-controls */
  .header-controls .search-container {
    width: auto;
  }

  /* Logo más grande en pantallas grandes */
  .company-logo {
    width: 80px;
    height: 80px;
  }

  .logo-container h1 {
    font-size: 2.25rem;
  }
}

/* ========================================================================== */
/* CONTENEDOR PRINCIPAL Y LAYOUT */
/* ========================================================================== */

main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ========================================================================== */
/* SECCIÓN DE CONTROLES Y BOTONES */
/* ========================================================================== */

.controls {
  margin-bottom: 2rem;
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.25rem;
}

.controls-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

/* Botones base */
.btn {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--text-dark);
  background-color: #e5e7eb;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn.primary {
  background-color: var(--primary-color);
  color: white;
}

.btn.primary:hover {
  background-color: var(--primary-hover);
}

.btn.secondary {
  background-color: var(--secondary-color);
  color: white;
}

.btn.secondary:hover {
  background-color: #475569;
}

.btn-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--secondary-color);
}

.btn-icon:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--primary-color);
  transform: scale(1.1);
}

/* Botones específicos */
.export-btn {
  background-color: var(--accent-color);
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--radius-md);
  padding: 0.625rem 1.25rem;
}

.export-btn:hover {
  background-color: #059669;
}

.columns-btn {
  background-color: var(--secondary-color);
  color: white;
}

.columns-btn:hover {
  background-color: #475569;
}

/* ========================================================================== */
/* BARRA DE BÚSQUEDA Y FILTROS */
/* ========================================================================== */

.search-container {
  display: flex;
  max-width: 400px;
  width: 100%;
  position: relative;
}

.search-container input {
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 100%;
  font-size: 0.9375rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='20' height='20' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 0.75rem) center;
  transition: var(--transition);
}

.search-container input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Estados de búsqueda */
.search-container input.searching {
  border-color: var(--primary-color);
  background-color: #f0f9ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.search-container input.has-results {
  border-color: var(--accent-color);
  background-color: #ecfdf5;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.search-container input.no-results {
  border-color: var(--warning-color);
  background-color: #fff7ed;
  box-shadow: 0 0 0 2px rgba(255, 140, 0, 0.1);
}

.filter-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-controls label {
  font-weight: 500;
  color: var(--text-light);
}

.filter-controls select,
.filter-controls input[type="date"] {
  padding: 0.625rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: white;
  color: var(--text-dark);
  font-size: 0.9375rem;
  transition: var(--transition);
}

.filter-controls select:focus,
.filter-controls input[type="date"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ========================================================================== */
/* ENCABEZADOS DE SECCIONES */
/* ========================================================================== */

.inventory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.inventory-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-dark);
  padding: 0;
  border: none;
  margin: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ========================================================================== */
/* TABLAS RESPONSIVE */
/* ========================================================================== */

.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  background-color: white;
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  overflow: hidden;
}

thead {
  background-color: #f1f5f9;
}

th {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-dark);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: var(--transition);
}

tbody tr:hover {
  background-color: #f8fafc;
}

/* Estados de inventario */
.low-stock {
  background-color: rgba(255, 165, 0, 0.15);
  color: var(--warning-color);
  font-weight: 600;
}

.out-of-stock {
  background-color: rgba(220, 53, 69, 0.15);
  color: var(--danger-color);
  font-weight: 600;
}

.no-data {
  text-align: center;
  color: var(--text-light);
  font-style: italic;
  padding: 2rem;
}

/* Columnas ocultas */
.column-hidden {
  display: none !important;
}

/* ========================================================================== */
/* EXCEL DROPDOWN - SISTEMA UNIFICADO RESPONSIVE */
/* Estilos consolidados para secciones de inventario y ventas */
/* ========================================================================== */

/* Estilos base del dropdown de Excel */
.excel-dropdown {
  position: relative;
  display: inline-block;
}

.excel-dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  min-width: 240px;
  background-color: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1050;
  overflow: hidden;
  border: 1px solid var(--border-color);
  pointer-events: auto;
}

.excel-dropdown.active .excel-dropdown-content {
  display: block !important;
  z-index: 1050 !important;
}

/* Header del dropdown de Excel */
.excel-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  background-color: #f8fafc;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.875rem;
}

/* Enlaces del dropdown de Excel */
.excel-dropdown-content a {
  color: var(--text-dark);
  padding: 0.875rem 1.25rem;
  text-decoration: none;
  display: block;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 1051;
}

.excel-dropdown-content a:last-child {
  border-bottom: none;
}

.excel-dropdown-content a:hover {
  background-color: #f1f5f9;
  color: var(--primary-color);
}

.excel-dropdown-content a:active {
  background-color: #e0e7ff;
  color: #4338ca;
}

/* Overlay para mobile */
.excel-dropdown-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

/* ========================================================================== */
/* DROPDOWN DE VISIBILIDAD DE COLUMNAS */
/* ========================================================================== */

.column-visibility-dropdown {
  position: relative;
  display: inline-block;
}

.column-toggle-content {
  display: none;
  position: absolute;
  right: 0;
  min-width: 280px;
  max-height: 400px;
  overflow-y: auto;
  background-color: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  border: 1px solid var(--border-color);
}

.column-visibility-dropdown.active .column-toggle-content {
  display: block;
}

.column-toggle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  background-color: #f8fafc;
  font-weight: 600;
  color: var(--text-dark);
}

.column-checkbox-container {
  padding: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
}

.column-checkbox-item {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s;
}

.column-checkbox-item:hover {
  background-color: #f8fafc;
}

.column-checkbox-item input[type="checkbox"] {
  margin-right: 0.5rem;
  width: 18px;
  height: 18px;
}

.column-checkbox-item label {
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-dark);
  flex: 1;
}

.column-toggle-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

/* ========================================================================== */
/* MODALES Y FORMULARIOS */
/* ========================================================================== */

.modal {
  display: flex;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.close-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.close-button:hover {
  background-color: #f1f5f9;
  color: var(--text-dark);
}

/* Formularios */
.form-container {
  display: flex;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.form-container.hidden {
  display: none;
}

.form-card {
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
}

/* Estados de validación */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
  border-color: var(--danger-color);
}

.form-group .error-message {
  color: var(--danger-color);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* ========================================================================== */
/* DROPDOWN ARROWS Y ICONOGRAFÍA */
/* ========================================================================== */

.dropdown-arrow {
  font-size: 0.75rem;
  margin-left: 0.5rem;
  transition: transform 0.2s ease;
}

.excel-dropdown.active .dropdown-arrow,
.column-visibility-dropdown.active .dropdown-arrow {
  transform: rotate(180deg);
}

/* Iconos SVG */
.btn svg {
  width: 18px;
  height: 18px;
}

/* ========================================================================== */
/* RESPONSIVE DESIGN - TABLET Y MÓVIL */
/* ========================================================================== */

/* Responsive adjustments */
@media (max-width: 992px) {
  .controls-container {
    flex-direction: column;
    align-items: stretch; /* Make items take full width */
  }

  .left-controls,
  .center-controls,
  .right-controls {
    width: 100%;
    margin-bottom: 0.8rem; /* Add some space between stacked controls */
  }

  .controls .search-container {
    /* Ensure search in controls also takes full width */
    max-width: none;
  }

  .right-controls {
    margin-bottom: 0; /* Remove bottom margin if it's the last item */
  }
  .sales-grid {
    /* Responsive sales grid */
    grid-template-columns: 1fr; /* Stack columns */
  }
}

@media (max-width: 1024px) {
  .controls-container {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .excel-dropdown-content {
    min-width: 220px;
  }
}

@media (max-width: 768px) {
  /* Header responsive */
  header {
    padding: 1rem 0.5rem;
  }

  /* Logo container responsive */
  .logo-container {
    margin-bottom: 0.75rem;
  }

  /* Logo más pequeño en dispositivos móviles */
  .company-logo {
    width: 45px;
    height: 45px;
    margin-bottom: 0.5rem;
  }

  .logo-container h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
  }

  .logo-container h2 {
    font-size: 0.95rem;
  }

  .main-nav ul {
    flex-direction: column;
    padding: 0.5rem;
  }

  .main-nav a {
    padding: 0.5rem 1rem;
    text-align: center;
  }

  /* Layout principal */
  main {
    margin: 1rem auto;
    padding: 0 0.5rem;
  }

  .controls {
    padding: 1rem;
  }

  .controls-container {
    flex-direction: column;
    gap: 1rem;
  }

  /* Encabezados responsive */
  .inventory-header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .inventory-header h2 {
    margin-bottom: 1rem;
  }

  .header-actions {
    justify-content: center;
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
  }

  .column-visibility-dropdown,
  .excel-dropdown {
    width: 100%;
  }

  .column-visibility-dropdown .btn,
  .excel-dropdown .btn {
    width: 100%;
    justify-content: center;
  }

  /* Excel Dropdown - Estilo Modal Mobile */
  .excel-dropdown.active .excel-dropdown-content {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    transform: translate(-50%, -50%) !important;
    width: 90vw !important;
    max-width: 400px !important;
    min-width: 280px !important;
    max-height: 80vh !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    z-index: 1060 !important;
    margin: 0 !important;
    animation: modalSlideIn 0.3s ease;
    overflow-y: auto;
  }

  /* Overlay Mobile para Excel Dropdown */
  .excel-dropdown.active .excel-dropdown-overlay,
  .excel-dropdown.active::before {
    content: "";
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1050;
    opacity: 1;
    animation: overlayFadeIn 0.2s ease;
    pointer-events: auto !important;
  }

  /* Objetivos táctiles mejorados para Excel dropdown */
  .excel-dropdown-content a {
    padding: 1rem 1.25rem !important;
    font-size: 1rem !important;
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .excel-dropdown-header {
    padding: 1rem !important;
    font-size: 1rem !important;
    border-bottom: 2px solid #e2e8f0 !important;
    text-align: center;
  }

  /* Column Dropdown - Estilo Modal Mobile */
  .column-toggle-content {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    transform: translate(-50%, -50%) !important;
    width: 90vw !important;
    max-width: 400px !important;
    min-width: 280px !important;
    max-height: 80vh !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    z-index: 1050 !important;
    margin: 0 !important;
    animation: modalSlideIn 0.3s ease;
  }

  /* Overlay Mobile para Column Dropdown */
  .column-visibility-dropdown.active .column-toggle-overlay,
  .column-visibility-dropdown.active::before {
    content: "";
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1040;
    opacity: 1;
    animation: overlayFadeIn 0.2s ease;
    pointer-events: auto !important;
  }

  /* Objetivos táctiles mejorados para column dropdown */
  .column-checkbox-item {
    padding: 1rem 0.75rem !important;
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .column-toggle-header {
    padding: 1rem !important;
    font-size: 1rem !important;
    border-bottom: 2px solid #e2e8f0 !important;
  }

  .column-toggle-header .btn-sm {
    padding: 0.75rem 1rem !important;
    font-size: 0.9rem !important;
    min-height: 44px !important;
    touch-action: manipulation;
  }

  /* Tabla responsive */
  .table-responsive {
    font-size: 0.875rem;
  }

  th,
  td {
    padding: 0.75rem 0.5rem;
  }

  /* Modales responsive */
  .modal-content {
    margin: 1rem;
    width: calc(100% - 2rem);
  }

  .form-card {
    margin: 1rem;
    width: calc(100% - 2rem);
    padding: 1.5rem;
  }

  /* Botones responsive */
  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .search-container {
    max-width: 100%;
  }
}

/* ========================================================================== */
/* RESPONSIVE DESIGN - MOBILE PEQUEÑO (max-width: 400px) */
/* Optimizado para Samsung Galaxy S8+ y similares */
/* ========================================================================== */

@media (max-width: 400px) {
  /* Logo container para dispositivos pequeños */
  .logo-container h1 {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
  }

  .logo-container h2 {
    font-size: 0.85rem;
  }

  /* Excel Dropdown - Optimizaciones para móvil pequeño */
  .excel-dropdown.active .excel-dropdown-content {
    width: 95vw !important;
    max-width: 350px !important;
    min-width: 320px !important;
    max-height: 85vh !important;
  }

  .excel-dropdown-content a {
    padding: 1.125rem 1rem !important;
    font-size: 0.95rem !important;
    min-height: 52px !important;
  }

  .excel-dropdown-header {
    padding: 1rem 0.875rem !important;
    font-size: 0.95rem !important;
  }

  /* Column Dropdown - Optimizaciones para móvil pequeño */
  .column-toggle-content {
    width: 95vw !important;
    max-width: 350px !important;
    min-width: 320px !important;
    max-height: 85vh !important;
  }

  .column-checkbox-item {
    padding: 1.125rem 1rem !important;
    font-size: 0.95rem !important;
    min-height: 52px !important;
  }

  .column-toggle-header {
    padding: 1rem 0.875rem !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    align-items: stretch !important;
  }

  .column-toggle-header > div {
    display: flex !important;
    gap: 0.5rem !important;
  }

  .column-toggle-header .btn-sm {
    flex: 1 !important;
    padding: 0.875rem 0.75rem !important;
    font-size: 0.875rem !important;
    min-height: 48px !important;
  }

  /* Checkboxes más grandes para touch */
  .column-checkbox-item input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
    margin-right: 0.75rem !important;
  }

  .column-checkbox-item label {
    font-size: 0.95rem !important;
    line-height: 1.4 !important;
  }

  /* Layout general */
  .header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .excel-dropdown,
  .column-visibility-dropdown {
    margin-bottom: 0.25rem;
    width: 100%;
  }

  .export-btn,
  .columns-btn {
    width: 100%;
    padding: 0.625rem 1rem;
    min-width: unset;
    justify-content: space-between;
  }

  /* Tabla responsive para móvil pequeño */
  .table-responsive {
    font-size: 0.8rem;
  }

  th,
  td {
    padding: 0.5rem 0.25rem;
  }
}

/* ========================================================================== */
/* RESPONSIVE DESIGN - MOBILE EXTRA PEQUEÑO (max-width: 370px) */
/* ========================================================================== */

@media (max-width: 370px) {
  /* Logo container para dispositivos extra pequeños */
  .logo-container h1 {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
  }

  .logo-container h2 {
    font-size: 0.8rem;
  }

  /* Excel Dropdown - Extra pequeño */
  .excel-dropdown.active .excel-dropdown-content {
    width: 98vw !important;
    max-width: 340px !important;
    min-width: 300px !important;
  }

  .excel-dropdown-content a {
    padding: 1.25rem 0.875rem !important;
    font-size: 0.9rem !important;
    min-height: 56px !important;
  }

  .excel-dropdown-header {
    padding: 0.875rem !important;
    font-size: 0.9rem !important;
  }

  /* Column Dropdown - Extra pequeño */
  .column-toggle-content {
    width: 98vw !important;
    max-width: 340px !important;
    min-width: 300px !important;
  }

  .column-checkbox-item {
    padding: 1.25rem 0.875rem !important;
    font-size: 0.9rem !important;
    min-height: 56px !important;
  }

  .column-toggle-header {
    padding: 0.875rem !important;
    font-size: 0.95rem !important;
  }

  .column-toggle-header .btn-sm {
    padding: 1rem 0.625rem !important;
    font-size: 0.8rem !important;
    min-height: 50px !important;
  }
}

/* ========================================================================== */
/* MODAL FIX - OVERLAY BEHAVIOR */
/* Comportamiento consistente para overlays de dropdowns */
/* ========================================================================== */

/* Fuerza ocultar overlay en desktop */
.excel-dropdown-overlay,
.column-toggle-overlay {
  display: none !important;
  pointer-events: none !important;
}

/* Solo habilita overlay en dispositivos móviles */
@media (max-width: 768px) {
  .excel-dropdown.active .excel-dropdown-overlay,
  .column-visibility-dropdown.active .column-toggle-overlay {
    display: block !important;
    pointer-events: auto !important;
  }
}

/* ========================================================================== */
/* ANIMACIONES Y TRANSICIONES */
/* ========================================================================== */

/* Animación de entrada para modales */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal:not(.hidden) .modal-content,
.form-container:not(.hidden) .form-card {
  animation: modalFadeIn 0.2s ease-out;
}

/* Animaciones para dropdowns mobile */
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
    scale: 0.9;
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
    scale: 1;
  }
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Animación suave para desktop */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.excel-dropdown.active .excel-dropdown-content {
  animation: fadeIn 0.2s ease;
}

/* Animación de pulso para botones */
@keyframes button-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

/* Animación de carga para botones */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ========================================================================== */
/* ESTADOS ESPECIALES Y UTILIDADES */
/* ========================================================================== */

/* Prevenir scroll del body cuando modal está abierto */
@media (max-width: 768px) {
  body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }
}

/* Desabilitar efectos hover en dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
  .excel-dropdown-content a:hover {
    background-color: transparent;
    color: var(--text-dark);
  }

  .column-checkbox-item:hover {
    background-color: transparent;
  }

  .btn:hover {
    transform: none;
    box-shadow: none;
  }
}

/* Estados de accesibilidad */
.excel-dropdown-content a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: -2px;
  background-color: #eff6ff;
}

.column-checkbox-item:focus-within {
  background-color: #eff6ff;
  outline: 2px solid var(--primary-color);
  outline-offset: -2px;
}

/* Estados activos mejorados para touch */
.excel-dropdown-content a:active {
  background-color: #e2e8f0 !important;
  transform: scale(0.98);
  transition: all 0.1s ease;
}

/* ========================================================================== */
/* PRINT STYLES */
/* ========================================================================== */

@media print {
  .excel-dropdown,
  .column-visibility-dropdown,
  .btn,
  .search-container,
  .filter-controls {
    display: none !important;
  }

  .table-responsive {
    overflow: visible !important;
  }

  table {
    font-size: 12px;
  }

  th,
  td {
    padding: 0.25rem !important;
  }
}

/* ========================================================================== */
/* FIN DEL ARCHIVO CSS CONSOLIDADO */
/* ========================================================================== */

/* =============================================
   MODALES DE DETALLES - ESTILOS MEJORADOS
   ============================================= */

/* Modal de detalles de pieza */
#pieceDetailModal .modal-content {
  max-width: 650px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

#pieceDetailModal h2 {
  background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
  color: white;
  margin: 0;
  padding: 1.5rem 2rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  font-size: 1.4rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#pieceDetailModal h2::before {
  content: "🔧";
  font-size: 1.2rem;
}

#pieceDetail {
  padding: 2rem;
  background: white;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Contenedor de información de pieza */
.piece-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.piece-info-card {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.piece-info-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
}

.piece-info-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.15);
}

.piece-info-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.piece-info-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-dark);
  word-break: break-word;
}

.piece-info-value.price {
  color: var(--accent-color);
  font-size: 1.25rem;
}

.piece-info-value.stock {
  color: var(--primary-color);
  font-size: 1.25rem;
}

.piece-info-value.low-stock {
  color: #ef4444;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Modal de detalles de venta */
#saleDetailModal .modal-content {
  max-width: 700px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

#saleDetailModal h2 {
  background: linear-gradient(135deg, var(--accent-color) 0%, #059669 100%);
  color: white;
  margin: 0;
  padding: 1.5rem 2rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  font-size: 1.4rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#saleDetailModal h2::before {
  content: "🧾";
  font-size: 1.2rem;
}

#saleDetail {
  padding: 2rem;
  background: white;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Información de venta */
.sale-info-header {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
}

.sale-info-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(135deg, var(--accent-color), #059669);
}

.sale-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.sale-info-row:last-child {
  margin-bottom: 0;
}

.sale-info-label {
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.95rem;
}

.sale-info-value {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 1rem;
}

/* Lista de productos en venta */
.sale-products-section {
  margin: 2rem 0;
}

.sale-products-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sale-products-title::before {
  content: "📦";
  font-size: 1rem;
}

.sale-products-list {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.sale-product-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  transition: background-color 0.2s ease;
}

.sale-product-item:last-child {
  border-bottom: none;
}

.sale-product-item:hover {
  background-color: #e2e8f0;
}

.sale-product-info {
  flex: 1;
}

.sale-product-name {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.sale-product-details {
  font-size: 0.875rem;
  color: var(--text-light);
}

.sale-product-price {
  font-weight: 600;
  color: var(--accent-color);
  font-size: 1.1rem;
}

/* Totales de venta */
.sale-totals {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 2rem;
}

.sale-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.sale-total-row:last-child {
  margin-bottom: 0;
  border-top: 2px solid #0284c7;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.sale-total-label {
  font-weight: 600;
  color: var(--text-dark);
}

.sale-total-value {
  font-weight: 700;
  font-size: 1.125rem;
}

.sale-total-usd {
  color: var(--accent-color);
}

.sale-total-cup {
  color: var(--primary-color);
}

/* Botón de cerrar mejorado */
#pieceDetailModal .close-button,
#saleDetailModal .close-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#pieceDetailModal .close-button:hover,
#saleDetailModal .close-button:hover {
  background: rgba(255, 255, 255, 1);
  color: #ef4444;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ========================================================================== */
/* MODAL DE IMPORTACIÓN DE INVENTARIO - ESTILOS MEJORADOS */
/* ========================================================================== */

/* Estilos específicos para el modal de importación de inventario Excel */
#importExcelFormContainer .modal-content {
  max-width: 600px;
  width: 95%;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#importExcelFormContainer .modal-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 1.5rem 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#importExcelFormContainer .modal-content h2::before {
  content: "";
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #059669, #10b981);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#importExcelFormContainer .modal-content h2::after {
  content: "📦";
  position: absolute;
  left: 30px;
  top: 2px;
  font-size: 14px;
}

#importExcelFormContainer .import-help-info {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #10b981;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

#importExcelFormContainer .import-help-info::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #10b981, #059669);
}

#importExcelFormContainer .import-help-info h4 {
  color: #064e3b;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#importExcelFormContainer .import-help-info h4::before {
  content: "ℹ️";
  font-size: 1rem;
}

#importExcelFormContainer .import-help-info p {
  color: #065f46;
  margin: 0.5rem 0;
  line-height: 1.6;
  font-size: 0.95rem;
}

#importExcelFormContainer .import-help-info ul {
  margin: 1rem 0;
  padding-left: 0;
  list-style: none;
}

#importExcelFormContainer .import-help-info li {
  color: #065f46;
  margin: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.5;
}

#importExcelFormContainer .import-help-info li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #059669;
  font-weight: bold;
  font-size: 1rem;
}

#importExcelFormContainer .form-group {
  margin-bottom: 1.5rem;
}

#importExcelFormContainer .form-group label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

#importExcelFormContainer .form-group input[type="file"] {
  width: 100%;
  padding: 0.75rem;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}

#importExcelFormContainer .form-group input[type="file"]:hover {
  border-color: #10b981;
  background: #ecfdf5;
}

#importExcelFormContainer .form-group input[type="file"]:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

#importExcelFormContainer .file-upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

#importExcelFormContainer .file-upload-area:hover {
  border-color: #10b981;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  transform: translateY(-2px);
}

#importExcelFormContainer .file-upload-area::before {
  content: "📁";
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.7;
}

#importExcelFormContainer .file-upload-text {
  color: #6b7280;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

#importExcelFormContainer .file-upload-subtext {
  color: #9ca3af;
  font-size: 0.875rem;
}

#importExcelFormContainer .form-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

#importExcelFormContainer .btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

#importExcelFormContainer .btn.primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.39);
}

#importExcelFormContainer .btn.primary:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px 0 rgba(16, 185, 129, 0.5);
}

#importExcelFormContainer .btn:not(.primary) {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

#importExcelFormContainer .btn:not(.primary):hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}

#importExcelFormContainer .close-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f3f4f6;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #6b7280;
  font-size: 1.2rem;
  z-index: 10;
}

#importExcelFormContainer .close-button:hover {
  background: #fee2e2;
  color: #dc2626;
  transform: scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #importExcelFormContainer .modal-content {
    width: 95%;
    max-width: none;
    margin: 1rem;
    max-height: calc(100vh - 2rem);
  }

  #importExcelFormContainer .form-buttons {
    flex-direction: column;
  }

  #importExcelFormContainer .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================================================== */
/* MODAL DE IMPORTACIÓN DE VENTAS - ESTILOS MEJORADOS */
/* ========================================================================== */

/* Estilos específicos para el modal de importación de ventas Excel */
#importSalesExcelModal .modal-content {
  max-width: 600px;
  width: 95%;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  animation: modalSlideIn 0.3s ease-out;
}

#importSalesExcelModal .modal-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 1.5rem 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#importSalesExcelModal .modal-content h2::before {
  content: "";
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #059669, #10b981);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#importSalesExcelModal .modal-content h2::after {
  content: "📊";
  position: absolute;
  left: 30px;
  top: 2px;
  font-size: 14px;
}

#importSalesExcelModal .import-help-info {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #10b981;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

#importSalesExcelModal .import-help-info::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #10b981, #059669);
}

#importSalesExcelModal .import-help-info h4 {
  color: #064e3b;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#importSalesExcelModal .import-help-info h4::before {
  content: "ℹ️";
  font-size: 1rem;
}

#importSalesExcelModal .import-help-info p {
  color: #065f46;
  margin: 0.5rem 0;
  line-height: 1.6;
  font-size: 0.95rem;
}

#importSalesExcelModal .import-help-info ul {
  margin: 1rem 0;
  padding-left: 0;
  list-style: none;
}

#importSalesExcelModal .import-help-info li {
  color: #065f46;
  margin: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.5;
}

#importSalesExcelModal .import-help-info li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #059669;
  font-weight: bold;
  font-size: 1rem;
}

#importSalesExcelModal .form-group {
  margin-bottom: 1.5rem;
}

#importSalesExcelModal .form-group label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

#importSalesExcelModal .form-group input[type="file"] {
  width: 100%;
  padding: 0.75rem;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}

#importSalesExcelModal .form-group input[type="file"]:hover {
  border-color: #10b981;
  background: #ecfdf5;
}

#importSalesExcelModal .form-group input[type="file"]:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

#importSalesExcelModal .file-upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

#importSalesExcelModal .file-upload-area:hover {
  border-color: #10b981;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  transform: translateY(-2px);
}

#importSalesExcelModal .file-upload-area::before {
  content: "📁";
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.7;
}

#importSalesExcelModal .file-upload-text {
  color: #6b7280;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

#importSalesExcelModal .file-upload-subtext {
  color: #9ca3af;
  font-size: 0.875rem;
}

#importSalesExcelModal .form-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

#importSalesExcelModal .btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

#importSalesExcelModal .btn.primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.39);
}

#importSalesExcelModal .btn.primary:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px 0 rgba(16, 185, 129, 0.5);
}

#importSalesExcelModal .btn:not(.primary) {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

#importSalesExcelModal .btn:not(.primary):hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}

#importSalesExcelModal .close-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f3f4f6;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #6b7280;
  font-size: 1.2rem;
  z-index: 10;
}

#importSalesExcelModal .close-button:hover {
  background: #fee2e2;
  color: #dc2626;
  transform: scale(1.1);
}

/* Responsive adjustments para modal de ventas */
@media (max-width: 768px) {
  #importSalesExcelModal .modal-content {
    width: 95%;
    max-width: none;
    margin: 1rem;
    max-height: calc(100vh - 2rem);
  }

  #importSalesExcelModal .form-buttons {
    flex-direction: column;
  }

  #importSalesExcelModal .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================================================== */
/* FOOTER STYLES */
/* ========================================================================== */

footer {
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  padding: 1.5rem 0;
  margin-top: 2rem;
  position: relative;
  bottom: 0;
  width: 100%;
  box-shadow: var(--shadow-md);
}

/* Estilo para el contenedor del footer con dos líneas */
.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.footer-line {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 400;
  text-align: center;
  line-height: 1.2;
}

.footer-line.copyright {
  font-weight: 500;
}

.footer-line.subtitle {
  font-weight: 300;
  opacity: 0.9;
}

/* Estilo para footer con párrafos simples (fallback) */
footer p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 400;
  text-align: center;
  line-height: 1.4;
}

/* Responsive footer */
@media (max-width: 768px) {
  footer {
    padding: 1rem;
  }

  .footer-line {
    font-size: 0.8rem;
  }

  footer p {
    font-size: 0.8rem;
  }
}

/* ========================================================================== */
/* FIN DEL ARCHIVO CSS CONSOLIDADO */
/* ========================================================================== */
