:root {
    --primary: #1a73e8; --primary-dark: #1557b0; --primary-light: #4da3ff;
    --secondary: #0d47a1; --accent: #00bcd4;
    --success: #28a745; --danger: #dc3545; --warning: #ffc107; --info: #17a2b8;
    --bg-body: #f0f2f5; --bg-card: #ffffff; --bg-sidebar: #1a237e;
    --bg-sidebar-hover: #283593; --bg-header: #ffffff; --bg-table-header: #2e5b3e;
    --bg-table-header-revenue: #c5cae9; --bg-table-header-expense: #fff3cd;
    --bg-table-row-alt: #f8f9fa; --bg-input: #ffffff; --bg-modal: #ffffff;
    --text-primary: #212529; --text-secondary: #6c757d; --text-sidebar: #ffffff;
    --text-header: #1a237e; --text-table-header: #ffffff; --text-muted: #adb5bd;
    --text-input: #212529;
    --border-color: #dee2e6; --border-light: #e9ecef;
    --shadow: 0 2px 10px rgba(0,0,0,0.08); --shadow-hover: 0 4px 20px rgba(0,0,0,0.12);
    --revenue-color: #28a745; --expense-color: #dc3545;
    --balance-positive: #28a745; --balance-negative: #dc3545;
    --sidebar-width: 260px; --header-height: 60px; --transition: all 0.3s ease;
}
[data-theme="dark"] {
    --bg-body: #121212; --bg-card: #1e1e1e; --bg-sidebar: #0d1117;
    --bg-sidebar-hover: #161b22; --bg-header: #1e1e1e; --bg-table-header: #1b3a2a;
    --bg-table-header-revenue: #1b3a2a; --bg-table-header-expense: #3a2a1b;
    --bg-table-row-alt: #252525; --bg-input: #2d2d2d; --bg-modal: #2d2d2d;
    --text-primary: #e0e0e0; --text-secondary: #aaaaaa; --text-sidebar: #c9d1d9;
    --text-header: #58a6ff; --text-table-header: #e0e0e0; --text-muted: #666666;
    --text-input: #e0e0e0;
    --border-color: #333333; --border-light: #2d2d2d;
    --shadow: 0 2px 10px rgba(0,0,0,0.3); --shadow-hover: 0 4px 20px rgba(0,0,0,0.5);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Segoe UI", Tahoma, sans-serif; background: var(--bg-body); color: var(--text-primary); min-height: 100vh; transition: var(--transition); }
.sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-width); height: 100vh; background: var(--bg-sidebar); color: var(--text-sidebar); z-index: 1000; transition: var(--transition); overflow-y: auto; display: flex; flex-direction: column; }
.sidebar-header { padding: 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header img { max-width: 240px; height: auto; }
.sidebar-menu { list-style: none; padding: 10px 0; flex: 1; }
.sidebar-menu li a { display: flex; align-items: center; padding: 12px 20px; color: var(--text-sidebar); text-decoration: none; transition: var(--transition); font-size: 14px; gap: 12px; }
.sidebar-menu li a:hover, .sidebar-menu li a.active { background: var(--bg-sidebar-hover); border-left: 4px solid var(--accent); }
.sidebar-menu li a .icon { width: 20px; text-align: center; font-size: 16px; }
.sidebar-footer { padding: 15px 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 12px; text-align: center; opacity: 0.7; }
.main-content { margin-left: var(--sidebar-width); min-height: 100vh; transition: var(--transition); }
.top-header { background: var(--bg-header); height: var(--header-height); display: flex; align-items: center; justify-content: space-between; padding: 0 30px; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 999; }
.top-header h1 { font-size: 20px; color: var(--text-header); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 15px; }
.user-info { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); }
.user-info .user-avatar { width: 35px; height: 35px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; }
.content-area { padding: 25px 30px; }
.card { background: var(--bg-card); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 25px; overflow: hidden; }
.card-header { padding: 18px 25px; border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.card-header h2 { font-size: 18px; font-weight: 600; color: var(--text-header); }
.card-body { padding: 25px; }
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { background: var(--bg-table-header); color: var(--text-table-header); padding: 10px 12px; text-align: center; font-weight: 600; white-space: nowrap; }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--border-light); text-align: center; white-space: nowrap; }
.table tbody tr:nth-child(even) { background: var(--bg-table-row-alt); }
.table tbody tr:hover { background: rgba(26, 115, 232, 0.05); }
.table .col-name { text-align: left; font-weight: 500; min-width: 150px; }
.table-revenue th { background: var(--bg-table-header-revenue); color: #1a237e; }
.table-expense th { background: var(--bg-table-header-expense); color: #333; }
[data-theme="dark"] .table-revenue th, [data-theme="dark"] .table-expense th { color: var(--text-table-header); }
.table input[type="text"], .table input[type="number"] { width: 100%; min-width: 90px; padding: 5px 8px; border: 1px solid var(--border-color); border-radius: 4px; text-align: right; font-size: 12px; background: var(--bg-input); color: var(--text-input); }
.table input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2); }
.monthly-table .entry-receita { color: var(--revenue-color); font-weight: 600; }
.monthly-table .entry-despesa { color: var(--expense-color); font-weight: 600; }
.monthly-summary { background: var(--bg-card); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.monthly-summary .summary-item { display: flex; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--border-light); font-size: 14px; }
.monthly-summary .summary-item:last-child { border-bottom: none; }
.monthly-summary .summary-label { font-weight: 500; color: var(--text-secondary); }
.monthly-summary .summary-value { font-weight: 700; }
.flow-table .row-highlight { background: rgba(26, 115, 232, 0.05) !important; font-weight: 700; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 14px; color: var(--text-secondary); }
.form-control { width: 100%; padding: 10px 14px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 14px; background: var(--bg-input); color: var(--text-input); }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border: none; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; transition: var(--transition); text-decoration: none; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: #333; }
.btn-info { background: var(--info); color: white; }
.btn-secondary { background: var(--text-secondary); color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.theme-toggle { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--border-color); background: var(--bg-card); color: var(--text-primary); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; justify-content: center; align-items: center; }
.modal-overlay.active { display: flex; }
.modal { background: var(--bg-modal); border-radius: 16px; width: 90%; max-width: 500px; max-height: 80vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,0.3); }
.modal-header { padding: 20px 25px; border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { color: var(--text-header); font-size: 18px; }
.modal-close { width: 30px; height: 30px; border: none; background: none; font-size: 20px; cursor: pointer; color: var(--text-secondary); border-radius: 50%; }
.modal-body { padding: 25px; }
.modal-footer { padding: 15px 25px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 10px; }
.badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; display: inline-block; }
.badge-ok, .badge-active { background: #d4edda; color: #155724; }
.badge-pendente { background: #fff3cd; color: #856404; }
.badge-inactive { background: #f8d7da; color: #721c24; }
[data-theme="dark"] .badge-ok, [data-theme="dark"] .badge-active { background: #1b3a2a; color: #75d99a; }
[data-theme="dark"] .badge-pendente { background: #3a2a1b; color: #ffc107; }
[data-theme="dark"] .badge-inactive { background: #3a1b1b; color: #ff7b7b; }
.value-positive { color: var(--balance-positive); font-weight: 600; }
.value-negative { color: var(--balance-negative); font-weight: 600; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 25px; }
.stat-card { background: var(--bg-card); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); text-align: center; }
.stat-card .stat-value { font-size: 22px; font-weight: 700; margin: 8px 0; }
.stat-card .stat-label { font-size: 13px; color: var(--text-secondary); }
.year-selector select { padding: 6px 12px; border: 2px solid var(--primary); border-radius: 8px; background: var(--bg-input); color: var(--text-input); font-weight: 600; cursor: pointer; }
.month-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 20px; }
.month-tab { padding: 8px 16px; border: 2px solid var(--border-color); border-radius: 8px; background: var(--bg-card); color: var(--text-primary); cursor: pointer; font-size: 13px; font-weight: 500; text-decoration: none; }
.month-tab:hover, .month-tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1a237e 0%, #0d47a1 50%, #1a73e8 100%); padding: 20px; }
.login-card { background: var(--bg-card); border-radius: 20px; padding: 40px; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-card .logo { text-align: center; margin-bottom: 30px; }
.login-card .logo img { max-width: 300px; }
.login-card h2 { text-align: center; color: var(--text-header); margin-bottom: 8px; font-size: 22px; }
.login-card .subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 30px; font-size: 14px; }
.login-card .btn-primary { width: 100%; justify-content: center; padding: 12px; font-size: 16px; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
[data-theme="dark"] .alert-danger { background: #3a1b1b; color: #ff7b7b; border-color: #5a2b2b; }
[data-theme="dark"] .alert-success { background: #1b3a2a; color: #75d99a; border-color: #2b5a3a; }
.goal-over { color: var(--danger); font-weight: 700; }
.goal-under { color: var(--success); font-weight: 700; }
.mobile-toggle { display: none; width: 40px; height: 40px; border: none; background: none; font-size: 24px; cursor: pointer; color: var(--text-primary); }
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-toggle { display: flex; align-items: center; justify-content: center; }
    .content-area { padding: 15px; }
}
@media (max-width: 768px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats-grid { grid-template-columns: 1fr; } }
@media print { .sidebar, .top-header, .btn, .no-print { display: none !important; } .main-content { margin-left: 0; } }
.text-center { text-align: center; } .text-left { text-align: left; }
.mt-2 { margin-top: 16px; }
.d-flex { display: flex; } .gap-2 { gap: 16px; } .flex-wrap { flex-wrap: wrap; }
.col-ok { background: rgba(40,167,69,0.1); }
.col-pendente { background: rgba(255,193,7,0.1); }