:root {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --border: #d9e1ea;
    --text: #1f2937;
    --text-muted: #6b7280;
    --primary: #1a73e8;
    --primary-soft: #e8f0fe;
    --success: #137333;
    --success-soft: #e6f4ea;
    --danger: #b3261e;
    --danger-soft: #fce8e6;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

.hidden {
    display: none;
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: 100%;
    max-width: 420px;
}

.login-card,
.panel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.login-card {
    padding: 32px;
}

.login-brand h1,
.page-title,
.panel-card h2,
.panel-card h3 {
    margin: 0;
    font-weight: 600;
}

.login-brand p,
.page-subtitle,
.panel-card p,
.text-muted {
    color: var(--text-muted);
}

.login-brand {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn:disabled {
    opacity: 0.72;
    cursor: wait;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-light {
    background: #fff;
    color: var(--text);
    border-color: var(--border);
}

.btn-inline {
    width: auto;
    min-width: 110px;
    padding: 0 16px;
}

.denuncia-page-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.denuncia-page-header h2 {
    margin: 0 0 6px;
}

.denuncia-page-header p {
    margin: 0;
    color: var(--text-muted);
}

.alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 14px;
}

.alert-success {
    background: var(--success-soft);
    border-color: #c6e7ce;
    color: var(--success);
}

.alert-error {
    background: var(--danger-soft);
    border-color: #f2c4c0;
    color: var(--danger);
}

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 24px 18px;
    background: #fff;
    border-right: 1px solid var(--border);
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 24px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
}

.sidebar-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.sidebar-nav,
.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.sidebar-link {
    padding: 11px 12px;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.sidebar-link:hover,
.sidebar-link.is-active {
    background: var(--primary-soft);
    color: var(--primary);
}

.logout-link {
    color: var(--danger);
}

.app-main {
    margin-left: 260px;
    width: calc(100% - 260px);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 24px 32px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
}

.topbar-user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
}

.content-area {
    padding: 24px 32px 40px;
}

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

.panel-card {
    padding: 22px;
}

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

.module-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.module-card {
    min-height: 148px;
}

.inline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-top: 18px;
    color: var(--text-muted);
}

.data-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.data-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf1f5;
    font-size: 14px;
}

.code-block {
    overflow-x: auto;
    padding: 14px;
    border-radius: 10px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    font-size: 13px;
}

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

.denuncia-toolbar {
    width: 100%;
}

.filters-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1.8fr) repeat(5, minmax(120px, 1fr)) auto;
    gap: 16px;
    align-items: end;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.filter-field input,
.filter-field select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.denuncia-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.summary-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    min-width: 170px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-muted);
}

.summary-chip span {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.summary-chip strong {
    font-size: 20px;
    color: var(--text);
}

.denuncia-empty-state {
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: var(--surface-muted);
}

.denuncia-empty-state h3,
.denuncia-empty-state p {
    margin: 0;
}

.denuncia-empty-state p {
    margin-top: 8px;
    color: var(--text-muted);
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 940px;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #edf1f5;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.data-table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.data-table tbody tr:hover td {
    background: #fbfdff;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.table-action {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.detail-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
    font-size: 14px;
    color: var(--text-muted);
}

.modal-section h3 {
    margin: 0 0 8px;
}

.modal-section p {
    margin: 0;
    color: var(--text);
}

.detail-description strong {
    display: block;
    margin-bottom: 8px;
}

.detail-description p {
    margin: 0;
    color: var(--text);
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.image-thumb-link {
    display: block;
}

.image-thumb {
    display: block;
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
}

.pagination-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.pagination-link.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.48);
    z-index: 200;
}

.modal-overlay.hidden {
    display: none;
}

.modal-dialog {
    width: min(960px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.modal-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: #f3f6fa;
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
}

.modal-body {
    padding: 24px;
}

@media (max-width: 960px) {
    .sidebar {
        position: static;
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .app-shell {
        flex-direction: column;
    }

    .app-main {
        margin-left: 0;
        width: 100%;
    }

    .topbar {
        padding: 20px;
    }

    .content-area {
        padding: 20px;
    }

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

    .filters-bar {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

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

    .modal-overlay {
        padding: 12px;
    }

    .modal-body,
    .modal-header {
        padding: 16px;
    }
}
