* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f3;
    color: #1f2a1f;
}

.topbar {
    background: #1f3b2d;
    color: white;
    padding: 24px 18px;
}

.topbar h1 {
    margin: 0;
    font-size: 26px;
}

.topbar p {
    margin: 6px 0 0;
    opacity: 0.9;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px;
}

.hero {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 22px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.hero h2 {
    margin-top: 0;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card h3 {
    margin-top: 0;
    color: #1f3b2d;
}

.btn {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    background: #1f3b2d;
    color: white;
}

.btn.disabled {
    background: #999;
    cursor: not-allowed;
}

.footer {
    text-align: center;
    color: #666;
    font-size: 13px;
    padding: 20px;
}

@media (max-width: 900px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .cards {
        grid-template-columns: 1fr;
    }

    .topbar h1 {
        font-size: 22px;
    }
}

.table-card,
.form-card {
    background: white;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    font-size: 14px;
}

th {
    background: #eef3ee;
    color: #1f3b2d;
}

form {
    display: grid;
    gap: 12px;
}

label {
    font-weight: bold;
    color: #1f3b2d;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccd3cc;
    border-radius: 8px;
    font-size: 15px;
}

textarea {
    resize: vertical;
}

.btn.secondary {
    background: #666;
}

.map-card {
    background: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

#map {
    width: 100%;
    height: 600px;
    border-radius: 10px;
}

@media (max-width: 600px) {
    #map {
        height: 450px;
    }
}

.status-online {
    color: #1f7a3a;
    font-weight: bold;
}

.status-offline {
    color: #b00020;
    font-weight: bold;
}

.risco {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
}

.risco-baixo {
    background: #d7f5df;
    color: #1f7a3a;
}

.risco-médio {
    background: #fff3cd;
    color: #8a6d00;
}

.risco-alto {
    background: #f8d7da;
    color: #842029;
}

hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 12px 0;
}

.details-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.detail-card {
    background: white;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.detail-card h3 {
    margin-top: 0;
    color: #1f3b2d;
}

.checklist-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.link-table {
    color: #1f3b2d;
    font-weight: bold;
    text-decoration: none;
}

.link-table:hover {
    text-decoration: underline;
}

.muted {
    color: #666;
    font-size: 14px;
}

@media (max-width: 800px) {
    .details-grid,
    .checklist-grid {
        grid-template-columns: 1fr;
    }
}

.btn.danger {
    background: #b00020;
}

.btn.danger:hover {
    background: #8a0018;
}

.filter-card {
    background: white;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.filter-form {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .filter-form {
        grid-template-columns: 1fr;
    }
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 16px;
}

.photo-card {
    background: #f4f6f3;
    border-radius: 10px;
    padding: 8px;
}

.photo-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
}

.photo-card p {
    font-size: 13px;
    color: #333;
}

@media (max-width: 900px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .photo-grid {
        grid-template-columns: 1fr;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-top: 5px solid #1f3b2d;
}

.stat-card h3 {
    margin: 0;
    font-size: 32px;
    color: #1f3b2d;
}

.stat-card p {
    margin: 8px 0 0;
    color: #444;
}

.danger-stat {
    border-top-color: #b00020;
}

.danger-stat h3 {
    color: #b00020;
}

.warning-stat {
    border-top-color: #8a6d00;
}

.warning-stat h3 {
    color: #8a6d00;
}

.success-stat {
    border-top-color: #1f7a3a;
}

.success-stat h3 {
    color: #1f7a3a;
}

@media (max-width: 1000px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.btn.small {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 6px;
}

.ocorrencias-filter {
    grid-template-columns: 1fr 2fr 1fr 1fr auto;
}

@media (max-width: 1100px) {
    .ocorrencias-filter {
        grid-template-columns: 1fr;
    }
}

.login-card {
    max-width: 420px;
    margin: 40px auto;
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.alert-error {
    background: #f8d7da;
    color: #842029;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #1f3b2d;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
}

.sidebar-header {
    padding: 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 22px;
}

.sidebar-header p {
    margin: 6px 0 0;
    font-size: 13px;
    opacity: 0.8;
}

.sidebar-menu {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
}

.sidebar-menu a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    font-weight: 500;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.13);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.15);
    font-size: 14px;
}

.logout-btn {
    display: block;
    text-align: center;
    background: #b00020;
    color: white;
    text-decoration: none;
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
}

.logout-btn:hover {
    background: #8a0018;
}

.main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
}

.topbar {
    background: white;
    padding: 18px 24px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar h1 {
    margin: 0;
    color: #1f3b2d;
    font-size: 24px;
}

.topbar p {
    margin: 4px 0 0;
    color: #666;
}

.content-area {
    padding: 22px;
}

.menu-toggle {
    display: none;
    background: #1f3b2d;
    color: white;
    border: none;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
}

/* Evita duplicidade visual dos antigos headers/hero em algumas páginas */
.hero {
    margin-top: 0;
}

/* Responsivo */
@media (max-width: 850px) {
    .sidebar {
        transform: translateX(-100%);
        transition: 0.25s ease;
    }

    .sidebar.sidebar-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .menu-toggle {
        display: inline-block;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 900;
    }
}

.route-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
}

.property-select-list {
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 10px;
    margin: 12px 0;
    background: #f7f7f7;
}

.property-select-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    border: 2px solid transparent;
}

.property-select-item:hover {
    border-color: #1f3b2d;
}

.property-select-item.selected {
    border-color: #1f3b2d;
    background: #e7f1eb;
}

.property-select-item span {
    color: #555;
    font-size: 14px;
}

.property-select-item button {
    border: 1px solid #ccc;
    background: white;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
}

.route-card {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    background: white;
}

.route-card h3 {
    margin: 0 0 6px;
}

.route-card p {
    margin: 3px 0;
    color: #555;
}

.route-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

#map {
    height: 420px;
    border-radius: 12px;
}

@media (max-width: 950px) {
    .route-layout {
        grid-template-columns: 1fr;
    }

    .route-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .route-actions {
        flex-wrap: wrap;
    }
}

.public-body {
    background: #ffffff;
    color: #111827;
}

.public-header {
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px 28px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.public-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0b8f3a;
    font-size: 20px;
}

.brand-icon {
    background: #e5e7eb;
    color: #111827;
    font-size: 12px;
    padding: 9px;
    border-radius: 4px;
}

.public-nav {
    display: flex;
    gap: 22px;
}

.public-nav a {
    color: #4b5563;
    text-decoration: none;
    font-weight: 500;
}

.public-nav a:hover {
    color: #0b8f3a;
}

.public-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 28px;
}

.public-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    padding: 40px 0 70px;
    border-bottom: 1px solid #ddd;
}

.public-hero h1 {
    font-size: 42px;
    line-height: 1.1;
    margin-bottom: 22px;
}

.public-hero p {
    font-size: 20px;
    color: #4b5563;
    line-height: 1.5;
}

.public-actions {
    margin-top: 30px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.public-hero-card {
    background: white;
    border-radius: 10px;
    padding: 44px;
    text-align: center;
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}

.big-icon {
    font-size: 58px;
    color: #0b8f3a;
    margin-bottom: 18px;
}

.public-section {
    padding: 60px 0;
    text-align: center;
}

.public-section h2,
.public-objectives h2 {
    font-size: 32px;
    margin-bottom: 34px;
}

.public-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    text-align: left;
}

.public-card {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 26px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

.public-card h3 {
    margin-top: 0;
}

.public-card p {
    color: #4b5563;
    line-height: 1.5;
}

.public-objectives {
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 34px;
    margin-bottom: 50px;
}

.public-objectives li {
    margin-bottom: 14px;
    color: #374151;
}

.public-footer {
    max-width: 1180px;
    margin: 0 auto;
    padding: 30px 28px;
    border-top: 1px solid #ddd;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    color: #6b7280;
}

.public-footer a {
    color: #6b7280;
    text-decoration: none;
}

@media (max-width: 850px) {
    .public-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }

    .public-nav {
        flex-direction: column;
        gap: 10px;
    }

    .public-hero {
        grid-template-columns: 1fr;
    }

    .public-cards {
        grid-template-columns: 1fr;
    }

    .public-footer {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.public-form-section {
    max-width: 760px;
    margin: 0 auto;
}

.public-form-section h1 {
    font-size: 34px;
    margin-bottom: 10px;
}

.public-form-section > p {
    color: #4b5563;
    font-size: 18px;
    margin-bottom: 28px;
}

.public-form {
    background: white;
    border: 1px solid #ddd;
    border-radius: 14px;
    padding: 26px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.public-form label {
    display: block;
    font-weight: 600;
    margin-top: 16px;
    margin-bottom: 6px;
}

.public-form input,
.public-form select,
.public-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 9px;
    font-size: 15px;
}

.public-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 18px;
}

.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.dashboard-card.warning {
    border-left: 6px solid #f59e0b;
}

.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.dashboard-filter {
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr auto;
}

.dashboard-stats {
    grid-template-columns: repeat(5, 1fr);
}

.dashboard-summary-cards {
    margin-bottom: 22px;
}

.dashboard-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin: 22px 0;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.chart-card h3 {
    margin-top: 0;
    color: #1f3b2d;
}

.chart-card canvas {
    width: 100%;
    max-height: 360px;
}

.big-info {
    font-size: 22px;
    font-weight: bold;
    color: #1f3b2d;
}

@media (max-width: 1200px) {
    .dashboard-filter {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .dashboard-filter {
        grid-template-columns: 1fr;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

.dashboard-link-card {
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(0,0,0,0.14);
}

.map-layer-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 16px 0;
}

.table-card td .btn.small {
    margin: 2px;
}

.alertas-regionais {
    margin: 22px 0;
}

.alertas-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.alerta-card {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    border-radius: 12px;
    padding: 14px;
    border-left: 6px solid #999;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.alerta-card p {
    margin: 6px 0;
}

.alerta-alto {
    border-left-color: #b91c1c;
    background: #fff5f5;
}

.alerta-medio {
    border-left-color: #d97706;
    background: #fffbeb;
}

.alerta-baixo {
    border-left-color: #2563eb;
    background: #eff6ff;
}

.alerta-critica {
    border-left-color: #b91c1c;
    background: #fff5f5;
}

.alerta-atencao {
    border-left-color: #d97706;
    background: #fffbeb;
}

.alerta-monitoramento {
    border-left-color: #2563eb;
    background: #eff6ff;
}


@media (max-width: 900px) {
    .alertas-grid {
        grid-template-columns: 1fr;
    }
}


.pin-comunidade-simples {
    width: 14px;
    height: 14px;
}

.pin-comunidade-simples span {
    display: block;
    width: 12px;
    height: 12px;
    background: #1f7a4d;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}


.map-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

#map:fullscreen {
    width: 100vw;
    height: 100vh;
}
