/**
 * Tema Escuro Global (Dark Mode)
 * Banco de Auxiliares da Justiça - Tribunal de Justiça de Alagoas (TJAL)
 *
 * Cores em conformidade com WCAG AA para máximo contraste e legibilidade.
 */

/* Layout do Topbar e Alinhamento Horizontal do Botão de Tema */
.m-topbar .m-topbar__nav-wrapper {
    vertical-align: middle !important;
}

.m-topbar .m-topbar__nav.m-nav--inline {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-direction: row !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
}

.m-topbar__theme-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    padding: 0 !important;
}

.theme-toggle-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    background: transparent !important;
    text-decoration: none !important;
}

.btn-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    font-size: 1.1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-theme-toggle:hover {
    background-color: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.theme-icon-sun {
    display: none;
    color: #fbbf24;
}

.theme-icon-moon {
    display: inline-block;
    color: #64748b;
}

html.theme-dark .btn-theme-toggle {
    background-color: #1e293b;
    border-color: #334155;
    color: #fbbf24;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

html.theme-dark .btn-theme-toggle:hover {
    background-color: #334155;
    border-color: #475569;
    color: #fef08a;
}

html.theme-dark .theme-icon-sun {
    display: inline-block;
}

html.theme-dark .theme-icon-moon {
    display: none;
}

/* ==========================================================================
   Fundo Global e Estrutura Principal
   ========================================================================== */
html.theme-dark,
html.theme-dark body,
html.theme-dark .m-page,
html.theme-dark .m-grid,
html.theme-dark .m-body,
html.theme-dark .m-wrapper {
    background-color: #0b1329 !important;
    color: #e2e8f0 !important;
}

html.theme-dark .m-content {
    background-color: transparent !important;
}

/* Header Superior */
html.theme-dark #m_header,
html.theme-dark .m-header {
    background-color: #0f172a !important;
    border-bottom: 1px solid #1e293b !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

html.theme-dark .m-topbar {
    background-color: transparent !important;
}

html.theme-dark .m-header-head {
    background-color: transparent !important;
}

/* Rodapé do Sistema (Footer) */
html.theme-dark footer,
html.theme-dark .m-footer,
html.theme-dark .m-grid__item.m-footer {
    background-color: #0f172a !important;
    border-top: 1px solid #1e293b !important;
    box-shadow: none !important;
}

html.theme-dark .m-footer .m-container,
html.theme-dark .m-footer .m-page__container {
    background-color: transparent !important;
}

html.theme-dark .m-footer__copyright,
html.theme-dark .m-footer .m-footer__copyright {
    color: #94a3b8 !important;
}

html.theme-dark .m-footer__copyright a,
html.theme-dark .m-footer a {
    color: #cbd5e1 !important;
}

html.theme-dark .m-footer__copyright a:hover,
html.theme-dark .m-footer a:hover {
    color: #60a5fa !important;
}

/* ==========================================================================
   Cards, Portlets e Painéis
   ========================================================================== */
html.theme-dark .card,
html.theme-dark .m-portlet,
html.theme-dark .card-modern,
html.theme-dark .m-portlet--skin-light,
html.theme-dark .card-search-box {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    color: #e2e8f0 !important;
}

html.theme-dark .card-header,
html.theme-dark .card-modern-header,
html.theme-dark .m-portlet__head {
    background-color: #1e293b !important;
    border-bottom: 1px solid #334155 !important;
    color: #f8fafc !important;
}

html.theme-dark .card-modern-title,
html.theme-dark .m-portlet__head-text,
html.theme-dark .card-title {
    color: #f8fafc !important;
}

html.theme-dark .card-body,
html.theme-dark .card-modern-body,
html.theme-dark .m-portlet__body {
    background-color: #1e293b !important;
    color: #cbd5e1 !important;
}

/* ==========================================================================
   Tipografia e Cores de Texto
   ========================================================================== */
html.theme-dark h1,
html.theme-dark h2,
html.theme-dark h3,
html.theme-dark h4,
html.theme-dark h5,
html.theme-dark h6 {
    color: #f8fafc !important;
}

html.theme-dark p {
    color: #cbd5e1;
}

html.theme-dark .text-dark {
    color: #f1f5f9 !important;
}

html.theme-dark .text-muted {
    color: #94a3b8 !important;
}

html.theme-dark hr,
html.theme-dark .border-top,
html.theme-dark .border-bottom,
html.theme-dark .border-left,
html.theme-dark .border-right,
html.theme-dark .border {
    border-color: #334155 !important;
}

/* Utilitários de Fundo Bootstrap no Modo Escuro */
html.theme-dark .bg-light {
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
}

html.theme-dark .bg-white {
    background-color: #1e293b !important;
    color: #cbd5e1 !important;
}

/* Barra de Ações de Análise e Homologação de Documentos */
html.theme-dark .bg-light.border-top {
    background-color: #0f172a !important;
    border-top: 1px solid #334155 !important;
}

/* Botões desabilitados e botões claros */
html.theme-dark .btn-secondary.disabled,
html.theme-dark .btn-secondary:disabled,
html.theme-dark .btn:disabled {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #64748b !important;
    opacity: 0.65 !important;
}

html.theme-dark .btn-light {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html.theme-dark .btn-light:hover {
    background-color: #1e293b !important;
    border-color: #475569 !important;
    color: #ffffff !important;
}

/* Fichas de Detalhes Cadastrais (Peritos e Inventariantes) */
html.theme-dark .detail-item-value {
    color: #f8fafc !important;
}

html.theme-dark .detail-item-label {
    color: #94a3b8 !important;
}

html.theme-dark .form-section-label {
    color: #60a5fa !important;
}

html.theme-dark .toggle-icon-btn {
    background-color: #0f172a !important;
    color: #94a3b8 !important;
    border: 1px solid #334155 !important;
}

html.theme-dark .card-modern-header.clickable:hover {
    background-color: #24344d !important;
}

html.theme-dark .card-modern-header.clickable:hover .toggle-icon-btn {
    background-color: #1e3a8a !important;
    color: #93c5fd !important;
}

/* ==========================================================================
   Formulários, Inputs e Labels
   ========================================================================== */
html.theme-dark label,
html.theme-dark .form-label-custom,
html.theme-dark .col-form-label {
    color: #cbd5e1 !important;
}

html.theme-dark .form-control,
html.theme-dark .form-control-custom,
html.theme-dark input[type="text"],
html.theme-dark input[type="password"],
html.theme-dark input[type="email"],
html.theme-dark textarea,
html.theme-dark select {
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
}

html.theme-dark .form-control:focus,
html.theme-dark .form-control-custom:focus,
html.theme-dark input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

html.theme-dark input::placeholder,
html.theme-dark textarea::placeholder {
    color: #64748b !important;
}

/* ==========================================================================
   Select2 no Modo Escuro
   ========================================================================== */
html.theme-dark .select2-container--default .select2-selection--single,
html.theme-dark .select2-container--bootstrap .select2-selection--single {
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
}

html.theme-dark .select2-container--default .select2-selection--single .select2-selection__rendered,
html.theme-dark .select2-container--bootstrap .select2-selection--single .select2-selection__rendered {
    color: #f8fafc !important;
}

html.theme-dark .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #64748b !important;
}

html.theme-dark .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #94a3b8 transparent transparent transparent !important;
}

html.theme-dark .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #94a3b8 transparent !important;
}

html.theme-dark .select2-dropdown {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

html.theme-dark .select2-search--dropdown {
    background-color: #1e293b !important;
}

html.theme-dark .select2-search--dropdown .select2-search__field {
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
}

html.theme-dark .select2-results__option {
    color: #cbd5e1 !important;
    background-color: transparent !important;
}

html.theme-dark .select2-results__option--highlighted[aria-selected],
html.theme-dark .select2-container--bootstrap .select2-results__option--highlighted[aria-selected] {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

html.theme-dark .select2-results__option[aria-selected="true"] {
    background-color: rgba(37, 99, 235, 0.2) !important;
    color: #60a5fa !important;
}

html.theme-dark .select2-results__options::-webkit-scrollbar-track {
    background: #0f172a !important;
}

html.theme-dark .select2-results__options::-webkit-scrollbar-thumb {
    background: #334155 !important;
}

/* ==========================================================================
   Tabelas e Listagens (Gerais e Modernas)
   ========================================================================== */
html.theme-dark .table,
html.theme-dark .table-history,
html.theme-dark .table-modern {
    background-color: #1e293b !important;
    color: #cbd5e1 !important;
}

html.theme-dark .table-modern-wrapper {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

html.theme-dark .table thead th,
html.theme-dark .table-history thead th,
html.theme-dark .table-modern thead th {
    background-color: #0f172a !important;
    color: #94a3b8 !important;
    border-bottom: 2px solid #334155 !important;
}

html.theme-dark .table tbody td,
html.theme-dark .table-history tbody td,
html.theme-dark .table-modern tbody td {
    background-color: #1e293b !important;
    border-bottom: 1px solid #334155 !important;
    color: #cbd5e1 !important;
}

html.theme-dark .table tbody tr:hover td,
html.theme-dark .table-history tbody tr:hover td,
html.theme-dark .table-modern tbody tr:hover td,
html.theme-dark .table-modern tbody tr:hover {
    background-color: #24344d !important;
}

/* Nomes dos Peritos e Usuários na Listagem - 100% Legível e Branco */
html.theme-dark .perito-name-text,
html.theme-dark .table-modern .perito-name-text,
html.theme-dark .pro-name,
html.theme-dark .table-modern .pro-name,
html.theme-dark .user-name-text,
html.theme-dark .table-modern .user-name-text,
html.theme-dark .table-modern td strong,
html.theme-dark .table-modern td b,
html.theme-dark .table-history .hist-name,
html.theme-dark .perito-name,
html.theme-dark .user-name {
    color: #f8fafc !important;
}

html.theme-dark .pro-email {
    color: #60a5fa !important;
}

html.theme-dark .pro-doc,
html.theme-dark .pro-phone {
    color: #94a3b8 !important;
}

/* Avatar do Perito e do Usuário na Listagem */
html.theme-dark .perito-avatar {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%) !important;
    color: #93c5fd !important;
    border: 1px solid #3b82f6 !important;
}

html.theme-dark .user-avatar {
    background: linear-gradient(135deg, #3730a3 0%, #1e1b4b 100%) !important;
    color: #c7d2fe !important;
    border: 1px solid #4f46e5 !important;
}

/* Badges de Perfil e Status na Gestão de Usuários */
html.theme-dark .profile-badge {
    background-color: rgba(14, 165, 233, 0.15) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
}

html.theme-dark .profile-badge-pre {
    background-color: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(251, 191, 36, 0.3) !important;
}

/* Custom Checkboxes no Modo Escuro */
html.theme-dark .custom-control-label {
    color: #e2e8f0 !important;
}

html.theme-dark .custom-control-label::before {
    background-color: #0f172a !important;
    border: 1px solid #475569 !important;
}

html.theme-dark .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
}

html.theme-dark .custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25) !important;
}

/* Badges e Status em Listagens */
html.theme-dark .status-badge-yes {
    background-color: rgba(34, 197, 94, 0.15) !important;
    color: #4ade80 !important;
    border: 1px solid rgba(74, 222, 128, 0.3) !important;
}

html.theme-dark .status-badge-no {
    background-color: rgba(148, 163, 184, 0.1) !important;
    color: #94a3b8 !important;
    border: 1px solid #334155 !important;
}

/* Botões de Ação na Listagem (Ícones de lupa, edição, ficha, etc.) */
html.theme-dark .btn-action-sm {
    border: 1px solid transparent !important;
}
html.theme-dark .btn-action-info {
    background-color: rgba(14, 165, 233, 0.15) !important;
    color: #38bdf8 !important;
    border-color: rgba(56, 189, 248, 0.3) !important;
}
html.theme-dark .btn-action-info:hover {
    background-color: #0284c7 !important;
    color: #ffffff !important;
}
html.theme-dark .btn-action-primary {
    background-color: rgba(37, 99, 235, 0.15) !important;
    color: #60a5fa !important;
    border-color: rgba(96, 165, 250, 0.3) !important;
}
html.theme-dark .btn-action-primary:hover {
    background-color: #2563eb !important;
    color: #ffffff !important;
}
html.theme-dark .btn-action-danger {
    background-color: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
}
html.theme-dark .btn-action-danger:hover {
    background-color: #dc2626 !important;
    color: #ffffff !important;
}
html.theme-dark .btn-action-disabled {
    background-color: #1e293b !important;
    color: #475569 !important;
    border-color: #334155 !important;
}

/* Filtros aplicados e chips */
html.theme-dark .applied-filters-box {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

html.theme-dark .filter-chip {
    background-color: rgba(37, 99, 235, 0.2) !important;
    color: #93c5fd !important;
    border-color: #2563eb !important;
}

/* Botões modernos secundários */
html.theme-dark .btn-modern-secondary {
    background-color: #1e293b !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

html.theme-dark .btn-modern-secondary:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
    border-color: #64748b !important;
}

/* Empty state */
html.theme-dark .empty-state-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

html.theme-dark .empty-state-icon {
    background-color: #0f172a !important;
    color: #64748b !important;
}

html.theme-dark .empty-state-title {
    color: #f8fafc !important;
}

html.theme-dark .empty-state-text {
    color: #94a3b8 !important;
}

/* Paginação no Modo Escuro */
html.theme-dark .pagination .page-item .page-link {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html.theme-dark .pagination .page-item.active .page-link {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}

html.theme-dark .pagination .page-item.disabled .page-link {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #475569 !important;
}

html.theme-dark .badge-light {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
}

html.theme-dark .table-history .hist-date {
    color: #f8fafc !important;
}

html.theme-dark .table-history .hist-name {
    color: #f8fafc !important;
}

html.theme-dark .table-history .hist-area {
    color: #94a3b8 !important;
}

html.theme-dark .badge-code {
    background-color: rgba(37, 99, 235, 0.2) !important;
    color: #60a5fa !important;
    border-color: #2563eb !important;
}

html.theme-dark .badge-code:hover {
    background-color: rgba(37, 99, 235, 0.35) !important;
}

/* ==========================================================================
   Tela de Sorteio de Peritos (Componentes Específicos)
   ========================================================================== */
html.theme-dark .aviso-inventariante-box {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html.theme-dark .result-card {
    background-color: #1e293b !important;
    border-color: #3b82f6 !important;
}

html.theme-dark .result-body {
    background-color: #1e293b !important;
}

html.theme-dark .perito-main-name {
    color: #f8fafc !important;
}

html.theme-dark .perito-profile-header {
    border-bottom-color: #334155 !important;
}

html.theme-dark .tag-tipo {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

html.theme-dark .badge-pessoa-fisica {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html.theme-dark .info-cell {
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
}

html.theme-dark .info-cell-label {
    color: #94a3b8 !important;
}

html.theme-dark .info-cell-value {
    color: #f1f5f9 !important;
}

html.theme-dark .actions-panel {
    background-color: #0f172a !important;
    border-top-color: #334155 !important;
}

html.theme-dark .btn-action-outline {
    background-color: #1e293b !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

html.theme-dark .btn-action-outline:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
}

html.theme-dark .empty-result-box {
    background-color: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}

html.theme-dark .empty-result-box h4 {
    color: #fbbf24 !important;
}

html.theme-dark .empty-result-box p {
    color: #fde68a !important;
}

/* ==========================================================================
   Modais e Dropdowns
   ========================================================================== */
html.theme-dark .modal-content {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #e2e8f0 !important;
}

html.theme-dark .modal-header {
    border-bottom: 1px solid #334155 !important;
}

html.theme-dark .modal-footer {
    border-top: 1px solid #334155 !important;
    background-color: #0f172a !important;
}

html.theme-dark .profile-dropdown-card {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}

html.theme-dark .profile-dropdown-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
}

html.theme-dark .profile-dropdown-body {
    background-color: #1e293b !important;
}

html.theme-dark .profile-action-item {
    color: #cbd5e1 !important;
}

html.theme-dark .profile-action-item:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
}

html.theme-dark .profile-logout-box {
    background-color: #0f172a !important;
    border-top: 1px solid #334155 !important;
}

/* ==========================================================================
   Central de Relatórios (Cards KPI e Hub de Relatórios)
   ========================================================================== */
html.theme-dark .kpi-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

html.theme-dark .kpi-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.45) !important;
}

html.theme-dark .kpi-title {
    color: #94a3b8 !important;
}

html.theme-dark .kpi-number-primary {
    color: #60a5fa !important;
}

html.theme-dark .kpi-number-success {
    color: #34d399 !important;
}

html.theme-dark .kpi-number-info {
    color: #38bdf8 !important;
}

html.theme-dark .kpi-number-purple {
    color: #c084fc !important;
}

html.theme-dark .kpi-icon-primary {
    background-color: rgba(37, 99, 235, 0.2) !important;
    color: #60a5fa !important;
}

html.theme-dark .kpi-icon-success {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
}

html.theme-dark .kpi-icon-info {
    background-color: rgba(2, 132, 199, 0.2) !important;
    color: #38bdf8 !important;
}

html.theme-dark .kpi-icon-purple {
    background-color: rgba(147, 51, 234, 0.2) !important;
    color: #c084fc !important;
}

html.theme-dark .section-title {
    color: #f8fafc !important;
}

html.theme-dark .hub-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

html.theme-dark .hub-card:hover {
    border-color: #475569 !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45) !important;
}

html.theme-dark .hub-card-title {
    color: #f8fafc !important;
}

html.theme-dark .hub-card-desc {
    color: #94a3b8 !important;
}

html.theme-dark .btn-hub-action {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html.theme-dark .btn-hub-action:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
}

html.theme-dark .hub-badge-perito {
    background-color: rgba(37, 99, 235, 0.2) !important;
    color: #93c5fd !important;
}

html.theme-dark .hub-badge-inventariante {
    background-color: rgba(147, 51, 234, 0.2) !important;
    color: #d8b4fe !important;
}

/* Ícones temáticos do Hub no Modo Escuro */
html.theme-dark .hub-icon-amber {
    background-color: rgba(217, 119, 6, 0.15) !important;
    color: #fbbf24 !important;
    border-color: rgba(217, 119, 6, 0.3) !important;
}

html.theme-dark .hub-icon-blue {
    background-color: rgba(37, 99, 235, 0.15) !important;
    color: #60a5fa !important;
    border-color: rgba(37, 99, 235, 0.3) !important;
}

html.theme-dark .hub-icon-green {
    background-color: rgba(5, 150, 105, 0.15) !important;
    color: #34d399 !important;
    border-color: rgba(5, 150, 105, 0.3) !important;
}

html.theme-dark .hub-icon-cyan {
    background-color: rgba(2, 132, 199, 0.15) !important;
    color: #38bdf8 !important;
    border-color: rgba(2, 132, 199, 0.3) !important;
}

html.theme-dark .hub-icon-orange {
    background-color: rgba(234, 88, 12, 0.15) !important;
    color: #fb923c !important;
    border-color: rgba(234, 88, 12, 0.3) !important;
}

html.theme-dark .hub-icon-purple {
    background-color: rgba(147, 51, 234, 0.15) !important;
    color: #c084fc !important;
    border-color: rgba(147, 51, 234, 0.3) !important;
}

/* ==========================================================================
   Aviso da Tela de Login (Cards de Escolha de Exibição de Popup)
   ========================================================================== */
html.theme-dark .switch-card {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

html.theme-dark .switch-card:hover {
    background-color: #1e293b !important;
    border-color: #475569 !important;
}

html.theme-dark .switch-card.selected-active {
    background-color: rgba(16, 185, 129, 0.12) !important;
    border-color: #10b981 !important;
}

html.theme-dark .switch-card.selected-inactive {
    background-color: rgba(100, 116, 139, 0.15) !important;
    border-color: #64748b !important;
}

html.theme-dark .switch-card-title {
    color: #f8fafc !important;
}

html.theme-dark .switch-card-title.text-success {
    color: #34d399 !important;
}

html.theme-dark .switch-card-title.text-secondary {
    color: #94a3b8 !important;
}

html.theme-dark .switch-card-desc {
    color: #94a3b8 !important;
}

html.theme-dark .switch-card input[type="radio"] {
    accent-color: #10b981;
}

/* ==========================================================================
   Tela de Login (Dark Mode)
   ========================================================================== */
.login-theme-toggle-wrapper {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 20;
}

@media (max-width: 860px) {
    .login-theme-toggle-wrapper {
        top: 16px;
        right: 16px;
    }
}

html.theme-dark .form-section {
    background-color: #0b1329 !important;
}

html.theme-dark .login-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(51, 65, 85, 0.8) !important;
}

html.theme-dark .panel-title {
    color: #f8fafc !important;
}

html.theme-dark .panel-desc {
    color: #94a3b8 !important;
}

html.theme-dark .form-label-custom {
    color: #cbd5e1 !important;
}

html.theme-dark .form-control-custom {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html.theme-dark .form-control-custom:focus {
    background-color: #0f172a !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15) !important;
}

html.theme-dark .input-icon-left {
    color: #64748b !important;
}

html.theme-dark .password-toggle-btn {
    color: #94a3b8 !important;
}

html.theme-dark .password-toggle-btn:hover {
    color: #f8fafc !important;
    background-color: #334155 !important;
}

html.theme-dark .custom-checkbox-container {
    color: #cbd5e1 !important;
}

html.theme-dark .custom-checkmark {
    background-color: #0f172a !important;
    border-color: #475569 !important;
}

html.theme-dark .custom-checkbox-container input:checked ~ .custom-checkmark {
    background-color: #0284c7 !important;
    border-color: #0284c7 !important;
}

html.theme-dark .auth-link {
    color: #38bdf8 !important;
}

html.theme-dark .auth-link:hover {
    color: #7dd3fc !important;
}

html.theme-dark .signup-promo-box {
    border-top-color: #334155 !important;
}

html.theme-dark .signup-promo-text {
    color: #94a3b8 !important;
}

html.theme-dark .signup-promo-btn {
    background-color: rgba(2, 132, 199, 0.15) !important;
    border-color: rgba(2, 132, 199, 0.35) !important;
    color: #38bdf8 !important;
}

html.theme-dark .signup-promo-btn:hover {
    background-color: rgba(2, 132, 199, 0.25) !important;
    color: #7dd3fc !important;
}

html.theme-dark .manual-item {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html.theme-dark .manual-item:hover {
    background-color: #1e293b !important;
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
}

html.theme-dark .manual-title-text {
    color: #f8fafc !important;
}

html.theme-dark .manual-item-arrow {
    color: #64748b !important;
}

/* Modal Popup de Aviso na Tela de Login */
html.theme-dark .aviso-login-modal {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.6) !important;
}

html.theme-dark .aviso-login-body {
    color: #cbd5e1 !important;
}

html.theme-dark .aviso-login-text {
    color: #f8fafc !important;
}

html.theme-dark .aviso-login-org-badge {
    background-color: #0f172a !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

html.theme-dark .aviso-login-footer {
    background-color: #0f172a !important;
    border-top-color: #334155 !important;
}

html.theme-dark .btn-aviso-login-confirm {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
}

/* ==========================================================================
   Loading Overlay
   ========================================================================== */
html.theme-dark #loading-overlay {
    background: rgba(11, 19, 41, 0.85) !important;
}

html.theme-dark #loading-overlay div {
    color: #e2e8f0 !important;
}

/* ==========================================================================
   Consulta Pública Transparente (Dark Mode)
   ========================================================================== */
html.theme-dark .public-navbar {
    background-color: #091322 !important;
    border-bottom: 1px solid #1e293b !important;
}

html.theme-dark .public-navbar .btn-theme-toggle {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #fbbf24 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4) !important;
}

html.theme-dark .public-navbar .btn-theme-toggle:hover {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #fef08a !important;
}

html.theme-dark .public-hero {
    background: linear-gradient(145deg, #070d19 0%, #0b1d33 55%, #050b14 100%) !important;
}

html.theme-dark .search-card-container {
    background: #1e293b !important;
    background-clip: padding-box !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.45) !important;
}

html.theme-dark .search-field-label {
    color: #f8fafc !important;
}

html.theme-dark .search-field-label i,
html.theme-dark .search-field-label svg {
    color: #38bdf8 !important;
}

html.theme-dark .btn-clear-action {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html.theme-dark .btn-clear-action:hover {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

html.theme-dark .btn-download-pdf-action {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
    color: #f87171 !important;
}

html.theme-dark .btn-download-pdf-action:hover {
    background-color: rgba(239, 68, 68, 0.25) !important;
    border-color: rgba(239, 68, 68, 0.55) !important;
    color: #fca5a5 !important;
}

html.theme-dark .results-card-container {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.4) !important;
}

html.theme-dark .results-header-bar {
    background: #1e293b !important;
    border-bottom: 1px solid #334155 !important;
}

html.theme-dark .results-count-title {
    color: #f8fafc !important;
}

html.theme-dark .results-badge-count {
    background-color: rgba(34, 197, 94, 0.15) !important;
    border: 1px solid rgba(74, 222, 128, 0.3) !important;
    color: #4ade80 !important;
}

html.theme-dark .results-filtered-hint {
    color: #94a3b8 !important;
}

html.theme-dark .modern-table th {
    background-color: #0f172a !important;
    color: #94a3b8 !important;
    border-bottom: 1.5px solid #334155 !important;
}

html.theme-dark .modern-table td {
    background-color: #1e293b !important;
    border-bottom: 1px solid #334155 !important;
    color: #cbd5e1 !important;
}

html.theme-dark .modern-table tbody tr:hover td {
    background-color: #24344d !important;
}

html.theme-dark .status-homologado-badge {
    background-color: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
    color: #34d399 !important;
}

html.theme-dark .specialty-pill {
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #cbd5e1 !important;
}

html.theme-dark .specialty-pill:hover {
    background-color: #1e3a8a !important;
    border-color: #3b82f6 !important;
    color: #93c5fd !important;
}

html.theme-dark .empty-state-icon {
    background-color: #0f172a !important;
    color: #64748b !important;
}

html.theme-dark .empty-state-title {
    color: #f8fafc !important;
}

html.theme-dark .empty-state-desc {
    color: #94a3b8 !important;
}

html.theme-dark .pagination-container {
    background: #1e293b !important;
    border-top: 1px solid #334155 !important;
}

html.theme-dark .pagination-container .page-item .page-link {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html.theme-dark .pagination-container .page-item .page-link:hover {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

html.theme-dark .pagination-container .page-item.active .page-link {
    background-color: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4) !important;
}

html.theme-dark .pagination-container .page-item.disabled .page-link {
    background-color: #0b1329 !important;
    border-color: #1e293b !important;
    color: #475569 !important;
}

html.theme-dark .public-footer {
    background-color: #070d19 !important;
    border-top: 1px solid #1e293b !important;
}

html.theme-dark .public-footer-copy {
    color: #94a3b8 !important;
}

