/* ═══════════════════════════════════════════════════════════════
   ZERON · El Estado de tus Impuestos — Estilos
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bg: #05070d;
    --bg-2: #080c14;
    --bg-3: #0c1322;
    --ink: #f5f7fb;
    --ink-2: #a8b3c5;
    --ink-3: #6a7488;
    --line: rgba(255, 255, 255, 0.06);
    --line-2: rgba(255, 255, 255, 0.1);
    --acc: #5b8cff;
    --acc-2: #a06bff;
    --acc-3: #4ad7ff;
    --grad: linear-gradient(135deg, #5b8cff 0%, #a06bff 50%, #4ad7ff 100%);
    --green: #10b981;
    --red: #ef4444;
    --gold: #f59e0b;
    --defense: #ef4444;
    --health: #10b981;
    --education: #4ad7ff;
    --fnt: "Inter", system-ui, -apple-system, sans-serif;
    --dis: "Space Grotesk", var(--fnt);
    --mono: "JetBrains Mono", ui-monospace, monospace;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); -webkit-font-smoothing: antialiased; }
body { font-family: var(--fnt); background: var(--bg); color: var(--ink); line-height: 1.6; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--dis); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; color: var(--ink); }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.grad { background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-style: italic; font-weight: 500; }
::selection { background: var(--acc); color: #fff; }

/* ── NAVBAR ── */
.navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 16px 0; transition: all 0.3s; }
.navbar.scrolled { background: rgba(5, 7, 13, 0.78); backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%); border-bottom: 1px solid var(--line); padding: 10px 0; }
.nav-container { display: flex; align-items: center; justify-content: space-between; }
.logo img { height: 28px; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { font-size: 13.5px; font-weight: 500; color: var(--ink-2); transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: #fff; }

/* ── HEADER ── */
.page-header { padding: 130px 0 32px; text-align: center; position: relative; }
.badges { display: flex; gap: 10px; justify-content: center; margin-bottom: 24px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; font-weight: 500; padding: 6px 12px; border-radius: 999px; border: 1px solid; letter-spacing: 0.06em; text-transform: uppercase; }
.badge.live { color: var(--green); background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.25); }
.badge.src { color: var(--ink-2); background: rgba(255, 255, 255, 0.03); border-color: var(--line-2); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.4); } }
.page-header h1 { font-size: clamp(38px, 6vw, 64px); font-weight: 700; line-height: 1.05; margin-bottom: 16px; letter-spacing: -0.03em; color: #fff; }
.lead { font-size: 16px; color: var(--ink-2); line-height: 1.6; max-width: 760px; margin: 0 auto 16px; }
.lead strong { color: var(--ink); font-weight: 600; }
.data-quote {
    font-style: italic;
    font-size: 14px;
    color: var(--ink-3);
    max-width: 720px;
    margin: 0 auto 24px;
    padding: 14px 20px;
    border-left: 3px solid var(--red);
    background: rgba(239, 68, 68, 0.04);
    border-radius: 0 8px 8px 0;
    text-align: left;
}
.quote-src { color: var(--ink-2); font-size: 12px; font-weight: 600; font-style: normal; }
.updated-bar { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--ink-3); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); padding: 10px 20px; border-radius: 999px; flex-wrap: wrap; justify-content: center; }
.up-time { color: var(--ink); font-weight: 500; }
.up-sep { color: var(--ink-3); }
.up-refresh { color: var(--ink-2); }

/* ── BLOCKS ── */
.block { margin-bottom: 80px; }
.block-head { text-align: center; max-width: 760px; margin: 0 auto 32px; }
.kicker { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--red); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 16px; }
.block-head h2 { font-size: clamp(26px, 3.6vw, 40px); font-weight: 600; margin-bottom: 12px; }
.block-lead { font-size: 15px; color: var(--ink-2); line-height: 1.6; max-width: 620px; margin: 0 auto; }

/* ── URBAN KPIs ── */
.urban-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.urban-kpi {
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}
.urban-kpi::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: var(--grad);
    opacity: 0.5;
}
.urban-kpi:hover { transform: translateY(-3px); border-color: var(--line-2); }
.kpi-icon { font-size: 28px; margin-bottom: 14px; display: block; }
.kpi-label { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px; }
.kpi-value { font-family: var(--dis); font-size: 30px; font-weight: 700; color: #fff; line-height: 1; letter-spacing: -0.02em; margin-bottom: 6px; }
.kpi-unit { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-left: 4px; }
.kpi-detail { font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); line-height: 1.4; margin-top: 6px; }
.kpi-source { font-family: var(--mono); font-size: 9.5px; color: var(--ink-3); margin-top: 10px; opacity: 0.7; letter-spacing: 0.04em; }

/* ── DATA WARNING ── */
.data-warning {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-left: 3px solid var(--gold);
    border-radius: 10px;
    padding: 16px 20px;
    margin: 20px 0 24px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--ink-2);
}
.dw-icon { font-size: 22px; flex-shrink: 0; line-height: 1.2; }
.dw-content strong { color: var(--ink); font-weight: 600; }

/* ── CONTROLS ── */
.consumer-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: center;
    margin: 24px 0 28px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
    border-radius: 14px;
}
.consumer-search input {
    width: 280px;
    max-width: 100%;
    padding: 10px 16px;
    font-family: var(--fnt);
    font-size: 14px;
    color: var(--ink);
    background: var(--bg-2);
    border: 1px solid var(--line-2);
    border-radius: 999px;
    outline: none;
    transition: border-color 0.2s;
}
.consumer-search input::placeholder { color: var(--ink-3); }
.consumer-search input:focus { border-color: var(--acc); }
.region-bar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 0; }
.region-btn { padding: 9px 18px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 999px; transition: all 0.25s; }
.region-btn:hover { color: var(--ink); border-color: var(--line-2); }
.region-btn.active { color: #fff; background: rgba(91, 140, 255, 0.14); border-color: rgba(91, 140, 255, 0.35); }
.consumer-sort { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.consumer-sort label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.consumer-sort select {
    padding: 8px 12px;
    font-family: var(--fnt);
    font-size: 13px;
    color: var(--ink);
    background: var(--bg-2);
    border: 1px solid var(--line-2);
    border-radius: 8px;
    cursor: pointer;
    outline: none;
}
.consumer-sort select:hover, .consumer-sort select:focus { border-color: var(--acc); }

/* ── DASHBOARD / TABLA ── */
.dash-card { background: var(--bg-3); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.dash-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; color: #fff; }
.card-sub { font-size: 11px; color: var(--ink-3); margin-bottom: 16px; }
.table-wrap { overflow-x: auto; }
.table-wrap.big { max-height: 720px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg-3); z-index: 1; }
thead th.num { text-align: right; }
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--ink); }
tbody td { padding: 10px 12px; font-size: 13px; border-bottom: 1px solid rgba(255, 255, 255, 0.02); color: var(--ink-2); }
tbody td.num { text-align: right; font-family: var(--mono); font-weight: 500; color: var(--ink); }
tbody tr:hover td { background: rgba(91, 140, 255, 0.04); }
.rank-cell { font-family: var(--mono); font-weight: 600; color: var(--ink); width: 36px; }
.team-cell { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; }
.flag { font-size: 16px; }
.conf-tag { font-family: var(--mono); font-size: 9.5px; color: var(--ink-3); padding: 2px 7px; background: rgba(255, 255, 255, 0.04); border-radius: 4px; letter-spacing: 0.04em; text-transform: capitalize; }
.year-tag { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.loading { text-align: center; padding: 30px 20px; color: var(--ink-3); font-style: italic; font-size: 13px; }

.mini-bar {
    display: inline-block;
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 2px;
    margin-left: 8px;
    vertical-align: middle;
    overflow: hidden;
}
.mini-bar-fill { height: 100%; background: var(--defense); border-radius: 2px; }
.mini-bar-fill.h { background: var(--health); }
.mini-bar-fill.e { background: var(--education); }

/* ── COMPARADOR ── */
.comparator-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.cmp-select {
    padding: 12px 20px;
    font-family: var(--fnt);
    font-size: 14px;
    color: var(--ink);
    background: var(--bg-3);
    border: 1px solid var(--line-2);
    border-radius: 12px;
    cursor: pointer;
    min-width: 220px;
    outline: none;
}
.cmp-select:hover, .cmp-select:focus { border-color: var(--acc); }
.cmp-vs {
    font-family: var(--dis);
    font-size: 16px;
    font-weight: 700;
    color: var(--acc);
    letter-spacing: 0.1em;
}
.cmp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.cmp-card {
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
    min-height: 280px;
}
.cmp-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 16px;
}
.cmp-flag { font-size: 32px; }
.cmp-name { font-family: var(--dis); font-size: 22px; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.cmp-bars { display: flex; flex-direction: column; gap: 12px; }
.cmp-bar {
    display: grid;
    grid-template-columns: 110px 1fr 60px;
    align-items: center;
    gap: 12px;
}
.cmp-blabel { font-size: 13px; color: var(--ink-2); }
.cmp-btrack {
    height: 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    overflow: hidden;
}
.cmp-bfill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.4s;
}
.cmp-bfill.defense { background: linear-gradient(90deg, var(--defense), #b91c1c); }
.cmp-bfill.health  { background: linear-gradient(90deg, var(--health), #047857); }
.cmp-bfill.education { background: linear-gradient(90deg, var(--education), #0369a1); }
.cmp-bval { font-family: var(--mono); font-size: 13px; color: var(--ink); text-align: right; font-weight: 600; }

/* ── ARGENTINA ── */
.ar-fx-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin: 0 0 24px;
    padding: 14px 20px;
    background: linear-gradient(180deg, rgba(91, 140, 255, 0.06), var(--bg-3));
    border: 1px solid rgba(91, 140, 255, 0.2);
    border-radius: 12px;
    font-size: 13px;
    color: var(--ink-2);
}
.fx-flag { font-size: 22px; }
.fx-label { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; }
.fx-item { font-family: var(--mono); font-size: 12.5px; padding: 4px 10px; background: rgba(255, 255, 255, 0.03); border-radius: 6px; color: var(--ink-2); }
.fx-item b { color: var(--ink); font-weight: 600; }
.fx-item.oficial { border-left: 2px solid var(--ink-3); }
.fx-item.blue { border-left: 2px solid var(--acc); }
.fx-item.brecha-low { border-left: 2px solid var(--green); color: var(--green); }
.fx-item.brecha-low b { color: var(--green); }

.ar-state-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.ar-state-card {
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
    text-align: center;
}
.ar-state-card.highlight { background: linear-gradient(180deg, rgba(91, 140, 255, 0.1), var(--bg-3)); border-color: rgba(91, 140, 255, 0.3); }
.ar-s-label { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; }
.ar-s-value { font-family: var(--dis); font-size: 30px; font-weight: 700; color: #fff; line-height: 1; margin-bottom: 8px; }
.ar-s-rank { font-size: 12px; color: var(--acc); font-weight: 600; }
.ar-s-year { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); margin-top: 4px; }
.ar-s-detail { font-size: 12px; color: var(--ink-2); }

/* ── SOURCES ── */
.sources { background: var(--bg-2); padding: 40px 32px; border-radius: 18px; border: 1px solid var(--line); }
.sources h2 { margin-bottom: 20px; }
.sources li { font-size: 14px; color: var(--ink-2); line-height: 1.7; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sources li:last-child { border-bottom: none; }
.sources li strong { color: var(--ink); }
.sources a { color: var(--acc); border-bottom: 1px dashed var(--acc); }
.src-foot { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-top: 16px; }

/* ── FOOTER ── */
.footer { padding: 50px 0 32px; border-top: 1px solid var(--line); text-align: center; }
.footer p { font-size: 12.5px; color: var(--ink-3); }
.footer a { color: var(--acc); }
.tag { margin-top: 6px; font-family: var(--mono); font-size: 11px; }

/* ── RESPONSIVE ── */
@media (max-width: 1000px) {
    .urban-kpis { grid-template-columns: repeat(2, 1fr); }
    .ar-state-grid { grid-template-columns: repeat(2, 1fr); }
    .cmp-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .container { padding: 0 22px; }
    .urban-kpis { grid-template-columns: 1fr; }
    .ar-state-grid { grid-template-columns: 1fr; }
    .consumer-controls { flex-direction: column; align-items: stretch; padding: 14px; }
    .consumer-search input { width: 100%; }
    .ar-fx-bar { gap: 10px; font-size: 12px; padding: 12px 14px; }
    .nav-links { gap: 14px; }
    .nav-links a { font-size: 12px; }
}
