/* Gudang Payment Simulator — mengikuti gaya dokumen teknis mitra (doktek.html) */
:root {
  color-scheme: light;
  --primary: #0F172A;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-light: #EFF6FF;
  --sidebar-bg: #0F172A;
  --sidebar-text: #94A3B8;
  --sidebar-active: #38BDF8;
  --sidebar-active-bg: #1E293B;
  --text: #334155;
  --heading: #0F172A;
  --muted: #64748B;
  --border: #E2E8F0;
  --bg-body: #F8FAFC;
  --bg-content: #FFFFFF;
  --code-bg: #0F172A;
  --code-text: #F8FAFC;
  --get: #10B981; --post: #2563EB; --put: #F59E0B; --delete: #EF4444;
  --ok: #047857; --ok-bg: #ECFDF5;
  --bad: #B91C1C; --bad-bg: #FEF2F2;
  --warn: #92400E; --warn-bg: #FFFBEB;
  --info: #1E40AF; --info-bg: #EFF6FF;
  --gutter: 0px;            /* padding kiri/kanan area konten */
  --sidebar-w: 260px;
  --r: 8px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; color: var(--text); background: var(--bg-body); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--heading); margin: 0 0 .5em; line-height: 1.3; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 700; }
p { margin: 0 0 .7em; line-height: 1.65; }
code, pre, .mono { font-family: 'Fira Code', ui-monospace, Menlo, Consolas, monospace; }
code { background: #F1F5F9; color: var(--primary); padding: 2px 6px; border-radius: 4px; font-size: .85em; }
.muted { color: var(--muted); }
.small { font-size: .88em; }
.hidden { display: none !important; }
.spacer { flex: 1; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- sidebar ---------- */
.sidebar { width: var(--sidebar-w); background: var(--sidebar-bg); color: var(--sidebar-text); position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 100; border-right: 1px solid #1E293B; display: flex; flex-direction: column; }
.sidebar-header { padding: 22px 20px; border-bottom: 1px solid #1E293B; }
.sidebar-brand { font-size: .8rem; font-weight: 700; color: var(--sidebar-active); letter-spacing: .05em; text-transform: uppercase; }
.sidebar-title { font-size: 1.1rem; font-weight: 700; color: #F8FAFC; margin-top: 4px; }
.nav-menu { padding: 16px 0; flex: 1; margin: 0; list-style: none; }
.nav-link { display: block; width: 100%; text-align: left; padding: 9px 22px; color: var(--sidebar-text); font: 500 .9rem 'Inter', sans-serif; border: 0; border-left: 3px solid transparent; border-radius: 0; background: none; height: auto; cursor: pointer; transition: all .2s ease; text-decoration: none; }
.nav-link:hover { color: #F8FAFC; background: rgba(255,255,255,.03); text-decoration: none; }
.nav-link.active { color: var(--sidebar-active); background: var(--sidebar-active-bg); border-left-color: var(--sidebar-active); font-weight: 600; }
.nav-group { padding: 14px 22px 4px; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #64748B; }
.sidebar-footer { padding: 12px 0 16px; border-top: 1px solid #1E293B; }

/* ---------- area utama ---------- */
.main-wrapper { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; }
.top-navbar { height: 60px; background: rgba(255,255,255,.85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 90; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--gutter); gap: 12px; }
.top-title { font-weight: 700; color: var(--heading); font-size: 1rem; padding-left: 20px; }
.top-meta { display: flex; gap: 10px; align-items: center; font-size: .85rem; padding: 0 20px; margin-left: auto; }
.meta-pill { background: #F1F5F9; padding: 4px 10px; border-radius: 20px; font-weight: 500; color: #475569; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.meta-pill b { font-weight: 600; color: var(--accent); }
.content-container { width: 100%; max-width: none; margin: 0; padding: 20px var(--gutter) 60px; background: var(--bg-content); min-height: calc(100vh - 60px); box-shadow: 0 1px 3px rgba(0,0,0,.05); }
body.guest .sidebar { display: none; }
body.guest .main-wrapper { margin-left: 0; }
body.guest .top-title { display: none; }
@media (max-width: 900px) {
  .sidebar { position: static; width: 100%; inset: auto; }
  body, body.guest { flex-direction: column; }
  .main-wrapper { margin-left: 0; }
  .nav-menu { display: flex; overflow-x: auto; padding: 0; }
  .nav-link { white-space: nowrap; width: auto; border-left: 0; border-bottom: 3px solid transparent; }
  .nav-link.active { border-bottom-color: var(--sidebar-active); }
  .nav-group, .sidebar-footer { display: none; }
  .sidebar-header { padding: 14px 16px; }
}

/* ---------- hero ---------- */
.doc-hero { background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%); color: #fff; padding: 28px 32px; border-radius: 12px; margin: 8px 0 24px; box-shadow: 0 10px 25px -5px rgba(15,23,42,.2); }
.doc-hero h1 { color: #fff; font-size: 1.7rem; margin-bottom: 8px; }
.doc-hero p { color: var(--sidebar-text); margin: 0; font-size: 1rem; max-width: 640px; }
.doc-hero .eyebrow { color: var(--sidebar-active); font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 6px; }

/* ---------- card / grid ---------- */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 18px; margin: 14px 0; }
.card > h2:first-child { margin-top: 0; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.grid { display: grid; gap: 14px; }
.grid > .card { margin: 0; }
@media (min-width: 760px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }

/* ---------- form ---------- */
label { display: block; font-weight: 600; font-size: .82rem; color: var(--heading); margin: 12px 0 5px; }
label:first-child { margin-top: 0; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 12px 0 0; }
input, select, textarea { width: 100%; height: 38px; padding: 0 12px; border: 1px solid #CBD5E1; border-radius: 6px; background: #fff; color: var(--heading); font: inherit; font-size: .92rem; transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; padding: 10px 12px; min-height: 200px; font-family: 'Fira Code', ui-monospace, Menlo, Consolas, monospace; font-size: .84rem; line-height: 1.6; resize: vertical; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
input::placeholder, textarea::placeholder { color: #94A3B8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- buttons ---------- */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border: 1px solid #CBD5E1; border-radius: 6px; background: #fff; color: var(--heading); font: 600 .88rem 'Inter', sans-serif; cursor: pointer; text-decoration: none; transition: all .2s ease; }
button:hover, .btn:hover { background: var(--bg-body); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { color: var(--bad); }
button.danger:hover { background: var(--bad-bg); border-color: #FECACA; }
button.sm, .btn.sm { height: 30px; padding: 0 11px; font-size: .78rem; }
button:disabled { opacity: .5; cursor: not-allowed; }
.copy-btn { background: #334155; color: #F8FAFC; border: 0; height: 26px; padding: 0 10px; border-radius: 4px; font-size: .75rem; }
.copy-btn:hover { background: var(--accent); }

/* ---------- badges / callouts ---------- */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: #F1F5F9; color: #475569; line-height: 1.5; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.info { background: var(--info-bg); color: var(--info); }
.method-badge { display: inline-block; padding: 3px 8px; border-radius: 4px; font: 700 .72rem 'Fira Code', monospace; color: #fff; text-transform: uppercase; }
.method-post { background: var(--post); } .method-get { background: var(--get); } .method-put { background: var(--put); } .method-delete { background: var(--delete); }
.notice { padding: 12px 16px; border-radius: var(--r); background: var(--info-bg); border-left: 4px solid var(--accent); color: var(--info); font-size: .9rem; }
.notice.bad { background: var(--bad-bg); border-left-color: var(--delete); color: var(--bad); }
.notice.warn { background: var(--warn-bg); border-left-color: var(--put); color: var(--warn); }
.notice.ok { background: var(--ok-bg); border-left-color: var(--get); color: var(--ok); }

/* ---------- blok kode ---------- */
pre.code { background: var(--code-bg); color: var(--code-text); padding: 16px 18px; border-radius: var(--r); overflow: auto; margin: 8px 0; max-height: 380px; white-space: pre-wrap; word-break: break-word; font-size: .84rem; line-height: 1.6; box-shadow: 0 4px 6px -1px rgba(0,0,0,.1); }
.code-label { font-size: .78rem; color: var(--muted); margin-top: 8px; font-weight: 600; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 0 0 14px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; border-top: 3px solid var(--accent); background: #fff; }
.stat:nth-child(2) { border-top-color: var(--sidebar-active); }
.stat:nth-child(3) { border-top-color: var(--get); }
.stat:nth-child(4) { border-top-color: var(--put); }
.stat .l { color: var(--muted); font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat .n { font-size: 1.4rem; font-weight: 800; color: var(--heading); letter-spacing: -.02em; margin-top: 2px; }

/* ---------- tabel ---------- */
.table-wrap { width: 100%; overflow-x: auto; margin: 4px 0 8px; border: 1px solid var(--border); border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .88rem; }
th { background: var(--bg-body); color: var(--heading); font-weight: 600; font-size: .8rem; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: #FAFAFA; }
tbody tr:hover td { background: var(--accent-light); }

/* ---------- key-value ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr auto; gap: 10px 14px; align-items: center; }
.kv .k { color: var(--muted); font-size: .82rem; font-weight: 500; }
.kv .v { font-family: 'Fira Code', ui-monospace, Menlo, monospace; font-size: .84rem; color: var(--heading); overflow-wrap: anywhere; }

/* ---------- log ---------- */
.log { border: 1px solid var(--border); border-radius: var(--r); margin: 8px 0; background: #fff; }
.log > summary { cursor: pointer; padding: 9px 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; list-style: none; font-size: .86rem; }
.log > summary::-webkit-details-marker { display: none; }
.log[open] > summary { border-bottom: 1px solid var(--border); background: var(--bg-body); border-radius: var(--r) var(--r) 0 0; }
.log .body { padding: 8px 12px 12px; }

/* ---------- live pill ---------- */
.dot { width: 8px; height: 8px; border-radius: 50%; background: #CBD5E1; display: inline-block; }
.dot.live { background: var(--get); box-shadow: 0 0 0 3px #D1FAE5; }

/* ---------- langkah ---------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 10px; }
.steps li { counter-increment: s; position: relative; padding-left: 32px; line-height: 1.55; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-light); color: var(--accent); font-size: .76rem; font-weight: 700; display: grid; place-items: center; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 6px; z-index: 200; max-width: 90vw; font-size: .88rem; box-shadow: 0 10px 25px -5px rgba(15,23,42,.3); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 300; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { position: relative; width: min(460px, 100%); height: min(700px, 100%); background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 25px 50px -12px rgba(15,23,42,.45); }
.modal-box iframe { width: 100%; height: 100%; border: 0; display: block; }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 22px; line-height: 1; }
.modal-close:hover { background: rgba(255,255,255,.28); }
