/* === 1) Tipografía y fondo general === */
body {
  font-family: 'Roboto', sans-serif;
  background-color: #fff8e1; /* fondo crema cálido */
  color: #5d4037; /* texto marrón suave */
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

/* === 2) Header profesional con branding y usuario === */
.site-header {
  background: linear-gradient(to right, #ffe082, #ffecb3);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  margin: 0;
  font-size: 1.6rem;
  color: #5d4037;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
}

.nav-left ul {
  display: flex;
  gap: 1rem;
  margin: 0 16px;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}

.nav-left a {
  color: #5d4037;
  font-weight: 500;
  text-decoration: none;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: rgba(255,255,255,.35);
  transition: background 0.3s, box-shadow 0.3s;
}
.nav-left a:hover {
  background: rgba(255,255,255,.6);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.nav-left a.active {
  background-color: #ffe082;
  font-weight: bold;
  color: #4e342e;
  box-shadow: inset 0 -2px 0 #ffca28;
}

/* === Usuario y logout === */
.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.userbox {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(93,64,55,.15);
  border-radius: 999px;
  padding: 6px 8px 6px 6px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #5d4037;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .95rem;
}

.userbox .hello {
  color: #6c5f58;
  font-size: .85rem;
  display: block;
}
.userbox .uname {
  color: #4e342e;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease;
}
.btn-outline {
  background: #fff;
  border: 1px solid #5d4037;
  color: #5d4037;
}
.btn-outline:hover {
  background: #ffecb3;
  transform: translateY(-1px);
}

/* === 3) Contenedor central === */
.content {
  max-width: 960px;
  margin: 2rem auto;
  background: #ffffff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

/* === 4) Selector estilizado === */
.pan-selector__label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
}
.pan-selector__select {
  width: 100%;
  padding: 0.6rem 1rem;
  border: 2px solid #eec84a;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
  background-color: #fff;
}
.pan-selector__select:focus {
  outline: none;
  border-color: #eec84a;
  box-shadow: 0 0 0 2px rgba(238, 200, 74, 0.25);
}

/* === 5) Gráfico en card === */
.chart-container {
  margin-top: 1.5rem;
  border-radius: 12px;
  overflow-x: auto;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.06);
  background: #ffffff;
  padding: 1.5rem;
}

/* === 6) Footer simple con branding === */
footer {
  text-align: center;
  padding: 1rem 0;
  background: #fcd86b;
  color: #5d4037;
  font-size: 0.9rem;
}
footer a {
  color: #5d4037;
  text-decoration: none;
}

/* === 7) Estilo general de la vista === */
.page-wrapper {
  display: flex;
  justify-content: center;
  padding: 2rem;
  background-color: #fefaf2;
  min-height: 100vh;
}

.graficas-card {
  background: #ffffff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 900px;
}

.graficas-card h2 {
  font-size: 2rem;
  color: #5d4037;
  margin-bottom: 0.2rem;
  text-align: left;
  font-weight: 700;
}

.descripcion {
  font-size: 1rem;
  color: #6c757d;
  margin-bottom: 1.5rem;
}

.selector-wrapper {
  margin-bottom: 2rem;
  max-width: 320px;
}

/* === 8) Responsive === */
@media screen and (max-width: 768px) {
  .navbar { padding: 14px 12px; gap: 10px; }
  .brand { font-size: 1.2rem; }
  .nav-left ul { gap: 6px; margin: 0 8px; }
  .nav-left a { padding: 6px 10px; }
  .userbox { padding: 4px 6px 4px 4px; }
  .avatar { width: 28px; height: 28px; font-size: .85rem; }
  .btn { padding: 5px 10px; }
  
  .graficas-card {
    padding: 1.5rem 1rem;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
  }
  .graficas-card h2 {
    font-size: 1.5rem;
    text-align: center;
  }
  .descripcion {
    text-align: center;
    font-size: 0.95rem;
  }
  .selector-wrapper {
    width: 100%;
    max-width: 100%;
  }
  .chart-container {
    padding: 0.5rem;
    box-shadow: none;
  }
}

/* =================================================================
   ESTILOS PARA EL MODAL DE DETALLES PROFESIONAL
   ================================================================= */

/* --- El fondo oscuro --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  
  /* Animación de entrada/salida */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* --- La ventana blanca --- */
.modal-content {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  width: min(600px, 90vw);
  z-index: 1001;
  
  /* Animación de entrada/salida */
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

/* --- Encabezado del modal --- */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
}

/* --- Botón de cierre (la '×') --- */
.modal-close-btn {
  border: none;
  background: transparent;
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
  color: #888;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}

.modal-close-btn:hover {
  color: #000;
}

/* --- Cuerpo y tabla del modal --- */
.modal-body {
  padding: 1rem 1.5rem 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.details-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.details-table th,
.details-table td {
  padding: 0.75rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

.details-table thead th {
  font-weight: 600;
  color: #555;
  background-color: #f9f9f9;
}

/* --- Estilo de "cebra" para las filas --- */
.details-table tbody tr:nth-child(even) {
  background-color: #fafafa;
}

.details-table tbody tr:hover {
  background-color: #ffecb3; /* Un amarillo suave al pasar el mouse */
}

.details-empty-message {
  text-align: center;
  padding: 2rem;
  color: #888;
  display: none; /* Se mostrará con JS si no hay datos */
}