:root {
    --app-navy: #243447;
    --app-menu-yellow: #feb103;
    --app-reformas-orange: #f28c28;
    --app-menu-text: #1f2937;
    --app-blue: #1d5d8f;
    --app-border: #d9e1ea;
    --app-bg: #f4f7fa;
    --app-text: #263442;
    --app-font: "Exo 2", "Segoe UI", sans-serif;
    --navbar-height: 64px;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--app-bg);
    color: var(--app-text);
    font-family: var(--app-font);
}

@media (min-width: 1200px) {
    body.app-body {
        zoom: 0.8;
    }
}

.app-loading-overlay {
    align-items: center;
    background: rgba(244, 247, 250, 0.92);
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 160ms ease, visibility 160ms ease;
    visibility: hidden;
    z-index: 2500;
}

.app-loading-overlay.is-visible {
    opacity: 1;
    pointer-events: all;
    visibility: visible;
}

.app-loading-card {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    max-width: calc(100vw - 32px);
    min-width: 280px;
    padding: 24px 30px;
    text-align: center;
}

.app-loading-spinner {
    animation: app-loading-spin 0.8s linear infinite;
    border: 5px solid #e2e8f0;
    border-radius: 50%;
    border-top-color: var(--app-menu-yellow);
    height: 46px;
    margin-bottom: 14px;
    width: 46px;
}

.app-loading-title {
    color: var(--app-navy);
    font-size: 1.05rem;
    font-weight: 700;
}

.app-loading-message {
    color: #64748b;
    font-size: 0.86rem;
    margin-top: 4px;
}

@keyframes app-loading-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .app-loading-spinner { animation-duration: 1.6s; }
    .app-loading-overlay { transition: none; }
}

.app-navbar,
.topbar {
    background-color: var(--app-menu-yellow) !important;
    color: var(--app-menu-text) !important;
    border-bottom: 1px solid rgba(31, 41, 55, 0.12);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin-top: 0;
    z-index: 1050;
    width: 100%;
    box-shadow: 0 4px 16px rgba(10, 20, 34, 0.08);
}

.app-navbar.reformas-navbar {
    background-color: var(--app-reformas-orange) !important;
    border-bottom-color: rgba(31, 41, 55, 0.2);
}

.navbar-left {
    align-items: center;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.app-navbar .navbar-brand {
    margin-right: 0;
}

.environment-label {
    background: #8b1e1e;
    border: 2px solid #ffffff;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 6px 12px;
    text-transform: uppercase;
}

.app-brand {
    align-items: center;
    display: inline-flex;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.app-brand img {
    display: block;
    height: 52px;
    width: auto;
}

.topbar-page-box,
.page-title-box,
.header-page-info {
    background-color: #ffffff !important;
    color: #111827 !important;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.topbar-page-box *,
.page-title-box *,
.header-page-info * {
    color: #111827 !important;
}

.navbar-page-meta {
    align-items: baseline;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.2;
}

.navbar-page-sep {
    color: #111827;
}

.navbar-page-title {
    font-size: 0.98rem;
    font-weight: 700;
}

.navbar-page-subtitle {
    font-size: 0.92rem;
}

.app-navbar .navbar-nav {
    align-items: center;
    gap: 4px;
}

@media (min-width: 993px) {
    .app-navbar .container-fluid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    }

    .app-navbar .navbar-left {
        flex-wrap: nowrap;
        grid-column: 1;
        min-width: 0;
        overflow: hidden;
    }

    .app-navbar .navbar-page-meta {
        flex-wrap: nowrap;
        max-width: calc(100% - 64px);
        min-width: 0;
        white-space: nowrap;
    }

    .app-navbar .navbar-page-title,
    .app-navbar .navbar-page-sep {
        flex: 0 0 auto;
    }

    .app-navbar .navbar-page-subtitle {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-navbar #navbarMain {
        display: contents !important;
    }

    .app-navbar .navbar-main-links {
        flex-wrap: nowrap;
        grid-column: 2;
        justify-self: center;
        white-space: nowrap;
    }

    .app-navbar .navbar-user-menu {
        grid-column: 3;
        justify-self: end;
        min-width: 0;
    }
}

.app-navbar .nav-link {
    border-radius: 6px;
    color: var(--app-menu-text) !important;
    padding-left: 10px;
    padding-right: 10px;
}

.app-navbar .nav-link.active {
    background: #003b5c;
    color: #ffffff !important;
    font-weight: 700;
}

.app-navbar .nav-link.active:hover,
.app-navbar .nav-link.active:focus {
    background: #003b5c;
    color: #ffffff !important;
}

.app-navbar .navbar-toggler {
    border-color: rgba(31, 41, 55, 0.35);
}

.app-navbar .nav-refresh-button {
    background: #fff;
    border-radius: 6px;
    color: var(--app-menu-text);
    display: inline-block;
    font-weight: 600;
    padding: 6px 12px;
    text-decoration: none;
    white-space: nowrap;
}

.app-navbar .nav-refresh-button:hover,
.app-navbar .nav-refresh-button:focus {
    background: #fff6da;
    color: #111827;
}

.admin-dropdown {
    border: 1px solid var(--app-border);
    box-shadow: 0 10px 24px rgba(36, 52, 71, 0.12);
}

.admin-dropdown .dropdown-item {
    color: #111;
}

.admin-dropdown .dropdown-item:hover,
.admin-dropdown .dropdown-item:focus {
    background: #eef6ff;
    color: #0d2f4a;
}

.notification-menu {
    position: relative;
}

.notification-bell {
    align-items: center;
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(31, 41, 55, 0.16);
    display: inline-flex;
    justify-content: center;
    min-height: 38px;
    min-width: 42px;
    position: relative;
}

.notification-bell::after {
    display: none;
}

.notification-badge {
    align-items: center;
    background: #b91c1c;
    border: 2px solid var(--app-menu-yellow);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 0.68rem;
    font-weight: 800;
    height: 20px;
    justify-content: center;
    line-height: 1;
    min-width: 20px;
    padding: 0 5px;
    position: absolute;
    right: -5px;
    top: -5px;
}

.notification-dropdown {
    border: 1px solid var(--app-border);
    box-shadow: 0 14px 34px rgba(36, 52, 71, 0.18);
    max-width: calc(100vw - 24px);
    min-width: 360px;
    padding: 0;
}

.notification-header {
    align-items: center;
    border-bottom: 1px solid #e4ebf2;
    display: flex;
    justify-content: space-between;
    padding: 12px 14px;
}

.notification-header strong {
    color: var(--app-navy);
    font-size: 0.98rem;
}

.notification-header button {
    background: transparent;
    border: 0;
    color: #1d5d8f;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px;
}

.notification-list {
    max-height: min(430px, 70vh);
    overflow: auto;
    padding: 6px;
}

.notification-item {
    align-items: flex-start;
    border-radius: 8px;
    color: #263442;
    display: flex;
    gap: 10px;
    padding: 10px;
    text-decoration: none;
}

.notification-item:hover,
.notification-item:focus {
    background: #eef6ff;
    color: #102f4a;
}

.notification-item.is-unread {
    background: #fff8df;
}

.notification-dot {
    background: #b7c4d1;
    border-radius: 999px;
    flex: 0 0 9px;
    height: 9px;
    margin-top: 6px;
    width: 9px;
}

.notification-item.is-unread .notification-dot {
    background: #b91c1c;
}

.notification-content {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.notification-content strong {
    color: #162b3d;
    font-size: 0.9rem;
}

.notification-content small {
    color: #536b82;
    font-size: 0.8rem;
    line-height: 1.3;
}

.notification-content em {
    color: #1d5d8f;
    font-size: 0.76rem;
    font-style: normal;
    font-weight: 700;
}

.notification-empty {
    color: #607286;
    font-size: 0.86rem;
    padding: 18px 14px;
    text-align: center;
}

.navbar-main-links .dropdown-menu {
    min-width: 260px;
}

.navbar-main-links .dropdown-item.active {
    background: #eef6ff;
    color: #0d2f4a;
    font-weight: 700;
}

.app-container {
    padding: calc(var(--navbar-height) + 28px) 28px 28px;
}

.page-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.page-heading h1 {
    font-size: 1.55rem;
    margin: 0;
}

.page-heading p {
    color: #667789;
    margin: 3px 0 0;
}

.detail-top-actions {
    display: inline-flex;
    gap: 10px;
    white-space: nowrap;
}

.btn-dark-blue {
    background: #163e67;
    border-color: #163e67;
    color: #ffffff;
}

.btn-dark-blue:hover,
.btn-dark-blue:focus {
    background: #0f314f;
    border-color: #0f314f;
    color: #ffffff;
}

.btn-orange {
    background: #e67e22;
    border-color: #e67e22;
    color: #ffffff;
}

.btn-orange:hover,
.btn-orange:focus {
    background: #c96816;
    border-color: #c96816;
    color: #ffffff;
}

.file-queue {
    display: grid;
    gap: 10px;
}

.file-queue-list {
    display: grid;
    gap: 8px;
    margin-top: 6px;
}

.file-queue-empty {
    font-size: 0.9rem;
}

.file-queue-item {
    align-items: center;
    background: #f6f8fb;
    border: 1px solid #d9e1ea;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding: 8px 10px;
}

.file-queue-item-info {
    min-width: 0;
}

.file-queue-item-name {
    font-size: 0.92rem;
    font-weight: 600;
    word-break: break-word;
}

.file-queue-item-meta {
    color: #607286;
    font-size: 0.8rem;
    margin-top: 2px;
}

.file-queue-remove {
    flex-shrink: 0;
}

.public-other-field {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
    width: 100%;
}

.metric-card,
.filter-panel,
.info-panel,
.edit-panel,
.app-table-wrap,
.chart-card {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(36, 52, 71, 0.06);
}

.metric-card {
    min-height: 118px;
    padding: 20px;
}

.metric-card-compact {
    height: 100%;
    min-height: 88px;
    padding: 14px;
}

.metric-card span {
    color: #657789;
    display: block;
    font-size: 0.88rem;
}

.metric-card strong {
    display: block;
    font-size: 1.8rem;
    margin-top: 8px;
}

.metric-priority-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.metric-card .metric-priority-chip {
    align-items: center;
    background: #e8f0f7;
    border: 1px solid #bdd0e1;
    border-radius: 999px;
    color: #244866;
    display: inline-flex;
    font-size: .68rem;
    gap: 5px;
    letter-spacing: 0;
    padding: 3px 7px;
    text-transform: none;
}

.metric-priority-chip b { color: #102f4a; font-size: .72rem; }
.metric-priority-chip.priority-chip-urgente { background: #fde2e2; border-color: #efa6a6; color: #8f1d1d; }
.metric-priority-chip.priority-chip-alta { background: #ffe9d5; border-color: #efbd88; color: #8a4709; }
.metric-priority-chip.priority-chip-media { background: #fff4cb; border-color: #e7c865; color: #725b00; }
.metric-priority-chip.priority-chip-baixa { background: #e2f2ff; border-color: #98c8ed; color: #19547e; }
.metric-priority-chip.priority-chip-planejada { background: #eee8ff; border-color: #b9a8ee; color: #4d388c; }

.dashboard-status-card {
    height: 100%;
}

.dashboard-metric-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: 100%;
}

.dashboard-metric-card {
    min-height: 132px;
}

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

.filter-panel {
    margin-bottom: 18px;
    padding: 18px;
    position: relative;
    z-index: 30;
    overflow: visible;
}

.filter-panel h2 {
    font-size: 1rem;
    margin-bottom: 14px;
}

.filter-actions,
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    margin-top: 18px;
}

.classification-filter-actions {
    margin-top: 0;
}

.table-actions {
    display: inline-flex;
    gap: 8px;
    white-space: nowrap;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
}

.table-actions-cell {
    white-space: nowrap;
    min-width: 170px;
    text-align: center;
}

.table-actions .btn {
    white-space: nowrap;
}

.col-acoes,
th.col-acoes,
td.col-acoes {
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

td.col-acoes .acoes-wrapper {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.col-local {
    max-width: 260px;
    width: 20%;
    white-space: normal;
    word-break: break-word;
}

.col-prazo {
    min-width: 150px;
    width: 12%;
    white-space: normal;
}

.app-table {
    margin-bottom: 0;
}

.app-table-wrap {
    position: relative;
    z-index: 1;
    overflow: visible;
}

.table-scroll {
    width: 100%;
    max-height: 65vh;
    overflow: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
    position: relative;
    z-index: 1;
}

.table-scroll table {
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
    min-width: 1100px;
}

.table-scroll thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-scroll thead th {
    background-color: var(--app-menu-yellow) !important;
    background-clip: padding-box;
    box-shadow: inset 0 -1px 0 rgba(17, 24, 39, 0.18);
    position: static;
}

.app-table thead th {
    background: var(--app-menu-yellow);
    color: #111827;
    text-align: center;
    font-size: 0.86rem;
    white-space: nowrap;
}

.app-table thead th a.sort-link {
    color: #111827;
}

.app-table thead th a.sort-link:hover,
.app-table thead th a.sort-link:focus {
    color: #111827;
}

.app-table thead th .sort-icon {
    color: #111827;
}

.app-table thead th.text-end {
    text-align: right;
}

.app-table tbody td {
    text-align: center;
    vertical-align: middle;
}

.app-table tbody tr:nth-child(odd) > *,
.consulta-table tbody tr:nth-child(odd) > * {
    background-color: #ffffff !important;
}

.app-table tbody tr:nth-child(even) > *,
.consulta-table tbody tr:nth-child(even) > * {
    background-color: #f5f7fb !important;
}

.app-table tbody tr:hover > *,
.consulta-table tbody tr:hover > * {
    background-color: #e9f0ff !important;
}

.app-table tbody td.col-local {
    text-align: center;
}

.status-pill {
    background: #edf2f7;
    border-radius: 999px;
    color: #46596b;
    display: inline-block;
    font-size: 0.82rem;
    padding: 4px 10px;
    white-space: nowrap;
}

.status-recebida {
    background: #e8eef5;
    color: #33516f;
}

.status-analise {
    background: #e7f0ff;
    color: #1d5d9f;
}

.status-andamento {
    background: #e3f6ef;
    color: #12664f;
}

.status-material {
    background: #fff0d6;
    color: #8a5200;
}

.status-reforma {
    background: #f1e8ff;
    color: #5b218a;
}

.status-concluido {
    background: #dff5e5;
    color: #176b35;
}

.status-recusado {
    background: #ffe1e1;
    color: #a11212;
}

.status-devolvido {
    background: #dfe4ea;
    color: #364152;
}

.status-duplicado {
    background: #fff5c2;
    color: #755f00;
}

.priority-badge {
    border-radius: 999px;
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    min-width: 72px;
    padding: 5px 10px;
    text-align: center;
}

.priority-critico {
    background: #ffe1e1;
    color: #a11212;
}

.priority-urgente {
    background: #7f1d1d;
    color: #fff;
}

.priority-alta {
    background: #ffe1e1;
    color: #b91c1c;
}

.priority-media {
    background: #ffe7cc;
    color: #a84d00;
}

.priority-normal {
    background: #fff5c2;
    color: #755f00;
}

.priority-baixa {
    background: #dff5e5;
    color: #176b35;
}

.priority-planejada {
    background: #e0efff;
    color: #1d4f91;
}

.priority-empty {
    background: #edf2f7;
    color: #607286;
}

.detail-layout {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
}

.info-panel,
.edit-panel {
    padding: 20px;
}

.editable-requester-panel {
    background: #faf3e8;
    border: 1px solid #e5d3b1;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(123, 84, 31, 0.08);
    margin-bottom: 18px;
}

.editable-requester-panel h2 {
    color: #6f4a1d;
}

.admin-fields-panel {
    background: #ffffff;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(36, 52, 71, 0.06);
    margin-top: 10px;
}

.info-panel h2,
.edit-panel h2 {
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.info-panel dl {
    margin: 0;
}

.info-panel dt {
    color: #000000;
    font-size: 0.84rem;
    font-weight: 700;
    margin-top: 12px;
}

.info-panel dd {
    border-bottom: 1px solid #edf1f5;
    color: #c00000;
    margin: 3px 0 0;
    padding-bottom: 10px;
    word-break: break-word;
}

.info-panel dd a,
.info-panel dd strong,
.info-panel dd span {
    color: inherit;
}

.priority-summary {
    background: #f6f8fb;
    border: 1px solid #e1e8ef;
    border-radius: 8px;
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
    padding: 12px;
}

.priority-summary > div {
    display: grid;
    gap: 4px;
}

.priority-summary > div > span {
    color: #607286;
    font-size: 0.84rem;
}

.planned-priority-control {
    background: linear-gradient(135deg, #eef5ff 0%, #ffffff 100%);
    border: 1px solid #9dbbdd;
    border-left: 5px solid #2563a7;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(23, 58, 92, 0.08);
    margin-top: 18px;
    padding: 14px 16px;
}

.maintenance-classification-switches {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.maintenance-nature-control {
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.maintenance-nature-control:has(input[value="Corretiva"]:checked) {
    background: linear-gradient(135deg, #fff4e6 0%, #ffffff 100%);
    border-color: #e7a35a;
    border-left-color: #c65d0e;
    box-shadow: 0 8px 18px rgba(166, 73, 12, 0.13);
}

.maintenance-nature-control:has(input[value="Preventiva"]:checked) {
    background: linear-gradient(135deg, #eaf8ef 0%, #ffffff 100%);
    border-color: #77bc8b;
    border-left-color: #198754;
    box-shadow: 0 8px 18px rgba(25, 135, 84, 0.13);
}

.maintenance-nature-title {
    color: var(--app-navy);
    display: block;
    font-weight: 700;
    margin-bottom: 10px;
}

.maintenance-nature-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.maintenance-nature-option {
    align-items: center;
    background: #ffffff;
    border: 1px solid #aebfd0;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    gap: 8px;
    min-height: 42px;
    padding: 8px 14px;
}

.maintenance-nature-option:has(input:checked) {
    border-width: 2px;
}

.maintenance-nature-option-preventive:has(input:checked) {
    border-color: #198754;
    color: #12683f;
}

.maintenance-nature-option-corrective:has(input:checked) {
    border-color: #c65d0e;
    color: #9a4308;
}

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

.planned-priority-control .form-check-label {
    color: var(--app-navy);
    font-weight: 650;
}

.planned-priority-control p {
    color: #536b82;
    font-size: 0.82rem;
    margin: 7px 0 0;
}

.planned-priority-control .form-check-input:checked {
    background-color: #2563a7;
    border-color: #2563a7;
}

.chart-card {
    padding: 16px;
}

.chart-card h2 {
    font-size: 1rem;
    margin: 0 0 14px;
}

.donut-wrap {
    align-items: center;
    display: flex;
    gap: 16px;
}

.donut-chart {
    border-radius: 50%;
    height: 180px;
    position: relative;
    width: 180px;
}

.donut-chart::after {
    background: #fff;
    border-radius: 50%;
    content: "";
    height: 108px;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 108px;
}

.donut-center {
    color: #2f4254;
    font-size: 1.2rem;
    font-weight: 700;
    margin-left: -126px;
    pointer-events: none;
    width: 72px;
    text-align: center;
}

.chart-legend {
    list-style: none;
    margin: 0;
    padding: 0;
}

.chart-legend li {
    align-items: center;
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.legend-dot {
    border-radius: 999px;
    display: inline-block;
    height: 10px;
    width: 10px;
}

.legend-green { background: #2d8b57; }
.legend-blue { background: #1d5d8f; }
.legend-amber { background: #b45309; }

.bar-list {
    display: grid;
    gap: 10px;
}

.bar-row {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(120px, 1fr) minmax(120px, 2fr) 34px;
}

.bar-label {
    color: #425566;
    font-size: 0.88rem;
}

.bar-track {
    background: #eef3f7;
    border-radius: 6px;
    height: 12px;
    overflow: hidden;
}

.bar-fill {
    background: linear-gradient(90deg, #3f86b6, #1d5d8f);
    height: 100%;
}

.bar-value {
    color: #425566;
    font-size: 0.86rem;
    font-weight: 600;
    text-align: right;
}

.status-tone-green {
    background: #f3fbf5;
    border-color: #a9d8b9;
}

.status-tone-red {
    background: #fff5f5;
    border-color: #e6b1b1;
}

.status-tone-gray {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.status-tone-yellow {
    background: #fffbea;
    border-color: #ebd58f;
}

.login-shell {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 150px);
}

.login-panel {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(36, 52, 71, 0.08);
    max-width: 420px;
    padding: 28px;
    width: 100%;
}

.login-panel h1 {
    font-size: 1.45rem;
    margin-bottom: 20px;
}

.auto-refresh-note {
    color: #607286;
    font-size: 0.86rem;
    margin: -4px 0 14px;
}

.auto-refresh-note-warning {
    color: #8a5b12;
}

.custos-filter-panel {
    margin-bottom: 20px;
}

.custos-filter-grid {
    align-items: end;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.8fr) minmax(240px, 1fr) auto;
}

.custos-filter-actions,
.custos-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.custos-list-table {
    max-height: 64vh;
}

.custos-detail-grid {
    align-items: stretch;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(340px, 0.75fr) minmax(620px, 1.25fr);
}

.custos-report-panel {
    align-items: center;
    background: linear-gradient(135deg, #ffffff 0%, #fff8e8 100%);
    border: 1px solid #ead7aa;
    border-left: 5px solid #dc3545;
    border-radius: 10px;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 14px 16px;
}

.custos-report-panel h2 {
    color: #293b4d;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 3px;
}

.custos-report-panel p {
    color: #64748b;
    font-size: 0.86rem;
    margin: 0;
}

.custos-report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.custos-readonly-panel,
.custos-admin-readonly {
    height: 100%;
}

.custos-readonly-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
    border: 1px solid #cad8e6;
    border-top: 4px solid #ffb511;
    box-shadow: 0 14px 32px rgba(23, 58, 92, 0.11);
}

.custos-readonly-panel > h2 {
    background: linear-gradient(135deg, #173a5c 0%, #1d5d8f 100%);
    border-left: 6px solid #ffb511;
    border-radius: 9px;
    box-shadow: 0 7px 16px rgba(23, 58, 92, 0.16);
    color: #ffffff;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
    margin-bottom: 14px;
    padding: 11px 14px;
}

.custos-readonly-panel dl {
    display: grid;
    gap: 10px;
}

.custos-readonly-panel dt {
    color: #173a5c;
    font-size: 0.78rem;
    letter-spacing: 0.025em;
    margin: 0 0 -10px;
    padding: 0 12px;
    position: relative;
    text-transform: uppercase;
    z-index: 1;
}

.custos-readonly-panel dd {
    background: linear-gradient(135deg, #f8fbfe 0%, #ffffff 100%);
    border: 1px solid #d7e2ec;
    border-left: 4px solid #1d5d8f;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(23, 58, 92, 0.04);
    color: #203346;
    font-weight: 500;
    margin: 0;
    overflow-wrap: anywhere;
    padding: 21px 12px 10px;
}

.custos-readonly-panel dd:hover {
    background: #fff9e8;
    border-left-color: #ffb511;
}

.custos-readonly-panel .text-muted {
    color: #607286 !important;
}

.custos-readonly-panel > p.text-muted {
    background: #edf5fb;
    border: 1px solid #d2e2ef;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 9px 11px;
}

.custos-section-divider {
    border-color: #b9cad9;
    margin: 22px 0;
    opacity: 1;
}

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

.custos-admin-summary > div {
    background: #ffffff;
    border: 1px solid #d7e2ec;
    border-left: 4px solid #ffb511;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(23, 58, 92, 0.04);
    padding: 11px 12px;
}

.custos-admin-summary span {
    color: #526f87;
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.custos-admin-summary strong {
    color: #173a5c;
    display: block;
    font-weight: 650;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.custos-admin-wide {
    grid-column: 1 / -1;
}

.custos-admin-readonly .form-control:disabled {
    background: #f8fafc;
    color: #334155;
    opacity: 1;
}

.custos-entry-panel,
.custos-items-panel {
    position: relative;
    z-index: 1;
}

.custos-workspace-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
    border: 1px solid #cad8e6;
    border-top: 4px solid #1d5d8f;
    box-shadow: 0 14px 32px rgba(23, 58, 92, 0.12);
    min-width: 0;
}

.custos-workspace-header {
    background:
        linear-gradient(90deg, #ffb511 0, #ffb511 7px, transparent 7px),
        linear-gradient(135deg, #173a5c 0%, #1d5d8f 68%, #286f9f 100%);
    border: 1px solid #173a5c;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(23, 58, 92, 0.2);
    padding: 18px 20px 18px 24px;
}

.custos-workspace-header h2 {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 700;
}

.custos-workspace-header .text-muted {
    color: #dbe9f4 !important;
}

.custos-workspace-table-wrap {
    border: 1px solid #cbd8e5;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(23, 58, 92, 0.07);
    overflow-x: hidden;
}

.custos-total-card {
    align-items: flex-end;
    background: linear-gradient(145deg, #ffffff 0%, #fff4cf 100%);
    border: 1px solid #ffca46;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(8, 31, 51, 0.2);
    display: flex;
    flex-direction: column;
    min-width: 190px;
    padding: 11px 16px;
}

.custos-total-card span,
.custos-preview span {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
}

.custos-total-card strong {
    color: #173a5c;
    font-size: 1.35rem;
}

.custos-entry-form {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns: 160px minmax(260px, 1fr);
}

.custos-material-fields {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-column: 1 / -1;
    grid-template-columns: 150px 145px 155px 145px minmax(210px, 1fr) 145px auto;
}

.custos-hour-fields {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-column: 1 / -1;
    grid-template-columns: 150px 150px minmax(260px, 1fr) 145px auto;
}

.custos-material-fields[hidden],
.custos-hour-fields[hidden],
.custos-entry-form [hidden] {
    display: none !important;
}

.custos-material-observation textarea,
.custos-hour-observation textarea {
    min-height: 58px;
    resize: vertical;
}

.custos-entry-surface {
    background: linear-gradient(145deg, #ffffff 0%, #f2f7fb 100%);
    border: 1px solid #cfdae6;
    border-left: 5px solid #ffb511;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(23, 58, 92, 0.09);
    padding: 18px;
}

.custos-entry-surface .form-label {
    color: #173a5c;
    font-weight: 700;
    margin-bottom: 6px;
}

.custos-entry-surface .form-control,
.custos-entry-surface .form-select {
    background-color: #ffffff;
    border-color: #bdccda;
    color: #203346;
    min-height: 42px;
}

.custos-entry-surface .form-control:focus,
.custos-entry-surface .form-select:focus {
    border-color: #1d5d8f;
    box-shadow: 0 0 0 0.22rem rgba(29, 93, 143, 0.15);
}

.custos-entry-surface .btn {
    min-height: 42px;
}

.custos-entry-surface .custos-form-actions .btn-primary {
    background: linear-gradient(135deg, #1d5d8f 0%, #173a5c 100%);
    border-color: #173a5c;
    box-shadow: 0 7px 16px rgba(23, 58, 92, 0.22);
    font-weight: 700;
    padding-left: 1.15rem;
    padding-right: 1.15rem;
}

.custos-entry-surface .custos-form-actions .btn-primary:hover,
.custos-entry-surface .custos-form-actions .btn-primary:focus {
    background: linear-gradient(135deg, #276f9f 0%, #1d5d8f 100%);
    border-color: #1d5d8f;
    transform: translateY(-1px);
}

.custos-preview {
    background: linear-gradient(145deg, #eef9f4 0%, #ffffff 100%);
    border: 1px solid #a9d7c2;
    border-left: 4px solid #198754;
    border-radius: 9px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 42px;
    padding: 7px 11px;
}

.custos-preview strong,
.custos-grand-total {
    color: #164e35;
}

.custos-grand-total {
    background: #eaf7f0;
    border: 1px solid #b9dfca;
    border-radius: 999px;
    padding: 0.42rem 0.8rem;
}

.custos-items-table {
    margin-bottom: 0;
    table-layout: fixed;
    width: 100%;
}

.custos-items-table thead th {
    background: linear-gradient(180deg, #1d5d8f 0%, #173a5c 100%);
    border-bottom: 3px solid #ffb511;
    color: #ffffff;
    line-height: 1.15;
    overflow-wrap: anywhere;
    padding: 0.7rem 0.35rem;
    text-align: center;
    white-space: normal;
}

.custos-items-table tbody td {
    border-color: #dce5ed;
    overflow-wrap: anywhere;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    text-align: center;
    vertical-align: middle;
    white-space: normal;
}

.custos-items-table tbody tr:nth-child(even) td {
    background: #f4f8fb;
}

.custos-items-table tbody tr:hover td {
    background: #fff7dc;
}

.detalhe-workspace-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
    border: 1px solid #cad8e6;
    border-top: 4px solid #1d5d8f;
    box-shadow: 0 14px 32px rgba(23, 58, 92, 0.12);
}

.detalhe-workspace-header {
    margin-bottom: 18px !important;
}

.detalhe-back-button {
    border: 1px solid #ffca46;
    color: #173a5c;
    font-weight: 700;
    min-width: 88px;
}

.detalhe-back-button:hover,
.detalhe-back-button:focus {
    background: #fff4cf;
    border-color: #ffb511;
    color: #173a5c;
}

.detalhe-entry-surface {
    margin-bottom: 18px;
}

.detalhe-admin-surface {
    background: linear-gradient(145deg, #ffffff 0%, #f2f7fb 100%);
    border: 1px solid #cfdae6;
    border-left: 5px solid #ffb511;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(23, 58, 92, 0.09);
    margin-top: 0;
}

.detalhe-admin-surface > h2 {
    background: linear-gradient(135deg, #173a5c 0%, #1d5d8f 100%);
    border-left: 6px solid #ffb511;
    border-radius: 9px;
    box-shadow: 0 7px 16px rgba(23, 58, 92, 0.16);
    color: #ffffff;
    font-size: 1.05rem;
    margin-bottom: 16px;
    padding: 11px 14px;
}

.received-master-hint {
    margin: -4px 0 12px;
    color: #35536f;
    font-size: 0.78rem;
    font-weight: 600;
}

.received-master-input {
    border-left: 4px solid #1d5d8f;
    background: #ffffff;
    color: #173a5c;
}

textarea.received-master-input {
    min-height: 76px;
    resize: vertical;
}

.detalhe-workspace-panel > .form-actions {
    background: #edf5fb;
    border: 1px solid #cbdbe7;
    border-radius: 10px;
    padding: 12px;
}

.custos-observation-cell {
    max-width: none;
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: left !important;
    white-space: normal;
}

.custos-items-table--editable th:nth-child(1),
.custos-items-table--editable td:nth-child(1) { width: 9%; }
.custos-items-table--editable th:nth-child(2),
.custos-items-table--editable td:nth-child(2) { width: 13%; }
.custos-items-table--editable th:nth-child(3),
.custos-items-table--editable td:nth-child(3) { width: 8%; }
.custos-items-table--editable th:nth-child(4),
.custos-items-table--editable td:nth-child(4) { width: 12%; }
.custos-items-table--editable th:nth-child(5),
.custos-items-table--editable td:nth-child(5) { width: 12%; }
.custos-items-table--editable th:nth-child(6),
.custos-items-table--editable td:nth-child(6) { width: 11%; }
.custos-items-table--editable th:nth-child(7),
.custos-items-table--editable td:nth-child(7) { width: 11%; }
.custos-items-table--editable th:nth-child(8),
.custos-items-table--editable td:nth-child(8) { width: 14%; }
.custos-items-table--editable th:nth-child(9),
.custos-items-table--editable td:nth-child(9) { width: 10%; }

.custos-items-table--readonly th:nth-child(1),
.custos-items-table--readonly td:nth-child(1) { width: 10%; }
.custos-items-table--readonly th:nth-child(2),
.custos-items-table--readonly td:nth-child(2) { width: 15%; }
.custos-items-table--readonly th:nth-child(3),
.custos-items-table--readonly td:nth-child(3) { width: 9%; }
.custos-items-table--readonly th:nth-child(4),
.custos-items-table--readonly td:nth-child(4) { width: 14%; }
.custos-items-table--readonly th:nth-child(5),
.custos-items-table--readonly td:nth-child(5) { width: 13%; }
.custos-items-table--readonly th:nth-child(6),
.custos-items-table--readonly td:nth-child(6) { width: 12%; }
.custos-items-table--readonly th:nth-child(7),
.custos-items-table--readonly td:nth-child(7) { width: 12%; }
.custos-items-table--readonly th:nth-child(8),
.custos-items-table--readonly td:nth-child(8) { width: 15%; }

.custos-items-table .table-actions {
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: center;
}

.custos-items-table .table-actions form {
    max-width: 100%;
}

.custo-type-badge {
    border: 1px solid transparent;
    font-weight: 700;
    padding: 0.38rem 0.62rem;
}

.custo-type-material {
    background: #e8f3ff;
    border-color: #b9d8f5;
    color: #174f7a;
}

.custo-type-hours {
    background: #fff3d6;
    border-color: #efd28d;
    color: #73500a;
}

.custos-items-table .custos-edit-row > td {
    background: #fffaf0;
    padding: 14px;
    text-align: left;
}

.custos-edit-card {
    border: 1px solid #e9c96e;
    border-radius: 8px;
    padding: 16px;
}

.custos-edit-card-heading {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
}

.custos-edit-card-heading h3 {
    font-size: 1rem;
    margin: 0 0 3px;
}

.custos-edit-card-heading p {
    color: #64748b;
    margin: 0;
}

.custos-view-modal .modal-content {
    border: 0;
    border-radius: 12px;
}

.custos-view-modal .modal-body {
    background: #f8fafc;
}

.custos-modal-summary {
    align-items: flex-end;
    background: #fff8e1;
    border: 1px solid #f2cf72;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    margin: 0 0 16px auto;
    max-width: 220px;
    padding: 10px 16px;
}

.custos-modal-summary span {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
}

.custos-modal-summary strong {
    color: #684400;
    font-size: 1.35rem;
}

@media (max-width: 1400px) {
    .custos-entry-form {
        grid-template-columns: repeat(4, minmax(150px, 1fr));
    }

    .custos-item-description {
        grid-column: span 2;
    }

    .custos-material-fields {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }

    .custos-hour-fields {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }

    .custos-material-observation,
    .custos-hour-observation {
        grid-column: 1 / -1;
    }
}

@media (max-width: 992px) {
    :root {
        --navbar-height: 58px;
    }

    .app-container {
        padding: calc(var(--navbar-height) + 18px) 18px 18px;
    }

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

    .navbar-left {
        align-items: flex-start;
    }

    .navbar-page-meta {
        font-size: 0.9rem;
    }

    .app-brand img {
        height: 36px;
    }

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

    .navbar-left {
        flex: 1;
    }

    .app-navbar .navbar-nav {
        align-items: stretch;
        gap: 0;
        padding-top: 10px;
    }

    .custos-filter-grid,
    .custos-detail-grid,
    .custos-entry-form {
        grid-template-columns: 1fr;
    }

    .custos-report-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .custos-report-actions {
        justify-content: flex-start;
    }

    .custos-item-description {
        grid-column: auto;
    }

    .custos-material-fields,
    .custos-hour-fields {
        grid-template-columns: 1fr;
    }

    .custos-material-observation,
    .custos-hour-observation {
        grid-column: auto;
    }

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

    .custos-admin-wide {
        grid-column: auto;
    }

    .donut-wrap {
        align-items: flex-start;
        flex-direction: column;
    }

    .donut-center {
        margin-left: 0;
        margin-top: -124px;
        width: 180px;
    }
}

.chart-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 320px;
}

.chart-card .donut-wrap,
.chart-card .bar-list {
    margin: 0 auto;
    width: 100%;
    max-width: 520px;
}

.donut-wrap {
    justify-content: center;
}

.public-track-panel {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(36, 52, 71, 0.06);
    margin-bottom: 18px;
    padding: 16px;
}

.public-track-panel h2 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.public-track-table {
    max-height: 320px;
    overflow-y: auto;
}

.login-shell {
    min-height: auto;
    padding-bottom: 12px;
}

th.sortable {
    cursor: pointer;
    white-space: nowrap;
}

th.sortable a.sort-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

th.sortable:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.sort-icon {
    font-size: 0.8rem;
    opacity: 0.75;
}

.filtros-container,
.card-filtros,
.filters-card,
.form-filtros,
.filter-panel {
    position: relative;
    z-index: 50;
    overflow: visible !important;
}

.filtros-container .row,
.card-filtros .row,
.filters-card .row,
.form-filtros .row,
.filter-panel .row,
.filtros-grid {
    overflow: visible !important;
}

.filtros-grid { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 18px 16px; align-items: end; }
.filtro-item { display: flex; flex-direction: column; position: relative; overflow: visible; z-index: 1; }
.filtro-resumo-card { grid-column: span 2; align-self: stretch; }
.menu-summary-card {
    height: 100%;
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    padding: 16px 18px;
}
.menu-summary-card h3 {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}
.menu-summary-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}
.menu-summary-card li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e5ebf4;
}
.menu-summary-card span {
    color: #334155;
    font-size: 0.92rem;
}
.menu-summary-card strong {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
    min-width: 2ch;
    text-align: right;
}
.filtro-item:has(.choices.is-open) {
    z-index: 10000 !important;
}
.filtro-item .form-label { margin-bottom: 6px; font-weight: 500; }
.filtro-item .form-select, .filtro-item .form-control { width: 100%; height: 38px; }
.filtro-item .flatpickr-wrapper {
    display: block;
    position: relative;
    width: 100%;
}
.filtro-item .flatpickr-calendar.static {
    left: 0;
    right: auto;
    top: calc(100% + 4px);
    z-index: 2200;
}
.filtro-item .choices { width: 100%; position: relative; z-index: 1; }
.filtro-item:has(.choices.is-open) .choices {
    z-index: 10000 !important;
}
.filtro-item .choices__inner { min-height: 38px; height: 38px; }
.filtro-item .choices__list--dropdown,
.filtro-item .choices__list[aria-expanded] {
    position: absolute;
    z-index: 9999 !important;
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
    opacity: 1 !important;
}
.filtro-item .choices.is-open {
    z-index: 10000 !important;
}
.filtro-item:has(.choices.is-open) .choices__list--dropdown,
.filtro-item:has(.choices.is-open) .choices__list[aria-expanded] {
    z-index: 10000 !important;
}
.filtro-item .choices__list--dropdown .choices__item,
.filtro-item .choices__list[aria-expanded] .choices__item,
.choices__list--dropdown .choices__item,
.choices__list[aria-expanded] .choices__item {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    hyphens: auto;
    line-height: 1.35;
}
.select2-container--open,
.select2-dropdown,
.dropdown-menu,
.choices__list--dropdown,
.choices__list[aria-expanded] {
    z-index: 9999 !important;
}
.choices__list--dropdown,
.choices__list[aria-expanded] {
    overflow: visible !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
}
.choices__list--dropdown .choices__item,
.choices__list[aria-expanded] .choices__item {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    hyphens: auto;
    line-height: 1.35;
}
.filtros-acoes { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.solicitacoes-count {
    margin-right: auto;
    align-self: center;
    color: #173f67;
    font-weight: 700;
    white-space: nowrap;
}

.filtro-item .choices[data-type*="select-one"] .choices__button {
    opacity: .72;
    right: 34px;
}
.filtro-item .choices[data-type*="select-one"] .choices__button:hover,
.filtro-item .choices[data-type*="select-one"] .choices__button:focus {
    opacity: 1;
}
@media (max-width: 1400px) { .filtros-grid { grid-template-columns: repeat(4, minmax(180px, 1fr)); } }
@media (max-width: 900px) { .filtros-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); } }
@media (max-width: 900px) { .filtro-resumo-card { grid-column: 1 / -1; } }
@media (max-width: 600px) { .filtros-grid { grid-template-columns: 1fr; } }

.app-container:has(.panel-selector) {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
    padding: calc(var(--navbar-height) + 32px) 28px 32px;
    position: relative;
}
.app-container:has(.panel-selector)::before {
    background: url("../img/unifei-campus-login.jpg") center / cover no-repeat;
    content: "";
    filter: blur(9px) saturate(0.95);
    inset: -18px;
    position: absolute;
    transform: scale(1.03);
    z-index: -2;
}
.app-container:has(.panel-selector)::after {
    background:
        linear-gradient(135deg, rgba(15, 38, 64, 0.5), rgba(15, 38, 64, 0.18) 44%, rgba(244, 248, 250, 0.48)),
        rgba(244, 247, 250, 0.24);
    content: "";
    inset: 0;
    position: absolute;
    z-index: -1;
}
.panel-selector {
    margin: 0 auto;
    max-width: 1180px;
    position: relative;
    width: 100%;
}
.panel-selector-heading {
    margin: 0 auto 34px;
    max-width: 820px;
    padding: 0 28px;
    text-align: center;
}
.panel-selector-eyebrow {
    color: #eaf7ff;
    display: block;
    font-size: .9rem;
    font-weight: 800;
    letter-spacing: .08em;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(0, 20, 35, 0.72);
    text-transform: uppercase;
}
.panel-selector-heading h1 {
    color: #ffffff;
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    text-shadow: 0 3px 14px rgba(0, 20, 35, 0.78);
}
.panel-selector-heading p {
    color: #f4fbff;
    font-size: 1.12rem;
    font-weight: 700;
    margin: 10px auto 0;
    max-width: 720px;
    text-shadow: 0 2px 8px rgba(0, 20, 35, 0.74);
}
.panel-selector-grid {
    display: grid;
    gap: 28px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.panel-selector-card {
    align-items: center;
    background: #fff;
    border: 1px solid #97b3c7;
    border-left: 7px solid #fdb913;
    border-radius: 16px;
    box-shadow: 0 16px 36px rgba(18, 59, 86, 0.18);
    color: #073b5c;
    display: grid;
    gap: 18px;
    grid-template-columns: auto 1fr auto;
    min-height: 210px;
    padding: 36px;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease;
}
.panel-selector-card[href]:hover {
    box-shadow: 0 18px 42px #123b5630;
    color: #073b5c;
    transform: translateY(-3px);
}
.panel-selector-card strong,
.panel-selector-card small {
    display: block;
}
.panel-selector-card strong { color: #002f4f; font-size: 1.62rem; margin-bottom: 10px; }
.panel-selector-card small { color: #173a54; font-size: 1.06rem; font-weight: 700; line-height: 1.55; }
.panel-selector-card b { font-size: 1.6rem; }
.panel-selector-icon {
    align-items: center;
    background: #e8f2f8;
    border-radius: 50%;
    display: flex;
    font-size: 1.9rem;
    height: 70px;
    justify-content: center;
    width: 70px;
}
.panel-selector-renovation { border-left-color: #086a9f; }
.panel-selector-disabled { background: #f4f6f8; box-shadow: none; opacity: .72; }
@media (min-width: 1200px) {
    .app-container:has(.panel-selector) {
        min-height: 125vh;
    }
}
@media (max-width: 720px) {
    .app-container:has(.panel-selector) {
        padding: calc(var(--navbar-height) + 24px) 16px 24px;
    }
    .panel-selector-grid { grid-template-columns: 1fr; }
    .panel-selector-card { min-height: 145px; padding: 22px; }
}

/* Exportação por período: reserva área para o calendário estático e impede
   que ele fique recortado ou sobreposto ao rodapé do modal. */
#modalExportarOSPeriodo .modal-dialog,
#modalFiltroDataConferencia .modal-dialog {
    max-width: 760px;
}
#modalExportarOSPeriodo .modal-content,
#modalExportarOSPeriodo form,
#modalFiltroDataConferencia .modal-content,
#modalFiltroDataConferencia form {
    overflow: visible;
}
#modalExportarOSPeriodo .modal-body,
#modalFiltroDataConferencia .modal-body {
    min-height: 390px;
}
#modalExportarOSPeriodo .flatpickr-wrapper,
#modalFiltroDataConferencia .flatpickr-wrapper {
    display: block;
    position: relative;
    width: 100%;
}
#modalExportarOSPeriodo .flatpickr-calendar.static,
#modalFiltroDataConferencia .flatpickr-calendar.static {
    left: 0;
    right: auto;
    top: calc(100% + 6px);
    z-index: 2200;
}
@media (max-width: 767px) {
    #modalExportarOSPeriodo .modal-dialog,
    #modalFiltroDataConferencia .modal-dialog {
        margin-left: auto;
        margin-right: auto;
        max-width: calc(100% - 24px);
    }
    #modalExportarOSPeriodo .modal-body,
    #modalFiltroDataConferencia .modal-body {
        min-height: 470px;
    }
}

/* Dashboard: mantém o resumo à direita e leva os quatro filtros de
   identificação/período para a faixa livre à esquerda. */
@media (min-width: 1200px) {
    .dashboard-filter-panel .filtros-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .dashboard-filter-panel [data-filter-key="status"] { grid-column: 1; grid-row: 1; }
    .dashboard-filter-panel [data-filter-key="local"] { grid-column: 2; grid-row: 1; }
    .dashboard-filter-panel [data-filter-key="solicitante"] { grid-column: 3; grid-row: 1; }
    .dashboard-filter-panel [data-filter-key="categoria"] { grid-column: 4; grid-row: 1; }

    .dashboard-filter-panel [data-filter-key="tipo_ocorrencia"] { grid-column: 1; grid-row: 2; }
    .dashboard-filter-panel [data-filter-key="prioridade"] { grid-column: 2; grid-row: 2; }
    .dashboard-filter-panel [data-filter-key="unidade"] { grid-column: 3; grid-row: 2; }
    .dashboard-filter-panel [data-filter-key="numero_os"] { grid-column: 4; grid-row: 2; }

    .dashboard-filter-panel [data-filter-key="data_solicitacao_de"] { grid-column: 1; grid-row: 3; }
    .dashboard-filter-panel [data-filter-key="data_solicitacao_ate"] { grid-column: 2; grid-row: 3; }
    .dashboard-filter-panel [data-filter-key="data_inicio_execucao_de"] { grid-column: 3; grid-row: 3; }
    .dashboard-filter-panel [data-filter-key="data_inicio_execucao_ate"] { grid-column: 4; grid-row: 3; }

    .dashboard-filter-panel [data-filter-key="data_fim_execucao_de"] { grid-column: 1; grid-row: 4; }
    .dashboard-filter-panel [data-filter-key="data_fim_execucao_ate"] { grid-column: 2; grid-row: 4; }

    .dashboard-filter-panel .filtros-grid > .filtro-resumo-card {
        grid-column: 5 / 7;
        grid-row: 1 / 5;
    }
}

.urgent-overview-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 3fr);
}

.urgent-overview-pane {
    min-height: 88px;
    min-width: 0;
}

.overview-pane-header {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 8px;
    min-height: 30px;
}

.overview-pane-title {
    color: #334155;
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
}

.overview-list-button {
    background: #ffffff;
    border: 1px solid #94a3b8;
    color: #334155;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 5px 9px;
    white-space: nowrap;
}

.overview-list-button:hover,
.overview-list-button:focus-visible {
    background: #e2e8f0;
    border-color: #64748b;
    color: #0f172a;
}

.alert-list-modal-grid {
    align-items: stretch;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.alert-list-modal .modal-content,
.alert-list-modal .modal-body,
.alert-list-modal .modal-footer { background: #fff; }
.alert-list-modal .modal-header { background: #174f7d; color: #fff; }
.alert-list-modal .modal-header .text-muted { color: #dbeafe !important; }
.alert-modal-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.alert-modal-counts span { background: #0b3558; border: 1px solid #75b8e8; border-radius: 999px; color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 8px; }
.planning-modal-summary {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 9px;
    width: min(100%, 1120px);
}
.planning-summary-block {
    background: rgba(7, 45, 77, .55);
    border: 1px solid rgba(147, 197, 253, .65);
    border-radius: 9px;
    padding: 8px 10px;
}
.planning-summary-block > strong { display: block; font-size: .8rem; }
.planning-summary-block .alert-modal-counts { margin-top: 5px; }
.planning-card-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 6px;
}
.planning-legend-item {
    align-items: center;
    background: #fff;
    border: 1px solid #bad1e5;
    border-radius: 7px;
    color: #17324d;
    display: inline-flex;
    font-size: .72rem;
    gap: 6px;
    padding: 4px 9px;
}
.planning-legend-item strong { margin-left: 2px; }
.planning-legend-swatch {
    border: 1px solid rgba(15, 23, 42, .25);
    border-left-width: 5px;
    border-radius: 4px;
    display: inline-block;
    height: 18px;
    width: 28px;
}
.planning-legend-planned { background: #f2efff; border-color: #6550b7; }
.planning-legend-analysis { background: #eef6ff; border-color: #2f6eaf; }
@media (max-width: 760px) {
    .planning-modal-summary { grid-template-columns: 1fr; }
}

/* O zoom de 80% do desktop reduz o backdrop nativo do Bootstrap.
   Compensamos a escala para que a camada escura cubra toda a viewport. */
@media (min-width: 1200px) {
    .modal-backdrop {
        height: 125vh;
        width: 125vw;
    }
}

.alert-list-modal-grid .urgent-card,
.alert-list-modal-grid .deadline-card,
.alert-list-modal-grid .planning-card {
    height: 100%;
}

.alert-list-modal-grid .urgent-card {
    animation: none;
}

.urgent-cards,
.deadline-cards,
.planning-cards {
    align-content: start;
    display: grid;
    gap: 10px;
    grid-auto-rows: 104px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    max-height: 104px;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 5px;
    scrollbar-gutter: stable;
}

.urgent-alerts-pane .urgent-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.deadline-alerts-pane .deadline-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.planning-alerts-pane .planning-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.planning-card {
    align-items: flex-start;
    background: #eef6ff;
    border: 2px solid #78a9df;
    border-left: 8px solid #2f6eaf;
    border-radius: 8px;
    color: #173d66;
    display: flex;
    gap: 6px;
    font-size: 0.74rem;
    min-height: 104px;
    padding: 8px 9px;
    text-decoration: none;
}

.planning-card:hover {
    box-shadow: 0 8px 18px rgba(47, 110, 175, 0.22);
    color: #173d66;
    text-decoration: none;
}

.planning-alert-icon {
    font-size: 1rem;
    line-height: 1;
    min-width: 18px;
}

.planning-content { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.planning-os { font-size: 0.82rem; line-height: 1.1; margin-bottom: 2px; }
.planning-kind { font-weight: 700; line-height: 1.1; margin-bottom: 2px; }
.planning-line { line-height: 1.1; margin: 1px 0; }

.planning-card.planning-planned {
    background: #f2efff;
    border-color: #9685dc;
    border-left-color: #6550b7;
    color: #3d2e78;
}

.planning-card.planning-empty {
    background: #f7fafc;
    border: 1px solid #93a4b6;
    border-left: 4px solid #93a4b6;
    color: #4b6074;
}

.deadline-card {
    align-items: flex-start;
    background: #fff8db;
    border: 2px solid #e4b63f;
    border-left: 8px solid #c88c00;
    border-radius: 8px;
    color: #493400;
    display: flex;
    gap: 6px;
    font-size: 0.72rem;
    min-height: 104px;
    padding: 8px 9px;
    text-decoration: none;
}

.deadline-card:hover {
    box-shadow: 0 8px 18px rgba(154, 102, 0, 0.22);
    color: #493400;
    text-decoration: none;
}

.deadline-alert-icon {
    font-size: 1rem;
    line-height: 1;
    min-width: 18px;
}

.deadline-content { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.deadline-os { font-size: 0.82rem; line-height: 1.1; margin-bottom: 2px; }
.deadline-line { line-height: 1.1; margin: 1px 0; }
.deadline-state { font-weight: 700; line-height: 1.1; margin-top: 2px; }

.deadline-card.deadline-overdue {
    background: #f97316;
    border-color: #c2410c;
    border-left-color: #9a3412;
    color: #ffffff;
}

.deadline-card.deadline-overdue:hover {
    background: #ea580c;
    color: #ffffff;
}

.deadline-card.deadline-today {
    background: #fff3cd;
    border-color: #e0a800;
    border-left-color: #a87400;
}

.deadline-card.deadline-upcoming {
    background: #fffbea;
    border-color: #e4c961;
    border-left-color: #b89920;
}

.deadline-card.deadline-empty {
    background: #f7fafc;
    border: 1px solid #93a4b6;
    border-left: 4px solid #93a4b6;
    color: #4b6074;
}
.urgent-card {
    align-items: flex-start;
    background: #fff;
    border: 2px solid #d04a4a;
    border-left: 8px solid #b91c1c;
    border-radius: 8px;
    color: #ffffff;
    display: flex;
    gap: 7px;
    font-size: 0.76rem;
    min-height: 104px;
    padding: 8px 9px;
    text-decoration: none;
}
.urgent-card:hover { text-decoration: none; box-shadow: 0 8px 18px rgba(185, 28, 28, 0.28); }
.urgent-alert-icon {
    align-items: center;
    display: inline-flex;
    font-size: 1.05rem;
    line-height: 1;
    min-width: 18px;
}
.urgent-content { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.urgent-os { font-size: 0.84rem; line-height: 1.1; margin-bottom: 2px; }
.urgent-line { line-height: 1.1; margin: 1px 0; }
.urgent-card.urgent-danger {
    animation: urgent-pulse 1.2s ease-in-out infinite;
    background: linear-gradient(135deg, #ff2424, #d40000);
    border-color: #940000;
    border-left-color: #7a0000;
}
.urgent-card.urgent-warning {
    animation: urgent-pulse-soft 1.8s ease-in-out infinite;
    background: linear-gradient(135deg, #ff5757, #e01b1b);
    border-color: #ab1111;
    border-left-color: #8f0d0d;
}
.urgent-card.urgent-medium {
    background: linear-gradient(135deg, #ff7878, #d44a4a);
    border-color: #b73030;
    border-left-color: #992424;
}
.urgent-card.urgent-empty {
    border: 1px solid #93a4b6;
    border-left: 4px solid #93a4b6;
    background: #f7fafc;
    color: #4b6074;
}

@media (max-width: 1400px) {
    .urgent-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .planning-alerts-pane {
        grid-column: 1 / -1;
    }

    .urgent-alerts-pane .urgent-cards,
    .deadline-alerts-pane .deadline-cards,
    .planning-alerts-pane .planning-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .urgent-overview-grid {
        grid-template-columns: 1fr;
    }

    .planning-alerts-pane {
        grid-column: auto;
    }

    .urgent-alerts-pane .urgent-cards,
    .deadline-alerts-pane .deadline-cards,
    .planning-alerts-pane .planning-cards {
        grid-template-columns: 1fr;
    }
}

/* Destaque visual consistente para ordens concluídas. */
.app-table tbody tr.status-row-concluido:nth-child(n) > * {
    background: #e2f5e8 !important;
    border-color: #c1e5cc;
    color: #164e2d;
}

.app-table tbody tr.status-row-concluido:nth-child(n):hover > * {
    background: #d3eedc !important;
}

.app-table tbody tr.status-row-recusado:nth-child(n) > * {
    background: #ffe6e6 !important;
    border-color: #efb1b1;
    color: #8f1d1d;
}

.app-table tbody tr.status-row-recusado:nth-child(n):hover > * {
    background: #ffd7d7 !important;
}

.app-table tbody tr.status-row-devolvido:nth-child(n) > * {
    background: #e5e7eb !important;
    border-color: #c5cad1;
    color: #303846;
}

.app-table tbody tr.status-row-devolvido:nth-child(n):hover > * {
    background: #d7dbe0 !important;
}

.app-table tbody tr.status-row-duplicado:nth-child(n) > * {
    background: #fff7cf !important;
    border-color: #ead78d;
    color: #6f5a00;
}

.app-table tbody tr.status-row-duplicado:nth-child(n):hover > * {
    background: #fff1b8 !important;
}

.detail-layout-concluido .custos-readonly-panel,
.detail-layout-concluido .custos-workspace-panel {
    background: linear-gradient(180deg, #f8fff9 0%, #eaf7ee 100%);
    border-color: #8dcba0;
    border-top-color: #238449;
    box-shadow: 0 14px 32px rgba(30, 116, 65, 0.14);
}

.detail-layout-concluido .custos-readonly-panel > h2,
.detail-layout-concluido .custos-workspace-header,
.detail-layout-concluido .detalhe-admin-surface > h2 {
    background:
        linear-gradient(90deg, #ffb511 0, #ffb511 7px, transparent 7px),
        linear-gradient(135deg, #14532d 0%, #1f7a43 68%, #2e9657 100%);
    border-color: #14532d;
    color: #ffffff;
    box-shadow: 0 9px 22px rgba(20, 83, 45, 0.2);
}

.detail-layout-concluido .custos-readonly-panel dd,
.detail-layout-concluido .detalhe-entry-surface,
.detail-layout-concluido .detalhe-admin-surface,
.detail-layout-concluido .detalhe-workspace-panel > .form-actions {
    background: linear-gradient(145deg, #ffffff 0%, #effaf2 100%);
    border-color: #b9dec4;
}

.detail-layout-concluido .custos-readonly-panel dd {
    border-left-color: #238449;
}

.detail-layout-concluido .custos-readonly-panel dt,
.detail-layout-concluido .detalhe-admin-surface .form-label {
    color: #14532d;
}

@keyframes urgent-pulse {
    0% { box-shadow: 0 0 0 rgba(185, 28, 28, 0.2); filter: brightness(1); }
    50% { box-shadow: 0 0 18px rgba(255, 0, 0, 0.45); filter: brightness(1.08); }
    100% { box-shadow: 0 0 0 rgba(185, 28, 28, 0.2); filter: brightness(1); }
}

@keyframes urgent-pulse-soft {
    0% { opacity: 1; box-shadow: 0 0 0 rgba(185, 28, 28, 0.14); }
    50% { opacity: 0.9; box-shadow: 0 0 12px rgba(255, 59, 59, 0.3); }
    100% { opacity: 1; box-shadow: 0 0 0 rgba(185, 28, 28, 0.14); }
}

/* Identidade visual compartilhada */
:root {
    --app-navy: #173a5c;
    --app-navy-deep: #102f4b;
    --app-blue: #1d5d8f;
    --app-blue-soft: #edf5fb;
    --app-gold: #ffb511;
    --app-gold-soft: #fff7dc;
    --app-border: #cad8e6;
    --app-bg: #eef3f7;
    --app-text: #203346;
    --app-shadow: 0 12px 28px rgba(23, 58, 92, 0.09);
}

body {
    background:
        radial-gradient(circle at 8% 4%, rgba(255, 181, 17, 0.08), transparent 22rem),
        linear-gradient(180deg, #f4f7fa 0%, #edf3f7 100%);
}

.app-container .card,
.filter-panel,
.metric-card,
.chart-card,
.app-table-wrap,
.info-panel:not(.custos-readonly-panel),
.edit-panel:not(.custos-workspace-panel) {
    border: 1px solid var(--app-border);
    border-radius: 12px;
    box-shadow: var(--app-shadow);
}

.filter-panel {
    background: linear-gradient(145deg, #ffffff 0%, #f7fafc 100%);
    border-left: 5px solid var(--app-gold);
    border-top: 3px solid var(--app-blue);
    padding: 20px;
}

.filter-panel h2 {
    align-items: center;
    color: var(--app-navy);
    display: flex;
    font-weight: 750;
    gap: 8px;
}

.filter-panel h2::before,
.chart-card h2::before {
    background: var(--app-gold);
    border-radius: 999px;
    content: "";
    display: inline-block;
    height: 0.78em;
    width: 4px;
}

.app-container .form-label {
    color: var(--app-navy);
    font-weight: 700;
}

.app-container .form-control,
.app-container .form-select,
.app-container .choices__inner {
    background-color: #ffffff;
    border-color: #bdccda;
    border-radius: 8px;
    color: #203346;
    min-height: 42px;
}

.app-container .form-control:focus,
.app-container .form-select:focus,
.app-container .choices.is-focused .choices__inner,
.app-container .choices.is-open .choices__inner {
    border-color: var(--app-blue);
    box-shadow: 0 0 0 0.22rem rgba(29, 93, 143, 0.15);
}

.app-container .form-control:disabled,
.app-container .form-select:disabled,
.app-container .form-control[readonly] {
    background: #f2f6f9;
    color: #4d6478;
    opacity: 1;
}

/* O ADM Externo consulta os campos bloqueados com a mesma legibilidade dos demais dados. */
.adm-externo-detail .form-control:disabled,
.adm-externo-detail .form-select:disabled,
.adm-externo-detail .form-control[readonly],
.adm-externo-detail .choices.is-disabled .choices__inner,
.adm-externo-detail .choices.is-disabled .choices__item {
    background-color: #ffffff !important;
    color: #000000 !important;
    -webkit-text-fill-color: #000000;
    opacity: 1 !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--app-blue) 0%, var(--app-navy) 100%);
    border-color: var(--app-navy);
    box-shadow: 0 5px 12px rgba(23, 58, 92, 0.16);
    font-weight: 650;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #2875a7 0%, var(--app-blue) 100%);
    border-color: var(--app-blue);
}

.btn-outline-primary {
    border-color: var(--app-blue);
    color: var(--app-blue);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--app-blue);
    border-color: var(--app-blue);
    color: #ffffff;
}

.btn-outline-secondary {
    border-color: #8297aa;
    color: #4d6275;
}

.app-table-wrap,
.table-scroll {
    background: #ffffff;
    border-color: #c6d5e2;
    border-radius: 11px;
    box-shadow: 0 9px 22px rgba(23, 58, 92, 0.07);
}

.table-scroll thead th,
.app-table thead th {
    background: linear-gradient(180deg, var(--app-blue) 0%, var(--app-navy) 100%) !important;
    border-bottom: 3px solid var(--app-gold) !important;
    color: #ffffff;
    font-weight: 700;
}

.app-table thead th a.sort-link,
.app-table thead th a.sort-link:hover,
.app-table thead th a.sort-link:focus,
.app-table thead th .sort-icon {
    color: #ffffff;
}

.app-table tbody tr:nth-child(odd) > *,
.consulta-table tbody tr:nth-child(odd) > * {
    background-color: #ffffff !important;
}

.app-table tbody tr:nth-child(even) > *,
.consulta-table tbody tr:nth-child(even) > * {
    background-color: #f3f7fa !important;
}

.app-table tbody tr:hover > *,
.consulta-table tbody tr:hover > * {
    background-color: var(--app-gold-soft) !important;
}

.metric-card {
    background:
        linear-gradient(90deg, var(--app-gold) 0, var(--app-gold) 5px, transparent 5px),
        linear-gradient(145deg, #ffffff 0%, #f2f7fb 100%);
    border-top: 3px solid var(--app-blue);
    overflow: hidden;
    padding-left: 20px;
}

.metric-card span {
    color: #526f87;
    font-weight: 700;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.metric-card strong {
    color: var(--app-navy);
}

.chart-card {
    background: linear-gradient(145deg, #ffffff 0%, #f7fafc 100%);
    border-top: 4px solid var(--app-blue);
    min-height: 100%;
    padding: 20px;
}

.chart-card h2 {
    align-items: center;
    color: var(--app-navy);
    display: flex;
    font-weight: 750;
    gap: 8px;
}

.bar-track {
    background: #dce7ef;
    height: 14px;
}

.bar-fill {
    background: linear-gradient(90deg, var(--app-gold), var(--app-blue));
    border-radius: inherit;
}

.info-panel:not(.custos-readonly-panel),
.edit-panel:not(.custos-workspace-panel) {
    background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
    border-top: 4px solid var(--app-blue);
}

.edit-panel:not(.custos-workspace-panel) {
    border-left: 5px solid var(--app-gold);
}

.info-panel:not(.custos-readonly-panel) h2,
.edit-panel:not(.custos-workspace-panel) > h2 {
    color: var(--app-navy);
    font-weight: 750;
}

.info-panel:not(.custos-readonly-panel) dd {
    color: #203346;
}

.info-panel:not(.custos-readonly-panel) dd a,
.info-panel:not(.custos-readonly-panel) dd strong,
.info-panel:not(.custos-readonly-panel) dd span {
    color: var(--app-blue);
}

.editable-requester-panel {
    background: linear-gradient(145deg, #fffaf0 0%, #ffffff 100%);
    border-color: #e8cf91;
    border-left: 5px solid var(--app-gold);
    box-shadow: var(--app-shadow);
}

.admin-fields-panel {
    border-top: 4px solid var(--app-blue);
    box-shadow: var(--app-shadow);
}

.priority-summary {
    background: linear-gradient(135deg, #edf5fb 0%, #fff9e6 100%);
    border: 1px solid #cbdbe7;
    border-left: 5px solid var(--app-gold);
}

.app-container .card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fbfd 100%);
    border-top: 4px solid var(--app-blue) !important;
}

.app-container .card-header {
    background: linear-gradient(135deg, var(--app-navy) 0%, var(--app-blue) 100%) !important;
    border-bottom: 3px solid var(--app-gold);
    color: #ffffff;
}

.app-container .card-header .text-muted,
.app-container .card-header p {
    color: #dceaf4 !important;
}

.modal-content {
    border: 1px solid #bfcfdd;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(16, 47, 75, 0.22);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--app-navy) 0%, var(--app-blue) 100%);
    border-bottom: 3px solid var(--app-gold);
    color: #ffffff;
}

.modal-header .text-muted {
    color: #dceaf4 !important;
}

.modal-header .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
}

.alert {
    border: 0;
    border-left: 5px solid currentColor;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(23, 58, 92, 0.08);
}

.app-body:has(.login-shell) .app-navbar {
    display: none;
}

.app-container:has(.login-shell) {
    padding: 0;
}

.login-shell {
    box-sizing: border-box;
    isolation: isolate;
    min-height: 100vh;
    overflow: hidden;
    padding: clamp(32px, 5vw, 64px) 24px;
    position: relative;
}

.login-shell::before {
    background: url("../img/unifei-campus-login.jpg") center / cover no-repeat;
    content: "";
    filter: blur(4px) saturate(1);
    inset: -8px;
    position: absolute;
    transform: scale(1.015);
    z-index: -2;
}

.login-shell::after {
    background:
        linear-gradient(135deg, rgba(15, 38, 64, 0.5), rgba(15, 38, 64, 0.18) 44%, rgba(244, 248, 250, 0.48)),
        rgba(244, 247, 250, 0.24);
    content: "";
    inset: 0;
    position: absolute;
    z-index: -1;
}

.login-panel {
    background:
        linear-gradient(90deg, rgba(254, 177, 3, 0.96) 0, rgba(254, 177, 3, 0.96) 8px, transparent 8px),
        linear-gradient(145deg, rgba(255, 255, 255, 0.94) 0%, rgba(245, 250, 253, 0.9) 100%);
    border: 1px solid rgba(195, 211, 224, 0.9);
    border-top: 6px solid var(--app-blue);
    border-radius: 16px;
    box-shadow: 0 28px 70px rgba(9, 25, 43, 0.28);
    max-width: 760px;
    padding: clamp(46px, 4.8vw, 64px);
    position: relative;
    width: min(100%, 760px);
}

.login-panel::before {
    background: url("../img/simbolo_RGB.png") center / contain no-repeat;
    content: "";
    display: block;
    height: 112px;
    margin: 0 auto 26px;
    width: 112px;
}

.login-panel h1 {
    color: var(--app-navy);
    font-size: clamp(1.8rem, 2vw, 2.2rem);
    font-weight: 800;
    margin-bottom: 18px;
    text-align: center;
}

.login-panel .text-muted {
    font-size: 1.02rem;
}

.login-panel .btn {
    align-items: center;
    display: inline-flex;
    font-size: 1rem;
    font-weight: 800;
    justify-content: center;
    min-height: 48px;
}

.login-panel .form-control {
    min-height: 46px;
}

@media (min-width: 1200px) {
    .login-shell {
        min-height: 125vh;
    }
}

@media (max-width: 575.98px) {
    .login-shell {
        padding: 28px 16px;
    }

    .login-panel {
        border-radius: 12px;
        padding: 30px 24px;
    }
}

.admin-dropdown {
    border: 1px solid #c4d3e0;
    border-top: 4px solid var(--app-gold);
    border-radius: 10px;
    box-shadow: 0 16px 34px rgba(23, 58, 92, 0.16);
    padding: 8px;
}

.admin-dropdown .dropdown-item {
    border-radius: 7px;
    color: var(--app-navy);
    padding: 8px 11px;
}

.admin-dropdown .dropdown-item:hover,
.admin-dropdown .dropdown-item:focus {
    background: var(--app-blue-soft);
    color: var(--app-blue);
}

.app-loading-card {
    border: 1px solid #c3d3e0;
    border-top: 5px solid var(--app-blue);
    box-shadow: 0 22px 54px rgba(16, 47, 75, 0.2);
}

.detail-layout-concluido .edit-panel.detalhe-admin-surface > h2 {
    background:
        linear-gradient(90deg, #ffb511 0, #ffb511 7px, transparent 7px),
        linear-gradient(135deg, #14532d 0%, #1f7a43 68%, #2e9657 100%);
    border-color: #14532d;
    color: #ffffff;
}

.detail-layout-recusado .custos-readonly-panel,
.detail-layout-recusado .custos-workspace-panel {
    background: linear-gradient(180deg, #fff8f8 0%, #fdecec 100%);
    border-color: #e3a8a8;
    border-top-color: #b42323;
    box-shadow: 0 14px 32px rgba(180, 35, 35, 0.14);
}

.detail-layout-recusado .custos-readonly-panel > h2,
.detail-layout-recusado .custos-workspace-header,
.detail-layout-recusado .detalhe-admin-surface > h2,
.detail-layout-recusado .edit-panel.detalhe-admin-surface > h2 {
    background:
        linear-gradient(90deg, #ffb511 0, #ffb511 7px, transparent 7px),
        linear-gradient(135deg, #8f1d1d 0%, #b42323 68%, #cf3b3b 100%);
    border-color: #8f1d1d;
    color: #ffffff;
    box-shadow: 0 9px 22px rgba(143, 29, 29, 0.2);
}

.detail-layout-recusado .custos-readonly-panel dd,
.detail-layout-recusado .detalhe-entry-surface,
.detail-layout-recusado .detalhe-admin-surface,
.detail-layout-recusado .detalhe-workspace-panel > .form-actions {
    background: linear-gradient(145deg, #ffffff 0%, #fff2f2 100%);
    border-color: #e8c1c1;
}

.detail-layout-recusado .custos-readonly-panel dd {
    border-left-color: #b42323;
}

.detail-layout-recusado .custos-readonly-panel dt,
.detail-layout-recusado .detalhe-admin-surface .form-label {
    color: #8f1d1d;
}

.detail-layout-devolvido .custos-readonly-panel,
.detail-layout-devolvido .custos-workspace-panel {
    background: linear-gradient(180deg, #f5f6f7 0%, #e5e7eb 100%);
    border-color: #9ca3af;
    border-top-color: #4b5563;
    box-shadow: 0 14px 32px rgba(55, 65, 81, 0.14);
}

.detail-layout-devolvido .custos-readonly-panel > h2,
.detail-layout-devolvido .custos-workspace-header,
.detail-layout-devolvido .detalhe-admin-surface > h2,
.detail-layout-devolvido .edit-panel.detalhe-admin-surface > h2 {
    background:
        linear-gradient(90deg, #ffb511 0, #ffb511 7px, transparent 7px),
        linear-gradient(135deg, #374151 0%, #4b5563 68%, #6b7280 100%);
    border-color: #374151;
    color: #ffffff;
    box-shadow: 0 9px 22px rgba(55, 65, 81, 0.2);
}

.detail-layout-devolvido .custos-readonly-panel dd,
.detail-layout-devolvido .detalhe-entry-surface,
.detail-layout-devolvido .detalhe-admin-surface,
.detail-layout-devolvido .detalhe-workspace-panel > .form-actions {
    background: linear-gradient(145deg, #ffffff 0%, #f3f4f6 100%);
    border-color: #c5c9d0;
}

.detail-layout-devolvido .custos-readonly-panel dd {
    border-left-color: #4b5563;
}

.detail-layout-devolvido .custos-readonly-panel dt,
.detail-layout-devolvido .detalhe-admin-surface .form-label {
    color: #374151;
}

.detail-layout-duplicado .custos-readonly-panel,
.detail-layout-duplicado .custos-workspace-panel {
    background: linear-gradient(180deg, #fffef7 0%, #fff7df 100%);
    border-color: #e5d18a;
    border-top-color: #b58b00;
    box-shadow: 0 14px 32px rgba(181, 139, 0, 0.14);
}

.detail-layout-duplicado .custos-readonly-panel > h2,
.detail-layout-duplicado .custos-workspace-header,
.detail-layout-duplicado .detalhe-admin-surface > h2,
.detail-layout-duplicado .edit-panel.detalhe-admin-surface > h2 {
    background:
        linear-gradient(90deg, #ffb511 0, #ffb511 7px, transparent 7px),
        linear-gradient(135deg, #8a6500 0%, #b58b00 68%, #d2a31a 100%);
    border-color: #8a6500;
    color: #ffffff;
    box-shadow: 0 9px 22px rgba(138, 101, 0, 0.2);
}

.detail-layout-duplicado .custos-readonly-panel dd,
.detail-layout-duplicado .detalhe-entry-surface,
.detail-layout-duplicado .detalhe-admin-surface,
.detail-layout-duplicado .detalhe-workspace-panel > .form-actions {
    background: linear-gradient(145deg, #ffffff 0%, #fff9e8 100%);
    border-color: #ead9a1;
}

.detail-layout-duplicado .custos-readonly-panel dd {
    border-left-color: #b58b00;
}

.detail-layout-duplicado .custos-readonly-panel dt,
.detail-layout-duplicado .detalhe-admin-surface .form-label {
    color: #8a6500;
}

.priority-checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.priority-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #c7d6ea;
    border-radius: 12px;
    background: #f8fbff;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #183153;
    font-weight: 600;
}

.priority-checkbox-item:hover {
    border-color: #2a5f92;
    background: #eef5fd;
}

.priority-checkbox-item .form-check-input {
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.priority-checkbox-item:has(.form-check-input:checked) {
    border-color: #2a5f92;
    background: #e7f1fb;
    box-shadow: 0 8px 18px rgba(42, 95, 146, 0.12);
}

textarea.observacao-automatica-ativa,
textarea.observacao-automatica-ativa:disabled {
    color: #b42318 !important;
    font-weight: 600;
    -webkit-text-fill-color: #b42318;
}

@media (max-width: 768px) {
    .filter-panel {
        padding: 16px;
    }

    .login-panel {
        padding: 26px 22px;
    }
}
/* Dashboard, consultas e relatórios de manutenção */
.analytics-page { --analytics-blue:#0d4f7d; --analytics-ink:#12324b; --analytics-line:#d7e3ec; --analytics-bg:#f5f9fc; color:var(--analytics-ink); display:grid; gap:18px; }
.analytics-page,.analytics-page>*,.analytics-filter-grid>*,.analytics-more-grid>*,.kpi-grid>*,.analytics-grid>* { max-width:100%; min-width:0; }
.analytics-heading p { overflow-wrap:anywhere; }
.analytics-heading { align-items:flex-end; display:flex; justify-content:space-between; gap:20px; }
.analytics-heading h1 { font-size:clamp(1.45rem,2.2vw,2.15rem); font-weight:700; margin:.15rem 0; }
.analytics-heading p,.data-note { color:#63788b; margin:0; }
.eyebrow { color:#28668e; font-size:.72rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
.analytics-heading-actions,.filter-buttons,.consultation-actions { display:flex; flex-wrap:wrap; gap:8px; }
.analytics-filter,.analytics-card,.executive-summary,.report-group { background:#fff; border:1px solid var(--analytics-line); border-radius:14px; box-shadow:0 7px 22px rgba(34,74,104,.07); padding:16px; }
.quick-filters { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:14px; }
.quick-filter { background:#edf4f8; border:1px solid transparent; border-radius:999px; color:#254b67; cursor:pointer; font-size:.78rem; font-weight:600; padding:6px 11px; text-decoration:none; }
.quick-filter:hover,.quick-filter.active { background:#d8ebf7; border-color:#7cb0d2; color:#073d63; }
.quick-filter-danger { color:#9e2929; }
.analytics-filter-grid { display:grid; gap:12px; grid-template-columns:repeat(6,minmax(0,1fr)); }
.analytics-filter label,.analytics-more-filters label,.consultation-search label { color:#244963; display:grid; font-size:.76rem; font-weight:700; gap:5px; }
.analytics-filter input,.analytics-filter select,.card-heading select,.custom-report input,.custom-report select { background:#fff; border:1px solid #bed0de; border-radius:8px; color:#183b54; min-height:38px; padding:7px 9px; width:100%; }
.analytics-more-filters { grid-column:1/-1; }
.analytics-more-filters summary { color:#145a86; cursor:pointer; font-size:.8rem; font-weight:700; }
.analytics-more-grid { display:grid; gap:12px; grid-template-columns:repeat(4,minmax(0,1fr)); padding-top:12px; }
.analytics-filter-footer { align-items:center; border-top:1px solid #edf2f6; display:flex; justify-content:space-between; gap:12px; margin-top:14px; padding-top:12px; }
.active-filter-chips { display:flex; flex-wrap:wrap; gap:6px; }
.active-filter-chips span { align-items:center; background:#e9f3fa; border:1px solid #c5ddec; border-radius:999px; display:inline-flex; font-size:.72rem; gap:4px; padding:5px 8px; }
.active-filter-chips button { background:none; border:0; color:#5e7180; cursor:pointer; font-size:1rem; line-height:1; }
.analytics-tabs { background:#eaf2f7; border-radius:10px; display:flex; gap:4px; overflow:auto; padding:4px; }
.analytics-tabs button { background:transparent; border:0; border-radius:8px; color:#496274; font-size:.82rem; font-weight:600; padding:8px 14px; white-space:nowrap; }
.analytics-tabs button.active { background:#fff; box-shadow:0 2px 8px rgba(22,64,93,.12); color:#0e4d78; }
.dashboard-panel { display:grid; gap:16px; }
.kpi-grid { display:grid; gap:12px; grid-template-columns:repeat(8,minmax(0,1fr)); }
.kpi-card { background:#fff; border:1px solid var(--analytics-line); border-left:4px solid #f9b400; border-radius:12px; color:inherit; display:flex; flex-direction:column; min-height:126px; padding:14px; text-decoration:none; }
.kpi-card:hover { border-color:#77a9ca; box-shadow:0 8px 20px rgba(23,75,109,.12); color:inherit; transform:translateY(-1px); }
.kpi-card span { font-size:.7rem; font-weight:700; letter-spacing:.03em; text-transform:uppercase; }
.kpi-card span i { border:1px solid #9bb2c2; border-radius:50%; display:inline-grid; font-size:.62rem; font-style:normal; height:16px; place-items:center; width:16px; }
.kpi-card strong { color:#0b4269; font-size:clamp(1.35rem,2vw,2rem); margin:8px 0 5px; }
.kpi-card small { color:#6a7e8d; font-size:.65rem; line-height:1.25; }
.analytics-grid { display:grid; gap:14px; grid-template-columns:repeat(2,minmax(0,1fr)); }
.analytics-grid-wide { grid-template-columns:repeat(2,minmax(0,1fr)); }
.chart-span-2 { grid-column:1/-1; }
.card-heading { align-items:center; display:flex; justify-content:space-between; gap:12px; margin-bottom:14px; }
.card-heading h2 { font-size:1rem; font-weight:700; margin:0; }
.line-chart { min-height:250px; overflow:hidden; position:relative; }
.line-chart svg { height:250px; overflow:visible; width:100%; }
.chart-inline-legend { display:flex; gap:16px; justify-content:center; margin-top:4px; }.chart-inline-legend span { align-items:center; display:flex; font-size:.72rem; gap:5px; }.chart-inline-legend i { border-radius:50%; height:8px; width:8px; }
.chart-tooltip { background:#0d3049; border-radius:6px; color:#fff; display:none; font-size:.7rem; padding:5px 8px; pointer-events:none; position:absolute; z-index:2; }
.bar-chart-list,.horizontal-ranking,.pareto-chart { display:grid; gap:9px; }
.bar-chart-list a,.bar-chart-list>div,.pareto-chart a { color:inherit; display:grid; gap:4px; grid-template-columns:minmax(130px,1fr) auto; position:relative; text-decoration:none; }
.bar-chart-list i,.pareto-chart i,.horizontal-ranking i { background:linear-gradient(90deg,#1f6d9e var(--bar),#e8f0f5 var(--bar)); border-radius:999px; grid-column:1/-1; height:7px; }
.bar-chart-list span,.pareto-chart span,.horizontal-ranking span { font-size:.76rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bar-chart-list b,.pareto-chart b,.horizontal-ranking b { font-size:.75rem; }
.secondary-kpi-grid { display:grid; gap:12px; grid-template-columns:repeat(4,minmax(0,1fr)); }
.secondary-kpi-grid>div { background:#fff; border:1px solid var(--analytics-line); border-radius:12px; display:grid; gap:4px; padding:15px; }
.secondary-kpi-grid span { font-size:.72rem; font-weight:700; text-transform:uppercase; }
.secondary-kpi-grid strong { color:#0c4e78; font-size:1.5rem; }
.secondary-kpi-grid small { color:#70818e; }
.sla-grid,.maintenance-split { display:grid; gap:8px; grid-template-columns:repeat(2,minmax(0,1fr)); }
.sla-stat,.maintenance-split>div { background:#f5f9fc; border:1px solid #dce7ee; border-radius:9px; color:inherit; display:grid; padding:12px; text-decoration:none; }
.sla-stat b,.maintenance-split strong { font-size:1.3rem; }.sla-stat span,.maintenance-split span { font-size:.72rem; }
.sla-1 { border-left:4px solid #258451; }.sla-2 { border-left:4px solid #dca300; }.sla-3 { border-left:4px solid #c83e3e; }.sla-4 { border-left:4px solid #71808b; }
.segmented { background:#eaf1f5; border-radius:8px; display:flex; padding:3px; }.segmented a { border-radius:6px; color:#526b7c; font-size:.72rem; padding:5px 9px; text-decoration:none; }.segmented a.active { background:#fff; color:#0c4d77; }
.horizontal-ranking>div { align-items:center; display:grid; gap:10px; grid-template-columns:minmax(100px,180px) 1fr 90px; }
.horizontal-ranking i { grid-column:auto; }
.responsive-table { overflow:auto; }.analytics-table { border-collapse:separate; border-spacing:0; min-width:900px; width:100%; }.analytics-table th { background:#edf4f8; color:#24485f; font-size:.69rem; position:sticky; text-transform:uppercase; top:0; }.analytics-table th,.analytics-table td { border-bottom:1px solid #e5edf2; padding:9px 10px; text-align:left; vertical-align:middle; }.analytics-table td { font-size:.75rem; }.analytics-table tbody tr:hover { background:#f7fbfd; }.analytics-table th a { color:inherit; text-decoration:none; }.empty-cell { color:#71808b; padding:25px!important; text-align:center!important; }
.analytics-empty { align-items:center; background:#fff; border:1px dashed #b9cbd7; border-radius:12px; display:flex; flex-direction:column; padding:35px; text-align:center; }.analytics-empty span { color:#6a7d8b; }
.consultation-search { align-items:end; display:grid; gap:10px; grid-template-columns:1fr auto; margin-bottom:14px; }.consultation-toolbar { flex-wrap:wrap; }.column-picker { position:relative; }.column-picker>form>div { background:#fff; border:1px solid #cfdde6; border-radius:10px; box-shadow:0 10px 30px rgba(15,48,70,.16); display:grid; gap:6px; padding:12px; position:absolute; right:0; top:42px; width:220px; z-index:5; }.column-picker label { font-size:.77rem; }.column-picker input { width:auto; }.consultation-table tr[data-href] { cursor:pointer; }.status-pill { background:#edf3f7; border-radius:999px; display:inline-block; padding:4px 8px; white-space:nowrap; }
.pagination-footer { align-items:center; display:flex; justify-content:space-between; gap:10px; padding-top:14px; }.pagination-footer label { align-items:center; display:flex; font-size:.75rem; gap:6px; }.pagination-footer select { border:1px solid #bfd0dc; border-radius:6px; padding:4px; }.pagination-footer nav { display:flex; gap:4px; }.pagination-footer nav a { border:1px solid #c7d7e2; border-radius:6px; color:#235574; min-width:30px; padding:4px; text-align:center; text-decoration:none; }.pagination-footer nav a.active { background:#155e8d; color:#fff; }
.executive-summary { display:grid; gap:14px; }.executive-attention { background:#fff8dc; border-left:4px solid #efb400; border-radius:8px; padding:14px; }.executive-attention h3 { font-size:.9rem; }.executive-attention p,.executive-attention li { font-size:.76rem; }.report-grid { display:grid; gap:12px; grid-template-columns:repeat(4,minmax(0,1fr)); }.report-grid article { border:1px solid #dbe6ed; border-radius:10px; padding:14px; }.report-grid h3 { font-size:.9rem; margin:8px 0; }.report-grid p { color:#687c8b; font-size:.75rem; min-height:38px; }.report-grid a { font-size:.75rem; font-weight:700; }.report-icon { color:#17618e; font-size:1.25rem; }.custom-report fieldset { border:0; display:flex; flex-wrap:wrap; gap:10px; margin:15px 0; padding:0; }.custom-report legend { font-size:.8rem; font-weight:700; }.custom-report fieldset label { font-size:.75rem; }.custom-report fieldset input { min-height:auto; width:auto; }
@media (max-width:1400px) { .kpi-grid { grid-template-columns:repeat(4,1fr); }.analytics-filter-grid { grid-template-columns:repeat(3,1fr); } }
@media (max-width:992px) { .analytics-page { width:calc(100vw - 36px); } }
@media (max-width:900px) { .analytics-heading { align-items:flex-start; flex-direction:column; }.kpi-grid,.secondary-kpi-grid { grid-template-columns:repeat(2,1fr); }.analytics-grid { grid-template-columns:1fr; }.chart-span-2 { grid-column:auto; }.analytics-filter-grid,.analytics-more-grid,.report-grid { grid-template-columns:repeat(2,1fr); }.analytics-filter-footer { align-items:stretch; flex-direction:column; }.filter-buttons { justify-content:flex-end; } }
@media (max-width:560px) { .analytics-filter-grid,.analytics-more-grid,.kpi-grid,.secondary-kpi-grid,.report-grid { grid-template-columns:1fr; }.analytics-filter-footer,.pagination-footer { align-items:stretch; flex-direction:column; }.kpi-card { min-height:105px; }.horizontal-ranking>div { grid-template-columns:95px 1fr 70px; }.analytics-card,.analytics-filter { padding:12px; } }
@media print { .app-navbar,.analytics-heading-actions,.analytics-filter,.analytics-tabs,.report-group,.custom-report,.consultation-actions { display:none!important; }.app-container { padding:0!important; }.analytics-page>*:not(.print-area) { display:none!important; }.print-area { border:0; box-shadow:none; display:block!important; }.kpi-grid { grid-template-columns:repeat(4,1fr); }.kpi-card { break-inside:avoid; } }

/* Dashboard executivo de alto contraste — escopo isolado. */
.app-body:has(.dashboard-page) { background:#e8eff5; color:#102a43; }
.dashboard-page { --dash-blue:#075985; --dash-dark:#0c3d5d; --dash-strong:#0369a1; --dash-green:#15803d; --dash-red:#b91c1c; --dash-amber:#b45309; --dash-violet:#6d28d9; --dash-line:#b8c7d6; color:#102a43; font-size:15px; gap:14px; }
.app-body:has(.dashboard-page) .app-navbar .nav-link { font-size:.88rem; font-weight:600; min-height:40px; padding:10px 13px; }
.app-body:has(.dashboard-page) .app-navbar .nav-link.active { background:#003b5c; border-radius:7px; box-shadow:0 2px 7px rgba(15,42,67,.24); color:#fff !important; font-weight:800; }
.dashboard-page .analytics-heading { align-items:center; padding:4px 2px 0; }
.dashboard-page .analytics-heading h1 { color:#102a43; font-size:clamp(1.8rem,2.4vw,2.25rem); letter-spacing:-.025em; line-height:1.12; }
.dashboard-page .analytics-heading p { color:#334e68; font-size:1rem; margin-top:4px; }
.dashboard-page .eyebrow { color:#0c4d77; font-size:.78rem; font-weight:800; letter-spacing:.035em; }
.dashboard-page .analytics-heading-actions { display:flex; gap:12px; }
.dashboard-page .analytics-heading-actions .btn { align-items:center; border-radius:8px; display:inline-flex; font-size:.92rem; font-weight:700; gap:8px; min-height:44px; padding:9px 18px; }
.dashboard-page .analytics-heading-actions .btn-primary,.dashboard-page .filter-buttons .btn-primary { background:#075985; border-color:#075985; box-shadow:0 4px 10px rgba(7,89,133,.2); }
.dashboard-page .analytics-heading-actions .btn-outline-primary { background:#fff; border:1.5px solid #075985; color:#075985; }
.dashboard-page .analytics-filter,.dashboard-page .analytics-card,.dashboard-page .secondary-kpi-grid>div { background:#fff; border:1px solid #b8c7d6; box-shadow:0 2px 8px rgba(15,42,67,.08); }
.dashboard-page .analytics-filter { border-left:4px solid #0878b9; padding:14px 16px; }
.dashboard-page .quick-filters { align-items:center; border-bottom:1px solid #cfdae4; display:flex; flex-wrap:wrap; gap:9px; margin:-2px 0 14px; padding:0 0 13px; }
.dashboard-page .quick-filter,.dashboard-page .quick-filter-icon { align-items:center; border:1px solid transparent; border-radius:999px; display:inline-flex; font-size:.86rem; font-weight:700; justify-content:center; min-height:38px; padding:7px 18px; }
.dashboard-page .quick-filter { background:#e8f1f8; color:#164e63; }
.dashboard-page .quick-filter:hover,.dashboard-page .quick-filter:focus-visible { border-color:#075985; box-shadow:0 0 0 3px rgba(7,89,133,.13); }
.dashboard-page .quick-filter.active { background:#075985; border-color:#075985; color:#fff; }
.dashboard-page .quick-filter-critical,.dashboard-page .quick-filter-danger { background:#fee2e2; color:#991b1b; }
.dashboard-page .quick-filter-critical.active,.dashboard-page .quick-filter-danger.active { background:#b91c1c; border-color:#991b1b; color:#fff; }
.dashboard-page .quick-filter-icon { background:#e3f1fb; color:#075985; padding-inline:12px; }
.dashboard-page .selected-period { background:#eef6fb; border-radius:8px; color:#075985; font-size:.83rem; margin-left:auto; padding:9px 12px; }
.dashboard-page .analytics-filter-grid { gap:13px; }
.dashboard-page .analytics-filter-grid label,.dashboard-page .analytics-more-grid label { color:#102a43; font-size:.84rem; font-weight:750; }
.dashboard-page .analytics-filter select,.dashboard-page .analytics-filter input { background-color:#fff; border:1.5px solid #9db2c5; border-radius:7px; color:#102a43; font-size:.92rem; min-height:46px; }
.dashboard-page .analytics-filter select:focus,.dashboard-page .analytics-filter input:focus { border-color:#075985; box-shadow:0 0 0 3px rgba(7,89,133,.14); }
.dashboard-page .analytics-more-filters summary { background:#e5f0f8; border:1px solid #bdd0df; border-radius:7px; color:#0c3d5d; font-size:.88rem; font-weight:750; min-height:42px; padding:10px 14px; }
.dashboard-page .analytics-more-filters .more-close { display:none; }.dashboard-page .analytics-more-filters[open] .more-open { display:none; }.dashboard-page .analytics-more-filters[open] .more-close { display:inline; }
.dashboard-page .active-filter-chips { align-items:center; color:#102a43; display:flex; flex-wrap:wrap; font-size:.85rem; gap:8px; }
.dashboard-page .active-filter-chips:not(:has(span))::before { content:"Filtros ativos:"; font-weight:750; }
.dashboard-page .active-filter-chips span { background:#e2f1fb; border:1px solid #bdd9ec; border-radius:999px; color:#0c4d77; font-size:.86rem; padding:8px 10px 8px 13px; }
.dashboard-page .active-filter-chips button { color:#075985; font-size:1.05rem; margin-left:5px; }
.dashboard-page .filter-buttons .btn { align-items:center; display:inline-flex; font-size:.9rem; font-weight:700; min-height:44px; padding:9px 16px; }
.dashboard-page .analytics-tabs { background:transparent; display:grid; gap:8px; grid-template-columns:repeat(4,minmax(0,1fr)); padding:0; }
.dashboard-page .analytics-tabs button { align-items:center; background:#edf4f9; border:1px solid #c5d4e0; border-radius:7px; color:#153e5a; display:flex; font-size:.92rem; font-weight:750; gap:9px; justify-content:center; min-height:46px; padding:9px 14px; }
.dashboard-page .analytics-tabs button.active { background:#075985; border-color:#075985; box-shadow:0 4px 10px rgba(7,89,133,.2); color:#fff; }
.dashboard-page .kpi-grid { gap:12px; grid-template-columns:repeat(4,minmax(0,1fr)); }
.dashboard-page .kpi-card { --kpi:#075985; background:#fff; border:1px solid #b8c7d6; border-left:5px solid var(--kpi); border-radius:10px; box-shadow:0 2px 8px rgba(15,42,67,.09); color:#102a43; display:flex; flex-direction:column; min-height:190px; padding:16px; }
.dashboard-page .kpi-card:hover,.dashboard-page .kpi-card:focus-visible { border-color:var(--kpi); box-shadow:0 8px 20px rgba(15,42,67,.16); transform:translateY(-2px); }
.dashboard-page .kpi-title { align-items:center; color:#163c56; display:flex; font-size:.82rem; font-weight:800; gap:8px; min-height:38px; text-transform:uppercase; }
.dashboard-page .kpi-icon { align-items:center; background:color-mix(in srgb,var(--kpi) 12%,white); border-radius:8px; color:var(--kpi); display:inline-flex; font-size:1.25rem; font-style:normal; height:38px; justify-content:center; min-width:38px; }
.dashboard-page .kpi-help { align-items:center; border:1px solid currentColor; border-radius:50%; display:inline-flex; font-size:.7rem; font-style:normal; height:18px; justify-content:center; margin-left:auto; min-width:18px; }
.dashboard-page .kpi-card strong { color:var(--kpi); font-size:clamp(2rem,2.4vw,2.5rem); line-height:1.15; margin:12px 0 6px; }
.dashboard-page .kpi-card small { color:#334e68; font-size:.86rem; line-height:1.4; }
.dashboard-page .kpi-card em { color:var(--kpi); font-size:.84rem; font-style:normal; font-weight:750; margin-top:auto; padding-top:10px; }
.dashboard-page .kpi-open { --kpi:#b45309; }.dashboard-page .kpi-progress { --kpi:#0369a1; }.dashboard-page .kpi-completed,.dashboard-page .kpi-sla { --kpi:#15803d; }.dashboard-page .kpi-backlog { --kpi:#b91c1c; }.dashboard-page .kpi-average { --kpi:#6d28d9; }.dashboard-page .kpi-median { --kpi:#3730a3; }
.dashboard-page .analytics-card { border-radius:11px; padding:17px; }
.dashboard-page .card-heading h2 { color:#102a43; font-size:1.12rem; font-weight:800; }
.dashboard-page .data-note { background:#eaf3f9; border-radius:999px; color:#164e63; font-size:.8rem; font-weight:700; padding:6px 10px; }
.dashboard-page .line-chart { min-height:300px; }.dashboard-page .line-chart svg { height:260px; overflow:visible; }
.dashboard-page .chart-inline-legend { color:#102a43; font-size:.88rem; font-weight:700; gap:24px; }
.dashboard-page .chart-inline-legend i { height:11px; width:11px; }
.dashboard-page .bar-chart-list { gap:14px; }.dashboard-page .bar-chart-list span,.dashboard-page .pareto-chart span,.dashboard-page .horizontal-ranking span { color:#274960; font-size:.88rem; }
.dashboard-page .bar-chart-list b,.dashboard-page .pareto-chart b,.dashboard-page .horizontal-ranking b { color:#102a43; font-size:.86rem; }
.dashboard-page .bar-chart-list i,.dashboard-page .pareto-chart i,.dashboard-page .horizontal-ranking i { background:linear-gradient(90deg,#0877ba var(--bar),#e5edf3 var(--bar)); height:10px; }
.dashboard-page .compact-legend { display:grid; gap:8px; margin-top:12px; }.dashboard-page .compact-legend>a,.dashboard-page .compact-legend>span { align-items:center; color:#274960; display:flex; font-size:.84rem; gap:7px; justify-content:space-between; text-decoration:none; }
.dashboard-page .sla-overview { align-items:center; display:grid; grid-template-columns:auto 1fr; gap:2px 12px; }.dashboard-page .sla-overview strong { color:#b91c1c; font-size:2.2rem; grid-row:1/3; }.dashboard-page .sla-overview span { color:#334e68; font-weight:700; }.dashboard-page .sla-overview>div { background:#e3eaf0; border-radius:99px; height:12px; overflow:hidden; }.dashboard-page .sla-overview>div i { background:#b91c1c; display:block; height:100%; width:var(--sla); }
.dashboard-page .maintenance-donut { align-items:center; background:conic-gradient(#0369a1 var(--preventive),#f97316 0); border-radius:50%; display:flex; height:130px; justify-content:center; margin:4px auto 12px; width:130px; }.dashboard-page .maintenance-donut>div { align-items:center; background:#fff; border-radius:50%; display:flex; flex-direction:column; height:80px; justify-content:center; width:80px; }.dashboard-page .maintenance-donut strong { font-size:1.3rem; }.dashboard-page .maintenance-donut span { color:#334e68; font-size:.75rem; }.dashboard-page .legend-dot { border-radius:50%; display:inline-block; height:10px; margin-right:3px; width:10px; }.dashboard-page .legend-dot.preventive { background:#0369a1; }.dashboard-page .legend-dot.corrective { background:#f97316; }
.dashboard-context { align-items:center; background:#fff; border:1px solid #b8c7d6; border-left:4px solid #075985; border-radius:8px; display:flex; gap:12px; justify-content:space-between; padding:10px 14px; }.dashboard-context>div { display:flex; gap:8px; }.dashboard-breadcrumb { align-items:center; color:#334e68; display:flex; flex-wrap:wrap; font-size:.86rem; gap:7px; }.dashboard-breadcrumb a { color:#075985; font-weight:750; }.dashboard-back,.dashboard-clear-selection { background:#edf5fa; border:1px solid #aac2d4; border-radius:6px; color:#0c4d77; cursor:pointer; font-size:.84rem; font-weight:700; padding:7px 10px; text-decoration:none; }
.dashboard-page :is(a,button,select,input,summary):focus-visible { outline:3px solid #f5a900; outline-offset:2px; }
@media (prefers-reduced-motion:reduce) { .dashboard-page * { scroll-behavior:auto!important; transition:none!important; } }
@media (max-width:1100px) { .dashboard-page .kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.dashboard-page .analytics-tabs { grid-template-columns:repeat(2,1fr); } }
@media (max-width:700px) { .dashboard-page { font-size:16px; }.dashboard-page .analytics-heading-actions { width:100%; }.dashboard-page .analytics-heading-actions .btn { flex:1; justify-content:center; }.dashboard-page .selected-period { margin-left:0; width:100%; }.dashboard-page .analytics-tabs,.dashboard-page .kpi-grid { grid-template-columns:1fr; }.dashboard-page .kpi-card { min-height:175px; }.dashboard-context { align-items:flex-start; flex-direction:column; }.dashboard-context>div { width:100%; }.dashboard-back,.dashboard-clear-selection { flex:1; text-align:center; } }
@media (min-resolution:1.25dppx) and (max-width:1536px) { .dashboard-page .kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* Consulta sobreposta ao Dashboard. */
body.query-overlay-open { overflow:hidden; }
.dashboard-query-overlay { inset:0; position:fixed; z-index:1080; }
.dashboard-query-overlay[hidden] { display:none; }
.dashboard-query-backdrop { background:rgba(8,30,47,.68); inset:0; position:absolute; }
.dashboard-query-dialog { background:#f4f8fb; border-left:1px solid #9fb6c8; box-shadow:-16px 0 45px rgba(5,30,48,.28); display:flex; flex-direction:column; height:100%; margin-left:auto; max-width:1720px; position:relative; width:min(96vw,1720px); }
.dashboard-query-dialog>header { align-items:center; background:#fff; border-bottom:1px solid #b8c7d6; display:flex; justify-content:space-between; min-height:72px; padding:13px 20px; }
.dashboard-query-dialog>header>div { display:grid; gap:2px; }.dashboard-query-dialog>header strong { color:#102a43; font-size:1.2rem; }
.dashboard-query-dialog>header>button { align-items:center; background:#e8f1f8; border:1px solid #9fb8ca; border-radius:8px; color:#0c3d5d; display:flex; font-size:1.7rem; height:42px; justify-content:center; width:42px; }
.dashboard-query-body { flex:1; min-height:0; overflow:auto; padding:18px 20px; }
.dashboard-query-loading { align-items:center; color:#0c3d5d; display:flex; flex:1; flex-direction:column; gap:12px; justify-content:center; }.dashboard-query-loading[hidden] { display:none; }.dashboard-query-loading span { animation:query-spin .8s linear infinite; border:5px solid #d5e2eb; border-radius:50%; border-top-color:#075985; height:46px; width:46px; }
@keyframes query-spin { to { transform:rotate(360deg); } }
.dashboard-query-results { align-content:start; display:grid; gap:12px; grid-template-rows:auto auto minmax(0,1fr) auto; height:100%; min-height:0; }.dashboard-query-results .consultation-toolbar { align-items:center; background:#fff; border:1px solid #b8c7d6; border-radius:10px; display:flex; justify-content:space-between; padding:14px 16px; }.dashboard-query-results .consultation-toolbar h2 { color:#102a43; font-size:1.35rem; margin:3px 0; }.dashboard-query-results .consultation-toolbar p { color:#334e68; font-size:.88rem; margin:0; }.dashboard-query-results .consultation-actions { display:flex; flex-wrap:wrap; gap:8px; }
.query-active-filters { align-items:center; display:flex; flex-wrap:wrap; gap:7px; min-height:32px; }.query-active-filters span { align-items:center; align-self:center; background:#dfeef8; border:1px solid #bad5e7; border-radius:999px; color:#0c4d77; display:inline-flex; font-size:.84rem; height:auto; line-height:1.2; padding:7px 11px; width:auto; }
.query-table-wrap { background:#fff; border:1px solid #b8c7d6; border-radius:10px; height:100%; max-height:none; min-height:220px; }.dashboard-query-results .analytics-table th { background:#dfeaf2; color:#102a43; font-size:.76rem; padding:11px 10px; }.dashboard-query-results .analytics-table td { color:#183b53; font-size:.82rem; padding:10px; }.dashboard-query-results .analytics-table tbody tr:nth-child(even) { background:#f3f7fa; }.dashboard-query-results .analytics-table tbody tr:hover { background:#e2f1fb; }
.dashboard-query-results .pagination-footer { background:#fff; border:1px solid #b8c7d6; border-radius:9px; padding:10px 13px; position:sticky; bottom:0; }.dashboard-query-results .pagination-footer label,.dashboard-query-results .pagination-footer span { color:#334e68; font-size:.84rem; }
@media (max-width:800px) { .dashboard-query-dialog { width:100vw; }.dashboard-query-body { padding:10px; }.dashboard-query-results .consultation-toolbar { align-items:stretch; flex-direction:column; }.dashboard-query-results .consultation-actions .btn { flex:1; }.query-table-wrap { max-height:calc(100vh - 285px); }.dashboard-query-results .pagination-footer { align-items:stretch; flex-direction:column; } }
@media (prefers-reduced-motion:reduce) { .dashboard-query-loading span { animation:none; } }

/* Detalhamento contextual do dashboard */
.dashboard-query-backdrop { background:rgba(0,0,0,.45); }
.dashboard-query-dialog { border:1px solid #9fb6c8; border-radius:12px; height:min(90vh,960px); left:50%; margin:0; position:absolute; top:50%; transform:translate(-50%,-50%); width:min(95vw,1720px); }
.dashboard-query-dialog>header { background:#0c3d5d; border-radius:11px 11px 0 0; color:#fff; }
.dashboard-query-dialog>header strong,.dashboard-query-dialog>header .eyebrow { color:#fff; }
.dashboard-query-results { grid-template-rows:auto auto auto minmax(0,1fr) auto; }
.query-local-filters { align-items:end; background:#fff; border:1px solid #b8c7d6; border-radius:10px; display:grid; gap:10px; grid-template-columns:2fr repeat(4,1fr) auto; padding:12px; }
.query-local-filters label { color:#102a43; display:grid; font-size:.8rem; font-weight:700; gap:4px; }
.query-local-filters input,.query-local-filters select { border:1px solid #9db2c5; border-radius:6px; min-height:39px; padding:7px 9px; }
.query-table-wrap th { position:sticky; top:0; z-index:2; }
.dashboard-query-results .consultation-table th { background:#0c3d5d; color:#fff; font-size:.84rem; }
.consultation-table th a { color:#fff; }.consultation-table td { max-width:250px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.query-actions { display:flex; gap:5px; }
.priority-badge { border-radius:999px; display:inline-block; font-weight:800; padding:5px 10px; }
.priority-badge.priority-critico,
.priority-badge.priority-urgente { background:#b91c1c; color:#fff; }
.priority-badge.priority-alta { background:#ea580c; color:#fff; }
.priority-badge.priority-media { background:#facc15; color:#422006; }
.priority-badge.priority-normal { background:#fde68a; color:#713f12; }
.priority-badge.priority-baixa { background:#15803d; color:#fff; }
.priority-badge.priority-planejada { background:#6d28d9; color:#fff; }
.priority-badge.priority-empty { background:#dbe3ec; color:#334155; }
.os-detail-panel { background:#fff; box-shadow:-12px 0 30px rgba(5,30,48,.28); display:flex; flex-direction:column; height:100%; position:absolute; right:0; top:0; transform:translateX(105%); transition:transform .2s ease; width:min(92%,1100px); z-index:5; }
.os-detail-panel.open { transform:none; }.os-detail-panel header { align-items:center; background:#0c3d5d; color:#fff; display:flex; justify-content:space-between; min-height:62px; padding:12px 18px; }.os-detail-panel header button { background:#fff; border:0; border-radius:6px; font-size:1.5rem; height:38px; width:38px; }.os-detail-panel iframe { border:0; flex:1; width:100%; }
.maintenance-split a { color:inherit; text-decoration:none; }
@media (max-width:1000px) { .query-local-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }.query-search { grid-column:1/-1; } }
@media (max-width:800px) { .dashboard-query-dialog { border-radius:0; height:100vh; width:100vw; }.query-local-filters { grid-template-columns:1fr; }.query-search { grid-column:auto; }.os-detail-panel { width:100%; } }
