/* ============ Panel admin ============ */
body { font-size: 14.5px; }
.shell { min-height: 100vh; }
.main { min-width: 0; }

/* ---------- Sidebar ---------- */
.side {
  position: fixed; inset: 0 auto 0 0; z-index: 60; width: 260px; display: flex; flex-direction: column; gap: 4px;
  padding: 18px 12px; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line);
  transform: translateX(-100%); transition: transform .2s ease;
}
.side.is-open { transform: none; box-shadow: var(--shadow-lg); }
.side-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(10, 12, 20, .45); display: none; }
.side.is-open + .side-backdrop { display: block; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-weight: 800; font-size: 16px; }
.side .brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--text); color: var(--bg); }
.side .group { margin: 12px 10px 4px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.side a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: var(--text-2); font-weight: 700; }
.side a:hover { background: var(--surface-2); }
.side a.is-active { background: var(--brand-soft); color: var(--brand); }
.side a .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 11px; text-align: center; line-height: 20px; }
.side .me { margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid var(--line); }

@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
  .side { position: sticky; top: 0; height: 100vh; transform: none; }
  .side-backdrop, .menu-btn { display: none !important; }
}

/* ---------- Topbar & konten ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar h1 { flex: 1; min-width: 0; font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: 16px; max-width: 1400px; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 1024px) { .content { padding: 22px 28px 40px; } .topbar { padding: 12px 28px; } }

.mode-pill { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--warn-soft); color: var(--warn); white-space: nowrap; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { padding: 16px; }
.kpi .label { display: flex; align-items: center; gap: 6px; }
.kpi .value { display: block; margin-top: 6px; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .foot { margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.two { display: grid; gap: 16px; }
@media (min-width: 1100px) { .two { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; } .two.even { grid-template-columns: 1fr 1fr; } }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding: 16px 16px 8px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bars .fill { width: 100%; max-width: 44px; min-height: 3px; border-radius: 8px 8px 3px 3px; background: var(--brand); }
.bars .fill.profit { background: var(--ok); }
.bars small { color: var(--muted); font-size: 11px; }

/* ---------- Filter ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.filters .input, .filters .select { min-height: 38px; padding: 6px 12px; border-radius: 10px; width: auto; }
.filters .search-box { flex: 1 1 220px; position: relative; }
.filters .search-box .input { width: 100%; padding-left: 36px; }
.filters .search-box .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; }

/* ---------- Tabel responsif: kartu di layar sempit ---------- */
@media (max-width: 760px) {
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .rtable td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
  .rtable td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; text-align: left; flex: none; }
  .rtable td.primary { display: block; text-align: left; font-weight: 800; }
  .rtable td.primary::before { display: none; }
  .rtable .num { text-align: right; }
}

/* ---------- Detail & tree ---------- */
.detail-grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .detail-grid { grid-template-columns: 1fr 1fr; } }
.attempt { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.tree { display: flex; flex-direction: column; }
.tree-row { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.tree-row .indent { flex: none; }
.tree-row .title { font-weight: 700; }
.tree-row.is-hidden .title { color: var(--muted); text-decoration: line-through; }
.tree-row .kind { font-size: 11.5px; }
.tree-toggle { width: 26px; height: 26px; }
.tree-toggle .icon { transition: transform .15s; }
.tree-toggle.is-open .icon { transform: rotate(90deg); }

.thread { display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow-y: auto; padding: 4px; }
.bubble { max-width: 86%; padding: 9px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.admin { align-self: flex-end; background: var(--brand-soft); border-color: transparent; }
.bubble .by { display: block; font-size: 11.5px; font-weight: 800; color: var(--muted); }
.bubble img { display: block; margin-top: 6px; max-height: 180px; border-radius: 8px; }
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.proof-big { max-width: 100%; max-height: 60vh; border-radius: 12px; border: 1px solid var(--line); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: 100%; max-width: 380px; padding: 26px 22px; }
.form-grid { display: grid; gap: 12px; }
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.setting-block h3 { margin-bottom: 10px; }
.ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--brand-soft); color: var(--brand); flex: none; }
.transfer-total { font-size: 30px; font-weight: 800; letter-spacing: .1em; }
.list-item:disabled { cursor: default; }
.mode-pill.test { background: var(--info-soft); color: var(--info); }
.mode-pill.live { background: var(--ok-soft); color: var(--ok); }

/* Pemberitahuan */
.notice { border-left: 4px solid var(--line); }
.notice.is-danger { border-left-color: var(--bad); }
.notice.is-warn { border-left-color: var(--warn); }
.notice.is-info { border-left-color: var(--brand); }
.notice.is-done { opacity: .7; }
.notice.is-auto { border-left-color: var(--ok); opacity: .85; }
.notice-body { white-space: pre-line; overflow-wrap: anywhere; margin: 0; }
@media (min-width: 760px) { .kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi.is-bad { border-color: var(--bad); }
.kpi.is-bad .value { color: var(--bad); }
.kpi.is-warn { border-color: var(--warn); }
.kpi.is-warn .value { color: var(--warn); }

/* QR penautan bot WhatsApp */
.wa-qr { width: 260px; max-width: 100%; height: auto; background: #fff; padding: 8px; border-radius: 12px; align-self: center; }
