/* ============ Aplikasi pelanggan: mobile first, dua kolom di desktop ============ */
.shell { min-height: 100vh; }
.side { display: none; }
.main { min-width: 0; }

/* ---------- Topbar (mobile) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 6px; min-height: 58px;
  padding: 8px 10px 8px 14px; padding-top: calc(8px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.topbar h1 { flex: 1; min-width: 0; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .back { margin-left: -6px; }
.bal-chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 800; font-size: 14px; color: var(--text); }
.bal-chip .icon { color: var(--brand); width: 18px; height: 18px; }

.view { padding: 4px 14px calc(96px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; }

/* ---------- Bottom nav (mobile) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; color: var(--muted); font-size: 11.5px; font-weight: 700; }
.tabbar a .icon { width: 22px; height: 22px; }
.tabbar a.is-active { color: var(--brand); }
.tabbar a.is-active .icon { stroke-width: 2.4; }
.dot { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px; line-height: 16px; text-align: center; font-weight: 800; }

/* ---------- Desktop ---------- */
@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
  .side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 22px 16px; border-right: 1px solid var(--line); background: var(--surface); }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--text-2); font-weight: 700; }
  .side-nav a:hover { background: var(--surface-2); }
  .side-nav a.is-active { background: var(--brand-soft); color: var(--brand); }
  .side-nav .dot { position: static; margin-left: auto; }
  .side-foot { margin-top: auto; }
  .tabbar { display: none; }
  .topbar { padding: 16px 28px; min-height: 72px; }
  .topbar h1 { font-size: 22px; }
  .view { padding: 4px 28px 40px; }
  .toasts { bottom: 24px; }
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 18px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--brand); color: var(--brand-ink); }

/* ---------- Tata letak halaman ---------- */
.page { display: flex; flex-direction: column; gap: 14px; }
.cols { display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 960px) {
  .cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 20px; }
  .cols > .aside { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }
  .cols.equal { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
/* Beranda di HP: saldo & isi cepat nomor tampil paling atas. */
@media (max-width: 959px) { .cols.home > .aside { order: -1; display: flex; flex-direction: column; gap: 14px; } }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 2px 0; }
.section-title h2 { font-size: 16px; }

/* ---------- Kartu saldo ---------- */
.wallet {
  position: relative; overflow: hidden; padding: 18px; border-radius: 20px; color: var(--brand-ink);
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #0ea5e9));
  box-shadow: 0 10px 30px color-mix(in srgb, var(--brand) 30%, transparent);
}
.wallet::after { content: ""; position: absolute; right: -40px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.wallet small { opacity: .85; font-weight: 700; }
.wallet .amount { display: block; margin: 2px 0 14px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.wallet .row .btn { flex: 1; background: rgba(255, 255, 255, .18); color: inherit; border-color: rgba(255, 255, 255, .25); }
.wallet .row .btn:hover { background: rgba(255, 255, 255, .28); }
.wallet .level { position: absolute; right: 16px; top: 16px; z-index: 1; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .2); font-size: 12px; font-weight: 800; }

/* ---------- Isi cepat nomor HP ---------- */
.quick { padding: 14px; }
.quick .input-group .input { font-size: 18px; font-weight: 700; }
.op { padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 12.5px; white-space: nowrap; pointer-events: none; }

/* ---------- Grid kategori ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 10px 6px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 960px) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 4px; border: 0; border-radius: 14px; background: transparent; color: var(--text-2); font-size: 12.5px; font-weight: 700; line-height: 1.25; text-align: center; }
.tile:hover { background: var(--surface-2); }
.ic { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 16px; flex: none; }
.ic .icon { width: 25px; height: 25px; }
.ic.sm { width: 36px; height: 36px; border-radius: 11px; font-size: 12px; }
.ic.sm .icon { width: 19px; height: 19px; }
.tone0 { background: rgba(79, 70, 229, .12); color: #5b54e6; }
.tone1 { background: rgba(14, 165, 233, .14); color: #0b8fc9; }
.tone2 { background: rgba(245, 158, 11, .16); color: #c27c06; }
.tone3 { background: rgba(236, 72, 153, .13); color: #d0457f; }
.tone4 { background: rgba(16, 185, 129, .14); color: #0e9b6c; }
.tone5 { background: rgba(139, 92, 246, .14); color: #7c55e6; }

/* ---------- Daftar menu ---------- */
.menu-list .list-item .ic { margin: -2px 0; }
.search-box { position: relative; }
.search-box .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box .input { padding-left: 42px; }

/* ---------- Produk ---------- */
.products { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.product {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--text); text-align: left; transition: border-color .15s, transform .1s;
}
.product:hover { border-color: var(--brand); }
.product:active { transform: scale(.99); }
.product .name { font-weight: 800; }
.product .prov { color: var(--muted); font-size: 13px; }
.product .price { margin-left: auto; font-weight: 800; color: var(--brand); white-space: nowrap; font-variant-numeric: tabular-nums; }
.product.is-off { opacity: .55; }
.product.is-off:hover { border-color: var(--line); }
.product.is-active { border-color: var(--brand); background: var(--brand-soft); }
.product:disabled { opacity: .6; cursor: default; }
.order-dest { position: sticky; top: 58px; z-index: 30; padding: 12px; margin: 0 -2px; }
@media (min-width: 960px) { .order-dest { top: 72px; } }
.toolbar { display: flex; align-items: center; gap: 8px; }
.accordion > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-weight: 800; }
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary .chev { margin-left: auto; transition: transform .15s; color: var(--muted); }
.accordion[open] > summary .chev { transform: rotate(180deg); }
.accordion > .products { padding: 0 12px 12px; }

/* ---------- Checkout ---------- */
.summary { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.summary .row > span:first-child { color: var(--muted); }
.summary .row > strong { margin-left: auto; text-align: right; overflow-wrap: anywhere; }
.summary .total { padding-top: 10px; border-top: 1px dashed var(--line); font-size: 17px; }
.desc { font-size: 13.5px; color: var(--text-2); }

/* ---------- Status transaksi ---------- */
.status-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 16px 18px; text-align: center; }
.status-hero .ring { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; }
.status-hero .ring .icon { width: 34px; height: 34px; }
.status-hero.success .ring { background: var(--ok-soft); color: var(--ok); }
.status-hero.failed .ring { background: var(--bad-soft); color: var(--bad); }
.status-hero.pending .ring { background: var(--warn-soft); color: var(--warn); }
.status-hero.pending .ring .icon { animation: spin 2.4s linear infinite; }
.sn { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }

/* ---------- Riwayat ---------- */
.trx-item { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 12px; align-items: center; }
.trx-item .meta { grid-column: 2; color: var(--muted); font-size: 12.5px; }
.trx-item .amt { grid-row: 1 / span 2; grid-column: 3; text-align: right; }

/* ---------- Deposit ---------- */
.amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.amounts button { min-height: 42px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 800; }
.amounts button.is-active { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.method { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
.method:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.method.is-disabled { opacity: .55; cursor: not-allowed; }
.method input { accent-color: var(--brand); width: 18px; height: 18px; }
.transfer-total { font-size: 30px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.transfer-total .code { color: var(--warn); }
.proof { max-height: 220px; border-radius: 12px; border: 1px solid var(--line); object-fit: contain; background: var(--surface-2); }

/* ---------- Tiket ---------- */
.thread { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 84%; padding: 10px 13px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-color: transparent; border-bottom-right-radius: 5px; }
.bubble.them { align-self: flex-start; border-bottom-left-radius: 5px; }
.bubble .by { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 800; opacity: .8; }
.bubble time { display: block; margin-top: 4px; font-size: 11px; opacity: .7; }
.bubble img { display: block; margin-top: 6px; max-height: 200px; border-radius: 10px; }
.composer { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 8px; padding: 10px; }
@media (min-width: 960px) { .composer { bottom: 16px; } }
.composer .textarea { min-height: 46px; max-height: 160px; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 500px at 10% -10%, var(--brand-soft), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 420px; padding: 26px 22px; }
.auth-card .brand { margin-bottom: 18px; }
.auth-card h1 { margin-bottom: 4px; }
