:root {
    --primary: #6d28d9;
    --primary-light: #8b5cf6;
    --secondary: #ec4899;
    --bg-dark: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --color-primary: var(--primary);
    --color-secondary: var(--secondary);
    --progress-track: rgba(255, 255, 255, 0.1);
    --card-surface: rgba(255, 255, 255, 0.04);
    --bg-gradient-1: rgba(109, 40, 217, 0.22);
    --bg-gradient-2: rgba(236, 72, 153, 0.22);
}

/* TEMAS */
body.theme-light {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --secondary: #059669;
    --bg-dark: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #475569;
    --glass-bg: rgba(0, 0, 0, 0.04);
    --glass-border: rgba(0, 0, 0, 0.09);
    --color-primary: var(--primary);
    --color-secondary: var(--secondary);
    --progress-track: rgba(0, 0, 0, 0.08);
    --card-surface: rgba(255, 255, 255, 0.85);
    --bg-gradient-1: rgba(37, 99, 235, 0.08);
    --bg-gradient-2: rgba(5, 150, 105, 0.08);
}

body.theme-dark {
    --primary: #4b5563;
    --primary-light: #6b7280;
    --secondary: #9ca3af;
    --bg-dark: #000000;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    --color-primary: var(--primary);
    --color-secondary: var(--secondary);
    --progress-track: rgba(255, 255, 255, 0.08);
    --card-surface: rgba(255, 255, 255, 0.03);
    --bg-gradient-1: rgba(75, 85, 99, 0.15);
    --bg-gradient-2: rgba(31, 41, 55, 0.2);
}

body.theme-beach {
    --primary: #0284c7; /* Azul mar */
    --primary-light: #0ea5e9;
    --secondary: #d97706; /* Amarelo areia */
    --bg-dark: #f0fdfa; /* Ciano suave e limpo */
    --text-main: #0c4a6e;
    --text-muted: #075985;
    --glass-bg: rgba(14, 165, 233, 0.06);
    --glass-border: rgba(2, 132, 199, 0.16);
    --color-primary: var(--primary);
    --color-secondary: var(--secondary);
    --progress-track: rgba(2, 132, 199, 0.12);
    --card-surface: rgba(255, 255, 255, 0.88);
    --bg-gradient-1: rgba(2, 132, 199, 0.12);
    --bg-gradient-2: rgba(217, 119, 6, 0.1);
}

body.theme-nature {
    --primary: #15803d; /* Verde floresta */
    --primary-light: #16a34a;
    --secondary: #65a30d; /* Verde lima */
    --bg-dark: #f0fdf4; /* Verde super claro */
    --text-main: #14532d;
    --text-muted: #166534;
    --glass-bg: rgba(34, 197, 94, 0.06);
    --glass-border: rgba(21, 128, 61, 0.16);
    --color-primary: var(--primary);
    --color-secondary: var(--secondary);
    --progress-track: rgba(21, 128, 61, 0.12);
    --card-surface: rgba(255, 255, 255, 0.88);
    --bg-gradient-1: rgba(21, 128, 61, 0.12);
    --bg-gradient-2: rgba(101, 163, 13, 0.1);
}

body.theme-cyberpunk {
    --primary: #eab308; /* Amarelo neon */
    --primary-light: #facc15;
    --secondary: #06b6d4; /* Ciano neon */
    --bg-dark: #09090b;
    --text-main: #fef08a;
    --text-muted: #bef264;
    --glass-bg: rgba(234, 179, 8, 0.07);
    --glass-border: rgba(6, 182, 212, 0.35);
    --color-primary: var(--primary);
    --color-secondary: var(--secondary);
    --progress-track: rgba(255, 255, 255, 0.12);
    --card-surface: rgba(20, 20, 26, 0.7);
    --bg-gradient-1: rgba(234, 179, 8, 0.15);
    --bg-gradient-2: rgba(6, 182, 212, 0.15);
}

body.theme-luxury {
    --primary: #d97706; /* Ouro nobre */
    --primary-light: #f59e0b;
    --secondary: #fbbf24;
    --bg-dark: #111827; /* Preto fosco */
    --text-main: #fef3c7;
    --text-muted: #fde68a;
    --glass-bg: rgba(251, 191, 36, 0.05);
    --glass-border: rgba(251, 191, 36, 0.2);
    --color-primary: var(--primary);
    --color-secondary: var(--secondary);
    --progress-track: rgba(251, 191, 36, 0.15);
    --card-surface: rgba(25, 23, 20, 0.7);
    --bg-gradient-1: rgba(217, 119, 6, 0.14);
    --bg-gradient-2: rgba(251, 191, 36, 0.09);
}

body.theme-hacker {
    --primary: #22c55e; /* Verde terminal */
    --primary-light: #4ade80;
    --secondary: #10b981;
    --bg-dark: #050505;
    --text-main: #22c55e;
    --text-muted: #16a34a;
    --glass-bg: rgba(34, 197, 94, 0.06);
    --glass-border: rgba(34, 197, 94, 0.25);
    --color-primary: var(--primary);
    --color-secondary: var(--secondary);
    --progress-track: rgba(34, 197, 94, 0.15);
    --card-surface: rgba(8, 18, 12, 0.75);
    --bg-gradient-1: rgba(34, 197, 94, 0.16);
    --bg-gradient-2: rgba(16, 185, 129, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
}

/* Scrollbar Personalizada e Discreta (elimina a barra branca padrão) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

.custom-scrollbar,
.modal-overlay .glass-card,
.modal-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.custom-scrollbar::-webkit-scrollbar,
.modal-overlay .glass-card::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
    width: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track,
.modal-overlay .glass-card::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb,
.modal-overlay .glass-card::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover,
.modal-overlay .glass-card::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* Suporte para temas claros */
body.theme-light ::-webkit-scrollbar-thumb,
body.theme-beach ::-webkit-scrollbar-thumb,
body.theme-nature ::-webkit-scrollbar-thumb,
body.theme-light .modal-overlay .glass-card::-webkit-scrollbar-thumb,
body.theme-beach .modal-overlay .glass-card::-webkit-scrollbar-thumb,
body.theme-nature .modal-overlay .glass-card::-webkit-scrollbar-thumb,
body.theme-light .modal-content::-webkit-scrollbar-thumb,
body.theme-beach .modal-content::-webkit-scrollbar-thumb,
body.theme-nature .modal-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.16);
}

/* Subtabs de Navegação (Investimentos: Carteiras vs Ações) */
.subtabs-nav {
    display: flex;
    background: var(--glass-bg);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    gap: 4px;
}

.subtab-btn {
    padding: 7px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.subtab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.subtab-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.theme-light .subtab-btn:hover,
body.theme-beach .subtab-btn:hover,
body.theme-nature .subtab-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, var(--bg-gradient-1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, var(--bg-gradient-2) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    /* Removido align-items: center para não quebrar o scroll vertical quando a página crescer */
    padding: 20px 0;
}

.app-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

.view {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.view.active {
    display: block;
    opacity: 1;
}

/* Glassmorphism */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    max-width: 450px;
    margin: 0 auto;
}

.add-expense-card {
    max-width: 100%;
    width: 100%;
}

.dashboard-hero-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
    align-items: stretch;
}

.dashboard-hero-row .glass-card,
#net-worth-hero-card,
#trend-hero-card,
#smart-alerts-container,
#emergency-fund-card,
.couple-collaboration-row .glass-card,
#couple-notes-card,
#couple-challenges-card {
    max-width: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.couple-collaboration-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
    margin-top: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.couple-collaboration-row .glass-card,
#couple-notes-card,
#couple-challenges-card {
    padding: 24px !important;
    border-radius: 20px !important;
}

@media (max-width: 900px) {
    .couple-collaboration-row {
        grid-template-columns: 1fr !important;
    }
}

.register-card {
    max-width: 700px;
}

h1, h2, h3 {
    margin-bottom: 10px;
    font-weight: 600;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

.partner-section {
    background: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--glass-border);
}

/* Formulários */
.input-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.input-row .input-group {
    flex: 1;
    min-width: 150px;
}

.align-end {
    align-items: flex-end;
}

.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    text-align: left;
}

label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    margin-left: 4px;
}

input, select, textarea {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    outline: none;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

/* Reset Global para Checkbox e Radio (evita esticar para 100% e quebrar labels) */
input[type="checkbox"], input[type="radio"] {
    width: 20px !important;
    height: 20px !important;
    min-height: unset !important;
    max-height: 20px !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    flex-shrink: 0 !important;
    accent-color: var(--primary-light) !important;
    background: transparent !important;
    border: none !important;
}

/* Padronização e Correção Definitiva para campos de Data (iOS Safari / iPhone 16 & Android / Desktop) */
input[type="date"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    padding: 0 14px !important;
    margin: 0 !important;
    text-align: left !important;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 1rem !important;
    line-height: 48px !important;
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 12px !important;
    color: var(--text-main) !important;
    outline: none !important;
    color-scheme: dark;
}

body.theme-light input[type="date"],
body.theme-beach input[type="date"],
body.theme-nature input[type="date"] {
    color-scheme: light;
}

/* Forçar alinhamento à esquerda, altura exata e reset no WebKit (iOS Safari) */
input[type="date"]::-webkit-date-and-time-value {
    text-align: left !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    line-height: 48px !important;
    font-family: inherit !important;
    font-size: 1rem !important;
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

/* Ícone do calendário adaptado ao tema no Chrome/Edge/Safari */
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.75;
    filter: invert(0.85);
    margin: 0;
    padding: 0;
    height: 20px;
    width: 20px;
    transition: opacity 0.2s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

body.theme-light input[type="date"]::-webkit-calendar-picker-indicator,
body.theme-beach input[type="date"]::-webkit-calendar-picker-indicator,
body.theme-nature input[type="date"]::-webkit-calendar-picker-indicator {
    filter: none;
    opacity: 0.7;
}


input[type="file"] {
    padding: 8px 12px;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    border-radius: 8px;
    color: white;
    padding: 8px 16px;
    margin-right: 15px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

input[type="file"]::file-selector-button:hover {
    opacity: 0.9;
}

input:focus, select:focus {
    border-color: var(--primary-light);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

option {
    background-color: var(--bg-dark);
    color: var(--text-main);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 10px;
}

/* Botões Globais */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(236, 72, 153, 0.3);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, border-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.btn-secondary:hover {
    background: var(--glass-border);
    transform: translateY(-2px);
}

/* Harmonização de botões lado a lado em containers Flex (Modais, Ações de Formulário) */
.modal-overlay div[style*="display: flex"] > .btn-primary,
.modal-overlay div[style*="display: flex"] > .btn-secondary,
.onboarding-actions button {
    margin-top: 0 !important;
    min-height: 46px;
}

/* Botões compactos de cards de listagem (Categorias, Cartões, etc.) */
.card-actions button,
.card-actions .btn-secondary,
div[style*="border-top"] > .btn-secondary,
.month-filter button,
.modal-overlay .btn-secondary[style*="position: absolute"] {
    min-height: unset !important;
    padding: 6px 12px !important;
    font-size: 0.82rem !important;
    border-radius: 8px !important;
    width: auto;
}

.switch-view {
    margin-top: 25px;
    font-size: 0.9rem;
    text-align: center;
    color: var(--text-muted);
}

.switch-view a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
}

.switch-view a:hover {
    text-decoration: underline;
}

/* Dashboard */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.chart-container {
    max-width: 100%;
    padding: 20px;
}

.chart-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

.partners-summary {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.partner-card {
    flex: 1;
    min-width: 250px;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.partner-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary-light);
}

.partner-stat {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.partner-stat span {
    color: var(--text-main);
    font-weight: 600;
    font-size: 1.1rem;
}

.progress-bar-container {
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    height: 10px;
    width: 100%;
    margin-top: 15px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 1s ease-in-out;
}

.add-expense-card {
    max-width: 100%;
    width: 100%;
    margin-top: 30px;
    padding: 25px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-main);
    color: var(--bg-dark);
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: bottom 0.4s ease;
    z-index: 999999;
}

.toast.show {
    bottom: 30px;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 30px;
    border-radius: 16px;
    margin-bottom: 20px;
    position: relative;
    z-index: 9999;
}

.nav-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.profile-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
    cursor: pointer;
    transition: transform 0.2s;
}

.profile-avatar:hover {
    transform: scale(1.1);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.btn-icon:hover {
    color: var(--secondary);
}

/* Profile View */
.profile-pic-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    gap: 15px;
}

#profile-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.change-pic-btn {
    font-size: 0.9rem;
    padding: 8px 16px;
}

/* Navbar elements */
.nav-links {
    display: flex;
    gap: clamp(10px, 1.5vw, 22px);
    align-items: center;
    flex-wrap: nowrap;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 7px 12px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.06);
}

body.theme-light .nav-link:hover,
body.theme-beach .nav-link:hover,
body.theme-nature .nav-link:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Dropdowns da Navbar (Despoluição Inteligente) */
.nav-dropdown-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown-trigger {
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 7px 12px;
    border-radius: 9px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-dropdown-trigger:hover,
.nav-dropdown-wrap:hover .nav-dropdown-trigger,
.nav-dropdown-wrap.open .nav-dropdown-trigger {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.07);
}

body.theme-light .nav-dropdown-trigger:hover,
body.theme-light .nav-dropdown-wrap:hover .nav-dropdown-trigger,
body.theme-light .nav-dropdown-wrap.open .nav-dropdown-trigger,
body.theme-beach .nav-dropdown-trigger:hover,
body.theme-beach .nav-dropdown-wrap:hover .nav-dropdown-trigger,
body.theme-beach .nav-dropdown-wrap.open .nav-dropdown-trigger,
body.theme-nature .nav-dropdown-trigger:hover,
body.theme-nature .nav-dropdown-wrap:hover .nav-dropdown-trigger,
body.theme-nature .nav-dropdown-wrap.open .nav-dropdown-trigger {
    background: rgba(0, 0, 0, 0.05);
}

.dropdown-chevron {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
    opacity: 0.7;
    pointer-events: none;
}

.nav-dropdown-wrap:hover .dropdown-chevron,
.nav-dropdown-wrap.open .dropdown-chevron {
    transform: rotate(180deg);
    opacity: 1;
    color: var(--primary-light);
}

/* Menu Flutuante Glassmorphism */
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 290px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s ease;
    z-index: 10005;
}

/* Área invisível de ponte para o cursor não fechar acidentalmente */
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    width: 100%;
    height: 14px;
}

/* Suporte a hover e clique (.open) */
.nav-dropdown-wrap:hover .nav-dropdown-menu,
.nav-dropdown-wrap.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* Temas Claros para o Dropdown */
body.theme-light .nav-dropdown-menu,
body.theme-beach .nav-dropdown-menu,
body.theme-nature .nav-dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.09);
    box-shadow: 0 18px 40px -10px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* Item dentro do Dropdown */
.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 11px;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    margin-bottom: 2px;
}

.nav-dropdown-item:last-child {
    margin-bottom: 0;
}

.nav-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateX(3px);
}

body.theme-light .nav-dropdown-item:hover,
body.theme-beach .nav-dropdown-item:hover,
body.theme-nature .nav-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* Ícones com Cores Suaves e Modernas */
.nav-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-dropdown-item:hover .nav-item-icon {
    transform: scale(1.08);
}

.nav-item-icon.icon-blue {
    background: rgba(59, 130, 246, 0.14);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.nav-item-icon.icon-purple {
    background: rgba(168, 85, 247, 0.14);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.nav-item-icon.icon-emerald {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.nav-item-icon.icon-amber {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.nav-item-icon.icon-cyan {
    background: rgba(6, 182, 212, 0.14);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.25);
}

.nav-item-icon.icon-pink {
    background: rgba(236, 72, 153, 0.14);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.25);
}

.nav-item-icon.icon-indigo {
    background: rgba(99, 102, 241, 0.14);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

/* Textos do Item */
.nav-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.nav-item-text strong {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.25;
}

.nav-item-text small {
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.25;
}

/* Barra de Progresso (Metas) */
.progress-bar-container {
    width: 100%;
    height: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    margin: 15px 0;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 6px;
    transition: width 0.5s ease;
}

.goal-card {
    display: flex;
    flex-direction: column;
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.goal-investors {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Container de Metas em Grid */
#goals-container {
    display: grid;
    grid-template-columns: 1fr; /* Padrão mobile */
    gap: 20px;
}

@media (min-width: 768px) {
    #goals-container {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

/* Botões de Aporte/Resgate */
.add-inv-form .input-row {
    flex-wrap: wrap;
    gap: 10px;
}

.add-inv-form .input-group {
    flex: 1 1 100%;
}

.add-inv-form .btn-primary, .add-inv-form .btn-withdraw {
    flex: 1 1 calc(50% - 5px);
    margin-top: 10px !important;
    padding: 12px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000;
}

.modal-overlay .glass-card {
    background: var(--bg-dark);
}


.cropper-container-card {
    width: 92%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px;
    box-sizing: border-box;
}

.cropper-canvas-wrapper {
    width: 100%;
    height: 320px;
    max-height: 48vh;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

/* Deixa a área de corte do cropper redonda */
.cropper-view-box,
.cropper-face {
    border-radius: 50%;
}

.cropper-actions {
    display: flex;
    gap: 12px;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    margin-top: 4px;
}

.cropper-actions button,
.cropper-actions .btn-primary,
.cropper-actions .btn-secondary {
    flex: 1;
    margin: 0 !important;
    padding: 12px 16px !important;
    min-height: 48px !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

/* Dropdown de Notificações */
#notifications-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: -20px; /* Alinhar melhor com o canto */
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    padding: 15px !important;
    margin: 0 !important;
    border-radius: 12px !important;
    background: var(--bg-dark) !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5) !important;
    border: 1px solid var(--glass-border) !important;
    text-align: left;
}

@media (max-width: 768px) {
    body {
        display: block !important;
        padding: 0 !important;
        min-height: 100dvh !important;
    }

    .app-container {
        padding: 10px;
        padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); /* Espaço maior para o bottom nav + safe area */
        overflow-x: hidden;
        max-width: 100vw;
    }

    .glass-card {
        padding: 15px; /* Reduzido de 20 para ganhar espaço */
    }

    /* Navbar superior no mobile */
    .navbar {
        padding: 10px 15px;
        margin-bottom: 15px;
    }

    .nav-brand {
        font-size: 1.1rem;
    }

    /* Esconde os links horizontais no Mobile */
    .nav-links {
        display: none !important;
    }

    .profile-avatar {
        width: 35px;
        height: 35px;
    }

    .input-row {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .align-end {
        align-items: stretch;
    }

    .input-group, .input-row .input-group {
        margin-bottom: 0;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    #installment-fields {
        margin-top: 15px;
    }

    .partners-summary {
        flex-direction: column;
    }

    .partner-card {
        min-width: 100%;
        padding: 15px;
    }

    /* Tabelas responsivas (Swipe horizontal) */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 15px;
        border-radius: 8px;
    }
    
    table {
        min-width: 500px; /* Garante que a tabela não fique espremida */
    }

    /* Gráfico Anual responsivo */
    .annual-chart-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .chart-wrapper {
        height: 250px;
    }

    #total-debt-value {
        font-size: 2rem !important;
    }

    h2 {
        font-size: 1.3rem;
    }
    
    /* Mostrar bottom nav apenas se estiver logado */
    body.logged-in .bottom-nav {
        display: flex !important;
    }

    body:not(.logged-in) .bottom-nav {
        display: none !important;
    }

    /* Correção do Dropdown de Notificações no Mobile */
    #notifications-dropdown {
        position: fixed;
        top: 70px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        z-index: 2100;
    }

    /* Otimização da IA para Mobile */
    .ai-chat-widget {
        bottom: calc(75px + env(safe-area-inset-bottom, 0px)) !important; /* Fica acima da bottom nav */
        right: 15px !important;
        opacity: 0.85;
        transition: opacity 0.3s;
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
        will-change: transform;
        z-index: 9998;
    }
    
    .ai-chat-widget:focus-within, .ai-chat-widget:active {
        opacity: 1; /* Revela ao tocar */
    }

    .ai-chat-btn {
        width: 45px;
        height: 45px;
    }
    
    .ai-chat-btn svg {
        width: 20px;
        height: 20px;
    }

    .ai-chat-panel {
        width: 320px;
        height: 400px;
        right: 0;
    }
}

/* ==================================
   MOBILE BOTTOM NAVIGATION & DRAWER
   ================================== */
.bottom-nav {
    display: none; /* Só mostra no mobile */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    min-height: 60px;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--glass-border);
    z-index: 9999;
    justify-content: space-around;
    align-items: flex-start;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)) 10px;
    box-sizing: border-box;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    gap: 4px;
    padding: 5px;
    flex: 1;
    transition: 0.3s;
}

.bottom-nav-item.active {
    color: var(--color-primary);
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: -280px; /* Escondido */
    width: 280px;
    height: 100vh;
    background: var(--bg-dark);
    border-left: 1px solid var(--glass-border);
    z-index: 10001; /* Maior que a navbar (9999) */
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-drawer.open {
    right: 0;
}

.drawer-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.drawer-header h3 {
    margin: 0;
    color: var(--color-primary);
}

.drawer-links {
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    overflow-y: auto;
}

.drawer-links a {
    padding: 15px 25px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.drawer-links a:hover {
    background: rgba(255,255,255,0.05);
    color: var(--color-primary);
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
    z-index: 10000; /* Maior que a navbar (9999) */
    display: none;
}

.drawer-overlay.active {
    display: block;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--glass-border);
}

.app-footer p {
    margin: 5px 0;
}

/* Estilos de Impressão (PDF/Impressora) */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }

    .app-container, .modal-overlay:not(#report-modal), #toast, #ai-chat-widget, .bottom-nav, #saas-banner {
        display: none !important;
    }

    #report-modal {
        display: block !important;
        position: static !important;
        background: transparent !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    .report-paper {
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        background: #ffffff !important;
        color: #000000 !important;
    }

    .report-actions-bar {
        display: none !important;
    }

    @page {
        margin: 1.5cm;
        size: A4;
    }
}

/* ==========================================
   MODO LEITURA (SAAS EXPIRADO)
   Bloqueia criação/edição financeira sem afetar
   perfil, modais de utilidade, fotos, LGPD ou checkout
   ========================================== */
body.read-only-mode .floating-btn,
body.read-only-mode #form-expense button[type="submit"],
body.read-only-mode #form-fixed-expense button[type="submit"],
body.read-only-mode #form-category button[type="submit"],
body.read-only-mode #btn-save-cat,
body.read-only-mode #form-goal button[type="submit"],
body.read-only-mode #form-portfolio button[type="submit"],
body.read-only-mode #btn-save-wallet,
body.read-only-mode #form-investment button[type="submit"],
body.read-only-mode #form-debt button[type="submit"],
body.read-only-mode #btn-ofx-save,
body.read-only-mode #form-edit-transaction button[type="submit"],
body.read-only-mode #form-edit-fixed-expense button[type="submit"],
body.read-only-mode #form-edit-goal button[type="submit"],
body.read-only-mode #btn-del-all,
body.read-only-mode #btn-del-one,
body.read-only-mode #history-table .btn-icon,
body.read-only-mode #fixed-expenses-list .btn-icon,
body.read-only-mode #debts-list .btn-icon,
body.read-only-mode #category-budget-list .btn-icon,
body.read-only-mode #goals-container .btn-icon,
body.read-only-mode .transactions-table .btn-icon {
    display: none !important;
}

/* Desativa inputs apenas nos formulários de criação financeira */
body.read-only-mode #form-expense input,
body.read-only-mode #form-expense select,
body.read-only-mode #form-expense textarea,
body.read-only-mode #form-fixed-expense input,
body.read-only-mode #form-fixed-expense select,
body.read-only-mode #form-category input,
body.read-only-mode #form-category select,
body.read-only-mode #form-goal input,
body.read-only-mode #form-goal select,
body.read-only-mode #form-portfolio input,
body.read-only-mode #form-portfolio select,
body.read-only-mode #form-investment input,
body.read-only-mode #form-investment select,
body.read-only-mode #form-debt input,
body.read-only-mode #form-debt select {
    pointer-events: none;
    opacity: 0.6;
}

/* Blindagem: botões de utilitários, modais, fotos, LGPD e checkout NUNCA devem sumir */
#cropper-modal .btn-primary,
#cropper-modal .btn-secondary,
#cropper-modal button,
#btn-save-avatar.visible,
#delete-account-modal button,
#reset-password-modal button,
#privacy-modal button,
#totp-setup-modal button,
#checkout-modal button,
#onboarding-modal button,
#modal-level-progress button,
#modal-title-select button,
#cookie-banner button,
.btn-cookie-accept {
    display: inline-flex !important;
}

/* =========================================
   FASE 13: CHATBOT IA FLUTUANTE
========================================= */
.ai-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ai-chat-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.ai-chat-btn:hover {
    transform: scale(1.1);
}

.ai-chat-panel {
    display: none;
    width: 350px;
    height: 500px;
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 15px;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-chat-header {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(236, 72, 153, 0.2) 100%);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.ai-message.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 2px;
}

.ai-message.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border-bottom-left-radius: 2px;
}

.ai-chat-input-area {
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 10px;
}

.ai-chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px;
    border-radius: 20px;
    outline: none;
}

.ai-chat-input-area button {
    background: var(--primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-chat-input-area button:hover {
    background: var(--primary-hover);
}

.typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 5px 10px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}/* ==============================================================================
   ANIMAÇÃO DE SUCESSO (CHECKMARK PIX)
   ============================================================================== */
.success-animation {
    margin: 20px auto;
    width: 80px;
    height: 80px;
}
.checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #10b981;
    stroke-miterlimit: 10;
    margin: 10% auto;
    box-shadow: inset 0px 0px 0px #10b981;
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}
.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #10b981;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}
@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}
@keyframes scale {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}
@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 30px rgba(16, 185, 129, 0.1);
    }
}
/* =========================================
   CALCULADORA FLUTUANTE
========================================= */
.calc-widget {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.calc-btn-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.calc-btn-toggle:hover {
    transform: scale(1.1);
}

.calc-panel {
    display: none;
    position: fixed;
    bottom: 100px;
    left: 30px;
    z-index: 10001;
    width: 250px;
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    flex-direction: column;
}

.calc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
    cursor: move;
    user-select: none;
}

.calc-history {
    max-height: 44px;
    overflow-y: auto;
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: right;
    margin-bottom: 6px;
    padding: 0 4px;
    font-family: monospace;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calc-history::-webkit-scrollbar {
    width: 3px;
}

.calc-history::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.calc-history-item {
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
}

.calc-history-item:hover {
    color: #38bdf8;
}

.calc-display {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 1.5rem;
    text-align: right;
    padding: 10px;
    margin-bottom: 10px;
    font-family: monospace;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: font-size 0.15s ease;
}

.calc-display.small {
    font-size: 1.15rem;
}

.calc-display.extra-small {
    font-size: 0.95rem;
}

.calc-keys {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.calc-key {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.1rem;
    padding: 10px 0;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.calc-key:active {
    transform: scale(0.96);
}

.calc-key:hover {
    background: rgba(255, 255, 255, 0.2);
}

.calc-op {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.calc-op:hover {
    background: rgba(59, 130, 246, 0.4);
}

.calc-equals {
    background: #10b981;
    color: white;
}

.calc-equals:hover {
    background: #059669;
}

@media (max-width: 768px) {
    .calc-widget {
        bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; /* Acima do menu inferior */
        left: 15px !important;
        opacity: 1; /* Painel e widget nítidos */
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
        will-change: transform;
        z-index: 9998;
    }
    
    .calc-btn-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        opacity: 0.85;
    }
    
    .calc-btn-toggle:hover, .calc-btn-toggle:active {
        opacity: 1;
    }

    .calc-panel {
        width: 230px; /* Mais fina para não cobrir tanto a tela */
        padding: 12px;
        margin-bottom: 10px;
        background: rgba(17, 24, 39, 0.98);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
        opacity: 1 !important;
    }
    
    .calc-key {
        padding: 10px 0;
        font-size: 1.05rem;
    }

    #saas-banner {
        font-size: 0.85rem !important;
        padding: 8px 10px !important;
    }

    /* Card de Previsão de Contas Fixas no Mobile */
    #fixed-forecast-container {
        padding: 12px 14px !important;
        gap: 12px !important;
    }

    #fixed-forecast-total {
        font-size: 1.35rem !important;
    }

    #dashboard-fixed-expenses-container {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    body.logged-in #cookie-banner {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    }

    body:not(.logged-in) #cookie-banner {
        bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    }

    #cookie-banner {
        width: calc(100% - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        padding: 14px 16px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        border-radius: 14px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }

    #cookie-banner .cookie-text {
        font-size: 0.84rem !important;
        line-height: 1.45 !important;
    }

    #cookie-banner .cookie-actions {
        width: 100% !important;
        display: flex !important;
    }

    #cookie-banner .btn-cookie-accept {
        width: 100% !important;
        min-height: 44px !important;
        font-size: 0.92rem !important;
        padding: 12px !important;
        border-radius: 10px !important;
    }

    #btn-help-nav {
        display: none !important;
    }

    .section-tooltip-btn .tooltip-popup {
        left: auto !important;
        right: -30px !important;
        width: 230px !important;
        max-width: calc(100vw - 40px) !important;
        box-sizing: border-box !important;
    }

    .section-tooltip-btn .tooltip-popup::after {
        left: auto !important;
        right: 35px !important;
    }
}

/* ========================================================
   COMPONENTS: LGPD, AJUDA & ONBOARDING GUIADO
   ======================================================== */

/* Banner de Cookies & Privacidade (LGPD) */
#cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 820px;
    background: var(--bg-dark);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
    z-index: 999999;
    animation: slideUpBanner 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

body.theme-light #cookie-banner,
body.theme-beach #cookie-banner,
body.theme-nature #cookie-banner {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
}

@keyframes slideUpBanner {
    from {
        opacity: 0;
        transform: translate(-50%, 35px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.cookie-text {
    font-size: 0.88rem;
    color: var(--text-main);
    line-height: 1.5;
    margin: 0;
    flex: 1;
}

.cookie-text a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
}

.cookie-text a:hover {
    color: var(--primary-light);
}

.cookie-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.cookie-close-btn:hover {
    color: var(--text-main);
}

.cookie-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-cookie-accept {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #ffffff !important;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    -webkit-tap-highlight-color: transparent;
}

.btn-cookie-accept:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}

.btn-cookie-accept:active {
    transform: scale(0.98);
}

/* Botões de Ação na Navbar (Ajuda, Sininho, Sair) */
.nav-user .btn-icon {
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
}

.nav-user .btn-icon:hover {
    color: var(--secondary) !important;
    transform: scale(1.15);
}

.nav-user .btn-icon:active {
    transform: scale(0.95);
}

/* Tooltips Contextuais nas Seções */
.section-tooltip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    margin-left: 8px;
    vertical-align: middle;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
}

.section-tooltip-btn:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: #8b5cf6;
    color: #a78bfa;
}

.section-tooltip-btn .tooltip-popup {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: calc(100% + 10px);
    bottom: auto;
    left: -10px;
    transform: translateY(-4px);
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(139, 92, 246, 0.4);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
    color: #f1f5f9;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.45;
    font-weight: 400;
    width: 260px;
    text-align: left;
    z-index: 10000;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.section-tooltip-btn:hover .tooltip-popup,
.section-tooltip-btn:focus .tooltip-popup {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.section-tooltip-btn .tooltip-popup::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 20px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent rgba(15, 23, 42, 0.98) transparent;
}

/* Onboarding Aprimorado */
.onboarding-progress-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.onboarding-dot.active {
    width: 24px;
    background: linear-gradient(90deg, #8b5cf6, #ec4899);
}

.onboarding-step-badge {
    display: inline-block;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #c4b5fd;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.onboarding-icon-banner {
    font-size: 3rem;
    margin-bottom: 12px;
    display: inline-block;
    filter: drop-shadow(0 4px 12px rgba(139, 92, 246, 0.3));
}

/* Botões Padronizados do Onboarding */
.onboarding-actions {
    display: flex;
    gap: 12px;
    align-items: stretch;
    justify-content: center;
    margin-top: 20px;
}

.onboarding-actions button,
.onboarding-actions .btn-primary,
.onboarding-actions .btn-secondary {
    flex: 1;
    margin: 0 !important;
    padding: 12px 18px !important;
    min-height: 48px !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    line-height: 1.3 !important;
    box-sizing: border-box !important;
}

.onboarding-actions .btn-secondary {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-main) !important;
}

.onboarding-actions .btn-secondary:hover {
    background: var(--glass-border) !important;
    color: var(--text-main) !important;
}

/* Modal de Privacidade com Scroll Elegante */
.privacy-content-scroll {
    max-height: 65vh;
    overflow-y: auto;
    padding-right: 12px;
    text-align: left;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.privacy-content-scroll h3 {
    color: var(--text-main);
    font-size: 1rem;
    margin-top: 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 4px;
}

.privacy-content-scroll ul {
    padding-left: 20px;
    margin-bottom: 12px;
}

.privacy-content-scroll li {
    margin-bottom: 4px;
}

/* Zona de Perigo no Perfil */
.danger-zone-box {
    background: rgba(239, 68, 68, 0.07);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 12px;
    padding: 18px;
    margin-top: 25px;
}

body.theme-light .danger-zone-box,
body.theme-beach .danger-zone-box,
body.theme-nature .danger-zone-box {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* === ESTILOS MODERNOS E RESPONSIVOS DO CHECKOUT === */
.checkout-plan-btn {
    width: 100%;
    margin-bottom: 10px;
    margin-top: 0;
    padding: 13px 18px;
    border-radius: 12px;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    text-align: left;
    box-sizing: border-box;
}

.checkout-plan-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.checkout-plan-btn .plan-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.checkout-plan-btn .plan-title {
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
}

.checkout-plan-btn .plan-discount-badge {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.22);
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.checkout-plan-btn .plan-price-box {
    font-size: 0.98rem;
    font-weight: 700;
    white-space: nowrap;
    text-align: right;
    margin-left: 8px;
}

.checkout-plan-btn.plan-annual {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.checkout-plan-btn.plan-semiannual {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.25);
}

.checkout-plan-btn.plan-quarterly {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

.checkout-plan-btn.plan-monthly {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.25);
}

.checkout-plan-btn.plan-lifetime {
    background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.4);
    border: 1px solid rgba(253, 230, 138, 0.3);
}

@media (max-width: 480px) {
    .checkout-plan-btn {
        padding: 12px 14px;
    }
    .checkout-plan-btn .plan-title {
        font-size: 0.88rem;
    }
    .checkout-plan-btn .plan-discount-badge {
        font-size: 0.68rem;
        padding: 2px 5px;
    }
    .checkout-plan-btn .plan-price-box {
        font-size: 0.88rem;
    }
}

/* ========================================================
   HARMONIZAÇÃO VISUAL DE NOVAS TELAS E COMPONENTES
   ======================================================== */

/* Modal Content Base */
.modal-content {
    background: var(--bg-dark);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body.theme-light .modal-content,
body.theme-beach .modal-content,
body.theme-nature .modal-content {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}

/* Card de Completude do Perfil */
#profile-completion-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 15px 18px;
    border-radius: 14px;
    margin-bottom: 16px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

body.theme-light #profile-completion-card,
body.theme-beach #profile-completion-card,
body.theme-nature #profile-completion-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.profile-completion-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-completion-track {
    width: 100%;
    background: var(--progress-track);
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
    margin: 8px 0 6px 0;
}

#profile-completion-hint {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.4;
}

/* Container de XP e Nível do Perfil */
#prof-xp-container .prof-xp-track {
    width: 100%;
    background: var(--progress-track);
    border-radius: 10px;
    height: 12px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

#prof-xp-container .prof-xp-link {
    font-size: 0.78rem;
    color: var(--primary);
    margin-top: 6px;
    font-weight: 600;
    display: inline-block;
    transition: opacity 0.2s;
}

#prof-xp-container .prof-xp-link:hover {
    opacity: 0.8;
}

/* Card de Previsão de Gastos (Contas Fixas) */
#fixed-forecast-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: background 0.3s ease, border-color 0.3s ease;
}

body.theme-light #fixed-forecast-container,
body.theme-beach #fixed-forecast-container,
body.theme-nature #fixed-forecast-container {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

/* Banner Próximo Passo Recomendado */
#onboarding-next-step-banner {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

body.theme-light #onboarding-next-step-banner,
body.theme-beach #onboarding-next-step-banner,
body.theme-nature #onboarding-next-step-banner {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

/* Caixa de Cupom no Checkout */
.checkout-coupon-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 16px;
}

body.theme-light .checkout-coupon-box,
body.theme-beach .checkout-coupon-box,
body.theme-nature .checkout-coupon-box {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* ==========================================================
   MÓDULO DE AÇÕES & MERCADO: HEATMAP E RAIO-X DO ATIVO
   ========================================================== */

/* Barra de Busca de Mercado */
.market-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 260px;
}

.market-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

.market-search-input {
    width: 100%;
    padding: 10px 38px 10px 38px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.market-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.market-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    display: none;
    padding: 2px 6px;
}

/* Filtros Rápidos por Categoria (Pills) */
.market-filter-pills {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.market-filter-pill {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.market-filter-pill:hover {
    color: var(--text-main);
    border-color: var(--primary);
}

.market-filter-pill.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

/* Grid do Mapa de Mercado (Heatmap) */
.market-heatmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(162px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}

@media (max-width: 480px) {
    .market-heatmap-grid {
        grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
        gap: 10px;
    }
}

/* Tile Individual do Heatmap */
.heatmap-tile {
    position: relative;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 106px;
    cursor: pointer;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s, border-color 0.2s;
    overflow: hidden;
    user-select: none;
}

.heatmap-tile:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 24px -6px rgba(0, 0, 0, 0.35);
    z-index: 2;
}

/* Cores e Variações do Heatmap */
.heatmap-tile.tile-up-strong {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.26) 0%, rgba(5, 150, 105, 0.14) 100%);
    border-color: rgba(16, 185, 129, 0.45);
}

.heatmap-tile.tile-up-strong:hover {
    border-color: #10b981;
    box-shadow: 0 10px 24px -4px rgba(16, 185, 129, 0.3);
}

.heatmap-tile.tile-up {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14) 0%, rgba(5, 150, 105, 0.06) 100%);
    border-color: rgba(16, 185, 129, 0.25);
}

.heatmap-tile.tile-neutral {
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

.heatmap-tile.tile-down {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.14) 0%, rgba(185, 28, 28, 0.06) 100%);
    border-color: rgba(239, 68, 68, 0.25);
}

.heatmap-tile.tile-down-strong {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.26) 0%, rgba(185, 28, 28, 0.14) 100%);
    border-color: rgba(239, 68, 68, 0.45);
}

.heatmap-tile.tile-down-strong:hover {
    border-color: #ef4444;
    box-shadow: 0 10px 24px -4px rgba(239, 68, 68, 0.3);
}

/* Componentes internos do Tile */
.heatmap-tile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.heatmap-tile-ticker {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--text-main);
}

.heatmap-tile-badge {
    font-size: 0.62rem;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 4px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.heatmap-tile-name {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
    line-height: 1.2;
}

.heatmap-tile-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    flex-wrap: nowrap;
}

.heatmap-tile-price {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    flex-shrink: 1;
    min-width: 0;
}

.heatmap-tile-price.price-large {
    font-size: 0.80rem;
    letter-spacing: -0.3px;
}

.heatmap-tile-change {
    font-size: 0.70rem;
    font-weight: 700;
    padding: 2.5px 5.5px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.heatmap-tile-change.badge-up {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.heatmap-tile-change.badge-down {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.heatmap-tile-change.badge-neutral {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-muted);
}

/* Suporte de Temas Claros para o Heatmap */
body.theme-light .heatmap-tile,
body.theme-beach .heatmap-tile,
body.theme-nature .heatmap-tile {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body.theme-light .heatmap-tile.tile-neutral,
body.theme-beach .heatmap-tile.tile-neutral,
body.theme-nature .heatmap-tile.tile-neutral {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .heatmap-tile.tile-up,
body.theme-beach .heatmap-tile.tile-up,
body.theme-nature .heatmap-tile.tile-up {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-color: rgba(16, 185, 129, 0.35);
}

body.theme-light .heatmap-tile.tile-down,
body.theme-beach .heatmap-tile.tile-down,
body.theme-nature .heatmap-tile.tile-down {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-color: rgba(239, 68, 68, 0.35);
}

/* Modal de Raio-X do Ativo */
.asset-details-card {
    max-width: 680px;
    width: 94%;
    max-height: 92vh;
    overflow-y: auto;
    padding: 24px;
    border-radius: 18px;
    border: 1px solid var(--glass-border);
    background: var(--card-surface);
}

.asset-details-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.asset-range-bar {
    display: flex;
    gap: 6px;
    background: var(--glass-bg);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    margin-bottom: 16px;
    overflow-x: auto;
}

.asset-range-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.asset-range-btn:hover {
    color: var(--text-main);
}

.asset-range-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

.asset-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 18px;
    margin-bottom: 20px;
}

.asset-stat-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 10px 12px;
    text-align: center;
}

.asset-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 3px;
}

.asset-stat-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

/* ==========================================================
   TOOLBAR SUPERIOR & RESPONSIVIDADE (RENDA VARIÁVEL)
   ========================================================== */
.variable-top-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    background: var(--card-surface);
    padding: 12px 18px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
}

.variable-views-nav {
    display: flex;
    background: var(--glass-bg);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    gap: 4px;
}

.variable-actions-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Grid de Resumo de Renda Variável */
.assets-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

/* Painel de Proventos: 2 colunas equilibradas em desktop */
.assets-dividends-panels {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 10px;
}

/* ==========================================================
   MÓDULO DE RECOMENDAÇÕES DE INVESTIMENTOS COM IA
   ========================================================== */
.ai-diagnosis-banner {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.16) 0%, rgba(16, 185, 129, 0.12) 100%);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 25px;
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ai-diagnosis-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.ai-profile-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-profile-badge.badge-agressivo {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.ai-profile-badge.badge-moderado {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.ai-profile-badge.badge-conservador {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.ai-alloc-bar-wrapper {
    display: flex;
    height: 12px;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 14px;
    background: var(--progress-track);
    border: 1px solid var(--glass-border);
}

.ai-alloc-segment {
    height: 100%;
    transition: width 0.4s ease;
}

.ai-rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
    margin-top: 15px;
    margin-bottom: 30px;
}

.ai-rec-card {
    background: var(--card-surface);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s, border-color 0.2s;
}

.ai-rec-card:hover {
    transform: translateY(-3px);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 10px 24px -6px rgba(0, 0, 0, 0.35);
}

/* ==========================================================
   REGRAS DE RESPONSIVIDADE MOBILE (Telas <= 768px e <= 480px)
   ========================================================== */
@media (max-width: 768px) {
    .variable-top-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 12px;
    }

    .variable-views-nav {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        padding: 4px;
    }

    .variable-views-nav .subtab-btn {
        flex: 1;
        text-align: center;
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .variable-actions-bar {
        width: 100%;
        justify-content: space-between;
    }

    .variable-actions-bar button {
        flex: 1;
        padding: 8px 10px;
        font-size: 0.8rem;
        text-align: center;
    }

    .assets-summary-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .assets-dividends-panels {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}

@media (max-width: 480px) {
    .variable-actions-bar {
        flex-direction: column;
    }

    .variable-actions-bar button {
        width: 100%;
    }

    .ai-rec-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Lembretes e Dívidas (debts-view)
   ============================================================ */
#debts-view .glass-card {
    max-width: 100% !important;
    width: 100%;
    margin: 0 0 25px 0;
    box-sizing: border-box;
    padding: 24px 28px;
}

#debts-view .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

#debts-view table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
    text-align: left;
}

#debts-view th {
    padding: 14px 12px;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.02);
}

#debts-view td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--glass-border);
    vertical-align: middle;
    font-size: 0.9rem;
}

#debts-view tr:hover td {
    background: rgba(255, 255, 255, 0.025);
}

.debt-action-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-debt-pay {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.25);
    margin: 0;
    width: auto;
}

.btn-debt-pay:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.4);
}

.btn-debt-pay.paid {
    background: rgba(139, 92, 246, 0.18);
    color: var(--primary-light);
    border: 1px solid rgba(139, 92, 246, 0.35);
    box-shadow: none;
}

.btn-debt-pay.paid:hover {
    background: rgba(139, 92, 246, 0.28);
    color: #ffffff;
}

.btn-debt-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    padding: 0;
    margin: 0;
}

.btn-debt-action:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.btn-debt-action.delete:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
}

.btn-debt-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: transform 0.15s ease, background 0.2s ease;
    margin: 0;
}

.btn-debt-toggle:hover {
    transform: scale(1.15);
    background: rgba(255, 255, 255, 0.08);
}

/* ==========================================
   CALENDÁRIO FINANCEIRO VISUAL & FAB
   ========================================== */

/* Botão Flutuante (FAB) de Nova Movimentação - Empilhado acima do Chat da IA */
.fab-add-expense {
    position: fixed;
    bottom: 102px; /* Fica 12px acima do botão da IA (que ocupa de 30px a 90px) */
    right: 33px;  /* Centralizado verticalmente com o botão da IA */
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    color: white;
    border: none;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    font-weight: 400;
    cursor: pointer;
    z-index: 9998;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
}

.fab-add-expense:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.6);
}

/* =========================================================================
   MODAL DO CALENDÁRIO FINANCEIRO VISUAL (PREMIUM DESIGN)
   ========================================================================= */
.calendar-modal-card {
    max-width: 1080px;
    width: 95%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    padding: 24px 28px;
    box-sizing: border-box;
    overflow-y: auto;
    background: radial-gradient(circle at top right, rgba(139, 92, 246, 0.08), transparent 40%),
                radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.05), transparent 40%),
                rgba(17, 24, 39, 0.96) !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 40px rgba(139, 92, 246, 0.15);
    backdrop-filter: blur(20px);
}

.calendar-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.calendar-header-title-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.calendar-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(59, 130, 246, 0.15));
    border: 1px solid rgba(139, 92, 246, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.calendar-header-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #c4b5fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.calendar-header-desc {
    margin: 2px 0 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.calendar-month-nav {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 3px 6px;
    gap: 6px;
}

.calendar-nav-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.5);
    color: #fff;
    transform: scale(1.05);
}

#calendar-month-display {
    font-weight: 800;
    font-size: 1rem;
    min-width: 135px;
    text-align: center;
    color: #f8fafc;
    letter-spacing: -0.01em;
}

.calendar-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 7px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

/* KPIs de Resumo do Calendário */
.calendar-kpi-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.calendar-kpi-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.calendar-kpi {
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease;
}

.calendar-kpi:hover {
    transform: translateY(-1px);
}

.calendar-kpi .kpi-icon {
    font-size: 1.15rem;
}

.calendar-kpi .kpi-label {
    font-size: 0.7rem;
    display: block;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
}

.calendar-kpi .kpi-val {
    font-size: 0.92rem;
    font-weight: 800;
    display: block;
}

.calendar-kpi-pending {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(239, 68, 68, 0.04)) !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
    color: #fca5a5 !important;
}
.calendar-kpi-paid {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(16, 185, 129, 0.04)) !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
    color: #6ee7b7 !important;
}
.calendar-kpi-income {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.14), rgba(6, 182, 212, 0.04)) !important;
    border-color: rgba(6, 182, 212, 0.35) !important;
    color: #67e8f9 !important;
}

/* Legenda Refinada */
.calendar-legend-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 6px 12px;
    border-radius: 10px;
}

.calendar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.calendar-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* GRADE DO CALENDÁRIO */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 16px;
}

/* Cabeçalho dos Dias da Semana */
.calendar-day-header {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 8px 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    box-sizing: border-box;
}

.calendar-day-header.weekend {
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.18);
}

/* Células dos Dias */
.calendar-day-cell {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    min-height: 88px;
    padding: 6px 7px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.calendar-day-cell:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
    z-index: 2;
}

/* Células Vazias (dias antes do início do mês) */
.calendar-day-cell.is-empty,
.calendar-day-cell.empty-day {
    background: transparent !important;
    border: 1px dashed rgba(255, 255, 255, 0.04) !important;
    cursor: default !important;
    pointer-events: none !important;
    opacity: 0.25;
}

/* Célula do Dia Atual (Hoje) */
.calendar-day-cell.is-today {
    border-color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.1) !important;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
}

.calendar-day-cell.is-today .calendar-day-num {
    color: #38bdf8;
    font-weight: 800;
}

/* Célula Selecionada (Raio-X Ativo) */
.calendar-day-cell.is-selected,
.calendar-day-cell.selected {
    border-color: #a855f7 !important;
    background: rgba(168, 85, 247, 0.16) !important;
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.35) !important;
    transform: translateY(-2px);
    z-index: 3;
}

.calendar-day-cell.is-selected .calendar-day-num,
.calendar-day-cell.selected .calendar-day-num {
    color: #e9d5ff;
}

/* Número do Dia */
.calendar-day-num {
    font-size: 0.82rem;
    font-weight: 700;
    color: #cbd5e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    line-height: 1;
}

.calendar-events-container {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

/* Pílulas de Eventos (Pills) */
.cal-pill {
    font-size: 0.67rem;
    height: 19px;
    line-height: 19px;
    padding: 0 5px;
    border-radius: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: block;
    transition: filter 0.15s ease;
}

.cal-pill:hover {
    filter: brightness(1.2);
}

.cal-pill-fixed-pending { 
    background: rgba(239, 68, 68, 0.2); 
    color: #fca5a5; 
    border-left: 3px solid #ef4444; 
}
.cal-pill-fixed-paid { 
    background: rgba(16, 185, 129, 0.18); 
    color: #6ee7b7; 
    border-left: 3px solid #10b981; 
}
.cal-pill-salary { 
    background: rgba(16, 185, 129, 0.25); 
    color: #a7f3d0; 
    border-left: 3px solid #34d399; 
    font-weight: 700; 
}
.cal-pill-card { 
    background: rgba(245, 158, 11, 0.2); 
    color: #fde68a; 
    border-left: 3px solid #f59e0b; 
}
.cal-pill-debt { 
    background: rgba(236, 72, 153, 0.2); 
    color: #fbcfe8; 
    border-left: 3px solid #ec4899; 
}
.cal-pill-var {
    background: rgba(148, 163, 184, 0.16);
    color: #cbd5e1;
    border-left: 3px solid #94a3b8;
}
.cal-pill-more { 
    font-size: 0.62rem; 
    color: #c4b5fd; 
    font-weight: 700; 
    text-align: center; 
    background: rgba(139, 92, 246, 0.15);
    border-radius: 4px;
    padding: 1px 4px;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Detalhes do Dia Selecionado (Painel Raio-X) */
.calendar-day-details {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 18px 20px;
    margin-top: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.calendar-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
}

.calendar-details-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-details-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(139, 92, 246, 0.25);
    color: #ddd6fe;
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.calendar-details-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 230px;
    overflow-y: auto;
    padding-right: 4px;
}

.calendar-details-list::-webkit-scrollbar {
    width: 5px;
}
.calendar-details-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.calendar-quick-actions-bar {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
}

.calendar-quick-btn {
    flex: 1;
    min-width: 150px;
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.calendar-quick-btn-expense {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
}
.calendar-quick-btn-expense:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
}

.calendar-quick-btn-debt {
    background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
    color: #ffffff;
}
.calendar-quick-btn-debt:hover {
    background: linear-gradient(135deg, #db2777 0%, #e11d48 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(236, 72, 153, 0.4);
}

@media (max-width: 768px) {
    .calendar-modal-card {
        padding: 16px 12px;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }
    .calendar-grid {
        gap: 4px;
    }
    .calendar-day-cell {
        min-height: 60px;
        padding: 4px 3px;
        border-radius: 8px;
    }
    .calendar-day-num {
        font-size: 0.72rem;
        margin-bottom: 2px;
    }
    .cal-pill {
        font-size: 0.58rem;
        height: 15px;
        line-height: 15px;
        padding: 0 3px;
        border-radius: 3px;
    }
    .calendar-header-bar {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }
    .calendar-kpi-row {
        gap: 8px;
    }
    .calendar-kpi {
        padding: 6px 10px;
        flex: 1 1 45%;
    }
    .calendar-legend-bar {
        width: 100%;
        justify-content: center;
    }
}

/* =========================================================================
   CABEÇALHO MODERNO DO DASHBOARD (DESKTOP & MOBILE)
   ========================================================================= */
.dash-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.dash-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-header-title-wrap h2 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.3px;
}

.dash-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.dash-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dash-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-main);
    text-decoration: none;
    line-height: 1.2;
}

.dash-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.dash-action-btn.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(109, 40, 217, 0.35);
}

.dash-action-btn.primary:hover {
    box-shadow: 0 6px 18px rgba(109, 40, 217, 0.5);
}

.dash-action-btn.primary .action-icon {
    font-size: 1.1rem;
    line-height: 1;
    font-weight: 700;
    color: #ffffff;
}

/* =========================================================================
   MODAL DE NOVA MOVIMENTAÇÃO (DESKTOP & MOBILE)
   ========================================================================= */
.add-tx-modal-card {
    max-width: 580px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 26px 28px;
    position: relative;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    background: rgba(15, 23, 42, 0.96);
}

.add-tx-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 12px;
    width: auto;
    font-size: 0.85rem;
    border-radius: 8px;
    line-height: 1;
}

.add-tx-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.add-tx-header-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.add-tx-title {
    margin: 0;
    color: var(--primary-light);
    font-size: 1.25rem;
    font-weight: 700;
}

.add-tx-subtitle {
    margin: 3px 0 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.add-tx-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}

.add-tx-grid .input-group {
    margin-bottom: 0 !important;
    display: flex;
    flex-direction: column;
    min-width: 0 !important;
    width: 100% !important;
}

.add-tx-grid .input-group.col-span-2 {
    grid-column: span 2;
}

.add-tx-grid label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block;
}

.add-tx-grid select,
.add-tx-grid input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 9px 12px;
    font-size: 0.88rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

.add-tx-grid select option {
    background: #1e293b;
    color: #f8fafc;
}

.add-tx-submit-btn {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    box-shadow: 0 4px 15px rgba(109, 40, 217, 0.35);
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    color: #ffffff;
}

.add-tx-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(109, 40, 217, 0.5);
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .dash-header-modern {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 18px;
    }

    .dash-header-left {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .dash-header-title-wrap h2 {
        font-size: 1.3rem;
    }

    .dash-header-right {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
    }

    .dash-header-right .month-filter {
        order: 1;
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .dash-header-actions {
        order: 2;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    .dash-header-actions .dash-action-btn {
        width: 100%;
        padding: 9px 8px;
        font-size: 0.8rem;
    }

    .dash-header-actions .dash-action-btn.primary {
        grid-column: span 2;
        padding: 11px 12px;
        font-size: 0.88rem;
    }

    .add-tx-modal-card {
        padding: 18px 14px;
        width: 95%;
        max-height: 94vh;
        border-radius: 14px;
    }

    .add-tx-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .add-tx-grid .input-group.col-span-2 {
        grid-column: span 1;
    }

    /* No Mobile: Oculta os 3 botões avulsos que ficavam sobrepostos e poluindo a tela */
    .fab-add-expense,
    .calc-btn-toggle,
    .ai-chat-btn {
        display: none !important;
    }

    /* Painel da Calculadora quando acionado pelo menu de ações no mobile */
    .calc-widget {
        bottom: calc(75px + env(safe-area-inset-bottom, 0px)) !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: auto !important;
        z-index: 10006 !important;
    }

    .calc-panel {
        width: 290px !important;
        margin: 0 auto !important;
        border: 1px solid var(--glass-border) !important;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7) !important;
    }

    /* Painel do Chat IA quando acionado pelo menu de ações no mobile */
    .ai-chat-widget {
        bottom: calc(75px + env(safe-area-inset-bottom, 0px)) !important;
        right: 12px !important;
        left: 12px !important;
        width: auto !important;
        z-index: 10006 !important;
    }

    .ai-chat-panel {
        width: 100% !important;
        max-width: 440px !important;
        margin: 0 auto !important;
        height: min(520px, 78vh) !important;
        border: 1px solid var(--glass-border) !important;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7) !important;
    }
}

/* ==========================================================================
   FASE 3: ECOSSISTEMA CONJUGAL AVANÇADO
   - Radar Inteligente de Alertas (Tópico 4)
   - Mural de Recados do Casal (Tópico 2)
   - Desafios da Dupla Gamificados (Tópico 3)
   - Reserva de Emergência Inteligente (Tópico 1)
   ========================================================================== */

/* 1. Radar Inteligente de Alertas */
.smart-alerts-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 0 20px 0 !important;
    padding: 18px 22px !important;
    border-radius: 18px !important;
    transition: all 0.3s ease;
    overflow: hidden;
}

.smart-alerts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 12px;
    margin-top: 14px;
    width: 100%;
}

.smart-alerts-grid.collapsed {
    display: none !important;
}

.smart-alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid var(--glass-border);
    gap: 14px;
    flex-wrap: nowrap;
    transition: transform 0.2s, background 0.2s;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .smart-alerts-grid {
        grid-template-columns: 1fr;
    }
    .smart-alerts-grid.collapsed {
        display: none !important;
    }
    .smart-alert-item {
        flex-wrap: wrap;
    }
}

.smart-alert-item:hover {
    background: rgba(15, 23, 42, 0.7);
    transform: translateY(-1px);
}

.smart-alert-item.alert-danger {
    border-left: 4px solid #ef4444;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.08) 0%, rgba(15, 23, 42, 0.6) 100%);
}

.smart-alert-item.alert-warning {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.08) 0%, rgba(15, 23, 42, 0.6) 100%);
}

.smart-alert-item.alert-info {
    border-left: 4px solid #06b6d4;
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.08) 0%, rgba(15, 23, 42, 0.6) 100%);
}

.smart-alert-item.alert-success {
    border-left: 4px solid #10b981;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.08) 0%, rgba(15, 23, 42, 0.6) 100%);
}

.smart-alert-action-btn {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    white-space: nowrap;
    transition: all 0.2s;
}

.smart-alert-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--text-muted);
}

/* 2. Mural de Recados do Casal */
.sticky-note-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.sticky-note-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.sticky-note-item.is-pinned {
    border: 1px solid rgba(236, 72, 153, 0.4);
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.1) 0%, rgba(15, 23, 42, 0.7) 100%);
}

.sticky-note-pin-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.sticky-note-pin-badge:hover {
    opacity: 1;
}

/* 3. Desafios da Dupla */
.challenge-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s;
}

.challenge-item.status-completed {
    border-color: rgba(16, 185, 129, 0.5);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(15, 23, 42, 0.7) 100%);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.challenge-btn-claim {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    animation: pulseReward 2s infinite;
}

@keyframes pulseReward {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.challenge-template-pill {
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.challenge-template-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   FASE 4: SUB-ABAS EM METAS, LINHA DO TEMPO DE SONHOS, VIAGENS E QUIZ CONJUGAL
   ========================================================================== */

/* Sub-navegação em Metas */
.metas-subnav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.metas-subnav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 9px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.metas-subnav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    transform: translateY(-1px);
}

.metas-subnav-btn.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25) 0%, rgba(59, 130, 246, 0.25) 100%);
    border-color: #8b5cf6;
    color: #fff;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.25);
}

/* Card de Grande Sonho */
.dream-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.06) 0%, rgba(15, 23, 42, 0.75) 100%);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 20px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.dream-card:hover {
    border-color: rgba(139, 92, 246, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(139, 92, 246, 0.15);
}

/* Linha do Tempo Conjugal (Timeline) */
.dream-timeline {
    position: relative;
    padding-left: 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 10px;
}

.dream-timeline::before {
    content: '';
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 9px;
    width: 2px;
    background: linear-gradient(180deg, #8b5cf6 0%, rgba(255,255,255,0.15) 100%);
    border-radius: 2px;
}

.timeline-milestone {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid var(--glass-border);
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.timeline-milestone::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 16px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #475569;
    border: 2px solid #0f172a;
    transition: all 0.2s ease;
}

.timeline-milestone.is-done {
    border-color: rgba(16, 185, 129, 0.35);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(15, 23, 42, 0.6) 100%);
}

.timeline-milestone.is-done::before {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

/* Viagens & Multi-moeda */
.trip-card {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.06) 0%, rgba(15, 23, 42, 0.75) 100%);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 20px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.trip-checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.trip-checklist-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

/* Central de Educação & Quiz */
.quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-main);
    transition: all 0.2s ease;
    text-align: left;
}

.quiz-option:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(139, 92, 246, 0.4);
}

.quiz-option.is-selected {
    background: rgba(139, 92, 246, 0.18);
    border-color: #8b5cf6;
    color: #fff;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
}

.quiz-option.is-correct {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: #10b981 !important;
    color: #34d399 !important;
}

.quiz-option.is-wrong {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: #ef4444 !important;
    color: #f87171 !important;
}

.pill-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pill-card:hover {
    border-color: rgba(139, 92, 246, 0.35);
    background: rgba(15, 23, 42, 0.8);
    transform: translateY(-1px);
}

/* ===================================================
   REPAGINAÇÃO DE ORÇAMENTO & CATEGORIAS - HERO & KPIS
   =================================================== */
.budget-kpis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    width: 100%;
}

.budget-kpi-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.budget-kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.budget-kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.budget-kpi-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.budget-kpi-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid transparent;
}

.budget-kpi-badge.income {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

.budget-kpi-badge.budget {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.3);
}

.budget-kpi-badge.spent {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

.budget-kpi-badge.healthy {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

.budget-kpi-badge.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

.budget-kpi-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 4px 0;
    letter-spacing: -0.5px;
}

.budget-kpi-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
}

.budget-overview-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.budget-overview-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 30px;
    align-items: center;
}

@media (max-width: 900px) {
    .budget-overview-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.budget-chart-container {
    position: relative;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.budget-chart-center-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.budget-chart-center-overlay .pct-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
    display: block;
}

.budget-chart-center-overlay .pct-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
}

.budget-progress-bar-wrap {
    background: rgba(0, 0, 0, 0.35);
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    width: 100%;
    margin-bottom: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.budget-impact-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 6px;
}

.budget-impact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 8px 12px;
    transition: background 0.15s ease;
}

.budget-impact-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.budget-alert-box {
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.84rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.budget-alert-box.healthy {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #34d399;
}

.budget-alert-box.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

.budget-alert-box.danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
}

/* ===================================================
   BOTÃO CENTRAL DE AÇÕES RÁPIDAS & BOTTOM SHEET (MOBILE)
   =================================================== */
.bottom-nav-action-btn {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.7rem;
    gap: 2px;
    padding: 0 4px;
    flex: 1;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 10000;
}

.action-btn-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    border: 3px solid #0f172a;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    margin-top: -16px;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.bottom-nav-action-btn:active .action-btn-circle {
    transform: scale(0.92);
}

.bottom-nav-action-btn.active .action-btn-circle {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 18px rgba(239, 68, 68, 0.45);
    transform: rotate(45deg);
}

.bottom-nav-action-btn span {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #cbd5e1;
    margin-top: 1px;
}

/* Overlay Escurecido com Blur */
.quick-actions-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10002;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.quick-actions-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Bottom Sheet */
.quick-actions-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: rgba(17, 24, 39, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    border-left: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
    border-radius: 24px 24px 0 0;
    padding: 12px 18px calc(24px + env(safe-area-inset-bottom, 0px)) 18px;
    box-sizing: border-box;
    z-index: 10003;
    transform: translateY(105%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
}

.quick-actions-sheet.open {
    transform: translateY(0);
}

.sheet-drag-handle {
    width: 42px;
    height: 4px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    margin: 4px auto 14px auto;
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 4px;
}

.sheet-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 4px;
}

.sheet-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.sheet-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sheet-close-btn:active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.quick-actions-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-action-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: all 0.2s ease;
    box-sizing: border-box;
    color: inherit;
}

.quick-action-card:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.08);
}

.quick-action-card.primary {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(59, 130, 246, 0.08) 100%);
    border-color: rgba(16, 185, 129, 0.3);
}

.quick-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-icon-green {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
}

.action-icon-purple {
    background: rgba(168, 85, 247, 0.18);
    color: #c084fc;
}

.action-icon-blue {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
}

.quick-action-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.quick-action-info strong {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 600;
}

.quick-action-info small {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.quick-action-arrow {
    font-size: 1.3rem;
    color: var(--text-muted);
    font-weight: 300;
}

/* Bloqueio do Bottom Sheet Mobile no Desktop */
@media (min-width: 769px) {
    .quick-actions-sheet,
    .quick-actions-overlay {
        display: none !important;
    }
}

/* ==========================================
   GESTÃO DE CONTAS FIXAS REFINADA
   ========================================== */
.fixed-form-fields-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 0.8fr 1.4fr 1.2fr;
    gap: 14px;
    align-items: flex-end;
}

.fixed-form-fields-grid .input-group {
    margin-bottom: 0;
}

.fixed-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    flex-wrap: wrap;
    gap: 12px;
}

.fixed-autopay-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.22);
    transition: all 0.2s ease;
}

.fixed-autopay-toggle:hover {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.35);
}

.fixed-autopay-toggle input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #10b981;
    cursor: pointer;
    margin: 0;
}

.autopay-label-content {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.86rem;
    color: #34d399;
    font-weight: 500;
}

.autopay-label-content strong {
    font-weight: 700;
}

.btn-add-fixed {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px;
    height: 44px;
    border-radius: 11px;
    font-size: 0.94rem;
    font-weight: 600;
    margin-top: 0 !important;
    width: auto !important;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(109, 40, 217, 0.3);
    transition: all 0.2s ease;
}

.btn-add-fixed:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(109, 40, 217, 0.45);
}

.fixed-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-filter-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    transition: all 0.2s ease;
}

.checkbox-filter-label:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.checkbox-filter-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0;
}

/* Cards das Contas Fixas */
.fixed-card-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.fixed-card-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35);
}

.fixed-card-item.inactive {
    opacity: 0.65;
    border-style: dashed;
}

.fixed-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.fixed-card-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fixed-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.fixed-card-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.fixed-card-badge {
    padding: 3px 9px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.fixed-card-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.fixed-card-badge.paused {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.fixed-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    gap: 10px;
}

.fixed-card-amount {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--secondary);
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.fixed-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.fixed-btn-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 5px 8px;
    font-size: 0.76rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.fixed-btn-action.edit {
    color: #60a5fa;
}
.fixed-btn-action.edit:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

.fixed-btn-action.pause {
    color: #fbbf24;
}
.fixed-btn-action.pause:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
}

.fixed-btn-action.restore {
    color: #34d399;
}
.fixed-btn-action.restore:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
}

.fixed-btn-action.delete {
    color: #f87171;
}
.fixed-btn-action.delete:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

.fixed-partner-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

@media (max-width: 992px) {
    .fixed-form-fields-grid {
        grid-template-columns: 1fr 1fr;
    }
    .fixed-form-fields-grid .col-desc {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .fixed-form-fields-grid {
        grid-template-columns: 1fr;
    }
    .fixed-form-fields-grid .col-desc {
        grid-column: span 1;
    }
    .fixed-form-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-add-fixed {
        width: 100%;
        justify-content: center;
    }
}




