/* ============================================================
   ZAMA — Design System & Styles
   Mobile-first · South African flavour
   ============================================================ */

/* ── Tokens / Variables ────────────────────────────────────── */
:root {
  --green-900: #14532d;
  --green-800: #166534;
  --green-700: #15803d;
  --green-600: #16a34a;
  --green-500: #22c55e;
  --green-400: #4ade80;
  --green-100: #dcfce7;
  --green-50:  #f0fdf4;

  --gold-600:  #d97706;
  --gold-500:  #f59e0b;
  --gold-400:  #fbbf24;
  --gold-100:  #fef3c7;
  --gold-50:   #fffbeb;

  --red-600:   #dc2626;
  --red-100:   #fee2e2;
  --red-50:    #fef2f2;

  --blue-600:  #2563eb;
  --blue-100:  #dbeafe;

  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;

  --white:     #ffffff;

  --primary:   var(--green-700);
  --primary-light: var(--green-100);
  --accent:    var(--gold-500);

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:    0 4px 16px rgba(0,0,0,.1), 0 1px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.14);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --topbar-h:  56px;
  --nav-h:     66px;
  --page-pad:  16px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--slate-100);
  color: var(--slate-800);
  min-height: 100dvh;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
button { border: none; cursor: pointer; background: none; font-family: inherit; }
input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
  border: none;
  outline: none;
  background: transparent;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }

/* ── Splash ─────────────────────────────────────────────────── */
.splash {
  position: fixed; inset: 0;
  background: linear-gradient(160deg, #166534 0%, #15803d 60%, #1a9a4a 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  transition: opacity .4s ease, visibility .4s;
}
.splash.fade-out { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner { text-align: center; color: #fff; }
.splash-logo { margin-bottom: 16px; animation: bounceIn .6s ease; }
.splash-title { font-size: 2.4rem; font-weight: 800; letter-spacing: -.02em; color: #fbbf24; }
.splash-sub   { font-size: .95rem; opacity: .85; margin-top: 4px; }
.splash-loader {
  margin: 28px auto 0;
  width: 140px; height: 4px;
  background: rgba(255,255,255,.25);
  border-radius: 99px; overflow: hidden;
}
.loader-bar {
  width: 40%;
  height: 100%;
  background: #fbbf24;
  border-radius: 99px;
  animation: loadBar 1.4s ease infinite;
}

/* ── App Shell ──────────────────────────────────────────────── */
.app { display: flex; flex-direction: column; height: 100dvh; }

/* ── Top Bar ────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 4px;
  position: sticky; top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 4px; }
.topbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--slate-900);
  padding-left: 4px;
}
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--slate-600);
  transition: background .15s;
}
.icon-btn:hover, .icon-btn:active { background: var(--slate-100); }
.icon-btn svg { width: 22px; height: 22px; }

.token-badge {
  display: flex; align-items: center; gap: 5px;
  background: var(--gold-50);
  border: 1.5px solid var(--gold-400);
  color: var(--gold-600);
  border-radius: 99px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  transition: background .15s;
}
.token-badge:hover { background: var(--gold-100); }

/* ── Page ───────────────────────────────────────────────────── */
.page-wrap {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.page-content { padding-bottom: calc(var(--nav-h) + 16px); }

/* ── Bottom Nav ─────────────────────────────────────────────── */
.bottom-nav {
  height: var(--nav-h);
  background: var(--white);
  border-top: 1px solid var(--slate-200);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
  position: sticky; bottom: 0; z-index: 100;
}
.nav-item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  color: var(--slate-400);
  font-size: .65rem;
  font-weight: 500;
  border-radius: 12px;
  transition: color .15s, background .15s;
  position: relative;
}
.nav-item svg { width: 22px; height: 22px; stroke-width: 1.8; }
.nav-item.active { color: var(--primary); }
.nav-item.active svg { stroke-width: 2.4; }
.nav-item.active::after {
  content: '';
  position: absolute; bottom: 4px;
  width: 4px; height: 4px;
  background: var(--primary);
  border-radius: 50%;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin: var(--page-pad);
  margin-bottom: 0;
}
.card + .card { margin-top: 10px; }
.card-title {
  font-size: 1rem; font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 12px;
}
.card-subtitle { font-size: .82rem; color: var(--slate-500); }

/* ── Hero / Dashboard ───────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #166534 0%, #15803d 50%, #1a9a4a 100%);
  color: #fff;
  padding: 24px var(--page-pad) 32px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -40px;
  width: 160px; height: 160px;
  background: rgba(251,191,36,.08);
  border-radius: 50%;
}
.hero-greeting { font-size: .9rem; opacity: .8; margin-bottom: 4px; }
.hero-name { font-size: 1.6rem; font-weight: 800; margin-bottom: 16px; }
.hero-balance-row {
  display: flex; align-items: center;
  gap: 8px;
  background: rgba(0,0,0,.2);
  border-radius: var(--radius);
  padding: 12px 16px;
  backdrop-filter: blur(10px);
}
.hero-balance-label { font-size: .8rem; opacity: .75; }
.hero-balance-value { font-size: 1.6rem; font-weight: 800; color: var(--gold-400); }
.hero-earn-bar {
  margin-top: 12px;
  background: rgba(0,0,0,.2);
  border-radius: var(--radius);
  padding: 10px 14px;
}
.hero-earn-label { font-size: .75rem; opacity: .75; margin-bottom: 6px; }
.earn-progress { height: 8px; background: rgba(255,255,255,.2); border-radius: 99px; overflow: hidden; }
.earn-progress-fill { height: 100%; background: var(--gold-400); border-radius: 99px; transition: width .4s ease; }
.earn-text { font-size: .75rem; opacity: .8; margin-top: 4px; }

/* ── Quick Actions ──────────────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: var(--page-pad);
}
.qa-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  padding: 12px 4px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-size: .72rem;
  font-weight: 600;
  color: var(--slate-700);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  text-align: center;
}
.qa-item:active { transform: scale(.95); }
.qa-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}

/* ── Section Header ─────────────────────────────────────────── */
.section-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px var(--page-pad) 8px;
}
.section-hdr h2 { font-size: 1rem; font-weight: 700; color: var(--slate-900); }
.section-link { font-size: .82rem; font-weight: 600; color: var(--primary); }

/* ── Gig Cards ──────────────────────────────────────────────── */
.gig-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin: 0 var(--page-pad) 10px;
  padding: 14px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  border-left: 4px solid var(--primary);
}
.gig-card:active { transform: scale(.98); box-shadow: var(--shadow); }
.gig-card.featured { border-left-color: var(--gold-500); }
.gig-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.gig-title { font-size: .95rem; font-weight: 700; color: var(--slate-900); flex: 1; }
.gig-reward {
  background: var(--gold-50);
  color: var(--gold-600);
  border: 1.5px solid var(--gold-400);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
}
.gig-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.gig-tag {
  font-size: .72rem;
  color: var(--slate-500);
  background: var(--slate-100);
  padding: 2px 8px;
  border-radius: 99px;
}
.gig-poster { font-size: .78rem; color: var(--slate-500); margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.star { color: var(--gold-500); }

/* ── Form elements ──────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  background: var(--slate-50);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: .95rem;
  color: var(--slate-900);
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21,128,61,.1);
  background: var(--white);
}
.form-input::placeholder { color: var(--slate-400); }
textarea.form-input { resize: vertical; min-height: 80px; }
select.form-input { appearance: none; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 6px;
  padding: 13px 20px;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  width: 100%;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(21,128,61,.3);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(21,128,61,.4); }
.btn-gold {
  background: var(--gold-500);
  color: #fff;
  box-shadow: 0 4px 14px rgba(245,158,11,.3);
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn-ghost {
  background: var(--slate-100);
  color: var(--slate-700);
}
.btn-danger {
  background: var(--red-600);
  color: #fff;
}
.btn-sm {
  padding: 8px 14px;
  font-size: .82rem;
  border-radius: var(--radius-sm);
  width: auto;
}

/* ── Auth screens ───────────────────────────────────────────── */
.auth-page {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  background: linear-gradient(160deg, #166534 0%, #15803d 55%, #1a9a4a 100%);
}
.auth-hero {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px var(--page-pad) 24px;
  color: #fff;
  text-align: center;
}
.auth-logo {
  width: 72px; height: 72px;
  background: rgba(255,255,255,.15);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold-400);
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255,255,255,.2);
}
.auth-tagline { font-size: 1.6rem; font-weight: 800; line-height: 1.2; margin-bottom: 8px; }
.auth-sub { font-size: .9rem; opacity: .8; }
.auth-sheet {
  background: var(--white);
  border-radius: 28px 28px 0 0;
  padding: 28px var(--page-pad) 40px;
  box-shadow: 0 -8px 40px rgba(0,0,0,.2);
}
.auth-tabs {
  display: flex;
  background: var(--slate-100);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}
.auth-tab {
  flex: 1;
  padding: 9px;
  border-radius: 9px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--slate-500);
  transition: background .15s, color .15s;
}
.auth-tab.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.auth-divider {
  text-align: center;
  font-size: .8rem;
  color: var(--slate-400);
  margin: 16px 0;
  position: relative;
}
.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--slate-200);
}
.auth-divider span {
  background: var(--white);
  padding: 0 12px;
  position: relative;
}
.social-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius);
  font-size: .9rem; font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 8px;
  cursor: pointer;
  transition: background .15s;
}
.social-btn:hover { background: var(--slate-50); }
.social-icon { font-size: 1.1rem; }

/* ── Scout ──────────────────────────────────────────────────── */
.scout-earn-status {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: var(--page-pad);
}
.earn-dot {
  aspect-ratio: 1;
  max-height: 56px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  background: var(--slate-100);
  border: 2px dashed var(--slate-300);
  transition: all .3s;
}
.earn-dot.earned {
  background: var(--green-100);
  border-color: var(--green-500);
  border-style: solid;
}
.upload-area {
  margin: 0 var(--page-pad);
  border: 2px dashed var(--slate-300);
  border-radius: var(--radius-lg);
  padding: 32px var(--page-pad);
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--white);
}
.upload-area.has-image {
  border-color: var(--primary);
  background: var(--green-50);
}
.upload-area:active { background: var(--slate-50); }
.upload-preview {
  width: 100%; max-height: 200px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  margin: 0 auto;
}
.ai-result {
  margin: 10px var(--page-pad) 0;
  padding: 14px;
  border-radius: var(--radius);
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .88rem;
}
.ai-result.success { background: var(--green-100); color: var(--green-800); }
.ai-result.fail { background: var(--red-100); color: var(--red-600); }

/* ── Grocery ─────────────────────────────────────────────────── */
.price-search {
  padding: var(--page-pad);
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  display: flex; gap: 8px;
  position: sticky; top: var(--topbar-h); z-index: 10;
}
.price-search .form-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
}
.product-row {
  padding: 12px var(--page-pad);
  border-bottom: 1px solid var(--slate-100);
}
.product-name { font-size: .92rem; font-weight: 600; color: var(--slate-900); }
.product-stores { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.store-price-chip {
  display: flex; align-items: center; gap: 4px;
  background: var(--slate-100);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: .75rem;
}
.store-price-chip.cheapest {
  background: var(--green-100);
  color: var(--green-800);
  font-weight: 700;
}
.savings-card {
  margin: var(--page-pad);
  background: linear-gradient(135deg, #166534, #15803d);
  border-radius: var(--radius-lg);
  padding: 20px;
  color: #fff;
}
.savings-amount { font-size: 2rem; font-weight: 800; color: var(--gold-400); }

/* ── Budget / Safe-Share ─────────────────────────────────────── */
.health-bar-wrap {
  padding: var(--page-pad);
  background: var(--white);
  border-radius: var(--radius);
  margin: var(--page-pad);
  box-shadow: var(--shadow-sm);
}
.health-bar-label { display: flex; justify-content: space-between; font-size: .8rem; color: var(--slate-600); margin-bottom: 8px; }
.health-bar-track { height: 14px; background: var(--slate-200); border-radius: 99px; overflow: hidden; }
.health-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .6s cubic-bezier(.34, 1.56, .64, 1);
}
.health-bar-fill.green  { background: linear-gradient(90deg, var(--green-500), var(--green-400)); }
.health-bar-fill.yellow { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.health-bar-fill.red    { background: linear-gradient(90deg, #dc2626, #ef4444); }

.member-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--slate-100);
}
.member-card:last-child { border-bottom: none; }
.member-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.member-info { flex: 1; }
.member-name { font-weight: 700; font-size: .9rem; }
.member-contributed { font-size: .8rem; color: var(--slate-500); }
.member-balance {
  font-weight: 700;
  font-size: .88rem;
  text-align: right;
}
.member-balance.owes { color: var(--red-600); }
.member-balance.overpaid { color: var(--primary); }

/* ── Expense list ─────────────────────────────────────────────── */
.expense-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px var(--page-pad);
  border-bottom: 1px solid var(--slate-100);
}
.expense-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.expense-info { flex: 1; min-width: 0; }
.expense-desc { font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.expense-meta { font-size: .75rem; color: var(--slate-500); }
.expense-amount { font-weight: 700; font-size: .9rem; }
.expense-shared-badge {
  font-size: .65rem;
  padding: 2px 6px;
  border-radius: 99px;
  font-weight: 600;
}
.expense-shared-badge.shared { background: var(--blue-100); color: var(--blue-600); }
.expense-shared-badge.personal { background: var(--slate-100); color: var(--slate-500); }
.expense-shared-badge.hidden-item { background: var(--slate-100); color: var(--slate-400); font-style: italic; }

/* ── Chat ─────────────────────────────────────────────────────── */
.chat-wrap { display: flex; flex-direction: column; height: calc(100dvh - var(--topbar-h) - var(--nav-h)); }
.chat-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.msg-row { display: flex; }
.msg-row.mine { justify-content: flex-end; }
.msg-bubble {
  max-width: 75%;
  padding: 9px 14px;
  border-radius: 18px;
  font-size: .88rem;
  line-height: 1.45;
}
.msg-bubble.theirs { background: var(--white); border-radius: 4px 18px 18px 18px; box-shadow: var(--shadow-sm); }
.msg-bubble.mine { background: var(--primary); color: #fff; border-radius: 18px 4px 18px 18px; }
.msg-time { font-size: .65rem; color: var(--slate-400); text-align: right; margin-top: 2px; }
.chat-input-row {
  padding: 10px;
  background: var(--white);
  border-top: 1px solid var(--slate-200);
  display: flex; gap: 8px; align-items: flex-end;
}
.chat-input {
  flex: 1;
  background: var(--slate-100);
  border-radius: 20px;
  padding: 10px 14px;
  font-size: .9rem;
  color: var(--slate-900);
  max-height: 120px;
  resize: none;
  overflow-y: auto;
}
.send-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: opacity .15s;
}
.send-btn:disabled { opacity: .4; }

/* ── Wallet ──────────────────────────────────────────────────── */
.wallet-hero {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #fff;
  padding: 28px var(--page-pad) 36px;
  text-align: center;
}
.wallet-balance { font-size: 3rem; font-weight: 800; color: var(--gold-400); line-height: 1; }
.wallet-balance-label { font-size: .85rem; opacity: .7; margin-top: 4px; }
.pack-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  margin: 10px var(--page-pad) 0;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  border: 2px solid transparent;
}
.pack-card.selected { border-color: var(--primary); background: var(--green-50); }
.pack-card:active { transform: scale(.98); }
.pack-emoji { font-size: 1.8rem; }
.pack-info { flex: 1; }
.pack-name { font-weight: 700; font-size: .95rem; }
.pack-sub { font-size: .78rem; color: var(--slate-500); }
.pack-price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
}
.transaction-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px var(--page-pad);
  border-bottom: 1px solid var(--slate-100);
}
.tx-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.tx-icon.earn { background: var(--green-100); }
.tx-icon.spend { background: var(--red-100); }
.tx-icon.purchase { background: var(--gold-100); }
.tx-amount { font-weight: 700; font-size: .92rem; }
.tx-amount.earn { color: var(--primary); }
.tx-amount.spend, .tx-amount.escrow_in { color: var(--red-600); }
.tx-amount.purchase { color: var(--gold-600); }

/* ── Ratings / Stars ─────────────────────────────────────────── */
.star-row { display: flex; gap: 4px; }
.star-btn { font-size: 1.6rem; cursor: pointer; transition: transform .1s; }
.star-btn:active { transform: scale(1.2); }

/* ── Empty states ─────────────────────────────────────────────── */
.empty-state {
  padding: 48px var(--page-pad);
  text-align: center;
  color: var(--slate-400);
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-title { font-size: 1.1rem; font-weight: 700; color: var(--slate-600); margin-bottom: 8px; }
.empty-sub { font-size: .85rem; line-height: 1.5; }

/* ── Toast ─────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%; transform: translateX(-50%);
  background: var(--slate-900);
  color: #fff;
  padding: 12px 20px;
  border-radius: 99px;
  font-size: .88rem;
  font-weight: 600;
  z-index: 999;
  white-space: nowrap;
  max-width: 90vw;
  white-space: normal;
  text-align: center;
  animation: slideUp .25s ease;
}
.toast.success { background: var(--green-700); }
.toast.error   { background: var(--red-600); }

/* ── Modal / Bottom Sheet ─────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  backdrop-filter: blur(2px);
}
.modal {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  z-index: 201;
  padding: 0 0 env(safe-area-inset-bottom);
  max-height: 90dvh;
  overflow-y: auto;
  animation: slideUp .25s cubic-bezier(.34, 1.2, .64, 1);
}
.modal-handle {
  width: 36px; height: 4px;
  background: var(--slate-300);
  border-radius: 99px;
  margin: 12px auto 0;
}
.modal-inner { padding: 16px var(--page-pad) 32px; }
.modal-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 16px; color: var(--slate-900); }

/* ── Loading spinner ──────────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--slate-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
.page-loading {
  display: flex; align-items: center; justify-content: center;
  height: 200px;
}

/* ── Chip / Badge ─────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
}
.chip-green { background: var(--green-100); color: var(--green-800); }
.chip-gold  { background: var(--gold-100);  color: var(--gold-600);  }
.chip-red   { background: var(--red-100);   color: var(--red-600);   }
.chip-slate { background: var(--slate-200); color: var(--slate-600); }

/* ── Filter chips row ─────────────────────────────────────────── */
.filter-row {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 0 var(--page-pad) 12px;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: .8rem;
  font-weight: 600;
  background: var(--white);
  color: var(--slate-600);
  border: 1.5px solid var(--slate-200);
  cursor: pointer;
  transition: all .15s;
}
.filter-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── Divider ──────────────────────────────────────────────────── */
.divider {
  height: 8px;
  background: var(--slate-100);
  margin: 0 calc(-1 * var(--page-pad));
}

/* ── Avatar ───────────────────────────────────────────────────── */
.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

/* ── Animations ───────────────────────────────────────────────── */
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes bounceIn {
  0%   { transform: scale(.5); opacity: 0; }
  70%  { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes loadBar {
  0%   { transform: translateX(-100%); }
  50%  { transform: translateX(200%); }
  100% { transform: translateX(-100%); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (min-width: 480px) {
  .app, .modal { max-width: 480px; margin: 0 auto; }
  .auth-page { max-width: 480px; margin: 0 auto; }
}
@media (prefers-color-scheme: dark) {
  /* Optional dark mode — enable if desired */
}

/* ── Utility ──────────────────────────────────────────────────── */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--slate-500); }
.text-sm { font-size: .82rem; }
.text-xs { font-size: .72rem; }
.font-bold { font-weight: 700; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.w-full { width: 100%; }
.p-pad { padding: var(--page-pad); }
