/* ==========================================================================
   MONO DESIGN SYSTEM - STYLES.CSS
   Dark/Green Neon Aesthetic with Seamless Light Mode Toggle
   ========================================================================== */

:root {
    /* Fonts */
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Base Colors - Dark Theme (Default mono) */
    --bg-main: #090d16;
    --bg-header: rgba(15, 23, 42, 0.85);
    --bg-card: #131b2e;
    --bg-card-hover: #1a253e;
    --bg-input: #1a233a;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(16, 185, 129, 0.3);

    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Brand Palette (Emerald & Green Glow) */
    --primary: #10b981;
    --primary-hover: #059669;
    --primary-glow: rgba(16, 185, 129, 0.25);
    --accent-green: #34d399;
    --accent-emerald: #00e676;

    /* Financial Status Colors */
    --income-color: #10b981;
    --income-bg: rgba(16, 185, 129, 0.12);
    --expense-color: #f43f5e;
    --expense-bg: rgba(244, 63, 94, 0.12);
    --warning-color: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --info-color: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.12);

    /* WhatsApp Brand Color */
    --whatsapp-color: #25d366;
    --whatsapp-glow: rgba(37, 211, 102, 0.25);

    /* Shadows & Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.15);
    --glass-blur: blur(12px);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    /* Transition Speed */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Overrides */
[data-theme="light"] {
    --bg-main: #f1f5f9;
    --bg-header: rgba(255, 255, 255, 0.9);
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #e2e8f0;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-highlight: rgba(16, 185, 129, 0.4);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.2);
}

/* ==========================================================================
   MULTI-MODO: Finanças / Disciplina / Estudo
   Troca a cor de destaque do app inteiro via "html[data-mode]" — como quase
   todo componente (botão de ação, nav ativa, badges, barras de progresso) já
   usa var(--primary)/var(--primary-hover)/var(--primary-glow) em vez de cor
   fixa, sobrescrever essas 3 variáveis aqui já retema o app inteiro sem
   precisar duplicar regra por componente. "financas" não precisa de bloco
   próprio — é a paleta padrão já definida em :root acima.
   ========================================================================== */
html[data-mode="disciplina"] {
    --primary: #f97316;
    --primary-hover: #ea580c;
    --primary-glow: rgba(249, 115, 22, 0.25);
    --accent-green: #fb923c;
    --accent-emerald: #f97316;
    --border-highlight: rgba(249, 115, 22, 0.3);
    --shadow-glow: 0 0 25px rgba(249, 115, 22, 0.15);
}

html[data-mode="estudo"] {
    --primary: #2563eb;
    --primary-hover: #3b82f6;
    --primary-glow: rgba(37, 99, 235, 0.25);
    --accent-green: #3b82f6;
    --accent-emerald: #2563eb;
    --border-highlight: rgba(37, 99, 235, 0.3);
    --shadow-glow: 0 0 25px rgba(37, 99, 235, 0.15);
}

/* ==========================================================================
   SELETOR DE MODO (Finanças / Disciplina / Estudo)
   ========================================================================== */
.mode-selector {
    display: flex;
    background: var(--bg-input);
    border-radius: 12px;
    padding: 4px;
    margin: 0 20px 16px;
    gap: 4px;
}

.mode-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 9px 4px;
    border-radius: 9px;
    font-size: 0.68rem;
    font-weight: 700;
    font-family: var(--font-main);
    cursor: pointer;
    transition: var(--transition);
}

.mode-tab i {
    font-size: 1rem;
}

.mode-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.mode-tab.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Container re-renderizado a cada troca de modo (ver renderSidebarMenu em
   multimode.js) — fade simples de opacidade dá a "transição suave" pedida sem
   precisar animar altura/layout do menu, que muda de item pra item por modo. */
#sidebar-nav-dynamic {
    transition: opacity 0.18s ease;
}
#sidebar-nav-dynamic.nav-fading {
    opacity: 0;
}

.nav-link.coming-soon {
    opacity: 0.55;
    cursor: not-allowed;
    justify-content: space-between;
}
.nav-link.coming-soon:hover {
    background: transparent;
    color: var(--text-secondary);
}

/* Base Resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    max-width: 100vw;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Global Typography Adjustments */
h1, h2, h3, h4, .tab-btn, label, p {
    letter-spacing: 0.02em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

/* ==========================================================================
   OFFCANVAS SIDEBAR COMPONENT
   ========================================================================== */

/* Overlay escuro que aparece atrás do menu */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    z-index: 299;
    animation: fadeOverlay 0.2s ease;
}

.overlay.active {
    display: block;
}

@keyframes fadeOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Botão Hambúrguer */
.btn-hamburger {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.3rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-hamburger:hover {
    background: var(--bg-input);
    color: var(--primary);
}

/* Sidebar offcanvas */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.active {
    transform: translateX(0);
}

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

.btn-close-sidebar {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-close-sidebar:hover {
    background: var(--bg-input);
    color: var(--expense-color);
}

.sidebar-nav {
    /* flex:1 + min-height:0 é o que faz esse container realmente ocupar o espaço
       restante (abaixo do .sidebar-header, que tem flex-shrink:0) e permite que o
       overflow-y:auto role de verdade até o fim — sem min-height:0 um filho flex
       cresce pra caber todo o conteúdo e o scroll nunca chega a engatilhar. */
    flex: 1;
    min-height: 0;
    padding: 20px 14px 30px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-group-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 10px;
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 10px;
    transition: var(--transition);
    position: relative;
}

.nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-link:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--primary-glow);
    color: var(--primary);
    font-weight: 700;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-link.locked {
    opacity: 0.55;
    cursor: not-allowed;
    justify-content: space-between;
}

.nav-link.locked:hover {
    background: transparent;
    color: var(--text-secondary);
}

.badge-pro {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-left: auto;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ==========================================================================
   HEADER COMPONENT
   ========================================================================== */
.app-header {
    /* position:sticky (não position:relative) de propósito — sticky preserva o
       cabeçalho grudado no topo ao rolar a página (comportamento já existente) e,
       assim como relative, também serve de containing block pra filhos com
       position:absolute (dropdown do perfil, popover de período). */
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-header);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    height: 60px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 36px;
    flex-shrink: 0;
}

/* Seletor de período: filho direto do .app-header (não mais aninhado em
   .header-right — ver index.html). No desktop, margin-left:auto absorve todo o
   espaço livre da flexbox e "gruta" o seletor logo antes do avatar, preservando o
   agrupamento visual que já existia; o avatar em si nunca é afetado por isso,
   porque continua isolado dentro de .header-right, no fluxo normal da flexbox. */
.app-header > .month-selector {
    margin-left: auto;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary) 0%, #059669 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
}

.brand-name .highlight {
    color: var(--primary);
}

.brand-tagline {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Nav Tabs Antigas removidas */

.pulse-badge {
    width: 8px;
    height: 8px;
    background-color: var(--whatsapp-color);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--whatsapp-color);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(37, 211, 102, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Logo centralizado do header mobile — escondido no desktop, ver @media max-width:768px */
.header-center-mobile {
    display: none;
}

/* Month Selector */
.month-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: 10px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--bg-input);
    color: var(--primary);
}

.current-period {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
    justify-content: center;
}

.current-period i {
    color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-income {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-income:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-expense {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.3);
}

.btn-expense:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 63, 94, 0.45);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-danger {
    background: #f43f5e;
    color: #ffffff;
    border: none;
}

.btn-danger:hover {
    background: #e11d48;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.4);
}

.btn-whatsapp {
    background: #25d366;
    color: #ffffff;
    font-weight: 700;
}

.btn-whatsapp:hover {
    background: #1eb857;
    box-shadow: 0 4px 14px var(--whatsapp-glow);
}

.btn-whatsapp-direct {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    text-decoration: none;
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: #f43f5e;
}

.btn-outline-danger:hover {
    background: rgba(244, 63, 94, 0.1);
}

.btn-edit-category {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit-category:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-block {
    width: 100%;
}

/* Theme Toggle Button */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: rotate(15deg);
}

[data-theme="dark"] .icon-light { display: block; color: #f59e0b; }
[data-theme="dark"] .icon-dark { display: none; }

[data-theme="light"] .icon-light { display: none; }
[data-theme="light"] .icon-dark { display: block; color: #3b82f6; }

/* ==========================================================================
   MAIN CONTENT & METRICS SECTION
   ========================================================================== */
.main-content {
    flex: 1;
    padding: 28px;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    overflow-x: hidden;
}

.page-section {
    display: none;
    flex-direction: column;
    gap: 28px;
    animation: fadeIn 0.3s ease-in-out;
}

.page-section.active {
    display: flex;
}

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

.section-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title-bar h2 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.section-title-bar h2 i {
    color: var(--primary);
}

.updated-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Metrics Grid - 8 Cards Layout */
/* Padronização global de largura dos cards — mesma largura útil do container pai
   (a coluna do grid/flex em que cada um está) em qualquer resolução de tela, e
   overflow:hidden pra nenhum elemento interno vazar das bordas arredondadas (ex.:
   canvas de gráfico, o círculo decorativo do .credit-card, texto longo). box-sizing
   já é border-box globalmente (ver `*` no topo do arquivo) — repetido aqui só pra
   deixar explícito que padding/border desses cards nunca somam largura extra. */
.metric-card,
.chart-card,
.report-card,
.construction-card,
.wallet-card,
.credit-card,
.card-limit-item {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

/* Cards com data-filter são clicáveis */
.metric-card[data-filter] {
    cursor: pointer;
    user-select: none;
}

.metric-card[data-filter]:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md), 0 0 0 2px var(--primary-glow);
}

.metric-card[data-filter]:active {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Card selecionado (filtro ativo) */
.metric-card.card-filter-active {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px var(--primary-glow), var(--shadow-md) !important;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.07) 0%, var(--bg-card) 100%) !important;
}

.metric-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-highlight);
    box-shadow: var(--shadow-md);
}

.metric-card.highlight-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, var(--bg-card) 100%);
    border: 1.5px solid var(--primary);
    box-shadow: var(--shadow-glow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.balance-icon { background: rgba(16, 185, 129, 0.2); color: var(--primary); }
.income-icon { background: var(--income-bg); color: var(--income-color); }
.expense-icon { background: var(--expense-bg); color: var(--expense-color); }
.received-icon { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.paid-icon { background: var(--info-bg); color: var(--info-color); }
.to-receive-icon { background: var(--warning-bg); color: var(--warning-color); }
.to-pay-icon { background: var(--expense-bg); color: var(--expense-color); }
.statement-icon { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }

.card-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.card-value.positive { color: var(--income-color); }
.card-value.negative { color: var(--expense-color); }
.card-value.warning { color: var(--expense-color); }
.card-value.info { color: var(--warning-color); }

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
}

.card-subtext {
    color: var(--text-muted);
}

.card-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
}

.trend-positive { color: var(--income-color); }
.trend-negative { color: var(--expense-color); }
.trend-neutral { color: var(--text-secondary); }

.badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-success { background: var(--income-bg); color: var(--income-color); }
.badge-danger { background: var(--expense-bg); color: var(--expense-color); }
.badge-warning { background: var(--warning-bg); color: var(--warning-color); }
.badge-muted { background: var(--bg-input); color: var(--text-secondary); }

/* ==========================================================================
   CHARTS SECTION
   ========================================================================== */
.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chart-header h3 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-header h3 i { color: var(--primary); }

.chart-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.chart-container {
    position: relative;
    height: 240px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Chart.js (com responsive:true + maintainAspectRatio:false, já configurado nas
   instâncias) redimensiona o <canvas> pra caber no wrapper — isso aqui é só o
   cinto de segurança em CSS puro, caso o canvas seja medido antes do layout do
   container estabilizar (ex.: troca de aba) e fique temporariamente mais largo
   que o pai. */
.chart-container canvas,
.doughnut-container canvas,
.line-container canvas {
    max-width: 100% !important;
}

/* ==========================================================================
   TRANSACTIONS SECTION & TABLE
   ========================================================================== */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: var(--shadow-sm);
}

.table-header-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.table-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-title h2 {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-title h2 i { color: var(--primary); }

.total-count-badge {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--primary);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
}

.btn-refresh {
    margin-left: 15px;
    padding: 5px 12px;
    border-radius: 6px;
    background: var(--bg-tertiary, var(--bg-input));
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    max-width: fit-content;
}

/* Banner de filtro ativo (vindo dos cards do Dashboard) */
#active-filter-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-glow);
    border: 1px solid var(--border-highlight);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    animation: fadeIn 0.25s ease;
}

#active-filter-banner i {
    font-size: 0.9rem;
}

#active-filter-banner .filter-label {
    flex: 1;
}

#active-filter-banner .btn-clear-filter {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--border-highlight);
    color: var(--primary);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

#active-filter-banner .btn-clear-filter:hover {
    background: rgba(16, 185, 129, 0.2);
    transform: scale(1.15);
}

.controls-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.2fr;
    gap: 12px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 36px;
    color: var(--text-primary);
    font-size: 0.88rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.select-box {
    position: relative;
    display: flex;
    align-items: center;
}

.select-box i {
    position: absolute;
    left: 12px;
    color: var(--primary);
    pointer-events: none;
    font-size: 0.85rem;
}

.select-box select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px 10px 34px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    transition: var(--transition);
}

.select-box select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Table Responsive */
.table-responsive {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

/* Extrato em cards — visível só no mobile (ver @media max-width:768px), a tabela
   continua sendo a visualização padrão no desktop/tablet. */
.transactions-cards-mobile {
    display: none;
}

.transaction-mobile-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
}

.transaction-mobile-card:last-child {
    border-bottom: none;
}

.tmc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tmc-value {
    font-size: 1.05rem;
    font-weight: 800;
    white-space: nowrap;
}

.tmc-desc {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tmc-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.tmc-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tmc-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 2px;
}

/* Modal de Detalhes da Transação — lista simples de rótulo:valor */
.transaction-details-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 24px 24px;
}

.transaction-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.transaction-detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.transaction-detail-row .detail-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.transaction-detail-row .detail-value {
    font-weight: 700;
    text-align: right;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

.data-table th {
    background: var(--bg-input);
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

/* Coluna e celulas de checkbox */
.col-check,
.data-table td.td-check {
    width: 42px;
    padding: 14px 8px 14px 16px !important;
    text-align: center;
}

/* Checkbox estilizada */
.data-table input[type="checkbox"],
.col-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
    border-radius: 4px;
}

/* Linha selecionada */
.data-table tbody tr.row-selected {
    background: var(--primary-glow) !important;
    border-left: 3px solid var(--primary);
}

/* ==========================================================================
   BARRA DE ACOES EM MASSA
   ========================================================================== */
#massa-actions-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(16, 185, 129, 0.08) 100%);
    border: 1px solid var(--border-highlight);
    border-radius: 12px;
    padding: 10px 16px;
    gap: 16px;
    animation: fadeIn 0.2s ease;
    margin-bottom: 4px;
}

.massa-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.88rem;
}

.massa-info i {
    font-size: 1.1rem;
}

.massa-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-massa {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
}

.btn-massa-clone {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

.btn-massa-clone:hover {
    background: rgba(59, 130, 246, 0.28);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-massa-delete {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.4);
    color: #f43f5e;
}

.btn-massa-delete:hover {
    background: rgba(244, 63, 94, 0.24);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.25);
}

.btn-massa-cancel {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
}

.btn-massa-cancel:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.type-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
}

.type-pill.income { background: var(--income-bg); color: var(--income-color); }
.type-pill.expense { background: var(--expense-bg); color: var(--expense-color); }

.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.status-tag.settled {
    background: var(--income-bg);
    color: var(--income-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-tag.pending {
    background: var(--warning-bg);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-tag:hover {
    transform: scale(1.05);
}

.actions-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.action-btn.delete-btn:hover {
    border-color: var(--expense-color);
    color: var(--expense-color);
    background: var(--expense-bg);
}

.text-right { text-align: right; }
.text-success { color: var(--income-color); }
.text-danger { color: var(--expense-color); }

/* Table Summary Footer */
.table-footer-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-input);
    padding: 14px 20px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.summary-item strong {
    font-size: 1rem;
    font-weight: 800;
}

.badge-pro.unlocked {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.main-summary {
    background: var(--bg-card);
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-highlight);
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: var(--text-muted);
}

/* ==========================================================================
   TAB 2: CONFIGURAÇÕES WHATSAPP SYNC
   ========================================================================== */
.settings-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-hero {
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.15) 0%, var(--bg-card) 100%);
    border: 1px solid rgba(37, 211, 102, 0.3);
    border-radius: var(--radius-lg);
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.whatsapp-badge-icon {
    width: 64px;
    height: 64px;
    background: var(--whatsapp-color);
    color: #ffffff;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    box-shadow: 0 0 20px var(--whatsapp-glow);
}

.settings-hero-text h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.settings-hero-text p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    max-width: 800px;
    line-height: 1.5;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-top h3 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-indicator.disconnected {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
}

.status-indicator.connected {
    background: rgba(37, 211, 102, 0.15);
    color: #25d366;
}

.whatsapp-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 14px;
    color: var(--whatsapp-color);
    font-size: 1.1rem;
}

.input-with-icon input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px 12px 42px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.95rem;
}

.form-group small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Connected State Info */
.whatsapp-connected-info {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.success-box {
    background: rgba(37, 211, 102, 0.1);
    border: 1px solid rgba(37, 211, 102, 0.3);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.success-box i {
    font-size: 1.8rem;
    color: var(--whatsapp-color);
}

.success-box h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.success-box p {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.qr-demo-box {
    background: var(--bg-input);
    border: 1px dashed var(--border-color);
    padding: 16px;
    border-radius: 12px;
}

.bot-number-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
}

.copy-bot-num {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    padding: 8px 14px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 1rem;
    font-weight: bold;
    color: var(--primary);
}

.btn-copy {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
}

/* Toggle Switches */
.toggle-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.toggle-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.toggle-info strong {
    font-size: 0.9rem;
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
}

.toggle-info p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .3s;
}

input:checked + .slider {
    background-color: var(--primary);
    border-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
    background-color: #ffffff;
}

.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

/* ==========================================================================
   MODALS & OVERLAYS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: var(--glass-blur);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-card.modal-sm {
    max-width: 420px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.type-selector-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: 10px;
}

.btn-type-tab {
    background: transparent;
    border: none;
    padding: 10px;
    font-weight: 700;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-type-tab.active-income {
    background: var(--income-bg);
    color: var(--income-color);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.btn-type-tab.active-expense {
    background: var(--expense-bg);
    color: var(--expense-color);
    border: 1px solid rgba(244, 63, 94, 0.4);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.col-span-2 { grid-column: span 2; }

.form-grid input, .form-grid select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 0.88rem;
}

.form-grid input:disabled, .form-grid select:disabled {
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.03);
    cursor: not-allowed;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

/* PIN Verification Modal */
.pin-inputs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
}

.pin-digit {
    width: 44px;
    height: 52px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--primary);
}

.pin-digit:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.resend-hint {
    color: var(--text-muted);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-highlight);
    border-left: 4px solid var(--primary);
    padding: 14px 20px;
    border-radius: 10px;
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.toast-error {
    border-left-color: var(--expense-color);
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1200px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .charts-section {
        grid-template-columns: 1fr;
    }
    .controls-wrapper {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    /* Layout de 3 blocos do .app-header (☰ | logo centralizado | avatar) fica todo
       definido no bloco @media mais abaixo, perto do FAB — flex-direction:column
       aqui quebraria esse layout em linha. */
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
    .controls-wrapper {
        grid-template-columns: 1fr;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .col-span-2 {
        grid-column: span 1;
    }
    .table-footer-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ==========================================================================
   AUTH (LOGIN/REGISTER) STYLES
   ========================================================================== */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.05), transparent 40%),
                radial-gradient(circle at bottom left, rgba(5, 150, 105, 0.05), transparent 40%),
                var(--bg-main);
}

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

.auth-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent-emerald));
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .logo {
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.auth-header .logo i {
    color: var(--primary);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-tabs {
    display: flex;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 6px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.auth-tab.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.auth-form.active {
    display: flex;
    animation: fadeIn 0.4s ease;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.input-wrapper input {
    width: 100%;
    background: var(--bg-input);
    border: none;
    border-bottom: 2px solid var(--border-color);
    padding: 14px 14px 14px 45px;
    color: var(--text-primary);
    font-size: 1rem;
    border-radius: 8px 8px 0 0;
    transition: border-color 0.3s ease, background 0.3s ease;
    outline: none;
}

.input-wrapper input:focus {
    border-bottom: 2px solid var(--primary);
    background: var(--bg-card);
}

.input-wrapper input:focus + i,
.input-wrapper input:not(:placeholder-shown) + i {
    color: var(--primary);
}

.theme-switcher-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 10;
}
.theme-switcher-btn:hover {
    transform: scale(1.1);
}

.auth-btn {
    margin-top: 10px;
    padding: 14px;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.auth-forgot-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-forgot-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.auth-forgot-link-center {
    width: 100%;
    text-align: center;
    margin-top: 16px;
}

.auth-forgot-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
    margin: -8px 0 4px;
}

.auth-alert {
    margin-top: 20px;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    text-align: center;
    font-weight: 600;
}

.auth-alert.error {
    background: var(--expense-bg);
    color: var(--expense-color);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.auth-alert.success {
    background: var(--income-bg);
    color: var(--income-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   PRICING / ASSINATURA E PLANOS
   ========================================================================== */

/* Header Plan Badge */
.header-plan-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-highlight);
    font-size: 0.8rem;
    font-weight: 700;
}

#header-plan-name {
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trial-countdown {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.trial-countdown.expired {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
}

/* Pricing Section */
.pricing-header {
    text-align: center;
    margin-bottom: 40px;
}

.pricing-header h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.trial-banner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%);
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 8px 20px;
    border-radius: 30px;
    color: #10b981;
    font-weight: 700;
    font-size: 0.9rem;
}

.pulse-icon {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--transition);
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border-color: var(--primary);
}

.pricing-card.current-plan {
    border: 2px solid #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

.pricing-card.current-plan .btn {
    background-color: #374151;
    color: #9ca3af;
    border: none;
    cursor: default;
}

.btn.disabled {
    pointer-events: none;
    cursor: default;
}

.current-plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4);
}

.pricing-card.popular {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.4);
}

.card-header h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.card-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.card-price {
    display: flex;
    align-items: baseline;
    margin-bottom: 5px;
}

.card-price .currency {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 4px;
}

.card-price .amount {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
}

.card-price .period {
    color: var(--text-secondary);
    font-weight: 500;
}

.trial-note {
    color: #10b981;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.features-list {
    list-style: none;
    margin-bottom: 30px;
    flex-grow: 1;
}

.features-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.features-list li:last-child {
    border-bottom: none;
}

.comparison-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    overflow: hidden;
}

.comparison-container h3 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.4rem;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th {
    text-align: left;
    padding: 15px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 700;
}

.comparison-table th:not(:first-child) {
    text-align: center;
}

.comparison-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.comparison-table td:not(:first-child) {
    text-align: center;
}

.comparison-table tr:hover {
    background: var(--bg-card-hover);
}

.comparison-table .text-success {
    font-size: 1.1rem;
}

.comparison-table .text-danger {
    color: #f43f5e;
    font-size: 1.1rem;
}

/* ==========================================================================
   MODAL MEMBER REDESIGN
   ========================================================================== */
.modal-member {
    padding: 28px;
}

.modal-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-icon-badge {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(0, 200, 83, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 400;
}

.member-form-body {
    margin-top: 24px;
}

.member-form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.member-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

[data-theme="dark"] .member-form-group label {
    color: #94a3b8;
}

.label-icon {
    opacity: 0.7;
}

.member-form-group input,
.member-form-group select {
    border: 1px solid var(--border-color) !important;
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 8px;
    height: 44px;
    padding: 0 14px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.member-form-group input:focus,
.member-form-group select:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.15) !important;
}

.password-toggle-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle-wrapper input {
    width: 100%;
    padding-right: 44px;
}

.btn-toggle-pass {
    position: absolute;
    right: 0;
    top: 0;
    height: 44px;
    width: 44px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.btn-toggle-pass:hover {
    color: var(--text-primary);
}

.field-hint {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.select-wrapper select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
}

.select-arrow {
    position: absolute;
    right: 14px;
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 0.8rem;
}

.member-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    border-top: none;
}

.btn-member-cancel,
.btn-member-submit {
    height: 42px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-member-cancel {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-member-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

[data-theme="light"] .btn-member-cancel:hover {
    background: rgba(0, 0, 0, 0.05);
}

.btn-member-submit {
    background: var(--primary);
    color: white;
    border: none;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.btn-member-submit:hover {
    box-shadow: 0 4px 12px rgba(0, 200, 83, 0.3);
    transform: translateY(-1px);
}

/* ==========================================================================
   REPORTS SECTION
   ========================================================================== */
.reports-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    background: var(--bg-card);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-group select {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 8px;
    outline: none;
    font-size: 0.9rem;
}

.filter-group select:focus {
    border-color: var(--primary);
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.btn-export {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.report-section-title {
    margin: 32px 0 16px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* ── Grid Visão Geral ── */
.reports-grid-main {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: stretch;
}

.reports-main-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reports-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.report-full-3col {
    grid-column: 1 / -1;
}

/* ── Sidebar da coluna 3 ── */
.report-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Mini KPI Cards ── */
.report-mini-kpis {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mini-kpi-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.mini-kpi-card.mini-kpi-alert {
    border-left: 3px solid #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.06) 0%, var(--bg-card) 100%);
}

.mini-kpi-card.mini-kpi-danger {
    border-left: 3px solid #f43f5e;
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.06) 0%, var(--bg-card) 100%);
}

.mini-kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.mini-kpi-alert .mini-kpi-icon { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.mini-kpi-danger .mini-kpi-icon { background: rgba(244, 63, 94, 0.15); color: #f43f5e; }

.mini-kpi-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mini-kpi-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mini-kpi-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-kpi-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ── Report Card Compacto ── */
.report-card-compact {
    padding: 16px;
}

.report-card-compact h4 {
    font-size: 0.88rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.report-card-compact h4 i { opacity: 0.7; }

/* ── Top 5 Lista ── */
.top5-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top5-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s;
}

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

.top5-rank {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.top5-emoji {
    font-size: 1.1rem;
    flex-shrink: 0;
    line-height: 1;
}

.top5-info {
    flex: 1;
    min-width: 0;
}

.top5-desc {
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.top5-cat {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.top5-amount {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f43f5e;
    white-space: nowrap;
    flex-shrink: 0;
}

.top5-empty {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 16px 0;
    font-style: italic;
}

/* ── Insights Pills ── */
.insights-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.insight-pill {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    line-height: 1.45;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.insight-pill i { margin-top: 1px; flex-shrink: 0; font-size: 0.85rem; }

.insight-pill.insight-danger {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: #fda4af;
}

.insight-pill.insight-success {
    background: rgba(0, 200, 83, 0.08);
    border: 1px solid rgba(0, 200, 83, 0.2);
    color: #86efac;
}

.insight-pill.insight-loading {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.insight-cta {
    margin-top: 10px;
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0, 200, 83, 0.35);
    background: rgba(0, 200, 83, 0.08);
    color: #00C853;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}

.insight-cta:hover { background: rgba(0, 200, 83, 0.18); }

/* ── Destaque de seção ao navegar via CTA de Insights ── */
@keyframes sectionPulse {
    0%   { box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.0); }
    30%  { box-shadow: 0 0 0 6px rgba(0, 200, 83, 0.25); }
    60%  { box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.12); }
    100% { box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.0); }
}

.section-highlight-pulse {
    animation: sectionPulse 1.5s ease-out forwards;
    border-radius: 12px;
    outline: 2px solid rgba(0, 200, 83, 0.3);
    outline-offset: 4px;
    transition: outline 0.3s;
}

/* ── Responsividade ── */
@media (max-width: 1100px) {
    .reports-grid-main {
        grid-template-columns: 1fr;
    }
    .reports-charts-row {
        grid-template-columns: 1fr 1fr;
    }
    .report-sidebar {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 14px;
    }
    .report-mini-kpis { flex-direction: row; }
}

@media (max-width: 700px) {
    .reports-grid-main { grid-template-columns: 1fr; }
    .reports-charts-row { grid-template-columns: 1fr; }
    .report-sidebar { grid-template-columns: 1fr; }
    .report-mini-kpis { flex-direction: column; }
}

.report-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.report-card h4 {
    margin: 0 0 16px;
    font-size: 1rem;
    color: var(--text-primary);
}

.report-card.full-width {
    grid-column: 1 / -1;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 250px;
}

.doughnut-container {
    height: 250px;
}

.line-container {
    height: 300px;
}

.report-kpi {
    margin-top: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.report-kpi span {
    color: var(--primary);
}

.empty-state-small {
    padding: 30px;
    text-align: center;
    background: rgba(0, 0, 0, 0.02);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .empty-state-small {
    background: rgba(255, 255, 255, 0.02);
}

/* Paywall Overlay */
.paywall-container {
    position: relative;
}

.paywall-container.locked .report-card {
    filter: blur(4px);
    opacity: 0.7;
    pointer-events: none;
    user-select: none;
}

.paywall-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    z-index: 10;
    text-align: center;
    padding: 20px;
    display: none;
}

[data-theme="light"] .paywall-overlay {
    background: rgba(255, 255, 255, 0.7);
}

.paywall-container.locked .paywall-overlay {
    display: flex;
}

.paywall-overlay i {
    font-size: 2.5rem;
    color: #f59e0b;
    margin-bottom: 12px;
}

.paywall-overlay h4 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.paywall-overlay p {
    font-size: 0.9rem;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.dre-table {
    font-size: 0.9rem;
}

.dre-table td {
    padding: 10px 15px;
}

.dre-total td {
    font-weight: 700;
    border-top: 2px solid var(--border-color);
    color: var(--text-primary);
}

/* === PROFILE STYLES === */
.profile-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

/* Avatar de foto de perfil (topo da tela "Meu Perfil") */
.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.profile-avatar-wrapper {
    position: relative;
    cursor: pointer;
}

.profile-id-badge {
    font-size: 0.78rem;
    color: var(--text-secondary, #94a3b8);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    padding: 3px 10px;
    border-radius: 999px;
    font-family: monospace;
    user-select: all;
}

.btn-remove-avatar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #f43f5e;
    font-size: 0.82rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}

.btn-remove-avatar:hover {
    background: rgba(244, 63, 94, 0.1);
}

.btn-remove-avatar:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.profile-avatar-circle {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background-color: var(--primary, #10b981);
    background-size: cover;
    background-position: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--bg-card, rgba(255, 255, 255, 0.08));
    overflow: hidden;
}

.profile-avatar-edit-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary, #10b981);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border: 3px solid var(--bg-main, #0f172a);
    transition: background 0.2s ease;
}

.profile-avatar-wrapper:hover .profile-avatar-edit-badge {
    background: var(--primary-dark, #059669);
}

.btn-save-profile {
    margin-top: 24px;
}

/* Cabeçalho de seção reutilizável (Contas & Cartões, Categorias, Teto de Gastos):
   título à esquerda, botão de ação à direita, sempre na mesma linha. */
.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.section-header-row h4 {
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.section-header-row .btn {
    flex-shrink: 0;
}

.wallets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.wallet-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wallet-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wallet-type-badge {
    font-size: 11px;
    padding: 4px 8px;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-radius: 12px;
    font-weight: 600;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.credit-card {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.credit-card::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    top: -50px;
    right: -50px;
}

.cc-brand {
    font-size: 24px;
    align-self: flex-end;
}

.cc-info h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 1px;
}

.cc-details {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}

.cc-actions {
    position: absolute;
    top: 15px;
    left: 15px;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cat-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cat-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

/* Fix colors in select input */
input[type="color"] {
    cursor: pointer;
    border: 1px solid var(--border-color);
}

/* === REFACTORED PROFILE & MODAL INPUTS === */
.settings-section .form-control,
.modal-card .form-control {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    height: 42px;
    padding: 0 14px;
    transition: all 0.3s ease;
}

.settings-section .form-control::placeholder,
.modal-card .form-control::placeholder {
    color: #94a3b8;
}

.settings-section .form-control:focus,
.modal-card .form-control:focus {
    outline: none;
    border-color: #00C853;
    box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.15);
}

/* Modal Specific Adjustments */
.modal-card {
    background-color: #111827;
    padding: 24px;
}

.modal-card .form-group {
    margin-bottom: 16px;
}

/* Custom Select Arrow */
.modal-card select.form-control,
.settings-section select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
}

.modal-card select.form-control option,
.settings-section select.form-control option {
    background-color: #1e293b;
    color: #ffffff;
}

/* Custom Color Input */
.modal-card input[type="color"].form-control,
.settings-section input[type="color"].form-control {
    padding: 0;
    width: 60px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    background: transparent;
    overflow: hidden;
}

/* Teto de Gastos: card de categoria (nome esquerda, %/R$ centro-direita, excluir extrema direita) */
.ceiling-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 8px;
}

.ceiling-name-input {
    flex: 1 1 auto;
    min-width: 0;
}

.ceiling-values {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    white-space: nowrap;
}

.ceiling-input-group {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.ceiling-unit {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.settings-section .ceiling-perc-input {
    width: 64px;
    text-align: center;
    padding: 0 6px;
}

.settings-section .ceiling-val-input {
    width: 90px;
    text-align: right;
    padding: 0 6px;
}

/* Emoji Picker Styles */
.emoji-option {
    cursor: pointer;
    font-size: 24px;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.2s, transform 0.1s;
    border: 2px solid transparent;
    user-select: none;
    line-height: 1;
}

.emoji-option:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.emoji-option.selected {
    background: rgba(0, 200, 83, 0.2);
    border-color: #00C853;
}

.modal-card input[type="color"]::-webkit-color-swatch-wrapper,
.settings-section input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.modal-card input[type="color"]::-webkit-color-swatch,
.settings-section input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
}

/* Profile Grid */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

/* Remove setas do input number */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}

/* ==========================================
   FAB Component
   ========================================== */
.fab-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    left: auto;
    transform: none;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fab-main {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary, #10b981);
    color: white;
    border: none;
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-main.active {
    transform: rotate(45deg);
    background-color: var(--danger-color, #f43f5e);
}

.fab-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    align-items: center;
}

.fab-container.open .fab-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fab-action {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--card-bg, #1e293b);
    border: 1px solid var(--border-color, #334155);
    color: white;
    border-radius: 20px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: background 0.2s, transform 0.2s;
    white-space: nowrap;
}

.fab-action:hover {
    background-color: rgba(255,255,255,0.1);
    transform: scale(1.05);
}

.fab-income i { color: #10b981; }
.fab-expense i { color: #f43f5e; }
.fab-card i { color: #8b5cf6; }

/* ==========================================
   Period Popover
   ========================================== */
.period-popover {
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 1100;
    width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s;
    transform-origin: top center;
}

.period-popover.open {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(5px);
}

.period-tabs {
    display: flex;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
}

.period-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted, #94a3b8);
    padding: 6px 0;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.period-tab.active {
    background: var(--primary, #10b981);
    color: white;
}

.period-inputs .form-control {
    width: 100%;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.period-inputs .form-control::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* ==========================================
   Construction Cards
   ========================================== */
.construction-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    flex: 1;
}
.construction-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #131822;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.05);
}
.construction-card .construction-icon {
    font-size: 40px;
    margin-bottom: 15px;
}
.construction-card h4 {
    margin-bottom: 8px;
    color: #f8fafc;
    font-weight: 600;
}
.construction-card p {
    color: #94a3b8;
    margin: 0;
    font-size: 0.9rem;
}

/* ── Widget: Limite dos Cartões (dashboard/relatórios) ── */
.card-limits-report-card {
    max-height: 320px;
    overflow-y: auto;
}

.card-limits-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-limits-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    padding: 24px 10px;
    color: var(--text-secondary);
}

.card-limit-item {
    border-radius: 12px;
    padding: 14px 16px;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

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

.card-limit-item-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.card-limit-item-brand {
    font-size: 0.75rem;
    opacity: 0.8;
}

.card-limit-item-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.85);
}

.card-limit-progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    overflow: hidden;
}

.card-limit-progress-bar {
    height: 100%;
    border-radius: 4px;
    background: var(--primary);
    transition: width 0.3s, background 0.3s;
}

.card-limit-progress-bar.warning { background: #f59e0b; }
.card-limit-progress-bar.danger { background: #f43f5e; }

/* ==========================================
   Profile Avatar Dropdown
   ========================================== */
.profile-dropdown-container {
    position: relative;
    display: inline-block;
}

.btn-profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background-color: var(--primary, #10b981);
    background-size: cover;
    background-position: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    outline: none;
}
.btn-profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.profile-dropdown-menu {
    position: absolute;
    top: 55px;
    right: 0;
    width: 260px;
    background-color: #131822;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.profile-dropdown-menu.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
}

.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--primary, #10b981);
    background-size: cover;
    background-position: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-dropdown-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.profile-dropdown-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.profile-dropdown-name {
    color: #f8fafc;
    font-weight: 600;
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theme-toggle-compact {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary, #f8fafc);
    cursor: pointer;
    transition: background 0.2s ease;
}

.theme-toggle-compact:hover {
    background: rgba(255, 255, 255, 0.16);
}

.theme-toggle-compact i {
    font-size: 0.85rem;
}

.profile-dropdown-plan {
    color: var(--text-muted, #64748b);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    align-self: flex-start;
}

.profile-dropdown-body {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}

.profile-dropdown-body a {
    color: var(--text-secondary, #94a3b8);
    text-decoration: none;
    padding: 12px 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background-color 0.2s, color 0.2s;
}
.profile-dropdown-body a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
}
.profile-dropdown-body a i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.profile-dropdown-footer {
    padding: 8px 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-dropdown-logout {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background-color: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s, color 0.2s;
}
.btn-dropdown-logout:hover {
    background-color: #f43f5e;
    color: #fff;
}

/* ============================================================== */
/*                 RESPONSIVIDADE E USABILIDADE MOBILE            */
/* ============================================================== */
@media (max-width: 768px) {
    
    /* 1. Grid e Containers (Stack Column) */
    .metrics-grid,
    .reports-charts-row,
    .construction-cards,
    .reports-grid-main,
    .wallets-grid,
    .cards-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        display: grid;
    }

    .metric-card,
    .report-card,
    .construction-card {
        width: 100% !important;
        padding: 16px !important;
    }

    .chart-card,
    .credit-card,
    .card-limit-item,
    .wallet-card {
        padding: 16px !important;
    }

    /* Cabeçalhos de seção (Contas & Cartões, Categorias, Teto de Gastos): título e
       botão de ação encolhem pra caber lado a lado numa tela estreita, sem quebrar. */
    .section-header-row h4 {
        font-size: 0.78rem;
    }

    .section-header-row .btn {
        padding: 6px 10px;
        font-size: 0.7rem;
        white-space: nowrap;
    }

    /* Cabeçalho do Extrato: badge some do fluxo se precisar quebrar, e o botão
       "Atualizar" vira ícone compacto (sem o texto) pra nunca vazar do container. */
    .table-title {
        flex-wrap: wrap;
        row-gap: 8px;
    }

    .table-title h2 {
        font-size: 1rem;
    }

    .btn-refresh {
        margin-left: 0;
        padding: 7px 10px;
    }

    .btn-refresh-label {
        display: none;
    }

    /* Extrato: tabela dá lugar aos cards no mobile — mesmos dados, mesmo filtro,
       só a apresentação muda (renderTableAndSummary() já preenche os dois). */
    #transactions-table {
        display: none !important;
    }

    .transactions-cards-mobile {
        display: flex;
        flex-direction: column;
    }

    /* overflow-x:hidden do .app-container/.main-content agora é regra global
       (ver topo do arquivo) — vale pra todas as resoluções, não só mobile. */

    /* 2. Header em 3 blocos na 1ª linha (☰ esquerda | logo centro | avatar direita)
       + seletor de período em linha própria, 100% de largura, abaixo. .app-header
       tem 4 filhos diretos (header-left, header-center-mobile, month-selector,
       header-right) — cada um com "order" próprio pra controlar em qual das duas
       linhas do flex-wrap ele cai, sem que o avatar nunca dependa do que acontece
       com o seletor de período (são irmãos independentes, não um dentro do outro). */
    .app-header {
        flex-wrap: wrap;
        align-items: center;
        height: auto;
        min-height: 60px;
        padding: 10px 16px;
        row-gap: 12px;
    }

    .header-left {
        order: 1;
        flex: 0 0 auto;
    }

    /* Esconde o logo "original" (fica só o hambúrguer à esquerda) — o logo visível
       no mobile é o .header-center-mobile, centralizado de forma independente da
       largura dos blocos vizinhos. */
    .header-left .logo {
        display: none;
    }

    .header-center-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        left: 50%;
        top: 10px;
        height: 40px;
        transform: translateX(-50%);
        pointer-events: none;
    }

    .header-center-mobile .logo {
        pointer-events: auto;
        gap: 8px;
    }

    .header-center-mobile .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    /* Avatar isolado em .header-right, sozinho na 1ª linha — travado no fluxo
       normal da flexbox (sem position:absolute, sem margem manual empurrando pra
       baixo), então nunca colide com o seletor de período, que agora é outro
       elemento (2ª linha, ver abaixo). */
    .header-right {
        order: 2;
        flex: 0 0 auto;
        margin-left: 0;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* Alternância de tema sai do header no mobile — vive no dropdown do perfil
       (ver #btn-theme-toggle-dropdown). */
    .header-right #btn-theme-toggle {
        display: none !important;
    }

    /* Seletor de período: 3º filho do header, ordem 3 (depois do avatar) — flex-basis
       100% força a própria linha, cheia, abaixo da linha do topo. */
    .app-header > .month-selector {
        order: 3;
        margin-left: 0;
        flex: 1 1 100%;
        width: 100%;
        justify-content: center;
        margin-top: 12px;
        padding: 4px 6px;
    }

    .current-period {
        font-size: 0.82rem;
        min-width: 0;
        padding: 0 6px;
    }

    /* Dropdown e Popover dentro dos limites da tela */
    .profile-dropdown-menu,
    .period-popover {
        right: 0 !important;
        left: auto !important;
        max-width: 95vw;
        overflow-x: hidden;
    }

    /* 3. Aba Teto de Gastos (Configurações) */
    .ceiling-row {
        padding: 12px !important;
        gap: 8px !important;
    }

    .ceiling-name-input {
        min-width: 70px;
    }

    .ceiling-values {
        gap: 6px !important;
    }

    .ceiling-perc-input {
        width: 52px !important;
    }

    .ceiling-val-input {
        width: 72px !important;
    }

    /* 4. Botão Flutuante (FAB) e Modais */
    .fab-container {
        position: fixed !important;
        right: 20px !important;
        bottom: 20px !important;
        z-index: 999 !important;
        /* O container herda align-items:center do desktop, mas como .fab-menu (mesmo
           fechado/invisível) é mais largo que o botão redondo, isso empurrava o "+"
           visível ~30px pra longe da borda direita real. flex-end alinha os botões
           pela borda direita, então o "+" fica exatamente nos 20px pedidos. */
        align-items: flex-end !important;
    }

    /* Respiro inferior contra o FAB: o "+" flutuante fica por cima do fim de
       qualquer página (Dashboard, Contas & Cartões, Extrato, etc.) — sem esse
       espaço extra, o botão sobrepõe os últimos itens ao rolar até o fim. */
    .main-content {
        padding-bottom: 90px !important;
    }

    /* .modal-card é a classe realmente usada nos modais (index.html) — a regra
       .modal-content nunca bateu em nada, então esse ajuste de mobile nunca chegava
       a aplicar de verdade. */
    .modal-card {
        width: 92% !important;
        max-width: 480px !important;
        margin: 0 auto !important;
        max-height: 85vh !important;
        padding: 16px 20px !important;
        gap: 12px !important;
    }

    .modal-card .form-group {
        margin-bottom: 12px;
    }

    /* Respiro inferior pros botões de ação — evita colidir com a borda da tela
       (barra de navegação do celular, home indicator, etc.). */
    .modal-footer .btn {
        margin-bottom: 10px;
    }

    /* 5. Usabilidade de Toque (Touch - Min 44px) */
    button, 
    .btn,
    .form-control, 
    .period-tab,
    .nav-link,
    .btn-dropdown-logout,
    .fab-main,
    .fab-action {
        min-height: 44px !important;
    }

    /* Ajuste fino de alinhamento vertical após forçar a altura */
    .nav-link, .btn-dropdown-logout {
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }
    
    .fab-action, .fab-main, .period-tab {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}