  :root {
    --azul: #1B4F8A; --azul-oscuro: #0d3060; --azul-claro: #2a6fc4;
    --dorado: #F5A800; --dorado-oscuro: #c98a00;
    --verde: #16a34a; --verde-claro: #4ade80;
    --blanco: #ffffff; --gris-claro: #f0f4fa; --gris-med: #c8d6e8;
    --texto-oscuro: #0a1f3a; --sombra: rgba(11,31,66,0.18);
  }
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; overflow-x: hidden; }
  body { font-family: 'Barlow', sans-serif; background: var(--gris-claro); color: var(--texto-oscuro); overflow-x: hidden; }

  /* NAV */
  nav { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: rgba(11,30,62,0.97); backdrop-filter: blur(12px); border-bottom: 3px solid var(--dorado); display: flex; align-items: center; justify-content: space-between; padding: 0.55rem 2.5rem; box-shadow: 0 4px 24px var(--sombra); }
  .nav-logos { display: flex; align-items: center; gap: 1.4rem; }
  .nav-logos img { height: 42px; object-fit: contain; mix-blend-mode: screen; }
  .nav-sep { width: 1px; height: 32px; background: rgba(245,168,0,0.4); }
  .nav-links { display: flex; gap: 2rem; list-style: none; }
  .nav-links a { color: var(--gris-med); text-decoration: none; font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: 0.88rem; letter-spacing: 0.06em; text-transform: uppercase; transition: color .22s; }
  .nav-links a:hover { color: var(--dorado); }

  /* HERO */
  .hero {
    min-height: 100vh;
    background: linear-gradient(160deg, rgba(3,14,8,0.90) 0%, rgba(8,40,20,0.80) 50%, rgba(3,14,8,0.92) 100%);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: relative; color: var(--blanco); text-align: center;
    margin-top: 60px; padding: 3rem 1.5rem;
  }
  .hero::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(22,163,74,0.18) 0%, transparent 70%);
    pointer-events: none;
  }
  .hero-badge { display: inline-flex; align-items: center; gap: 0.5rem; background: rgba(74,222,128,0.12); border: 1px solid rgba(74,222,128,0.35); border-radius: 2rem; padding: 0.35rem 1.1rem; font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--verde-claro); margin-bottom: 1.6rem; position: relative; z-index: 1; }
  .hero h1 { font-family: 'Barlow Condensed', sans-serif; font-weight: 900; font-size: clamp(2.6rem, 6vw, 5rem); line-height: 1.05; text-transform: uppercase; margin-bottom: 1rem; position: relative; z-index: 1; text-shadow: 0 2px 20px rgba(0,0,0,0.9); }
  .hero h1 em { display: block; color: var(--verde-claro); font-style: normal; }
  .hero-divider { width: 60px; height: 4px; background: var(--verde-claro); border-radius: 2px; margin: 1rem auto; position: relative; z-index: 1; }
  .hero-sub { max-width: 680px; font-size: 1.08rem; font-weight: 300; line-height: 1.7; color: var(--gris-med); position: relative; z-index: 1; }
  .hero-stats { display: flex; gap: 2.5rem; flex-wrap: wrap; justify-content: center; margin-top: 2.5rem; position: relative; z-index: 1; }
  .hero-stat .num { font-family: 'Barlow Condensed', sans-serif; font-weight: 900; font-size: 2.4rem; color: var(--verde-claro); line-height: 1; }
  .hero-stat .label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gris-med); margin-top: 0.2rem; }

  /* SECTIONS */
  section { padding: 5rem 1.5rem; }
  section:nth-child(even):not(.hero) { background: var(--blanco); }
  .container { max-width: 1100px; margin: 0 auto; }
  .section-tag { display: inline-flex; align-items: center; gap: 0.45rem; font-family: 'Barlow Condensed', sans-serif; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--dorado); margin-bottom: 0.8rem; }
  .section-tag::before { content: ''; display: block; width: 22px; height: 3px; background: var(--dorado); border-radius: 2px; }
  .section-title { font-family: 'Barlow Condensed', sans-serif; font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; text-transform: uppercase; color: var(--azul-oscuro); line-height: 1.05; margin-bottom: 0.5rem; }
  .section-title span { color: var(--dorado); }
  .section-desc { font-size: 1rem; color: #4a6080; line-height: 1.7; margin-bottom: 2rem; }

  /* REVEAL */
  .reveal { opacity: 0; transform: translateY(28px); transition: opacity .55s ease, transform .55s ease; }
  .reveal.visible { opacity: 1; transform: none; }

  /* LAYOUT HEADER: gadgets izq + tasas der */
  .gasto-header-layout { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: stretch; margin-bottom: 3rem; }
  .tasas-wrap { border-radius: 14px; overflow: hidden; box-shadow: 0 4px 20px var(--sombra); border: 1.5px solid var(--gris-med); display: flex; flex-direction: column; }

  /* GADGETS */
  .gasto-gadgets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
  .gasto-gadget { border-radius: 16px; padding: 1.6rem 1.2rem; text-align: center; box-shadow: 0 4px 18px var(--sombra); display: flex; flex-direction: column; align-items: center; gap: 0.7rem; }
  .gasto-gadget--presupuesto { background: linear-gradient(160deg, #0a1f4e, #163272); border-top: 4px solid #facc15; }
  .gasto-gadget--personas    { background: linear-gradient(160deg, #064e2a, #0a7a3f); border-top: 4px solid #4ade80; }
  .gasto-gadget--programas   { background: linear-gradient(160deg, #431407, #7c2d12); border-top: 4px solid #fb923c; }
  .gg-icon  { font-size: 2rem; line-height: 1; }
  .gg-text  { display: flex; flex-direction: column; gap: 0.15rem; }
  .gg-val   { font-family: 'Barlow Condensed', sans-serif; font-weight: 900; font-size: 1.7rem; color: #facc15; line-height: 1; }
  .gasto-gadget--personas .gg-val  { color: #4ade80; }
  .gasto-gadget--programas .gg-val { color: #fb923c; }
  .gg-label { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.06em; color: #ffffff; }
  .gg-sub   { font-size: 0.74rem; color: rgba(255,255,255,0.55); }

  /* TABLA GASTO */
  .gasto-table-title { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--azul-oscuro); margin-bottom: 0.8rem; padding-left: 1rem; border-left: 4px solid var(--dorado); }
  .compras-table-wrap { overflow-x: auto; border-radius: 16px; box-shadow: 0 6px 32px rgba(27,79,138,0.10); border: 1.5px solid var(--gris-med); margin-bottom: 2rem; }
  .compras-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
  .compras-table thead tr { background: linear-gradient(90deg, var(--azul-oscuro), var(--azul)); }
  .compras-table thead th { font-family: 'Barlow Condensed', sans-serif; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blanco); padding: 1rem 1.1rem; text-align: left; white-space: nowrap; }
  .compras-table thead th:first-child { border-radius: 14px 0 0 0; }
  .compras-table thead th:last-child  { border-radius: 0 14px 0 0; }
  .compras-table tbody tr { border-bottom: 1px solid rgba(27,79,138,0.07); transition: background .18s; }
  .compras-table tbody tr:nth-child(odd)  { background: var(--blanco); }
  .compras-table tbody tr:nth-child(even) { background: #f4f7fc; }
  .compras-table tbody tr:hover { background: #e8f0fb; }
  .compras-table tbody td { padding: 0.85rem 1.1rem; vertical-align: middle; line-height: 1.4; }
  .compras-table tfoot tr { background: linear-gradient(90deg, var(--azul-oscuro), var(--azul)); }
  .compras-table tfoot td { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; color: var(--blanco); padding: 1rem 1.1rem; }
  .td-total-label { text-align: right; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.88rem; opacity: 0.85; border-radius: 0 0 0 14px; }
  .td-total-sum { text-align: right !important; font-size: 1.4rem; font-weight: 900; color: var(--dorado) !important; border-radius: 0 0 14px 0; white-space: nowrap; }
  .td-val { text-align: right !important; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; color: var(--azul); white-space: nowrap; }
  .gasto-prog    { font-weight: 600; color: var(--azul-oscuro); }
  .gasto-periodo { font-size: 0.85rem; color: #4a6080; white-space: nowrap; }
  .gasto-num     { text-align: center !important; font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 1.1rem; color: var(--azul); }
  .gasto-pct     { text-align: center !important; font-size: 0.88rem; color: #4a6080; font-weight: 600; }
  .gasto-nivel   { text-align: center !important; }

  /* BADGES NIVEL */
  .nivel { display: inline-block; font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.25rem 0.7rem; border-radius: 6px; }
  .nivel--alto  { background: rgba(220,38,38,0.12);  color: #dc2626; border: 1px solid rgba(220,38,38,0.3); }
  .nivel--medio { background: rgba(234,88,12,0.10);  color: #ea580c; border: 1px solid rgba(234,88,12,0.25); }
  .nivel--bajo  { background: rgba(22,163,74,0.10);  color: #16a34a; border: 1px solid rgba(22,163,74,0.25); }

  /* TASAS DIARIAS */
  .tasas-header { display: flex; align-items: center; gap: 0.7rem; padding: 0.9rem 1.4rem; background: linear-gradient(90deg, var(--azul-oscuro), var(--azul)); color: var(--blanco); font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.08em; }
  .tasas-header i { color: var(--dorado); }
  .tasas-table { border-collapse: collapse; }
  .tasas-table th { background: rgba(27,79,138,0.08); font-family: 'Barlow Condensed', sans-serif; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--azul-oscuro); padding: 0.6rem 1.4rem; text-align: center; border-bottom: 1px solid var(--gris-med); }
  .tasas-table th:first-child { text-align: left; }
  .tasas-table td { padding: 0.6rem 1.4rem; font-size: 0.9rem; color: var(--texto-oscuro); border-bottom: 1px solid rgba(27,79,138,0.06); text-align: center; }
  .tasas-table td:first-child { text-align: left; font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 1rem; color: var(--azul); }
  .tasas-table tr:last-child td { border-bottom: none; }
  .tasas-table tr:nth-child(even) td { background: #f4f7fc; }
  .tasas-table tr:hover td { background: #e8f0fb; }

  /* DETALLE POR PROGRAMA */
  .dp-grid { display: flex; flex-direction: column; gap: 2rem; }
  .dp-card { border-radius: 14px; overflow: hidden; box-shadow: 0 4px 22px var(--sombra); border: 1.5px solid var(--gris-med); }
  .dp-header { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 1.4rem; background: linear-gradient(90deg, var(--azul-oscuro), var(--azul)); gap: 1rem; }
  .dp-nombre { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--blanco); }
  .dp-periodo { font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: 0.88rem; color: var(--dorado); white-space: nowrap; }
  .dp-table-wrap { overflow-x: auto; }
  .dp-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
  .dp-table thead tr { background: rgba(27,79,138,0.07); }
  .dp-table thead th { font-family: 'Barlow Condensed', sans-serif; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--azul-oscuro); padding: 0.65rem 1rem; text-align: left; border-bottom: 2px solid rgba(27,79,138,0.12); white-space: nowrap; }
  .dp-table thead th:last-child { text-align: right; }
  .dp-table thead th:nth-child(3) { text-align: center; }
  .dp-table tbody tr { border-bottom: 1px solid rgba(27,79,138,0.06); transition: background .15s; }
  .dp-table tbody tr:nth-child(even) { background: #f6f9ff; }
  .dp-table tbody tr:hover { background: #eaf2ff; }
  .dp-cargo { padding: 0.65rem 1rem; color: var(--texto-oscuro); font-weight: 500; line-height: 1.35; }
  .dp-cat   { padding: 0.65rem 1rem; font-size: 0.83rem; color: #4a6080; white-space: nowrap; }
  .dp-n     { padding: 0.65rem 1rem; text-align: center; font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 1.1rem; color: var(--azul); }
  .dp-tarifa { padding: 0.65rem 1rem; text-align: center; }
  .dp-sub   { padding: 0.65rem 1rem; text-align: right; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; color: var(--azul-oscuro); white-space: nowrap; }
  .dp-badge { display: inline-block; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 0.78rem; padding: 0.2rem 0.55rem; border-radius: 5px; }
  .tarifa-c1   { background: rgba(27,79,138,0.10); color: var(--azul); border: 1px solid rgba(27,79,138,0.2); }
  .tarifa-c2   { background: rgba(245,168,0,0.12); color: #a06800; border: 1px solid rgba(245,168,0,0.3); }
  .tarifa-bono { background: rgba(22,163,74,0.10); color: #166534; border: 1px solid rgba(22,163,74,0.25); }
  .dp-table tfoot tr { background: linear-gradient(90deg, rgba(13,48,96,0.08), rgba(13,48,96,0.03)); border-top: 2px solid rgba(27,79,138,0.15); }
  .dp-foot-label { padding: 0.7rem 1rem; font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--azul-oscuro); text-align: right; }
  .dp-foot-n    { padding: 0.7rem 1rem; text-align: center; font-family: 'Barlow Condensed', sans-serif; font-weight: 900; font-size: 1.15rem; color: var(--azul); }
  .dp-foot-sum  { padding: 0.7rem 1rem; text-align: right; font-family: 'Barlow Condensed', sans-serif; font-weight: 900; font-size: 1.05rem; color: var(--dorado-oscuro); white-space: nowrap; }

  /* NAV HAMBURGER */
  .nav-toggle { display:none; flex-direction:column; gap:5px; background:none; border:none; cursor:pointer; padding:8px; z-index:1002; flex-shrink:0; }
  .nav-toggle span { display:block; width:26px; height:2.5px; background:var(--dorado); border-radius:2px; transition:transform .3s, opacity .3s; }
  .nav-toggle.active span:nth-child(1) { transform:translateY(7.5px) rotate(45deg); }
  .nav-toggle.active span:nth-child(2) { opacity:0; transform:scaleX(0); }
  .nav-toggle.active span:nth-child(3) { transform:translateY(-7.5px) rotate(-45deg); }
  nav.compact .nav-toggle { display:flex; }
  nav.compact .nav-links { position:fixed; top:0; left:0; width:100%; height:100%; min-height:100dvh; background:rgba(5,12,28,.97); flex-direction:column; align-items:center; justify-content:center; gap:2.2rem; z-index:1001; display:none; }
  nav.compact .nav-links.open { display:flex; }
  nav.compact .nav-links li { list-style:none; }
  nav.compact .nav-links a { font-size:1.4rem; font-weight:700; color:var(--dorado); }

  /* FOOTER */
  footer { background: var(--texto-oscuro); border-top: 3px solid var(--dorado); padding: 2.5rem 2rem; text-align: center; }
  footer img { height: 36px; object-fit: contain; opacity: 0.9; margin: 0 0.8rem; mix-blend-mode: screen; }
  .footer-copy { margin-top: 1.1rem; font-size: 0.82rem; color: #5a7898; letter-spacing: 0.04em; }

  @media (max-width: 768px) {
    .gasto-header-layout { grid-template-columns: 1fr; }
    .tasas-wrap { width: 100%; }
  }
  @media (max-width: 480px) {
    .hero h1 { font-size: clamp(1.9rem, 8vw, 2.4rem); }
    .hero-stats { gap: 1.2rem; }
    .hero-stat .num { font-size: 2rem; }
  }

/* ── ANÁLISIS COMPARATIVO ────────────────────────────────── */
.comparativo-section { background: var(--gris-claro, #f0f4fa); }
.comp-subtitle { font-size: 0.95rem; color: #4a6080; margin: 0.4rem 0 2rem; }

/* Tabla */
.comp-table-wrap { overflow-x: auto; border-radius: 16px; box-shadow: 0 6px 32px rgba(27,79,138,0.10); border: 1.5px solid #c8d6e8; margin-bottom: 2rem; }
.comp-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 700px; }
.comp-table thead tr { background: linear-gradient(90deg, #0d3060, #1B4F8A); }
.comp-table thead th { font-family: 'Barlow Condensed', sans-serif; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #fff; padding: 0.95rem 1.1rem; text-align: left; white-space: nowrap; }
.comp-table thead th:first-child { border-radius: 14px 0 0 0; }
.comp-table thead th:last-child { border-radius: 0 14px 0 0; width: 30%; }
.comp-table thead th:nth-child(2), .comp-table thead th:nth-child(4) { text-align: center; }
.comp-table thead th:nth-child(3) { text-align: right; }
.comp-table tbody tr { border-bottom: 1px solid rgba(27,79,138,0.07); transition: background .18s; }
.comp-table tbody tr:nth-child(odd) { background: #fff; }
.comp-table tbody tr:nth-child(even) { background: #f4f7fc; }
.comp-table tbody tr:hover { background: #e8f0fb; }
.comp-table tbody td { padding: 0.75rem 1.1rem; vertical-align: middle; }
.comp-table tbody td:nth-child(2) { text-align: center; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; color: #1B4F8A; }
.comp-table tbody td:nth-child(3) { text-align: right; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; color: #0d3060; white-space: nowrap; }
.comp-table tbody td:nth-child(4) { text-align: center; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; }
.nivel-alto td:nth-child(4) { color: #c0392b; }
.nivel-medio td:nth-child(4) { color: #ca8a04; }
.nivel-bajo td:nth-child(4) { color: #16a34a; }
.comp-total { background: linear-gradient(90deg, #0d3060, #1B4F8A) !important; }
.comp-total td { color: #fff !important; font-family: 'Barlow Condensed', sans-serif; font-weight: 900; font-size: 0.95rem; padding: 0.9rem 1.1rem; }
.comp-total td:nth-child(2) { text-align: center; }
.comp-total td:nth-child(3) { text-align: right; }
.comp-total td:nth-child(4) { text-align: center; color: #F5A800 !important; }
.comp-total td:first-child { border-radius: 0 0 0 14px; }
.comp-total td:last-child { border-radius: 0 0 14px 0; }

/* Barra visual */
.dist-wrap { display: flex; align-items: center; gap: 0.5rem; }
.dist-bar { height: 18px; border-radius: 3px; min-width: 2px; flex-shrink: 0; }
.dist-alto  { background: linear-gradient(90deg, #c0392b, #e74c3c); }
.dist-medio { background: linear-gradient(90deg, #ca8a04, #eab308); }
.dist-bajo  { background: linear-gradient(90deg, #16a34a, #22c55e); }
.dist-wrap span { font-size: 0.78rem; color: #4a6080; white-space: nowrap; }

/* Leyenda */
.comp-leyenda { background: #fff; border: 1.5px solid #c8d6e8; border-radius: 14px; padding: 1.4rem 1.8rem; margin-bottom: 2.5rem; }
.ley-title { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.12em; color: #0d3060; margin-bottom: 1rem; }
.ley-items { display: flex; gap: 2rem; flex-wrap: wrap; }
.ley-item { display: flex; align-items: flex-start; gap: 0.7rem; }
.ley-dot { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; margin-top: 3px; }
.ley-alto  .ley-dot { background: #c0392b; }
.ley-medio .ley-dot { background: #eab308; }
.ley-bajo  .ley-dot { background: #16a34a; }
.ley-item strong { font-family: 'Barlow Condensed', sans-serif; font-size: 0.95rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; display: block; }
.ley-alto  strong { color: #c0392b; }
.ley-medio strong { color: #ca8a04; }
.ley-bajo  strong { color: #16a34a; }
.ley-item span { font-size: 0.83rem; color: #4a6080; }

/* Dashboard */
.comp-dashboard { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: auto auto; gap: 1.5rem; }
.dash-card { background: #fff; border-radius: 16px; padding: 1.5rem 1.8rem; box-shadow: 0 4px 20px rgba(27,79,138,0.09); border: 1.5px solid #c8d6e8; }
.dash-card--wide { grid-column: 1; }
.dash-card--full { grid-column: 1 / -1; }
.dash-card-title { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.08em; color: #0d3060; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.dash-card-title i { color: #F5A800; }
@media (max-width: 900px) { .comp-dashboard { grid-template-columns: 1fr; } .dash-card--wide, .dash-card--full { grid-column: 1; } .ley-items { flex-direction: column; gap: 0.8rem; } }
