/* kredit-maliki: Template oleh Maliki Saputra (@malikisaputra) — https://malikisaputra.biz.id. Lisensi Nonkomersial Maliki Studio: wajib kredit, dilarang dijual (lihat LICENSE). */
:root {
  --tema-utama: #059669;
  --tema-aksen: #f59e0b;
  --tema-radius: 16px;
  --tema-font: "Plus Jakarta Sans", "DM Sans", system-ui, sans-serif;
  --tema-latar: #f8fafc;
  --tema-panel: #ffffff;
  --tema-nav: #ffffff;
  --tema-teks: #0f172a;
  --utama: var(--tema-utama, #059669);
  --aksen: var(--tema-aksen, #f59e0b);
  --latar: var(--tema-latar, #f8fafc);
  --kartu: var(--tema-panel, #ffffff);
  --teks: var(--tema-teks, #0f172a);
  --nav: var(--tema-nav, #ffffff);
  color-scheme: light;
}
[data-mode="gelap"], .dark {
  --latar: #020617;
  --kartu: #0f172a;
  --teks: #f8fafc;
  --nav: #0f172a;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
html, body { margin: 0; }
body {
  font-family: var(--tema-font, "Plus Jakarta Sans"), "DM Sans", system-ui, -apple-system, sans-serif;
  font-feature-settings: "tnum" 1;
}
[hidden] { display: none !important; }
svg:not(.logo):not(.ilus):not(.centang) {
  width: 19px;
  height: 19px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
code {
  background: rgba(148, 163, 184, 0.16);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
}

/* Navigasi aktif (desktop & mobile) */
.nav { color: #64748b; }
.dark .nav { color: #94a3b8; }
.nav:hover { background: rgba(148, 163, 184, 0.12); color: #0f172a; }
.dark .nav:hover { color: #f8fafc; }
.nav.aktif { background: #ecfdf5; color: #047857; }
.dark .nav.aktif { background: rgba(16, 185, 129, 0.18); color: #34d399; }

.bawah { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
.bawah .nav {
  flex: 1;
  flex-direction: column;
  gap: 3px;
  padding: 6px 2px;
  font-size: 11px;
  min-height: 52px;
}

/* Halaman */
.hal { display: none; }
.hal.aktif { display: block; animation: naik .22s ease; }
#hal-kasir.aktif { display: flex; flex-direction: column; }

/* PIN login */
.pin-titik i {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 54px;
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  transition: transform .18s, background-color .18s, border-color .18s, box-shadow .18s;
}
.pin-titik i::after {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #059669;
  opacity: 0;
  transform: scale(0.3);
  transition: transform .16s cubic-bezier(.34, 1.56, .64, 1), opacity .14s ease;
}
.dark .pin-titik i {
  border-color: #334155;
  background: rgba(15, 23, 42, 0.75);
}
.pin-titik i.aktif {
  border-color: #059669;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.14);
}
.dark .pin-titik i.aktif {
  border-color: #34d399;
  background: #0f172a;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
}
.pin-titik i.isi {
  border-color: #059669;
  background: #ecfdf5;
}
.pin-titik i.isi::after {
  opacity: 1;
  transform: scale(1);
}
.dark .pin-titik i.isi {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.16);
}
.dark .pin-titik i.isi::after { background: #34d399; }
.pin-titik.salah { animation: goyang .32s; }
.pin-titik.salah i {
  border-color: #ef4444;
  background: #fef2f2;
  box-shadow: none;
}
.pin-titik.salah i::after { background: #ef4444; }
.dark .pin-titik.salah i {
  border-color: #f87171;
  background: rgba(239, 68, 68, 0.18);
}
@keyframes goyang { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
@keyframes naik { from { opacity: 0; } }
@keyframes denyut { 40% { transform: scale(1.06); } }

/* Thumbnail & foto produk */
.thumb {
  position: relative;
  overflow: hidden;
  background: #f1f5f9;
}
.dark .thumb { background: #1e293b; }
.ilus { display: block; width: 100%; height: 100%; }
.bump { animation: denyut .32s ease; }
.foto-produk { display: block; width: 100%; height: 100%; object-fit: cover; }
.logo-img { object-fit: contain; border-radius: 22%; flex: none; }
.logo-inisial {
  display: grid; place-items: center; flex: none;
  border-radius: 22%; background: #059669; color: #fff; font-weight: 800; font-size: 14px;
}

/* Segmen laporan & daftar terlaris */
.segmen button { color: #64748b; }
.dark .segmen button { color: #94a3b8; }
.segmen button.aktif { background: #059669; color: #fff; }

/* Custom non-native dropdown */
.dd.buka .dd-chev { transform: rotate(180deg); }
.dd-opt {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  color: #334155;
  white-space: nowrap;
  transition: background-color .14s, color .14s;
}
.dark .dd-opt { color: #e2e8f0; }
.dd-opt:hover { background: #f1f5f9; color: #0f172a; }
.dark .dd-opt:hover { background: #1e293b; color: #ffffff; }
.dd-opt.aktif { background: #ecfdf5; color: #047857; font-weight: 700; }
.dark .dd-opt.aktif { background: rgba(16, 185, 129, 0.18); color: #34d399; }
.dd-opt.aktif::after { content: "✓"; font-size: 11px; font-weight: 800; }

.terlaris { counter-reset: n; }
.terlaris li {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.28);
  counter-increment: n;
}
.terlaris li:last-child { border-bottom: 0; }
.terlaris li::before {
  content: counter(n);
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 11px;
}
.dark .terlaris li::before { background: rgba(16, 185, 129, 0.18); color: #34d399; }
.terlaris li:first-child::before { background: #f59e0b; color: #111827; }

/* Grafik batang */
.grafik .batang {
  width: 100%;
  background: #059669;
  border-radius: 6px 6px 2px 2px;
  min-height: 3px;
  transform-origin: bottom;
  animation: tumbuh .5s ease both;
}
.grafik .kol:hover .batang { background: #f59e0b; }
.grafik .batang.nol { background: rgba(148, 163, 184, 0.25); }
@keyframes tumbuh { from { transform: scaleY(0); } }

/* Dialog & centang sukses */
dialog::backdrop { background: rgba(2, 6, 23, 0.55); backdrop-filter: blur(4px); }
dialog:has(.bayar) { width: min(460px, calc(100% - 24px)); }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button { display: none; }

.centang { width: 68px; height: 68px; }
.centang circle {
  fill: rgba(16, 185, 129, 0.12);
  stroke: #059669;
  stroke-width: 2.5;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: gambar .5s ease forwards;
}
.centang path {
  fill: none;
  stroke: #059669;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: gambar .35s .35s ease forwards;
}
@keyframes gambar { to { stroke-dashoffset: 0; } }

/* Toast */
.toast { transform: translate(-50%, 120px); transition: transform .3s ease; }
.toast.tampil { transform: translate(-50%, 0); }

/* Mobile 2-langkah kasir (< 1024px): Pilih Menu -> Detail & Pembayaran */
@media (max-width: 1023px) {
  .pos .keranjang { display: none; }
  .pos.tahap-bayar .pos-kiri { display: none; }
  .pos.tahap-bayar .keranjang { display: flex; }
}
@media (max-width: 767px) {
  .pos-kiri, .pos.tahap-bayar .keranjang, #hal-produk, #hal-riwayat, #hal-laporan, #hal-atur { padding-bottom: 88px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .centang circle, .centang path { stroke-dashoffset: 0; }
}

/* Customizer helper */
[data-sorot] { outline: 2px dashed #f43f5e !important; outline-offset: -2px; }
.label-sorot {
  position: fixed; z-index: 9999; pointer-events: none;
  background: #f43f5e; color: #fff; font: 700 11px/1 system-ui, sans-serif;
  padding: 4px 7px; border-radius: 6px; white-space: nowrap;
}

/* Struk thermal 58mm */
.struk { display: none; }
.proto-card { animation: naik .22s ease; }
@media print {
  @page { size: 58mm auto; margin: 0; }
  body { background: #fff !important; color: #000 !important; }
  body > *:not(.struk) { display: none !important; }
  #protoOverlay { display: none !important; }
  .struk { display: block; width: 58mm; padding: 3mm 2.5mm; font: 11px/1.35 "Courier New", monospace; color: #000; }
  .struk .tengah { text-align: center; }
  .struk .gr { border-top: 1px dashed #000; margin: 4px 0; }
  .struk .br { display: flex; justify-content: space-between; gap: 4px; }
  .struk b { font-weight: 700; }
  .struk h4 { margin: 0; font-size: 13px; }
  .struk .struk-logo { display: block; width: 22mm; height: auto; margin: 0 auto 2mm; }
}
