/* PentaLog — shell compartilhado das telas de operação */

:root {
    --pl-navy: #051835;
    --pl-navy-2: #0A2148;
    --pl-orange: #D84D15;
    --pl-orange-hover: #B93E10;
    --pl-bg: #F4F6F8;
    --pl-surface: #FFFFFF;
    --pl-text: #0F172A;
    --pl-muted: #64748B;
    --pl-border: #E2E8F0;
    --pl-radius: 14px;
    --pl-radius-sm: 10px;
}

.pl-op-page {
    color: var(--pl-text);
}

/* Card shell — containers operacionais (não full-bleed) */
.pl-op-page.container,
.pl-op-page.container-xl,
.pl-op-page.container-lg,
.pl-op-page.pl-op-page-wide {
    background: var(--pl-surface) !important;
    border: 1px solid var(--pl-border);
    border-radius: var(--pl-radius);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    padding-top: 1rem !important;
    padding-bottom: 1.5rem !important;
    margin-top: 1rem !important;
    margin-bottom: 1.5rem !important;
}

/* Tabela densa: usa quase toda a largura, com gutter lateral */
.pl-op-page.pl-op-page-wide.container-fluid {
    width: calc(100% - 1.5rem);
    max-width: 1920px;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Full-bleed (painel / mapa): só tipografia e botões, sem card extra */
.pl-op-page.container-fluid:not(.pl-op-page-wide),
.pl-op-page.w-100.min-vh-100 {
    border: none;
    box-shadow: none;
}

.pl-op-page .pl-op-title,
.pl-op-page .h1,
.pl-op-page h1 {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: var(--pl-navy) !important;
    margin-top: 0.35rem !important;
    margin-bottom: 0.75rem !important;
}

.pl-op-page .h2,
.pl-op-page h2 {
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    color: var(--pl-navy) !important;
}

.pl-op-page .h3,
.pl-op-page h3 {
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    color: var(--pl-navy) !important;
}

/* Logo central Grupo Penta */
.pl-op-page .recepcao_logo,
.pl-op-page .coordenador_do_cd_logo,
.pl-op-page img.logo.card-img-top,
.pl-op-page img.logo {
    width: auto !important;
    max-width: 300px !important;
    max-height: 64px !important;
    object-fit: contain !important;
    margin: 0.25rem auto 0.35rem !important;
    display: block;
}

.pl-op-page .btn-primary,
.modal .btn-primary {
    background-color: var(--pl-orange) !important;
    border-color: var(--pl-orange) !important;
    color: #fff !important;
    font-weight: 600;
    border-radius: var(--pl-radius-sm);
    min-height: 40px;
}

.pl-op-page .btn-primary:hover,
.pl-op-page .btn-primary:focus,
.modal .btn-primary:hover,
.modal .btn-primary:focus {
    background-color: var(--pl-orange-hover) !important;
    border-color: var(--pl-orange-hover) !important;
}

.pl-op-page .btn-dark,
.modal .btn-dark {
    background-color: var(--pl-navy) !important;
    border-color: var(--pl-navy) !important;
    border-radius: var(--pl-radius-sm);
    font-weight: 600;
}

.pl-op-page .btn-outline-primary,
.modal .btn-outline-primary {
    color: var(--pl-orange) !important;
    border-color: var(--pl-orange) !important;
    border-radius: var(--pl-radius-sm);
}

.pl-op-page .btn-outline-primary:hover,
.modal .btn-outline-primary:hover {
    background-color: var(--pl-orange) !important;
    color: #fff !important;
}

.pl-op-page .form-control,
.pl-op-page .form-select {
    border-color: var(--pl-border);
    border-radius: var(--pl-radius-sm);
    min-height: 42px;
}

.pl-op-page .form-control:focus,
.pl-op-page .form-select:focus {
    border-color: var(--pl-orange);
    box-shadow: 0 0 0 0.2rem rgba(216, 77, 21, 0.2);
}

.pl-op-page .form-floating > label {
    color: var(--pl-muted);
}

/* Tabelas operacionais — mesmo padrão do painel, em tamanho de mesa */
.pl-op-page table,
.pl-op-page .table_agente {
    width: 100%;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
}

.pl-op-page table.dataTable thead th,
.pl-op-page table.table thead th,
.pl-op-page table thead th,
.pl-op-page .table_agente thead th {
    background: #051835 !important;
    color: #F8FAFC !important;
    border: 0 !important;
    border-bottom: 3px solid #D84D15 !important;
    border-right: 1px solid rgba(203, 213, 225, 0.45) !important;
    font-family: inherit !important;
    font-weight: 800 !important;
    font-size: 1rem !important;
    line-height: 1.2 !important;
    text-transform: none !important;
    letter-spacing: 0.01em;
    white-space: nowrap;
    vertical-align: middle;
    text-align: center !important;
    padding: 0.8rem 0.65rem !important;
}

.pl-op-page table thead th:last-child,
.pl-op-page table tbody td:last-child,
.pl-op-page .table_agente thead th:last-child,
.pl-op-page .table_agente tbody td:last-child,
.pl-op-page table.table > :not(caption) > * > :last-child {
    border-right: 0 !important;
}

.pl-op-page table.dataTable tbody td,
.pl-op-page table.table tbody td,
.pl-op-page table tbody td,
.pl-op-page .table_agente tbody td,
.pl-op-page table.table > :not(caption) > * > * {
    vertical-align: middle;
    color: var(--pl-text);
    border: 0 !important;
    border-right: 1px solid #CBD5E1 !important;
    border-bottom: 0 !important;
    font-family: inherit !important;
    font-size: 1rem !important;
    font-weight: 600;
    line-height: 1.3;
    padding: 0.75rem 0.65rem !important;
}

.pl-op-page .pl-op-nome,
.pl-op-page .pl-op-nome .text-center {
    text-align: left !important;
}

.pl-op-page table tbody td .pl-op-sub,
.pl-op-page .table_agente tbody td .pl-op-sub {
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    color: var(--pl-muted);
    line-height: 1.3;
}

.pl-op-page table.dataTable.stripe tbody tr.odd,
.pl-op-page table.dataTable.display tbody tr.odd {
    background-color: #F8FAFC;
}

.pl-op-page table.dataTable.hover tbody tr:hover,
.pl-op-page table.table tbody tr:hover {
    background-color: #FFF1E8 !important;
}

.pl-op-page .dataTables_wrapper .dataTables_filter input,
.pl-op-page .dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--pl-border);
    border-radius: 8px;
    min-height: 36px;
}

.pl-op-page .dataTables_wrapper .dataTables_info,
.pl-op-page .dataTables_wrapper .dataTables_paginate {
    color: var(--pl-muted);
    padding-top: 0.75rem;
}

.pl-op-page .page-link {
    color: var(--pl-navy);
}

.pl-op-page .page-item.active .page-link {
    background-color: var(--pl-orange);
    border-color: var(--pl-orange);
    color: #fff;
}

/* Badges / legendas */
.pl-op-page .quadrado_legenda,
.pl-op-page .table_financeiro_acoes_quadrado_legenda {
    border-radius: 4px;
}

.pl-op-page .badge.bg-primary,
.pl-op-page .badge-primary {
    background-color: var(--pl-orange) !important;
}

.pl-op-page .text-primary {
    color: var(--pl-orange) !important;
}

/* Empty / muted helpers */
.pl-op-page .text-muted {
    color: var(--pl-muted) !important;
}

/* Grids operacionais — mesmo desenho do painel, em tamanho de mesa.
   Modais ficam de fora para não herdar zebra, barra e largura fixa. */
.pl-op-page .table-responsive > table,
.pl-op-page > table.table,
.pl-op-page > div > table.table,
.pl-op-page > div > div > table.table {
    width: 100% !important;
    table-layout: fixed;
}

.pl-op-page table.dataTable {
    width: 100% !important;
    table-layout: fixed;
    margin: 0 !important;
}

.pl-op-page .table-responsive > table tbody td,
.pl-op-page > table.table tbody td,
.pl-op-page > div > table.table tbody td,
.pl-op-page > div > div > table.table tbody td,
.pl-op-page table.dataTable tbody td {
    text-align: center !important;
    background: #fff !important;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-op-page table tbody td:has(.pl-op-badge),
.pl-op-page table.dataTable tbody td:has(.pl-op-badge) {
    white-space: normal;
}

.pl-op-page .table-responsive > table tbody tr:nth-child(even) td,
.pl-op-page > table.table tbody tr:nth-child(even) td,
.pl-op-page > div > table.table tbody tr:nth-child(even) td,
.pl-op-page > div > div > table.table tbody tr:nth-child(even) td,
.pl-op-page table.dataTable tbody tr:nth-child(even) td {
    background: #F8FAFC !important;
}

.pl-op-page table.dataTable tbody tr.selected td {
    background: #FFE8DC !important;
}

.pl-op-page .table-responsive > table tbody td.pl-op-nome,
.pl-op-page .table-responsive > table thead th.pl-op-nome,
.pl-op-page table tbody td.pl-op-nome,
.pl-op-page table thead th.pl-op-nome,
.pl-op-page table tbody td.pl-op-nome * {
    text-align: left !important;
}

.pl-op-page table thead th.pl-op-nome,
.pl-op-page table tbody td.pl-op-nome {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-op-page .table-responsive > table tbody td:first-child,
.pl-op-page > table.table tbody td:first-child,
.pl-op-page > div > table.table tbody td:first-child,
.pl-op-page > div > div > table.table tbody td:first-child,
.pl-op-page table.dataTable tbody td:first-child {
    box-shadow: inset 8px 0 0 #CBD5E1;
}

.pl-op-page table tbody tr.st-VERDE > td:first-child,
.pl-op-page table.dataTable tbody tr.st-VERDE > td:first-child,
.pl-op-page .table-responsive table tbody tr.st-VERDE > td:first-child {
    box-shadow: inset 8px 0 0 #16A34A;
}

.pl-op-page table tbody tr.st-VERDE_ESCURO > td:first-child,
.pl-op-page table.dataTable tbody tr.st-VERDE_ESCURO > td:first-child,
.pl-op-page .table-responsive table tbody tr.st-VERDE_ESCURO > td:first-child,
.pl-op-page table tbody tr.VERDE_ESCURO > td:first-child {
    box-shadow: inset 8px 0 0 #15803D;
}

.pl-op-page table tbody tr.st-VERDE_CLARO > td:first-child,
.pl-op-page table.dataTable tbody tr.st-VERDE_CLARO > td:first-child,
.pl-op-page .table-responsive table tbody tr.st-VERDE_CLARO > td:first-child,
.pl-op-page table tbody tr.VERDE_CLARO > td:first-child {
    box-shadow: inset 8px 0 0 #22C55E;
}

.pl-op-page table tbody tr.st-AMARELO > td:first-child,
.pl-op-page table.dataTable tbody tr.st-AMARELO > td:first-child,
.pl-op-page .table-responsive table tbody tr.st-AMARELO > td:first-child,
.pl-op-page table tbody tr.AMARELO > td:first-child {
    box-shadow: inset 8px 0 0 #CA8A04;
}

.pl-op-page table tbody tr.st-AZUL > td:first-child,
.pl-op-page table.dataTable tbody tr.st-AZUL > td:first-child,
.pl-op-page .table-responsive table tbody tr.st-AZUL > td:first-child,
.pl-op-page table tbody tr.AZUL > td:first-child,
.pl-op-page table tbody tr.st-AZUL_CLARO > td:first-child,
.pl-op-page table tbody tr.AZUL_CLARO > td:first-child {
    box-shadow: inset 8px 0 0 #1D4ED8;
}

.pl-op-page table tbody tr.st-LARANJA > td:first-child,
.pl-op-page table.dataTable tbody tr.st-LARANJA > td:first-child,
.pl-op-page .table-responsive table tbody tr.st-LARANJA > td:first-child {
    box-shadow: inset 8px 0 0 #EA580C;
}

.pl-op-page table tbody tr.st-BRANCO > td:first-child,
.pl-op-page table.dataTable tbody tr.st-BRANCO > td:first-child,
.pl-op-page .table-responsive table tbody tr.st-BRANCO > td:first-child,
.pl-op-page table tbody tr.BRANCO > td:first-child {
    box-shadow: inset 8px 0 0 #64748B;
}

.pl-op-page table tbody tr.st-VERMELHO > td:first-child,
.pl-op-page table.dataTable tbody tr.st-VERMELHO > td:first-child,
.pl-op-page .table-responsive table tbody tr.st-VERMELHO > td:first-child,
.pl-op-page table tbody tr.VERMELHO > td:first-child,
.pl-op-page table tbody tr.st-PISCA_VERMELHO > td:first-child,
.pl-op-page table tbody tr.PISCA_VERMELHO > td:first-child {
    box-shadow: inset 8px 0 0 #DC2626;
}

.pl-op-page table tbody tr.st-PRETO > td:first-child,
.pl-op-page table.dataTable tbody tr.st-PRETO > td:first-child,
.pl-op-page .table-responsive table tbody tr.st-PRETO > td:first-child,
.pl-op-page table tbody tr.PRETO > td:first-child {
    box-shadow: inset 8px 0 0 #0F172A;
}

.pl-op-page tr.VERDE_CLARO,
.pl-op-page tr.VERDE_ESCURO,
.pl-op-page tr.AMARELO,
.pl-op-page tr.AZUL,
.pl-op-page tr.AZUL_CLARO,
.pl-op-page tr.VERMELHO,
.pl-op-page tr.BRANCO,
.pl-op-page tr.PRETO,
.pl-op-page tr.PISCA_VERMELHO,
.pl-op-page tr.PISCA_VERMELHO td {
    background-color: transparent !important;
    animation: none !important;
}

.pl-op-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: min(7.5rem, 100%);
    max-width: 100%;
    min-height: 1.8rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.pl-op-badge.badge-VERDE { background: #16A34A; }
.pl-op-badge.badge-VERDE_ESCURO { background: #15803D; }
.pl-op-badge.badge-VERDE_CLARO { background: #22C55E; }
.pl-op-badge.badge-AMARELO { background: #CA8A04; }
.pl-op-badge.badge-AZUL,
.pl-op-badge.badge-AZUL_CLARO { background: #1D4ED8; }
.pl-op-badge.badge-LARANJA { background: #EA580C; }
.pl-op-badge.badge-BRANCO { background: #334155; }
.pl-op-badge.badge-VERMELHO,
.pl-op-badge.badge-PISCA_VERMELHO { background: #DC2626; }
.pl-op-badge.badge-PRETO { background: #0F172A; }

.pl-op-col-doca { width: 4.2rem; }
.pl-op-col-status { width: 14rem; }
.pl-op-col-id { width: 5rem; white-space: nowrap; }
.pl-op-col-placa { width: 7.5rem; white-space: nowrap; }
.pl-op-col-tempo { width: 7.5rem; }
.pl-op-col-tipo { width: 7.5rem; white-space: nowrap; }
.pl-op-col-ped { width: 6.5rem; }
.pl-op-col-acao { width: 4.75rem; }

/* Botão de ação (hambúrguer): a coluna estreita + overflow cortava o ícone e o menu */
.pl-op-page table thead th.pl-op-col-acao,
.pl-op-page table tbody td.pl-op-col-acao,
.pl-op-page table tbody td:has(.btn-group),
.pl-op-page .table-responsive table tbody td:has(.btn-group),
.pl-op-page table.dataTable tbody td:has(.btn-group) {
    width: 4.75rem;
    min-width: 4.75rem;
    overflow: visible !important;
    text-overflow: clip;
    white-space: nowrap;
    padding-left: 0.3rem !important;
    padding-right: 0.3rem !important;
}

.pl-op-page .btn-group > .btn.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border-radius: 8px;
    border: 1px solid #CBD5E1 !important;
    background: #fff;
    color: #051835;
    line-height: 1;
}

.pl-op-page .btn-group > .btn.dropdown-toggle::after {
    display: none;
}

.pl-op-page .btn-group > .btn.dropdown-toggle:hover,
.pl-op-page .btn-group > .btn.dropdown-toggle:focus,
.pl-op-page .btn-group > .btn.dropdown-toggle.show {
    background: #051835;
    color: #fff;
    border-color: #051835 !important;
}

.dropdown-menu .dropdown-item,
.dropdown-menu .dropdown-item * {
    cursor: pointer;
}

.dropdown-menu .dropdown-item.disabled,
.dropdown-menu .dropdown-item.disabled * {
    cursor: default;
}

.pl-op-page .dropdown-menu {
    z-index: 1080;
}

.pl-op-page .table-responsive,
.pl-op-page .dataTables_wrapper {
    overflow: visible;
}

.pl-op-page table thead th.pl-op-col-tempo,
.pl-op-page table thead th.pl-op-col-ped {
    white-space: normal !important;
    line-height: 1.1 !important;
}

.pl-op-legenda {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 1rem;
    margin: 0;
    color: #0F172A;
    font-size: 0.95rem;
    font-weight: 800;
}

.pl-op-legenda span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.pl-op-legenda i {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    display: inline-block;
    flex: 0 0 auto;
}

.pl-op-legenda .dot-VERDE { background: #16A34A; }
.pl-op-legenda .dot-VERDE_ESCURO { background: #15803D; }
.pl-op-legenda .dot-VERDE_CLARO { background: #22C55E; }
.pl-op-legenda .dot-AMARELO { background: #CA8A04; }
.pl-op-legenda .dot-AZUL { background: #1D4ED8; }
.pl-op-legenda .dot-LARANJA { background: #EA580C; }
.pl-op-legenda .dot-BRANCO { background: #94A3B8; border: 1px solid #64748B; }
.pl-op-legenda .dot-VERMELHO { background: #DC2626; }
.pl-op-legenda .dot-PRETO { background: #0F172A; }

.pl-op-busca-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem 1.25rem;
    flex-wrap: wrap;
    margin: 0.35rem 0 0.9rem;
}

.pl-op-page .pl-op-busca.form-control {
    width: 100%;
    max-width: 36rem;
    flex: 1 1 18rem;
    min-height: 3.25rem;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    font-size: 1.15rem;
    font-weight: 600;
    padding: 0.55rem 0.9rem;
    box-shadow: none;
}

.pl-op-page .pl-op-busca.form-control:focus {
    border-color: #D84D15;
    box-shadow: 0 0 0 3px rgba(216, 77, 21, 0.16);
}

.pl-op-busca-bar .pl-op-legenda {
    flex: 1 1 16rem;
    font-size: 1rem;
}

.pl-op-busca-acoes {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pl-op-page .dataTables_wrapper .dataTables_filter {
    display: none !important;
}

.pl-op-page .modal table,
.pl-op-page .modal table tbody td,
.pl-op-page .modal table tbody td:first-child {
    table-layout: auto;
    background: transparent !important;
    box-shadow: none !important;
    text-align: inherit !important;
}

@media (max-width: 767.98px) {
    .pl-op-page.container,
    .pl-op-page.container-xl,
    .pl-op-page.container-lg,
    .pl-op-page.pl-op-page-wide.container-fluid {
        margin-left: 0.5rem !important;
        margin-right: 0.5rem !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        max-width: calc(100% - 1rem);
        width: calc(100% - 1rem);
    }

    .pl-op-page .recepcao_logo,
    .pl-op-page .coordenador_do_cd_logo,
    .pl-op-page img.logo.card-img-top,
    .pl-op-page img.logo {
        max-width: 200px !important;
        max-height: 48px !important;
    }

    .pl-op-page .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pl-op-page .dataTables_wrapper,
    .pl-op-page .table-responsive {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pl-op-page .btn-primary,
    .pl-op-page .btn-dark {
        width: 100%;
    }

    .pl-op-page .d-flex.justify-content-end .btn-primary {
        width: auto;
    }
}

body.pl-theme-dark {
    background: #061428 !important;
}

body.pl-theme-dark .pl-op-page {
    --pl-navy: #F8FAFC;
    --pl-bg: #061428;
    --pl-surface: #0B1F3C;
    --pl-text: #F8FAFC;
    --pl-muted: #93A4BB;
    --pl-border: rgba(148, 163, 184, 0.22);
    background: #0B1F3C !important;
    color: #F8FAFC;
}

body.pl-theme-dark .pl-op-page .form-control,
body.pl-theme-dark .pl-op-page .form-select {
    background: #0C2344;
    color: #F8FAFC;
    border-color: rgba(148, 163, 184, 0.28);
}

body.pl-theme-dark .pl-op-page table,
body.pl-theme-dark .pl-op-page .table,
body.pl-theme-dark .pl-op-page table tbody td,
body.pl-theme-dark .pl-op-page table thead th {
    background: #0B1F3C;
    color: #F8FAFC;
    border-color: rgba(148, 163, 184, 0.16);
}

body.pl-theme-dark .pl-op-page .dataTables_wrapper,
body.pl-theme-dark .pl-op-page .dataTables_info,
body.pl-theme-dark .pl-op-page .dataTables_filter label {
    color: #F8FAFC;
}

/* Modais no dark mode: o board passa texto claro para dentro do Bootstrap
   (fundo branco + letra branca). Recolore o overlay inteiro. */
body.pl-theme-dark .modal,
body.painel-theme-dark .modal,
.painel-shell.painel-theme-dark .modal {
    --bs-body-color: #F8FAFC;
    --bs-body-bg: #0B1F3C;
    --bs-border-color: rgba(148, 163, 184, 0.28);
    color: #F8FAFC;
}

body.pl-theme-dark .modal-content,
body.painel-theme-dark .modal-content,
.painel-shell.painel-theme-dark .modal-content {
    background: #0B1F3C;
    color: #F8FAFC;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 16px;
}

body.pl-theme-dark .modal-header,
body.pl-theme-dark .modal-footer,
body.painel-theme-dark .modal-header,
body.painel-theme-dark .modal-footer,
.painel-shell.painel-theme-dark .modal-header,
.painel-shell.painel-theme-dark .modal-footer {
    border-color: rgba(148, 163, 184, 0.22);
}

body.pl-theme-dark .modal-title,
body.pl-theme-dark .modal .h3,
body.pl-theme-dark .modal h3,
body.pl-theme-dark .modal h4,
body.pl-theme-dark .modal label,
body.pl-theme-dark .modal .form-check-label,
body.painel-theme-dark .modal-title,
body.painel-theme-dark .modal .h3,
body.painel-theme-dark .modal h3,
body.painel-theme-dark .modal h4,
body.painel-theme-dark .modal label,
.painel-shell.painel-theme-dark .modal-title,
.painel-shell.painel-theme-dark .modal .h3,
.painel-shell.painel-theme-dark .modal h3,
.painel-shell.painel-theme-dark .modal h4,
.painel-shell.painel-theme-dark .modal label {
    color: #F8FAFC;
}

body.pl-theme-dark .modal .form-control,
body.pl-theme-dark .modal .form-select,
body.painel-theme-dark .modal .form-control,
body.painel-theme-dark .modal .form-select,
.painel-shell.painel-theme-dark .modal .form-control,
.painel-shell.painel-theme-dark .modal .form-select {
    background: #0C2344;
    color: #F8FAFC;
    border-color: rgba(148, 163, 184, 0.28);
}

body.pl-theme-dark .modal .form-control:focus,
body.pl-theme-dark .modal .form-select:focus,
body.painel-theme-dark .modal .form-control:focus,
body.painel-theme-dark .modal .form-select:focus,
.painel-shell.painel-theme-dark .modal .form-control:focus,
.painel-shell.painel-theme-dark .modal .form-select:focus {
    background: #0C2344;
    color: #F8FAFC;
    border-color: #D84D15;
    box-shadow: 0 0 0 0.2rem rgba(216, 77, 21, 0.25);
}

body.pl-theme-dark .modal .form-control option,
body.pl-theme-dark .modal .form-select option,
body.painel-theme-dark .modal .form-control option,
body.painel-theme-dark .modal .form-select option,
.painel-shell.painel-theme-dark .modal .form-select option {
    background: #0B1F3C;
    color: #F8FAFC;
}

body.pl-theme-dark .modal .form-floating > label,
body.painel-theme-dark .modal .form-floating > label,
.painel-shell.painel-theme-dark .modal .form-floating > label {
    color: #93A4BB;
}

body.pl-theme-dark .modal .text-dark,
body.pl-theme-dark .modal .text-black,
body.painel-theme-dark .modal .text-dark,
.painel-shell.painel-theme-dark .modal .text-dark {
    color: #F8FAFC !important;
}

body.pl-theme-dark .modal .bg-white,
body.pl-theme-dark .modal .bg-light,
body.painel-theme-dark .modal .bg-white,
.painel-shell.painel-theme-dark .modal .bg-white {
    background: #0C2344 !important;
    color: #F8FAFC !important;
}

body.pl-theme-dark .modal .btn-close,
body.painel-theme-dark .modal .btn-close,
.painel-shell.painel-theme-dark .modal .btn-close {
    filter: invert(1) grayscale(1) brightness(1.8);
    opacity: 0.85;
}

body.pl-theme-dark .modal .form-check-input,
body.painel-theme-dark .modal .form-check-input,
.painel-shell.painel-theme-dark .modal .form-check-input {
    background-color: #0C2344;
    border-color: rgba(148, 163, 184, 0.45);
}

body.pl-theme-dark .modal .card,
body.pl-theme-dark .modal .card-header,
body.painel-theme-dark .modal .card,
.painel-shell.painel-theme-dark .modal .card {
    background: #0C2344;
    color: #F8FAFC;
    border-color: rgba(148, 163, 184, 0.22);
}

body.pl-theme-dark .gp-tela .modal-title,
body.pl-theme-dark .gp-tela h5,
body.pl-theme-dark .gp-grid b,
body.pl-theme-dark .gp-topo b,
body.pl-theme-dark .gp-tempo strong,
body.painel-theme-dark .gp-tela .modal-title {
    color: #F8FAFC;
}

body.pl-theme-dark .gp-grid > div,
body.pl-theme-dark .gp-tempo,
body.pl-theme-dark .gp-relato,
body.painel-theme-dark .gp-grid > div {
    background: #0C2344;
    border-color: rgba(148, 163, 184, 0.22);
}

body.pl-theme-dark .gp-hero span,
body.pl-theme-dark .gp-topo span,
body.pl-theme-dark .gp-grid span,
body.pl-theme-dark .gp-relato small,
body.pl-theme-dark .gp-kicker,
body.pl-theme-dark .gp-evento small {
    color: #93A4BB;
}

body.pl-theme-dark .gp-tabela td {
    border-color: rgba(148, 163, 184, 0.16);
    color: #F8FAFC;
}

/* Modais: overlay na viewport (não no fluxo da página). Header/footer
   fixos; o corpo rola. O Bootstrap zera max-height no dialog centralizado. */
.modal,
.modal-backdrop {
    position: fixed;
}

.modal {
    overflow-x: hidden;
    overflow-y: auto;
}

.modal .modal-dialog {
    max-height: calc(100dvh - 1.5rem);
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
}

.modal .modal-dialog-centered,
.modal .modal-dialog-centered.modal-dialog-scrollable {
    height: auto;
    min-height: 0;
    max-height: calc(100dvh - 1.5rem);
    align-items: center;
}

.modal .modal-content,
.modal .modal-dialog-centered.modal-dialog-scrollable .modal-content,
.gp-tela.modal-content,
.sd-modal.modal-content,
.cobranca-finalizar.modal-content {
    max-height: calc(100dvh - 1.5rem);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.modal .modal-header,
.modal .modal-footer {
    flex: 0 0 auto;
}

.modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
