/**
 * CSS de Sobrescrita de Tema
 * Este arquivo deve ser carregado POR ÚLTIMO para garantir prioridade máxima
 */

/* Sobrescrever TODOS os estilos inline e do styles.css quando em modo escuro */
html[data-theme="dark"] body,
html[data-theme-mode="dark"] body,
html[data-theme="dark"] body.main-content,
html[data-theme-mode="dark"] body.main-content,
html[data-theme="dark"] .main-content,
html[data-theme-mode="dark"] .main-content,
html[data-theme="dark"] .page-wrapper,
html[data-theme-mode="dark"] .page-wrapper,
html[data-theme="dark"] .app-content,
html[data-theme-mode="dark"] .app-content {
    background-color: #0f0f0f !important;
    background: #0f0f0f !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .card,
html[data-theme-mode="dark"] .card,
html[data-theme="dark"] .white-container,
html[data-theme-mode="dark"] .white-container,
html[data-theme="dark"] .bg-white,
html[data-theme-mode="dark"] .bg-white,
html[data-theme="dark"] .custom-card,
html[data-theme-mode="dark"] .custom-card,
html[data-theme="dark"] .card-body,
html[data-theme-mode="dark"] .card-body {
    background-color: #1a1a1a !important;
    background: #1a1a1a !important;
    color: #ffffff !important;
    border-color: #333333 !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .card-header,
html[data-theme-mode="dark"] .card-header {
    background-color: #1a1a1a !important;
    background: #1a1a1a !important;
    color: #ffffff !important;
    border-bottom-color: #333333 !important;
}

html[data-theme="dark"] .app-sidebar,
html[data-theme-mode="dark"] .app-sidebar,
html[data-theme="dark"] .sidebar,
html[data-theme-mode="dark"] .sidebar {
    background-color: #1a1a1a !important;
    background: #1a1a1a !important;
    border-right-color: #333333 !important;
}

html[data-theme="dark"] .main-header,
html[data-theme-mode="dark"] .main-header,
html[data-theme="dark"] .header,
html[data-theme-mode="dark"] .header,
html[data-theme="dark"] .navbar,
html[data-theme-mode="dark"] .navbar {
    background-color: #1a1a1a !important;
    background: #1a1a1a !important;
    border-bottom-color: #333333 !important;
}

html[data-theme="dark"] .text-dark,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] p,
html[data-theme="dark"] span,
html[data-theme="dark"] label,
html[data-theme="dark"] td,
html[data-theme="dark"] th,
html[data-theme="dark"] div {
    color: #ffffff !important;
}

html[data-theme="dark"] .text-muted {
    color: #999999 !important;
}

html[data-theme="dark"] input,
html[data-theme-mode="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme-mode="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme-mode="dark"] select,
html[data-theme="dark"] .form-control,
html[data-theme-mode="dark"] .form-control {
    background-color: #1a1a1a !important;
    background: #1a1a1a !important;
    color: #ffffff !important;
    border-color: #333333 !important;
}

html[data-theme="dark"] input:focus,
html[data-theme-mode="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme-mode="dark"] textarea:focus,
html[data-theme="dark"] select:focus,
html[data-theme-mode="dark"] select:focus,
html[data-theme="dark"] .form-control:focus,
html[data-theme-mode="dark"] .form-control:focus {
    background-color: #1a1a1a !important;
    border-color: #fab62c !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.2rem rgba(250, 182, 44, 0.25) !important;
}

html[data-theme="dark"] .table,
html[data-theme="dark"] table {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .table thead th,
html[data-theme="dark"] table thead th {
    background-color: #3d3d3d !important;
    color: #ffffff !important;
    border-color: #404040 !important;
}

html[data-theme="dark"] .table tbody td,
html[data-theme="dark"] table tbody td {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
    border-color: #404040 !important;
}

html[data-theme="dark"] .saldo-progress-container {
    background: #3d3d3d !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .saldo-text {
    color: #ffffff !important;
}

html[data-theme="dark"] .saldo-progress-bar {
    background-color: #404040 !important;
}

html[data-theme="dark"] .saldo-progress-fill {
    background-color: #feb405 !important;
}

/* Modo claro - garantir que volte ao normal */
html[data-theme="light"] body,
html[data-theme="light"] .main-content {
    background-color: #f4f4f4 !important;
    background: #f4f4f4 !important;
    color: #212529 !important;
}

html[data-theme="light"] .card,
html[data-theme="light"] .white-container,
html[data-theme="light"] .bg-white {
    background-color: #ffffff !important;
    background: #ffffff !important;
    color: #212529 !important;
    border-color: #eaeaea !important;
}

html[data-theme="light"] .text-dark,
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] h5,
html[data-theme="light"] h6 {
    color: #1a237e !important;
}

html[data-theme="light"] .text-muted {
    color: #284065 !important;
}

/* FORÇAR TODOS OS TEXTOS BRANCOS NO MODO ESCURO */
html[data-theme="dark"] *,
html[data-theme-mode="dark"] * {
    color: #ffffff !important;
}

/* Exceções para manter funcionalidade */
html[data-theme="dark"] .btn-primary,
html[data-theme-mode="dark"] .btn-primary,
html[data-theme="dark"] .btn-success,
html[data-theme-mode="dark"] .btn-success,
html[data-theme="dark"] .btn-warning,
html[data-theme-mode="dark"] .btn-warning,
html[data-theme="dark"] .btn-danger,
html[data-theme-mode="dark"] .btn-danger {
    color: #1a1a1a !important;
}

html[data-theme="dark"] .text-danger,
html[data-theme-mode="dark"] .text-danger {
    color: #dc3545 !important;
}

html[data-theme="dark"] .text-success,
html[data-theme-mode="dark"] .text-success {
    color: #28a745 !important;
}

html[data-theme="dark"] .text-warning,
html[data-theme-mode="dark"] .text-warning {
    color: #fab62c !important;
}

/* Sidebar menu */
html[data-theme="dark"] .side-menu__label,
html[data-theme-mode="dark"] .side-menu__label,
html[data-theme="dark"] .side-menu__item,
html[data-theme-mode="dark"] .side-menu__item {
    color: #ffffff !important;
}

/* Card Minha Carteira */
html[data-theme="dark"] .carteira-label,
html[data-theme-mode="dark"] .carteira-label,
html[data-theme="dark"] .carteira-valor,
html[data-theme-mode="dark"] .carteira-valor {
    color: #ffffff !important;
}

/* Valores e números */
html[data-theme="dark"] .fs-25,
html[data-theme-mode="dark"] .fs-25,
html[data-theme="dark"] .fs-20,
html[data-theme-mode="dark"] .fs-20,
html[data-theme="dark"] .fw-bold,
html[data-theme-mode="dark"] .fw-bold {
    color: #ffffff !important;
}

/* Títulos de cards */
html[data-theme="dark"] .fs-15,
html[data-theme-mode="dark"] .fs-15,
html[data-theme="dark"] .card-title,
html[data-theme-mode="dark"] .card-title {
    color: #ffffff !important;
}

/* Progress labels */
html[data-theme="dark"] .stat-progress-label,
html[data-theme-mode="dark"] .stat-progress-label,
html[data-theme="dark"] .stat-progress-label span,
html[data-theme-mode="dark"] .stat-progress-label span {
    color: #ffffff !important;
}

/* Header */
html[data-theme="dark"] .app-header,
html[data-theme-mode="dark"] .app-header,
html[data-theme="dark"] .header-element,
html[data-theme-mode="dark"] .header-element {
    color: #ffffff !important;
}

/* Tabelas */
html[data-theme="dark"] .table,
html[data-theme-mode="dark"] .table,
html[data-theme="dark"] .table td,
html[data-theme-mode="dark"] .table td,
html[data-theme="dark"] .table th,
html[data-theme-mode="dark"] .table th {
    color: #ffffff !important;
}

/* Progress bars no modo escuro */
html[data-theme="dark"] .progress,
html[data-theme-mode="dark"] .progress {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px !important;
    height: 8px !important;
}

html[data-theme="dark"] .progress-bar,
html[data-theme-mode="dark"] .progress-bar {
    background-color: #4a90e2 !important;
    border-radius: 10px !important;
}

/* Ícones amarelos no modo escuro */
html[data-theme="dark"] .icon-yellow,
html[data-theme-mode="dark"] .icon-yellow,
html[data-theme="dark"] i[class*="fa-"],
html[data-theme-mode="dark"] i[class*="fa-"] {
    color: #fab62c !important;
}

/* Responsividade - Mobile */
@media (max-width: 768px) {
    html[data-theme="dark"] .card,
    html[data-theme-mode="dark"] .card {
        margin-bottom: 15px !important;
        border-radius: 10px !important;
        padding: 15px !important;
    }
    
    html[data-theme="dark"] .card-header,
    html[data-theme-mode="dark"] .card-header {
        padding: 12px 15px !important;
        font-size: 14px !important;
    }
    
    html[data-theme="dark"] .card-body,
    html[data-theme-mode="dark"] .card-body {
        padding: 15px !important;
    }
}

/* Responsividade - Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    html[data-theme="dark"] .card,
    html[data-theme-mode="dark"] .card {
        margin-bottom: 20px !important;
    }
}

/* Responsividade - Desktop */
@media (min-width: 1025px) {
    html[data-theme="dark"] .card,
    html[data-theme-mode="dark"] .card {
        transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    }
    
    html[data-theme="dark"] .card:hover,
    html[data-theme-mode="dark"] .card:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    }
}

