/* =========================================================
   PROYECCIÓN CONSULTORES — DASHBOARD + MICROSITIO THEME
========================================================= */

:root{
  --bg:#1A1A1A;
  --bg-soft:#141414;
  --bg-deep:#050505;
  --panel:rgba(20,20,20,.82);
  --text:#ffffff;
  --muted:rgba(255,255,255,.68);
  --stroke:rgba(255,255,255,.12);
  --brand:#008FC5;
  --brand-dark:#0067A2;
  --shadow:0 18px 45px rgba(0,0,0,.38);
  --radius:10px;
  --sans:'Metropolis', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html{
  min-height:100%;
  scroll-behavior:smooth;
}

body{
  min-height:100%;
  margin:0;
  display:flex;
  flex-direction:column;
  font-family:var(--sans);
  background:#050505;
  color:var(--text);
  overflow-x:hidden;
  overflow-y:auto;
  -webkit-font-smoothing:antialiased;
  text-rendering:geometricPrecision;
}

body::before,
body::after{
  display:none !important;
}

*::selection{
  background:rgba(0,143,197,.35);
  color:#fff;
}

/* =========================================================
   STORY / MICROSITIO
========================================================= */

.story-container{
  width:min(1180px, calc(100% - 48px));
  margin:0 auto;
}

.story-hero{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  color:#fff;
  background:
    radial-gradient(circle at 50% 42%, rgba(0,143,197,.30), transparent 34%),
    radial-gradient(circle at 50% 100%, rgba(0,143,197,.12), transparent 35%),
    linear-gradient(180deg, #020202 0%, #050505 100%);
  position:relative;
  overflow:hidden;
}

.story-hero::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:1px;
  background:rgba(255,255,255,.12);
}

.story-hero-inner{
  max-width:950px;
}

.eyebrow{
  color:var(--brand);
  text-transform:uppercase;
  letter-spacing:4px;
  font-size:.90rem;
  font-weight:700;
  margin-bottom:28px;
}

.story-hero h1{
  font-size:clamp(4rem, 8vw, 7.5rem);
  line-height:.88;
  letter-spacing:-5px;
  font-weight:800;
  margin:0 0 34px;
}

.hero-lead{
  max-width:720px;
  margin:0 auto;
  color:rgba(255,255,255,.76);
  font-size:1.24rem;
  line-height:1.7;
}

.story-block{
  min-height:86vh;
  display:flex;
  align-items:center;
  color:#fff;
  background: #050505;
  position:relative;
  overflow:hidden;
}

.story-centered{
  text-align:center;
}

.story-centered h2{
  max-width:1050px;
  margin:0 auto 24px;
  font-size:clamp(2.6rem, 5vw, 5rem);
  line-height:1.05;
  font-weight:300;
  letter-spacing:-2px;
}

.story-centered > p:not(.eyebrow){
  max-width:860px;
  margin:0 auto;
  color:rgba(255,255,255,.68);
  font-size:1.15rem;
  line-height:1.8;
}

.story-stats{
  margin-top:76px;
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:0;
  width:100%;
}

.story-stat{
  min-height:170px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:28px 20px;
}

.story-stat:last-child{
  border-right:0;
}

.story-stat strong{
  display:block;
  font-size:clamp(2.8rem, 5vw, 4.8rem);
  line-height:1;
  font-weight:700;
  letter-spacing:-2px;
  color:#fff;
}

.story-stat span{
  margin-top:14px;
  color:rgba(255,255,255,.62);
  font-size:.92rem;
  letter-spacing:.4px;
}

.scenario-banner{
  min-height:86vh;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  color:#fff;
  background:
    radial-gradient(circle at center, rgba(0,143,197,.34), transparent 35%),
    linear-gradient(180deg, #050505 0%, #030303 100%);
  position:relative;
}

.scenario-banner h2{
  font-size:clamp(3rem, 6vw, 6rem);
  font-weight:300;
  letter-spacing:-3px;
  margin:0 0 20px;
}

.scenario-banner p{
  max-width:700px;
  margin:0 auto 38px;
  color:rgba(255,255,255,.68);
  font-size:1.15rem;
  line-height:1.7;
}

.story-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:58px;
  padding:0 34px;
  background:var(--brand);
  color:#fff;
  text-decoration:none;
  text-transform:uppercase;
  letter-spacing:1.5px;
  font-size:.84rem;
  font-weight:700;
  transition:.22s ease;
}

.story-btn:hover{
  background:var(--brand-dark);
  color:#fff;
}

.scroll-indicator{
  margin-top:28px;
  color:var(--brand);
  font-size:2rem;
  line-height:1;
  animation:scrollPulse 1.6s ease-in-out infinite;
}

.scroll-link{
  text-decoration:none;
}

@keyframes scrollPulse{
  0%,100%{
    opacity:.45;
    transform:translateY(0);
  }
  50%{
    opacity:1;
    transform:translateY(8px);
  }
}

.lab-section{
  min-height:100vh;
  padding:90px 0 40px;
  background:#050505;
  position:relative;
}

/* =========================================================
   DASHBOARD BASE
========================================================= */

.app{
  position:relative;
  z-index:1;
  flex:1;
  display:flex;
  flex-direction:column;
  width:100%;
  max-width:1600px;
  margin:0 auto;
  padding:0 40px 32px;
}

.filters,
.panel,
.metric-card,
.chart-card,
.kpi{
  border-radius:var(--radius);
  border:1px solid var(--stroke);
  background:linear-gradient(180deg, rgba(26,26,26,.92), rgba(15,15,15,.88));
  box-shadow:var(--shadow);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}

.panel{
  padding:18px;
}

.metric-card{
  padding:26px 24px;
}

.chart-card{
  border-radius:10px;
  padding:20px;
}

.kpi{
  border-radius:10px;
}

.chart-card h3,
.ipe-title,
.kpi .lbl{
  color:#fff;
  font-family:var(--sans);
  font-weight:400;
  letter-spacing:1px;
  text-transform:uppercase;
}

.chart-card h3{
  font-size:13px;
  line-height:1.35;
  margin-bottom:14px;
}

.ipe-title{
  font-size:13px;
  letter-spacing:1.1px;
  opacity:.76;
}

.kpi .lbl{
  font-weight:600;
  opacity:.74;
}

.kpi .val,
.ipe-value{
  color:#fff;
  letter-spacing:-1px;
}

.kpi.top3 .val,
.kpi.top3:nth-child(1) .val,
.kpi.top3:nth-child(2) .val,
.kpi.top3:nth-child(3) .val{
  color:var(--brand);
}

.kpi::after{
  background:radial-gradient(circle, rgba(0,143,197,.22), transparent 70%);
}

.kpi:hover,
.chart-card:hover{
  border-color:rgba(0,143,197,.65);
  box-shadow:
    0 18px 45px rgba(0,0,0,.42),
    0 0 0 1px rgba(0,143,197,.25);
}

/* =========================================================
   DASHBOARD FILTERS BASE — visual legacy/fallback
========================================================= */

.filters{
  margin-top:96px;
  padding:28px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(26,26,26,.96), rgba(15,15,15,.94));
  box-shadow:0 18px 45px rgba(0,0,0,.35);
  position:relative;
  overflow:hidden;
}

.filters::before{
  content:"";
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:3px;
  background:var(--brand);
}

#datasetRow{
  display:grid;
  grid-template-columns:repeat(2,minmax(220px,280px));
  gap:20px;
  margin-bottom:26px;
  padding-bottom:24px;
  border-bottom:1px solid rgba(255,255,255,.08);
}

#filtersRow{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:20px;
}

.filter-group{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.filter-title{
  color:#9c9c9c;
  font-size:.72rem;
  font-weight:500;
  letter-spacing:2px;
  text-transform:uppercase;
}

select,
.filter-box{
  height:52px;
  padding:0 16px;
  background:#101010;
  border:1px solid rgba(255,255,255,.12);
  border-radius:0;
  color:white;
  font-size:.95rem;
  transition:.2s;
}

select:hover,
select:focus{
  border-color:var(--brand);
  outline:none;
}

select:focus{
  box-shadow:0 0 0 1px rgba(0,143,197,.25);
}

.filters-actions{
  margin-top:28px;
  justify-content:flex-end;
}

.btn.ghost{
  height:50px;
  padding:0 22px;
  background:transparent;
  border:1px solid rgba(255,255,255,.14);
  color:white;
  border-radius:0;
  text-transform:uppercase;
  letter-spacing:1px;
  font-size:.8rem;
  transition:.2s;
}

.btn.ghost:hover{
  background:var(--brand);
  border-color:var(--brand);
}

/* =========================================================
   TABS
========================================================= */

.tabs{
  margin-top:16px;
  gap:10px;
}

.tab{
  border-radius:0;
  border:1px solid rgba(255,255,255,.18);
  background:transparent;
  color:#fff;
  padding:11px 16px;
  cursor:pointer;
  font-family:var(--sans);
  font-size:.82rem;
  font-weight:500;
  letter-spacing:.5px;
  text-transform:uppercase;
  transition:.2s ease;
}

.tab:hover{
  border-color:var(--brand);
  color:var(--brand);
  transform:translateY(-1px);
}

.tab.active{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}

.chart-filter-chip{
  border-radius:0;
  border:1px solid rgba(0,143,197,.45);
  background:rgba(0,143,197,.12);
  color:#fff;
}

/* =========================================================
   CHARTS / METERS
========================================================= */

.content{
  margin-top:16px;
}

.charts-grid{
  gap:20px;
}

.chart-card canvas{
  max-width:100%;
}

.ipe-value{
  font-size:64px;
  font-weight:800;
}

.ipe-bar{
  height:18px;
  border-radius:0;
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,.48),
    0 0 18px rgba(0,0,0,.35);
}

.ipe-pointer{
  background:#fff;
  border:2px solid var(--brand);
  box-shadow:0 0 10px rgba(0,143,197,.55);
}

.ipe-scale,
.ipe-zones{
  color:rgba(255,255,255,.72);
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media(max-width:1100px){
  .chart-active-filters{
    width:100%;
    justify-content:flex-start;
    margin-left:0;
    margin-top:8px;
  }
}

@media(max-width:980px){
  .app{
    padding:0 28px 30px;
  }

  .filters{
    padding:22px;
  }

  #datasetRow,
  #filtersRow{
    grid-template-columns:1fr;
  }

  .filters-actions{
    justify-content:stretch;
  }

  .btn.ghost{
    width:100%;
  }

  #tab-overview,
  #tab-economia,
  #tab-evaluacion,
  #tab-imagen,
  #tab-voto{
    min-height:auto !important;
  }
}

@media(max-width:900px){
  .story-stats{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .story-stat:nth-child(2){
    border-right:0;
  }

  .story-stat:nth-child(1),
  .story-stat:nth-child(2){
    border-bottom:1px solid rgba(255,255,255,.10);
  }
}

@media(max-width:820px){
  .app{
    padding:0 18px 28px;
  }

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

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

  .filters{
    margin-top:86px;
    padding:15px;
  }

  .tabs{
    flex-wrap:nowrap;
    overflow-x:auto;
    gap:10px;
    padding-bottom:8px;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
  }

  .tabs::-webkit-scrollbar{
    display:none;
  }

  .tab{
    flex:0 0 auto;
    white-space:nowrap;
  }

  .chart-active-filters{
    flex:0 0 100%;
    min-width:100%;
    overflow-x:auto;
    flex-wrap:nowrap;
    padding-bottom:4px;
  }

  .chart-filter-chip{
    flex:0 0 auto;
  }

  .charts-grid,
  #tab-economia .charts-grid,
  #tab-evaluacion .evaluacion-grid{
    grid-template-columns:1fr !important;
    grid-template-areas:none !important;
  }

  #tab-economia .charts-grid .chart-card,
  #tab-evaluacion .chart-card,
  #tab-voto .chart-card{
    min-height:340px;
  }

  #tab-economia .charts-grid .chart-card,
  #tab-evaluacion .evagob-card,
  #tab-evaluacion .capacidad-card,
  #tab-evaluacion .impacto-card{
    grid-column:auto !important;
    grid-row:auto !important;
    grid-area:auto !important;
  }
}

@media(max-width:600px){

  .story-hero{
    min-height:120svh;
    height:auto;
    padding:80px 20px 70px;
    overflow:visible;
    border:0;
  }

  .story-block{
    display:block;
    min-height:auto;
    height:auto;
    padding:90px 0;
    overflow:visible;
  }

  .story-centered{
    display:block;
  }

  .story-centered h2{
    font-size:clamp(2.2rem, 12vw, 3.4rem);
    line-height:1.05;
    margin-bottom:22px;
  }

  .story-centered > p:not(.eyebrow){
    font-size:.95rem;
    line-height:1.7;
  }

  .story-stats{
    margin-top:56px;
    grid-template-columns:1fr;
  }

    .tabs{

    display:grid;

    grid-template-columns:1fr 1fr;

    gap:10px;

    overflow:visible;

    justify-content:stretch;

  }

  .tab{
    min-width:unset;
    width:100%;
    height:54px;
    padding:0 10px;
    font-size:.65rem;
    line-height:1.2;
  }
}

@media(max-width:560px){
  .app{
    padding:0 14px 24px;
  }

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

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

  .filters{
    margin-top:74px;
    padding:13px;
  }

  .panel{
    padding:13px;
  }

  .chart-card{
    padding:16px 12px;
  }

  .tab{
    font-size:.72rem;
    padding:10px 13px;
    letter-spacing:.35px;
  }

  .ipe-title{
    font-size:11px;
  }

  .ipe-value{
    font-size:42px;
  }

  .ipe-zones{
    font-size:8px;
    line-height:1.15;
  }

  .chart-card h3{
    font-size:11.5px;
    line-height:1.28;
  }

  #tab-overview .kpi-grid{
    grid-template-columns:1fr;
    gap:14px;
  }

  .story-hero .eyebrow{
    margin-top:120px;
  }
}

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

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

.tabs{
  display:flex;
  justify-content:center;   /* CENTRADO */
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  margin:40px auto 30px;
  width:100%;
}

.tab{
  min-width:180px;
  height:62px;

  padding:0 28px;

  border:1px solid rgba(255,255,255,.18);
  border-radius:0;

  background:transparent;
  color:rgba(255,255,255,.88);

  font-size:.88rem;
  font-weight:500;
  letter-spacing:.8px;
  text-transform:uppercase;

  transition:
    background .25s ease,
    border-color .25s ease,
    transform .25s ease;
}

.tab:hover{
  border-color:#008FC5;
  color:#fff;
}

.tab.active{
  background:#008FC5;
  border-color:#008FC5;
  color:#fff;

  box-shadow:
    0 0 25px rgba(0,143,197,.22);
}

/* ===== OVERVIEW KPI GRID ===== */

#tab-overview .kpi-grid{
  grid-template-columns:repeat(5, minmax(0, 1fr)) !important;
  gap:18px !important;
}

#tab-overview .kpi{
  min-height:190px !important;
  padding:22px 14px !important;
}

#tab-overview .kpi .val{
  font-size:clamp(2.6rem, 3.6vw, 4rem) !important;
}

#tab-overview .kpi .lbl{
  font-size:.78rem !important;
}

/* responsive */
@media(max-width:1200px){
  #tab-overview .kpi-grid{
    grid-template-columns:repeat(4, minmax(0, 1fr)) !important;
  }
}

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

@media(max-width:560px){
  #tab-overview .kpi-grid{
    grid-template-columns:1fr !important;
  }
}

