/* SUS360 Painel Cirurgias v0.8.0 — painel */

        /* ═══════ CARD SUB-HEADER — linha de filtros/controles abaixo do header ═══════ */
        .card-subheader {
            display: flex;
            align-items: center;
            justify-content: space-evenly;
            padding: 6px 16px 8px;
            border-bottom: 1px solid color-mix(in srgb, var(--border-color) 100%, black 10%);
            gap: 12px;
            flex-wrap: wrap;
            position: relative;
            overflow: hidden;
        }
        .card-subheader::after {
            content: '';
            position: absolute;
            top: 0; left: -100%; width: 60%; height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
            animation: subheader-shimmer 8s ease-in-out infinite;
            pointer-events: none;
        }
        body.dark .card-subheader {
            border-bottom-color: color-mix(in srgb, var(--border-color) 100%, white 8%);
        }
        body.dark .card-subheader::after {
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
        }
        @keyframes subheader-shimmer {
            0% { left: -100%; }
            50% { left: 150%; }
            100% { left: 150%; }
        }

        /* Shimmer no chart-header também */
        .chart-header { position: relative; overflow: hidden; }
        .chart-header::after {
            content: '';
            position: absolute;
            top: 0; left: -100%; width: 60%; height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
            animation: subheader-shimmer 8s ease-in-out 4s infinite;
            pointer-events: none;
        }
        body.dark .chart-header::after {
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.02), transparent);
        }

        .card-foot { display:flex; align-items:center; justify-content:space-between; padding:4px 12px; border-top:1px solid var(--border-color); font-size:11px; font-weight:600; letter-spacing:0.3px; color:rgba(0,0,0,0.45); height:28px; min-height:28px; max-height:28px; box-sizing:content-box; }
        .card-foot-info { display:flex; align-items:center; gap:6px; white-space:nowrap; flex-wrap:wrap; }
        .card-foot-actions { display:flex; align-items:center; gap:8px; }
        .card-foot-actions { display:flex; align-items:center; gap:6px; padding:2px; }
        .card-foot-action {
            font-size:14px; cursor:pointer; opacity:0.3;
            transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
            display:inline-flex; align-items:center; justify-content:center;
            width:24px; height:24px; border-radius:6px;
            color: var(--text-muted);
        }
        .card-foot-action:hover {
            opacity:1; transform:scale(1.4) translateY(-4px);
            background: var(--bg-body); box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        }
        /* Efeito dock: vizinhos crescem também */
        .card-foot-action:hover + .card-foot-action { opacity:0.7; transform:scale(1.15) translateY(-2px); }
        .card-foot-action:hover + .card-foot-action + .card-foot-action { opacity:0.5; transform:scale(1.05); }
        /* Cores individuais no hover */
        .card-foot-action.act-png:hover { color:#22c55e; }
        .card-foot-action.act-svg:hover { color:#06b6d4; }
        .card-foot-action.act-pdf:hover { color:#ef4444; }
        .card-foot-action.act-csv:hover { color:#f59e0b; }
        .card-foot-action.act-excel:hover { color:#16a34a; }
        .card-foot-action.act-copy:hover { color:#3b82f6; }
        .card-foot-action.act-link:hover { color:#a855f7; }
        .card-foot-action.act-fullscreen:hover { color:#f59e0b; }
        .card-foot-action.act-print:hover { color:#6366f1; }

        /* ═══════ CARD VAZIO / INVÁLIDO ═══════ */
        .card-empty-overlay {
            position:absolute; inset:0; z-index:5;
            display:flex; flex-direction:column;
            align-items:center; justify-content:center;
            gap:10px; border-radius:inherit;
            background: var(--bg-card);
            opacity:0.95;
        }
        .card-empty-icon { font-size:32px; opacity:0.3; }
        .card-empty-msg { font-size:13px; font-weight:600; color:var(--text-muted); text-align:center; max-width:250px; line-height:1.4; }
        .card-empty-btn {
            font-size:11px; font-weight:600; padding:4px 14px;
            border:1px solid var(--border-color); border-radius:6px;
            background:transparent; color:var(--text-secondary);
            cursor:pointer; transition:all 0.15s;
        }
        .card-empty-btn:hover { background:var(--sus-blue); color:#fff; border-color:var(--sus-blue); }
        .card-empty-overlay.is-invalid { border:2px solid rgba(245,158,11,0.3); }
        .card-empty-overlay.is-invalid .card-empty-icon { color:#f59e0b; opacity:0.5; }

        /* Fullscreen */
        .chart-card.is-fullscreen {
            position:fixed !important; inset:0; z-index:9999;
            border-radius:0; margin:0; max-width:none;
            background:var(--bg-card);
            display:flex; flex-direction:column;
        }
        .chart-card.is-fullscreen .chart-body { flex:1; }
        .chart-card.is-fullscreen .card-foot-action.act-fullscreen::before { content:'\F128'; }
        /* Botão fechar fullscreen — grande e visível */
        .fullscreen-close {
            display:none; position:absolute; top:16px; right:20px; z-index:10;
            width:44px; height:44px; border-radius:50%;
            background:var(--bg-body); border:2px solid var(--border-color);
            box-shadow:0 4px 20px rgba(0,0,0,0.2);
            align-items:center; justify-content:center;
            cursor:pointer; font-size:22px; color:var(--text-primary);
            transition:all 0.2s;
        }
        .chart-card.is-fullscreen .fullscreen-close { display:flex; }
        .fullscreen-close:hover {
            background:rgba(239,68,68,0.1); border-color:#ef4444;
            color:#ef4444; transform:scale(1.15);
        }
        body.dark .card-foot { color:rgba(255,255,255,0.35); }
        .card-foot-dot { opacity:0.5; }
        .card-foot-brand { font-weight:700; letter-spacing:0.5px; }
        .kpi-grid .card-foot, .kpi-2 .card-foot { grid-column:1/-1; border-top:none; padding-top:4px; }

        /* ═══════ CHART COMPONENTS ═══════ */
        .chart-card {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            overflow: hidden;
            margin-bottom: var(--space-lg);
        }
        .chart-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            padding: 16px 20px 12px;
            border-bottom: 1px solid var(--border-color);
        }
        .chart-title {
            font-size: 14px;
            font-weight: 700;
            color: var(--text-primary);
            margin: 0;
        }
        .chart-subtitle {
            font-size: 11px;
            color: var(--text-muted);
            margin: 4px 0 0;
        }
        .chart-body {
            padding: 12px 16px 4px;
        }
        .chart-tabs {
            display: flex;
            gap: 4px;
            background: var(--bg-body);
            border-radius: 6px;
            padding: 2px;
        }
        .chart-tab {
            padding: 4px 12px;
            border: none;
            border-radius: 4px;
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
            background: transparent;
            color: var(--text-muted);
            transition: all 0.15s;
        }
        .chart-tab.active {
            background: var(--bg-card);
            color: var(--text-primary);
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }
        .chart-tab:hover:not(.active) { color: var(--text-primary); }

        /* ═══════ ANO TAB — mesmo estilo que chart-tab ═══════ */
        .ano-tab {
            position: relative;
            min-width: 34px;
            padding: 5px 10px;
            font-size: 12px;
        }
        .ano-tab.in-range {
            background: rgba(0,102,204,0.08);
            color: var(--sus-blue);
        }
        .ano-tab.active {
            background: var(--sus-blue) !important;
            color: white !important;
            box-shadow: 0 1px 4px rgba(0,102,204,0.3);
        }
        .ano-tab[data-ano="2026"] {
            border: 1px solid var(--color-success);
        }
        .ano-tab[data-ano="2026"].active {
            background: var(--color-success) !important;
            border-color: var(--color-success) !important;
            box-shadow: 0 1px 4px rgba(34,197,94,0.3);
        }
        .ano-atual-dot {
            position: absolute;
            top: 2px;
            right: 2px;
            width: 5px;
            height: 5px;
            border-radius: 50%;
            background: var(--color-success);
        }
        .ano-tab[data-ano="2026"].active .ano-atual-dot {
            background: white;
        }
        .chart-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
        .chart-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-lg); }
        @media (max-width:768px) { .chart-2, .chart-3 { grid-template-columns: 1fr; } }
        .sh {
            font-size: 16px;
            font-weight: 800;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 8px;
            margin: var(--space-xl) 0 var(--space-md);
            padding-bottom: 8px;
            border-bottom: 1px solid var(--border-color);
        }
        .sh i { font-size: 18px; color: var(--text-muted); }

        /* ═══════ VIEW SWITCH — Panorama / Dados ═══════ */
        .view-switch {
            display: inline-flex;
            align-items: center;
            background: rgba(0,73,144,0.06);
            border: 1px solid rgba(0,73,144,0.12);
            border-radius: 12px;
            padding: 3px;
            gap: 2px;
        }
        body.dark .view-switch {
            background: rgba(255,255,255,0.04);
            border-color: rgba(255,255,255,0.08);
        }
        .view-switch-btn {
            padding: 6px 16px;
            border: none;
            background: transparent;
            border-radius: 10px;
            font-size: 12px;
            font-weight: 600;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            align-items: center;
            gap: 6px;
            position: relative;
            white-space: nowrap;
        }
        .view-switch-btn i { font-size: 13px; }
        .view-switch-btn:hover {
            color: var(--sus-blue);
            background: rgba(0,73,144,0.06);
        }
        .view-switch-btn.active {
            background: var(--sus-blue);
            color: white;
            box-shadow: 0 2px 12px rgba(0,73,144,0.35);
            transform: scale(1.02);
        }
        .view-switch-btn.active:hover {
            background: var(--sus-blue);
            color: white;
        }

        /* ═══════ YEAR PILL 2026 — Highlight ═══════ */
        .year-pill[data-ano="2026"] {
            border: 1.5px solid var(--color-success);
            position: relative;
        }
        .year-pill[data-ano="2026"].active {
            background: var(--color-success) !important;
            border-color: var(--color-success) !important;
        }
        .year-pill[data-ano="2026"]::after {
            content: '';
            position: absolute;
            top: -2px;
            right: -2px;
            width: 6px;
            height: 6px;
            background: var(--color-success);
            border-radius: 50%;
            animation: pulse-dot 2s infinite;
        }
        @keyframes pulse-dot {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.5; transform: scale(1.3); }
        }

        /* ═══════ TOPBAR — Title Group (override topbar.css column → row) ═══════ */
        .header-title-group {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 10px;
            min-width: auto;
            flex-shrink: 0;
        }
        .header-title {
            font-size: 14px;
            font-weight: 700;
            color: var(--text-primary);
            white-space: nowrap;
        }

        @media (max-width:1024px) {
            .header-title-group { gap:6px; flex-direction:row; }
            .period-trigger { padding:5px 10px; font-size:11px; }
            .period-trigger i:first-child { font-size:14px; }
            .view-switch-btn { padding:5px 12px; font-size:11px; }
        }
        [x-cloak] { display: none !important; }
        /* ═══════ VIEW TRANSITIONS ═══════ */
        .transition { transition-property: all; }
        .ease-out { transition-timing-function: cubic-bezier(0, 0, 0.2, 1); }
        .ease-in { transition-timing-function: cubic-bezier(0.4, 0, 1, 1); }
        .duration-200 { transition-duration: 200ms; }
        .duration-150 { transition-duration: 150ms; }
        .opacity-0 { opacity: 0; }
        .opacity-100 { opacity: 1; }
        .translate-y-2 { transform: translateY(8px); }
        .translate-y-0 { transform: translateY(0); }

        .skip-link { position:absolute; top:-40px; left:0; background:var(--sus-blue); color:white; padding:var(--space-sm) var(--space-md); text-decoration:none; z-index:100; border-radius:0 0 var(--radius-md) 0; }
        .skip-link:focus { top:0; }

        /* KPI icon variants */
        .kpi-icon.blue { background:rgba(0,102,204,0.1); color:var(--sus-blue); }
        .kpi-icon.green { background:rgba(34,197,94,0.1); color:#16a34a; }

        /* Filter chips */
        .filter-chips { display:flex; align-items:center; gap:5px; flex-wrap:wrap; margin-left:4px; }
        .filter-chip { display:inline-flex; align-items:center; gap:4px; padding:3px 8px 3px 7px; background:rgba(0,102,204,0.07); color:var(--sus-blue); border-radius:var(--radius-full); font-size:11px; font-weight:600; white-space:nowrap; }
        .filter-chip-x { background:none; border:none; color:inherit; cursor:pointer; padding:0; font-size:13px; line-height:1; opacity:0.45; transition:opacity 0.15s; margin-left:2px; }
        .filter-chip-x:hover { opacity:1; }

        /* ═══════ TOPBAR — Period Picker (ISSUE-012) ═══════ */
        .header-sep-dot {
            width: 4px;
            height: 4px;
            border-radius: 50%;
            background: var(--border-color);
            flex-shrink: 0;
        }
        .period-picker { position: relative; }
        .period-trigger {
            display: flex; align-items: center; gap: 8px;
            padding: 6px 14px; background: rgba(0,73,144,0.05);
            border: 1px solid rgba(0,73,144,0.1); border-radius: 10px;
            font-size: 12px; font-weight: 600; color: var(--text-primary);
            cursor: pointer; white-space: nowrap; transition: all 0.15s;
        }
        .period-trigger:hover { border-color: var(--sus-blue); }
        .period-trigger i:first-child { font-size: 16px; color: var(--sus-blue); }
        body.dark .period-trigger { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); }

        .period-panel {
            position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
            background: var(--bg-card); border: 1px solid var(--border-color);
            border-radius: 16px; box-shadow: 0 12px 48px rgba(0,0,0,0.2);
            padding: 20px; min-width: 320px; z-index: 1200;
        }
        body.dark .period-panel { box-shadow: 0 12px 48px rgba(0,0,0,0.5); }

        .period-title {
            font-size: 11px; font-weight: 700; color: var(--text-muted);
            text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px;
        }

        .period-anos-grid {
            display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
            margin-bottom: 16px;
        }
        .period-ano-btn {
            position: relative; padding: 10px 8px; border: 1px solid var(--border-color);
            border-radius: 8px; font-size: 14px; font-weight: 600;
            color: var(--text-secondary); background: transparent;
            cursor: pointer; transition: all 0.15s; text-align: center;
        }
        .period-ano-btn:hover { border-color: var(--sus-blue); color: var(--sus-blue); }
        .period-ano-btn.selected {
            background: var(--sus-blue); border-color: var(--sus-blue); color: white;
        }
        .period-ano-btn.current { border-color: var(--color-success); }
        .period-ano-btn.current.selected {
            background: var(--color-success); border-color: var(--color-success);
        }
        .period-ano-dot {
            position: absolute; top: 4px; right: 4px; width: 6px; height: 6px;
            background: var(--color-success); border-radius: 50%;
            animation: pulse-dot 2s infinite;
        }
        .period-ano-btn.selected .period-ano-dot { background: white; }

        .period-divider {
            height: 1px; background: var(--border-color); margin: 12px 0;
        }

        .period-shortcuts {
            display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px;
        }
        .period-shortcuts button {
            padding: 5px 12px; border: 1px solid var(--border-color);
            border-radius: 20px; font-size: 11px; font-weight: 600;
            color: var(--text-muted); background: transparent;
            cursor: pointer; transition: all 0.15s;
        }
        .period-shortcuts button:hover {
            border-color: var(--sus-blue); color: var(--sus-blue);
            background: rgba(0,73,144,0.05);
        }

        .period-actions {
            display: flex; justify-content: flex-end; gap: 8px;
 border-top: 1px solid var(--border-color);
        }
        .period-clear {
            padding: 6px 16px; border: none; background: transparent;
            font-size: 12px; font-weight: 600; color: var(--text-muted);
            cursor: pointer;
        }
        .period-clear:hover { color: var(--color-danger); }
        .period-apply {
            padding: 6px 20px; border: none; border-radius: 8px;
            background: var(--sus-blue); color: white;
            font-size: 12px; font-weight: 700; cursor: pointer;
            transition: background 0.15s;
        }
        .period-apply:hover { background: #0055aa; }

        /* ═══════ TOPBAR — Nav Dropdown (padrao hemodialise) ═══════ */
        .header-nav { display:flex; align-items:center; gap:4px; }
        .nav-link-hd { padding:6px 14px; text-decoration:none; font-size:13px; font-weight:500; color:var(--text-secondary); border-radius:8px; transition:all 0.2s; display:flex; align-items:center; gap:6px; white-space:nowrap; }
        .nav-link-hd:hover { background:rgba(0,73,144,0.08); color:var(--sus-blue); text-decoration:none; }
        .nav-link-hd.active { background:var(--sus-blue); color:white; }
        /* nav-home e header-sep-vertical: framework no critical CSS */
        .nav-home-flag { transition:transform 0.2s; }
        .nav-home-btn:hover .nav-home-flag { transform:scale(1.1); }
        /* ═══════ PAINEIS MODAL — Mini Cards ═══════ */
        .paineis-sidebar-btn i { font-size: 16px; }
        .paineis-modal-overlay {
            position: fixed; inset: 0; z-index: 10000;
            background: rgba(0,0,0,0.45);
            display: none; align-items: center; justify-content: center;
            padding: 24px;
        }
        body.dark .paineis-modal-overlay { background: rgba(0,0,0,0.7); }
        .paineis-modal-overlay.sb-open { display: flex; }
        .pm-panel {
            width: 100%; max-width: 520px; max-height: 85vh;
            background: var(--bg-card);
            border-radius: 20px;
            box-shadow: 0 24px 80px rgba(0,0,0,0.25), 0 0 0 1px rgba(128,128,128,0.06);
            display: flex; flex-direction: column;
            overflow: hidden; overscroll-behavior: contain;
            animation: dp-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        }
        @media (max-width: 768px) {
            .paineis-modal-overlay { padding: 0; align-items: flex-end; }
            .pm-panel { max-width: 100%; border-radius: 20px 20px 0 0; max-height: 90vh; animation: dp-up 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
        }

        .pm-cards-area {
            flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain; padding: 4px 16px 16px;
        }
        .pm-section-label {
            font-size: 10px; font-weight: 700; text-transform: uppercase;
            letter-spacing: 0.5px; opacity: 0.4; padding: 14px 4px 8px;
            display: flex; align-items: center; gap: 6px;
        }
        .pm-section-label i { font-size: 12px; opacity: 1; }
        .pm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
        @media (max-width: 400px) { .pm-grid { grid-template-columns: repeat(2, 1fr); } }

        .pm-card {
            display: flex; flex-direction: column; align-items: center; gap: 8px;
            padding: 16px 8px 12px; border-radius: 14px;
            border: 1.5px solid rgba(128,128,128,0.1);
            background: transparent; text-decoration: none; color: inherit;
            transition: all 0.15s; position: relative;
        }
        .pm-card:hover { border-color: var(--sus-blue, #004990); background: rgba(0,73,144,0.04); transform: translateY(-2px); text-decoration: none; }
        .pm-card:active { transform: scale(0.97); }
        .pm-card.pm-active { border-color: var(--sus-blue, #004990); background: rgba(0,73,144,0.06); }

        .pm-card-icon {
            width: 40px; height: 40px; border-radius: 12px;
            display: flex; align-items: center; justify-content: center;
            font-size: 18px; color: #fff;
        }
        .pm-card-name { font-size: 11px; font-weight: 600; text-align: center; line-height: 1.3; }
        .pm-card-tag {
            position: absolute; top: 6px; right: 6px;
            font-size: 8px; font-weight: 700; padding: 2px 5px;
            border-radius: 4px; opacity: 0.5;
        }
        .pm-card-tag.pm-novo { background: rgba(16,185,129,0.15); color: #10b981; opacity: 1; }
        .pm-card.pm-active .pm-card-tag { background: rgba(0,73,144,0.15); color: var(--sus-blue, #004990); opacity: 1; }

        .pm-footer {
            padding: 12px 16px 16px; border-top: 1px solid rgba(128,128,128,0.08);
            display: flex; align-items: center; justify-content: space-between;
        }
        .pm-theme-btn {
            display: flex; align-items: center; gap: 6px;
            padding: 8px 14px; font-size: 12px; font-weight: 600;
            border: 1px solid rgba(128,128,128,0.12); border-radius: 10px;
            background: transparent; color: inherit; cursor: pointer; opacity: 0.6;
        }
        .pm-theme-btn:active { opacity: 1; }
        .pm-footer-info { display: flex; align-items: center; gap: 8px; }
        .dd-col { display:flex; flex-direction:column; }
        .dd-col + .dd-col { border-left:1px solid var(--border-color); padding-left:20px; }
        .dd-section { margin-bottom:4px; }
        .dd-section + .dd-section { border-top:1px solid var(--border-color); padding-top:10px; margin-top:6px; }
        .dd-section-header { display:flex; align-items:center; gap:8px; padding:4px 10px 6px; }
        .dd-section-icon { width:28px; height:28px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:14px; color:#fff; flex-shrink:0; }
        .dd-section-label { font-size:11px; font-weight:700; color:var(--text-primary); line-height:1.2; }
        .dd-section-sub { font-size:9px; font-weight:500; color:var(--text-muted); letter-spacing:0.3px; }
        .dd-item-hd { display:flex; align-items:center; gap:8px; padding:7px 12px; text-decoration:none; color:var(--text-primary); font-size:12.5px; font-weight:500; border-radius:8px; transition:all 0.15s; }
        .dd-item-hd:hover { background:rgba(0,73,144,0.06); color:var(--sus-blue); text-decoration:none; }
        .dd-item-hd.dd-active { background:rgba(0,73,144,0.08); color:var(--sus-blue); font-weight:700; }
        .dd-item-hd i { font-size:13px; width:18px; text-align:center; flex-shrink:0; opacity:0.7; }
        .dd-item-hd.dd-active i { opacity:1; }

        /* Hamburger mobile — REMOVIDO (agora usa header isolado .mobile-only) */

        /* ═══════ EVO KPIs (mini indicadores acima do grafico) ═══════ */
        .evo-kpis {
            display:flex; align-items:center; gap:20px; flex-wrap:wrap;
            padding:14px 20px; margin-bottom:14px;
            background:var(--bg-card); border:1px solid var(--border-color); border-radius:var(--radius-lg);
            box-shadow:0 1px 3px rgba(0,0,0,0.04);
        }
        .evo-kpi { display:flex; flex-direction:column; gap:3px; }
        .evo-kpi-label { font-size:10px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.4px; }
        .evo.kpi-val {
            /* overflow managed by fitText JS */
             font-size:14px; font-weight:800; color:var(--text-primary); display:flex; align-items:center; gap:5px; font-variant-numeric:tabular-nums; white-space:nowrap; }
        .evo-kpi-sep { width:1px; height:32px; background:var(--border-color); flex-shrink:0; }
        @media (max-width:600px) { .evo-kpis { gap:12px; padding:10px 14px; } .evo.kpi-val {
            /* overflow managed by fitText JS */
             font-size:14px; } }

        /* ═══════ Evolução Temporal — Custom Tooltip ═══════ */
        .evo-tooltip {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            padding: 14px 16px;
            min-width: 230px;
            max-width: 300px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
            font-family: var(--font-family);
        }
        .evo-tt-header {
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            padding-bottom: 8px;
            margin-bottom: 8px;
            border-bottom: 1px solid var(--border-color);
        }
        .evo-tt-row {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 4px 0;
        }
        .evo-tt-row-media {
            opacity: 0.6;
        }
        .evo-tt-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            flex-shrink: 0;
        }
        .evo-tt-label {
            font-size: 12px;
            font-weight: 500;
            color: var(--text-secondary);
            flex: 1;
        }
        .evo-tt-val {
            font-size: 13px;
            font-weight: 700;
            color: var(--text-primary);
            font-variant-numeric: tabular-nums;
        }
        .evo-tt-yoy {
            font-size: 11px;
            font-weight: 600;
            margin-top: 8px;
            padding-top: 8px;
            border-top: 1px solid var(--border-color);
        }
        .evo-tt-ctx {
            font-size: 10px;
            font-weight: 500;
            color: var(--text-muted);
            margin-top: 4px;
        }

        /* ═══════ Main ═══════ */
        #painel-scope { }
        /* main padding-top controlado pelo critical CSS inline via --topbar-total */
        main { background:transparent; padding: 0; margin: 0; }
        .wrap { max-width:1400px; margin:0 auto; padding:var(--space-xl) var(--space-lg); }

        /* Section headers */
        .sh { font-size:var(--font-size-xl); font-weight:700; color:var(--text-primary); margin:var(--space-2xl) 0 var(--space-md); padding-bottom:var(--space-sm); border-bottom:2px solid var(--sus-blue); display:flex; align-items:center; gap:var(--space-sm); }
        .sh i { color:var(--sus-blue); }
        .sh:first-child { margin-top:0; }

        /* Loading */
        .loading-box { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:var(--space-2xl) 0; gap:var(--space-md); min-height:300px; }
        .spinner { width:48px; height:48px; border:4px solid var(--border-color); border-top-color:var(--sus-blue); border-radius:50%; animation:spin 0.8s linear infinite; }
        @keyframes spin { to { transform:rotate(360deg); } }

        /* Error */
        .error-banner { background:rgba(220,53,69,0.08); border:1px solid rgba(220,53,69,0.2); border-radius:var(--radius-md); padding:var(--space-md); margin-bottom:var(--space-lg); color:var(--color-danger); font-weight:500; }

        /* Chart Grid */
        .chart-2 { display:grid; grid-template-columns:1fr 1fr; gap:var(--space-lg); }
        .chart-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:var(--space-lg); }
        @media (max-width:768px) { .chart-2, .chart-3 { grid-template-columns:1fr; } }

        /* Badge */
        .badge { display:inline-block; padding:2px 8px; border-radius:var(--radius-sm); font-size:var(--font-size-xs); font-weight:600; }
        .badge-blue { background:rgba(0,102,204,0.1); color:var(--sus-blue); }
        .badge-green { background:rgba(34,197,94,0.1); color:var(--color-success); }
        .badge-purple { background:rgba(139,92,246,0.1); color:#8b5cf6; }
        .badge-yellow { background:rgba(245,158,11,0.1); color:#b45309; }
        .text-center { text-align:center; }

        /* ═══════ HERO — 4 Cards (2x2 → 4 colunas desktop) ═══════ */
        .hero-kpi {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
            margin-bottom: var(--space-xl);
        }
        .hero-card {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: var(--shadow-sm);
            transition: box-shadow 0.2s, border-color 0.2s;
        }
        .hero-card:hover {
            box-shadow: var(--shadow-md);
            border-color: rgba(0,73,144,0.12);
        }

        /* ═══════ MINI CARDS (4 colunas) ═══════ */
        .hc-mini-accent { height: 2px; background: var(--hc-accent, #0066cc); flex-shrink: 0; border-radius: 14px 14px 0 0; opacity: 0.85; }
        .hc-mini { padding: 16px 18px 14px; }
        .hc-mini-head { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
        .hc-mini-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; color: #fff; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.18); }
        .hc-mini-label { font-size: 13px; font-weight: 700; line-height: 1.3; color: var(--text-primary); }
        .hc-mini-label span { display: block; font-size: 10px; font-weight: 500; color: var(--text-muted); opacity: 0.7; margin-top: 1px; }
        .hc-mini-hero { font-size: clamp(26px, 3.2vw, 38px); font-weight: 900; line-height: 1.05; letter-spacing: -0.5px; color: var(--text-primary); font-variant-numeric: tabular-nums; margin-bottom: 14px; }
        .hc-mini-bar { margin-bottom: 13px; }
        .hc-mini-bar-labels { display: flex; justify-content: space-between; align-items: center; font-size: 10px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; gap: 6px; }
        .hc-mini-bar-labels span { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
        .hc-mini-bar-labels b { font-weight: 800; color: var(--text-primary); }
        .hc-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; vertical-align: middle; flex-shrink: 0; }
        .hc-dot-muted { background: rgba(0,0,0,0.15); }
        body.dark .hc-dot-muted { background: rgba(255,255,255,0.18); }
        .hc-mini-bar-track { height: 8px; border-radius: 4px; background: rgba(0,0,0,0.07); overflow: hidden; position: relative; }
        body.dark .hc-mini-bar-track { background: rgba(255,255,255,0.06); }
        .hc-mini-bar-seg { height: 100%; border-radius: 4px; transition: width 0.7s cubic-bezier(0.34, 1, 0.64, 1); position: relative; }
        .hc-bar-glow-green { background: linear-gradient(90deg, #10b981, #34d399); box-shadow: 0 0 6px rgba(16,185,129,0.35); }
        .hc-bar-glow-blue { background: linear-gradient(90deg, #3b82f6, #60a5fa); box-shadow: 0 0 6px rgba(59,130,246,0.35); }
        .hc-bar-glow-purple { background: linear-gradient(90deg, #8b5cf6, #a78bfa); box-shadow: 0 0 6px rgba(139,92,246,0.35); }
        .hc-mini-metrics { display: flex; gap: 8px; margin-top: auto; margin-bottom: 12px; }
        .hc-mini-metric { flex: 1; padding: 8px 10px; border-radius: 8px; background: var(--bg-body); border: 1px solid var(--border-color); min-width: 0; }
        body.dark .hc-mini-metric { background: rgba(255,255,255,0.03); }
        .hc-mini-metric-val { display: block; font-size: 13px; font-weight: 800; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
        .hc-mini-metric-lbl { display: block; font-size: 9px; font-weight: 600; color: var(--text-muted); opacity: 0.6; text-transform: uppercase; letter-spacing: 0.4px; margin-top: 2px; }
        .hc-mini-foot { display: flex; align-items: center; gap: 4px; font-size: 9px; font-weight: 600; color: var(--text-muted); opacity: 0.55; padding-top: 10px; border-top: 1px solid var(--border-color); letter-spacing: 0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .hc-mini-foot i { font-size: 9px; flex-shrink: 0; }
        .hc-foot-sep { opacity: 0.4; margin: 0 1px; }
        .wrap-panorama { padding-top: 14px !important; padding-bottom: 0 !important; }
        /* Light mode: card silver tone — more visible against #f8f9fa */
        body:not(.dark) .hero-card {
            background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
            border-color: rgba(0,0,0,0.1);
            box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
        }
        body:not(.dark) .hero-card:hover {
            border-color: rgba(0,73,144,0.15);
            box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06);
        }

        /* ── Card Header ── */
        .hc-header {
            padding: 18px 18px 14px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: flex-start;
            gap: 12px;
        }
        .hc-icon {
            width: 48px; height: 48px; border-radius: 12px;
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0;
        }
        .hc-icon .bi { font-size: 28px; }
        .hc-icon.producao { background: rgba(0,100,30,0.1); }
        .hc-icon.producao .bi { color: #006420; }
        .hc-icon.financeiro { background: rgba(0,100,30,0.1); }
        .hc-icon.financeiro .bi { color: #006420; }
        .hc-icon.perfil { background: rgba(0,100,30,0.1); }
        .hc-icon.perfil .bi { color: #006420; }
        body.dark .hc-icon.producao { background: rgba(0,156,59,0.15); }
        body.dark .hc-icon.producao .bi { color: #00b94a; }
        body.dark .hc-icon.financeiro { background: rgba(0,156,59,0.15); }
        body.dark .hc-icon.financeiro .bi { color: #00b94a; }
        body.dark .hc-icon.perfil { background: rgba(0,156,59,0.15); }
        body.dark .hc-icon.perfil .bi { color: #00b94a; }

        /* ── Card Period (below território) ── */
        .hc-period-line {
            display: flex; align-items: center; gap: 6px;
            margin-top: 6px;
        }
        .hc-period-line i {
            font-size: 11px; color: var(--text-muted); opacity: 0.5; flex-shrink: 0;
        }
        .hc-period-badges {
            display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
        }
        .hc-period-badge {
            display: inline-flex; align-items: center; gap: 3px;
            padding: 2px 8px; border-radius: 20px;
            background: var(--bg-body); border: 1px solid var(--border-color);
            font-size: 10px; font-weight: 700; color: var(--text-muted);
            letter-spacing: 0.3px; white-space: nowrap;
        }
        .hc-period-badge.active {
            background: rgba(0,100,32,0.08); border-color: rgba(0,100,32,0.2);
            color: #006420;
        }
        body.dark .hc-period-badge.active {
            background: rgba(0,185,74,0.12); border-color: rgba(0,185,74,0.25);
            color: #4ade80;
        }

        .hc-header-text { flex: 1; min-width: 0; }
        .hc-titulo {
            font-size: 26px; font-weight: 900; color: var(--text-primary);
            text-transform: uppercase; letter-spacing: 1.5px;
            line-height: 1.1;
        }
        .hc-subtitulo {
            display: block; font-weight: 500; font-size: 13px; letter-spacing: 0.5px; opacity: 0.55; margin-top: 2px;
        }
        .hc-territorio {
            display: flex; align-items: center; gap: 6px;
            font-size: 11px; font-weight: 500; color: var(--text-muted);
            margin-top: 4px;
        }
        .hc-territorio img {
            width: 18px; height: 13px; border-radius: 2px; object-fit: cover;
            box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
        }

        /* ── Card Body ── */
        .hc-body { padding: 18px; flex: 1; }

        /* ── Valor Principal ── */
        .hc-valor-principal {
            font-size: clamp(1.4rem, 2.5vw, 2rem);
            font-weight: 900; color: var(--text-primary);
            line-height: 1; font-variant-numeric: tabular-nums;
            letter-spacing: -1.5px; margin-bottom: 6px;
        }
        .hc-valor-nota {
            font-size: 11px; font-weight: 500; color: var(--text-muted);
            margin-bottom: 14px; display: flex; align-items: center; gap: 5px;
        }
        .hc-valor-nota i { font-size: 11px; opacity: 0.5; }
        /* ROL/PATE card enhancements (legacy) */
        .hc-body .hc-valor-nota.nota-lg { font-size:14px; font-weight:600; }
        .hc-body .hc-valor-nota.nota-tag { font-size:12px; line-height:1.6; opacity:0.7; }
        .hc-body .hc-valor-nota.nota-tag i { font-size:14px; opacity:0.7; }
        .rol-pate-spacing { margin-bottom:var(--space-xl,32px); }

        /* ═══════ ROL/PATE cards ═══════ */
        .sc-card { background:var(--bg-card); border:1px solid var(--border-color); border-radius:16px; display:flex; flex-direction:column; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,0.04); }
        body.dark .sc-card { background:hsl(222 47% 11%); border-color:hsl(217 33% 17%); }
        .sc-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:20px 24px 0; }
        .sc-header-left { display:flex; align-items:center; gap:12px; }
        .sc-badge { width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:20px; flex-shrink:0; }
        .sc-badge-blue  { background:rgba(59,130,246,0.12); color:#3b82f6; }
        .sc-badge-green { background:rgba(34,197,94,0.12);  color:#22c55e; }
        .sc-title { font-size:17px; font-weight:800; color:var(--text-primary); line-height:1.2; }
        body.dark .sc-title { color:#f1f5f9; }
        .sc-desc { font-size:12px; color:var(--text-muted); margin-top:1px; }
        .sc-yoy { display:inline-flex; align-items:center; gap:4px; font-size:12px; font-weight:700; padding:4px 10px; border-radius:20px; white-space:nowrap; flex-shrink:0; background:rgba(100,116,139,0.1); color:var(--text-muted); font-variant-numeric:tabular-nums; }
        .sc-hero { padding:14px 24px 12px; }
        .sc-hero-value { font-size:clamp(2.4rem,5vw,3rem); font-weight:900; color:var(--text-primary); letter-spacing:-1.5px; line-height:1; font-variant-numeric:tabular-nums; }
        body.dark .sc-hero-value { color:#f8fafc; }
        .sc-hero-sub { display:flex; align-items:center; gap:8px; margin-top:6px; flex-wrap:wrap; font-size:14px; color:var(--text-muted); font-weight:500; }
        .sc-hero-sub strong { font-weight:700; color:var(--text-secondary); }
        .sc-tag { font-size:13px; font-weight:700; padding:4px 12px; border-radius:8px; white-space:nowrap; }
        .sc-tag-blue  { background:rgba(59,130,246,0.12); color:#2563eb; }
        .sc-tag-green { background:rgba(34,197,94,0.12);  color:#16a34a; }
        body.dark .sc-tag-blue  { color:#60a5fa; }
        body.dark .sc-tag-green { color:#4ade80; }
        /* Donut + bars row */
        .sc-viz { display:flex; align-items:center; gap:20px; padding:4px 24px 14px; }
        .sc-donut-wrap { flex-shrink:0; position:relative; width:110px; height:110px; }
        .sc-donut-wrap canvas { width:110px !important; height:110px !important; }
        .sc-bars-col { flex:1; min-width:0; display:flex; flex-direction:column; gap:10px; }
        /* Thick horizontal bars */
        .sc-hbar { display:flex; flex-direction:column; gap:3px; }
        .sc-hbar-head { display:flex; justify-content:space-between; align-items:baseline; }
        .sc-hbar-label { font-size:11px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.3px; display:flex; align-items:center; gap:5px; }
        .sc-hbar-pct { font-size:13px; font-weight:800; color:var(--text-primary); font-variant-numeric:tabular-nums; }
        body.dark .sc-hbar-pct { color:#e2e8f0; }
        .sc-hbar-track { height:24px; border-radius:12px; background:var(--bg-body); overflow:hidden; display:flex; }
        body.dark .sc-hbar-track { background:hsl(217 33% 18%); }
        .sc-hbar-fill { height:100%; border-radius:12px; transition:width 0.6s cubic-bezier(0.4,0,0.2,1); display:flex; align-items:center; justify-content:center; }
        .sc-hbar-fill-label { font-size:11px; font-weight:800; color:#fff; text-shadow:0 1px 2px rgba(0,0,0,0.3); white-space:nowrap; padding:0 8px; }
        /* Stacked bars */
        .sc-stack { display:flex; flex-direction:column; gap:10px; padding:0 24px 14px; }
        .sc-stack-row { display:flex; flex-direction:column; gap:3px; }
        .sc-stack-legend { display:flex; justify-content:space-between; align-items:center; }
        .sc-stack-leg-item { display:flex; align-items:center; gap:5px; font-size:11px; font-weight:600; color:var(--text-secondary); }
        .sc-stack-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
        .sc-stack-val { font-weight:800; font-variant-numeric:tabular-nums; color:var(--text-primary); font-size:12px; }
        body.dark .sc-stack-val { color:#e2e8f0; }
        .sc-stack-track { height:24px; border-radius:12px; overflow:hidden; display:flex; background:var(--bg-body); }
        body.dark .sc-stack-track { background:hsl(217 33% 18%); }
        .sc-stack-seg { height:100%; display:flex; align-items:center; justify-content:center; transition:width 0.6s cubic-bezier(0.4,0,0.2,1); min-width:2px; }
        .sc-stack-seg:first-child { border-radius:12px 0 0 12px; }
        .sc-stack-seg:last-child { border-radius:0 12px 12px 0; }
        .sc-stack-seg-lbl { font-size:10px; font-weight:800; color:#fff; text-shadow:0 1px 2px rgba(0,0,0,0.3); white-space:nowrap; }
        /* Ticket, divider, footer */
        .sc-divider { height:1px; background:var(--border-color); margin:0 24px; }
        .sc-ticket { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 24px; background:color-mix(in srgb,var(--bg-body) 80%,transparent); border-top:1px solid var(--border-color); }
        body.dark .sc-ticket { background:hsl(222 47% 9%); }
        .sc-ticket-item { display:flex; flex-direction:column; gap:2px; }
        .sc-ticket-lbl { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:0.5px; color:var(--text-muted); }
        .sc-ticket-val { font-size:20px; font-weight:900; color:var(--text-primary); font-variant-numeric:tabular-nums; letter-spacing:-0.5px; }
        body.dark .sc-ticket-val { color:#f1f5f9; }
        .sc-ticket-note { font-size:11px; color:var(--text-muted); font-weight:600; }
        .sc-ticket-sep { width:1px; height:40px; background:var(--border-color); flex-shrink:0; }
        .sc-footer { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:10px 24px; border-top:1px solid var(--border-color); font-size:11px; color:var(--text-muted); font-weight:500; }
        .sc-footer i { font-size:11px; opacity:0.6; }
        .sc-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; display:inline-block; }
        @media (max-width:768px) { .sc-hero-value{font-size:2rem;} .sc-viz{flex-direction:column;align-items:stretch;} .sc-donut-wrap{align-self:center;} .sc-header,.sc-hero,.sc-viz,.sc-stack,.sc-ticket,.sc-footer{padding-left:16px;padding-right:16px;} .sc-divider{margin:0 16px;} }

        /* ── Hero metric block (all 3 cards, same height) ── */
        .hc-hero-block {
            background:var(--bg-body); border-radius:8px;
            padding:12px 16px; margin-bottom:14px;
            text-align:center;
        }
        .hc-hero-block .hc-valor-principal { margin-bottom:0; }
        .hc-hero-block .hc-valor-nota { margin-bottom:0; justify-content:center; }
        .hc-hero-block .hc-hero-info {
            margin-top:4px;
        }
        .hc-fin-modo {
            display:inline-flex; border-radius:20px; overflow:hidden;
            background:var(--border-color); padding:2px; gap:2px;
        }
        .hc-fin-modo-btn {
            padding:5px 14px; cursor:pointer; user-select:none;
            text-align:center; transition:all 0.2s; border:none;
            background:transparent; border-radius:18px;
            font-size:11px; font-weight:600; color:var(--text-muted);
            line-height:1;
        }
        .hc-fin-modo-btn:hover { color:var(--text-primary); }
        .hc-fin-modo-btn.active {
            background:var(--bg-card); color:var(--text-primary);
            box-shadow:0 1px 3px rgba(0,0,0,0.1);
        }

        /* ── Barra Proporcional ── */
        .hc-bar-labels {
            display: flex; justify-content: space-between; align-items: flex-end;
            margin-bottom: 8px; font-size: 12px; font-weight: 600;
        }
        .hc-bar-label { display: flex; flex-direction: column; gap: 2px; }
        .hc-bar-label-top { display: flex; align-items: center; gap: 5px; }
        .hc-bar-label:last-child { align-items: flex-end; }
        .hc-bar-label:last-child .hc-bar-label-top { flex-direction: row-reverse; }
        .hc-bar-label-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
        .hc-bar-label-abs {
            font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums;
            color: var(--text-primary); line-height: 1; letter-spacing: -0.5px;
        }

        .hc-bar {
            height: 36px; border-radius: 10px; overflow: visible;
            display: flex; position: relative; background: var(--border-color);
            width: 100%; min-width: 100%;
        }
        .hc-bar-seg {
            height: 100%; display: flex; align-items: center; justify-content: center;
            position: relative; overflow: visible; transition: flex 0.4s ease;
        }
        .hc-bar-seg-label {
            font-size: 14px; font-weight: 800; color: #fff;
            text-shadow: 0 1px 3px rgba(0,0,0,0.35);
        }

        /* ══ Paleta Brasil — verde escuro, ouro, azul marinho ══ */

        /* Card 1 — Eletivo (verde escuro) vs Urgência (ouro escuro) */
        .hc-bar-seg.eletivo { background: linear-gradient(135deg, #006420, #004d1a); border-radius: 10px 0 0 10px; }
        .hc-bar-seg.urgencia { background: linear-gradient(135deg, #b8860b, #8b6914); border-radius: 0 10px 10px 0; }
        .hc-label-eletivo { color: #006420; }
        .hc-label-eletivo .hc-bar-label-dot { background: #006420; }
        .hc-label-urgencia { color: #8b6914; }
        .hc-label-urgencia .hc-bar-label-dot { background: #b8860b; }
        body.dark .hc-bar-seg.eletivo { background: linear-gradient(135deg, #00b94a, #009c3b); }
        body.dark .hc-bar-seg.urgencia { background: linear-gradient(135deg, #d4a017, #b8860b); }
        body.dark .hc-label-eletivo { color: #4ade80; }
        body.dark .hc-label-eletivo .hc-bar-label-dot { background: #4ade80; }
        body.dark .hc-label-urgencia { color: #f0c040; }
        body.dark .hc-label-urgencia .hc-bar-label-dot { background: #f0c040; }

        /* Card 2 — Cirúrgico (verde escuro) vs Outros (azul marinho) */
        .hc-bar-seg.vl-sih { background: linear-gradient(135deg, #006420, #004d1a); border-radius: 10px 0 0 10px; }
        .hc-bar-seg.vl-sia { background: linear-gradient(135deg, #002776, #001d5a); border-radius: 0 10px 10px 0; }
        .hc-label-vl-sih { color: #006420; }
        .hc-label-vl-sih .hc-bar-label-dot { background: #006420; }
        .hc-label-vl-sia { color: #002776; }
        .hc-label-vl-sia .hc-bar-label-dot { background: #002776; }
        body.dark .hc-bar-seg.vl-sih { background: linear-gradient(135deg, #00b94a, #009c3b); }
        body.dark .hc-bar-seg.vl-sia { background: linear-gradient(135deg, #1e40af, #1e3a8a); }
        body.dark .hc-label-vl-sih { color: #4ade80; }
        body.dark .hc-label-vl-sih .hc-bar-label-dot { background: #4ade80; }
        body.dark .hc-label-vl-sia { color: #93c5fd; }
        body.dark .hc-label-vl-sia .hc-bar-label-dot { background: #93c5fd; }

        /* Card 3 — Público (verde) / Filantrópico (ouro) / Privado (azul) */
        .hc-bar-seg.publico { background: linear-gradient(135deg, #006420, #004d1a); border-radius: 10px 0 0 10px; }
        .hc-bar-seg.filantropico { background: linear-gradient(135deg, #b8860b, #8b6914); border-radius: 0; }
        .hc-bar-seg.privado { background: linear-gradient(135deg, #002776, #001d5a); border-radius: 0 10px 10px 0; }
        .hc-label-publico { color: #006420; }
        .hc-label-publico .hc-bar-label-dot { background: #006420; }
        .hc-label-filantropico { color: #8b6914; }
        .hc-label-filantropico .hc-bar-label-dot { background: #b8860b; }
        .hc-label-privado { color: #002776; }
        .hc-label-privado .hc-bar-label-dot { background: #002776; }
        body.dark .hc-bar-seg.publico { background: linear-gradient(135deg, #00b94a, #009c3b); }
        body.dark .hc-bar-seg.filantropico { background: linear-gradient(135deg, #d4a017, #b8860b); }
        body.dark .hc-bar-seg.privado { background: linear-gradient(135deg, #1e40af, #1e3a8a); }
        body.dark .hc-label-publico { color: #4ade80; }
        body.dark .hc-label-publico .hc-bar-label-dot { background: #4ade80; }
        body.dark .hc-label-filantropico { color: #f0c040; }
        body.dark .hc-label-filantropico .hc-bar-label-dot { background: #f0c040; }
        body.dark .hc-label-privado { color: #93c5fd; }
        body.dark .hc-label-privado .hc-bar-label-dot { background: #93c5fd; }

        /* ── Bar labels 3-col layout ── */
        .hc-bar-labels.three-col { justify-content: space-between; }
        .hc-bar-labels.three-col .hc-bar-label { flex: none; }
        .hc-bar-labels.three-col .hc-bar-label:nth-child(2) { text-align: center; }
        .hc-bar-labels.three-col .hc-bar-label:last-child { text-align: right; }

        .hc-bar-seg.bar-seg-overflow .hc-bar-seg-label {
            position: absolute; bottom: calc(100% + 4px); right: 0;
            white-space: nowrap; color: var(--text-muted) !important;
            font-size: 10px; text-shadow: none; font-weight: 700;
        }
        .hc-bar-seg.bar-seg-overflow::after {
            content: '▼'; position: absolute; bottom: calc(100% - 2px);
            right: 4px; font-size: 6px; color: var(--text-muted); opacity: 0.5;
        }

        /* ── Sub-cards (detail-grid) ── */
        .hc-detail-grid {
            display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
            margin-top: 14px;
        }
        .hc-detail-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
        .hc-detail-col {
            border-radius: 12px; padding: 12px 14px;
            background: var(--bg-body);
            border: 1px solid var(--border-color);
        }
        .hc-detail-head {
            display: flex; align-items: center; gap: 8px;
            margin-bottom: 8px; padding-bottom: 6px;
            border-bottom: 1px solid var(--border-color);
        }
        .hc-detail-icon {
            width: 28px; height: 28px; border-radius: 8px;
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0;
        }
        .hc-detail-icon i { font-size: 14px; }
        .hc-detail-dot {
            width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
        }
        .hc-detail-nome {
            font-size: 11px; font-weight: 800; color: var(--text-primary);
            text-transform: uppercase; letter-spacing: 0.5px; line-height: 1.2;
        }
        .hc-detail-row {
            display: flex; justify-content: space-between; align-items: center;
            gap: 6px; white-space: nowrap;
        }
        .hc-detail-row + .hc-detail-row {
            margin-top: 0; padding-top: 6px;
            border-top: 1px solid var(--border-color);
        }
        .hc-detail-row { padding-bottom: 5px; }
        .hc-detail-row-label {
            font-size: 12px; color: var(--text-muted); flex-shrink: 0;
            display: flex; align-items: center; gap: 4px;
        }
        .hc-detail-row-val {
            font-size: 14px; font-weight: 800; color: var(--text-primary);
            font-variant-numeric: tabular-nums; text-align: right;
        }
        .hc-detail-row.total .hc-detail-row-label { font-weight: 600; }
        .hc-detail-row-pct {
            font-size:10px; font-weight:600; color:var(--text-muted); opacity:0.45;
            min-width:28px; text-align:right; flex-shrink:0;
        }
        .hc-sys-details {
            margin-top:4px; padding-top:4px;
            border-top:1px solid var(--border-color);
        }
        .hc-sys-details .hc-detail-row { padding-bottom:2px; }
        .hc-sys-details .hc-detail-row + .hc-detail-row { margin-top:0; padding-top:2px; border-top:none; }
        .hc-sys-details .hc-detail-row-val { font-size:12px; font-weight:700; }
        .hc-sys-details .hc-detail-row-label { font-size:11px; }

        /* ── Card Footer ── */
        .hc-footer {
            padding: 10px 18px; border-top: 1px solid var(--border-color);
            display: flex; flex-direction: column; align-items: center; gap: 2px;
            font-size: 9px; color: var(--text-muted); font-weight: 500;
            text-align: center;
        }
        .hc-footer-line { display: flex; align-items: center; gap: 4px; }
        .hc-footer-line i { font-size: 9px; opacity: 0.5; }
        .hc-footer-seal {
            display: flex; align-items: center; gap: 4px;
            font-weight: 600; opacity: 0.7; margin-top: 2px;
        }
        .hc-footer-seal img { height: 10px; width: auto; opacity: 0.5; }

        @media (max-width:1024px) { .hero-kpi { grid-template-columns: 1fr 1fr; } }
        @media (max-width:600px)  {
            .hero-kpi { grid-template-columns: 1fr; }
            .hc-titulo { font-size: 18px; }
            .hc-detail-grid { grid-template-columns: 1fr; }
            .hc-detail-grid.cols-3 { grid-template-columns: 1fr; }
        }

        /* ═══════ Financiamento MAC/FAEC (Card 2 sub-card) ═══════ */
        .hc-detail-grid { align-items:stretch; }
        .hc-detail-col { display:flex; flex-direction:column; min-width:0; overflow:hidden; }
        .hc-fin-stack {
            display:flex; flex-direction:column; flex:1; gap:0;
        }
        .hc-fin-item {
            flex:1; display:flex; flex-direction:column; justify-content:center;
            padding:6px 0;
        }
        .hc-fin-item + .hc-fin-item { border-top:1px solid var(--border-color); }
        .hc-fin-item-top {
            display:flex; align-items:center; gap:6px;
        }
        .hc-fin-item-dot { width:6px; height:6px; border-radius:50%; flex-shrink:0; }
        .hc-fin-item-label { font-size:11px; font-weight:700; color:var(--text-muted); letter-spacing:0.3px; }
        .hc-fin-item-row {
            display:flex; align-items:baseline; gap:6px; margin-top:2px; padding-left:12px;
        }
        .hc-fin-item-val {
            font-size:18px; font-weight:800; color:var(--text-primary); line-height:1.1;
        }
        .hc-fin-item-pct {
            font-size:20px; font-weight:800; line-height:1; margin-left:auto;
            color:var(--text-muted); opacity:0.5;
        }
        .hc-fin-item-yoy {
            display:flex; align-items:center; gap:3px; margin-top:2px; padding-left:12px;
            font-size:11px; font-weight:700; line-height:1;
        }
        .hc-fin-item-yoy i { font-size:10px; }

        /* Mini-table: 2-line rows (label top, data bottom) */
        .hc-mini-table { margin-top:4px; padding-top:4px; border-top:1px solid var(--border-color); }
        .hc-mini-item { padding:4px 0; }
        .hc-mini-item + .hc-mini-item { border-top:1px solid color-mix(in srgb, var(--border-color) 50%, transparent); }
        .hc-mini-item-label { font-size:10px; font-weight:700; color:var(--text-muted); display:flex; align-items:center; gap:4px; margin-bottom:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
        .hc-mini-item-data { display:flex; align-items:baseline; gap:6px; flex-wrap:wrap; }
        .hc-mini-item-val { font-size:13px; font-weight:800; color:var(--text-primary); font-variant-numeric:tabular-nums; }
        .hc-mini-item-pct { font-size:10px; font-weight:600; color:var(--text-muted); opacity:0.5; }
        .hc-mini-item-yoy { font-size:9px; font-weight:600; white-space:nowrap; font-variant-numeric:tabular-nums; width:100%; margin-top:1px; }
        /* Right sub-card: rows fill height evenly */
        .hc-detail-col-fill { display:flex; flex-direction:column; min-width:0; overflow:hidden; }
        .hc-detail-col-fill .hc-detail-head { flex-shrink:0; }
        .hc-detail-col-fill .hc-detail-rows { display:flex; flex-direction:column; flex:1; justify-content:space-between; }
        .hc-detail-col-fill .hc-detail-row { flex:1; display:flex; align-items:center; }

        /* ═══════ KPI 2-col (ROL / PATE detail) ═══════ */
        .kpi-2 { display:grid; grid-template-columns:1fr 1fr; gap:var(--space-md); margin-bottom:var(--space-lg); }
        .kpi-2 .kpi-card { padding:18px 22px; gap:14px; }
        .kpi-2 .kpi-icon { width:48px; height:48px; border-radius:12px; font-size:22px; }
        @media (max-width:768px) { .kpi-2 { grid-template-columns:1fr; } }

        /* KPI Grid */
        .kpi-grid .kpi-card { padding:20px 24px; gap:16px; border-radius:var(--radius-lg); border:1px solid var(--border-color); position:relative; overflow:hidden; box-shadow:var(--shadow-sm); transition:box-shadow 0.2s, border-color 0.2s; }
        body:not(.dark) .kpi-grid .kpi-card { background:linear-gradient(135deg, #ffffff 0%, #fafbfc 100%); border-color:rgba(0,0,0,0.1); box-shadow:0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04); }
        body:not(.dark) .kpi-grid .kpi-card:hover { border-color:rgba(0,73,144,0.15); box-shadow:0 2px 8px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06); }
        .kpi-grid .kpi-card::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; border-radius:var(--radius-lg) var(--radius-lg) 0 0; }
        .kpi-grid .kpi-card:nth-child(1)::before { background:var(--sus-blue); }
        .kpi-grid .kpi-card:nth-child(2)::before { background:var(--color-success); }
        .kpi-grid .kpi-card:nth-child(3)::before { background:#8b5cf6; }
        .kpi-grid .kpi-card:nth-child(4)::before { background:var(--color-danger); }
        .kpi-grid .kpi-card:nth-child(5)::before { background:#f59e0b; }
        .kpi-grid .kpi-icon { width:52px; height:52px; border-radius:14px; font-size:24px; }
        .kpi-grid .kpi-label { font-size:11px; letter-spacing:0.5px; margin-bottom:4px; }
        .kpi-grid .kpi-value { font-size:var(--font-size-2xl); font-weight:800; line-height:1.15; }
        .kpi-card .kpi-content { flex:1; min-width:0; }

        /* Breakdown */
        .bk-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-top:10px; }
        .bk-item { padding:6px 10px; background:var(--bg-body); border-radius:var(--radius-md); display:flex; align-items:center; justify-content:space-between; gap:6px; }
        .bk-label { font-size:10px; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.6px; font-weight:700; flex-shrink:0; }
        .bk-value { font-size:var(--font-size-sm); font-weight:700; color:var(--text-primary); text-align:right; }

        /* KPI Row */
        .kpi-row { display:grid; grid-template-columns:repeat(5, 1fr); gap:var(--space-sm); margin-top:var(--space-md); }
        .kpi-row-item { background:var(--bg-card); border:1px solid var(--border-color); border-radius:var(--radius-md); padding:12px 14px; text-align:center; }
        .kpi-row-label { font-size:10px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.5px; margin-bottom:4px; }
        .kpi-row-value { font-size:var(--font-size-lg); font-weight:800; color:var(--text-primary); }
        @media (max-width:768px) { .kpi-row { grid-template-columns:repeat(2, 1fr); } }

        /* Canvas fix */
        .chart-canvas-wrap { height:300px !important; aspect-ratio:unset !important; }

        /* ═══════ LAYOUT ESTAVEL — anti-scroll-jump ═══════ */
        .hero-kpi          { min-height: 220px; }
        .chart-card         { min-height: auto; }
        .chart-2            { min-height: 400px; }
        .chart-3            { min-height: 400px; }
        .kpi-grid           { min-height: 110px; }
        .kpi-2              { min-height: 110px; }
        .table-container    { min-height: 520px; }
        .data-table tbody tr { height: 44px; overflow-anchor: none; }
        .table-link { color:var(--text-primary); text-decoration:none; cursor:pointer; border-bottom:1px dotted var(--border-color); transition:color 0.2s; }
        .table-link:hover { color:rgba(59,130,246,1); border-bottom-color:rgba(59,130,246,0.5); }
        .sh                  { min-height: 44px; }
        .sh, .chart-header, .table-toolbar { overflow-anchor: auto; }

        /* Pagination */
        .table-pagination {
            display:flex; align-items:center; justify-content:center;
            gap:16px; padding:14px 16px; border-top:1px solid var(--border-color); font-size:12px;
        }
        .table-pagination-info { font-size:11px; color:var(--text-muted); font-weight:500; }
        .table-pagination-buttons { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--text-secondary); font-weight:600; }
        .table-page-btn {
            width:32px; height:32px; border:1px solid var(--border-color); border-radius:var(--radius-full);
            background:var(--bg-body); color:var(--text-secondary); font-size:13px; cursor:pointer;
            display:flex; align-items:center; justify-content:center; transition:all 0.2s;
        }
        .table-page-btn:hover:not(:disabled) { border-color:var(--sus-blue); color:var(--sus-blue); background:rgba(0,102,204,0.05); }
        .table-page-btn:disabled { opacity:0.25; cursor:not-allowed; }

        /* Sections loading */
        .sections-loading { display:flex; align-items:center; justify-content:center; gap:12px; padding:48px 0; color:var(--text-muted); font-size:14px; }
        .sections-loading .spinner { width:28px; height:28px; border-width:3px; }

        @media (max-width:768px) { .wrap { padding:var(--space-lg) var(--space-md); } }

        /* ═══════ INLINE RESPONSIVE FIXES (from lines 3274 and 3680) ═══════ */
        .evo-kpis { flex-wrap: wrap; }
        @media (max-width:768px) { div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; } }
        @media (max-width:768px) { div[style*="grid-template-columns:1fr 1fr 1fr"] { grid-template-columns: 1fr !important; } }

        /* ═══════ UF BAR TOGGLE — Collapsible Flags Bar ═══════ */
        .uf-bar { position: fixed !important; transition: padding 0.25s ease; }
        .uf-bar-toggle {
            position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
            width: 28px; height: 28px; border: 1px solid var(--border-color);
            border-radius: 6px; background: var(--bg-body); color: var(--text-muted);
            cursor: pointer; display: flex; align-items: center; justify-content: center;
            font-size: 12px; opacity: 0.5; transition: all 0.2s; z-index: 2;
        }
        .uf-bar-toggle:hover { opacity: 1; border-color: var(--sus-blue); color: var(--sus-blue); }
        .uf-bar-collapsed-label {
            display: none; align-items: center; gap: 8px;
            font-size: 12px; font-weight: 600; color: var(--text-secondary);
            padding: 0 12px; white-space: nowrap;
        }
        .uf-bar-collapsed-label img {
            width: 20px; height: 14px; border-radius: 2px; object-fit: cover;
            box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
        }
        .uf-bar.uf-collapsed .uf-flags-container {
            max-height: 0; overflow: hidden; opacity: 0;
            transition: max-height 0.3s ease, opacity 0.2s ease;
        }
        .uf-bar:not(.uf-collapsed) .uf-flags-container {
            max-height: 200px; opacity: 1;
            transition: max-height 0.3s ease, opacity 0.2s ease 0.1s;
        }
        .uf-bar.uf-collapsed { height: auto; min-height: 36px; padding: 4px 40px 4px 12px; }
        .uf-bar.uf-collapsed .uf-bar-collapsed-label { display: flex; }

        /* ═══════ COLLAPSIBLE SECTIONS ═══════ */
        .section-collapsible { margin-bottom: 0; }
        .section-toggle {
            cursor: pointer; user-select: none;
            display: flex; align-items: center;
        }
        .section-toggle:hover .sh { color: var(--sus-blue); }
        .section-toggle .sh { flex: 1; margin-bottom: 0; }
        .section-chevron {
            font-size: 12px; opacity: 0.4; margin-left: 8px;
            transition: transform 0.2s ease, opacity 0.2s;
        }
        .section-toggle:hover .section-chevron { opacity: 0.8; }
        .section-body {
            transition: opacity 0.25s ease;
        }
        .section-body.sec-hidden {
            opacity: 0; max-height: 0; overflow: hidden;
            transition: opacity 0.2s ease, max-height 0.01s linear 0.2s;
        }
        .section-body:not(.sec-hidden) {
            opacity: 1; max-height: none;
        }

        /* ═══════ MOBILE HEADER (estilos adicionais — framework no critical CSS) ═══════ */

        .mobile-hamburger {
            width: 44px; height: 44px;
            border: none; background: transparent;
            border-radius: 8px; cursor: pointer;
            color: var(--text-primary);
            display: flex; align-items: center; justify-content: center;
            font-size: 24px;
            transition: background 0.15s;
        }
        .mobile-hamburger:hover { background: rgba(0,73,144,0.08); }

        /* ═══════ MOBILE MENU OVERLAY ═══════ */
        /* hidden por default via x-cloak no HTML + [x-cloak]{display:none} no critical CSS */
        /* Alpine remove x-cloak ao inicializar, depois x-show controla visibilidade */
        .mobile-menu-overlay {
            position: fixed;
            inset: 0;
            z-index: 10000;
            background: rgba(0,0,0,0.5);
            display: flex;
            align-items: flex-start;
            justify-content: flex-end;
        }
        body.dark .mobile-menu-overlay { background: rgba(0,0,0,0.7); }

        /* Animacao entrada/saida */
        .mm-enter { transition: opacity 0.2s ease; }
        .mm-enter-start { opacity: 0; }
        .mm-enter-end { opacity: 1; }
        .mm-leave { transition: opacity 0.15s ease; }
        .mm-leave-start { opacity: 1; }
        .mm-leave-end { opacity: 0; }

        .mobile-menu-panel {
            width: 300px;
            max-width: 85vw;
            height: 100vh;
            background: var(--bg-card);
            box-shadow: -8px 0 32px rgba(0,0,0,0.2);
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            animation: mm-slide-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        }
        @keyframes mm-slide-in {
            from { transform: translateX(100%); }
            to   { transform: translateX(0); }
        }

        /* Header do menu */
        .mm-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-color);
        }
        .mm-header .logo { gap: 8px; }
        .mm-close {
            width: 36px; height: 36px;
            border: 1px solid var(--border-color);
            background: var(--bg-body);
            border-radius: 10px; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            font-size: 16px; color: var(--text-secondary);
            transition: all 0.15s;
        }
        .mm-close:hover { background: rgba(239,68,68,0.1); border-color: #ef4444; color: #ef4444; }

        /* Navegacao */
        .mm-nav {
            padding: 16px 12px;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .mm-section-label {
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--text-muted);
            padding: 4px 12px 8px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .mm-section-label i { font-size: 12px; }

        .mm-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 14px;
            text-decoration: none;
            color: var(--text-primary);
            font-size: 14px;
            font-weight: 500;
            border-radius: 10px;
            transition: all 0.15s;
        }
        .mm-item:hover { background: rgba(0,73,144,0.06); color: var(--sus-blue); text-decoration: none; }
        .mm-item.mm-active {
            background: rgba(0,73,144,0.08);
            color: var(--sus-blue);
            font-weight: 700;
        }
        .mm-item i { font-size: 16px; width: 22px; text-align: center; opacity: 0.7; }
        .mm-item.mm-active i { opacity: 1; }

        .mm-divider {
            height: 1px;
            background: var(--border-color);
            margin: 8px 20px;
        }

        /* Botoes de visao */
        .mm-view-switch {
            display: flex;
            gap: 8px;
            padding: 8px 12px 16px;
        }
        .mm-view-btn {
            flex: 1;
            padding: 10px 12px;
            border: 1px solid var(--border-color);
            border-radius: 10px;
            background: var(--bg-body);
            color: var(--text-secondary);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: all 0.15s;
            font-family: var(--font-family);
        }
        .mm-view-btn:hover { border-color: var(--sus-blue); color: var(--sus-blue); }

        /* Footer do menu */
        .mm-footer {
            margin-top: auto;
            padding: 16px 20px;
            border-top: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .mm-version {
            font-size: 10px;
            font-weight: 600;
            color: var(--text-muted);
            letter-spacing: 0.3px;
        }

        /* ═══════ RESPONSIVE — Mobile (<=480px) ═══════ */
        @media (max-width: 480px) {
            .hero-kpi { grid-template-columns: 1fr !important; }
            .chart-2 { grid-template-columns: 1fr !important; }
            .chart-3 { grid-template-columns: 1fr !important; }
            .filter-bar-split { flex-direction: column; gap: 8px; }
            .sd-trigger { width: 100% !important; }
            .sd-panel { min-width: calc(100vw - 32px) !important; }
            .uf-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
            .wrap { padding: var(--space-md) var(--space-sm) !important; }
            .sh { font-size: 14px !important; }
            .hc-valor-principal { font-size: 1.8rem !important; }
            .evo-kpis { padding: 8px 10px; gap: 8px; }
            .evo.kpi-val {
            /* overflow managed by fitText JS */
             font-size: 12px; }
        }

        /* ═══════ RESPONSIVE — Tablet (<=768px) ═══════ */
        @media (max-width: 768px) {
            .hero-kpi { grid-template-columns: 1fr !important; gap: 12px; }
            .chart-2 { grid-template-columns: 1fr !important; }
            .sc-grid-3 { grid-template-columns: 1fr !important; }
            .sb-panel { width: 100%; max-width: 100%; }
            .filter-bar { padding: 8px 12px; }
            .filter-bar-split { gap: 8px; }
            .uf-bar-toggle { right: 4px; }
        }

        /* ═══════ RESPONSIVE — Small desktop (<=1024px) ═══════ */
        @media (max-width: 1024px) {
            .hero-kpi { grid-template-columns: 1fr 1fr !important; }
        }

        /* ═══════ HERO KPI — Cirurgias icon variants (blue palette) ═══════ */
        @keyframes kpi-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); opacity: 0.9; } }
        .kpi-icon-svg { animation: kpi-breathe 3.6s ease-in-out infinite; color: currentColor; }
        .hc-icon.producao-cir { width:48px;height:48px;border-radius:12px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:rgba(0,39,118,0.10);color:#002776;box-shadow:0 2px 8px rgba(0,39,118,0.12); }
        body.dark .hc-icon.producao-cir { background:rgba(0,73,144,0.20);color:#6ea8fe; }
        .hc-icon.financeiro-cir { width:48px;height:48px;border-radius:12px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:rgba(0,73,144,0.10);color:#004990;box-shadow:0 2px 8px rgba(0,73,144,0.12); }
        body.dark .hc-icon.financeiro-cir { background:rgba(0,73,144,0.22);color:#90bfff; }
        .hc-icon.rol-cir { width:48px;height:48px;border-radius:12px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:rgba(26,58,107,0.10);color:#1a3a6b;box-shadow:0 2px 8px rgba(26,58,107,0.12); }
        body.dark .hc-icon.rol-cir { background:rgba(26,58,107,0.24);color:#7fb3f5; }
        .hc-icon.perfil-cir { width:48px;height:48px;border-radius:12px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:rgba(0,61,128,0.10);color:#003d80;box-shadow:0 2px 8px rgba(0,61,128,0.12); }
        body.dark .hc-icon.perfil-cir { background:rgba(0,61,128,0.22);color:#82b4ff; }
        .kpi-insight { display:flex;align-items:center;gap:6px;margin-top:14px;padding-top:10px;border-top:1px dashed var(--border-color);font-size:11px;font-weight:500;color:var(--text-muted);line-height:1.4; }
        .kpi-insight i { font-size:10px;flex-shrink:0;opacity:0.6; }
        .kpi-insight strong { font-weight:800;color:var(--text-secondary); }
        body.dark .kpi-insight { border-top-color:rgba(255,255,255,0.10); }

        

        /* ═══════════════════════════════════════════════════════════════
           KPI CARD COMPONENT — Padrão reutilizável (réplica hemodiálise)

        /* ═══════════════════════════════════════════════════════════════
           KPI Number Auto-Sizing (CSS-only, container queries)
           ═══════════════════════════════════════════════════════════════ */
        .kpi-hero-num {
            font-weight: 900;
            letter-spacing: -1px;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            font-size: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            height: 60px;
            min-height: 60px;
            max-height: 60px;
            min-height: 60px;
            cursor: pointer;
            user-select: none;
        }
        .kpi-sub-num {
            font-weight: 800;
            white-space: nowrap;
            overflow: hidden;
            font-size: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            height: 32px;
            min-height: 32px;
            max-height: 32px;
            cursor: pointer;
            user-select: none;
        }

           Classes: kpi-card-footer, kpi-card-footer-line, kpi-card-footer-seal
           ═══════════════════════════════════════════════════════════════ */
        .kpi-card-footer {
            padding: 12px 22px 16px;
            margin-top: auto;

            border-top: 1px solid var(--border-color);
            font-size: 10px !important;
            font-weight: 600;
            letter-spacing: 0.3px;
            color: var(--text-secondary);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
            line-height: 1.5;
            width: 100%;
        }
        .kpi-card-footer i { font-size: 11px !important; opacity: 0.6; }
        .kpi-card-footer-line { display: flex; align-items: center; gap: 4px; }
        .kpi-card-footer-line:nth-child(2) { font-size: 9px; color: var(--text-muted); }

        [@click="_abs = !_abs"] { cursor: pointer !important; user-select: none; }
        .kpi-clickable { cursor: pointer !important; user-select: none; -webkit-user-select: none; }
        .kpi-clickable:hover { opacity: 0.7; }

        /* Filter bar: esconde até Alpine inicializar, revela suave */
        .filter-bar { opacity: 1; }
        .filter-bar.fb-ready { opacity: 1; }

        /* ═══════ Loading bar — Alpine reactive ═══════ */
        /* ═══ Loading bar — JS-driven, smooth ═══ */
        .top-loading-bar {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 2px;
            z-index: 99999;
            pointer-events: none;
        }
        .top-loading-bar .tlb-bar {
            height: 100%;
            width: 0%;
            background: #3b82f6;
            box-shadow: 0 0 6px rgba(59,130,246,0.5);
            transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
        }

        
        main { overflow-x: hidden; }

        /* ═══════ SPA: no scroll ═══════ */
        html, body { /* overflow managed by fitText JS */ height: 100vh !important; }

        /* ═══════ Auto-fit text in container ═══════ */
        .kpi-fit {
            white-space: nowrap;
            overflow: hidden;
            display: block;
            font-variant-numeric: tabular-nums;
            font-weight: 800;
            margin-top: 8px;
            container-type: inline-size;
        }
        .kpi-fit-inner {
            font-size: 1.3rem;
            display: block;
            transform-origin: left center;
        }
        @container (max-width: 120px) { .kpi-fit-inner { font-size: 0.9rem; } }
        @container (max-width: 100px) { .kpi-fit-inner { font-size: 0.75rem; } }
        @container (max-width: 80px) { .kpi-fit-inner { font-size: 0.65rem; } }

        /* ═══════ Auto-fit text to container ═══════ */
        .kpi-val {
            /* overflow managed by fitText JS */
            
            font-weight: 800;
            margin-top: 8px;
            white-space: nowrap;
            font-variant-numeric: tabular-nums;
            display: block;
            transform-origin: center center;
        }
