:root {
  --bg: #f4f4f6;
  --surface: #ffffff;
  --ink: #16181d;
  --ink-soft: #6b7280;
  --line: #ececf0;

  --accent: #2fd187;
  --accent-2: #11b7a8;
  --grad: linear-gradient(135deg, #5ef0a8 0%, #2fd187 45%, #11b7a8 100%);

  --pastel-rose: #ffd9d4;
  --pastel-violet: #ded6ff;
  --pastel-mint: #d2f6e4;
  --pastel-blue: #d4e7ff;
  --pastel-amber: #ffe6c2;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(20, 24, 29, 0.06);
  --shadow-soft: 0 4px 14px rgba(20, 24, 29, 0.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 92px;
}

.screen { padding: 22px 20px 8px; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 6px;
}
.topbar .hello { font-size: 13px; color: var(--ink-soft); }
.topbar .name { font-size: 18px; font-weight: 700; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--grad); color: #fff;
  display: grid; place-items: center; font-weight: 700;
  box-shadow: var(--shadow-soft);
}

/* ---------- Hero balance ---------- */
.hero {
  margin: 14px 20px 0;
  background: var(--grad);
  border-radius: 26px;
  padding: 22px 22px 24px;
  color: #07261b;
  box-shadow: 0 18px 40px rgba(47, 209, 135, 0.28);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}
.hero .label { font-size: 13px; opacity: 0.8; }
.hero .amount { font-size: 38px; font-weight: 800; letter-spacing: -1px; margin-top: 4px; }
.hero .sub { font-size: 13px; opacity: 0.85; margin-top: 6px; }
.hero .badge {
  position: absolute; top: 22px; right: 22px;
  background: rgba(255,255,255,0.85); color: #07261b;
  font-weight: 700; font-size: 12px; padding: 5px 10px; border-radius: 8px;
}

/* ---------- Quick actions ---------- */
.actions { display: flex; gap: 12px; margin: 18px 20px 0; }
.action {
  flex: 1; background: var(--surface); border: none;
  border-radius: var(--radius-sm); padding: 14px 0;
  display: grid; place-items: center; gap: 6px;
  box-shadow: var(--shadow-soft); cursor: pointer;
  color: var(--ink); font-size: 12px; font-weight: 600; text-decoration: none;
}
.action.primary { background: var(--ink); color: #fff; }
.action .ico { font-size: 18px; line-height: 1; }

/* ---------- Sections ---------- */
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 26px 20px 12px; font-size: 17px; font-weight: 700;
}
.section-title a { font-size: 13px; color: var(--accent-2); text-decoration: none; font-weight: 600; }

/* ---------- List rows / cards ---------- */
.list { padding: 0 20px; display: flex; flex-direction: column; gap: 10px; }
.row {
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 14px 16px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-soft); text-decoration: none; color: var(--ink);
}
.row .icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-size: 18px; flex-shrink: 0;
}
.row .meta { flex: 1; min-width: 0; }
.row .title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .desc { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.row .amount { font-weight: 700; font-size: 15px; white-space: nowrap; }
.row .amount.pos { color: var(--accent-2); }

.i-rose { background: var(--pastel-rose); }
.i-violet { background: var(--pastel-violet); }
.i-mint { background: var(--pastel-mint); }
.i-blue { background: var(--pastel-blue); }
.i-amber { background: var(--pastel-amber); }

/* tint full row variants (transactions look) */
.row.tint-rose { background: var(--pastel-rose); box-shadow: none; }
.row.tint-violet { background: var(--pastel-violet); box-shadow: none; }
.row.tint-mint { background: var(--pastel-mint); box-shadow: none; }
.row.tint-blue { background: var(--pastel-blue); box-shadow: none; }
.row.tint-amber { background: var(--pastel-amber); box-shadow: none; }
.row.tint-rose .icon, .row.tint-violet .icon, .row.tint-mint .icon,
.row.tint-blue .icon, .row.tint-amber .icon { background: rgba(255,255,255,0.6); }

/* ---------- Stats grid ---------- */
.stats { display: flex; gap: 12px; margin: 18px 20px 0; }
.stat {
  flex: 1; background: var(--surface); border-radius: var(--radius-sm);
  padding: 16px; box-shadow: var(--shadow-soft);
}
.stat .n { font-size: 24px; font-weight: 800; }
.stat .l { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- Empty ---------- */
.empty {
  margin: 14px 20px; padding: 28px 20px; text-align: center;
  background: var(--surface); border-radius: var(--radius-sm);
  color: var(--ink-soft); box-shadow: var(--shadow-soft);
}
.empty .big { font-size: 30px; margin-bottom: 8px; }

/* ---------- Forms ---------- */
.form { padding: 8px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.field input, .field select {
  font-size: 16px; padding: 13px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  width: 100%; appearance: none;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,209,135,0.15);
}
.field .hint { font-size: 11px; color: var(--ink-soft); }
.row2 { display: flex; gap: 12px; }
.row2 .field { flex: 1; }

.btn {
  border: none; border-radius: var(--radius-sm); padding: 15px;
  font-size: 16px; font-weight: 700; cursor: pointer; width: 100%;
  background: var(--ink); color: #fff; text-decoration: none; text-align: center;
  display: block;
}
.btn.accent { background: var(--accent); color: #06281c; }
.btn.ghost { background: transparent; color: var(--ink-soft); box-shadow: none; }
.btn.danger { background: var(--pastel-rose); color: #9b2c2c; padding: 8px 12px; width: auto; font-size: 13px; }

.alert {
  margin: 0 20px 4px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--pastel-rose); color: #9b2c2c; font-size: 14px; font-weight: 500;
}

/* ---------- Auth screens ---------- */
.auth { padding: 60px 26px 26px; min-height: 100vh; display: flex; flex-direction: column; }
.auth .brand {
  font-size: 30px; font-weight: 800; letter-spacing: -1px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth .tag { color: var(--ink-soft); margin: 6px 0 30px; font-size: 15px; }
.auth .form { padding: 0; gap: 14px; }
.auth .switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--ink-soft); }
.auth .switch a { color: var(--accent-2); font-weight: 600; text-decoration: none; }

/* ---------- Bottom nav ---------- */
.nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px;
  width: calc(100% - 36px); max-width: 424px;
  background: var(--surface); border-radius: 20px;
  display: flex; justify-content: space-around; padding: 10px 6px;
  box-shadow: 0 12px 30px rgba(20,24,29,0.12);
}
.nav a {
  display: grid; place-items: center; gap: 3px;
  color: var(--ink-soft); text-decoration: none; font-size: 10px; font-weight: 600;
  padding: 4px 10px; border-radius: 12px;
}
.nav a .ico { font-size: 19px; }
.nav a.active { color: var(--ink); }
.nav a.active .ico { color: var(--accent-2); }

/* floating add */
.fab {
  position: fixed; right: calc(50% - 212px); bottom: 92px; z-index: 5;
  width: 56px; height: 56px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-size: 26px; text-decoration: none;
  box-shadow: 0 10px 24px rgba(20,24,29,0.28);
}
@media (max-width: 460px) { .fab { right: 20px; } }
