/* ==========================================================================
   MÓDULO PP0030: EJECUCIÓN PRESUPUESTAL PARA LA SEGURIDAD CIUDADANA
   Homologación exacta de estilos UI/UX — Observatorio Junín
   ========================================================================== */

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section).provincial-budget-section {
    background: linear-gradient(180deg, #f7fafc 0%, #ffffff 100%);
    border-top: 1px solid #e5edf3;
    border-bottom: 1px solid #e5edf3;
    padding: 64px 6vw;
    position: relative;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1a2e3b;
    box-sizing: border-box;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section).data-refresh-section:before {
    content: "";
    position: absolute;
    right: -120px;
    top: 30px;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 116, 144, 0.10), transparent 68%);
    pointer-events: none;
}

/* --- Cabecera Principal y Tarjeta de Fuente --- */
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .section-head.provincial-budget-head.refresh-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 28px;
    margin-bottom: 24px;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .section-head.provincial-budget-head.refresh-head > div:first-child {
    flex: 1;
    min-width: 0;
    max-width: 820px;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .eyebrow {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #7a8c99;
    text-transform: uppercase;
    margin: 0 0 8px 0;
    display: block;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) h2 {
    font-size: 34px;
    font-weight: 800;
    color: #0f2940;
    line-height: 1.15;
    margin: 0 0 14px 0;
    letter-spacing: -0.02em;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .section-head > div > p {
    font-size: 14px;
    color: #506370;
    line-height: 1.55;
    margin: 0;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .section-head > div > p strong {
    font-weight: 800;
    color: #0f2940;
}

/* Tarjeta de Fuente Oficial */
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-source-card {
    min-width: 280px;
    max-width: 330px;
    padding: 18px 20px;
    border: 1px solid #d9e6ea;
    border-radius: 18px;
    background: linear-gradient(145deg, #ffffff, #f4fafb);
    box-shadow: 0 12px 30px rgba(15, 50, 65, 0.06);
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-source-card > span {
    font-size: 10px;
    letter-spacing: 0.14em;
    color: #0e7490;
    font-weight: 800;
    text-transform: uppercase;
    display: block;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-source-card > strong {
    font-size: 15px;
    color: #0f2940;
    font-weight: 800;
    line-height: 1.25;
    display: block;
    margin: 2px 0;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-source-card > small {
    font-size: 11px;
    color: #657786;
    line-height: 1.4;
    display: block;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .data-download-button {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 12px;
    background: #073b55;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 4px 14px rgba(7, 59, 85, 0.2);
    transition: all 0.2s ease;
    cursor: pointer;
    text-align: center;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .data-download-button:hover {
    background: #0e7490;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(14, 116, 144, 0.28);
}

/* --- Banner de Lectura del Módulo --- */
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-reading-note {
    margin: 20px 0 18px;
    padding: 16px 20px;
    border: 1px solid #d8e2e8;
    border-radius: 14px;
    background: #f8fafb;
    color: #294654;
    box-sizing: border-box;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-reading-note strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #073b55;
    margin-bottom: 5px;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-reading-note p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.55;
    color: #536b78;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-reading-note b {
    font-weight: 800;
    color: #073b55;
}

/* --- Toolbar: Pestañas, Buscador y Selector de Orden --- */
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    margin: 16px 0 20px;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-tabs {
    display: inline-flex;
    padding: 4px;
    border-radius: 13px;
    background: #eef5f7;
    border: 1px solid #dce8ec;
    gap: 4px;
    align-items: center;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-tab {
    border: 0;
    background: transparent;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    color: #58707c;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
    line-height: 1.2;
    white-space: nowrap;
    outline: none;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-tab:hover {
    color: #073b55;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-tab.active {
    background: #ffffff;
    color: #073b55;
    box-shadow: 0 3px 12px rgba(15, 50, 65, 0.09);
    font-weight: 800;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-search {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 10.5px;
    color: #6b7f8b;
    font-weight: 800;
    flex: 1;
    min-width: 220px;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-search span,
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-select span {
    font-size: 10.5px;
    text-transform: none;
    color: #6b7f8b;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-search input {
    height: 42px;
    border: 1px solid #d9e5e9;
    border-radius: 11px;
    background: #ffffff;
    padding: 0 14px;
    color: #19384a;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-search input:focus {
    border-color: #38a3b7;
    box-shadow: 0 0 0 3px rgba(56, 163, 183, 0.12);
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-select {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 10.5px;
    color: #6b7f8b;
    font-weight: 800;
    min-width: 170px;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-select select {
    height: 42px;
    border: 1px solid #d9e5e9;
    border-radius: 11px;
    background: #ffffff;
    padding: 0 12px;
    color: #19384a;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    box-sizing: border-box;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-select select:focus {
    border-color: #38a3b7;
    box-shadow: 0 0 0 3px rgba(56, 163, 183, 0.12);
}

/* --- Vista 1: Grid de Mapa y Ficha de Detalle --- */
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-refresh-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
    gap: 20px;
    align-items: stretch;
    margin-top: 12px;
}

/* Panel del Mapa */
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-map-panel {
    border: 1px solid #dce8ec;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(13, 57, 74, 0.055);
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-panel-head span {
    font-size: 10px;
    letter-spacing: 0.12em;
    color: #0e7490;
    font-weight: 800;
    text-transform: uppercase;
    display: block;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-panel-head h3 {
    font-size: 17px;
    font-weight: 800;
    color: #0f2940;
    margin: 4px 0 0 0;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-panel-head small {
    font-size: 11px;
    color: #7a8d98;
    font-style: italic;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-map-canvas.budget-map-canvas {
    position: relative;
    width: 100%;
    min-height: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafcfd;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-map-canvas img {
    max-width: 96%;
    max-height: 420px;
    object-fit: contain;
    display: block;
    user-select: none;
    pointer-events: none;
    filter: none !important;
    opacity: 1 !important;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-map-stage {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chips Flotantes del Mapa */
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-map-chip {
    position: absolute;
    transform: translate(-50%, -50%);
    border-width: 1px !important;
    border-style: solid !important;
    border-bottom-width: 4px !important;
    border-radius: 11px;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 4px 14px rgba(11, 79, 99, 0.12) !important;
    cursor: pointer;
    min-width: 58px;
    text-align: center;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
    z-index: 2;
    box-sizing: border-box;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-map-chip:hover {
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow: 0 8px 22px rgba(11, 79, 99, 0.22) !important;
    z-index: 5;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-map-chip.selected {
    outline: 3px solid rgba(14, 116, 144, 0.3) !important;
    transform: translate(-50%, -50%) scale(1.08);
    z-index: 5;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-map-chip span {
    display: none !important;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-map-chip strong {
    display: block;
    font-size: 11.5px !important;
    margin: 0 !important;
    font-weight: 900 !important;
}

/* Semáforo MEF en Chips */
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-map-chip.very-good {
    background: #E8F5E9 !important;
    border-color: #A5D6A7 !important;
    border-bottom-color: #2E7D32 !important;
}
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-map-chip.very-good strong {
    color: #1B5E20 !important;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-map-chip.good {
    background: #F1F8E9 !important;
    border-color: #C5E1A5 !important;
    border-bottom-color: #66BB6A !important;
}
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-map-chip.good strong {
    color: #2E7D32 !important;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-map-chip.regular {
    background: #FFF8E1 !important;
    border-color: #FFE082 !important;
    border-bottom-color: #F9A825 !important;
}
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-map-chip.regular strong {
    color: #8A6100 !important;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-map-chip.deficient {
    background: #FFEBEE !important;
    border-color: #EF9A9A !important;
    border-bottom-color: #C62828 !important;
}
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-map-chip.deficient strong {
    color: #B71C1C !important;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-map-chip.no-pim {
    background: #F2F4F5 !important;
    border-color: #CFD7DC !important;
    border-bottom-color: #9E9E9E !important;
}
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-map-chip.no-pim strong {
    color: #5F6B72 !important;
}

/* Leyenda MEF al pie del mapa */
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .mef-color-ranking {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding-top: 14px;
    border-top: 1px solid #edf2f5;
    font-size: 11px;
    color: #496371;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .mef-color-ranking strong {
    font-size: 11px;
    font-weight: 800;
    color: #0f2940;
    margin-right: 4px;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .mef-color-key {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .mef-color-key i {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    display: inline-block;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .mef-color-key.very-good i { background: #2e7d32; }
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .mef-color-key.good i { background: #66bb6a; }
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .mef-color-key.regular i { background: #f9a825; }
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .mef-color-key.deficient i { background: #c62828; }

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .mef-color-key b {
    font-weight: 700;
    color: #213c53;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .mef-color-key small {
    font-size: 10px;
    color: #7a8d98;
    margin-left: 2px;
}

/* --- Ficha Lateral de Detalle Provincial --- */
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-detail-card {
    border: 1px solid #dce8ec;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(13, 57, 74, 0.055);
    padding: 22px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: fit-content;
    align-self: start;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-detail-kicker {
    font-size: 10px;
    letter-spacing: 0.12em;
    color: #0e7490;
    font-weight: 800;
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) h3#budget-detail-name {
    font-size: 24px;
    font-weight: 800;
    color: #0f2940;
    margin: 0 0 4px 0;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-detail-municipality {
    font-size: 11.5px;
    color: #6b7f8b;
    margin: 0 0 16px 0;
    line-height: 1.35;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-detail-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-detail-metrics > div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    box-sizing: border-box;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-detail-metrics span {
    font-size: 10px;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-detail-metrics strong {
    font-size: 16px;
    color: #0f2940;
    font-weight: 800;
    display: block;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-progress {
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    margin-bottom: 12px;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-progress i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #0e7490;
    transition: width 0.3s ease;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-detail-reading {
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
    margin: 0 0 14px 0;
    padding: 10px 12px;
    background: #f1f5f9;
    border-radius: 8px;
    box-sizing: border-box;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-mini-ranking.budget-district-highlights {
    border-top: 1px solid #e2e8f0;
    padding-top: 14px;
    margin-top: 0 !important;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-mini-ranking > span {
    font-size: 11px;
    font-weight: 800;
    color: #0f2940;
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .mini-rank-row {
    display: grid !important;
    grid-template-columns: 24px minmax(0, 1fr) auto !important;
    gap: 10px !important;
    align-items: center !important;
    padding: 7px 0 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    font-size: 11.5px;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .mini-rank-row:last-child {
    border-bottom: none !important;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .mini-rank-row > span {
    font-weight: 800;
    color: #94a3b8;
    font-size: 10.5px;
    line-height: 1;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .mini-rank-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .mini-rank-main b {
    color: #0f2940;
    font-weight: 700;
    display: block;
    line-height: 1.25;
    font-size: 11.5px;
    text-transform: uppercase;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .mini-rank-main small {
    color: #64748b;
    font-size: 10px;
    display: block;
    margin-top: 2px;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .mini-rank-row > strong {
    color: #0e7490;
    font-weight: 800;
    text-align: right;
    font-size: 12px;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .mini-rank-row > strong em {
    display: block;
    font-size: 9.5px;
    color: #64748b;
    font-weight: 600;
    font-style: normal;
}

/* --- Vista 2: Ranking Municipal (124 Registros) --- */
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-ranking-card {
    border: 1px solid #dce8ec;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(13, 57, 74, 0.055);
    padding: 22px;
    margin-top: 12px;
    box-sizing: border-box;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .municipal-rank-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1.8fr) minmax(120px, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: #ffffff;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    box-sizing: border-box;
    margin-bottom: 4px;
    font-family: inherit;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .municipal-rank-row:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .municipal-rank-pos {
    font-size: 13px;
    font-weight: 800;
    color: #94a3b8;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .municipal-rank-row strong {
    font-size: 13px;
    font-weight: 700;
    color: #0f2940;
    display: block;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .municipal-rank-row small {
    font-size: 11px;
    color: #64748b;
    display: block;
    margin-top: 2px;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .municipal-rank-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .municipal-rank-bars i {
    display: block;
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .municipal-rank-bars b {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #0e7490;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .municipal-rank-bars small {
    font-size: 10.5px;
    color: #64748b;
    font-weight: 700;
}

/* --- Metodología y Notas al Pie --- */
:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-method-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-method-grid > div {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px;
    box-sizing: border-box;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-method-grid strong {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: #0f2940;
    margin-bottom: 4px;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-method-grid p {
    margin: 0;
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.5;
}

/* --- Adaptabilidad Responsiva --- */
@media (max-width: 1050px) {
    :is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .section-head.provincial-budget-head.refresh-head {
        flex-direction: column;
    }
    :is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-source-card {
        min-width: 0;
        max-width: none;
        width: 100%;
    }
    :is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-refresh-grid {
        grid-template-columns: 1fr;
    }
    :is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-method-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    :is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section).provincial-budget-section {
        padding: 40px 18px;
    }
    :is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) h2 {
        font-size: 26px;
    }
    :is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    :is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-tabs {
        width: 100%;
    }
    :is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .refresh-tab {
        flex: 1;
        text-align: center;
    }
    :is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .municipal-rank-row {
        grid-template-columns: 28px minmax(0, 1fr) auto;
    }
    :is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .municipal-rank-bars {
        display: none;
    }
}
/* Drag and Drop de chips en modo editor */
.chip-dragging {
    opacity: 0.92;
    transform: translate(-50%, -50%) scale(1.15) !important;
    box-shadow: 0 10px 25px rgba(2, 132, 199, 0.45) !important;
    outline: 2px dashed #0284c7 !important;
    cursor: grabbing !important;
    user-select: none;
    pointer-events: auto;
}

:is(#presupuesto-pp0030, #presupuesto, .provincial-budget-section) .budget-map-chip:focus-visible {
    outline: 3px solid #0284c7 !important;
    box-shadow: 0 0 12px rgba(2, 132, 199, 0.6) !important;
    z-index: 10;
}

@keyframes chipPulseGlow {
    0%, 100% {
        outline: 3px solid #0284c7;
        transform: translate(-50%, -50%) scale(1.22);
        box-shadow: 0 0 22px rgba(2, 132, 199, 0.85);
    }
    50% {
        outline: 3px solid #38bdf8;
        transform: translate(-50%, -50%) scale(1.12);
        box-shadow: 0 0 12px rgba(56, 189, 248, 0.55);
    }
}

.chip-highlighted {
    animation: chipPulseGlow 0.8s ease-in-out infinite;
    z-index: 9999 !important;
}

/* Barra de Control de Edición de Etiquetas del Mapa PP0030 */
.map-label-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 8px 12px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}
.map-label-toolbar.is-editing {
    background: #f0f9ff;
    border-color: #0284c7;
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.12);
}
.map-toolbar-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #475569;
}
.map-label-toolbar.is-editing .map-toolbar-status {
    color: #0369a1;
    font-weight: 600;
}
.map-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    display: inline-block;
    transition: background 0.2s ease;
}
.map-label-toolbar.is-editing .map-status-dot {
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
    animation: mapStatusPulse 1.5s infinite;
}
.map-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.btn-map-control {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    line-height: 1;
}
.btn-map-control.btn-edit-labels {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.3);
}
.btn-map-control.btn-edit-labels:hover {
    background: #0369a1;
    transform: translateY(-1px);
}
.btn-map-control.btn-save-labels {
    background: #059669;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
}
.btn-map-control.btn-save-labels:hover {
    background: #047857;
    transform: translateY(-1px);
}
.btn-map-control.btn-cancel-labels {
    background: #ffffff;
    color: #64748b;
    border-color: #cbd5e1;
}
.btn-map-control.btn-cancel-labels:hover {
    background: #f1f5f9;
    color: #334155;
}
.btn-map-control.btn-reset-labels {
    background: #ffffff;
    color: #0284c7;
    border-color: #bae6fd;
}
.btn-map-control.btn-reset-labels:hover {
    background: #e0f2fe;
}

/* Toast de confirmación de guardado PP0030 */
.budget-map-toast {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0f172a;
    color: #f8fafc;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    white-space: nowrap;
}
.budget-map-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.budget-map-toast.success {
    background: #047857;
    border: 1px solid #10b981;
}
.budget-map-toast.info {
    background: #0369a1;
    border: 1px solid #38bdf8;
}

/* Drag and Drop interactivo solo cuando el bloque budget_pp0030 está en edición activa */
.budget-map-canvas.is-editable-map .budget-map-chip {
    cursor: grab !important;
    touch-action: none;
    box-shadow: 0 0 0 2px #0284c7, 0 6px 16px rgba(2, 132, 199, 0.22) !important;
}
.budget-map-canvas.is-editable-map .budget-map-chip.chip-dragging,
.budget-map-canvas.is-editable-map .budget-map-chip.dragging {
    cursor: grabbing !important;
    z-index: 100 !important;
    transform: translate(-50%, -50%) scale(1.15) !important;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32) !important;
    transition: none !important;
}
