* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  /* Pro palette: deep indigo + violet accent + soft neutrals */
  --bg:        #eef1ff;
  --bg-2:      #f7f8ff;
  --card:      #ffffff;
  --primary:   #4f46e5;   /* indigo-600 */
  --primary-2: #6366f1;   /* indigo-500 */
  --primary-3: #818cf8;   /* indigo-400 */
  --accent:    #a855f7;   /* violet-500 */
  --accent-2:  #ec4899;   /* pink-500 */
  --text:      #0f172a;   /* slate-900 */
  --text-2:    #334155;   /* slate-700 */
  --muted:     #64748b;   /* slate-500 */
  --line:      #e5e7f2;
  --danger:    #ef4444;
  --ok:        #10b981;
  --warn:      #f59e0b;

  --shadow-sm: 0 2px 6px rgba(15, 23, 42, .05);
  --shadow-md: 0 6px 18px rgba(79, 70, 229, .08);
  --shadow-lg: 0 24px 60px rgba(30, 27, 75, .25), 0 8px 24px rgba(30, 27, 75, .12);
}

html, body {
  height: 100%;
  width: 100%;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex; align-items: stretch; justify-content: center;
  padding: 0;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}
body::before, body::after { display: none; }

.phone {
  width: 100vw;
  min-width: 100vw;
  height: 100vh;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  max-width: none;
  background:
    radial-gradient(600px 300px at 50% -10%, rgba(99, 102, 241, .08), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  border-radius: 0;
  position: fixed;
  inset: 0;
  overflow: hidden;
  box-shadow: none;
  border: 0;
}

/* Tablet portrait (iPad Mini, iPad, small tablets) */
@media (min-width: 641px) and (max-width: 900px) {
  body { padding: 0; background: var(--bg); }
  .phone {
    width: 100vw; min-width: 100vw;
    height: 100vh; min-height: 100vh;
    min-height: -webkit-fill-available;
    max-width: none;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    position: fixed; inset: 0;
  }
}

/* Tablet landscape / large tablet (iPad Pro, Surface) */
@media (min-width: 901px) and (max-width: 1199px) {
  body { padding: 0; background: var(--bg); }
  .phone {
    width: 100vw; min-width: 100vw;
    height: 100vh; min-height: 100vh;
    min-height: -webkit-fill-available;
    max-width: none;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    position: fixed; inset: 0;
  }
}

/* Tablet: enlarge inner content proportionally */
@media (min-width: 641px) and (max-width: 1023px) {
  .page { padding: 32px 40px 120px; max-width: 840px; margin: 0 auto; }
  .page { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
  .page.welcome { max-width: 100%; padding: 0; }
  .topbar h1 { font-size: 22px; }
  .icon-btn { width: 44px; height: 44px; }
  .icon-btn svg { width: 24px; height: 24px; }

  .month-switch { font-size: 17px; margin-bottom: 24px; gap: 26px; }

  .ring { --size: 220px; }
  .ring-pct { font-size: 34px; }
  .ring-label { font-size: 14px; }

  .stats { padding: 20px 12px; border-radius: 18px; }
  .stat-val { font-size: 19px; }
  .stat-lbl { font-size: 13px; }

  .recent h2, .help-section-title { font-size: 18px; }
  .recent .sub { font-size: 13.5px; }

  .tx { padding: 15px; grid-template-columns: 50px 1fr auto auto; gap: 14px; }
  .tx-ic, .cat-ic { width: 50px; height: 50px; font-size: 24px; border-radius: 14px; }
  .tx-t, .cat-t { font-size: 16px; }
  .tx-s, .cat-s { font-size: 12.5px; }
  .tx-amt { width: 50px; height: 50px; font-size: 14px; }
  .tx-amt.neg, .tx-amt.pos { font-size: 16px; }

  .form { gap: 20px; }
  .field > span { font-size: 13px; }
  .field select, .field input { padding: 15px 16px; font-size: 14.5px; border-radius: 13px; }
  .amount-wrap input { padding-left: 30px; }
  .primary-btn { padding: 16px; font-size: 16px; border-radius: 15px; }

  .type-switch { padding: 7px; border-radius: 16px; }
  .type-btn { padding: 12px; font-size: 14px; }
  .type-btn svg { width: 19px; height: 19px; }

  .tabs .tab { padding: 13px; font-size: 13.5px; }
  .chart-card { padding: 20px; border-radius: 18px; }
  .chart { height: 190px; gap: 10px; }
  .chart-title { font-size: 13px; }
  .totals { padding: 16px; border-radius: 18px; }
  .t-val { font-size: 15px; }
  .t-lbl { font-size: 11.5px; }
  .pill { padding: 13px; font-size: 14.5px; border-radius: 13px; }

  .donut { width: 240px; height: 240px; }
  .donut-val { font-size: 26px; }
  .donut-lbl { font-size: 13px; }

  .legend { font-size: 13px; padding: 14px; gap: 12px 18px; }

  .help-hero { padding: 26px 22px 20px; border-radius: 22px; }
  .help-hero h2 { font-size: 22px; }
  .help-hero p { font-size: 14px; }
  .help-search { padding: 12px 14px; }
  .help-search input { font-size: 14px; }
  .quick-card { padding: 16px 10px; border-radius: 16px; }
  .qc-ic { width: 46px; height: 46px; border-radius: 14px; }
  .qc-ic svg { width: 22px; height: 22px; }
  .qc-t { font-size: 14px; }
  .faq-item summary { padding: 16px; font-size: 14px; }
  .faq-item p { padding: 0 16px 16px; font-size: 13.5px; }
  .hc-icon { width: 46px; height: 46px; }
  .help-contact { padding: 16px 18px; border-radius: 18px; }

  .bottom-nav {
    height: 76px;
    left: 0; right: 0;
    max-width: none; width: 100%;
    bottom: 0; border-radius: 22px 22px 0 0;
    padding: 0 32px;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .nav-btn { height: 54px; }
  .nav-btn svg { width: 26px; height: 26px; }
  .nav-btn.fab { width: 62px; height: 62px; }
  .nav-btn.fab svg { width: 28px; height: 28px; }

  .side-menu { max-width: 340px; }
  .menu-item { padding: 14px 16px; font-size: 15px; }
  .menu-item svg { width: 21px; height: 21px; }

  .welcome-inner { padding: 52px 44px 36px; max-width: 700px; margin: 0 auto; }
  .welcome-title { font-size: 36px; }
  .welcome-sub { font-size: 15px; margin-bottom: 28px; }
  .welcome-features li { font-size: 14px; padding: 12px 14px; }
  .welcome-logo { width: 80px; height: 80px; border-radius: 22px; margin-bottom: 32px; }
}

/* Tablet landscape orientation: adaptive */
@media (min-width: 900px) and (orientation: landscape) and (max-width: 1366px) {
  body { padding: 0; background: var(--bg); }
  .phone {
    width: 100vw; min-width: 100vw;
    height: 100vh; min-height: 100vh;
    min-height: -webkit-fill-available;
    max-width: none;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    position: fixed; inset: 0;
  }
}

/* Large tablet / iPad Pro 12.9" (1024x1366 portrait, 1366x1024 landscape) */
@media (min-width: 1024px) and (max-width: 1440px),
       (min-width: 1200px) and (max-width: 1440px) and (orientation: landscape) {
  body { padding: 0; background: var(--bg); }
  .phone {
    width: 100vw; min-width: 100vw;
    height: 100vh; min-height: 100vh;
    min-height: -webkit-fill-available;
    max-width: none;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    position: fixed; inset: 0;
  }
}

/* Large tablet: scale up content proportionally for 12.9" iPad Pro */
@media (min-width: 1024px) and (max-width: 1440px) {
  .page { padding: 40px 60px 130px; max-width: 1100px; margin: 0 auto; }
  .page { padding-bottom: calc(130px + env(safe-area-inset-bottom)); }
  .page.welcome { max-width: 100%; padding: 0; }
  .topbar h1 { font-size: 26px; }
  .icon-btn { width: 48px; height: 48px; }
  .icon-btn svg { width: 26px; height: 26px; }

  .month-switch { font-size: 18px; margin-bottom: 28px; gap: 30px; }

  .ring { --size: 260px; }
  .ring-pct { font-size: 40px; }
  .ring-label { font-size: 15px; }

  .stats { padding: 24px 14px; border-radius: 20px; }
  .stat-val { font-size: 22px; }
  .stat-lbl { font-size: 14px; }

  .recent h2, .help-section-title { font-size: 20px; }
  .recent .sub { font-size: 14px; }
  .recent-head { margin-bottom: 16px; }

  .tx { padding: 18px; grid-template-columns: 56px 1fr auto auto; gap: 16px; }
  .tx-ic, .cat-ic { width: 56px; height: 56px; font-size: 26px; border-radius: 16px; }
  .tx-t, .cat-t { font-size: 17px; }
  .tx-s, .cat-s { font-size: 13px; }
  .tx-amt { width: 54px; height: 54px; font-size: 15px; }
  .tx-amt.neg, .tx-amt.pos { font-size: 17px; }

  .form { gap: 22px; }
  .field > span { font-size: 14px; }
  .field select, .field input { padding: 16px 18px; font-size: 15px; border-radius: 14px; }
  .amount-wrap input { padding-left: 34px; }
  .amt-icon { font-size: 16px; }
  .primary-btn { padding: 18px; font-size: 17px; border-radius: 16px; }

  .type-switch { padding: 8px; border-radius: 18px; }
  .type-btn { padding: 14px; font-size: 15px; }
  .type-btn svg { width: 20px; height: 20px; }

  .tabs .tab { padding: 14px; font-size: 14px; }
  .chart-card { padding: 22px; border-radius: 20px; }
  .chart { height: 220px; gap: 12px; }
  .chart-title { font-size: 14px; margin-bottom: 16px; }
  .totals { padding: 18px; border-radius: 20px; }
  .t-val { font-size: 16px; }
  .t-lbl { font-size: 12px; }
  .pill { padding: 14px; font-size: 15px; border-radius: 14px; }

  .donut { width: 280px; height: 280px; }
  .donut-val { font-size: 30px; }
  .donut-lbl { font-size: 14px; }

  .legend { font-size: 14px; padding: 16px; gap: 14px 20px; }
  .dot { width: 10px; height: 10px; }

  .help-hero { padding: 32px 28px 24px; border-radius: 24px; }
  .help-hero h2 { font-size: 26px; }
  .help-hero p { font-size: 15px; }
  .help-search { padding: 14px 16px; border-radius: 14px; }
  .help-search input { font-size: 15px; }
  .quick-card { padding: 20px 12px; border-radius: 18px; }
  .qc-ic { width: 52px; height: 52px; border-radius: 16px; }
  .qc-ic svg { width: 26px; height: 26px; }
  .qc-t { font-size: 15px; }
  .qc-s { font-size: 12px; }
  .faq-item summary { padding: 18px; font-size: 15px; }
  .faq-item p { padding: 0 18px 18px; font-size: 14px; }
  .hc-icon { width: 52px; height: 52px; border-radius: 16px; }
  .help-contact { padding: 18px 20px; border-radius: 20px; }

  .bottom-nav {
    height: 84px;
    left: 0; right: 0;
    max-width: none; width: 100%;
    bottom: 0; border-radius: 24px 24px 0 0;
    padding: 0 40px;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .nav-btn { height: 60px; }
  .nav-btn svg { width: 28px; height: 28px; }
  .nav-btn.fab { width: 68px; height: 68px; }
  .nav-btn.fab svg { width: 30px; height: 30px; }

  .side-menu { max-width: 380px; }
  .menu-item { padding: 16px 18px; font-size: 16px; }
  .menu-item svg { width: 22px; height: 22px; }

  .welcome-inner { padding: 60px 60px 40px; max-width: 900px; margin: 0 auto; }
  .welcome-title { font-size: 44px; }
  .welcome-sub { font-size: 17px; margin-bottom: 32px; }
  .welcome-features li { font-size: 15px; padding: 14px 16px; }
  .welcome-logo { width: 88px; height: 88px; border-radius: 24px; margin-bottom: 36px; }
}

/* Large screens / small desktops */
@media (min-width: 1441px) {
  body { padding: 0; background: var(--bg); }
  .phone {
    width: 100vw; min-width: 100vw;
    height: 100vh; min-height: 100vh;
    min-height: -webkit-fill-available;
    max-width: none;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    position: fixed; inset: 0;
  }
  .page { padding: 48px 80px 140px; max-width: 1200px; margin: 0 auto; }
  .page { padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
  .page.welcome { max-width: 100%; padding: 0; }
  .welcome-inner { padding: 64px 80px 48px; max-width: 1000px; margin: 0 auto; }
  .bottom-nav {
    height: 88px;
    left: 0; right: 0;
    max-width: none; width: 100%;
    bottom: 0; border-radius: 28px 28px 0 0;
    padding: 0 48px;
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Mobile: fill the screen, drop rounded frame */
@media (max-width: 640px) {
  body { padding: 0; background: var(--bg); }
  .phone {
    width: 100vw; min-width: 100vw;
    height: 100vh; min-height: 100vh;
    min-height: -webkit-fill-available;
    max-width: none;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    position: fixed; inset: 0;
  }
  .page { padding: 18px 16px 100px; }
  .bottom-nav { left: 12px; right: 12px; bottom: 12px; }
}

/* Very small phones */
@media (max-width: 360px) {
  .page { padding: 14px 12px 96px; }
  .topbar h1 { font-size: 16px; }
  .ring { --size: 150px; }
  .donut { width: 160px; height: 160px; }
  .stat-val { font-size: 14px; }
  .stat-lbl { font-size: 10px; }
  .totals { padding: 10px 8px; }
  .t-val { font-size: 12px; }
  .t-lbl { font-size: 9px; }
}

.page {
  position: absolute;
  inset: 0;
  padding: 22px 20px 100px;
  overflow-y: auto;
  display: none;
}
.page.active { display: block; }
.page::-webkit-scrollbar { width: 0; }

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.topbar h1 { font-size: 18px; font-weight: 700; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px;
  background: transparent; border: 0; cursor: pointer;
  display: grid; place-items: center; color: var(--text);
}
.icon-btn svg { width: 22px; height: 22px; }

/* Month switch */
.month-switch {
  display: flex; align-items: center; justify-content: center; gap: 22px;
  font-weight: 600; margin-bottom: 18px;
}
.arrow {
  border: 0; background: transparent; font-size: 18px;
  color: var(--text); cursor: pointer;
}

/* Ring card (dashboard) */
.ring-card {
  display: grid; place-items: center; margin: 6px 0 18px;
}
.ring {
  --size: 170px;
  --pct: 50;
  width: var(--size); height: var(--size);
  border-radius: 50%;
  background:
    conic-gradient(from 0deg,
      var(--primary) 0%,
      var(--primary-2) calc(var(--pct) * 0.5%),
      var(--accent) calc(var(--pct) * 1%),
      #e5e7f2 calc(var(--pct) * 1%));
  display: grid; place-items: center;
  position: relative;
  filter: drop-shadow(0 12px 24px rgba(79, 70, 229, .25));
}
.ring::before {
  content: "";
  position: absolute; inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(99,102,241,.15), transparent 50%);
  filter: blur(10px);
  z-index: -1;
}
.ring-inner {
  width: 78%; height: 78%;
  background: #fff; border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px #eef0f8, 0 4px 12px rgba(15,23,42,.04);
}
.ring-pct {
  font-size: 26px; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ring-label { font-size: 12px; color: var(--muted); margin-top: 2px; text-align: center; }

/* Stats */
.stats {
  background: #fff; border-radius: 16px; padding: 14px 8px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  box-shadow: 0 6px 18px rgba(30, 40, 90, .06);
  margin-bottom: 22px;
}
.stat { text-align: center; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-val { font-weight: 700; font-size: 15px; }
.stat-lbl { color: var(--muted); font-size: 11px; margin-top: 4px; }

/* Recent */
.recent h2 { font-size: 15px; margin-bottom: 4px; }
.recent .sub { font-size: 12px; color: var(--muted); margin-bottom: 12px; }

.tx-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.tx {
  background: #fff; border-radius: 14px; padding: 12px;
  display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px;
  box-shadow: 0 4px 12px rgba(30, 40, 90, .05);
}
.tx-ic {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px;
  background: #eef0ff;
}
.tx-ic.food { background:#fee2e2; }
.tx-ic.shop { background:#fef3c7; }
.tx-ic.movie { background:#e0e7ff; }
.tx-t { font-weight: 600; font-size: 14px; }
.tx-s { color: var(--muted); font-size: 11px; margin-top: 2px; }
.tx-amt {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-weight: 700; font-size: 12px;
  display: grid; place-items: center;
  box-shadow: 0 6px 14px rgba(79, 70, 229, .35);
}
.tx-amt.neg { background: transparent; color: var(--danger); width: auto; height: auto; font-size: 14px; box-shadow: none; }

/* Form */
.form { display: flex; flex-direction: column; gap: 16px; margin-top: 6px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.field select, .field input {
  width: 100%; border: 1px solid var(--line);
  background: #fff; border-radius: 12px;
  padding: 12px 12px; font-size: 13px; color: var(--text);
  outline: none; transition: border-color .15s;
}
.field select:focus, .field input:focus { border-color: var(--primary); }
.amount-wrap { position: relative; }
.amt-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-weight: 600;
}
.amount-wrap input { padding-left: 28px; }
.primary-btn {
  margin-top: 20px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; border: 0;
  padding: 14px; border-radius: 14px; font-weight: 700; font-size: 15px;
  letter-spacing: .2px;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(79, 70, 229, .35), inset 0 1px 0 rgba(255,255,255,.2);
  transition: transform .15s ease, box-shadow .15s ease;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 18px 32px rgba(79, 70, 229, .45); }
.primary-btn:active { transform: translateY(0); }

/* Tabs */
.tabs {
  display: flex; background: #eef0f8; padding: 4px; border-radius: 12px;
  margin-bottom: 16px;
}
.tab {
  flex: 1; padding: 10px; border: 0; background: transparent;
  border-radius: 10px; font-weight: 700; font-size: 12px; color: var(--muted);
  cursor: pointer; letter-spacing: .5px;
}
.tab.active { background: #fff; color: var(--text); box-shadow: 0 2px 6px rgba(0,0,0,.06); }

/* Chart */
.chart-card {
  background: #fff; border-radius: 16px; padding: 16px;
  box-shadow: 0 6px 18px rgba(30, 40, 90, .06); margin-bottom: 16px;
}
.chart-title { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.chart {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 8px; height: 140px; align-items: end;
  padding-bottom: 20px; position: relative;
}
.bar {
  position: relative; height: calc(var(--h));
  background: linear-gradient(180deg, var(--primary-3), var(--primary));
  border-radius: 8px 8px 0 0;
  box-shadow: 0 4px 10px rgba(79, 70, 229, .25);
}
.bar.highlight { background: linear-gradient(180deg, var(--accent), var(--primary)); box-shadow: 0 6px 14px rgba(168, 85, 247, .4); }
.bar.highlight::before {
  content: attr(data-label);
  position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  background: #111827; color: #fff; padding: 2px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 600;
}
.bar span {
  position: absolute; bottom: -20px; left: 0; right: 0;
  text-align: center; font-size: 11px; color: var(--muted); font-weight: 600;
}

/* Totals */
.totals {
  background: #fff; border-radius: 16px; padding: 12px 14px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  box-shadow: 0 6px 18px rgba(30, 40, 90, .06); margin-bottom: 16px;
}
.totals > div { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.t-lbl { font-size: 10px; color: var(--muted); }
.t-val { font-size: 13px; font-weight: 700; }

/* Pills */
.pill-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.pill {
  flex: 1; padding: 10px; border: 0; background: #fff;
  border-radius: 12px; font-weight: 600; font-size: 13px; color: var(--muted);
  cursor: pointer;
}
.pill.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 10px 22px rgba(79, 70, 229, .35);
}

/* Donut (history) */
.donut-card { display: grid; place-items: center; margin: 6px 0 16px; }
.donut {
  width: 180px; height: 180px; border-radius: 50%;
  background: conic-gradient(
    #f59e0b 0 30%,
    #10b981 30% 55%,
    #ef4444 55% 78%,
    #6366f1 78% 92%,
    #a855f7 92% 100%
  );
  display: grid; place-items: center;
  filter: drop-shadow(0 14px 28px rgba(79, 70, 229, .2));
}
.donut-inner {
  width: 72%; height: 72%; background: #fff; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
}
.donut-lbl { font-size: 12px; color: var(--muted); }
.donut-val { font-size: 22px; font-weight: 700; }

.legend {
  background: #fff; border-radius: 14px; padding: 12px;
  display: flex; flex-wrap: wrap; gap: 10px 14px;
  justify-content: center; font-size: 12px; color: var(--muted);
  box-shadow: 0 4px 12px rgba(30, 40, 90, .05); margin-bottom: 14px;
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

.cat-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.cat-list li {
  background: #fff; border-radius: 14px; padding: 12px;
  display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px;
  box-shadow: 0 4px 12px rgba(30, 40, 90, .05);
}
.cat-ic {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px; background: #eef0ff;
}
.cat-ic.food { background:#fee2e2; }
.cat-ic.shop { background:#fef3c7; }
.cat-ic.trans { background:#dcfce7; }
.cat-t { font-weight: 600; font-size: 14px; }
.cat-s { color: var(--muted); font-size: 11px; margin-top: 2px; }
.cat-amt { font-weight: 700; font-size: 14px; }

/* Bottom nav */
.bottom-nav {
  position: absolute; left: 16px; right: 16px; bottom: 14px;
  height: 62px; background: #fff; border-radius: 20px;
  display: grid; grid-template-columns: repeat(4, 1fr); align-items: center;
  padding: 0 8px; box-shadow: 0 10px 24px rgba(30, 40, 90, .12);
  z-index: 10;
}
.nav-btn {
  border: 0; background: transparent; cursor: pointer;
  color: var(--muted); display: grid; place-items: center;
  height: 46px; border-radius: 12px;
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn.active { color: var(--primary); }
.nav-btn.fab {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; width: 52px; height: 52px;
  border-radius: 50%; justify-self: center;
  box-shadow: 0 14px 26px rgba(79, 70, 229, .5), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .2s ease;
}
.nav-btn.fab:hover { transform: translateY(-2px) scale(1.03); }
.nav-btn.fab svg { width: 24px; height: 24px; }
.bottom-nav.hidden { display: none; }

/* ===================== Welcome page ===================== */
.page.welcome {
  padding: 0;
  background:
    radial-gradient(700px 500px at 15% 5%, rgba(56, 189, 248, .35), transparent 60%),
    radial-gradient(600px 500px at 90% 95%, rgba(244, 114, 182, .45), transparent 60%),
    radial-gradient(500px 400px at 50% 60%, rgba(167, 139, 250, .3), transparent 65%),
    linear-gradient(160deg, #0b1120 0%, #1e293b 30%, #312e81 65%, #6d28d9 100%);
  color: #fff;
  overflow: hidden;
}
.welcome-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.welcome-bg .blob {
  position: absolute; border-radius: 50%; filter: blur(50px); opacity: .5;
  mix-blend-mode: screen;
}
.welcome-bg .b1 { width: 280px; height: 280px; background: #38bdf8; top: -80px; left: -60px; animation: floatA 11s ease-in-out infinite; }
.welcome-bg .b2 { width: 240px; height: 240px; background: #f472b6; bottom: 15%; right: -70px; animation: floatB 13s ease-in-out infinite; }
.welcome-bg .b3 { width: 220px; height: 220px; background: #a78bfa; bottom: -90px; left: 25%; animation: floatA 15s ease-in-out infinite reverse; }
@keyframes floatA {
  0%,100% { transform: translate(0,0); }
  50%     { transform: translate(30px, 20px); }
}
@keyframes floatB {
  0%,100% { transform: translate(0,0); }
  50%     { transform: translate(-25px, -30px); }
}
.welcome-inner {
  position: relative; z-index: 1;
  height: 100%;
  padding: 44px 28px 32px;
  display: flex; flex-direction: column;
}
.welcome-logo {
  width: 72px; height: 72px; border-radius: 20px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(10px);
  display: grid; place-items: center;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
  margin-bottom: 28px;
}
.welcome-title {
  font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -.5px;
  margin-bottom: 12px;
}
.welcome-sub {
  font-size: 14px; line-height: 1.5;
  color: rgba(255,255,255,.78);
  margin-bottom: 24px;
}
.welcome-features {
  list-style: none; display: flex; flex-direction: column; gap: 10px;
  margin-bottom: auto;
}
.welcome-features li {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: rgba(255,255,255,.88);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px; padding: 10px 12px;
  backdrop-filter: blur(6px);
}
.tick {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #22d3ee);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #06231a;
}
.welcome-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.welcome-cta {
  margin-top: 0;
  background: #fff;
  color: var(--primary);
  box-shadow: 0 20px 40px rgba(0,0,0,.35);
}
.welcome-cta:hover { background: #fff; box-shadow: 0 24px 46px rgba(0,0,0,.45); }
.ghost-btn {
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  padding: 12px; border-radius: 14px;
  font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background .15s;
}
.ghost-btn:hover { background: rgba(255,255,255,.1); }
.welcome-dots {
  display: flex; justify-content: center; gap: 6px; margin-top: 18px;
}
.welcome-dots .d {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.4);
}
.welcome-dots .d.active { width: 22px; border-radius: 6px; background: #fff; }

/* ===================== Side menu ===================== */
.menu-overlay {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
  z-index: 30;
}
.menu-overlay.show { opacity: 1; pointer-events: auto; }

.side-menu {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 82%; max-width: 320px;
  background:
    radial-gradient(400px 200px at 0% 0%, rgba(168,85,247,.25), transparent 70%),
    linear-gradient(180deg, #1e1b4b, #312e81);
  color: #fff;
  transform: translateX(-105%);
  transition: transform .28s cubic-bezier(.4,.0,.2,1);
  z-index: 40;
  display: flex; flex-direction: column;
  border-radius: 0 24px 24px 0;
  box-shadow: 20px 0 40px rgba(0,0,0,.35);
}
.side-menu.open { transform: translateX(0); }

.menu-head {
  padding: 22px 20px 18px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.menu-brand {
  font-weight: 800; font-size: 18px; letter-spacing: .3px;
  background: linear-gradient(135deg, #fff, #c7d2fe);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.menu-close { color: #fff; }

.menu-list {
  display: flex; flex-direction: column; padding: 12px 10px; gap: 2px;
  flex: 1; overflow-y: auto;
}
.menu-item {
  display: flex; align-items: center; gap: 12px;
  background: transparent; border: 0;
  color: rgba(255,255,255,.85); text-align: left;
  padding: 12px 14px; border-radius: 12px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
}
.menu-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.menu-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
  transform: translateX(2px);
}
.menu-item.danger { color: #fca5a5; }
.menu-item.danger:hover { background: rgba(239,68,68,.15); color: #fecaca; }
.menu-sep {
  height: 1px; background: rgba(255,255,255,.1); margin: 10px 8px;
}
.menu-foot {
  padding: 14px 20px; font-size: 11px; color: rgba(255,255,255,.4);
  border-top: 1px solid rgba(255,255,255,.08);
}

/* Toggle row (dark mode) */
.menu-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  color: rgba(255,255,255,.85);
}
.menu-toggle-info { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; }
.menu-toggle-info svg { width: 20px; height: 20px; }
.switch {
  width: 46px; height: 26px; border-radius: 999px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.15);
  position: relative; cursor: pointer;
  transition: background .25s ease;
  padding: 0;
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transition: transform .25s cubic-bezier(.4,.0,.2,1);
}
.switch.on { background: linear-gradient(135deg, var(--primary), var(--accent)); }
.switch.on .switch-thumb { transform: translateX(20px); }

/* ============ DARK THEME ============ */
body.dark {
  --bg:        #0f1226;
  --bg-2:      #151935;
  --card:      #1a1f3d;
  --text:      #f1f5f9;
  --text-2:    #cbd5e1;
  --muted:     #94a3b8;
  --line:      #262b4d;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(99, 102, 241, .18), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(168, 85, 247, .14), transparent 55%),
    radial-gradient(800px 500px at 50% 110%, rgba(236, 72, 153, .1), transparent 60%),
    linear-gradient(135deg, #030712 0%, #0b1024 45%, #14103a 100%);
}
body.dark .phone {
  background:
    radial-gradient(600px 300px at 50% -10%, rgba(99, 102, 241, .15), transparent 60%),
    linear-gradient(180deg, #151935, #0f1226);
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 24px 60px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.4);
}
body.dark .stats,
body.dark .tx,
body.dark .chart-card,
body.dark .totals,
body.dark .pill,
body.dark .legend,
body.dark .cat-list li,
body.dark .bottom-nav {
  background: var(--card);
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
body.dark .stat + .stat { border-color: var(--line); }
body.dark .ring-inner,
body.dark .donut-inner {
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line), 0 4px 12px rgba(0,0,0,.4);
}
body.dark .topbar h1,
body.dark .icon-btn,
body.dark .arrow,
body.dark .recent h2,
body.dark .stat-val,
body.dark .tx-t,
body.dark .cat-t,
body.dark .cat-amt,
body.dark .t-val,
body.dark .ring-label,
body.dark .donut-lbl,
body.dark .donut-val,
body.dark .month-switch { color: var(--text); }

body.dark .stat-lbl,
body.dark .recent .sub,
body.dark .tx-s,
body.dark .cat-s,
body.dark .t-lbl,
body.dark .chart-title { color: var(--muted); }

/* Form dark */
body.dark .field > span { color: var(--muted); }
body.dark .field select,
body.dark .field input {
  background: var(--card);
  color: var(--text);
  border-color: var(--line);
}
body.dark .field select:focus,
body.dark .field input:focus { border-color: var(--primary-3); }
body.dark .amt-icon { color: var(--muted); }

/* Tabs dark */
body.dark .tabs { background: var(--card); }
body.dark .tab { color: var(--muted); }
body.dark .tab.active { background: #262b4d; color: #fff; }
body.dark .pill { color: var(--muted); }

/* Category icons softer in dark */
body.dark .tx-ic,
body.dark .cat-ic { background: rgba(129,140,248,.15); }
body.dark .tx-ic.food, body.dark .cat-ic.food { background: rgba(239,68,68,.18); }
body.dark .tx-ic.shop, body.dark .cat-ic.shop { background: rgba(245,158,11,.18); }
body.dark .tx-ic.movie { background: rgba(99,102,241,.22); }
body.dark .cat-ic.trans { background: rgba(16,185,129,.2); }

/* Nav dark */
body.dark .nav-btn { color: var(--muted); }
body.dark .nav-btn.active { color: var(--primary-3); }

/* ============ Income / Expense type switch ============ */
.type-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  background: var(--card, #fff);
  padding: 6px; border-radius: 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 4px;
}
.type-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; border: 0; border-radius: 10px; cursor: pointer;
  font-weight: 600; font-size: 13px; color: var(--muted);
  background: transparent; transition: all .18s ease;
}
.type-btn svg { width: 18px; height: 18px; }
.type-btn.expense.active {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff; box-shadow: 0 8px 18px rgba(239,68,68,.35);
}
.type-btn.income.active {
  background: linear-gradient(135deg, #10b981, #22d3ee);
  color: #fff; box-shadow: 0 8px 18px rgba(16,185,129,.35);
}
body.dark .type-switch { background: var(--card); }

/* ============ Recent head with clear button ============ */
.recent-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.history-head { margin-top: 6px; align-items: center; }
.clear-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 10px;
  background: rgba(239,68,68,.1);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,.2);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.clear-btn:hover { background: rgba(239,68,68,.18); }
.clear-btn svg { width: 14px; height: 14px; }

/* ============ Delete on tx ============ */
.tx { grid-template-columns: 42px 1fr auto auto; }
.tx-del {
  border: 0; background: transparent; cursor: pointer;
  color: var(--muted); padding: 6px; border-radius: 8px;
  opacity: 0; transition: opacity .15s, background .15s, color .15s;
  display: grid; place-items: center;
}
.tx-del svg { width: 16px; height: 16px; }
.tx:hover .tx-del { opacity: 1; }
.tx-del:hover { color: var(--danger); background: rgba(239,68,68,.12); }
@media (hover: none) { .tx-del { opacity: .6; } }

/* Income amount in green */
.tx-amt.pos {
  background: transparent;
  color: var(--ok);
  width: auto; height: auto;
  font-size: 14px; box-shadow: none;
}

/* Empty state */
.empty {
  list-style: none;
  text-align: center; padding: 20px;
  color: var(--muted); font-size: 13px;
  background: rgba(255,255,255,.4);
  border: 1px dashed var(--line);
  border-radius: 14px;
}
body.dark .empty { background: rgba(255,255,255,.03); border-color: var(--line); }

/* ============ Help & Support page ============ */
.help-hero {
  background:
    radial-gradient(400px 200px at 20% 0%, rgba(168,85,247,.35), transparent 60%),
    linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: 20px;
  padding: 22px 20px 18px;
  margin-bottom: 18px;
  box-shadow: 0 18px 40px rgba(79, 70, 229, .35);
  position: relative;
}
.help-hero-icon {
  width: 46px; height: 46px; border-radius: 14px;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.28);
  display: grid; place-items: center; color: #fff;
  margin-bottom: 12px;
  backdrop-filter: blur(6px);
}
.help-hero-icon svg { width: 22px; height: 22px; }
.help-hero h2 { font-size: 20px; font-weight: 800; margin-bottom: 4px; letter-spacing: -.3px; }
.help-hero p { font-size: 13px; color: rgba(255,255,255,.85); line-height: 1.4; margin-bottom: 14px; }
.help-search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  padding: 10px 12px; border-radius: 12px;
  backdrop-filter: blur(6px);
}
.help-search svg { width: 18px; height: 18px; color: rgba(255,255,255,.8); flex-shrink: 0; }
.help-search input {
  background: transparent; border: 0; outline: none;
  color: #fff; font-size: 13px; width: 100%;
  font-family: inherit;
}
.help-search input::placeholder { color: rgba(255,255,255,.6); }

/* Quick action cards */
.help-quick {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 20px;
}
.quick-card {
  background: #fff; border: 0; border-radius: 14px;
  padding: 14px 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.quick-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.qc-ic {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; color: #fff;
  margin-bottom: 4px;
}
.qc-ic svg { width: 20px; height: 20px; }
.qc-ic.q1 { background: linear-gradient(135deg, #6366f1, #a855f7); }
.qc-ic.q2 { background: linear-gradient(135deg, #10b981, #22d3ee); }
.qc-ic.q3 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.qc-t { font-size: 13px; font-weight: 700; color: var(--text); }
.qc-s { font-size: 10px; color: var(--muted); }
body.dark .quick-card { background: var(--card); }
body.dark .qc-t { color: var(--text); }

/* Section title */
.help-section-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  margin: 4px 4px 10px;
  letter-spacing: .2px;
}
body.dark .help-section-title { color: var(--text); }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.faq-item {
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  transition: box-shadow .2s;
}
.faq-item[open] { box-shadow: var(--shadow-md); border-color: transparent; }
.faq-item summary {
  list-style: none; cursor: pointer;
  padding: 13px 14px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-icon {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(99,102,241,.12);
  color: var(--primary);
  display: grid; place-items: center;
  position: relative; flex-shrink: 0;
  transition: transform .2s ease, background .2s;
}
.faq-icon::before, .faq-icon::after {
  content: ""; position: absolute; background: currentColor;
  border-radius: 2px;
}
.faq-icon::before { width: 10px; height: 2px; }
.faq-icon::after  { width: 2px; height: 10px; transition: transform .2s ease; }
.faq-item[open] .faq-icon { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; }
.faq-item[open] .faq-icon::after { transform: rotate(90deg); }
.faq-item p {
  padding: 0 14px 14px;
  font-size: 12.5px; color: var(--muted); line-height: 1.55;
}
.faq-item p code {
  background: rgba(99,102,241,.12); color: var(--primary);
  padding: 1px 5px; border-radius: 4px; font-size: 11.5px;
}
.faq-item.hidden { display: none; }
body.dark .faq-item { background: var(--card); border-color: var(--line); }
body.dark .faq-item summary { color: var(--text); }

/* Contact CTA (email link) */
.help-contact {
  background: #fff; border-radius: 16px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.help-contact:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.hc-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 8px 18px rgba(79, 70, 229, .35);
  flex-shrink: 0;
}
.hc-icon svg { width: 20px; height: 20px; }
.hc-t { font-size: 14px; font-weight: 700; color: var(--text); }
.hc-s { font-size: 12px; color: var(--muted); margin-top: 2px; }
body.dark .help-contact { background: var(--card); }
body.dark .hc-t { color: var(--text); }
