:root {
    /* Cores Light Mode */
    --bg-color: #f3f4f6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --primary-color: #2563eb;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-color: #111827;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --glass-bg: rgba(31, 41, 55, 0.7);
    --glass-border: rgba(55, 65, 81, 0.5);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    padding-bottom: 80px; /* Espaço para a bottom nav */
}

a { color: var(--primary-color); text-decoration: none; }

/* Glassmorphism Classes */
.glass-panel, .glass-card, .glass-header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.glass-card { border-radius: 16px; padding: 16px; margin-bottom: 16px; }

/* Auth Views */
.auth-container {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; padding: 20px;
}
.auth-container .glass-panel { padding: 30px; border-radius: 20px; width: 100%; max-width: 400px; }
.auth-container h2 { margin-bottom: 20px; text-align: center; }

/* Forms */
.input-group { margin-bottom: 15px; }
.input-group-row { display: flex; gap: 10px; margin-bottom: 15px; }
.input-group.half { width: 50%; margin-bottom: 0; }
label { display: block; margin-bottom: 5px; font-size: 14px; color: var(--text-secondary); }
input, select {
    width: 100%; padding: 12px; border-radius: 8px;
    border: 1px solid var(--text-secondary);
    background: transparent; color: var(--text-primary);
    outline: none;
}
input:focus, select:focus { border-color: var(--primary-color); }
.password-wrapper { position: relative; }
.toggle-password { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; }

/* Buttons */
.btn-primary {
    background: var(--primary-color); color: white; border: none;
    padding: 12px 20px; border-radius: 8px; font-weight: 600; cursor: pointer;
    transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.9; }
.w-100 { width: 100%; }

/* App Header */
.app-header { position: sticky; top: 0; z-index: 10; padding: 15px 20px; }
.header-content { display: flex; justify-content: space-between; align-items: center; max-width: 800px; margin: 0 auto; }
.workspace-selector select { padding: 5px 10px; border: none; font-weight: bold; background: transparent; cursor: pointer; }
.user-profile { display: flex; align-items: center; gap: 10px; }
.avatar-circle { width: 32px; height: 32px; border-radius: 50%; background: #ddd; background-size: cover; background-position: center; }
.btn-icon { background: none; border: none; font-size: 20px; cursor: pointer; }

/* Dashboard Content */
.app-content { max-width: 800px; margin: 0 auto; padding: 20px; }
.month-selector { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.month-selector button { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-primary); }

.summary-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.summary-cards span { font-size: 14px; color: var(--text-secondary); }
.summary-cards h2, .summary-cards h3 { margin-top: 5px; }
.balance-card h2 { color: var(--primary-color); }
.proj-balance-card h3 { color: var(--text-secondary); }

/* Budget Bar */
.budget-container { margin-bottom: 20px; }
.budget-labels { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px; }
.progress-bar-bg { width: 100%; height: 8px; background: #ddd; border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; width: 0%; transition: width 0.3s, background-color 0.3s; }
.budget-green { background-color: var(--success-color); }
.budget-yellow { background-color: var(--warning-color); }
.budget-red { background-color: var(--danger-color); }

/* Filters */
.filters { display: flex; gap: 10px; margin-bottom: 15px; overflow-x: auto; padding-bottom: 5px; }
.filter-btn { padding: 6px 12px; border-radius: 20px; border: 1px solid var(--text-secondary); background: transparent; color: var(--text-primary); cursor: pointer; white-space: nowrap; }
.filter-btn.active { background: var(--primary-color); color: white; border-color: var(--primary-color); }

/* Transaction List & Cards */
.transaction-card {
    display: flex; align-items: center; justify-content: space-between;
    position: relative; overflow: hidden;
}
.tx-left { display: flex; align-items: center; gap: 15px; }
.tx-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; }
.tx-info h4 { margin: 0; font-size: 16px; }
.tx-info p { margin: 0; font-size: 12px; color: var(--text-secondary); }
.tx-right { text-align: right; }
.tx-amount { font-weight: bold; font-size: 16px; }
.tx-status { font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.status-paid { background: #d1fae5; color: #065f46; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-overdue { background: #fee2e2; color: #991b1b; }
.status-future { background: #e0e7ff; color: #3730a3; }
.amount-income { color: var(--success-color); }
.amount-expense { color: var(--text-primary); }

/* Swipe Actions */
.tx-actions {
    position: absolute; right: 0; top: 0; height: 100%;
    display: flex; transform: translateX(100%); transition: transform 0.3s;
}
.transaction-card.swiped .tx-actions { transform: translateX(0); }
.btn-edit, .btn-delete { border: none; color: white; padding: 0 15px; cursor: pointer; }
.btn-edit { background: var(--warning-color); }
.btn-delete { background: var(--danger-color); }

/* Bottom Nav */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 70px;
    background: var(--glass-bg); backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    display: flex; justify-content: space-around; align-items: center; z-index: 100;
}
.nav-item { background: none; border: none; display: flex; flex-direction: column; align-items: center; color: var(--text-secondary); cursor: pointer; }
.nav-item.active { color: var(--primary-color); }
.nav-item .icon { font-size: 24px; margin-bottom: 2px; }
.nav-item span:not(.icon) { font-size: 12px; }

/* FAB */
.fab-container { transform: translateY(-20px); }
.fab {
    width: 60px; height: 60px; border-radius: 50%;
    background: var(--primary-color); color: white;
    border: none; font-size: 30px; line-height: 1;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4); cursor: pointer;
}

/* Bottom Sheet */
.bottom-sheet { position: fixed; inset: 0; z-index: 200; display: none; }
.bottom-sheet.open { display: block; }
.sheet-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); opacity: 0; transition: opacity 0.3s; }
.bottom-sheet.open .sheet-overlay { opacity: 1; }
.sheet-content {
    position: absolute; bottom: 0; left: 0; width: 100%;
    border-radius: 20px 20px 0 0; padding: 20px;
    transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.1, 0.8, 0.2, 1);
}
.bottom-sheet.open .sheet-content { transform: translateY(0); }
.sheet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.btn-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-primary); }

/* Toggle tipo tx */
.tx-type-selector { display: flex; gap: 10px; margin-bottom: 15px; }
.radio-btn {
    flex: 1; text-align: center; padding: 10px; border: 1px solid var(--text-secondary);
    border-radius: 8px; cursor: pointer; color: var(--text-primary);
}
.radio-btn input { display: none; }
.radio-btn:has(input:checked) { background: var(--primary-color); color: white; border-color: var(--primary-color); }

/* Skeleton Loader */
.skeleton-container { display: none; }
.skeleton { background: #e2e8f0; border-radius: 8px; animation: pulse 1.5s infinite; }
.skeleton-card { height: 70px; margin-bottom: 15px; }
@keyframes pulse { 0% { opacity: 0.6; } 50% { opacity: 0.3; } 100% { opacity: 0.6; } }

/* Toasts */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; }
.toast { background: var(--text-primary); color: var(--bg-color); padding: 12px 20px; border-radius: 8px; margin-bottom: 10px; box-shadow: var(--shadow); opacity: 0; transform: translateY(-20px); transition: all 0.3s; }
.toast.show { opacity: 1; transform: translateY(0); }
