:root {
  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --surface-subtle: #F7F9FC;
  --surface-pill: #EEF2F7;
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --border: rgba(15, 23, 42, 0.06);
  --border-strong: rgba(15, 23, 42, 0.11);

  --blue: #2563EB;
  --blue-dark: #1D4ED8;
  --blue-soft: #EFF6FF;
  --blue-pill: #DBEAFE;

  --green: #10B981;
  --green-dark: #059669;
  --green-soft: #ECFDF5;

  --red: #EF4444;
  --red-soft: #FEF2F2;

  --amber: #F59E0B;
  --amber-soft: #FFFBEB;

  --purple: #8B5CF6;
  --purple-soft: #F5F3FF;

  --shadow-card: 0 4px 18px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.03);
  --shadow-wallet: 0 14px 32px rgba(15, 23, 42, 0.18);
  --shadow-fab: 0 10px 24px rgba(37, 99, 235, 0.42);
  --radius-card: 22px;
  --radius-wallet: 24px;
  --radius-pill: 999px;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* Desktop framing so it feels like the sleek mobile PWA in the video, while responsive on phones */
.desktop-backdrop {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  background: radial-gradient(circle at 20% 10%, #E0EAFF 0%, #EEF2F7 42%, #E5E9F2 100%);
}

.app-shell {
  width: 100%;
  max-width: 440px;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
  overflow-x: hidden;
}

@media (max-width: 460px) {
  .desktop-backdrop {
    background: var(--bg);
  }
  .app-shell {
    max-width: 100%;
    box-shadow: none;
  }
}

.main-content {
  flex: 1;
  padding: 18px 18px 104px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Top Header */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.greeting-sub {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 2px;
}

.greeting-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.15;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-circle-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, background 0.15s ease;
}

.icon-circle-btn:active {
  transform: scale(0.94);
}

.notif-dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  border: 1.5px solid #fff;
}

.avatar-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  background: linear-gradient(135deg, #2563EB, #1E3A8A);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
  padding: 0;
}

.avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Wallet Card Stack Carousel (matches video's stacked right-peek deck!) */
.wallet-deck-wrap {
  position: relative;
  margin-top: 2px;
}

.wallet-deck-stage {
  position: relative;
  height: 204px;
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}

.wallet-deck-stage:active {
  cursor: grabbing;
}

.wallet-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 90%;
  height: 196px;
  border-radius: var(--radius-wallet);
  padding: 20px 20px 18px;
  color: #FFFFFF;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease, filter 0.32s ease;
  box-shadow: var(--shadow-wallet);
  will-change: transform;
}

.wallet-card.is-active {
  width: 91%;
  z-index: 5;
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
}

.wallet-card.is-next-1 {
  width: 91%;
  z-index: 4;
  transform: translate3d(24px, 8px, 0) scale(0.95);
  opacity: 0.94;
  cursor: pointer;
}

.wallet-card.is-next-2 {
  width: 91%;
  z-index: 3;
  transform: translate3d(42px, 15px, 0) scale(0.90);
  opacity: 0.78;
  cursor: pointer;
}

.wallet-card.is-prev {
  width: 91%;
  z-index: 2;
  transform: translate3d(-110%, 8px, 0) scale(0.92);
  opacity: 0;
  pointer-events: none;
}

.wallet-card.is-hidden {
  width: 91%;
  z-index: 1;
  transform: translate3d(52px, 20px, 0) scale(0.86);
  opacity: 0;
  pointer-events: none;
}

.wallet-art-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-size: cover;
  background-position: right center;
}

.wallet-art-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(100deg, rgba(8, 15, 34, 0.88) 0%, rgba(8, 15, 34, 0.62) 48%, rgba(8, 15, 34, 0.14) 100%);
}

.wallet-card.is-total .wallet-art-overlay {
  background: radial-gradient(circle at 82% 20%, rgba(59, 130, 246, 0.34), transparent 55%),
              linear-gradient(135deg, #0D1B3E 0%, #172A54 55%, #0F2046 100%);
}

.wallet-card-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.wallet-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wallet-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bank-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.wallet-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.wallet-type {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.78;
}

.privacy-eye-btn,
.card-skin-btn {
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.15s ease;
}

.privacy-eye-btn:hover,
.card-skin-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.wallet-balance-label {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.8;
  margin-bottom: 2px;
}

.wallet-balance {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

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

.wallet-flow-col {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.wallet-flow-label {
  font-size: 11px;
  opacity: 0.75;
  font-weight: 500;
}

.wallet-flow-val {
  font-size: 13px;
  font-weight: 700;
}

.afford-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.15s ease, transform 0.15s ease;
}

.afford-pill-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.afford-pill-btn:active {
  transform: scale(0.97);
}

/* Carousel Dots */
.deck-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.deck-dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  border: none;
  padding: 0;
  background: #CBD5E1;
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.deck-dot.active {
  width: 22px;
  background: #0F172A;
}

/* Payday Cycle Selector Bar */
.cycle-bar {
  background: var(--surface);
  border-radius: 16px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}

.cycle-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cycle-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cycle-arrow-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cycle-arrow-btn:hover {
  background: var(--surface-pill);
  color: var(--text-primary);
}

.cycle-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--blue-pill);
  background: var(--blue-soft);
  color: var(--blue);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* KPI 2x2 Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}

.kpi-card {
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 118px;
}

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

.kpi-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.kpi-icon {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon.green {
  background: var(--green-soft);
  color: var(--green);
}

.kpi-icon.red {
  background: var(--red-soft);
  color: var(--red);
}

.kpi-icon.slate {
  background: var(--surface-pill);
  color: var(--text-secondary);
}

.kpi-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.15;
}

.kpi-value.savings-green {
  font-size: 24px;
  color: var(--green);
}

.kpi-sub-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  width: fit-content;
}

.kpi-sub-text {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.mini-progress {
  height: 5px;
  width: 100%;
  border-radius: 99px;
  background: #E2E8F0;
  overflow: hidden;
  margin-bottom: 6px;
}

.mini-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--blue);
  transition: width 0.4s ease;
}

/* Section Card Header */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.card-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 2px 0 0;
}

.link-btn {
  border: none;
  background: none;
  color: var(--blue);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

/* Spending Analytics Donut Row */
.donut-layout {
  display: flex;
  align-items: center;
  gap: 18px;
}

.donut-chart-wrap {
  position: relative;
  width: 122px;
  height: 122px;
  flex-shrink: 0;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.donut-center-val {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
}

.donut-center-lbl {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.donut-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
}

.legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

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

.legend-name {
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-pct {
  color: var(--text-primary);
  font-weight: 800;
  flex-shrink: 0;
}

/* Transaction List */
.tx-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 2px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tx-row:hover {
  background: var(--surface-subtle);
}

.tx-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 12px;
}

.tx-main {
  flex: 1;
  min-width: 0;
}

.tx-merchant-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tx-merchant {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-badges-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
}

.tx-auto-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 99px;
  background: #EFF6FF;
  color: #2563EB;
  font-size: 10.5px;
  font-weight: 700;
}

.tx-lhdn-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 99px;
  background: #ECFDF5;
  color: #059669;
  font-size: 10px;
  font-weight: 700;
}

.tx-sub {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-amount {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.tx-amount.expense {
  color: var(--red);
}

.tx-amount.income {
  color: var(--green);
}

/* Left This Month Checklist */
.pill-badge-blue {
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11.5px;
  font-weight: 700;
}

.checklist-progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.filter-chip.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.chip-count {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(15, 23, 42, 0.08);
}

.filter-chip.active .chip-count {
  background: rgba(255, 255, 255, 0.24);
}

.commitment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.commitment-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 15px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
}

.commitment-item:hover {
  border-color: var(--blue-pill);
}

.commitment-item.done {
  opacity: 0.6;
}

.commitment-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #CBD5E1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #FFFFFF;
}

.commitment-item.done .commitment-check {
  background: var(--green);
  border-color: var(--green);
}

.commitment-item.done .commitment-title {
  text-decoration: line-through;
}

/* Money Page Header & Tabs */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.page-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
}

.money-cycle-inline {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.money-cycle-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  padding: 4px 8px;
  border-radius: 99px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  font-size: 12.5px;
  font-weight: 700;
}

.money-cycle-range {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  padding-right: 4px;
}

.money-subtabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.money-subtab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 15px;
  border-radius: 15px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-card);
}

.money-subtab.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #FFFFFF;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

/* Search + CSV bar */
.search-bar-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrap svg {
  position: absolute;
  left: 13px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border-radius: 15px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  outline: none;
}

.search-input:focus {
  border-color: var(--blue);
}

.csv-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 14px;
  border-radius: 15px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  white-space: nowrap;
}

.day-group-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 4px 2px 8px;
}

/* Segmented Controls (Budget & Limits | Analytics, Week|Month|Quarter|Year, Cumulative|Daily) */
.segmented-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  padding: 5px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 10px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.16s ease;
}

.seg-btn.active {
  background: var(--blue);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.seg-mini {
  display: inline-flex;
  background: var(--surface-pill);
  padding: 3px;
  border-radius: 11px;
  gap: 2px;
}

.seg-mini button {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.seg-mini button.active {
  background: var(--blue);
  color: #FFFFFF;
}

/* Chart Card */
.chart-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.chart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.chart-big-amount {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.budget-target-pill {
  padding: 5px 11px;
  border-radius: 99px;
  background: var(--amber-soft);
  color: #D97706;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.chart-canvas-wrap {
  width: 100%;
  margin-top: 12px;
  position: relative;
}

.chart-legend-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

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

.legend-line {
  width: 14px;
  height: 3px;
  border-radius: 99px;
  display: inline-block;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 440px;
  height: 76px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr 78px 1fr 1fr;
  align-items: center;
  padding: 0 8px env(safe-area-inset-bottom, 4px);
  z-index: 40;
}

@media (max-width: 460px) {
  .bottom-nav {
    max-width: 100%;
  }
}

.nav-item {
  border: none;
  background: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  font-family: inherit;
  padding: 6px 2px;
  transition: color 0.15s ease;
}

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

.nav-label {
  font-size: 11px;
  font-weight: 700;
}

.nav-fab-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.fab-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 4px solid #FFFFFF;
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform: translateY(-16px);
  box-shadow: var(--shadow-fab);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease;
}

.fab-btn:hover {
  transform: translateY(-19px) scale(1.03);
}

.fab-btn:active {
  transform: translateY(-14px) scale(0.95);
}

/* Modal / Bottom Sheet */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.18s ease;
}

.modal-root.hidden {
  display: none;
}

.sheet {
  width: 100%;
  max-width: 440px;
  max-height: 92dvh;
  background: var(--surface);
  border-radius: 26px 26px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -14px 40px rgba(15, 23, 42, 0.22);
  animation: slideUp 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.sheet-handle {
  width: 40px;
  height: 4.5px;
  border-radius: 99px;
  background: #CBD5E1;
  margin: 10px auto 4px;
  flex-shrink: 0;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sheet-title {
  font-size: 17px;
  font-weight: 800;
  margin: 0;
}

.sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface-pill);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.sheet-body {
  padding: 16px 20px 26px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Form Elements */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.input, .select, .textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 13px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-subtle);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--blue);
  background: #FFFFFF;
}

.textarea {
  resize: vertical;
  min-height: 92px;
  font-weight: 500;
  line-height: 1.45;
}

.amount-input-hero {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-subtle);
  border: 1.5px solid var(--border-strong);
  border-radius: 16px;
  padding: 10px 14px;
}

.amount-input-hero:focus-within {
  border-color: var(--blue);
  background: #FFFFFF;
}

.amount-prefix {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-secondary);
}

.amount-input-hero input {
  border: none;
  background: transparent;
  width: 100%;
  font-family: inherit;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  outline: none;
  font-variant-numeric: tabular-nums;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 14px;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s ease, opacity 0.14s ease, background 0.14s ease;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-primary {
  background: var(--blue);
  color: #FFFFFF;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover {
  background: var(--blue-dark);
}

.btn-secondary {
  background: var(--surface-pill);
  color: var(--text-primary);
}

.btn-outline {
  background: var(--surface);
  color: var(--text-primary);
  border: 1.5px solid var(--border-strong);
}

.btn-danger {
  background: var(--red-soft);
  color: var(--red);
}

.btn-success {
  background: var(--green);
  color: #FFFFFF;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 12.5px;
  border-radius: 11px;
}

/* Receipt Scanner Dropzone */
.scan-dropzone {
  border: 2px dashed #93C5FD;
  background: #EFF6FF;
  border-radius: 18px;
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.scan-dropzone:hover {
  background: #DBEAFE;
  border-color: var(--blue);
}

.scan-preview-img {
  width: 100%;
  max-height: 210px;
  object-fit: contain;
  border-radius: 14px;
  background: #0F172A;
  border: 1px solid var(--border);
}

.scan-status-box {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--blue-soft);
  border: 1px solid var(--blue-pill);
  font-size: 12.5px;
  color: var(--blue-dark);
  font-weight: 600;
}

/* Sync & Status Pills */
.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
}

.sync-pill.ok {
  background: var(--green-soft);
  color: var(--green-dark);
}

.sync-pill.warn {
  background: var(--amber-soft);
  color: #B45309;
}

.sync-pill.info {
  background: var(--blue-soft);
  color: var(--blue);
}

/* Code / Webhook Snippet Box */
.code-box {
  background: #0F172A;
  color: #E2E8F0;
  border-radius: 13px;
  padding: 11px 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Life / Profile list items */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.settings-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Toast */
.toast-root {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 408px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #0F172A;
  color: #FFFFFF;
  padding: 12px 15px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  animation: fadeDown 0.2s ease;
  pointer-events: auto;
}

.toast.success {
  background: #065F46;
}

.toast.error {
  background: #991B1B;
}

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

@keyframes slideUp {
  from { transform: translateY(36px); opacity: 0.7; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeDown {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.empty-state {
  text-align: center;
  padding: 26px 14px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.muted-note {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
