/* ============================================================================
   ESTILOS GERAIS & VARIÁVEIS - V15 (Correção Seletores & Espaçamento)
   ============================================================================ */
:root {
    --primary: #0f393b;
    /* Verde Petróleo */
    --primary-dark: #072526;
    --invest: #00623B;
    /* Verde Investimento */
    --invest-dark: #003B23;
    --gold: #D4AF37;
    /* Dourado */
    --gold-light: #F4EBD0;
    /* Creme */
    --bg-body: #E5E7EB;
    --white: #FFFFFF;
    --text-dark: #111827;
    --text-gray: #4B5563;
    --danger: #991B1B;
    --success: #065F46;
    --card-radius: 20px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

body {
    margin: 0;
    font-family: 'Mulish', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-dark);
    padding-bottom: 100px;
    overflow-x: hidden;
    /* FUNDO DENSO DE MOEDAS */
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%239CA3AF' fill-opacity='0.12' font-family='Arial' font-weight='bold'%3E%3Ctext x='10' y='30' transform='rotate(15 10,30)' font-size='24'%3E$%3C/text%3E%3Ctext x='50' y='80' transform='rotate(-20 50,80)' font-size='28'%3E€%3C/text%3E%3Ctext x='120' y='40' transform='rotate(45 120,40)' font-size='20'%3E£%3C/text%3E%3Ctext x='160' y='20' transform='rotate(-10 160,20)' font-size='30'%3E¥%3C/text%3E%3Ctext x='30' y='150' transform='rotate(90 30,150)' font-size='22'%3ER$%3C/text%3E%3Ctext x='90' y='120' transform='rotate(-45 90,120)' font-size='26'%3E₿%3C/text%3E%3Ctext x='150' y='160' transform='rotate(30 150,160)' font-size='20'%3E₹%3C/text%3E%3Ctext x='10' y='190' transform='rotate(-15 10,190)' font-size='24'%3E₩%3C/text%3E%3Ctext x='180' y='90' transform='rotate(60 180,90)' font-size='18'%3E₺%3C/text%3E%3Ctext x='60' y='10' transform='rotate(-5 60,10)' font-size='16'%3E₽%3C/text%3E%3Ctext x='110' y='190' transform='rotate(20 110,190)' font-size='28'%3E₣%3C/text%3E%3Ctext x='80' y='60' transform='rotate(-30 80,60)' font-size='20'%3EKc%3C/text%3E%3Ctext x='140' y='80' transform='rotate(10 140,80)' font-size='24'%3Ekr%3C/text%3E%3Ctext x='40' y='110' transform='rotate(180 40,110)' font-size='18'%3E$%3C/text%3E%3Ctext x='170' y='130' transform='rotate(-90 170,130)' font-size='22'%3E€%3C/text%3E%3Ctext x='20' y='70' transform='rotate(45 20,70)' font-size='14'%3E¥%3C/text%3E%3C/g%3E%3C/svg%3E");
}

/* HEADER GERAL */
header {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px 24px 40px 24px;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    box-shadow: 0 4px 20px rgba(15, 57, 59, 0.4);
    position: relative;
    border-bottom: 2px solid var(--gold);
}

header.theme-invest {
    background: linear-gradient(180deg, var(--invest) 0%, var(--invest-dark) 100%);
}

header.theme-invest .balance-label,
header.theme-invest .balance-val,
header.theme-invest .app-title,
header.theme-invest .btn-icon-head {
    color: var(--gold-light) !important;
}

header.theme-invest .nav-arrow {
    color: var(--gold) !important;
}

/* ELEMENTOS DO HEADER */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.app-title {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gold-light);
}

.balance-container {
    text-align: center;
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
}

.balance-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
    font-weight: 600;
    color: #D1D5DB;
}

.balance-val {
    font-size: 2.4rem;
    font-weight: 800;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    color: var(--white);
}

.balance-val.neg {
    color: #FECACA;
}

.btn-icon-head {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--gold);
    color: var(--gold);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.cloud-dot {
    width: 10px;
    height: 10px;
    background: #00ff88;
    border-radius: 50%;
    position: absolute;
    top: 0;
    right: 0;
    border: 2px solid var(--primary);
    display: none;
}

/* NAVEGAÇÃO */
.month-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 24px;
    border-radius: 30px;
    width: fit-content;
    margin: 15px auto 0 auto;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-arrow {
    background: none;
    border: none;
    color: var(--gold);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 10px;
    font-weight: bold;
}

.date-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}

#month-display {
    font-weight: 800;
    text-transform: capitalize;
    font-size: 1.1rem;
    color: white;
}

#header-year {
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: 600;
    color: var(--gold-light);
}

.nav-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    padding: 12px;
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    border: 1px solid rgba(197, 160, 89, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80px;
    text-decoration: none;
}

.nav-card:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.2);
}

.nav-icon {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.nav-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold-light);
}

/* CARDS & LAYOUT */
.container {
    padding: 0 20px;
    position: relative;
    top: -20px;
    z-index: 5;
}

.view-section {
    display: none;
    padding-bottom: 120px;
    animation: fadeIn 0.3s ease;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--card-radius);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 10px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
}

.row-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.95rem;
    align-items: center;
}

.row-item:last-child {
    border-bottom: none;
}

.row-val {
    font-weight: 700;
    font-size: 1rem;
}

.text-red {
    color: var(--danger);
}

.text-green {
    color: var(--success);
}

.prev-bal-row {
    background: #EFF6FF;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    border: 1px solid #DBEAFE;
    color: #1E3A8A;
}

.section-header {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 30px 5px 15px 5px;
    color: var(--primary);
    border-bottom: 2px solid var(--gold);
    display: inline-block;
    padding-bottom: 5px;
}

.trans-card {
    background: white;
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    border-left: 4px solid transparent;
}

.trans-card:hover {
    border-left-color: var(--gold);
}

.trans-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #F0FDF4;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    border: 1px solid #DCFCE7;
}

.trans-info {
    margin-left: 15px;
    flex: 1;
}

.trans-title {
    font-weight: 700;
    font-size: 0.95rem;
    display: block;
    color: #374151;
}

.trans-meta {
    font-size: 0.8rem;
    color: #6B7280;
    margin-top: 2px;
}

.trans-amount {
    font-weight: 700;
    font-size: 1rem;
}

/* ============================================================================
   ESTILOS ESPECÍFICOS: PÁGINA GUARDAR (Correção do Espaçamento)
   ============================================================================ */
/* IMPORTANTE: Usamos o seletor ID DO BODY (#page-savings) */
/* Remove a margem negativa do container apenas nesta página */
#page-savings .container {
    margin-top: 0 !important;
    padding-top: 20px;
}

/* Afasta o título "Meus Cofrinhos" do topo */
#page-savings .section-header {
    color: var(--invest-dark);
    border-bottom: 2px solid var(--gold);
    display: inline-block;
    padding-bottom: 5px;
    margin-top: 20px;
}

#page-savings .app-card,
#page-savings .trans-card {
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: linear-gradient(to bottom right, #ffffff, #FDFCF5);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.15);
}

#page-savings .invest-icon {
    background: var(--gold-light) !important;
    color: var(--invest-dark) !important;
    border: 1px solid var(--gold);
}

#page-savings .text-green,
#page-savings .trans-amount.text-green {
    color: #B8860B !important;
}

#page-savings .trans-title,
#page-savings span[style*="font-weight:700"] {
    color: var(--invest-dark);
}

/* ============================================================================
   BOTÕES E MODAIS
   ============================================================================ */
.fab {
    background: var(--primary);
    color: var(--gold);
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    font-size: 2.5rem;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(15, 57, 59, 0.5);
    cursor: pointer;
    transition: transform 0.2s;
    padding-bottom: 6px;
}

.fab.invest {
    background: linear-gradient(135deg, var(--invest), var(--invest-dark));
    border: 2px solid var(--gold);
    box-shadow: 0 6px 20px rgba(0, 98, 59, 0.5);
}

.fab:active {
    transform: scale(0.95);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100;
    display: none;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(3px);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

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

.modal-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0;
    color: var(--primary);
}

.close-btn {
    background: #f3f4f6;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
    color: #666;
}

.type-switch {
    display: flex;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 14px;
    margin-bottom: 20px;
}

.switch-opt.active-exp {
    background: white;
    color: var(--danger);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.switch-opt.active-inc {
    background: white;
    color: var(--success);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #666;
    margin-bottom: 8px;
    margin-top: 15px;
}

.form-input {
    width: 100%;
    padding: 16px;
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    background: #F9FAFB;
}

.form-input:focus {
    border-color: var(--primary);
    background: #fff;
}

/* Estilo do Botão Recorrência */
.recurrence-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 15px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-primary {
    width: 100%;
    padding: 18px;
    background: var(--primary);
    color: var(--gold-light);
    border: 1px solid var(--gold);
    border-radius: 16px;
    font-weight: 800;
    font-size: 1rem;
    margin-top: 25px;
    cursor: pointer;
}

.btn-delete {
    background: #fee2e2;
    color: var(--danger);
    width: 100%;
    padding: 14px;
    border-radius: 16px;
    border: none;
    font-weight: 700;
    margin-top: 10px;
    cursor: pointer;
    display: none;
}

.reset-btn {
    display: block;
    margin: 40px auto;
    color: #999;
    border: 1px solid #eee;
    background: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.8rem;
    cursor: pointer;
}

/* Nuvem e Toast */
.cloud-icon-large {
    font-size: 3rem;
    margin-bottom: 10px;
    text-align: center;
    display: block;
}

.cloud-desc {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.link-wrapper {
    position: relative;
    margin-bottom: 10px;
}

.link-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #fee2e2;
    color: var(--danger);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
}

.error-msg {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
    font-weight: 600;
}

/* --- CORREÇÃO DA NOTIFICAÇÃO (TOAST) --- */
#toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 50px;
    /* Mais arredondado */
    padding: 16px;
    position: fixed;
    z-index: 999999 !important;
    /* <--- ISSO GARANTE QUE FIQUE NA FRENTE DE TUDO */
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
}

#toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px;
    /* Sobe um pouco quando aparece */
}

/* Estilo para Erro (Vermelho) */
#toast.error {
    background-color: #EF4444;
    /* Vermelho */
}

/* Gráficos */
.chart-page-container {
    background: white;
    min-height: 100vh;
    padding: 20px;
}

.chart-wrapper {
    height: 400px;
    width: 100%;
}

.chart-back-btn {
    background: #f3f4f6;
    border: none;
    padding: 10px 15px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    margin-right: 15px;
}

/* Estilo do Checkbox de Status (Pago/Pendente) */
.status-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    justify-content: center;
}

.status-checkbox input {
    display: none;
    /* Esconde o quadradinho feio padrão */
}

.status-visual {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f3f4f6;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #6b7280;
    transition: 0.2s;
    border: 1px solid #e5e7eb;
}

/* Quando marcado (Pago) */
.status-checkbox input:checked+.status-visual {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
    box-shadow: 0 2px 5px rgba(22, 101, 52, 0.1);
}

/* Quando desmarcado (Pendente) */
.status-checkbox input:not(:checked)+.status-visual {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

/* --- CORREÇÃO DE CORES (Padronização) --- */
.text-green {
    color: #059669 !important;
    font-weight: 700;
}

.text-red {
    color: #e11d48 !important;
    font-weight: 700;
}

/* --- BOTÕES DE BACKUP (Design Melhorado) --- */
.btn-backup {
    background-color: white;
    color: #4B5563;
    border: 1px solid #d1d5db;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-backup:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.btn-backup-icon {
    font-size: 1.1rem;
}

/* --- BOTÃO DE RESET (Perigo) --- */
.reset-btn {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    margin-top: 40px;
    font-weight: 700;
    margin-bottom: 40px;
    /* Espaço extra no final */
}

/* Classes utilitárias para ocultar/mostrar elementos */
.hidden {
    display: none !important;
}

.flex {
    display: flex !important;
}

/* Garante que os modais fiquem acima de tudo */
.modal-overlay {
    z-index: 9999;
}

/* ============================================================================
   ESTILOS GERAIS & VARIÁVEIS (V38)
   ============================================================================ */
:root {
    --primary: #0f393b;
    --primary-dark: #072526;
    --invest: #00623B;
    --invest-dark: #003B23;
    --gold: #D4AF37;
    --bg-body: #F3F4F6;
    --white: #FFFFFF;
    --text-dark: #1F2937;
    --text-gray: #6B7280;
    --danger: #EF4444;
    --success: #10B981;
    --card-radius: 16px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

body {
    margin: 0;
    font-family: 'Mulish', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-dark);
    padding-bottom: 100px;
    overflow-x: hidden;
}

/* LAYOUT */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.theme-home {
    background-color: #820AD1;
    color: white;
    border-radius: 0 0 30px 30px;
    position: relative;
}

.theme-invest {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    padding: 20px 20px 40px 20px;
    border-radius: 0 0 30px 30px;
}

/* HEADER */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.app-title {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.btn-icon-head {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: 0.2s;
}

.btn-icon-head:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cloud-dot {
    width: 8px;
    height: 8px;
    background-color: #4ade80;
    border-radius: 50%;
    position: absolute;
    top: 8px;
    right: 8px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    display: none;
}

/* SALDO */
.balance-container {
    text-align: center;
    margin-bottom: 15px;
}

.balance-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.balance-val {
    font-size: 2rem;
    font-weight: 800;
}

.balance-val.neg {
    color: #fca5a5;
}

/* NAV MÊS */
.month-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.15);
    width: fit-content;
    margin: 0 auto;
    padding: 8px 20px;
    border-radius: 30px;
    backdrop-filter: blur(5px);
}

.nav-arrow {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 10px;
}

.date-wrapper {
    text-align: center;
}

#month-display {
    font-weight: 700;
    text-transform: capitalize;
    font-size: 1rem;
    line-height: 1.2;
}

#header-year {
    font-size: 0.75rem;
    opacity: 0.8;
}

.nav-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 16px;
    text-decoration: none;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: 0.2s;
}

.nav-card:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.2);
}

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.nav-text {
    font-size: 0.85rem;
    font-weight: 600;
}

/* CARDS BRANCOS */
.app-card {
    background: white;
    border-radius: var(--card-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
}

.card-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
}

.prev-bal-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
    padding: 0 5px;
}

.row-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f9fafb;
    font-size: 0.95rem;
    align-items: center;
}

.row-item:last-child {
    border-bottom: none;
}

.row-val {
    font-weight: 700;
}

/* LISTA TRANSAÇÕES */
.section-header {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 25px 0 15px 5px;
    color: var(--text-dark);
}

.trans-card {
    background: white;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: 0.2s;
    border: 1px solid transparent;
}

.trans-card:active {
    transform: scale(0.98);
    background: #f9fafb;
}

.trans-icon {
    width: 42px;
    height: 42px;
    background: #f3f4f6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-right: 15px;
}

.invest-icon {
    background: #d1fae5;
    color: #065f46;
}

.trans-info {
    display: flex;
    flex-direction: column;
}

.trans-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.trans-meta {
    font-size: 0.75rem;
    color: var(--text-gray);
}

.trans-amount {
    font-weight: 800;
    font-size: 1rem;
}

/* GRÁFICO (CORREÇÃO DE ALTURA) */
.chart-wrapper {
    position: relative;
    height: 250px;
    width: 100%;
}

/* BOTÃO FLUTUANTE */
.fab-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 990;
    height: 60px;
    bottom: 100px;
}

.fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #820AD1;
    color: white;
    border: none;
    font-size: 2rem;
    box-shadow: 0 4px 15px rgba(130, 10, 209, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.fab:active {
    transform: scale(0.9) rotate(90deg);
}

.fab.invest {
    background-color: #059669;
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.4);
}

/* MODAIS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s;
}

.modal-sheet {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 25px 25px 0 0;
    padding: 25px;
    animation: slideUp 0.3s;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

.modal-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-dark);
}

.close-btn {
    background: #f3f4f6;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
}

/* FORMULÁRIOS */
.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-gray);
    margin-bottom: 8px;
    margin-top: 15px;
}

.form-input {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    font-size: 1rem;
    background: #f9fafb;
    transition: 0.2s;
    font-family: 'Mulish', sans-serif;
}

.form-input:focus {
    border-color: #820AD1;
    background: white;
    outline: none;
}

/* SWITCH */
.type-switch {
    display: flex;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
}

/* BOTÕES AÇÃO */
.btn-primary {
    width: 100%;
    padding: 16px;
    background-color: #820AD1;
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    transition: 0.2s;
    box-shadow: 0 4px 6px rgba(130, 10, 209, 0.2);
}

.btn-primary:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-delete {
    background: #fee2e2;
    color: #991b1b;
    padding: 16px;
    border-radius: 14px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
}

/* STATUS CHECKBOX */
.status-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 100%;
}

.status-checkbox input {
    display: none;
}

.status-visual {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    transition: 0.2s;
}

.status-checkbox input:checked+.status-visual {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

/* BACKUP BTNS */
.btn-backup {
    background: white;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: 600;
    color: #555;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.reset-btn {
    width: 100%;
    background: #fee2e2;
    color: #991b1b;
    border: none;
    padding: 15px;
    margin-top: 30px;
    margin-bottom: 50px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* UTILS */
.text-green {
    color: var(--success);
}

.text-red {
    color: var(--danger);
}

.recurrence-box {
    background: #f8fafc;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    justify-content: space-between;
}

@media (min-width: 600px) {
    .modal-sheet {
        max-width: 400px;
        border-radius: 20px;
        margin-bottom: 20px;
    }

    .modal-overlay {
        align-items: center;
    }
}

/* Adicione isso ao seu style.css para o gráfico não ficar com altura 0 */
.chart-wrapper {
    position: relative;
    height: 300px;
    /* Altura fixa obrigatória */
    width: 100%;
    margin-bottom: 20px;
}

/* Correção para os botões de abas funcionarem visualmente */
.switch-opt {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    color: #666;
    transition: 0.3s;
}

.switch-opt.active {
    background: white;
    color: var(--primary);
    /* Ou sua cor de destaque */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* --- RODAPÉ PERSONALIZADO (Estilo Guardar) --- */
.app-footer {
    background: linear-gradient(135deg, #00623B 0%, #003B23 100%);
    /* Verde Investimento */
    color: #F4EBD0;
    /* Creme/Dourado Claro */
    padding: 40px 20px 80px 20px;
    /* Espaço extra embaixo por causa do botão flutuante */
    border-radius: 30px 30px 0 0;
    text-align: center;
    margin-top: 40px;
    border-top: 4px solid #D4AF37;
    /* Borda Dourada */
    position: relative;
    z-index: 10;
}

.footer-dev {
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-weight: 300;
}

.footer-dev strong {
    color: #D4AF37;
    /* Dourado */
    font-weight: 800;
}

/* Botão WhatsApp */
.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #25D366;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
    transition: transform 0.2s;
}

.btn-whatsapp:active {
    transform: scale(0.95);
}

/* Link Termos */
.footer-link {
    display: block;
    margin-top: 25px;
    color: #D4AF37;
    font-size: 0.8rem;
    text-decoration: none;
    opacity: 0.8;
}

/* --- REMOÇÃO DO ROXO (CORREÇÃO DE CORES) --- */
/* Força o verde petróleo nos botões e header da home */
.theme-home {
    background: linear-gradient(180deg, #0f393b 0%, #072526 100%) !important;
}

.btn-primary,
.fab {
    background-color: #0f393b !important;
    border-color: #D4AF37 !important;
}

/* Ajuste de botões para ficarem uniformes */
.btn-primary,
.btn-delete,
.reset-btn {
    min-height: 54px;
    border-radius: 16px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- RODAPÉ CLÁSSICO (Franz TI) --- */
.app-footer {
    background: linear-gradient(135deg, #00623B 0%, #003B23 100%);
    /* Verde Investimento */
    color: #F4EBD0;
    padding: 30px 20px 80px 20px;
    /* Espaço embaixo pro FAB */
    border-radius: 20px 20px 0 0;
    text-align: center;
    margin-top: 40px;
    border-top: 3px solid #D4AF37;
    /* Dourado */
    position: relative;
    z-index: 10;
}

.footer-dev {
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.footer-dev strong {
    color: #D4AF37;
    font-weight: 800;
}

/* Botão WhatsApp */
.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #25D366;
    color: white;
    padding: 10px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.2s;
}

.btn-whatsapp:active {
    transform: scale(0.95);
}

/* --- ESTILOS PÁGINA TERMOS --- */
.text-orange {
    color: #F97316 !important;
    font-weight: 800;
}

.terms-content h2 {
    font-size: 1.1rem;
    margin-top: 25px;
    margin-bottom: 10px;
    border-left: 4px solid #F97316;
    padding-left: 10px;
}

.terms-content p {
    line-height: 1.6;
    color: #4B5563;
    font-size: 0.9rem;
    text-align: justify;
    margin-bottom: 15px;
}

.terms-content ul {
    padding-left: 20px;
    color: #4B5563;
    font-size: 0.9rem;
}

.terms-content li {
    margin-bottom: 8px;
}

/* --- AJUSTE BOTÃO EXCLUIR (SIM/NÃO) --- */
.modal-confirm-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-cancel-reset {
    flex: 1;
    background: #E5E7EB;
    color: #374151;
    border: 1px solid #D1D5DB;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

.btn-confirm-reset {
    flex: 1;
    background: #EF4444;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* --- RODAPÉ IDENTICO AO CABEÇALHO (HOME/GRÁFICOS) --- */
.footer-home {
    /* Mesmo gradiente do cabeçalho .theme-home */
    background: linear-gradient(135deg, #0f393b 0%, #072526 100%);
    color: #F4EBD0;
    /* Texto claro (Creme) */
    padding: 30px 20px 90px 20px;
    border-radius: 20px 20px 0 0;
    text-align: center;
    margin-top: 40px;
    border-top: 2px solid #D4AF37;
    /* Detalhe Dourado Sutil */
    position: relative;
    z-index: 10;
}

/* --- RODAPÉ PÁGINA GUARDAR (MANTIDO) --- */
.footer-invest {
    /* Gradiente Verde mais vivo */
    background: linear-gradient(135deg, #00623B 0%, #003B23 100%);
    color: #F4EBD0;
    padding: 30px 20px 90px 20px;
    border-radius: 20px 20px 0 0;
    text-align: center;
    margin-top: 40px;
    border-top: 2px solid #D4AF37;
    position: relative;
    z-index: 10;
}

/* Estilo dos Links do Rodapé */
.footer-dev {
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-weight: 300;
}

.footer-dev strong {
    color: #D4AF37;
    font-weight: 800;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #25D366;
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* =========================================
   FIX DO RODAPÉ (LAYOUT)
   ========================================= */
html,
body {
    height: 100%;
    /* Garante altura total */
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
    /* Remove padding antigo que atrapalhava */
}

/* O container agora cresce para ocupar o vazio */
.container {
    flex: 1;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
    /* Mantém o visual sobreposto ao header */
}

//* --- RODAPÉ PERSONALIZADO (Compacto e Centralizado) --- */
.app-footer {
    width: 100%;
    max-width: 600px;
    /* TRAVA A LARGURA IGUAL AO APP */
    margin: 0 auto;
    /* CENTRALIZA NA TELA */
    padding: 20px 20px 80px 20px;
    border-radius: 25px 25px 0 0;
    /* Arredondado estilo cartão */
    text-align: center;
    position: relative;
    z-index: 10;
    /* Removemos margem superior grande para ele ficar mais perto do conteúdo se quiser */
    margin-top: auto;
    font-size: 0.85rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    /* Sombra suave para destacar do fundo */
}

/* Home e Gráficos: Verde Petróleo */
.footer-home {
    background: linear-gradient(135deg, #0f393b 0%, #072526 100%);
    border-top: 2px solid #D4AF37;
    color: #F4EBD0;
}

/* Guardar: Verde Investimento */
.footer-invest {
    background: linear-gradient(135deg, #00623B 0%, #003B23 100%);
    border-top: 2px solid #D4AF37;
    color: #F4EBD0;
}

/* Ajustes internos para caber melhor */
.footer-dev {
    font-size: 0.8rem;
    margin-bottom: 15px;
    font-weight: 300;
}

.footer-dev strong {
    color: #D4AF37;
    font-weight: 800;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #25D366;
    color: white;
    padding: 8px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-whatsapp:active {
    transform: scale(0.95);
}

/* ============================================================================
   RODAPÉ COMPACTO & BOTÕES DISCRETOS
   ============================================================================ */
/* 1. RODAPÉ BEM PEQUENO */
.app-footer {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    /* Altura reduzida conforme seu pedido */
    padding: 15px 20px 100px 20px;
    border-radius: 20px 20px 0 0;
    text-align: center;
    position: relative;
    z-index: 10;
    margin-top: auto;
    font-size: 0.75rem;
    /* Fonte menor */
}

/* Home e Gráficos: Verde Petróleo */
.footer-home {
    background: linear-gradient(135deg, #0f393b 0%, #072526 100%);
    border-top: 1px solid #D4AF37;
    /* Borda mais fina */
    color: rgba(244, 235, 208, 0.6);
    /* Texto mais apagado */
}

/* Guardar: Verde Investimento */
.footer-invest {
    background: linear-gradient(135deg, #00623B 0%, #003B23 100%);
    border-top: 1px solid #D4AF37;
    color: rgba(244, 235, 208, 0.6);
}

/* 2. BOTÃO WHATSAPP (PEQUENO E DISCRETO) */
.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    /* Fundo transparente */
    color: #D4AF37;
    /* Dourado */
    border: 1px solid rgba(212, 175, 55, 0.3);
    /* Borda fina */
    padding: 5px 12px;
    /* Tamanho reduzido */
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.75rem;
    /* Fonte pequena */
    margin: 8px 0;
    transition: 0.2s;
    box-shadow: none;
    /* Sem sombra para ser discreto */
}

.btn-whatsapp:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 3. LINKS DO RODAPÉ */
.footer-dev {
    margin: 0;
    font-weight: 300;
}

.footer-dev strong {
    color: #D4AF37;
}

/* 4. BOTÃO APAGAR DADOS (AGORA É SÓ UM LINK DE TEXTO) */
.reset-btn {
    width: fit-content;
    height: auto;
    margin: 20px auto 10px auto;
    /* Centralizado */
    background: transparent;
    border: none;
    color: #9CA3AF;
    /* Cinza claro */
    font-size: 0.75rem;
    font-weight: 400;
    text-decoration: underline;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
    opacity: 0.7;
}

.reset-btn:hover {
    color: #EF4444;
    /* Fica vermelho só ao passar o mouse */
    background: transparent;
    opacity: 1;
}

/* Ajuste o container para não colar demais no rodapé */
.container {
    padding-bottom: 10px;
}

/* --- BOTÃO RESGATAR (Laranja/Dourado) --- */
.btn-redeem-gold {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #F97316 0%, #D97706 100%);
    /* Laranja para Dourado Escuro */
    color: white;
    font-weight: 800;
    font-size: 1rem;
    border: 2px solid #FCD34D;
    /* Borda Dourada Clara */
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: transform 0.2s;
}

.btn-redeem-gold:active {
    transform: scale(0.98);
}

/* HISTÓRICO DE META (READ ONLY) */
.history-item-readonly {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.history-item-readonly:last-child {
    border-bottom: none;
}

.history-time {
    font-size: 0.75rem;
    color: #999;
    margin-top: 2px;
}

/* --- DASHBOARD GRÁFICO (Cores Originais) --- */
.dash-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
    position: relative;
    z-index: 5;
    /* Para ficar acima do header se sobrepor um pouco */
}

.dash-card.bal {
    grid-column: span 2;
    /* Saldo ocupa a linha inteira */
}

.dash-card {
    background: #ffffff;
    padding: 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.dash-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.dash-info {
    display: flex;
    flex-direction: column;
}

.dash-card span {
    font-size: 0.75rem;
    color: #6B7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.dash-card strong {
    font-size: 1.1rem;
    font-weight: 800;
}

/* --- CORES DO TEMA --- */
/* Receita (Verde Sucesso) */
.dash-card.inc .dash-icon {
    background: #ECFDF5;
    color: var(--success);
}

.dash-card.inc strong {
    color: var(--success);
}

/* Despesa (Vermelho Perigo) */
.dash-card.exp .dash-icon {
    background: #FEF2F2;
    color: var(--danger);
}

.dash-card.exp strong {
    color: var(--danger);
}

/* Saldo (Verde Petróleo / Dourado da Marca) */
.dash-card.bal .dash-icon {
    background: #F0FDF4;
    /* Fundo bem suave */
    color: var(--primary);
    border: 1px solid var(--gold);
    /* Detalhe Dourado */
}

.dash-card.bal strong {
    color: var(--primary);
}

/* --- BOTÕES DE FILTRO (Estilo Verde & Dourado) --- */
.chart-switch {
    display: flex;
    background: #f0fdf4;
    /* Fundo verde bem clarinho */
    padding: 6px;
    border-radius: 16px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
    gap: 10px;
    border: 1px solid #dcfce7;
}

.switch-opt {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.9rem;
    color: #166534;
    /* Texto verde escuro quando inativo */
    border: 2px solid transparent;
    /* Reserva espaço para borda */
    background: #00ff88;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
}

/* RECEITAS (Ativo): Verde Padrão + Borda Dourada */
.switch-opt.active-inc {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #F4EBD0;
    /* Texto Creme */
    border-color: #D4AF37;
    /* Dourado Puro */
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

/* DESPESAS (Ativo): Verde Diferente + Borda Dourada-Avermelhada */
.switch-opt.active-exp {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    /* Verde Petróleo/Teal */
    color: #F4EBD0;
    border-color: #B45309;
    /* Dourado Avermelhado (Bronze/Cobre) */
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
    transform: translateY(-1px);
}

/* --- GRADE DE CATEGORIAS (Lado a Lado Flexível) --- */
.cat-grid {
    display: flex;
    /* Flexbox para ficar lado a lado */
    flex-wrap: wrap;
    /* Permite quebrar linha se ficar muito apertado no celular */
    gap: 10px;
    /* Espaço entre eles */
    width: 100%;
}

.cat-stat-card {
    flex: 1;
    /* Cresce para ocupar espaço igual */
    min-width: 100px;
    /* Tamanho mínimo para não esmagar */
    border-radius: 20px;
    overflow: hidden;
    color: white;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Cabeçalho do Card (Categoria) */
.cat-stat-header {
    padding: 12px 5px 5px 5px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Corpo (Círculo) */
.cat-stat-body {
    padding: 10px 0 35px 0;
    /* Espaço embaixo para a curva */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.cat-percent-circle {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Separador Curvo (A curva branca antes do valor) */
.cat-val-separator {
    position: absolute;
    bottom: 35px;
    /* Ajuste fino da posição vertical */
    left: 0;
    width: 100%;
    height: 25px;
    background: rgba(0, 0, 0, 0.15);
    /* Fundo mais escuro do rodapé */
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    /* Cria o arco convexo */
    transform: scaleX(1.2);
    /* Alarga a curva */
    z-index: 1;
}

/* Rodapé (Valor) */
.cat-stat-footer {
    background: rgba(0, 0, 0, 0.15);
    /* Fundo escuro igual ao separador */
    padding: 8px 5px 12px 5px;
    font-weight: 800;
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
    margin-top: auto;
    /* Empurra para o fundo */
}

/* --- BOTÕES DE FILTRO (Estilo Verde & Dourado) --- */
.chart-switch {
    display: flex;
    background: #f0fdf4;
    /* Fundo verde bem clarinho */
    padding: 6px;
    border-radius: 16px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
    gap: 10px;
    border: 1px solid #dcfce7;
}

/* RECEITAS (Ativo): Verde Padrão + Borda Dourada */
.switch-opt.active-inc {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #F4EBD0;
    /* Texto Creme */
    border-color: #D4AF37;
    /* Dourado Puro */
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

/* DESPESAS (Ativo): Verde Diferente + Borda Dourada-Avermelhada */
.switch-opt.active-exp {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    /* Verde Petróleo/Teal */
    color: #F4EBD0;
    border-color: #B45309;
    /* Dourado Avermelhado (Bronze/Cobre) */
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
    transform: translateY(-1px);
}

/* --- GRADE DE CATEGORIAS (Lado a Lado Flexível) --- */
.cat-grid {
    display: flex;
    /* Flexbox para ficar lado a lado */
    flex-wrap: wrap;
    /* Permite quebrar linha se ficar muito apertado no celular */
    gap: 10px;
    /* Espaço entre eles */
    width: 100%;
}

.cat-stat-card {
    flex: 1;
    /* Cresce para ocupar espaço igual */
    min-width: 100px;
    /* Tamanho mínimo para não esmagar */
    border-radius: 20px;
    overflow: hidden;
    color: white;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Cabeçalho do Card (Categoria) */
.cat-stat-header {
    padding: 12px 5px 5px 5px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Corpo (Círculo) */
.cat-stat-body {
    padding: 10px 0 35px 0;
    /* Espaço embaixo para a curva */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.cat-percent-circle {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Separador Curvo (A curva branca antes do valor) */
.cat-val-separator {
    position: absolute;
    bottom: 35px;
    /* Ajuste fino da posição vertical */
    left: 0;
    width: 100%;
    height: 25px;
    background: rgba(0, 0, 0, 0.15);
    /* Fundo mais escuro do rodapé */
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    /* Cria o arco convexo */
    transform: scaleX(1.2);
    /* Alarga a curva */
    z-index: 1;
}

/* Rodapé (Valor) */
.cat-stat-footer {
    background: rgba(0, 0, 0, 0.15);
    /* Fundo escuro igual ao separador */
    padding: 8px 5px 12px 5px;
    font-weight: 800;
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
    margin-top: auto;
    /* Empurra para o fundo */
}

/* ============================================================================
   DASHBOARD VISUAL (Replicando o Exemplo "White Curve")
   ============================================================================ */
.dashboard-container {
    position: relative;
    width: 100%;
    /* Altura fixa é necessária para o layout absoluto funcionar bem */
    height: 480px;
    display: flex;
    overflow: hidden;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* COLUNA (Cada Categoria) */
.dash-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    /* Borda sutil entre colunas */
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    background-color: #666;
    /* Fallback */
}

.dash-col:last-child {
    border-right: none;
}

/* TÍTULO DA COLUNA */
.dash-col-title {
    color: #fff;
    font-size: 0.65rem;
    /* Ajustado para caber nomes longos */
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 25px;
    text-align: center;
    padding: 0 4px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* CÍRCULO DE PORCENTAGEM */
.dash-col-circle {
    width: 70px;
    /* Um pouco menor que o exemplo (100px) para caber em telas móveis */
    height: 70px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* VALOR DA COLUNA */
.dash-col-value {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 10px 0;
    color: #fff;
    font-weight: 800;
    text-align: center;
    font-size: 0.85rem;
}

/* O ARCO BRANCO (Igual ao seu exemplo) */
.dash-arc-container {
    position: absolute;
    bottom: -20px;
    /* Ajuste fino para colar embaixo */
    left: 50%;
    transform: translateX(-50%);
    width: 140%;
    /* Larga para criar uma curva suave */
    height: 220px;
    background-color: #fff;
    /* A cor do fundo da página */
    /* O segredo da curva */
    border-top-left-radius: 50% 100%;
    border-top-right-radius: 50% 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 40px;
    /* Empurra o texto para baixo da curva */
    z-index: 10;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
}

.dash-total-label {
    font-weight: 800;
    font-size: 1rem;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dash-total-value {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--primary);
    /* Será sobrescrito pelo JS (verde/vermelho) */
    margin: 0;
    line-height: 1;
}

/* Ajustes para telas muito pequenas */
@media (max-width: 400px) {
    .dash-col-circle {
        width: 50px;
        height: 50px;
        font-size: 0.9rem;
    }

    .dash-total-value {
        font-size: 2.2rem;
    }
}

/* ============================================================================
   BOTÕES DE FILTRO (Laranja Inativo -> Verde Ativo)
   ============================================================================ */
.chart-switch {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 15px;
    /* Reduzi margem */
    padding: 0;
}

.switch-opt {
    flex: 1;
    padding: 10px;
    /* Reduzi altura */
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    /* ESTADO INATIVO (Laranja) */
    background: transparent;
    color: #D97706;
    /* Laranja Escuro */
    border: 2px solid #F59E0B;
    /* Laranja Claro */
    opacity: 0.7;
}

.switch-opt:hover {
    opacity: 1;
    background: #FFFBEB;
}

/* --- ESTADO ATIVO (Verde com Borda Dourada) --- */
/* Despesas (Ativo): Verde Petróleo */
.switch-opt.active-exp {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    color: #F4EBD0;
    border-color: #B45309;
    /* Borda Bronze */
    box-shadow: 0 4px 10px rgba(15, 118, 110, 0.3);
    opacity: 1;
    transform: scale(1.05);
}

/* Receitas (Ativo): Verde Esmeralda */
.switch-opt.active-inc {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    border-color: #D4AF37;
    /* Borda Dourada */
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
    opacity: 1;
    transform: scale(1.05);
}

/* ============================================================================
   GRADE DE CATEGORIAS (Cards Compactos)
   ============================================================================ */
.cat-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    /* Espaço menor entre cards */
    width: 100%;
    margin-bottom: 0;
    /* Remove margem inferior para colar no total */
}

.cat-stat-card {
    flex: 1;
    min-width: 100px;
    border-radius: 16px;
    overflow: hidden;
    color: white;
    text-align: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Cabeçalho Compacto */
.cat-stat-header {
    padding: 8px 2px 4px 2px;
    /* Reduzi padding */
    font-size: 0.65rem;
    /* Fonte menor */
    font-weight: 800;
    text-transform: uppercase;
    z-index: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Corpo Compacto */
.cat-stat-body {
    padding: 5px 0 25px 0;
    /* Bem menos espaço */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

/* Círculo Menor */
.cat-percent-circle {
    width: 45px;
    /* Reduzi de 60px */
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    /* Fonte menor */
    font-weight: 800;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Curva Ajustada */
.cat-val-separator {
    position: absolute;
    bottom: 28px;
    /* Subi para acompanhar o rodapé */
    left: -10%;
    width: 120%;
    height: 20px;
    /* Curva mais sutil */
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50% 50% 0 0;
    z-index: 1;
}

/* Rodapé Compacto */
.cat-stat-footer {
    background: rgba(0, 0, 0, 0.2);
    padding: 0 2px 8px 2px;
    font-weight: 800;
    font-size: 0.85rem;
    position: relative;
    z-index: 2;
    margin-top: auto;
}

/* ============================================================================
   SALDO GRANDE (Aproximado)
   ============================================================================ */
.big-total-section {
    position: relative;
    margin-top: 15px;
    /* Bem próximo dos cards */
    padding-top: 20px;
    text-align: center;
    z-index: 10;
}

.total-curve-bg {
    position: absolute;
    top: -20px;
    /* Sobe mais para encostar nos cards */
    left: 50%;
    transform: translateX(-50%);
    width: 140%;
    /* Arco bem largo */
    height: 80px;
    background: white;
    /* Fundo branco ou cinza claro do body */
    border-radius: 50% 50% 0 0;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.03);
    z-index: -1;
}

.total-content {
    /* Sem fundo para usar o do arco */
}

.total-label {
    font-size: 0.8rem;
    color: #9CA3AF;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: -5px;
    display: block;
}

.total-value {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    line-height: 1.1;
}

/* --- BOTÕES COMPACTOS (Modal de Conta) --- */
.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    /* 3 colunas iguais */
    gap: 8px;
    margin-top: 15px;
}

.btn-compact {
    padding: 8px 5px;
    font-size: 0.75rem;
    /* Fonte menor */
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 60px;
    /* Altura fixa menor */
    color: white;
}

.btn-compact i {
    font-size: 1.2rem;
    margin-bottom: 2px;
    font-style: normal;
}

/* Cores dos Botões */
.btn-blue {
    background: #3B82F6;
    box-shadow: 0 3px 0 #1D4ED8;
}

.btn-gray {
    background: #6B7280;
    box-shadow: 0 3px 0 #374151;
}

.btn-gold {
    background: #D4AF37;
    box-shadow: 0 3px 0 #B45309;
}

.btn-compact:active {
    transform: translateY(3px);
    box-shadow: none;
}

/* Input Moeda Destacado */
.input-currency {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
    letter-spacing: 0.5px;
}

/* ============================================================================
   NOVA BARRA DE NAVEGAÇÃO (FLUTUANTE, MENOR E CORES DO TEMA)
   ============================================================================ */
.bottom-nav {
    position: fixed;
    bottom: 25px;
    /* Flutuando acima da borda */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 380px;
    /* Largura contida */
    /* Fundo Verde Escuro (Tema) */
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    /* Borda Dourada */
    border: 1px solid var(--gold);
    /* Formato Redondo */
    border-radius: 50px;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    /* Sombra e Z-Index (Menor que Modal) */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    z-index: 900;
}

.nav-item {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: rgba(244, 235, 208, 0.5);
    /* Cor inativa */
    font-size: 0.7rem;
    font-weight: 600;
    transition: 0.3s;
}

.nav-item.active {
    color: var(--gold);
    /* Cor ativa */
    opacity: 1;
    transform: translateY(-2px);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.nav-icon {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

/* UTILITÁRIOS & TOAST */
#toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 50px;
    padding: 16px;
    position: fixed;
    z-index: 999999 !important;
    /* MAIS ALTO DE TODOS */
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
}

#toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 120px;
}

#toast.error {
    background-color: #EF4444;
}

/* Botões Compactos (Modal Conta) */
.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-top: 15px;
}

.btn-compact {
    padding: 8px 5px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 60px;
    color: white;
}

.btn-compact i {
    font-size: 1.2rem;
    margin-bottom: 2px;
    font-style: normal;
}

.btn-blue {
    background: #3B82F6;
    box-shadow: 0 3px 0 #1D4ED8;
}

.btn-gray {
    background: #6B7280;
    box-shadow: 0 3px 0 #374151;
}

.btn-gold {
    background: #D4AF37;
    box-shadow: 0 3px 0 #B45309;
}

.btn-compact:active {
    transform: translateY(3px);
    box-shadow: none;
}

/* ÍCONE SVG DE BANCO (NOVO) */
.bank-icon-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    margin-right: 12px;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
}

/* CORREÇÃO DE Z-INDEX: Força a confirmação a ficar na frente de outros modais */
#modal-confirm {
    z-index: 20000 !important;
    /* Valor bem alto para garantir */
}

#modal-alert {
    z-index: 20001 !important;
    /* Alertas também devem ficar no topo */
}

/* ============================================================================
   CORREÇÃO: BOTÕES GASTO/GANHO (Telas Pequenas)
   ============================================================================ */
/* 1. Ajuste do Container (A caixa cinza atrás dos botões) */
.type-switch {
    display: flex !important;
    flex-wrap: nowrap !important;
    /* Impede que caia para linha de baixo */
    gap: 8px !important;
    /* Cria o espaço entre os botões para não grudarem */
    padding: 5px !important;
    width: 100%;
    box-sizing: border-box;
}

/* 2. Ajuste dos Botões em si */
.switch-opt {
    flex: 1;
    /* Ocupam espaço igual */
    min-width: 0;
    /* Permite encolher se necessário */
    white-space: nowrap;
    /* Texto não quebra linha */
    padding: 10px 5px !important;
    /* Reduz o "gordo" do botão */
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 3. Regra Específica para Celulares Pequenos (ex: iPhone SE, Galaxy Mini) */
@media (max-width: 380px) {
    .switch-opt {
        padding: 8px 2px !important;
        /* Botão mais fino */
        font-size: 0.85rem !important;
        /* Letra um pouco menor */
        height: 40px;
        /* Altura fixa controlada */
    }

    .type-switch {
        margin-bottom: 15px;
        /* Menos espaço embaixo */
    }
}

/* BOTÃO DE DELETAR (ÍCONE) */
.btn-icon-trash {
    background: #FEE2E2;
    /* Vermelho bem claro */
    color: #EF4444;
    /* Vermelho vivo */
    border: 1px solid #FECACA;
    border-radius: 14px;
    width: 54px;
    /* Quadrado */
    height: 54px;
    /* Mesma altura do botão salvar */
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    flex-shrink: 0;
    /* Não deixa esmagar */
}

.btn-icon-trash:active {
    background: #FECACA;
    transform: scale(0.95);
}

/* ÍCONE DE BANCO (SVG) */
.bank-logo-small {
    width: 30px;
    height: 30px;
    object-fit: contain;
    /* Garante que o logo caiba sem distorcer */
    border-radius: 6px;
    background: transparent;
}

/* Ajuste para a lista de contas na Home */
.acc-row-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Ajuste para o ícone no histórico (substitui o quadrado colorido) */
.trans-icon.bank-img-container {
    background: transparent;
    /* Remove fundo colorido */
    border: none;
    padding: 2px;
}

.trans-icon.bank-img-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* MODAL DE EXTRATO (Lista Limpa) */
#extract-list {
    max-height: 60vh;
    overflow-y: auto;
    margin-top: 10px;
    padding: 0 5px;
}

/* Item da lista de extrato */
.extract-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    animation: fadeIn 0.3s ease;
}

.extract-date {
    font-size: 0.75rem;
    color: #9ca3af;
    display: block;
    margin-top: 3px;
}

/* BOTÃO VER EXTRATO (Mais discreto e bonito) */
.btn-outline {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #4b5563;
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-outline:active {
    background: #f3f4f6;
    transform: scale(0.98);
}

/* --- COLE NO FINAL DO STYLE.CSS --- */
/* Ajustes Exclusivos para os Botões do Modal de Editar */
#modal-form .btn-primary,
#modal-form .btn-icon-trash {
    flex: 1 !important;
    /* Faz ambos ocuparem 50% do espaço (mesma largura) */
    width: auto !important;
    /* Remove larguras fixas antigas */
    height: 40px !important;
    /* Altura reduzida para ficarem PEQUENOS */
    min-height: 0 !important;
    /* Remove altura mínima antiga */
    padding: 0 !important;
    /* Remove enchimento excessivo */
    margin: 0 !important;
    /* Remove margens extras */
    font-size: 0.9rem !important;
    /* Texto um pouco menor */
    border-radius: 10px !important;
    /* Cantos arredondados */
    border: 1px solid #D4AF37 !important;
    /* Borda Dourada Fina */
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Cores específicas */
#modal-form .btn-primary {
    background-color: #0f393b !important;
    /* Verde Petróleo */
    color: white !important;
}

#modal-form .btn-icon-trash {
    background-color: #FEF2F2 !important;
    /* Fundo Vermelho Claro */
    color: #EF4444 !important;
    /* Ícone Vermelho */
}

/* ============================================================================
   CORREÇÃO CRÍTICA: SELETOR DE BANCOS (ADICIONAR AO FINAL DO STYLE.CSS)
   ============================================================================ */
/* 1. Forçar a janela a ficar na frente de TUDO */
#modal-bank-selection {
    z-index: 99999 !important;
    align-items: center !important;
    /* Centraliza na tela */
    justify-content: center !important;
}

/* 2. Ajuste da caixa branca do modal */
#modal-bank-selection .modal-sheet {
    width: 90% !important;
    max-width: 400px !important;
    max-height: 80vh !important;
    border-radius: 20px !important;
    padding: 20px !important;
    background: #fff;
    display: flex;
    flex-direction: column;
}

/* 3. Estilo da caixa de cada banco (O item da lista) */
.bank-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 5px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    min-height: 80px;
    /* Altura mínima para ficarem iguais */
}

.bank-grid-item:active {
    transform: scale(0.95);
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

/* 4. CORREÇÃO DOS ÍCONES GIGANTES (Obrigatório) */
/* Substitui a regra .bank-grid-icon antiga por esta: */
.bank-grid-icon {
    width: 40px !important;
    height: 40px !important;
    object-fit: contain;
    margin-bottom: 8px;
    /* O SEGREDO: Fundo escuro para destacar logos brancos */
    background-color: #00000018;
    /* Cinza quase preto */
    padding: 6px;
    /* Espaço para a imagem não colar na borda */
    border-radius: 10px;
    /* Bordas arredondadas estilo App */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.059);
}

/* 5. Texto do nome do banco */
.bank-grid-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #374151;
    line-height: 1.1;
    word-break: break-word;
    /* Quebra texto longo se precisar */
}

/* 6. Ajuste da Grade (Grid) */
#bank-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    /* 3 colunas */
    gap: 10px !important;
    padding-bottom: 20px;
    padding-top: 10px;
    overflow-y: auto;
    /* Barra de rolagem se tiver muitos */
}

/* =========================================
   CORREÇÃO: DESIGN FINTECH PREMIUM (V3.1)
   ========================================= */
/* Fundo Blur - Oculto por padrão */
.modal-overlay {
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    /* <--- CORREÇÃO: Deve começar invisível */
    align-items: flex-end;
    /* Modal vem de baixo */
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 12000;
}

/* O "Papel" do Modal */
.modal-sheet {
    width: 100%;
    background: #F2F4F8;
    border-radius: 32px 32px 0 0;
    padding: 20px 24px 30px 24px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Resto dos estilos do design novo... */
.drag-handle {
    width: 48px;
    height: 5px;
    background: #D1D5DB;
    border-radius: 100px;
    margin: 0 auto 20px auto;
}

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

.type-toggle-container {
    background: #E5E7EB;
    padding: 4px;
    border-radius: 100px;
    display: flex;
    width: 200px;
}

.type-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #6B7280;
    cursor: pointer;
    transition: 0.2s;
}

.type-btn.active {
    background: #FFFFFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    color: #1F2937;
}

.theme-expense .type-btn.active {
    color: #EF4444 !important;
}

.theme-income .type-btn.active {
    color: #10B981 !important;
}

.btn-close-clean {
    background: #E5E7EB;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4B5563;
    cursor: pointer;
}

.hero-amount-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 30px;
}

.currency-prefix {
    font-size: 1.5rem;
    font-weight: 600;
    color: #9CA3AF;
    margin-top: 8px;
    margin-right: 4px;
}

.input-hero-amount {
    background: transparent;
    border: none;
    font-size: 3.5rem;
    font-weight: 800;
    color: #111827;
    width: 100%;
    text-align: center;
    outline: none;
    letter-spacing: -1.5px;
    padding: 0;
}

.input-card {
    background: #FFFFFF;
    border-radius: 16px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.input-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #FFF;
}

.border-bottom {
    border-bottom: 1px solid #F3F4F6;
}

.icon-slot {
    font-size: 1.2rem;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.clean-input {
    border: none;
    background: transparent;
    flex: 1;
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
    outline: none;
    height: 100%;
    padding: 8px 0;
}

.clean-select {
    appearance: none;
    background: transparent;
    width: 100%;
}

.extras-row {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

.toggle-pill {
    background: #E5E7EB;
    padding: 8px 16px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: 0.3s;
}

#chk-paid:checked~.pill-label {
    color: #059669;
    font-weight: 700;
}

.toggle-pill:has(#chk-paid:checked) {
    background: #D1FAE5;
}

.action-bar {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-main-action {
    flex: 1;
    background: #111827;
    color: #FFF;
    border: none;
    padding: 18px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

.theme-expense .btn-main-action {
    background: #EF4444;
    box-shadow: 0 10px 20px -5px rgba(239, 68, 68, 0.4);
}

.theme-income .btn-main-action {
    background: #10B981;
    box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.4);
}

.btn-delete-icon {
    width: 56px;
    background: #FEE2E2;
    color: #EF4444;
    border: none;
    border-radius: 20px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   DESIGN CLEAN ICON (V4.0)
   ========================================= */
/* --- Header Mais Compacto --- */
.compact-header-row {
    margin-bottom: 15px;
}

.type-toggle-mini {
    background: #E5E7EB;
    border-radius: 20px;
    padding: 3px;
    display: flex;
    gap: 2px;
}

.mini-type-btn {
    border: none;
    background: transparent;
    padding: 6px 16px;
    /* Botões menores */
    border-radius: 18px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #9CA3AF;
    cursor: pointer;
    transition: 0.2s;
}

.mini-type-btn.active {
    background: #FFF;
    color: #374151;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.theme-expense .mini-type-btn.active {
    color: #EF4444;
}

.theme-income .mini-type-btn.active {
    color: #10B981;
}

/* --- Linhas Mistas (Input + Botão) --- */
.row-split {
    display: flex;
    align-items: stretch;
}

.split-left {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 12px 16px;
}

.border-right {
    border-right: 1px solid #F3F4F6;
}

/* --- Botões de Toggle (Repetir/Pago) --- */
.split-action {
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #FAFAFA;
    transition: 0.2s;
    color: #9CA3AF;
    /* Cor inativo */
}

.split-action:active {
    background: #E5E7EB;
}

.action-icon {
    font-size: 1.2rem;
    line-height: 1;
    margin-bottom: 2px;
}

.action-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Estado Ativo (Pago/Repetir) */
.split-action.active-state {
    background: #ECFDF5;
    color: #059669;
    /* Verde para Pago */
    
}

.split-action.active-repeat {
    background: #EFF6FF;
    color: #3B82F6;
    /* Azul para Repetir */
}

/* Painel de repetição (aparece abaixo) */
.rec-opts-panel {
    text-align: center;
    padding: 10px;
    background: #EFF6FF;
    margin-top: -10px;
    margin-bottom: 16px;
    border-radius: 0 0 16px 16px;
    color: #3B82F6;
    font-size: 0.9rem;
    font-weight: 600;
    animation: slideDown 0.2s;
}

.input-times {
    width: 40px;
    border: none;
    background: #FFF;
    border-radius: 6px;
    text-align: center;
    padding: 4px;
    font-weight: 700;
    color: #3B82F6;
}

/* --- Botões de Ação Circulares --- */
.action-bar-center {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.btn-circle-action {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.btn-circle-action:active {
    transform: scale(0.9);
}

.btn-save {
    background: #1F2937;
    color: #FFF;
}

.theme-expense .btn-save {
    background: #EF4444;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.theme-income .btn-save {
    background: #10B981;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-trash {
    background: #FEE2E2;
    color: #EF4444;
    border: 2px solid #FECACA;
    box-shadow: none;
}

/* =========================================
   DESIGN SUPER APP (V5.0)
   ========================================= */
/* --- Botão Salvar NEUTRO (Pedido do Usuário) --- */
.btn-save-neutral {
    background: #111827;
    /* Preto suave */
    color: #FFF;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-save-neutral:active {
    transform: scale(0.95);
    background: #000;
}

/* --- Seletor de Fonte (Abas + Display) --- */
.source-selector-container {
    background: #FFF;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    margin-bottom: 16px;
}

.source-type-toggle {
    display: flex;
    background: #F3F4F6;
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 12px;
}

.source-tab {
    flex: 1;
    text-align: center;
    padding: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #9CA3AF;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.source-tab.active {
    background: #FFF;
    color: #374151;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.selected-source-display {
    display: flex;
    align-items: center;
    padding: 8px 4px;
    cursor: pointer;
    border-radius: 12px;
    transition: 0.2s;
}

.selected-source-display:active {
    background: #F9FAFB;
}

.source-big-icon {
    width: 42px;
    height: 42px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    background: #F3F4F6;
    border-radius: 12px;
    overflow: hidden;
}

.source-big-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.source-info-col {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.source-label {
    font-size: 0.7rem;
    color: #9CA3AF;
    font-weight: 600;
    text-transform: uppercase;
}

.source-name {
    font-size: 1rem;
    color: #1F2937;
    font-weight: 700;
}

.chevron-right {
    color: #D1D5DB;
    font-weight: bold;
    font-size: 1.2rem;
}

/* --- Grid de Seleção (Estilo iPhone) --- */
.grid-scroll-area {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 10px;
    overflow-y: auto;
}

.grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.grid-icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    /* Squircle */
    background: #FFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 6px;
    border: 1px solid #F3F4F6;
    overflow: hidden;
}

.grid-icon-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-label {
    font-size: 0.75rem;
    color: #4B5563;
    text-align: center;
    line-height: 1.1;
    font-weight: 500;
}

.add-btn-circle {
    border: 2px dashed #D1D5DB;
    color: #9CA3AF;
    box-shadow: none;
}

/* --- Stepper (Repetir) --- */
.stepper-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 5px;
}

.step-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #DBEAFE;
    background: #FFF;
    color: #3B82F6;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 0;
    padding-bottom: 4px;
    /* Ajuste visual do traço */
}

.step-btn:active {
    background: #DBEAFE;
}

.step-val-box {
    display: flex;
    align-items: baseline;
    font-size: 1.2rem;
    font-weight: 800;
    color: #1F2937;
}

.step-val-box input {
    width: 40px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: #3B82F6;
}

.step-desc {
    font-size: 0.8rem;
    color: #9CA3AF;
    margin-bottom: 10px;
}

/* Ajuste status full width */
.full-width-action {
    width: 100% !important;
    flex-direction: row !important;
    height: 45px;
    border-radius: 12px;
}

.flex-center-row {
    display: flex;
    align-items: center;
}

/* --- AJUSTES NOVO LAYOUT FORMULÁRIO --- */
/* 1. Botões de Tipo (Saída/Entrada) Maiores e Centralizados */
.type-toggle-mini.big-toggle {
    padding: 5px;
    background: #E5E7EB;
    border-radius: 16px;
    gap: 5px;
    width: auto;
    /* Deixa o conteúdo definir a largura */
}

.type-toggle-mini.big-toggle .mini-type-btn {
    padding: 10px 30px;
    /* Mais gordinhos e largos */
    font-size: 1rem;
    /* Fonte maior */
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 2. Valor Menor */
.input-hero-amount.small-amount {
    font-size: 2.5rem;
    /* Era 3.5rem */
    margin-bottom: 10px;
}

/* 3. Rodapé Compacto (Status + Salvar na mesma linha) */
.status-compact {
    flex: 1;
    /* Ocupa todo o espaço disponível */
    height: 50px;
    /* Altura do botão salvar */
    border-radius: 16px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    display: flex;
    flex-direction: row !important;
    /* Força linha */
    align-items: center;
    justify-content: center;
}

/* Estilo do botão Salvar Quadrado */
.btn-save-square {
    border-radius: 16px;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f393b;
    /* Cor primária */
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    /* Não deixa esmagar */
}

.btn-del-color {
    background: #FEE2E2;
    color: #EF4444;
    border: 1px solid #FECACA;
}

/* Ajuste visual quando 'Pago' está ativo */
.status-compact.active-state {
    background: #ECFDF5;
    color: #059669;
    border-color: #A7F3D0;
}

.btn-icon-head {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--gold);
    color: var(--gold);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    backdrop-filter: blur(5px);
}

.app-title {
    font-weight: 800;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold);
    flex: 1;
    text-align: center;
}