/* Web/css/stats-accordion.css */
/* UI pro: acordeón por pares + mapa principal grande abajo */

:root{
  --card-bg: rgba(255,255,255,.92);
  --card-bd: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --shadow: 0 14px 34px rgba(2,6,23,.08);
  --radius: 18px;
}

/* ====== CONTENEDOR "GRÁFICAS Y RESUMEN" ====== */
.stats-block {
  border: 1px solid var(--card-bd);
  border-radius: var(--radius);
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stats-block__head {
  padding: 16px 18px;
  border-bottom: 1px solid #eef2f7;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.stats-block__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  color: var(--text);
  margin: 0;
}

.stats-block__hint {
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  margin-top: 4px;
}

/* ====== GRID DE ACORDEONES ====== */
.stats-acc-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.acc-item {
  grid-column: span 6;
  border: 1px solid var(--card-bd);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: 0 10px 24px rgba(2,6,23,.06);
  overflow: hidden;
  min-width: 0;
}

@media (max-width: 980px) {
  .acc-item { grid-column: span 12; }
}

.acc-head {
  width: 100%;
  border: 0;
  cursor: pointer;
  padding: 14px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, rgba(241,245,249,.9), rgba(255,255,255,.96));
}

.acc-left{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 0;
}

.acc-left span{
  font-weight: 900;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-sub {
  font-weight: 800;
  color: var(--muted);
  font-size: 13px;
  margin-left: 8px;
  white-space: nowrap;
}

.acc-icon{
  width: 18px;
  height: 18px;
  color: var(--text);
  flex: 0 0 auto;
}

.acc-chevron {
  width: 18px;
  height: 18px;
  transition: transform .18s ease;
  color: #334155;
  flex: 0 0 auto;
}

.acc-item[data-open="true"] .acc-chevron { transform: rotate(180deg); }

.acc-body {
  display: none;
  padding: 12px 14px 14px;
  border-top: 1px solid #eef2f7;
}

.acc-item[data-open="true"] .acc-body { display: block; }

/* Altura consistente */
.acc-body .chart-wrap {
  height: 320px;
}

/* Full width (Top 5) */
.acc-item.acc-wide { grid-column: span 12; }

/* ====== MAPA PRINCIPAL ABAJO ====== */
.map-block {
  margin-top: 14px;
  border: 1px solid var(--card-bd);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.map-block__head{
  padding: 16px 18px;
  border-bottom: 1px solid #eef2f7;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}

.map-block__title{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight: 900;
  color: var(--text);
  margin:0;
}

.map-badge{
  font-size: 12px;
  font-weight: 900;
  color: #0b5c7a;
  background: rgba(56,189,248,.18);
  border: 1px solid rgba(56,189,248,.35);
  padding: 6px 10px;
  border-radius: 999px;
}

/* ✅ Filtros en una fila (con botón a la derecha) */
.map-filters {
  padding: 12px 18px 6px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
  align-items: end;
}

.map-filters .field { grid-column: span 3; min-width: 0; }
.map-filters .actions { grid-column: span 3; display:flex; justify-content: flex-end; align-items:center; }

.map-filters .field label {
  display:block;
  font-weight: 900;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

/* Responsive */
@media (max-width: 1100px) {
  .map-filters .field { grid-column: span 6; }
  .map-filters .actions { grid-column: span 12; justify-content: flex-start; }
}
@media (max-width: 680px) {
  .map-filters .field { grid-column: span 12; }
  .map-filters .actions { grid-column: span 12; }
}

#mapInfo{
  padding: 0 18px 12px;
  color: var(--muted);
  font-weight: 800;
}

.map-canvas-wrap{ height: 460px; }
@media (max-width: 980px){ .map-canvas-wrap{ height: 380px; } }
@media (max-width: 680px){ .map-canvas-wrap{ height: 320px; } }

#statsMap{
  width: 100%;
  height: 100%;
}

/* Tablas */
.table-wrap { overflow-x: auto; }