:root{
  --card-radius: 16px;
  --soft-border: rgba(0,0,0,.08);
  --shadow-1: 0 8px 22px rgba(16,24,40,.08);
  --shadow-2: 0 14px 30px rgba(16,24,40,.10);
}

body.bg-light{
  background: #f6f8fb !important;
}

/* Top bar */
.navbar{
  box-shadow: var(--shadow-1);
  border-bottom: 1px solid var(--soft-border);
}

.container-fluid.py-3{
  max-width: 1680px;
}

/* Cards */
.card{
  border-radius: var(--card-radius);
  border: 1px solid var(--soft-border);
  box-shadow: var(--shadow-1);
}

.card .card-header{
  background: #fff;
  border-bottom: 1px solid var(--soft-border);
  border-top-left-radius: var(--card-radius);
  border-top-right-radius: var(--card-radius);
}

.card-title{
  letter-spacing: .2px;
}

/* KPI tiles */
.kpiBox{
  border: 1px solid var(--soft-border);
  border-radius: 14px;
  padding: 14px 14px;
  background: #fff;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* barra superior sutil (color por tipo de KPI) */
.kpiBox::before{
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 4px;
  width: 100%;
  background: rgba(2, 132, 199, .35);
}

.kpiDenBox{ background: linear-gradient(180deg, rgba(59,130,246,.08) 0%, #ffffff 55%); }
.kpiDenBox::before{ background: rgba(59,130,246,.75); }

.kpiNumBox{ background: linear-gradient(180deg, rgba(16,185,129,.08) 0%, #ffffff 55%); }
.kpiNumBox::before{ background: rgba(16,185,129,.75); }

.kpiAvanceBox{ background: linear-gradient(180deg, rgba(14,165,233,.10) 0%, #ffffff 55%); }
.kpiAvanceBox::before{ background: rgba(14,165,233,.80); }

.kpiMetaBox{ background: linear-gradient(180deg, rgba(99,102,241,.10) 0%, #ffffff 55%); }
.kpiMetaBox::before{ background: rgba(99,102,241,.80); }

.kpiCumplBox{ background: linear-gradient(180deg, rgba(245,158,11,.10) 0%, #ffffff 55%); }
.kpiCumplBox::before{ background: rgba(245,158,11,.85); }
.kpiLabel{
  font-size: 12px;
  color: #6c757d;
}
.kpiValue{
  font-size: 24px;
  font-weight: 800;
  letter-spacing: .2px;
  margin-top: 2px;
}

/* KPI barra (reemplaza radial: más legible y exportable) */
.kpiProgressSm{
  border: 1px solid var(--soft-border);
  border-radius: 12px;
  padding: 6px 8px;
  background: linear-gradient(180deg, rgba(2,132,199,.06) 0%, #ffffff 60%);
  height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.kpiProgressSm::before{
  content: '';
  position: absolute;
  left: 0; top: 0;
  height: 4px; width: 100%;
  background: rgba(2,132,199,.75);
}
.kpiProgressSm::before{
  content: '';
  position: absolute;
  left: 0; top: 0;
  height: 4px; width: 100%;
  background: rgba(2,132,199,.75);
}
.kpiProgressTitle{ line-height: 1.1; }
.kpiProgressBar{
  height: 12px;
  border-radius: 999px;
  background: rgba(226,232,240,1);
  overflow: hidden;
  border: 1px solid var(--soft-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.kpiProgressFill{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: rgba(34,197,94,1);
  transition: width .6s ease;
}
.kpiProgressFoot{
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
  font-weight: 700;
}
.kpiProgressPct{ font-size: 12px; }

/* Filters row (responsive) */
.filtersRow{
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}
.filtersActions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 1200px){
  .filtersRow{
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}
@media (max-width: 576px){
  .filtersRow{
    grid-template-columns: 1fr;
  }
  .kpiValue{ font-size: 20px; }
}

/* Charts layout */
.chartWrap{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}
.chartWrap.single{
  grid-template-columns: 1fr;
}
.chartPanel{
  border: 1px solid var(--soft-border);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  /* Un poco más alto para que se aprecien barras/etiquetas sin ocupar media pantalla */
  min-height: 340px;
}
.chartPanel canvas{
  width: 100% !important;
  height: 100% !important;
}

/* Drill-down (Provincia -> Distritos) */
.drillWrap{
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 12px;
}
.drillWrap.drill{
  /* Drilldown: mini-panel de provincia (15%) + distritos (85%) */
  grid-template-columns: minmax(240px, 15%) 1fr;
  align-items: start;
}

/* Tarjeta gerencial de provincia (cuando hay provincia seleccionada) */
.provSummary{
  border: 1px solid var(--soft-border);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  min-height: 320px;
}
.provSummaryTitle{
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 8px;
}
.provSummaryGrid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.provMetric{
  border: 1px solid var(--soft-border);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}
.provMetricLabel{ font-size: 12px; color: #6c757d; }
.provMetricValue{ font-size: 18px; font-weight: 800; margin-top: 2px; }
.provMetricDen{ color: #2563eb; }
.provMetricNum{ color: #db2777; }
.provBarHeader{ display: flex; justify-content: space-between; align-items: center; }
.provBarPct{ font-weight: 800; }
.provBar{
  margin-top: 6px;
  height: 14px;
  border-radius: 999px;
  background: rgba(226,232,240,1);
  border: 1px solid var(--soft-border);
  overflow: hidden;
}
.provBarFill{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: rgba(34,197,94,1);
  transition: width .6s ease;
}

/* En modo drill-down, el panel de provincia necesita MÁS altura para que NO se vea aplastado */
/* (+15% aprox vs versión anterior) */
.drillWrap.drill #provPanel{ min-height: 360px; }
.drillWrap.drill #provPanel .chartPanel{ min-height: 340px; }
.drillWrap.drill #provPanel .chartPanel canvas{ height: 260px !important; }

/* Animaciones sutiles para drill-down */
@keyframes panelPulse{
  0%{ box-shadow: var(--shadow-1); transform: translateY(0); }
  40%{ box-shadow: var(--shadow-2); transform: translateY(-2px); }
  100%{ box-shadow: var(--shadow-1); transform: translateY(0); }
}
.panelPulse{ animation: panelPulse .65s ease-out; }

@keyframes panelEnter{
  0%{ opacity: 0; transform: translateY(10px); }
  100%{ opacity: 1; transform: translateY(0); }
}
.panelEnter{ animation: panelEnter .35s ease-out; }
.chartPanelInner{
  border: 1px solid var(--soft-border);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  min-height: 360px;
}
.chartPanelInner canvas{
  width: 100% !important;
  height: 100% !important;
}

/* Serie por periodo: gráfico 75% y tabla 25% (desktop) */
@media (min-width: 992px){
  .serieRow{ display:flex; }
  .serieRow > [class*='col-']{ flex: 0 0 auto; }
  .serieColChart{ flex-basis: 75% !important; max-width: 75% !important; }
  .serieColTable{ flex-basis: 25% !important; max-width: 25% !important; }
}

/* Serie por periodo: más compacto en altura (similar a primer gráfico) */
.serieChartInner{
  min-height: 320px;
  max-height: 340px;
}

/* KPI row (moved below charts) */
.kpiRow{
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr)) minmax(240px, 1.1fr);
  gap: 12px;
  align-items: stretch;
}

/* KPI compacto debajo de filtros (para maximizar área de gráficos) */
.kpiCompactRow{
  display: grid;
  grid-template-columns: repeat(5, minmax(92px, 1fr)) minmax(180px, 1fr);
  gap: 8px;
  align-items: stretch;
}
.kpiBoxSm{ padding: 6px 8px; border-radius: 12px; }
.kpiValueSm{ font-size: 16px; }
.kpiGaugeSm{ display:none; }

@media (max-width: 1200px){
  .kpiCompactRow{ grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .kpiProgressSm{ height: 90px; }
}
@media (max-width: 576px){
  .kpiCompactRow{ grid-template-columns: 1fr; }
}
.kpiGauge{
  height: 120px;
}

@media (max-width: 1200px){
  .drillWrap.drill{display:grid;grid-template-columns:1fr;gap:16px;align-items:start;}
  .kpiRow{ grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .kpiGauge{ height: 140px; }
}
@media (max-width: 576px){
  .kpiRow{ grid-template-columns: 1fr; }
}

@media (max-width: 1200px){
  .chartWrap{ grid-template-columns: 1fr; }
  .chartPanel{ min-height: 360px; }
}
@media (max-width: 576px){
  .chartPanel{ min-height: 320px; }
}

/* Tables */
.table-responsive{
  border-radius: 14px;
  border: 1px solid var(--soft-border);
  background: #fff;
  box-shadow: var(--shadow-1);
}
.table-hover tbody tr{ cursor: pointer; }
#apiError{ white-space: pre-wrap; }

#tblProvincia thead th,
#tblDistrito thead th{
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}

/* Subtle section separators */
.sectionDivider{
  height: 1px;
  background: var(--soft-border);
  margin: 8px 0;
}


/* --- Table badges (gerencial) --- */
.badge-pill{
  display:inline-block;
  padding:.18rem .45rem;
  font-size:.90rem;
  border-radius:999px;
  font-weight:700;
  font-variant-numeric: tabular-nums;
  letter-spacing:.2px;
  border:1px solid rgba(0,0,0,.06);
}
.badge-neutral{ background:#f3f4f6; color:#111827; }
.badge-good{ background:#e8fff3; color:#0f5132; }
.badge-warn{ background:#fff7e6; color:#7a4b00; }
.badge-bad{ background:#ffe8ea; color:#842029; }
.badge-total{ background:#e7f0ff; color:#0b3d91; }
.badge-meta{ background:#eef2ff; color:#1f2937; }

tr.row-total td{
  background: linear-gradient(90deg, rgba(231,240,255,.65), rgba(255,255,255,0));
}
tr.row-total td:nth-child(2){
  font-weight:800;
}


/* Compact horizontal filters */
.filtersBar{
  display:flex;
  flex-wrap:wrap;
  gap:8px 10px;
  align-items:flex-end;
}
.filterItem{
  min-width: 120px;
}
.filterWide{
  min-width: auto;
}
.filtersBtns{
  margin-left:auto;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:flex-end;
}
.filtersBar .form-label{
  margin-bottom: 4px;
  font-size: .85rem;
  color: rgba(0,0,0,.75);
}
@media (max-width: 992px){
  .filtersBtns{ margin-left:0; width:100%; }
  .filterItem, .filterWide{ flex: 1 1 180px; }
}


/* Home cards */
.card-hover{ transition: transform .12s ease, box-shadow .12s ease; }
.card-hover:hover{ transform: translateY(-2px); box-shadow: var(--shadow-2); }

.miniChartWrap{ position: relative; height: 120px; }

/* Home mini charts (donut + barras) */
.miniChartsRow{
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.miniDonut{
  position: relative;
  flex: 0 0 130px;
  height: 130px;
}
.miniDonut canvas{ width: 100% !important; height: 100% !important; }

.miniBars{
  flex: 1 1 auto;
  min-width: 0;
  border-left: 1px dashed rgba(148,163,184,.45);
  padding-left: 12px;
}
.miniBarsTitle{
  font-size: .76rem;
  font-weight: 700;
  color: rgba(15,23,42,.70);
  margin-bottom: 6px;
}
.miniBars canvas{ width: 100% !important; height: 100px !important; }

@media (max-width: 576px){
  .miniChartsRow{ flex-direction: column; }
  .miniDonut{ flex: 0 0 auto; width: 100%; height: 150px; }
  .miniBars{ border-left: 0; padding-left: 0; border-top: 1px dashed rgba(148,163,184,.45); padding-top: 10px; }
  .miniBars canvas{ height: 120px !important; }
}
.miniChartCenter{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  pointer-events:none;
}
.miniCenterBig{
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .2px;
}
.miniCenterSmall{
  font-size: .78rem;
  color: rgba(0,0,0,.60);
}

.miniKpi{
  border: 1px solid var(--soft-border);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255,255,255,.7);
  min-width: 86px;
  text-align:right;
}
.miniKpiLabel{ font-size:.72rem; color: rgba(0,0,0,.55); line-height:1; }
.miniKpiValue{ font-weight:800; font-size: .95rem; line-height:1.2; }


/* --- UI compact + gerencial (v5) --- */
.drillWrap{ gap: 14px; transition: all .25s ease; }
.chartPanel{
  box-shadow: 0 10px 22px rgba(15,23,42,.06);
}
#provPanel{ min-height: 345px; }
#provPanel canvas{ height: 300px !important; }
#distPanel{ min-height: 360px; }
#distPanel canvas{ height: 310px !important; }

/* Animaciones sutiles (no agrandar) */
.panelPulse{
  animation: panelPulseSoft .55s ease-out;
}
@keyframes panelPulseSoft{
  0%{ box-shadow: 0 10px 22px rgba(15,23,42,.06); transform: translateY(0); }
  40%{ box-shadow: 0 16px 34px rgba(59,130,246,.16); transform: translateY(-2px); }
  100%{ box-shadow: 0 10px 22px rgba(15,23,42,.06); transform: translateY(0); }
}
.panelEnter{
  animation: panelEnterSoft .28s ease-out;
}
@keyframes panelEnterSoft{
  0%{ opacity: 0; transform: translateY(6px); }
  100%{ opacity: 1; transform: translateY(0); }
}



/* --- OVERRIDE v10: mejorar legibilidad panel provincia en drill-down --- */
#provPanel{ min-height: 360px !important; }
#provPanel canvas{ height: 300px !important; }

.drillWrap.drill #provPanel{ min-height: 360px !important; }
.drillWrap.drill #provPanel .chartPanel{ min-height: 340px !important; }
.drillWrap.drill #provPanel .chartPanel canvas{ height: 260px !important; }

/* KPI más compacto aún (para liberar área de charts) */
.kpiCompactRow{ gap: 10px !important; }
.kpiBoxSm{ padding: 6px 8px !important; }
.kpiValueSm{ font-size: 15px !important; }
.kpiGaugeSm{ height: 66px !important; }


/* Scroller para charts con muchas categorías (IPRESS) */
.chartScroller{
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
}
.chartScroller canvas{
  display: block;
  width: 100%;
  margin: 0 auto;
  height: 340px !important;
}

/* Variante explícita para paneles que deben ocupar toda la fila (ej. IPRESS) */
.chartScrollerWide{
  width: 100%;
}

/* Tablas más gerenciales */
.tableHover tbody tr:hover{
  background: rgba(59,130,246,.08);
  cursor: pointer;
}
.tableSticky thead th{
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
  box-shadow: 0 1px 0 rgba(0,0,0,.06);
}

/* Tabla jerárquica (Provincia -> Distrito -> IPRESS) */
#tblHier td{ vertical-align: middle; }
.hier-indent-1{ padding-left: 18px !important; }
.hier-indent-2{ padding-left: 36px !important; }


/* =======================
   Gerencial UI (DIRESA)
   ======================= */
.appNav{
  background: linear-gradient(90deg, rgba(2,132,199,1) 0%, rgba(14,165,233,1) 50%, rgba(59,130,246,1) 100%);
  box-shadow: 0 10px 30px rgba(2,6,23,.15);
}
.brandLogo{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255,255,255,.9);
  padding: 4px;
}
.brandTitle{
  font-weight: 700;
  letter-spacing: .2px;
}

.heroCard{
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(2,6,23,.08);
  border: 1px solid rgba(148,163,184,.28);
}
.heroBg{
  position:absolute;
  inset:0;
  /* Fondo limpio (sin “sombra”/banda lateral) */
  background: #ffffff;
  opacity: 1;
}
.heroInner{
  position: relative;
  padding: 14px 16px;
}
.heroTitle{
  margin: 0;
  font-weight: 850;
  letter-spacing: .2px;
}
.heroKicker{
  font-size: 12px;
  color: rgba(15,23,42,.70);
  font-weight: 650;
  letter-spacing: .6px;
  text-transform: none;
}
.heroSub{
  margin-top: 4px;
  color: rgba(15,23,42,.70);
}
.heroBadge{
  min-width: auto;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(148,163,184,.28);
  border-radius: 999px;
  padding: 8px 12px;
}
.heroBadgeLabel{
  font-size: 12px;
  color: rgba(15,23,42,.65);
  font-weight: 700;
}
.heroBadgeValue{
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 2px;
}
.heroBadgeHint{
  color: rgba(15,23,42,.60);
}

.kpiCard{
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.35);
  box-shadow: 0 12px 30px rgba(2,6,23,.08);
}
.kpiCardTitle{
  font-weight: 700;
  color: rgba(15,23,42,.92);
  line-height: 1.2;
}
.pillMeta{
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.35);
  background: rgba(248,250,252,.8);
  font-size: 12px;
}
.progressSlim{
  height: 8px;
  border-radius: 999px;
  background: rgba(148,163,184,.25);
}
.progressSlim .progress-bar{
  border-radius: 999px;
}




/* ============================
   HOME - Infografía SVG
   ============================ */
.infoCard{
  border: 1px solid var(--soft-border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(2,6,23,.06);
}
.infoCardHeader{
  padding: 14px 18px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.85);
}
.infoTitle{
  font-weight: 800;
  letter-spacing: .2px;
}
.infoCardBody{ padding: 14px; }
.infoCardFooter{
  padding: 12px 18px;
  border-top: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.90);
}
.panoramaStage{
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(15,23,42,.07);
}

.legendRow{
  display:flex;
  gap:16px;
  flex-wrap: wrap;
  align-items:center;
  font-size: 13px;
  color: rgba(17,24,39,.80);
}
.legendItem{ display:flex; gap:8px; align-items:center; }
.dot{ width:10px; height:10px; border-radius:50%; display:inline-block; }
.dot-ok{ background:#10b981; }
.dot-warn{ background:#f59e0b; }
.dot-bad{ background:#f28b82; }

#panoramaSvg{ width:100%; height: clamp(520px, 70vh, 860px); display:block; }

/* Hover suave en tarjetas SVG */
#panoramaSvg .nodeGroup{ transition: transform 220ms ease, filter 220ms ease; }
#panoramaSvg .nodeGroup:hover{ transform: translateY(-2px); }

/* SVG typography */
.svgTitle{ font-size: 24px; font-weight: 800; fill: rgba(17,24,39,.86); }
.svgSubtitle{ font-size: 14px; font-weight: 600; fill: rgba(17,24,39,.52); }

.centerKicker{ font-size: 12px; font-weight: 750; fill: rgba(255,255,255,.92); letter-spacing: .6px; }
.centerValue{ font-size: 64px; font-weight: 900; fill: #ffffff; }
.centerSub{ font-size: 13px; font-weight: 800; fill: rgba(255,255,255,.80); }
.centerTiny{ font-size: 12px; font-weight: 800; fill: rgba(255,255,255,.78); }

.nodeHeader{ font-size: 12px; font-weight: 800; letter-spacing: .4px; text-transform: none; }
.nodeHeaderBold{ font-size: 14px; font-weight: 950; }
.nodeBadge{ font-size: 12px; font-weight: 950; fill: rgba(17,24,39,.85); }
.nodeTitle2{ font-size: 14px; font-weight: 900; }
.nodeValue2{ font-size: 38px; font-weight: 900; }
.nodeLabelTiny{ font-size: 12px; font-weight: 800; }
.nodeChip2{ font-size: 13px; font-weight: 950; }



/* =========================
   FULL RESPONSIVE TUNING
   - Reduce wasted vertical space
   - Let panorama use viewport height
   - Keep smooth, light look
========================= */

/* Hero typography scales with viewport */
.heroInner{ padding: clamp(14px, 2vw, 22px); }
.heroTitle{
  font-size: clamp(30px, 3.2vw, 56px);
  line-height: 1.08;
}
.heroSub{ font-size: clamp(13px, 1.1vw, 15px); }

.heroBadge{
  min-width: min(220px, 100%);
  padding: 10px 12px;
  border-radius: 999px;
}
.heroBadgeValue{ font-size: clamp(18px, 2.0vw, 24px); }

/* Panorama: center content and use height better */
.infoCardBody{ padding: clamp(10px, 1.2vw, 14px); }
.panoramaStage{
  display:block;
}

/* When viewport is short, keep panorama compact to avoid scroll jump */
@media (max-height: 740px){
  #panoramaSvg{ height: clamp(460px, 62vh, 740px); }
}

/* Mobile: tighter spacing, stacked layout */
@media (max-width: 576px){
  .heroCard{ border-radius: 18px; }
  .heroKicker{ font-size: 11px; }
  .heroTitle{ letter-spacing: 0; }
  .infoPanel{ margin-top: .75rem !important; }
  .infoTitle{ font-size: 18px; }
  #panoramaSvg{ height: clamp(420px, 64vh, 680px); }
}

/* Large screens: use width, but don't create excessive empty top/bottom */
@media (min-width: 1200px){
  #panoramaSvg{ height: clamp(560px, 68vh, 900px); }
}


/* Home: agrupación por curso de vida */
.groupTitle{
  font-weight: 700;
  letter-spacing: .2px;
  color: rgba(12, 74, 110, .95);
}
.indCardLink{ text-decoration: none; color: inherit; display:block; }
.indCard{
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 16px;
  padding: 14px 14px 12px 14px;
  box-shadow: 0 10px 24px rgba(15,23,42,.06);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  height: 100%;
}
.indCard:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15,23,42,.10);
  border-color: rgba(14, 116, 144, .22);
}
.indCardTop{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin-bottom: 8px;
}
.indBadge{
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(14, 116, 144, .10);
  color: rgba(14, 116, 144, 1);
}
.indArrow{
  font-weight: 900;
  color: rgba(100,116,139,.9);
}
.indCardName{
  font-weight: 700;
  line-height: 1.25;
  font-size: 14px;
  color: rgba(15,23,42,.95);
  margin-bottom: 6px;
}
.indCardMeta{
  line-height: 1.2;
}

/* Curso de vida pill (SVG) */
.nodeCurso{ font-size:12px; font-weight:800; letter-spacing:.35px; }


/* CHEVRON TABLE HEADER (estilo referencia) */
.tableChevron thead th{
  background:#1f4b6e;
  color:#fff;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.06em;
  font-size:12px;
  padding:10px 14px;
  border-bottom:none !important;
  position:relative;
  white-space:nowrap;
}
.tableChevron thead tr{ background:transparent; }
.tableChevron thead th:first-child{
  color:#ff4da6;
  background:transparent;
  padding-left:0;
  text-transform:uppercase;
  font-size:12px;
  letter-spacing:.08em;
}
.tableChevron thead th:first-child::after,
.tableChevron thead th:first-child::before{
  display:none;
}
.tableChevron thead th:not(:first-child){
  border-top-left-radius:0;
  border-top-right-radius:0;
}
.tableChevron thead th:not(:first-child)::after{
  content:"";
  position:absolute;
  top:0;
  right:-18px;
  width:0; height:0;
  border-top:20px solid transparent;
  border-bottom:20px solid transparent;
  border-left:18px solid #1f4b6e;
  z-index:2;
}
.tableChevron thead th:not(:first-child)::before{
  content:"";
  position:absolute;
  top:0;
  left:0;
  width:0; height:0;
  border-top:20px solid transparent;
  border-bottom:20px solid transparent;
  border-left:18px solid #ffffff;
  z-index:1;
}
.tableChevron thead th:last-child::after{ display:none; }
.tableChevron thead th:not(:first-child){ padding-left:22px; } /* compensa corte */
.tableChevron tbody td{
  padding:8px 10px !important;
  font-size:13px;
  border-bottom:1px solid #e7eef8;
}
.tableChevron tbody tr:nth-child(even){ background:#f6f8fc; }
.tableChevron tbody tr:hover{ background:#eef4ff; }


/* =========================================================
   CHEVRON TABLE HEADER - COMPACT / SUAVE (v2)
   Solo visual: reduce altura y “tosquedad”
   ========================================================= */
.tableChevron{
  border-radius:14px;
  overflow:hidden;            /* limpia puntas */
}
.tableChevron thead th{
  font-size:11px;
  padding:6px 10px;
  letter-spacing:.05em;
}
.tableChevron thead th:not(:first-child){ padding-left:16px; }
.tableChevron thead th:not(:first-child)::after{
  right:-12px;
  border-top:14px solid transparent;
  border-bottom:14px solid transparent;
  border-left:12px solid #1f4b6e;
}
.tableChevron thead th:not(:first-child)::before{
  border-top:14px solid transparent;
  border-bottom:14px solid transparent;
  border-left:12px solid #ffffff;
}
.tableChevron tbody td{
  padding:6px 10px !important;
  font-size:12.5px;
}
.tableChevron tbody tr:nth-child(even){ background:#f7f9fd; }
.tableChevron tbody tr:hover{ background:#f0f5ff; }

/* badges dentro de tablas: más delgados */
.tableChevron .badge-pill{
  padding:2px 8px;
  font-size:12px;
  font-weight:800;
}


.tableChevron thead th:first-child{
  font-size:11px;
  padding:6px 8px 6px 0;
}



/* ==========================================================
   CLEAN COMPACT TABLE (modelo simple y suave)
   ========================================================== */
.tableClean{
  border-collapse:separate;
  border-spacing:0;
}
.tableClean thead th{
  background:#fbfcfe;
  color:#243041;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.06em;
  font-size:12px;
  padding:10px 12px;
  border-bottom:1px solid #dde5f2 !important;
  white-space:nowrap;
}
.tableClean.tableSticky thead th{
  position:sticky;
  top:0;
  z-index:3;
}
.tableClean tbody td{
  padding:8px 12px;
  border-bottom:1px solid #e7eef8;
  vertical-align:middle;
  font-size:13px;
  line-height:1.15;
}
.tableClean.tableHover tbody tr:hover{
  background:#eef4ff;
}
.tableClean tbody tr:nth-child(even){
  background:#f6f8fc;
}
.tableClean .pill{
  display:inline-flex;
  align-items:center;
  height:22px;
  padding:0 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  border:1px solid rgba(0,0,0,.06);
  box-shadow:none;
}

/* Semaforización (tablas compactas) */
.tableClean .pill.ok{ background: rgba(22,163,74,.12); color:#166534; border-color: rgba(22,163,74,.20); }
.tableClean .pill.warn{ background: rgba(245,158,11,.14); color:#92400e; border-color: rgba(245,158,11,.22); }
.tableClean .pill.bad{ background: rgba(239,68,68,.12); color:#991b1b; border-color: rgba(239,68,68,.20); }

/* Brecha a meta (Δ) */
.tableClean .delta{ font-weight:900; font-size:12px; }
.tableClean .delta.pos{ color:#16a34a; }
.tableClean .delta.neg{ color:#ef4444; }
.tableClean .delta.neu{ color: rgba(15,23,42,.55); }

/* Serie por periodo: tabla más compacta para que entren todas las columnas */
#tblSerie thead th{ font-size:12px; letter-spacing:.02em; padding:8px 10px; }
#tblSerie tbody td{ padding:7px 10px; font-size:12px; white-space:nowrap; }
#tblSerie tfoot th, #tblSerie tfoot td{ padding:9px 10px; }
.tableClean .lvlBadge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:20px;
  padding:0 8px;
  border-radius:10px;
  font-size:11px;
  font-weight:800;
  letter-spacing:.02em;
}

.tableClean .badge{
  font-size:11px;
  padding:.2rem .5rem;
  border-radius:999px;
  font-weight:800;
}


/* --- Home mode switch (Gestión / FED / Todos) --- */
.segSwitch{display:inline-flex;gap:6px;background:rgba(15,23,42,.06);border:1px solid rgba(15,23,42,.10);border-radius:999px;padding:6px;}
.segBtn{appearance:none;border:0;background:transparent;padding:8px 14px;border-radius:999px;font-weight:700;color:rgba(15,23,42,.80);cursor:pointer;transition:all .15s ease;}
.segBtn:hover{background:rgba(15,23,42,.06);}
.segBtn.isActive{background:#0ea5e9;color:white;box-shadow:0 6px 18px rgba(2,132,199,.20);}
@media (max-width: 520px){.segBtn{padding:7px 10px;font-size:13px;}}


/* Home split labels (Gestión vs FED) */
.splitLabels{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 6px 10px 10px 10px;
}
.splitLabel{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:800;
  letter-spacing:.2px;
  color: rgba(15,23,42,.80);
  user-select:none;
}
.splitDot{
  width:10px;height:10px;border-radius:999px;
  box-shadow: 0 6px 16px rgba(2,6,23,.10);
}
.dotGestion{ background:#0ea5e9; }
.dotFed{ background:#22c55e; }

/* Softer segmented switch */
.segSwitch{
  background: rgba(255,255,255,.70);
  border: 1px solid rgba(148,163,184,.35);
  padding: 5px;
  box-shadow: 0 10px 24px rgba(2,6,23,.06);
}
.segBtn{
  padding: 7px 12px;
  font-weight: 800;
}
.segBtn.isActive{
  box-shadow: 0 10px 22px rgba(2,132,199,.18);
}

/* Tighten home header spacing a bit */
.infoCardHeader{ padding: 12px 16px; }
.infoCardBody{ padding: 12px; }
.heroInner{ padding: 18px 20px; }
.heroTitle{ font-size: clamp(34px, 4.2vw, 56px); line-height: 1.05; }

/* ============================
   HOME - Compact header + full-width panorama
   (requested: reducir título, centrar botones, ampliar gráficos)
   ============================ */
.heroCard{ margin-bottom: 10px; }
.heroInner{ padding: 14px 18px; }
.heroKicker{ margin-bottom: 4px; }
.heroTitle{ font-size: clamp(22px, 3.2vw, 40px); line-height: 1.05; margin: 0; }

.infoCardHeader{ padding: 10px 14px; }
.segSwitch{ gap: 8px; padding: 6px; }
.segBtn{ padding: 8px 14px; font-size: .95rem; }

.infoCardBody{ padding: 10px 12px 12px; }
.panoramaStage{ width: 100%; max-width: none; margin: 0; }
#panoramaSvg{ width: 100%; height: clamp(520px, 70vh, 900px); display: block; }


/* Tabla Serie (compacta) */
#tblSerie th, #tblSerie td{
  padding: 8px 8px;
  font-size: 12.5px;
  white-space: nowrap;
}
#tblSerie thead th{
  font-weight: 800;
  letter-spacing: .2px;
}
#tblSerie code{
  font-size: 12px;
}


/* ============================
   Curso de vida filters (Home)
   ============================ */
.cursoWrap{
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 0 10px;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}
.cursoRow{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cursoLabel{
  font-weight: 700;
  font-size: 12px;
  color: rgba(15,23,42,.70);
  letter-spacing: .02em;
}
.cursoSwitch{
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.35);
  background: rgba(248,250,252,.85);
  box-shadow: 0 10px 26px rgba(2,6,23,.06);
}
.cursoBtn{
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(15,23,42,.78);
  font-weight: 700;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.cursoBtn:hover{
  border-color: rgba(148,163,184,.45);
  background: rgba(226,232,240,.45);
}
.cursoBtn.isActive{
  background: rgba(15,23,42,.92);
  color: rgba(255,255,255,.96);
  border-color: rgba(15,23,42,.92);
}
@media (max-width: 520px){
  .cursoWrap{ padding: 8px 0 8px; }
  .cursoSwitch{ width: 100%; justify-content: space-between; }
  .cursoBtn{ flex: 1; text-align: center; padding: 8px 6px; }
  .cursoLabel{ width: 100%; text-align: center; }
}

/* ------------------------------------------------------------------
   HOME: acceso rápido a administrador
------------------------------------------------------------------- */
.heroAdminBtn{
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  letter-spacing: .2px;
  box-shadow: 0 10px 24px rgba(2,132,199,.18);
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}
.heroAdminBtn:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(2,132,199,.22);
}
.heroAdminBtn:active{
  transform: translateY(0);
  filter: brightness(.98);
}

/* ------------------------------------------------------------------
   ADMIN: responsive + suave
------------------------------------------------------------------- */
.adminHero{
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(59,130,246,.16), rgba(16,185,129,.10));
  border: 1px solid rgba(148,163,184,.35);
  padding: 14px;
  box-shadow: 0 18px 40px rgba(2,6,23,.06);
}
.adminHero h5{
  font-weight: 900;
  letter-spacing: .2px;
}
.adminCard{
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.25);
  box-shadow: 0 16px 36px rgba(2,6,23,.06);
}
.adminTableWrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.adminTableWrap table{
  min-width: 860px;
}
.adminStickyBar{
  position: sticky;
  top: 10px;
  z-index: 5;
}
.adminPulse{
  animation: adminPulse .55s ease;
}
@keyframes adminPulse{
  0%{ transform: translateY(0); box-shadow: 0 0 0 rgba(0,0,0,0); }
  50%{ transform: translateY(-2px); box-shadow: 0 18px 40px rgba(2,6,23,.10); }
  100%{ transform: translateY(0); box-shadow: 0 0 0 rgba(0,0,0,0); }
}



/* -----------------------------
   Modal Login Excel (sin popups)
------------------------------*/
.excelLoginModal{ position:fixed; inset:0; display:none; z-index:1055; }
.excelLoginModal.is-open{ display:block; }
.excelLoginModal__backdrop{ position:absolute; inset:0; background:rgba(2,6,23,.55); backdrop-filter: blur(2px); }
.excelLoginModal__panel{ position:relative; width:min(520px, calc(100vw - 28px)); height:min(560px, calc(100vh - 28px)); margin:14px auto; background:#fff; border-radius:16px; box-shadow:0 22px 60px rgba(2,6,23,.35); overflow:hidden; animation: excelPop .18s ease-out; }
.excelLoginModal__head{ display:flex; align-items:center; justify-content:space-between; padding:10px 12px; background:linear-gradient(90deg, rgba(2,132,199,.92), rgba(59,130,246,.92)); color:#fff; }
.excelLoginModal__title{ font-weight:700; letter-spacing:.2px; }
.excelLoginModal__close{ border:0; background:rgba(255,255,255,.18); color:#fff; width:34px; height:34px; border-radius:10px; font-size:20px; line-height:1; cursor:pointer; }
.excelLoginModal__close:hover{ background:rgba(255,255,255,.26); }
.excelLoginModal__frame{ width:100%; height:calc(100% - 54px); border:0; background:#f8fafc; }
@keyframes excelPop{ from{ transform:translateY(10px); opacity:.0; } to{ transform:translateY(0); opacity:1; } }


.heroBadgeCompact{
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.heroBadgeCompact .heroBadgeLabel{
  margin:0;
}
.heroBadgeCompact .heroBadgeHint{
  font-size:12px;
}


.heroBadgeCompact .heroBadgeValue{ margin-top:0; line-height:1; }
.heroBadgeCompact .heroBadgeHint{ opacity:.75; }

/* =========================================================
   ADMIN USERS – Responsive (iPhone/tablet friendly)
   - Desktop: keeps table layout
   - Mobile: hides table, shows cards, sticky bulk actions
   ========================================================= */
@media (max-width: 768px){
  .adminHero{ border-radius: 16px !important; }
  .adminTableWrap{ overflow: visible !important; }
  .adminTableWrap table{ display:none; }

  .adminCards{ display:flex !important; flex-direction:column; gap:12px; }
  .adminCardItem{
    background:#fff; border:1px solid rgba(0,0,0,.08);
    border-radius:16px; padding:12px;
    box-shadow:0 8px 22px rgba(0,0,0,.08);
  }
  .adminCardTop{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
  .adminCardTop .left{ display:flex; align-items:center; gap:10px; min-width:0; }
  .adminCardTop .dni{ font-weight:700; font-size:15px; }
  .adminCardTop .badges{ display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }

  .adminCardGrid{
    margin-top:10px;
    display:grid; grid-template-columns: 1fr 1fr;
    gap:8px 10px; font-size:13px;
  }
  .adminCardGrid .k{ color:#6c757d; }
  .adminCardGrid .v{ color:#111; font-weight:600; word-break:break-word; }

  /* Bulk actions: sticky bottom bar (iOS style) */
  .admin-actions{
    position: sticky; bottom: 0; z-index: 20;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0,0,0,.08);
    padding: 10px;
    border-radius: 14px;
    margin-top: 10px;
  }
  .admin-actions .btn{ border-radius: 12px !important; }
  .admin-actions .btn-group, .admin-actions form{ width:100%; }
  .admin-actions .btn, .admin-actions button, .admin-actions a{ flex:1; }

  /* Make top controls wrap nicely */
  .adminTopRow{ gap:10px !important; }
}
@media (min-width: 769px){
  .adminCards{ display:none !important; }
}
