/* =========================================================
   KasRuma — tema hangat & ramah keluarga (krem–oranye)
   ========================================================= */

:root {
  --bg: #FFF8F1;
  --bg-2: #FFF1E4;
  --card: #FFFFFF;
  --ink: #3D2A1E;
  --ink-soft: #6B5344;
  --muted: #7E6659;
  --line: #F2E3D6;
  --line-strong: #E7D2C0;
  --primary: #F2733B;
  --primary-2: #E9531F;
  --primary-soft: #FFE9DC;
  --green: #2F8F5B;
  --green-soft: #E4F4EB;
  --red: #D9503C;
  --red-soft: #FBE9E5;
  --amber: #CE8A2A;
  --amber-soft: #FCF1DC;
  --violet: #8A6FD1;
  --radius-lg: 24px;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 28px rgba(190, 120, 72, .10);
  --shadow-sm: 0 4px 14px rgba(190, 120, 72, .08);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  background-image:
    radial-gradient(720px 400px at 8% -8%, #FFE3CC 0%, rgba(255, 227, 204, 0) 62%),
    radial-gradient(600px 340px at 100% 0%, #FFEFD2 0%, rgba(255, 239, 210, 0) 60%),
    radial-gradient(700px 500px at 50% 110%, #FFEDE0 0%, rgba(255, 237, 224, 0) 65%);
  background-attachment: fixed;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.ic { width: 20px; height: 20px; flex: 0 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }

/* ---------------- Shell ---------------- */
.app-shell { min-height: 100vh; }
.app-main { min-height: 100vh; display: flex; flex-direction: column; }
.page {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 16px calc(112px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.page > * { min-width: 0; }

/* ---------------- Topbar ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 248, 241, .86);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid rgba(242, 227, 214, .8);
}
.topbar-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.topbar-title strong { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  flex: 0 0 auto;
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary-2); }

.streak-chip, .sync-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--amber-soft);
  color: #A6650F;
  border: 1px solid #F0DDB8;
}
.streak-chip .ic, .sync-chip .ic { width: 15px; height: 15px; }
.sync-chip { background: var(--primary-soft); color: #B9480F; border-color: #F6D5C0; }

/* ---------------- Drawer ---------------- */
.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: 288px;
  max-width: 86vw;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF9F3 100%);
  border-right: 1px solid var(--line);
  z-index: 60;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  transform: translateX(-102%);
  transition: transform .24s ease;
  box-shadow: 0 0 40px rgba(120, 70, 40, .14);
}
.drawer.is-open { transform: translateX(0); }
.drawer-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 10px;
}
.drawer-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-group {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 700;
  padding: 14px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 13px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 14px;
}
.nav-item:hover { background: var(--bg-2); color: var(--ink); }
.nav-item.is-active { background: var(--primary-soft); color: #B9480F; }
.nav-item.danger { color: var(--red); }
.nav-item .ic { width: 19px; height: 19px; }
.drawer-foot {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; }
.user-chip:hover { background: var(--bg-2); }
.user-meta { display: flex; flex-direction: column; min-width: 0; }
.user-meta strong { font-size: 13px; }
.user-meta small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex: 0 0 auto;
}
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(61, 42, 30, .38);
  z-index: 55;
  backdrop-filter: blur(2px);
}

/* ---------------- Bottom nav ---------------- */
.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr 1fr 1fr;
  align-items: end;
  gap: 2px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 250, .95);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.bottom-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  min-width: 0;
}
.bottom-item .ic { width: 22px; height: 22px; }
.bottom-item.is-active { color: var(--primary-2); }
.bottom-fab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: -22px;
  color: #B9480F;
  font-size: 11px;
  font-weight: 700;
}
.bottom-fab .ic {
  width: 52px;
  height: 52px;
  padding: 13px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FB8A4E, #E9531F);
  color: #fff;
  box-shadow: 0 10px 22px rgba(233, 83, 31, .35);
  stroke-width: 2.2;
}

/* ---------------- Kartu & grid ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.card.flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.card-head h2 { font-size: 16px; }
.card-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card-link { font-size: 13px; font-weight: 700; color: var(--primary-2); display: inline-flex; align-items: center; gap: 4px; }
.card-link .ic { width: 15px; height: 15px; }

.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid > *, .grid-2 > *, .grid-3 > *, .grid-auto > * { min-width: 0; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 4px 2px -4px; }
.section-title h2 { font-size: 17px; }
.section-title p { font-size: 12.5px; color: var(--muted); }

/* ---------------- KPI ---------------- */
.kpi-main {
  border-radius: var(--radius-lg);
  padding: 20px;
  color: #fff;
  background: linear-gradient(135deg, #F98A4C 0%, #E9531F 55%, #D24413 100%);
  box-shadow: 0 16px 34px rgba(217, 83, 31, .28);
  position: relative;
  overflow: hidden;
}
.kpi-main::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -60px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .13);
}
.kpi-main .label { font-size: 12.5px; opacity: .9; font-weight: 600; letter-spacing: .02em; }
.kpi-main .value { font-size: clamp(28px, 8vw, 36px); font-weight: 800; letter-spacing: -.02em; margin: 4px 0 2px; }
.kpi-main .row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; position: relative; z-index: 1; }
.kpi-main .row div { font-size: 12px; opacity: .95; }
.kpi-main .row strong { display: block; font-size: 15px; font-weight: 700; }
.kpi-main .pill {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, .2);
  border: 1px solid rgba(255, 255, 255, .35);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  z-index: 1;
}

.kpi-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.kpi .k-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.kpi .k-label .ic { width: 15px; height: 15px; }
.kpi .k-value { font-size: 18px; font-weight: 800; margin-top: 6px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.kpi .k-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.kpi.hl-green { background: linear-gradient(160deg, #F1FBF5, #FFFFFF); border-color: #CFEBDA; }
.kpi.hl-red { background: linear-gradient(160deg, #FEF2EE, #FFFFFF); border-color: #F7D9D1; }
.kpi.hl-amber { background: linear-gradient(160deg, #FFF8E9, #FFFFFF); border-color: #F2E0BE; }

/* ---------------- Tombol ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  color: var(--ink);
  text-align: center;
  transition: filter .15s ease, background .15s ease;
}
.btn .ic { width: 18px; height: 18px; }
.btn:hover { filter: brightness(.98); }
.btn-primary { background: linear-gradient(135deg, #F98A4C, #E9531F); color: #fff; box-shadow: 0 8px 18px rgba(233, 83, 31, .24); }
.btn-primary:hover { filter: brightness(1.04); }
.btn-soft { background: var(--primary-soft); color: #B9480F; border-color: #F7D8C4; }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--ink-soft); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: #F3CFC7; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 11px; }
.btn-xs { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 9px; }
.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row .btn { flex: 0 1 auto; }

/* ---------------- Form ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.field .hint { font-size: 11.5px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"],
input[type="month"], input[type="tel"], input[type="url"], input[type="search"], input[type="time"], select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: #FFFDFB;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink);
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(242, 115, 59, .14); }
textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2393796B' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-soft); }
.check input { width: 19px; height: 19px; accent-color: var(--primary); }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { flex: 1 1 160px; }

.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
}
.flash .ic { width: 18px; height: 18px; margin-top: 1px; }
.flash-ok { background: var(--green-soft); color: #216B44; border-color: #C6E6D4; }
.flash-err { background: var(--red-soft); color: #A63A28; border-color: #F1CCC4; }
.flash-warn { background: var(--amber-soft); color: #9A6412; border-color: #F0DFBB; }

/* ---------------- Segmented / chips / tabs ---------------- */
.seg {
  display: inline-flex; padding: 4px; background: var(--bg-2); border-radius: 14px; gap: 3px;
  border: 1px solid var(--line); max-width: 100%; min-width: 0; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.seg > * { flex: 0 0 auto; }
@media (max-width: 560px) {
  .seg { display: flex; width: 100%; }
}
.admin-main .seg { max-width: 100%; }
.seg a, .seg button {
  border: 0;
  background: none;
  padding: 8px 14px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.seg a.is-active, .seg button.is-active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line-strong);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.chip .ic { width: 15px; height: 15px; }
.chip.is-active, .chip:hover { background: var(--primary-soft); border-color: #F5D0B8; color: #B9480F; }
.chip.plain { cursor: default; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-2);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.green { background: var(--green-soft); color: #216B44; border-color: #CBE7D8; }
.badge.red { background: var(--red-soft); color: #A63A28; border-color: #F1CCC4; }
.badge.amber { background: var(--amber-soft); color: #9A6412; border-color: #EFDDB9; }
.badge.violet { background: #F1ECFB; color: #6A4FAC; border-color: #DED4F4; }

/* ---------------- Daftar transaksi ---------------- */
.tx-list { display: flex; flex-direction: column; }
.tx-day { padding: 10px 2px 6px; font-size: 12px; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.tx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.tx-row:last-child { border-bottom: 0; }
.tx-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--bg-2);
  color: var(--ink-soft);
}
.tx-icon .ic { width: 21px; height: 21px; }
.tx-body { flex: 1 1 auto; min-width: 0; }
.tx-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amount { font-size: 14.5px; font-weight: 800; text-align: right; white-space: nowrap; }
.tx-amount small { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); }
.tx-row.is-income .tx-amount { color: var(--green); }
.tx-row.is-expense .tx-amount { color: var(--red); }
.tx-row.is-transfer .tx-amount { color: var(--violet); }
.tx-row a.tx-hit { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }

.empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty .em-icon {
  width: 54px; height: 54px; border-radius: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: #C25A22;
}
.empty .em-icon .ic { width: 26px; height: 26px; }
.empty h3 { font-size: 15px; color: var(--ink); }
.empty p { font-size: 13px; max-width: 340px; }

/* ---------------- Progress ---------------- */
.bar { height: 9px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #FB9A5E, #E9531F); }
.bar.green > span { background: linear-gradient(90deg, #57B98A, #2F8F5B); }
.bar.amber > span { background: linear-gradient(90deg, #EFBD63, #CE8A2A); }
.bar.red > span { background: linear-gradient(90deg, #EB8069, #D9503C); }
.bar-lg { height: 12px; }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }

/* ---------------- Grafik batang ---------------- */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 132px; padding-top: 8px; }
.chart .col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .bars { display: flex; align-items: flex-end; gap: 3px; height: 100%; width: 100%; justify-content: center; }
.chart .bars i { display: block; width: 46%; max-width: 12px; border-radius: 5px 5px 3px 3px; background: linear-gradient(180deg, #FBA06A, #F2733B); min-height: 3px; }
.chart .bars i.in { background: linear-gradient(180deg, #6FC79A, #2F8F5B); }
.chart .col b { font-size: 9.5px; color: var(--muted); font-weight: 600; }
.chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--primary); display: inline-block; }
.chart-legend i.in { background: var(--green); }

/* Donut sederhana pakai conic-gradient */
.donut { width: 124px; height: 124px; border-radius: 50%; position: relative; flex: 0 0 auto; }
.donut::after {
  content: ""; position: absolute; inset: 22px; border-radius: 50%; background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1; text-align: center; }
.donut-center strong { font-size: 13px; }
.donut-center small { font-size: 10px; color: var(--muted); }

/* ---------------- Tabel ---------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl td.num, table.tbl th.num { text-align: right; white-space: nowrap; }
table.tbl tfoot td { font-weight: 800; border-top: 2px solid var(--line-strong); border-bottom: 0; }

/* ---------------- Keypad nominal ---------------- */
.amount-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFF9F4;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 14px 16px;
}
.amount-display .rp { font-size: 15px; font-weight: 800; color: var(--muted); }
.amount-display input {
  border: 0; background: none; padding: 0; min-height: 0; height: auto;
  font-size: clamp(26px, 8vw, 34px); font-weight: 800; letter-spacing: -.02em; color: var(--ink);
  width: 100%; outline: none; box-shadow: none;
}
.amount-display input:focus { box-shadow: none; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.keypad button {
  height: 50px; border-radius: 14px; border: 1px solid var(--line-strong); background: #fff;
  font-size: 18px; font-weight: 700; color: var(--ink); cursor: pointer;
}
.keypad button:active { background: var(--primary-soft); }
.keypad button.wide { grid-column: span 2; font-size: 14px; }
.type-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.type-tabs button {
  padding: 11px 6px; border-radius: 14px; border: 1px solid var(--line-strong); background: #fff;
  font-size: 13px; font-weight: 700; color: var(--ink-soft); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.type-tabs button .ic { width: 19px; height: 19px; }
.type-tabs button.is-active { background: var(--primary-soft); border-color: #F3CBB2; color: #B9480F; }
.type-tabs button[data-type="income"].is-active { background: var(--green-soft); border-color: #C6E6D4; color: #216B44; }
.type-tabs button[data-type="transfer"].is-active { background: #F1ECFB; border-color: #DED4F4; color: #6A4FAC; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-chips button {
  padding: 7px 12px; border-radius: 999px; border: 1px dashed var(--line-strong); background: #fff;
  font-size: 12px; font-weight: 700; color: var(--ink-soft); cursor: pointer;
}
.quick-chips button:hover { background: var(--primary-soft); border-style: solid; border-color: #F3CBB2; color: #B9480F; }

.cat-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.cat-pick label {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px;
  border-radius: 14px; border: 1px solid var(--line-strong); background: #fff; cursor: pointer;
  font-size: 11px; font-weight: 600; color: var(--ink-soft); text-align: center;
}
.cat-pick input { position: absolute; opacity: 0; pointer-events: none; }
.cat-pick .ic { width: 20px; height: 20px; }
.cat-pick label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: #B9480F; box-shadow: 0 0 0 2px rgba(242, 115, 59, .14); }

/* ---------------- Struk & komentar ---------------- */
.receipt-preview { border-radius: 14px; border: 1px solid var(--line); overflow: hidden; background: var(--bg-2); }
.receipt-preview img { display: block; width: 100%; max-height: 260px; object-fit: cover; }
.comment { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.comment:last-child { border-bottom: 0; }
.comment .body { flex: 1; min-width: 0; }
.comment .body p { font-size: 13.5px; overflow-wrap: anywhere; }
.comment .body small { color: var(--muted); font-size: 11px; }

/* ---------------- Panel info / notice ---------------- */
.notice {
  display: flex; gap: 10px; padding: 13px 14px; border-radius: 15px;
  background: #FFF9F0; border: 1px solid #F3E3C9; font-size: 13px; color: #7A5A2C;
}
.notice .ic { width: 18px; height: 18px; margin-top: 1px; }
.notice.green { background: var(--green-soft); border-color: #CBE7D8; color: #216B44; }
.notice.red { background: var(--red-soft); border-color: #F1CCC4; color: #A63A28; }
.notice.violet { background: #F5F1FC; border-color: #E0D7F3; color: #5C4795; }

.att-item {
  display: flex; gap: 11px; align-items: flex-start; padding: 11px 12px; border-radius: 14px;
  background: #FFFCF8; border: 1px solid var(--line); min-width: 0;
}
.att-item .ic { width: 18px; height: 18px; margin-top: 2px; }
.att-item.danger { background: var(--red-soft); border-color: #F1CCC4; color: #8E3222; }
.att-item.warn { background: var(--amber-soft); border-color: #F0DFBB; color: #855617; }
.att-item.info { background: var(--primary-soft); border-color: #F6D6C2; color: #98400F; }
.att-item .t { font-size: 13px; font-weight: 700; }
.att-item .d { font-size: 12px; opacity: .82; }
.att-item a.t:hover { text-decoration: underline; }

/* ---------------- Anggota & undangan ---------------- */
.member-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.member-row:last-child { border-bottom: 0; }
.member-row .meta { flex: 1; min-width: 0; }
.member-row .meta strong { display: block; font-size: 14px; }
.member-row .meta small { color: var(--muted); font-size: 12px; }
.invite-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 22px; font-weight: 800; letter-spacing: .16em;
  padding: 12px 16px; border-radius: 14px; background: #FFF6EE;
  border: 1px dashed #EFC9AE; color: #B9480F; text-align: center;
}

/* ---------------- Kalkulator ---------------- */
.calc-result {
  border-radius: 16px; padding: 16px; background: linear-gradient(160deg, #FFF6ED, #FFFFFF);
  border: 1px solid #F3E1CF;
}
.calc-result .big { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: #C24A17; overflow-wrap: anywhere; }
.calc-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.calc-rows div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; border-bottom: 1px dashed var(--line); padding-bottom: 7px; }
.calc-rows div:last-child { border-bottom: 0; padding-bottom: 0; }
.calc-rows strong { white-space: nowrap; }
.calc-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.calc-tabs button {
  flex: 0 0 auto; padding: 10px 14px; border-radius: 13px; border: 1px solid var(--line-strong);
  background: #fff; font-size: 13px; font-weight: 700; color: var(--ink-soft); cursor: pointer;
}
.calc-tabs button.is-active { background: var(--primary-soft); border-color: #F3CBB2; color: #B9480F; }

/* ---------------- Auth ---------------- */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px 16px; }
body.auth { background-image: radial-gradient(700px 420px at 15% 0%, #FFE1C8 0%, rgba(255,225,200,0) 60%), radial-gradient(600px 380px at 90% 10%, #FFEFCF 0%, rgba(255,239,207,0) 60%); }
.auth-wrap { width: 100%; max-width: 430px; display: flex; flex-direction: column; gap: 16px; }
.auth-brand { display: flex; justify-content: center; padding: 8px 0 4px; }
.auth-card {
  background: #fff; border: 1px solid var(--line); border-radius: 26px; padding: 26px 22px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px;
}
.auth-card h1 { font-size: 21px; }
.auth-card > p.lead { color: var(--muted); font-size: 13.5px; margin-top: -8px; }
.auth-mark {
  width: 54px; height: 54px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); font-size: 26px;
}
.auth-foot { text-align: center; font-size: 12.5px; color: var(--muted); padding: 0 12px; }
.auth-alt { text-align: center; font-size: 13px; color: var(--muted); }
.auth-alt a { color: #B9480F; font-weight: 700; }

/* ---------------- Brand ---------------- */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #FB9A5E, #E9531F); color: #fff;
  box-shadow: 0 8px 18px rgba(233, 83, 31, .28);
}
.brand-mark .ic { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 16px; letter-spacing: -.01em; }
.brand-text small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- Landing ---------------- */
.landing { max-width: 1040px; margin: 0 auto; padding: 18px 16px 60px; display: flex; flex-direction: column; gap: 30px; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.landing-nav .nav-links { display: flex; gap: 8px; }
.hero { display: grid; gap: 24px; align-items: center; grid-template-columns: 1fr; padding-top: 8px; }
.hero-copy { display: flex; flex-direction: column; gap: 16px; }
.hero-copy .eyebrow {
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  font-size: 12px; font-weight: 700; color: #B9480F; box-shadow: var(--shadow-sm);
}
.hero-copy h1 { font-size: clamp(28px, 7vw, 44px); letter-spacing: -.03em; }
.hero-copy h1 span { background: linear-gradient(120deg, #E9531F, #F2A03B); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy .lead { font-size: 15.5px; color: var(--ink-soft); max-width: 520px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-stats { display: flex; gap: 22px; flex-wrap: wrap; padding-top: 6px; }
.hero-stats div strong { display: block; font-size: 18px; }
.hero-stats div span { font-size: 12px; color: var(--muted); }
.hero-card {
  background: #fff; border: 1px solid var(--line); border-radius: 26px; padding: 20px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px;
}
.hero-card .mini-tx { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.hero-card .mini-tx:last-of-type { border-bottom: 0; }
.hero-card .mini-tx .tx-icon { width: 34px; height: 34px; border-radius: 11px; }
.hero-card .mini-tx .tx-icon .ic { width: 17px; height: 17px; }
.features { display: grid; gap: 16px; grid-template-columns: 1fr; }
.feature {
  background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 18px;
  display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-sm);
}
.feature .fi {
  width: 42px; height: 42px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: #C25A22;
}
.feature h3 { font-size: 15px; }
.feature p { font-size: 13px; color: var(--muted); }
.compare { width: 100%; border-collapse: collapse; font-size: 13.5px; background: #fff; border-radius: 18px; overflow: hidden; }
.compare th, .compare td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.compare th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #FFF9F3; }
.compare td.yes { color: #216B44; font-weight: 700; }
.compare td.no { color: var(--muted); }
.landing-cta {
  border-radius: 26px; padding: 28px 22px; text-align: center; color: #fff;
  background: linear-gradient(135deg, #F98A4C, #E9531F 70%);
  box-shadow: 0 18px 38px rgba(217, 83, 31, .28);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.landing-cta h2 { font-size: 22px; }
.landing-cta p { font-size: 13.5px; opacity: .92; max-width: 460px; }
.landing-cta .btn { background: #fff; color: #B9480F; }
.landing-foot { text-align: center; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }

/* ---------------- Print ---------------- */
@media print {
  body { background: #fff; }
  .drawer, .bottomnav, .topbar, .scrim, .no-print, .btn-row, .page > .flash { display: none !important; }
  .page { max-width: none; padding: 0; gap: 12px; }
  .card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
  .kpi-main { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------------- Responsif ---------------- */
@media (min-width: 620px) {
  .page { padding: 20px 22px calc(112px + env(safe-area-inset-bottom)); }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1.05fr .95fr; gap: 32px; }
}

@media (min-width: 900px) {
  .page { padding: 24px 28px 48px; gap: 20px; }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card { padding: 20px; }
}

@media (min-width: 1024px) {
  .drawer { transform: none; box-shadow: none; }
  .drawer-close, .scrim { display: none !important; }
  .app-main { margin-left: 288px; }
  .bottomnav { display: none; }
  .page { padding-bottom: 48px; }
  .topbar { padding: 12px 28px; }
  .topbar .icon-btn[data-nav-toggle] { display: none; }
  .features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .grid-2, .grid-3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; border-radius: 20px; }
  .amount-display input { font-size: 28px; }
  .type-tabs button { font-size: 12px; }
  .kpi .k-value { font-size: 16.5px; }
  .landing { padding: 14px 14px 48px; gap: 24px; }
  .landing-nav .nav-links .btn { padding: 0 12px; }
  .hero-stats { gap: 16px; }
  .table-wrap { margin: 0 -12px; padding: 0 12px; }
}

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  z-index: 90;
  max-width: min(92vw, 420px);
  padding: 12px 16px;
  border-radius: 14px;
  background: #3D2A1E;
  color: #FFF8F1;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 14px 30px rgba(61, 42, 30, .3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast[data-kind="err"] { background: #A63A28; }
@media (min-width: 1024px) { .toast { bottom: 28px; } }

/* ---------------- Langganan & notifikasi ---------------- */
.icon-btn.bell { position: relative; }
.bell-dot {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px;
  border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
  border: 2px solid #FFF8F1;
}
.sub-banner {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 16px;
  border: 1px solid #F0DFBB; background: var(--amber-soft); color: #855617; font-size: 13px;
}
.sub-banner .ic { width: 20px; height: 20px; flex: 0 0 auto; }
.sub-banner strong { display: block; font-size: 13.5px; }
.sub-banner span { font-size: 12px; line-height: 1.4; }
.sub-banner > div { flex: 1; min-width: 0; }
.sub-banner .sb-cta {
  flex: 0 0 auto; font-weight: 800; font-size: 12.5px; background: #fff; color: #855617;
  border: 1px solid #EBD3A6; padding: 7px 12px; border-radius: 10px; white-space: nowrap;
}
.sub-banner.danger { background: var(--red-soft); border-color: #F1CCC4; color: #8E3222; }
.sub-banner.danger .sb-cta { color: #8E3222; border-color: #EFC5BC; }

.plan-card {
  border: 2px solid var(--line); border-radius: 22px; padding: 20px; background: #fff;
  display: flex; flex-direction: column; gap: 10px; position: relative;
}
.plan-card.is-featured { border-color: #F5B894; background: linear-gradient(165deg, #FFF8F2, #FFFFFF); box-shadow: var(--shadow); }
.plan-card .plan-tag {
  position: absolute; top: -12px; left: 18px; background: linear-gradient(135deg, #FB8A4E, #E9531F);
  color: #fff; font-size: 11px; font-weight: 800; padding: 5px 11px; border-radius: 999px;
  box-shadow: 0 6px 14px rgba(233, 83, 31, .25);
}
.plan-card .plan-price { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.plan-card .plan-price small { font-size: 13px; font-weight: 600; color: var(--muted); }
.plan-card ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-soft); display: flex; flex-direction: column; gap: 6px; }
.plan-card li::marker { color: var(--green); }

.notif-row {
  display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: flex-start;
}
.notif-row:last-child { border-bottom: 0; }
.notif-row.is-unread { background: #FFFCF7; }
.notif-row .n-body { flex: 1; min-width: 0; }
.notif-row .n-body strong { display: block; font-size: 13.5px; }
.notif-row .n-body p { font-size: 13px; color: var(--ink-soft); overflow-wrap: anywhere; }
.notif-row .n-body small { color: var(--muted); font-size: 11px; }

.push-box {
  border: 1px dashed var(--line-strong); border-radius: 16px; padding: 16px; background: #FFFCF8;
  display: flex; flex-direction: column; gap: 10px;
}
.amount-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.amount-inline .field { flex: 1 1 140px; }

.admin-shell { display: flex; min-height: 100vh; background: #F7F5F2; }
.admin-side {
  width: 250px; flex: 0 0 250px; background: #2F2622; color: #F3E9E1; height: 100dvh;
  display: flex; flex-direction: column; overflow: hidden; position: sticky; top: 0;
}
.admin-brand { flex: 0 0 auto; padding: 18px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #453933; }
.admin-brand strong { font-size: 14px; display: block; }
.admin-brand small { font-size: 11px; color: #B9A79A; }
.admin-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.admin-nav .nav-item { color: #E4D6CB; }
.admin-nav .nav-item:hover { background: #3D322D; color: #fff; }
.admin-nav .nav-item.is-active { background: #E9531F; color: #fff; }
.admin-foot { flex: 0 0 auto; padding: 10px; border-top: 1px solid #453933; }
.admin-main { flex: 1 1 auto; min-width: 0; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.admin-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-title h1 { font-size: 21px; }
.admin-main > * { min-width: 0; }
.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat-card { background: #fff; border: 1px solid #EDE5DC; border-radius: 16px; padding: 15px; }
.stat-card .l { font-size: 11.5px; color: #8A7466; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .v { font-size: 22px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }
.stat-card .s { font-size: 11.5px; color: #8A7466; margin-top: 2px; }
@media (max-width: 900px) {
  .admin-shell { flex-direction: column; }
  .admin-side { width: 100%; flex: 0 0 auto; height: auto; position: static; }
  .admin-nav { flex-direction: row; overflow-x: auto; }
  .admin-nav .nav-item { white-space: nowrap; }
  .admin-main { padding: 14px; }
}
.trial-chip {
  display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 800; background: var(--amber-soft); color: #9A6412;
  border: 1px solid #F0DDB8; white-space: nowrap;
}
.trial-chip.is-off { background: var(--red-soft); color: #A63A28; border-color: #F1CCC4; }
