/* ============================================================
   ExpenseTrack - app.css  (mobile-first)
   ============================================================ */

:root {
  --primary:       #6366f1;
  --primary-dark:  #4f46e5;
  --primary-light: #eef2ff;
  --success:       #10b981;
  --danger:        #ef4444;
  --warning:       #f59e0b;
  --card-bg:       #ffffff;
  --bg:            #f1f5f9;
  --sidebar-bg:    #1e1b4b;
  --text:          #1e293b;
  --text-muted:    #64748b;
  --border:        #e2e8f0;
  --wallet-color:  #10b981;
  --card-color:    #6366f1;
  --shadow:        0 1px 2px rgba(0,0,0,.05);
  --shadow-md:     0 4px 16px rgba(0,0,0,.07);
  --radius:        14px;
  --sidebar-w:     240px;
  --bottom-nav-h:  64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================ SIDEBAR */
.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  padding: 24px 0;
  z-index: 300;
  transition: transform .3s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 24px 28px;
  font-size: 18px; font-weight: 700; color: #fff;
}
.sidebar-brand i { color: var(--primary); font-size: 20px; }
.nav-links { list-style: none; flex: 1; }
.nav-links a {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 24px; color: #a5b4fc;
  text-decoration: none; font-size: 14px; font-weight: 500;
  transition: all .2s; border-left: 3px solid transparent;
}
.nav-links a i { width: 18px; font-size: 15px; }
.nav-links a:hover  { background: rgba(255,255,255,.06); color: #fff; }
.nav-links a.active { background: rgba(99,102,241,.2); color: #fff; border-left-color: var(--primary); }
.sidebar-footer {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px 0;
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 12px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.sidebar-footer span { color: #c7d2fe; font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-logout { color: #a5b4fc; font-size: 15px; text-decoration: none; padding: 6px; border-radius: 6px; transition: color .2s; }
.btn-logout:hover { color: #fff; }

/* ============================================================ MOBILE TOP BAR */
.mobile-topbar {
  display: none; position: sticky; top: 0; z-index: 200;
  background: var(--sidebar-bg); padding: 0 16px; height: 56px;
  align-items: center; justify-content: space-between; color: #fff;
}
.mobile-topbar .brand { font-weight: 700; display: flex; align-items: center; gap: 8px; font-size: 16px; }
.mobile-topbar .brand i { color: var(--primary); }
.mobile-topbar .topbar-right { display: flex; align-items: center; gap: 2px; }
.mobile-topbar a { color: #a5b4fc; font-size: 16px; padding: 8px; }
#menuToggle { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; padding: 8px; }
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 299;
}
.sidebar-overlay.visible { display: block; }

/* ============================================================ BOTTOM NAV */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h); background: #fff;
  border-top: 1px solid var(--border); z-index: 200;
  padding: 0 4px; align-items: center; justify-content: space-around;
  box-shadow: 0 -4px 12px rgba(0,0,0,.08);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-decoration: none; color: var(--text-muted);
  font-size: 10px; font-weight: 500;
  padding: 6px 10px; border-radius: 10px;
  transition: all .2s; flex: 1;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav a i { font-size: 18px; }
.bottom-nav a.active, .bottom-nav a.active i { color: var(--primary); }
.bottom-nav .add-btn {
  background: var(--primary); color: #fff !important;
  border-radius: 14px; padding: 6px 12px;
  box-shadow: 0 4px 12px rgba(99,102,241,.4);
}
.bottom-nav .add-btn i { font-size: 20px; color: #fff !important; }

/* ============================================================ MAIN CONTENT */
.main-content { margin-left: var(--sidebar-w); padding: 28px 32px; min-height: 100vh; }

/* ============================================================ PAGE HEADER */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 12px;
}
.page-header h1 { font-size: 24px; font-weight: 700; }
.page-header .text-muted { margin-top: 2px; font-size: 13px; color: var(--text-muted); }

/* ============================================================ BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none;
  transition: all .2s; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-dark); }
.btn-primary:active { transform: scale(.98); }
.btn-ghost  { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-full { width: 100%; justify-content: center; padding: 14px; font-size: 15px; border-radius: 12px; }
.btn-sm   { padding: 7px 14px; font-size: 12.5px; }
.btn-icon {
  background: none; border: none; cursor: pointer;
  padding: 7px 9px; border-radius: 8px; font-size: 13px;
  transition: all .2s; -webkit-tap-highlight-color: transparent;
}
.btn-icon.btn-danger { color: var(--danger); }
.btn-icon.btn-danger:hover { background: #fef2f2; }

/* ============================================================ CARDS */
.card {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-header h3 i { color: var(--primary); }
.card-body    { padding: 20px; }
.card-body.p0 { padding: 0; }
.link-sm { font-size: 12.5px; color: var(--primary); text-decoration: none; font-weight: 500; }
.link-sm:hover { text-decoration: underline; }

/* ============================================================ STATS GRID */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--card-bg); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 18px; display: flex; align-items: center; gap: 14px;
}
.stat-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; flex-shrink: 0;
}
.stat-wallet .stat-icon { background: #d1fae5; color: #059669; }
.stat-total .stat-icon  { background: #fee2e2; color: #dc2626; }
.stat-cash .stat-icon   { background: #dbeafe; color: #2563eb; }
.stat-card2 .stat-icon  { background: #ede9fe; color: #7c3aed; }
.stat-body  { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 20px; font-weight: 700; margin-top: 2px; white-space: nowrap; }

/* ============================================================ TWO COLUMN */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ============================================================ TABLE */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead th {
  padding: 11px 16px; background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-weight: 600; color: var(--text-muted);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px;
}
.table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); }
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: #f8fafc; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ============================================================ EXPENSE CARDS (mobile) */
.expense-list { display: none; }
.expense-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.expense-item:last-child { border-bottom: none; }
.expense-cat-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
  background: var(--primary-light); color: var(--primary);
}
.expense-info { flex: 1; min-width: 0; }
.expense-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.expense-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.expense-right { text-align: right; flex-shrink: 0; }
.expense-amount { font-weight: 700; font-size: 15px; color: var(--danger); display: block; }
.expense-delete { background: none; border: none; color: var(--text-muted); font-size: 13px; cursor: pointer; padding: 2px 4px; margin-top: 4px; border-radius: 4px; }
.expense-delete:active { color: var(--danger); }
.type-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.type-dot.wallet { background: var(--success); }
.type-dot.card   { background: var(--primary); }

/* ============================================================ BADGES */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge-wallet { background: #d1fae5; color: #065f46; }
.badge-card   { background: #ede9fe; color: #5b21b6; }
.badge-cat    { background: var(--primary-light); color: var(--primary-dark); }

/* ============================================================ CATEGORY BAR */
.cat-row    { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cat-info   { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.cat-dot    { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cat-bar-wrap { flex: 1; background: var(--border); border-radius: 4px; height: 7px; overflow: hidden; }
.cat-bar    { height: 100%; border-radius: 4px; transition: width .6s ease; }
.cat-amount { font-weight: 600; min-width: 80px; text-align: right; font-size: 13px; }

/* ============================================================ ALERTS */
.alert {
  padding: 12px 14px; border-radius: 10px; font-size: 13.5px;
  margin-bottom: 16px; display: flex; align-items: flex-start; gap: 8px;
}
.alert i { margin-top: 2px; flex-shrink: 0; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger  { background: #fee2e2; color: #991b1b; }

/* ============================================================ FORMS */
.form-page { max-width: 680px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--text); }
.form-control {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  border: 1.5px solid var(--border); background: #fff;
  font-size: 15px; color: var(--text);
  outline: none; transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
textarea.form-control { resize: vertical; }
select.form-control { cursor: pointer; }
.form-row     { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* Amount display (numpad-driven, not a real input) */
.amount-field-wrap { position: relative; }
.amount-field-wrap .currency-sym {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 20px; font-weight: 700; color: var(--text-muted); pointer-events: none;
  user-select: none;
}
.amount-display {
  width: 100%; padding: 14px 14px 14px 72px;
  border-radius: 12px; border: 2px solid var(--border);
  font-size: 34px; font-weight: 800; color: var(--text);
  background: #fff; min-height: 68px; line-height: 1.1;
  cursor: default; user-select: none;
  transition: border-color .2s;
}
.amount-display.focused { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99,102,241,.10); }
.amount-placeholder { color: #cbd5e1; font-weight: 700; }
/* Keep old .amount-input for wallet page which still uses a real input */
.amount-input {
  width: 100%; padding: 14px 14px 14px 44px;
  border-radius: 12px; border: 2px solid var(--border);
  font-size: 34px; font-weight: 800; color: var(--text);
  outline: none; background: #fff;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
}
.amount-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99,102,241,.10); }

/* Numpad */
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.numpad-btn {
  padding: 17px 10px; border-radius: 12px; border: 1.5px solid var(--border);
  background: #fff; font-size: 20px; font-weight: 600; cursor: pointer;
  transition: all .15s; color: var(--text);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  user-select: none;
}
.numpad-btn:active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); transform: scale(.96); }
.numpad-btn.backspace { color: var(--danger); }
.numpad-btn.clear-btn { font-size: 13px; font-weight: 700; color: var(--text-muted); }

/* Type toggle */
.type-toggle { display: flex; gap: 10px; }
.type-option {
  flex: 1; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border); border-radius: 12px;
  padding: 14px 10px; cursor: pointer; transition: all .2s;
  text-align: center; -webkit-tap-highlight-color: transparent;
}
.type-option input { display: none; }
.type-option span { display: flex; flex-direction: column; align-items: center; gap: 5px; font-weight: 600; font-size: 14px; pointer-events: none; }
.type-option span i     { font-size: 22px; }
.type-option span small { font-size: 11px; font-weight: 400; color: var(--text-muted); }
.type-option.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.type-option.active small { color: var(--primary-dark); }

/* Category grid */
.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.cat-chip {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 6px; border-radius: 10px; border: 2px solid var(--border);
  background: #fff; cursor: pointer; transition: all .2s;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  -webkit-tap-highlight-color: transparent; text-align: center;
  user-select: none;
}
.cat-chip i { font-size: 18px; }
.cat-chip.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
input[name="category"] { display: none; }

/* Quick amounts */
.quick-amounts { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.quick-btn {
  padding: 8px 16px; border-radius: 20px; border: 1.5px solid var(--border);
  background: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .2s; color: var(--text);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.quick-btn:hover, .quick-btn:active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ============================================================ FILTER BAR */
.filter-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-tab {
  padding: 8px 16px; border-radius: 20px; text-decoration: none;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  border: 1.5px solid var(--border); background: #fff; transition: all .2s;
  display: flex; align-items: center; gap: 5px; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.filter-tab:hover, .filter-tab.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ============================================================ SUMMARY BAR */
.summary-bar {
  display: flex; background: var(--card-bg);
  border-radius: var(--radius); border: 1px solid var(--border);
  margin-bottom: 20px; overflow: hidden;
}
.summary-item { flex: 1; display: flex; flex-direction: column; padding: 14px 16px; border-right: 1px solid var(--border); }
.summary-item:last-child { border-right: none; }
.summary-label { font-size: 11px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .4px; }
.summary-val   { font-size: 17px; font-weight: 700; margin-top: 2px; }
.text-wallet   { color: var(--wallet-color); }
.text-card     { color: var(--card-color); }

/* ============================================================ WALLET */
/* Credit card - standard ISO 7810 ratio 85.6mm x 53.98mm = 1.586:1 */
.wallet-hero { margin-bottom: 28px; }
.wallet-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 55%, #7c3aed 100%);
  border-radius: 18px;
  color: #fff;
  width: 100%; max-width: 400px;
  aspect-ratio: 1.586 / 1;
  padding: 7% 8%;
  box-shadow: 0 8px 32px rgba(67,56,202,.35), 0 2px 8px rgba(0,0,0,.15);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
}
.wallet-card::before,
.wallet-card::after {
  content: ''; position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.wallet-card::before { width: 55%; padding-bottom: 55%; top: -20%; right: -15%; }
.wallet-card::after  { width: 40%; padding-bottom: 40%; bottom: -20%; left: -10%; background: rgba(255,255,255,.04); }
.wc-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  position: relative; z-index: 1;
}
.wc-brand { font-size: 15px; font-weight: 800; letter-spacing: .5px; opacity: .95; display: flex; align-items: center; gap: 7px; }
.wc-brand i { font-size: 17px; }
.wc-chip {
  width: 36px; height: 28px; border-radius: 5px;
  background: linear-gradient(135deg, #d4a843, #f0c860);
  display: flex; align-items: center; justify-content: center;
}
.wc-chip-lines {
  width: 22px; height: 18px; border-radius: 2px;
  border: 1.5px solid rgba(160,110,10,.5);
  display: grid; grid-template-rows: 1fr 1fr 1fr;
  gap: 2px; padding: 2px;
}
.wc-chip-lines span { background: rgba(160,110,10,.4); border-radius: 1px; }
.wc-mid { position: relative; z-index: 1; }
.wc-label   { font-size: 10px; opacity: .6; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.wc-balance { font-size: clamp(20px, 5.5vw, 30px); font-weight: 800; letter-spacing: -.5px; line-height: 1; }
.wc-bottom {
  display: flex; justify-content: space-between; align-items: flex-end;
  position: relative; z-index: 1;
}
.wc-holder-label { font-size: 9px; opacity: .5; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 3px; }
.wc-holder-name  { font-size: 13px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; opacity: .9; }
.wc-network { display: flex; align-items: center; }
.wc-circle { width: 26px; height: 26px; border-radius: 50%; opacity: .85; }
.wc-circle:first-child { background: #eb5757; margin-right: -10px; }
.wc-circle:last-child  { background: #f59e0b; }
.wallet-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: #d1fae5; color: #065f46;
  padding: 9px 16px; border-radius: 10px; font-weight: 700; font-size: 14px;
}

/* ============================================================ MONTH INPUT */
.month-input {
  padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 9px;
  font-size: 13.5px; background: #fff; color: var(--text); outline: none;
}
.month-input:focus { border-color: var(--primary); }

/* ============================================================ INPUT ICON */
.input-icon { position: relative; }
.input-icon i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.input-icon input {
  width: 100%; padding: 12px 13px 12px 38px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 15px; outline: none; transition: border-color .2s;
}
.input-icon input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }

/* ============================================================ AUTH */
.auth-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%); padding: 20px;
}
.auth-card { background: #fff; border-radius: 20px; padding: 36px 32px; width: 100%; max-width: 400px; box-shadow: var(--shadow-md); }
.auth-logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: var(--sidebar-bg); margin-bottom: 22px; }
.auth-logo i   { color: var(--primary); font-size: 24px; }
.auth-card h2  { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.auth-sub      { color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }
.auth-hint     { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 16px; }
.auth-credit {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center; font-size: 12px; color: #94a3b8;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.auth-credit i { font-size: 11px; }
.auth-credit strong { color: var(--primary); font-weight: 700; }

/* Sidebar credit */
.sidebar-credit {
  text-align: center; padding: 10px 20px 4px;
  font-size: 11px; color: rgba(165,180,252,.45);
  letter-spacing: .2px;
}
.sidebar-credit strong { color: rgba(165,180,252,.75); font-weight: 600; }

/* ============================================================ EMPTY STATE */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state i { font-size: 38px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 14px; margin-bottom: 16px; }
.empty-state.large { padding: 60px 20px; }

/* ============================================================ CHART PAGE */
.chart-filters {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--card-bg); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 14px 18px; margin-bottom: 20px;
}
.chart-filters label { font-size: 13px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.chart-wrap { position: relative; width: 100%; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }

/* ============================================================ UTILS */
.text-muted    { color: var(--text-muted); font-size: 13px; }
.text-right    { text-align: right; }
.text-center   { text-align: center; }
.text-sm       { font-size: 12px; }
.fw-medium     { font-weight: 600; }
.amount-positive { color: var(--success); }
.amount-negative { color: var(--danger); }

/* ============================================================ RESPONSIVE */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .two-col    { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .mobile-topbar { display: flex; }
  .bottom-nav    { display: flex; }
  .main-content  { margin-left: 0; padding: 16px 14px calc(var(--bottom-nav-h) + 20px); }
  .stats-grid  { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card   { padding: 14px; gap: 10px; }
  .stat-icon   { width: 40px; height: 40px; font-size: 16px; border-radius: 10px; }
  .stat-value  { font-size: 17px; }
  .stat-label  { font-size: 10px; }
  .form-row    { grid-template-columns: 1fr; gap: 0; }
  .page-header { flex-direction: column; gap: 10px; }
  .page-header .btn { align-self: flex-start; }
  .table-desktop  { display: none !important; }
  .expense-list   { display: block; }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .wallet-card { max-width: 100%; }
  .summary-bar  { flex-wrap: wrap; }
  .summary-item { min-width: 45%; border-bottom: 1px solid var(--border); }
  .chart-filters { flex-direction: column; align-items: flex-start; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; justify-content: center; }
  .auth-card { padding: 28px 20px; }
  .wallet-badge { font-size: 13px; padding: 8px 12px; }
}
@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cat-grid   { grid-template-columns: repeat(3, 1fr); }
  .quick-amounts .quick-btn { font-size: 12px; padding: 7px 12px; }
}
