:root {
    --brand-dark: #062f5a;
    --brand: #07579d;
    --brand-light: #0b78b6;
    --accent: #12a39b;
    --background: #f5f7fa;
    --surface: #ffffff;
    --text: #172332;
    --muted: #5c6a78;
    --border: #d9e1e8;
    --focus: #ffbf47;
    --font-scale: 1;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: calc(16px * var(--font-scale));
    line-height: 1.5;
}

.public-portal #main-container {
    min-height: 420px;
}

.public-portal #main-container::after {
    display: table;
    clear: both;
    content: "";
}

a,
button,
input {
    font: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.page-width {
    width: min(1140px, calc(100% - 40px));
    margin: 0 auto;
}

.skip-link {
    position: absolute;
    top: -80px;
    left: 16px;
    z-index: 1000;
    padding: 10px 14px;
    background: #ffffff;
    color: #062f5a;
    font-weight: 600;
}

.skip-link:focus {
    top: 12px;
}

.accessibility-bar__content,
.brand-row,
.main-navigation__links,
.section-heading,
.guidance__content,
.site-footer__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.accessibility-bar {
    background: var(--brand-dark);
    color: #ffffff;
    font-size: 0.76rem;
}

.accessibility-bar__content {
    min-height: 38px;
}

.accessibility-controls {
    display: flex;
    align-items: center;
    gap: 14px;
}

.accessibility-bar button {
    border: 0;
    background: transparent;
    color: #ffffff;
    padding: 4px;
    text-decoration: none;
}

.accessibility-bar button {
    cursor: pointer;
}

.accessibility-controls__label {
    padding: 4px;
    font-weight: 600;
}

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.brand-row {
    min-height: 92px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--brand);
    text-decoration: none;
}

.brand:focus {
    outline: 0;
    text-decoration: none;
}

.brand:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.brand img {
    width: 58px;
    height: 58px;
    object-fit: contain;
}

.brand span {
    display: grid;
    gap: 1px;
}

.brand small {
    color: var(--muted);
    font-size: 0.78rem;
}

.brand strong {
    font-size: 1.55rem;
    font-weight: 650;
    line-height: 1.2;
}

.admin-access {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--brand);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}

.main-navigation {
    border-top: 1px solid var(--border);
}

.main-navigation__mobile {
    display: none;
}

.mobile-menu-toggle {
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--brand);
    font-weight: 650;
    cursor: pointer;
}

.main-navigation__links {
    justify-content: flex-start;
    gap: 30px;
    min-height: 48px;
}

.main-navigation__links > a,
.nav-submenu > summary {
    align-self: stretch;
    display: flex;
    align-items: center;
    border-bottom: 3px solid transparent;
    color: var(--text);
    font-size: 0.86rem;
    text-decoration: none;
}

.main-navigation a:focus {
    outline: 0;
    text-decoration: none;
}

.main-navigation a:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.main-navigation__links > a:hover,
.main-navigation__links > a.is-current,
.nav-submenu > summary:hover,
.nav-submenu[open] > summary,
.nav-submenu.is-current > summary {
    border-bottom-color: var(--accent);
    color: var(--brand);
}

.nav-submenu {
    position: relative;
    align-self: stretch;
    flex: 0 0 auto;
}

.nav-submenu > summary {
    height: 100%;
    gap: 7px;
    cursor: pointer;
    list-style: none;
    white-space: nowrap;
}

.nav-submenu > summary::-webkit-details-marker {
    display: none;
}

.nav-submenu > summary .fa {
    font-size: 0.64rem;
    transition: transform 160ms ease;
}

.nav-submenu[open] > summary .fa {
    transform: rotate(180deg);
}

.nav-submenu__panel {
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    z-index: 50;
    display: none;
    min-width: 220px;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 0 0 10px 10px;
    background: var(--surface);
    box-shadow: 0 14px 28px rgba(23, 35, 50, 0.16);
}

.nav-submenu[open] > .nav-submenu__panel {
    display: grid;
}

.nav-submenu__panel a {
    display: block;
    padding: 10px 12px;
    border-radius: 7px;
    color: var(--text);
    font-size: 0.84rem;
    line-height: 1.35;
    text-decoration: none;
    white-space: nowrap;
}

.nav-submenu__panel a:hover,
.nav-submenu__panel a.is-current {
    background: #edf6fb;
    color: var(--brand);
}

@media (hover: hover) and (min-width: 681px) {
    .nav-submenu:hover > .nav-submenu__panel {
        display: grid;
    }
}

.hero {
    background: linear-gradient(125deg, var(--brand-dark) 0%, var(--brand) 64%, #087e8c 100%);
    color: #ffffff;
}

.hero__content {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
    gap: 38px;
    align-items: center;
    padding-top: 32px;
    padding-bottom: 32px;
}

.hero__copy {
    display: grid;
    gap: 9px;
}

.eyebrow {
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero .eyebrow {
    color: #a6e9e3;
}

.hero h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3.4vw, 2.35rem);
    font-weight: 650;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.hero__copy p {
    margin: 0;
    color: #dfedf8;
    font-size: 0.94rem;
}

.search-panel {
    padding: 18px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 16px 34px rgba(0, 20, 45, 0.22);
    color: #172332;
}

.search-panel label {
    display: block;
    margin-bottom: 9px;
    font-size: 0.84rem;
    font-weight: 650;
}

.search-panel__field {
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid #aebbc7;
    border-radius: 8px;
}

.search-panel__field > .fa {
    margin-left: 13px;
    color: #667685;
}

.search-panel input {
    min-width: 0;
    flex: 1;
    border: 0;
    background: #ffffff;
    color: #172332;
    padding: 13px 10px;
    outline: 0;
}

.search-panel button {
    align-self: stretch;
    border: 0;
    background: var(--brand);
    color: #ffffff;
    cursor: pointer;
    padding: 0 22px;
    font-weight: 650;
}

.search-panel button:hover {
    background: var(--brand-dark);
}

.search-panel p {
    min-height: 18px;
    margin: 8px 0 0;
    color: #596775;
    font-size: 0.74rem;
}

.queries {
    padding-top: 42px;
    padding-bottom: 48px;
}

.section-heading {
    align-items: flex-end;
    margin-bottom: 22px;
}

.section-heading h2 {
    margin: 4px 0 0;
    font-size: 1.55rem;
    font-weight: 650;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 0.75rem;
}

.section-heading p .fa {
    margin-right: 5px;
    color: var(--accent);
}

.query-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
}

.query-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 18px;
    gap: 13px;
    align-items: center;
    min-height: 88px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 3px 12px rgba(27, 50, 75, 0.04);
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.query-card:hover,
.query-card:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 8px 22px rgba(23, 68, 107, 0.11);
    transform: translateY(-2px);
}

.query-card[hidden] {
    display: none;
}

.query-card__icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 10px;
    background: #eaf3fb;
    color: var(--brand);
    font-size: 1.1rem;
}

.query-card__text {
    display: grid;
    gap: 3px;
}

.query-card__text strong {
    font-size: 0.9rem;
    font-weight: 650;
}

.query-card__text small {
    color: var(--muted);
    font-size: 0.75rem;
}

.query-card > .fa {
    color: #82909c;
    font-size: 0.78rem;
}

.portal-page {
    padding-top: 34px;
    padding-bottom: 46px;
}

.portal-page .x_panel {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 8px 26px rgba(27, 50, 75, 0.07);
}

.portal-page .x_title {
    margin: 0;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--border);
}

.portal-page .x_title::before {
    display: block;
    margin-bottom: 5px;
    color: var(--brand);
    content: "Consulta pública";
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.portal-page .x_title h2 {
    float: none;
    margin: 0;
    color: var(--text);
    font-size: 1.55rem;
    font-weight: 650;
    line-height: 1.25;
}

.portal-page .x_title h4 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 500;
}

.portal-page .x_title h4 a {
    color: var(--brand);
    font-weight: 650;
}

.portal-page .x_content {
    float: none;
    width: 100%;
    padding: 24px;
}

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

.portal-page label {
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 650;
}

.portal-page .form-control {
    min-height: 40px;
    border-color: #b8c5d0;
    border-radius: 7px;
    background: var(--surface);
    box-shadow: none;
    color: var(--text);
}

.portal-page textarea.form-control {
    min-height: 120px;
}

.portal-page .btn {
    border-radius: 7px;
    font-weight: 650;
}

.portal-page .btn-primary,
.portal-page .btn-info {
    border-color: var(--brand);
    background: var(--brand);
    color: #ffffff;
}

.portal-page .btn-primary:hover,
.portal-page .btn-primary:focus,
.portal-page .btn-info:hover,
.portal-page .btn-info:focus {
    border-color: var(--brand-dark);
    background: var(--brand-dark);
}

.portal-page .table-responsive {
    border: 0;
}

.portal-page table.table {
    width: 100% !important;
    margin-bottom: 0;
    color: var(--text);
}

.portal-page table.table > thead > tr > th {
    padding: 12px 11px;
    border-color: #31536f;
    background: var(--brand-dark);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 650;
    vertical-align: middle;
}

.portal-page table.table > tbody > tr > td {
    padding: 11px;
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.8rem;
    vertical-align: middle;
}

.portal-page table.table-striped > tbody > tr:nth-of-type(odd) > td {
    background: #f7f9fb;
}

.portal-page table a {
    color: var(--brand);
    font-weight: 600;
}

.portal-page .dataTables_wrapper .row {
    margin-right: 0;
    margin-left: 0;
}

.portal-page .dataTables_wrapper .row:first-child {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.portal-page .dataTables_wrapper .row:first-child::before,
.portal-page .dataTables_wrapper .row:first-child::after {
    display: none;
}

.portal-page .dataTables_wrapper .row:first-child > div {
    float: none;
    width: auto;
    padding: 0;
}

.portal-page .dataTables_length label,
.portal-page .dataTables_filter label,
.portal-page .dataTables_info {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 500;
}

.portal-page .dataTables_length select,
.portal-page .dataTables_filter input {
    min-height: 36px;
    border-color: #b8c5d0;
    border-radius: 7px;
    background: var(--surface);
    color: var(--text);
}

.portal-page .dataTables_filter input {
    min-width: 220px;
    margin-left: 8px;
}

.portal-page .dataTables_wrapper .row:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
}

.portal-page .dataTables_wrapper .row:last-child::before,
.portal-page .dataTables_wrapper .row:last-child::after {
    display: none;
}

.portal-page .dataTables_wrapper .row:last-child > div {
    float: none;
    width: auto;
    padding: 0;
}

.portal-page .pagination > li > a,
.portal-page .pagination > li > span {
    border-color: var(--border);
    color: var(--brand);
}

.portal-page .pagination > .active > a,
.portal-page .pagination > .active > a:hover,
.portal-page .pagination > .active > span {
    border-color: var(--brand);
    background: var(--brand);
    color: #ffffff;
}

.portal-page .panel,
.portal-page .list-group-item {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}

.portal-page .panel-heading {
    border-color: var(--border);
    background: #eef4f8;
    color: var(--text);
}

.portal-page .label-success,
.portal-page .label-info,
.portal-page .label-default {
    background: var(--brand);
}

.empty-search {
    padding: 46px 20px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    text-align: center;
}

.empty-search .fa,
.empty-search strong,
.empty-search span {
    display: block;
}

.empty-search .fa {
    margin-bottom: 10px;
    color: var(--brand);
    font-size: 1.4rem;
}

.empty-search strong {
    color: var(--text);
}

.empty-search span {
    margin-top: 4px;
    font-size: 0.82rem;
}

.guidance {
    border-top: 1px solid #b8d8d3;
    border-bottom: 1px solid #b8d8d3;
    background: #e5f3f0;
}

.guidance__content {
    min-height: 94px;
}

.guidance__content > div {
    display: flex;
    align-items: center;
    gap: 13px;
}

.guidance__icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 50%;
    background: #ffffff;
    color: #08766f;
}

.guidance__content > div > span:last-child {
    display: grid;
    gap: 3px;
}

.guidance strong {
    font-size: 0.88rem;
}

.guidance small {
    color: #4f6865;
    font-size: 0.76rem;
}

.guidance a {
    color: #075f59;
    font-size: 0.8rem;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}

.site-footer {
    background: #071f38;
    color: #dce7f0;
}

.site-footer__content {
    min-height: 104px;
}

.site-footer__content > div {
    display: grid;
    gap: 4px;
}

.site-footer strong {
    color: #ffffff;
    font-size: 0.9rem;
}

.site-footer span,
.site-footer a {
    font-size: 0.73rem;
}

.site-footer nav {
    display: flex;
    gap: 18px;
}

.site-footer a {
    color: #dce7f0;
}

.site-footer__legal {
    padding-top: 13px;
    padding-bottom: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: #aebdca;
    font-size: 0.7rem;
}

body.high-contrast {
    --brand-dark: #000000;
    --brand: #ffeb3b;
    --brand-light: #ffeb3b;
    --accent: #ffeb3b;
    --background: #000000;
    --surface: #000000;
    --text: #ffffff;
    --muted: #ffffff;
    --border: #ffffff;
    --focus: #00ffff;
}

body.high-contrast .accessibility-bar,
body.high-contrast .hero,
body.high-contrast .site-footer {
    background: #000000;
    color: #ffffff;
}

body.high-contrast .accessibility-bar,
body.high-contrast .hero,
body.high-contrast .site-header,
body.high-contrast .main-navigation,
body.high-contrast .guidance,
body.high-contrast .site-footer {
    border-color: #ffffff;
}

body.high-contrast .brand,
body.high-contrast .admin-access,
body.high-contrast .eyebrow,
body.high-contrast .main-navigation a,
body.high-contrast .nav-submenu > summary,
body.high-contrast .query-card__icon,
body.high-contrast .guidance a {
    color: #ffeb3b;
}

body.high-contrast .nav-submenu__panel,
body.high-contrast .nav-submenu__panel a:hover,
body.high-contrast .nav-submenu__panel a.is-current {
    border-color: #ffffff;
    background: #000000;
}

body.high-contrast .mobile-menu-toggle {
    border-color: #ffffff;
    background: #000000;
    color: #ffeb3b;
}

body.high-contrast .search-panel,
body.high-contrast .search-panel input,
body.high-contrast .guidance,
body.high-contrast .guidance__icon,
body.high-contrast .query-card__icon {
    background: #000000;
    color: #ffffff;
}

body.high-contrast .search-panel__field,
body.high-contrast .search-panel button,
body.high-contrast .query-card,
body.high-contrast .empty-search {
    border-color: #ffffff;
}

body.high-contrast .search-panel button {
    background: #ffeb3b;
    color: #000000;
}

body.high-contrast .portal-page .x_panel,
body.high-contrast .portal-page .x_title,
body.high-contrast .portal-page .form-control,
body.high-contrast .portal-page .panel,
body.high-contrast .portal-page .panel-heading,
body.high-contrast .portal-page .list-group-item,
body.high-contrast .portal-page table.table > tbody > tr > td {
    border-color: #ffffff;
    background: #000000;
    color: #ffffff;
}

body.high-contrast .portal-page table.table > thead > tr > th {
    border-color: #ffffff;
    background: #000000;
    color: #ffeb3b;
}

body.high-contrast .portal-page table.table-striped > tbody > tr:nth-of-type(odd) > td,
body.high-contrast .portal-page .panel-heading {
    background: #101010;
}

body.high-contrast .portal-page a,
body.high-contrast .portal-page .x_title::before {
    color: #ffeb3b;
}

body.high-contrast .hero__copy p,
body.high-contrast .search-panel p,
body.high-contrast .guidance small,
body.high-contrast .site-footer span,
body.high-contrast .site-footer a {
    color: #ffffff;
}

@media (max-width: 900px) {
    .hero__content {
        grid-template-columns: 1fr;
        gap: 28px;
    }

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

@media (max-width: 680px) {
    .page-width {
        width: min(1140px, calc(100% - 28px));
    }

    .section-heading,
    .guidance__content,
    .site-footer__content {
        align-items: flex-start;
        flex-direction: column;
    }

    .accessibility-bar__content > span {
        display: none;
    }

    .accessibility-bar__content {
        justify-content: flex-end;
    }

    .brand-row {
        min-height: 82px;
    }

    .brand img {
        width: 48px;
        height: 48px;
    }

    .brand strong {
        font-size: 1.16rem;
    }

    .brand small {
        display: none;
    }

    .admin-access {
        font-size: 0;
    }

    .admin-access .fa {
        font-size: 1rem;
    }

    .main-navigation__mobile {
        display: block;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .main-navigation__links {
        display: none;
        min-height: 0;
        padding-bottom: 10px;
        overflow: visible;
        align-items: stretch;
        flex-direction: column;
        gap: 0;
    }

    .main-navigation__links.is-mobile-open {
        display: flex;
    }

    .main-navigation__links > a,
    .nav-submenu > summary {
        flex: 0 0 auto;
        justify-content: space-between;
        width: 100%;
        min-height: 44px;
        border-bottom: 1px solid var(--border);
        white-space: normal;
    }

    .main-navigation__links > a.is-current,
    .nav-submenu[open] > summary,
    .nav-submenu.is-current > summary {
        border-bottom-color: var(--accent);
    }

    .nav-submenu {
        width: 100%;
    }

    .nav-submenu__panel {
        position: static;
        min-width: 0;
        padding: 4px 0 7px 14px;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .nav-submenu__panel a {
        padding: 10px 12px;
        white-space: normal;
    }

    .hero__content {
        padding-top: 28px;
        padding-bottom: 28px;
    }

    .search-panel {
        padding: 17px;
    }

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

    .section-heading {
        gap: 10px;
    }

    .guidance__content,
    .site-footer__content {
        padding-top: 22px;
        padding-bottom: 22px;
    }

    .site-footer nav {
        flex-wrap: wrap;
    }

    .portal-page {
        padding-top: 22px;
        padding-bottom: 32px;
    }

    .portal-page .x_title,
    .portal-page .x_content {
        padding: 18px;
    }

    .portal-page .x_title h2 {
        font-size: 1.3rem;
    }

    .portal-page .dataTables_wrapper .row:first-child,
    .portal-page .dataTables_wrapper .row:last-child {
        align-items: stretch;
        flex-direction: column;
    }

    .portal-page .dataTables_filter,
    .portal-page .dataTables_filter label,
    .portal-page .dataTables_filter input {
        width: 100%;
        margin-left: 0;
    }

    .portal-page .dataTables_filter label {
        display: grid;
        gap: 5px;
    }
}

@media (max-width: 440px) {
    .accessibility-controls {
        width: 100%;
        justify-content: space-between;
        gap: 5px;
    }

    .accessibility-controls__label {
        display: none;
    }

    .search-panel__field {
        flex-wrap: wrap;
    }

    .search-panel input {
        width: calc(100% - 40px);
    }

    .search-panel button {
        width: 100%;
        min-height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .query-card {
        transition: none;
    }
}
