:root {
  --bg-app: #050505;
  --bg-panel: rgba(20, 20, 25, 0.9);
  --primary: #00f3ff;
  --secondary: #bc13fe;
  --success: #00ff9d;
  --danger: #ff0055;
  --text: #e0e6ed;
  --text-muted: #6f7a8c;
  --border: 1px solid rgba(255, 255, 255, 0.1);
  --font-main: 'Rajdhani', sans-serif;
  --font-head: 'Orbitron', sans-serif;
  --radius: 12px;
}

[data-theme="neon-red"] {
  --bg-app: #0a0000;
  --primary: #ff003c;
  --secondary: #ff4d00;
  --success: #ff003c;
  --danger: #ff003c;
}

[data-theme="royal-gold"] {
  --bg-app: #0f0f12;
  --primary: #d4af37;
  --secondary: #fff;
  --border: 1px solid #d4af37;
}

[data-theme="clean"] {
  --bg-app: #f4f7f6;
  --bg-panel: #ffffff;
  --primary: #007bff;
  --secondary: #6610f2;
  --text: #333;
  --border: 1px solid #ddd;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-main); background: var(--bg-app); color: var(--text); min-height: 100vh; overflow-x: hidden; padding-bottom: 2rem;}
.hidden { display: none !important; }
.app, .auth-wrapper { max-width: 800px; margin: 0 auto; padding: 1rem; position: relative; z-index: 2; }

/* AUTH */
.auth-wrapper { height: 90vh; display: flex; align-items: center; justify-content: center; }
.auth-panel { text-align: center; width: 100%; max-width: 400px; border: var(--border); padding: 2rem; border-radius: var(--radius); background: var(--bg-panel); }
.logo-mark { font-family: var(--font-head); font-size: 2rem; background: linear-gradient(90deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: bold; }

/* NAV */
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.nav-left { display: flex; gap: 1rem; align-items: center; }
.nav-right { display: flex; gap: 1rem; align-items: center; }
.icon-wrapper { cursor: pointer; font-size: 1.2rem; position: relative; }
.badge { position: absolute; top: -5px; right: -5px; background: var(--danger); color: white; font-size: 0.6rem; padding: 2px 5px; border-radius: 50%; }
.profile-avatar { width: 35px; height: 35px; background: var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid var(--primary); }

/* BUDGET BAR (NEW) */
.budget-bar-container { margin-bottom: 1rem; }
.budget-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.budget-visual { background: rgba(0,0,0,0.2); padding: 10px; border-radius: 8px; }
.budget-labels { display: flex; justify-content: space-between; font-size: 0.8rem; margin-bottom: 5px; }
.progress-track { height: 10px; background: rgba(255,255,255,0.1); border-radius: 5px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--secondary)); transition: 1s ease; }
.budget-msg { font-size: 0.75rem; color: var(--text-muted); margin-top: 5px; text-align: center; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; margin-bottom: 1rem; }
.stat-card { background: var(--bg-panel); padding: 1rem; border-radius: var(--radius); border: var(--border); }
.stat-card.balance { grid-column: 1 / -1; background: linear-gradient(135deg, rgba(0, 243, 255, 0.05), rgba(188, 19, 254, 0.05)); border-color: var(--primary); }
.stat-card h1 { font-family: var(--font-head); font-size: 2rem; color: var(--primary); }
.stat-card.income h3 { color: var(--success); } .stat-card.expense h3 { color: var(--danger); }

/* TABS */
.tabs-container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 1rem; background: var(--bg-panel); padding: 5px; border-radius: var(--radius); overflow-x: auto; }
.tab-btn { background: transparent; border: none; color: var(--text-muted); padding: 8px; cursor: pointer; font-weight: bold; border-radius: 6px; font-size: 0.8rem; white-space: nowrap; }
.tab-btn.active { background: var(--primary); color: #000; }

/* FORMS & LISTS */
.panel { background: var(--bg-panel); padding: 1.2rem; border-radius: var(--radius); border: var(--border); margin-bottom: 1rem; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
input, select { width: 100%; padding: 0.8rem; background: rgba(0,0,0,0.3); border: var(--border); color: var(--text); border-radius: 8px; outline: none; margin-bottom: 0.8rem; }
input:focus { border-color: var(--primary); }
.btn-primary { width: 100%; padding: 12px; background: linear-gradient(90deg, var(--primary), var(--secondary)); border: none; color: #fff; font-weight: bold; border-radius: 8px; cursor: pointer; text-transform: uppercase; }
.btn-secondary { width: 100%; padding: 12px; background: rgba(255,255,255,0.1); border: var(--border); color: var(--text); border-radius: 8px; cursor: pointer; margin-bottom: 0.5rem; }
.btn-danger { width: 100%; padding: 10px; background: var(--danger); border: none; color: white; border-radius: 8px; cursor: pointer; }
.btn-xs { padding: 4px 8px; font-size: 0.7rem; cursor: pointer; background: transparent; color: var(--primary); border: 1px solid var(--primary); border-radius: 4px; }
.btn-close { background: none; border: none; color: var(--text); font-size: 1.2rem; cursor: pointer; }

.expense-item, .debt-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.tx-amount { font-family: var(--font-head); font-weight: bold; }
.income-text { color: var(--success); } .expense-text { color: var(--danger); }

/* GOALS CARD (NEW) */
.goals-container { display: grid; grid-template-columns: 1fr; gap: 10px; }
.goal-card { background: rgba(255,255,255,0.03); padding: 10px; border-radius: 8px; border: var(--border); }
.goal-header { display: flex; justify-content: space-between; margin-bottom: 5px; font-weight: bold; }
.goal-bar { height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; margin: 8px 0; overflow: hidden; }
.goal-fill { height: 100%; background: var(--success); width: 0%; }
.goal-actions button { font-size: 0.7rem; margin-right: 5px; cursor: pointer; }

/* MODALS & NOTIFS */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 200; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.modal-panel { background: #0b0b0e; width: 90%; max-width: 400px; padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--primary); }
.dropdown-panel { position: absolute; top: 50px; right: 0; width: 280px; background: var(--bg-panel); border: var(--border); border-radius: var(--radius); padding: 1rem; z-index: 100; box-shadow: 0 5px 15px rgba(0,0,0,0.5); }
.notif-item { font-size: 0.8rem; padding: 8px; margin-bottom: 5px; border-left: 3px solid var(--primary); background: rgba(255,255,255,0.05); }

/* DEBT CARDS */
.debt-overview { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 1rem; }
.debt-card { padding: 1rem; border-radius: var(--radius); border: var(--border); text-align: center; }
.debt-card.owe-me { border-color: var(--success); background: rgba(0, 255, 157, 0.05); }
.debt-card.i-owe { border-color: var(--danger); background: rgba(255, 0, 85, 0.05); }
.debt-card h2 { margin-top: 5px; font-size: 1.4rem; }

@media (max-width: 600px) { .stats-grid { grid-template-columns: 1fr 1fr; } .stat-card.balance { grid-column: 1 / -1; } .tabs-container { overflow-x: scroll; } }