/* ═══════════════════════════════════════════
   MoneyMind v3.0 — style.css
   Vintrex Solutions
═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS VARIABLES ── */
:root {
  --bg:           #0b0f1e;
  --bg2:          #111827;
  --surface:      rgba(255,255,255,0.05);
  --surface-h:    rgba(255,255,255,0.09);
  --border:       rgba(255,255,255,0.08);
  --border-h:     rgba(255,255,255,0.18);

  --blue:   #6c63ff;
  --green:  #22d3a5;
  --red:    #ff6b6b;
  --yellow: #fbbf24;
  --purple: #a78bfa;
  --teal:   #2dd4bf;
  --orange: #fb923c;
  --pink:   #f472b6;

  --text1: #f1f5f9;
  --text2: #94a3b8;
  --text3: #475569;

  --r1: 10px;
  --r2: 16px;
  --r3: 22px;
  --sidebar-w: 220px;
  --topbar-h: 60px;
  --transition: all 0.22s cubic-bezier(.4,0,.2,1);
  --shadow: 0 8px 32px rgba(0,0,0,0.45);
}

/* Light mode */
body.light {
  --bg:        #f1f5fb;
  --bg2:       #e8edf5;
  --surface:   rgba(255,255,255,0.90);
  --surface-h: rgba(255,255,255,1);
  --border:    rgba(0,0,0,0.07);
  --border-h:  rgba(0,0,0,0.14);
  --text1:     #0f172a;
  --text2:     #475569;
  --text3:     #94a3b8;
  --shadow: 0 4px 20px rgba(0,0,0,0.10);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text1);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }

/* ── LOADING SCREEN ── */
#loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: #0b0f1e;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
}
.load-logo {
  font-size: 60px;
  animation: bounce 0.8s infinite alternate;
}
@keyframes bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-12px); }
}
.load-name {
  font-size: 28px; font-weight: 800;
  background: linear-gradient(135deg, #6c63ff, #22d3a5);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.load-bar {
  width: 200px; height: 4px;
  background: rgba(255,255,255,0.1); border-radius: 99px; overflow: hidden;
}
.load-fill {
  width: 0; height: 100%;
  background: linear-gradient(90deg, #6c63ff, #22d3a5);
  border-radius: 99px;
  animation: load-progress 1.5s ease forwards;
}
@keyframes load-progress { to { width: 100%; } }

/* ── LOGIN ── */
#login-screen {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  padding: 20px;
}
.login-bg-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.18; pointer-events: none;
}
.orb1 { width:400px;height:400px; background:#6c63ff; top:-100px;  left:-100px; }
.orb2 { width:300px;height:300px; background:#22d3a5; bottom:-80px; right:-60px; }
.orb3 { width:200px;height:200px; background:#f472b6; top:50%; left:60%; }

.login-card {
  background: var(--surface);
  border: 1px solid var(--border-h);
  border-radius: var(--r3);
  padding: 44px 40px;
  width: 100%; max-width: 440px;
  text-align: center;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  position: relative; z-index: 1;
}
.login-icon { font-size: 56px; margin-bottom: 12px; display: block; }
.login-card h1 {
  font-size: 32px; font-weight: 900;
  background: linear-gradient(135deg,#6c63ff,#22d3a5);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
.login-sub  { color: var(--text2); font-size: 14px; margin-bottom: 16px; }
.login-desc { color: var(--text2); font-size: 14px; line-height: 1.6; margin-bottom: 20px; }
.login-features {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; margin-bottom: 28px;
}
.login-features span {
  background: var(--surface-h);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 14px; font-size: 12px; font-weight: 500;
  color: var(--text2);
}
#google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 14px;
  background: #fff; color: #333;
  border-radius: var(--r2); font-size: 15px; font-weight: 600;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  transition: var(--transition);
}
#google-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
#google-btn:active { transform: translateY(0); }

/* Email Auth Styles */
.auth-form {
  display: flex; flex-direction: column; gap: 12px;
  text-align: left; margin-bottom: 8px;
}
.auth-form h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; text-align: center; }
.auth-form input {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r1); padding: 12px 14px;
  color: var(--text1); font-size: 14px; outline: none;
  transition: var(--transition);
}
.auth-form input:focus { border-color: var(--blue); }
.auth-toggle { display: flex; justify-content: center; gap: 6px; font-size: 13px; margin-top: 4px; color: var(--text2); }
.auth-divider { display: flex; align-items: center; margin: 20px 0; color: var(--text3); font-size: 12px; font-weight: 700; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-divider span { padding: 0 10px; }

.login-privacy { font-size: 11px; color: var(--text3); margin-top: 14px; }

/* ── ONBOARDING ── */
#onboarding {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.onboard-card {
  background: var(--bg2);
  border: 1px solid var(--border-h);
  border-radius: var(--r3);
  padding: 40px 36px;
  width: 100%; max-width: 500px;
  text-align: center;
}
.onboard-icon { font-size: 48px; margin-bottom: 14px; }
.onboard-card h2 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.onboard-card p { color: var(--text2); font-size: 14px; margin-bottom: 24px; }
#currency-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px; margin-bottom: 24px;
}
.cur-btn {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--r2); padding: 12px 8px;
  cursor: pointer; transition: var(--transition);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.cur-btn:hover { border-color: var(--blue); background: var(--surface-h); }
.cur-btn.selected { border-color: var(--blue); background: rgba(108,99,255,0.12); }
.cur-btn .cur-sym { font-size: 20px; font-weight: 800; color: var(--blue); }
.cur-btn .cur-code { font-size: 11px; font-weight: 600; color: var(--text2); }

/* ── LAYOUT ── */
#app {
  display: flex; min-height: 100vh;
}
#sidebar {
  width: var(--sidebar-w); min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 300;
  transition: transform 0.3s;
  overflow-y: auto;
}
#main-content {
  margin-left: var(--sidebar-w);
  flex: 1; min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ── SIDEBAR BRAND ── */
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
}
.brand-icon { font-size: 22px; }
.brand-name {
  font-size: 18px; font-weight: 800;
  background: linear-gradient(135deg, #6c63ff, #22d3a5);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* ── NAV ── */
.nav-section { padding: 16px 12px 4px; }
.nav-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text3);
  padding: 0 8px; margin-bottom: 6px;
}
.nav-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  border-radius: var(--r1);
  background: none; color: var(--text2);
  font-size: 14px; font-weight: 500;
  transition: var(--transition);
  text-align: left; margin-bottom: 2px;
}
.nav-btn:hover { background: var(--surface-h); color: var(--text1); }
.nav-btn.active {
  background: rgba(108,99,255,0.15);
  color: var(--blue); font-weight: 600;
}
.nav-icon { font-size: 16px; }

/* ── SIDEBAR USER ── */
.sidebar-user {
  margin-top: auto; padding: 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg,#6c63ff,#22d3a5);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
  background-size: cover; background-position: center;
}
.user-details { overflow: hidden; }
.user-name  { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 11px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  position: sticky; top: 0; z-index: 10;
}
#hamburger {
  display: none; font-size: 20px;
  background: none; color: var(--text2);
  padding: 6px; border-radius: 8px;
}
#page-title-bar {
  font-size: 16px; font-weight: 700; flex: 1;
  color: var(--text1);
}
.topbar-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text2); font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.icon-btn:hover { background: var(--surface-h); color: var(--text1); }

/* ── PAGES ── */
.page { display: none; padding: 28px 28px 60px; }
.page.active { display: block; }
.page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; flex-wrap: wrap;
  gap: 14px; margin-bottom: 24px;
}
.page-header h1 { font-size: 28px; font-weight: 800; }
.page-header p  { color: var(--text2); font-size: 14px; margin-top: 3px; }

/* ── KPI ROW (4 cards) ── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  border-radius: var(--r2);
  padding: 22px;
  border: 1px solid var(--border);
  display: flex; gap: 16px; align-items: flex-start;
  position: relative; overflow: hidden;
  transition: var(--transition);
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.kpi-card::after {
  content: '';
  position: absolute; top: -30px; right: -30px;
  width: 100px; height: 100px; border-radius: 50%;
  opacity: 0.15;
}
.kpi-balance { background: rgba(108,99,255,0.08); }
.kpi-balance::after { background: #6c63ff; }
.kpi-income  { background: rgba(34,211,165,0.08); }
.kpi-income::after  { background: #22d3a5; }
.kpi-expense { background: rgba(255,107,107,0.08); }
.kpi-expense::after { background: #ff6b6b; }
.kpi-savings { background: rgba(167,139,250,0.08); }
.kpi-savings::after { background: #a78bfa; }

.kpi-icon {
  font-size: 22px; width: 44px; height: 44px;
  border-radius: 12px; display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-balance .kpi-icon { background: rgba(108,99,255,0.15); }
.kpi-income  .kpi-icon { background: rgba(34,211,165,0.15); }
.kpi-expense .kpi-icon { background: rgba(255,107,107,0.15); }
.kpi-savings .kpi-icon { background: rgba(167,139,250,0.15); }

.kpi-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text2); margin-bottom: 6px; }
.kpi-value { font-size: 26px; font-weight: 800; line-height: 1; }
.kpi-balance .kpi-value { color: #6c63ff; }
.kpi-income  .kpi-value { color: #22d3a5; }
.kpi-expense .kpi-value { color: #ff6b6b; }
.kpi-savings .kpi-value { color: #a78bfa; }
.kpi-sub { font-size: 11px; color: var(--text3); margin-top: 6px; }

/* ── CHARTS ── */
.charts-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; margin-bottom: 24px;
}
.chart-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r2); padding: 22px;
  backdrop-filter: blur(12px);
  transition: var(--transition);
}
.chart-box:hover { background: var(--surface-h); }
.chart-box.wide { grid-column: 1 / -1; }
.chart-title {
  font-size: 14px; font-weight: 700;
  margin-bottom: 18px; color: var(--text1);
}
.chart-wrap { position: relative; height: 230px; }
.chart-empty {
  text-align: center; padding: 60px 20px;
  color: var(--text2); font-size: 14px;
}

/* ── SECTION BOX ── */
.section-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r2); padding: 22px;
  backdrop-filter: blur(12px);
}
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.section-title { font-size: 14px; font-weight: 700; }
.link-btn {
  background: none; color: var(--blue);
  font-size: 13px; font-weight: 500;
  transition: var(--transition);
}
.link-btn:hover { opacity: 0.75; }

/* ── TRANSACTION ITEMS ── */
.tx-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 10px; border-radius: var(--r1);
  transition: var(--transition);
}
.tx-item:hover { background: var(--surface-h); }
.tx-cat-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.tx-info { flex: 1; min-width: 0; }
.tx-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-meta { font-size: 12px; color: var(--text2); margin-top: 2px; }
.tx-amount { font-size: 15px; font-weight: 700; white-space: nowrap; }
.tx-amount.income  { color: var(--green); }
.tx-amount.expense { color: var(--red); }
.tx-btns { display: flex; gap: 4px; }
.tx-btn {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; display: flex; align-items: center; justify-content: center;
  transition: var(--transition); opacity: 0.6;
}
.tx-btn:hover { opacity: 1; background: var(--surface-h); }
.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--text2);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }

/* ── FILTERS ── */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 16px;
}
.filter-input {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r1); padding: 10px 14px;
  color: var(--text1); font-size: 13px;
  transition: var(--transition); outline: none;
}
.filter-input:focus { border-color: var(--blue); }
.filter-input[type="text"] { flex: 1; min-width: 160px; }

/* ── BUDGET GRID ── */
.budget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.budget-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r2); padding: 22px;
  transition: var(--transition); backdrop-filter: blur(12px);
}
.budget-card:hover { background: var(--surface-h); }
.budget-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.budget-cat-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.budget-cat-name { font-size: 15px; font-weight: 700; }
.budget-cat-month { font-size: 12px; color: var(--text2); }
.budget-actions { margin-left: auto; display: flex; gap: 4px; }
.prog-bar {
  height: 8px; background: var(--surface-h);
  border-radius: 99px; overflow: hidden; margin-bottom: 10px;
}
.prog-fill { height: 100%; border-radius: 99px; transition: width 0.6s ease; }
.budget-amounts {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text2);
}
.budget-add-card {
  background: var(--surface); border: 2px dashed var(--border);
  border-radius: var(--r2); padding: 22px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; cursor: pointer;
  transition: var(--transition); min-height: 140px;
  color: var(--text2); font-size: 14px;
}
.budget-add-card:hover { border-color: var(--blue); color: var(--blue); background: rgba(108,99,255,0.05); }
.add-icon { font-size: 28px; }

/* ── ANALYTICS ── */
.ana-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.month-nav {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r2); padding: 6px 12px;
}
.month-nav button {
  background: none; color: var(--text2); font-size: 18px;
  width: 28px; height: 28px; display: flex;
  align-items: center; justify-content: center;
  border-radius: 6px; transition: var(--transition);
}
.month-nav button:hover { background: var(--surface-h); color: var(--text1); }
.month-nav span { font-size: 14px; font-weight: 600; min-width: 120px; text-align: center; }
#ana-legend { margin-top: 14px; display: flex; flex-direction: column; gap: 7px; }
.legend-row {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── SETTINGS ── */
.settings-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  margin-bottom: 18px; overflow: hidden;
  backdrop-filter: blur(12px);
}
.settings-title {
  font-size: 13px; font-weight: 700;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; gap: 16px;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.s-label { font-size: 14px; font-weight: 600; }
.s-desc  { font-size: 12px; color: var(--text2); margin-top: 3px; }
.version-badge {
  background: rgba(108,99,255,0.15);
  color: var(--blue); border-radius: 99px;
  padding: 4px 12px; font-size: 12px; font-weight: 700;
}

/* ── BUTTONS ── */
.btn-primary {
  background: linear-gradient(135deg, #6c63ff, #22d3a5);
  color: #fff; border-radius: var(--r2);
  padding: 10px 22px; font-size: 14px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 7px;
  transition: var(--transition); box-shadow: 0 4px 16px rgba(108,99,255,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(108,99,255,0.4); }
.btn-ghost {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text1); border-radius: var(--r1);
  padding: 9px 18px; font-size: 13px; font-weight: 600;
  transition: var(--transition);
}
.btn-ghost:hover { background: var(--surface-h); border-color: var(--border-h); }
.btn-danger {
  background: rgba(255,107,107,0.12);
  border: 1px solid rgba(255,107,107,0.25);
  color: var(--red); border-radius: var(--r1);
  padding: 9px 18px; font-size: 13px; font-weight: 600;
  transition: var(--transition);
}
.btn-danger:hover { background: rgba(255,107,107,0.2); }

/* ── ALERT BANNERS ── */
.alert-banner {
  display: flex; align-items: center; gap: 12px;
  border-radius: var(--r1); padding: 13px 16px;
  margin-bottom: 12px; font-size: 13px; font-weight: 500;
}
.alert-danger {
  background: rgba(255,107,107,0.10);
  border: 1px solid rgba(255,107,107,0.25);
  color: var(--red);
}
.alert-warning {
  background: rgba(251,191,36,0.10);
  border: 1px solid rgba(251,191,36,0.25);
  color: var(--yellow);
}

/* ── MODALS ── */
.modal-bg {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); padding: 20px;
}
.modal {
  background: var(--bg2); border: 1px solid var(--border-h);
  border-radius: var(--r3); width: 100%; max-width: 500px;
  box-shadow: var(--shadow); overflow: hidden;
  animation: modal-in 0.2s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 17px; font-weight: 800; }
.modal-close {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--surface); color: var(--text2);
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--surface-h); color: var(--text1); }
.type-row {
  display: flex; gap: 0; padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.type-tab {
  flex: 1; padding: 9px; font-size: 13px; font-weight: 600;
  background: var(--surface); color: var(--text2);
  transition: var(--transition);
}
.type-tab:first-child { border-radius: var(--r1) 0 0 var(--r1); }
.type-tab:last-child  { border-radius: 0 var(--r1) var(--r1) 0; }
.type-tab.active { background: linear-gradient(135deg,#6c63ff,#22d3a5); color: #fff; }
.form-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.form-row  { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text2); }
.form-row input,
.form-row select,
.form-row textarea {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r1); padding: 11px 14px;
  color: var(--text1); font-size: 14px; outline: none;
  transition: var(--transition);
}
select option {
  background: #1e293b; /* slate-800 for dark mode compatibility */
  color: #f8fafc;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus { border-color: var(--blue); }
.form-row textarea { resize: vertical; min-height: 72px; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px; border-top: 1px solid var(--border);
}

/* ── TOAST ── */
#toasts {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px; z-index: 9999;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; border-radius: var(--r1);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow); min-width: 240px;
  animation: toast-in 0.3s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast.success { background: rgba(34,211,165,0.15); border: 1px solid rgba(34,211,165,0.3); color: var(--green); }
.toast.error   { background: rgba(255,107,107,0.15); border: 1px solid rgba(255,107,107,0.3); color: var(--red);   }
.toast.info    { background: rgba(108,99,255,0.15);  border: 1px solid rgba(108,99,255,0.3);  color: var(--blue);  }

/* ── SIDEBAR MOBILE OVERLAY ── */
#sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 299;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(3px);
}

/* ── CATEGORIES PAGE ── */
.cat-type-tabs {
  display: flex; gap: 0; margin-bottom: 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r2); padding: 5px; width: fit-content;
}
.cat-tab {
  padding: 9px 22px; border-radius: var(--r1);
  font-size: 13px; font-weight: 600;
  color: var(--text2); background: none;
  transition: var(--transition);
}
.cat-tab.active {
  background: linear-gradient(135deg,#6c63ff,#22d3a5);
  color: #fff;
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px; padding: 4px 0;
}
.cat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r2); padding: 16px 14px;
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; position: relative;
  transition: var(--transition); text-align: center;
}
.cat-card:hover { background: var(--surface-h); transform: translateY(-2px); }
.cat-card-icon {
  width: 50px; height: 50px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.cat-card-name { font-size: 13px; font-weight: 700; }
.badge-default { font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;padding:2px 8px;border-radius:99px;background:rgba(148,163,184,0.12);color:var(--text3); }
.badge-custom  { font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;padding:2px 8px;border-radius:99px;background:rgba(108,99,255,0.15);color:var(--blue); }
.cat-card-actions { position:absolute;top:8px;right:8px;display:flex;gap:3px;opacity:0;transition:var(--transition); }
.cat-card:hover .cat-card-actions { opacity:1; }
.cat-add-card {
  background: var(--surface); border: 2px dashed var(--border);
  border-radius: var(--r2); padding: 16px 14px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; cursor: pointer;
  transition: var(--transition); min-height: 120px;
  color: var(--text2); font-size: 13px; font-weight: 600;
}
.cat-add-card:hover { border-color:var(--blue);color:var(--blue);background:rgba(108,99,255,0.05); }
.emoji-row { display:flex;align-items:flex-start;gap:12px;flex-wrap:wrap; }
.emoji-grid { display:flex;flex-wrap:wrap;gap:6px;flex:1; }
.emoji-btn { width:34px;height:34px;border-radius:8px;font-size:18px;background:var(--surface);border:1px solid var(--border);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:var(--transition); }
.emoji-btn:hover { background:var(--surface-h);transform:scale(1.15); }
.emoji-btn.selected { border-color:var(--blue);background:rgba(108,99,255,0.15); }
.color-grid { display:flex;flex-wrap:wrap;gap:8px; }
.color-btn { width:30px;height:30px;border-radius:50%;border:3px solid transparent;cursor:pointer;transition:var(--transition); }
.color-btn:hover { transform:scale(1.15); }
.color-btn.selected { border-color:var(--text1);transform:scale(1.15); }

/* ── ACCOUNTS PAGE ── */
.acc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.acc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r2); padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
  transition: var(--transition); position: relative;
}
.acc-card:hover { background: var(--surface-h); transform: translateY(-2px); }
.acc-card-icon {
  width: 54px; height: 54px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
}
.acc-card-info { flex: 1; min-width: 0; }
.acc-card-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-card-bal { font-size: 14px; font-weight: 600; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-card-actions {
  position: absolute; top: 16px; right: 16px;
  display: flex; gap: 4px; opacity: 0;
  transition: var(--transition);
}
.acc-card:hover .acc-card-actions { opacity: 1; }
.acc-add-card {
  background: var(--surface); border: 2px dashed var(--border);
  border-radius: var(--r2); padding: 18px 20px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  cursor: pointer; transition: var(--transition); min-height: 90px;
  color: var(--text2); font-size: 14px; font-weight: 600;
}
.acc-add-card:hover { border-color:var(--blue);color:var(--blue);background:rgba(108,99,255,0.05); }

/* ══════════════════════════════════
   RESPONSIVE
══════════════════════════════════ */
@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  #sidebar-overlay.open { display: block; }
  #main-content { margin-left: 0; }
  #hamburger { display: flex; }
  .charts-row { grid-template-columns: 1fr; }
  .page { padding: 20px 16px 60px; }
}
@media (max-width: 600px) {
  .login-card { padding: 30px 24px; margin-top: -20px; }
  .login-card h1 { font-size: 26px; }
  .kpi-row { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: stretch; }
  .form-2col { grid-template-columns: 1fr; }
}
