/* ==========================================================================
   PERFEX CRM - MODERN DARK THEME: ALTO CONTRASTE FINANCEIRO
   Arquivo: contrast_finance.css
   Escopo: body.dark-theme
   Grupo: Despesas (e categorias), Faturas, Pagamentos, Itens, Notas de Crédito,
          Relatórios Financeiros, Dashboards Financeiros e Cards de Totais.
   ========================================================================== */

/* ==========================================================================
   1. CARDS DE TOTAIS E QUICK STATS FINANCEIROS
   ========================================================================== */

/* Cards de Totais: Despesas (#expenses_total) */
body.dark-theme #expenses_total dl > div,
body.dark-theme #expenses_total dl > div.tw-bg-white {
    background-color: #1a2333 !important;
    border-color: #2d3b55 !important;
    color: #f1f5f9 !important;
}

body.dark-theme #expenses_total dl dd div,
body.dark-theme #expenses_total dl dd div.tw-text-neutral-600 {
    color: #f8fafc !important;
    font-weight: 600;
}

/* Cards de Totais: Faturas (#invoices_total) */
body.dark-theme #invoices_total dl > div,
body.dark-theme #invoices_total dl > div.tw-bg-white,
body.dark-theme #invoices_total div.tw-border.tw-bg-white {
    background-color: #1a2333 !important;
    border-color: #2d3b55 !important;
    color: #f1f5f9 !important;
}

body.dark-theme #invoices_total dl dd div,
body.dark-theme #invoices_total dl dd div.tw-text-neutral-600,
body.dark-theme #invoices_total div.tw-font-medium {
    color: #f8fafc !important;
}

/* Quick Stats no Topo das Faturas (.quick-top-stats) */
body.dark-theme .quick-top-stats button,
body.dark-theme .quick-top-stats button.tw-bg-white {
    background-color: #1a2333 !important;
    border-color: #2d3b55 !important;
    color: #f1f5f9 !important;
}

body.dark-theme .quick-top-stats button:hover,
body.dark-theme .quick-top-stats button:focus {
    background-color: #243049 !important;
    border-color: #3b82f6 !important;
}

body.dark-theme .quick-top-stats button .tw-text-neutral-600 {
    color: #f8fafc !important;
}

body.dark-theme .quick-top-stats button .tw-text-neutral-500 {
    color: #cbd5e1 !important;
}

/* Dashboard Quick Stats: Faturas e Métricas Financeiras */
body.dark-theme .quick-stats-invoices .top_stats_wrapper {
    background-color: #1a2333 !important;
    border-color: #2d3b55 !important;
    color: #f1f5f9 !important;
}

body.dark-theme .quick-stats-invoices .top_stats_wrapper .tw-text-neutral-800,
body.dark-theme .quick-stats-invoices .top_stats_wrapper .text-neutral-600,
body.dark-theme .quick-stats-invoices .top_stats_wrapper .tw-text-neutral-600 {
    color: #f1f5f9 !important;
}

body.dark-theme .quick-stats-invoices .top_stats_wrapper svg {
    color: #94a3b8 !important;
}

/* ==========================================================================
   2. DESPESAS E CATEGORIAS (EXPENSES & CATEGORIES)
   ========================================================================== */

/* Tabelas de Despesas e Categorias */
body.dark-theme table.table-expenses,
body.dark-theme table.expenses,
body.dark-theme table#expenses,
body.dark-theme table.table-expenses-categories,
body.dark-theme table#expenses-categories {
    color: #f1f5f9 !important;
}

body.dark-theme table.table-expenses tbody td,
body.dark-theme table.table-expenses-categories tbody td {
    color: #f1f5f9 !important;
}

body.dark-theme table.table-expenses tbody td a:not(.btn):not(.label):not(.badge),
body.dark-theme table.table-expenses-categories tbody td a:not(.btn):not(.label):not(.badge) {
    color: #bfdbfe !important;
}

body.dark-theme table.table-expenses tbody td a:not(.btn):not(.label):not(.badge):hover,
body.dark-theme table.table-expenses-categories tbody td a:not(.btn):not(.label):not(.badge):hover {
    color: #ffffff !important;
    text-decoration: underline;
}

/* Painel de Visualização / Preview de Despesas (#expense) */
body.dark-theme #expenseHeadings #expenseCategory,
body.dark-theme #expenseHeadings .tw-text-neutral-700 {
    color: #f8fafc !important;
}

body.dark-theme #expenseHeadings #expenseName,
body.dark-theme #expenseHeadings #expenserCreator,
body.dark-theme #expenseHeadings .tw-text-neutral-500 {
    color: #cbd5e1 !important;
}

body.dark-theme #expenseHeadings #expenserCreator a {
    color: #bfdbfe !important;
}

body.dark-theme #expenseHeadings #expenserCreator a:hover {
    color: #ffffff !important;
}

body.dark-theme #amountWrapper .bold,
body.dark-theme #amountWrapper .font-medium,
body.dark-theme #amountWrapper span {
    color: #f8fafc !important;
}

body.dark-theme #tab_expense p,
body.dark-theme #tab_expense p span.bold,
body.dark-theme #tab_expense .bold {
    color: #f1f5f9 !important;
}

body.dark-theme #tab_expense p .text-muted,
body.dark-theme #tab_expense span.text-muted,
body.dark-theme #tab_expense .text-muted.text-sm {
    color: #cbd5e1 !important;
}

body.dark-theme #tab_expense .text-muted.mbot15 {
    color: #e5e7eb !important;
}

body.dark-theme #tab_child_expenses .list-group-item {
    background-color: #151c2c !important;
    border-color: #243049 !important;
    color: #f1f5f9 !important;
}

body.dark-theme #tab_child_expenses .list-group-item a {
    color: #bfdbfe !important;
}

body.dark-theme #tab_child_expenses .list-group-item a:hover {
    color: #ffffff !important;
}

body.dark-theme #expenseReceipt h4 {
    color: #f8fafc !important;
}

body.dark-theme .dropzone-expense-preview,
body.dark-theme #dropzoneDragArea {
    background-color: #111827 !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

/* Formulário de Cadastro/Edição de Despesas */
body.dark-theme #expense-form .tw-bg-neutral-50 {
    background-color: #1a2333 !important;
    border-color: #2d3b55 !important;
}

body.dark-theme #expense-form .tw-text-neutral-700,
body.dark-theme #expense-form h4 {
    color: #f8fafc !important;
}

body.dark-theme #expense-form .tw-text-neutral-500 {
    color: #cbd5e1 !important;
}

body.dark-theme #expense-form a:not(.btn):not(.label):not(.badge) {
    color: #bfdbfe;
}

body.dark-theme #expense-form a:not(.btn):not(.label):not(.badge):hover {
    color: #ffffff;
}

/* ==========================================================================
   3. FATURAS (INVOICES & RECURRING INVOICES)
   ========================================================================== */

/* Tabelas de Faturas */
body.dark-theme table.table-invoices,
body.dark-theme table.invoices,
body.dark-theme table#invoices,
body.dark-theme table.table-recurring-invoices,
body.dark-theme table.recurring-invoices {
    color: #f1f5f9 !important;
}

body.dark-theme table.table-invoices tbody td,
body.dark-theme table.table-recurring-invoices tbody td {
    color: #f1f5f9 !important;
}

body.dark-theme table.table-invoices tbody td a:not(.btn):not(.label):not(.badge),
body.dark-theme table.table-recurring-invoices tbody td a:not(.btn):not(.label):not(.badge) {
    color: #bfdbfe !important;
}

body.dark-theme table.table-invoices tbody td a:not(.btn):not(.label):not(.badge):hover,
body.dark-theme table.table-recurring-invoices tbody td a:not(.btn):not(.label):not(.badge):hover {
    color: #ffffff !important;
    text-decoration: underline;
}

/* Bloco de Mesclagem de Faturas (.mergeable-invoices) */
body.dark-theme .mergeable-invoices {
    background-color: #151c2c !important;
    border: 1px solid #243049 !important;
}

body.dark-theme .mergeable-invoices h4 {
    color: #f8fafc !important;
}

body.dark-theme .mergeable-invoices .tw-text-neutral-500 {
    color: #cbd5e1 !important;
}

body.dark-theme .mergeable-invoices a.tw-font-medium {
    color: #bfdbfe !important;
}

body.dark-theme .mergeable-invoices a.tw-font-medium:hover {
    color: #ffffff !important;
}

/* Preview de Fatura (#invoice-preview) */
body.dark-theme #invoice-preview #invoice-number,
body.dark-theme #invoice-preview h4.bold,
body.dark-theme #invoice-preview h4.font-medium {
    color: #f8fafc !important;
}

body.dark-theme #invoice-preview address,
body.dark-theme #invoice-preview address.tw-text-neutral-500,
body.dark-theme #invoice-preview p.no-mbot,
body.dark-theme #invoice-preview span.bold {
    color: #e5e7eb !important;
}

body.dark-theme #invoice-preview a:not(.btn):not(.label):not(.badge) {
    color: #bfdbfe !important;
}

body.dark-theme #invoice-preview a:not(.btn):not(.label):not(.badge):hover {
    color: #ffffff !important;
}

/* Tabela de Itens da Fatura (Visualização/Preview - table.items) */
body.dark-theme table.items,
body.dark-theme table.items-preview {
    color: #f1f5f9 !important;
}

body.dark-theme table.items thead th,
body.dark-theme table.items-preview thead th {
    background-color: #101725 !important;
    border-color: #243049 !important;
    color: #f8fafc !important;
}

body.dark-theme table.items tbody td,
body.dark-theme table.items-preview tbody td {
    border-color: #243049 !important;
    color: #f1f5f9 !important;
}

body.dark-theme table.items tbody td strong,
body.dark-theme table.items-preview tbody td strong {
    color: #f8fafc !important;
}

/* Correção crítica: anular style="color:#424242;" hardcoded na descrição longa */
body.dark-theme table.items td.description span,
body.dark-theme table.items-preview td.description span,
body.dark-theme table.items td.description span[style*="color:#424242"],
body.dark-theme table.items td.description span[style*="color: #424242"],
body.dark-theme table.items-preview td.description span[style*="color:#424242"],
body.dark-theme table.items-preview td.description span[style*="color: #424242"] {
    color: #e5e7eb !important;
}

/* Tabela de Totais / Resumo Financeiro da Fatura */
body.dark-theme #invoice-preview table.table.text-right,
body.dark-theme .invoice table.table.text-right {
    color: #f1f5f9 !important;
}

body.dark-theme #invoice-preview table.table tr#subtotal td,
body.dark-theme #invoice-preview table.table tr.tax-area td,
body.dark-theme #invoice-preview table.table tr td.subtotal,
body.dark-theme #invoice-preview table.table tr td.discount,
body.dark-theme #invoice-preview table.table tr td.adjustment,
body.dark-theme #invoice-preview table.table tr td.total,
body.dark-theme #invoice-preview table.table tr td span.tw-font-medium,
body.dark-theme #invoice-preview table.table tr td span.tw-text-neutral-700,
body.dark-theme #invoice-preview table.table tr td.!tw-text-neutral-700 {
    color: #f1f5f9 !important;
}

body.dark-theme #invoice-preview table.table tr td.total,
body.dark-theme .invoice table.table tr td.total {
    color: #ffffff !important;
    font-weight: 700;
}

/* Formulário de Faturas (.accounting-template) */
body.dark-theme .accounting-template table.invoice-items-table,
body.dark-theme .accounting-template table.table-main-invoice-edit {
    color: #f1f5f9 !important;
}

body.dark-theme .accounting-template table.invoice-items-table thead th,
body.dark-theme .accounting-template table.table-main-invoice-edit thead th {
    background-color: #101725 !important;
    border-color: #243049 !important;
    color: #f8fafc !important;
}

body.dark-theme .accounting-template table.invoice-items-table tbody td,
body.dark-theme .accounting-template table.table-main-invoice-edit tbody td {
    border-color: #243049 !important;
    color: #f1f5f9 !important;
}

body.dark-theme .accounting-template tr#subtotal td,
body.dark-theme .accounting-template tr#subtotal span,
body.dark-theme .accounting-template tr#discount_area td,
body.dark-theme .accounting-template tr#discount_area span,
body.dark-theme .accounting-template td.subtotal,
body.dark-theme .accounting-template td.discount-total,
body.dark-theme .accounting-template td.adjustment,
body.dark-theme .accounting-template td.total,
body.dark-theme .accounting-template .tw-text-neutral-700 {
    color: #f1f5f9 !important;
}

body.dark-theme #invoice_top_info .panel-body {
    background-color: #151c2c !important;
    border-color: #243049 !important;
    color: #f1f5f9 !important;
}

/* Tabela de Pagamentos na Fatura (#invoice_payments_received & tr.payment) */
body.dark-theme tr.payment td {
    color: #f1f5f9 !important;
}

body.dark-theme tr.payment td a:not(.btn):not(.label):not(.badge) {
    color: #bfdbfe !important;
}

body.dark-theme tr.payment td a:not(.btn):not(.label):not(.badge):hover {
    color: #ffffff !important;
}

body.dark-theme tr.payment .tw-text-neutral-500 {
    color: #94a3b8 !important;
}

body.dark-theme tr.payment a.tw-text-neutral-500:hover {
    color: #ffffff !important;
}

/* ==========================================================================
   4. PAGAMENTOS (PAYMENTS)
   ========================================================================== */

/* Tabela de Pagamentos */
body.dark-theme table.table-payments,
body.dark-theme table.payments {
    color: #f1f5f9 !important;
}

body.dark-theme table.table-payments tbody td {
    color: #f1f5f9 !important;
}

body.dark-theme table.table-payments tbody td a:not(.btn):not(.label):not(.badge) {
    color: #bfdbfe !important;
}

body.dark-theme table.table-payments tbody td a:not(.btn):not(.label):not(.badge):hover {
    color: #ffffff !important;
    text-decoration: underline;
}

/* Tela de Recibo / Detalhes de Pagamento (payment.php / #tab_receipt) */
body.dark-theme #tab_receipt h3.tw-text-neutral-700,
body.dark-theme #tab_receipt h4.tw-text-neutral-800 {
    color: #f8fafc !important;
}

body.dark-theme #tab_receipt p.tw-text-neutral-600,
body.dark-theme #tab_receipt p.tw-text-neutral-600 span.pull-right,
body.dark-theme #tab_receipt address.tw-text-neutral-500 {
    color: #e5e7eb !important;
}

/* Bloco de Valor Total Pago (.tw-bg-neutral-100) */
body.dark-theme #tab_receipt div.tw-bg-neutral-100 {
    background-color: #1a2333 !important;
    border: 1px solid #2d3b55 !important;
    color: #f1f5f9 !important;
}

body.dark-theme #tab_receipt div.tw-bg-neutral-100 span.tw-font-medium {
    color: #94a3b8 !important;
}

body.dark-theme #tab_receipt div.tw-bg-neutral-100 span.tw-font-bold {
    color: #ffffff !important;
}

/* Tabela de faturas vinculadas ao pagamento */
body.dark-theme #tab_receipt table.table-bordered {
    border-color: #243049 !important;
}

body.dark-theme #tab_receipt table.table-bordered thead th {
    background-color: #101725 !important;
    border-color: #243049 !important;
    color: #f8fafc !important;
}

body.dark-theme #tab_receipt table.table-bordered tbody td {
    border-color: #243049 !important;
    color: #f1f5f9 !important;
}

body.dark-theme #tab_receipt table.table-bordered tbody td a:not(.btn):not(.label):not(.badge) {
    color: #bfdbfe !important;
}

/* Modal de Pagamentos em Lote (#batch-payment-modal) */
body.dark-theme #batch-payment-modal table.table-bordered thead th {
    background-color: #101725 !important;
    border-color: #243049 !important;
    color: #f8fafc !important;
}

body.dark-theme #batch-payment-modal table.table-bordered tbody td {
    border-color: #243049 !important;
    color: #f1f5f9 !important;
}

body.dark-theme #batch-payment-modal table.table-bordered tbody td a.text-dark {
    color: #f1f5f9 !important;
}

body.dark-theme #batch-payment-modal table.table-bordered tbody td a:not(.btn):not(.label):not(.badge) {
    color: #bfdbfe !important;
}

/* ==========================================================================
   5. ITENS DE FATURAS E GRUPOS (INVOICE ITEMS & GROUPS)
   ========================================================================== */

/* Tabela de Itens */
body.dark-theme table.table-invoice-items {
    color: #f1f5f9 !important;
}

body.dark-theme table.table-invoice-items tbody td {
    color: #f1f5f9 !important;
}

body.dark-theme table.table-invoice-items tbody td a:not(.btn):not(.label):not(.badge) {
    color: #bfdbfe !important;
}

body.dark-theme table.table-invoice-items tbody td a:not(.btn):not(.label):not(.badge):hover {
    color: #ffffff !important;
    text-decoration: underline;
}

/* Grupos de Itens (table.table-items-groups) */
body.dark-theme table.table-items-groups tbody td {
    color: #f1f5f9 !important;
}

body.dark-theme table.table-items-groups .group_name_plain_text {
    color: #f1f5f9 !important;
}

body.dark-theme table.table-items-groups .row-options a.edit-item-group {
    color: #bfdbfe !important;
}

body.dark-theme table.table-items-groups .row-options a.edit-item-group:hover {
    color: #ffffff !important;
}

/* Selectpicker de Itens */
body.dark-theme .items-select-wrapper .bootstrap-select .text-muted,
body.dark-theme .items-select-wrapper .bootstrap-select small {
    color: #cbd5e1 !important;
}

/* ==========================================================================
   6. NOTAS DE CRÉDITO (CREDIT NOTES)
   ========================================================================== */

/* Tabela de Notas de Crédito */
body.dark-theme table.table-credit-notes,
body.dark-theme table.credit-notes {
    color: #f1f5f9 !important;
}

body.dark-theme table.table-credit-notes tbody td {
    color: #f1f5f9 !important;
}

body.dark-theme table.table-credit-notes tbody td a:not(.btn):not(.label):not(.badge) {
    color: #bfdbfe !important;
}

body.dark-theme table.table-credit-notes tbody td a:not(.btn):not(.label):not(.badge):hover {
    color: #ffffff !important;
    text-decoration: underline;
}

/* Preview de Nota de Crédito (#credit-note-preview) */
body.dark-theme #credit-note-preview #credit-note-number,
body.dark-theme #credit-note-preview h4.bold {
    color: #f8fafc !important;
}

body.dark-theme #credit-note-preview address,
body.dark-theme #credit-note-preview address.tw-text-neutral-500,
body.dark-theme #credit-note-preview p.no-mbot,
body.dark-theme #credit-note-preview span.bold {
    color: #e5e7eb !important;
}

body.dark-theme #credit-note-preview .tw-text-neutral-500.tw-leading-relaxed {
    color: #cbd5e1 !important;
}

body.dark-theme #credit-note-preview a:not(.btn):not(.label):not(.badge) {
    color: #bfdbfe !important;
}

body.dark-theme #credit-note-preview a:not(.btn):not(.label):not(.badge):hover {
    color: #ffffff !important;
}

/* Totais da Nota de Crédito */
body.dark-theme #credit-note-preview table.table tr#subtotal td,
body.dark-theme #credit-note-preview table.table tr.tax-area td,
body.dark-theme #credit-note-preview table.table tr td.subtotal,
body.dark-theme #credit-note-preview table.table tr td.discount,
body.dark-theme #credit-note-preview table.table tr td.adjustment,
body.dark-theme #credit-note-preview table.table tr td.total,
body.dark-theme #credit-note-preview table.table tr td span.tw-font-medium,
body.dark-theme #credit-note-preview table.table tr td span.tw-text-neutral-700 {
    color: #f1f5f9 !important;
}

body.dark-theme #credit-note-preview table.table tr td.total {
    color: #ffffff !important;
    font-weight: 700;
}

/* Faturas Creditadas (#invoices_credited) */
body.dark-theme #invoices_credited table.table-bordered thead th {
    background-color: #101725 !important;
    border-color: #243049 !important;
    color: #f8fafc !important;
}

body.dark-theme #invoices_credited table.table-bordered tbody td {
    border-color: #243049 !important;
    color: #f1f5f9 !important;
}

body.dark-theme #invoices_credited table.table-bordered tbody td a:not(.btn):not(.label):not(.badge) {
    color: #bfdbfe !important;
}

/* Modal de Aplicação de Créditos (.apply-credits-to-invoice) */
body.dark-theme .apply-credits-to-invoice .credits-table table thead th {
    background-color: #101725 !important;
    border-color: #243049 !important;
    color: #f8fafc !important;
}

body.dark-theme .apply-credits-to-invoice .credits-table table tbody td {
    border-color: #243049 !important;
    color: #f1f5f9 !important;
}

body.dark-theme .apply-credits-to-invoice .amount-to-credit,
body.dark-theme .apply-credits-to-invoice .credit-note-balance-due {
    color: #f8fafc !important;
}

/* ==========================================================================
   7. RELATÓRIOS FINANCEIROS (FINANCIAL REPORTS)
   ========================================================================== */

/* Menu Lateral / Navegação de Relatórios (reports/sales.php) */
body.dark-theme ul.reports a.group.tw-text-neutral-500 {
    color: #cbd5e1 !important;
}

body.dark-theme ul.reports a.group:hover,
body.dark-theme ul.reports a.group:focus {
    background-color: #1e293b !important;
    color: #ffffff !important;
}

body.dark-theme ul.reports a.group[data-active="true"] {
    background-color: #1a2333 !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

body.dark-theme ul.reports a.group svg.tw-text-neutral-500 {
    color: #94a3b8 !important;
}

body.dark-theme ul.reports a.group:hover svg,
body.dark-theme ul.reports a.group[data-active="true"] svg {
    color: #60a5fa !important;
}

body.dark-theme .sm\:tw-border-neutral-200 {
    border-color: #243049 !important;
}

body.dark-theme #report h4.tw-text-neutral-700 {
    color: #f8fafc !important;
}

/* Relatório de Faturas (table.table-invoices-report) */
body.dark-theme table.table-invoices-report thead th {
    background-color: #101725 !important;
    border-color: #243049 !important;
    color: #f8fafc !important;
}

body.dark-theme table.table-invoices-report tbody td {
    border-color: #243049 !important;
    color: #f1f5f9 !important;
}

body.dark-theme table.table-invoices-report tbody td a:not(.btn):not(.label):not(.badge) {
    color: #bfdbfe !important;
}

body.dark-theme table.table-invoices-report tfoot td {
    background-color: #101725 !important;
    border-color: #243049 !important;
    color: #f8fafc !important;
    font-weight: 700;
}

/* Relatório de Pagamentos Recebidos (table.table-payments-received-report) */
body.dark-theme table.table-payments-received-report thead th {
    background-color: #101725 !important;
    border-color: #243049 !important;
    color: #f8fafc !important;
}

body.dark-theme table.table-payments-received-report tbody td {
    border-color: #243049 !important;
    color: #f1f5f9 !important;
}

body.dark-theme table.table-payments-received-report tbody td a:not(.btn):not(.label):not(.badge) {
    color: #bfdbfe !important;
}

body.dark-theme table.table-payments-received-report tfoot td {
    background-color: #101725 !important;
    border-color: #243049 !important;
    color: #f8fafc !important;
    font-weight: 700;
}

/* Relatório de Notas de Crédito (table.table-credit-notes-report) */
body.dark-theme table.table-credit-notes-report thead th {
    background-color: #101725 !important;
    border-color: #243049 !important;
    color: #f8fafc !important;
}

body.dark-theme table.table-credit-notes-report tbody td {
    border-color: #243049 !important;
    color: #f1f5f9 !important;
}

body.dark-theme table.table-credit-notes-report tbody td a:not(.btn):not(.label):not(.badge) {
    color: #bfdbfe !important;
}

body.dark-theme table.table-credit-notes-report tfoot td {
    background-color: #101725 !important;
    border-color: #243049 !important;
    color: #f8fafc !important;
    font-weight: 700;
}

/* Relatório de Itens Vendidos (table.table-items-report) */
body.dark-theme table.table-items-report thead th {
    background-color: #101725 !important;
    border-color: #243049 !important;
    color: #f8fafc !important;
}

body.dark-theme table.table-items-report tbody td {
    border-color: #243049 !important;
    color: #f1f5f9 !important;
}

body.dark-theme table.table-items-report tfoot td {
    background-color: #101725 !important;
    border-color: #243049 !important;
    color: #f8fafc !important;
    font-weight: 700;
}

/* Relatório Anual de Despesas (table.expenses-report#expenses-report-table) */
body.dark-theme table.expenses-report thead th,
body.dark-theme table#expenses-report-table thead th {
    background-color: #101725 !important;
    border-color: #243049 !important;
    color: #f8fafc !important;
}

body.dark-theme table.expenses-report tbody td,
body.dark-theme table#expenses-report-table tbody td {
    border-color: #243049 !important;
    color: #f1f5f9 !important;
}

body.dark-theme table.expenses-report tbody tr:hover td,
body.dark-theme table#expenses-report-table tbody tr:hover td {
    background-color: #1e293b !important;
    color: #ffffff !important;
}

/* Relatório Detalhado de Despesas (#expenses_detailed_report) */
body.dark-theme table#expenses_detailed_report thead th {
    background-color: #101725 !important;
    border-color: #243049 !important;
    color: #f8fafc !important;
}

body.dark-theme table#expenses_detailed_report tbody td {
    border-color: #243049 !important;
    color: #f1f5f9 !important;
}

body.dark-theme table#expenses_detailed_report tbody td a:not(.btn):not(.label):not(.badge) {
    color: #bfdbfe !important;
}

body.dark-theme table#expenses_detailed_report tfoot td {
    background-color: #101725 !important;
    border-color: #243049 !important;
    color: #f8fafc !important;
    font-weight: 700;
}

/* ==========================================================================
   8. DASHBOARDS FINANCEIROS (DASHBOARD WIDGETS)
   ========================================================================== */

/* Widget Finance Overview (.finance-summary) */
body.dark-theme .finance-summary .text-neutral-700,
body.dark-theme .finance-summary p.text-neutral-700,
body.dark-theme .finance-summary span.tw-font-medium {
    color: #f8fafc !important;
}

body.dark-theme .finance-summary svg.tw-text-neutral-500 {
    color: #94a3b8 !important;
}

body.dark-theme .finance-summary .text-stats-wrapper a.text-muted {
    color: #cbd5e1 !important;
}

body.dark-theme .finance-summary .text-stats-wrapper a.text-muted:hover {
    color: #ffffff !important;
}

body.dark-theme .finance-summary .text-stats-wrapper span._total {
    color: #f8fafc !important;
}

body.dark-theme .finance-summary .progress-finance-status.tw-text-neutral-400 {
    color: #94a3b8 !important;
}

/* Widget Payments Chart (#payments) */
body.dark-theme #payments span.tw-text-neutral-700 {
    color: #f8fafc !important;
}

body.dark-theme #payments svg.tw-text-neutral-500 {
    color: #94a3b8 !important;
}

body.dark-theme #payments .tw-divide-neutral-300 {
    border-color: #243049 !important;
}

body.dark-theme #payments a#PaymentChartmode,
body.dark-theme #payments a.tw-pl-2 {
    color: #bfdbfe !important;
}

body.dark-theme #payments a#PaymentChartmode:hover,
body.dark-theme #payments a.tw-pl-2:hover {
    color: #ffffff !important;
}

/* ==========================================================================
   9. SALVAGUARDAS SEMÂNTICAS (PRESERVAÇÃO DE CORES DE STATUS & BADGES)
   ========================================================================== */

/* Preservação das cores de status do sistema financeiro */
body.dark-theme .text-success { color: #86efac !important; }
body.dark-theme .text-danger  { color: #fca5a5 !important; }
body.dark-theme .text-warning { color: #fcd34d !important; }
body.dark-theme .text-info    { color: #7dd3fc !important; }

/* Inativos / Linhas desabilitadas: suavemente atenuadas, porém 100% legíveis */
body.dark-theme table.dataTable tbody tr.text-muted > td,
body.dark-theme table.dataTable tbody tr.disabled > td,
body.dark-theme table.dataTable tbody tr.inactive > td {
    color: #cbd5e1 !important;
}

/* Despesas: tag Recorrente padronizada com os chips de Grupos de clientes
   (label-default: #334155 / #f1f5f9, mesma regra de contrast_leads_sales.css).
   Escopo restrito a label-primary na tabela; Faturado/Nao faturado
   (label-success/danger) mantem as cores semanticas. */
body.dark-theme table.table-expenses td .label.label-primary {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
    border: 0 !important;
}
