:root {
  --bg: #0a0a0b;
  --surface: #121214;
  --card: #161618;
  --elevated: #1a1a1d;
  --border: #2a2a2e;
  --border-subtle: #1f1f22;
  --text: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #f472b6;
  --positive: #22c55e;
  --negative: #ef4444;
  --warning: #f59e0b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

a { color: inherit; text-decoration: none; }

.app {
  max-width: 430px;
  margin: 0 auto;
  padding-bottom: 88px;
  min-height: 100vh;
}

.demo-banner {
  background: rgba(245, 158, 11, 0.12);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  color: #fcd34d;
  font-size: 11px;
  text-align: center;
  padding: 8px 12px;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--elevated);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 15px;
}
.welcome { font-size: 12px; color: var(--text-muted); }
.name { font-size: 15px; font-weight: 600; line-height: 1.2; }
.header-right { display: flex; align-items: center; gap: 8px; }
.premium {
  background: rgba(244, 114, 182, 0.2);
  color: #f9a8d4;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
}
.icon-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--elevated);
  border: none;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.badge {
  position: absolute;
  top: -2px; right: -2px;
  background: #ec4899;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* Balance */
.balance-section { padding: 8px 20px 24px; }
.currency-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.chip {
  background: rgba(244, 114, 182, 0.15);
  color: #f9a8d4;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 999px;
}
.rate { font-size: 12px; color: var(--text-muted); }
.balance {
  font-size: 42px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin: 4px 0 8px;
}
.change-row { margin-bottom: 20px; }
.change {
  display: inline-flex;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
}
.change.positive { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.actions { display: flex; gap: 12px; }
.btn {
  flex: 1;
  height: 44px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform 0.15s, background 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: #fff; color: #000; }
.btn-primary:hover { background: #e4e4e7; }
.btn-secondary {
  background: var(--elevated);
  color: #fff;
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

/* Quick stats */
.quick-stats {
  display: flex;
  gap: 1px;
  margin: 0 16px 20px;
  background: var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}
.stat {
  flex: 1;
  background: var(--card);
  padding: 12px;
  text-align: center;
}
.stat-label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.stat-val { font-size: 14px; font-weight: 600; }

/* Card / transactions */
.card {
  margin: 0 16px 24px;
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.card-header h2 { font-size: 15px; font-weight: 600; }
.card-header a { font-size: 12px; color: var(--text-muted); }
.day-label {
  padding: 12px 16px 4px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.tx {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  transition: background 0.15s;
}
.tx:hover { background: rgba(255,255,255,0.03); }
.tx-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; color: #fff;
  flex-shrink: 0;
}
.tx-body { flex: 1; min-width: 0; }
.tx-merchant { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-cat { font-size: 12px; color: var(--text-muted); }
.tx-amount {
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.tx-amount.credit { color: #4ade80; }

.footer-note {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 20px 16px;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(18, 18, 20, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: center;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 64px;
  padding: 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
}
.nav-item.active { color: #fff; }
.nav-item svg { margin-bottom: 2px; }

/* Shared page styles */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 12px;
}
.page-header h1 { font-size: 20px; font-weight: 600; }
.back-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--elevated);
  border: none;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 16px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-group input, .form-group select {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #fff;
  padding: 0 16px;
  font-size: 15px;
  outline: none;
}
.form-group input:focus, .form-group select:focus {
  border-color: rgba(244, 114, 182, 0.5);
}
.amount-input {
  height: 56px !important;
  font-size: 24px !important;
  font-weight: 600 !important;
  font-variant-numeric: tabular-nums;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); }
.detail-value { color: #fff; font-weight: 500; }

.card-visual {
  background: linear-gradient(135deg, #27272a, #18181b);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}
.card-number {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.15em;
  font-size: 17px;
  margin: 24px 0 16px;
}
