@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=JetBrains+Mono:wght@400;600&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --y: #fdb906;
  --y-deep: #e8a200;
  --y-soft: #fff4cc;
  --y-pale: #fffbeb;
  --ink: #1d1a12;
  --ink-2: #4a4535;
  --muted: #8a836e;
  --line: #f1e6c2;
  --white: #ffffff;
  --ok: #18a058;
  --err: #d9373b;
  --get: #1a7f5a;
  --post: #b77900;
  --del: #c2342f;
  --radius: 18px;
  --shadow: 0 1px 0 #f3e7bf, 0 12px 32px -14px rgba(160, 118, 0, .28);
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  --display: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--y-pale);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.ic { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.18em; }
.ic-title { color: var(--y-deep); stroke-width: 2.2; }
.ic-big { width: 56px; height: 56px; color: var(--ok); }
.toast { display: inline-flex; align-items: center; gap: 8px; }
.url-bar button { display: inline-flex; align-items: center; gap: 6px; }
.nav-item .ic { color: var(--y-deep); }

/* ───────── shared bits ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 2px solid var(--ink); border-radius: 999px;
  padding: 10px 18px; font-weight: 700; cursor: pointer;
  background: var(--y); color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: var(--white); }
a.btn { text-decoration: none; }
.btn.sm { padding: 6px 12px; font-size: 13px; box-shadow: 2px 2px 0 var(--ink); }
.btn.danger { background: #ffe1e1; }

.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .field input, .field textarea, .field select {
  width: 100%; border: 2px solid var(--line); background: var(--white);
  border-radius: 12px; padding: 11px 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { font-family: var(--mono); font-size: 13px; min-height: 160px; resize: vertical; line-height: 1.55; }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--y); box-shadow: 0 0 0 4px var(--y-soft);
}

.method {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 6px; letter-spacing: .04em; color: #fff;
  min-width: 52px; text-align: center; display: inline-block;
}
.method.GET { background: var(--get); }
.method.POST { background: var(--post); }
.method.DELETE { background: var(--del); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: var(--y); padding: 10px 18px; border-radius: 999px;
  font-weight: 600; font-size: 14px; pointer-events: none; transition: .2s; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ───────── login ───────── */
.login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
}
.login-hero {
  position: relative; overflow: hidden; background: var(--y);
  padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-hero::before, .login-hero::after {
  content: ""; position: absolute; border-radius: 50%; background: var(--white); opacity: .22;
}
.login-hero::before { width: 520px; height: 520px; right: -180px; top: -160px; }
.login-hero::after { width: 300px; height: 300px; left: -100px; bottom: -120px; opacity: .16; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 800; font-size: 20px; position: relative; z-index: 1; }
.brand img { width: 44px; height: 44px; filter: var(--vol-sm); }
:root {
  /* efek volume: lapisan kuning tua bertumpuk (ekstrusi) + bayangan lembut */
  --vol-sm: drop-shadow(1px 1px 0 #e3a000) drop-shadow(1px 1px 0 #c98a00) drop-shadow(0 4px 4px rgba(120, 80, 0, .3));
  --vol-lg: drop-shadow(2px 2px 0 #f0ac00) drop-shadow(2px 2px 0 #e09d00) drop-shadow(2px 2px 0 #cf8f00)
            drop-shadow(2px 2px 0 #bd8100) drop-shadow(2px 2px 0 #a97300) drop-shadow(2px 2px 0 #946400)
            drop-shadow(0 36px 28px rgba(110, 70, 0, .38));
}
.hero-logo {
  position: relative; z-index: 1; align-self: center;
  width: min(380px, 78%); aspect-ratio: 1;
  display: grid; place-items: center; perspective: 900px;
}
.hero-logo::after { /* bayangan lantai */
  content: ""; position: absolute; bottom: 4%; left: 22%; right: 22%; height: 9%;
  background: radial-gradient(closest-side, rgba(110, 70, 0, .35), transparent);
  border-radius: 50%; animation: floor 4s ease-in-out infinite;
}
.hero-logo > img {
  width: 100%; filter: var(--vol-lg); transform-style: preserve-3d;
  animation: float 4s ease-in-out infinite;
}
/* stiker GIF animasi (Flaticon) yang melayang di sekitar logo */
.sticker {
  position: absolute; z-index: 2; width: 84px; aspect-ratio: 1; padding: 6px;
  background: var(--white); border: 2px solid var(--ink); border-radius: 20px;
  box-shadow: 4px 4px 0 var(--ink); rotate: var(--r, 0deg);
  animation: bob 3.6s ease-in-out infinite; animation-delay: var(--d, 0s);
  transition: scale .2s;
}
.sticker img { display: block; width: 100%; height: 100%; border-radius: 13px; }
.sticker:hover { scale: 1.12; }
.sticker.s1 { --r: -10deg; --d: 0s;    top: 4%;    left: -6%; }
.sticker.s2 { --r: 8deg;   --d: -.9s;  top: 0;     right: -4%; }
.sticker.s3 { --r: -6deg;  --d: -1.8s; bottom: 14%; left: -10%; width: 72px; }
.sticker.s4 { --r: 10deg;  --d: -2.7s; bottom: 8%; right: -8%; width: 92px; }
@keyframes bob { 50% { translate: 0 -10px; } }
@keyframes float {
  0%, 100% { transform: translateY(0) rotateX(8deg) rotateY(-14deg) rotate(-2deg); }
  50% { transform: translateY(-16px) rotateX(4deg) rotateY(-6deg) rotate(2deg); }
}
@keyframes floor { 50% { transform: scaleX(.8); opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .hero-logo > img, .hero-logo::after, .sticker, .mascot.pop { animation: none; } }
.hero-copy { position: relative; z-index: 1; }
.hero-copy h1 { font-family: var(--display); font-size: clamp(30px, 4vw, 48px); line-height: 1.02; margin: 0 0 12px; letter-spacing: -.02em; }
.hero-copy p { margin: 0; max-width: 42ch; color: var(--ink-2); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip { background: var(--white); border: 2px solid var(--ink); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; }

.login-panel { position: relative; display: grid; place-items: center; padding: 40px 24px 56px; background: var(--white); }
.login-card h2 { display: flex; align-items: center; gap: 10px; }
.mascot { width: 52px; height: 52px; flex: none; border-radius: 14px; }
.mascot.pop { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 0% { scale: .4; rotate: -12deg; opacity: 0; } 100% { scale: 1; rotate: 0deg; opacity: 1; } }
.credit { position: absolute; bottom: 16px; left: 0; right: 0; margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
.credit a { color: inherit; }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 18px; }
.login-card h2 { font-family: var(--display); font-size: 30px; line-height: 1.15; margin: 0 0 8px; letter-spacing: -.01em; }
.login-card .sub { margin: 0; line-height: 1.5; color: var(--muted); }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; padding: 6px; }
.login-err { background: #ffecec; color: var(--err); border-radius: 12px; padding: 10px 14px; font-size: 14px; font-weight: 600; }
.login-card .btn { width: 100%; padding: 13px; font-size: 16px; }
.auth-switch { margin: 0; text-align: center; font-size: 14px; color: var(--muted); }
.auth-switch a { color: var(--ink); font-weight: 700; text-decoration-color: var(--y); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.who { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 14px; background: var(--white); min-width: 0; }
.who > div { min-width: 0; flex: 1; }
.who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--y); border: 2px solid var(--ink); display: grid; place-items: center; font-family: var(--display); font-weight: 800; text-transform: uppercase; }
.role { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--y-soft); color: var(--ink-2); }
.role.admin { background: var(--ink); color: var(--y); }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td.act { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.tbl select { padding: 6px 10px; border: 2px solid var(--line); border-radius: 10px; background: var(--white); }
.mode-pick { display: grid; gap: 8px; }
.mode-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; }
.mode-opt:has(input:checked) { border-color: var(--ink); background: var(--y-pale); }
.mode-opt input { width: auto; flex: none; padding: 0; margin-top: 3px; accent-color: var(--ink); }
.mode-opt small { display: block; color: var(--muted); font-size: 12.5px; }
.new-token { display: grid; gap: 8px; margin-top: 4px; padding: 12px; border-radius: 14px; background: var(--y-soft); }
.tok-prefix { font-family: var(--mono); font-size: 12.5px; background: var(--y-soft); padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
.sm-input { padding: 6px 10px; min-width: 130px; width: 100%; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.hint code { font-family: var(--mono); background: var(--y-soft); padding: 1px 6px; border-radius: 6px; color: var(--ink); }

@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { padding: 28px 20px 32px; gap: 24px; }
  .hero-logo { width: 200px; }
  .sticker { width: 56px; padding: 4px; border-radius: 14px; box-shadow: 3px 3px 0 var(--ink); }
  .sticker img { border-radius: 9px; }
  .sticker.s3, .sticker.s4 { width: 52px; }
  .sticker.s1 { left: -24%; } .sticker.s2 { right: -22%; }
  .sticker.s3 { left: -28%; } .sticker.s4 { right: -26%; }
}

/* ───────── dashboard ───────── */
.app { display: grid; grid-template-columns: 290px 1fr; min-height: 100vh; }
.side {
  background: var(--white); border-right: 2px solid var(--line);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; padding: 20px 14px 28px;
  display: flex; flex-direction: column; gap: 18px;
}
.side .brand { font-size: 18px; padding: 0 6px; }
.side .brand img { width: 42px; height: 42px; }
.side .brand small { display: block; font-family: var(--sans); font-weight: 600; font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.side-search { margin: 0 4px; width: auto; }
.nav-group h4 { margin: 0 8px 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none;
  text-align: left; padding: 8px 10px; border-radius: 12px; cursor: pointer; font-size: 13.5px; font-weight: 500;
}
.nav-item .method { min-width: 46px; font-size: 10px; padding: 2px 6px; }
.nav-item:hover { background: var(--y-pale); }
.nav-item.active { background: var(--y-soft); font-weight: 700; box-shadow: inset 3px 0 0 var(--y); }
.side-foot { margin-top: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 0 4px; }

.main { min-width: 0; padding: 24px clamp(16px, 3vw, 36px) 60px; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 22px; }
.topbar h1 { font-family: var(--display); margin: 0; font-size: 28px; letter-spacing: -.01em; }
.topbar p { margin: 2px 0 0; color: var(--muted); }
.menu-btn { display: none; }
.side-close { display: none; margin-left: auto; width: 38px; height: 38px; place-items: center; border: 2px solid var(--ink); border-radius: 12px; background: var(--white); cursor: pointer; font-size: 18px; }
.side-backdrop { display: none; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--white); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
  border: 2px solid var(--line); position: relative; overflow: hidden;
}
.stat.hl { background: var(--y); border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.stat .k { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.stat .v { font-family: var(--display); font-size: 30px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--muted); margin-right: 6px; vertical-align: middle; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px rgba(24, 160, 88, .15); }
.dot.off { background: var(--err); }

.card { background: var(--white); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 2px dashed var(--line); }
.card-h h3 { margin: 0; font-family: var(--display); font-size: 18px; }
.card-b { padding: 18px 20px; }

.base-url { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.base-url code { font-family: var(--mono); background: var(--y-soft); padding: 6px 10px; border-radius: 10px; font-size: 13px; word-break: break-all; }

.endpoint-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.endpoint-head h2 { font-family: var(--display); margin: 0; font-size: 24px; }
.desc { color: var(--ink-2); margin: 8px 0 0; line-height: 1.6; }

.url-bar {
  display: flex; align-items: stretch; margin-top: 16px; border: 2px solid var(--ink);
  border-radius: 14px; overflow: hidden; background: var(--white); box-shadow: 3px 3px 0 var(--ink);
}
.url-bar .method { border-radius: 0; display: grid; place-items: center; min-width: 74px; font-size: 13px; }
.url-bar .path { flex: 1; min-width: 0; padding: 12px 14px; font-family: var(--mono); font-size: 13.5px; overflow-x: auto; white-space: nowrap; }
.url-bar .path .param { background: var(--y-soft); color: var(--post); border-radius: 5px; padding: 0 4px; }
.url-bar button { border: 0; border-left: 2px solid var(--ink); background: var(--y); font-weight: 700; padding: 0 16px; cursor: pointer; white-space: nowrap; }
.url-bar button:hover { background: var(--y-deep); }

.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.params { display: grid; gap: 12px; }
.params-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { border: 0; background: none; padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted); }
.tab.active { background: var(--ink); color: var(--y); }

.code {
  position: relative; background: #1d1a12; color: #f8f1dc; border-radius: 14px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
}
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; max-height: 460px; }
.code .copy {
  position: absolute; top: 10px; right: 10px; border: 1.5px solid #4a4535; background: #2b261a;
  color: var(--y); border-radius: 8px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.code .copy:hover { background: var(--y); color: var(--ink); }
.tok-k { color: #ffcf4d; }
.tok-s { color: #b7e28a; }
.tok-n { color: #ff9e64; }
.tok-c { color: #8a836e; }

.resp-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.badge { font-family: var(--mono); font-weight: 600; padding: 3px 9px; border-radius: 999px; font-size: 12px; }
.badge.ok { background: #dff5e8; color: var(--ok); }
.badge.err { background: #ffe5e5; color: var(--err); }
.empty { border: 2px dashed var(--line); border-radius: 14px; padding: 28px; text-align: center; color: var(--muted); font-size: 14px; }
.qr-box { display: grid; place-items: center; gap: 8px; margin-top: 14px; }
.qr-box img { width: 240px; max-width: 100%; border: 3px solid var(--ink); border-radius: 16px; padding: 8px; background: #fff; }
.pair { font-family: var(--mono); font-size: 26px; font-weight: 600; letter-spacing: .2em; background: var(--y); padding: 8px 16px; border-radius: 12px; border: 2px solid var(--ink); }

.inst-list { display: grid; gap: 10px; }
.inst { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; }
.inst b { font-family: var(--mono); }
.inst small { color: var(--muted); }

.mt { margin-top: 18px; }

/* ───────── ikon animasi (GIF Flaticon) di dashboard ───────── */
.gif { display: inline-block; flex: none; }
.topbar h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gif-title { width: 46px; height: 46px; mix-blend-mode: multiply; animation: pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.stat { padding-right: 76px; }
.gif-stat {
  position: absolute; right: 14px; top: 50%; translate: 0 -50%;
  width: 50px; height: 50px; padding: 3px; border-radius: 14px;
  background: var(--white); border: 2px solid var(--line);
  transition: rotate .2s, scale .2s;
}
.stat.hl .gif-stat { border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.stat:hover .gif-stat { rotate: -8deg; scale: 1.08; }
.empty.has-gif { display: grid; place-items: center; gap: 6px; line-height: 1.5; }
.gif-empty { width: 84px; height: 84px; mix-blend-mode: multiply; }
.empty.loading .gif-empty { width: 60px; height: 60px; }
.empty.err { color: var(--err); border-color: #f6caca; }
.gif-big { width: 120px; height: 120px; }
.new-token-h { display: flex; align-items: center; gap: 10px; }
.gif-inline { width: 44px; height: 44px; mix-blend-mode: multiply; }
@media (prefers-reduced-motion: reduce) { .gif-title { animation: none; } }
@media (max-width: 640px) {
  .stat { padding-right: 18px; }
  .stat .k { padding-right: 40px; min-height: 2.6em; }
  .gif-stat { top: 10px; right: 10px; translate: none; width: 38px; height: 38px; padding: 2px; border-radius: 11px; }
  .gif-title { width: 38px; height: 38px; }
}

@media (max-width: 1100px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 290px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 10px 0 40px rgba(0,0,0,.12); }
  .side { width: min(290px, 85vw); }
  .side.open { transform: translateX(0); }
  .side-close { display: grid; }
  .side-backdrop { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(29, 26, 18, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .side.open ~ .side-backdrop { opacity: 1; pointer-events: auto; }
  body:has(.side.open) { overflow: hidden; }
  .menu-btn { display: inline-flex; }
  .topbar h1 { font-size: 22px; }
}
