:root {
    --grad-1: #0a0a0a;
    --grad-2: #141414;
    --grad-3: #1a1710;
    --brand: #d4af37;
    --brand-light: #f3e5ab;
    --accent: #b8901e;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(212, 175, 55, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

* { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--grad-1) 0%, var(--grad-2) 50%, var(--grad-3) 100%);
    background-attachment: fixed;
    color: #1f2937;
}

body { padding-bottom: 90px; }

.bg-app {
    background: linear-gradient(135deg, var(--grad-1) 0%, var(--grad-2) 50%, var(--grad-3) 100%);
    background-attachment: fixed;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.18);
}

.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 24px rgba(31, 38, 135, 0.1);
    border-radius: 1.25rem;
}

.header-glass {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 -4px 20px rgba(31, 38, 135, 0.1);
}

.text-gradient {
    background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.text-gradient-purple {
    background: linear-gradient(135deg, #d4af37 0%, #b8901e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.btn-brand {
    background: linear-gradient(135deg, #d4af37 0%, #e3be47 100%);
    color: white;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.35);
}
.btn-brand:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(212, 175, 55, 0.45); }
.btn-brand:active { transform: translateY(0); }

.btn-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35); }
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16, 185, 129, 0.45); }

.btn-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: white; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35); }
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(239, 68, 68, 0.45); }

.btn-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35); }

.btn-info { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: white; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35); }

.btn-teal { background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%); color: white; box-shadow: 0 4px 12px rgba(20, 184, 166, 0.35); }

.btn-gradient-pink {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
    transition: all 0.3s ease;
}
.btn-gradient-pink:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(245, 87, 108, 0.5); }

.input-glass {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #1f2937;
    transition: all 0.25s ease;
}
.input-glass:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--brand);
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.modal-overlay {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 20px 60px rgba(31, 38, 135, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 1.25rem;
}

.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}
.blob-1 { width: 400px; height: 400px; background: rgba(212, 175, 55, 0.2); top: -150px; left: -150px; }
.blob-2 { width: 500px; height: 500px; background: rgba(148, 163, 184, 0.15); bottom: -200px; right: -200px; }
.blob-3 { width: 350px; height: 350px; background: rgba(227, 190, 71, 0.25); top: 40%; right: 10%; opacity: 0.25; }

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 24px rgba(31, 38, 135, 0.08);
    border-radius: 1.25rem;
    transition: all 0.3s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15); }

.icon-circle-brand {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.logo-icon {
    background: transparent;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.45);
    overflow: hidden;
    padding: 0;
}
.logo-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
.pulse-ring { animation: pulse-ring 2s infinite; }

.icon-circle-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }
.icon-circle-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
.icon-circle-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3); }
.icon-circle-info { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }
.icon-circle-teal { background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%); box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3); }

.badge-brand { background: rgba(124, 58, 237, 0.15); color: #6d28d9; }
.badge-success { background: rgba(16, 185, 129, 0.15); color: #047857; }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #b91c1c; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #b45309; }

.progress-bar-track { background: rgba(0, 0, 0, 0.08); }
.progress-bar-fill { background: linear-gradient(90deg, var(--brand) 0%, var(--accent) 100%); transition: width 0.5s ease; }

.action-chip {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(31, 38, 135, 0.08);
    transition: all 0.2s ease;
}
.action-chip:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(31, 38, 135, 0.15); }

.divider-soft { border-top: 1px solid rgba(0, 0, 0, 0.06); }

@media (max-width: 640px) {
    .blob { filter: blur(60px); }
    .blob-1, .blob-2 { width: 280px; height: 280px; }
}

.scroll-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scroll-thin::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }
.scroll-thin::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   MODO ESCURO NOBRE & OURO CHAMPANHE (IDENTIDADE DA LANDING PAGE)
   ========================================================================== */
html.dark {
    color-scheme: dark;
}

html.dark, html.dark body {
    background-color: #08090d !important;
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 90% 40%, rgba(184, 144, 30, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 10% 80%, rgba(212, 175, 55, 0.03) 0%, transparent 50%) !important;
    background-attachment: fixed !important;
    color: #f1f5f9 !important;
}

html.dark .blob {
    display: none !important;
}

html.dark h1, html.dark h2, html.dark h3, html.dark h4, html.dark .font-heading {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    letter-spacing: -0.015em;
}

/* Header & Navbar Glass */
html.dark .header-glass {
    background: rgba(8, 9, 13, 0.90) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .nav-glass {
    background: rgba(8, 9, 13, 0.94) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.7) !important;
}

/* Superfícies & Cards Principais */
html.dark .glass-card,
html.dark .stat-card,
html.dark .bg-white {
    background-color: #0f121a !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #f1f5f9 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

html.dark .stat-card:hover,
html.dark .glass-card:hover {
    border-color: rgba(212, 175, 55, 0.25) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.05) !important;
}

html.dark .glass-strong {
    background-color: #151924 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Superfícies Secundárias / Fundo de Itens */
html.dark .bg-slate-50,
html.dark .bg-gray-50,
html.dark .bg-gray-50\/50,
html.dark .bg-gray-50\/70,
html.dark .bg-gray-100 {
    background-color: #151924 !important;
}

html.dark .bg-white\/70,
html.dark .bg-white\/80,
html.dark .bg-white\/90,
html.dark .bg-white\/50,
html.dark .bg-white\/60 {
    background-color: rgba(21, 25, 36, 0.90) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Tipografia em Modo Escuro */
html.dark .text-slate-900,
html.dark .text-slate-800,
html.dark .text-slate-700,
html.dark .text-gray-900,
html.dark .text-gray-800,
html.dark .text-gray-700 {
    color: #ffffff !important;
}

html.dark .text-slate-600,
html.dark .text-slate-500,
html.dark .text-gray-600,
html.dark .text-gray-500 {
    color: #94a3b8 !important;
}

html.dark .text-slate-400,
html.dark .text-gray-400 {
    color: #64748b !important;
}

/* Tons Roxo legados mapeados para Ouro Nobre */
html.dark .text-purple-600,
html.dark .text-purple-700 {
    color: #d4af37 !important;
}
html.dark .text-purple-500 {
    color: #e0be47 !important;
}
html.dark .border-purple-600 {
    border-color: #d4af37 !important;
}
html.dark .shadow-purple-500\/20,
html.dark .shadow-purple-500\/25 {
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2) !important;
}

/* Bordas & Divisórias */
html.dark .border-slate-100,
html.dark .border-slate-200,
html.dark .border-slate-200\/70,
html.dark .border-slate-200\/80,
html.dark .border-gray-100,
html.dark .border-gray-200,
html.dark .border-white\/60,
html.dark .border-white\/50,
html.dark .divider-soft {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

html.dark .divide-slate-100 > :not([hidden]) ~ :not([hidden]),
html.dark .divide-gray-100 > :not([hidden]) ~ :not([hidden]) {
    border-color: rgba(255, 255, 255, 0.06) !important;
}

/* Inputs, Selects e Textareas */
html.dark input,
html.dark select,
html.dark textarea,
html.dark .input-glass {
    background-color: #151924 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
}

html.dark input:focus,
html.dark select:focus,
html.dark textarea:focus,
html.dark .input-glass:focus {
    border-color: #d4af37 !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2) !important;
    outline: none !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
    color: #64748b !important;
}

html.dark input[type="month"],
html.dark input[type="date"] {
    color-scheme: dark !important;
}

/* Autocomplete e Listas Dropdown */
html.dark ul[id^="dd_"] {
    background-color: #151924 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7) !important;
}
html.dark ul[id^="dd_"] li {
    color: #f1f5f9 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}
html.dark ul[id^="dd_"] li:hover {
    background-color: rgba(212, 175, 55, 0.15) !important;
    color: #f3e5ab !important;
}

/* Modais de Lançamento / Edição */
html.dark .modal-overlay,
html.dark [id^="modal"].fixed {
    background-color: rgba(0, 0, 0, 0.78) !important;
    backdrop-filter: blur(8px) !important;
}

html.dark .modal-card,
html.dark [id^="modal"] > div {
    background-color: #0f121a !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85) !important;
}

/* Cards Interativos (Abas em Despesas / Receitas / Cartões) */
html.dark #card-tab-cartao,
html.dark #card-tab-pago,
html.dark #card-tab-pendente {
    background-color: #0f121a !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Card Ativo com Borda Ouro Nobre e Brilho Dourado da Landing Page */
html.dark #card-tab-cartao.border-slate-900,
html.dark #card-tab-pago.border-slate-900,
html.dark #card-tab-pendente.border-slate-900 {
    background: linear-gradient(180deg, rgba(21, 25, 36, 0.95) 0%, rgba(15, 18, 26, 0.98) 100%) !important;
    border-color: #d4af37 !important;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.22), 0 0 15px rgba(212, 175, 55, 0.08) !important;
}

/* Botão Ouro Nobre (Mesmo da Landing Page) */
.btn-gold,
.btn-brand,
.btn-primary,
html.dark .btn-primary,
html.dark .bg-purple-600,
html.dark .bg-slate-900:not(.bg-white) {
    background: linear-gradient(135deg, #d4af37 0%, #b8901e 100%) !important;
    color: #08090d !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.25) !important;
    border: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-gold:hover,
.btn-brand:hover,
.btn-primary:hover,
html.dark .btn-primary:hover,
html.dark .bg-purple-600:hover,
html.dark .bg-slate-900:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.38) !important;
    filter: brightness(1.05) !important;
}

/* Gradientes Ouro Nobre */
.text-gradient-gold,
.text-gradient-purple {
    background: linear-gradient(135deg, #f9f4e2 0%, #d4af37 50%, #b8901e 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;
}

/* Badges e Pílulas de Status */
html.dark .badge-success,
html.dark .bg-emerald-100,
html.dark .bg-green-100 {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

html.dark .badge-danger,
html.dark .bg-rose-100,
html.dark .bg-red-100 {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

html.dark .badge-warning,
html.dark .bg-amber-100,
html.dark .bg-yellow-100 {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

/* Hover e Destaques */
html.dark .hover\:bg-slate-50\/70:hover,
html.dark .hover\:bg-gray-50:hover,
html.dark .hover\:bg-gray-100:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

html.dark .scroll-thin::-webkit-scrollbar-thumb {
    background: #1c2230 !important;
}
html.dark .scroll-thin::-webkit-scrollbar-thumb:hover {
    background: #d4af37 !important;
}