/* ═══════════════════════════════════════════════
   MC Legacy — Fintech Design System
   Teal · Mobile-first · Light & Dark mode
   ═══════════════════════════════════════════════ */

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

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

/* ══════════════════════════════════════════════
   DESIGN TOKENS
   ══════════════════════════════════════════════ */
:root {
  /* Teal brand */
  --teal:       #008080;
  --teal-dk:    #006666;
  --teal-dim:   rgba(0,128,128,0.13);
  --teal-glow:  rgba(0,128,128,0.28);
  --teal-border:rgba(0,128,128,0.22);

  /* Semantic */
  --green:      #22D395;
  --green-dim:  rgba(34,211,149,0.13);
  --red:        #F5415A;
  --red-dim:    rgba(245,65,90,0.13);
  --amber:      #F59E0B;
  --amber-dim:  rgba(245,158,11,0.13);
  --blue:       #4A8CF7;
  --blue-dim:   rgba(74,140,247,0.13);
  --purple:     #A855F7;
  --purple-dim: rgba(168,85,247,0.13);

  /* Typography */
  --font:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:  'JetBrains Mono', 'SF Mono', monospace;

  /* Radii */
  --r-xs:   6px;
  --r-sm:   10px;
  --r-md:   16px;
  --r-lg:   22px;
  --r-xl:   28px;
  --r-full: 9999px;

  /* Motion */
  --t: .18s ease;
  --t-long: .3s ease;
}

/* ── DARK (default) ── */
:root, [data-theme="dark"] {
  --bg:       #060F0E;
  --surface:  #0A1716;
  --card:     #0F1F1E;
  --card-2:   #142928;
  --card-3:   #1A3332;
  --border:   rgba(0,128,128,0.07);
  --border-2: rgba(0,128,128,0.14);
  --text:     #DFF5F2;
  --text-2:   #6DB8B3;
  --text-3:   #3D7A76;
  --overlay:  rgba(0,0,0,0.72);
  --shadow:   0 8px 32px rgba(0,0,0,0.45);
  --header-bg:rgba(6,15,14,0.88);
  color-scheme: dark;
}

/* ── LIGHT ── */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:       #EAF7F5;
    --surface:  #FFFFFF;
    --card:     #FFFFFF;
    --card-2:   #F0FBF9;
    --card-3:   #E4F7F4;
    --border:   rgba(0,0,0,0.08);
    --border-2: rgba(0,0,0,0.15);
    --text:     #071615;
    --text-2:   #2D6B67;
    --text-3:   #7AADAA;
    --overlay:  rgba(0,0,0,0.55);
    --shadow:   0 4px 24px rgba(0,0,0,0.09);
    --header-bg:rgba(234,247,245,0.9);
    color-scheme: light;
  }
}
[data-theme="light"] {
  --bg:       #EAF7F5;
  --surface:  #FFFFFF;
  --card:     #FFFFFF;
  --card-2:   #F0FBF9;
  --card-3:   #E4F7F4;
  --border:   rgba(0,0,0,0.08);
  --border-2: rgba(0,0,0,0.15);
  --text:     #071615;
  --text-2:   #2D6B67;
  --text-3:   #7AADAA;
  --overlay:  rgba(0,0,0,0.55);
  --shadow:   0 4px 24px rgba(0,0,0,0.09);
  --header-bg:rgba(234,247,245,0.9);
  color-scheme: light;
}

/* ══════════════════════════════════════════════
   BASE
   ══════════════════════════════════════════════ */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--t-long), color var(--t-long);
}

/* Mobile centering — keeps it phone-shaped on desktop */
.app-shell {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
}

/* ══════════════════════════════════════════════
   HEADER / NAV
   ══════════════════════════════════════════════ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  padding: 0 1rem;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-shrink: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dk) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 4px 12px var(--teal-glow);
  flex-shrink: 0;
}

.brand-name {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}
.brand-name span { color: var(--teal); }

.header-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: .82rem;
  transition: all var(--t);
  flex-shrink: 0;
  position: relative;
}
.icon-btn:hover { border-color: var(--teal-border); color: var(--teal); background: var(--teal-dim); }

/* ── Back button ── */
.back-btn {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--teal);
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem .6rem .4rem 0;
  transition: opacity var(--t);
}
.back-btn:hover { opacity: .75; }

/* ══════════════════════════════════════════════
   PAGE WRAPPER
   ══════════════════════════════════════════════ */
.page {
  padding: 1.25rem 1rem 5rem;
}
.page-narrow {
  padding: 1.5rem 1.25rem 5rem;
}

/* ══════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
}
.card + .card, .card + .card-section { margin-top: .75rem; }

.card-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-top: .75rem;
}
.card-section-hd {
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Hero balance card */
.balance-card {
  background: linear-gradient(145deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--teal-border);
  border-radius: var(--r-xl);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.balance-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--teal-glow) 0%, transparent 70%);
  pointer-events: none;
}
.balance-label {
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: .35rem;
}
.balance-amount {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.03em;
  line-height: 1.1;
}
.balance-amount .currency { font-size: 1.1rem; color: var(--teal); margin-right: .1rem; }
.balance-sub {
  font-size: .72rem;
  color: var(--text-3);
  margin-top: .35rem;
}

/* ══════════════════════════════════════════════
   SECTION TITLE
   ══════════════════════════════════════════════ */
.section-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  margin-bottom: .65rem;
}

/* ══════════════════════════════════════════════
   TYPOGRAPHY
   ══════════════════════════════════════════════ */
.page-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: .25rem;
}
.page-subtitle {
  font-size: .82rem;
  color: var(--text-2);
  line-height: 1.5;
}

/* ══════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════ */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .8rem 1.25rem;
  border-radius: var(--r-md);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: all var(--t);
  border: none;
  white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.btn-primary {
  background: var(--teal);
  color: #ffffff;
  box-shadow: 0 4px 16px var(--teal-glow);
}
.btn-primary:hover:not(:disabled) { background: var(--teal-dk); transform: translateY(-1px); box-shadow: 0 6px 22px var(--teal-glow); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border-2);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--teal-border); color: var(--teal); background: var(--teal-dim); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--border-2); background: var(--card-2); }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(245,65,90,.2);
}
.btn-danger:hover:not(:disabled) { background: var(--red); color: #fff; }

.btn-sm { padding: .5rem .9rem; font-size: .8rem; border-radius: var(--r-sm); }
.btn-lg { padding: 1rem 1.5rem; font-size: .95rem; border-radius: var(--r-md); }
.btn-full { width: 100%; }

/* ── Action grid (dashboard quick actions) ── */
.action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .6rem;
}
.action-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  padding: .9rem .5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t);
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
}
.action-tile:hover { border-color: var(--teal-border); color: var(--teal); background: var(--teal-dim); }
.action-tile .ico {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  transition: all var(--t);
}
.action-tile:hover .ico { transform: scale(1.08); }

/* ══════════════════════════════════════════════
   FORM ELEMENTS
   ══════════════════════════════════════════════ */
.f-group { margin-bottom: .9rem; }
.f-group:last-child { margin-bottom: 0; }

.f-label {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .4rem;
}

.f-wrap { position: relative; }
.f-icon {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: .82rem;
  pointer-events: none;
}

.f-input {
  width: 100%;
  padding: .8rem 1rem .8rem 2.6rem;
  background: var(--card-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: .9rem;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  -webkit-appearance: none;
}
.f-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-dim);
}
.f-input::placeholder { color: var(--text-3); }
.f-input:disabled { opacity: .5; cursor: not-allowed; }
.f-input.no-icon { padding-left: 1rem; }
.f-input.has-right { padding-right: 2.8rem; }

.f-right-btn {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: .82rem;
  padding: .2rem;
  transition: color var(--t);
}
.f-right-btn:hover { color: var(--teal); }

.f-hint {
  font-size: .7rem;
  color: var(--text-3);
  margin-top: .35rem;
}
.f-error-msg {
  font-size: .7rem;
  color: var(--red);
  margin-top: .35rem;
}

.f-select {
  width: 100%;
  padding: .8rem 2.2rem .8rem 1rem;
  background: var(--card-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: .9rem;
  outline: none;
  transition: border-color var(--t);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23008080' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
}
.f-select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); }

/* ── Checkbox / toggle ── */
.f-check-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  cursor: pointer;
}
.f-check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  accent-color: var(--teal);
  cursor: pointer;
  flex-shrink: 0;
}
.f-check-label { font-size: .83rem; color: var(--text-2); cursor: pointer; user-select: none; }

/* ══════════════════════════════════════════════
   OTP CELLS
   ══════════════════════════════════════════════ */
.otp-row {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin-bottom: 1.25rem;
}
.otp-cell {
  width: 46px;
  height: 56px;
  background: var(--card-2);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--mono);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  caret-color: var(--teal);
}
.otp-cell:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); }
.otp-cell.filled { border-color: var(--teal-border); background: var(--teal-dim); }

/* ══════════════════════════════════════════════
   NUMPAD (MPIN)
   ══════════════════════════════════════════════ */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  margin-top: .75rem;
}
.numpad-key {
  padding: .9rem;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all var(--t);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.numpad-key:active, .numpad-key:hover { background: var(--teal-dim); border-color: var(--teal-border); color: var(--teal); }
.numpad-key.del { color: var(--red); }
.numpad-key.del:hover { background: var(--red-dim); border-color: rgba(245,65,90,.2); }

.pin-dots {
  display: flex;
  justify-content: center;
  gap: .75rem;
  margin-bottom: .75rem;
}
.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-2);
  background: transparent;
  transition: all var(--t);
}
.pin-dot.filled { background: var(--teal); border-color: var(--teal); box-shadow: 0 0 8px var(--teal-glow); }

/* ══════════════════════════════════════════════
   ALERTS / TOASTS
   ══════════════════════════════════════════════ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .8rem 1rem;
  border-radius: var(--r-md);
  font-size: .82rem;
  line-height: 1.55;
  border: 1px solid transparent;
  margin-bottom: .9rem;
  animation: alertIn .25s ease;
}
@keyframes alertIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }
.alert i { margin-top: .05rem; flex-shrink: 0; }
.alert-success { background: var(--green-dim); color: var(--green);   border-color: rgba(34,211,149,.22); }
.alert-error   { background: var(--red-dim);   color: var(--red);     border-color: rgba(245,65,90,.22);  }
.alert-warn    { background: var(--amber-dim);  color: var(--amber);   border-color: rgba(245,158,11,.22); }
.alert-info    { background: var(--teal-dim);   color: var(--teal);    border-color: var(--teal-border);   }

/* Toast */
.toast {
  position: fixed;
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--card-3);
  color: var(--text);
  border: 1px solid var(--border-2);
  padding: .65rem 1.2rem;
  border-radius: var(--r-full);
  font-size: .82rem;
  font-weight: 600;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: var(--shadow);
  animation: toastIn .25s ease forwards;
  pointer-events: none;
}
.toast.success { background: var(--teal); color: #ffffff; border-color: transparent; }
.toast.error   { background: var(--red);  color: #fff;    border-color: transparent; }
@keyframes toastIn { to { transform: translateX(-50%) translateY(0); opacity: 1; } }

/* ══════════════════════════════════════════════
   BADGES / PILLS
   ══════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .6rem;
  border-radius: var(--r-full);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.badge-success  { background: var(--green-dim);  color: var(--green);  }
.badge-refunded { background: var(--amber-dim);  color: var(--amber);  }
.badge-pending  { background: var(--blue-dim);   color: var(--blue);   }
.badge-failed   { background: var(--red-dim);    color: var(--red);    }
.badge-teal     { background: var(--teal-dim);   color: var(--teal);   }
.badge-purple   { background: var(--purple-dim); color: var(--purple); }

/* ══════════════════════════════════════════════
   LIST ROW (transactions, settings rows)
   ══════════════════════════════════════════════ */
.list-row {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
  cursor: pointer;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--card-2); }

.row-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}

.row-body { flex: 1; min-width: 0; }
.row-title {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-sub {
  font-size: .72rem;
  color: var(--text-3);
  margin-top: .1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-right {
  text-align: right;
  flex-shrink: 0;
}
.row-amount {
  font-family: var(--mono);
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
}
.row-amount.debit  { color: var(--red); }
.row-amount.credit { color: var(--green); }
.row-time {
  font-size: .68rem;
  color: var(--text-3);
  margin-top: .1rem;
}

/* ══════════════════════════════════════════════
   MODAL / BOTTOM SHEET
   ══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: overlayIn var(--t-long) ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
@keyframes overlayIn { from { opacity:0; } to { opacity:1; } }

.bottom-sheet {
  width: 100%;
  max-width: 430px;
  background: var(--card);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
  animation: sheetIn .3s cubic-bezier(.32,.72,0,1);
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
@keyframes sheetIn { from { transform:translateY(100%); } to { transform:translateY(0); } }

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-2);
  margin: 0 auto 1.25rem;
}

.sheet-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
}

/* Center modal (for PIN, confirm dialogs) */
.modal-center {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: overlayIn var(--t-long) ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-box {
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.5rem;
  animation: boxIn .28s cubic-bezier(.32,.72,0,1);
}
@keyframes boxIn { from { opacity:0; transform:scale(.95) translateY(8px); } to { opacity:1; transform:scale(1) translateY(0); } }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.modal-head h3 { font-size: .98rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 1rem;
  padding: .1rem;
  transition: color var(--t);
}
.modal-close:hover { color: var(--red); }

/* ══════════════════════════════════════════════
   BOTTOM TAB BAR
   ══════════════════════════════════════════════ */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: calc(58px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--header-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 100;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  font-size: .62rem;
  font-weight: 600;
  color: var(--text-3);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  transition: color var(--t);
  padding: .5rem .25rem;
  letter-spacing: .02em;
}
.tab-item i { font-size: 1.1rem; transition: transform var(--t); }
.tab-item:hover, .tab-item.active { color: var(--teal); }
.tab-item.active i { transform: scale(1.1); }

/* ══════════════════════════════════════════════
   STATS GRID
   ══════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .6rem;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem;
}
.stat-card .stat-label {
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .35rem;
}
.stat-card .stat-value {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}
.stat-card .stat-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  margin-bottom: .5rem;
}

/* ══════════════════════════════════════════════
   DIVIDER
   ══════════════════════════════════════════════ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1rem 0;
}
.divider-label {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .7rem;
  color: var(--text-3);
  margin: 1rem 0;
}
.divider-label::before, .divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ══════════════════════════════════════════════
   SKELETON LOADER
   ══════════════════════════════════════════════ */
@keyframes shimmer {
  0% { background-position: -300px 0; }
  100% { background-position: 300px 0; }
}
.skeleton {
  border-radius: var(--r-sm);
  animation: shimmer 1.5s infinite linear;
}
[data-theme="dark"] .skeleton,
:root .skeleton {
  background: linear-gradient(90deg, var(--card-2) 25%, var(--card-3) 50%, var(--card-2) 75%);
  background-size: 600px 100%;
}
[data-theme="light"] .skeleton {
  background: linear-gradient(90deg, #e8f5f3 25%, #d0eeea 50%, #e8f5f3 75%);
  background-size: 600px 100%;
}

/* ══════════════════════════════════════════════
   PROGRESS BAR
   ══════════════════════════════════════════════ */
.progress-wrap {
  height: 4px;
  background: var(--border);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal-dk));
  border-radius: var(--r-full);
  transition: width .4s ease;
}

/* ══════════════════════════════════════════════
   CHIP / TAG
   ══════════════════════════════════════════════ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .65rem;
  border-radius: var(--r-full);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .02em;
  border: 1px solid transparent;
  transition: all var(--t);
  cursor: default;
}
.chip-teal   { background: var(--teal-dim);   color: var(--teal);   border-color: var(--teal-border); }
.chip-green  { background: var(--green-dim);  color: var(--green);  border-color: rgba(34,211,149,.2); }
.chip-amber  { background: var(--amber-dim);  color: var(--amber);  border-color: rgba(245,158,11,.2); }
.chip-red    { background: var(--red-dim);    color: var(--red);    border-color: rgba(245,65,90,.2);  }

/* ══════════════════════════════════════════════
   AUTH PAGES (login, register, forgot)
   ══════════════════════════════════════════════ */
.auth-wrap {
  min-height: 100vh;
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 2rem 1.25rem calc(2rem + env(safe-area-inset-bottom));
}
.auth-logo {
  text-align: center;
  margin-bottom: 2.25rem;
  padding-top: .5rem;
}
.auth-logo-mark {
  width: 68px;
  height: 68px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dk) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #ffffff;
  margin: 0 auto .85rem;
  box-shadow: 0 12px 32px var(--teal-glow);
}
.auth-logo-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
}
.auth-logo-title span { color: var(--teal); }
.auth-logo-sub {
  font-size: .78rem;
  color: var(--text-3);
  margin-top: .25rem;
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.5rem;
  animation: authIn .35s ease;
}
@keyframes authIn { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:translateY(0); } }

.auth-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--text);
  margin-bottom: .3rem;
}
.auth-sub {
  font-size: .8rem;
  color: var(--text-2);
  margin-bottom: 1.4rem;
  line-height: 1.5;
}

/* Steps indicator */
.step-dots {
  display: flex;
  justify-content: center;
  gap: .4rem;
  margin-bottom: 1.5rem;
}
.step-dot {
  height: 3px;
  border-radius: var(--r-full);
  background: var(--border-2);
  transition: all .25s;
  width: 20px;
}
.step-dot.active { background: var(--teal); width: 32px; }

/* ══════════════════════════════════════════════
   FILTER STRIP
   ══════════════════════════════════════════════ */
.filter-strip {
  display: flex;
  gap: .45rem;
  overflow-x: auto;
  padding-bottom: .25rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-bottom: .9rem;
}
.filter-strip::-webkit-scrollbar { display: none; }

.filter-pill {
  flex-shrink: 0;
  padding: .4rem .85rem;
  border-radius: var(--r-full);
  font-size: .75rem;
  font-weight: 600;
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
}
.filter-pill:hover { border-color: var(--teal-border); color: var(--teal); }
.filter-pill.active { background: var(--teal-dim); border-color: var(--teal-border); color: var(--teal); }

/* ══════════════════════════════════════════════
   SEGMENTED CONTROL
   ══════════════════════════════════════════════ */
.seg-ctrl {
  display: flex;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: .2rem;
  gap: .2rem;
}
.seg-opt {
  flex: 1;
  padding: .55rem;
  border-radius: 10px;
  text-align: center;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t);
  border: none;
  background: none;
}
.seg-opt.active {
  background: var(--teal);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--teal-glow);
}

/* ══════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}
.empty-state .empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--teal-dim);
  border: 1px solid var(--teal-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--teal);
  margin: 0 auto 1rem;
}
.empty-state h4 { font-size: .95rem; font-weight: 700; color: var(--text); margin-bottom: .4rem; }
.empty-state p  { font-size: .8rem; color: var(--text-3); line-height: 1.5; }

/* ══════════════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════════════ */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }

/* ══════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════ */
@keyframes fadeIn   { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp  { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
@keyframes spin     { to { transform:rotate(360deg); } }
.spin { animation: spin .8s linear infinite; }
.fade-in { animation: fadeIn .3s ease; }

/* ══════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════ */
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-sm { margin-top: .5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.mb-sm { margin-bottom: .5rem; }
.mb-md { margin-bottom: 1rem; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-teal   { color: var(--teal); }
.text-muted  { color: var(--text-2); }
.text-faint  { color: var(--text-3); }
.text-red    { color: var(--red); }
.text-green  { color: var(--green); }
.text-amber  { color: var(--amber); }
.text-sm     { font-size: .8rem; }
.text-xs     { font-size: .72rem; }
.font-mono   { font-family: var(--mono); }
.font-bold   { font-weight: 700; }
.font-semibold { font-weight: 600; }

.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-col    { display: flex; flex-direction: column; }
.gap-xs      { gap: .35rem; }
.gap-sm      { gap: .6rem; }
.gap-md      { gap: 1rem; }
.items-center{ align-items: center; }
.flex-1      { flex: 1; }

.w-full      { width: 100%; }
.hidden      { display: none !important; }
.truncate    { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Safe area padding for fixed bottom elements */
.pb-safe { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
