* {
    box-sizing: border-box;
}

:root {
    --bg: #151716;
    --surface: #222523;
    --surface-2: #2b2f2d;
    --surface-3: #343936;
    --line: #3f4642;
    --text: #f2f5f3;
    --muted: #b9c1bc;
    --green: #4CAF50;
    --green-dark: #2E7D32;
    --red: #F44336;
    --orange: #FFA726;
    --yellow: #FFEB3B;
    --yellow-text: #202000;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
    --shadow-strong: 0 24px 70px rgba(0, 0, 0, 0.5);
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(76, 175, 80, 0.08), transparent 28rem),
        linear-gradient(180deg, #101211, var(--bg));
    color: var(--text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    font: inherit;
}

img {
    max-width: 100%;
}

button {
    border: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 2px solid #9ad59c;
    outline-offset: 2px;
}

.container {
    width: min(95vw, 1580px);
    margin: 18px auto;
    background: var(--surface);
    border: 1px solid #323834;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    background: linear-gradient(90deg, #4CAF50, #2E7D32);
    color: #fff;
    padding: 16px 22px;
    position: relative;
    isolation: isolate;
}

.header::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.24);
    z-index: -1;
}

.brand-lockup {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    gap: 18px;
    min-width: 0;
}

.brand-lockup img {
    flex: 0 0 auto;
    width: 158px;
    max-width: 28vw;
    height: auto;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    padding: 5px;
}

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

.header-kicker,
.section-kicker {
    display: block;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: uppercase;
}

.header h1 {
    margin: 2px 0 0;
    color: #fff;
    font-size: clamp(23px, 2.15vw, 34px);
    line-height: 1.06;
    letter-spacing: 0;
    max-width: 900px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

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

.last-update {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    padding: 9px 12px;
    white-space: nowrap;
}

.notification-button,
.advanced-tools button,
.filters button,
.panel-actions a,
.panel-actions button,
.filter-chip {
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.notification-button {
    background: #173d1c;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    color: #fff;
    min-height: 38px;
    padding: 9px 13px;
    white-space: nowrap;
}

.notification-button:hover,
.advanced-tools button:hover,
.filters button:hover,
.panel-actions a:hover,
.panel-actions button:hover,
.filter-chip:hover {
    filter: brightness(1.07);
    transform: translateY(-1px);
}

.notification-button.is-active {
    background: #0f6f2d;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14);
}

.notification-button.is-blocked {
    background: #5d6260;
    cursor: not-allowed;
    opacity: 0.8;
}

.notification-button.needs-install {
    background: #145c26;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

#map-container {
    position: relative;
    min-height: clamp(450px, 49vh, 610px);
    background: #202321;
    border-bottom: 1px solid var(--line);
}

#map {
    height: clamp(450px, 49vh, 610px);
    width: 100%;
}

.leaflet-container {
    font: inherit;
}

.leaflet-control-zoom a {
    color: #141414;
}

.map-hud,
.info-layer,
.map-legend {
    position: absolute;
    z-index: 1000;
    background: rgba(24, 28, 26, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
    color: #fff;
    backdrop-filter: blur(8px);
}

.map-hud {
    top: 16px;
    right: 16px;
    display: grid;
    grid-template-columns: repeat(3, minmax(76px, 1fr));
    gap: 8px;
    padding: 10px;
}

.map-hud div {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px;
}

.map-hud span {
    display: block;
    color: #cbd4cf;
    font-size: 10px;
    text-transform: uppercase;
}

.map-hud strong {
    display: block;
    font-size: 22px;
    line-height: 1;
    margin-top: 3px;
}

.info-layer {
    left: 16px;
    top: 88px;
    min-width: 275px;
    padding: 14px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.info-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    color: #e7f6e8;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 10px;
    padding-bottom: 8px;
    text-transform: uppercase;
}

.info-table {
    display: grid;
    gap: 8px;
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.info-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f7faf7;
    font-size: 13px;
    padding: 0;
}

.info-cell:last-child {
    color: #fff;
    font-size: 18px;
    font-weight: 800;
}

.marker-tooltip {
    background: rgba(23, 27, 25, 0.96);
    border: 1px solid rgba(76, 175, 80, 0.44);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
    color: #fff;
    padding: 0;
}

.marker-tooltip::before {
    border-top-color: rgba(23, 27, 25, 0.96);
}

.marker-tooltip-content {
    display: grid;
    gap: 3px;
    max-width: 230px;
    padding: 8px 10px;
}

.marker-tooltip-content strong {
    font-size: 13px;
    line-height: 1.2;
}

.marker-tooltip-content span {
    color: var(--muted);
    font-size: 12px;
}

.marker-tooltip-content em {
    color: #9ad59c;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    text-transform: uppercase;
}

.info-cell img,
.map-legend img {
    display: block;
    flex: 0 0 auto;
    max-height: 22px;
    max-width: 22px;
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.map-legend {
    right: 16px;
    bottom: 28px;
    display: grid;
    gap: 8px;
    padding: 10px 12px;
}

.map-legend div {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f3f7f4;
    font-size: 12px;
    white-space: nowrap;
}

.occurrence-cluster {
    align-items: center;
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(76, 175, 80, 0.22), 0 10px 22px rgba(0, 0, 0, 0.34);
    color: #fff;
    display: flex;
    font-weight: 800;
    justify-content: center;
}

.occurrence-cluster span {
    align-items: center;
    background: #2E7D32;
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    height: 46px;
    justify-content: center;
    width: 46px;
}

.occurrence-cluster-medium span {
    background: #C77900;
}

.occurrence-cluster-large span {
    background: #B92E28;
}

.ops-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
    padding: 14px 22px 0;
    scrollbar-width: none;
}

.ops-summary::-webkit-scrollbar,
.filters::-webkit-scrollbar {
    display: none;
}

.summary-item {
    flex: 1 1 96px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0)),
        #292f2b;
    border: 1px solid #46504a;
    border-radius: 8px;
    min-height: 0;
    padding: 7px 12px;
    position: relative;
    overflow: hidden;
}

.summary-item:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.summary-item::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--green);
}

.summary-label {
    color: var(--muted);
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.summary-item strong {
    color: #fff;
    display: block;
    font-size: 22px;
    line-height: 1;
    margin-top: 3px;
}

/* Quebra visual entre contadores de estado e totais de meios */
.summary-sep {
    flex-basis: 100%;
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.summary-means {
    border-color: rgba(30, 136, 229, 0.4);
}

.summary-means::before {
    background: #1E88E5;
}

/* Cartões de estado clicáveis = filtros (fundem contadores + filtros de estado) */
.summary-item.is-filter {
    appearance: none;
    -webkit-appearance: none;
    color: inherit;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.summary-item.is-filter:hover {
    border-color: rgba(255, 255, 255, 0.42);
}

.summary-item.is-active {
    border-color: #9ad59c;
    box-shadow: inset 0 0 0 1px #9ad59c;
}

.summary-danger {
    border-color: rgba(244, 67, 54, 0.65);
}

.summary-danger::before {
    background: var(--red);
}

.summary-alert {
    border-color: rgba(255, 167, 38, 0.72);
}

.summary-alert::before {
    background: var(--orange);
}

.summary-warning {
    border-color: rgba(255, 235, 59, 0.72);
}

.summary-warning::before {
    background: var(--yellow);
}

.summary-success {
    border-color: rgba(56, 142, 60, 0.72);
}

.summary-success::before {
    background: #388E3C;
}

.control-panel {
    background: var(--surface);
    border-top: 1px solid #303733;
    padding: 18px 22px 10px;
    position: relative;
    z-index: 3;
}

.filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 12px;
}

.filters button {
    background: #38413b;
    border: 1px solid #4c5750;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    min-height: 38px;
    padding: 8px 10px;
    width: 100%;
}

.filters button.todas-ocorrencias {
    background: var(--green);
    border-color: var(--green);
}

.filters button.em-curso {
    background: var(--red);
    border-color: var(--red);
}

.filters button.conclusao {
    background: #388E3C;
    border-color: #388E3C;
}

.filters button.em-resolucao {
    background: var(--yellow);
    border-color: var(--yellow);
    color: var(--yellow-text);
}

.filters button.despacho-alerta {
    background: var(--orange);
    border-color: var(--orange);
}

.filters button.is-active {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16), 0 8px 20px rgba(0, 0, 0, 0.24);
}

.advanced-tools {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) repeat(2, minmax(145px, 1fr)) repeat(3, minmax(108px, 0.75fr));
    gap: 9px;
    align-items: center;
}

.advanced-tools > * {
    min-width: 0;
}

.advanced-tools input,
.advanced-tools select {
    background: #171a18;
    border: 1px solid #4b554f;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    min-height: 38px;
    padding: 8px 10px;
    width: 100%;
}

.advanced-tools input::placeholder {
    color: #9da7a1;
}

.advanced-tools input:focus,
.advanced-tools select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.16);
}

.advanced-tools button {
    background: var(--green);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    min-height: 38px;
    padding: 8px 10px;
    white-space: nowrap;
}

.active-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 0;
    padding-top: 10px;
}

.filter-chip {
    background: #1c3320;
    border: 1px solid rgba(76, 175, 80, 0.45);
    border-radius: 8px;
    color: #dff3e0;
    padding: 7px 10px;
}

.status-line {
    background: #1b1f1c;
    border: 1px solid #37413a;
    border-radius: 8px;
    color: #d6ded9;
    display: none;
    font-size: 13px;
    margin: 8px 22px 16px;
    padding: 10px 12px;
    text-align: center;
}

.status-line.is-visible {
    display: block;
}

.status-line.error {
    background: rgba(244, 67, 54, 0.12);
    border-color: rgba(244, 67, 54, 0.48);
    color: #ffc0c0;
    font-weight: 700;
}

.notification-tray {
    display: grid;
    gap: 8px;
    position: fixed;
    right: 18px;
    top: 18px;
    width: min(370px, calc(100vw - 36px));
    z-index: 2600;
    pointer-events: none;
}

.notification-toast {
    align-items: center;
    background: #202421;
    border: 1px solid var(--green);
    border-radius: 8px;
    box-shadow: var(--shadow);
    color: #fff;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    line-height: 1.35;
    padding: 12px;
    pointer-events: auto;
}

.notification-toast button {
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.notification-error {
    border-color: var(--red);
}

.notification-success {
    border-color: var(--green);
}

.table-section {
    padding: 0 22px 22px;
}

.section-titlebar {
    align-items: flex-end;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin: 2px 0 10px;
}

.section-titlebar h2 {
    font-size: 22px;
    line-height: 1.1;
    margin: 2px 0 0;
}

.section-subtitle {
    color: var(--muted);
    font-size: 13px;
    margin: 5px 0 0;
}

.section-titlebar .section-kicker {
    color: var(--muted);
}

#table-count {
    background: #1c3320;
    border: 1px solid rgba(76, 175, 80, 0.42);
    border-radius: 8px;
    color: #dff3e0;
    padding: 8px 10px;
    white-space: nowrap;
}

.table-container {
    background: #1a1e1b;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: auto;
    max-height: 780px;
    scrollbar-color: #6d756f #202421;
    scrollbar-width: thin;
}

table {
    width: 100%;
    min-width: 1240px;
    border-collapse: separate;
    border-spacing: 0;
    background: #242824;
    color: #fff;
    font-size: 13px;
}

th:first-child,
td:first-child {
    left: 0;
    position: sticky;
    z-index: 3;
}

th:first-child {
    z-index: 4;
}

td:first-child {
    background: inherit;
    box-shadow: 8px 0 12px rgba(0, 0, 0, 0.18);
}

th,
td {
    border-bottom: 1px solid #3d453f;
    padding: 12px 13px;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #3f9d43;
    color: #fff;
    font-size: 12px;
    line-height: 1.1;
    position: sticky;
    top: 0;
    z-index: 2;
    white-space: nowrap;
}

tbody tr {
    background: #2b302c;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

tbody tr:nth-child(even) {
    background: #333834;
}

tbody tr:hover {
    background: #404840;
}

tbody tr.row-selected {
    box-shadow: inset 4px 0 0 var(--green);
}

.occurrence-type-cell {
    min-width: 380px;
    max-width: 560px;
}

.occurrence-line {
    align-items: center;
    display: flex;
    gap: 7px;
    line-height: 1.25;
}

.occurrence-line strong {
    font-size: 14px;
}

.occurrence-meta,
.date-cell span {
    color: var(--muted);
    display: block;
    font-size: 11px;
    line-height: 1.35;
    margin-top: 4px;
}

.new-badge {
    background: var(--green);
    border-radius: 5px;
    color: #fff;
    flex: 0 0 auto;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 6px;
    text-transform: uppercase;
}

.date-cell {
    min-width: 112px;
}

.location-cell {
    min-width: 140px;
}

.state-cell {
    min-width: 142px;
}

.state-pill {
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.15;
    padding: 7px 9px;
}

.state-pill.state-em-curso,
.popup-content.state-em-curso .popup-state {
    background: var(--red);
}

.state-pill.state-conclusao,
.popup-content.state-conclusao .popup-state {
    background: #388E3C;
}

.state-pill.state-em-resolucao,
.popup-content.state-em-resolucao .popup-state {
    background: var(--yellow);
    color: var(--yellow-text);
}

.state-pill.state-despacho-de-1-alerta,
.popup-content.state-despacho-de-1-alerta .popup-state {
    background: var(--orange);
}

tr.state-em-curso {
    box-shadow: inset 4px 0 0 var(--red);
}

tr.state-em-resolucao {
    box-shadow: inset 4px 0 0 var(--yellow);
}

tr.state-despacho-de-1-alerta {
    box-shadow: inset 4px 0 0 var(--orange);
}

tr.state-conclusao {
    box-shadow: inset 4px 0 0 #388E3C;
}

.number-cell {
    font-size: 14px;
    font-weight: 800;
    min-width: 86px;
    text-align: center;
}

th:last-child,
td:last-child {
    min-width: 118px;
    padding-right: 18px;
}

.mobile-card-list {
    display: none;
}

.sort-icon {
    cursor: pointer;
    margin-left: 5px;
}

.popup-content {
    color: #202421;
    font-size: 13px;
    line-height: 1.35;
    min-width: 245px;
    padding: 8px;
}

.popup-state {
    background: #2E7D32;
    border-radius: 6px;
    color: #fff;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 7px;
    padding: 5px 7px;
}

.popup-title {
    display: block;
    font-size: 15px;
    margin-bottom: 8px;
}

.popup-grid {
    display: grid;
    grid-template-columns: 95px 1fr;
    gap: 5px 9px;
}

.popup-grid span {
    color: #59615b;
}

.popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.popup-actions a {
    background: #eaf6ea;
    border: 1px solid #b9dbba;
    border-radius: 6px;
    color: #246b29;
    padding: 5px 7px;
    text-decoration: none;
}

.popup-actions a:hover {
    text-decoration: underline;
}

.occurrence-panel {
    background:
        radial-gradient(circle at top right, rgba(76, 175, 80, 0.16), transparent 34%),
        linear-gradient(180deg, #2b302d, #202421);
    border: 1px solid rgba(76, 175, 80, 0.62);
    border-radius: 8px;
    box-shadow: var(--shadow-strong);
    color: #fff;
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 20px;
    position: fixed;
    right: 24px;
    top: 24px;
    transform: translateX(calc(100% + 32px));
    transition: transform 0.25s ease;
    width: min(500px, calc(100vw - 48px));
    z-index: 2000;
}

.occurrence-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: var(--green);
}

.occurrence-panel.is-open {
    transform: translateX(0);
}

.panel-grabber {
    display: none;
}

.panel-close {
    align-items: center;
    background: #3a413d;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: flex;
    font-size: 22px;
    height: 34px;
    justify-content: center;
    line-height: 1;
    position: absolute;
    right: 12px;
    top: 12px;
    width: 34px;
}

.panel-close:hover {
    background: #4a534e;
}

.panel-hero {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 12px;
    margin-bottom: 16px;
    padding-right: 38px;
}

.panel-icon {
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    display: flex;
    font-size: 30px;
    height: 58px;
    justify-content: center;
    width: 58px;
}

.panel-icon img,
.mobile-card-icon img {
    display: block;
    height: 70%;
    object-fit: contain;
    width: 70%;
}

.panel-heading {
    min-width: 0;
}

.panel-kicker {
    color: #9ad59c;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.occurrence-panel h2 {
    font-size: 21px;
    line-height: 1.2;
    margin: 6px 0 10px;
}

.panel-badge {
    border-radius: 8px;
    color: #fff;
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 14px;
    padding: 6px 9px;
}

.panel-badge-neutral {
    background: var(--green);
}

.panel-grid {
    display: grid;
    gap: 12px;
}

.panel-metric-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 4px;
}

.panel-metric {
    background: rgba(10, 12, 11, 0.48);
    border: 1px solid #3f4943;
    border-radius: 8px;
    padding: 10px 8px;
}

.panel-metric span,
.panel-row span {
    color: var(--muted);
    display: block;
    font-size: 11px;
}

.panel-metric strong {
    display: block;
    font-size: 25px;
    line-height: 1;
    margin-top: 5px;
}

.panel-section {
    background: rgba(10, 12, 11, 0.24);
    border: 1px solid #37413a;
    border-radius: 8px;
    padding: 14px;
}

.panel-section h3 {
    color: #dce7df;
    font-size: 12px;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.panel-section-grid {
    display: grid;
    gap: 9px;
}

.panel-row {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 9px;
}

.panel-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.panel-row strong {
    color: #fff;
    font-weight: 600;
    word-break: break-word;
}

.panel-note {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.panel-note-error {
    color: #ffc0c0;
}

.meteo-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meteo-item {
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 8px;
    padding: 9px;
}

.meteo-item span {
    color: var(--muted);
    display: block;
    font-size: 11px;
}

.meteo-item strong {
    color: #fff;
    display: block;
    font-size: 16px;
    margin-top: 4px;
}

.fire-analysis {
    border-radius: 8px;
    display: grid;
    gap: 3px;
    margin-top: 10px;
    padding: 10px;
}

.fire-analysis strong {
    font-size: 13px;
}

.fire-analysis span {
    font-size: 12px;
}

.analysis-high {
    background: rgba(244, 67, 54, 0.22);
    border: 1px solid rgba(244, 67, 54, 0.52);
}

.analysis-medium {
    background: rgba(255, 167, 38, 0.2);
    border: 1px solid rgba(255, 167, 38, 0.5);
}

.analysis-normal {
    background: rgba(76, 175, 80, 0.18);
    border: 1px solid rgba(76, 175, 80, 0.42);
}

.panel-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 14px;
}

.panel-actions a,
.panel-actions button {
    align-items: center;
    background: var(--green);
    border-radius: 8px;
    color: #fff;
    display: flex;
    font-size: 13px;
    justify-content: center;
    line-height: 1.15;
    min-height: 36px;
    padding: 11px 10px;
    text-align: center;
    text-decoration: none;
}

.panel-action-primary {
    grid-column: 1 / -1;
    font-size: 15px !important;
    font-weight: 800;
}

.means-dot {
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    padding: 7px 8px;
}

@media (max-width: 1320px) {
    .filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .advanced-tools input {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1100px) {
    .header {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-actions {
        justify-content: flex-start;
        width: 100%;
    }

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

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

    .advanced-tools input {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    body {
        background: var(--surface);
    }

    .container {
        width: 100%;
        margin: 0;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .header {
        gap: 8px;
        padding: 9px 10px;
    }

    .brand-lockup {
        align-items: center;
        flex-direction: row;
        gap: 8px;
    }

    .brand-lockup img {
        max-width: none;
        width: 82px;
        padding: 3px;
    }

    .header-kicker {
        font-size: 9px;
    }

    .header h1 {
        font-size: clamp(16px, 4.5vw, 20px);
        line-height: 1.08;
        max-width: 100%;
    }

    .header-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .last-update,
    .notification-button {
        font-size: 12px;
        min-height: 34px;
        padding: 7px 8px;
        text-align: center;
        width: 100%;
    }

    #map-container {
        min-height: min(45vh, 360px);
    }

    #map {
        height: min(45vh, 360px);
    }

    .info-layer {
        display: none;
    }

    .map-hud {
        display: none;
    }

    .map-legend {
        display: none;
    }

    .ops-summary {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        padding: 12px 12px 2px;
        scroll-snap-type: x proximity;
    }

    .summary-item {
        flex: 0 0 104px;
        min-height: 0;
        padding: 8px 12px;
        scroll-snap-align: start;
    }

    .summary-item strong {
        font-size: 22px;
        margin-top: 4px;
    }

    .summary-sep {
        display: none;
    }

    .control-panel,
    .table-section {
        padding-left: 12px;
        padding-right: 12px;
    }

    .table-section {
        display: none;
    }

    .filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        overflow: visible;
        padding-bottom: 0;
    }

    .filters button {
        font-size: 13px;
        min-height: 38px;
        padding: 8px 7px;
        white-space: normal;
    }

    .filters button.todas-ocorrencias {
        grid-column: 1 / -1;
    }

    .advanced-tools {
        grid-template-columns: 1fr 1fr;
    }

    .advanced-tools input {
        grid-column: 1 / -1;
    }

    .advanced-tools select {
        min-width: 0;
    }

    .advanced-tools button {
        font-size: 13px;
        min-height: 38px;
        padding: 8px 7px;
        width: 100%;
    }

    #clear-filters-button {
        grid-column: 1 / -1;
    }

    .section-titlebar {
        align-items: flex-start;
        flex-direction: row;
    }

    .table-container {
        display: none;
    }

    .mobile-card-list {
        display: grid;
        gap: 10px;
    }

    .mobile-occurrence-card,
    .mobile-empty-card {
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0)),
            #252b27;
        border: 1px solid #3d463f;
        border-left: 5px solid var(--green);
        border-radius: 8px;
        color: #fff;
        cursor: pointer;
        padding: 12px;
        transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    }

    .mobile-empty-card {
        cursor: default;
        font-size: 14px;
        line-height: 1.4;
    }

    .mobile-error-card {
        border-color: rgba(244, 67, 54, 0.68);
        border-left-color: var(--red);
        color: #ffd0d0;
    }

    .mobile-occurrence-card:active {
        transform: translateY(1px);
    }

    .mobile-occurrence-card.state-em-curso {
        border-left-color: var(--red);
    }

    .mobile-occurrence-card.state-em-resolucao {
        border-left-color: var(--yellow);
    }

    .mobile-occurrence-card.state-despacho-de-1-alerta {
        border-left-color: var(--orange);
    }

    .mobile-occurrence-card.state-conclusao {
        border-left-color: #388E3C;
    }

    .mobile-occurrence-card.is-selected {
        border-color: rgba(76, 175, 80, 0.85);
        box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.16);
    }

    .mobile-card-header {
        display: grid;
        grid-template-columns: 42px 1fr;
        gap: 10px;
        align-items: center;
    }

    .mobile-card-icon {
        align-items: center;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 8px;
        display: flex;
        font-size: 24px;
        height: 42px;
        justify-content: center;
        width: 42px;
    }

    .mobile-card-title {
        min-width: 0;
    }

    .mobile-card-title-line {
        align-items: center;
        display: flex;
        gap: 7px;
    }

    .mobile-card-title-line strong {
        font-size: 15px;
        line-height: 1.22;
        overflow-wrap: anywhere;
    }

    .mobile-card-title > span {
        color: var(--muted);
        display: block;
        font-size: 12px;
        margin-top: 3px;
    }

    .mobile-card-state-row {
        display: flex;
        flex-wrap: wrap;
        gap: 7px;
        margin: 10px 0;
    }

    .mobile-card-meta {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .mobile-card-meta-item {
        background: rgba(255, 255, 255, 0.055);
        border: 1px solid rgba(255, 255, 255, 0.075);
        border-radius: 8px;
        padding: 8px;
    }

    .mobile-card-meta-item span {
        color: var(--muted);
        display: block;
        font-size: 11px;
    }

    .mobile-card-meta-item strong {
        display: block;
        font-size: 15px;
        margin-top: 3px;
        overflow-wrap: anywhere;
    }

    .occurrence-panel {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        border-left: 0;
        border-right: 0;
        bottom: 0;
        left: 0;
        max-height: 80vh;
        padding: 16px 14px 18px;
        right: 0;
        top: auto;
        transform: translateY(calc(100% + 24px));
        width: auto;
    }

    .occurrence-panel.is-open {
        transform: translateY(0);
    }

    .panel-grabber {
        background: rgba(255, 255, 255, 0.28);
        border-radius: 999px;
        display: block;
        height: 4px;
        margin: 0 auto 12px;
        width: 44px;
    }

    .panel-hero {
        grid-template-columns: 48px 1fr;
        padding-right: 40px;
    }

    .panel-icon {
        font-size: 25px;
        height: 48px;
        width: 48px;
    }

    .occurrence-panel h2 {
        font-size: 18px;
    }

    .panel-actions {
        grid-template-columns: 1fr 1fr;
        position: static;
        background: transparent;
        margin: 12px 0 0;
        padding-top: 0;
    }

    .panel-actions a,
    .panel-actions button {
        font-size: 12px;
        min-height: 34px;
        padding: 8px 6px;
    }

    .notification-tray {
        left: 12px;
        right: 12px;
        top: 12px;
        width: auto;
    }
}

@media (max-width: 480px) {
    .container {
        min-width: 0;
    }

    .brand-copy {
        flex: 1 1 auto;
    }

    .header h1 {
        font-size: clamp(15px, 4.2vw, 18px);
    }

    .brand-lockup img {
        width: 72px;
    }

    .header-actions {
        gap: 7px;
    }

    #map-container {
        min-height: 300px;
    }

    #map {
        height: 300px;
    }

    .summary-item strong {
        font-size: 20px;
    }

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

    #table-count {
        align-self: flex-start;
    }

    .panel-row {
        grid-template-columns: 1fr;
    }

    .panel-metric-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .panel-metric {
        padding: 9px 6px;
    }

    .panel-metric strong {
        font-size: 19px;
    }

    .mobile-card-meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 430px) {
    .header {
        align-items: stretch;
    }

    .brand-lockup {
        width: 100%;
    }

    .header-actions {
        grid-template-columns: 1fr;
    }

    .ops-summary {
        padding-top: 10px;
    }

    .filters button,
    .advanced-tools input,
    .advanced-tools select,
    .advanced-tools button {
        min-height: 36px;
    }

    .panel-actions a,
    .panel-actions button {
        font-size: 11px;
        padding: 7px 5px;
    }
}

/* ===== Pontos de Água + ficha operacional reorganizada (2026-07) ===== */

.water-toggle-button.is-active {
    background: #1E88E5;
    color: #fff;
}

.legend-water-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #1E88E5;
    border: 2px solid #fff;
    vertical-align: middle;
}

/* Barra de ações fixa no topo do corpo da ficha */
.panel-actionbar {
    position: sticky;
    top: -4px;
    z-index: 5;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 6px;
    padding: 8px;
    margin: -2px 0 2px;
    background: rgba(23, 27, 25, 0.96);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid #37413a;
    border-radius: 10px;
}

.panel-actionbar-empty {
    display: block;
    grid-template-columns: none;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.panel-action-primary,
.panel-action-secondary {
    align-items: center;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    font-size: 13px;
    font-weight: 700;
    justify-content: center;
    min-height: 40px;
    padding: 8px 6px;
    text-align: center;
    text-decoration: none;
}

.panel-action-primary {
    background: var(--green);
    color: #fff;
}

.panel-action-primary:hover {
    background: #43a047;
}

.panel-action-secondary {
    background: var(--surface-3);
    color: var(--text);
}

.panel-action-secondary:hover {
    background: #414a45;
}

/* Resumo crítico sempre visível */
.panel-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.panel-summary-item {
    background: rgba(10, 12, 11, 0.4);
    border: 1px solid #37413a;
    border-radius: 8px;
    padding: 8px 10px;
    min-width: 0;
}

.panel-summary-item-wide {
    grid-column: 1 / -1;
}

.panel-summary-item > span {
    color: var(--muted);
    display: block;
    font-size: 11px;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.panel-summary-item strong {
    color: #fff;
    display: block;
    font-size: 15px;
    font-weight: 700;
    margin-top: 3px;
    word-break: break-word;
}

.panel-summary-item strong small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.panel-summary-item .state-pill {
    font-size: 11px;
    margin-top: 3px;
    padding: 5px 7px;
}

/* Acordeões (secundário recolhido) */
.panel-accordion {
    background: rgba(10, 12, 11, 0.24);
    border: 1px solid #37413a;
    border-radius: 8px;
    overflow: hidden;
}

.panel-accordion > summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 12px 14px;
    user-select: none;
}

.panel-accordion > summary::-webkit-details-marker {
    display: none;
}

.panel-accordion-title {
    color: #dce7df;
    flex: 1;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.panel-accordion-meta {
    color: var(--muted);
    font-size: 12px;
}

.panel-accordion-chevron {
    color: var(--muted);
    transition: transform 0.18s ease;
}

.panel-accordion[open] > summary .panel-accordion-chevron {
    transform: rotate(180deg);
}

.panel-accordion-body {
    display: grid;
    gap: 9px;
    padding: 0 14px 14px;
}

.panel-tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.panel-tools-grid a,
.panel-tools-grid button {
    align-items: center;
    background: var(--surface-3);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font-size: 12px;
    font-weight: 600;
    justify-content: center;
    min-height: 36px;
    padding: 8px 6px;
    text-align: center;
    text-decoration: none;
}

.panel-tools-grid a:hover,
.panel-tools-grid button:hover {
    background: #414a45;
}

/* Secção de pontos de água na ficha */
.panel-water {
    background: rgba(30, 136, 229, 0.08);
    border-color: rgba(30, 136, 229, 0.5);
}

.panel-water h3 {
    color: #9fd0ff;
}

.panel-water-content {
    display: grid;
    gap: 6px;
}

.water-item {
    align-items: center;
    background: rgba(10, 12, 11, 0.4);
    border: 1px solid #37413a;
    border-radius: 8px;
    display: flex;
    gap: 8px;
    padding: 6px 8px;
}

.water-item-main {
    background: transparent;
    color: var(--text);
    cursor: pointer;
    flex: 1;
    min-width: 0;
    padding: 2px;
    text-align: left;
}

.water-item-main strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.water-item-main span {
    color: var(--muted);
    display: block;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.water-item-side {
    align-items: flex-end;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 3px;
}

.water-item-dist {
    color: #9fd0ff;
    font-size: 13px;
    font-weight: 700;
}

.water-item-route {
    background: #1E88E5;
    border-radius: 6px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    text-decoration: none;
}

.water-focus-button {
    background: #1E88E5;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    margin-top: 2px;
    min-height: 38px;
    padding: 8px;
    width: 100%;
}

.water-focus-button:hover {
    background: #1976D2;
}

/* Marcadores e clusters de água no mapa */
.water-cluster {
    align-items: center;
    background: rgba(30, 136, 229, 0.85);
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    color: #fff;
    display: flex;
    font-weight: 800;
    justify-content: center;
}

.water-cluster span {
    font-size: 13px;
}

.water-cluster-medium {
    background: rgba(21, 101, 192, 0.9);
}

.water-cluster-large {
    background: rgba(13, 71, 161, 0.92);
}

.water-popup strong {
    font-size: 14px;
}

.water-popup .water-popup-meta {
    color: #333;
    font-size: 12px;
    margin-top: 2px;
}

.water-popup-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.water-popup-actions a {
    background: #1E88E5;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    text-decoration: none;
}

/* Realce de proximidade na lista e cartões */
tr.row-near {
    background: rgba(30, 136, 229, 0.12) !important;
}

tr.row-near td:first-child {
    box-shadow: inset 4px 0 0 #1E88E5;
}

.mobile-occurrence-card.is-near {
    border-color: rgba(30, 136, 229, 0.6);
}

@media (max-width: 768px) {
    .panel-actionbar {
        top: 0;
    }

    .panel-action-primary,
    .panel-action-secondary {
        font-size: 12px;
        min-height: 42px;
    }
}

@media (max-width: 430px) {
    .panel-action-secondary {
        font-size: 11px;
    }
}

/* ===== Ficha mais operacional (iteração 2): dados primeiro, rotas secundárias ===== */

/* Cabeçalho da ficha compacto (menos altura) */
.occurrence-panel .panel-badge {
    display: none;
}

.panel-hero {
    grid-template-columns: 48px 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.panel-icon {
    height: 48px;
    width: 48px;
    font-size: 24px;
}

.occurrence-panel h2 {
    font-size: 19px;
    margin: 4px 0 0;
}

/* Métricas operacionais (meios) em destaque no topo do corpo */
.panel-metric-strip {
    margin-bottom: 0;
}

/* Navegação: linha compacta e secundária (deixou de dominar o topo) */
.panel-actionrow {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.panel-actionrow-empty {
    color: var(--muted);
    font-size: 12px;
    padding: 6px 2px;
}

.panel-actionchip {
    align-items: center;
    background: var(--surface-3);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    flex: 1 1 auto;
    font-size: 12px;
    font-weight: 700;
    justify-content: center;
    min-height: 36px;
    padding: 7px 10px;
    text-align: center;
    text-decoration: none;
}

.panel-actionchip:hover {
    background: #414a45;
}

.panel-actionchip-primary {
    background: var(--green);
    color: #fff;
}

.panel-actionchip-primary:hover {
    background: #43a047;
}
