:root {
    --bg-body: #f1f5f9;
    --bg-panel: #ffffff;
    --bg-muted: #f8fafc;
    --text-main: #0f172a;
    --text-subtle: #64748b;
    --border: #e2e8f0;
    --accent: #73c341;
    --radius: 12px;
    --gap: 16px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.22);
}

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

html,
body {
    height: 100%;
}

body {
    font-family: 'Russo One', sans-serif;
    color: #000000;
    background-color: var(--bg-body);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

input,
select,
button,
textarea {
    font-family: inherit;
}

.filter-bar {
    min-height: 60px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background-color: var(--bg-panel);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1001;
}

.filter-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 4px 8px 4px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-panel);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.lang-switcher-label {
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1;
    white-space: nowrap;
}

.lang-toggle-btn {
    width: 34px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lang-toggle-btn:hover {
    transform: translateY(-1px);
}

.lang-toggle-btn:focus-visible {
    outline: 2px solid rgba(115, 195, 65, 0.35);
    outline-offset: 2px;
}

.lang-flag {
    width: 28px;
    height: 18px;
    display: none;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.lang-flag-en {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 18'%3E%3Crect width='28' height='18' fill='%23b22234'/%3E%3Cg fill='%23ffffff'%3E%3Crect y='1.38' width='28' height='1.38'/%3E%3Crect y='4.15' width='28' height='1.38'/%3E%3Crect y='6.92' width='28' height='1.38'/%3E%3Crect y='9.69' width='28' height='1.38'/%3E%3Crect y='12.46' width='28' height='1.38'/%3E%3Crect y='15.23' width='28' height='1.38'/%3E%3C/g%3E%3Crect width='12' height='9.7' fill='%233c3b6e'/%3E%3Cg fill='%23ffffff'%3E%3Ccircle cx='2' cy='2' r='0.45'/%3E%3Ccircle cx='4.5' cy='2' r='0.45'/%3E%3Ccircle cx='7' cy='2' r='0.45'/%3E%3Ccircle cx='9.5' cy='2' r='0.45'/%3E%3Ccircle cx='2' cy='4.2' r='0.45'/%3E%3Ccircle cx='4.5' cy='4.2' r='0.45'/%3E%3Ccircle cx='7' cy='4.2' r='0.45'/%3E%3Ccircle cx='9.5' cy='4.2' r='0.45'/%3E%3Ccircle cx='2' cy='6.4' r='0.45'/%3E%3Ccircle cx='4.5' cy='6.4' r='0.45'/%3E%3Ccircle cx='7' cy='6.4' r='0.45'/%3E%3Ccircle cx='9.5' cy='6.4' r='0.45'/%3E%3Ccircle cx='2' cy='8.6' r='0.45'/%3E%3Ccircle cx='4.5' cy='8.6' r='0.45'/%3E%3Ccircle cx='7' cy='8.6' r='0.45'/%3E%3Ccircle cx='9.5' cy='8.6' r='0.45'/%3E%3C/g%3E%3C/svg%3E");
}

.lang-flag-pt {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 18'%3E%3Crect width='28' height='18' fill='%23009b3a'/%3E%3Cpolygon points='14,2 24,9 14,16 4,9' fill='%23ffdf00'/%3E%3Ccircle cx='14' cy='9' r='4' fill='%23002776'/%3E%3Cpath d='M10.3 8.45c1.35-0.95 3.2-1.35 7.35-0.2' fill='none' stroke='%23ffffff' stroke-width='0.9' stroke-linecap='round'/%3E%3C/svg%3E");
}

.lang-switcher[data-next-lang='en'] .lang-flag-en,
.lang-switcher[data-next-lang='pt-BR'] .lang-flag-pt {
    display: block;
}

.nav-toggle {
    display: inline-flex;
    align-items: center;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-muted);
    overflow: hidden;
}

.nav-btn {
    border: none;
    background: none;
    color: #94a3b8;
    height: 100%;
    min-width: 120px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-btn:hover {
    color: #475569;
}

.nav-btn.active {
    background-color: #e2e8f0;
    color: var(--text-main);
}

.filter-metrics {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 2px;
}

.filter-metrics::-webkit-scrollbar {
    height: 6px;
}

.filter-metrics::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 999px;
}

.filter-metrics input {
    width: 36px;
    min-width: 0;
    height: 36px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #475569;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.filter-metrics input:focus {
    width: min(220px, 48vw);
    border-color: var(--accent);
    background-color: var(--bg-muted);
    background-position: 8px center;
    padding: 0 10px 0 34px;
    outline: none;
    cursor: text;
}

.filter-metrics select {
    height: 36px;
    min-width: 104px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #475569;
    background-color: var(--bg-muted);
    font-size: 0.8rem;
    cursor: pointer;
}

.filter-metrics select:focus,
.filter-metrics input:focus {
    outline: none;
    border-color: var(--accent);
}

.main-container {
    flex: 1;
    min-height: 0;
    display: flex;
    gap: var(--gap);
    padding: var(--gap);
    min-height: 560px;
}

#view-frig-map,
#view-frig-chart,
.varejo-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--bg-panel);
    box-shadow: var(--shadow);
    min-width: 0;
    min-height: 0;
}

#view-frig-map {
    flex: 55 1 0;
    position: relative;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

#view-frig-chart {
    flex: 45 1 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 18px;
}

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

.ranking-header h3 {
    font-size: 1.1rem;
    line-height: 1.2;
}

.ranking-axis-label {
    text-align: right;
    font-size: 0.7rem;
    color: var(--text-subtle);
    padding-right: 4px;
    margin-bottom: 4px;
    line-height: 1.3;
}

.filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-stats {
    color: var(--text-subtle);
    white-space: nowrap;
    font-size: 0.82rem;
}

#btn-view-table.nav-btn,
#btn-reset-filters {
    min-width: unset;
    height: 36px;
    padding: 0 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background-color: #e2e8f0;
    color: #1e293b;
}

#btn-view-table.nav-btn:hover,
#btn-reset-filters:hover {
    background-color: #cbd5e1;
}

#ranking-scroll-container,
#varejo-scroll-container,
#varejo-direct-indirect-scroll-container {
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow: auto;
}

#ranking-inner-wrapper,
#varejo-inner-wrapper,
#varejo-direct-indirect-inner-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
}

#rankingChart,
#varejoChart,
#varejoDirectIndirectChart {
    width: 100%;
    height: 100%;
}

#view-varejistas {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    gap: var(--gap);
    background: transparent;
    overflow: hidden;
}

/* Bioma Cerrado view */
#view-cerrado {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    gap: var(--gap);
    background: transparent;
    overflow: hidden;
}

#view-cerrado-map {
    flex: 55 1 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--bg-panel);
    box-shadow: var(--shadow);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

#cerrado-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

#view-cerrado-chart {
    flex: 45 1 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--bg-panel);
    box-shadow: var(--shadow);
    min-width: 0;
    min-height: 0;
}

#cerrado-ranking-scroll-container {
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow: auto;
}

#cerrado-ranking-inner-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
}

#cerradoRankingChart {
    width: 100%;
    height: 100%;
}

#cerrado-ranking-scroll-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#cerrado-ranking-scroll-container::-webkit-scrollbar-track {
    background: #f1f5f9;
}

#cerrado-ranking-scroll-container::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 999px;
}

#btn-cerrado-view-table.nav-btn {
    min-width: unset;
    height: 36px;
    padding: 0 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background-color: #e2e8f0;
    color: #1e293b;
}

#btn-cerrado-view-table.nav-btn:hover {
    background-color: #cbd5e1;
}

.leaflet-marker-icon.cerrado-cluster-wrapper {
    background: transparent;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cerrado-cluster-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(184, 66, 58, 0.82);
    border: 2px solid rgba(132, 38, 33, 0.92);
    color: #fff;
    font-family: 'Russo One', sans-serif;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.28);
}

.cerrado-cluster-icon span {
    line-height: 1;
}

.cerrado-cluster-icon--medium {
    width: 42px;
    height: 42px;
    background: rgba(184, 66, 58, 0.88);
    font-size: 13px;
}

.cerrado-cluster-icon--large {
    width: 48px;
    height: 48px;
    background: rgba(132, 38, 33, 0.9);
    border-color: rgba(102, 28, 24, 0.96);
    font-size: 14px;
}

.cerrado-legend {
    position: absolute;
    bottom: 24px;
    right: 16px;
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.78rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.cerrado-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cerrado-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.varejo-panel {
    width: 50%;
    display: flex;
    flex-direction: column;
    padding: 18px;
    overflow: hidden;
}

#ranking-scroll-container::-webkit-scrollbar,
#varejo-scroll-container::-webkit-scrollbar,
#varejo-direct-indirect-scroll-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#ranking-scroll-container::-webkit-scrollbar-track,
#varejo-scroll-container::-webkit-scrollbar-track,
#varejo-direct-indirect-scroll-container::-webkit-scrollbar-track {
    background: #f1f5f9;
}

#ranking-scroll-container::-webkit-scrollbar-thumb,
#varejo-scroll-container::-webkit-scrollbar-thumb,
#varejo-direct-indirect-scroll-container::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 999px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.modal-content {
    width: min(980px, 92vw);
    height: min(760px, 86dvh);
    border-radius: var(--radius);
    background-color: var(--bg-panel);
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background-color: var(--bg-muted);
}

.modal-header h2 {
    font-size: 1.1rem;
    color: #1e293b;
}

.close-btn {
    border: none;
    background: none;
    color: #64748b;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.close-btn:hover {
    color: #0f172a;
}

.modal-body {
    flex: 1;
    overflow: auto;
    padding: 0 20px 16px;
}

#risk-table {
    width: 100%;
    min-width: 620px;
    border-collapse: separate;
    border-spacing: 0;
    color: #334155;
}

#risk-table th,
#risk-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

#risk-table th {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #f1f5f9;
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    padding-top: 16px;
}

#risk-table tbody tr:hover {
    background-color: #f8fafc;
}

#risk-table th:last-child,
#risk-table td:last-child {
    min-width: 240px;
}

.risk-exposure-meter {
    position: relative;
    min-width: 200px;
    height: 34px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 8px;
    background: #f8fafc;
    overflow: hidden;
}

.risk-exposure-meter::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid #e2e8f0;
    border-radius: inherit;
    pointer-events: none;
}

.risk-exposure-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--risk-width);
    background: linear-gradient(90deg, rgba(196, 149, 106, 0.88) 0%, rgba(221, 185, 140, 0.96) 100%);
}

.risk-exposure-value {
    position: relative;
    z-index: 1;
    color: #1e293b;
    font-size: 0.82rem;
}

.leaflet-tooltip {
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border);
    color: #1e293b;
    border-radius: 4px;
}

.leaflet-popup-content-wrapper {
    background-color: rgba(255, 255, 255, 0.95);
    color: #1e293b;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.leaflet-popup-content {
    margin: 12px 14px;
}

.leaflet-popup-tip {
    background-color: rgba(255, 255, 255, 0.95);
}

.feature-popup {
    min-width: 240px;
    max-width: min(420px, 76vw);
    font-family: 'Russo One', sans-serif;
}

.feature-popup__title {
    margin-bottom: 10px;
    font-size: 0.92rem;
    line-height: 1.35;
    color: #0f172a;
}

.feature-popup__table-wrap {
    max-height: min(300px, 44vh);
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
}

.feature-popup__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    color: #334155;
}

.feature-popup__table th,
.feature-popup__table td {
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #e2e8f0;
}

.feature-popup__table tr:last-child th,
.feature-popup__table tr:last-child td {
    border-bottom: none;
}

.feature-popup__table th {
    width: 40%;
    color: #475569;
    background: #f8fafc;
    font-weight: normal;
}

.feature-popup__table td {
    line-height: 1.5;
    word-break: break-word;
    white-space: normal;
    background: #ffffff;
}

.leaflet-control-attribution {
    display: none !important;
}

.leaflet-control-layers-toggle {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e293b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 2 2 7 12 12 22 7 12 2'%3E%3C/polygon%3E%3Cpolyline points='2 17 12 22 22 17'%3E%3C/polyline%3E%3Cpolyline points='2 12 12 17 22 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 20px 20px;
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 36px !important;
    height: 36px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.leaflet-control-layers-toggle:hover {
    background-color: #f1f5f9;
}

/* --- RADAR VERDE LEGEND --- */
.radar-verde-legend {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 0;
    font-family: 'Russo One', sans-serif;
    font-size: 11px;
    color: #334155;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    border: 1px solid #e2e8f0;
    max-width: 260px;
    line-height: 1.4;
    overflow: hidden;
    transition: max-width 0.2s;
}

.radar-verde-legend.collapsed {
    max-width: 130px;
}

.legend-toggle-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.legend-toggle-label {
    font-size: 11px;
    font-weight: bold;
    color: #1e293b;
}

.legend-toggle-btn {
    border: none;
    background: none;
    color: #64748b;
    font-size: 11px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

.legend-toggle-btn:hover {
    color: #1e293b;
}

.legend-body {
    padding: 12px 14px;
}

.legend-title {
    font-size: 11px;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 10.5px;
}

.legend-circle {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.legend-swatch {
    display: inline-block;
    width: 18px;
    height: 12px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.legend-separator {
    border-top: 1px solid #e2e8f0;
    margin: 10px 0;
}

.legend-size-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.legend-size-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10px;
}

.legend-size-circle {
    display: inline-block;
    border-radius: 50%;
    border: 2px solid #8a8278;
    background: rgba(180, 170, 150, 0.3);
    flex-shrink: 0;
}

.legend-zone-swatch {
    display: inline-block;
    width: 20px;
    height: 14px;
    background: #e8dfc8;
    border: 1px solid #c4b99a;
    border-radius: 2px;
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    body {
        overflow: auto;
    }

    .filter-bar {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 10px;
    }

    .filter-logo {
        width: 100%;
    }

    .filter-metrics {
        width: 100%;
        flex: 1 1 100%;
        padding-bottom: 4px;
    }

    .main-container {
        min-height: calc(100dvh - 118px);
        height: auto;
        flex-direction: column;
    }

    #view-frig-map {
        flex: none;
        min-height: 46dvh;
    }

    #view-frig-chart {
        flex: 1;
        min-height: 420px;
    }

    #view-varejistas {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .varejo-panel {
        width: 100%;
        min-height: 380px;
    }

    .filter-actions {
        justify-content: flex-start;
    }

    .radar-verde-legend {
        max-width: 220px;
        font-size: 10px;
    }

    .legend-body {
        padding: 10px 12px;
    }

    .legend-title {
        font-size: 10px;
    }

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

@media (max-width: 768px) {
    :root {
        --gap: 10px;
    }

    .filter-bar {
        padding: 10px;
        gap: 8px;
    }

    .nav-toggle {
        width: 100%;
    }

    .nav-btn {
        flex: 1;
        min-width: 0;
        padding: 0 10px;
        font-size: 0.78rem;
    }

    .filter-metrics select {
        min-width: 92px;
        height: 34px;
        font-size: 0.74rem;
    }

    .filter-metrics input {
        width: 34px;
        height: 34px;
        background-size: 16px;
    }

    .filter-metrics input:focus {
        width: min(170px, 58vw);
    }

    .main-container {
        padding: 10px;
    }

    #view-frig-map {
        min-height: 42dvh;
    }

    #view-frig-chart {
        padding: 12px;
        min-height: 360px;
    }

    .ranking-header {
        margin-bottom: 10px;
    }

    .ranking-header h3 {
        font-size: 0.96rem;
    }

    .varejo-panel {
        padding: 12px;
        min-height: 320px;
    }

    #btn-view-table.nav-btn,
    #btn-reset-filters {
        height: 34px;
        font-size: 0.74rem;
        padding: 0 10px;
    }

    .modal-overlay {
        padding: 10px;
    }

    .modal-content {
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 10px;
    }

    .modal-header {
        padding: 12px;
    }

    .modal-header h2 {
        font-size: 0.95rem;
    }

    .modal-body {
        padding: 0 12px 12px;
    }

    #risk-table {
        min-width: 560px;
    }

    #risk-table th,
    #risk-table td {
        padding: 10px;
        font-size: 0.78rem;
    }

    #risk-table th:last-child,
    #risk-table td:last-child {
        min-width: 180px;
    }

    .risk-exposure-meter {
        min-width: 150px;
        height: 30px;
        padding: 0 8px;
    }

    .risk-exposure-value {
        font-size: 0.76rem;
    }

    .radar-verde-legend {
        max-width: 190px;
        font-size: 9px;
    }

    .legend-body {
        padding: 8px 10px;
    }

    .legend-title {
        font-size: 9px;
        margin-bottom: 5px;
    }

    .legend-item {
        gap: 5px;
        margin-bottom: 3px;
        font-size: 9px;
    }

    .legend-circle {
        width: 11px;
        height: 11px;
    }

    .legend-size-item {
        font-size: 8px;
        gap: 6px;
    }

    .legend-size-circle {
        transform: scale(0.75);
    }

    .legend-separator {
        margin: 6px 0;
    }
}

@media (max-width: 480px) {
    #view-frig-map {
        min-height: 38dvh;
    }

    #view-frig-chart {
        min-height: 320px;
    }

    .varejo-panel {
        min-height: 280px;
    }

    .filter-metrics select {
        min-width: 86px;
    }

    .filter-stats {
        font-size: 0.72rem;
    }
}
