:root {
  --bg: #FAF9F6;
  --surface: #FFFFFF;
  --border: #ECEAE4;
  --text-primary: #1A2420;
  --text-secondary: #6B7570;
  --emerald: #0E9F6E;
  --emerald-light: #E6F7EF;
  --teal: #0D9488;
  --teal-light: #E5F7F5;
  --sky: #0284C7;
  --sky-light: #E6F4FC;
  --gold: #D4A017;
  --gold-light: #FBF3DE;
  --orange: #F0924C;
  --orange-light: #FDEEE3;
  --red: #E5484D;
  --red-light: #FDECEC;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 25, 0.04), 0 4px 16px rgba(20, 30, 25, 0.04);
  --shadow-hover: 0 2px 4px rgba(20, 30, 25, 0.06), 0 12px 24px rgba(20, 30, 25, 0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg); color: var(--text-primary); -webkit-font-smoothing: antialiased; }
.app { display: flex; min-height: 100vh; }
.sidebar { width: 232px; background: var(--surface); border-right: 1px solid var(--border); padding: 24px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 17px; letter-spacing: -0.02em; padding: 0 8px 24px; display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--emerald), var(--teal)); display: inline-block; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 500; transition: background 0.15s, color 0.15s; }
.nav a:hover { background: var(--bg); color: var(--text-primary); }
.nav a.active { background: var(--emerald-light); color: var(--emerald); font-weight: 600; }
.scope-toggle { margin-top: 12px; display: flex; background: var(--bg); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.scope-toggle button { flex: 1; border: none; background: transparent; padding: 7px 0; font-size: 12.5px; font-weight: 600; border-radius: 8px; cursor: pointer; color: var(--text-secondary); transition: all 0.15s; }
.scope-toggle button.active { background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow); }
.main { flex: 1; padding: 32px 40px 60px; max-width: 1280px; }
.header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; }
.header h1 { font-family: 'Manrope', sans-serif; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.header p { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }
.header-actions { display: flex; gap: 10px; }
.btn { font-family: inherit; font-size: 13.5px; font-weight: 600; border-radius: var(--radius-sm); padding: 9px 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text-primary); cursor: pointer; transition: box-shadow 0.15s, transform 0.1s; }
.btn:hover { box-shadow: var(--shadow-hover); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--emerald); color: white; border-color: var(--emerald); }
.btn-primary:hover { background: #0C8A5F; }
.btn-danger { background: var(--red-light); color: var(--red); border-color: var(--red-light); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); transition: box-shadow 0.2s, transform 0.2s; }
.kpi-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.kpi-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.kpi-value { font-family: 'Manrope', sans-serif; font-size: 26px; font-weight: 800; margin-top: 8px; letter-spacing: -0.01em; }
.kpi-sub { font-size: 12.5px; margin-top: 6px; font-weight: 600; }
.kpi-sub.positive { color: var(--emerald); }
.kpi-sub.negative { color: var(--red); }
.kpi-sub.neutral { color: var(--text-secondary); }
.icon-badge { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.card-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.empty-state { text-align: center; padding: 30px 10px; color: var(--text-secondary); font-size: 13.5px; }
.empty-state span { display: block; font-size: 28px; margin-bottom: 8px; }
.loading-pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table th { text-align: left; padding: 10px 12px; color: var(--text-secondary); font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--border); }
table.data-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: var(--bg); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.pill-business { background: var(--emerald-light); color: var(--emerald); }
.pill-private { background: var(--sky-light); color: var(--sky); }
.pill-income { background: var(--emerald-light); color: var(--emerald); }
.pill-expense { background: var(--orange-light); color: var(--orange); }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.form-grid input, .form-grid select { font-family: inherit; font-size: 13.5px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 10px; background: var(--bg); color: var(--text-primary); }
.form-grid input:focus, .form-grid select:focus { outline: none; border-color: var(--emerald); background: var(--surface); }
.progress-track { height: 8px; background: var(--bg); border-radius: 6px; overflow: hidden; margin: 10px 0 6px; }
.progress-fill { height: 100%; border-radius: 6px; transition: width 0.6s ease; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } .grid-2 { grid-template-columns: 1fr; } .form-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .app { flex-direction: column; } .sidebar { width: 100%; height: auto; position: relative; flex-direction: row; overflow-x: auto; } .nav { flex-direction: row; } .main { padding: 20px; } .kpi-grid { grid-template-columns: 1fr; } .form-grid { grid-template-columns: 1fr; } }
