/* DSkasir — desain v2 */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/dskasir/fonts/plus-jakarta-sans-latin.woff2) format("woff2");
}

:root {
  --bg: #f5f4f0;
  --bg-glow: #ffe6d8;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --soft: #f0eee9;
  --fg: #171923;
  --muted: #6b6e7b;
  --line: #ebe8e1;
  --line-strong: #dcd8cf;
  --brand: #ee6a32;
  --brand-2: #e2501b;
  --brand-grad: linear-gradient(135deg, #ff8a4c 0%, #ee6a32 45%, #dd4a17 100%);
  --brand-soft: #fff0e8;
  --brand-ink: #b8400f;
  --ok: #16a067;
  --ok-soft: #e4f6ee;
  --danger: #dc3b2b;
  --danger-soft: #fdebe8;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 24px;
  --shadow-sm: 0 1px 2px rgb(23 25 35 / 0.04), 0 2px 8px -2px rgb(23 25 35 / 0.06);
  --shadow: 0 2px 4px rgb(23 25 35 / 0.04), 0 12px 32px -12px rgb(23 25 35 / 0.18);
  --shadow-brand: 0 10px 28px -10px rgb(226 80 27 / 0.65);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111218;
    --bg-glow: #2a1a12;
    --surface: #1a1c24;
    --surface-2: #1f2129;
    --soft: #262833;
    --fg: #f3f2ef;
    --muted: #9ea1ae;
    --line: #2a2c37;
    --line-strong: #393c49;
    --brand: #ff7f47;
    --brand-2: #ff6a2b;
    --brand-soft: #36241b;
    --brand-ink: #ffb08a;
    --ok: #3ccf8e;
    --ok-soft: #173327;
    --danger: #ff6b5a;
    --danger-soft: #3a1d1a;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow: 0 12px 32px -12px rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(900px 420px at 100% -10%, var(--bg-glow), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--fg);
  font: 15px/1.5 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
h1 { font-size: 1.6rem; font-weight: 800; margin: 0; letter-spacing: -0.025em; }
h2 { font-size: 1.05rem; font-weight: 750; margin: 0; letter-spacing: -0.01em; }
a { color: var(--brand); font-weight: 600; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.right { text-align: right; }
svg { flex: none; }
.badge {
  display: inline-flex; align-items: center; margin-left: 6px; padding: 2px 9px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-ink); font-size: 0.72rem; font-weight: 700; vertical-align: middle;
}

/* ---------------------------------------------------------------- kerangka */
.app { display: flex; flex-direction: column; min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand img { width: 38px; height: 38px; border-radius: 12px; box-shadow: var(--shadow-brand); }
.brand-text { min-width: 0; }
.brand-text strong { display: block; font-size: 1rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-text span { display: block; font-size: 0.75rem; color: var(--muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { display: flex; align-items: center; gap: 8px; flex: none; }
.today-chip {
  display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15;
  padding: 5px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.today-chip span { font-size: 0.66rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.today-chip strong { font-size: 0.92rem; font-weight: 800; color: var(--ok); }
.net { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); font-size: 0; overflow: hidden; }
.net.off { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

main { flex: 1; padding: 16px 16px 120px; width: 100%; max-width: 1240px; margin: 0 auto; }
.view { animation: rise 0.28s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }

/* ---------------------------------------------------------------- kontrol */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 14px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-weight: 700; cursor: pointer; text-decoration: none; color: var(--fg);
  transition: background 0.15s, transform 0.12s var(--ease), box-shadow 0.15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--brand-grad); border: 0; color: #fff; box-shadow: var(--shadow-brand); }
.btn.primary:hover { filter: brightness(1.05); background: var(--brand-grad); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; filter: grayscale(0.3); }
.btn.block { width: 100%; }
.btn.danger-outline { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: transparent; }
.btn.danger-outline:hover { background: var(--danger-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.link { background: none; border: 0; padding: 6px 4px; cursor: pointer; font-weight: 700; color: var(--muted); font-size: 0.88rem; }
.link.danger { color: var(--danger); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }

.input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px;
  border: 1.5px solid var(--line-strong); background: var(--surface); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.input.sm { min-height: 40px; width: 132px; padding: 6px 12px; font-weight: 700; }
.input.lg { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; min-height: 60px; }
.field { display: block; }
.field > span { display: block; font-size: 0.82rem; font-weight: 700; margin-bottom: 6px; color: var(--muted); }
.field > span em { font-style: normal; font-weight: 500; }
.stack > * + * { margin-top: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.error { color: var(--danger); background: var(--danger-soft); padding: 9px 12px; border-radius: 12px; font-size: 0.88rem; font-weight: 600; margin: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row.total { font-size: 1.05rem; padding: 10px 0 12px; font-weight: 700; }
.row.total strong { font-size: 1.5rem; letter-spacing: -0.02em; }

.searchbar { margin-bottom: 12px; }
.searchbar input {
  width: 100%; min-height: 50px; padding: 10px 16px 10px 46px; border-radius: 16px;
  border: 1.5px solid var(--line); background: var(--surface) no-repeat 16px 50% / 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23898c99' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  box-shadow: var(--shadow-sm); outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.searchbar input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); font-weight: 700; font-size: 0.86rem; cursor: pointer; white-space: nowrap;
  color: var(--muted); transition: all 0.15s var(--ease);
}
.chip:hover { color: var(--fg); border-color: var(--line-strong); }
.chip.active { background: var(--fg); color: var(--bg); border-color: var(--fg); box-shadow: var(--shadow-sm); }

/* ---------------------------------------------------------------- kasir */
.pos { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.pos > * { min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.prod {
  position: relative; text-align: left; padding: 14px; min-height: 132px; border-radius: var(--r);
  border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 3px;
  transition: transform 0.15s var(--ease), box-shadow 0.15s, border-color 0.15s;
}
.prod:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.prod:active { transform: scale(0.96); }
.prod.in-cart { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent), var(--shadow-sm); }
.thumb {
  --h: 24;
  width: 42px; height: 42px; border-radius: 13px; margin-bottom: 8px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 0.95rem; letter-spacing: -0.02em;
  background: hsl(var(--h) 85% 93%); color: hsl(var(--h) 55% 32%);
}
@media (prefers-color-scheme: dark) { .thumb { background: hsl(var(--h) 35% 22%); color: hsl(var(--h) 80% 78%); } }
.prod .name { font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; font-size: 0.93rem; }
.prod .price { margin-top: auto; padding-top: 6px; font-weight: 800; font-size: 1rem; letter-spacing: -0.01em; }
.prod .stock { align-self: flex-start; font-size: 0.72rem; font-weight: 700; color: var(--muted); background: var(--soft); padding: 1px 8px; border-radius: 999px; }
.prod .stock.low { color: var(--danger); background: var(--danger-soft); }
.prod .qty-badge {
  position: absolute; top: 12px; right: 12px; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px;
  background: var(--brand-grad); color: #fff; font-size: 0.85rem; font-weight: 800; display: grid; place-items: center;
  box-shadow: var(--shadow-brand); animation: pop 0.25s var(--ease);
}
@keyframes pop { from { transform: scale(0.4); } to { transform: scale(1); } }
.prod:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.cart {
  display: none; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); max-height: calc(100dvh - 110px); box-shadow: var(--shadow);
}
.cart.open {
  display: flex; position: fixed; inset: auto 0 0 0; z-index: 40; max-height: 88dvh;
  border-radius: 28px 28px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom);
  animation: sheet 0.32s var(--ease);
}
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }
.sheet-handle { display: none; width: 44px; height: 5px; border-radius: 99px; background: var(--line-strong); margin: 10px auto 0; }
.cart.open .sheet-handle { display: block; }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 6px; }
.cart-items { list-style: none; margin: 0; padding: 0 20px; overflow-y: auto; flex: 1; }
.cart-items li { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-items li:last-child { border-bottom: 0; }
.cart-items .ci-name { font-weight: 700; overflow-wrap: anywhere; }
.cart-items .ci-sub { font-size: 0.84rem; color: var(--muted); align-self: center; }
.cart-items .ci-total { font-weight: 800; text-align: right; }
.qty { display: inline-flex; align-items: center; gap: 4px; background: var(--soft); border-radius: 12px; padding: 3px; }
.qty button {
  width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--surface);
  font-weight: 800; font-size: 1.05rem; cursor: pointer; box-shadow: var(--shadow-sm);
}
.qty button:active { transform: scale(0.92); }
.qty span { min-width: 28px; text-align: center; font-weight: 800; }
.cart-empty { padding: 34px 8px; text-align: center; color: var(--muted); }
.cart-foot { padding: 14px 20px 20px; border-top: 1px dashed var(--line-strong); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.cart.open .cart-foot { border-radius: 0; }
.cart-foot .row.small { margin-bottom: 2px; font-weight: 600; color: var(--muted); }
.cart-foot .btn.primary { min-height: 54px; font-size: 1.02rem; }
.backdrop { position: fixed; inset: 0; background: rgb(15 16 22 / 0.45); backdrop-filter: blur(3px); z-index: 35; animation: fadein 0.2s; }
@keyframes fadein { from { opacity: 0; } }

.cartbar {
  position: fixed; left: 14px; right: 14px; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 20;
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; border-radius: 20px; border: 0;
  background: var(--brand-grad); color: #fff; box-shadow: var(--shadow-brand), 0 18px 40px -16px rgb(0 0 0 / 0.35);
  cursor: pointer; text-align: left; animation: rise 0.25s var(--ease);
}
.cb-badge {
  position: relative; width: 46px; height: 46px; border-radius: 14px; background: rgb(255 255 255 / 0.18);
  display: grid; place-items: center;
}
.cb-badge svg, .cartbar-cta svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cb-badge span {
  position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: #fff; color: var(--brand-2); font-size: 0.75rem; font-weight: 800; display: grid; place-items: center;
}
.cb-text { display: flex; flex-direction: column; line-height: 1.2; }
.cb-text span { font-size: 0.75rem; opacity: 0.85; font-weight: 600; }
.cb-text strong { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; }
.cartbar-cta { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-weight: 800; font-size: 0.92rem; padding: 8px 6px 8px 14px; background: rgb(255 255 255 / 0.16); border-radius: 12px; }

/* ---------------------------------------------------------------- daftar */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.list li + li { border-top: 1px solid var(--line); }
.list button.item { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: none; border: 0; text-align: left; cursor: pointer; transition: background 0.12s; }
.list button.item:hover { background: var(--surface-2); }
.item .thumb { margin: 0; width: 44px; height: 44px; }
.item .grow { flex: 1; min-width: 0; }
.item .title { display: block; font-weight: 700; overflow-wrap: anywhere; }
.item .sub { display: block; font-size: 0.83rem; color: var(--muted); }
.item .amount { font-weight: 800; white-space: nowrap; }
.trx-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); flex: none; }
.trx-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.trx-ic.qris { background: hsl(260 80% 95%); color: hsl(260 55% 48%); }
.trx-ic.transfer { background: hsl(205 85% 93%); color: hsl(205 70% 38%); }
@media (prefers-color-scheme: dark) {
  .trx-ic.qris { background: hsl(260 30% 24%); color: hsl(260 80% 80%); }
  .trx-ic.transfer { background: hsl(205 35% 22%); color: hsl(205 80% 75%); }
}
.day-head { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 800; color: var(--muted); margin: 20px 6px 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.day-head:first-child { margin-top: 4px; }
.day-head span:last-child { color: var(--fg); }

.empty { text-align: center; padding: 36px 20px; color: var(--muted); border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.empty .art { width: 120px; height: 96px; margin: 0 auto 10px; display: block; }
.empty strong { color: var(--fg); font-size: 1.05rem; }
.empty .btn { margin-top: 14px; }

/* ---------------------------------------------------------------- laporan */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--soft); color: var(--muted); margin-bottom: 10px; }
.stat .ic svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stat .label { font-size: 0.78rem; color: var(--muted); font-weight: 700; }
.stat .value { font-size: 1.3rem; font-weight: 800; margin-top: 2px; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.stat.hero { grid-column: 1 / -1; background: var(--brand-grad); color: #fff; border: 0; box-shadow: var(--shadow-brand); }
.stat.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgb(255 255 255 / 0.12); }
.stat.hero .ic { background: rgb(255 255 255 / 0.2); color: #fff; }
.stat.hero .label { color: rgb(255 255 255 / 0.85); }
.stat.hero .value { font-size: 2rem; }
@media (min-width: 760px) { .stat.hero { grid-column: span 2; } }
.bars { display: grid; gap: 12px; }
.bar { display: grid; grid-template-columns: 84px minmax(0, 1fr) 8.6em; gap: 10px; align-items: center; font-size: 0.84rem; }
.bar > span:last-child { text-align: right; white-space: nowrap; font-weight: 700; }
.bar .track { height: 12px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--brand-grad); border-radius: 999px; }
.bar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.card > h2 + .bars, .card > h2 + .row { margin-top: 14px; }

/* ---------------------------------------------------------------- dialog */
dialog {
  width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: 28px;
  padding: 24px; background: var(--surface); color: var(--fg); box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.45);
}
dialog[open] { animation: dlg 0.28s var(--ease); }
@keyframes dlg { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
dialog::backdrop { background: rgb(15 16 22 / 0.5); backdrop-filter: blur(4px); }
dialog h2 { font-size: 1.2rem; font-weight: 800; }
@media (max-width: 600px) {
  dialog {
    width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 28px 28px 0 0;
    padding: 14px 20px calc(20px + env(safe-area-inset-bottom)); max-height: 92dvh;
  }
  dialog[open] { animation: sheet 0.32s var(--ease); }
  dialog > form::before, dialog > .stack::before {
    content: ""; display: block; width: 44px; height: 5px; border-radius: 99px; background: var(--line-strong); margin: 0 auto 14px;
  }
}

.pay-total {
  display: flex; flex-direction: column; gap: 2px; padding: 18px 20px; border-radius: 20px;
  background: var(--brand-grad); color: #fff; box-shadow: var(--shadow-brand); position: relative; overflow: hidden;
}
.pay-total::after { content: ""; position: absolute; right: -30px; bottom: -50px; width: 140px; height: 140px; border-radius: 50%; background: rgb(255 255 255 / 0.12); }
.pay-total .muted { color: rgb(255 255 255 / 0.85); font-weight: 700; font-size: 0.85rem; }
.pay-total strong { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
#pay-method { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px; background: var(--soft); border-radius: 16px; overflow: visible; }
#pay-method .chip { border: 0; background: transparent; border-radius: 12px; padding: 10px 0; text-align: center; }
#pay-method .chip.active { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
#pay-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; overflow: visible; }
#pay-quick .chip { border-radius: 12px; padding: 10px 4px; color: var(--fg); text-align: center; }
#pay-quick .chip:first-child { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; }
#cash-box .row { padding: 12px 16px; border-radius: 14px; background: var(--ok-soft); color: var(--ok); font-weight: 700; }
#cash-box .row strong { font-size: 1.25rem; font-weight: 800; }

/* sukses + struk */
.success { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 4px 0 2px; }
.success strong { font-size: 1.2rem; font-weight: 800; }
.success span:last-child { color: var(--muted); font-weight: 600; }
.check svg { width: 64px; height: 64px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.check circle { stroke: var(--ok); stroke-width: 3; fill: var(--ok-soft); stroke-dasharray: 152; stroke-dashoffset: 152; animation: draw 0.5s var(--ease) forwards; }
.check path { stroke: var(--ok); stroke-width: 4; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 0.35s 0.35s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.receipt-wrap { background: var(--soft); border-radius: 20px; padding: 16px; max-height: 52dvh; overflow: auto; }
.receipt {
  margin: 0 auto; background: #fff; color: #111; padding: 16px 14px; width: 100%; max-width: 300px;
  font: 12px/1.5 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  box-shadow: 0 6px 18px -8px rgb(0 0 0 / 0.25);
  -webkit-mask: radial-gradient(circle 5px at 50% 100%, transparent 98%, #000) 0 0 / 12px 100% repeat-x; /* tepi bergerigi */
          mask: radial-gradient(circle 5px at 50% 100%, transparent 98%, #000) 0 0 / 12px 100% repeat-x;
  padding-bottom: 22px;
}
.receipt .c { text-align: center; }
.receipt .b { font-weight: 700; }
.receipt .big { font-size: 15px; }
.receipt hr { border: 0; border-top: 1px dashed #999; margin: 8px 0; }
.receipt .r { display: flex; justify-content: space-between; gap: 8px; }
.receipt .r span:first-child { overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- navigasi */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 15;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; width: min(460px, calc(100vw - 24px));
  padding: 6px; border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border: 1px solid var(--line); box-shadow: 0 12px 36px -12px rgb(0 0 0 / 0.28);
}
.tabbar button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; border-radius: 18px;
  border: 0; background: none; color: var(--muted); font-size: 0.7rem; font-weight: 700; cursor: pointer;
  transition: color 0.15s, background 0.2s var(--ease);
}
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button.active { color: var(--brand-ink); background: var(--brand-soft); }
@media (prefers-color-scheme: dark) { .tabbar button.active { color: var(--brand); } }

/* ---------------------------------------------------------------- desktop */
@media (min-width: 900px) {
  .app { padding-left: 96px; }
  .tabbar {
    left: 16px; top: 16px; bottom: 16px; transform: none; width: 72px;
    grid-template-columns: 1fr; grid-auto-rows: 64px; align-content: center; gap: 8px; border-radius: 24px;
  }
  .tabbar button { font-size: 0.68rem; }
  main { padding-bottom: 40px; }
  .pos { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
  .cart { position: sticky; top: 90px; display: flex !important; }
  .cartbar { display: none !important; }
  .toast { bottom: 28px !important; top: auto !important; }
}

.toast {
  position: fixed; left: 50%; top: calc(76px + env(safe-area-inset-top)); transform: translate(-50%, -12px);
  background: var(--fg); color: var(--bg); padding: 11px 18px; border-radius: 14px; font-weight: 700; font-size: 0.88rem;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.25s var(--ease); z-index: 60;
  max-width: calc(100vw - 32px); box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

#print-area { display: none; }
@media print {
  @page { margin: 0; }
  body { background: #fff; }
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { display: block; position: absolute; left: 0; top: 0; }
  #print-area .receipt { max-width: none; padding: 4mm 3mm; box-shadow: none; -webkit-mask: none; mask: none; }
  #print-area.w58 .receipt { width: 58mm; }
  #print-area.w80 .receipt { width: 80mm; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* jarak chip di dalam dialog/kartu bertumpuk */
.stack > * + .chips { margin-top: 14px; margin-bottom: 0; }
/* ruang ekstra saat bar keranjang tampil (HP) */
@media (max-width: 899px) { body:has(#cartbar:not([hidden])) main { padding-bottom: 200px; } }

/* laporan: omzet besar + 3 statistik ringkas */
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat.hero { grid-column: 1 / -1; }
@media (max-width: 759px) {
  .stat:not(.hero) { padding: 12px; border-radius: 18px; }
  .stat:not(.hero) .ic { display: none; }
  .stat:not(.hero) .label { font-size: 0.7rem; line-height: 1.25; min-height: 2.5em; }
  .stat:not(.hero) .value { font-size: 0.95rem; letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
}
@media (min-width: 760px) {
  .stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .stat.hero { grid-column: span 2; }
}
