@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #1c2140; --ink-2: #4a5070; --muted: #6e7491; --line: #dde1ea; --soft: #f5f6f9;
  --bg: #edeff4; --paper: #fff;
  --blue: #2747d8; --blue-ink: #1b34a8; --blue-soft: #e8ecfd;
  --green: #0f7b55; --green-soft: #e3f4ec; --amber: #b26a00; --amber-soft: #fdf1dc; --red: #c62839; --red-soft: #fce8ea;
  --r-sm: 8px; --r: 14px; --r-lg: 20px;
  --shadow: 0 1px 2px rgb(28 33 64 / .06), 0 8px 24px -12px rgb(28 33 64 / .18);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--ink); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 8px; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 5vw, 38px); font-weight: 800; letter-spacing: -.025em; }
h2 { font-size: 22px; font-weight: 800; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 12px; }
a { color: var(--blue); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* Tombol & input */
button, .btn {
  font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
button:hover, .btn:hover { border-color: #c4c9d8; background: var(--soft); }
button:active, .btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-ink); border-color: var(--blue-ink); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent); outline-offset: 2px; }

label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
input, textarea, select {
  font: inherit; width: 100%; margin-top: 6px; padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); color: var(--ink);
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); outline: 3px solid var(--blue-soft); outline-offset: 0; }
textarea { min-height: 96px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { width: 18px; height: 18px; min-height: 0; margin: 2px 0 0; accent-color: var(--blue); flex: none; }
.err { color: var(--red); font-size: 14px; min-height: 1.4em; margin: 0 0 8px; }

/* Permukaan */
.panel { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; }
.badge { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--soft); color: var(--ink-2); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.paid { background: var(--green-soft); color: var(--green); }
.badge.pending { background: var(--amber-soft); color: var(--amber); }
.badge.expired { background: var(--soft); color: var(--muted); }
.badge.cancelled { background: var(--red-soft); color: var(--red); }
code, .code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13px; background: var(--soft); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; word-break: break-all; }

/* Dialog: bottom sheet di HP, modal di layar lebar */
dialog { border: 0; padding: 0; border-radius: var(--r-lg); width: min(440px, calc(100vw - 32px)); color: var(--ink); box-shadow: 0 24px 60px -20px rgb(28 33 64 / .45); }
dialog::backdrop { background: rgb(28 33 64 / .45); }
dialog > form, dialog > div { padding: 22px; }
dialog[open] { animation: rise .2s ease-out; }
@media (max-width: 560px) {
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
}
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }

/* Tabel */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 32px 10px; }

/* Toast */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px;
  transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--red); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
