/* PINN STORE Console — desain "Aurora": gelap/terang, aksen violet→cyan, kartu bulat, tanpa border tebal. */
:root {
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --brand: #7c5cff; --brand-2: #22d3ee; --ok: #34d399; --warn: #fbbf24; --bad: #fb7185; --info: #60a5fa;
  --grad: linear-gradient(135deg, #7c5cff 0%, #5b8cff 55%, #22d3ee 100%);
  --r: 18px; --r-sm: 12px; --side: 268px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
:root[data-theme='dark'] {
  --bg: #0a0b14; --bg-2: #0f1120; --card: #141629; --card-2: #1a1d35; --hover: #1f2340;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14);
  --text: #eceeff; --mute: #8f94b8; --faint: #5d6285;
  --shadow: 0 10px 30px -12px rgba(0,0,0,.6); --glow: 0 0 0 1px rgba(124,92,255,.35), 0 12px 40px -12px rgba(124,92,255,.5);
  --tint-brand: rgba(124,92,255,.16); --tint-ok: rgba(52,211,153,.14); --tint-warn: rgba(251,191,36,.14); --tint-bad: rgba(251,113,133,.14); --tint-info: rgba(96,165,250,.14);
  --scrim: rgba(5,6,12,.7);
}
:root[data-theme='light'] {
  --bg: #f3f4fb; --bg-2: #eceef8; --card: #ffffff; --card-2: #f7f8fd; --hover: #eef0fb;
  --line: rgba(20,24,60,.09); --line-2: rgba(20,24,60,.16);
  --text: #11142b; --mute: #5b6186; --faint: #8d92b3;
  --shadow: 0 8px 24px -14px rgba(30,35,90,.28); --glow: 0 0 0 1px rgba(124,92,255,.35), 0 12px 32px -14px rgba(124,92,255,.45);
  --tint-brand: rgba(124,92,255,.10); --tint-ok: rgba(16,185,129,.12); --tint-warn: rgba(217,119,6,.12); --tint-bad: rgba(225,29,72,.10); --tint-info: rgba(37,99,235,.10);
  --scrim: rgba(15,17,40,.45);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(900px 420px at 85% -10%, rgba(124,92,255,.16), transparent 60%), radial-gradient(700px 380px at -5% 110%, rgba(34,211,238,.10), transparent 60%); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.i { width: 18px; height: 18px; flex: none; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.mute { color: var(--mute); } .faint { color: var(--faint); } .right { text-align: right; } .nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }

/* ---------- boot / login ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--mute); }
.boot-dot { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 30px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; background: var(--grad); display: grid; place-items: center; color: #fff; font-weight: 800; box-shadow: var(--glow); }
.brand b { font-size: 16px; letter-spacing: .2px; display: block; line-height: 1.1; } .brand small { color: var(--mute); font-size: 12px; }
.login h1 { font-size: 22px; margin: 26px 0 4px; } .login .sub { color: var(--mute); margin-bottom: 20px; }

/* ---------- shell ---------- */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 88%, transparent); backdrop-filter: blur(10px); display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.nav { display: grid; gap: 2px; }
.nav-h { margin: 14px 12px 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--mute); font-weight: 600; transition: background .15s, color .15s; }
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.on { background: var(--tint-brand); color: var(--text); box-shadow: inset 0 0 0 1px rgba(124,92,255,.35); }
.nav a.on .i { color: var(--brand); }
.nav .pill { margin-left: auto; font-size: 11px; padding: 1px 8px; border-radius: 99px; background: var(--tint-bad); color: var(--bad); font-weight: 700; }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 20px; font-weight: 800; letter-spacing: -.2px; } .top .crumb { color: var(--mute); font-size: 12.5px; }
.content { padding: 26px 28px 90px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; width: 100%; max-width: 1400px; margin: 0 auto; animation: fade .25s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.btn.burger { display: none; }
.tabbar { display: none; }

/* ---------- komponen ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.card-h h2 { font-size: 15px; font-weight: 700; } .card-h .sub { color: var(--mute); font-size: 12.5px; }
.grid { display: grid; gap: 16px; } .g-4 { grid-template-columns: repeat(4, 1fr); } .g-3 { grid-template-columns: repeat(3, 1fr); } .g-2 { grid-template-columns: repeat(2, 1fr); }
.g-main { grid-template-columns: 1.7fr 1fr; }
.stat { position: relative; overflow: hidden; padding: 18px 18px 16px; }
.stat .lbl { color: var(--mute); font-weight: 600; font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.stat .val { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin-top: 8px; line-height: 1.15; }
.stat .hint { margin-top: 6px; font-size: 12px; color: var(--mute); }
.stat .ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--tint-brand); color: var(--brand); margin-left: auto; }
.stat.ok .ic { background: var(--tint-ok); color: var(--ok); } .stat.warn .ic { background: var(--tint-warn); color: var(--warn); } .stat.info .ic { background: var(--tint-info); color: var(--info); } .stat.bad .ic { background: var(--tint-bad); color: var(--bad); }
.stat.hero { background: var(--grad); border: 0; color: #fff; box-shadow: var(--glow); }
.stat.hero .lbl, .stat.hero .hint { color: rgba(255,255,255,.82); } .stat.hero .ic { background: rgba(255,255,255,.22); color: #fff; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card-2); font-weight: 600; cursor: pointer; transition: transform .12s, background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; min-height: 38px; }
.btn:hover { background: var(--hover); } .btn:active { transform: translateY(1px); }
.btn.pri { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 22px -10px rgba(124,92,255,.8); } .btn.pri:hover { filter: brightness(1.08); }
.btn.bad { background: var(--tint-bad); color: var(--bad); border-color: transparent; } .btn.bad:hover { background: var(--bad); color: #fff; }
.btn.ok { background: var(--tint-ok); color: var(--ok); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--mute); } .btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.sm { padding: 6px 10px; min-height: 32px; font-size: 12.5px; border-radius: 10px; } .btn.ico { width: 38px; padding: 0; } .btn.sm.ico { width: 32px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--card-2); color: var(--mute); border: 1px solid var(--line); white-space: nowrap; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ok { background: var(--tint-ok); color: var(--ok); border-color: transparent; } .chip.warn { background: var(--tint-warn); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--tint-bad); color: var(--bad); border-color: transparent; } .chip.info { background: var(--tint-info); color: var(--info); border-color: transparent; } .chip.brand { background: var(--tint-brand); color: var(--brand); border-color: transparent; }
.chip.plain::before { display: none; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 240px; max-width: 380px; } .search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { padding-left: 38px; }
.input, .select, .textarea, .search input { width: 100%; background: var(--card-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 13px; min-height: 40px; transition: border-color .15s, box-shadow .15s; }
.search > input { padding-left: 40px; }
.textarea { min-height: 96px; resize: vertical; font-family: inherit; }
.input:focus, .select:focus, .textarea:focus, .search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--tint-brand); }
.select { width: auto; padding-right: 30px; }
.field { display: grid; gap: 6px; } .field label { font-weight: 600; font-size: 12.5px; color: var(--mute); } .field .hint { font-size: 12px; color: var(--faint); }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; font-weight: 600; color: var(--mute); cursor: pointer; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 0 var(--line), 0 4px 10px -6px rgba(0,0,0,.5); }
.content > *, .grid > * { min-width: 0; }
.switch { display: inline-block; vertical-align: middle; position: relative; width: 42px; height: 24px; flex: none; }
.switch input { appearance: none; -webkit-appearance: none; position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; border-radius: 99px; background: var(--line-2); cursor: pointer; transition: background .2s; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.switch input:checked { background: var(--ok); } .switch input:checked::after { transform: translateX(18px); }

/* tabel (menjadi kartu di HP) */
.tw { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table.t { width: 100%; border-collapse: collapse; min-width: 640px; }
.t th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
.t th.sort { cursor: pointer; } .t th.sort:hover { color: var(--text); }
.t td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tbody tr { transition: background .12s; } .t tbody tr:hover { background: var(--hover); } .t tbody tr:last-child td { border-bottom: 0; }
.t .ck { width: 34px; } .t .ck input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--brand); }
.cell-main { font-weight: 700; } .cell-sub { color: var(--mute); font-size: 12.5px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acts { display: flex; gap: 6px; justify-content: flex-end; }
.pager { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; margin-top: 14px; color: var(--mute); font-size: 12.5px; }
.pager .pp { display: flex; gap: 6px; align-items: center; }
.bulk { position: sticky; bottom: 78px; z-index: 15; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--brand); box-shadow: var(--glow); }
.empty { text-align: center; padding: 44px 16px; color: var(--mute); } .empty .i { width: 38px; height: 38px; margin-bottom: 10px; color: var(--faint); } .empty b { display: block; color: var(--text); margin-bottom: 4px; }
.sk { border-radius: 10px; background: linear-gradient(90deg, var(--card-2), var(--hover), var(--card-2)); background-size: 200% 100%; animation: sh 1.2s infinite; height: 16px; } @keyframes sh { to { background-position: -200% 0; } }

/* chart */
.chart { width: 100%; height: 240px; display: block; } .chart text { fill: var(--faint); font-size: 11px; font-family: var(--font); }
.chart .bar { fill: url(#gbar); transition: opacity .15s; } .chart .bar:hover { opacity: .75; }
.hbar { display: grid; gap: 14px; } .hbar .row { display: grid; gap: 6px; } .hbar .top-l { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.hbar .trk { height: 9px; border-radius: 99px; background: var(--card-2); overflow: hidden; } .hbar .fill { height: 100%; border-radius: 99px; background: var(--grad); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--mute); font-size: 12.5px; }

/* drawer / modal / toast */
#layer { position: relative; z-index: 100; }
.scrim { position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(3px); animation: fadeIn .18s; display: flex; justify-content: flex-end; }
@keyframes fadeIn { from { opacity: 0; } }
.drawer { width: min(520px, 100%); height: 100%; background: var(--card); border-left: 1px solid var(--line-2); display: flex; flex-direction: column; animation: slide .26s var(--ease); box-shadow: -20px 0 60px -20px rgba(0,0,0,.5); }
.drawer.wide { width: min(780px, 100%); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-h { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); } .drawer-h h2 { font-size: 17px; flex: 1; }
.drawer-b { padding: 22px; overflow-y: auto; display: grid; gap: 16px; align-content: start; flex: 1; }
.drawer-f { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.dialog-wrap { place-items: center; justify-content: center; align-items: center; padding: 16px; }
.dialog { width: min(440px, 100%); background: var(--card); border: 1px solid var(--line-2); border-radius: 22px; padding: 24px; display: grid; gap: 12px; box-shadow: var(--shadow); animation: pop .2s var(--ease); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.dialog .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--tint-bad); color: var(--bad); } .dialog.safe .ic { background: var(--tint-brand); color: var(--brand); }
.dialog h3 { font-size: 17px; } .dialog p { color: var(--mute); } .dialog .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 10px; }
.toast { min-width: 240px; max-width: 360px; padding: 12px 14px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); display: flex; gap: 10px; align-items: flex-start; animation: slide .25s var(--ease); font-weight: 600; }
.toast.ok .i { color: var(--ok); } .toast.bad .i { color: var(--bad); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; } .kv dt { color: var(--mute); } .kv dd { margin: 0; word-break: break-word; }
pre.code { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; overflow: auto; max-height: 260px; white-space: pre-wrap; word-break: break-all; }
.note { padding: 12px 14px; border-radius: 12px; background: var(--tint-warn); color: var(--warn); font-weight: 600; display: flex; gap: 10px; }

/* ---------- responsif ---------- */
@media (max-width: 1100px) { .g-4 { grid-template-columns: repeat(2, 1fr); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 60; transform: translateX(-102%); transition: transform .25s var(--ease); background: var(--bg-2); box-shadow: 20px 0 60px rgba(0,0,0,.5); }
  .side.open { transform: none; }
  .btn.burger { display: inline-flex; }
  .top { padding: 12px 16px; } .content { padding: 18px 16px 110px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg-2) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .tabbar a { display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border-radius: 12px; color: var(--mute); font-size: 11px; font-weight: 600; } .tabbar a.on { color: var(--brand); background: var(--tint-brand); }
  .g-3, .g-2 { grid-template-columns: 1fr; }
  .tw { margin: 0 -20px; padding: 0; overflow: visible; }
  table.t, .t tbody, .t tr, .t td { display: block; min-width: 0; width: 100%; } .t thead { display: none; }
  .t tbody tr { border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; margin: 0 20px 12px; background: var(--card-2); width: auto; }
  .t td { display: flex; justify-content: space-between; align-items: center; gap: 14px; border: 0; padding: 7px 0; text-align: right; }
  .t td::before { content: attr(data-label); color: var(--faint); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; text-align: left; flex: none; }
  .t td.ck, .t td[data-label=''] { justify-content: flex-end; } .t td.ck::before, .t td[data-label='']::before { display: none; }
  .t td .cell-sub { white-space: normal; max-width: 220px; text-align: right; }
  .t td .cv { min-width: 0; text-align: right; }
  .t td[data-label=''] .cv { width: 100%; }
  .bulk { bottom: 84px; } #toasts { left: 14px; right: 14px; bottom: 86px; } .toast { max-width: none; }
  .drawer { width: 100%; border-left: 0; } .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 8px; }
  .stat .val { font-size: 22px; }
}
@media (max-width: 520px) { .g-4 { grid-template-columns: 1fr 1fr; gap: 12px; } .card { padding: 16px; } .toolbar .btn.pri span { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
