/* Portal merchant doit.id — kulit sendiri, terpisah dari console internal.
   (Sebelumnya menumpang /console/style.css; begitu portal dirilis publik,
   merapikan yang satu tidak boleh berisiko merusak yang lain.)
   Bahasa desain mengikuti doit.id: biru #0b5fff, Inter, kedalaman lewat
   bayangan halus. */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --border: #e4e9f0;
  --text: #0e1420;
  --muted: #5b6472;
  --accent: #0b5fff;
  --accent-hover: #0a51d8;
  --accent-soft: #e9f0ff;
  --green-bg: #d9f5e7; --green-fg: #0c7a52;
  --blue-bg: #dcebff;  --blue-fg: #124f9e;
  --gray-bg: #edf0f4;  --gray-fg: #545a69;
  --red-bg: #ffe3e0;   --red-fg: #b3261e;
  --amber-bg: #fcedb9; --amber-fg: #8a6116;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(14, 20, 32, .05), 0 1px 6px rgba(14, 20, 32, .04);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 14px/1.5 Inter, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
h1 { font-size: 20px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; letter-spacing: -.01em; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); z-index: 50; padding: 16px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 40px; width: 360px; max-width: 100%; text-align: center; }
.login-card h1 { margin: 14px 0 4px; }
.login-card input { width: 100%; margin: 18px 0 10px; }
.login-card .btn { width: 100%; }
.err { color: var(--red-fg); font-size: 13px; }
.auth-tabs { display: flex; gap: 6px; margin: 18px 0 8px; }
.auth-tabs button { flex: 1; }
.auth-tabs button.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.login-card input { margin: 5px 0; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; padding: 18px 16px 14px; }
.brand svg { display: block; border-radius: 7px; box-shadow: 0 3px 10px -3px rgba(11,95,255,.5); }
/* Wordmark persis seperti header doit.id: "doit" dengan "it" biru aksen. */
.brand i, .wordmark { font-style: normal; letter-spacing: -.02em; }
.brand b, .wordmark b { color: var(--accent); font-weight: inherit; }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px; background: var(--accent);
  color: #fff; font-weight: 700; font-size: 15px;
}
#nav-toggle { display: none; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.sidebar nav a {
  padding: 7px 10px; border-radius: 7px; text-decoration: none;
  color: var(--text); font-weight: 500;
}
.sidebar nav a:hover { background: var(--bg); }
.sidebar nav a.active { color: var(--accent); background: var(--accent-soft); }
.sidebar-foot { margin-top: auto; padding: 14px 16px; }
.env-pill { font-size: 12px; color: var(--muted); background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px; }

.main { flex: 1; padding: 28px 36px 60px; max-width: 1160px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- komponen ---------- */
.btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 7px 13px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; box-shadow: 0 1px 1px rgba(14,20,32,.04);
}
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .6; cursor: default; }

input, select {
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px;
  font-size: 13.5px; color: var(--text); background: var(--surface); outline: none;
  font-family: inherit;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11, 95, 255, .14); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px;
  /* Tabel di dalam kartu menggeser di sini — halaman tidak pernah ikut melebar. */
  overflow-x: auto;
}
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 22px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 22px; align-items: stretch; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }
.stat .label { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--border);
}
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f8fafd; }
.amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.badge.paid      { background: var(--green-bg); color: var(--green-fg); }
.badge.pending   { background: var(--blue-bg);  color: var(--blue-fg); }
.badge.expired   { background: var(--gray-bg);  color: var(--gray-fg); }
.badge.failed    { background: var(--red-bg);   color: var(--red-fg); }
.badge.refunded  { background: var(--amber-bg); color: var(--amber-fg); }
.badge.test      { background: var(--amber-bg); color: var(--amber-fg); }
.badge.live      { background: var(--green-bg); color: var(--green-fg); }
.badge.dead      { background: var(--gray-bg);  color: var(--gray-fg); }

.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.banner {
  background: var(--amber-bg); color: var(--amber-fg); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 18px; font-size: 13.5px;
}
.banner.live { background: var(--green-bg); color: var(--green-fg); }
.secret-row { font-size: 12.5px; margin-top: 4px; }
.rail-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.rail-chips .badge { font-weight: 600; }

/* ---------- kartu metode ---------- */
.method-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.method-card { position: relative; display: flex; flex-direction: column; padding: 16px 18px; overflow-x: visible; }
.method-card.off-platform { opacity: .55; }
.method-card .mname { font-weight: 700; font-size: 14.5px; line-height: 1.35; margin: 0 0 2px; padding-right: 64px; min-height: 40px; }
.method-card .mfee { font-size: 13px; color: var(--muted); padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.switch { position: absolute; top: 16px; right: 16px; border: none; border-radius: 14px; padding: 3px 12px; font-size: 11.5px; font-weight: 700; cursor: pointer; color: #fff; }
.switch.on { background: #0c7a52; } .switch.off { background: #9aa3b2; }
.payer-label { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 5px; }
.payer { display: flex; gap: 16px; font-size: 13.5px; flex-wrap: wrap; }
.payer label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.payer input[disabled] + span, .payer.locked label { color: var(--muted); cursor: default; }
.mnote { font-size: 12px; color: var(--amber-fg); background: var(--amber-bg); border-radius: 6px; padding: 6px 10px; margin-top: 10px; }
.mnote.info { background: var(--gray-bg); color: var(--gray-fg); }

/* ---------- drawer detail ---------- */
.drawer { position: fixed; inset: 0; z-index: 40; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(14, 20, 32, .35); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 460px; max-width: 92vw;
  background: var(--surface); box-shadow: -8px 0 28px rgba(14,20,32,.18);
  overflow-y: auto; padding: 26px 28px;
}
.drawer .amount-big { font-size: 26px; font-weight: 700; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13.5px; margin: 16px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
.timeline { border-left: 2px solid var(--border); margin: 10px 0 0 6px; padding-left: 16px; }
.timeline .ev { position: relative; padding-bottom: 14px; }
.timeline .ev::before {
  content: ""; position: absolute; left: -21px; top: 5px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.timeline .ev .t { font-size: 12px; color: var(--muted); }
.qr-box { background: var(--bg); border: 1px dashed var(--border); border-radius: 8px; padding: 10px 12px; margin: 10px 0;
  word-break: break-all; overflow-wrap: anywhere; font-size: 12px; }
details.qr-box summary { cursor: pointer; font-family: inherit; font-size: 13px; user-select: none; }
details.qr-box[open] summary { margin-bottom: 6px; }
details.qr-box .qr-raw { max-height: 110px; overflow-y: auto; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(14,20,32,.4); }
.modal-card { position: relative; background: var(--surface); border-radius: 12px;
  box-shadow: 0 18px 50px rgba(14,20,32,.25); padding: 22px 24px; width: 420px; max-width: 92vw;
  max-height: 90vh; overflow-y: auto; }
.modal-card label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 12px 0 4px; }
.modal-card input, .modal-card select { width: 100%; }
.modal-card .radio-row { display: flex; gap: 16px; font-size: 14px; }
.modal-card .radio-row label { display: flex; gap: 6px; align-items: center; margin: 0; font-weight: 500; color: var(--text); cursor: pointer; }
.modal-key {
  background: #0e1420; color: #7ee2a8; border-radius: 8px; padding: 12px 14px;
  word-break: break-all; margin: 10px 0;
}
.section-gap { margin-top: 26px; }

/* ---------- toast: kabar singkat tanpa alert() ---------- */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(8px);
  background: #0e1420; color: #fff; font-size: 13.5px; padding: 10px 18px;
  border-radius: 10px; box-shadow: 0 10px 28px rgba(14,20,32,.35);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
  z-index: 70; max-width: min(480px, 90vw); text-align: center;
}
#toast.tampil { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.galat { background: #8f1d14; }

/* Blok ponsel di UJUNG berkas dengan sengaja: override media query kalah
   dari aturan dasar berspesifisitas sama yang ditulis sesudahnya — pelajaran
   dari drawer yang diam-diam tetap 92vw. */
/* ---------- ponsel: sidebar jadi bilah atas ---------- */
@media (max-width: 880px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; flex-direction: row; flex-wrap: wrap;
    align-items: center; border-right: 0; border-bottom: 1px solid var(--border);
    z-index: 30;
  }
  .brand { padding: 12px 14px; margin-right: auto; }
  #nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; margin-right: 10px; font-size: 18px;
    border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
    color: var(--text); cursor: pointer;
  }
  .sidebar nav, .sidebar-foot { display: none; }
  .sidebar.open nav {
    display: flex; width: 100%; order: 3;
    border-top: 1px solid var(--border); padding: 8px 10px;
  }
  .sidebar.open .sidebar-foot {
    display: flex; align-items: center; gap: 10px; width: 100%; order: 4;
    border-top: 1px solid var(--border); padding: 10px 14px; margin-top: 0;
  }
  .sidebar.open .sidebar-foot > div { margin: 0 !important; }
  .main { padding: 18px 14px 48px; }
  .kv { grid-template-columns: 110px 1fr; }
  .drawer-panel { width: 100vw; max-width: 100vw; padding: 20px 16px; }
  .stat .value { font-size: 20px; }
  .filters input, .filters select { flex: 1 1 140px; min-width: 0; }
  .filters input[style] { width: auto !important; }
}
