/* Cegah horizontal scroll di semua halaman */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* Fix layout: saat sidebar (col-sm-4 d-none d-md-block) tersembunyi di mobile,
   buat konten utama full-width (tidak cuma 66.7% dari col-sm-8) */
@media (max-width: 767.98px) {
  .d-none.d-md-block + .col-sm-8,
  .d-none.d-md-block.d-print-none + .col-sm-8 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }
}

/* Card utility */
.card-modern {
  border: none;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

/* =========================================================
   HALAMAN AKUN — mobile-first, tema e-wallet (ikut homepage)
   ========================================================= */
.akun-page { padding-top: 4px; }

/* Header halaman (judul + tombol kembali) */
.akun-pagehead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 16px;
}
.akun-pagehead .ah-back {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.akun-pagehead .ah-back:hover { background: var(--color-primary-light); border-color: var(--color-primary); color: var(--color-primary); }
.akun-pagehead .ah-title { font-weight: 700; font-size: 1.15rem; margin: 0; line-height: 1.2; }
.akun-pagehead .ah-sub { font-size: 12px; color: var(--color-muted); }

/* ---------- Kartu profil / wallet ---------- */
.wallet-card {
  position: relative;
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 85% -10%, rgba(255,255,255,.18) 0%, transparent 55%),
    linear-gradient(135deg, #1D4ED8 0%, #2563EB 55%, #3B82F6 100%);
  color: #fff;
  padding: 22px 20px 58px;
  box-shadow: 0 10px 30px rgba(37,99,235,.30);
  overflow: hidden;
}
.wallet-card::after {
  content: ""; position: absolute; right: -50px; top: -50px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,.08); pointer-events: none;
}
.wallet-id { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.wallet-avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background: rgba(255,255,255,.22);
  border: 2px solid rgba(255,255,255,.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.wallet-name { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.wallet-user { font-size: 12.5px; color: rgba(255,255,255,.75); }
.wallet-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.wallet-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px;
  background: rgba(255,255,255,.18); color: #fff;
  text-decoration: none;
}
.wallet-pill.is-ok { background: rgba(255,255,255,.92); color: var(--color-success); }
.wallet-pill.is-warn { background: rgba(255,255,255,.92); color: var(--color-warning); }

.wallet-balance { position: relative; z-index: 1; margin-top: 18px; }
.wallet-balance .wb-label { font-size: 12px; color: rgba(255,255,255,.8); }
.wallet-balance .wb-amount { font-size: 1.9rem; font-weight: 800; letter-spacing: .3px; line-height: 1.2; }

/* Tray aksi cepat — menonjol, overlap bawah kartu wallet */
.quick-tray {
  display: flex;
  gap: 6px;
  background: #fff;
  border-radius: 16px;
  padding: 14px 10px;
  margin: -24px 14px 0;
  position: relative;
  z-index: 2;
  box-shadow: 0 6px 22px rgba(0,0,0,.10);
}
.quick-action {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-decoration: none; color: var(--color-text);
  padding: 6px 2px; border-radius: 12px;
  transition: background .15s;
}
.quick-action:hover { background: var(--color-primary-light); color: var(--color-primary); }
.quick-action .qa-ico {
  width: 42px; height: 42px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: #fff;
}
.quick-action .qa-label { font-size: 11px; font-weight: 600; text-align: center; line-height: 1.2; }

/* ---------- Daftar detail (key : value) ---------- */
.info-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow-card); overflow: hidden; }
.info-card .ic-head { padding: 14px 16px; border-bottom: 1px solid var(--color-border); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--color-muted); }
.info-row { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #f1f3f5; align-items: flex-start; }
.info-row:last-child { border-bottom: none; }
.info-row .ir-key { flex: 0 0 38%; max-width: 38%; color: var(--color-muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.info-row .ir-key i { width: 16px; text-align: center; color: var(--color-primary); }
.info-row .ir-val { flex: 1; font-size: 13.5px; color: var(--color-text); word-break: break-word; }

/* ---------- Kartu statistik (notif & mutasi) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-card {
  background: #fff; border-radius: 14px; padding: 14px 12px;
  box-shadow: var(--shadow-card); text-align: left;
  border-left: 3px solid var(--color-border);
}
.stat-card.is-primary { border-left-color: var(--color-primary); }
.stat-card.is-success { border-left-color: var(--color-success); }
.stat-card.is-danger  { border-left-color: var(--color-danger); }
.stat-card .sc-ico { font-size: 14px; margin-bottom: 6px; color: var(--color-muted); }
.stat-card.is-primary .sc-ico { color: var(--color-primary); }
.stat-card.is-success .sc-ico { color: var(--color-success); }
.stat-card.is-danger  .sc-ico { color: var(--color-danger); }
.stat-card .sc-num { font-weight: 800; font-size: 1.05rem; line-height: 1.15; color: var(--color-text); word-break: break-word; }
.stat-card.is-success .sc-num { color: var(--color-success); }
.stat-card.is-danger  .sc-num { color: var(--color-danger); }
.stat-card .sc-label { font-size: 11px; color: var(--color-muted); margin-top: 2px; }

/* ---------- Filter chips ---------- */
.filter-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto; white-space: nowrap;
  font-size: 12.5px; font-weight: 600;
  padding: 7px 14px; border-radius: 20px;
  background: #fff; border: 1px solid var(--color-border);
  color: var(--color-muted); text-decoration: none;
  transition: all .15s;
}
.filter-chip:hover { border-color: var(--color-primary); color: var(--color-primary); }
.filter-chip.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.filter-chip .fc-count { opacity: .8; font-weight: 700; }

/* ---------- Item notifikasi ---------- */
.notif-list { background: #fff; border-radius: 16px; box-shadow: var(--shadow-card); overflow: hidden; }
.notif-item {
  display: flex; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid #f1f3f5; text-decoration: none; color: inherit;
  transition: background .12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f8faff; }
.notif-item.is-unread { background: #f0f5ff; }
.notif-item .ni-ico {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: #e9ecef; color: var(--color-muted); font-size: 15px; margin-top: 2px;
}
.notif-item.is-unread .ni-ico { background: var(--color-primary); color: #fff; }
.notif-item .ni-body { flex: 1; min-width: 0; }
.notif-item .ni-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 2px; }
.notif-item .ni-title { font-weight: 600; font-size: 13.5px; color: var(--color-text); }
.notif-item .ni-text {
  font-size: 12.5px; color: var(--color-muted); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notif-item .ni-time { font-size: 11px; color: #adb5bd; margin-top: 4px; }
.badge-admin { font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: #e9ecef; color: #495057; }
.badge-new { font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 20px; background: var(--color-primary); color: #fff; }

/* ---------- Item mutasi saldo ---------- */
.mutasi-list { background: #fff; border-radius: 16px; box-shadow: var(--shadow-card); overflow: hidden; }
.mutasi-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid #f1f3f5; }
.mutasi-item:last-child { border-bottom: none; }
.mutasi-item .mi-ico {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.mutasi-item .mi-ico.kredit { background: #e7f6ec; color: var(--color-success); }
.mutasi-item .mi-ico.debit  { background: #fdecec; color: var(--color-danger); }
.mutasi-item .mi-body { flex: 1; min-width: 0; }
.mutasi-item .mi-info { font-size: 13px; color: var(--color-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mutasi-item .mi-info a { color: var(--color-primary); text-decoration: none; }
.mutasi-item .mi-time { font-size: 11px; color: #adb5bd; margin-top: 3px; }
.mutasi-item .mi-amount { flex-shrink: 0; text-align: right; }
.mutasi-item .mi-amount .ma-val { font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.mutasi-item .mi-amount .ma-val.kredit { color: var(--color-success); }
.mutasi-item .mi-amount .ma-val.debit  { color: var(--color-danger); }
.mutasi-item .mi-amount .ma-saldo { font-size: 10.5px; color: var(--color-muted); white-space: nowrap; margin-top: 2px; }

/* ---------- Item transaksi (mobile list) ---------- */
.trx-list { background: #fff; border-radius: 16px; box-shadow: var(--shadow-card); overflow: hidden; }
.trx-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid #f1f3f5; text-decoration: none; color: inherit; transition: background .12s; }
.trx-item:last-child { border-bottom: none; }
.trx-item:hover { background: #f8faff; }
.trx-item .ti-ico {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--color-primary-light); color: var(--color-primary); font-size: 16px;
}
.trx-item .ti-ico img { width: 100%; height: 100%; object-fit: contain; padding: 4px; background: #fff; }
.trx-item .ti-body { flex: 1; min-width: 0; }
.trx-item .ti-title { font-weight: 600; font-size: 13.5px; color: var(--color-text); }
.trx-item .ti-sub { font-size: 12px; color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trx-item .ti-time { font-size: 11px; color: #adb5bd; margin-top: 2px; }
.trx-item .ti-right { flex-shrink: 0; text-align: right; }
.trx-item .ti-amount { font-weight: 700; font-size: 13.5px; color: var(--color-primary); white-space: nowrap; }
.trx-item .ti-right .badge { margin-top: 4px; }

/* ---------- Status hero (halaman view) ---------- */
.status-hero {
  border-radius: 18px; padding: 20px; color: #fff; margin-bottom: 16px;
  background: linear-gradient(135deg, #1D4ED8, #3B82F6);
  box-shadow: 0 8px 24px rgba(37,99,235,.25);
}
.status-hero.ok   { background: linear-gradient(135deg, #15803D, #22C55E); box-shadow: 0 8px 24px rgba(22,163,74,.25); }
.status-hero.wait { background: linear-gradient(135deg, #B45309, #F59E0B); box-shadow: 0 8px 24px rgba(217,119,6,.25); }
.status-hero.fail { background: linear-gradient(135deg, #B91C1C, #EF4444); box-shadow: 0 8px 24px rgba(220,38,38,.25); }
.status-hero .sh-label { font-size: 12px; opacity: .85; }
.status-hero .sh-amount { font-size: 1.7rem; font-weight: 800; line-height: 1.2; margin: 2px 0 6px; }
.status-hero .sh-meta { font-size: 12.5px; opacity: .9; }
.status-hero .sh-badge { display: inline-flex; align-items: center; gap: 5px; background: rgba(255,255,255,.92); color: var(--color-text); font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 20px; }

/* Section heading kecil di halaman akun */
.akun-section-title { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--color-muted); margin: 18px 2px 10px; }

/* ---------- Popover menu komplain ---------- */
.popover.komplain-pop { max-width: 320px; border: none; border-radius: 16px; box-shadow: 0 10px 34px rgba(0,0,0,.18); }
.popover.komplain-pop .popover-header { background: var(--color-primary-light); color: var(--color-primary); font-weight: 700; font-size: 13px; border: none; border-radius: 16px 16px 0 0; padding: 11px 16px; }
.popover.komplain-pop .popover-arrow::after { border-top-color: #fff; }
.popover.komplain-pop .popover-body { padding: 6px; }
.komplain-menu { display: flex; flex-direction: column; gap: 2px; }
.komplain-menu a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 11px;
  text-decoration: none; color: var(--color-text);
  font-size: 12.5px; line-height: 1.3;
  transition: background .12s;
}
.komplain-menu a:hover { background: var(--color-primary-light); }
.komplain-menu .km-ico {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff;
}
.komplain-menu .km-text { flex: 1; }
.komplain-menu .km-arrow { font-size: 10px; color: #ced4da; flex-shrink: 0; }

/* Empty state */
.akun-empty { background: #fff; border-radius: 16px; box-shadow: var(--shadow-card); padding: 40px 24px; text-align: center; color: var(--color-muted); }
.akun-empty i { font-size: 2rem; margin-bottom: 12px; color: #ced4da; }

/* Tablet/desktop: stat & nominal lebih lega */
@media (min-width: 768px) {
  .stat-card .sc-num { font-size: 1.25rem; }
  .quick-tray { margin-left: 22px; margin-right: 22px; }
}

/* Status label */
.badge-sukses  { background-color: var(--color-success); color: #fff; }
.badge-pending { background-color: var(--color-warning); color: #fff; }
.badge-gagal   { background-color: var(--color-danger);  color: #fff; }
.badge-refund  { background-color: var(--color-info);    color: #fff; }

/* Body spacing untuk mobile bottom nav */
@media (max-width: 767.98px) {
  body {
    padding-bottom: var(--bottom-nav-height, 64px) !important;
  }
}

/* Breadcrumb fix global — halaman lama tidak pakai .breadcrumb-item */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px 0;
  margin-bottom: 16px;
  background: transparent;
  font-size: .875rem;
}
.breadcrumb > li {
  display: inline-flex;
  align-items: center;
  color: var(--color-muted);
}
.breadcrumb > li + li::before {
  content: "/";
  padding: 0 6px;
  color: #adb5bd;
}
.breadcrumb > li.active,
.breadcrumb > li:last-child { color: var(--color-text); font-weight: 500; }
.breadcrumb > li a { color: var(--color-primary); text-decoration: none; }
.breadcrumb > li a:hover { text-decoration: underline; }

/* Print: sembunyikan bottom nav */
@media print {
  .bottom-nav, .top-bar-mobile { display: none !important; }
  body { padding-bottom: 0 !important; }
}

/* Nav tabs: scrollable horizontal di mobile, tidak wrap */
@media (max-width: 767.98px) {
  .nav-tabs.card-header-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-tabs.card-header-tabs::-webkit-scrollbar { display: none; }
  .nav-tabs.card-header-tabs .nav-link {
    white-space: nowrap;
    font-size: 12px;
    padding: 6px 10px;
  }
}

/* Back to top button */
#back-to-top {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 16px);
  right: 16px;
  display: none;
  width: 40px;
  height: 40px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  text-align: center;
  line-height: 40px;
  z-index: 1020;
  text-decoration: none;
}
@media (min-width: 768px) {
  #back-to-top { bottom: 24px; }
}
