:root {
    --app-navy: #243447;
    --app-menu-yellow: #feb103;
    --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);
}

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

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

.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: #ffffff;
    color: var(--app-blue) !important;
}

.app-navbar .nav-link.active:hover,
.app-navbar .nav-link.active:focus {
    background: #ffffff;
    color: var(--app-blue) !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;
}

.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-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;
}

.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-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; } }

/* 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 {
    max-width: 760px;
}
#modalExportarOSPeriodo .modal-content,
#modalExportarOSPeriodo form {
    overflow: visible;
}
#modalExportarOSPeriodo .modal-body {
    min-height: 390px;
}
#modalExportarOSPeriodo .flatpickr-wrapper {
    display: block;
    position: relative;
    width: 100%;
}
#modalExportarOSPeriodo .flatpickr-calendar.static {
    left: 0;
    right: auto;
    top: calc(100% + 6px);
    z-index: 2200;
}
@media (max-width: 767px) {
    #modalExportarOSPeriodo .modal-dialog {
        margin-left: auto;
        margin-right: auto;
        max-width: calc(100% - 24px);
    }
    #modalExportarOSPeriodo .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; }
@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-origin-system {
    background: #fff1b8 !important;
    border-color: #d99a00 !important;
    border-left-color: #9d6800 !important;
    color: #563900 !important;
}

.planning-card.planning-origin-system:hover {
    box-shadow: 0 8px 18px rgba(184, 121, 0, .24);
    color: #654600;
}

.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-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);
}

.login-panel {
    background:
        linear-gradient(90deg, var(--app-gold) 0, var(--app-gold) 6px, transparent 6px),
        linear-gradient(145deg, #ffffff 0%, #f3f8fb 100%);
    border: 1px solid #c3d3e0;
    border-top: 5px solid var(--app-blue);
    border-radius: 14px;
    box-shadow: 0 20px 46px rgba(23, 58, 92, 0.15);
    max-width: 460px;
    padding: 34px;
}

.login-panel h1 {
    color: var(--app-navy);
    font-weight: 800;
}

.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-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;
    }
}

