/* ============ Langganan Tracker — playful fintech redesign ============ */

@import url('https://fonts.googleapis.com/css2?family=Gabarito:wght@400;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --accent: #2f6bff;
  --accent-ink: #ffffff;
  --accent-2: #6f9bff;
  --accent-soft: #e9f0ff;
  --accent-glow: 47 107 255;

  --green: #10b981;  --green-soft: #def5ea; --green-ink: #047857;
  --rose:  #f43f6b;  --rose-soft:  #fde4ea; --rose-ink:  #c01e44;
  --amber: #f59e0b;  --amber-soft: #fdeecb; --amber-ink: #b45309;

  --c-purple: #7c5cff;
  --c-pink:   #ff5da2;
  --c-teal:   #12b5a8;
  --c-orange: #ff7a3d;
  --c-blue:   #2f6bff;
  --c-lime:   #66c61c;

  --bg:        #eef1f8;
  --bg-tint:   #e6ebf6;
  --surface:   #ffffff;
  --surface-2: #f6f8fc;
  --ink:       #131a30;
  --ink-soft:  #5d6580;
  --ink-faint: #97a0b8;
  --line:      #e7ebf4;
  --line-2:    #eef1f8;

  --shadow-sm: 0 1px 2px rgba(19,26,48,.05), 0 2px 6px rgba(19,26,48,.05);
  --shadow-md: 0 6px 22px rgba(19,26,48,.08);
  --shadow-lg: 0 18px 50px rgba(19,26,48,.13);
  --shadow-accent: 0 12px 30px rgba(var(--accent-glow), .35);

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-xl: 32px;
  --maxw: 1080px;
  --font-ui: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-display: "Gabarito", "Plus Jakarta Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
::selection { background: var(--accent); color: #fff; }

.app-bg {
  min-height: 100vh;
  background:
    radial-gradient(1200px 480px at 12% -8%, rgba(var(--accent-glow), .12), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(124,92,255,.10), transparent 55%),
    var(--bg);
}

/* ---------- Shell ---------- */
.shell { max-width: var(--maxw); margin: 0 auto; padding: 0 22px 130px; }
.page { opacity: 1; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .page { animation: rise .42s cubic-bezier(.2,.7,.2,1) both; }
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; cursor: pointer; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: #fff;
  box-shadow: var(--shadow-accent); flex-shrink: 0;
}
.brand-name { font-family: var(--font-display); font-size: 21px; letter-spacing: -.3px; }
.brand-sub { font-size: 11px; color: var(--ink-faint); font-weight: 600; letter-spacing: .3px; margin-top: -3px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 12px; font-weight: 700; font-size: 14.5px;
  color: var(--ink-soft); transition: .18s;
}
.nav-link:hover { color: var(--ink); background: var(--surface-2); }
.nav-link.active { color: var(--accent-ink); background: var(--accent); box-shadow: var(--shadow-accent); }
.nav-link.danger:hover { color: var(--rose-ink); background: var(--rose-soft); }

/* ---------- Tabbar (mobile) ---------- */
.tabbar { display: none; }

/* ---------- Page headings ---------- */
.page-head { padding: 30px 2px 18px; }
.page-kicker { font-size: 12.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.page-title { font-family: var(--font-display); font-size: 34px; font-weight: 800; letter-spacing: -.6px; margin: 4px 0 0; }
.page-desc { color: var(--ink-soft); font-size: 15px; margin: 6px 0 0; }

.section-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint); margin: 30px 2px 14px;
}
.section-label .count { color: var(--accent); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}

/* Hero card */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl);
  background: linear-gradient(135deg, var(--accent), var(--accent-2) 92%);
  color: #fff; padding: 28px 30px; box-shadow: var(--shadow-accent);
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -60px;
  width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255,255,255,.13); pointer-events: none;
}
.hero::before {
  content: ""; position: absolute; right: 60px; bottom: -90px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,.08); pointer-events: none;
}
.hero-label { font-size: 14px; font-weight: 700; opacity: .9; display: flex; align-items: center; gap: 8px; }
.hero-amount { font-family: var(--font-display); font-weight: 800; font-size: 52px; letter-spacing: -1.5px; line-height: 1; margin: 12px 0 0; }
.hero-amount .rp { font-size: 26px; opacity: .8; margin-right: 6px; vertical-align: 6px; }
.hero-foot { display: flex; gap: 22px; margin-top: 22px; position: relative; }
.hero-foot .hf { font-size: 13px; }
.hero-foot .hf b { font-family: var(--font-display); display: block; font-size: 20px; margin-top: 2px; }
.hero-foot .hf span { opacity: .85; }
.hero-divider { width: 1px; background: rgba(255,255,255,.25); }

/* Stat grid */
.grid-stats { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.stat-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; }
.stat-val { font-family: var(--font-display); font-size: 27px; font-weight: 800; letter-spacing: -.5px; }
.stat-lbl { font-size: 13.5px; color: var(--ink-soft); font-weight: 600; margin-top: 2px; }

/* ---------- List items ---------- */
.list { display: flex; flex-direction: column; }
.item {
  display: flex; align-items: center; gap: 15px;
  padding: 16px 20px; border-bottom: 1px solid var(--line-2);
  transition: background .15s;
}
.item:last-child { border-bottom: none; }
.item:hover { background: var(--surface-2); }

.avatar {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; color: #fff; font-weight: 800;
}

.item-main { min-width: 0; flex: 1; }
.item-name { font-weight: 800; font-size: 16px; letter-spacing: -.2px; display: flex; align-items: center; gap: 9px; }
.item-sub { font-size: 13.5px; color: var(--ink-soft); margin-top: 3px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-faint); display: inline-block; }
.chip-cat {
  font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line);
}

.item-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.amount { font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -.4px; text-align: right; }
.amount .rp { font-size: 13px; color: var(--ink-faint); font-weight: 700; margin-right: 3px; }

/* Badges */
.badge {
  font-size: 12.5px; font-weight: 800; padding: 5px 11px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px; letter-spacing: -.1px; white-space: nowrap;
}
.badge .bd { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge.lunas { background: var(--green-soft); color: var(--green-ink); }
.badge.lewat  { background: var(--rose-soft);  color: var(--rose-ink); }
.badge.belum  { background: var(--amber-soft); color: var(--amber-ink); }

/* Pay toggle / check */
.check {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 9px;
  border: 2.5px solid var(--line); background: var(--surface);
  display: grid; place-items: center; transition: .18s; color: #fff;
}
.check.on { background: var(--green); border-color: var(--green); box-shadow: 0 4px 12px rgba(16,185,129,.4); }
.check:hover { border-color: var(--green); }

.icon-btn {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  color: var(--ink-faint); transition: .15s;
}
.icon-btn:hover { background: var(--rose-soft); color: var(--rose-ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 800; font-size: 15px; padding: 12px 20px; border-radius: 14px;
  transition: .16s; letter-spacing: -.2px; cursor: pointer; border: none; font-family: inherit;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-accent); }
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--rose-soft); color: var(--rose-ink); }
.btn-danger:hover { background: var(--rose-ink); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 13px; font-size: 13.5px; border-radius: 11px; }

/* Add row */
.add-row {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-radius: var(--r-md);
  border: 1.5px dashed var(--line); background: var(--surface);
  color: var(--accent); font-weight: 800; font-size: 15px; width: 100%;
  transition: .16s; cursor: pointer; font-family: inherit;
}
.add-row:hover { border-color: var(--accent); background: var(--accent-soft); }
.add-plus {
  width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft);
  display: grid; place-items: center; color: var(--accent); flex-shrink: 0;
}

/* Form */
.form-wrap { padding: 6px 20px 20px; display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 800; color: var(--ink-soft); letter-spacing: .02em; }
.input {
  background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 13px; font-size: 15px; font-weight: 600; color: var(--ink); width: 100%; transition: .15s;
}
.input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.input::placeholder { color: var(--ink-faint); font-weight: 500; }
select.input { appearance: auto; }

/* Cat chips (form) */
.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-chip {
  font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-soft); border: 1.5px solid var(--line);
  cursor: pointer; transition: .15s; font-family: inherit;
}
.cat-chip:hover { border-color: var(--accent); color: var(--accent); }
.cat-chip.sel { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 800; }

/* ---------- Patungan card ---------- */
.pat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px; box-shadow: var(--shadow-sm); transition: .18s; cursor: pointer; position: relative; overflow: hidden;
}
.pat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.pat-top { display: flex; align-items: center; gap: 14px; }
.pat-name { font-family: var(--font-display); font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.pat-meta { font-size: 13.5px; color: var(--ink-soft); margin-top: 2px; }

.progress { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 16px; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green), #34d399); transition: width .6s cubic-bezier(.2,.7,.2,1); }
.progress.warn > i { background: linear-gradient(90deg, var(--amber), #fbbf4d); }

.pat-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.pat-collected { font-size: 14px; color: var(--ink-soft); }
.pat-collected b { font-family: var(--font-display); color: var(--ink); font-size: 16px; }

/* Avatar stack */
.ava-stack { display: flex; }
.ava-stack > * { margin-left: -10px; border: 2.5px solid var(--surface); }
.ava-stack > *:first-child { margin-left: 0; }
.ava-mini {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 12.5px;
}

/* ---------- Detail hero ---------- */
.detail-hero {
  border-radius: var(--r-xl); padding: 28px 30px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--c-purple), #b06bff);
  box-shadow: 0 16px 40px rgba(124,92,255,.35); margin-top: 16px;
}
.detail-hero.green { background: linear-gradient(135deg, var(--green), #34d399); box-shadow: 0 16px 40px rgba(16,185,129,.32); }
.detail-hero.asuransi { background: linear-gradient(135deg, #12b5a8, #37d6c8); box-shadow: 0 16px 40px rgba(18,181,168,.32); }
.detail-hero.hosting  { background: linear-gradient(135deg, #7c5cff, #b06bff); box-shadow: 0 16px 40px rgba(124,92,255,.32); }
.detail-hero.hiburan  { background: linear-gradient(135deg, #ff5da2, #ff86bd); box-shadow: 0 16px 40px rgba(255,93,162,.32); }
.detail-hero.internet { background: linear-gradient(135deg, #2f6bff, #6f9bff); box-shadow: 0 16px 40px rgba(47,107,255,.32); }
.detail-hero.lainnya  { background: linear-gradient(135deg, #ff7a3d, #ffa471); box-shadow: 0 16px 40px rgba(255,122,61,.32); }
.detail-hero::after { content: ""; position: absolute; right: -30px; top: -50px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.12); pointer-events: none; }
.dh-name { font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -.4px; margin-top: 6px; }
.dh-amount { font-family: var(--font-display); font-size: 44px; font-weight: 800; letter-spacing: -1px; margin: 14px 0 4px; }
.dh-amount .rp { font-size: 22px; opacity: .8; margin-right: 5px; }
.dh-meta { font-size: 14px; opacity: .92; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dh-progress { height: 12px; border-radius: 999px; background: rgba(255,255,255,.25); overflow: hidden; margin-top: 22px; }
.dh-progress > i { display: block; height: 100%; background: #fff; border-radius: 999px; }
.dh-collected { margin-top: 12px; font-size: 15px; font-weight: 600; }
.dh-collected b { font-family: var(--font-display); font-size: 17px; }

/* Member row */
.member {
  display: flex; align-items: center; gap: 14px; padding: 15px 20px; border-bottom: 1px solid var(--line-2);
}
.member:last-child { border-bottom: none; }
.member-main { flex: 1; min-width: 0; }
.member-name { font-weight: 700; font-size: 15.5px; }
.member-sub { font-size: 13px; color: var(--ink-soft); margin-top: 1px; }
.member-amt { font-family: var(--font-display); font-weight: 800; font-size: 15px; }

/* Back button */
.back-btn {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14.5px;
  color: var(--ink-soft); padding: 8px 14px 8px 10px; border-radius: 11px; background: var(--surface);
  border: 1px solid var(--line); margin: 26px 0 0; transition: .15s;
}
.back-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Note */
.note {
  display: flex; align-items: center; gap: 11px; padding: 14px 18px; margin-top: 16px;
  background: var(--accent-soft); border-radius: var(--r-md); color: var(--accent);
  font-size: 13.5px; font-weight: 600;
}

/* Copy link */
.copy-link {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--ink-soft);
  cursor: pointer; margin-top: 14px; transition: .15s;
}
.copy-link:hover { border-color: var(--accent); color: var(--accent); }

/* Empty state */
.empty { text-align: center; padding: 50px 20px; color: var(--ink-faint); }
.empty-ico { width: 64px; height: 64px; border-radius: 20px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 16px; color: var(--ink-faint); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--surface); padding: 13px 20px; border-radius: 14px;
  font-weight: 700; font-size: 14.5px; box-shadow: var(--shadow-lg); z-index: 90;
  opacity: 0; pointer-events: none; transition: .25s; display: flex; align-items: center; gap: 10px;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex-shrink: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .shell { padding: 0 14px 110px; }
  .topbar-inner { padding: 12px 16px; }
  .nav { display: none; }
  .brand-sub { display: none; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(16px); border-top: 1px solid var(--line);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); justify-content: space-around;
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 11px; font-weight: 700; color: var(--ink-faint);
    padding: 6px 14px; border-radius: 12px; transition: .15s; background: none; border: none; font-family: inherit; cursor: pointer;
  }
  .tab.active { color: var(--accent); }
  .tab.active .tab-ico { background: var(--accent-soft); }
  .tab-ico { width: 40px; height: 30px; border-radius: 10px; display: grid; place-items: center; transition: .15s; }

  .page-title { font-size: 28px; }
  .grid-stats { grid-template-columns: 1fr 1fr; }
  .grid-stats .stat:first-child { grid-column: 1 / -1; }
  .hero-amount { font-size: 42px; }
  .form-grid { grid-template-columns: 1fr; }
  .hero { padding: 24px 22px; }
  .detail-hero { padding: 24px 20px; }
}
@media (max-width: 420px) {
  .item { padding: 14px 15px; gap: 12px; }
  .item-right { gap: 9px; }
  .amount { font-size: 17px; }
}
