/* =========================================
   ESTRUTURA GLOBAL E FONTES
   ========================================= */
* { font-family: 'Poppins', sans-serif; }
body {
    background-color: var(--cor-fundo) !important;
    color: var(--cor-texto) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* =========================================
   CORES GLOBAIS E NAVBAR
   ========================================= */
.navbar-pistache { 
    background-color: var(--cor-secundaria) !important; 
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); 
}
.offcanvas-header, .modal-header { background-color: var(--cor-secundaria) !important; }
.navbar-pistache .nav-link, .offcanvas-header h5, .modal-header h5, h1, h2, h3, h4, h5 { color: var(--cor-texto) !important; }

.btn-rosa { background-color: var(--cor-primaria) !important; border-color: var(--cor-primaria) !important; color: #ffffff !important; }
.btn-rosa:hover { opacity: 0.9; color: #ffffff !important; }
.text-rosa { color: var(--cor-primaria) !important; }

/* Proteção garantida para os textos dos botões não sumirem */
.btn-dark, .btn-success, .btn-primary, .btn-rosa, .btn-danger { color: #ffffff !important; }
.btn-outline-dark { color: #212529 !important; }
.btn-outline-dark:hover { color: #ffffff !important; }

/* =========================================
   RESPONSIVIDADE (MOBILE)
   ========================================= */
@media (min-width: 992px) { .offcanvas-body .nav-link { border-bottom: none !important; } }
@media (max-width: 767.98px) {
    body, p, .small, .opacity-90 { font-size: 15px !important; }
    .main-banner h1, .main-banner .fs-1 { font-size: 1.8rem !important; line-height: 1.2 !important; }
    .main-banner p { font-size: 14px !important; }
    .row.g-4 > div { margin-bottom: 10px; }
    h2, .fs-2 { font-size: 1.5rem !important; }
}

/* =========================================
   MODO ESCURO GLOBAL (BLINDADO)
   ========================================= */
html.dark-mode body,
html.dark-mode .main {
    background-color: #121212 !important;
    color: #f5f5f5 !important;
}

/* 🌙 BARRA SUPERIOR E RODAPÉ ESCUROS 🌙 */
html.dark-mode .navbar-pistache,
html.dark-mode .footer-pistache {
    background-color: #1a1a1a !important;
    border-bottom: 1px solid #2d2d2d !important;
    border-top: 1px solid #2d2d2d !important;
}

/* Aplica cor clara em TUDO dentro da Navbar e do Footer */
html.dark-mode .navbar-pistache .nav-link,
html.dark-mode .navbar-pistache .fw-bold,
html.dark-mode .navbar-pistache .text-dark,
html.dark-mode .navbar-pistache .text-muted,
html.dark-mode .navbar-pistache i,
html.dark-mode .footer-pistache,
html.dark-mode .footer-pistache p,
html.dark-mode .footer-pistache span,
html.dark-mode .footer-pistache small,
html.dark-mode .footer-pistache i,
html.dark-mode .footer-pistache a,
html.dark-mode .footer-pistache .text-dark,
html.dark-mode .footer-pistache .fw-bold {
    color: #f5f5f5 !important;
}

html.dark-mode .navbar-pistache #btn-dark-mode {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #f1c40f !important;
}

/* ✨ A MÁGICA: INVERTE AS LOGOS PARA BRANCO ✨ */
html.dark-mode .navbar-brand img,
html.dark-mode .footer-pistache img,
html.dark-mode .sidebar-logo img {
    filter: brightness(0) invert(1) !important;
}

/* CARDS E ELEMENTOS CLAROS VIRAM ESCUROS */
html.dark-mode .bg-white, 
html.dark-mode .bg-light,
html.dark-mode .card,
html.dark-mode .modal-content,
html.dark-mode .list-group-item {
    background-color: #1e1e1e !important;
    color: #f5f5f5 !important;
    border-color: #2d2d2d !important;
}

/* Correção do menu lateral no Admin PC */
@media (max-width: 991.98px) {
    html.dark-mode #menuLateral {
        background-color: #1e1e1e !important;
        border-left: 1px solid #333 !important;
    }
}

/* Arruma os avisos invisíveis */
html.dark-mode .alert {
    background-color: #2d2d2d !important;
    color: #f5f5f5 !important;
    border-color: #444 !important;
}

html.dark-mode .form-control, 
html.dark-mode .form-select {
    background-color: #2d2d2d !important;
    color: #f5f5f5 !important;
    border-color: #444 !important;
}

html.dark-mode .text-dark, 
html.dark-mode .text-muted,
html.dark-mode .nav-link,
html.dark-mode h1, html.dark-mode h2, html.dark-mode h3, html.dark-mode h4, html.dark-mode h5 {
    color: #f5f5f5 !important;
}

/* Garante que os botões funcionam no dark mode */
html.dark-mode .btn-dark {
    background-color: #333 !important;
    border-color: #444 !important;
    color: #fff !important;
}
html.dark-mode .btn-outline-dark {
    color: #f5f5f5 !important;
    border-color: #f5f5f5 !important;
}