body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

#map {
    height: 72vh;
    width: 100%;
    border-radius: 12px;
}

.page-box {
    padding: 20px;
}

.info-bar {
    margin-top: 12px;
    padding: 12px 14px;
    background: #f7f7f7;
    border: 1px solid #e3e3e3;
    border-radius: 10px;
    color: #444;
    font-size: 14px;
}

.legend {
    margin-top: 12px;
    font-size: 14px;
    color: #444;
    line-height: 1.5;
}

.filtros-estados,
.filtros-ods {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filtros-ods {
    margin-top: 12px;
}

.filtro-btn,
.filtro-ods-btn {
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    min-height: 38px;
}

.filtro-btn {
    border: 1px solid #0d6efd;
    background: #fff;
    color: #0d6efd;
}

.filtro-btn:hover {
    background: #eef4ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.12);
}

.filtro-btn.active {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
    box-shadow: 0 6px 14px rgba(13, 110, 253, 0.18);
}

.filtro-ods-btn {
    background: #fff;
}

.filtro-ods-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.10);
    filter: brightness(0.98);
}

.filtro-ods-btn.active {
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
}

.filtro-btn:focus,
.filtro-ods-btn:focus {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.18);
}

.lista-projetos {
    margin-top: 22px;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.lista-header {
    padding: 14px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e8e8e8;
    font-size: 15px;
    font-weight: 700;
    color: #222;
}

.lista-vazia {
    padding: 18px 16px;
    color: #666;
}

.item-projeto {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.item-projeto:hover {
    background: #fafafa;
}

.item-projeto:last-child {
    border-bottom: none;
}

.item-projeto-titulo {
    font-size: 16px;
    font-weight: 700;
    color: #1f1f1f;
    margin-bottom: 6px;
    line-height: 1.4;
}

.item-projeto-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    line-height: 1.4;
}

.item-projeto-acoes {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.project-link {
    color: #0d6efd;
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
    font-weight: 500;
}

.project-link:hover {
    color: #0a58ca;
}

.leaflet-popup-content {
    min-width: 230px;
    font-size: 14px;
    line-height: 1.5;
}

.leaflet-tooltip {
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 8px;
}

.state-label {
    background: transparent;
    border: none;
    box-shadow: none;
}

.state-label div {
    font-size: 12px;
    font-weight: 800;
    color: #111;
    text-align: center;
    line-height: 1.2;
    text-shadow:
        -1px -1px 0 #fff,
         1px -1px 0 #fff,
        -1px  1px 0 #fff,
         1px  1px 0 #fff;
}

.custom-ods-marker {
    background: transparent;
    border: none;
}

.project-list {
    margin-top: 8px;
    padding-left: 18px;
}

.project-list li {
    margin-bottom: 6px;
}

.project-list li:last-child {
    margin-bottom: 0;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    width: min(900px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    padding: 24px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    border: none;
    background: #f1f1f1;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: #e4e4e4;
}

.modal-title {
    margin: 0 40px 16px 0;
    font-size: 24px;
    font-weight: 800;
    color: #222;
    line-height: 1.3;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.detail-card {
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 5px;
    padding: 12px;
}

.detail-card strong {
    display: block;
    margin-bottom: 6px;
    color: #111;
    font-size: 14px;
}

.section-title {
    margin: 18px 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #222;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: #eef4ff;
    color: #214a9b;
    border: 1px solid #cddcff;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
}

.loading {
    color: #666;
    font-style: italic;
}

#modal-detalhes-projeto .modal-dialog.modal-projeto-largo {
    max-width: min(1400px, 95vw);
}

#modal-detalhes-projeto .modal-body {
    max-height: 75vh;
    overflow-y: auto;
}

#modal-detalhes-projeto .detail-grid {
    grid-template-columns: 1fr;
    gap: 12px;
}




@media (max-width: 768px) {
    #map {
        height: 58vh;
    }

    .page-box {
        padding: 12px;
    }

    .filtro-btn,
    .filtro-ods-btn {
        font-size: 13px;
        padding: 7px 12px;
    }

    .item-projeto-titulo {
        font-size: 15px;
    }

    .modal-box {
        padding: 18px;
    }

    .modal-title {
        font-size: 20px;
    }
}

