/* VornixShop – sistem tampilan. Terang secara default, gelap mengikuti pengaturan perangkat. */
:root {
  --bg: #F2F3F7; --surface: #FFFFFF; --sunk: #E8EAF1; --ink: #15162B; --muted: #5B5D75; --line: #DFE1EB;
  --brand: #2D3CFF; --brand-press: #2230D6; --on-brand: #FFFFFF; --brand-soft: #E7E9FF; --brand-ink: #1B26B8;
  --hot: #FF6B1A; --hot-soft: #FFEBDD;
  --ok: #0B7A55; --ok-soft: #DDF5EA;
  --warn: #8A5300; --warn-soft: #FFEFD0;
  --bad: #B8223B; --bad-soft: #FFE3E8;
  --shadow: 0 1px 2px rgba(21, 22, 43, .06), 0 8px 24px -12px rgba(21, 22, 43, .18);
  --font-d: 'Bricolage Grotesque', 'Hanken Grotesk', system-ui, sans-serif;
  --font-b: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --top-h: 56px; --tab-h: 64px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D0E1B; --surface: #161730; --sunk: #1E2040; --ink: #EEEFF9; --muted: #A0A2BF; --line: #2A2C4E;
    --brand: #8791FF; --brand-press: #A0A8FF; --on-brand: #0D0E1B; --brand-soft: #23265A; --brand-ink: #B8BEFF;
    --hot-soft: #3A2417;
    --ok: #46D9A4; --ok-soft: #13342A;
    --warn: #F2B35A; --warn-soft: #382A12;
    --bad: #FF8097; --bad-soft: #3B1823;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); min-height: 100vh; min-height: 100dvh;
  font: 400 16px/1.5 var(--font-b); -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-d); margin: 0; letter-spacing: -0.015em; line-height: 1.15; }
h1 { font-size: clamp(26px, 5vw, 34px); font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
a { color: var(--brand); }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; word-break: break-all; font-size: 14px; }
.hide { display: none !important; }
.ic { flex: none; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------- tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 0 18px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; text-decoration: none;
  font: 600 15px/1 var(--font-b); background: var(--brand); color: var(--on-brand);
  transition: background .15s, transform .08s;
}
.btn:hover { background: var(--brand-press); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--sunk); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--line); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.block { display: flex; width: 100%; }
.btn:disabled, .btn[disabled] { background: var(--sunk); color: var(--muted); border-color: transparent; cursor: not-allowed; transform: none; }

/* ---------- form ---------- */
.field { display: block; margin-top: 16px; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.input {
  width: 100%; min-height: 46px; padding: 0 14px; font: 400 16px var(--font-b); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.input::placeholder { color: var(--muted); opacity: .8; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search { position: relative; width: 100%; }
@media (min-width: 560px) { .page-head .search { width: 320px; } }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 42px; }

/* ---------- panel, chip, segmented ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font: 600 13px/1.4 var(--font-b); background: var(--sunk); color: var(--muted); white-space: nowrap;
}
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.wait { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.brand { background: var(--brand-soft); color: var(--brand-ink); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--sunk); }
.seg button {
  min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  font: 600 14px var(--font-b); cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }

/* ---------- navigasi ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1080px; margin: 0 auto; padding: 0 16px; height: var(--top-h); display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 800 20px var(--font-d); letter-spacing: -0.02em; }
.brand img { width: 30px; height: 30px; display: block; }
.brand b { color: var(--brand); font-weight: 800; }
.nav-links { display: none; gap: 4px; flex: 1; height: 100%; }
.nav-links a { display: flex; align-items: center; padding: 0 14px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; position: relative; }
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"]::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px; background: var(--brand); border-radius: 3px 3px 0 0; }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { text-decoration: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); font: 700 15px var(--font-d); }
.who .out { display: none; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font: 600 11.5px var(--font-b);
}
.tabbar a[aria-current="page"] { color: var(--brand); }
.page { max-width: 1080px; margin: 0 auto; padding: 24px 16px calc(var(--tab-h) + 32px + env(safe-area-inset-bottom)); }
.page.narrow { max-width: 600px; }
.page.mid { max-width: 760px; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
@media (min-width: 760px) {
  .nav-links { display: flex; }
  .who .out { display: inline-flex; }
  .tabbar { display: none; }
  .page { padding-bottom: 64px; }
}

/* ---------- daftar baris ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.list > * + * { border-top: 1px solid var(--line); }
.list-link { display: flex; align-items: center; gap: 14px; padding: 16px 18px; color: inherit; text-decoration: none; }
.list-link:hover { background: var(--sunk); }
.list-link .t { font-weight: 600; }
.list-link .grow { flex: 1; min-width: 0; }
.tile { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); flex: none; }
.tile.hot { background: var(--hot-soft); color: var(--warn); }

/* ---------- login ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; }
.auth-side { background: var(--brand); color: var(--on-brand); padding: 28px 24px 32px; display: flex; flex-direction: column; gap: 28px; }
@media (prefers-color-scheme: dark) { .auth-side { background: #2330C9; color: #fff; } }
.auth-side .brand { color: inherit; }
.auth-side .brand b { color: #FFB27A; }
.auth-side h1 { font-size: clamp(30px, 6vw, 46px); max-width: 14ch; }
.auth-side p.lead { opacity: .88; max-width: 38ch; margin-top: 12px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: s; }
.steps li { display: flex; gap: 14px; align-items: center; counter-increment: s; font-weight: 600; }
.steps li::before {
  content: counter(s); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: rgba(255, 255, 255, .18); font: 700 14px var(--font-d);
}
.auth-main { padding: 28px 20px 40px; display: flex; align-items: flex-start; justify-content: center; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box .seg { display: flex; margin-bottom: 22px; }
.auth-box .seg button { flex: 1; }
@media (min-width: 900px) {
  .auth { grid-template-columns: 1.05fr 1fr; }
  .auth-side { padding: 48px 56px; justify-content: space-between; }
  .auth-main { align-items: center; padding: 48px; }
}

/* ---------- beranda ---------- */
.banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 20px; border-radius: 14px; background: var(--warn-soft); color: var(--warn); text-decoration: none; font-weight: 600; }
.banner .grow { flex: 1; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); }
.stats > div { padding: 16px 18px; min-width: 0; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats .v { font: 800 clamp(19px, 5vw, 30px)/1.1 var(--font-d); margin-top: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 200px; margin-top: 18px; padding-bottom: 26px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.bar-col { flex: 1; min-width: 34px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; position: relative; }
.bar { width: 100%; max-width: 44px; border-radius: 6px 6px 0 0; background: var(--brand); opacity: .35; min-height: 3px; transition: height .3s; }
.bar-col:last-child .bar { opacity: 1; }
.bar-val { font-size: 12px; font-weight: 600; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.bar-lbl { position: absolute; bottom: -24px; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- katalog ---------- */
.grid-p { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.p-card { display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.p-card .top { display: flex; align-items: center; justify-content: space-between; }
.p-card h3 { margin-bottom: 6px; }
.p-card .desc { color: var(--muted); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.p-card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.price { font: 800 24px var(--font-d); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.p-card.out { opacity: .6; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

.sheet-back { position: fixed; inset: 0; z-index: 60; background: rgba(13, 14, 27, .55); display: none; align-items: flex-end; justify-content: center; }
.sheet-back.open { display: flex; }
.sheet { width: 100%; max-width: 480px; max-height: 94dvh; overflow: auto; background: var(--surface); border-radius: 20px 20px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@media (min-width: 640px) { .sheet-back { align-items: center; padding: 20px; } .sheet { border-radius: 20px; } }
.sheet-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.iconbtn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: var(--sunk); color: var(--ink); border-radius: 50%; cursor: pointer; flex: none; }
.method { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-top: 16px; border: 1.5px solid var(--brand); background: var(--brand-soft); border-radius: 12px; }
.method .grow { flex: 1; }
.method strong { display: block; }
.sum { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); display: grid; gap: 6px; }
.sum .r { display: flex; justify-content: space-between; }
.sum .tot { font: 800 22px var(--font-d); margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }

/* ---------- struk / halaman pesanan ---------- */
.receipt-wrap { filter: drop-shadow(0 1px 0 var(--line)) drop-shadow(0 12px 18px rgba(21, 22, 43, .08)); margin-bottom: 14px; }
.receipt { position: relative; background: var(--surface); border-radius: 18px 18px 0 0; padding: 22px 20px 26px; }
.receipt::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px;
  background: radial-gradient(circle at 10px -1px, transparent 9px, var(--surface) 9.5px) 0 0 / 20px 10px repeat-x;
}
.rc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.rc-title { font: 700 22px var(--font-d); margin-bottom: 14px; }
.rc-rows { display: grid; gap: 6px; font-size: 15px; }
.rc-row { display: flex; align-items: baseline; gap: 8px; }
.rc-row .lead { flex: 1; border-bottom: 1px dotted var(--line); transform: translateY(-4px); }
.rc-row.total { font: 800 20px var(--font-d); margin-top: 6px; }
.qr-box { margin: 22px auto 14px; width: min(300px, 100%); padding: 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); position: relative; }
.qr-box img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.pay-line { text-align: center; }
.pay-line .amt { font: 800 30px var(--font-d); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.timer { margin-top: 18px; }
.timer .row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; }
.timer .row b { font: 700 18px var(--font-d); font-variant-numeric: tabular-nums; }
.track { height: 6px; border-radius: 6px; background: var(--sunk); overflow: hidden; }
.track i { display: block; height: 100%; background: var(--brand); border-radius: 6px; transition: width 1s linear; }
.track.low i { background: var(--hot); }
.actions { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; margin-top: 4px; }
.done { text-align: center; padding: 8px 0 22px; }
.done svg { width: 76px; height: 76px; margin: 0 auto 14px; display: block; }
.done circle { fill: var(--ok-soft); }
.done path { fill: none; stroke: var(--ok); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .15s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.delivery { padding: 18px; border-radius: 14px; background: var(--ok-soft); display: grid; gap: 10px; }
.delivery pre { margin: 0; white-space: pre-wrap; padding: 12px; background: var(--surface); border-radius: 10px; font: 14px/1.5 ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
.backlink { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.backlink:hover { color: var(--ink); }

/* ---------- pesanan ---------- */
.order { padding: 16px 18px; }
.order .row1 { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.order .meta { color: var(--muted); font-size: 14px; margin-top: 2px; }
.order .price-s { font: 700 18px var(--font-d); margin-top: 10px; font-variant-numeric: tabular-nums; }
.order .more { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; height: calc(100dvh - var(--top-h) - var(--tab-h) - 150px - env(safe-area-inset-bottom)); min-height: 340px; }
@media (min-width: 760px) { .chat { height: calc(100dvh - var(--top-h) - 190px); } }
.chat-box { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.bubble { max-width: 82%; padding: 9px 13px; border-radius: 16px; word-break: break-word; background: var(--sunk); }
.bubble.me { align-self: flex-end; background: var(--brand); color: var(--on-brand); border-bottom-right-radius: 5px; }
.bubble.them { align-self: flex-start; border-bottom-left-radius: 5px; }
.bubble .who-n { font-size: 12.5px; font-weight: 700; margin-bottom: 2px; color: var(--brand-ink); }
.bubble .tm { font-size: 11.5px; opacity: .65; text-align: right; margin-top: 2px; }
.composer { display: flex; gap: 10px; margin-top: 12px; }

/* ---------- profil ---------- */
.profile-head { display: flex; align-items: center; gap: 16px; }
.avatar.xl { width: 72px; height: 72px; font-size: 30px; }
.dl { margin: 22px 0 0; display: grid; gap: 14px; }
.dl dt { font-size: 13.5px; color: var(--muted); }
.dl dd { margin: 2px 0 0; font-weight: 600; }

/* ---------- toast ---------- */
#toasts { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(92vw, 420px); }
@media (min-width: 760px) { #toasts { bottom: 24px; } }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px; box-shadow: var(--shadow); animation: up .18s ease-out; }
.toast.err { background: var(--bad); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}
