

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Rawline, "Segoe UI", Arial, sans-serif;
    background: #f5f7fa;
    color: #172033;
    min-height: 100vh;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}




.login-screen {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #f1f5f9;
}

.login-card {
    width: 380px;

    background: #ffffff;

    border: 1px solid #e2e8f0;
    border-radius: 16px;

    padding: 34px;

    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.logo {
    width: 46px;
    height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #2563eb;
    color: #ffffff;

    border-radius: 10px;

    font-size: 21px;
    font-weight: 800;

    margin-bottom: 18px;
}

.login-card h1 {
    font-size: 22px;
    margin-bottom: 7px;
}

.login-card p {
    color: #64748b;
    font-size: 12px;
    margin-bottom: 25px;
}

.login-card small {
    display: block;

    margin-top: 13px;

    color: #64748b;

    font-size: 10px;
}

.error {
    margin-top: 10px;

    color: #dc2626;

    font-size: 11px;
}




label {
    display: block;

    margin: 14px 0 6px;

    font-size: 11px;
    font-weight: 600;

    color: #334155;
}

input,
textarea,
select {
    width: 100%;

    padding: 11px 12px;

    border: 1px solid #dbe2ea;

    border-radius: 8px;

    background: #ffffff;

    color: #172033;

    font-size: 12px;

    outline: none;

    transition: 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #2563eb;

    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

textarea {
    min-height: 150px;

    resize: vertical;
}




.primary {
    background: #2563eb;

    color: #ffffff;

    border: none;

    border-radius: 8px;

    padding: 10px 16px;

    font-size: 12px;
    font-weight: 600;

    transition: 0.2s;
}

.primary:hover {
    background: #1d4ed8;

    transform: translateY(-1px);
}

.primary:active {
    transform: translateY(0);
}

.full {
    width: 100%;
}




.app {
    min-height: 100vh;
}




.sidebar {
    position: fixed;

    left: 0;
    top: 0;

    width: 245px;
    height: 100vh;

    background: #ffffff;

    border-right: 1px solid #e2e8f0;

    padding: 18px 11px;

    display: flex;
    flex-direction: column;

    z-index: 100;
}




.brand {
    display: flex;

    align-items: center;

    gap: 10px;

    padding: 5px 8px 20px;
}

.brand-icon {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #2563eb;

    color: #ffffff;

    border-radius: 8px;

    font-weight: 800;
}

.brand strong {
    display: block;

    font-size: 13px;
}

.brand span {
    display: block;

    color: #64748b;

    font-size: 10px;

    margin-top: 2px;
}




.sidebar-menu {
    flex: 1;

    overflow-y: auto;

    padding-right: 3px;
}




.sidebar-menu::-webkit-scrollbar {
    width: 5px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: #cbd5e1;

    border-radius: 10px;
}




.nav-item {
    width: 100%;

    height: 40px;

    display: flex;
    align-items: center;

    border: none;

    border-radius: 8px;

    background: transparent;

    color: #475569;

    text-align: left;

    padding: 0 11px;

    margin-bottom: 3px;

    font-size: 11px;

    transition: 0.2s;
}

.nav-item:hover {
    background: #f1f5f9;

    color: #2563eb;
}

.nav-item.active {
    background: #eff6ff;

    color: #2563eb;

    font-weight: 600;
}




.sidebar-user {
    border-top: 1px solid #e2e8f0;

    padding: 13px 5px 3px;

    display: flex;

    align-items: center;

    gap: 9px;
}

.avatar {
    width: 31px;
    height: 31px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #dbeafe;

    color: #2563eb;

    border-radius: 50%;

    font-size: 11px;
    font-weight: 700;
}

.user-info {
    min-width: 0;
}

.user-info strong {
    display: block;

    font-size: 11px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info small {
    display: block;

    color: #64748b;

    font-size: 9px;

    margin-top: 2px;
}

.logout {
    margin-left: auto;

    width: 28px;
    height: 28px;

    border: none;

    background: transparent;

    color: #ef4444;

    border-radius: 6px;

    font-size: 16px;
}

.logout:hover {
    background: #fef2f2;
}




.main-content {
    margin-left: 245px;

    min-height: 100vh;

    width: calc(100% - 245px);
}




.topbar {
    height: 76px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    padding: 0 30px;

    background: #ffffff;

    border-bottom: 1px solid #e2e8f0;
}

.topbar small {
    color: #64748b;

    font-size: 9px;

    letter-spacing: 0.5px;
}

.topbar h1 {
    margin-top: 3px;

    font-size: 20px;

    font-weight: 700;
}

.topbar-actions {
    display: flex;

    align-items: center;

    gap: 18px;
}

.api-status {
    color: #16a34a;

    font-size: 10px;

    font-weight: 600;
}

.theme-toggle {
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    padding: 9px 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    transition: 0.2s;
}

.theme-toggle:hover {
    border-color: #2563eb;
    color: #2563eb;
}




.page {
    display: none;

    padding: 30px;
}

.page.active {
    display: block;
}




.welcome {
    margin-bottom: 22px;
}

.welcome h2 {
    font-size: 21px;

    margin-bottom: 5px;
}

.welcome p {
    color: #64748b;

    font-size: 12px;
}

.section-heading {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 20px;
}

.section-heading h2 {
    font-size: 20px;
}

.section-heading p {
    margin-top: 5px;

    color: #64748b;

    font-size: 12px;
}




.stats {
    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 13px;

    margin-bottom: 22px;
}

.stat-card {
    background: #ffffff;

    border: 1px solid #e2e8f0;

    border-radius: 11px;

    padding: 19px;

    transition: 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);

    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
}

.stat-card strong {
    display: block;

    font-size: 24px;

    margin-bottom: 5px;
}

.stat-card span {
    color: #64748b;

    font-size: 10px;
}




.panel {
    background: #ffffff;

    border: 1px solid #e2e8f0;

    border-radius: 11px;

    padding: 20px;
}

.panel h2 {
    font-size: 17px;

    margin-bottom: 10px;
}

.panel h3 {
    font-size: 14px;

    margin-bottom: 5px;
}

.panel p {
    font-size: 11px;

    color: #64748b;

    line-height: 1.6;
}

.panel-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 15px;
}

.panel-header span {
    color: #64748b;

    font-size: 10px;
}

.panel-header button {
    border: none;

    background: transparent;

    color: #2563eb;

    font-size: 11px;

    font-weight: 600;
}




.ticket-row {
    display: grid;

    grid-template-columns:
        1.1fr
        1fr
        1.6fr
        1fr
        0.8fr
        0.9fr
        1.2fr;

    gap: 10px;

    align-items: center;

    padding: 13px 5px;

    border-bottom: 1px solid #eef2f7;

    font-size: 10px;
}

.ticket-row:last-child {
    border-bottom: none;
}

.ticket-row.header {
    color: #64748b;

    font-size: 9px;

    font-weight: 700;

    text-transform: uppercase;
}

.ticket-row span {
    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}

.ticket-status-control {
    min-width: 0;

    padding: 6px 7px;

    font-size: 9px;
}

.ticket-status-control:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.ticket-status-cell {
    min-width: 0;

    display: flex;
    flex-direction: column;

    align-items: flex-start;
}

.sla-indicator {
    display: block;

    max-width: 100%;
    margin-top: 4px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 8px;
    font-weight: 600;
}

.sla-on-time {
    color: #16a34a;
}

.sla-near {
    color: #d97706;
}

.sla-overdue {
    color: #dc2626;
}

.sla-finished {
    color: #64748b;
}

.sla-unavailable {
    color: #94a3b8;
}

.ticket-protocol {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 4px;
}

.ticket-history-btn {
    width: fit-content;

    border: none;
    padding: 0;

    background: transparent;
    color: #2563eb;

    font-size: 9px;
    font-weight: 600;
    text-align: left;
}

.ticket-history-btn:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.ticket-history-panel {
    margin-top: 15px;
}

.ticket-history-timeline {
    position: relative;

    padding: 5px 0 5px 28px;
}

.ticket-history-timeline::before {
    content: "";

    position: absolute;
    left: 8px;
    top: 15px;
    bottom: 15px;

    width: 2px;

    background: #dbe2ea;
}

.history-event {
    position: relative;

    display: flex;

    min-height: 72px;
    padding-bottom: 18px;
}

.history-event:last-child {
    min-height: 0;
    padding-bottom: 0;
}

.history-marker {
    position: absolute;
    left: -25px;
    top: 4px;

    width: 12px;
    height: 12px;

    border: 3px solid #ffffff;
    border-radius: 50%;

    background: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
}

.history-event.created .history-marker {
    background: #16a34a;
    box-shadow: 0 0 0 1px #16a34a;
}

.history-event.in-progress .history-marker {
    background: #d97706;
    box-shadow: 0 0 0 1px #d97706;
}

.history-event.sla-overdue .history-marker {
    background: #dc2626;
    box-shadow: 0 0 0 1px #dc2626;
}

.history-event.resolved .history-marker {
    background: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
}

.history-event.closed .history-marker {
    background: #64748b;
    box-shadow: 0 0 0 1px #64748b;
}

.history-event-body {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

.history-event-title {
    font-size: 12px;
}

.history-event-date {
    margin-top: 4px;

    color: #64748b;
    font-size: 10px;
}

.history-observation {
    margin-top: 8px;

    color: #64748b;
    font-size: 10px;
    line-height: 1.5;
}




.status {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    width: fit-content;

    padding: 5px 9px;

    border-radius: 20px;

    background: #eff6ff;

    color: #2563eb;

    font-size: 9px;

    font-weight: 600;
}

.status.resolved {
    background: #dcfce7;

    color: #166534;
}

.status.overdue {
    background: #fee2e2;

    color: #991b1b;
}

.status.in-progress {
    background: #fef3c7;

    color: #92400e;
}

.status.closed {
    background: #e2e8f0;

    color: #475569;
}




.filters {
    display: grid;

    grid-template-columns: 2fr 1fr 1fr;

    gap: 10px;

    margin-bottom: 15px;
}




.two-columns {
    display: grid;

    grid-template-columns: 1fr 1.35fr;

    gap: 18px;
}




.examples {
    display: flex;

    flex-wrap: wrap;

    gap: 6px;

    margin: 10px 0 16px;
}

.examples button {
    border: 1px solid #e2e8f0;

    background: #f8fafc;

    color: #475569;

    border-radius: 20px;

    padding: 7px 10px;

    font-size: 9px;

    transition: 0.2s;
}

.examples button:hover {
    background: #eff6ff;

    color: #2563eb;

    border-color: #bfdbfe;
}




.ai-result {
    min-height: 400px;
}

.ai-result .empty {
    height: 100%;

    min-height: 350px;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;
}

.analysis-item {
    background: #f8fafc;

    border: 1px solid #e2e8f0;

    border-radius: 8px;

    padding: 12px;

    margin-bottom: 9px;
}

.analysis-item span {
    display: block;

    color: #64748b;

    font-size: 9px;

    margin-bottom: 4px;
}

.analysis-item strong {
    font-size: 12px;
}

.confidence {
    margin-top: 14px;

    padding: 12px;

    border-radius: 8px;

    background: #eff6ff;

    color: #1d4ed8;

    font-size: 10px;
}

.ai-actions {
    display: flex;

    gap: 8px;

    margin-top: 15px;
}




.empty {
    text-align: center;

    color: #64748b;

    padding: 45px 15px;
}

.error-state {
    color: #b91c1c;
}

.empty h3 {
    color: #334155;

    margin-bottom: 5px;
}




.cards {
    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 15px;
}

.cards .panel {
    min-height: 100px;
}




.form-panel {
    max-width: 760px;
}




.map-placeholder {
    height: 450px;

    margin-top: 15px;

    border-radius: 10px;

    border: 1px solid #e2e8f0;

    background:
        linear-gradient(
            45deg,
            #e9eef3 25%,
            transparent 25%
        ),
        linear-gradient(
            -45deg,
            #e9eef3 25%,
            transparent 25%
        ),
        #f8fafc;

    background-size: 70px 70px;

    display: flex;

    align-items: center;
    justify-content: center;

    color: #64748b;

    font-size: 12px;
}


.map-placeholder.leaflet-container {
    display: block;
    background: #e5e7eb;
    font-size: initial;
}


.ticket-location-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}


.secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}


.secondary:hover {
    background: #e2e8f0;
}


.ticket-location-status {
    color: #64748b;
    font-size: 12px;
}




::-webkit-scrollbar {
    width: 7px;
}

::-webkit-scrollbar-track {
    background: #f8fafc;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;

    border-radius: 10px;
}




@media (max-width: 1100px) {

    .sidebar {
        width: 215px;
    }

    .main-content {
        margin-left: 215px;

        width: calc(100% - 215px);
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .two-columns {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 800px) {

    .sidebar {
        width: 190px;
    }

    .main-content {
        margin-left: 190px;

        width: calc(100% - 190px);
    }

    .topbar {
        padding: 0 18px;
    }

    .page {
        padding: 20px;
    }

    .ticket-row {
        grid-template-columns:
            1fr
            1fr
            1.5fr
            1fr
            1.2fr;
    }

    .ticket-row span:nth-child(5) {
        display: none;
    }
}


@media (max-width: 600px) {

    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;

        width: 100%;
    }

    .topbar-actions {
        display: none;
    }

    .stats,
    .cards,
    .filters {
        grid-template-columns: 1fr;
    }

    .login-card {
        width: 90%;

        padding: 25px;
    }
}




body.dark-theme {
    background: #0f172a;
    color: #e2e8f0;
}

body.dark-theme .login-screen {
    background: #0f172a;
}

body.dark-theme .login-card,
body.dark-theme .sidebar,
body.dark-theme .topbar,
body.dark-theme .panel,
body.dark-theme .stat-card {
    background: #111827;
    border-color: #334155;
}

body.dark-theme .nav-item {
    color: #cbd5e1;
}

body.dark-theme .nav-item:hover {
    background: #1e293b;
    color: #93c5fd;
}

body.dark-theme .nav-item.active {
    background: #172554;
    color: #93c5fd;
}

body.dark-theme .brand span,
body.dark-theme .topbar small,
body.dark-theme .welcome p,
body.dark-theme .section-heading p,
body.dark-theme .panel p,
body.dark-theme .panel-header span,
body.dark-theme .stat-card span,
body.dark-theme .empty,
body.dark-theme .ticket-row.header {
    color: #94a3b8;
}

body.dark-theme label {
    color: #cbd5e1;
}

body.dark-theme input,
body.dark-theme textarea,
body.dark-theme select {
    background: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
}

body.dark-theme input:focus,
body.dark-theme textarea:focus,
body.dark-theme select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.14);
}

body.dark-theme .sidebar-user,
body.dark-theme .ticket-row {
    border-color: #334155;
}

body.dark-theme .theme-toggle {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

body.dark-theme .theme-toggle:hover {
    border-color: #93c5fd;
    color: #bfdbfe;
}

body.dark-theme .examples button {
    background: #1e293b;
    border-color: #475569;
    color: #cbd5e1;
}

body.dark-theme .examples button:hover {
    background: #172554;
    border-color: #60a5fa;
    color: #bfdbfe;
}

body.dark-theme .analysis-item {
    background: #1e293b;
    border-color: #475569;
}

body.dark-theme .ticket-history-timeline::before {
    background: #475569;
}

body.dark-theme .history-marker {
    border-color: #111827;
}

body.dark-theme .history-event-date,
body.dark-theme .history-observation {
    color: #94a3b8;
}

body.dark-theme .ticket-history-btn {
    color: #93c5fd;
}

body.dark-theme .sla-on-time {
    color: #86efac;
}

body.dark-theme .sla-near {
    color: #fcd34d;
}

body.dark-theme .sla-overdue {
    color: #fca5a5;
}

body.dark-theme .sla-finished,
body.dark-theme .sla-unavailable {
    color: #94a3b8;
}

body.dark-theme .map-placeholder {
    border-color: #475569;
    background:
        linear-gradient(
            45deg,
            #1e293b 25%,
            transparent 25%
        ),
        linear-gradient(
            -45deg,
            #1e293b 25%,
            transparent 25%
        ),
        #0f172a;
}

.dark-theme .secondary {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #475569;
}


.dark-theme .secondary:hover {
    background: #334155;
}


.dark-theme .ticket-location-status {
    color: #94a3b8;
}


body.dark-theme .confidence {
    background: #172554;
    color: #bfdbfe;
}

body.dark-theme .empty h3 {
    color: #e2e8f0;
}

body.dark-theme .user-info small {
    color: #94a3b8;
}



.login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 12px;
    color: #777;
    font-size: 12px;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #ddd;
}

.govbr-button {
    border: 0;
    border-radius: 8px;
    padding: 12px 16px;
    font-weight: 700;
    cursor: pointer;
    background: #1351b4;
    color: #fff;
}

.govbr-button:hover {
    filter: brightness(0.95);
}

.login-help {
    margin: 10px 0 0;
    font-size: 11px;
    line-height: 1.4;
    color: #777;
    text-align: center;
}



.register-panel {
    margin-top: 10px;
}

.register-panel.hidden {
    display: none;
}

.secondary.full {
    width: 100%;
    margin-top: 10px;
}



.cgm-login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--background, #f5f7fb);
}
.cgm-login-screen.hidden { display: none; }
.cgm-login-card {
    width: min(430px, 100%);
    background: var(--card, #fff);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,.10);
}
.cgm-login-card h1 { margin: 24px 0 8px; }
.cgm-login-card p { margin: 0 0 24px; opacity: .75; }
.cgm-login-card label { display:block; margin: 14px 0 7px; font-weight: 600; }
.cgm-login-card input { width:100%; box-sizing:border-box; }
.cgm-login-card button { width:100%; margin-top:14px; }
.cgm-login-brand { display:flex; }
.cgm-login-divider { text-align:center; margin:24px 0 4px; opacity:.65; font-size:14px; }
.cgm-login-card .secondary { background: transparent; }



.map-filters { display:flex; gap:10px; flex-wrap:wrap; margin:16px 0; }
.map-filters select, .map-filters input { padding:10px 12px; border:1px solid #d9dee8; border-radius:10px; background:#fff; }
.my-manifestation-card { margin-bottom:16px; }
.notification-summary { padding:12px 14px; border-radius:10px; margin-bottom:12px; background:#f4f7fb; }
.notification-item { border-top:1px solid #e5e7eb; padding:12px 0; }
.notification-item.unread { font-weight:600; }
.notification-item p { margin:5px 0; font-weight:400; }
.notification-item button { margin-top:8px; }
#useManifestLocationBtn { margin:10px 0 4px; }
#manifestLocationStatus { display:block; margin-bottom:12px; opacity:.75; }



.cgm-portal-selector {
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.55);
}
.cgm-portal-card {
  width: min(92vw, 520px);
  padding: 28px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  text-align: center;
}
.cgm-portal-card h2 {
  margin-top: 0;
}
.cgm-portal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}
.cgm-portal-actions button {
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 600;
}



.portal-landing-card {
  width: min(92vw, 560px);
  margin: 10vh auto;
  padding: 34px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 20px 70px rgba(0,0,0,.18);
  text-align: center;
}
.cgm-portal-landing {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: #f4f6f8;
}
.portal-landing-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 26px 0 18px;
}
.portal-landing-actions a {
  text-decoration: none;
  display: inline-block;
  padding: 12px 18px;
  border-radius: 10px;
}
.portal-prefeitura-only {
  display: none;
}
.notification-bell {
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
}
#notificationBadge {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #d92d20;
  color: #fff;
}
.cgm-notification-toast {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 100000;
  width: min(90vw, 360px);
  padding: 15px 18px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
  transform: translateY(-20px);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}
.cgm-notification-toast.show {
  transform: translateY(0);
  opacity: 1;
}
.cgm-notification-toast strong,
.cgm-notification-toast span {
  display: block;
}
.cgm-notification-toast span {
  margin-top: 5px;
}



.map-summary-grid,
.ops-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.map-summary-card,
.ops-mini-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
}

.map-summary-card strong,
.ops-mini-card strong {
    display: block;
    font-size: 22px;
    line-height: 1.1;
}

.map-summary-card span,
.ops-mini-card span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
}

.map-summary-card.urgent strong { color: #dc2626; }
.map-summary-card.high strong { color: #ea580c; }
.map-summary-card.normal strong { color: #ca8a04; }
.map-summary-card.low strong { color: #16a34a; }
.ops-mini-card.warning strong { color: #ca8a04; }
.ops-mini-card.danger strong { color: #dc2626; }

.map-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 8px;
    align-items: center;
}

.map-filters button { min-height: 40px; }

.cgm-map-marker-wrapper { background: transparent !important; border: 0 !important; }
.cgm-map-marker {
    display: block;
    width: 16px;
    height: 16px;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 5px rgba(15,23,42,.45);
}
.cgm-map-marker-urgente { background: #dc2626; }
.cgm-map-marker-alta { background: #ea580c; }
.cgm-map-marker-normal { background: #eab308; }
.cgm-map-marker-baixa { background: #16a34a; }

.cgm-map-legend {
    background: rgba(255,255,255,.96);
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    padding: 9px 10px;
    box-shadow: 0 4px 16px rgba(15,23,42,.12);
    font-size: 11px;
}
.cgm-map-legend strong { display:block; margin-bottom:5px; }
.cgm-map-legend span { display:flex; align-items:center; gap:6px; margin:3px 0; }
.cgm-map-legend .cgm-map-marker { width:10px; height:10px; border-width:2px; box-shadow:none; }

.cgm-map-popup { min-width: 245px; }
.cgm-map-popup-protocol { font-size: 11px; color:#64748b; font-weight:700; }
.cgm-map-popup h4 { margin:5px 0 10px; font-size:14px; }
.cgm-map-popup-grid { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.cgm-map-popup-grid span { font-size:11px; color:#475569; }
.cgm-map-popup-grid b { display:block; color:#0f172a; font-size:10px; margin-bottom:2px; }
.cgm-map-history-btn { margin-top:10px; width:100%; }

.secretary-bars { display:grid; gap:10px; }
.secretary-bar-row { display:grid; gap:5px; }
.secretary-bar-label { display:flex; justify-content:space-between; gap:12px; font-size:12px; }
.secretary-bar-label span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.secretary-bar-track { height:8px; background:#e2e8f0; border-radius:999px; overflow:hidden; }
.secretary-bar-track span { display:block; height:100%; background:#2563eb; border-radius:inherit; }

@media (max-width: 700px) {
    .cgm-map-popup { min-width: 205px; }
    .cgm-map-popup-grid { grid-template-columns:1fr; }
}

body.dark-theme .map-summary-card,
body.dark-theme .ops-mini-card,
body.dark-theme .cgm-map-legend { background:#111827; border-color:#334155; }
body.dark-theme .map-summary-card span,
body.dark-theme .ops-mini-card span,
body.dark-theme .cgm-map-popup-grid span { color:#94a3b8; }
body.dark-theme .cgm-map-popup-grid b { color:#e2e8f0; }
body.dark-theme .secretary-bar-track { background:#334155; }


/* Auditoria da linha do tempo Beta 2 */
.history-transition,
.history-responsible {
    margin: 5px 0 0;
    color: #475569;
    font-size: 11px;
}
.history-internal-badge {
    display: inline-block;
    margin: 5px 0 0 7px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 9px;
    font-weight: 700;
}


/* Separação visual inicial dos portais: o acesso interno não é anunciado ao público. */
body[data-cgm-portal="municipe"] .portal-prefeitura-only,
body[data-cgm-portal="municipe"] .nav-item[data-page="atendimentos"],
body[data-cgm-portal="municipe"] .nav-item[data-page="cgm"],
body[data-cgm-portal="municipe"] .nav-item[data-page="campo"],
body[data-cgm-portal="municipe"] .nav-item[data-page="relatorios"],
body[data-cgm-portal="municipe"] .nav-item[data-page="usuarios"],
body[data-cgm-portal="municipe"] .nav-item[data-page="secretarias"],
body[data-cgm-portal="municipe"] .nav-item[data-page="whatsapp"],
body[data-cgm-portal="municipe"] .nav-item[data-page="configuracoes"],
body[data-cgm-portal="municipe"] .nav-item[data-page="integracoes"] {
    display: none !important;
}

.portal-switch-link {
    display: inline-flex;
    align-items: center;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    font-size: .9rem;
}

.portal-switch-link:hover { background: rgba(148, 163, 184, .15); }

body[data-cgm-portal="prefeitura"] .portal-prefeitura-only {
    display: inline-flex !important;
}
body[data-cgm-portal="municipe"] .portal-prefeitura-only {
    display: none !important;
}


/* Anexos de manifestações: estilo localizado, sem alterar o restante do layout. */
.attachment-preview { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:8px 0 14px; font-size:0.95rem; }
.attachment-preview-image { display:block; max-width:180px; max-height:140px; object-fit:contain; border-radius:8px; border:1px solid #d0d7de; }
