/* track.smartcodedbot.com · bank-app personal finance · v2 */
:root {
  --bg: #0a0a0a;
  --bg-elev: #131313;
  --bg-card: #181818;
  --bg-card-2: #1f1f1f;
  --border: #262626;
  --text: #f8f8f8;
  --text-dim: #a1a1aa;
  --text-mute: #71717a;
  --accent: #f97316;
  --accent-soft: rgba(249, 115, 22, 0.15);
  --base: #0052FF;
  --base-soft: rgba(0, 82, 255, 0.15);
  --up: #10d188;
  --down: #ef4444;
  --warn: #fbbf24;
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); color: var(--text); min-height: 100%; overscroll-behavior-y: contain; }

/* MOVING BACKGROUND · subtle radial gradients drifting */
.bg-anim {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(circle at 20% 10%, rgba(249,115,22,0.10), transparent 50%),
    radial-gradient(circle at 80% 90%, rgba(0,82,255,0.08), transparent 50%),
    radial-gradient(circle at 60% 30%, rgba(167,139,250,0.06), transparent 60%),
    var(--bg);
  animation: bg-drift 30s ease-in-out infinite alternate;
}
@keyframes bg-drift {
  0%   { background-position: 0% 0%, 100% 100%, 50% 50%; transform: scale(1); }
  50%  { background-position: 25% 15%, 75% 85%, 60% 40%; transform: scale(1.04); }
  100% { background-position: 15% 25%, 85% 75%, 40% 60%; transform: scale(1); }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'tnum' 1, 'cv11' 1;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.45;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}
button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
input, select, textarea { background: none; border: 0; color: inherit; font: inherit; outline: none; }

.muted { color: var(--text-dim); }
.muted.small { font-size: 12px; color: var(--text-mute); }

/* LOGIN */
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(ellipse at top, rgba(249,115,22,0.10), transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.brand-mark { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(249,115,22,0.6); }
.brand-name { font-weight: 800; letter-spacing: -0.5px; }
.login-card h1 { font-size: 28px; font-weight: 800; letter-spacing: -1px; }
.login-card p.muted { color: var(--text-dim); margin-bottom: 24px; }
#login-form { display: flex; flex-direction: column; gap: 12px; }
#login-form input { width: 100%; padding: 16px 18px; border-radius: var(--r-md); background: var(--bg-elev); border: 1px solid var(--border); font-size: 16px; }
#login-form input:focus { border-color: var(--accent); }
#login-form button { padding: 16px; border-radius: var(--r-md); background: var(--accent); color: #fff; font-weight: 700; font-size: 16px; transition: transform 0.1s; }
#login-form button:active { transform: scale(0.98); }
.err { color: var(--down); font-size: 13px; min-height: 18px; }

/* SCREEN BASE */
.screen { padding: 20px 18px 100px; max-width: 480px; margin: 0 auto; }
.screen header.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.screen h1.big { font-size: 28px; font-weight: 800; letter-spacing: -1px; }
.screen .hi .muted.small { font-size: 12px; color: var(--text-mute); }
.screen .hi .big { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* + button in headers */
.add-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 22px; font-weight: 600; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(249,115,22,0.4);
  transition: transform 0.15s;
}
.add-btn:active { transform: scale(0.92); }

/* PRIVACY EYE TOGGLE */
.privacy-toggle { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-dim); font-size: 16px; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.privacy-toggle:active { transform: scale(0.92); }
.privacy-toggle:hover { color: var(--text); border-color: var(--accent); }

/* BANNER · rotating tips on home */
.banner { position: relative; height: 56px; margin-bottom: 16px; border-radius: var(--r-md); overflow: hidden; background: linear-gradient(135deg, rgba(249,115,22,0.10) 0%, rgba(0,82,255,0.08) 50%, rgba(249,115,22,0.06) 100%); border: 1px solid var(--border); }
.banner::before { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.05) 50%, transparent 70%); animation: banner-shine 4s linear infinite; }
@keyframes banner-shine { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.banner-track { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 16px; font-size: 13px; color: var(--text); font-weight: 500; }
.banner-track .item { width: 100%; opacity: 0; transition: opacity 0.5s; position: absolute; left: 16px; right: 16px; }
.banner-track .item.show { opacity: 1; }
.banner-track .item b { color: var(--accent); font-weight: 700; }

/* PAGE ENTRY ANIMATION */
.screen { opacity: 0; transform: translateY(8px); transition: opacity 0.3s, transform 0.3s; }
.screen.screen-in { opacity: 1; transform: translateY(0); }

/* HERO VALUE PULSE */
.hero-value { transition: color 0.2s; }
.hero-card:hover .hero-value { color: #fff; }

/* Stagger fade-in for grids */
.accounts-grid > * { animation: fade-up 0.4s ease-out backwards; }
.accounts-grid > *:nth-child(1) { animation-delay: 0.05s; }
.accounts-grid > *:nth-child(2) { animation-delay: 0.10s; }
.accounts-grid > *:nth-child(3) { animation-delay: 0.15s; }
.accounts-grid > *:nth-child(4) { animation-delay: 0.20s; }
.accounts-grid > *:nth-child(5) { animation-delay: 0.25s; }
.top-cats > *, .activity-list > * { animation: fade-up 0.4s ease-out backwards; }
.top-cats > *:nth-child(2) { animation-delay: 0.05s; }
.top-cats > *:nth-child(3) { animation-delay: 0.10s; }
.activity-list > *:nth-child(2) { animation-delay: 0.05s; }
.activity-list > *:nth-child(3) { animation-delay: 0.10s; }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* CURRENCY TABS */
.ccy-tabs { display: flex; background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px; padding: 3px; font-size: 12px; }
.ccy-tabs button { padding: 6px 12px; border-radius: 999px; color: var(--text-dim); font-weight: 600; transition: 0.15s; }
.ccy-tabs button.active { background: var(--accent); color: #fff; }

/* HERO CARD */
.hero-card {
  background: linear-gradient(160deg, #1a1a1a 0%, #111 80%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: ''; position: absolute; top: 0; right: 0; width: 60%; height: 60%;
  background: radial-gradient(circle, rgba(249,115,22,0.12), transparent 70%);
  pointer-events: none;
}
.hero-label { font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; }
.hero-value { font-size: 44px; font-weight: 800; letter-spacing: -2px; margin-top: 6px; line-height: 1.1; }
.hero-sub { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.hero-divider { height: 1px; background: var(--border); margin: 18px 0; }
.month-row { display: flex; justify-content: space-between; }
.month-col.right { text-align: right; }
.amount { font-size: 18px; font-weight: 700; letter-spacing: -0.5px; margin-top: 4px; }
.amount.up { color: var(--up); }
.amount.down { color: var(--down); }
.month-net { font-size: 12px; color: var(--text-mute); margin-top: 12px; }
.sparkline { height: 36px; margin-top: 12px; display: flex; align-items: flex-end; gap: 2px; }
.spark-bar { flex: 1; background: var(--accent-soft); border-radius: 2px 2px 0 0; min-height: 2px; transition: height 0.3s; }
.spark-bar.has { background: var(--accent); }

/* STREAK CARD */
.streak-card { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: linear-gradient(140deg, rgba(249,115,22,0.08), rgba(249,115,22,0.02)); border: 1px solid rgba(249,115,22,0.20); border-radius: var(--r-md); margin-top: 14px; }
.streak-flame { font-size: 28px; }
.streak-count { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.streak-label { font-size: 12px; color: var(--text-dim); }

/* ACCOUNTS GRID */
.accounts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 8px; }
.account-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; position: relative; overflow: hidden; }
.account-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.account-card.cash::before { background: var(--up); }
.account-card.bank::before { background: var(--base); }
.account-card.savings::before { background: var(--accent); }
.account-card.credit::before { background: var(--down); }
.account-card.wallet::before { background: #a78bfa; }
.account-card .head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.account-card .icon { font-size: 18px; }
.account-card .name { font-size: 13px; font-weight: 700; flex: 1; }
.account-card .balance { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; }
.account-card .ccy-tag { font-size: 10px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }

/* YTD CARD */
.ytd-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 18px; margin-top: 18px; }
.ytd-row { display: flex; justify-content: space-between; gap: 8px; }
.ytd-col { flex: 1; min-width: 0; }
.ytd-col .amount { font-size: 16px; }

/* SECTION HEAD */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 12px; }
.section-head h2 { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); }
.link { color: var(--accent); font-size: 13px; font-weight: 600; }

/* TOP CATEGORIES */
.top-cats { display: flex; flex-direction: column; gap: 8px; }
.top-cat { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg-card); border-radius: var(--r-md); border: 1px solid var(--border); }
.top-cat .icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--bg-elev); font-size: 18px; }
.top-cat .name { flex: 1; font-weight: 600; }
.top-cat .val { font-weight: 700; color: var(--down); }
.top-cat .pct { font-size: 11px; color: var(--text-mute); margin-left: 6px; }

/* ACTIVITY LIST */
.activity-list { display: flex; flex-direction: column; gap: 12px; }
.day-group { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.day-head { padding: 10px 16px; background: var(--bg-elev); font-size: 12px; color: var(--text-mute); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; display: flex; justify-content: space-between; }
.tx-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--border); cursor: pointer; transition: background 0.1s; }
.tx-row:first-of-type { border-top: 0; }
.tx-row:active { background: var(--bg-card-2); }
.tx-row .icon { width: 40px; height: 40px; border-radius: 12px; background: var(--bg-elev); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.tx-row .info { flex: 1; min-width: 0; }
.tx-row .info .name { font-weight: 600; }
.tx-row .info .note { font-size: 12px; color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-row .info .acct-tag { display: inline-block; font-size: 10px; color: var(--text-mute); margin-left: 6px; padding: 1px 6px; background: var(--bg-elev); border-radius: 4px; }
.tx-row .amt { font-weight: 700; text-align: right; }
.tx-row .amt.up { color: var(--up); }
.tx-row .amt.down { color: var(--down); }
.tx-row .amt .ccy { font-size: 10px; color: var(--text-mute); margin-left: 3px; font-weight: 500; }

/* EMPTY */
.empty { padding: 40px 20px; text-align: center; color: var(--text-mute); font-size: 13px; }
.empty .em-icon { font-size: 36px; margin-bottom: 8px; opacity: 0.6; }

/* SEARCH */
#search-bar { margin-bottom: 12px; }
#search-bar input { width: 100%; padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); font-size: 14px; color: var(--text); }
#search-bar input:focus { border-color: var(--accent); }

/* FILTERS */
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; -webkit-overflow-scrolling: touch; }
.filter-row::-webkit-scrollbar { display: none; }
.chip { padding: 8px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px; font-size: 13px; color: var(--text-dim); font-weight: 600; white-space: nowrap; }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* INSIGHTS */
.insight-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; margin-bottom: 16px; }
.insight-card h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 14px; }
.donut-wrap { position: relative; height: 200px; margin: 12px 0 18px; }
#donut { width: 100%; height: 100%; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center .total { font-size: 24px; font-weight: 800; letter-spacing: -1px; }
.donut-center .total-lbl { font-size: 10px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 1.5px; margin-top: 2px; }
.legend { display: flex; flex-direction: column; gap: 6px; }
.legend-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend-row .name { flex: 1; }
.legend-row .v { font-weight: 700; }
.legend-row .pct { color: var(--text-mute); font-size: 11px; margin-left: 6px; }

/* BUDGETS */
.budget-intro { padding: 0 4px 16px; }
.budget-list { display: flex; flex-direction: column; gap: 12px; }
.budget-row { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; }
.budget-row .head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.budget-row .head .icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--bg-elev); font-size: 16px; }
.budget-row .head .name { flex: 1; font-weight: 600; }
.budget-row .head .spent-vs { font-size: 12px; color: var(--text-mute); }
.budget-row .spent-vs strong { color: var(--text); font-weight: 700; }
.bar { height: 8px; background: var(--bg-elev); border-radius: 999px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; background: var(--up); border-radius: 999px; transition: width 0.4s; }
.bar-fill.warn { background: var(--warn); }
.bar-fill.over { background: var(--down); }
.budget-row .foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-mute); margin-top: 6px; }
.primary-btn { width: 100%; padding: 14px; border-radius: var(--r-md); background: var(--accent); color: #fff; font-weight: 700; margin-top: 12px; }
.primary-btn:active { transform: scale(0.98); }
.danger-btn { width: 100%; padding: 14px; border-radius: var(--r-md); background: rgba(239,68,68,0.10); color: var(--down); font-weight: 700; border: 1px solid rgba(239,68,68,0.30); }

/* SETTINGS */
.settings-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; margin-bottom: 14px; }
.settings-card h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 10px; }
.cat-row, .acct-row, .rec-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; font-size: 14px; border-top: 1px solid var(--border); }
.cat-row:first-of-type, .acct-row:first-of-type, .rec-row:first-of-type { border-top: 0; }
.cat-row .icon, .acct-row .icon, .rec-row .icon { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-elev); display: flex; align-items: center; justify-content: center; }
.cat-row .name, .acct-row .name, .rec-row .name { flex: 1; }
.cat-row .kind-badge, .acct-row .kind-badge { font-size: 10px; padding: 2px 6px; border-radius: 999px; background: var(--bg-elev); color: var(--text-mute); text-transform: uppercase; letter-spacing: 1px; }
.acct-row .balance { font-weight: 700; font-size: 13px; }
.rec-row .meta { display: flex; flex-direction: column; align-items: flex-end; }
.rec-row .meta .amt { font-weight: 700; font-size: 14px; }
.rec-row .meta .when { font-size: 11px; color: var(--text-mute); }
.rec-row .x-btn { padding: 4px 10px; font-size: 11px; background: var(--bg-elev); border-radius: 999px; color: var(--text-mute); }

/* BOTTOM NAV - 5 equal slots */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 10px 0 calc(var(--safe-bottom) + 10px);
  z-index: 50;
}
.bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--text-mute); font-weight: 600; }
.bottom-nav button span { font-size: 18px; }
.bottom-nav button.active { color: var(--accent); }
.bottom-nav button.active span { color: var(--accent); }

.spacer-bottom { height: 100px; }

/* SHEET */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 90; opacity: 0; transition: opacity 0.25s; pointer-events: none; }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg-card); border-radius: 22px 22px 0 0; padding: 18px; max-height: 90vh; overflow-y: auto; transform: translateY(100%); transition: transform 0.35s cubic-bezier(.22,1,.36,1); z-index: 100; padding-bottom: calc(var(--safe-bottom) + 30px); }
.sheet.open { transform: translateY(0); }
.sheet-handle { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 16px; }
.sheet h2 { font-size: 18px; font-weight: 800; margin-bottom: 14px; letter-spacing: -0.5px; }

.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-field label { font-size: 12px; color: var(--text-mute); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.form-field input, .form-field select, .form-field textarea { padding: 14px 16px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-md); font-size: 16px; color: var(--text); }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--accent); }
.form-row { display: flex; gap: 10px; }
.form-row > * { flex: 1; }
.dir-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dir-toggle button { padding: 12px; border-radius: var(--r-md); background: var(--bg-elev); border: 1px solid var(--border); font-weight: 700; }
.dir-toggle button.active.in { background: rgba(16,209,136,0.15); border-color: var(--up); color: var(--up); }
.dir-toggle button.active.out { background: rgba(239,68,68,0.15); border-color: var(--down); color: var(--down); }

.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-height: 240px; overflow-y: auto; padding: 4px 0; }
.cat-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-md); cursor: pointer; transition: all 0.15s; }
.cat-tile.active { border-color: var(--accent); background: var(--accent-soft); }
.cat-tile .ic { font-size: 22px; }
.cat-tile .nm { font-size: 10px; color: var(--text-dim); text-align: center; line-height: 1.2; }

/* Tags chip */
.tag-chip { display: inline-block; font-size: 10px; padding: 2px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); margin-right: 4px; }

/* Detail sheet */
.detail-amount { font-size: 38px; font-weight: 800; letter-spacing: -1.5px; text-align: center; margin: 8px 0; }
.detail-amount.up { color: var(--up); }
.detail-amount.down { color: var(--down); }
.detail-cat { text-align: center; margin-bottom: 18px; color: var(--text-dim); }
.detail-meta { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; margin-bottom: 14px; }
.detail-meta .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; gap: 12px; }
.detail-meta .row .k { color: var(--text-mute); flex-shrink: 0; }
.detail-meta .row .v { text-align: right; overflow-wrap: anywhere; }
