@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,500;0,600;1,500;1,600&family=Poppins:wght@400;500;600;700&display=swap');

:root {
  --bg: #243b30;
  --bg-expense: #57352f;
  --bg-soft: #2c4738;
  --card: #3f5c4c;
  --card-hi: #4a6b58;
  --card-expense: #6b453d;
  --card-expense-hi: #7a4d43;
  --stripe: #375040;
  --cream: #f3ede1;
  --cream-dim: #c9d3c6;
  --orange: #dc9a5a;
  --orange-dark: #c17d3f;
  --purple-bg: #443761;
  --purple-card: #5a4c78;
  --income: #7fb98a;
  --expense: #c17d6b;
  --green-bar: #7fb98a;
  --amber-bar: #d9a94f;
  --red-bar: #c96b5c;
  --warn-bg: #b98046;
  --warn-border: #eecd94;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: 'Poppins', sans-serif;
  background: #182922;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  color: var(--cream);
  overflow: hidden;
  overscroll-behavior: none;
}

#phone {
  width: 100%;
  max-width: 390px;
  aspect-ratio: 390 / 844;
  background: var(--bg);
  border-radius: 36px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .5), 0 0 0 8px #0f1a15;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: background .5s var(--ease);
  overscroll-behavior: none;
}

/* Mobile optimizations */
@media (max-height: 900px) {
  #phone {
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .4), 0 0 0 4px #0f1a15;
  }
}

@media (max-width: 500px) {
  body {
    padding: 8px;
    align-items: stretch;
  }
  
  #phone {
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .3), 0 0 0 2px #0f1a15;
  }
  
  #screen-content {
    padding: 18px 14px 8px;
  }
}

@media (max-width: 420px) {
  body {
    padding: 4px;
  }
  
  #phone {
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .3), 0 0 0 1px #0f1a15;
  }
  
  #screen-content {
    padding: 16px 12px 6px;
  }
  
  .header-card,
  .summary-card,
  .card {
    padding: 14px 16px;
    margin-bottom: 12px;
  }
  
  .pill {
    padding: 5px 12px;
    font-size: 11px;
  }
  
  .big-number {
    font-size: clamp(28px, 8vw, 34px);
  }
}

#screen-content {
  flex: 1;
  overflow-y: scroll;
  overflow-x: hidden;
  padding: 50px 18px 10px;
  scrollbar-width: none;
  position: relative;
  overscroll-behavior: contain;
  -webkit-overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#screen-content::-webkit-scrollbar {
  display: none;
}

#modal-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

#modal-container > * {
  pointer-events: auto;
}

h1,
h2,
.font-display {
  font-family: 'Fraunces', serif;
}

button {
  font-family: 'Poppins', sans-serif;
}

/* ============ Animation keyframes ============ */
@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(.9) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes overlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.045);
  }
}

@keyframes bobble {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

.page-enter {
  animation: pageIn .42s var(--ease) both;
}

/* b-card animations removed */
.txn-row {
  animation: fadeIn .3s ease both;
}

.cat-chip {
  animation: fadeIn .3s ease both;
}

/* interactive press feedback */
.pill,
.icon-btn,
.type-btn,
.cat-chip,
.save-btn,
.nav-btn,
.fab,
.toggle-btn,
.add-goal-btn,
.modal-ok,
.back-btn,
.settings-list .s-row,
.txn-row,
.switch,
.eye-row,
.goal-chip {
  /* No transitions - instant feedback */
}

.fab:active {
  transform: scale(.88);
}

/* ---------- Splash ---------- */
.splash {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  cursor: pointer;
  padding: 20px;
  text-align: center;
  animation: fadeIn .6s ease both;
  transition: transform .2s var(--ease);
}

.splash:active {
  transform: scale(.98);
}

.splash .brand {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: clamp(32px, 10vw, 48px);
  font-weight: 600;
  letter-spacing: .5px;
}

.splash .brand-cn {
  font-size: clamp(14px, 4vw, 20px);
  letter-spacing: 6px;
  margin-top: 2px;
  color: var(--cream-dim);
}

.splash .lotus-wrap {
  animation: breathe 4.5s ease-in-out infinite;
  max-width: 200px;
}

.splash .hint {
  font-size: clamp(10px, 2.5vw, 12px);
  color: var(--cream-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
  position: absolute;
  bottom: clamp(20px, 5%, 40px);
  animation: bobble 2.2s ease-in-out infinite;
}

/* ---------- Header ---------- */
.header-card {
  background: rgba(60, 92, 76, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.header-card .brand {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: clamp(20px, 6vw, 26px);
}

.header-card .brand-cn {
  font-size: clamp(11px, 3vw, 13px);
  color: var(--cream-dim);
  letter-spacing: 3px;
}

.header-plain {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: clamp(20px, 6vw, 26px);
  margin-bottom: 16px;
  padding: 4px 2px;
}

/* ---------- Generic card ---------- */
.card {
  background: rgba(60, 92, 76, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dim {
  color: var(--cream-dim);
  font-size: 13px;
}

.big-number {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 34px;
}

.eye-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--cream-dim);
  font-size: 13px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.eye-row svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.pill {
  background: rgba(74, 107, 88, 0.5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cream);
  cursor: pointer;
}

.pill:hover {
  background: rgba(74, 107, 88, 0.7);
}

.period-dropdown {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.period-btn {
  background: rgba(74, 107, 88, 0.5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--cream);
  cursor: pointer;
  font-weight: 600;
  transition: background .28s ease;
}

.period-btn:hover {
  background: rgba(74, 107, 88, 0.7);
}

.period-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: rgba(44, 71, 56, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  overflow: hidden;
  z-index: 10;
  min-width: 140px;
  margin-top: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.period-menu button {
  width: 100%;
  background: none;
  border: none;
  color: var(--cream);
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background .2s ease;
}

.period-menu button:last-child {
  border-bottom: none;
}

.period-menu button:hover {
  background: rgba(74, 107, 88, 0.5);
}

.period-menu button.active {
  background: rgba(127, 185, 138, 0.4);
  color: var(--income);
  font-weight: 600;
}

/* ---------- Home summary ---------- */
.summary-card {
  background: rgba(60, 92, 76, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.summary-body {
  display: flex;
  align-items: center;
  gap: 18px;
}

.donut {
  flex-shrink: 0;
}

.donut circle {
  transition: stroke-dasharray 1s var(--ease);
}

.summary-stats {
  flex: 1;
}

.summary-stats .label {
  font-size: 12px;
  color: var(--cream-dim);
  margin-top: 8px;
}

.summary-stats .label:first-child {
  margin-top: 0;
}

.summary-stats .val {
  font-size: 20px;
  font-weight: 600;
}

.net-pill {
  display: inline-block;
  margin-top: 10px;
  background: var(--income);
  color: #14261c;
  font-weight: 700;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 14px;
  animation: cardIn .5s var(--ease) both;
  animation-delay: .15s;
}

/* ---------- Graphs ---------- */
.graph-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 16px;
}

.graph-header > span:first-child {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
}

.graph-toggle {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.graph-btn {
  background: rgba(74, 107, 88, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--cream);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  cursor: pointer;
  transition: all .2s ease;
  font-weight: 400;
}

.graph-btn:hover {
  background: rgba(74, 107, 88, 0.5);
}

.graph-btn.active {
  background: rgba(127, 185, 138, 0.4);
  border-color: rgba(127, 185, 138, 0.6);
}

.graph-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.graph-bar-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.graph-bar-label {
  font-size: 11px;
  color: var(--cream-dim);
  font-weight: 500;
}

.graph-bar-track {
  height: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  overflow: hidden;
}

.graph-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width .3s ease;
}

.graph-bar-val {
  font-size: 11px;
  color: var(--cream);
  font-weight: 600;
}

.graph-trend {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 100px;
  gap: 6px;
}

.trend-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 6px;
}

.trend-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 4px;
  transition: height .3s ease;
}

.trend-date {
  font-size: 10px;
  color: var(--cream-dim);
}

.graph-comparison {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comp-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comp-label {
  font-size: 12px;
  color: var(--cream-dim);
  font-weight: 500;
}

.comp-bar-track {
  height: 24px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  overflow: hidden;
}

.comp-bar-fill {
  height: 100%;
  border-radius: 8px;
  transition: width .3s ease;
}

.comp-val {
  font-size: 12px;
  color: var(--cream);
  font-weight: 600;
}

/* ---------- Monthly Overview ---------- */
.monthly-overview {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.month-item {
  padding: 12px;
  background: rgba(74, 107, 88, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.month-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 8px;
}

.month-stats {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.month-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.month-label-small {
  font-size: 10px;
  color: var(--cream-dim);
}

.month-val {
  font-size: 12px;
  font-weight: 600;
}

.month-val.income {
  color: var(--income);
}

.month-val.expense {
  color: #e2a99a;
}

.lotus-divider {
  display: flex;
  justify-content: center;
  padding: 18px 0;
  opacity: .5;
}

/* ---------- Bottom nav ---------- */
#bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(60, 92, 76, 0.4);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 18px 16px;
  position: relative;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--cream-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  cursor: pointer;
  width: 56px;
}

.nav-btn.active {
  color: var(--orange);
}

.nav-btn svg {
  width: 20px;
  height: 20px;
  transition: transform .25s var(--ease);
}

.nav-btn.active svg {
  transform: translateY(-2px);
}

.fab {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--bg-soft);
  margin-top: -30px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(220, 154, 90, .45);
}

.fab-icon {
  position: relative;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab-icon .dollar {
  font-weight: 700;
  font-size: 17px;
  color: #22201a;
}

.fab-icon .plus-badge {
  position: absolute;
  top: -7px;
  right: -9px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #22201a;
  color: var(--orange);
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ---------- Transactions ---------- */
.txn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.txn-list {
  border-radius: 12px;
  overflow: hidden;
  background: rgba(55, 80, 64, 0.3);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.txn-date-row {
  background: rgba(74, 107, 88, 0.3);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  font-size: 11px;
  color: var(--cream-dim);
  letter-spacing: .5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.txn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  width: 100%;
  border: none;
  text-align: left;
  transition: background .2s ease;
}

.txn-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.txn-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.txn-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.txn-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--card-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.txn-icon svg {
  width: 13px;
  height: 13px;
}

.txn-desc {
  font-size: 13px;
  font-weight: 500;
  color: var(--cream);
}

.txn-cat {
  font-size: 11px;
  color: var(--cream-dim);
}

.txn-amt {
  font-size: 14px;
  font-weight: 600;
}

.txn-amt.income {
  color: var(--income);
}

.txn-amt.expense {
  color: #e2a99a;
}

.empty-note {
  padding: 18px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--cream-dim);
  background: var(--stripe);
}

/* ---------- Search Input ---------- */
input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

input[type="text"]:focus {
  outline: none;
  background: rgba(74, 107, 88, 0.4) !important;
  border-color: rgba(127, 185, 138, 0.5) !important;
}

/* ---------- Pie Chart & Category Filter ---------- */
.pie-chart-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.pie-chart-horizontal {
  flex-shrink: 0;
}

.pie-legend-horizontal {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.legend-item-large {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--cream);
  font-weight: 500;
}

.pie-chart {
  max-width: 160px;
  margin: 0 auto 12px;
  display: block;
}

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

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--cream);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.category-filter {
  position: relative;
  display: inline-block;
}

.filter-btn {
  background: rgba(74, 107, 88, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--cream);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 500;
  min-width: 70px;
  white-space: nowrap;
}

.filter-btn:hover {
  background: rgba(74, 107, 88, 0.7);
}

.filter-btn.active {
  background: rgba(127, 185, 138, 0.4);
  border-color: rgba(127, 185, 138, 0.5);
  color: var(--cream);
  font-weight: 600;
}

.filter-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: rgba(44, 71, 56, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  min-width: 140px;
  margin-top: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 100;
  overflow: hidden;
}

.filter-menu button {
  width: 100%;
  background: none;
  border: none;
  color: var(--cream);
  padding: 8px 12px;
  font-size: 11px;
  cursor: pointer;
  text-align: left;
  transition: background .2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.filter-menu button:last-child {
  border-bottom: none;
}

.filter-menu button:hover {
  background: rgba(127, 185, 138, 0.2);
}

.filter-menu button.active {
  background: rgba(127, 185, 138, 0.4);
  color: var(--income);
  font-weight: 600;
}

.graph-period-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(44, 71, 56, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  min-width: 130px;
  margin-top: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 100;
  overflow: hidden;
}

.graph-period-menu button {
  width: 100%;
  background: none;
  border: none;
  color: var(--cream);
  padding: 8px 12px;
  font-size: 11px;
  cursor: pointer;
  text-align: left;
  transition: background .2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.graph-period-menu button:last-child {
  border-bottom: none;
}

.graph-period-menu button:hover {
  background: rgba(127, 185, 138, 0.2);
}

.graph-period-menu button.active {
  background: rgba(127, 185, 138, 0.4);
  color: var(--income);
  font-weight: 600;
}

/* ---------- Budget & Goals ---------- */
.bg-panel {
  background: rgba(68, 55, 97, 0.3);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  padding: 18px;
  transition: background .35s ease, border-color .35s ease;
}

.bg-panel.budget-mode {
  background: rgba(60, 92, 76, 0.35);
  border-color: rgba(127, 185, 138, 0.2);
}

.bg-panel.goal-mode {
  background: rgba(68, 55, 97, 0.35);
  border-color: rgba(90, 76, 120, 0.2);
}

.bg-panel-header {
  text-align: center;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 24px;
  margin-bottom: 14px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.toggle-group {
  display: flex;
  background: rgba(0, 0, 0, .2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 3px;
  backdrop-filter: blur(8px);
}

.toggle-btn {
  border: none;
  background: transparent;
  color: var(--cream-dim);
  font-size: 12px;
  padding: 7px 16px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 600;
  transition: all .28s ease;
}

.toggle-btn.active.budget {
  background: rgba(127, 185, 138, 0.5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(127, 185, 138, 0.3);
  color: var(--cream);
  box-shadow: 0 4px 12px rgba(127, 185, 138, 0.2);
}

.toggle-btn.active.goal {
  background: rgba(90, 76, 120, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(90, 76, 120, 0.4);
  color: var(--cream);
  box-shadow: 0 4px 12px rgba(90, 76, 120, 0.2);
}

.icon-btn {
  background: rgba(74, 107, 88, 0.3);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--cream);
  transition: all .2s ease;
}

.icon-btn:hover {
  background: rgba(74, 107, 88, 0.5);
}

.icon-btn svg {
  width: 14px;
  height: 14px;
}

.sort-dropdown {
  position: relative;
}

.sort-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: rgba(44, 71, 56, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  overflow: hidden;
  z-index: 10;
  min-width: 140px;
  margin-top: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.sort-menu button {
  width: 100%;
  background: none;
  border: none;
  color: var(--cream);
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background .2s ease;
}

.sort-menu button:last-child {
  border-bottom: none;
}

.sort-menu button:hover {
  background: rgba(74, 107, 88, 0.5);
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.b-card {
  background: rgba(74, 107, 88, 0.35);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px;
  position: relative;
  cursor: pointer;
  transition: all .2s ease;
}

.b-card:hover {
  background: rgba(74, 107, 88, 0.5);
}

.b-card.goal-card {
  background: rgba(90, 76, 120, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.b-card.goal-card:hover {
  background: rgba(90, 76, 120, 0.5);
}

.b-card-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: rgba(201, 107, 92, 0.5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(201, 107, 92, 0.4);
  border-radius: 6px;
  color: var(--cream);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s ease, background .2s ease;
  padding: 0;
  font-size: 0;
}

.b-card:hover .b-card-delete {
  opacity: 1;
}

.b-card-delete:hover {
  background: rgba(201, 107, 92, 0.7);
}

.b-card-delete svg {
  width: 14px;
  height: 14px;
}

.b-name {
  background: rgba(0, 0, 0, .18);
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  margin-bottom: 8px;
  font-weight: 600;
}

.b-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--cream-dim);
}

.b-stats-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 6px;
}

.b-remaining-label {
  font-size: 10px;
  color: var(--cream-dim);
  margin-top: 2px;
}

.b-remaining-val {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.b-remaining-val.over {
  color: #f0a58f;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, .28);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  width: 0;
  transition: width .85s var(--ease);
}

.progress-pct {
  font-size: 9px;
  color: var(--cream-dim);
  text-align: right;
  margin-top: 3px;
}

.add-goal-btn {
  width: 100%;
  margin-top: 14px;
  background: rgba(127, 185, 138, 0.2);
  backdrop-filter: blur(8px);
  border: 1px dashed rgba(127, 185, 138, 0.4);
  color: var(--cream);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all .2s ease;
}

.add-goal-btn:hover {
  background: rgba(127, 185, 138, 0.35);
  border-color: rgba(127, 185, 138, 0.6);
}

/* ---------- Add Transaction ---------- */
.form-page {
  display: flex;
  flex-direction: column;
}

.form-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.back-btn {
  background: var(--card-hi);
  border: none;
  color: var(--cream);
  padding: 8px 16px 8px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.back-btn svg {
  width: 15px;
  height: 15px;
}

.form-header h2 {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 22px;
}

.field-label {
  font-size: 13px;
  margin-top: 4px;
  margin-bottom: 8px;
  color: var(--cream-dim);
}

.field {
  margin-bottom: 16px;
}

.budget-info-card {
  background: rgba(74, 107, 88, 0.3);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
  margin-bottom: 16px;
}

.budget-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--cream-dim);
  margin-bottom: 8px;
}

.budget-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--cream);
}

.budget-row strong {
  font-weight: 600;
}

.budget-row strong.over {
  color: #e2a99a;
}

input[type=text],
input[type=number],
input[type=date] {
  width: 100%;
  background: rgba(63, 92, 76, 0.3);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--cream);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  transition: background-color .35s ease, border-color .2s ease;
  box-sizing: border-box;
}

input[type=date] {
  text-align: center;
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
  overflow: hidden;
  white-space: nowrap;
}

input[type=date]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  opacity: 0.6;
}

.theme-expense input,
.theme-expense .amount-wrap {
  background: rgba(107, 69, 61, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.amount-wrap {
  display: flex;
  align-items: center;
  background: rgba(63, 92, 76, 0.3);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0 14px;
  transition: background-color .35s ease;
  width: 100%;
}

.amount-wrap span {
  font-size: 16px;
  color: var(--cream-dim);
}

.amount-wrap input {
  border: none;
  background: none;
  padding: 12px 6px;
  width: 100%;
}

input:focus {
  outline: 2px solid var(--orange);
  outline-offset: 1px;
}

.cat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.cat-chip {
  background: rgba(63, 92, 76, 0.3);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--cream-dim);
  padding: 9px 14px;
  border-radius: 18px;
  font-size: 12px;
  cursor: pointer;
  transition: all .2s ease;
  flex-shrink: 0;
}

.theme-expense .cat-chip {
  background: rgba(107, 69, 61, 0.3);
}

.cat-chip.selected {
  border-color: var(--orange);
  color: var(--cream);
  font-weight: 600;
  background: rgba(127, 185, 138, 0.3);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(127, 185, 138, 0.15);
}

.theme-expense .cat-chip.selected {
  background: rgba(193, 125, 63, 0.3);
}

.goal-chip {
  background: rgba(63, 92, 76, 0.3);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--cream-dim);
  padding: 9px 14px;
  border-radius: 18px;
  font-size: 12px;
  cursor: pointer;
  margin: 0 6px 6px 0;
  display: inline-block;
  transition: all .2s ease;
}

.goal-chip.selected {
  border-color: rgba(90, 76, 120, 0.5);
  background: rgba(90, 76, 120, 0.4);
  backdrop-filter: blur(8px);
  color: var(--cream);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(90, 76, 120, 0.2);
}

.type-btn {
  flex: 1;
  padding: 11px;
  border-radius: 22px;
  border: 2px solid transparent;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  background: rgba(63, 92, 76, 0.3);
  backdrop-filter: blur(8px);
  color: var(--cream-dim);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all .2s ease;
}

.type-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  margin-top: 16px;
}

.theme-expense .type-btn {
  background: rgba(107, 69, 61, 0.3);
}

.type-btn.income.selected {
  background: rgba(127, 185, 138, 0.5);
  backdrop-filter: blur(8px);
  color: var(--cream);
  border-color: rgba(127, 185, 138, 0.4);
  box-shadow: 0 4px 12px rgba(127, 185, 138, 0.2);
}

.type-btn.expense.selected {
  background: rgba(193, 125, 63, 0.5);
  backdrop-filter: blur(8px);
  color: var(--cream);
  border-color: rgba(193, 125, 63, 0.4);
  box-shadow: 0 4px 12px rgba(193, 125, 63, 0.2);
}

.more-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .4s var(--ease), opacity .3s ease, margin .4s ease;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.more-panel.open {
  max-height: 200px;
  opacity: 1;
  margin-bottom: 18px;
}

.cat-divider {
  width: 100%;
  font-size: 11px;
  color: var(--cream-dim);
  margin-top: 12px;
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.allocate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(63, 92, 76, 0.3);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 16px;
  margin-top: 18px;
  margin-bottom: 10px;
  transition: background-color .35s ease;
}

.allocate-row span {
  font-size: 13px;
}

.switch {
  width: 42px;
  height: 24px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .3s ease;
}

.switch .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cream-dim);
  transition: transform .3s var(--ease), background-color .3s ease;
}

.switch.on {
  background: rgba(127, 185, 138, 0.4);
  border: 1px solid rgba(127, 185, 138, 0.3);
}

.switch.on .knob {
  transform: translateX(18px);
  background: var(--cream);
}

.allocate-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .4s var(--ease), opacity .3s ease, margin .4s ease;
}

.allocate-panel.open {
  max-height: 260px;
  opacity: 1;
  margin-bottom: 16px;
}

.goal-chip {
  background: var(--card);
  border: 2px solid transparent;
  color: var(--cream-dim);
  padding: 9px 14px;
  border-radius: 18px;
  font-size: 12px;
  cursor: pointer;
  margin: 0 6px 6px 0;
  display: inline-block;
}

.goal-chip.selected {
  border-color: var(--purple-card);
  background: var(--purple-card);
  color: var(--cream);
  font-weight: 600;
}

.save-btn {
  width: 100%;
  background: rgba(127, 185, 138, 0.4);
  backdrop-filter: blur(8px);
  color: var(--cream);
  border: 1px solid rgba(127, 185, 138, 0.3);
  padding: 14px;
  border-radius: 22px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  margin-top: 24px;
  transition: all .35s ease;
}

.theme-expense .save-btn {
  background: rgba(193, 125, 63, 0.4);
  border: 1px solid rgba(193, 125, 63, 0.3);
}

.save-btn:hover {
  background: rgba(127, 185, 138, 0.6);
}

.save-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.save-btn.shake {
  animation: shake .4s ease;
}

/* ---------- Account ---------- */
.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--card-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px auto 6px;
}

.avatar svg {
  width: 44px;
  height: 44px;
  color: var(--cream-dim);
}

.profile-edit-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  background: rgba(127, 185, 138, 0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(127, 185, 138, 0.4);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background .2s ease;
}

.profile-edit-btn:hover {
  background: rgba(127, 185, 138, 0.35);
}

.profile-edit-btn svg {
  width: 16px;
  height: 16px;
  color: var(--cream);
}

.acc-name-input {
  text-align: center;
  background: none;
  border: none;
  color: var(--cream);
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 22px;
  width: 100%;
  margin-bottom: 4px;
}

.acc-sub {
  text-align: center;
  color: var(--cream-dim);
  font-size: 12px;
  margin-bottom: 6px;
}

.settings-list .s-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  font-size: 14px;
}

.settings-list .s-row:last-child {
  border-bottom: none;
}

.s-row.clickable {
  cursor: pointer;
}

.s-row.danger {
  color: #e2a99a;
  cursor: pointer;
}

.s-row.danger svg {
  width: 16px;
  height: 16px;
}

.s-row svg {
  width: 12px;
  height: 12px;
}

.currency-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: rgba(44, 71, 56, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  overflow: hidden;
  z-index: 10;
  min-width: 100px;
  margin-top: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.currency-option {
  background: none;
  border: none;
  color: var(--cream);
  padding: 10px 14px;
  text-align: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background .2s ease;
  display: block;
  width: 100%;
}

.currency-option:last-child {
  border-bottom: none;
}

.currency-option:hover {
  background: rgba(74, 107, 88, 0.5);
}

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: absolute;
  bottom: 90px;
  right: 12px;
  z-index: 25;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.toast {
  background: rgba(60, 92, 76, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--cream);
  font-size: 12px;
  font-weight: 500;
  animation: slideUpRight .35s var(--ease) both;
  pointer-events: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  text-align: center;
  line-height: 1.4;
  max-width: 280px;
}

.toast.success {
  border-color: rgba(127, 185, 138, 0.4);
  background: rgba(127, 185, 138, 0.15);
}

.toast.error {
  border-color: rgba(201, 107, 92, 0.4);
  background: rgba(201, 107, 92, 0.15);
}

.toast.info {
  border-color: rgba(127, 185, 138, 0.4);
  background: rgba(127, 185, 138, 0.15);
}

@keyframes slideUpRight {
  from {
    opacity: 0;
    transform: translateY(20px) translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateX(0);
  }
}

@keyframes slideDownRight {
  from {
    opacity: 1;
    transform: translateY(0) translateX(0);
  }
  to {
    opacity: 0;
    transform: translateY(20px) translateX(20px);
  }
}

.toast.hiding {
  animation: slideDownRight .25s var(--ease) both;
}

/* ---------- Modal / Warning ---------- */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 17, .72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  z-index: 20;
}

.modal-box {
  background: rgba(185, 128, 70, 0.4);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(238, 205, 148, 0.3);
  border-radius: 18px;
  padding: 22px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .4);
}

.modal-title {
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 14px;
  color: #2a1c08;
}

.warn-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  color: #2a1c08;
  margin-bottom: 10px;
  font-weight: 600;
  animation: cardIn .35s var(--ease) both;
}

.warn-item:nth-child(2) {
  animation-delay: .06s;
}

.warn-item:nth-child(3) {
  animation-delay: .12s;
}

.warn-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-top: 2px;
}

.modal-ok {
  width: 100%;
  margin-top: 8px;
  background: #f3ede1;
  border: none;
  color: #2a1c08;
  padding: 12px;
  border-radius: 20px;
  font-weight: 700;
  cursor: pointer;
}

/* Plain modal (Add Goal / Edit Budgets) */
.plain-modal {
  background: rgba(60, 92, 76, 0.5);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 22px;
  width: 100%;
  max-height: 640px;
  overflow-y: auto;
}

.plain-modal h3 {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 20px;
  margin-bottom: 16px;
}

.modal-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.modal-btn-row button {
  flex: 1;
  padding: 11px;
  border-radius: 16px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}

.modal-btn-row .cancel {
  background: rgba(74, 107, 88, 0.4);
  backdrop-filter: blur(8px);
  color: var(--cream);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.modal-btn-row .confirm {
  background: rgba(127, 185, 138, 0.5);
  backdrop-filter: blur(8px);
  color: var(--cream);
  border: 1px solid rgba(127, 185, 138, 0.3);
}

/* Responsive modal adjustments */
@media (max-width: 420px) {
  .modal-overlay {
    padding: 20px;
  }
  
  .modal-box,
  .plain-modal {
    padding: 18px;
  }
  
  .modal-title {
    font-size: 16px;
    margin-bottom: 12px;
  }
  
  .plain-modal h3 {
    font-size: clamp(16px, 5vw, 20px);
    margin-bottom: 12px;
  }
  
  .modal-btn-row {
    gap: 8px;
    margin-top: 12px;
  }
  
  .modal-btn-row button {
    padding: 9px;
    font-size: 12px;
  }
}

/* ================= SUBSCRIPTIONS ================= */
.color-dot {
  transition: outline .15s ease;
  flex-shrink: 0;
}

select option {
  background: #2c4738;
  color: var(--cream);
}

.modal-btn-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.modal-btn-row button {
  flex: 1;
}

/* Hide number input spin buttons */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}