:root {
    --navy: #102b46;
    --navy-light: #183e60;
    --accent: #e58a32;
    --text: #263445;
    --muted: #718096;
    --border: #dce3eb;
    --background: #f3f6fa;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, Arial, sans-serif;
    color: var(--text);
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--background);
}

.login-container {
    width: 100%;
    max-width: 1020px;
    min-height: 610px;
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    overflow: hidden;
    border-radius: 18px;
    background: var(--white);
    box-shadow: 0 18px 55px rgba(20, 42, 66, 0.12);
}

.login-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 64px 54px;
    color: var(--white);
    background:
        radial-gradient(circle at 90% 15%, rgba(255,255,255,.10), transparent 32%),
        linear-gradient(145deg, var(--navy), var(--navy-light));
}

.brand-mark {
    width: fit-content;
    margin-bottom: 38px;
    padding: 10px 16px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 9px;
    font-size: 23px;
    font-weight: 800;
    letter-spacing: 4px;
}

.login-brand h1 {
    max-width: 350px;
    margin: 0 0 18px;
    font-size: 31px;
    line-height: 1.25;
    font-weight: 650;
}

.login-brand p {
    max-width: 350px;
    margin: 0;
    color: rgba(255,255,255,.76);
    font-size: 15px;
    line-height: 1.8;
}

.brand-footer {
    position: absolute;
    bottom: 38px;
    left: 54px;
    color: rgba(255,255,255,.65);
    font-size: 12px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 58px;
}

.login-content {
    width: 100%;
    max-width: 370px;
}

.eyebrow {
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.8px;
}

.login-heading h2 {
    margin: 12px 0 8px;
    color: var(--navy);
    font-size: 29px;
}

.login-heading p {
    margin: 0 0 34px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

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

.form-group label {
    display: block;
    margin-bottom: 9px;
    color: var(--text);
    font-size: 13px;
    font-weight: 650;
}

.form-control {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s;
}

.form-control:focus {
    border-color: var(--navy-light);
    box-shadow: 0 0 0 3px rgba(24,62,96,.10);
}

.form-control::placeholder {
    color: #a4afbd;
}

.form-options {
    margin: 2px 0 25px;
}

.remember-option {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
}

.remember-option input {
    accent-color: var(--navy-light);
}

.login-button {
    width: 100%;
    height: 49px;
    border: 0;
    border-radius: 8px;
    background: var(--navy);
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .2s;
}

.login-button:hover {
    background: var(--navy-light);
}

.login-button:active {
    transform: translateY(1px);
}

.alert {
    margin-bottom: 22px;
    padding: 12px 14px;
    border-radius: 7px;
    font-size: 13px;
    line-height: 1.5;
}

.alert-danger {
    border: 1px solid #f2c7c7;
    background: #fff1f1;
    color: #a52d2d;
}

.alert-warning {
    border: 1px solid #f0dfb4;
    background: #fff9e9;
    color: #85651b;
}

.alert-success {
    border: 1px solid #c7e7d3;
    background: #effaf3;
    color: #287346;
}

.field-error {
    display: block;
    margin-top: 6px;
    color: #b42318;
    font-size: 12px;
}

.login-bottom {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #edf0f4;
    color: #929eac;
    font-size: 11px;
    text-align: center;
}

@media (max-width: 760px) {
    .login-page {
        padding: 16px;
    }

    .login-container {
        max-width: 460px;
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .login-brand {
        min-height: 220px;
        padding: 32px;
    }

    .brand-mark {
        margin-bottom: 20px;
    }

    .login-brand h1 {
        font-size: 24px;
    }

    .brand-footer {
        display: none;
    }

    .login-panel {
        padding: 38px 28px;
    }
}

/* PAINEL PRINCIPAL */

.dashboard-page {
    min-height: 100vh;
    background: var(--background);
}

.dashboard-header {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6%;
    background: var(--white);
    border-bottom: 1px solid #e7ecf2;
}

.dashboard-logo {
    color: var(--navy);
    font-size: 23px;
    font-weight: 800;
    letter-spacing: 3px;
}

.dashboard-user {
    display: flex;
    align-items: center;
    gap: 22px;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
}

.user-info strong {
    color: var(--navy);
    font-size: 13px;
}

.user-info span {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 1px;
}

.logout-button {
    padding: 9px 17px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: white;
    color: var(--text);
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}

.logout-button:hover {
    border-color: var(--navy-light);
    color: var(--navy);
}

.dashboard-main {
    width: 88%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 58px 0 30px;
}

.welcome-section {
    margin-bottom: 38px;
}

.welcome-section h1 {
    margin: 12px 0 10px;
    color: var(--navy);
    font-size: 32px;
}

.welcome-section p {
    max-width: 620px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}

.module-card {
    display: flex;
    gap: 20px;
    padding: 28px;
    border: 1px solid #e5eaf0;
    border-radius: 12px;
    background: var(--white);
    box-shadow: 0 5px 18px rgba(20,42,66,.04);
}

.module-icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #edf2f7;
    color: var(--navy);
    font-size: 14px;
    font-weight: 800;
}

.module-status {
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}

.module-card h2 {
    margin: 9px 0;
    color: var(--navy);
    font-size: 18px;
}

.module-card p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.module-coming {
    color: #8995a3;
    font-size: 11px;
    font-weight: 650;
}

.dashboard-footer {
    margin-top: 70px;
    padding-top: 20px;
    border-top: 1px solid #e1e7ee;
    color: #929eac;
    font-size: 11px;
}

@media (max-width: 600px) {
    .dashboard-header {
        padding: 0 5%;
    }

    .dashboard-user {
        gap: 10px;
    }

    .dashboard-main {
        width: 90%;
        padding-top: 38px;
    }

    .welcome-section h1 {
        font-size: 26px;
    }

    .module-card {
        padding: 20px;
    }
}

/* =========================================================
   SIGA - PAINEL DE INDICADORES
   ========================================================= */

.filter-panel,
.overview-panel,
.indicator-card,
.empty-state {
    border: 1px solid #e3e9f0;
    border-radius: 12px;
    background: var(--white);
    box-shadow: 0 5px 18px rgba(20, 42, 66, .035);
}

.filter-panel {
    margin-bottom: 28px;
    padding: 24px;
}

.filter-heading,
.section-heading,
.overview-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.filter-heading {
    margin-bottom: 20px;
}

.section-kicker {
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.filter-heading h2,
.section-heading h2 {
    margin: 6px 0 0;
    color: var(--navy);
    font-size: 18px;
}

.filter-description {
    color: var(--muted);
    font-size: 12px;
}

.dashboard-filters {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) minmax(150px, .55fr) auto;
    align-items: end;
    gap: 14px;
}

.filter-field label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.filter-field select {
    width: 100%;
    height: 43px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    outline: none;
    background: #fff;
    color: var(--text);
    font-size: 13px;
}

.filter-field select:focus {
    border-color: var(--navy-light);
    box-shadow: 0 0 0 3px rgba(24, 62, 96, .09);
}

.filter-button {
    height: 43px;
    padding: 0 22px;
    border: 0;
    border-radius: 7px;
    background: var(--navy);
    color: white;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
}

.filter-button:hover {
    background: var(--navy-light);
}

.overview-panel {
    margin-bottom: 38px;
    padding: 25px 28px;
}

.overview-panel h2 {
    margin: 7px 0;
    color: var(--navy);
    font-size: 23px;
}

.overview-panel p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.overview-period {
    min-width: 150px;
    padding-left: 25px;
    border-left: 1px solid var(--border);
    text-align: right;
}

.overview-period span,
.overview-period small {
    display: block;
    color: var(--muted);
    font-size: 10px;
}

.overview-period strong {
    display: block;
    margin: 4px 0;
    color: var(--navy);
    font-size: 28px;
}

.indicators-section {
    margin-top: 12px;
}

.section-heading {
    margin-bottom: 20px;
}

.section-heading p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.indicator-count {
    padding: 7px 11px;
    border-radius: 20px;
    background: #edf2f7;
    color: var(--navy);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

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

.indicator-card {
    min-width: 0;
    padding: 21px;
    transition: box-shadow .2s, transform .2s;
}

.indicator-card:hover {
    box-shadow: 0 8px 24px rgba(20, 42, 66, .07);
    transform: translateY(-1px);
}

.indicator-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 13px;
}

.indicator-code {
    color: var(--navy);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .8px;
}

.status-active,
.status-discontinued {
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 9px;
    font-weight: 750;
}

.status-active {
    background: #edf5f1;
    color: #397458;
}

.status-discontinued {
    background: #fff4e8;
    color: #a96620;
}

.indicator-card h3 {
    min-height: 42px;
    margin: 0 0 20px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}

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

.comparison-item {
    min-width: 0;
    padding: 12px 10px;
    border-radius: 7px;
    background: #f5f7fa;
}

.comparison-item.institution-value {
    background: #edf2f7;
    border-left: 3px solid var(--navy-light);
}

.comparison-item span {
    display: block;
    min-height: 27px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
}

.comparison-item strong {
    display: block;
    margin-top: 5px;
    color: var(--navy);
    font-size: clamp(12px, 1.3vw, 16px);
    font-weight: 750;
    overflow-wrap: anywhere;
}

.indicator-card-footer {
    margin-top: 15px;
    color: #8995a3;
    font-size: 10px;
}

.indicator-details {
    margin-top: 17px;
    border-top: 1px solid #edf0f4;
}

.indicator-details summary {
    padding-top: 14px;
    color: var(--navy-light);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    list-style-position: inside;
}

.indicator-details summary:hover {
    color: var(--accent);
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
    margin: 17px 0 5px;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 10px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    display: inline-block;
    border-radius: 50%;
}

.legend-institution {
    background: #173e60;
}

.legend-anahp {
    background: #e58a32;
}

.legend-others {
    background: #7193ad;
}

.chart-container {
    width: 100%;
    margin: 8px 0 15px;
}

.indicator-chart {
    width: 100%;
    height: 230px;
    display: block;
}

.history-table-wrapper {
    max-width: 100%;
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
    white-space: nowrap;
}

.history-table th,
.history-table td {
    padding: 9px 8px;
    border-bottom: 1px solid #edf0f4;
    text-align: right;
}

.history-table th:first-child,
.history-table td:first-child {
    text-align: left;
}

.history-table th {
    background: #f5f7fa;
    color: var(--navy);
    font-weight: 750;
}

.history-table td {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.no-history {
    margin: 15px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.empty-state {
    padding: 45px 25px;
    text-align: center;
}

.empty-state h2 {
    margin: 10px 0;
    color: var(--navy);
    font-size: 19px;
}

.empty-state p {
    color: var(--muted);
    font-size: 13px;
}

.empty-state-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border-radius: 50%;
    background: #fff4e8;
    color: #a96620;
    font-weight: 800;
}

/* Responsividade */

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

    .dashboard-main {
        width: 92%;
    }
}

@media (max-width: 600px) {
    .dashboard-header {
        min-height: 68px;
    }

    .dashboard-user {
        gap: 9px;
    }

    .user-info strong {
        max-width: 130px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .dashboard-main {
        width: 92%;
        padding-top: 30px;
    }

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

    .filter-button {
        width: 100%;
    }

    .filter-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .overview-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .overview-period {
        width: 100%;
        padding: 15px 0 0;
        border-top: 1px solid var(--border);
        border-left: 0;
        text-align: left;
    }

    .comparison-values {
        gap: 5px;
    }

    .comparison-item {
        padding: 10px 7px;
    }

    .comparison-item span {
        font-size: 9px;
    }

    .indicator-card {
        padding: 16px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Controles e visualização dos gráficos SIGA */

.chart-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin: 16px 0 12px;
}

.chart-type-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chart-type-control label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.chart-type-select {
    min-width: 130px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--white);
    color: var(--text);
    font: inherit;
    font-size: 12px;
}

.chart-fullscreen-button {
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--white);
    color: var(--navy);
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}

.chart-fullscreen-button:hover {
    background: #f1f5f9;
    border-color: var(--navy-light);
}

.chart-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 12px 0;
}

.legend-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font-size: 11px;
    cursor: pointer;
    opacity: .42;
    transition: opacity .2s, background .2s;
}

.legend-toggle.is-visible {
    opacity: 1;
    background: #f4f7fa;
}

.legend-toggle:focus-visible,
.chart-fullscreen-button:focus-visible,
.chart-type-select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.chart-container {
    width: 100%;
    min-width: 0;
    margin: 12px 0 18px;
}

.indicator-chart {
    display: block;
    width: 100%;
    height: 260px;
}

body.chart-expanded-open {
    overflow: hidden;
}

.indicator-card.chart-expanded {
    position: fixed;
    z-index: 10000;
    inset: 12px;
    display: flex;
    flex-direction: column;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    padding: clamp(18px, 3vw, 34px);
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--white);
    box-shadow: 0 20px 80px rgba(10, 30, 50, .30);
}

.indicator-card.chart-expanded .indicator-details {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.indicator-card.chart-expanded .chart-container {
    flex: 1;
    min-height: 300px;
}

.indicator-card.chart-expanded .indicator-chart {
    height: clamp(300px, 48vh, 600px);
}

.indicator-card.chart-expanded .history-table-wrapper {
    max-height: 25vh;
    overflow: auto;
}

.indicator-card.chart-expanded .chart-toolbar {
    position: sticky;
    top: -1px;
    z-index: 2;
    padding: 8px 0;
    background: var(--white);
}

@media (max-width: 600px) {
    .chart-toolbar {
        align-items: stretch;
    }

    .chart-type-control,
    .chart-type-select,
    .chart-fullscreen-button {
        width: 100%;
    }

    .indicator-card.chart-expanded {
        inset: 5px;
        max-height: calc(100vh - 10px);
        padding: 15px;
    }

    .indicator-card.chart-expanded .indicator-chart {
        height: 42vh;
    }

    .chart-legend {
        gap: 5px;
    }
}

/* Mantém o controle de retorno acessível durante a ampliação */
.indicator-card.chart-expanded .chart-toolbar {
    position: sticky;
    top: 0;
    align-self: stretch;
    z-index: 10002;
}

.indicator-card.chart-expanded .chart-fullscreen-button {
    position: fixed;
    top: 28px;
    right: 30px;
    z-index: 10003;
    width: auto;
    min-width: 130px;
    box-shadow: 0 2px 12px rgba(10, 30, 50, .16);
}

@media (max-width: 600px) {
    .indicator-card.chart-expanded .chart-fullscreen-button {
        top: 16px;
        right: 18px;
        width: auto;
        min-width: 120px;
    }
}

/* =========================================================
   CONTA DO USUÁRIO E ADMINISTRAÇÃO
   ========================================================= */

.account-menu {
    position: relative;
}

.account-menu summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--navy);
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    list-style: none;
}

.account-menu summary::-webkit-details-marker {
    display: none;
}

.account-menu summary:hover {
    background: #f5f8fb;
}

.account-menu-icon {
    font-size: 13px;
}

.account-menu-chevron {
    color: var(--muted);
}

.account-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1000;
    width: 210px;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    box-shadow: 0 12px 30px rgba(10, 30, 50, .14);
}

.account-menu-dropdown a,
.account-menu-logout {
    display: block;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.account-menu-dropdown a:hover,
.account-menu-logout:hover {
    background: #f1f5f9;
}

.account-menu-logout {
    color: #a52d2d;
}

.account-main {
    width: min(1120px, 88%);
    margin: 0 auto;
    padding: 48px 0 60px;
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
}

.account-panel {
    min-width: 0;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    box-shadow: 0 4px 16px rgba(10, 30, 50, .04);
}

.account-panel-heading {
    margin-bottom: 26px;
}

.account-panel-heading h2,
.admin-module h2 {
    margin: 8px 0;
    color: var(--navy);
    font-size: 20px;
}

.account-panel-heading p,
.admin-module p {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.account-button {
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 7px;
    background: var(--navy);
    color: white;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.account-button:hover {
    background: var(--navy-light);
}

.account-hint {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 11px;
}

.account-back {
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--navy);
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
}

.account-back:hover {
    background: #f5f8fb;
}

.account-logo {
    color: var(--navy);
    text-decoration: none;
}

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

.admin-module {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.admin-module p {
    flex: 1;
}

.module-status {
    display: inline-block;
    padding: 7px 10px;
    border-radius: 6px;
    background: #f1f4f7;
    color: #657386;
    font-size: 11px;
    font-weight: 650;
}

@media (max-width: 760px) {
    .account-main {
        width: 92%;
        padding-top: 30px;
    }

    .account-grid,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .account-panel {
        padding: 22px;
    }

    .dashboard-header {
        gap: 12px;
        padding: 12px 4%;
    }

    .dashboard-user {
        gap: 10px;
    }

    .account-menu-label,
    .account-back {
        font-size: 11px;
    }
}

@media (max-width: 420px) {
    .account-menu summary {
        gap: 5px;
        padding: 0 8px;
    }

    .user-info strong {
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* =========================================================
   DASHBOARD MULTI-INSTITUIÇÃO
   ========================================================= */

.filter-field select[multiple] {
    height: auto;
    min-height: 118px;
    padding: 8px 10px;
    line-height: 1.7;
}

.filter-field select[multiple] option {
    padding: 5px 7px;
    border-radius: 4px;
}

.filter-help {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.comparison-values {
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}

.comparison-item {
    border-left: 3px solid var(--series-color, #dce3eb);
}

.comparison-item.institution-value {
    border-left-color: var(--series-color, var(--navy-light));
}

.comparison-item span {
    overflow-wrap: anywhere;
}

.legend-toggle {
    max-width: 100%;
    text-align: left;
    overflow-wrap: anywhere;
}

.legend-dot {
    flex: 0 0 8px;
}

.history-table-wrapper {
    max-width: 100%;
    overflow-x: auto;
}

.history-table {
    min-width: 620px;
}

.history-table th {
    white-space: normal;
    min-width: 115px;
}

@media (max-width: 760px) {
    .dashboard-filters {
        grid-template-columns: 1fr;
    }

    .filter-field select[multiple] {
        min-height: 140px;
    }

    .filter-button {
        width: 100%;
    }

    .overview-panel {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .chart-legend {
        gap: 6px;
    }

    .legend-toggle {
        font-size: 10px;
    }
}

@media (max-width: 420px) {
    .comparison-values {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   SIGA — IDENTIDADE VISUAL E ACABAMENTO DA INTERFACE
   Camada complementar: preserva as regras e funcionalidades
   existentes.
   ========================================================= */

:root {
    --siga-radius: 12px;
    --siga-radius-sm: 8px;
    --siga-shadow: 0 5px 20px rgba(16, 43, 70, .055);
    --siga-shadow-hover: 0 12px 28px rgba(16, 43, 70, .10);
    --siga-focus: 0 0 0 3px rgba(24, 62, 96, .13);
}

/* Base e tipografia */

body.dashboard-page {
    background:
        linear-gradient(180deg, #edf2f7 0, #f5f7fa 260px, #f5f7fa 100%);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.dashboard-page button,
.dashboard-page input,
.dashboard-page select,
.dashboard-page textarea {
    font: inherit;
}

.dashboard-page a,
.dashboard-page button,
.dashboard-page select,
.dashboard-page summary {
    -webkit-tap-highlight-color: transparent;
}

.dashboard-page a:focus-visible,
.dashboard-page button:focus-visible,
.dashboard-page input:focus-visible,
.dashboard-page select:focus-visible,
.dashboard-page summary:focus-visible {
    outline: none;
    box-shadow: var(--siga-focus);
}

/* Cabeçalho institucional */

.dashboard-header {
    position: relative;
    z-index: 20;
    min-height: 76px;
    padding-right: max(6%, calc((100% - 1320px) / 2));
    padding-left: max(6%, calc((100% - 1320px) / 2));
    background: rgba(255, 255, 255, .97);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 12px rgba(16, 43, 70, .035);
}

.dashboard-logo {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    letter-spacing: 3px;
}

.dashboard-logo::before {
    content: "";
    width: 4px;
    height: 27px;
    border-radius: 5px;
    background: var(--accent);
}

.user-info strong {
    font-size: 13px;
    font-weight: 750;
}

.user-info span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
}

.account-menu summary {
    min-height: 42px;
    border-color: #dce4ed;
    transition: background .18s, border-color .18s, box-shadow .18s;
}

.account-menu summary:hover {
    border-color: #b9c9d9;
    background: #f6f8fb;
}

.account-menu[open] summary {
    border-color: var(--navy-light);
    background: #f3f7fb;
}

.account-menu-dropdown {
    border-color: #e0e7ef;
    box-shadow: 0 16px 38px rgba(16, 43, 70, .15);
}

.account-menu-dropdown a,
.account-menu-logout {
    min-height: 40px;
    display: flex;
    align-items: center;
}

/* Área principal e títulos */

.dashboard-main {
    width: min(1200px, 90%);
    padding-top: 48px;
}

.account-main {
    width: min(1120px, 90%);
    padding-top: 42px;
}

.welcome-section {
    margin-bottom: 30px;
}

.welcome-section h1 {
    font-size: clamp(26px, 3vw, 34px);
    font-weight: 750;
    letter-spacing: -.8px;
    line-height: 1.2;
}

.welcome-section p {
    color: #65758a;
    font-size: 14px;
}

.eyebrow,
.section-kicker {
    letter-spacing: 1.6px;
}

/* Superfícies */

.filter-panel,
.overview-panel,
.indicator-card,
.empty-state,
.account-panel {
    border: 1px solid #e2e8f0;
    border-radius: var(--siga-radius);
    background: #fff;
    box-shadow: var(--siga-shadow);
}

.filter-panel,
.account-panel {
    padding: 26px;
}

.filter-panel {
    margin-bottom: 24px;
}

.filter-heading h2,
.section-heading h2 {
    font-size: 19px;
    font-weight: 750;
    letter-spacing: -.25px;
}

.filter-description {
    color: #718096;
}

.filter-field select,
.form-control {
    min-height: 43px;
    border: 1px solid #d7e0e9;
    border-radius: var(--siga-radius-sm);
    background-color: #fff;
    color: var(--text);
    transition: border-color .18s, box-shadow .18s;
}

.filter-field select:hover,
.form-control:hover {
    border-color: #b9c8d8;
}

.filter-field select:focus,
.form-control:focus {
    border-color: var(--navy-light);
    box-shadow: var(--siga-focus);
    outline: none;
}

.filter-field label,
.form-group label {
    color: #34465b;
    font-size: 12px;
    font-weight: 750;
}

/* Botões */

.filter-button,
.account-button {
    min-height: 43px;
    border-radius: var(--siga-radius-sm);
    background: linear-gradient(135deg, #102b46, #1b496d);
    box-shadow: 0 3px 8px rgba(16, 43, 70, .12);
    transition: transform .18s, box-shadow .18s, background .18s;
}

.filter-button:hover,
.account-button:hover {
    background: linear-gradient(135deg, #183e60, #24577e);
    box-shadow: 0 5px 13px rgba(16, 43, 70, .18);
    transform: translateY(-1px);
}

.filter-button:active,
.account-button:active {
    transform: translateY(0);
}

/* Resumo do painel */

.overview-panel {
    padding: 25px 28px;
    border-left: 4px solid var(--accent);
}

.overview-panel h2 {
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -.35px;
}

.overview-period {
    padding-left: 28px;
}

.overview-period strong {
    font-size: 32px;
    font-weight: 800;
}

/* Indicadores */

.indicator-grid {
    gap: 20px;
}

.indicator-card {
    padding: 23px;
    border-radius: 13px;
    box-shadow: 0 3px 14px rgba(16, 43, 70, .045);
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.indicator-card:hover {
    border-color: #cbd8e5;
    box-shadow: var(--siga-shadow-hover);
    transform: translateY(-2px);
}

.indicator-code {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    border-radius: 6px;
    background: #edf2f7;
    color: #294762;
    font-size: 10px;
    letter-spacing: .8px;
}

.indicator-card h3 {
    min-height: 44px;
    color: #263b50;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.55;
}

.comparison-item {
    padding: 13px 11px;
    border-radius: 8px;
    background: #f6f8fa;
}

.comparison-item.institution-value {
    background: #eef3f8;
}

.comparison-item span {
    color: #66788c;
    font-size: 10px;
    font-weight: 600;
}

.comparison-item strong {
    color: #173e60;
    font-size: clamp(13px, 1.2vw, 16px);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.indicator-card-footer {
    color: #8190a0;
    font-size: 10px;
}

.indicator-details {
    border-top-color: #e7edf3;
}

.indicator-details summary {
    display: block;
    padding: 14px 10px 3px;
    border-radius: 6px;
    color: #315b7e;
    font-weight: 750;
    transition: color .18s, background .18s;
}

.indicator-details summary:hover {
    background: #f5f8fb;
    color: var(--accent);
}

.indicator-details[open] summary {
    margin-bottom: 10px;
}

.chart-toolbar {
    gap: 12px;
}

.chart-type-select,
.chart-fullscreen-button {
    min-height: 38px;
    border-radius: 7px;
}

.chart-fullscreen-button {
    border: 1px solid #d8e2eb;
    background: #f7f9fb;
    color: var(--navy);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s, border-color .18s;
}

.chart-fullscreen-button:hover {
    border-color: #b9c9d9;
    background: #edf3f8;
}

.legend-toggle {
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #f5f7fa;
    color: #526477;
    font-size: 11px;
    cursor: pointer;
}

.legend-toggle:hover {
    border-color: #dce5ed;
    background: #edf2f7;
}

.legend-toggle:not(.is-visible) {
    opacity: .48;
}

/* Tabelas do histórico */

.history-table {
    border: 1px solid #e4eaf0;
    border-radius: 8px;
    overflow: hidden;
}

.history-table th {
    padding: 11px 10px;
    background: #edf2f7;
    color: #294762;
    font-size: 10px;
    letter-spacing: .2px;
}

.history-table td {
    padding: 10px;
    font-size: 11px;
}

.history-table tbody tr:nth-child(even) {
    background: #fafbfd;
}

.history-table tbody tr:hover {
    background: #f0f5f9;
}

/* =========================================================
   ADMINISTRAÇÃO
   ========================================================= */

.admin-main {
    width: min(1200px, 92%);
    padding-top: 34px;
}

.admin-main .welcome-section {
    margin: 30px 0 26px;
}

.admin-nav {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 25px;
    padding: 9px;
    border: 1px solid #e0e7ef;
    border-radius: 11px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 4px 14px rgba(16, 43, 70, .045);
}

.admin-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 15px;
    border-radius: 7px;
    color: #526477;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: color .18s, background .18s;
}

.admin-nav a:hover {
    background: #edf3f8;
    color: var(--navy);
}

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

.admin-module {
    position: relative;
    min-height: 180px;
    padding: 25px;
    overflow: hidden;
    text-decoration: none;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.admin-module::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
    opacity: 0;
    transition: opacity .2s;
}

.admin-module:hover {
    border-color: #c4d2df;
    box-shadow: var(--siga-shadow-hover);
    transform: translateY(-3px);
}

.admin-module:hover::after {
    opacity: 1;
}

.admin-module h2 {
    margin: 10px 0;
    font-size: 20px;
    font-weight: 750;
}

.admin-module p {
    color: #6b7b8e;
    line-height: 1.65;
}

.admin-module .module-status {
    margin-top: 8px;
    border: 1px solid #e2eaf1;
    background: #f3f7fa;
    color: #315b7e;
    font-size: 11px;
}

/* Painéis administrativos */

.admin-main .account-panel {
    margin-bottom: 20px;
    padding: 25px;
}

.admin-main .account-panel > h2 {
    margin: 0 0 19px;
    color: var(--navy);
    font-size: 17px;
    font-weight: 750;
}

.admin-form-panel,
.admin-table-panel {
    min-width: 0;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 17px;
    margin-bottom: 18px;
}

.admin-form-grid .form-group {
    min-width: 0;
    margin-bottom: 0;
}

.admin-form-grid > button,
.admin-form-grid > a {
    align-self: end;
}

.admin-check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    color: #43566b;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.admin-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--navy-light);
    cursor: pointer;
}

.admin-global-check {
    width: fit-content;
    margin-bottom: 18px;
    padding: 11px 14px;
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    background: #f6f9fb;
}

.institution-check-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
    margin: 15px 0;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #fafbfd;
    transition: opacity .2s;
}

.institution-check-list .admin-check {
    padding: 8px 10px;
    border-radius: 6px;
    background: #fff;
}

.institution-check-list .admin-check:hover {
    background: #edf3f8;
}

/* Tabelas administrativas */

.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    scrollbar-width: thin;
    scrollbar-color: #b8c7d6 #f1f4f7;
}

.admin-table {
    width: 100%;
    min-width: 680px;
    border-collapse: separate;
    border-spacing: 0;
    color: #35475b;
    font-size: 12px;
}

.admin-table th {
    position: sticky;
    top: 0;
    padding: 13px 14px;
    border-bottom: 1px solid #dce5ed;
    background: #edf2f7;
    color: #294762;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .55px;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #edf1f5;
    vertical-align: middle;
    line-height: 1.5;
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-table tbody tr:nth-child(even) {
    background: #fafbfd;
}

.admin-table tbody tr:hover {
    background: #f1f6fa;
}

.admin-table td strong {
    display: block;
    color: #263e55;
    font-weight: 750;
}

.admin-table td small {
    display: block;
    margin-top: 3px;
    color: #8190a0;
    font-size: 10px;
    overflow-wrap: anywhere;
}

.admin-table .form-control {
    min-width: 180px;
    min-height: 38px;
    font-size: 12px;
}

.admin-actions {
    min-width: 190px;
}

.admin-actions a,
.admin-table td > a {
    display: inline-block;
    margin: 2px 7px 2px 0;
    color: #285779;
    font-size: 11px;
    font-weight: 750;
    text-decoration: none;
}

.admin-actions a:hover,
.admin-table td > a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.admin-actions form {
    display: inline-block;
}

.text-action {
    padding: 3px 0;
    border: 0;
    background: transparent;
    color: #a44b37;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.text-action:hover {
    color: #c0392b;
    text-decoration: underline;
}

/* Status e mensagens */

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 4px 9px;
    border-radius: 20px;
    background: #edf2f7;
    color: #526477;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.status-pill.status-concluida,
.status-pill.status-concluído,
.status-pill.status-sucesso,
.status-pill.status-success {
    background: #eaf5ef;
    color: #28734d;
}

.status-pill.status-erro,
.status-pill.status-falha,
.status-pill.status-error {
    background: #fff0ef;
    color: #a63832;
}

.status-pill.status-processando,
.status-pill.status-em_andamento {
    background: #fff5e8;
    color: #9a641d;
}

.audit-details,
.import-error {
    max-width: 300px;
    overflow-wrap: anywhere;
    color: #65758a;
    font-size: 11px;
}

.import-error:not(:empty) {
    line-height: 1.5;
}

.admin-table .admin-check {
    white-space: nowrap;
}

.admin-main .account-hint {
    margin: 13px 0;
    line-height: 1.6;
}

/* Página de conta */

.account-main:not(.admin-main) .account-grid {
    gap: 20px;
}

.account-main:not(.admin-main) .account-panel {
    padding: 28px;
}

.account-panel-heading {
    padding-bottom: 17px;
    border-bottom: 1px solid #edf1f5;
}

.account-panel-heading h2 {
    font-size: 19px;
    font-weight: 750;
}

.account-panel-heading p {
    color: #718096;
    line-height: 1.6;
}

.account-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 39px;
    background: #fff;
    transition: background .18s, border-color .18s;
}

.account-back:hover {
    border-color: #c4d2df;
    background: #f1f5f9;
}

.dashboard-footer {
    width: min(1200px, 90%);
    margin: 50px auto 0;
    padding: 20px 0 25px;
    border-top: 1px solid #e1e7ee;
    color: #8492a2;
    text-align: center;
}

/* Alertas */

.alert {
    margin: 0 0 18px;
    padding: 13px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.55;
}

.alert-success {
    border-color: #cce8d7;
    background: #eff9f2;
    color: #286b45;
}

.alert-warning {
    border-color: #f1dfbd;
    background: #fff8e9;
    color: #8c601d;
}

.alert-danger,
.alert-error {
    border-color: #f0d0ce;
    background: #fff2f1;
    color: #a33e38;
}

/* Responsividade */

@media (max-width: 900px) {
    .dashboard-main,
    .account-main,
    .admin-main {
        width: 92%;
    }

    .admin-nav {
        position: relative;
        top: auto;
    }

    .admin-nav a {
        flex: 1 1 auto;
    }

    .admin-form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 760px) {
    .dashboard-header {
        min-height: 68px;
        padding: 10px 4%;
    }

    .dashboard-main,
    .account-main,
    .admin-main {
        width: 92%;
        padding-top: 28px;
    }

    .welcome-section {
        margin-bottom: 24px;
    }

    .welcome-section h1 {
        font-size: 27px;
    }

    .filter-panel,
    .account-panel,
    .admin-main .account-panel {
        padding: 20px;
    }

    .overview-panel {
        gap: 18px;
    }

    .overview-period {
        padding: 0;
        border: 0;
        text-align: left;
    }

    .admin-grid,
    .account-grid {
        grid-template-columns: 1fr;
    }

    .admin-module {
        min-height: 150px;
    }

    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .admin-nav {
        gap: 5px;
        padding: 7px;
    }

    .admin-nav a {
        min-height: 36px;
        padding: 0 10px;
        font-size: 11px;
    }

    .dashboard-footer {
        margin-top: 32px;
    }
}

@media (max-width: 480px) {
    .dashboard-header {
        gap: 8px;
    }

    .dashboard-logo {
        font-size: 20px;
    }

    .dashboard-user {
        gap: 8px;
    }

    .user-info strong {
        max-width: 100px;
        font-size: 11px;
    }

    .user-info span {
        font-size: 9px;
    }

    .account-menu summary {
        min-height: 38px;
        padding: 0 9px;
    }

    .account-menu-label {
        display: none;
    }

    .welcome-section h1 {
        font-size: 24px;
    }

    .filter-panel,
    .account-panel,
    .admin-main .account-panel {
        padding: 17px;
    }

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

    .admin-nav a {
        flex: 1 1 calc(50% - 5px);
    }

    .institution-check-list {
        grid-template-columns: 1fr;
    }

    .admin-module {
        padding: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-page *,
    .dashboard-page *::before,
    .dashboard-page *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}




/* SIGA - DROPDOWN DE INSTITUIÇÕES */

.institution-filter {
    min-width: 0;
}

.institution-dropdown {
    position: relative;
    width: 100%;
}

.institution-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 43px;
    padding: 0 13px;
    border: 1px solid #d7e0e9;
    border-radius: var(--siga-radius-sm, 8px);
    background: #fff;
    color: var(--text, #263746);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.institution-dropdown-trigger:hover,
.institution-dropdown-trigger[aria-expanded="true"] {
    border-color: #8da8bf;
}

.institution-dropdown-trigger:focus-visible {
    outline: none;
    border-color: #477e9d;
    box-shadow: 0 0 0 3px rgba(71, 126, 157, .13);
}

.institution-dropdown-chevron {
    flex: 0 0 auto;
    color: #64788b;
    font-size: 15px;
    transition: transform .18s ease;
}

.institution-dropdown-trigger[aria-expanded="true"] .institution-dropdown-chevron {
    transform: rotate(180deg);
}

.institution-dropdown-panel {
    position: absolute;
    z-index: 30;
    top: calc(100% + 7px);
    left: 0;
    width: 100%;
    min-width: 240px;
    padding: 10px;
    border: 1px solid #dce4ec;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(16, 43, 70, .14);
}

.institution-dropdown-panel[hidden] {
    display: none !important;
}

.institution-dropdown-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 2px 9px;
    border-bottom: 1px solid #edf1f5;
}

.institution-dropdown-actions button {
    padding: 5px 3px;
    border: 0;
    background: transparent;
    color: #315d7d;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.institution-dropdown-actions button:hover {
    color: #173e60;
    text-decoration: underline;
}

.institution-dropdown-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 245px;
    margin-top: 7px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.institution-option {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 9px 8px;
    border-radius: 6px;
    color: #33485b;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    cursor: pointer;
}

.institution-option:hover {
    background: #f3f6f9;
}

.institution-option input {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin: 1px 0 0;
    accent-color: #315d7d;
    cursor: pointer;
}

.institution-option span {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .institution-dropdown-panel {
        max-height:  min(330px, 55vh);
    }

    .institution-dropdown-list {
        max-height: min(245px, 42vh);
    }
}



/* SIGA - FILTROS ALINHADOS E PESQUISÁVEIS */

.dashboard-filters {
    display: grid;
    grid-template-columns:
        minmax(230px, 1.25fr)
        minmax(230px, 1.25fr)
        minmax(135px, .65fr)
        auto;
    align-items: end;
    gap: 14px;
}

.dashboard-filters .filter-field {
    min-width: 0;
}

.dashboard-filters .filter-field > label {
    display: block;
    min-height: 17px;
    margin-bottom: 8px;
}

.dashboard-filters .institution-dropdown-trigger,
.dashboard-filters .period-filter select,
.dashboard-filters .filter-button {
    box-sizing: border-box;
    width: 100%;
    height: 43px;
    min-height: 43px;
}

.dashboard-filters .filter-button {
    white-space: nowrap;
}

.dropdown-search {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 38px;
    margin-bottom: 8px;
    padding: 0 10px;
    border: 1px solid #d7e0e9;
    border-radius: 7px;
    outline: none;
    background: #fff;
    color: var(--text, #263746);
    font: inherit;
    font-size: 12px;
}

.dropdown-search:focus {
    border-color: #477e9d;
    box-shadow: 0 0 0 3px rgba(71, 126, 157, .12);
}

.institution-option[hidden] {
    display: none !important;
}

.institution-dropdown-panel {
    max-width: min(420px, calc(100vw - 32px));
}

.institution-dropdown-list {
    max-height: 260px;
}

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

    .dashboard-filters .filter-button {
        width: auto;
        min-width: 160px;
        justify-self: start;
    }
}

@media (max-width: 600px) {
    .dashboard-filters {
        grid-template-columns: minmax(0, 1fr);
        gap: 13px;
    }

    .dashboard-filters .filter-button {
        width: 100%;
    }

    .institution-dropdown-panel {
        min-width: 0;
        max-width: calc(100vw - 48px);
    }
}

/* Alinhamento vertical dos filtros do dashboard */
.dashboard-filters .filter-field {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.dashboard-filters .filter-help {
    display: block;
    min-height: 16px;
    line-height: 16px;
}

/* Reserva no período o mesmo espaço da orientação das instituições */
.dashboard-filters .period-filter::after {
    content: "";
    display: block;
    height: 16px;
}


/* Correção definitiva do alinhamento dos filtros */
.dashboard-filters {
    align-items: start !important;
}

.dashboard-filters .filter-field {
    display: flex;
    flex-direction: column;
    align-self: start;
    min-width: 0;
}

.dashboard-filters .filter-field > label {
    height: 17px;
    min-height: 17px;
    margin-bottom: 8px;
    line-height: 17px;
}

.dashboard-filters .institution-dropdown,
.dashboard-filters .institution-dropdown-trigger,
.dashboard-filters .period-filter select {
    box-sizing: border-box;
    height: 43px;
    min-height: 43px;
}

.dashboard-filters .period-filter::after {
    content: none !important;
}

.dashboard-filters .filter-help {
    display: none !important;
}

/* Padronização exata da altura dos controles */
.dashboard-filters .institution-dropdown-trigger,
.dashboard-filters .period-filter select {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    height: 43px !important;
    min-height: 43px !important;
    max-height: 43px;
    padding: 0 12px !important;
    margin: 0;
    line-height: normal;
    font-size: 13px;
    vertical-align: middle;
}

.dashboard-filters .period-filter select {
    display: block;
}

.dashboard-filters .institution-dropdown {
    height: 43px;
    min-height: 43px;
}

/* Ajuste fino do conteúdo interno dos filtros */
.dashboard-filters .institution-dropdown-trigger {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    line-height: 43px !important;
}

.dashboard-filters .institution-dropdown-trigger > span {
    line-height: normal;
}

.dashboard-filters .period-filter select {
    height: 43px !important;
    min-height: 43px !important;
    line-height: 43px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Alinha o botão Aplicar filtros à base dos campos */
.dashboard-filters > .filter-button {
    align-self: end !important;
    margin-bottom: 0;
}


/* Percentual de preenchimento dos indicadores */
.indicator-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.indicator-completeness {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex-shrink: 0;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
}

.indicator-completeness strong {
    font-size: 13px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.completeness-label {
    font-size: 10px;
    font-weight: 650;
}

.completeness-high {
    color: #176b45;
    background: #e9f6ef;
    border-color: #c9e9d6;
}

.completeness-medium {
    color: #8a5a12;
    background: #fff5df;
    border-color: #f0dfb7;
}

.completeness-low {
    color: #a13e3e;
    background: #fff0f0;
    border-color: #f0d0d0;
}

@media (max-width: 420px) {
    .indicator-completeness {
        gap: 4px;
        padding: 5px 7px;
    }

    .completeness-label {
        font-size: 9px;
    }
}
