/* ============================================================
   ATLAS FINANCE — Nautical Premium Design System
   ============================================================ */

/* ── Design Tokens ── */
:root {
    --deep-ocean:    #0a192f;
    --navy-blue:     #172a45;
    --abyss:         #020c1b;
    --sea-mist:      #f4f7f6;
    --foam:          #ffffff;
    --gold-brass:    #c5a059;
    --gold-hover:    #e5c07b;
    --gold-dim:      rgba(197, 160, 89, 0.18);
    --emerald-sea:   #2a9d8f;
    --coral-reef:    #e63946;
    --slate:         #475569;
    --slate-light:   #94a3b8;
    --border-light:  #e2e8f0;
    --text-dark:     #1e293b;
    --card-shadow:   0 8px 32px rgba(10, 25, 47, 0.10);
    --card-shadow-lg:0 20px 60px rgba(10, 25, 47, 0.18);
    --glass-bg:      rgba(255,255,255,0.93);
    --glass-border:  rgba(197,160,89,0.35);
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--sea-mist);
    color: var(--text-dark);
    background-image:
        radial-gradient(circle at 20% 80%, rgba(42,157,143,0.04) 0%, transparent 50%),
        radial-gradient(rgba(197,160,89,0.035) 1px, transparent 0);
    background-size: 100% 100%, 24px 24px;
    min-height: 100vh;
}
/* ============================================================
   PRELOADER & TEXTAREA (CORRIGIDO PARA O TEMA DO APP)
   ============================================================ */

/* Preloader (Mantém o fundo escuro de transição antes do painel abrir) */
#preloader {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: #0a192f !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 99999 !important;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out !important;
}

.preloader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.preloader-icon {
    animation: pulseIcon 1.5s ease-in-out infinite;
}

.shimmer-text {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 4px;
    margin: 0;
    background: linear-gradient(120deg, #c5a059 35%, #ffffff 50%, #c5a059 65%);
    background-size: 200% auto;
    color: transparent !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    animation: shimmerSweep 2.5s linear infinite;
}

@keyframes shimmerSweep {
    to { background-position: 200% center; }
}

@keyframes pulseIcon {
    0% { transform: scale(1); opacity: 0.8; filter: drop-shadow(0 0 0px rgba(197, 160, 89, 0)); }
    50% { transform: scale(1.1); opacity: 1; filter: drop-shadow(0 0 15px rgba(197, 160, 89, 0.6)); }
    100% { transform: scale(1); opacity: 0.8; filter: drop-shadow(0 0 0px rgba(197, 160, 89, 0)); }
}

.preloader-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Campo de Observação - Seguindo os tokens de input/select claros do seu App */
#observation {
    width: 100%;
    padding: 0.88rem 1.1rem;
    border: 1.5px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.93rem;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-dark); /* Texto cinza escuro legível */
    background: #f8fafc;     /* Fundo cinza bem clarinho igual ao de "Descrição" */
    resize: vertical;
    min-height: 80px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    display: block;
    box-sizing: border-box;
}

/* Efeito de foco dourado idêntico aos outros inputs */
#observation:focus {
    outline: none;
    border-color: var(--gold-brass);
    box-shadow: 0 0 0 3px rgba(197,160,89,0.18);
    background: #fff;
}

#observation::placeholder {
    color: var(--slate-light);
    font-size: 0.88rem;
}

/* Texto de observação dentro do Histórico (tabela) */
.transaction-obs {
    display: block;
    font-size: 0.8rem;
    color: var(--slate-light);
    margin-top: 4px;
    font-weight: 500;
    font-style: italic;
}


/* ============================================================
   AÇÕES DO HEADER (BOTÃO DE RELATÓRIO MENSAL)
   ============================================================ */

.user-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
}

/* Botão de Relatório Premium Dourado/Latão */
.btn-report {
    background: transparent;
    border: 1px solid #c5a059; /* Cor Dourado/Latão do Atlas */
    color: #c5a059;
    padding: 0.5rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.25s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-report:hover {
    background: linear-gradient(135deg, #c5a059 0%, #b38f46 100%);
    color: #0a192f; /* Fundo escuro do dashboard para contraste */
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.25);
    transform: translateY(-1px);
}

.btn-report:active {
    transform: translateY(0);
}

.btn-report:disabled {
    border-color: #4a5568;
    color: #a0aec0;
    background: transparent;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Responsividade para telas menores */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .user-controls {
        align-items: center;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
}

.report-select {
    background-color: #0a192f;
    color: #ffffff;
    border: 1px solid #2a9d8f;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.report-select:focus {
    border-color: #e9c46a; /* Realce dourado ao focar */
}

/* Estilos para intervalo de datas (header) — ATUALIZADO (SÊNIOR UPGRADE) */
.report-range {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(10, 25, 47, 0.45);
    border: 1px solid rgba(197, 160, 89, 0.22);
    padding: 4px 10px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.report-range:focus-within {
    border-color: rgba(197, 160, 89, 0.6);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 6px 20px rgba(197, 160, 89, 0.12);
}

/* Header toggle (hamburger) for mobile — REFINADO (ESTILO PREMIUM SÊNIOR) */
.header-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(23, 42, 69, 0.4);
    border: 1px solid rgba(197, 160, 89, 0.25);
    color: #c5a059; /* Dourado/Latão do Atlas */
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-toggle:hover {
    background: rgba(197, 160, 89, 0.1);
    border-color: rgba(197, 160, 89, 0.5);
    color: #e5c07b; /* Dourado hover */
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(197, 160, 89, 0.15);
}

.header-toggle:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(197, 160, 89, 0.08);
}

/* When on small screens, collapse header-actions into a vertical panel */
@media (max-width: 900px) {
    .header-toggle { display: inline-flex; }
    .header-actions { align-items: center; }
    .header-actions .report-range,
    .header-actions .btn-report,
    .header-actions .btn-logout { display: none; }
    .header-actions.actions-open .report-range,
    .header-actions.actions-open .btn-report,
    .header-actions.actions-open .btn-logout { display: flex; }

    .header-actions .report-range { 
        flex-direction: column; 
        gap: 10px; 
        align-items: stretch; 
        background: rgba(10, 25, 47, 0.95);
        border: 1px solid rgba(197, 160, 89, 0.35);
        padding: 14px;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    }
    .header-actions .report-range input[type="date"] { width: 100% !important; }
    .header-actions .btn-range-apply, .header-actions .btn-range-clear { width: 100% !important; }
}

#report-from, #report-to {
    background-color: rgba(255, 255, 255, 0.03);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.08);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    min-width: 145px;
    backdrop-filter: blur(6px);
    color-scheme: dark; /* Sênior Touch: Força o calendário pop-up nativo em Dark Mode */
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

/* Make date inputs and header elements more compact on mobile */
@media (max-width: 480px) {
    #report-from, #report-to { padding: 8px; min-width: 0; font-size: 0.92rem; }
    .header-toggle { padding: 8px 12px; font-size: 0.95rem; }
}

#report-from:focus, #report-to:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(197,160,89,0.95);
    box-shadow: 0 4px 14px rgba(197,160,89,0.18);
    transform: translateY(-1px);
}

/* Customização refinada do ícone nativo do calendário para combinar com o tom de Latão */
#report-from::-webkit-calendar-picker-indicator,
#report-to::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 2px;
    filter: invert(72%) sepia(17%) saturate(1005%) hue-rotate(355deg) brightness(92%) contrast(85%); 
    transition: transform 0.18s ease, filter 0.18s ease;
    opacity: 0.8;
}

#report-from::-webkit-calendar-picker-indicator:hover,
#report-to::-webkit-calendar-picker-indicator:hover {
    transform: scale(1.12);
    opacity: 1;
}

#report-from::-webkit-datetime-edit-fields-wrapper,
#report-to::-webkit-datetime-edit-fields-wrapper {
    color: #fff;
}

.btn-range-apply, .btn-range-clear {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn-range-apply {
    background: linear-gradient(90deg, rgba(197,160,89,0.22), rgba(197,160,89,0.12));
    color: #fff;
    border: 1px solid rgba(197,160,89,0.4);
}

.btn-range-apply:hover { 
    background: linear-gradient(90deg, rgba(197,160,89,0.35), rgba(197,160,89,0.2));
    border-color: rgba(197,160,89,0.7);
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px rgba(197,160,89,0.2); 
}

.btn-range-clear {
    background: transparent;
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-range-clear:hover { 
    background: rgba(230, 57, 70, 0.12); /* Sutil tom vermelho náutico ao limpar filtro */
    color: #ff8585;
    border-color: rgba(230, 57, 70, 0.3);
    transform: translateY(-1px); 
}

@media (max-width: 680px) {
    #report-from, #report-to { min-width: 120px; }
    .report-range { gap: 6px; }
}
/* ── Utilities ── */
.hidden { display: none !important; }

/* ============================================================
   LOGIN & CADASTRO
   ============================================================ */

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(42,157,143,0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(197,160,89,0.08) 0%, transparent 50%),
        linear-gradient(160deg, var(--deep-ocean) 0%, var(--abyss) 60%, #061020 100%);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before,
.login-wrapper::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(197,160,89,0.06);
    animation: expand 8s ease-in-out infinite;
    pointer-events: none;
}
.login-wrapper::before { width: 700px; height: 700px; top: -250px; left: -200px; animation-delay: 0s; }
.login-wrapper::after  { width: 600px; height: 600px; bottom: -250px; right: -150px; animation-delay: 4s; }

@keyframes expand {
    0%,100% { transform: scale(1); opacity: 0.4; }
    50%      { transform: scale(1.15); opacity: 0.9; }
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 3.5rem 2.75rem;
    border-radius: 20px;
    box-shadow: var(--card-shadow-lg), inset 0 1px 0 rgba(255,255,255,0.6);
    border: 1px solid var(--glass-border);
    border-top: 4px solid var(--gold-brass);
    text-align: center;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: surfaceCard 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes surfaceCard {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.logo-compass {
    font-size: 2.8rem;
    display: inline-block;
    animation: spin 20s linear infinite;
    filter: drop-shadow(0 4px 10px rgba(197,160,89,0.35));
    margin-bottom: 0.75rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.login-title {
    font-family: 'Cinzel', serif;
    color: var(--deep-ocean);
    font-size: 1.85rem;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.login-subtitle {
    color: var(--slate);
    font-size: 0.83rem;
    margin-bottom: 2.25rem;
    line-height: 1.55;
}

.switch-text {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--slate);
}
.switch-text a {
    color: var(--gold-brass);
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
    transition: color 0.2s;
}
.switch-text a:hover { color: var(--deep-ocean); text-decoration: underline; }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */

form { display: flex; flex-direction: column; gap: 1.2rem; }

.input-group { display: flex; flex-direction: column; gap: 0.45rem; text-align: left; }

.input-group label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--slate);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

input, select {
    appearance: none;
    -webkit-appearance: none;
    padding: 0.88rem 1.1rem;
    border: 1.5px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.93rem;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-dark);
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--gold-brass);
    box-shadow: 0 0 0 3px rgba(197,160,89,0.18);
    background: #fff;
}

input::placeholder { color: var(--slate-light); font-size: 0.88rem; }

.input-group {
    position: relative;
}

.input-group:focus-within > label,
.status-group:focus-within > label {
    color: var(--deep-ocean);
}

input:hover,
select:hover,
textarea:hover {
    border-color: rgba(197,160,89,0.55);
    background: #fff;
}

input:focus,
select:focus,
textarea:focus {
    transform: translateY(-1px);
}

input[type="date"] {
    position: relative;
    color-scheme: light;
    cursor: pointer;
    padding-right: 3rem;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    width: 1.25rem;
    height: 1.25rem;
    padding: 0.35rem;
    border-radius: 8px;
    cursor: pointer;
    background-color: rgba(197,160,89,0.16);
    filter: sepia(0.35) saturate(1.4);
    transition: background 0.2s, transform 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    background-color: rgba(197,160,89,0.28);
    transform: scale(1.05);
}

.status-options {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem !important;
}

.status-option {
    position: relative;
    min-height: 56px;
    padding: 0.85rem 0.95rem;
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    background: #f8fafc;
    color: var(--slate);
    line-height: 1.35;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s, color 0.2s;
}

.status-option:hover,
.status-option:focus-within {
    transform: translateY(-1px);
    border-color: rgba(197,160,89,0.65);
    background: #fff;
    box-shadow: 0 8px 22px rgba(10,25,47,0.08);
}

.status-option input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    min-height: 100%;
}

.status-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 999px;
    flex: 0 0 auto;
    box-shadow: 0 0 0 4px rgba(148,163,184,0.12);
    transition: box-shadow 0.2s, transform 0.2s;
}

.status-paid .status-dot {
    background: var(--emerald-sea);
}

.status-pending .status-dot {
    background: var(--gold-brass);
}

.status-option:has(input:checked) {
    background: #fff;
    color: var(--deep-ocean);
    border-color: var(--gold-brass);
    box-shadow: 0 10px 28px rgba(197,160,89,0.17);
}

.status-paid:has(input:checked) {
    border-color: var(--emerald-sea);
    box-shadow: 0 10px 28px rgba(42,157,143,0.15);
}

.status-option:has(input:checked) .status-dot {
    transform: scale(1.12);
    box-shadow: 0 0 0 5px rgba(197,160,89,0.18);
}

.status-paid:has(input:checked) .status-dot {
    box-shadow: 0 0 0 5px rgba(42,157,143,0.16);
}

#future-fields,
#installment-group {
    flex-wrap: wrap;
    gap: 1rem;
}

#future-fields .input-group,
#installment-group .input-group {
    flex: 1 1 180px;
}

#future-fields.future-fields-visible,
#installment-group.installment-visible {
    animation: revealFormFields 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.btn-submit {
    margin-top: 0.4rem;
    background: linear-gradient(135deg, var(--deep-ocean) 0%, var(--navy-blue) 100%);
    color: white;
    border: 1.5px solid var(--gold-brass);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    transition: color 0.3s, box-shadow 0.3s;
    isolation: isolate;
}

.btn-submit::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--gold-brass), var(--gold-hover));
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.btn-submit:hover::after { opacity: 1; }
.btn-submit:hover {
    color: var(--deep-ocean);
    box-shadow: 0 6px 22px rgba(197,160,89,0.35);
}



/* ============================================================
   HEADER
   ============================================================ */

header {
    background: linear-gradient(135deg, var(--deep-ocean) 0%, var(--abyss) 100%);
    color: white;
    padding: 2.5rem 1.5rem 3.75rem;
    position: relative;
    border-bottom: 3px solid var(--gold-brass);
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 5% 50%, rgba(42,157,143,0.08) 0%, transparent 40%),
        radial-gradient(rgba(197,160,89,0.03) 1px, transparent 0);
    background-size: 100% 100%, 20px 20px;
    pointer-events: none;
}

header::after {
    content: '';
    position: absolute;
    bottom: 1px; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-hover), transparent);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.header-titles { text-align: left; }

header .logo-compass {
    font-size: 1.9rem;
    margin-bottom: 0.2rem;
}

header h1 {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: 2rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

header .subtitle {
    font-size: 0.75rem;
    color: var(--gold-brass);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 0.3rem;
    font-weight: 400;
}

.user-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 0.6rem; }

.greeting { font-size: 0.83rem; color: rgba(255,255,255,0.65); }
.greeting strong { color: var(--gold-hover); text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; }

.btn-logout {
    background: transparent;
    border: 1px solid var(--coral-reef);
    color: var(--coral-reef);
    padding: 0.42rem 1.1rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: all 0.25s;
}

.btn-logout:hover {
    background: var(--coral-reef);
    color: white;
    box-shadow: 0 4px 12px rgba(230,57,70,0.3);
}

/* ============================================================
   CONTAINER & SECTIONS
   ============================================================ */

.container {
    max-width: 1100px;
    margin: -2.5rem auto 5rem;
    padding: 0 1.5rem;
    position: relative;
    z-index: 10;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.card {
    background: white;
    padding: 1.85rem 1.5rem;
    border-radius: 14px;
    text-align: center;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(197,160,89,0.1);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% -10%, rgba(197,160,89,0.05), transparent 70%);
    pointer-events: none;
}

.card:hover { transform: translateY(-6px); box-shadow: var(--card-shadow-lg); }

.card-indicator {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    border-radius: 14px 14px 0 0;
}

.card h3 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--slate-light);
    margin-bottom: 0.85rem;
    font-weight: 700;
}

.card p {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.income p                { color: var(--emerald-sea); }
.income .card-indicator  { background: linear-gradient(90deg, var(--emerald-sea), #52c7b8); }

.expense p               { color: var(--coral-reef); }
.expense .card-indicator { background: linear-gradient(90deg, var(--coral-reef), #f97082); }

.balance                 { border: 1px solid var(--gold-brass); }
.balance p               { color: var(--deep-ocean); }
.balance .card-indicator { background: linear-gradient(90deg, var(--gold-brass), var(--gold-hover)); }

.main-content {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

section {
    background: white;
    padding: 2rem 2rem 2.25rem;
    border-radius: 14px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0,0,0,0.025);
}

section h2 {
    font-family: 'Cinzel', serif;
    margin-bottom: 1.75rem;
    font-size: 1.1rem;
    color: var(--deep-ocean);
    letter-spacing: 1.5px;
    padding-bottom: 0.85rem;
    position: relative;
    border-bottom: 1px solid var(--border-light);
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0;
    width: 48px; height: 2px;
    background: linear-gradient(90deg, var(--gold-brass), var(--gold-hover));
    border-radius: 2px;
}

/* ============================================================
   CHART
   ============================================================ */

.chart-container { position: relative; margin: 0 auto; width: 100%; max-width: 255px; }

/* ============================================================
   TABLE
   ============================================================ */

.table-wrapper { overflow-x: auto; }

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

th, td { padding: 1rem 1rem; text-align: left; font-size: 0.9rem; border-bottom: 1px solid #f1f5f9; }

th {
    background: rgba(10,25,47,0.03);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 1.3px;
    color: var(--slate-light);
    border-bottom: 2px solid var(--border-light);
}

tbody tr { transition: background 0.15s; }
tbody tr:hover td { background: rgba(197,160,89,0.04); }

.type-income  { color: var(--emerald-sea); font-weight: 700; }
.type-expense { color: var(--coral-reef);  font-weight: 700; }

.badge-category {
    display: inline-block;
    background: rgba(10,25,47,0.055);
    color: var(--slate);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 0.22rem 0.7rem;
    border-radius: 20px;
    text-transform: uppercase;
}

.btn-delete {
    background: none;
    border: none;
    color: var(--slate-light);
    cursor: pointer;
    padding: 0.45rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: rgba(230,57,70,0.08);
    color: var(--coral-reef);
    transform: scale(1.2);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
    .summary-cards { grid-template-columns: 1fr 1fr; }
    .main-content  { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .summary-cards  { grid-template-columns: 1fr; }
    .header-content { flex-direction: column; text-align: center; gap: 1.5rem; }
    .header-titles  { text-align: center; }
    .user-controls  { align-items: center; }
    header h1       { font-size: 1.6rem; }
    .login-card     { padding: 2.5rem 1.75rem; }
    .login-title    { font-size: 1.55rem; }
    .container      { padding: 0 1rem; }
}

/* ============================================================
   SMART INSIGHTS & LIVE SEARCH
   ============================================================ */

.insights-container {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    animation: surfaceCard 0.6s ease forwards;
}

.insight-card {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--gold-brass);
    border-radius: 10px;
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.insight-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-lg);
}

.insight-icon {
    font-size: 1.8rem;
    background: rgba(10, 25, 47, 0.05);
    padding: 0.5rem;
    border-radius: 8px;
}

.insight-info h4 {
    font-size: 0.75rem;
    color: var(--slate);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
}

.insight-info p {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--deep-ocean);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.history-header h2 {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.history-header h2::after {
    display: none;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 350px;
}

.search-wrapper .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--slate-light);
    pointer-events: none;
}

.search-wrapper input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.search-wrapper input:focus {
    background: #fff;
    border-color: var(--gold-brass);
    box-shadow: 0 0 0 4px rgba(197, 160, 89, 0.1);
    outline: none;
}

@media (max-width: 768px) {
    .insights-container {
        flex-direction: column;
    }
    .search-wrapper {
        max-width: 100%;
    }
}

/* ============================================================
   NOTIFICATION CENTER & ALERTS
   ============================================================ */
#alerts-container {
    /* Desktop: painel lateral fixo à esquerda, fora do fluxo */
    position: fixed;
    top: 50%;
    left: 1.25rem;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 280px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 0.25rem 0.25rem 0.25rem 0;
}

/* Scrollbar fina estilizada */
#alerts-container::-webkit-scrollbar { width: 4px; }
#alerts-container::-webkit-scrollbar-track { background: transparent; }
#alerts-container::-webkit-scrollbar-thumb { background: var(--gold-brass); border-radius: 4px; }

.atlas-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
    border-left: 5px solid transparent;
    animation: slideInFromLeft 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes slideInFromLeft {
    from { opacity: 0; transform: translateX(-24px); }
    to   { opacity: 1; transform: translateX(0); }
}

.alert-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-left: 1rem;
}

.alert-content strong {
    font-size: 0.9rem;
    color: var(--deep-ocean);
}

.alert-content span {
    font-size: 0.8rem;
    color: var(--slate);
    margin-top: 0.2rem;
}

/* Cores de Urgência */
.alert-danger  { border-left-color: var(--coral-reef); background: rgba(230, 57, 70, 0.05); }
.alert-warning { border-left-color: var(--gold-brass); background: rgba(197, 160, 89, 0.05); }
.alert-info    { border-left-color: var(--emerald-sea); }

.btn-mark-paid {
    background: transparent;
    border: 1px solid var(--emerald-sea);
    color: var(--emerald-sea);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-mark-paid:hover {
    background: var(--emerald-sea);
    color: #fff;
}

/* ============================================================
   CAIXA DE SALDO FUTURO (PENDÊNCIAS)
   ============================================================ */
#future-balance-container {
    margin-top: 0.8rem;
    padding: 0.4rem 0.8rem;
    background: rgba(197, 160, 89, 0.1); /* Usa o seu var(--gold-dim) */
    border: 1px solid rgba(197, 160, 89, 0.3);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--gold-brass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#future-balance-container strong {
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.future-balance-hidden {
    display: none !important;
    opacity: 0;
    transform: translateY(-10px);
}

/* ============================================================
   ATLAS FINANCE — Estilos dos Novos Módulos (features.js)
   ============================================================ */

/* ── Seções de dashboard genéricas ── */
.dashboard-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s ease;
}
.dashboard-section:hover {
    box-shadow: var(--card-shadow-lg);
}

/* ── Gráfico de tendência ── */
#trend-chart-container {
    height: 220px;
    position: relative;
}

/* ── Orçamentos ── */
#budget-panel {
    overflow: hidden;
}
.budget-bar-item + .budget-bar-item {
    border-top: 1px solid rgba(0,0,0,0.04);
    padding-top: 0.75rem;
}

.budget-category-name {
    color: var(--text-dark) !important;
    font-weight: 600 !important;
}

.budget-category-value {
    color: var(--slate-light) !important;
}

/* ── Metas ── */
#goals-panel {
    overflow: hidden;
}
.goal-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 12px 32px rgba(10,25,47,0.12) !important;
}

/* ── Botão dark mode no header ── */
#btn-dark-toggle {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

/* ── Painel de atalhos ── */
#kbd-hint-panel {
    transition: opacity 0.3s ease;
}
#kbd-hint-panel:hover {
    box-shadow: 0 12px 40px rgba(10,25,47,0.18);
}
.kbd-hint {
    background: var(--sea-mist);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.68rem;
    font-family: monospace;
    color: var(--text-dark);
}

/* ── Importação CSV drop zone ── */
#csv-drop-zone:hover {
    border-color: #2a9d8f !important;
    background: rgba(42,157,143,0.05) !important;
}

/* ── Skeleton animado ── */
.skeleton-row td {
    padding: 12px 16px !important;
}

/* ── Transições suaves de página ── */
#app-view {
    animation: fadeInApp 0.5s ease both;
}
@keyframes fadeInApp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Cards de insights com hover ── */
.insights-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.insight-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--card-shadow);
    cursor: default;
}

/* ============================================================
   ATLAS FINANCE — Cartões de Crédito (cards.js)
   ============================================================ */

/* ── Painel de cartões ── */
#cards-panel { overflow: hidden; }

.cards-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    gap: 10px;
}
.cards-panel-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.cards-panel-subtitle {
    font-size: 0.7rem;
    color: var(--slate-light);
    font-weight: 400;
    font-family: 'Montserrat', sans-serif;
}

.btn-gold-outline {
    padding: 7px 14px;
    border-radius: 6px;
    border: 1px solid var(--gold-brass);
    background: transparent;
    color: var(--gold-brass);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-gold-outline:hover { background: rgba(197,160,89,0.12); }

.cards-empty-state {
    color: var(--slate-light);
    font-size: 0.85rem;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
    padding: 1.5rem 0;
}

/* ── Grade de cartões ── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.2rem;
}

/* ── Cartão visual (estilo cartão físico) ── */
.atlas-card {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(10,25,47,0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background: var(--glass-bg);
}
.atlas-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(10,25,47,0.24);
}

.atlas-card-face {
    padding: 1.1rem 1.2rem;
    color: #fff;
    position: relative;
    min-height: 118px;
    background-size: cover;
}
.atlas-card-face::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% -10%, rgba(255,255,255,0.18), transparent 55%);
    pointer-events: none;
}
.atlas-card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    z-index: 1;
}
.atlas-card-brand {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.atlas-card-number {
    margin: 1.1rem 0 0.2rem;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 3px;
    font-size: 1rem;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.atlas-card-nickname {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem;
    opacity: 0.92;
    position: relative;
    z-index: 1;
}

.btn-card-remove {
    background: rgba(255,255,255,0.18);
    border: none;
    color: #fff;
    border-radius: 6px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-size: 0.78rem;
    transition: background 0.2s ease;
    position: relative;
    z-index: 1;
}
.btn-card-remove:hover { background: rgba(255,255,255,0.32); }

/* ── Corpo (verso informativo) do cartão ── */
.atlas-card-body {
    background: var(--glass-bg);
    padding: 1rem 1.2rem 1.15rem;
}
.atlas-card-meta-row {
    display: flex;
    justify-content: space-between;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    color: var(--slate-light);
    margin-bottom: 0.5rem;
}
.atlas-card-progress-track {
    height: 6px;
    background: var(--border-light);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 0.6rem;
}
.atlas-card-progress-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--gold-brass);
    transition: width 0.6s ease;
}
.atlas-card-progress-fill.is-high { background: #e63946; }

.atlas-card-usage {
    margin: 0 0 0.9rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    color: var(--text-dark);
}

.atlas-card-actions { display: flex; gap: 8px; }

.btn-card-action {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}
.btn-card-action.primary {
    background: linear-gradient(135deg, #c5a059, #b38f46);
    color: #0a192f;
}
.btn-card-action.primary:hover { filter: brightness(1.05); }
.btn-card-action.outline {
    background: transparent;
    color: var(--gold-brass);
    border: 1px solid var(--gold-brass);
}
.btn-card-action.outline:hover { background: rgba(197,160,89,0.1); }

/* ── Preview de simulação de compra ── */
.sim-preview-box {
    margin-bottom: 1.2rem;
    padding: 0.8rem;
    border-radius: 8px;
    background: rgba(42,157,143,0.08);
    border: 1px dashed var(--emerald-sea);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem;
    color: var(--text-dark);
    line-height: 1.5;
}

/* ── Lista de projeção de faturas ── */
.invoice-cycles-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.invoice-cycle {
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 0.8rem 1rem;
}
.invoice-cycle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.invoice-cycle-header.has-items { margin-bottom: 0.5rem; }
.invoice-cycle-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    color: var(--text-dark);
}
.invoice-cycle-total {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--slate-light);
}
.invoice-cycle-total.has-total { color: var(--gold-brass); }
.invoice-item-row {
    display: flex;
    justify-content: space-between;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    color: var(--slate-light);
    padding: 2px 0;
}

/* ── Modal genérico (form de cartão / simulação) ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2,10,25,0.75);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInOverlay 0.25s ease;
    padding: 1rem;
}
.modal-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0,0,0,0.25);
    animation: slideUpModal 0.3s cubic-bezier(0.22,1,0.36,1);
}
.modal-box.accent-gold   { border-top: 3px solid var(--gold-brass); }
.modal-box.accent-teal   { border-top: 3px solid var(--emerald-sea); }
.modal-box h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    margin-bottom: 1.2rem;
    color: var(--gold-brass);
}
.modal-box.accent-teal h3 { color: var(--emerald-sea); }

.modal-field { margin-bottom: 0.9rem; }
.modal-field label {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
    display: block;
    margin-bottom: 5px;
}
.modal-field input,
.modal-field select {
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1.5px solid var(--border-light);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    background: #f8fafc;
    color: var(--text-dark);
}
.modal-row { display: flex; gap: 10px; }
.modal-row .modal-field { flex: 1; }

.modal-actions { display: flex; gap: 10px; margin-top: 1.1rem; }
.btn-modal-primary {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #c5a059, #b38f46);
    color: #0a192f;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s ease;
}
.btn-modal-primary:hover { filter: brightness(1.05); }
.btn-modal-primary.teal {
    background: linear-gradient(135deg, #2a9d8f, #1f7d70);
    color: #fff;
}
.btn-modal-secondary {
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: transparent;
    color: var(--slate);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease;
}
.btn-modal-secondary:hover { background: rgba(0,0,0,0.03); }

@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUpModal {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Responsividade — Cartões ── */
@media (max-width: 600px) {
    .cards-grid { grid-template-columns: 1fr; }
    .modal-box { padding: 1.5rem; max-width: 100%; }
    .modal-row { flex-direction: column; gap: 0; }
}

/* ── Scrollbar estilizada ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(197,160,89,0.35);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(197,160,89,0.6);
}

/* ── Responsividade para mobile ── */
@media (max-width: 600px) {
    #kbd-hint-panel { display: none; }
    .insights-container { grid-template-columns: 1fr; }
    #goals-panel .goal-card { min-width: 100% !important; }
}

/* ── Print: oculta controles ── */
@media print {
    #kbd-hint-panel,
    #btn-dark-toggle,
    #btn-import-csv,
    .btn-logout { display: none !important; }
}

/* ============================================================
   MOBILE UX PASS — telas folgadas e sem estouro horizontal
   ============================================================ */

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

button,
input,
select,
textarea {
    max-width: 100%;
}

.input-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

#transaction-form input[type="radio"] {
    min-height: auto;
    width: auto;
    flex: 0 0 auto;
    accent-color: var(--gold-brass);
}

.chart-container canvas {
    max-width: 100%;
}

@media (max-width: 900px) {
    header {
        padding-bottom: 3rem;
    }

    .container {
        margin-bottom: 3.5rem;
    }

    .summary-cards {
        gap: 1rem;
    }

    section,
    .dashboard-section {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    body {
        background-size: 100% 100%, 18px 18px;
    }

    #preloader {
        min-height: 100svh !important;
        height: 100svh !important;
        padding: 1.25rem;
    }

    .shimmer-text {
        font-size: clamp(1.45rem, 8vw, 2.1rem);
        letter-spacing: 0.16em;
        text-align: center;
        overflow-wrap: anywhere;
    }

    .login-wrapper {
        min-height: 100svh;
        align-items: flex-start;
        padding: max(1.25rem, env(safe-area-inset-top)) 1rem max(1.5rem, env(safe-area-inset-bottom));
        overflow-y: auto;
    }

    .login-wrapper::before {
        width: 420px;
        height: 420px;
        top: -180px;
        left: -220px;
    }

    .login-wrapper::after {
        width: 360px;
        height: 360px;
        right: -190px;
        bottom: -160px;
    }

    .login-card {
        width: min(100%, 460px);
        margin: auto 0;
        padding: clamp(1.65rem, 7vw, 2.35rem) clamp(1.15rem, 5.5vw, 1.75rem);
        border-radius: 16px;
    }

    .logo-compass {
        font-size: 2.35rem;
        margin-bottom: 0.55rem;
    }

    .login-title {
        font-size: clamp(1.32rem, 7vw, 1.7rem);
        letter-spacing: 0.12em;
        line-height: 1.18;
    }

    .login-subtitle {
        margin-bottom: 1.65rem;
        font-size: 0.9rem;
    }

    form {
        gap: 1rem;
    }

    .input-group {
        gap: 0.5rem;
    }

    .input-group label {
        line-height: 1.35;
        letter-spacing: 0.05em;
    }

    input,
    select,
    textarea,
    .btn-submit {
        width: 100%;
        min-height: 48px;
        font-size: 16px;
    }

    input,
    select,
    #observation {
        padding: 0.9rem 1rem;
    }

    .btn-submit {
        padding: 0.95rem 1rem;
        white-space: normal;
        line-height: 1.25;
    }

    .switch-text {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
        margin-top: 1.15rem;
        line-height: 1.45;
    }

    .switch-text a {
        margin-left: 0;
    }

    header {
        padding: 1.5rem 1rem 2.75rem;
    }

    .header-content {
        width: 100%;
        gap: 1.25rem;
    }

    header h1 {
        font-size: clamp(1.35rem, 7vw, 1.8rem);
        letter-spacing: 0.12em;
        line-height: 1.15;
        overflow-wrap: anywhere;
    }

    header .subtitle {
        font-size: 0.7rem;
        letter-spacing: 0.18em;
    }

    .user-controls,
    .header-actions {
        width: 100%;
    }

    .greeting {
        justify-content: center;
        flex-wrap: wrap;
        line-height: 1.45;
    }

    .header-actions,
    .header-actions[style] {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 0.65rem !important;
    }

    .header-actions > *,
    .header-actions button,
    .header-actions select,
    #btn-download-pdf,
    #btn-export-excel,
    #btn-import-csv,
    .btn-logout,
    .report-select {
        width: 100% !important;
        min-height: 46px;
        justify-content: center;
        text-align: center;
        white-space: normal;
    }

    .container {
        width: 100%;
        margin: -1.8rem auto 3rem;
        padding: 0 1rem;
    }

    .summary-cards {
        grid-template-columns: 1fr;
        gap: 0.9rem;
        margin-bottom: 1.25rem;
    }

    .card {
        padding: 1.35rem 1.15rem;
        border-radius: 12px;
    }

    .card p {
        font-size: clamp(1.32rem, 8vw, 1.65rem);
        letter-spacing: 0;
        overflow-wrap: anywhere;
    }

    .insights-container {
        gap: 0.85rem;
        margin-bottom: 1.25rem;
    }

    .insight-card {
        padding: 1rem;
        align-items: flex-start;
    }

    .main-content {
        grid-template-columns: 1fr; /* Transforma as duas colunas do PC em uma única coluna no celular */
        gap: 1rem;
        margin-bottom: 1.25rem;
    }

    section,
    .dashboard-section {
        border-radius: 12px;
        padding: 1.25rem;
    }

    section h2 {
        font-size: 1rem;
        line-height: 1.3;
        margin-bottom: 1.2rem;
    }

    .input-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    #transaction-form .input-group[style] {
        margin-top: 0.25rem !important;
        margin-bottom: 0.9rem !important;
    }

    #transaction-form .input-group > div[style*="display: flex"]:not(.status-options) {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 0.75rem !important;
        align-items: stretch !important;
    }

    #transaction-form .input-group > div[style*="display: flex"]:not(.status-options) label {
        min-height: 44px;
        padding: 0.75rem 0.85rem;
        border: 1px solid var(--border-light);
        border-radius: 10px;
        background: #f8fafc;
        line-height: 1.35;
    }

    .status-options {
        grid-template-columns: 1fr;
        gap: 0.75rem !important;
    }

    .status-option {
        min-height: 58px;
        padding: 0.9rem;
    }

    #future-fields,
    #installment-group {
        flex-direction: column !important;
        gap: 1rem;
    }

    #future-fields .input-group,
    #installment-group .input-group {
        flex: 0 1 auto;
    }

    .chart-container {
        max-width: min(255px, 72vw);
    }

    .history-header {
        align-items: stretch;
        gap: 1rem;
    }

    .history-header h2 {
        width: 100%;
        line-height: 1.3;
    }

    .search-wrapper {
        max-width: none;
    }

    .history-section {
        padding-left: 1rem;
        padding-right: 1rem;
        display: block
    }

    .table-wrapper {
        overflow: visible;
    }

    #transaction-table,
    #transaction-table thead,
    #transaction-table tbody,
    #transaction-table th,
    #transaction-table td,
    #transaction-table tr {
        display: block;
        width: 100%;
    }

    #transaction-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    #transaction-table tbody {
        display: grid;
        gap: 0.85rem;
    }

    #transaction-table tbody tr {
        border: 1px solid var(--border-light);
        border-radius: 12px;
        background: #fff;
        color: #1e293b; /* ◄ ADICIONE ISSO: Força o texto a ficar escuro no celular */
        box-shadow: 0 8px 24px rgba(10,25,47,0.08);
        overflow: hidden;
    }

    #transaction-table tbody td {
        display: grid;
        grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
        gap: 0.75rem;
        align-items: center;
        padding: 0.85rem 1rem;
        border-bottom: 1px solid #edf2f7;
        font-size: 0.88rem;
        line-height: 1.45;
        word-break: break-word;
    }

    #transaction-table tbody td:last-child {
        border-bottom: 0;
    }

        #transaction-table tbody td::before {
            color: #64748b; /* ◄ ADICIONE/SUBSTITUA ISSO: Um cinza escuro para os títulos dos cards */
            font-size: 0.68rem;
            font-weight: 800;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }

    #transaction-table tbody td:nth-child(1)::before { content: "Descricao"; }
    #transaction-table tbody td:nth-child(2)::before { content: "Categoria"; }
    #transaction-table tbody td:nth-child(3)::before { content: "Valor"; }
    #transaction-table tbody td:nth-child(4)::before { content: "Natureza"; }
    #transaction-table tbody td:nth-child(5)::before { content: "Acao"; }

    #transaction-table .action-cell {
        text-align: left !important;
    }

    #transaction-table .action-cell .btn-delete,
    #transaction-table .action-cell .btn-mark-paid {
        width: 100% !important;
        min-height: 42px;
    }

    .badge-category {
        width: fit-content;
        max-width: 100%;
        white-space: normal;
        border-radius: 8px;
    }

    /* ── Alertas no mobile: banner inline horizontal com scroll ── */
    #alerts-container {
        position: static !important;
        top: auto; left: auto; right: auto; bottom: auto;
        transform: none !important;
        width: 100%;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.75rem;
        padding: 0.25rem 0;
        margin-bottom: 1.25rem;
        /* Oculta scrollbar mas permite scroll */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    #alerts-container::-webkit-scrollbar { display: none; }

    .atlas-alert {
        /* Card compacto com largura fixa para o carrossel horizontal */
        min-width: 260px;
        max-width: 260px;
        flex-shrink: 0;
        align-items: flex-start;
        gap: 0.6rem;
        padding: 0.75rem 0.9rem;
        border-radius: 12px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    }

    .alert-content {
        margin-left: 0;
    }

    #toast-container {
        top: auto !important;
        right: 1rem !important;
        left: 1rem !important;
        bottom: calc(1rem + env(safe-area-inset-bottom)) !important;
        transform: none !important;
        max-height: 50vh !important;
    }

    #toast-container > div {
        max-width: none !important;
        width: 100%;
        line-height: 1.4;
    }
}

@media (max-width: 420px) {
    .login-wrapper {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .login-card {
        padding: 1.45rem 1rem;
    }

    .container {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    section,
    .dashboard-section,
    .history-section {
        padding: 1rem;
    }

    .card {
        padding: 1.15rem 1rem;
    }

    #transaction-table tbody td {
        grid-template-columns: 1fr;
        gap: 0.35rem;
        padding: 0.85rem;
    }
}

/* ============================================================
   ESTILIZAÇÃO DO MODAL DE METAS FINANCEIRAS (DEPÓSITO)
   ============================================================ */

.quick-deposit-btn {
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.quick-deposit-btn:hover {
    background: rgba(42, 157, 143, 0.15) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 157, 143, 0.2);
}

.quick-deposit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(42, 157, 143, 0.15);
}

#btn-deposit-confirm:hover {
    background: linear-gradient(135deg, #249078, #1a5f53) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(42, 157, 143, 0.4) !important;
}

#btn-deposit-confirm:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(42, 157, 143, 0.2) !important;
}

#deposit-amount {
    transition: all 0.2s ease;
}

#deposit-amount::placeholder {
    color: var(--slate-light);
}

#goal-target::placeholder {
    color: var(--slate-light);
}

#deposit-preview,
#goal-target-preview {
    animation: slideDownPreview 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

#deposit-new-balance,
#target-preview-value {
    display: inline-block;
    animation: updateBalance 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

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

@keyframes updateBalance {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}