:root {
    --bg: #f4f6f4;
    --panel: rgba(255,255,255,.95);
    --panel-soft: rgba(255,255,255,.88);
    --line: rgba(0,0,0,.08);
    --text: #2f3133;
    --muted: #7b7f82;
    --green-brand: #76bd39;
    --green-brand-dark: #5e9f28;
    --gray-chip: #f1f2f2;
    --gray-soft: #f7f7f7;
    --shadow: 0 14px 34px rgba(0,0,0,.08);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --sensibilizacao: #e9dcf7;
    --consultoria: #5BBBE6;
    --implantacao-1: #FDB366;
    --implantacao-2: #F07D2C;
    --implantacao-3: #B8570B;
    --finalizacao: #256CAC;
    --implantados: #04471C;
    --municipio-stroke: rgba(255,255,255,.92);
    --municipio-default: #ffffff;
}

* {
    box-sizing: border-box;
}
[hidden] {
    display: none !important;
}
html, body {
    background: linear-gradient(180deg, #f6f7f6 0%, #edf1ed 100%);
}
body {
    margin: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);    
}

.shell {
    max-width: 1600px;
    margin: 0 auto;
    padding: 18px 18px 10px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 18px;
    margin-bottom: 14px;
    border-radius: 20px;
    background: var(--panel);
    border: 1px solid rgba(0,0,0,.06);
    box-shadow: var(--shadow);
}

.brand {
    display:flex;
    align-items:center;
    gap:14px;
    min-width:0;
}
.brand-mark {
    width: 188px;
    height: 62px;
    border-radius: 0;
    background: transparent;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow: none;
    flex: 0 0 auto;
    overflow: visible;
}
.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display:block;
}
.brand-copy {
    min-width:0;
}
.brand-title {
    margin:0;
    font-size:18px;
    font-weight:800;
    letter-spacing:-.02em;
}
.brand-subtitle {
    margin:3px 0 0;
    color:var(--muted);
    font-size:13px;
}

.top-actions {
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
}
.chip, .btn, .tab {
    border: 0;
    font: inherit;
    cursor:pointer;
    transition:.18s ease;
}
.chip {
    padding: 10px 14px;
    border-radius:999px;
    background: var(--gray-chip);
    border: 1px solid rgba(0,0,0,.05);
    color:#4b4f52;
    font-size:13px;
    font-weight:700;
}
.btn {
    padding: 11px 16px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid rgba(0,0,0,.06);
    background: white;
    color: var(--text);
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(180deg, #84ca45 0%, var(--green-brand) 100%);
    color: white;
    border-color: rgba(0,0,0,.02);
    box-shadow: 0 10px 24px rgba(118,189,57,.25);
}

.kpi-strip {
    display:grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap:12px;
    margin-bottom:14px;
}
.kpi {
    padding:18px 20px;
    border-radius:20px;
    background:var(--panel);
    border:1px solid rgba(0,0,0,.06);
    box-shadow: var(--shadow);
}
.kpi-label {
    display:flex;
    justify-content:space-between;
    gap:8px;
    color:var(--muted);
    font-size:11px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.08em;
    margin-bottom:14px;
}
.kpi-value {
    font-size:20px;
    font-weight:800;
    margin-bottom:6px;
}
.kpi-sub {
    font-size:13px;
    color:#666b6e;
}

.layout {
    display:grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap:14px;
    align-items:stretch;
}

.main-card, .side-card {
    overflow:hidden;
    padding:15px 14px;
    border-radius: 24px;
    background: var(--panel);
    border:1px solid rgba(0,0,0,.06);
    box-shadow: var(--shadow);
}
.main-card {
    padding: 16px;
}
.sidebar {
    display:flex;
    flex-direction:column;
    gap:14px;
}
.side-card {
    overflow:hidden;
    padding:15px 14px;
    padding: 16px;
}

.toolbar {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
    margin-bottom:14px;
}
.toolbar-left, .toolbar-right {
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
}

.tabs {
    display:inline-flex;
    gap:6px;
    padding:5px;
    border-radius:16px;
    background:#eef1ee;
    border:1px solid rgba(0,0,0,.05);
}
.tab {
    padding: 10px 14px;
    border-radius: 12px;
    background: transparent;
    color:#6f7578;
    font-size:14px;
    font-weight:700;
}
.tab.active {
    background:white;
    color:var(--text);
    box-shadow:0 6px 14px rgba(0,0,0,.08);
}

.search, .select-wrap {
    border-radius: 16px;
    background: white;
    border:1px solid rgba(0,0,0,.07);
    min-height: 46px;
    display:flex;
    align-items:center;
}
.search {
    min-width:320px;
    padding: 0 14px;
    gap:10px;
}
.search input, .select {
    width:100%;
    border:0;
    outline:0;
    background:transparent;
    color:var(--text);
    font:inherit;
}
.select-wrap {
    min-width:240px;
    padding: 0 12px;
}

.map-headline {
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:14px;
    margin-bottom:12px;
    padding: 2px 2px 0;
}
.map-title {
    margin:0;
    font-size:30px;
    letter-spacing:-.04em;
    line-height:1;
}
.map-subtitle {
    margin:6px 0 0;
    color:var(--muted);
    font-size:14px;
}

.map-board {
    position: relative;
    min-height: 920px;
    border-radius: 24px;
    background: linear-gradient(180deg, #fafbfa 0%, #f0f3ef 100%);
    border:1px solid rgba(0,0,0,.06);
    overflow:hidden;
}
.map-board::before {
    content:"";
    position:absolute;
    inset:0;
    background-image: linear-gradient(rgba(0,0,0,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,.03) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,.18), transparent 88%);
    pointer-events:none;
}
#map {
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
}

.loading-state, .error-state {
    position:absolute;
    inset:0;
    display:grid;
    place-items:center;
    text-align:center;
    padding:28px;
    z-index:2;
    color:#667076;
}
.loading-pill {
    display:inline-flex;
    align-items:center;
    gap:10px;
    padding:14px 18px;
    border-radius:999px;
    background:white;
    border:1px solid rgba(0,0,0,.07);
    box-shadow:var(--shadow);
    font-weight:700;
}
.spinner {
    width:16px;
    height:16px;
    border-radius:999px;
    border:2px solid rgba(118,189,57,.22);
    border-top-color: var(--green-brand);
    animation:spin 1s linear infinite;
}
@keyframes spin {
    to {
        transform:rotate(360deg);
    }
}

.map-overlay {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:12px;
    margin-top:14px;
}
.legend, .map-helper {
    border-radius:18px;
    background:rgba(255,255,255,.94);
    border:1px solid rgba(0,0,0,.07);
    box-shadow: var(--shadow);
    padding: 14px 16px;
}
.legend-title, .section-title {
    font-size:14px;
    color:#7a8084;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.08em;
    margin-bottom:12px;
}

.legend-title-etapas {
    margin-top: 20px;
    font-size:14px;
    color:#000;
    font-weight:normal;    
    margin-bottom:20px;
}

.legend-list {
    display:flex;
    flex-wrap:wrap;
    gap:10px 16px;
}
.legend-item {
    display:inline-flex;
    align-items:center;
    gap:8px;
    font-size:13px;
    font-weight:700;
    color:#4f5357;
}
.swatch {
    width:12px;
    height:12px;
    border-radius:999px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.16), 0 0 0 1px rgba(255,255,255,.55);
}
.map-helper {
    font-size:13px;
    color:#5d656a;
    max-width:360px;
    line-height:1.5;
}

.tooltip {
    position:fixed;
    z-index:100;
    padding:14px 14px 12px;
    border-radius:16px;
    background: rgba(47,49,51,.94);
    color:white;
    box-shadow:0 20px 44px rgba(0,0,0,.30);
    opacity:0;
    transform:translateY(8px);
    pointer-events:none;
    transition:opacity .14s ease, transform .14s ease;
}
.tooltip.visible {
    opacity:1;
    transform:translateY(0);
}
.tooltip .name {
    font-size:15px;
    font-weight:800;
    margin-bottom:8px;
}
.tooltip .stage {
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:8px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
    background:rgba(255,255,255,.10);
    margin-bottom:8px;
}
.tooltip .meta {
    font-size:12px;
    color:rgba(255,255,255,.86);
    line-height:1.6;
}

.municipality {
    stroke: rgba(180,188,192,.92);
    stroke-width:.7;
    fill:var(--municipio-default);
    transition: fill .2s ease, opacity .2s ease, filter .2s ease, stroke-width .2s ease, transform .2s ease;
    cursor:pointer;
    vector-effect:non-scaling-stroke;
}
.municipality:hover {
    stroke:#1f2937;
    stroke-width:1.45;
    filter:brightness(1.03) saturate(1.02);
}
.municipality.dimmed {
    opacity:.18;
}
.municipality.active {
    stroke:#2f3133;
    stroke-width:1.2;
    filter:drop-shadow(0 8px 18px rgba(0,0,0,.18));
}
.outline {
    fill:none;
    stroke:rgba(0,0,0,.18);
    stroke-width:1.15;
    vector-effect:non-scaling-stroke;
    pointer-events:none;
}

/*
[data-stage="adesao"] {
    fill: var(--sensibilizacao);
}
[data-stage="consultoria"] {
    fill: var(--consultoria);
}
[data-stage="implantacao_1"] {
    fill: var(--implantacao-1);
}
[data-stage="implantacao_2"] {
    fill: var(--implantacao-2);
}
[data-stage="implantacao_3"] {
    fill: var(--implantacao-3);
}
[data-stage="implantados"] {
    fill: var(--implantados);
}
[data-stage="sem_inicio"] {
    fill: #FFFFFF;
}
*/

.stage-sensibilizacao {
    background: rgba(217,221,225,.68);
    color:#e9dcf7;
    border:1px solid rgba(93,101,112,.12);
}
.stage-implantacao {
    background: rgba(224,159,62,.16);
    color:#9c6517;
    border:1px solid rgba(224,159,62,.18);
}
.stage-finalizacao {
    background: rgba(40,75,99,.14);
    color:#284b63;
    border:1px solid rgba(40,75,99,.18);
}
.stage-implantados {
    background: rgba(4,71,28,.16);
    color:#04471C;
    border:1px solid rgba(4,71,28,.26);
}
.stage-sem_inicio {
    background: rgba(237,237,237,.45);
    color:#7a7f84;
    border:1px solid rgba(180,188,192,.45);
}

.municipio-title {
    margin:0 0 4px;
    font-size:28px;
    line-height:.98;
    letter-spacing:-.04em;
}
.muted {
    color:#667075;
    font-size:14px;
    line-height:1.58;
}
.stage-pill {
    display:inline-flex;
    align-items:center;
    gap:8px;
    margin-top:14px;
    padding:10px 12px;
    border-radius:999px;
    font-size:13px;
    font-weight:800;
}
.status-dot {
    width:10px;
    height:10px;
    border-radius:999px;
    display:inline-block;
}
.progress-track {
    width:100%;
    height:12px;
    border-radius:999px;
    background: rgba(0,0,0,.08);
    overflow:hidden;
    margin:12px 0 8px;
}
.progress-bar {
    height:100%;
    border-radius:inherit;
    background: linear-gradient(90deg, #84ca45 0%, var(--green-brand) 100%);
}
.stage-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
    margin-top:14px;
}
.mini-card {
    padding:14px;
    border-radius:16px;
    background:var(--gray-soft);
    border:1px solid rgba(0,0,0,.05);
}
.mini-card .label {
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:.08em;
    color:var(--muted);
    font-weight:800;
    margin-bottom:8px;
}
.mini-card .value {
    font-size:19px;
    font-weight:800;
    line-height:1;
    letter-spacing:-.03em;
    margin-bottom:5px;
}
.mini-card .desc {
    font-size:12px;
    color:var(--muted);
    line-height:1.5;
}
.empty-state {
    display:flex;
    flex-direction:column;
    gap:10px;
    min-height:220px;
    justify-content:center;
}
.list {
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-top:12px;
}
.list-row {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:11px 0;
    border-bottom:1px solid rgba(0,0,0,.06);
    font-size:14px;
}
.list-row:last-child {
    border-bottom:0;
    padding-bottom:0;
}
.stage-list {
    display:flex;
    flex-direction:column;
    gap:10px;
}
.stage-row {
    display:grid;
    grid-template-columns: 136px minmax(68px,1fr) 30px;
    gap:8px;
    min-height: 18px;
    align-items:center;
}
.stage-line {
    height:10px;
    border-radius:999px;
    background:rgba(0,0,0,.08);
    overflow:hidden;
}
.stage-line > span {
    display:block;
    height:100%;
    border-radius:inherit;
    width:0;
}


[data-stage="sensibilizacao_1"] {
    fill: var(--sensibilizacao-1);
}
[data-stage="sensibilizacao_2"] {
    fill: var(--sensibilizacao-2);
}
[data-stage="sensibilizacao_3"] {
    fill: var(--sensibilizacao-3);
}

.stage-sensibilizacao_1 {
    background: rgba(250,224,138,.30);
    color:#e9dcf7;
    border:1px solid rgba(250,224,138,.45);
}
.stage-sensibilizacao_2 {
    background: rgba(247,207,98,.28);
    color:#e9dcf7;
    border:1px solid rgba(247,207,98,.45);
}
.stage-sensibilizacao_3 {
    background: rgba(245,190,59,.26);
    color:#e9dcf7;
    border:1px solid rgba(245,190,59,.45);
}

.history-list {
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-top:16px;
}
.history-item {
    border:1px solid rgba(0,0,0,.06);
    border-radius:16px;
    background:#fafafa;
    padding:12px 12px 10px;
    margin-bottom: 10px;
}
.history-item:last-child {
    margin-bottom: 0px!important;
}
    
.history-top {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    margin-bottom:8px;
}
.history-name {
    font-size:13px;
    font-weight:800;
    color:#2f3133;
    display:flex;
    align-items:center;
    gap:8px;
}
.history-days {
    font-size:12px;
    font-weight:800;
    color:#5d656a;
}
.history-dates {
    font-size:12px;
    color:var(--muted);
    line-height:1.5;
}
.details-stack {
    display:flex;
    flex-direction:column;
    gap:12px;
}

.stage-sensibilizacao {
    background: rgba(250,224,138,.30);
    color:#e9dcf7;
    border:1px solid rgba(250,224,138,.48);
}
.stage-consultoria {
    background: rgba(202,240,248,.62);
    color:#155e75;
    border:1px solid rgba(72,126,141,.28);
}
.stage-implantacao_1 {
    background: rgba(253,225,199,.65);
    color:#9c6a37;
    border:1px solid rgba(253,225,199,.85);
}
.stage-implantacao_2 {
    background: rgba(251,172,107,.26);
    color:#9c6517;
    border:1px solid rgba(251,172,107,.40);
}
.stage-implantacao_3 {
    background: rgba(240,125,44,.20);
    color:#9a4d10;
    border:1px solid rgba(240,125,44,.36);
}

.details-stack {
    display:flex;
    flex-direction:column;
    gap:12px;
}
.history-list {
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-top:16px;
}
.history-item {
    border:1px solid rgba(0,0,0,.06);
    border-radius:16px;
    background:#fafafa;
    padding:12px 12px 10px;
}
.history-top {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    margin-bottom:8px;
}
.history-name {
    font-size:13px;
    font-weight:800;
    color:#2f3133;
    display:flex;
    align-items:center;
    gap:8px;
}
.history-days {
    font-size:12px;
    font-weight:800;
    color:#5d656a;
}
.history-dates {
    font-size:12px;
    color:var(--muted);
    line-height:1.5;
}


.partners {
    margin-top: 14px;
    border-radius: 22px;
    background: var(--panel);
    border:1px solid rgba(0,0,0,.06);
    box-shadow:var(--shadow);
    overflow:hidden;
}
.partners-topline {
    height: 7px;
    background: var(--green-brand);
}
.partners-inner {
    min-height: 70px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:34px;
    padding: 16px 20px;
    flex-wrap:wrap;
}
.partner-logo {
    max-height: 28px;
    width:auto;
    object-fit:contain;
    opacity:.95;
    filter: grayscale(.05);
}
.partner-fallback {
    padding: 8px 12px;
    border-radius: 12px;
    background: #f5f6f5;
    border:1px solid rgba(0,0,0,.05);
    font-size:13px;
    color:#6a6f72;
    font-weight:700;
}


.kpi-stage-grid {
    display:flex;
    flex-direction:column;
    gap:10px;
}
.kpi-stage-card {
    border-radius:18px;
    border:1px solid rgba(0,0,0,.05);
    background:linear-gradient(180deg, rgba(255,255,255,.95) 0%, rgba(247,247,247,.95) 100%);
    padding:14px;
    box-shadow: 0 8px 20px rgba(0,0,0,.04);
}
.kpi-stage-card {
    border-radius:16px;
    border:1px solid rgba(0,0,0,.05);
    background:#f8f8f8;
    padding:14px;
}
.kpi-stage-top {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-bottom:8px;
}
.kpi-stage-name {
    display:flex;
    align-items:center;
    gap:8px;
    font-size:14px;
    font-weight:800;
    color:#3f4448;
}
.kpi-stage-value {
    font-size:18px;
    font-weight:800;
    letter-spacing:-.03em;
    color:#2f3133;
}
.kpi-stage-desc {
    font-size:12px;
    line-height:1.55;
    color:#5f666a;
    margin-bottom:10px;
}
.kpi-stage-line {
    height:10px;
    width:100%;
    border-radius:999px;
    background:rgba(0,0,0,.07);
    overflow:hidden;
}
.kpi-stage-line > span {
    display:block;
    height:100%;
    border-radius:inherit;
}



/* Force internal refresh for  */


.stage-row.group-row {
    font-weight: 800;
    margin-top: 4px;
}
.stage-row.sub-row {
    padding-left: 20px;
    grid-template-columns: 118px minmax(66px,1fr) 28px;
    min-height: 28px;
}
.sub-row-last {
    margin-bottom: 10px;    
}
.stage-row.sub-row strong {
    font-size: 12px;
}


.stage-line > span,
.kpi-stage-line > span {
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}


.stage-breakdown-wrap {
    display:flex;
    flex-direction:column;
    gap:8px;
    margin-top:8px;
}
.stage-row {
    display:grid;
    grid-template-columns: 136px minmax(68px,1fr) 30px;
    gap:8px;
    min-height: 18px;
    align-items:center;
}
.stage-row > span:first-child {
    display:flex;
    align-items:center;
    line-height:1.22;
    font-size:13px;
    color:#33383c;
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.stage-row > strong {
    font-size:13px;
    font-weight:800;
    color:#3a4044;
    text-align:right;
    letter-spacing:-.01em;
}
.stage-row.group-row > span:first-child {
    font-weight:800;
    color:#2f3133;
}
.stage-row.group-row > span:first-child,
.stage-row.sub-row > span:first-child {
    font-size:9px;
    color:#656b70;
    line-height:1.18;
    white-space:normal;
    overflow:visible;
    text-overflow:clip;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    max-width:100%;
    padding-right:2px;
}
.stage-row.sub-row {
    padding-left: 20px;
    grid-template-columns: 118px minmax(66px,1fr) 28px;
    min-height: 28px;
}
.stage-row.sub-row > span:first-child {
    font-size:9px;
    color:#656b70;
    line-height:1.18;
    white-space:normal;
    overflow:visible;
    text-overflow:clip;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    max-width:100%;
    padding-right:2px;
}
.stage-row.sub-row > strong {
    font-size:11px;
}
.stage-row.sub-row > span:first-child::before {
    content: "";
    position: absolute;
    left: -12px;
    top: -1px;
    bottom: -1px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--implantacao-1), var(--implantacao-2), var(--implantacao-3));
    opacity: .95;
}
.stage-row.sub-row > span:first-child::after {
    content: "";
    position: absolute;
    left: -16px;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -3.5px;
    border-radius: 999px;
    background: rgba(240,125,44,.96);
    box-shadow: 0 0 0 2px rgba(240,125,44,.14);
}
.stage-line {
    height: 10px;
    display:flex;
    align-items:center;
    background: rgba(0,0,0,.06);
    border-radius:999px;
    overflow:hidden;
}
.stage-line > span {
    min-width: 2px;
    height:100%;
    display:block;
    border-radius:999px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
}


.municipality.filtered-highlight {
    stroke: #111827 !important;
    stroke-width: 1.2 !important;
    stroke-opacity: 0.7;
}
.municipality.filtered-dimmed {
    opacity: .22;
}
.municipio-list-card {
    margin-top: 14px;
    border-radius: 18px;
    background: rgba(255,255,255,.94);
    border:1px solid rgba(0,0,0,.07);
    box-shadow: var(--shadow);
    padding: 14px 16px;
}
.municipio-list-head {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:10px;
}
.municipio-list-count {
    font-size:12px;
    color:#6d7478;
    font-weight:800;
}
.municipio-list-grid {
    display:grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap:8px 14px;
}
.municipio-list-item {
    font-size:13px;
    color:#3e4347;
    padding:6px 0;
    border-bottom:1px solid rgba(0,0,0,.05);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.municipio-list-empty {
    font-size:13px;
    color:#6d7478;
    line-height:1.5;
    padding:4px 0 2px;
}

@media (max-width: 1200px) {
    .layout {
        grid-template-columns:1fr;
    }
    .kpi-strip {
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
    .map-board {
        min-height: 680px;
    }
}
@media (max-width: 760px) {
    .municipio-list-grid {
        grid-template-columns:1fr;
    }
    .shell {
        padding: 12px;
    }
    .topbar, .main-card, .side-card {
        overflow:hidden;
        padding:15px 14px;
        border-radius:18px;
    }
    .kpi-strip {
        grid-template-columns:1fr;
    }
    .search, .select-wrap {
        min-width:100%;
    }
    .toolbar-left, .toolbar-right, .toolbar {
        width:100%;
    }
    .map-board {
        min-height: 560px;
    }
    .map-overlay {
        grid-template-columns:1fr;
    }
    .partners-inner {
        gap:18px;
    }
}

/* Responsividade aprimorada */
img, svg {
    max-width: 100%;
    height: auto;
}

.shell {
    width: 100%;
}

.topbar,
.main-card,
.side-card,
.kpi,
.legend,
.map-helper,
.municipio-list-card,
.partners {
    min-width: 0;
}

.brand {
    min-width: 0;
    flex: 1 1 auto;
}

.brand-copy {
    min-width: 0;
}

.brand-title {
    word-break: break-word;
}

.toolbar-left,
.toolbar-right {
    min-width: 0;
}

.search,
.select-wrap {
    width: 100%;
    min-width: 0;
}

.search input,
.select {
    min-width: 0;
}

.map-board {
    min-height: clamp(420px, 62vh, 920px);
}

.municipio-list-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.partners-inner {
    justify-content: center;
}

@media (max-width: 1360px) {
    .layout {
        grid-template-columns: minmax(0, 1fr) 320px;
    }

    .map-title {
        font-size: 28px;
    }

    .municipio-list-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .shell {
        padding: 14px 14px 10px;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .top-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .kpi-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
    }

    .main-card {
        order: 1;
    }

    .map-board {
        min-height: clamp(420px, 58vh, 760px);
    }
}

@media (max-width: 820px) {
    .shell {
        padding: 12px 12px 8px;
    }

    .topbar {
        padding: 12px 14px;
        border-radius: 18px;
    }

    .brand {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .brand-mark {
        width: min(180px, 48vw);
        height: auto;
    }

    .brand-title {
        font-size: 16px;
        line-height: 1.25;
    }

    .brand-subtitle {
        font-size: 12px;
        line-height: 1.45;
    }

    .top-actions {
        justify-content: stretch;
    }

    .top-actions .btn,
    .toolbar-right .btn {
        width: 100%;
    }

    .kpi-strip {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .kpi {
        padding: 16px;
        border-radius: 18px;
    }

    .kpi-value {
        font-size: 30px;
    }

    .main-card,
    .side-card,
    .partners,
    .municipio-list-card {
        border-radius: 18px;
    }

    .main-card {
        padding: 14px;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .map-headline {
        flex-direction: column;
        align-items: flex-start;
    }

    .map-title {
        font-size: 24px;
        line-height: 1.1;
    }

    .map-subtitle {
        font-size: 13px;
    }

    .map-board {
        min-height: clamp(360px, 52vh, 620px);
        border-radius: 18px;
    }

    .map-overlay {
        grid-template-columns: 1fr;
    }

    .legend,
    .map-helper,
    .municipio-list-card {
        border-radius: 16px;
    }

    .municipio-list-grid {
        grid-template-columns: 1fr;
    }

    .stage-grid {
        grid-template-columns: 1fr;
    }

    .stage-row {
        grid-template-columns: 120px minmax(56px, 1fr) 28px;
    }

    .stage-row.sub-row {
        grid-template-columns: 104px minmax(56px, 1fr) 26px;
    }

    .partners-inner {
        gap: 14px;
        padding: 14px;
    }

    .partner-logo {
        max-height: 24px;
    }
}

@media (max-width: 560px) {
    body {
        font-size: 14px;
    }

    .shell {
        padding: 10px 10px 6px;
    }

    .topbar,
    .main-card,
    .side-card,
    .kpi,
    .partners {
        border-radius: 16px;
    }

    .topbar {
        gap: 12px;
    }

    .brand-mark {
        width: min(160px, 52vw);
    }

    .brand-title {
        font-size: 15px;
    }

    .kpi {
        padding: 14px;
    }

    .kpi-label {
        font-size: 10px;
    }

    .kpi-value {
        font-size: 26px;
    }

    .kpi-sub {
        font-size: 12px;
    }

    .btn,
    .btn-primary,
    .search,
    .select-wrap {
        min-height: 44px;
    }

    .map-title {
        font-size: 22px;
    }

    .map-subtitle,
    .muted,
    .map-helper {
        font-size: 12px;
    }

    .map-board {
        min-height: clamp(320px, 48vh, 500px);
    }

    .legend-list {
        gap: 8px 12px;
    }

    .legend-item {
        font-size: 12px;
    }

    .tooltip {
        min-width: 0;
        max-width: min(88vw, 320px);
    }

    .municipio-title {
        font-size: 24px;
    }

    .list-row {
        font-size: 13px;
    }

    .stage-row {
        grid-template-columns: 112px minmax(44px, 1fr) 24px;
        gap: 6px;
    }

    .stage-row > span:first-child {
        font-size: 12px;
    }

    .stage-row > strong {
        font-size: 12px;
    }

    .stage-row.sub-row {
        padding-left: 16px;
        grid-template-columns: 96px minmax(44px, 1fr) 24px;
        min-height: 26px;
    }

    .stage-row.sub-row > span:first-child {
        font-size: 8.5px;
    }

    .municipio-list-item {
        font-size: 12px;
    }
}