/* Painéis do mapa e do gráfico: mesma altura em telas largas, empilhados em telas estreitas. */
.map-panel,
.chart-panel {
    height: clamp(460px, calc(100vh - 345px), 880px);
}

.map-panel {
    position: relative;
    overflow: hidden;
    padding: 0;
    /* Mantém os z-index do Leaflet (400 a 1000) dentro do painel, abaixo dos dropdowns do Mantine. */
    isolation: isolate;
}

.land-use-chart {
    flex: 1 1 0;
    min-height: 240px;
}

@media (max-width: 75em) {
    .map-panel {
        height: 65vh;
        min-height: 380px;
    }

    .chart-panel {
        height: auto;
    }

    .land-use-chart {
        flex: none;
        height: 320px;
    }
}

/* Em telas estreitas os rótulos das unidades quebram linha em vez de estourar a largura. */
@media (max-width: 36em) {
    .base-selector .mantine-SegmentedControl-label {
        white-space: normal;
        line-height: 1.2;
    }
}

/* Indicadores */
.kpi-card {
    border-top: 3px solid var(--kpi-color);
}

.kpi-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: none;
}

.kpi-value {
    font-variant-numeric: tabular-nums;
}

/* Mapa */
.leaflet-container {
    font-family: inherit;
    background: var(--mantine-color-navy-9);
}

.map-legend {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 1000;
}

.leaflet-control-attribution {
    max-width: 60%;
    font-size: 10px;
    line-height: 1.3;
}

.map-hint {
    position: absolute;
    top: 12px;
    left: 56px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0.9;
}

.legend-swatch {
    width: 14px;
    height: 14px;
    flex: none;
    border-radius: 3px;
}

.legend-swatch.dot {
    border-radius: 50%;
    background: var(--swatch-color);
    border: 1.5px solid #ffffff;
    box-shadow: 0 0 0 1px rgb(0 0 0 / 25%);
}

.legend-swatch.line {
    height: 4px;
    border-radius: 2px;
    background: var(--swatch-color);
}

/* Fundo escuro para o contorno branco aparecer também no tema claro, como sobre o satélite. */
.legend-swatch.outline {
    border: 2px solid var(--swatch-color);
    background: var(--mantine-color-navy-7);
}

.legend-swatch.fill {
    background: var(--swatch-color);
    opacity: 0.8;
}

.map-popup {
    border-collapse: collapse;
    font-size: 12px;
}

.map-popup th {
    padding: 2px 12px 2px 0;
    font-weight: 600;
    color: #495057;
    text-align: left;
    white-space: nowrap;
}

.map-popup td {
    padding: 2px 0;
}
