:root {
    --sig-bg: #071318;
    --sig-panel: #0c1c22;
    --sig-panel-2: #122730;
    --sig-border: rgba(244, 200, 66, 0.14);
    --sig-border-2: rgba(255, 255, 255, 0.06);
    --sig-text: #f4f7fa;
    --sig-muted: #95a6ae;
    --sig-yellow: #f4c842;
    --sig-yellow-soft: rgba(244, 200, 66, 0.15);
    --sig-petroleum: #0d2a33;
    --sig-petroleum-2: #163844;
    --sig-accent: #2f8fa3;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--sig-bg);
    color: var(--sig-text);
    font-family: 'Inter', sans-serif;
}

a {
    text-decoration: none;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 92px !important;
    background: #0f1f25 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 22px 18px !important;
    display: flex !important;
    flex-direction: column !important;
    transition: width .3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    height: 100vh !important;
    z-index: 2100 !important;
    overflow: hidden !important;
}

.sidebar:hover {
    width: 280px !important;
}

.sidebar .brand-text,
.sidebar .label {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity .2s ease !important;
    white-space: nowrap !important;
}

.sidebar:hover .brand-text,
.sidebar:hover .label {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Removido display:none para permitir transição opaca */

.sidebar-top {
    gap: 12px;
}

.brand-badge {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--sig-yellow-soft), rgba(47, 143, 163, 0.12));
    color: var(--sig-yellow);
    font-size: 1rem;
    border: 1px solid var(--sig-border);
}

.brand-title {
    font-weight: 700;
    font-size: 1rem;
}

.brand-subtitle {
    font-size: .76rem;
    color: var(--sig-muted);
}

.collapse-btn,
.top-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid var(--sig-border-2);
    background: rgba(255, 255, 255, 0.03);
    color: var(--sig-text);
    display: grid;
    place-items: center;
}

.collapse-btn:hover,
.top-icon-btn:hover {
    background: var(--sig-yellow-soft);
    color: var(--sig-yellow);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 14px;
    border-radius: 16px;
    color: var(--sig-text);
    transition: all .2s ease;
}

.side-link:hover,
.side-link.active {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--sig-border);
}

.side-link .icon {
    width: 24px;
    text-align: center;
    color: var(--sig-yellow);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
}

.app-main {
    flex: 1;
    margin-left: 92px;
    padding: 22px;
}

.page-fullscreen .app-main {
    padding: 0 !important;
    margin: 0 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10;
    background: #000;
}

.topbar {
    min-height: 74px;
    margin-bottom: 22px;
}

.eyebrow {
    color: var(--sig-muted);
    font-size: .82rem;
    margin-bottom: 4px;
}

.page-title {
    font-size: 1.7rem;
    margin: 0;
    font-weight: 700;
}

.content-area {
    width: 100%;
}

.card-shell,
.metric-card,
.filter-panel {
    background: linear-gradient(180deg, rgba(14, 31, 39, 0.97), rgba(10, 24, 30, 0.98));
    border: 1px solid var(--sig-border-2);
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
}

.metric-card {
    padding: 22px;
    height: 100%;
}

.metric-card span {
    display: block;
    color: var(--sig-muted);
    margin-bottom: 12px;
}

.metric-card strong {
    font-size: 2rem;
    color: var(--sig-yellow);
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.btn-sig-primary {
    background: var(--sig-yellow);
    color: #1f1f1f;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    padding: 12px 18px;
}

.btn-sig-primary:hover {
    background: #ffd85f;
    color: #1f1f1f;
}

.btn-sig-outline {
    border: 1px solid var(--sig-border);
    color: var(--sig-text);
    background: transparent;
    border-radius: 14px;
    padding: 10px 16px;
}

.btn-sig-outline:hover {
    background: var(--sig-yellow-soft);
    color: var(--sig-yellow);
}

.table-sig {
    --bs-table-bg: transparent;
    --bs-table-color: var(--sig-text);
    --bs-table-border-color: rgba(255, 255, 255, 0.06);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
}

.status-pill.success {
    background: rgba(51, 176, 126, .16);
    color: #64d4a5;
}

.status-pill.warning {
    background: rgba(244, 200, 66, .16);
    color: var(--sig-yellow);
}

.status-pill.info {
    background: rgba(47, 143, 163, .16);
    color: #71d0e5;
}

.login-wrapper {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 50% 50%, var(--sig-petroleum) 0%, var(--sig-bg) 100%);
}

.login-card {
    width: 100%;
    max-width: 460px;
    padding: 34px;
}

.login-icon,
.hero-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--sig-yellow-soft), rgba(47, 143, 163, 0.12));
    color: var(--sig-yellow);
    font-size: 1.4rem;
    border: 1px solid var(--sig-border);
}

.input-shell .input-group-text,
.input-shell .form-control,
.form-control-dark,
.form-select.form-control-dark {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
    color: var(--sig-text);
}

.form-control-dark:focus,
.input-shell .form-control:focus,
.form-select.form-control-dark:focus {
    box-shadow: 0 0 0 .25rem rgba(244, 200, 66, 0.12);
    border-color: rgba(244, 200, 66, 0.4);
    background: rgba(255, 255, 255, 0.04);
    color: var(--sig-text);
}

.form-control::placeholder {
    color: #7e9198;
}

.user-dropdown {
    min-width: 290px;
    background: #0f1f25;
    color: var(--sig-text);
    border-radius: 18px;
    overflow: hidden;
}

.user-dropdown .dropdown-item {
    color: var(--sig-text);
    padding-top: .7rem;
    padding-bottom: .7rem;
}

.user-dropdown .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.main-map {
    height: 66vh;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--sig-border-2);
}

.mini-map {
    height: 320px;
    border-radius: 20px;
    overflow: hidden;
}

.filter-panel {
    padding: 22px;
}

.filter-title {
    font-size: 1.05rem;
    margin-bottom: 18px;
}

.list-clean {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-clean li {
    display: flex;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.leaflet-control-zoom a {
    background: #0f1f25 !important;
    color: var(--sig-text) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        z-index: 1040;
        inset: 0 auto 0 0;
        height: 100vh;
    }

    .app-main {
        margin-left: 92px;
    }
}


.form-control-dark,
.form-control-dark:focus,
.form-select.form-control-dark {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--sig-text);
    border-radius: 14px;
}

.form-control-dark:focus,
.form-select.form-control-dark:focus {
    box-shadow: 0 0 0 .2rem rgba(244, 200, 66, 0.12);
    border-color: rgba(244, 200, 66, 0.35);
}

.form-select.form-control-dark option {
    color: #111;
}

.map-page-shell {
    position: relative;
    margin: 0;
    width: 100%;
    height: 100%;
}

.map-stage {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 100;
    /* Mapa atrás de outros controles */
    background: #000;
}

.map-canvas,
.main-map {
    width: 100%;
    height: 100%;
}

.map-top-left {
    position: absolute;
    top: 22px;
    left: 130px; /* Ajustado para não ficar sob o sidebar de 92px */
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: min(420px, calc(100% - 136px));
}

.btn-map-back {
    align-self: flex-start;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 14, 18, 0.82);
    backdrop-filter: blur(12px);
    color: #fff;
    padding: 10px 16px;
}

.btn-map-back:hover {
    background: rgba(244, 200, 66, 0.12);
    color: var(--sig-yellow);
}

.map-title-chip {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 24px;
    background: rgba(10, 14, 18, 0.78);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.map-title-chip h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
}

.hero-icon-sm {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    font-size: 1.15rem;
}

.map-floating-controls {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 2100;
    display: flex;
    gap: 10px;
}

.map-action-btn,
.map-close-btn {
    width: 48px;
    height: 48px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 14, 18, 0.82);
    backdrop-filter: blur(12px);
    color: #fff;
    display: grid;
    place-items: center;
}

.map-action-btn:hover,
.map-close-btn:hover {
    background: rgba(244, 200, 66, 0.12);
    color: var(--sig-yellow);
}

.map-filter-balloon {
    position: fixed;
    top: 82px;
    right: 80px;
    /* Afastado para não sobrepor o painel lateral quando ambos abertos */
    z-index: 2100;
    width: min(500px, calc(100% - 44px));
    padding: 18px;
    border-radius: 26px;
    background: rgba(10, 14, 18, 0.88);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .3);
}

.map-filter-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.leaflet-control-zoom a {
    background: rgba(10, 14, 18, 0.82) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.leaflet-control-zoom a:hover {
    color: var(--sig-yellow) !important;
}

@media (max-width: 991.98px) {
    .map-stage {
        height: calc(100vh - 142px);
        min-height: 560px;
    }

    .page-fullscreen .map-stage {
        height: 100vh;
    }

    .map-title-chip h2 {
        font-size: 1.25rem;
    }
}

@media (max-width: 767.98px) {
    .app-main {
        padding: 14px;
    }

    .page-fullscreen .app-main {
        padding: 0;
    }

    .map-stage {
        height: calc(100vh - 132px);
        min-height: 520px;
        border-radius: 22px;
    }

    .page-fullscreen .map-stage {
        height: 100vh;
        border-radius: 0;
    }

    .map-top-left,
    .map-floating-controls {
        top: 14px;
        left: 14px;
        right: 14px;
    }

    .map-floating-controls {
        left: auto;
        justify-content: flex-end;
    }

    .map-filter-balloon {
        top: 74px;
        right: 14px;
        left: 14px;
        width: auto;
        max-height: calc(100% - 88px);
        overflow: auto;
    }

    .map-title-chip {
        padding: 14px;
    }
}

/* ─── Central de Ocorrências ────────────────────────────────────────────────*/

/* Ícone caveira na tabela */
.skull-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(232, 64, 64, 0.15);
    border: 1px solid rgba(232, 64, 64, 0.3);
    color: #e84040;
    font-size: 14px;
}

/* Status com bolinha colorida */
.status-pill-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.status-pill-dot::before {
    content: '';
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--dot-color, #6b7280);
    flex-shrink: 0;
}

/* Alertas de sucesso/erro da Central */
.alert-sig {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}

.alert-sig.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.alert-sig.danger {
    background: rgba(232, 64, 64, 0.1);
    border: 1px solid rgba(232, 64, 64, 0.3);
    color: #e84040;
}

/* Botão ícone nas linhas da tabela */
.btn-icon-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--sig-muted);
    transition: all 0.2s;
    cursor: pointer;
}

.btn-icon-sm:hover {
    background: rgba(244, 200, 66, 0.15);
    border-color: rgba(244, 200, 66, 0.4);
    color: var(--sig-yellow);
}

.btn-icon-sm.delete-btn:hover {
    background: rgba(232, 64, 64, 0.15);
    border-color: rgba(232, 64, 64, 0.4);
    color: #e84040;
}

/* Modal dark */
.bg-dark-card {
    background: #0c1c22 !important;
}

.border-subtle {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Hover row ocorrências */
.ocorrencia-row {
    transition: background 0.15s;
}

.ocorrencia-row:hover {
    background: rgba(232, 64, 64, 0.05);
}

/* Badge Alerta fixo */
.badge-alerta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(251, 146, 60, 0.15);
    border: 1px solid rgba(251, 146, 60, 0.35);
    color: #fb923c;
    white-space: nowrap;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* ─── OpenStreetMap Autocomplete Dropdown ──────────────────────────────────*/
.osm-results-container {
    position: absolute;
    background-color: #122730;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-top: 5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    display: none;
}

.osm-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13.5px;
    color: #f4f7fa;
    line-height: 1.4;
}

.osm-result-item:last-child {
    border-bottom: none;
}

.osm-result-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--sig-yellow);
}

.osm-result-item span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Paginação ─────────────────────────────────────────────────────────────*/
.page-link-sig {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: var(--sig-muted) !important;
    border-radius: 10px !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
    transition: all 0.2s !important;
    min-width: 36px !important;
    text-align: center !important;
}

.page-link-sig:hover {
    background: var(--sig-yellow-soft) !important;
    border-color: rgba(244, 200, 66, 0.35) !important;
    color: var(--sig-yellow) !important;
}

.page-item.active .page-link-sig {
    background: var(--sig-yellow) !important;
    border-color: var(--sig-yellow) !important;
    color: #1f1f1f !important;
    font-weight: 700 !important;
}

.page-item.disabled .page-link-sig {
    opacity: 0.3;
    pointer-events: none;
}

.pagination {
    gap: 4px;
}