@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,500..600&family=IBM+Plex+Mono:wght@400;500&display=swap");

/* ============================================================
   MyralithLabs global style — mineral green + graphite, editorial.
   Token warna, tipografi, bentuk, dan motion mengikuti design.md.
   --brick / --brick-soft = ekstensi app untuk status gagal.
   ============================================================ */

:root {
  color-scheme: light;

  /* Aksen */
  --lime: #b7e37a;
  --evergreen: #627d6f;
  --glow: #d8f2a6;
  --border: #a8d572;

  /* Surface */
  --canvas: #f6fbf3;
  --panel: #e3eedd;
  --lime-soft: #edf8dd;
  --mist: #ecf7e3;
  --sage: #9ebf9e;
  --fog: #eef3ef;
  --stone: #dce5e0;
  --steel: #c7d2cd;

  /* Teks & garis */
  --ink: #2f3e36;
  --secondary: #6e7f73;
  --muted: #bfcdbf;
  --deep: #40564b;
  --graphite: #17211c;
  --white: #fff;
  --line: rgba(64, 86, 75, 0.22);
  --line-strong: rgba(98, 125, 111, 0.35);

  /* Peran font */
  --font-display: "DM Sans", Arial, sans-serif;
  --font-editorial: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", Arial, sans-serif;
  --font-technical: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout & motion */
  --sidebar: 14.5rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* Shadow hijau-abu */
  --shadow-card: 0 24px 60px rgba(64, 86, 75, 0.12);
  --shadow-media: 0 28px 60px rgba(64, 86, 75, 0.15);
  --shadow-form: 0 24px 64px rgba(64, 86, 75, 0.08);
  --shadow-underline: 0 5px 0 -2px rgba(183, 227, 122, 0.82);

  /* Status semantik */
  --brick: #8a3d2e;
  --brick-soft: #f4e0d9;
}

* { box-sizing: border-box; }

html {
  background: var(--canvas);
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
}

body {
  min-width: 20rem;
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font-body), Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

body, button, input, textarea, select { letter-spacing: 0; }

::selection { color: var(--graphite); background: var(--lime); }

a { color: inherit; text-decoration: none; }

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible { outline: 2px solid var(--evergreen); outline-offset: 4px; }

.skip-link {
  position: fixed; z-index: 100; top: .75rem; left: .75rem;
  padding: .85rem 1.1rem;
  background: var(--graphite); color: var(--white);
  font-size: .78rem; font-weight: 600;
  transform: translateY(-180%);
  transition: transform 220ms var(--ease-out);
}
.skip-link:focus { transform: none; }

/* ------------------------------------------------------------
   Shell & navigasi
   ------------------------------------------------------------ */

.app-shell { min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }

.sidebar {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 2.5rem;
  padding: 1.6rem 1.1rem 1.4rem;
  border-right: 1px solid var(--line-strong);
}

.wordmark {
  width: max-content;
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 700; line-height: 1;
  letter-spacing: -.045em;
  color: var(--graphite);
  transition: color 180ms ease;
}
.brand-mark { width: 1.7rem; height: 1.5rem; flex: 0 0 auto; }
.brand-mark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.brand-mark path { fill: none; stroke: currentColor; stroke-linejoin: round; }
.brand-mark .brand-bill { stroke-width: 2.25; }
.brand-mark .brand-route { stroke-width: 2.5; stroke-linecap: round; }
.brand-mark circle { fill: var(--lime); stroke: currentColor; stroke-width: 1.25; }
.brand-mark .brand-coin-line { stroke-width: 1.25; stroke-linecap: round; }
.brand-name { transform: translateY(-.02em); }
.brand-pay { color: var(--evergreen); }
.sidebar .wordmark { padding-left: .7rem; }
.wordmark:hover { color: var(--evergreen); }

.sidebar nav { display: grid; gap: .15rem; }

.sidebar nav a {
  position: relative;
  display: flex; align-items: center; gap: .7rem;
  min-height: 2.75rem;
  padding: .6rem .7rem .6rem .85rem;
  color: var(--deep);
  font-size: .78rem; font-weight: 600;
  transition: color 180ms ease, background-color 180ms ease;
}
.sidebar nav a::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--lime);
  transform: scaleY(0); transform-origin: top;
  transition: transform 220ms var(--ease-out);
}
.sidebar nav a:hover { color: var(--graphite); background: var(--lime-soft); }
.sidebar nav a:hover::before { transform: scaleY(1); }
.sidebar nav a[aria-current="page"] { color: var(--graphite); background: var(--panel); }
.sidebar nav a[aria-current="page"]::before { background: var(--evergreen); transform: scaleY(1); }

.nav-index {
  min-width: 1.35rem;
  color: var(--evergreen);
  font-family: var(--font-technical); font-size: .68rem; font-weight: 400;
}

.sidebar nav a strong {
  margin-left: auto; min-width: 1.6rem; padding: .2rem .35rem;
  background: var(--lime); color: var(--graphite);
  font-family: var(--font-technical); font-size: .68rem; font-weight: 500; line-height: 1.3;
  text-align: center;
}

.sidebar form { margin-top: auto; padding-top: 1.1rem; border-top: 1px solid var(--line); }

.text-button {
  width: 100%; min-height: 2.75rem;
  padding: .6rem .7rem .6rem .85rem;
  border: 0; background: transparent;
  color: var(--secondary); cursor: pointer; text-align: left;
  font-size: .78rem; font-weight: 600;
  transition: color 180ms ease, background-color 180ms ease;
}
.text-button:hover { color: var(--graphite); background: var(--fog); }

/* ------------------------------------------------------------
   Konten utama
   ------------------------------------------------------------ */

.main-content { min-width: 0; width: min(100%, 94rem); padding: 1.75rem 2.5rem 6rem; }

.topbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem;
  padding-bottom: 1.4rem; margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--line-strong);
}
.topbar h1 {
  margin: 0;
  color: var(--graphite);
  font-family: var(--font-editorial);
  font-size: clamp(1.9rem, 2.6vw, 2.6rem); font-weight: 600;
  line-height: 1.02; letter-spacing: -.045em;
  text-transform: capitalize;
}

.context {
  display: block; margin: 0 0 .55rem;
  color: var(--evergreen);
  font-size: .72rem; font-weight: 600;
}
.context::after {
  content: ""; display: block; width: 3.2rem; height: 2px; margin-top: .45rem;
  background: var(--lime);
  transform-origin: left;
}

.button {
  min-height: 3rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .75rem;
  padding: .8rem 1rem;
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  font-family: var(--font-body); font-size: .78rem; font-weight: 600; line-height: 1;
  transition: color 220ms ease, background-color 220ms ease, border-color 220ms ease, transform 220ms var(--ease-out);
}
.button-primary { background: var(--graphite); border-color: var(--graphite); color: var(--white); }
.button-primary:hover { background: var(--lime); border-color: var(--lime); color: var(--graphite); transform: translateY(-2px); }
.button-secondary { background: var(--white); border-color: var(--muted); color: var(--graphite); }
.button-secondary:hover { background: var(--mist); border-color: var(--evergreen); transform: translateY(-2px); }
.button:disabled { opacity: .65; cursor: wait; transform: none; }

.notice {
  margin: 0 0 1.75rem; padding: .85rem 1.1rem;
  background: var(--glow);
  border: 1px solid var(--line-strong); border-left: 3px solid var(--evergreen);
  color: var(--graphite);
  font-size: .9rem;
}
.notice-error { background: var(--brick-soft); border-left-color: var(--brick); color: var(--brick); }

.payment-reveal {
  margin: 0 0 1.75rem; padding: 1.1rem 1.25rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem;
  background: var(--glow);
  border: 1px solid var(--line-strong); border-left: 3px solid var(--evergreen);
}
.payment-reveal img { width: 5.5rem; height: 5.5rem; background: var(--white); border: 1px solid var(--line); border-radius: 6px; }
.payment-reveal strong { display: block; color: var(--graphite); font-weight: 600; font-size: .9rem; }
.payment-reveal code { display: block; margin-top: .35rem; color: var(--deep); font-family: var(--font-technical); font-size: .78rem; overflow-wrap: anywhere; }
.payment-reveal .button { margin-left: auto; }

.secret-reveal {
  margin: 0 0 1.75rem; padding: 1.1rem 1.25rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .85rem 1.25rem;
  background: var(--deep); color: var(--panel);
}
.secret-reveal strong { color: var(--white); font-weight: 600; }
.secret-reveal code {
  max-width: 100%; overflow-wrap: anywhere; padding: .55rem .75rem;
  background: var(--graphite); color: var(--lime);
  font-family: var(--font-technical); font-size: .8rem;
}
.secret-reveal span { color: var(--muted); font-size: .84rem; }

/* ------------------------------------------------------------
   Section, list, dan tabel
   ------------------------------------------------------------ */

.section-block { margin: 0 0 3.5rem; }

.section-heading {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem;
  padding-top: 1.1rem; margin-bottom: 1.35rem;
  border-top: 1px solid var(--line-strong);
}
.section-heading h2, .form-panel h2 {
  margin: 0 0 .4rem;
  color: var(--graphite);
  font-family: var(--font-editorial);
  font-size: clamp(1.5rem, 1.9vw, 1.85rem); font-weight: 600;
  line-height: 1.05; letter-spacing: -.035em;
}
.section-heading p, .form-panel > p {
  margin: 0; max-width: 36rem;
  color: var(--secondary); font-size: .9rem; line-height: 1.6;
}
.section-heading > a {
  min-height: 2.75rem;
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--deep); font-size: .78rem; font-weight: 600; white-space: nowrap;
  transition: color 180ms ease;
}
.section-heading > a::after { content: "\2192"; transition: transform 220ms var(--ease-out); }
.section-heading > a:hover { color: var(--evergreen); }
.section-heading > a:hover::after { transform: translateX(4px); }
.section-heading > form label { min-width: 11rem; }

.table-wrap { width: 100%; overflow-x: auto; }

table { width: 100%; border-collapse: collapse; text-align: left; }

th {
  padding: .6rem 1.25rem .6rem 0;
  border-bottom: 1px solid var(--line-strong);
  color: var(--evergreen);
  font-family: var(--font-technical); font-size: .68rem; font-weight: 500; letter-spacing: .05em;
  white-space: nowrap;
}
td {
  padding: .8rem 1.25rem .8rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: .84rem; line-height: 1.5;
  vertical-align: middle;
}
tbody tr { transition: background-color 180ms ease; }
tbody tr:hover { background: var(--lime-soft); }
tbody td a { color: var(--deep); transition: color 180ms ease; }
tbody td a:hover { color: var(--evergreen); }

td code { font-size: .78rem; color: var(--deep); }
.error-cell { max-width: 30rem; color: var(--brick); }
.url-cell { max-width: 22rem; overflow-wrap: anywhere; }
.num { font-family: var(--font-technical); font-size: .78rem; font-weight: 500; }

.table-action {
  min-height: 2.75rem;
  display: inline-flex; align-items: center; padding: 0;
  border: 0; background: transparent;
  color: var(--deep); cursor: pointer;
  font-family: var(--font-body); font-size: .78rem; font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--evergreen);
  text-underline-offset: .2em;
  transition: color 180ms ease;
}
.table-action:hover { color: var(--evergreen); }
.table-action.is-danger { color: var(--brick); text-decoration-color: var(--brick); }
.row-actions { display: flex; align-items: center; gap: 1.1rem; }

.status {
  display: inline-flex; align-items: center; padding: .22rem .45rem;
  background: var(--fog); color: var(--deep);
  font-family: var(--font-technical); font-size: .68rem; font-weight: 500; line-height: 1.4;
  white-space: nowrap;
}
.status-active, .status-settlement, .status-delivered { background: var(--lime); color: var(--graphite); }
.status-pending { background: var(--steel); color: var(--graphite); }
.status-refund, .status-partial_refund { background: var(--glow); color: var(--deep); }
.status-inactive, .status-deny, .status-cancel, .status-expire, .status-failed { background: var(--brick-soft); color: var(--brick); }

.empty-state { padding: 1.5rem 1.4rem; background: var(--fog); border-left: 3px solid var(--steel); }
.empty-state strong { display: block; color: var(--graphite); font-size: .9rem; font-weight: 600; }
.empty-state p { margin: .35rem 0 0; max-width: 36rem; color: var(--secondary); font-size: .9rem; }
.empty-state.compact { padding: 1rem 1.1rem; }

.filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 1.5rem; padding: .5rem 0 1.5rem; }
.filters label { min-width: 11rem; }
.filters .loading-message { flex-basis: 100%; margin: 0; }

/* ------------------------------------------------------------
   Form
   ------------------------------------------------------------ */

label {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem;
  color: var(--evergreen); font-size: .72rem; font-weight: 600;
}
label > input, label > select, label > textarea { flex-basis: 100%; }

input, select, textarea {
  width: 100%; min-height: 2.75rem;
  border: 0; border-bottom: 2px solid var(--muted); border-radius: 4px 4px 0 0;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink); font-size: .9rem;
  padding: .6rem .75rem;
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, transform 180ms var(--ease-out);
}
input:hover, select:hover, textarea:hover { border-color: var(--sage); background: rgba(255, 255, 255, 0.9); }
input:focus, select:focus, textarea:focus {
  outline-offset: 2px;
  border-color: var(--evergreen); background: var(--white);
  box-shadow: var(--shadow-underline); transform: translateY(-1px);
}
input::placeholder { color: var(--secondary); opacity: .85; }
select { cursor: pointer; }

.loading-message { display: none; margin: .6rem 0 0; color: var(--secondary); font-size: .84rem; }
form.is-loading .loading-message { display: block; }
form.is-loading button[type="submit"] { opacity: .65; cursor: wait; transform: none; }

/* ------------------------------------------------------------
   Layout halaman
   ------------------------------------------------------------ */

.split-layout {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(17rem, 21rem);
  gap: clamp(2.5rem, 4vw, 4rem); align-items: start;
}

.form-panel {
  position: sticky; top: 1.5rem;
  padding: 1.4rem 1.3rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--line-strong); border-top: 3px solid var(--lime);
  box-shadow: var(--shadow-form);
}
.form-panel h2 { margin-bottom: .5rem; }
.form-panel > p { margin-bottom: 1.15rem; }
.form-panel form { display: grid; gap: 1.05rem; }
.form-panel .button { margin-top: .35rem; }

.system-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(15rem, 1fr); gap: 2.5rem; align-items: start; }
.system-layout .section-block { margin-bottom: 0; }

.system-row {
  min-height: 4.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--line);
}
.system-row strong { display: block; color: var(--graphite); font-size: .9rem; font-weight: 600; }
.system-row p { margin: .3rem 0 0; color: var(--secondary); font-size: .84rem; overflow-wrap: anywhere; }

.runbook { display: grid; }
.runbook a {
  min-height: 3rem;
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--deep); font-size: .84rem; font-weight: 600;
  transition: color 180ms ease;
}
.runbook a::after { content: "\2192"; margin-left: auto; color: var(--evergreen); transition: transform 220ms var(--ease-out); }
.runbook a:hover { color: var(--evergreen); }
.runbook a:hover::after { transform: translateX(4px); }

.metric-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 2.5rem;
  border-top: 1px solid var(--line-strong);
}
.metric-grid article {
  min-height: 6rem;
  display: flex; flex-direction: column; justify-content: space-between; gap: .75rem;
  padding: 1.2rem 1.3rem 1.4rem;
  border-left: 1px solid var(--line);
}
.metric-grid article:first-child { padding-left: 0; border-left: 0; }
.metric-grid span { color: var(--evergreen); font-size: .72rem; font-weight: 600; }
.metric-grid strong {
  color: var(--graphite);
  font-family: var(--font-technical);
  font-size: clamp(1.3rem, 1.9vw, 1.75rem); font-weight: 500; line-height: 1.1;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------
   Drawer event
   ------------------------------------------------------------ */

.drawer-scrim { position: fixed; z-index: 20; inset: 0; background: rgba(23, 33, 28, 0.28); }

.event-drawer {
  position: fixed; z-index: 21; inset: 0 0 0 auto;
  width: min(32rem, 100%); overflow-y: auto;
  padding: 1.6rem 1.75rem 3rem;
  background: var(--white);
  border-left: 1px solid var(--line-strong);
  box-shadow: var(--shadow-media);
}
.event-drawer > header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line-strong);
}
.event-drawer h2 {
  margin: 0;
  color: var(--graphite);
  font-family: var(--font-technical); font-size: 1.05rem; font-weight: 500; line-height: 1.3;
}
.close-button {
  min-height: 2.75rem; min-width: 2.75rem;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 .4rem;
  color: var(--deep); font-size: .78rem; font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--evergreen);
  text-underline-offset: .2em;
  transition: color 180ms ease;
}
.close-button:hover { color: var(--evergreen); }

.detail-list { margin: 1.35rem 0 0; }
.detail-list > div {
  display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--line);
}
.detail-list dt { color: var(--secondary); font-size: .78rem; }
.detail-list dd { margin: 0; color: var(--ink); font-size: .84rem; overflow-wrap: anywhere; }
.detail-list dd code { font-size: .78rem; color: var(--deep); }

.event-drawer section { margin-top: 2rem; }
.event-drawer h3 { margin: 0 0 .85rem; color: var(--evergreen); font-size: .78rem; font-weight: 600; }

pre {
  max-width: 100%; overflow: auto; margin: 0; padding: 1rem;
  background: var(--fog);
  border: 1px solid var(--line);
  color: var(--deep);
  font-family: var(--font-technical); font-size: .72rem; line-height: 1.7;
  white-space: pre-wrap; overflow-wrap: anywhere;
}

.attempt-list { margin: 0; padding: 0; list-style: none; }
.attempt-list li { position: relative; padding: .35rem 0 1rem 1.4rem; border-left: 1px solid var(--line-strong); }
.attempt-list li::before { content: ""; position: absolute; left: -3px; top: .75rem; width: 5px; height: 5px; background: var(--evergreen); }
.attempt-list strong { color: var(--graphite); font-size: .84rem; font-weight: 600; }
.attempt-list span { display: block; margin-top: .2rem; color: var(--secondary); font-family: var(--font-technical); font-size: .72rem; }
.attempt-list p { margin: .35rem 0 0; color: var(--brick); font-size: .84rem; }

/* ------------------------------------------------------------
   Navigasi mobile
   ------------------------------------------------------------ */

.mobile-nav, .mobile-menu { display: none; }

/* ------------------------------------------------------------
   Login
   ------------------------------------------------------------ */

.login-body { min-height: 100dvh; }

.login-shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(20rem, 46%) minmax(20rem, 54%); }

.login-intro {
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  padding: clamp(2rem, 4.5vw, 4.5rem);
  background: var(--deep); color: var(--panel);
}
.login-intro .wordmark { color: var(--white); }
.login-intro .brand-pay { color: var(--lime); }
.login-intro .wordmark:hover { color: var(--lime); }
.login-intro h1 {
  max-width: 12ch; margin: 0 0 1.25rem;
  color: var(--white);
  font-family: var(--font-display);
  font-size: clamp(2.9rem, 4.9vw, 5rem); font-weight: 700;
  line-height: .94; letter-spacing: -.055em;
  text-transform: uppercase;
}
.login-intro p { max-width: 30rem; margin: 0; color: var(--panel); font-size: clamp(1rem, 1.1vw, 1.12rem); }
.login-intro .login-foot {
  padding-top: .9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--muted);
  font-family: var(--font-technical); font-size: .68rem; font-weight: 500; letter-spacing: .06em;
}

.login-form-wrap { display: grid; place-items: center; padding: 2.5rem; }
.login-form { width: min(100%, 24rem); display: grid; gap: 1.15rem; }
.login-form h2 {
  margin: 0;
  color: var(--graphite);
  font-family: var(--font-editorial);
  font-size: clamp(1.8rem, 2.4vw, 2.3rem); font-weight: 600;
  line-height: 1.02; letter-spacing: -.04em;
}
.login-form .muted { margin: -.5rem 0 0; color: var(--secondary); font-size: .9rem; }
.login-form .notice { margin: 0; }
.login-form .button { width: 100%; margin-top: .35rem; }
.optional { color: var(--secondary); font-weight: 500; }

/* ------------------------------------------------------------
   Halaman root
   ------------------------------------------------------------ */

.home-body { min-height: 100dvh; }

.home-shell {
  width: min(88vw, 72rem); margin-inline: auto;
  min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: space-between; gap: 3rem;
  padding: clamp(2rem, 4vw, 3.5rem) 0;
}
.home-mark {
  margin: 0; align-self: flex-start;
  color: var(--graphite);
}
.home-shell h1 {
  max-width: 18ch; margin: 0 0 1.5rem;
  color: var(--graphite);
  font-family: var(--font-editorial); font-size: clamp(2.55rem, 4.5vw, 4.65rem); font-weight: 600;
  line-height: 1.02; letter-spacing: -.05em;
}
.home-copy { max-width: 34rem; margin: 0; color: var(--secondary); font-size: clamp(1rem, 1.1vw, 1.12rem); }
.home-foot {
  margin: 0; padding-top: .9rem;
  border-top: 1px solid var(--line);
  color: var(--evergreen);
  font-family: var(--font-technical); font-size: .68rem; font-weight: 500; letter-spacing: .06em;
}

/* ------------------------------------------------------------
   Halaman pembayaran QRIS
   ------------------------------------------------------------ */

.pay-body { min-height: 100dvh; }

.pay-shell {
  width: min(92vw, 73rem); margin-inline: auto;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: clamp(1.5rem, 3vw, 2.25rem) 0 1.5rem;
}
.pay-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--line-strong);
}
.pay-status-meta { display: grid; justify-items: end; gap: .45rem; }
.pay-monitor {
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--evergreen);
  font-family: var(--font-technical); font-size: .65rem; font-weight: 500; letter-spacing: .035em;
}
.pay-monitor i {
  width: .45rem; height: .45rem; flex: 0 0 auto;
  background: var(--lime); border: 1px solid var(--deep); border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(183, 227, 122, .28);
}
.pay-monitor.is-checking i { animation: pay-pulse 1.25s ease-in-out infinite; }
.pay-layout {
  flex: 1;
  display: grid; grid-template-columns: minmax(0, .92fr) minmax(26rem, 1fr);
  gap: clamp(3rem, 6vw, 5.5rem); align-items: center;
  padding: clamp(3rem, 7vh, 5.5rem) 0;
}
.pay-summary { min-width: 0; }
.pay-title { margin-bottom: 2.2rem; }
.pay-title .context { margin-bottom: .75rem; }
.pay-title h1 {
  margin: 0; max-width: 12ch;
  color: var(--graphite);
  font-family: var(--font-editorial);
  font-size: clamp(2.75rem, 4.6vw, 4.35rem); font-weight: 600;
  line-height: .98; letter-spacing: -.05em;
  overflow-wrap: anywhere;
}
.pay-label {
  display: block; margin-bottom: .45rem;
  color: var(--evergreen);
  font-family: var(--font-technical); font-size: .65rem; font-weight: 500; letter-spacing: .055em;
  text-transform: uppercase;
}
.pay-money-row {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(9rem, .65fr);
  gap: 1.5rem;
  padding: 1.35rem 0;
  border-block: 1px solid var(--line-strong);
}
.pay-money-row > div { min-width: 0; }
.pay-countdown-wrap { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.pay-amount, .pay-countdown {
  margin: 0;
  color: var(--graphite);
  font-family: var(--font-technical); font-weight: 500; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.pay-amount { display: flex; align-items: baseline; gap: .55rem; font-size: clamp(1.65rem, 3vw, 2.25rem); overflow-wrap: anywhere; }
.pay-currency { color: var(--evergreen); font-size: .68rem; letter-spacing: .06em; }
.pay-countdown { display: flex; align-items: center; gap: .6rem; font-size: clamp(1.35rem, 2.2vw, 1.75rem); }
.pay-clock { position: relative; width: 1.2rem; height: 1.2rem; border: 1.5px solid var(--evergreen); border-radius: 50%; }
.pay-clock::before, .pay-clock::after { content: ""; position: absolute; left: 50%; top: 50%; width: 1px; background: var(--evergreen); transform-origin: 50% 0; }
.pay-clock::before { height: .34rem; transform: translate(-50%, -100%); }
.pay-clock::after { height: .27rem; transform: translate(-50%, 0) rotate(-48deg); }
.pay-order { margin: 1rem 0 0; }
.pay-order .pay-label { margin-bottom: .15rem; }
.pay-order code { color: var(--deep); font-family: var(--font-technical); font-size: .78rem; overflow-wrap: anywhere; }
.pay-steps {
  position: relative;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.2rem;
  margin: 2.5rem 0 0; padding: 0;
  list-style: none;
}
.pay-steps::before { content: ""; position: absolute; z-index: -1; top: 1rem; left: 1rem; right: 1rem; border-top: 1px dashed var(--sage); }
.pay-step { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: .7rem; align-items: start; }
.pay-step-number {
  width: 2rem; height: 2rem;
  display: grid; place-items: center;
  background: var(--canvas); border: 1px solid var(--sage); border-radius: 50%;
  color: var(--evergreen); font-family: var(--font-technical); font-size: .68rem; font-weight: 500;
}
.pay-step:first-child .pay-step-number { background: var(--lime); border-color: var(--deep); color: var(--graphite); }
.pay-step strong { display: block; padding-top: .15rem; color: var(--graphite); font-size: .82rem; }
.pay-step p { margin: .25rem 0 0; color: var(--secondary); font-size: .73rem; line-height: 1.45; }
.pay-methods { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.pay-methods h2 { margin: 0 0 .7rem; color: var(--graphite); font-size: .8rem; font-weight: 600; }
.pay-methods > p { margin: .65rem 0 0; color: var(--secondary); font-size: .72rem; }
.pay-method-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem .7rem; align-items: center; }
.pay-method-list img { display: block; width: 100%; height: 1.55rem; object-fit: contain; object-position: left center; }
.pay-panel {
  min-height: 38rem; padding: clamp(1.5rem, 3vw, 2.35rem);
  display: grid;
  background: var(--white); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-card);
}
.pay-pending-state { min-height: 100%; display: grid; grid-template-rows: auto 1fr auto; gap: 1.3rem; align-items: center; }
.pay-trust { display: flex; align-items: center; justify-content: center; gap: .75rem; color: var(--evergreen); font-size: .74rem; }
.pay-trust img { display: block; width: 4.8rem; height: auto; padding-right: .75rem; border-right: 1px solid var(--line-strong); }
.pay-qr { margin: 0; display: grid; place-items: center; }
.pay-qr img { display: block; width: min(100%, 23rem); height: auto; border-radius: 4px; }
.pay-hint { max-width: 34rem; margin: 0 auto; color: var(--secondary); font-size: .82rem; text-align: center; }
.pay-success-state, .pay-terminal-state { min-height: 100%; display: none; place-content: center; justify-items: center; text-align: center; }
.pay-result-icon {
  width: 4.4rem; height: 4.4rem; margin-bottom: 1.5rem;
  display: grid; place-items: center;
  background: var(--lime); border: 1px solid var(--deep); border-radius: 50%;
  color: var(--graphite); font-size: 2rem; font-weight: 500;
  box-shadow: 0 0 0 .65rem var(--lime-soft);
}
.pay-result-icon-error { background: var(--brick-soft); border-color: var(--brick); color: var(--brick); box-shadow: 0 0 0 .65rem rgba(244, 224, 217, .7); }
.pay-success-state h2, .pay-terminal-state h2 {
  margin: 0 0 .55rem;
  color: var(--graphite); font-family: var(--font-editorial); font-size: clamp(2rem, 3vw, 2.75rem); font-weight: 600; line-height: 1; letter-spacing: -.04em;
}
.pay-success-state > p, .pay-terminal-state > p { max-width: 26rem; margin: 0; color: var(--secondary); font-size: .87rem; }
.pay-receipt { width: min(100%, 24rem); margin: 2.1rem 0 0; border-block: 1px solid var(--line-strong); }
.pay-receipt div { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 1rem; padding: .75rem 0; text-align: left; }
.pay-receipt div + div { border-top: 1px solid var(--line); }
.pay-receipt dt { color: var(--evergreen); font-family: var(--font-technical); font-size: .63rem; text-transform: uppercase; }
.pay-receipt dd { min-width: 0; margin: 0; color: var(--graphite); font-family: var(--font-technical); font-size: .73rem; text-align: right; overflow-wrap: anywhere; }
.pay-success-state .pay-result-foot { margin-top: 1.5rem; color: var(--deep); font-weight: 600; }
.pay-foot {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: auto; padding-top: .95rem;
  border-top: 1px solid var(--line);
  color: var(--evergreen);
  font-family: var(--font-technical); font-size: .62rem; font-weight: 500; letter-spacing: .045em;
}
.pay-shell[data-pay-status="settlement"] .pay-pending-state { display: none; }
.pay-shell[data-pay-status="settlement"] .pay-success-state { display: grid; }
.pay-shell[data-pay-status="deny"] .pay-pending-state,
.pay-shell[data-pay-status="cancel"] .pay-pending-state,
.pay-shell[data-pay-status="expire"] .pay-pending-state,
.pay-shell[data-pay-status="refund"] .pay-pending-state,
.pay-shell[data-pay-status="partial_refund"] .pay-pending-state { display: none; }
.pay-shell[data-pay-status="deny"] .pay-terminal-state,
.pay-shell[data-pay-status="cancel"] .pay-terminal-state,
.pay-shell[data-pay-status="expire"] .pay-terminal-state,
.pay-shell[data-pay-status="refund"] .pay-terminal-state,
.pay-shell[data-pay-status="partial_refund"] .pay-terminal-state { display: grid; }
.pay-shell[data-pay-status="settlement"] .pay-step-number { background: var(--lime); border-color: var(--deep); color: var(--graphite); }
.pay-shell[data-pay-status="settlement"] .pay-steps::before { border-color: var(--evergreen); }

/* ------------------------------------------------------------
   Halaman dokumentasi API
   ------------------------------------------------------------ */

.docs-body { min-height: 100dvh; }

.docs-shell { width: min(92vw, 76rem); margin-inline: auto; padding: clamp(1.5rem, 3vw, 2.25rem) 0 4rem; }

.docs-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line-strong);
}
.docs-meta { color: var(--evergreen); font-family: var(--font-technical); font-size: .68rem; font-weight: 500; letter-spacing: .06em; }

.docs-layout {
  display: grid; grid-template-columns: 15rem minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  margin-top: clamp(2.25rem, 4vw, 3.5rem);
  align-items: start;
}

.docs-toc { position: sticky; top: 1.5rem; display: grid; gap: .125rem; }
.docs-toc p { margin: 0 0 .6rem; color: var(--evergreen); font-size: .72rem; font-weight: 600; }
.docs-toc a {
  display: flex; align-items: center;
  min-height: 2.25rem; padding: .3rem .65rem;
  border-left: 2px solid var(--line);
  color: var(--deep); font-size: .78rem; font-weight: 600;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}
.docs-toc a:hover { color: var(--graphite); background: var(--lime-soft); border-color: var(--lime); }

.docs-content { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3.25rem; }
.docs-section { scroll-margin-top: 1.5rem; }
.docs-section h1 {
  margin: .4rem 0 1.25rem;
  color: var(--graphite);
  font-family: var(--font-editorial);
  font-size: clamp(2.2rem, 3.4vw, 3.2rem); font-weight: 600;
  line-height: 1.02; letter-spacing: -.045em;
}
.docs-section h2 {
  margin: .4rem 0 1.1rem; padding-top: 1.1rem;
  border-top: 1px solid var(--line-strong);
  color: var(--graphite);
  font-family: var(--font-editorial);
  font-size: clamp(1.6rem, 2.2vw, 2.05rem); font-weight: 600;
  line-height: 1.05; letter-spacing: -.035em;
}
.docs-eyebrow { margin: 0; color: var(--evergreen); font-family: var(--font-technical); font-size: .68rem; font-weight: 500; letter-spacing: .08em; }
.docs-section p { margin: 0 0 1.1rem; max-width: 44rem; }
.docs-section pre { margin: 0 0 1.1rem; }
.docs-section .table-wrap { margin: 0 0 1.1rem; }
.docs-section p code, .docs-section td code {
  padding: .12rem .3rem;
  background: var(--fog);
  color: var(--deep);
  font-family: var(--font-technical); font-size: .82em;
}

.docs-endpoint {
  display: flex; align-items: center; gap: .7rem;
  margin: 0 0 1rem; padding: .65rem .8rem;
  background: var(--fog);
  border-left: 3px solid var(--evergreen);
  overflow-wrap: anywhere;
}
.docs-endpoint code { min-width: 0; color: var(--graphite); font-family: var(--font-technical); font-size: .8rem; font-weight: 500; }
.docs-method {
  flex: 0 0 auto;
  padding: .2rem .45rem;
  background: var(--steel); color: var(--graphite);
  font-family: var(--font-technical); font-size: .62rem; font-weight: 500; letter-spacing: .06em;
}
.docs-method.is-get { background: var(--panel); }
.docs-method.is-post { background: var(--lime); }
.docs-method.is-put { background: var(--glow); }
.docs-method.is-del { background: var(--brick-soft); color: var(--brick); }

/* ------------------------------------------------------------
   Breakpoints
   ------------------------------------------------------------ */

@media (max-width: 68rem) {
  :root { --sidebar: 12.5rem; }
  .main-content { padding-inline: 1.5rem; }
  .nav-index { display: none; }
  .split-layout { grid-template-columns: 1fr; }
  .form-panel { position: static; max-width: 34rem; }
  .system-layout { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid article:nth-child(odd) { padding-left: 0; border-left: 0; }
  .metric-grid article:nth-child(n+3) { border-top: 1px solid var(--line); }
}

@media (max-width: 58rem) {
  .pay-shell { width: min(90vw, 43rem); }
  .pay-layout { grid-template-columns: minmax(0, 1fr); gap: 3rem; align-items: start; }
  .pay-title h1 { max-width: 15ch; }
  .pay-panel { min-height: 36rem; }
}

@media (max-width: 46rem) {
  body { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
  .pay-body { padding-bottom: 0; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-content { padding: 1.1rem 1rem 3rem; }
  .topbar { align-items: flex-start; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-grid article, .metric-grid article:first-child { padding-left: 0; border-left: 0; }
  .metric-grid article + article { border-top: 1px solid var(--line); }
  .section-heading { flex-wrap: wrap; align-items: flex-start; }
  .section-heading > form, .section-heading > form label { width: 100%; min-width: 0; }
  .section-heading > a { white-space: normal; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; align-items: end; }
  .filters label { min-width: 0; }
  .filters .button { grid-column: 1 / -1; }
  .table-wrap table { min-width: 46rem; }

  .mobile-nav {
    position: fixed; z-index: 15; inset: auto 0 0;
    min-height: calc(4.5rem + env(safe-area-inset-bottom));
    padding: .3rem .4rem env(safe-area-inset-bottom);
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: rgba(246, 251, 243, 0.92);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line-strong);
  }
  .mobile-nav a, .mobile-nav button {
    min-height: 3.4rem;
    display: flex; align-items: center; justify-content: center; padding: .3rem;
    border: 0; background: transparent;
    color: var(--deep); text-align: center;
    font-size: .78rem; font-weight: 600;
  }
  .mobile-nav [aria-current="page"] { color: var(--graphite); box-shadow: inset 0 -3px 0 var(--lime); }
  .mobile-menu {
    position: fixed; z-index: 14; inset: auto .75rem calc(5rem + env(safe-area-inset-bottom)) .75rem;
    padding: .5rem;
    grid-template-columns: 1fr 1fr;
    background: var(--deep);
    box-shadow: var(--shadow-card);
  }
  .mobile-menu:not([hidden]) { display: grid; }
  .mobile-menu a {
    min-height: 3rem;
    display: flex; align-items: center; padding: .5rem .8rem;
    color: var(--panel); font-size: .78rem; font-weight: 600;
    transition: color 180ms ease, background-color 180ms ease;
  }
  .mobile-menu a:hover { color: var(--white); background: rgba(255, 255, 255, 0.08); }

  .event-drawer { padding: 1.25rem 1.1rem 2.5rem; }
  .detail-list > div { grid-template-columns: 7rem minmax(0, 1fr); }

  .login-shell { grid-template-columns: 1fr; }
  .login-intro { min-height: 22rem; padding: 2rem 1.4rem; }
  .login-intro h1 { margin-top: 2.5rem; font-size: clamp(2.45rem, 11vw, 3.4rem); }
  .login-intro .login-foot { display: none; }
  .login-form-wrap { padding: 2.5rem 1.4rem; }

  .home-shell h1 { font-size: clamp(2.45rem, 12vw, 3.35rem); }

  .pay-shell { width: min(91vw, 31rem); padding-top: 1.15rem; }
  .pay-head { align-items: flex-start; gap: .8rem; }
  .pay-head .wordmark { font-size: 1.15rem; }
  .pay-status-meta { gap: .35rem; }
  .pay-monitor { max-width: 11rem; justify-content: flex-end; font-size: .57rem; line-height: 1.35; text-align: right; }
  .pay-layout { display: flex; flex-direction: column; gap: 0; padding: 2.25rem 0 2.75rem; }
  .pay-summary { display: contents; }
  .pay-title { order: 1; margin-bottom: 1.6rem; }
  .pay-money-row { order: 2; }
  .pay-order { order: 3; }
  .pay-panel { order: 4; width: 100%; margin-top: 2rem; }
  .pay-steps { order: 5; }
  .pay-methods { order: 6; }
  .pay-title h1 { font-size: clamp(2.55rem, 12vw, 3.35rem); }
  .pay-money-row { grid-template-columns: minmax(0, 1fr) minmax(7.8rem, .58fr); gap: .8rem; padding-block: 1.1rem; }
  .pay-countdown-wrap { padding-left: .85rem; }
  .pay-amount { display: grid; gap: .25rem; font-size: clamp(1.45rem, 7vw, 1.85rem); }
  .pay-countdown { gap: .4rem; font-size: 1.25rem; }
  .pay-steps { grid-template-columns: minmax(0, 1fr); gap: 1.15rem; margin-top: 2rem; }
  .pay-steps::before { inset: 1rem auto 1rem 1rem; border-top: 0; border-left: 1px dashed var(--sage); }
  .pay-step { background: var(--canvas); }
  .pay-methods { margin-top: 2rem; }
  .pay-method-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem .45rem; }
  .pay-method-list img { height: 1.35rem; }
  .pay-panel { min-height: 0; padding: 1.2rem; }
  .pay-pending-state { gap: 1rem; }
  .pay-qr img { width: min(100%, 21rem); }
  .pay-hint { font-size: .76rem; }
  .pay-success-state, .pay-terminal-state { min-height: 30rem; }
  .pay-receipt div { grid-template-columns: 5rem minmax(0, 1fr); }
  .pay-foot { flex-direction: column; gap: .25rem; }
}

@media (max-width: 68rem) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); }
  .docs-toc { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-toc p { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------
   Motion
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: no-preference) {
  .topbar, .section-block, .form-panel, .home-shell > *, .pay-shell > * { animation: reveal-in 860ms var(--ease-out) both; }
  .context::after { animation: rule-in 620ms var(--ease-out) 160ms both; }
  .mobile-menu:not([hidden]) { animation: menu-in 520ms var(--ease-out); }
  .event-drawer { animation: drawer-in 520ms var(--ease-out); }

  @keyframes reveal-in { from { opacity: 0; transform: translateY(24px); filter: blur(5px); } }
  @keyframes rule-in { from { transform: scaleX(0); } }
  @keyframes menu-in { from { opacity: 0; transform: translateY(.75rem); } }
  @keyframes drawer-in { from { opacity: 0; transform: translateX(2rem); } }
  @keyframes pay-pulse { 50% { box-shadow: 0 0 0 7px rgba(183, 227, 122, 0); } }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (forced-colors: active) {
  .status, .sidebar nav a strong, .attempt-list li::before { border: 1px solid CanvasText; }
}
