:root {
    --primary-brand: #0f172a;
    --primary-light: #334155;
    --primary-hover: #1e293b;
    --bg-light: #f3f4f6;
    --bg-dark: #0f172a;
}

* {
    transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease, transform 0.2s ease;
}

/* =========================================
   1. BASE THEMES (Absolute Force)
   ========================================= */

/* Dark Mode */
html.dark,
html.dark body,
html.dark main,
html.dark .bg-gray-100,
html.dark .bg-white,
html.dark .bg-slate-50,
html.dark .bg-gray-50,
html.dark .bg-slate-100 {
    background-color: #0f172a !important;
    background-image: none !important;
    color: #ffffff !important;
}

html.dark .premium-card,
html.dark .mobile-card,
html.dark aside,
html.dark nav,
html.dark .bg-gray-800,
html.dark .bg-slate-800 {
    background-color: #1e293b !important;
    color: #ffffff !important;
    border-color: #334155 !important;
}

html.dark h1,
html.dark h2,
html.dark h3,
html.dark p,
html.dark span {
    color: #ffffff !important;
}

html.dark .text-gray-900,
html.dark .text-gray-700,
html.dark .text-slate-700 {
    color: #f1f5f9 !important;
}

html.dark .text-gray-600,
html.dark .text-gray-500,
html.dark .text-slate-500 {
    color: #94a3b8 !important;
}

/* Light Mode */
html.light body {
    background-color: #f3f4f6;
    color: #0f172a;
}

html.light .premium-card,
html.light aside,
html.light nav,
html.light .bg-gray-800,
html.light .bg-slate-900 {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #e2e8f0 !important;
}

/* Force standard card backgrounds in Light Mode */
html.light section,
html.light .bg-gray-800,
html.light .dark\:bg-gray-800 {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #e2e8f0 !important;
}

/* Mobile Specific Light Mode Override (Explicit Gray-100) */
@media (max-width: 768px) {

    html.light:not(.liquid) body,
    html.light:not(.liquid) main,
    html.light:not(.liquid) .bg-gray-100 {
        background-color: #f3f4f6 !important;
        /* Forces Tailwind gray-100 */
        color: #0f172a !important;
        /* Ensure dark text */
    }

    /* Force visibility for specific text classes on mobile light mode */
    html.light:not(.liquid) .text-gray-900 {
        color: #111827 !important;
    }

    html.light:not(.liquid) .text-gray-700 {
        color: #374151 !important;
    }

    html.light:not(.liquid) .text-gray-500 {
        color: #6b7280 !important;
    }
}

/* =========================================
   2. NUCLEAR GALAXY VIBRANT LIQUID MODE (Bulletproof Fix)
   ========================================= */

/* The Background (On HTML - This works best) */
/* The Background (Using Pseudo-Element for Guaranteed Animation) */
/* The Background (Using Pseudo-Element for Guaranteed Animation) */
/* The Background (Using Pseudo-Element for Guaranteed Animation) */
html.liquid::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -9999;

    /* The Gradient: Sutil & Moderno (Deep Blue -> Deep Purple -> Deep Pink) */
    background: linear-gradient(-45deg, #1e3a8a, #4c1d95, #831843, #1e3a8a);
    background-size: 400% 400%;

    /* The Animation: Smooth 15s Cycle */
    animation: gradientBG 15s ease infinite;
}

/* Ensure Page Structure is Transparent */
html.liquid {
    background-color: transparent !important;
    min-height: 100% !important;
}

/* Ensure Body is fully transparent to show HTML gradient */
html.liquid body,
html.liquid main {
    background-color: transparent !important;
    background-image: none !important;
    min-height: 100vh !important;
}

/* Global Liquid Transparency (Reset EVERYTHING) */
html.liquid body,
html.liquid main,
html.liquid .bg-gray-100,
html.liquid .bg-gray-900,
html.liquid .bg-slate-900,
html.liquid .bg-gray-800,
html.liquid .bg-white,
html.liquid .bg-slate-50,
html.liquid .bg-gray-50,
html.liquid .bg-slate-100,
html.liquid .bg-gray-700,
html.liquid .bg-gray-700\/50,
html.liquid .premium-header {
    background-color: transparent !important;
    background-image: none !important;
}

/* Glass Overlays - Sidebar EXTREME CONTRAST */
html.liquid aside {
    background: rgba(15, 23, 42, 0.6) !important;
    /* Slightly lighter than 0.7 for vibrancy */
    backdrop-filter: blur(40px) !important;
    -webkit-backdrop-filter: blur(40px) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
}

html.liquid .premium-card,
html.liquid .mobile-card,
html.liquid nav {
    background: rgba(255, 255, 255, 0.12) !important;
    backdrop-filter: blur(30px) !important;
    -webkit-backdrop-filter: blur(30px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3) !important;
}

/* Forced White Text on Liquid */
html.liquid aside p,
html.liquid aside span,
html.liquid aside svg,
html.liquid aside a,
html.liquid h1,
html.liquid h2,
html.liquid h3,
html.liquid p,
html.liquid span:not(.text-red-500, .text-emerald-500, .h-val-receita, .h-val-despesa) {
    color: #ffffff !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
}

html.liquid aside a:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Animations */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Utils */
.premium-header {
    /* Dark Mode: Deep Blue Gradient (Not Black) */
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.4);
}

html.light:not(.liquid) .premium-header {
    /* Light Mode: Bright Blue Gradient */
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.active-brand {
    background-color: #0f172a !important;
    color: white !important;
}

html.light .active-brand {
    background-color: #2563eb !important;
}

body,
main,
div,
nav,
button,
input,
select {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}