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

/* ===========================
   VARIABLES
=========================== */
:root {
  --font-pixel: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --neon: #00FF9F;
  --neon-dim: rgba(0,255,159,0.6);
  --neon-pink: #FF00AA;
  --neon-purple: #7B2FFF;
  --neon-cyan: #00FFFF;
  --gold: #FFD700;

  --bg: #070711;
  --bg2: #0d0d1e;
  --surface: rgba(255,255,255,0.045);
  --surface-hover: rgba(255,255,255,0.08);
  --surface-border: rgba(100,100,255,0.15);
  --surface-border-neon: rgba(0,255,159,0.3);

  --text: #E8E8FF;
  --text-dim: rgba(232,232,255,0.45);
  --text-muted: rgba(232,232,255,0.25);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --nav-h: 68px;
  --header-h: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

[data-theme="light"] {
  --bg: #F0F0FF;
  --bg2: #E4E4F5;
  --surface: rgba(255,255,255,0.65);
  --surface-hover: rgba(255,255,255,0.85);
  --surface-border: rgba(100,100,180,0.2);
  --surface-border-neon: rgba(102,0,255,0.3);
  --text: #1A1A3E;
  --text-dim: rgba(26,26,62,0.5);
  --text-muted: rgba(26,26,62,0.3);
  --neon: #6600FF;
  --neon-dim: rgba(102,0,255,0.6);
  --neon-pink: #FF0066;
  --neon-purple: #9900FF;
  --neon-cyan: #0066FF;
}

/* ===========================
   RESET & BASE
=========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  overscroll-behavior: none;
}

body {
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: var(--font-mono); outline: none; }
select { appearance: none; -webkit-appearance: none; }

::-webkit-scrollbar { width: 0; height: 0; }

/* ===========================
   BACKGROUND ART LAYER
=========================== */
#bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(123,47,255,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(0,255,159,0.07) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,255,159,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,159,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

[data-theme="light"] .bg-grid {
  background-image:
    linear-gradient(rgba(102,0,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102,0,255,0.05) 1px, transparent 1px);
}

.bg-city {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  opacity: 0.12;
}

[data-theme="light"] .bg-city { opacity: 0.07; }

.bg-particles {
  position: absolute;
  inset: 0;
}

.particle {
  position: absolute;
  border-radius: 50%;
  animation: float-up linear infinite;
  pointer-events: none;
}

@keyframes float-up {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 0.4; }
  100% { transform: translateY(-100vh) scale(0.5); opacity: 0; }
}

/* ===========================
   APP LAYOUT
=========================== */
#app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ===========================
   HEADER
=========================== */
#app-header {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: calc(var(--header-h) + var(--safe-top));
  padding: calc(8px + var(--safe-top)) 16px 8px;
  background: rgba(7,7,17,0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--surface-border);
}

[data-theme="light"] #app-header {
  background: rgba(240,240,255,0.85);
}

.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.logo-pixel {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--neon);
  text-shadow: 0 0 10px var(--neon), 0 0 20px var(--neon);
  display: inline-block;
  animation: logo-pulse 3s ease-in-out infinite;
}

.logo-text {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text);
  letter-spacing: 1px;
  line-height: 1;
}

@keyframes logo-pulse {
  0%, 100% { text-shadow: 0 0 10px var(--neon), 0 0 20px var(--neon); }
  50% { text-shadow: 0 0 6px var(--neon), 0 0 12px var(--neon), 0 0 30px var(--neon); }
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 100px;
  padding: 6px 10px;
}

.month-prev, .month-next {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--neon);
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.2s, transform 0.1s;
}

.month-prev:active, .month-next:active { transform: scale(0.9); }

.month-current {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text);
  min-width: 60px;
  text-align: center;
  letter-spacing: 0.5px;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: transform 0.3s, background 0.3s;
  flex-shrink: 0;
}

.theme-toggle:active { transform: rotate(30deg) scale(0.9); }

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-btn {
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(108,99,255,0.45);
  background: rgba(108,99,255,0.14);
  color: #DCD9FF;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: background 0.2s, border-color 0.2s;
}

.auth-btn:active {
  background: rgba(108,99,255,0.24);
  border-color: rgba(108,99,255,0.7);
}

#auth-gate .btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

#auth-gate {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(8, 9, 13, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#auth-gate.hidden { display: none; }

.auth-gate-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  padding: 28px 22px;
  text-align: center;
}

.auth-gate-logo img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  margin: 0 auto 14px;
  display: block;
}

.auth-gate-card h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.auth-gate-card p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ===========================
   MAIN CONTENT
=========================== */
#main-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.view {
  display: none;
  padding: 16px 16px calc(var(--nav-h) + var(--safe-bottom) + 16px);
  min-height: calc(100dvh - var(--header-h) - var(--safe-top));
  animation: view-in 0.25s ease;
}

.view.active { display: block; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===========================
   GLASS CARDS
=========================== */
.glass-card {
  background: var(--surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: border-color 0.3s;
}

.glass-card:hover { border-color: var(--surface-border-neon); }

/* ===========================
   SECTION HEADERS
=========================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 10px;
}

.section-title {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.section-action {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--neon);
  padding: 4px 8px;
  border-radius: 100px;
  border: 1px solid var(--surface-border-neon);
  background: rgba(0,255,159,0.05);
  transition: background 0.2s;
}

.section-action:active { background: rgba(0,255,159,0.12); }
[data-theme="light"] .section-action {
  background: rgba(102,0,255,0.05);
}

/* ===========================
   DASHBOARD — SUMMARY CARD
=========================== */
.summary-card {
  background: linear-gradient(135deg, rgba(123,47,255,0.12), rgba(0,255,159,0.06));
  border-color: var(--surface-border-neon);
  margin-bottom: 4px;
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(0,255,159,0.12), transparent 70%);
  pointer-events: none;
}

.summary-month {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-dim);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.summary-spent {
  font-family: var(--font-pixel);
  font-size: 22px;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 4px;
}

.summary-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.summary-label span { color: var(--neon); }

.summary-stats {
  display: flex;
  gap: 0;
  margin-top: 14px;
  border-top: 1px solid var(--surface-border);
  padding-top: 12px;
}

.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: center;
  border-right: 1px solid var(--surface-border);
}

.stat:last-child { border-right: none; }

.stat-value {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--text);
}

.stat-label {
  font-size: 9px;
  color: var(--text-dim);
}

/* ===========================
   PROGRESS BARS
=========================== */
.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--neon), var(--neon-cyan));
  box-shadow: 0 0 8px var(--neon);
  transition: width 0.8s cubic-bezier(0.16,1,0.3,1);
  min-width: 2px;
}

.progress-fill.warn {
  background: linear-gradient(90deg, #FDCB6E, #E17055);
  box-shadow: 0 0 8px #FDCB6E;
}

.progress-fill.danger {
  background: linear-gradient(90deg, #FF6B6B, #FF00AA);
  box-shadow: 0 0 8px #FF6B6B;
  animation: danger-pulse 1s ease-in-out infinite;
}

@keyframes danger-pulse {
  0%, 100% { box-shadow: 0 0 8px #FF6B6B; }
  50% { box-shadow: 0 0 16px #FF6B6B, 0 0 24px #FF00AA44; }
}

/* ===========================
   ACCOUNTS CAROUSEL
=========================== */
.accounts-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.account-card {
  min-width: 200px;
  flex-shrink: 0;
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
  overflow: hidden;
}

.account-card:active { transform: scale(0.97); }

.account-card-shine {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.05) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.account-card:hover .account-card-shine { transform: translateX(100%); }

.acct-type-badge {
  font-family: var(--font-pixel);
  font-size: 6px;
  padding: 3px 6px;
  border-radius: 100px;
  background: rgba(255,255,255,0.1);
  color: var(--text-dim);
  margin-bottom: 10px;
  display: inline-block;
}

.acct-name {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text);
  margin-bottom: 14px;
}

.acct-balance {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--text);
  margin-bottom: 4px;
}

.acct-label {
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.empty-accounts {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 160px;
  min-height: 100px;
  border-style: dashed;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.empty-accounts:hover {
  border-color: var(--neon);
  background: rgba(0,255,159,0.03);
}

.empty-icon { font-size: 24px; }

.empty-text {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-dim);
  text-align: center;
}

/* ===========================
   FIXED BILLS (RENT etc)
=========================== */
.fixed-bill-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s;
  border-left: 3px solid #74B9FF;
}

.fixed-bill-card:active { transform: scale(0.98); }

.fixed-bill-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fixed-bill-icon { font-size: 24px; }

.fixed-bill-name {
  display: block;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--text);
  margin-bottom: 3px;
}

.fixed-bill-month {
  display: block;
  font-family: var(--font-pixel);
  font-size: 6px;
  color: var(--text-muted);
}

.fixed-bill-right {
  text-align: right;
  flex-shrink: 0;
}

.fixed-bill-amount {
  display: block;
  font-family: var(--font-pixel);
  font-size: 14px;
  margin-bottom: 4px;
}

.fixed-bill-status {
  font-family: var(--font-pixel);
  font-size: 6px;
  padding: 3px 7px;
  border-radius: 100px;
}

.fixed-bill-status.paid {
  color: var(--neon);
  background: rgba(0,255,159,0.1);
  border: 1px solid rgba(0,255,159,0.25);
}

.fixed-bill-status.unpaid {
  color: #FDCB6E;
  background: rgba(253,203,110,0.1);
  border: 1px solid rgba(253,203,110,0.25);
}

/* ===========================
   CURRENT BALANCE SECTION
=========================== */
.balance-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 10px;
}

.balance-total-label {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.balance-total-amt {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--neon);
  text-shadow: 0 0 8px var(--neon);
}

.balance-divider {
  height: 1px;
  background: var(--surface-border);
  margin-bottom: 8px;
}

.balance-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--surface-border);
}

.balance-row:last-child { border-bottom: none; }

.balance-row-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.balance-row-name {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text);
  flex: 1;
}

.balance-row-type {
  font-family: var(--font-pixel);
  font-size: 6px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 100px;
  padding: 2px 5px;
}

.balance-row-amount {
  font-family: var(--font-pixel);
  font-size: 9px;
  flex-shrink: 0;
}

/* ===========================
   BUDGET LIST
=========================== */
.budget-list-card {
  padding: 4px 16px;
}

.budget-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--surface-border);
  cursor: pointer;
  transition: background 0.15s;
}

.budget-row:last-child { border-bottom: none; }

.budget-row:active { opacity: 0.7; }

.budget-row-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.budget-row-mid {
  flex: 1;
  min-width: 0;
}

.budget-row-name {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text);
  display: block;
}

/* tighter progress bar inside list */
.budget-row-mid .progress-track {
  height: 5px;
  margin-top: 5px !important;
}

.budget-row-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
  min-width: 52px;
}

.budget-row-used {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-muted);
}

.budget-row-remaining {
  font-family: var(--font-pixel);
  font-size: 8px;
  font-weight: 700;
}

/* ===========================
   CATEGORY GRID (kept for reference, now unused on dashboard)
=========================== */
.categories-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cat-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.cat-card:active { transform: scale(0.97); }

.cat-card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.cat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cat-icon { font-size: 18px; }

.cat-pct {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-dim);
}

.cat-name {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-amounts {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.cat-spent {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--text);
}

.cat-budget {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-dim);
}

/* ===========================
   TRANSACTION ITEMS
=========================== */
.txn-group-date {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin: 16px 0 8px;
}

.txn-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
  position: relative;
  overflow: hidden;
}

.txn-item:active { transform: scale(0.98); }
.txn-item:hover { border-color: var(--surface-border-neon); background: var(--surface-hover); }

.txn-cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.txn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  background: var(--surface);
}

.txn-info { flex: 1; min-width: 0; }

.txn-title {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.txn-meta {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.txn-amount {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--text);
  flex-shrink: 0;
  text-align: right;
}

.txn-amount.credit { color: var(--neon); }

.txn-note-indicator {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-purple);
}

/* ===========================
   BOTTOM NAVIGATION
=========================== */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(7,7,17,0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--surface-border);
  z-index: 100;
}

[data-theme="light"] #bottom-nav {
  background: rgba(240,240,255,0.92);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: var(--nav-h);
  gap: 4px;
  color: var(--text-muted);
  font-family: var(--font-pixel);
  transition: color 0.2s, transform 0.1s;
  position: relative;
}

.nav-item.active { color: var(--neon); }

.nav-item.active .nav-icon {
  filter: drop-shadow(0 0 6px var(--neon));
}

.nav-item:active { transform: scale(0.9); }

.nav-icon { font-size: 20px; line-height: 1; }

.nav-label {
  font-size: 6px;
  letter-spacing: 0.3px;
}

.nav-add-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--nav-h);
}

.nav-add-btn {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--neon), var(--neon-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 300;
  color: #000;
  box-shadow: 0 0 16px var(--neon), 0 4px 20px rgba(0,0,0,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  line-height: 1;
}

[data-theme="light"] .nav-add-btn {
  box-shadow: 0 0 16px rgba(102,0,255,0.5), 0 4px 20px rgba(0,0,0,0.2);
}

.nav-add-btn:active {
  transform: scale(0.9);
  box-shadow: 0 0 8px var(--neon);
}

/* ===========================
   FORMS
=========================== */
.form-container {
  max-width: 480px;
  margin: 0 auto;
}

.form-title {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--text);
  margin-bottom: 20px;
  text-align: center;
}

.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.form-group.half { flex: 1; margin-bottom: 0; }

.form-label {
  display: block;
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-dim);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-mono);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.form-input:focus {
  border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(0,255,159,0.1);
}

[data-theme="light"] .form-input {
  background: rgba(255,255,255,0.7);
}

.form-input::placeholder { color: var(--text-muted); }

.form-select {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  font-family: var(--font-pixel);
  transition: border-color 0.2s;
  -webkit-appearance: none;
  cursor: pointer;
}

.form-select:focus { border-color: var(--neon); }

.form-select.small { font-size: 7px; padding: 8px 10px; }

[data-theme="light"] .form-select { background: rgba(255,255,255,0.7); }

.form-textarea {
  resize: none;
  min-height: 70px;
  line-height: 1.5;
}

/* Amount input */
.amount-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.amount-prefix {
  position: absolute;
  left: 14px;
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--neon);
  pointer-events: none;
  z-index: 1;
}

.amount-input { padding-left: 32px; font-family: var(--font-pixel); font-size: 18px; }

/* Category detect strip */
.category-detect {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(0,255,159,0.05);
  border: 1px solid rgba(0,255,159,0.15);
  border-radius: var(--radius-sm);
  transition: all 0.3s;
}

[data-theme="light"] .category-detect {
  background: rgba(102,0,255,0.05);
  border-color: rgba(102,0,255,0.15);
}

.detect-icon { font-size: 18px; }

.detect-label {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--neon);
  flex: 1;
}

.detect-change {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-dim);
  padding: 4px 8px;
  border-radius: 100px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
}

/* Payment mode chips */
.payment-modes, .mode-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pay-mode {
  font-family: var(--font-pixel);
  font-size: 7px;
  padding: 8px 12px;
  border-radius: 100px;
  border: 1px solid var(--surface-border);
  color: var(--text-dim);
  background: var(--surface);
  transition: all 0.2s;
}

.pay-mode.active, .pay-mode:focus {
  border-color: var(--neon);
  color: var(--neon);
  background: rgba(0,255,159,0.08);
  box-shadow: 0 0 8px rgba(0,255,159,0.15);
}

[data-theme="light"] .pay-mode.active {
  border-color: var(--neon);
  color: var(--neon);
  background: rgba(102,0,255,0.08);
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--neon), var(--neon-cyan));
  color: #000;
  font-family: var(--font-pixel);
  font-size: 10px;
  border-radius: var(--radius);
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 0 16px rgba(0,255,159,0.3), 0 4px 16px rgba(0,0,0,0.3);
  transition: transform 0.15s, box-shadow 0.15s;
  margin-top: 8px;
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 0 8px rgba(0,255,159,0.2);
}

.btn-secondary {
  width: 100%;
  padding: 14px;
  background: var(--surface);
  color: var(--text-dim);
  font-family: var(--font-pixel);
  font-size: 9px;
  border-radius: var(--radius);
  border: 1px solid var(--surface-border);
  transition: all 0.2s;
  margin-top: 8px;
}

.btn-secondary:active { background: var(--surface-hover); }

.btn-danger {
  font-family: var(--font-pixel);
  font-size: 7px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: #FF6B6B;
  border: 1px solid rgba(255,107,107,0.3);
  background: rgba(255,107,107,0.08);
  transition: all 0.2s;
}

.btn-danger:active { background: rgba(255,107,107,0.16); }

/* ===========================
   TRANSACTION FILTERS
=========================== */
.txn-filters {
  margin-bottom: 12px;
}

.filter-search { margin-bottom: 10px; }

.filter-row {
  display: flex;
  gap: 8px;
}

.filter-row .form-select { flex: 1; }

.txn-summary {
  display: flex;
  margin-bottom: 12px;
  padding: 10px 16px;
}

.txn-sum-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.sum-label {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-dim);
}

.sum-value {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--text);
}

/* ===========================
   ACCOUNTS VIEW
=========================== */
.accounts-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 80px;
}

.account-full-card {
  padding: 18px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.account-full-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background: radial-gradient(circle at top right, var(--accent-color, var(--neon)), transparent 60%);
  pointer-events: none;
}

.acct-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.acct-card-info {}

.acct-card-name {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--text);
  margin-bottom: 4px;
}

.acct-card-type {
  font-size: 10px;
  color: var(--text-dim);
}

.acct-card-actions { display: flex; gap: 8px; }

.acct-action-btn {
  font-family: var(--font-pixel);
  font-size: 7px;
  padding: 6px 10px;
  border-radius: 100px;
  border: 1px solid var(--surface-border);
  color: var(--text-dim);
  background: var(--surface);
  transition: all 0.2s;
}

.acct-action-btn:active { background: var(--surface-hover); }
.acct-action-btn.del { color: #FF6B6B; border-color: rgba(255,107,107,0.3); }

.acct-card-balance {
  margin-bottom: 10px;
}

.acct-balance-amount {
  font-family: var(--font-pixel);
  font-size: 20px;
  color: var(--text);
  margin-bottom: 2px;
}

.acct-balance-label { font-size: 11px; color: var(--text-dim); }

.btn-fab {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
  color: #fff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(123,47,255,0.4), 0 4px 16px rgba(0,0,0,0.3);
  z-index: 50;
  transition: transform 0.2s;
}

.btn-fab:active { transform: scale(0.9); }

/* ===========================
   ANALYTICS
=========================== */
.analytics-compare, .analytics-chart, .analytics-trend {
  margin-bottom: 14px;
}

.compare-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.compare-title {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--text);
}

.compare-months {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.compare-months .form-select { flex: 1; font-size: 8px; }

.compare-vs {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--neon-pink);
  flex-shrink: 0;
}

.compare-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--surface-border);
}

.compare-row:last-child { border-bottom: none; }

.compare-cat-icon { font-size: 16px; width: 20px; text-align: center; }

.compare-cat-name {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-dim);
  flex: 1;
}

.compare-vals {
  display: flex;
  gap: 10px;
  align-items: center;
}

.compare-v1, .compare-v2 {
  font-family: var(--font-pixel);
  font-size: 8px;
  min-width: 55px;
  text-align: right;
}

.compare-v1 { color: var(--neon-cyan); }
.compare-v2 { color: var(--neon-pink); }

.compare-delta {
  font-family: var(--font-pixel);
  font-size: 7px;
  min-width: 36px;
  text-align: right;
}

.compare-delta.up { color: #FF6B6B; }
.compare-delta.down { color: var(--neon); }

.chart-title {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-dim);
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

.chart-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

#donut-chart { flex-shrink: 0; }

.chart-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-name {
  font-family: var(--font-pixel);
  font-size: 6px;
  color: var(--text-dim);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-pct {
  font-family: var(--font-pixel);
  font-size: 6px;
  color: var(--text-muted);
}

/* ===========================
   MODALS
=========================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal.open { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  animation: backdrop-in 0.2s ease;
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: 85dvh;
  overflow-y: auto;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px 20px calc(20px + var(--safe-bottom));
  animation: sheet-in 0.3s cubic-bezier(0.16,1,0.3,1);
}

@keyframes sheet-in {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-handle {
  width: 36px;
  height: 4px;
  border-radius: 100px;
  background: var(--surface-border);
  margin: 0 auto 16px;
}

.modal-title {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--text);
  margin-bottom: 18px;
  text-align: center;
}

/* Category picker */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cat-pick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  border-radius: var(--radius);
  border: 1px solid var(--surface-border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s;
}

.cat-pick-btn.selected {
  border-color: var(--neon);
  background: rgba(0,255,159,0.08);
}

.cat-pick-btn:active { transform: scale(0.95); }

.cat-pick-icon { font-size: 22px; }

.cat-pick-name {
  font-family: var(--font-pixel);
  font-size: 6px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.4;
}

/* Transaction detail modal */
.txn-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.txn-detail-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.txn-detail-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--text);
  margin-bottom: 4px;
}

.txn-detail-amount {
  font-family: var(--font-pixel);
  font-size: 20px;
  color: var(--text);
}

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--surface-border);
}

.detail-row:last-child { border-bottom: none; }

.detail-key {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-dim);
}

.detail-val {
  font-size: 12px;
  color: var(--text);
  text-align: right;
}

.note-box {
  background: rgba(123,47,255,0.08);
  border: 1px solid rgba(123,47,255,0.2);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  margin: 12px 0;
}

/* Color picker */
.color-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.color-swatch.active, .color-swatch:focus {
  border-color: var(--text);
  transform: scale(1.15);
}

/* Budget edit list */
.budget-edit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--surface-border);
}

.budget-edit-item:last-child { border-bottom: none; }

.budget-edit-icon { font-size: 18px; }

.budget-edit-name {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-dim);
  flex: 1;
}

.budget-edit-input {
  width: 90px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: 9px;
  text-align: right;
}

.budget-edit-input:focus { border-color: var(--neon); }

/* ===========================
   EASTER EGG BALLOON
=========================== */
#easter-balloon {
  position: fixed;
  font-size: 36px;
  z-index: 150;
  cursor: pointer;
  animation: balloon-float 4s ease-in-out infinite;
  display: none;
  filter: drop-shadow(0 0 10px rgba(255,0,0,0.5));
  user-select: none;
}

#easter-balloon.visible { display: block; }

@keyframes balloon-float {
  0%, 100% { transform: translateX(0) rotate(-5deg); }
  25% { transform: translateX(8px) rotate(5deg); }
  50% { transform: translateX(-4px) rotate(-3deg); }
  75% { transform: translateX(6px) rotate(4deg); }
}

/* ===========================
   GAME OVERLAY
=========================== */
#game-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #020208;
  display: flex;
  flex-direction: column;
  transition: opacity 0.3s;
}

#game-overlay.hidden { display: none; }

#game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  border-bottom: 1px solid rgba(0,255,159,0.15);
  background: rgba(2,2,8,0.9);
  flex-shrink: 0;
}

.game-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--neon);
  text-shadow: 0 0 10px var(--neon);
}

#game-score-display {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--gold);
  text-shadow: 0 0 8px var(--gold);
}

#game-close {
  font-size: 20px;
  color: rgba(255,255,255,0.4);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  transition: all 0.2s;
}

#game-close:active { background: rgba(255,255,255,0.12); color: #fff; }

#game-canvas {
  display: block;
  flex: 1;
  width: 100%;
  image-rendering: pixelated;
}

#game-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-screen {
  pointer-events: all;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
  background: rgba(2,2,8,0.92);
  border: 1px solid rgba(0,255,159,0.2);
  border-radius: 20px;
  backdrop-filter: blur(16px);
  max-width: 300px;
  width: 90%;
  text-align: center;
}

.game-screen.hidden { display: none; }

.game-screen-title {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--neon);
  text-shadow: 0 0 16px var(--neon);
  animation: glitch 4s infinite;
}

@keyframes glitch {
  0%, 92%, 100% { transform: none; text-shadow: 0 0 16px var(--neon); }
  93% { transform: skewX(-10deg); text-shadow: -3px 0 #FF00AA, 3px 0 var(--neon-cyan); }
  94% { transform: skewX(0deg); }
  95% { transform: skewX(5deg); text-shadow: 2px 0 var(--neon-pink), -2px 0 var(--neon-cyan); }
  96% { transform: none; text-shadow: 0 0 16px var(--neon); }
}

.game-screen-subtitle {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: rgba(232,232,255,0.6);
  line-height: 1.6;
}

.game-screen-hint {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: rgba(232,232,255,0.3);
}

.game-high-score, .game-final-score {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--gold);
}

.game-final-score { font-size: 22px; }

/* ===========================
   EMPTY STATES
=========================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  text-align: center;
}

.empty-state-icon { font-size: 36px; opacity: 0.5; }

.empty-state-text {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-dim);
  line-height: 1.8;
}

/* ===========================
   TOAST NOTIFICATION
=========================== */
#toast {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: rgba(0,255,159,0.12);
  border: 1px solid rgba(0,255,159,0.3);
  color: var(--neon);
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 10px 18px;
  border-radius: 100px;
  backdrop-filter: blur(16px);
  z-index: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* ===========================
   RESPONSIVE — DESKTOP
=========================== */
@media (min-width: 768px) {
  #app {
    flex-direction: row;
    max-width: 1100px;
    margin: 0 auto;
  }

  #app-header { display: none; }

  #bottom-nav {
    position: sticky;
    top: 0;
    height: 100dvh;
    width: 200px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 24px 0 24px;
    padding-bottom: 24px; /* no safe area on desktop */
    border-top: none;
    border-right: 1px solid var(--surface-border);
  }

  .nav-item {
    width: 100%;
    flex-direction: row;
    min-height: 44px;
    height: 44px;
    padding: 0 20px;
    gap: 12px;
    justify-content: flex-start;
    border-radius: 0;
  }

  .nav-label { font-size: 7px; }
  .nav-icon { font-size: 18px; }

  .nav-add-wrap {
    width: 100%;
    padding: 8px 16px;
    min-height: auto;
    height: auto;
  }

  .nav-add-btn {
    width: 100%;
    border-radius: var(--radius-sm);
    height: 44px;
    font-size: 20px;
    justify-content: center;
    gap: 8px;
  }

  .nav-add-btn::after {
    content: 'ADD SPEND';
    font-family: var(--font-pixel);
    font-size: 7px;
  }

  /* Desktop sidebar logo */
  .desktop-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--surface-border);
    margin-bottom: 16px;
    width: 100%;
  }

  #main-content { flex: 1; }

  .view {
    padding: 24px;
    padding-bottom: 40px;
  }

  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .modal-content {
    border-radius: var(--radius-lg);
    margin: auto;
    max-height: 80dvh;
  }

  .modal { align-items: center; }
}

/* ===========================
   MISC UTILITIES
=========================== */
.text-neon { color: var(--neon); }
.text-pink { color: var(--neon-pink); }
.text-gold { color: var(--gold); }
.text-dim { color: var(--text-dim); }

.mt-auto { margin-top: auto; }
.bottom-spacer { height: 20px; }

.shimmer {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Number counter animation */
.counter { transition: all 0.5s; }

/* Logo tap flash */
.logo-flash .logo-pixel {
  animation: logo-flash-anim 0.2s ease;
}

@keyframes logo-flash-anim {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); filter: hue-rotate(90deg); }
  100% { transform: scale(1); }
}

/* ===========================
   PREMIUM DARK REDESIGN (VISUAL ONLY)
=========================== */
:root {
  --font-pixel: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bg: #08090D;
  --bg2: #0B0D12;
  --surface: #131419;
  --surface-hover: #1B1C24;
  --surface-border: rgba(255,255,255,0.06);
  --surface-border-neon: rgba(108,99,255,0.55);
  --text: #FFFFFF;
  --text-dim: #96979F;
  --text-muted: #62636D;
  --neon: #6C63FF;
  --neon-cyan: #8B84FF;
  --neon-purple: #6C63FF;
  --neon-pink: #8A78FF;
  --gold: #36E99B;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 20px;
}

[data-theme="light"] {
  --bg: #F3F4F8;
  --bg2: #ECEEF4;
  --surface: #FFFFFF;
  --surface-hover: #F7F8FC;
  --surface-border: rgba(17, 22, 31, 0.08);
  --surface-border-neon: rgba(108,99,255,0.35);
  --text: #141724;
  --text-dim: #545B67;
  --text-muted: #787F8B;
  --neon: #6C63FF;
  --neon-cyan: #5952E8;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
}

#bg-layer { display: none; }

#app-header,
#bottom-nav {
  background: rgba(8, 9, 13, 0.92);
  border-color: var(--surface-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.logo-text,
.month-current,
.section-title,
.section-action,
.summary-month,
.stat-value,
.balance-total-label,
.balance-row-name,
.balance-row-type,
.budget-row-name,
.budget-row-used,
.compare-title,
.compare-cat-name,
.legend-name,
.legend-pct,
.sum-label,
.sum-value,
.form-label,
.pay-mode,
.btn-primary,
.btn-secondary,
.nav-item,
.nav-label,
.compare-v1,
.compare-v2,
.compare-delta,
.txn-group-date,
.txn-title,
.txn-amount,
.txn-detail-title,
.txn-detail-amount,
.modal-title,
.detail-key,
.budget-edit-name,
.budget-edit-input {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: 0;
}

.view { padding-top: 18px; }

.glass-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

.section-action {
  font-size: 11px;
  font-weight: 600;
  color: #C7C4FF;
  border-color: rgba(108,99,255,0.5);
  background: rgba(108,99,255,0.12);
  padding: 6px 10px;
}

.summary-card {
  background: var(--surface);
  border-color: var(--surface-border);
}

.summary-card::before { display: none; }

.summary-month { font-size: 11px; color: var(--text-dim); }
.summary-spent { font-size: 34px; font-weight: 700; }
.summary-label { font-size: 13px; color: var(--text-dim); }
.summary-label span { color: #BDB8FF; }

.summary-stats { border-color: var(--surface-border); }
.stat-value { font-size: 15px; font-weight: 600; color: var(--text); }
.stat-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; }

.progress-track {
  background: #1B1C24;
  border-radius: 999px;
  height: 8px;
}

.progress-fill {
  background: #6C63FF;
  box-shadow: none;
}

.progress-fill.warn { background: #ECA840; box-shadow: none; }
.progress-fill.danger { background: #FF555F; box-shadow: none; animation: none; }

.accounts-scroll { gap: 14px; }
.account-card { border-radius: var(--radius); }
.account-card-shine { display: none; }
.acct-type-badge {
  font-size: 10px;
  font-weight: 600;
  background: #1B1C24;
  color: var(--text-dim);
}
.acct-name { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.acct-balance { font-size: 26px; font-weight: 700; }
.acct-label { font-size: 12px; color: var(--text-dim); }

#balance-section { padding: 14px 16px !important; }
.balance-total-amt { color: #36E99B; text-shadow: none; font-size: 20px; }
.balance-row { border-color: rgba(255,255,255,0.05); }
.balance-row-dot { width: 10px; height: 10px; border-radius: 50%; }
.balance-row-type { background: #1B1C24; font-size: 10px; }
.balance-row-amount { font-size: 13px; font-weight: 600; }

.budget-list-card { padding: 10px 14px; }
.budget-row {
  padding: 12px 0;
  border-color: rgba(255,255,255,0.05);
}
.budget-row-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1B1C24;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.budget-row-name { font-size: 12px; font-weight: 600; }
.budget-row-used { font-size: 11px; }
.budget-row-remaining { font-size: 13px; font-weight: 700; }

.home-analytics-card { margin-bottom: 4px; }
.analytics-compare,
.analytics-chart,
.analytics-trend {
  margin-bottom: 14px;
  border-radius: var(--radius-lg);
}

.chart-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.chart-container { align-items: center; gap: 14px; }

#donut-chart {
  background: transparent;
}

.legend-item {
  background: #1B1C24;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 6px 8px;
}

.legend-dot { border-radius: 50%; width: 9px; height: 9px; }
.legend-name { font-size: 11px; color: #D0D1D8; }
.legend-pct { font-size: 11px; color: var(--text-dim); }

#bar-chart {
  background: #101218;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
  padding: 6px;
}

.txn-filters,
.txn-summary {
  border-radius: var(--radius);
}

.txn-group-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-top: 18px;
}

.txn-item {
  background: var(--surface);
  border-color: rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.txn-item:hover,
.txn-item:active {
  border-color: rgba(108,99,255,0.5);
  background: var(--surface-hover);
}

.txn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1B1C24 !important;
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 17px;
}

.txn-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.txn-meta {
  font-size: 12px;
  color: var(--text-dim);
}

.txn-amount {
  font-size: 14px;
  font-weight: 700;
  color: #FF555F;
}

.txn-amount.income,
.txn-amount.credit {
  color: #36E99B;
}

.txn-amount.expense { color: #FF555F; }

.form-container { max-width: 560px; }
.form-title {
  font-size: 20px;
  font-weight: 700;
  text-align: left;
}

.form-input,
.form-select,
.budget-edit-input {
  background: #1B1C24;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: var(--text);
}

.form-input:focus,
.form-select:focus,
.budget-edit-input:focus {
  border-color: rgba(108,99,255,0.7);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.18);
}

.amount-input {
  font-size: 24px;
  font-weight: 700;
}

.amount-prefix {
  color: #A49EFF;
  font-size: 16px;
}

.category-detect {
  background: #1B1C24;
  border: 1px solid rgba(255,255,255,0.08);
}

.detect-label { font-size: 12px; font-weight: 600; }
.detect-change {
  background: rgba(108,99,255,0.16);
  border-color: rgba(108,99,255,0.45);
  color: #C8C5FF;
}

.pay-mode {
  background: #1B1C24;
  border-color: rgba(255,255,255,0.08);
  color: var(--text-dim);
  font-size: 11px;
  padding: 9px 12px;
}

.pay-mode.active,
.pay-mode:focus {
  border-color: rgba(108,99,255,0.7);
  color: #E2E1FF;
  background: rgba(108,99,255,0.18);
  box-shadow: none;
}

.btn-primary {
  background: #6C63FF;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: none;
}

.btn-primary:active { background: #5B53E8; box-shadow: none; }

.btn-secondary {
  background: #1B1C24;
  border-color: rgba(255,255,255,0.08);
  color: #C6C7CF;
  font-size: 12px;
}

#bottom-nav {
  background: #101217;
  border-top-color: rgba(255,255,255,0.08);
}

.nav-item { color: #6D707B; }
.nav-item.active { color: #A8A3FF; }
.nav-item.active .nav-icon { filter: none; }
.nav-icon { font-size: 18px; }
.nav-label { font-size: 10px; font-weight: 600; }

.nav-add-btn {
  background: #6C63FF;
  color: #fff;
  border-radius: 14px;
  box-shadow: none;
}

.modal-backdrop { background: rgba(0,0,0,0.65); backdrop-filter: blur(3px); }
.modal-content {
  background: #131419;
  border-color: rgba(255,255,255,0.08);
}

.detail-row,
.budget-edit-item,
.compare-row {
  border-bottom-color: rgba(255,255,255,0.06);
}

.compare-vs { color: #A9A5FF; }
.compare-v1 { color: #C8C5FF; }
.compare-v2 { color: #A6A8B3; }
.compare-delta.up { color: #FF555F; }
.compare-delta.down { color: #36E99B; }

#toast {
  background: rgba(108,99,255,0.18);
  border: 1px solid rgba(108,99,255,0.45);
  color: #DEDDFE;
  font-size: 11px;
}

@media (min-width: 768px) {
  #bottom-nav {
    background: #101217;
    border-right-color: rgba(255,255,255,0.08);
  }
}
