@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ════════════════════════════════════════════════════════════════════
   TOKENS — TEMA ESCURO (padrão)
   ════════════════════════════════════════════════════════════════════ */
:root,
[data-tema="escuro"] {
    --sidebar-width:     260px;
    --topbar-height:     56px;

    --bg-base:           #0f1117;
    --bg-sidebar:        #1a1d27;
    --bg-surface:        #13151e;
    --bg-card:           #1e2130;
    --bg-card-hover:     #242740;
    --bg-input:          #1a1d27;
    --border:            rgba(255,255,255,0.07);
    --border-sidebar:    rgba(255,255,255,0.06);

    --gold:              #c4a464;
    --gold-light:        #e8c97a;
    --gold-dim:          rgba(196,164,100,0.13);

    --green:             #6ee7b7;
    --green-dim:         rgba(110,231,183,0.12);
    --red:               #fca5a5;
    --red-dim:           rgba(252,165,165,0.12);
    --blue:              #93c5fd;
    --blue-dim:          rgba(147,197,253,0.12);

    --text-primary:      #eeeaf2;
    --text-secondary:    #b0adc0;
    --text-muted:        #6e6b82;

    --nav-active-bg:     rgba(147,197,253,0.12);
    --nav-active-color:  #93c5fd;

    --shadow-card:       0 4px 24px rgba(0,0,0,0.4);
    --shadow-modal:      0 24px 80px rgba(0,0,0,0.7);
}

/* ════════════════════════════════════════════════════════════════════
   TOKENS — TEMA CLARO
   ════════════════════════════════════════════════════════════════════ */
[data-tema="claro"] {
    --bg-base:           #f4f3f0;
    --bg-sidebar:        #ffffff;
    --bg-surface:        #fafaf8;
    --bg-card:           #ffffff;
    --bg-card-hover:     #f0ede8;
    --bg-input:          #f4f3f0;
    --border:            rgba(0,0,0,0.09);
    --border-sidebar:    rgba(0,0,0,0.07);

    --gold:              #b8892e;
    --gold-light:        #d4a843;
    --gold-dim:          rgba(184,137,46,0.09);

    --green:             #15803d;
    --green-dim:         rgba(21,128,61,0.1);
    --red:               #dc2626;
    --red-dim:           rgba(220,38,38,0.1);
    --blue:              #1d4ed8;
    --blue-dim:          rgba(29,78,216,0.08);

    --text-primary:      #1a1a2e;
    --text-secondary:    #4a4865;
    --text-muted:        #9190a8;

    --nav-active-bg:     rgba(29,78,216,0.08);
    --nav-active-color:  #1d4ed8;

    --shadow-card:       0 2px 12px rgba(0,0,0,0.08);
    --shadow-modal:      0 16px 60px rgba(0,0,0,0.2);
}

/* ════════════════════════════════════════════════════════════════════
   TIPOGRAFIA E RESET
   ════════════════════════════════════════════════════════════════════ */
--font-display: 'Playfair Display', Georgia, serif;
--font-body:    'DM Sans', sans-serif;
--font-mono:    'DM Mono', monospace;
--radius-sm:    6px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 22px;
--ease:         cubic-bezier(0.4,0,0.2,1);
--transition:   all 0.2s var(--ease);

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ════════════════════════════════════════════════════════════════════
   OVERLAY
   ════════════════════════════════════════════════════════════════════ */
.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: 300; visibility: hidden; opacity: 0;
    pointer-events: none; transition: opacity 0.25s ease;
}
.sidebar-overlay.visivel { visibility: visible; opacity: 1; pointer-events: auto; }

/* ════════════════════════════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════════════════════════════ */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-sidebar);
    z-index: 400;
    display: flex; flex-direction: column;
    overflow-y: auto; overflow-x: hidden;
    transform: translateX(-260px);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    will-change: transform;
}
.sidebar.aberta { transform: translateX(0); box-shadow: 6px 0 40px rgba(0,0,0,0.4); }

.sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 16px 14px; border-bottom: 1px solid var(--border-sidebar); flex-shrink: 0; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; }
.sidebar-brand-icon { font-size: 22px; color: var(--gold); }
.sidebar-brand-name { font-family: 'Playfair Display', serif; font-size: 1.2rem; font-weight: 600; color: var(--text-primary); }
.sidebar-close-btn { background: none; border: none; color: var(--text-muted); font-size: 18px; width: 30px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); }
.sidebar-close-btn:hover { background: rgba(255,255,255,0.07); }

.sidebar-saldo { padding: 14px 16px; background: var(--gold-dim); border-bottom: 1px solid var(--border-sidebar); flex-shrink: 0; }
.sidebar-saldo-label { display: block; font-size: 10px; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.sidebar-saldo-valor { font-family: 'DM Mono', monospace; font-size: 1.35rem; font-weight: 600; display: block; }
.sidebar-date { display: block; font-size: 10px; color: var(--text-muted); margin-top: 4px; }

.sidebar-nav { flex: 1; padding: 10px 10px 16px; display: flex; flex-direction: column; gap: 1px; }
.sidebar-nav-section { font-size: 10px; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; color: var(--text-muted); padding: 14px 8px 5px; display: block; }
.sidebar-nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--text-secondary); font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; transition: var(--transition); user-select: none; }
.sidebar-nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.sidebar-nav-item.ativo { background: var(--nav-active-bg); color: var(--nav-active-color); }
.nav-icon { font-size: 17px; width: 22px; text-align: center; flex-shrink: 0; opacity: .85; }

.sidebar-footer { padding: 14px 16px; border-top: 1px solid var(--border-sidebar); flex-shrink: 0; }
.sidebar-version { font-size: 11px; color: var(--text-muted); font-family: 'DM Mono', monospace; }

/* ════════════════════════════════════════════════════════════════════
   APP SHELL
   ════════════════════════════════════════════════════════════════════ */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; margin-left: 0; transition: margin-left 0.28s cubic-bezier(0.4,0,0.2,1); }

@media (min-width: 1024px) {
    .app-shell.sidebar-aberta { margin-left: 260px; }
    .sidebar-close-btn, .sidebar-overlay { display: none !important; }
}
body.no-scroll { overflow: hidden; }

/* ════════════════════════════════════════════════════════════════════
   TOPBAR
   ════════════════════════════════════════════════════════════════════ */
.topbar { position: sticky; top: 0; z-index: 200; height: 56px; background: rgba(15,17,23,0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 20px; gap: 14px; flex-shrink: 0; }
[data-tema="claro"] .topbar { background: rgba(244,243,240,0.92); }
.topbar-menu-btn { background: none; border: none; cursor: pointer; width: 36px; height: 36px; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 7px; border-radius: 6px; flex-shrink: 0; transition: var(--transition); }
.topbar-menu-btn:hover { background: rgba(255,255,255,0.07); }
.topbar-menu-btn span { display: block; height: 2px; background: var(--text-primary); border-radius: 2px; }
.topbar-title { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 600; color: var(--text-primary); flex: 1; }
.btn-nova-fab-top { background: var(--gold); color: #0a0a0f; width: 34px; height: 34px; border-radius: 50%; font-size: 22px; font-weight: 300; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 2px 12px rgba(196,164,100,0.35); transition: var(--transition); }
.btn-nova-fab-top:hover { background: var(--gold-light); transform: scale(1.08); }

/* ════════════════════════════════════════════════════════════════════
   PAGES
   ════════════════════════════════════════════════════════════════════ */
.page { display: none; flex: 1; }
.page.ativo { display: block; animation: fadeUp 0.22s ease both; }
.page-content { max-width: 960px; margin: 0 auto; padding: 28px 24px 100px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

/* ════════════════════════════════════════════════════════════════════
   UTILITIES
   ════════════════════════════════════════════════════════════════════ */
.text-blue  { color: var(--blue); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-muted { color: var(--text-muted); }

.section-title { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 14px; }

/* ════════════════════════════════════════════════════════════════════
   DASHBOARD CARDS
   ════════════════════════════════════════════════════════════════════ */
.dashboard-cards { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; position: relative; overflow: hidden; transition: var(--transition); animation: fadeUp 0.4s ease both; }
.card:hover { background: var(--bg-card-hover); border-color: rgba(255,255,255,0.11); transform: translateY(-2px); box-shadow: var(--shadow-card); }
.card-saldo::before { content:''; position:absolute; top:-40px; right:-40px; width:110px; height:110px; background:radial-gradient(circle,rgba(196,164,100,.1) 0%,transparent 70%); border-radius:50%; pointer-events:none; }
.card-label { font-size: 10px; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 10px; }
.card-value { font-family: 'DM Mono', monospace; font-size: 1.45rem; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.card-icon { position: absolute; bottom: 14px; right: 16px; font-size: 20px; opacity: .3; }

/* ════════════════════════════════════════════════════════════════════
   CONTAS
   ════════════════════════════════════════════════════════════════════ */
.contas-section { margin-bottom: 24px; }
.contas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.conta-card { background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--conta-cor, var(--gold)); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; transition: var(--transition); }
.conta-card:hover { background: var(--bg-card-hover); transform: translateY(-1px); }
.conta-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.conta-icone { font-size: 22px; }
.conta-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.conta-card:hover .conta-actions { opacity: 1; }
.conta-nome  { font-size: 13px; font-weight: 600; color: var(--text-primary); display: block; }
.conta-tipo  { font-size: 10px; color: var(--text-muted); display: block; margin-bottom: 2px; }
.conta-saldo { font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 600; display: block; }
.conta-limite-bar { height: 4px; background: var(--border); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.conta-limite-fill { height: 100%; background: var(--red); border-radius: 2px; transition: width .4s ease; }
.conta-limite-label { font-size: 10px; color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════════════
   FILTROS
   ════════════════════════════════════════════════════════════════════ */
.filtros-section { margin-bottom: 20px; }
.filtros-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filtro-group select, .filtro-group input { background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--text-primary); outline: none; transition: var(--transition); appearance: none; -webkit-appearance: none; cursor: pointer; }
.filtro-group select:focus, .filtro-group input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(196,164,100,.12); }
.filtro-busca-wrap { position: relative; flex: 1; min-width: 180px; }
.busca-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 17px; pointer-events: none; }
.filtro-busca-wrap input { padding-left: 32px; width: 100%; }

/* ════════════════════════════════════════════════════════════════════
   LISTA DE TRANSAÇÕES
   ════════════════════════════════════════════════════════════════════ */
.transactions-list { list-style: none; background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.tx-grupo-header { padding: 8px 18px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: capitalize; color: var(--text-muted); background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--border); }
.transaction-item { display: flex; justify-content: space-between; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--border); transition: var(--transition); gap: 10px; }
.transaction-item:last-child { border-bottom: none; }
.transaction-item:hover { background: var(--bg-card-hover); }
.transaction-item-left { display: flex; align-items: center; gap: 11px; min-width: 0; }
.transaction-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.transaction-info { min-width: 0; }
.transaction-desc { font-size: 14px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.tx-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 2px; }
.tx-cat { font-size: 11px; font-weight: 500; }
.tx-conta { font-size: 11px; color: var(--text-muted); background: rgba(255,255,255,.05); padding: 1px 6px; border-radius: 4px; }
.tx-parcela.badge { font-size: 10px; color: var(--gold); background: var(--gold-dim); padding: 1px 6px; border-radius: 4px; }
.tx-nota { font-size: 12px; cursor: help; }
.transaction-date { font-size: 11px; color: var(--text-muted); font-family: 'DM Mono', monospace; }
.transaction-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.transaction-value { font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 600; min-width: 105px; text-align: right; }
.transaction-value.receita { color: var(--green); }
.transaction-value.despesa { color: var(--red); }
.transaction-actions-btns { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.transaction-item:hover .transaction-actions-btns { opacity: 1; }
.empty-state { padding: 44px 24px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* ════════════════════════════════════════════════════════════════════
   ORÇAMENTOS
   ════════════════════════════════════════════════════════════════════ */
.orc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.orc-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 10px; transition: var(--transition); }
.orc-item.orc-ultrapassou { border-color: rgba(252,165,165,0.3); }
.orc-topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.orc-cat { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.orc-acoes { display: flex; align-items: center; gap: 8px; }
.orc-valores { font-family: 'DM Mono', monospace; font-size: 13px; color: var(--text-secondary); }
.orc-bar-bg { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.orc-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s cubic-bezier(0.4,0,0.2,1); }
.orc-info { display: flex; justify-content: space-between; font-size: 12px; margin-top: 6px; }

/* ════════════════════════════════════════════════════════════════════
   METAS
   ════════════════════════════════════════════════════════════════════ */
.meta-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin-bottom: 12px; transition: var(--transition); }
.meta-card.meta-concluida { border-color: rgba(110,231,183,0.3); }
.meta-header { display: flex; align-items: flex-start; gap: 12px; }
.meta-icone { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.meta-info { flex: 1; min-width: 0; }
.meta-nome { font-size: 15px; font-weight: 600; color: var(--text-primary); display: block; }
.meta-desc { font-size: 12px; color: var(--text-muted); display: block; margin-top: 2px; }
.meta-acoes { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.meta-badge { font-size: 11px; background: var(--green-dim); color: var(--green); padding: 3px 8px; border-radius: 6px; }
.meta-footer { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-top: 8px; }
.btn-contribuir { width: 100%; margin-top: 12px; padding: 8px; background: var(--gold-dim); border: 1px solid var(--gold); color: var(--gold); border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; transition: var(--transition); }
.btn-contribuir:hover { background: var(--gold); color: #0a0a0f; }

/* ════════════════════════════════════════════════════════════════════
   GRÁFICOS
   ════════════════════════════════════════════════════════════════════ */
.grafico-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 24px; }
.grafico-titulo { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 22px; }
.grafico-wrapper { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.grafico-wrapper canvas { flex-shrink: 0; }
.grafico-vazio { color: var(--text-muted); font-size: 14px; padding: 20px 0; }
#grafico-legenda { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 150px; }
.legenda-item { display: flex; align-items: center; gap: 8px; }
.legenda-dot  { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.legenda-nome { font-size: 13px; color: var(--text-secondary); flex: 1; }
.legenda-pct  { font-family: 'DM Mono', monospace; font-size: 12px; font-weight: 500; color: var(--text-primary); }
.legenda-val  { font-family: 'DM Mono', monospace; font-size: 11px; }
.bar-legenda  { display: flex; gap: 20px; margin-top: 12px; font-size: 12px; color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════════════
   INSIGHTS
   ════════════════════════════════════════════════════════════════════ */
.insights-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.insight-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; align-items: flex-start; gap: 12px; transition: var(--transition); }
.insight-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.insight-card.insight-positivo { border-left: 3px solid var(--green); }
.insight-card.insight-alerta   { border-left: 3px solid var(--red); }
.insight-card.insight-info     { border-left: 3px solid var(--gold); }
.insight-icone  { font-size: 22px; flex-shrink: 0; }
.insight-titulo { font-size: 13px; font-weight: 600; color: var(--text-primary); display: block; }
.insight-desc   { font-size: 12px; color: var(--text-secondary); display: block; margin-top: 3px; }

/* ════════════════════════════════════════════════════════════════════
   CATEGORIAS (ajustes)
   ════════════════════════════════════════════════════════════════════ */
.cat-grupo { margin-bottom: 20px; }
.cat-grupo-titulo { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.cat-item { background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--cat-cor, var(--gold)); border-radius: 8px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; transition: var(--transition); }
.cat-item:hover { background: var(--bg-card-hover); }
.cat-icone { font-size: 18px; flex-shrink: 0; }
.cat-nome  { font-size: 13px; font-weight: 500; color: var(--text-primary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.cat-item:hover .cat-actions { opacity: 1; }

/* Grid de emojis */
.grid-emojis { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; max-height: 200px; overflow-y: auto; }
.emoji-btn { background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; padding: 6px; font-size: 18px; cursor: pointer; transition: var(--transition); text-align: center; line-height: 1; }
.emoji-btn:hover, .emoji-btn.selecionado { background: var(--gold-dim); border-color: var(--gold); transform: scale(1.1); }

/* ════════════════════════════════════════════════════════════════════
   AJUSTES
   ════════════════════════════════════════════════════════════════════ */
.ajustes-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-bottom: 16px; }
.ajustes-info { font-size: 14px; color: var(--text-secondary); line-height: 1.8; margin-top: 10px; }
.ajustes-acoes { display: flex; flex-direction: column; gap: 8px; }
.btn-ajuste { background: var(--bg-input); border: 1px solid var(--border); color: var(--text-secondary); font-size: 13px; padding: 11px 16px; border-radius: 8px; cursor: pointer; text-align: left; transition: var(--transition); }
.btn-ajuste:hover { border-color: var(--gold); color: var(--text-primary); }
.btn-danger { border-color: rgba(252,165,165,0.3); color: var(--red); }
.btn-danger:hover { background: var(--red-dim); border-color: var(--red); }

/* ════════════════════════════════════════════════════════════════════
   BOTÕES
   ════════════════════════════════════════════════════════════════════ */
button { font-family: 'DM Sans', sans-serif; cursor: pointer; border: none; transition: var(--transition); }
.btn-icon { background: none; color: var(--text-muted); font-size: 14px; padding: 5px 7px; border-radius: 6px; line-height: 1; }
.btn-icon:hover { background: rgba(255,255,255,.06); color: var(--text-primary); }
.btn-fechar { background: none; color: var(--text-muted); font-size: 19px; width: 30px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.btn-fechar:hover { background: rgba(255,255,255,.07); }
.btn-submit { background: var(--gold); color: #0a0a0f; font-size: 14px; font-weight: 600; padding: 12px 24px; border-radius: 6px; flex: 1; }
.btn-submit:hover { background: var(--gold-light); box-shadow: 0 4px 18px rgba(196,164,100,.35); }
.btn-cancel { background: rgba(255,255,255,.05); color: var(--text-secondary); font-size: 14px; padding: 12px 20px; border-radius: 6px; border: 1px solid var(--border); }
.btn-cancel:hover { background: rgba(255,255,255,.09); }
.btn-add-small { background: var(--gold-dim); border: 1px solid var(--gold); color: var(--gold); font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: 8px; cursor: pointer; transition: var(--transition); }
.btn-add-small:hover { background: var(--gold); color: #0a0a0f; }
.btn-fab { display: none; position: fixed; bottom: 24px; right: 20px; z-index: 150; width: 54px; height: 54px; border-radius: 50%; background: var(--gold); color: #0a0a0f; font-size: 28px; font-weight: 300; align-items: center; justify-content: center; box-shadow: 0 4px 24px rgba(196,164,100,.45); }
.btn-fab:hover { background: var(--gold-light); transform: scale(1.08); }
@media (max-width: 1023px) { .btn-fab { display: flex; } }

/* ════════════════════════════════════════════════════════════════════
   MODAL
   ════════════════════════════════════════════════════════════════════ */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 500; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.aberto { display: flex; animation: fadeIn .15s ease; }
.modal-box { background: var(--bg-surface); border: 1px solid rgba(255,255,255,.09); border-radius: 22px; padding: 28px; width: 100%; max-width: 520px; box-shadow: var(--shadow-modal); animation: slideUp .25s cubic-bezier(0.34,1.56,0.64,1) both; max-height: 90vh; overflow-y: auto; }
[data-tema="claro"] .modal-box { border-color: rgba(0,0,0,.09); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.modal-header h2 { font-family: 'Playfair Display', serif; font-size: 1.2rem; font-weight: 600; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 10px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.form-group input, .form-group select { width: 100%; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--text-primary); outline: none; transition: var(--transition); appearance: none; -webkit-appearance: none; }
.form-group input::placeholder { color: var(--text-muted); }
.form-group input:focus, .form-group select:focus { border-color: var(--gold); background: var(--bg-card); box-shadow: 0 0 0 3px rgba(196,164,100,.1); }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: block; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: auto; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.55); cursor: pointer; }
.select-wrapper { position: relative; }
.select-wrapper::after { content:'▾'; position:absolute; right:11px; top:50%; transform:translateY(-50%); color:var(--text-muted); pointer-events:none; }
.tipo-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tipo-btn { padding: 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-input); color: var(--text-secondary); font-size: 13px; font-weight: 500; text-align: center; cursor: pointer; transition: var(--transition); }
.tipo-btn.active-receita { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.tipo-btn.active-despesa { background: var(--red-dim);   border-color: var(--red);   color: var(--red); }
.form-actions { display: flex; gap: 10px; margin-top: 22px; }

/* ════════════════════════════════════════════════════════════════════
   ANIMAÇÕES
   ════════════════════════════════════════════════════════════════════ */
@keyframes fadeUp    { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn    { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp   { from { opacity:0; transform:translateY(28px) scale(.97); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes slideUpMob{ from { transform:translateY(100%); opacity:.5; } to { transform:translateY(0); opacity:1; } }

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .dashboard-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
    .card-value { font-size: 1.25rem; }
    .page-content { padding: 20px 16px 100px; }
    .insights-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .page-content { padding: 16px 12px 100px; }
    .dashboard-cards { grid-template-columns: 1fr; gap: 8px; }
    .card { padding: 15px; }
    .card-value { font-size: 1.3rem; }
    .contas-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .filtros-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .filtro-busca-wrap { grid-column: 1 / -1; }
    .filtro-group select, .filtro-group input { font-size: 16px; padding: 10px; width: 100%; }
    .transaction-item { padding: 11px 13px; }
    .transaction-value { min-width: 80px; font-size: 13px; }
    .transaction-actions-btns { opacity: 1; }
    .cat-actions { opacity: 1; }
    .conta-actions { opacity: 1; }
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal-box { border-radius: 22px 22px 0 0; padding: 22px 18px 34px; max-height: 93vh; animation: slideUpMob .28s cubic-bezier(0.34,1.2,0.64,1) both; }
    .form-row { grid-template-columns: 1fr; }
    .form-group input, .form-group select { font-size: 16px; }
    .grid-emojis { grid-template-columns: repeat(6, 1fr); }
    .grafico-wrapper { flex-direction: column; align-items: center; }
    #grafico-legenda { min-width: 100%; }
}

@media (max-width: 360px) {
    .contas-grid, .filtros-row, .cat-grid { grid-template-columns: 1fr; }
}
