/* ===== RESET Y CONFIGURACIÓN GLOBAL ===== */
body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background-color: #0d0d0d;
  color: #fff;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.panel-container {
  display: flex;
  width: 100%;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 250px;
  background: linear-gradient(180deg, #1a1a1a, #0a0a0a);
  padding: 20px;
  box-shadow: 0 0 15px #00ffff;
  z-index: 10;
}

.sidebar h2 {
  text-align: center;
  color: #00ffff;
  margin-bottom: 30px;
  text-shadow: 0 0 10px #00ffff;
  font-size: 1.5em;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.sidebar li:hover {
  background: rgba(0, 255, 255, 0.1);
  border-color: #00ffff;
  transform: translateX(5px);
}

.sidebar li.active {
  background: linear-gradient(90deg, #00ffff, #ff00ff);
  color: #000;
  border-color: #ff00ff;
  box-shadow: 0 0 15px #ff00ff;
}

/* ===== CONTENIDO PRINCIPAL ===== */
.contenido {
  flex-grow: 1;
  padding: 40px;
  overflow-y: auto;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}

.seccion {
  display: none;
  animation: fadeIn 0.5s ease-in;
}

.seccion.activa {
  display: block;
}

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

/* ===== BOTONES GENERALES ===== */
button {
  background: linear-gradient(90deg, #00ffff, #ff00ff);
  color: #000;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
}

button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px #ff00ff;
}

button:active {
  transform: scale(0.95);
}

/* ===== FORMULARIO DE PRODUCTOS ===== */
.formulario-producto {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 500px;
  margin: 20px auto;
  background: rgba(255, 255, 255, 0.05);
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 0 20px #00ffff;
  border: 1px solid #00ffff;
}

.formulario-producto label {
  color: #00ffff;
  font-weight: bold;
  margin-bottom: 5px;
  display: block;
}

.formulario-producto input,
.formulario-producto select {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #00ffff;
  outline: none;
  font-size: 15px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  transition: all 0.3s ease;
}

.formulario-producto input:focus,
.formulario-producto select:focus {
  border-color: #ff00ff;
  box-shadow: 0 0 10px #ff00ff;
}

.imagen-opciones {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.imagen-opciones input[type="file"],
.imagen-opciones input[type="text"] {
  flex: 1;
  min-width: 150px;
}

.imagen-opciones span {
  color: #aaa;
  font-weight: bold;
}

/* ===== LISTA DE PRODUCTOS ===== */
.lista {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
  max-height: 500px;
  overflow-y: auto;
  padding: 10px;
}

.producto-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.08);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 0 15px #00ffff40;
  color: white;
  border: 1px solid #00ffff40;
  transition: all 0.3s ease;
}

.producto-item:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 20px #00ffff80;
}

.producto-item img {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  border: 1px solid #00ffff80;
  object-fit: cover;
}

.producto-item .acciones {
  display: flex;
  gap: 10px;
}

.producto-item .acciones button {
  background: none;
  border: none;
  cursor: pointer;
  color: #00ffff;
  font-size: 16px;
  padding: 8px 12px;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.producto-item .acciones button:hover {
  color: #ff00ff;
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.1);
}

/* ===== SECCIÓN ESTADÍSTICAS ===== */
.chart-container {
  width: 90%;
  max-width: 900px;
  margin: 30px auto;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 0 25px #00ffff;
  border: 1px solid #00ffff;
}

#actualizarDatos {
  display: block;
  margin: 20px auto;
  background: linear-gradient(90deg, #00ffff, #39ff14);
  color: #111;
  padding: 12px 25px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

#actualizarDatos:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px #39ff14;
}

/* ===== FORMULARIO DE VENTAS ===== */
.formulario-venta {
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 10px;
  border: 1px solid #98fb98;
  margin-top: 20px;
  box-shadow: 0 0 15px #98fb9840;
}

.formulario-venta label {
  display: block;
  margin-bottom: 8px;
  color: #98fb98;
  font-weight: bold;
}

.formulario-venta input,
.formulario-venta select {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #98fb98;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-family: 'Poppins', sans-serif;
}

.mensaje-venta {
  margin-top: 10px;
  font-weight: bold;
  text-align: center;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid transparent;
}

.mensaje-venta.exito {
  background: rgba(152, 251, 152, 0.2);
  color: #98fb98;
  border-color: #98fb98;
}

.mensaje-venta.error {
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
  border-color: #ff6b6b;
}

/* ===== CONFIGURACIÓN ===== */
.config-opciones {
  background: rgba(255, 255, 255, 0.08);
  padding: 25px;
  border-radius: 15px;
  border: 1px solid #dda0dd;
  margin-top: 20px;
  box-shadow: 0 0 20px #dda0dd40;
}

.config-item {
  margin-bottom: 20px;
}

.config-item label {
  display: block;
  margin-bottom: 8px;
  color: #dda0dd;
  font-weight: bold;
}

.config-item input,
.config-item select {
  width: 100%;
  padding: 10px;
  border: 1px solid #dda0dd;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-family: 'Poppins', sans-serif;
}

/* ===== SCROLLBAR PERSONALIZADO ===== */
.lista::-webkit-scrollbar {
  width: 8px;
}

.lista::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.lista::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #00ffff, #ff00ff);
  border-radius: 4px;
}

.lista::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ff00ff, #00ffff);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .panel-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
  }
  
  .contenido {
    padding: 20px;
  }
  
  .chart-container {
    width: 95%;
    padding: 15px;
  }
  
  .producto-item {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  
  .imagen-opciones {
    flex-direction: column;
  }
}

/* ===== MEJORAS PARA EL GRÁFICO DE BARRAS ===== */
.chart-container {
  width: 90%;
  max-width: 1000px;
  margin: 30px auto;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 0 30px #00ffff;
  border: 1px solid #00ffff;
  position: relative;
  min-height: 500px;
}

.chart-container canvas {
  max-height: 400px;
  width: 100% !important;
}

/* Leyenda mejorada */
.chart-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border: 1px solid #00ffff40;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
}

.legend-color {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Títulos de ejes mejorados */
.chart-axis-title {
  font-family: 'Poppins', sans-serif;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Responsive para gráficos */
@media (max-width: 768px) {
  .chart-container {
    width: 95%;
    padding: 15px;
    min-height: 400px;
  }
  
  .chart-container canvas {
    max-height: 300px;
  }
  
  .chart-legend {
    gap: 10px;
    padding: 10px;
  }
  
  .legend-item {
    font-size: 10px;
  }
}