/* ============ style.css ============ */
:root {
    --bg: #0a0c0f;
    --bg2: #111418;
    --bg3: #181c22;
    --bg4: #1e2329;
    --border: #252b34;
    --border2: #2e3640;
    --text: #e8eaed;
    --text2: #b0bcc8;
    --text3: #7a8a9a;
    --accent: #00d4ff;
    --green: #00c896;
    --red: #ff4d6a;
    --amber: #ffb347;
    --purple: #a78bfa;
    --mono: 'IBM Plex Mono', 'SF Mono', 'Consolas', monospace;
    --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --serif: 'IBM Plex Serif', Georgia, serif;
    --gap: 24px;
    --radius: 8px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   TICKER TAPE
   ======================================== */
.ticker-container {
    background: linear-gradient(180deg, var(--bg3) 0%, var(--bg2) 100%);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 100;
}

.ticker-tape {
    display: flex;
    animation: ticker 90s linear infinite;
    white-space: nowrap;
    padding: 10px 0;
}

.ticker-container:hover .ticker-tape { animation-play-state: paused; }

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 28px;
    font-family: var(--mono);
    font-size: 12px;
    border-right: 1px solid var(--border);
}

.ticker-label { color: var(--text2); font-weight: 500; letter-spacing: 0.3px; }
.ticker-value { color: var(--text); font-weight: 600; }

.ticker-change {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.ticker-change.positive { background: rgba(0, 200, 150, 0.15); color: var(--green); }
.ticker-change.negative { background: rgba(255, 77, 106, 0.15); color: var(--red); }

/* ========================================
   HEADER
   ======================================== */
.header {
    padding: 0 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg2);
    height: 52px;
}

.logo { display: flex; align-items: baseline; gap: 0; flex-shrink: 0; margin-right: 32px; }

.logo-main {
    font-family: var(--mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.logo-sub {
    font-family: var(--mono);
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.5px;
}

.logo-ar {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--bg);
    margin-left: 6px;
    padding: 3px 6px;
    background: linear-gradient(135deg, var(--accent) 0%, #0099cc 100%);
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text2);
    margin-left: auto;
    flex-shrink: 0;
    padding-left: 16px;
}

.status-indicator { display: flex; align-items: center; gap: 8px; }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.error { background: var(--red); animation: none; }
.status-dot.loading { background: var(--amber); }

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 200, 150, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(0, 200, 150, 0); }
}

/* ========================================
   NAVIGATION
   ======================================== */
.nav-tabs {
    display: flex;
    gap: 0;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    height: 100%;
    align-items: stretch;
}

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

.nav-tab {
    padding: 0 18px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--text2);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 7px;
    height: 100%;
}

.nav-tab:hover { color: var(--text); background: rgba(255,255,255,0.02); }
.nav-tab.active { color: var(--accent); border-bottom-color: var(--accent); background: transparent; }

.nav-icon { font-size: 13px; }

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    padding: 24px 32px;
    max-width: 1920px;
    margin: 0 auto;
}

.panel { display: none; }
.panel.active { display: block; animation: fadeIn 0.25s ease-out; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-header { margin-bottom: 24px; }

.panel-title {
    font-family: var(--serif);
    font-size: 26px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.panel-subtitle {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text2);
}

/* ========================================
   KPI CARDS
   ======================================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: var(--gap);
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.kpi-card:hover {
    border-color: var(--border2);
    transform: translateY(-2px);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--accent);
    opacity: 0.7;
}

.kpi-card.green::before { background: var(--green); }
.kpi-card.red::before { background: var(--red); }
.kpi-card.amber::before { background: var(--amber); }
.kpi-card.purple::before { background: var(--purple); }

.kpi-label {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 600;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.kpi-value {
    font-family: var(--mono);
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.kpi-value.small { font-size: 16px; }

.kpi-value.loading {
    background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    height: 26px;
    width: 80%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.kpi-subvalue {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text3);
    margin-top: 4px;
}

.kpi-change {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-family: var(--mono);
    font-size: 10px;
    margin-top: 6px;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.kpi-change.positive { background: rgba(0, 200, 150, 0.12); color: var(--green); }
.kpi-change.negative { background: rgba(255, 77, 106, 0.12); color: var(--red); }

.kpi-pair {
    display: flex;
    gap: 14px;
    margin-top: 6px;
    font-family: var(--mono);
    font-size: 10px;
}

.kpi-pair-label { color: var(--text3); }
.kpi-pair-value { color: var(--text2); font-weight: 600; }

/* ========================================
   CHARTS
   ======================================== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
    margin-bottom: 24px;
}

.charts-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.charts-grid.cols-1 { grid-template-columns: 1fr; }

.chart-container {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}

.chart-container.span-2 { grid-column: span 2; }
.chart-container.span-3 { grid-column: span 3; }
.chart-container.span-full { grid-column: 1 / -1; }

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 16px;
    flex-wrap: wrap;
}

.chart-title {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    color: var(--text3);
    font-size: 13px;
    cursor: default;
    opacity: 0.6;
    transition: opacity 0.2s;
    line-height: 1;
    margin-left: 2px;
}
.chart-info-btn:hover { opacity: 1; }

/* Chart action buttons (download PNG, CSV, share) */
.chart-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}
.chart-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text3);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.chart-action-btn:hover { color: var(--accent); border-color: var(--accent); background: rgba(0,212,255,0.06); }
.chart-action-btn .action-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    background: #1e2530;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 10px;
    color: var(--text2);
    white-space: nowrap;
    pointer-events: none;
    z-index: 300;
}
.chart-action-btn:hover .action-tooltip { display: block; }

/* Share modal */
.share-modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 500;
    align-items: center;
    justify-content: center;
}
.share-modal-overlay.open { display: flex; }
.share-modal {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: 10px;
    padding: 24px;
    width: 320px;
    max-width: 90vw;
}
.share-modal h3 {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text);
    margin-bottom: 16px;
}
.share-btns { display: flex; flex-direction: column; gap: 8px; }
.share-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg3); color: var(--text2);
    font-family: var(--mono); font-size: 11px;
    cursor: pointer; transition: all 0.15s; text-decoration: none;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.share-close {
    margin-top: 16px; width: 100%;
    padding: 8px; border-radius: 6px;
    border: 1px solid var(--border); background: transparent;
    color: var(--text3); font-family: var(--mono); font-size: 11px;
    cursor: pointer; transition: all 0.15s;
}
.share-close:hover { color: var(--text); }

/* Cache status badge */
.cache-badge {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--amber);
    background: rgba(255,179,71,0.1);
    border: 1px solid rgba(255,179,71,0.25);
    border-radius: 3px;
    padding: 2px 6px;
    margin-left: 8px;
}

/* Chart source label */
.chart-source {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--text3);
    margin-top: 6px;
    text-align: right;
}

.chart-info-tooltip {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 240px;
    background: #1e2530;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 400;
    color: var(--text2);
    line-height: 1.5;
    z-index: 200;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    pointer-events: none;
}
.chart-info-btn:hover .chart-info-tooltip { display: block; }

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-family: var(--mono);
    font-size: 9px;
}

.legend-item { display: flex; align-items: center; gap: 5px; color: var(--text2); }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

/* Period Selector */
.period-selector {
    display: flex;
    gap: 4px;
    background: var(--bg3);
    border-radius: 6px;
    padding: 3px;
}

.period-btn {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    color: var(--text2);
    background: transparent;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.period-btn:hover {
    color: var(--text);
    background: var(--bg4);
}

.period-btn.active {
    color: var(--accent);
    background: var(--bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.chart-wrapper { height: 220px; position: relative; }
.chart-wrapper.tall { height: 280px; }
.chart-wrapper.short { height: 170px; }
.chart-wrapper.xtall { height: 340px; }

/* ========================================
   TABLES
   ======================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--mono);
    font-size: 11px;
}

.data-table th {
    text-align: left;
    padding: 10px 14px;
    background: var(--bg3);
    color: var(--text2);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 9px;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.data-table tr:hover td { background: rgba(255,255,255,0.015); }

.data-table .num { text-align: right; font-weight: 600; }

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.critical { background: rgba(255, 77, 106, 0.15); color: var(--red); }
.status-badge.high { background: rgba(255, 179, 71, 0.15); color: var(--amber); }
.status-badge.medium { background: rgba(0, 212, 255, 0.15); color: var(--accent); }
.status-badge.paid { background: rgba(0, 200, 150, 0.15); color: var(--green); }

/* ========================================
   SECTION DIVIDER
   ======================================== */
.section-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0 20px;
}

.section-divider-line { flex: 1; height: 1px; background: var(--border); }

.section-divider-text {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 700;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* ========================================
   NOTE BOX
   ======================================== */
.note-box {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-left: 3px solid var(--amber);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin: 16px 0;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.note-box.info  { border-left-color: var(--accent); }
.note-box.stale { border-left-color: var(--red); }
.note-box strong { color: var(--text); }

/* ========================================
   FOOTER
   ======================================== */
.footer {
    padding: 20px 32px;
    border-top: 1px solid var(--border);
    background: var(--bg2);
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text3);
}
.footer-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.footer-disclaimer {
    font-size: 9px;
    color: var(--text3);
    opacity: 1;
    line-height: 1.5;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.footer-links { display: flex; gap: 20px; }

.footer-link {
    color: var(--text2);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover { color: var(--accent); }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1400px) {
    .charts-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
    .chart-container.span-3 { grid-column: span 2; }
}

@media (max-width: 1000px) {
    .charts-grid, .charts-grid.cols-3 { grid-template-columns: 1fr; }
    .chart-container.span-2, .chart-container.span-3 { grid-column: span 1; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Tablet ── */
@media (max-width: 768px) {
    /* Header */
    .header { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
    .logo { margin-right: 0; }
    .logo-main, .logo-sub { font-size: 16px; }
    .header-meta { margin-left: 0; font-size: 11px; gap: 8px; }
    #lastUpdate { display: none; }

    /* Nav */
    .nav-tabs {
        order: 3;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
        padding-bottom: 2px;
    }
    .nav-tabs::-webkit-scrollbar { display: none; }
    .nav-tab { flex-shrink: 0; padding: 10px 14px; font-size: 11px; }
    .nav-icon { font-size: 14px; }

    /* Ticker */
    .ticker-container { display: none; }

    /* Content */
    .main-content { padding: 12px; gap: 12px; }
    .panel-header { margin-bottom: 16px; }
    .panel-title { font-size: 18px; }
    .panel-subtitle { font-size: 12px; }

    /* KPIs */
    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .kpi-card { padding: 14px; }
    .kpi-value { font-size: 18px; }

    /* Charts */
    .chart-container { padding: 12px; }
    .chart-header { flex-wrap: wrap; gap: 6px; }
    .chart-title { font-size: 10px; }
    .chart-wrapper { height: 200px; }
    .chart-wrapper.tall { height: 260px; }
    .chart-wrapper.short { height: 150px; }
    .chart-legend { flex-wrap: wrap; gap: 6px; }

    /* Period selector */
    .period-selector { gap: 2px; }
    .period-btn { padding: 4px 8px; font-size: 9px; }

    /* Chart actions */
    .chart-actions { gap: 4px; }
    .chart-action-btn { padding: 4px 7px; font-size: 10px; }

    /* Tables */
    .data-table { font-size: 11px; }
    .data-table th, .data-table td { padding: 7px 8px; }

    /* Section divider */
    .section-divider-text { font-size: 9px; }

    /* Footer */
    .footer { flex-direction: column; text-align: center; gap: 10px; padding: 16px; }
    .footer-links { justify-content: center; }
    .footer-disclaimer { text-align: center; }
}

/* ── Mobile ── */
@media (max-width: 500px) {
    /* Header */
    .logo-main, .logo-sub { font-size: 14px; }
    .logo-ar { font-size: 12px; }
    .status-indicator span { display: none; }

    /* Nav — solo iconos */
    .nav-tab .nav-label { display: none; }
    .nav-tab { padding: 10px 12px; }
    .nav-icon { font-size: 16px; }

    /* Content */
    .main-content { padding: 10px; gap: 10px; }

    /* KPIs — 2 columnas en móvil */
    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .kpi-card { padding: 12px 10px; }
    .kpi-label { font-size: 8px; }
    .kpi-value { font-size: 16px; }
    .kpi-value.small { font-size: 14px; }
    .kpi-subvalue { font-size: 9px; }
    .kpi-pairs { gap: 4px; }
    .kpi-pair { font-size: 10px; }

    /* Charts */
    .chart-wrapper { height: 180px; }
    .chart-wrapper.tall { height: 240px; }
    .chart-wrapper.short { height: 140px; }

    /* Tables — scroll horizontal */
    .chart-container:has(.data-table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .data-table { min-width: 480px; font-size: 10px; }
    .data-table th, .data-table td { padding: 6px 8px; }

    /* Balance BCRA */
    .balance-cols { height: 360px; }
    .balance-seg-label { font-size: 8px; }
    .balance-seg-val { display: none; }
    .balance-seg-pct { font-size: 7px; }
    .balance-year-selector { gap: 3px; }

    /* Period selector */
    .period-btn { padding: 3px 7px; font-size: 9px; }

    /* Share modal */
    .share-modal { padding: 20px 16px; margin: 0 12px; }
    .share-btns { gap: 8px; }
    .share-btn { padding: 10px 14px; font-size: 12px; }

    /* Note box */
    .note-box { font-size: 11px; padding: 10px 12px; }
}

/* ── Balance BCRA "Heladera" ── */
.balance-heladera {
    width: 100%;
    font-family: 'IBM Plex Mono', monospace;
}
.balance-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 10px;
    color: var(--text-muted);
}
.balance-meta strong { color: var(--text-primary); font-size: 11px; }
.balance-cols {
    display: flex;
    gap: 6px;
    height: 480px;
}
.balance-col {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.balance-col-title {
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    padding: 6px 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.balance-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 0;
}
.balance-seg {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 8px;
    border-radius: 3px;
    cursor: default;
    overflow: hidden;
    transition: filter 0.15s, transform 0.1s;
    min-height: 18px;
}
.balance-seg:hover { filter: brightness(1.25); z-index: 5; }
.balance-seg-label {
    font-size: 9px;
    font-weight: 600;
    color: rgba(0,0,0,0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.balance-seg-val {
    font-size: 9px;
    color: rgba(0,0,0,0.75);
    margin-left: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}
.balance-seg-pct {
    font-size: 8px;
    color: rgba(0,0,0,0.6);
    margin-left: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.balance-tooltip {
    display: none;
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, -110%);
    background: #1e2329;
    border: 1px solid #252b34;
    color: #e8eaed;
    font-size: 10px;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
}
.balance-seg:hover .balance-tooltip { display: block; }
.balance-col-total {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    padding: 6px 4px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}
.balance-nota {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: right;
}
.balance-year-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background: var(--bg3);
    border-radius: 6px;
    padding: 4px;
    margin-bottom: 12px;
}
.balance-pn-negativo {
    font-size: 10px;
    color: var(--red);
    background: rgba(255,77,106,0.08);
    border: 1px solid rgba(255,77,106,0.2);
    border-radius: 4px;
    padding: 6px 10px;
    margin-bottom: 10px;
    font-family: var(--mono);
}
