/* Tema: ungu tua + pink muda. Mobile-first, responsif untuk semua perangkat. */
:root {
  --bg: #1a0a38;
  --bg-2: #24104a;
  --card: #2f1860;
  --card-2: #3b2078;
  --line: rgba(249, 168, 212, 0.18);
  --pink: #f9a8d4;
  --pink-2: #f472b6;
  --pink-soft: #fce7f3;
  --text: #fdf2f8;
  --muted: #c9b6ec;
  --ok: #86efac;
  --warn: #fcd34d;
  --err: #fda4af;
  --info: #a5b4fc;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(10, 2, 30, 0.45);
  --nav-h: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(244, 114, 182, 0.22), transparent 60%),
    radial-gradient(700px 500px at -10% 20%, rgba(124, 58, 237, 0.28), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--pink); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(26, 10, 56, 0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--pink-soft); }
.brand .logo { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--pink), #a855f7); color: #2a0f4d; font-size: 1.1rem; }
.top .spacer { flex: 1; }
.dnav { display: none; gap: 6px; }
.dnav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; }
.dnav a.on, .dnav a:hover { background: var(--card); color: var(--pink-soft); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: rgba(36, 16, 74, 0.94); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: .72rem; font-weight: 600; }
.bottom a .ic { font-size: 1.35rem; line-height: 1; }
.bottom a.on { color: var(--pink); }
@media (min-width: 820px) {
  .bottom { display: none; } .dnav { display: flex; } .wrap { padding-bottom: 48px; }
  h1 { font-size: 1.9rem; }
}

/* ---------- Komponen ---------- */
.card { background: linear-gradient(160deg, var(--card), var(--bg-2)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 22px 18px; margin-bottom: 16px; border: 1px solid var(--line);
  background: linear-gradient(135deg, #3b1488 0%, #5b21b6 50%, #9d3fb8 100%); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(249, 168, 212, .55), transparent 70%); }
.hero h1 { color: var(--pink-soft); position: relative; z-index: 1; }
.hero p { color: #f5d9ee; position: relative; z-index: 1; margin: 0; }
.notice { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; background: rgba(252, 211, 77, .12);
  border: 1px solid rgba(252, 211, 77, .35); color: #fde68a; }
.search { width: 100%; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  color: var(--muted); font-weight: 600; cursor: pointer; font: inherit; font-weight: 600; }
.chip.on { background: var(--pink); color: #2a0f4d; border-color: var(--pink); }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 820px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 18px 10px;
  border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(160deg, var(--card), var(--bg-2));
  color: var(--text); transition: transform .15s, border-color .15s; }
.tile:hover, .tile:active { transform: translateY(-3px); border-color: var(--pink); }
.tile .em { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; font-size: 2rem;
  background: linear-gradient(135deg, rgba(249, 168, 212, .25), rgba(168, 85, 247, .3)); overflow: hidden; }
.tile .em img { width: 100%; height: 100%; object-fit: cover; }
.tile .nm { font-weight: 700; font-size: .95rem; }
.tile .pr { font-size: .78rem; color: var(--muted); }
.tag { font-size: .68rem; padding: 2px 8px; border-radius: 999px; background: rgba(249, 168, 212, .15); color: var(--pink); font-weight: 700; }

/* ---------- Form ---------- */
label { display: block; font-weight: 600; margin: 12px 0 6px; font-size: .9rem; color: var(--pink-soft); }
input, select, textarea {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(10, 2, 30, .45);
  color: var(--text); font: inherit; font-size: 16px; /* 16px mencegah zoom otomatis di iOS */ outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(249, 168, 212, .2); }
input::placeholder { color: #8f78bd; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; min-width: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px 18px; border: 0;
  border-radius: 14px; font: inherit; font-weight: 800; cursor: pointer; color: #2a0f4d;
  background: linear-gradient(135deg, var(--pink-soft), var(--pink) 55%, var(--pink-2)); box-shadow: 0 8px 22px rgba(244, 114, 182, .35); }
.btn:active { transform: scale(.98); } .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--pink); border: 1px solid var(--pink); box-shadow: none; }
.btn.danger { background: linear-gradient(135deg, #fecdd3, #fb7185); }
.btn.sm { width: auto; padding: 8px 14px; font-size: .85rem; border-radius: 10px; }
.link { background: none; border: 0; color: var(--pink); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.err-msg { color: var(--err); font-size: .9rem; margin-top: 10px; min-height: 1.2em; }
.ok-msg { color: var(--ok); font-size: .9rem; margin-top: 10px; }

/* ---------- Pilih produk ---------- */
.pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .pgrid { grid-template-columns: repeat(3, 1fr); } }
.pbtn { text-align: left; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line); background: rgba(10, 2, 30, .35);
  color: var(--text); font: inherit; cursor: pointer; }
.pbtn .n { font-weight: 700; font-size: .92rem; } .pbtn .p { color: var(--pink); font-weight: 800; margin-top: 4px; }
.pbtn.on { border-color: var(--pink); background: rgba(249, 168, 212, .14); box-shadow: 0 0 0 2px rgba(249, 168, 212, .25); }
.step { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.step b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--pink); color: #2a0f4d; font-size: .85rem; }
.paybar { position: sticky; bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom)); z-index: 20; padding: 12px 14px;
  border-radius: 18px; background: rgba(36, 16, 74, .96); border: 1px solid var(--pink); box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px; }
.paybar .tot { flex: 1; min-width: 0; } .paybar .tot b { font-size: 1.15rem; color: var(--pink-soft); display: block; }
.paybar .btn { width: auto; flex: none; padding-inline: 22px; }
@media (min-width: 820px) { .paybar { bottom: 16px; } }

/* ---------- Pesanan ---------- */
.item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--line);
  border-radius: 14px; background: rgba(10, 2, 30, .3); margin-bottom: 10px; color: var(--text); }
.item .l { min-width: 0; } .item .t { font-weight: 700; } .item .r { text-align: right; flex: none; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.b-ok { background: rgba(134, 239, 172, .15); color: var(--ok); } .b-warn { background: rgba(252, 211, 77, .15); color: var(--warn); }
.b-err { background: rgba(253, 164, 175, .15); color: var(--err); } .b-info { background: rgba(165, 180, 252, .15); color: var(--info); }
.b-mut { background: rgba(201, 182, 236, .15); color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border: 0; } .kv span:first-child { color: var(--muted); } .kv span:last-child { text-align: right; font-weight: 600; word-break: break-all; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; padding: 5px; border-radius: 14px; background: rgba(10, 2, 30, .4); }
.tabs button { flex: 1; padding: 10px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.tabs button.on { background: var(--pink); color: #2a0f4d; }
.narrow { max-width: 440px; margin-inline: auto; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0;
  z-index: 60; padding: 12px 18px; border-radius: 12px; background: var(--pink-soft); color: #2a0f4d; font-weight: 700; max-width: 90vw; pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.spin { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--pink); border-radius: 50%; animation: sp .8s linear infinite; margin: 30px auto; }
@keyframes sp { to { transform: rotate(360deg); } }
.foot { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 24px; }

/* ---------- Admin ---------- */
.atabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.atabs::-webkit-scrollbar { display: none; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 820px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(160deg, var(--card), var(--bg-2)); }
.stat b { display: block; font-size: 1.25rem; color: var(--pink-soft); } .stat span { color: var(--muted); font-size: .8rem; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding-top: 8px; }
.bars div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; font-size: .7rem; color: var(--muted); }
.bars i { display: block; width: 100%; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--pink), #a855f7); min-height: 3px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; color: var(--muted); font-weight: 700; padding: 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; word-break: break-word; }
@media (max-width: 719px) { /* tabel berubah jadi kartu di layar kecil */
  .tbl thead { display: none; } .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 14px; background: rgba(10, 2, 30, .3); }
  .tbl td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .tbl td::before { content: attr(data-l); color: var(--muted); text-align: left; flex: none; }
}
.acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
dialog { width: min(520px, calc(100vw - 24px)); max-height: 90vh; overflow: auto; border: 1px solid var(--pink); border-radius: 20px;
  background: var(--bg-2); color: var(--text); padding: 18px; }
dialog::backdrop { background: rgba(10, 2, 30, .75); backdrop-filter: blur(3px); }
.chk { display: flex; align-items: center; gap: 10px; margin-top: 12px; } .chk input { width: 20px; height: 20px; }
.chk label { margin: 0; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
