html, body{
  height:100%;
}

/* Modelo de caja consistente en toda la app */
*,
*::before,
*::after{
  box-sizing:border-box;
}

/* Variables visuales globales reutilizadas en toda la UI */
:root{
  --bg:#08111d;
  --muted:rgba(255,255,255,.68);
  --text:#fff;
  --stroke:rgba(255,255,255,.10);
  --shadow:0 12px 30px rgba(0,0,0,.35);
  --radius:22px;

  --mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans:ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

/* Fondo general del dashboard */
body{
  margin:0;
  display:flex;
  flex-direction:column;
  font-family:var(--sans);
  background:
    radial-gradient(1200px 700px at 50% 120%, rgba(18,58,120,.22), transparent 60%),
    linear-gradient(180deg, #050b16 0%, #08111d 45%, #050b16 100%);
  color:var(--text);
  position:relative;
  overflow-x:hidden;
  overflow-y:auto;
}

/* Onda decorativa 1 del fondo */
body::before{
  content:"";
  position:fixed;
  left:-18%;
  top:10%;
  width:140%;
  height:240px;
  z-index:0;
  pointer-events:none;
  opacity:.30;
  background:
    linear-gradient(
      90deg,
      rgba(255,255,255,0) 0%,
      rgba(220,230,255,.10) 18%,
      rgba(255,255,255,.22) 38%,
      rgba(220,230,255,.10) 58%,
      rgba(255,255,255,0) 100%
    );
  border-radius:50%;
  filter:blur(8px);
  transform:rotate(-8deg);
  animation:waveFlowOne 18s ease-in-out infinite alternate;
}

/* Onda decorativa 2 del fondo */
body::after{
  content:"";
  position:fixed;
  left:-10%;
  top:46%;
  width:135%;
  height:300px;
  z-index:0;
  pointer-events:none;
  opacity:.18;
  background:
    linear-gradient(
      90deg,
      rgba(255,255,255,0) 0%,
      rgba(180,200,255,.08) 20%,
      rgba(255,255,255,.18) 48%,
      rgba(180,200,255,.08) 72%,
      rgba(255,255,255,0) 100%
    );
  border-radius:50%;
  filter:blur(14px);
  transform:rotate(7deg);
  animation:waveFlowTwo 24s ease-in-out infinite alternate;
}

/* Animaciones suaves de fondo */
@keyframes waveFlowOne{
  0%{
    transform:translate3d(-4%, -10px, 0) rotate(-8deg) scaleX(1);
  }
  50%{
    transform:translate3d(2%, 8px, 0) rotate(-5deg) scaleX(1.03);
  }
  100%{
    transform:translate3d(8%, -6px, 0) rotate(-9deg) scaleX(1.06);
  }
}

@keyframes waveFlowTwo{
  0%{
    transform:translate3d(0%, 16px, 0) rotate(7deg) scaleX(1);
  }
  50%{
    transform:translate3d(-4%, -8px, 0) rotate(4deg) scaleX(1.02);
  }
  100%{
    transform:translate3d(6%, 10px, 0) rotate(8deg) scaleX(1.05);
  }
}

/* Contenedor principal de la app */
.app{
  position:relative;
  z-index:1;
  flex:1;
  display:flex;
  flex-direction:column;
  width:100%;
  max-width:1600px;
  margin:0 auto;
  padding:0 40px 24px;
}

/* Logo lateral decorativo fijo */
.side-logo{
  position:fixed;
  top:28px;
  left:40px;
  width:180px;
  height:auto;
  z-index:100;
  opacity:1;

  transform:scale(1) translateY(0);
  transform-origin:left center;

  transition:
    transform .65s cubic-bezier(.22,.61,.36,1),
    opacity .65s ease;

  will-change:transform, opacity;
}

.side-logo img{
  width:100%;
  height:auto;
  opacity:.9;
  display:block;
}

/* ---------------- TOPBAR ---------------- */

/*
  Topbar anulada visualmente.
  Se conserva en el HTML porque todavía contiene #status
  y forma parte de la estructura original del proyecto.
*/
.topbar{
  visibility:hidden;
  pointer-events:none;
  height:0 !important;
  min-height:0 !important;
  padding:0 !important;
  margin:0 !important;
  border:0 !important;
  box-shadow:none !important;
  background:transparent !important;
  overflow:hidden;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.logo{
  width:44px;
  height:44px;
  border-radius:14px;
  display:grid;
  place-items:center;
  background:rgba(124,58,237,.22);
  border:1px solid rgba(124,58,237,.35);
}

.title{
  font-weight:800;
  font-size:18px;
  letter-spacing:.2px;
}

.subtitle{
  font-size:12px;
  color:var(--muted);
}

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

.muted{
  color:var(--muted);
}

code{
  font-family:var(--mono);
  font-size:12px;
  color:rgba(255,255,255,.85);
}

.chip{
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.18);
  display:flex;
  align-items:center;
  gap:10px;
}

/* ---------------- FILTERS ---------------- */

/* Caja visual principal de filtros */
.filters{
  margin-top:96px;
  padding:14px 16px 16px;
  border-radius:var(--radius);
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(10,20,38,.64), rgba(8,16,30,.48));
  box-shadow:
    0 16px 34px rgba(0,0,0,.22),
    inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

/* Grilla base de filas de filtros */
.filters-row{
  display:grid;
  grid-template-columns:repeat(5, minmax(160px,1fr));
  gap:10px;
}

select{
  width:100%;
  border-radius:14px;
  padding:10px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(0,0,0,.18);
  color:#fff;
  outline:none;
}

.filters-actions{
  display:flex;
  gap:10px;
  align-items:center;
  margin-top:10px;
}

.bases{
  margin-top:10px;
  color:var(--muted);
  font-size:12px;
}

/* ---------------- BUTTONS ---------------- */

.btn{
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.06);
  color:#fff;
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  transition:transform .12s ease, background .12s ease, border-color .12s ease;
}

.btn:hover{
  transform:translateY(-1px);
  border-color:rgba(255,255,255,.28);
  background:rgba(255,255,255,.09);
}

.btn.primary{
  background:rgba(124,58,237,.25);
  border-color:rgba(124,58,237,.45);
}

.btn.ghost{
  background:transparent;
}

.btn:focus-visible{
  outline:2px solid rgba(124,58,237,.7);
  outline-offset:2px;
}

/* ---------------- TABS ---------------- */

/* Fila de navegación de solapas */
.tabs{
  margin-top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.tab{
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.04);
  color:#fff;
  padding:10px 12px;
  border-radius:999px;
  cursor:pointer;
  transition:.12s ease;
}

.tab.active{
  background:rgba(34,197,94,.16);
  border-color:rgba(34,197,94,.35);
}

/* Contenedor de chips de crossfilter activos */
.chart-active-filters{
  flex:1;
  min-width:260px;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
  margin-left:8px;
  padding:2px 0;
}

.chart-filter-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.05);
  color:#e8eef9;
  font-size:12px;
  line-height:1;
  white-space:nowrap;
}

.chart-filter-chip__label{
  opacity:.95;
}

.chart-filter-chip__remove{
  border:0;
  background:transparent;
  color:#ffffff;
  cursor:pointer;
  font-size:14px;
  line-height:1;
  padding:0;
  opacity:.8;
}

.chart-filter-chip__remove:hover{
  opacity:1;
}

/*
  Se deja display:block cuando está vacío para no colapsar
  completamente el espacio y evitar saltos visuales raros
  en la fila de tabs.
*/
.chart-active-filters:empty{
  display:block;
}

/* ---------------- PANELS ---------------- */

/* Contenedor principal de paneles/tab content */
.content{
  margin-top:14px;
  flex:1;
  display:flex;
  flex-direction:column;
}

/* Caja visual base de cada tab */
.panel{
  padding:16px;
  border-radius:var(--radius);
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(10,19,35,.62), rgba(8,16,30,.46));
  box-shadow:
    0 20px 44px rgba(0,0,0,.24),
    inset 0 1px 0 rgba(255,255,255,.04);
  min-height:auto;
  display:flex;
  flex-direction:column;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

.panel-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}

.panel-head h2{
  margin:0;
  font-size:16px;
}

/* Clase usada por app.js para ocultar tabs no activas */
.hidden{
  display:none;
}

/* ---------------- ALTURA VISUAL ---------------- */

/*
  Alturas mínimas por tab en vista normal.
  Estas reglas son sensibles: ayudan a estabilizar el layout
  general y evitar que ciertas tabs “colapsen”.
*/
#tab-overview{
  min-height:auto;
}

#tab-economia{
  min-height:auto;
}

#tab-imagen{
  min-height:1150px;
}

#tab-evaluacion{
  min-height:1150px;
}

#tab-voto{
  min-height:auto;
}

/* ---------------- KPI GRID ---------------- */

/* Grilla principal de KPIs de overview */
.kpi-grid{
  flex:1;
  margin-top:20px;
  display:grid;
  grid-template-columns:repeat(5, 1fr);
  gap:20px;
  width:100%;
  align-content:stretch;
}

.kpi{
  padding:24px 20px;
  border-radius:20px;
  background:linear-gradient(160deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
  border:1px solid rgba(255,255,255,0.08);
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  min-height:180px;
  height:100%;
  position:relative;
  overflow:hidden;
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}

.kpi:hover{
  border-color:rgba(140,100,255,0.4);
  box-shadow:0 0 20px rgba(140,100,255,0.15);
}

.kpi .val{
  font-size:clamp(42px, 4vw, 56px);
  font-weight:900;
  letter-spacing:-1px;
  line-height:1;
  margin-bottom:12px;
  text-align:center;
}

.kpi .lbl{
  font-size:clamp(13px, 1vw, 15px);
  font-weight:700;
  letter-spacing:1px;
  text-transform:uppercase;
  opacity:.78;
  text-align:center;
  line-height:1.25;
}

.kpi::after{
  content:"";
  position:absolute;
  right:-40px;
  bottom:-40px;
  width:140px;
  height:140px;
  background:radial-gradient(circle, rgba(124,58,237,0.25), transparent 70%);
  filter:blur(40px);
}

/* Top 3 con destaque especial */
.kpi.top3{
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 8px 30px rgba(0,0,0,0.35),
    0 0 25px rgba(220,38,38,0.15);
}

.kpi.top3 .val{ color:#ff5a5a; }
.kpi.top3:nth-child(1) .val{ color:#ff3b3b; }
.kpi.top3:nth-child(2) .val{ color:#ff5a5a; }
.kpi.top3:nth-child(3) .val{ color:#ff7070; }

/* ---------------- CHARTS ---------------- */

/* Grilla base de charts para tabs de dos columnas */
.charts-grid{
  margin-top:18px;
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:20px;
}

.chart-card{
  position:relative;
  background:linear-gradient(180deg, rgba(18,28,46,.56), rgba(14,22,38,.42));
  border:1px solid rgba(255,255,255,0.06);
  border-radius:16px;
  padding:20px;
  height:380px;
  display:flex;
  flex-direction:column;
  box-shadow:
    0 14px 30px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.03);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

/*
  chart-box queda como estructura auxiliar por si un chart
  necesita wrapper absoluto. Hoy no siempre se usa, pero no molesta.
*/
.chart-box{
  position:relative;
  flex:1;
  width:100%;
}

.chart-box canvas{
  position:absolute;
  inset:0;
  width:100% !important;
  height:100% !important;
}

/* Canvas siempre estirado a su card */
.chart-card canvas{
  width:100% !important;
  height:100% !important;
}

.chart-card:hover{
  border-color:rgba(124,58,237,.45);
}

.chart-card h3{
  margin:0 0 14px 0;
  font-size:14px;
  font-weight:700;
  letter-spacing:.3px;
  text-transform:uppercase;
  text-align:center;
}

/* Variante de una sola columna */
.charts-grid.one{
  grid-template-columns:1fr;
}

/* ---------------- INDEX CARD ---------------- */

/* Caja base usada para IPE e ICG */
.metric-card{
  margin-bottom:25px;
  padding:26px;
  border-radius:22px;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(160deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  box-shadow:
    0 16px 34px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

.ipe-title{
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:.6px;
  opacity:.7;
}

.ipe-value{
  font-size:64px;
  font-weight:900;
  margin:6px 0 12px 0;
  transition:color .25s ease;
}

.ipe-track{
  width:100%;
  max-width:720px;
  margin:20px auto 0;
}

.ipe-meter{
  width:100%;
  max-width:980px;
  margin:26px auto 0;
}

/* Barra base del medidor */
.ipe-bar{
  position:relative;
  width:100%;
  height:18px;
  border-radius:14px;
  background:linear-gradient(
    90deg,
    #b30000 0%,
    #b30000 25%,
    #ff2e2e 25.1%,
    #ff2e2e 50%,
    #5cc2e6 50.1%,
    #5cc2e6 75.0%,
    #2c4f78 75.1%,
    #2c4f78 100%
  );
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,.45),
    0 0 18px rgba(0,0,0,.45);
}

.ipe-pointer{
  position:absolute;
  top:50%;
  transform:translate(-50%,-50%);
  width:14px;
  height:14px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 0 6px rgba(255,255,255,.8);
}

.ipe-scale,
.ipe-zones{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  width:100%;
}

.ipe-scale{
  margin-top:10px;
  font-size:12px;
  opacity:.7;
}

.ipe-zones{
  margin-top:3px;
  font-size:12px;
  opacity:.8;
}

.ipe-scale span,
.ipe-zones span{
  text-align:center;
}

/* ---------- ICG BAR ---------- */

/* Variante cromática del medidor para ICG */
.icg-card .ipe-bar{
  background:linear-gradient(
    90deg,
    #b30000 0%,
    #b30000 25%,
    #9edcff 25.1%,
    #9edcff 50%,
    #5cc2e6 50.1%,
    #5cc2e6 75.0%,
    #2c7be5 75.1%,
    #2c7be5 100%
  );
}

/* ---------------- FILTERS CUSTOM ---------------- */

/* Caja base de cada filtro */
.filter-group{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:180px;
  position:relative;
}

.filter-title{
  font-size:11px;
  color:#aeb7c6;
  letter-spacing:.5px;
  text-transform:uppercase;
}

/* Grilla específica de filtros globales */
#filtersRow{
  display:grid;
  grid-template-columns:repeat(5, 1fr);
  gap:18px;
  align-items:start;
}

/*
  Estilo final de los selects de filtros.
  Aunque el nombre diga "box", se aplica también sobre select real.
*/
.filter-box{
  background:#121a2b;
  border:1px solid rgba(255,255,255,0.08);
  border-radius:10px;
  padding:8px 10px;
  color:white;
  font-size:13px;
  cursor:pointer;
  display:flex;
  justify-content:space-between;
  align-items:center;
  min-height:36px;
}

/*
  Estructura de dropdown custom conservada.
  Parte de esto puede venir de iteraciones anteriores, pero se deja
  intacto para no tocar comportamientos o estilos colaterales.
*/
.filter-dropdown{
  position:absolute;
  top:100%;
  left:0;
  right:0;
  background:#0f1726;
  border:1px solid rgba(255,255,255,0.08);
  border-radius:10px;
  padding:8px;
  display:none;
  flex-direction:column;
  gap:6px;
  max-height:220px;
  overflow:auto;
  z-index:1000;
}

.filter-dropdown.open{
  display:flex;
}

.filter-option{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  color:#e6edf7;
  cursor:pointer;
}

.filter-option input{
  cursor:pointer;
}

.filter-values{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}

.filter-pill{
  background:#ffffff;
  color:#0b1320;
  border-radius:12px;
  padding:2px 8px;
  font-size:11px;
}

.filter-arrow{
  color:#9aa3ad;
  font-size:11px;
  margin-left:auto;
  pointer-events:none;
}

/* ---------------- OVERVIEW ---------------- */

/* Layout específico de KPIs en la tab overview */
#tab-overview .kpi-grid{
  min-height:auto;
  margin-top:20px;
  display:grid;
  grid-template-columns:repeat(5, minmax(0, 1fr));
  gap:20px;
  width:100%;
  align-content:start;
  grid-auto-rows:minmax(210px, auto);
}

#tab-overview .kpi{
  min-height:210px;
  height:auto;
}

/* ---------------- ECONOMIA ---------------- */

/* Ajustes específicos de la tab Economía */
#tab-economia{
  min-height:auto;
}

#tab-economia .metric-card{
  min-height:205px;
  margin-bottom:18px;
}

#tab-economia .charts-grid{
  margin-top:18px;
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "siteco siteco6"
    "prestamos prestamos"
    "rumbo rumbo";
  gap:20px;
  align-items:stretch;
}

#tab-economia .charts-grid .chart-card{
  min-width:0;
  height:auto;
  min-height:380px;
  overflow:hidden;
  padding:18px 20px 18px;
}

#tab-economia .charts-grid .chart-card:nth-child(1){
  grid-area:siteco;
  min-height:380px;
}

#tab-economia .charts-grid .chart-card:nth-child(2){
  grid-area:siteco6;
  min-height:380px;
}

#tab-economia .charts-grid .chart-card:nth-child(3){
  grid-area:prestamos;
  min-height:420px;
}

#tab-economia .charts-grid .chart-card:nth-child(4){
  grid-area:rumbo;
  min-height:420px;
}

#tab-economia .chart-card h3{
  margin:0 0 14px 0;
  font-size:13px;
  line-height:1.3;
  text-align:center;
  flex:0 0 auto;
}

#tab-economia .charts-grid .chart-card:nth-child(1) canvas,
#tab-economia .charts-grid .chart-card:nth-child(2) canvas{
  width:100% !important;
  height:300px !important;
  max-height:300px !important;
  display:block;
}

#tab-economia .charts-grid .chart-card:nth-child(3) canvas,
#tab-economia .charts-grid .chart-card:nth-child(4) canvas{
  width:100% !important;
  height:320px !important;
  max-height:320px !important;
  display:block;
}

#tab-economia .chart-card{
  min-height:410px;
  height:auto;
}

#tab-economia .chart-card canvas{
  height:330px !important;
  max-height:330px !important;
}

#tab-economia .ipe-card{
  padding:24px 22px 20px;
}

#tab-economia .ipe-title{
  font-size:13px;
  line-height:1.2;
}

#tab-economia .ipe-value{
  font-size:64px;
  margin:8px 0 14px;
}

#tab-economia .ipe-meter{
  width:100%;
  max-width:980px;
  margin:20px auto 0;
}

#tab-economia .ipe-bar{
  height:18px;
}

#tab-economia .ipe-scale{
  margin-top:10px;
  font-size:12px;
  opacity:.75;
}

#tab-economia .ipe-zones{
  margin-top:6px;
  font-size:12px;
  line-height:1.2;
  opacity:.9;
}

#tab-economia .ipe-zones span{
  padding:0 6px;
  text-align:center;
  white-space:normal;
  word-break:normal;
  overflow-wrap:anywhere;
}

/* ---------------- EVALUACION BASE ---------------- */

/*
  Estructura base de la grilla de evaluación.
  Luego se sobreescribe con reglas más específicas dentro de #tab-evaluacion.
*/
.evaluacion-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  grid-template-rows:auto auto;
  gap:20px;
}

.evagob-card{
  grid-column:1 / span 2;
  grid-row:1;
}

.capacidad-card{
  grid-column:1;
  grid-row:2;
}

.impacto-card{
  grid-column:2;
  grid-row:2;
}

/* ---------------- EVALUACION ---------------- */

/* Ajustes finos ya estabilizados para la tab Evaluación */
#tab-evaluacion{
  min-height:1000px;
}

#tab-evaluacion .evaluacion-grid{
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows:auto auto;
  gap:20px;
  align-items:stretch;
}

#tab-evaluacion .chart-card{
  min-width:0;
  min-height:0;
  height:auto;
  overflow:hidden;
  padding:18px 18px 16px;
}

#tab-evaluacion .chart-card h3{
  margin:0 0 12px 0;
  text-align:center;
  line-height:1.35;
  flex:0 0 auto;
}

#tab-evaluacion .evagob-card{
  grid-column:1 / span 2;
  grid-row:1;
  min-height:400px;
}

#tab-evaluacion .evagob-card canvas{
  height:300px !important;
  max-height:300px !important;
}

#tab-evaluacion .capacidad-card{
  grid-column:1;
  grid-row:2;
  min-height:360px;
  display:flex;
  flex-direction:column;
}

#tab-evaluacion .impacto-card{
  grid-column:2;
  grid-row:2;
  min-height:390px;
}

#tab-evaluacion .capacidad-card h3,
#tab-evaluacion .impacto-card h3{
  font-size:12px;
  line-height:1.35;
  margin-bottom:8px;
  padding:0 8px;
}

#tab-evaluacion .capacidad-card h3{
  margin-bottom:22px;
}

#tab-evaluacion .capacidad-card canvas{
  height:300px !important;
  max-height:300px !important;
  display:block;
  width:100% !important;
  max-width:100%;
  margin:26px auto 12px auto;
}

#tab-evaluacion .impacto-card canvas{
  height:310px !important;
  max-height:310px !important;
}

#tab-evaluacion .capacidad-card,
#tab-evaluacion .impacto-card{
  padding-left:16px;
  padding-right:16px;
}

/* ---------------- IMAGEN PRESIDENCIAL ---------------- */

/* Tab Imagen con card única y canvas muy alto */
#tab-imagen{
  min-height:1150px;
}

#tab-imagen .charts-grid.one{
  margin-top:8px;
  grid-template-columns:1fr;
}

#tab-imagen .chart-card{
  min-height:1100px !important;
  height:auto !important;
  padding:16px 18px 16px !important;
  display:flex !important;
  flex-direction:column !important;
}

#tab-imagen .chart-card h3{
  margin:0 0 10px 0 !important;
}

#tab-imagen .chart-card canvas{
  flex:1 1 auto !important;
  width:100% !important;
  height:100% !important;
  min-height:820px !important;
  max-height:none !important;
  margin-top:4px !important;
}

/* ---------------- VOTO / ELECCIONES ---------------- */

/* Layout vertical de la tab voto */
#tab-voto{
  min-height:1150px;
}

#tab-voto .charts-grid.one{
  grid-template-columns:1fr;
  gap:20px;
  align-content:start;
}

#tab-voto .chart-card{
  display:block;
  overflow:hidden;
  height:auto;
  padding:20px;
}

#tab-voto .chart-card h3{
  margin:0 0 14px 0;
}

#tab-voto .charts-grid.one .chart-card:first-child{
  min-height:460px;
}

#tab-voto .charts-grid.one .chart-card:first-child canvas{
  width:100% !important;
  height:460px !important;
  min-height:0 !important;
  max-height:460px !important;
  display:block;
}

#tab-voto .charts-grid.one .chart-card:last-child{
  min-height:460px;
}

#tab-voto .charts-grid.one .chart-card:last-child canvas{
  width:100% !important;
  height:460px !important;
  min-height:0 !important;
  max-height:460px !important;
  display:block;
}

/* ---------------- FOOTER ---------------- */

/*
  Footer actualmente no se usa en el HTML cargado,
  pero la regla se conserva por compatibilidad/iteraciones previas.
*/
.footer{
  margin-top:14px;
  padding:12px 16px;
  border-radius:var(--radius);
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.03);
  color:var(--muted);
  font-size:12px;
}

/* ---------------- RESPONSIVE ---------------- */

/* Breakpoint grande: overview pasa a 3 columnas */
@media (max-width:1200px){
  .kpi-grid{
    grid-template-columns:repeat(3, 1fr);
  }
}

/* Chips de filtros activos bajan de línea */
@media (max-width:1100px){
  .chart-active-filters{
    width:100%;
    justify-content:flex-start;
    margin-left:0;
    margin-top:8px;
  }
}

/* Breakpoint tablet grande */
@media (max-width:980px){
  #tab-overview,
  #tab-economia,
  #tab-evaluacion,
  #tab-imagen,
  #tab-voto{
    min-height:1150px;
  }

  /* Evaluación pasa a una sola columna */
  #tab-evaluacion .evaluacion-grid{
    grid-template-columns:minmax(0, 1fr);
    grid-template-rows:auto;
  }

  #tab-evaluacion .evagob-card,
  #tab-evaluacion .capacidad-card,
  #tab-evaluacion .impacto-card{
    grid-column:auto;
    grid-row:auto;
  }

  #tab-evaluacion .evagob-card{
    min-height:390px;
  }

  #tab-evaluacion .capacidad-card,
  #tab-evaluacion .impacto-card{
    min-height:390px;
  }

  #tab-evaluacion .evagob-card canvas{
    height:280px !important;
    max-height:280px !important;
  }

  #tab-evaluacion .capacidad-card h3{
    margin-bottom:18px;
  }

  #tab-evaluacion .capacidad-card canvas{
    height:240px !important;
    max-height:240px !important;
    margin:20px auto 0 auto;
  }

  #tab-evaluacion .impacto-card canvas{
    height:320px !important;
    max-height:320px !important;
  }

  /* Imagen reduce altura mínima */
  #tab-imagen{
    min-height:auto;
  }

  #tab-imagen .chart-card{
    min-height:620px !important;
  }

  #tab-imagen .chart-card canvas{
    min-height:540px !important;
    max-height:none !important;
  }

  /* Voto ajusta alturas de cards/canvas */
  #tab-voto .charts-grid.one .chart-card:first-child{
    min-height:420px;
  }

  #tab-voto .charts-grid.one .chart-card:first-child canvas{
    min-height:340px !important;
    max-height:none !important;
  }

  #tab-voto .charts-grid.one .chart-card:last-child{
    min-height:340px;
  }

  #tab-voto .charts-grid.one .chart-card:last-child canvas{
    min-height:260px !important;
    max-height:none !important;
  }

  /* Economía ajusta ligeramente alturas */
  #tab-economia .metric-card{
    min-height:220px;
  }

  #tab-economia .chart-card{
    min-height:390px;
  }

  #tab-economia .chart-card canvas{
    height:310px !important;
    max-height:310px !important;
  }

  /* Overview reduce altura de KPI cards */
  #tab-overview .kpi-grid{
    min-height:auto;
    grid-auto-rows:minmax(210px, auto);
  }

  #tab-overview .kpi{
    min-height:210px;
  }
}

/* Breakpoint tablet/desktop chico */
@media (max-width:800px){
  .kpi-grid{
    grid-template-columns:repeat(2, 1fr);
  }

  .filters-row,
  #filtersRow{
    grid-template-columns:repeat(2, minmax(160px, 1fr));
  }

  .charts-grid{
    grid-template-columns:1fr;
  }
}

/* Breakpoint móvil */
@media (max-width:500px){
  .app{
    padding:0 16px;
  }

  .kpi-grid{
    grid-template-columns:1fr;
  }

  .filters-row,
  #filtersRow{
    grid-template-columns:1fr;
  }

  .topbar{
    flex-direction:column;
    align-items:flex-start;
  }

  .side-logo{
    top:14px;
    left:16px;
    width:160px;
    height:48px;
  }

  .filters{
    margin-top:82px;
  }

  .fullscreen-btn{
    top:12px;
    right:12px;
    width:56px;
    height:56px;
    font-size:24px;
  }
}

/* ---------------- FULLSCREEN BUTTON ---------------- */
/* se deja exactamente como lo pusiste vos */

/*
  Botón de fullscreen ultra específico.
  Se deja sin tocar porque ya fue estabilizado visualmente.
*/
.fullscreen-btn{
  position:fixed;
  top:14px;
  right:14px;
  bottom:auto;
  z-index:8;
  width:84px;
  height:84px;
  padding:0;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(7,15,28,.42);
  color:#ffffff;
  font-size:34px;
  line-height:1;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:
    0 8px 18px rgba(0,0,0,.22),
    inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
  transition:transform .15s ease, border-color .15s ease, background .15s ease;
}

.fullscreen-btn:hover{
  transform:scale(1.03);
  border-color:rgba(255,255,255,.22);
  background:rgba(12,22,40,.58);
}

.fullscreen-btn span,
.fullscreen-btn__icon{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:100%;
  line-height:1;
  transform:translateY(-1px);
}

/*
  El bloque de bases se oculta completamente.
  Se conserva el elemento en HTML/JS, pero visualmente no se usa.
*/
#bases,
.bases{
  display:none !important;
}

/* ---------------- FULLSCREEN LAYOUT SUAVE ---------------- */

/*
  Layout base para fullscreen:
  - bloquea scroll externo
  - hace que app/content/paneles ocupen el alto total
  - sirve de base para overrides por tab
*/
html:fullscreen,
html:-webkit-full-screen{
  overflow:hidden;
}

html:fullscreen body,
html:-webkit-full-screen body{
  height:100vh;
  overflow:hidden;
}

html:fullscreen .app,
html:-webkit-full-screen .app{
  height:100vh;
  display:flex;
  flex-direction:column;
}

html:fullscreen .filters,
html:-webkit-full-screen .filters,
html:fullscreen .tabs,
html:-webkit-full-screen .tabs{
  flex:0 0 auto;
}

html:fullscreen .content,
html:-webkit-full-screen .content{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
  padding-bottom:20px;
}

html:fullscreen .panel,
html:-webkit-full-screen .panel{
  flex:1 1 auto;
  min-height:0 !important;
}

html:fullscreen #tab-overview,
html:-webkit-full-screen #tab-overview{
  min-height:0 !important;
}

html:fullscreen #tab-overview .kpi-grid,
html:-webkit-full-screen #tab-overview .kpi-grid{
  flex:1 1 auto;
  min-height:0 !important;
  grid-auto-rows:minmax(0, 1fr);
}

html:fullscreen #tab-overview .kpi,
html:-webkit-full-screen #tab-overview .kpi{
  min-height:0 !important;
}

/* ---------------- FULLSCREEN SOLO IMAGEN ---------------- */

/*
  Reglas específicas de fullscreen para la tab Imagen.
  Muy sensibles: no conviene tocarlas salvo bug concreto.
*/
html:fullscreen #tab-imagen,
html:-webkit-full-screen #tab-imagen{
  min-height:0 !important;
}

html:fullscreen #tab-imagen .charts-grid.one,
html:-webkit-full-screen #tab-imagen .charts-grid.one{
  margin-top:6px;
}

html:fullscreen #tab-imagen .chart-card,
html:-webkit-full-screen #tab-imagen .chart-card{
  min-height:780px !important;
  height:auto !important;
  overflow:hidden !important;
  padding:16px 18px 16px !important;
}

html:fullscreen #tab-imagen .chart-card canvas,
html:-webkit-full-screen #tab-imagen .chart-card canvas{
  min-height:680px !important;
  height: 1400px !important;
  max-height: 1400px !important;
  width:100% !important;
  margin-top:4px !important;
}

/* ---------------- FULLSCREEN SOLO ECONOMÍA ---------------- */

/* Ajustes exclusivos de fullscreen para Economía */
html:fullscreen #tab-economia,
html:-webkit-full-screen #tab-economia{
  min-height:0 !important;
}

html:fullscreen #tab-economia .metric-card,
html:-webkit-full-screen #tab-economia .metric-card{
  min-height:210px;
  margin-bottom:14px;
}

html:fullscreen #tab-economia .charts-grid,
html:-webkit-full-screen #tab-economia .charts-grid{
  margin-top:14px;
  gap:16px;
}

html:fullscreen #tab-economia .chart-card,
html:-webkit-full-screen #tab-economia .chart-card{
  min-height:450px !important;
  height:auto !important;
}

html:fullscreen #tab-economia .chart-card canvas,
html:-webkit-full-screen #tab-economia .chart-card canvas{
  height:490px !important;
  max-height:490px !important;
}

/* ---------------- FULLSCREEN SOLO EVALUACIÓN ---------------- */

/* Ajustes exclusivos de fullscreen para Evaluación */
html:fullscreen #tab-evaluacion,
html:-webkit-full-screen #tab-evaluacion{
  min-height:0 !important;
}

html:fullscreen #tab-evaluacion .metric-card,
html:-webkit-full-screen #tab-evaluacion .metric-card{
  margin-bottom:2px;
}

html:fullscreen #tab-evaluacion .evaluacion-grid,
html:-webkit-full-screen #tab-evaluacion .evaluacion-grid{
  gap:16px;
}

html:fullscreen #tab-evaluacion .evagob-card,
html:-webkit-full-screen #tab-evaluacion .evagob-card{
  min-height:430px !important;
}

html:fullscreen #tab-evaluacion .evagob-card canvas,
html:-webkit-full-screen #tab-evaluacion .evagob-card canvas{
  height:550px !important;
  max-height:590px !important;
}

html:fullscreen #tab-evaluacion .capacidad-card,
html:-webkit-full-screen #tab-evaluacion .capacidad-card{
  min-height:390px !important;
}

html:fullscreen #tab-evaluacion .impacto-card,
html:-webkit-full-screen #tab-evaluacion .impacto-card{
  min-height:410px !important;
}

html:fullscreen #tab-evaluacion .capacidad-card h3,
html:-webkit-full-screen #tab-evaluacion .capacidad-card h3{
  margin-bottom:18px !important;
}

html:fullscreen #tab-evaluacion .capacidad-card canvas,
html:-webkit-full-screen #tab-evaluacion .capacidad-card canvas{
  height:390px !important;
  max-height:390px !important;
  display:block;
  width:100% !important;
  max-width:100%;
  margin:34px auto 20px auto !important;
}

html:fullscreen #tab-evaluacion .impacto-card canvas,
html:-webkit-full-screen #tab-evaluacion .impacto-card canvas{
  height:415px !important;
  max-height:415px !important;
}

/* ---------------- FULLSCREEN SOLO VOTO ---------------- */

/* Ajustes exclusivos de fullscreen para Voto */
html:fullscreen #tab-voto,
html:-webkit-full-screen #tab-voto{
  min-height:0 !important;
}

html:fullscreen #tab-voto .charts-grid.one,
html:-webkit-full-screen #tab-voto .charts-grid.one{
  gap:16px;
  margin-top:14px;
}

html:fullscreen #tab-voto .charts-grid.one .chart-card:first-child,
html:-webkit-full-screen #tab-voto .charts-grid.one .chart-card:first-child{
  min-height:430px !important;
}

html:fullscreen #tab-voto .charts-grid.one .chart-card:first-child canvas,
html:-webkit-full-screen #tab-voto .charts-grid.one .chart-card:first-child canvas{
  height:700px !important;
  max-height:635px !important;
}

html:fullscreen #tab-voto .charts-grid.one .chart-card:last-child,
html:-webkit-full-screen #tab-voto .charts-grid.one .chart-card:last-child{
  min-height:430px !important;
}

html:fullscreen #tab-voto .charts-grid.one .chart-card:last-child canvas,
html:-webkit-full-screen #tab-voto .charts-grid.one .chart-card:last-child canvas{
  height:700px !important;
  max-height:635px !important;
}

@media (max-width: 1450px){
  #tab-overview .kpi-grid{
    grid-template-columns:repeat(4, minmax(0, 1fr));
  }

}

@media (max-width: 1180px){

  #tab-overview .kpi-grid{
    grid-template-columns:repeat(3, minmax(0, 1fr));
    grid-auto-rows:minmax(200px, auto);
  }

  #tab-overview .kpi{
    min-height:200px;
  }
}

@media (max-width: 820px){

  #tab-overview .kpi-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:16px;
    grid-auto-rows:minmax(185px, auto);
  }

  #tab-overview .kpi{
    min-height:185px;
    padding:20px 16px;
  }

  .filters{
    margin-top:88px;
  }

  .fullscreen-btn{
    width:70px;
    height:70px;
    font-size:28px;
    top:12px;
    right:12px;
  }

  .side-logo{
    top:16px;
    left:18px;
    width:120px;
    height:42px;
  }
}

@media (max-width: 560px){

  #tab-overview .kpi-grid{
    grid-template-columns:1fr;
    gap:14px;
    grid-auto-rows:minmax(170px, auto);
  }

  #tab-overview .kpi{
    min-height:170px;
    padding:18px 14px;
  }

  .kpi .val{
    font-size:clamp(36px, 11vw, 48px);
  }

  .kpi .lbl{
    font-size:13px;
  }

  .filters{
    margin-top:78px;
    padding:12px;
  }

  .side-logo{
    top:14px;
    left:16px;
    width:104px;
    height:36px;
  }

  .fullscreen-btn{
    width:56px;
    height:56px;
    font-size:24px;
    top:10px;
    right:10px;
  }
}

@media (min-width: 1800px){
  .app{
    max-width:1760px;
  }

  .side-logo{
    left:34px;
    width:160px;
    height:58px;
  }

  .fullscreen-btn{
    top:18px;
    right:18px;
  }

  #tab-overview .kpi-grid{
    grid-template-columns:repeat(5, minmax(0, 1fr));
    grid-auto-rows:minmax(230px, auto);
  }
}

@media (max-width: 1100px){
  #tab-economia .charts-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "siteco siteco6"
      "prestamos prestamos"
      "rumbo rumbo";
    gap:18px;
  }

  #tab-economia .charts-grid .chart-card:nth-child(1),
  #tab-economia .charts-grid .chart-card:nth-child(2){
    min-height:360px;
  }

  #tab-economia .charts-grid .chart-card:nth-child(3),
  #tab-economia .charts-grid .chart-card:nth-child(4){
    min-height:400px;
  }

  #tab-economia .charts-grid .chart-card:nth-child(1) canvas,
  #tab-economia .charts-grid .chart-card:nth-child(2) canvas{
    height:280px !important;
    max-height:280px !important;
  }

  #tab-economia .charts-grid .chart-card:nth-child(3) canvas,
  #tab-economia .charts-grid .chart-card:nth-child(4) canvas{
    height:300px !important;
    max-height:300px !important;
  }
}

@media (max-width: 820px){
  #tab-economia .metric-card{
    min-height:auto;
    padding:20px 16px 18px;
  }

  #tab-economia .ipe-title{
    font-size:12px;
  }

  #tab-economia .ipe-value{
    font-size:52px;
    margin:6px 0 12px;
  }

  #tab-economia .ipe-bar{
    height:16px;
  }

  #tab-economia .ipe-scale{
    font-size:11px;
  }

  #tab-economia .ipe-zones{
    font-size:10px;
    line-height:1.15;
  }

  #tab-economia .ipe-zones span{
    padding:0 4px;
  }

  #tab-economia .charts-grid{
    grid-template-columns:1fr;
    grid-template-areas:
      "siteco"
      "siteco6"
      "prestamos"
      "rumbo";
    gap:16px;
  }

  #tab-economia .charts-grid .chart-card{
    padding:16px;
  }

  #tab-economia .charts-grid .chart-card:nth-child(1),
  #tab-economia .charts-grid .chart-card:nth-child(2){
    min-height:340px;
  }

  #tab-economia .charts-grid .chart-card:nth-child(3),
  #tab-economia .charts-grid .chart-card:nth-child(4){
    min-height:360px;
  }

  #tab-economia .charts-grid .chart-card:nth-child(1) canvas,
  #tab-economia .charts-grid .chart-card:nth-child(2) canvas{
    height:250px !important;
    max-height:250px !important;
  }

  #tab-economia .charts-grid .chart-card:nth-child(3) canvas,
  #tab-economia .charts-grid .chart-card:nth-child(4) canvas{
    height:260px !important;
    max-height:260px !important;
  }
}

@media (max-width: 560px){
  #tab-economia .metric-card{
    padding:18px 14px 16px;
  }

  #tab-economia .ipe-title{
    font-size:11px;
    letter-spacing:.4px;
  }

  #tab-economia .ipe-value{
    font-size:42px;
    margin:6px 0 10px;
  }

  #tab-economia .ipe-meter{
    margin-top:14px;
  }

  #tab-economia .ipe-bar{
    height:14px;
  }

  #tab-economia .ipe-scale{
    margin-top:8px;
    font-size:10px;
  }

  #tab-economia .ipe-zones{
    margin-top:6px;
    font-size:8.5px;
    line-height:1.1;
  }

  #tab-economia .ipe-zones span{
    padding:0 2px;
  }

  #tab-economia .chart-card h3{
    font-size:12px;
    line-height:1.25;
    margin-bottom:10px;
  }

  #tab-economia .charts-grid .chart-card:nth-child(1),
  #tab-economia .charts-grid .chart-card:nth-child(2){
    min-height:310px;
  }

  #tab-economia .charts-grid .chart-card:nth-child(3),
  #tab-economia .charts-grid .chart-card:nth-child(4){
    min-height:340px;
  }

  #tab-economia .charts-grid .chart-card:nth-child(1) canvas,
  #tab-economia .charts-grid .chart-card:nth-child(2) canvas{
    height:220px !important;
    max-height:220px !important;
  }

  #tab-economia .charts-grid .chart-card:nth-child(3) canvas,
  #tab-economia .charts-grid .chart-card:nth-child(4) canvas{
    height:230px !important;
    max-height:230px !important;
  }
}
