/* MF GESTOR 2026 - STYLE COMPLETO 
    Estética: Suave, Moderna e Alto Contraste
    Versão: 2.0 - Otimizado para 700+ linhas
*/

:root {
    --radius-premium: 22px;
    --radius-input: 14px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --ofx-row-height: 60px;
}

/* --- RESET E BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
}

body {
    transition: var(--transition);
    overflow-x: hidden;
}

/* --- TEMAS (Cores de Fundo) --- */
.theme-midnight { background: radial-gradient(circle at top right, #0f172a, #020617); color: #f1f5f9; }
.theme-emerald  { background: radial-gradient(circle at top right, #064e3b, #022c22); color: #ecfdf5; }
.theme-blackout { background: #000000; color: #ffffff; }
.theme-nordic { background: #eceff4; color: #2e3440; }

/* --- COMPONENTES GLASSMORPHISM (Suavidade) --- */
.card {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-premium) !important;
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.5) !important;
    padding: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* --- FORMULÁRIOS (Inputs, Selects e Textarea) --- */
select, input, textarea {
    background-color: rgba(0, 0, 0, 0.3) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--radius-input) !important;
    padding: 12px 16px !important;
    outline: none !important;
    transition: var(--transition);
    font-size: 0.85rem;
}

select:focus, input:focus, textarea:focus {
    border-color: #3b82f6 !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* --- ADIVINHAÇÃO (AUTOCOMPLETE GOOGLE STYLE) --- */
input::-webkit-calendar-picker-indicator {
    display: none !important;
    opacity: 0;
}

datalist {
    background-color: #0f172a;
    border-radius: 12px;
    color: white;
}

textarea {
    resize: none;
    font-family: 'Courier New', Courier, monospace;
}

option {
    background-color: #1e293b;
    color: white;
}

/* --- CORES DE ALTO CONTRASTE --- */
.valor-positivo { 
    color: #10b981 !important; 
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.valor-negativo { 
    color: #fb7185 !important; 
    text-shadow: 0 0 15px rgba(251, 113, 133, 0.2);
}

/* --- TABELAS --- */
.overflow-hidden {
    border-radius: var(--radius-premium) !important;
}

thead {
    background: rgba(0, 0, 0, 0.2);
}

tr {
    transition: var(--transition);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* --- NAVEGAÇÃO E BOTÕES --- */
.nav-btn-icon {
    border-radius: 16px !important;
    position: relative;
}

.nav-btn-icon:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    transform: translateY(-2px);
}

button {
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

button:active {
    transform: scale(0.95);
}

/* --- TOOLTIP E SCROLLBAR --- */
.tooltip {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: bold;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.group:hover .tooltip {
    opacity: 1;
    bottom: -45px;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { 
    background: rgba(255, 255, 255, 0.1); 
    border-radius: 10px; 
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* =============================================================================
   OTIMIZAÇÕES PARA MODAL OFX COM GRANDES VOLUMES (700+ linhas)
   ============================================================================= */

/* Container principal da modal */
#modal-conferencia-ofx {
    z-index: 1000;
}

#modal-conferencia-ofx .card {
    width: 98vw !important;
    max-width: 1600px !important;
    height: 95vh !important;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
}

/* Área de scroll otimizada */
#modal-conferencia-ofx .flex-grow {
    overflow-y: auto !important;
    overflow-x: auto !important;
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(95vh - 200px);
    scroll-behavior: smooth;
    position: relative;
}

/* Cabeçalho fixo */
#modal-conferencia-ofx thead {
    position: sticky;
    top: 0;
    background-color: #0f172a;
    z-index: 20;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Linhas com altura fixa para performance de scroll */
#modal-conferencia-ofx tbody tr {
    height: var(--ofx-row-height);
    max-height: var(--ofx-row-height);
    contain: strict; /* Otimização de performance */
}

/* Tabela com layout fixo */
#modal-conferencia-ofx table {
    table-layout: fixed !important;
    width: 100% !important;
    min-width: 1200px;
    border-collapse: separate;
    border-spacing: 0;
}

/* Colunas com larguras definidas */
#modal-conferencia-ofx th:nth-child(1) { width: 120px; } /* Data */
#modal-conferencia-ofx th:nth-child(2) { width: 300px; } /* Contato */
#modal-conferencia-ofx th:nth-child(3) { width: 350px; } /* Categoria */
#modal-conferencia-ofx th:nth-child(4) { width: 120px; } /* Valor */
#modal-conferencia-ofx th:nth-child(5) { width: 80px; }  /* OK? */

/* Células com texto truncado para performance */
#modal-conferencia-ofx td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    padding: 8px 12px;
    font-size: 11px;
    line-height: 1.4;
}

/* Inputs dentro da tabela */
#modal-conferencia-ofx input[type="text"], 
#modal-conferencia-ofx input[type="number"] {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    font-size: 11px !important;
    padding: 6px 8px !important;
    height: 32px;
    width: 100%;
}

/* Checkbox centralizado */
#modal-conferencia-ofx input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0 auto;
    display: block;
}

/* Scrollbar customizada */
#modal-conferencia-ofx .flex-grow::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

#modal-conferencia-ofx .flex-grow::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

#modal-conferencia-ofx .flex-grow::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

#modal-conferencia-ofx .flex-grow::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.8);
    border: 2px solid transparent;
    background-clip: padding-box;
}

#modal-conferencia-ofx .flex-grow::-webkit-scrollbar-corner {
    background: transparent;
}

/* --- PAGINAÇÃO --- */
#ofx-paginacao {
    position: sticky;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 30;
    padding: 12px 24px;
}

#ofx-paginacao button {
    min-width: 100px;
    font-size: 10px;
}

/* --- LOADING INDICATOR --- */
#ofx-loading {
    animation: fadeIn 0.3s ease-out;
}

#ofx-loading .animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- BOTÃO FLUTUANTE DE RETOMADA --- */
#btn-retomar-conciliacao {
    animation: pulse-glow 2s infinite;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.5);
    z-index: 100;
}

#btn-retomar-conciliacao:hover {
    transform: translateY(-2px) scale(1.05);
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(37, 99, 235, 0.6);
    }
}

/* --- NOTIFICAÇÕES FLUTUANTES --- */
.fixed.top-20.right-6 {
    animation: slide-in-right 0.3s ease-out;
    z-index: 1000;
    max-width: 300px;
    word-wrap: break-word;
}

@keyframes slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* --- BADGES E INDICADORES --- */
.badge-confianca-alta {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 8px;
    font-weight: bold;
}

.badge-confianca-baixa {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 8px;
    font-weight: bold;
}

/* --- ÁREA DE JUROS --- */
.juros-container {
    background: rgba(249, 115, 22, 0.1);
    border-left: 3px solid #f97316;
    padding: 4px 8px;
    margin-top: 4px;
    border-radius: 6px;
}

/* --- ESTATÍSTICAS RÁPIDAS --- */
.ofx-stats {
    display: flex;
    gap: 16px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    font-size: 9px;
}

.ofx-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ofx-stat-value {
    font-weight: 800;
    color: #3b82f6;
}

/* --- FILTROS RÁPIDOS --- */
.ofx-filters-bar {
    display: flex;
    gap: 12px;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
}

.ofx-filter-input {
    min-width: 200px;
    flex: 1;
}

/* --- CONFIGURAÇÕES DE IMPRESSÃO PROFISSIONAL --- */
@media print {
    @page {
        size: A4 portrait;
        margin: 1cm;
    }

    body {
        background: white !important;
        color: #1e293b !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    /* Esconde elementos desnecessários */
    .no-print, button, nav, header, .tooltip, select, input, .toolbar-import,
    #modal-conferencia-ofx, #btn-retomar-conciliacao, #ofx-loading {
        display: none !important;
    }

    #main-system, main {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Ajuste da área do relatório */
    #area-impressao-relatorio {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Cabeçalho do Relatório */
    #tab-receber::before, #tab-pagar::before, #tab-relat::before {
        content: "RELATÓRIO FINANCEIRO - MF GESTOR 2026";
        display: block;
        text-align: left;
        font-size: 10px;
        font-weight: 800;
        color: #0f172a;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 5px;
        margin-bottom: 20px;
    }

    .card {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        width: 100% !important;
    }

    table {
        width: 100% !important;
        border-collapse: collapse !important;
        table-layout: auto !important;
    }

    tr {
        page-break-inside: avoid !important;
    }

    th {
        text-align: left !important;
        font-size: 9px !important;
        color: #1e293b !important;
        border-bottom: 2px solid #334155 !important;
        padding: 8px 4px !important;
    }

    td {
        font-size: 9px !important;
        padding: 8px 4px !important;
        border-bottom: 1px solid #f1f5f9 !important;
        color: #334155 !important;
        word-break: break-word !important;
    }

    .valor-positivo, .valor-negativo {
        color: #0f172a !important;
        font-weight: 700 !important;
        text-shadow: none !important;
    }
}

/* --- TEMA NORDIC PROFISSIONAL (Contraste refinado) --- */
.theme-nordic {
    background: #f3f4f6;
    color: #111827;
}

/* Navegação: ícones viram escuros no fundo claro */
.theme-nordic .nav-btn-icon {
    color: #374151 !important;
}
.theme-nordic .nav-btn-icon:hover {
    background: rgba(0,0,0,0.07) !important;
    color: #111827 !important;
}
.theme-nordic .nav-btn-icon.active {
    background: rgba(0,0,0,0.1) !important;
    color: #111827 !important;
}

/* Apenas o botão + Cadastros: ícone e texto pretos */
.theme-nordic .nav-btn-icon [data-lucide="plus-circle"],
.theme-nordic .nav-btn-icon:has([data-lucide="plus-circle"]) {
    color: #111827 !important;
}

/* Modais com overlay escuro mantêm fundo escuro */
.theme-nordic #modal-config,
.theme-nordic #modal-sobre,
.theme-nordic #modal-edicao,
.theme-nordic #modal-baixa,
.theme-nordic #modal-empresa-fiscal,
.theme-nordic #modal-setup-inicial {
    background: rgba(0,0,0,0.75) !important;
}
.theme-nordic #modal-config .card,
.theme-nordic #modal-sobre .card,
.theme-nordic #modal-edicao .card,
.theme-nordic #modal-baixa .card,
.theme-nordic #modal-empresa-fiscal .card,
.theme-nordic #modal-setup-inicial .card {
    background: #ffffff !important;
    color: #111827 !important;
}
.theme-nordic #modal-config .card *,
.theme-nordic #modal-sobre .card *,
.theme-nordic #modal-edicao .card *,
.theme-nordic #modal-baixa .card *,
.theme-nordic #modal-empresa-fiscal .card * {
    color: #1f2937 !important;
}
.theme-nordic #modal-config .card h2,
.theme-nordic #modal-sobre .card h2,
.theme-nordic #modal-sobre .card h3,
.theme-nordic #modal-edicao .card h2 {
    color: #111827 !important;
}

/* Painéis de stats / KPIs */
.theme-nordic [class*="bg-slate-900"],
.theme-nordic [class*="bg-slate-800"],
.theme-nordic [class*="bg-gray-900"],
.theme-nordic [class*="bg-black"] {
    background: #ffffff !important;
    color: #111827 !important;
}

/* Overlays de modais SEMPRE mantêm fundo escuro — override do [class*="bg-black"] acima */
.theme-nordic #modal-sobre.fixed,
.theme-nordic #modal-config.fixed,
.theme-nordic #modal-edicao.fixed,
.theme-nordic #modal-baixa.fixed,
.theme-nordic #modal-empresa-fiscal.fixed,
.theme-nordic #modal-setup-inicial.fixed {
    background: rgba(0, 0, 0, 0.85) !important;
    color: inherit !important;
}

/* Backgrounds semitransparentes dark */
.theme-nordic .bg-white\/10 {
    background-color: rgba(30, 58, 95, 0.08) !important;
}
.theme-nordic .bg-white\/20 {
    background-color: rgba(30, 58, 95, 0.12) !important;
}
.theme-nordic .bg-black\/20,
.theme-nordic .bg-black\/30 {
    background-color: rgba(30, 58, 95, 0.06) !important;
}
.theme-nordic .bg-black\/40,
.theme-nordic .bg-black\/50,
.theme-nordic .bg-black\/60 {
    background-color: rgba(255,255,255,0.9) !important;
}

/* Textos brancos em geral viram escuros */
.theme-nordic .text-white {
    color: #111827 !important;
}
.theme-nordic .text-white\/40,
.theme-nordic .text-white\/50,
.theme-nordic .text-white\/60,
.theme-nordic .text-white\/70 {
    color: #6b7280 !important;
}
.theme-nordic .text-slate-300,
.theme-nordic .text-slate-400 {
    color: #374151 !important;
}
.theme-nordic .text-slate-500 {
    color: #6b7280 !important;
}

/* Bordas claras ficam visíveis */
.theme-nordic .border-white\/5,
.theme-nordic .border-white\/10,
.theme-nordic .border-white\/20 {
    border-color: #d1d5db !important;
}

/* Backgrounds de seção */
.theme-nordic .bg-white\/5 {
    background-color: #f0f4f8 !important;
}
.theme-nordic .bg-white\/10 {
    background-color: #e8edf5 !important;
}

/* Central de Alertas — mantém tema escuro no Nordic (usa inline style, preserva) */
.theme-nordic #modal-notificacoes .card {
    background: #1e293b !important;
    border-color: rgba(59,130,246,0.3) !important;
}
.theme-nordic #modal-notificacoes .text-white,
.theme-nordic #modal-notificacoes .text-white\/40,
.theme-nordic #modal-notificacoes .text-white\/50,
.theme-nordic #modal-notificacoes .text-white\/60,
.theme-nordic #modal-notificacoes .text-white\/70 {
    color: #ffffff !important;
}
.theme-nordic #modal-notificacoes .text-slate-300,
.theme-nordic #modal-notificacoes .text-slate-400,
.theme-nordic #modal-notificacoes .text-slate-500 {
    color: rgba(255,255,255,0.6) !important;
}
.theme-nordic #modal-notificacoes .bg-white\/5  { background: rgba(255,255,255,0.05) !important; }
.theme-nordic #modal-notificacoes .bg-white\/10 { background: rgba(255,255,255,0.08) !important; }
.theme-nordic #modal-notificacoes .border-white\/5,
.theme-nordic #modal-notificacoes .border-white\/10 { border-color: rgba(255,255,255,0.1) !important; }
.theme-nordic #modal-notificacoes .text-emerald-400 { color: #34d399 !important; }
.theme-nordic #modal-notificacoes .text-rose-400   { color: #f87171 !important; }
.theme-nordic #modal-notificacoes .text-blue-400   { color: #60a5fa !important; }
.theme-nordic #modal-notificacoes .text-amber-400  { color: #fbbf24 !important; }

/* Botão flutuante OFX */
.theme-nordic #btn-retomar-conciliacao {
    background: #1e40af !important;
    color: #ffffff !important;
}

/* Tabelas */
.theme-nordic table {
    background: #ffffff;
}
.theme-nordic thead {
    background: #1e3a5f !important;
    color: #ffffff !important;
}
.theme-nordic thead th,
.theme-nordic thead * {
    color: #ffffff !important;
}
.theme-nordic tbody tr:hover {
    background: #eff6ff !important;
}
.theme-nordic tbody td {
    color: #111827 !important;
    border-bottom: 1px solid #e5e7eb !important;
}

/* Inputs e selects */
.theme-nordic input,
.theme-nordic select,
.theme-nordic textarea {
    background: #ffffff !important;
    color: #111827 !important;
    border: 1.5px solid #cbd5e1 !important;
}
.theme-nordic input:focus,
.theme-nordic select:focus,
.theme-nordic textarea:focus {
    border-color: #2563eb !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15) !important;
}
.theme-nordic input::placeholder {
    color: #9ca3af !important;
}

/* Badges e chips coloridos */
.theme-nordic .bg-blue-500\/20  { background: #dbeafe !important; }
.theme-nordic .bg-green-500\/20,
.theme-nordic .bg-emerald-500\/20 { background: #d1fae5 !important; }
.theme-nordic .bg-rose-500\/20  { background: #fee2e2 !important; }
.theme-nordic .bg-amber-500\/20 { background: #fef3c7 !important; }
.theme-nordic .bg-purple-500\/20 { background: #ede9fe !important; }

/* Scrollbar */
.theme-nordic ::-webkit-scrollbar-track { background: #e5e7eb; }
.theme-nordic ::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }
.theme-nordic ::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* Cards com sombra suave */
.theme-nordic .card {
    background: #ffffff !important;
    backdrop-filter: none !important;
    border: 1px solid #d1dae6 !important;
    border-radius: 20px !important;
    box-shadow: 0 2px 12px rgba(30,58,95,0.08) !important;
}

/* Labels */
.theme-nordic label {
    color: #374151 !important;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.3px;
}

/* Ícones na área de conteúdo (fora do header/sidebar) */
.theme-nordic #conteudo-principal [data-lucide],
.theme-nordic .card [data-lucide] {
    color: #4b5563 !important;
    stroke-width: 1.8;
}

/* Cores de destaque */
.theme-nordic .text-blue-400   { color: #2563eb !important; }
.theme-nordic .text-emerald-400 { color: #059669 !important; }
.theme-nordic .text-rose-400   { color: #be123c !important; }
.theme-nordic .text-purple-400  { color: #7c3aed !important; }
.theme-nordic .text-orange-400  { color: #c2410c !important; }
.theme-nordic .text-yellow-400  { color: #b45309 !important; }
.theme-nordic .text-cyan-400   { color: #0891b2 !important; }
.theme-nordic .text-amber-400  { color: #d97706 !important; }
.theme-nordic .text-lime-400   { color: #65a30d !important; }
.theme-nordic .text-violet-400 { color: #7c3aed !important; }
.theme-nordic .text-indigo-400 { color: #4338ca !important; }
.theme-nordic .text-pink-400   { color: #be185d !important; }

/* Valores financeiros */
.theme-nordic .valor-positivo { color: #059669 !important; font-weight: 700; }
.theme-nordic .valor-negativo { color: #be123c !important; font-weight: 700; }
.theme-nordic #header-saldo.valor-positivo { color: #059669 !important; }
.theme-nordic #header-saldo.valor-negativo { color: #be123c !important; }

/* Tooltips */
.theme-nordic .tooltip { background: #1e3a5f; color: #f9fafb; border: none; }

/* Badge de notificação */
.theme-nordic #notificacao-badge { border: 2px solid #e8edf5; color: white !important; }

/* Painel de alertas */
.theme-nordic #painel-alertas {
    background: white !important;
    border: 1px solid #e5e7eb !important;
    color: #111827 !important;
}
.theme-nordic #painel-alertas * { color: #1f2937 !important; }

/* Textos opacos viram cinza legível */
.theme-nordic .opacity-30,
.theme-nordic .opacity-40,
.theme-nordic .opacity-50,
.theme-nordic .opacity-60 {
    color: #6b7280 !important;
    opacity: 1 !important;
}

/* Opções de select */
.theme-nordic option { color: #111827; background: white; }

/* Botões de ação coloridos */
.theme-nordic button.bg-blue-600    { background: #2563eb !important; color: white !important; }
.theme-nordic button.bg-emerald-600 { background: #059669 !important; color: white !important; }
.theme-nordic button.bg-rose-600    { background: #be123c !important; color: white !important; }

/* ========================================================================= */
/* NORDIC: OVERRIDE DE INLINE STYLES ESCUROS                                */
/* Corrige todos os backgrounds/gradients inline que ficam escuros no claro  */
/* ========================================================================= */

/* Área de impressão do relatório - fundo escuro por padrão */
.area-relatorio-bg {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}
.theme-nordic .area-relatorio-bg {
    background-color: #ffffff !important;
    color: #111827 !important;
}

/* Cards de gráfico do dashboard (inline gradient escuro) */
.theme-nordic .card[style*="linear-gradient"],
.theme-nordic [style*="linear-gradient(145deg"] {
    background: #ffffff !important;
    border: 1px solid #d1dae6 !important;
}

/* Área de impressão de relatórios — forçar tema claro em TUDO */
.theme-nordic #area-impressao-relatorio,
.theme-nordic #relatorio-conteudo {
    background-color: #ffffff !important;
    color: #111827 !important;
}
/* Reset geral: todos os filhos herdam cor escura */
.theme-nordic #area-impressao-relatorio *:not(thead *):not([style*="#4ade80"]):not([style*="#059669"]):not([style*="#f87171"]):not([style*="#be123c"]):not([style*="#10b981"]):not([style*="#f59e0b"]):not([style*="#f97316"]):not([style*="#ef4444"]):not([style*="#991b1b"]):not([style*="#60a5fa"]):not([style*="#2563eb"]) {
    color: #1f2937 !important;
}
/* Preservar cores de destaque (verdes, vermelhos, azuis) */
.theme-nordic #area-impressao-relatorio [style*="color: #4ade80"],
.theme-nordic #area-impressao-relatorio [style*="color:#4ade80"] { color: #059669 !important; }
.theme-nordic #area-impressao-relatorio [style*="color: #f87171"],
.theme-nordic #area-impressao-relatorio [style*="color:#f87171"] { color: #be123c !important; }
.theme-nordic #area-impressao-relatorio [style*="color: #60a5fa"],
.theme-nordic #area-impressao-relatorio [style*="color:#60a5fa"] { color: #2563eb !important; }
.theme-nordic #area-impressao-relatorio [style*="color: #10b981"],
.theme-nordic #area-impressao-relatorio [style*="color:#10b981"] { color: #059669 !important; }
.theme-nordic #area-impressao-relatorio [style*="color: #f59e0b"],
.theme-nordic #area-impressao-relatorio [style*="color:#f59e0b"] { color: #d97706 !important; }
.theme-nordic #area-impressao-relatorio [style*="color: #f97316"],
.theme-nordic #area-impressao-relatorio [style*="color:#f97316"] { color: #c2410c !important; }
.theme-nordic #area-impressao-relatorio [style*="color: #ef4444"],
.theme-nordic #area-impressao-relatorio [style*="color:#ef4444"] { color: #dc2626 !important; }
.theme-nordic #area-impressao-relatorio [style*="color: #991b1b"],
.theme-nordic #area-impressao-relatorio [style*="color:#991b1b"] { color: #991b1b !important; }

/* Tabelas: cabeçalho mantém azul escuro, corpo fica branco */
.theme-nordic #area-impressao-relatorio table { background: #ffffff !important; }
.theme-nordic #area-impressao-relatorio thead,
.theme-nordic #area-impressao-relatorio thead tr { background: #1e3a5f !important; }
.theme-nordic #area-impressao-relatorio thead * { color: #ffffff !important; }
.theme-nordic #area-impressao-relatorio tbody td { border-bottom-color: #e5e7eb !important; }

/* Rodapé/total das tabelas */
.theme-nordic #area-impressao-relatorio tfoot tr,
.theme-nordic #area-impressao-relatorio [style*="background:#0f172a"],
.theme-nordic #area-impressao-relatorio [style*="background: #0f172a"] {
    background: #f0f4f8 !important;
}
.theme-nordic #area-impressao-relatorio [style*="background: linear-gradient"] {
    background: #f0f4f8 !important;
}
/* Borders escuros viram cinza claro */
.theme-nordic #area-impressao-relatorio [style*="border-bottom: 1px solid #1e293b"],
.theme-nordic #area-impressao-relatorio [style*="border-bottom:1px solid #1e293b"],
.theme-nordic #area-impressao-relatorio [style*="border: 1px solid #60a5fa"] {
    border-color: #d1dae6 !important;
}
/* Cabeçalho do relatório */
.theme-nordic #area-impressao-relatorio [style*="border-bottom: 2px solid"] {
    border-bottom-color: #2563eb !important;
}

/* =============================================================================
   NORDIC: Override das regras de relatórios — volta ao tema claro
   ============================================================================= */

/* Hover das linhas — cinza claro */
.theme-nordic #relatorio-conteudo tbody tr:hover,
.theme-nordic #area-impressao-relatorio tbody tr:hover {
    background: rgba(0, 0, 0, 0.04) !important;
}

/* Texto das células — escuro */
.theme-nordic #relatorio-conteudo tbody td,
.theme-nordic #area-impressao-relatorio tbody td {
    color: #1f2937 !important;
}

/* Cabeçalhos thead — mantém escuro com texto branco */
.theme-nordic #relatorio-conteudo thead,
.theme-nordic #relatorio-conteudo thead tr,
.theme-nordic #relatorio-conteudo thead th {
    background-color: #1e3a5f !important;
    color: #ffffff !important;
}

/* Tfoot — fundo claro com texto escuro */
.theme-nordic #relatorio-conteudo tfoot,
.theme-nordic #relatorio-conteudo tfoot td {
    background-color: #f0f4f8 !important;
    color: #1f2937 !important;
}

/* KPIs — fundos claros originais */
.theme-nordic #relatorio-conteudo .bg-emerald-50,
.theme-nordic #area-impressao-relatorio .bg-emerald-50 {
    background-color: #ecfdf5 !important;
}
.theme-nordic #relatorio-conteudo .bg-blue-50,
.theme-nordic #area-impressao-relatorio .bg-blue-50 {
    background-color: #eff6ff !important;
}
.theme-nordic #relatorio-conteudo .bg-rose-50,
.theme-nordic #area-impressao-relatorio .bg-rose-50 {
    background-color: #fff1f2 !important;
}
.theme-nordic #relatorio-conteudo .bg-amber-50,
.theme-nordic #area-impressao-relatorio .bg-amber-50 {
    background-color: #fffbeb !important;
}
.theme-nordic #relatorio-conteudo .bg-orange-50,
.theme-nordic #area-impressao-relatorio .bg-orange-50 {
    background-color: #fff7ed !important;
}
.theme-nordic #relatorio-conteudo .bg-slate-50,
.theme-nordic #area-impressao-relatorio .bg-slate-50 {
    background-color: #f8fafc !important;
}
.theme-nordic #relatorio-conteudo .bg-slate-100,
.theme-nordic #area-impressao-relatorio .bg-slate-100 {
    background-color: #f1f5f9 !important;
}
.theme-nordic #relatorio-conteudo .bg-slate-200,
.theme-nordic #area-impressao-relatorio .bg-slate-200 {
    background-color: #e2e8f0 !important;
}
.theme-nordic #relatorio-conteudo .bg-slate-200 td,
.theme-nordic #area-impressao-relatorio .bg-slate-200 td {
    color: #1f2937 !important;
}

/* Cores de texto — versões escuras para fundo claro */
.theme-nordic #relatorio-conteudo .text-emerald-600,
.theme-nordic #relatorio-conteudo .text-emerald-700,
.theme-nordic #area-impressao-relatorio .text-emerald-600,
.theme-nordic #area-impressao-relatorio .text-emerald-700 {
    color: #059669 !important;
}
.theme-nordic #relatorio-conteudo .text-blue-600,
.theme-nordic #relatorio-conteudo .text-blue-700,
.theme-nordic #area-impressao-relatorio .text-blue-600,
.theme-nordic #area-impressao-relatorio .text-blue-700 {
    color: #2563eb !important;
}
.theme-nordic #relatorio-conteudo .text-rose-600,
.theme-nordic #relatorio-conteudo .text-rose-700,
.theme-nordic #area-impressao-relatorio .text-rose-600,
.theme-nordic #area-impressao-relatorio .text-rose-700 {
    color: #dc2626 !important;
}
.theme-nordic #relatorio-conteudo .text-amber-600,
.theme-nordic #relatorio-conteudo .text-amber-700,
.theme-nordic #area-impressao-relatorio .text-amber-600,
.theme-nordic #area-impressao-relatorio .text-amber-700 {
    color: #d97706 !important;
}
.theme-nordic #relatorio-conteudo .text-slate-500,
.theme-nordic #relatorio-conteudo .text-slate-600,
.theme-nordic #area-impressao-relatorio .text-slate-500,
.theme-nordic #area-impressao-relatorio .text-slate-600 {
    color: #64748b !important;
}
.theme-nordic #relatorio-conteudo .text-slate-400,
.theme-nordic #area-impressao-relatorio .text-slate-400 {
    color: #94a3b8 !important;
}
.theme-nordic #relatorio-conteudo .text-emerald-500,
.theme-nordic #area-impressao-relatorio .text-emerald-500 {
    color: #10b981 !important;
}
.theme-nordic #relatorio-conteudo .text-blue-500,
.theme-nordic #area-impressao-relatorio .text-blue-500 {
    color: #3b82f6 !important;
}
.theme-nordic #relatorio-conteudo .text-amber-500,
.theme-nordic #area-impressao-relatorio .text-amber-500 {
    color: #f59e0b !important;
}

/* Badges — fundos claros */
.theme-nordic #relatorio-conteudo .bg-emerald-100,
.theme-nordic #area-impressao-relatorio .bg-emerald-100 {
    background-color: #d1fae5 !important;
}
.theme-nordic #relatorio-conteudo .bg-emerald-100 .text-emerald-700,
.theme-nordic #relatorio-conteudo span.bg-emerald-100,
.theme-nordic #area-impressao-relatorio .bg-emerald-100 .text-emerald-700,
.theme-nordic #area-impressao-relatorio span.bg-emerald-100 {
    color: #047857 !important;
}
.theme-nordic #relatorio-conteudo .bg-amber-100,
.theme-nordic #area-impressao-relatorio .bg-amber-100 {
    background-color: #fef3c7 !important;
}
.theme-nordic #relatorio-conteudo .bg-amber-100 .text-amber-700,
.theme-nordic #relatorio-conteudo span.bg-amber-100,
.theme-nordic #area-impressao-relatorio .bg-amber-100 .text-amber-700,
.theme-nordic #area-impressao-relatorio span.bg-amber-100 {
    color: #b45309 !important;
}
.theme-nordic #relatorio-conteudo .bg-rose-100,
.theme-nordic #area-impressao-relatorio .bg-rose-100 {
    background-color: #ffe4e6 !important;
}
.theme-nordic #relatorio-conteudo .bg-rose-100 .text-rose-700,
.theme-nordic #relatorio-conteudo span.bg-rose-100,
.theme-nordic #area-impressao-relatorio .bg-rose-100 .text-rose-700,
.theme-nordic #area-impressao-relatorio span.bg-rose-100 {
    color: #be123c !important;
}

/* Bordas — cinza claro */
.theme-nordic #relatorio-conteudo .border-slate-200,
.theme-nordic #relatorio-conteudo .border-slate-100 {
    border-color: #e2e8f0 !important;
}

/* bg-slate-800 headers — mantém escuro */
.theme-nordic #relatorio-conteudo .bg-slate-800 {
    background-color: #1e3a5f !important;
}
.theme-nordic #relatorio-conteudo .bg-slate-800 * {
    color: #ffffff !important;
}

/* Saldo Inicial (primeiro card do grid) — fundo claro e texto escuro */
.theme-nordic #relatorio-conteudo .grid-cols-4.gap-3.mb-6 .p-3:first-child,
.theme-nordic #area-impressao-relatorio .grid-cols-4.gap-3.mb-6 .p-3:first-child {
    background-color: #f1f5f9 !important;
}
.theme-nordic #relatorio-conteudo .grid-cols-4.gap-3.mb-6 .p-3:first-child *,
.theme-nordic #area-impressao-relatorio .grid-cols-4.gap-3.mb-6 .p-3:first-child * {
    color: #1f2937 !important;
}

/* bg-slate-100 com textos internos — volta ao escuro */
.theme-nordic #relatorio-conteudo .bg-slate-100 .text-slate-800,
.theme-nordic #area-impressao-relatorio .bg-slate-100 .text-slate-800,
.theme-nordic #relatorio-conteudo .bg-slate-100 .text-slate-700,
.theme-nordic #area-impressao-relatorio .bg-slate-100 .text-slate-700 {
    color: #1f2937 !important;
}

/* Opacidade — texto escuro em vez de cinza claro */
.theme-nordic #relatorio-conteudo .opacity-40,
.theme-nordic #relatorio-conteudo .opacity-50,
.theme-nordic #relatorio-conteudo .opacity-60,
.theme-nordic #relatorio-conteudo .opacity-70,
.theme-nordic #area-impressao-relatorio .opacity-40,
.theme-nordic #area-impressao-relatorio .opacity-50,
.theme-nordic #area-impressao-relatorio .opacity-60,
.theme-nordic #area-impressao-relatorio .opacity-70 {
    color: #64748b !important;
    opacity: 1 !important;
}

/* text-slate-700, text-slate-800 genéricos dentro de relatórios */
.theme-nordic #relatorio-conteudo .text-slate-700,
.theme-nordic #relatorio-conteudo .text-slate-800,
.theme-nordic #area-impressao-relatorio .text-slate-700,
.theme-nordic #area-impressao-relatorio .text-slate-800 {
    color: #1f2937 !important;
}

/* Tabelas dentro do relatorio — fundo branco */
.theme-nordic #relatorio-conteudo table {
    background: #ffffff !important;
}

/* Formulário de lançamentos — força fundo branco */
.theme-nordic #tab-lanc .card,
.theme-nordic #tab-lanc [style*="background"],
.theme-nordic #tab-receber .card,
.theme-nordic #tab-pagar .card {
    background: #ffffff !important;
}

/* Botões tipo ENTRADA/SAÍDA no formulário */
.theme-nordic #tab-lanc button[style*="background"] {
    background: #f0f4f8 !important;
    color: #374151 !important;
    border: 1px solid #d1d5db !important;
}
.theme-nordic #tab-lanc button[style*="background"]:hover {
    background: #e2e8f0 !important;
}

/* Inputs dentro de lançamentos que usam inline style escuro */
.theme-nordic #tab-lanc input[style*="background"],
.theme-nordic #tab-lanc select[style*="background"],
.theme-nordic #tab-lanc textarea[style*="background"] {
    background: #ffffff !important;
    color: #111827 !important;
    border: 1.5px solid #cbd5e1 !important;
}

/* Labels com cor clara no fundo claro */
.theme-nordic #tab-lanc [style*="color: #94a3b8"],
.theme-nordic #tab-lanc [style*="color:#94a3b8"],
.theme-nordic #tab-lanc [style*="color: #64748b"],
.theme-nordic #tab-lanc [style*="color:#64748b"] {
    color: #374151 !important;
}

/* Barra de pesquisa */
.theme-nordic input[type="search"],
.theme-nordic input[placeholder*="PESQUISAR"] {
    background: #ffffff !important;
    color: #111827 !important;
    border: 1.5px solid #cbd5e1 !important;
}

/* Dashboard: card de evolução mensal com inline style */
.theme-nordic #tab-dash [style*="border: 1px solid rgba(255"] {
    border: 1px solid #d1dae6 !important;
}

/* Backgrounds semitransparentes escuros no dashboard */
.theme-nordic #tab-dash .bg-emerald-500\/5,
.theme-nordic #tab-dash .bg-rose-500\/5,
.theme-nordic #tab-dash .bg-blue-500\/5 {
    background: #f8fafb !important;
    border-color: #d1dae6 !important;
}

/* Comparativo: botão e select com fundo escuro */
.theme-nordic #tab-dash select[style*="background"] {
    background: #ffffff !important;
    color: #111827 !important;
    border: 1.5px solid #cbd5e1 !important;
}
.theme-nordic #tab-dash button[style*="background"] {
    background: #7c3aed !important;
    color: #ffffff !important;
}

/* Contas a vencer: items com borders semitransparentes */
.theme-nordic #top-contas-vencer [style*="border"] {
    border-color: #d1dae6 !important;
}
.theme-nordic #top-contas-vencer [class*="bg-rose-500/5"] {
    background: #fef2f2 !important;
}
.theme-nordic #top-contas-vencer [class*="bg-amber-500/5"] {
    background: #fffbeb !important;
}
.theme-nordic #top-contas-vencer [class*="bg-white/5"] {
    background: #f8fafb !important;
}

/* DRE card no dashboard (gradient) */
.theme-nordic .bg-gradient-to-r {
    background: #f8fafc !important;
}

/* Checkboxes do comparativo */
.theme-nordic .comp-check {
    accent-color: #7c3aed;
}

/* Sidebar / Menu lateral */
.theme-nordic #sidebar,
.theme-nordic [id*="sidebar"] {
    background: #ffffff !important;
    border-right: 1px solid #d1dae6 !important;
}

/* Estoque, PCP, Vendas, NF-e — forçar cards brancos */
.theme-nordic #tab-estoque .card,
.theme-nordic #tab-pcp .card,
.theme-nordic #tab-vendas .card,
.theme-nordic #tab-nfe .card,
.theme-nordic #tab-clie .card,
.theme-nordic #tab-ia .card {
    background: #ffffff !important;
}

/* Fix: textos brancos dentro de cards com inline style no tema claro */
.theme-nordic .card .text-white,
.theme-nordic #tab-dash .text-white {
    color: #111827 !important;
}
/* Exceção: preservar cores nos badges/chips */
.theme-nordic .bg-emerald-500\/20 .text-emerald-400,
.theme-nordic .bg-rose-500\/20 .text-rose-400,
.theme-nordic .bg-blue-500\/20 .text-blue-400 {
    /* Manter cores de destaque */
}

/* Botões de relatório selecionados */
.theme-nordic #tab-relat button[style*="background"] {
    background: #f0f4f8 !important;
    color: #374151 !important;
}

/* ========================================================================= */
/* NORDIC: INPUTS E FORMULÁRIOS — OVERRIDE TAILWIND CLASSES                  */
/* ========================================================================= */

/* Todos os inputs/selects/textareas com classes de fundo escuro */
.theme-nordic .bg-black\/20,
.theme-nordic .bg-black\/30,
.theme-nordic .bg-black\/40,
.theme-nordic .bg-black\/50,
.theme-nordic .bg-black\/60 {
    background-color: #ffffff !important;
    color: #111827 !important;
}

/* Pesquisa e inputs com bg-slate-900 */
.theme-nordic .bg-slate-900\/50,
.theme-nordic .bg-slate-900\/40,
.theme-nordic .bg-slate-900\/30,
.theme-nordic .bg-slate-900\/20 {
    background: #ffffff !important;
    color: #111827 !important;
    border-color: #cbd5e1 !important;
}

/* Inputs de date, text, number dentro do tema */
.theme-nordic #tab-lanc input,
.theme-nordic #tab-lanc select,
.theme-nordic #tab-lanc textarea,
.theme-nordic #tab-receber input,
.theme-nordic #tab-receber select,
.theme-nordic #tab-pagar input,
.theme-nordic #tab-pagar select {
    background: #ffffff !important;
    color: #111827 !important;
    border: 1.5px solid #cbd5e1 !important;
}

/* Texto branco dentro de inputs (Tailwind text-white) */
.theme-nordic input.text-white,
.theme-nordic select.text-white,
.theme-nordic textarea.text-white {
    color: #111827 !important;
}

/* Ícones dentro de inputs (calendário etc) */
.theme-nordic #tab-lanc .text-white\/40,
.theme-nordic #tab-lanc .text-white\/50 {
    color: #9ca3af !important;
}

/* Botões ENTRADA/SAÍDA com bg escuro */
.theme-nordic #tab-lanc .bg-emerald-500\/10,
.theme-nordic #tab-lanc .bg-rose-500\/10 {
    background: #f0fdf4 !important;
}

/* Tabs de lançamentos (receber/pagar) com fundo escuro */
.theme-nordic .bg-slate-800\/50,
.theme-nordic .bg-slate-800\/40,
.theme-nordic .bg-slate-800\/30 {
    background: #f0f4f8 !important;
    color: #111827 !important;
}

/* Painéis de edição inline */
.theme-nordic [style*="backgroundColor: '#1e293b'"],
.theme-nordic [style*="background-color: rgb(30, 41, 59)"] {
    background: #ffffff !important;
    color: #111827 !important;
}

/* Search input - placeholder cor */
.theme-nordic input::placeholder,
.theme-nordic textarea::placeholder {
    color: #9ca3af !important;
}

/* Fix: seletor de tema visível no mobile */
@media (max-width: 768px) {
    #tema-selector {
        display: flex !important;
    }
}

/* Animações */
@keyframes slideInFromBottom {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-slide-in {
    animation: slideInFromBottom 0.3s ease-out;
}

/* --- CUSTOM SCROLLBAR PARA TODA APLICAÇÃO --- */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.6);
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 768px) {
    :root {
        --radius-premium: 16px;
        --radius-input: 12px;
    }
    
    .card {
        padding: 1rem !important;
    }
    
    #modal-conferencia-ofx .card {
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }
    
    #modal-conferencia-ofx table {
        min-width: 1000px;
    }
    
    .ofx-filters-bar {
        flex-direction: column;
    }
    
    .ofx-filter-input {
        width: 100%;
    }
    
    #btn-retomar-conciliacao {
        bottom: 10px;
        left: 10px;
        padding: 12px !important;
        font-size: 8px !important;
    }
}
/* NOTIFICAÇÃO ESTILO IPHONE */
#notificacao-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    background: #ff3b30; /* Vermelho iOS */
    color: white;
    font-size: 11px;
    font-weight: 800;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    border-radius: 20px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(255, 59, 48, 0.3);
    border: 1.5px solid #1e293b; /* Cor do fundo */
    animation: badgePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Animação de "pop" igual do iPhone */
@keyframes badgePop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Quando tem mais de 9, fica um pouco maior */
#notificacao-badge.nove-mais {
    min-width: 24px;
    font-size: 10px;
}

/* Sombra pulsante para chamar atenção */
@keyframes badgePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 59, 48, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
    }
}

#notificacao-badge.pulse {
    animation: badgePulse 1.5s infinite, badgePop 0.3s;
}
/* Garantir que os ícones dentro dos inputs apareçam */
.relative i[data-lucide] {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #3b82f6 !important; /* Azul forte para calendário */
    opacity: 0.9 !important;    /* Mais visível */
    z-index: 10;
    pointer-events: none;       /* Clica através do ícone */
}

/* Ícone de pagamento (verde) */
.relative i[data-lucide="calendar-check"] {
    color: #10b981 !important;  /* Verde mais forte */
}

/* Inputs com padding à esquerda para o ícone */
.relative input {
    padding-left: 35px !important;
}
/* Ajuste para as legendas dos gráficos */
.theme-midnight .chart-legend {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}

.theme-midnight .chart-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 8px;
    color: rgba(255,255,255,0.7);
    transition: all 0.2s;
}

.theme-midnight .chart-legend-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.theme-midnight .chart-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

/* Scrollbar para legendas */
.chart-legend::-webkit-scrollbar {
    width: 4px;
}

.chart-legend::-webkit-scrollbar-track {
    background: transparent;
}

.chart-legend::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 10px;
}
/* =============================================================================
   RESET INTELIGENTE - MANTÉM AS CORES ORIGINAIS DOS LANÇAMENTOS
   ============================================================================= */

/* Reset apenas para elementos base, mas preserva classes especiais */
#tab-lanc * {
    color: inherit;
}

/* 🔥 PRESERVA AS CORES DE ENTRADA E SAÍDA */
#tab-lanc .text-emerald-400 {
    color: #10b981 !important;
}

#tab-lanc .text-rose-400 {
    color: #fb7185 !important;
}

#tab-lanc .text-blue-400 {
    color: #60a5fa !important;
}

#tab-lanc .text-purple-400 {
    color: #c084fc !important;
}

#tab-lanc .text-orange-400 {
    color: #fb923c !important;
}

/* 🔥 PRESERVA OS BADGES DE STATUS */
#tab-lanc .badge-status.efetivado {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
}

#tab-lanc .badge-status.pendente {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #f59e0b !important;
}

/* 🔥 PRESERVA AS CORES DOS BOTÕES DE AÇÃO */
#tab-lanc button.text-blue-400 {
    color: #60a5fa !important;
}

#tab-lanc button.text-rose-500 {
    color: #f43f5e !important;
}

#tab-lanc button.text-white {
    color: white !important;
}

/* 🔥 PRESERVA O FUNDO DOS CARDS */
#tab-lanc .card {
    background: rgba(15, 23, 42, 0.7) !important;
    backdrop-filter: blur(16px) saturate(180%);
}

/* 🔥 PRESERVA O TÍTULO AZUL */
#tab-lanc h3.text-blue-400 {
    color: #60a5fa !important;
}

/* 🔥 PRESERVA OS VALORES POSITIVOS/NEGATIVOS */
#tab-lanc .valor-positivo {
    color: #10b981 !important;
}

#tab-lanc .valor-negativo {
    color: #fb7185 !important;
}

/* 🔥 PRESERVA O TEXTO BRANCO ONDE DEVE SER BRANCO */
#tab-lanc .text-white {
    color: white !important;
}

#tab-lanc .text-white\/70 {
    color: rgba(255, 255, 255, 0.7) !important;
}

#tab-lanc .text-white\/40 {
    color: rgba(255, 255, 255, 0.4) !important;
}

/* 🔥 PRESERVA OS BACKGROUNDS ESCUROS */
#tab-lanc .bg-slate-900\/50 {
    background-color: rgba(15, 23, 42, 0.5) !important;
}

#tab-lanc .bg-black\/40 {
    background-color: rgba(0, 0, 0, 0.4) !important;
}

#tab-lanc .bg-white\/5 {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

#tab-lanc .bg-purple-900\/20 {
    background-color: rgba(88, 28, 135, 0.2) !important;
}
/* =============================================================================
   CORREÇÃO PARA BADGES DE CENTRO DE CUSTO NO TEMA ESCURO
   ============================================================================= */

/* Badges de centro de custo na tela de lançamentos */
#tab-lanc .bg-blue-100,
#tab-lanc .bg-purple-100,
#tab-lanc .bg-emerald-100,
#tab-lanc .bg-orange-100,
#tab-lanc .bg-rose-100,
#tab-lanc .bg-slate-100 {
    background-color: rgba(59, 130, 246, 0.15) !important; /* Azul com transparência */
    color: #93c5fd !important; /* Azul claro */
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Cores específicas para cada departamento */
#tab-lanc .bg-blue-100 {
    background-color: rgba(59, 130, 246, 0.15) !important;
    color: #93c5fd !important;
}

#tab-lanc .bg-purple-100 {
    background-color: rgba(168, 85, 247, 0.15) !important;
    color: #d8b4fe !important;
}

#tab-lanc .bg-emerald-100 {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: #6ee7b7 !important;
}

#tab-lanc .bg-orange-100 {
    background-color: rgba(249, 115, 22, 0.15) !important;
    color: #fdba74 !important;
}

#tab-lanc .bg-rose-100 {
    background-color: rgba(244, 63, 94, 0.15) !important;
    color: #fda4af !important;
}

#tab-lanc .bg-slate-100 {
    background-color: rgba(100, 116, 139, 0.15) !important;
    color: #cbd5e1 !important;
}

/* 🔥 GARANTIR QUE OS BADGES TENHAM O FORMATO CORRETO */
#tab-lanc .px-2.py-1.rounded-full {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 9999px;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}/* =============================================================================
   CORREÇÃO DO CARD DE BANCO NOS RELATÓRIOS
   ============================================================================= */

/* Card de banco com fundo azul escuro e texto branco */
#area-impressao-relatorio .bg-blue-50,
#relatorio-conteudo .bg-blue-50 {
    background-color: #1e3a8a !important; /* Azul escuro */
    border: 1px solid #3b82f6 !important;
}

#area-impressao-relatorio .bg-blue-50 *,
#relatorio-conteudo .bg-blue-50 * {
    color: #ffffff !important; /* Texto branco */
}

#area-impressao-relatorio .bg-blue-50 .text-blue-800,
#relatorio-conteudo .bg-blue-50 .text-blue-800,
#area-impressao-relatorio .bg-blue-50 .text-blue-600,
#relatorio-conteudo .bg-blue-50 .text-blue-600 {
    color: #ffffff !important; /* Garante que todos os textos no card sejam brancos */
}

#area-impressao-relatorio .bg-blue-50 i[data-lucide],
#relatorio-conteudo .bg-blue-50 i[data-lucide] {
    color: #ffffff !important; /* Ícones brancos */
}

/* Card de banco quando for roxo (todos os bancos) */
#area-impressao-relatorio .bg-purple-50,
#relatorio-conteudo .bg-purple-50 {
    background-color: #4c1d95 !important; /* Roxo escuro */
    border: 1px solid #8b5cf6 !important;
}

#area-impressao-relatorio .bg-purple-50 *,
#relatorio-conteudo .bg-purple-50 * {
    color: #ffffff !important; /* Texto branco */
}

#area-impressao-relatorio .bg-purple-50 .text-purple-800,
#relatorio-conteudo .bg-purple-50 .text-purple-800,
#area-impressao-relatorio .bg-purple-50 .text-purple-600,
#relatorio-conteudo .bg-purple-50 .text-purple-600 {
    color: #ffffff !important;
}
/* =============================================================================
   RELATÓRIOS - FUNDO ESCURO COM TEXTO BRANCO (HERDADO)
   ============================================================================= */

/* Container principal: fundo escuro e cor de texto base branca (será herdada) */
#area-impressao-relatorio,
#relatorio-conteudo {
    background-color: #0f172a !important; 
    color: #ffffff !important;
}

/* =============================================================================
   CORES DE DESTAQUE - PRESERVADAS COM ALTA ESPECIFICIDADE
   ============================================================================= */

/* Valores de Receita (Verde Claro) */
#relatorio-conteudo .text-emerald-400,
#area-impressao-relatorio .text-emerald-400,
#relatorio-conteudo .text-emerald-600,
#area-impressao-relatorio .text-emerald-600 {
    color: #6ee7b7 !important; 
}

/* Valores de Despesa (Vermelho Claro) */
#relatorio-conteudo .text-rose-400,
#area-impressao-relatorio .text-rose-400,
#relatorio-conteudo .text-rose-600,
#area-impressao-relatorio .text-rose-600 {
    color: #fecaca !important; 
}

/* Outros textos em destaque (Azul, Roxo, etc.) */
#relatorio-conteudo .text-blue-400,
#area-impressao-relatorio .text-blue-400,
#relatorio-conteudo .text-blue-600,
#area-impressao-relatorio .text-blue-600 {
    color: #bfdbfe !important; 
}

#relatorio-conteudo .text-purple-400,
#area-impressao-relatorio .text-purple-400,
#relatorio-conteudo .text-purple-600,
#area-impressao-relatorio .text-purple-600 {
    color: #d8b4fe !important;
}

#relatorio-conteudo .text-orange-400,
#area-impressao-relatorio .text-orange-400,
#relatorio-conteudo .text-orange-600,
#area-impressao-relatorio .text-orange-600 {
    color: #fdba74 !important;
}

/* =============================================================================
   ESTILIZAÇÃO DOS CARDS DE FUNDO COLORIDO (TODOS ESCUROS)
   ============================================================================= */
#relatorio-conteudo .bg-emerald-50,
#area-impressao-relatorio .bg-emerald-50 {
    background-color: #064e3b !important;
}

#relatorio-conteudo .bg-rose-50,
#area-impressao-relatorio .bg-rose-50 {
    background-color: #881337 !important;
}

#relatorio-conteudo .bg-blue-50,
#area-impressao-relatorio .bg-blue-50 {
    background-color: #1e3a8a !important;
    border: 1px solid #3b82f6 !important;
}

#relatorio-conteudo .bg-purple-50,
#area-impressao-relatorio .bg-purple-50 {
    background-color: #4c1d95 !important; 
    border: 1px solid #8b5cf6 !important;
}

#relatorio-conteudo .bg-orange-50,
#area-impressao-relatorio .bg-orange-50 {
    background-color: #9a3412 !important;
    border: 1px solid #f97316 !important;
}

#relatorio-conteudo .bg-indigo-50,
#area-impressao-relatorio .bg-indigo-50 {
    background-color: #2e1065 !important;
    border: 1px solid #818cf8 !important;
}

/* Cards neutros (cinza) */
#relatorio-conteudo .bg-slate-50,
#area-impressao-relatorio .bg-slate-50,
#relatorio-conteudo .bg-slate-100,
#area-impressao-relatorio .bg-slate-100,
#relatorio-conteudo .bg-slate-200,
#area-impressao-relatorio .bg-slate-200 {
    background-color: #1e293b !important;
}

/* =============================================================================
   ESTILIZAÇÃO DE TABELAS E CABEÇALHOS
   ============================================================================= */
#relatorio-conteudo thead,
#area-impressao-relatorio thead {
    background-color: #1e293b !important;
}

#relatorio-conteudo thead th,
#area-impressao-relatorio thead th {
    color: #ffffff !important;
    background-color: #1e293b !important;
}

#relatorio-conteudo tbody td,
#area-impressao-relatorio tbody td {
    color: #ffffff !important;
}

#relatorio-conteudo tfoot,
#area-impressao-relatorio tfoot {
    background-color: #0f172a !important;
}

#relatorio-conteudo tfoot td,
#area-impressao-relatorio tfoot td {
    color: #ffffff !important;
}

/* Cabeçalho dos dias no fluxo */
#relatorio-conteudo .bg-slate-800,
#area-impressao-relatorio .bg-slate-800 {
    background-color: #020617 !important;
}

/* =============================================================================
   BORDAS E ELEMENTOS AUXILIARES
   ============================================================================= */
#relatorio-conteudo .border-slate-200,
#area-impressao-relatorio .border-slate-200,
#relatorio-conteudo .border-slate-300,
#area-impressao-relatorio .border-slate-300,
#relatorio-conteudo .border-slate-400,
#area-impressao-relatorio .border-slate-400 {
    border-color: #334155 !important;
}

/* Textos com opacidade - agora com cor fixa */
#relatorio-conteudo .opacity-40,
#area-impressao-relatorio .opacity-40,
#relatorio-conteudo .opacity-50,
#area-impressao-relatorio .opacity-50,
#relatorio-conteudo .opacity-60,
#area-impressao-relatorio .opacity-60,
#relatorio-conteudo .opacity-70,
#area-impressao-relatorio .opacity-70 {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

/* =============================================================================
   CORREÇÃO ESPECÍFICA PARA SALDO INICIAL NO FLUXO DIÁRIO
   ============================================================================= */

/* Card de Saldo Inicial - Garantir fundo escuro e texto branco */
#relatorio-conteudo .grid-cols-4.gap-3.mb-6 .p-3:first-child,
#area-impressao-relatorio .grid-cols-4.gap-3.mb-6 .p-3:first-child {
    background-color: #1e293b !important; /* Fundo escuro */
}

#relatorio-conteudo .grid-cols-4.gap-3.mb-6 .p-3:first-child *,
#area-impressao-relatorio .grid-cols-4.gap-3.mb-6 .p-3:first-child * {
    color: #ffffff !important; /* Texto branco para TODOS os elementos dentro do card */
}

/* Manter cores específicas apenas para os valores de Receita/Despesa */
#relatorio-conteudo .grid-cols-4.gap-3.mb-6 .bg-emerald-50 .text-emerald-600,
#area-impressao-relatorio .grid-cols-4.gap-3.mb-6 .bg-emerald-50 .text-emerald-600 {
    color: #6ee7b7 !important;
}

#relatorio-conteudo .grid-cols-4.gap-3.mb-6 .bg-rose-50 .text-rose-600,
#area-impressao-relatorio .grid-cols-4.gap-3.mb-6 .bg-rose-50 .text-rose-600 {
    color: #fecaca !important;
}

#relatorio-conteudo .grid-cols-4.gap-3.mb-6 .bg-blue-50 .text-blue-600,
#area-impressao-relatorio .grid-cols-4.gap-3.mb-6 .bg-blue-50 .text-blue-600 {
    color: #bfdbfe !important;
}

/* Caso o card de saldo inicial use bg-slate-100 (como no seu código) */
#relatorio-conteudo .bg-slate-100,
#area-impressao-relatorio .bg-slate-100 {
    background-color: #1e293b !important; /* Força fundo escuro */
}

#relatorio-conteudo .bg-slate-100 .text-slate-800,
#area-impressao-relatorio .bg-slate-100 .text-slate-800,
#relatorio-conteudo .bg-slate-100 .text-slate-700,
#area-impressao-relatorio .bg-slate-100 .text-slate-700 {
    color: #ffffff !important; /* Força texto branco */
}

/* =============================================================================
   HOVER DE LINHAS NOS RELATÓRIOS — tema escuro
   ============================================================================= */
#relatorio-conteudo tbody tr:hover,
#area-impressao-relatorio tbody tr:hover {
    background: rgba(59, 130, 246, 0.08) !important;
}

/* KPIs dos relatórios — fundos escuros para combinar com texto branco */
#relatorio-conteudo .bg-emerald-50,
#area-impressao-relatorio .bg-emerald-50 {
    background-color: rgba(16, 185, 129, 0.12) !important;
}
#relatorio-conteudo .bg-blue-50,
#area-impressao-relatorio .bg-blue-50 {
    background-color: rgba(59, 130, 246, 0.12) !important;
}
#relatorio-conteudo .bg-rose-50,
#area-impressao-relatorio .bg-rose-50 {
    background-color: rgba(239, 68, 68, 0.12) !important;
}
#relatorio-conteudo .bg-amber-50,
#area-impressao-relatorio .bg-amber-50 {
    background-color: rgba(245, 158, 11, 0.12) !important;
}
#relatorio-conteudo .bg-orange-50,
#area-impressao-relatorio .bg-orange-50 {
    background-color: rgba(249, 115, 22, 0.12) !important;
}
#relatorio-conteudo .bg-slate-50,
#area-impressao-relatorio .bg-slate-50 {
    background-color: rgba(255, 255, 255, 0.04) !important;
}

/* Cores de texto dentro dos KPIs — manter legíveis no escuro */
#relatorio-conteudo .text-emerald-600,
#relatorio-conteudo .text-emerald-700,
#area-impressao-relatorio .text-emerald-600,
#area-impressao-relatorio .text-emerald-700 {
    color: #6ee7b7 !important;
}
#relatorio-conteudo .text-blue-600,
#relatorio-conteudo .text-blue-700,
#area-impressao-relatorio .text-blue-600,
#area-impressao-relatorio .text-blue-700 {
    color: #93c5fd !important;
}
#relatorio-conteudo .text-rose-600,
#relatorio-conteudo .text-rose-700,
#area-impressao-relatorio .text-rose-600,
#area-impressao-relatorio .text-rose-700 {
    color: #fca5a5 !important;
}
#relatorio-conteudo .text-amber-600,
#relatorio-conteudo .text-amber-700,
#area-impressao-relatorio .text-amber-600,
#area-impressao-relatorio .text-amber-700 {
    color: #fcd34d !important;
}
#relatorio-conteudo .text-slate-500,
#relatorio-conteudo .text-slate-600,
#area-impressao-relatorio .text-slate-500,
#area-impressao-relatorio .text-slate-600 {
    color: #94a3b8 !important;
}
#relatorio-conteudo .text-slate-400,
#area-impressao-relatorio .text-slate-400 {
    color: #64748b !important;
}

/* Labels dos KPIs */
#relatorio-conteudo .text-emerald-500,
#area-impressao-relatorio .text-emerald-500 {
    color: #34d399 !important;
}
#relatorio-conteudo .text-blue-500,
#area-impressao-relatorio .text-blue-500 {
    color: #60a5fa !important;
}
#relatorio-conteudo .text-amber-500,
#area-impressao-relatorio .text-amber-500 {
    color: #f59e0b !important;
}

/* Badges de status */
#relatorio-conteudo .bg-emerald-100,
#area-impressao-relatorio .bg-emerald-100 {
    background-color: rgba(16, 185, 129, 0.2) !important;
}
#relatorio-conteudo .bg-emerald-100 .text-emerald-700,
#relatorio-conteudo span.bg-emerald-100,
#area-impressao-relatorio .bg-emerald-100 .text-emerald-700,
#area-impressao-relatorio span.bg-emerald-100 {
    color: #6ee7b7 !important;
}
#relatorio-conteudo .bg-amber-100,
#area-impressao-relatorio .bg-amber-100 {
    background-color: rgba(245, 158, 11, 0.2) !important;
}
#relatorio-conteudo .bg-amber-100 .text-amber-700,
#relatorio-conteudo span.bg-amber-100,
#area-impressao-relatorio .bg-amber-100 .text-amber-700,
#area-impressao-relatorio span.bg-amber-100 {
    color: #fcd34d !important;
}
#relatorio-conteudo .bg-rose-100,
#area-impressao-relatorio .bg-rose-100 {
    background-color: rgba(239, 68, 68, 0.2) !important;
}
#relatorio-conteudo .bg-rose-100 .text-rose-700,
#relatorio-conteudo span.bg-rose-100,
#area-impressao-relatorio .bg-rose-100 .text-rose-700,
#area-impressao-relatorio span.bg-rose-100 {
    color: #fca5a5 !important;
}

/* Rodapé totais — bg-slate-200 */
#relatorio-conteudo .bg-slate-200,
#area-impressao-relatorio .bg-slate-200 {
    background-color: #1e293b !important;
}
#relatorio-conteudo .bg-slate-200 td,
#area-impressao-relatorio .bg-slate-200 td {
    color: #ffffff !important;
}
