/* ============================================================
   Kasir App — Design System v2 (Aesthetic Professional)
   Palette: pink-rose gradient, soft neutrals, generous spacing
   Motion: spring curves, staggered entrances, micro-interactions
   ============================================================ */

:root {
  /* Brand */
  --primary: #ec4899;
  --primary-dark: #db2777;
  --primary-light: #f472b6;
  --grad: linear-gradient(135deg, #f9a8d4 0%, #ec4899 45%, #db2777 100%);
  --grad-soft: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
  --grad-deep: linear-gradient(160deg, #ec4899 0%, #be185d 100%);

  /* Neutrals */
  --bg: #f8f6fb;
  --card: #ffffff;
  --text: #1f1524;
  --text-2: #4b3a52;
  --muted: #9b89a4;
  --line: #f0e8f2;
  --line-strong: #e6dbea;

  /* Semantic */
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  /* Depth */
  --shadow-sm: 0 1px 2px rgba(45, 20, 40, .04), 0 2px 8px rgba(45, 20, 40, .04);
  --shadow: 0 2px 4px rgba(45, 20, 40, .04), 0 8px 24px rgba(45, 20, 40, .06);
  --shadow-lg: 0 4px 8px rgba(45, 20, 40, .06), 0 16px 40px rgba(45, 20, 40, .12);
  --shadow-brand: 0 6px 16px rgba(236, 72, 153, .22), 0 16px 40px rgba(236, 72, 153, .16);

  /* Shape */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Layout */
  --nav-h: 68px;
  --sp: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  /* Motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur: .28s;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: contain;
  padding-top: env(safe-area-inset-top);
}

/* ===== Typography scale ===== */
h1, h2, h3, h4, h5, .h4, .h5 { line-height: 1.2; margin: 0 0 .4em; font-weight: 800; letter-spacing: -.02em; }
.t1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.t2 { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; } .fw-800 { font-weight: 800; }
.small { font-size: .82rem; }
.muted { color: var(--muted); }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.text-white { color: #fff; }
code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .78em; background: var(--grad-soft); padding: 2px 7px; border-radius: 8px; color: var(--primary-dark); }

/* ===== App bar ===== */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--grad);
  color: #fff;
  padding: 14px 18px;
  padding-top: calc(env(safe-area-inset-top) + 12px);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-brand);
}
.appbar .title { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; }
.appbar .sub { font-size: .74rem; opacity: .92; }
.appbar .spacer { flex: 1; }
.appbar .btn-circle {
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 50%;
  width: 38px; height: 38px;
  color: #fff;
  font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: transform var(--dur) var(--ease-spring), background .2s;
  backdrop-filter: blur(4px);
}
.appbar .btn-circle:hover { background: rgba(255, 255, 255, .3); }
.appbar .btn-circle:active { transform: scale(.9); }

/* ===== Content ===== */
.app-content {
  padding: var(--sp-6) var(--sp-4) calc(var(--nav-h) + var(--sp-8));
  max-width: 640px;
  margin: 0 auto;
}

/* ===== Card ===== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.card.hoverable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card.p-3 { padding: var(--sp-5); }
.card.p-4 { padding: var(--sp-6); }

/* ===== Segment label ===== */
.segment-label {
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ===== Stat cards ===== */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.stat-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--sp-5) var(--sp-3);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.stat-box:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-box .label {
  font-size: .66rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
}
.stat-box .val { font-size: 1.15rem; font-weight: 800; color: var(--primary-dark); margin-top: 4px; letter-spacing: -.01em; }
.stat-box .sub { font-size: .7rem; color: var(--muted); margin-top: 2px; }

/* ===== Menu grid (dashboard quick actions) ===== */
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.menu-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease-out), border-color .2s;
  display: flex; flex-direction: column;
}
.menu-item:hover { transform: translateY(-4px) scale(1.01); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.menu-item:active { transform: scale(.97); }
.menu-item .ico {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #fff;
  margin-bottom: var(--sp-3);
  background: var(--grad);
  box-shadow: var(--shadow-brand);
  transition: transform var(--dur) var(--ease-spring);
}
.menu-item:hover .ico { transform: rotate(-6deg) scale(1.08); }
.menu-item .t { font-weight: 700; font-size: .95rem; }
.menu-item .d { font-size: .76rem; color: var(--muted); margin-top: 3px; line-height: 1.45; }

/* ===== Bottom nav (pill indicator) ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 30;
  box-shadow: 0 -6px 24px rgba(45, 20, 40, .05);
}
.bottom-nav a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--muted);
  text-decoration: none;
  font-size: .68rem;
  gap: 3px;
  position: relative;
  font-weight: 600;
  transition: color .2s;
}
.bottom-nav a i {
  font-size: 1.32rem;
  transition: transform var(--dur) var(--ease-spring), color .2s;
}
.bottom-nav a.active { color: var(--primary-dark); font-weight: 700; }
.bottom-nav a.active i { transform: translateY(-2px) scale(1.12); }
.bottom-nav a:active i { transform: scale(.9); }
.bottom-nav a.active::before {
  content: '';
  position: absolute;
  top: 6px;
  width: 20px; height: 3.5px;
  border-radius: 999px;
  background: var(--grad);
  animation: pillIn .35s var(--ease-spring);
}

/* ===== List items ===== */
.list-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-3);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), border-color .2s;
  cursor: default;
}
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover { transform: translateX(4px); box-shadow: var(--shadow); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t2 { font-weight: 700; font-size: .92rem; }
.list-item .m2 { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.list-item .price { font-weight: 800; font-size: .95rem; color: var(--primary-dark); white-space: nowrap; }

/* ===== Segmented control ===== */
.seg {
  display: flex;
  background: var(--grad-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 4px;
  gap: 4px;
}
.seg button {
  flex: 1; border: 0; background: transparent;
  padding: 10px 6px;
  border-radius: var(--r-sm);
  font-size: .8rem; font-weight: 600; color: var(--muted);
  cursor: pointer;
  transition: all var(--dur) var(--ease-out);
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.seg button.active {
  background: #fff;
  color: var(--primary-dark);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.seg button:not(.active):hover { color: var(--text-2); }

/* ===== Buttons ===== */
.btn-full {
  display: block; width: 100%;
  background: var(--grad);
  color: #fff; border: 0;
  border-radius: var(--r-md);
  padding: 15px 18px;
  font-size: 1rem; font-weight: 800;
  text-decoration: none; text-align: center;
  box-shadow: var(--shadow-brand);
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease-out), opacity .2s;
  position: relative;
  overflow: hidden;
}
.btn-full::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.25) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform .6s var(--ease-out);
  pointer-events: none;
}
.btn-full:hover { box-shadow: var(--shadow-lg), 0 10px 30px rgba(236,72,153,.28); }
.btn-full:hover::after { transform: translateX(100%); }
.btn-full:active { transform: scale(.98) translateY(1px); }
.btn-full:disabled { opacity: .6; transform: none; }
.btn-full.secondary {
  background: #fff; color: var(--primary-dark);
  border: 1.5px solid var(--line-strong);
  box-shadow: none;
}
.btn-full.secondary:hover { border-color: var(--primary-light); background: var(--grad-soft); box-shadow: var(--shadow-sm); }
.btn-full.success { background: linear-gradient(135deg, #34d399, #10b981); box-shadow: 0 6px 16px rgba(16,185,129,.25); }
.btn-full.whatsapp { background: linear-gradient(135deg, #4ade80, #22c55e); box-shadow: 0 6px 16px rgba(34,197,94,.28); }

.btn-circle {
  background: var(--grad-soft);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 36px; height: 36px;
  color: var(--primary-dark);
  font-size: .95rem;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur) var(--ease-spring), background .2s, color .2s;
}
.btn-circle:hover { background: var(--primary); color: #fff; }
.btn-circle:active { transform: scale(.88); }

/* ===== Inputs ===== */
.form-input {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 14px 15px;
  font-size: 1rem;
  background: #fff;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  color: var(--text);
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), background .2s;
}
.form-input::placeholder { color: var(--muted); }
.form-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(244, 114, 182, .14);
  background: #fff;
}
.form-input:hover:not(:focus) { border-color: var(--primary-light); }
label.f-label {
  font-size: .8rem; font-weight: 600; color: var(--text-2);
  margin-bottom: 6px; display: block;
}

/* ===== Badges ===== */
.badge {
  display: inline-block; padding: 4px 11px; border-radius: 999px;
  font-size: .7rem; font-weight: 700;
  vertical-align: middle;
}
.badge.primary { background: var(--grad-soft); color: var(--primary-dark); }
.badge.success { background: #d1fae5; color: #059669; }
.badge.warning { background: #fef3c7; color: #b45309; }
.badge.danger { background: #fee2e2; color: #dc2626; }
.badge.info { background: #dbeafe; color: #2563eb; }

/* ===== Toast ===== */
.toast-msg {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 64px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px) scale(.96);
  z-index: 60;
  width: calc(100% - 40px);
  max-width: 400px;
  border-radius: var(--r-md);
  padding: 14px 18px;
  font-size: .88rem; font-weight: 700; color: #fff;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  animation: toastIn var(--dur) var(--ease-spring);
}
.toast-msg.success { background: linear-gradient(135deg, #34d399, #059669); }
.toast-msg.danger { background: linear-gradient(135deg, #f87171, #dc2626); }
.toast-msg.warning { background: linear-gradient(135deg, #fbbf24, #d97706); }

/* ===== Charts ===== */
.chart-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 6px;
  margin: 0 -4px;
  padding-left: 4px;
  padding-right: 4px;
}
.chart-scroll::-webkit-scrollbar { height: 6px; }
.chart-scroll::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 4px; }
.chart-bar { display: flex; align-items: flex-end; gap: 8px; height: 120px; min-width: 100%; }
.chart-col {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  height: 100%; justify-content: flex-end;
  min-width: 26px;
}
/* Periode dengan banyak data (24 jam / 30 hari): kolom tetap ukuran, kontainer scroll */
.chart-bar.dense .chart-col { flex: 0 0 34px; }
.chart-bar.dense { min-width: max-content; }
.bar {
  width: 100%; max-width: 30px;
  background: var(--grad);
  border-radius: 8px 8px 4px 4px;
  min-height: 3px;
  transition: height .5s var(--ease-out);
  transform-origin: bottom;
  animation: growUp .6s var(--ease-out);
}
.bar:hover { filter: brightness(1.1); }
.bar.empty { background: #ece4ef; }
.bar-lbl { font-size: .64rem; color: var(--muted); font-weight: 600; }
.bar-val { font-size: .6rem; font-weight: 700; color: var(--primary-dark); }

/* ===== Product grid (penjualan) ===== */
.produk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.produk-btn {
  background: #fff;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: 0;
  text-align: left;
  display: flex; flex-direction: column;
  min-width: 0; /* jangan sampai overflow horizontal */
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease-out), border-color .2s;
}
.produk-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary-light); }
.produk-btn:active { transform: scale(.97); }
.produk-btn.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(236, 72, 153, .1), var(--shadow); }
.produk-body { padding: var(--sp-3) var(--sp-4) 0; }
.produk-nama { font-weight: 700; font-size: .9rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.produk-meta { font-size: .72rem; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.produk-btn .tambah-bar {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
}
.produk-harga {
  font-weight: 800; font-size: .88rem; color: var(--primary-dark);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; flex: 1 1 auto; margin-right: auto;
}
.btn-tambah {
  border: 0; border-radius: 999px; padding: 9px 16px; font-size: .8rem; font-weight: 800;
  background: var(--grad); color: #fff; box-shadow: 0 4px 12px rgba(236, 72, 153, .3);
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  cursor: pointer; flex-shrink: 0;
  min-height: 40px;
  transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease-out);
}
.btn-tambah:hover { transform: translateY(-1px) scale(1.03); box-shadow: 0 6px 18px rgba(236,72,153,.4); }
.btn-tambah:active { transform: scale(.94); }

/* ===== Qty stepper ===== */
.qty-stepper {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--grad); border-radius: 999px; padding: 3px 6px; color: #fff;
  box-shadow: 0 4px 10px rgba(236, 72, 153, .3);
  animation: popIn .3s var(--ease-spring);
  flex-shrink: 0;
}
.qty-stepper button {
  width: 26px; height: 26px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .28); color: #fff; font-size: 1rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  transition: background .2s, transform var(--dur) var(--ease-spring);
}
.qty-stepper button:hover { background: rgba(255, 255, 255, .45); }
.qty-stepper button:active { transform: scale(.82); }
.qty-stepper span { min-width: 20px; text-align: center; font-weight: 800; font-size: .88rem; }

/* ===== Cart bar (floating) ===== */
.cart-bar {
  position: fixed; left: var(--sp-4); right: var(--sp-4);
  bottom: calc(var(--nav-h) + var(--sp-4));
  z-index: 28;
  max-width: 608px;
  margin: 0 auto;
  background: var(--grad);
  color: #fff;
  border-radius: var(--r-lg);
  box-shadow: 0 12px 30px rgba(219, 39, 119, .4);
  display: none; align-items: center; padding: 12px 16px; gap: 12px;
  animation: slideUp .35s var(--ease-spring);
}
.cart-bar .cart-ico {
  width: 36px; height: 36px; border-radius: 12px;
  background: rgba(255, 255, 255, .22);
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem; position: relative;
}
.cart-bar .cart-ico .cnt-badge {
  position: absolute; top: -7px; right: -7px;
  min-width: 19px; height: 19px; border-radius: 999px;
  background: #fff; color: var(--primary-dark); font-size: .68rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  animation: popIn .3s var(--ease-spring);
}
.cart-bar .cart-total { flex: 1; min-width: 0; line-height: 1.25; }
.cart-bar .cart-total .t1 { font-size: .72rem; opacity: .9; }
.cart-bar .cart-total .t2 { font-weight: 800; font-size: 1.02rem; }
.cart-bar .cart-open {
  border: 0; background: #fff; color: var(--primary-dark); font-weight: 800;
  border-radius: 999px; padding: 10px 18px; font-size: .84rem;
  cursor: pointer;
  transition: transform var(--dur) var(--ease-spring);
  white-space: nowrap;
}
.cart-bar .cart-open:hover { transform: scale(1.04); }
.cart-bar .cart-open:active { transform: scale(.95); }

/* ===== Bottom sheet ===== */
.sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(30, 15, 30, .45);
  z-index: 45;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .2s var(--ease-out);
  backdrop-filter: blur(3px);
}
.sheet-overlay.hidden { display: none !important; }
.sheet {
  background: #fff;
  width: 100%; max-width: 640px;
  border-radius: 26px 26px 0 0;
  max-height: 88vh;
  display: flex; flex-direction: column;
  animation: sheetUp .38s var(--ease-spring);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -12px 48px rgba(0, 0, 0, .14);
}
.sheet-head {
  display: flex; align-items: center; gap: 10px;
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.sheet-head .st { font-weight: 800; font-size: 1.06rem; flex: 1; letter-spacing: -.01em; }
.sheet-head .close {
  border: 0; background: var(--grad-soft); color: var(--primary-dark);
  width: 34px; height: 34px; border-radius: 50%; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform var(--dur) var(--ease-spring), background .2s;
}
.sheet-head .close:hover { background: var(--primary); color: #fff; }
.sheet-head .close:active { transform: scale(.85); }
.sheet-items { flex: 1; overflow-y: auto; padding: var(--sp-3) var(--sp-5); }
.sheet-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  animation: fadeSlideIn .35s var(--ease-out);
}
.sheet-item .grow { flex: 1; min-width: 0; }
.sheet-item .nm { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-item .pr { font-size: .74rem; color: var(--muted); }
.sheet-item .sub { font-weight: 800; font-size: .88rem; color: var(--primary-dark); min-width: 64px; text-align: right; }
.sheet-item .del {
  border: 0; background: transparent; color: var(--danger); font-size: 1.05rem; padding: 2px;
  cursor: pointer; transition: transform var(--dur) var(--ease-spring);
}
.sheet-item .del:hover { transform: scale(1.15); }
.sheet-item .del:active { transform: scale(.85); }
.sheet-foot {
  padding: var(--sp-4) var(--sp-5) calc(var(--sp-5) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
}
.sheet-foot .pay-label { font-size: .74rem; font-weight: 700; color: var(--text-2); margin-bottom: 7px; }
.sheet-total { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 4px; }
.sheet-total .lb { font-size: .82rem; color: var(--muted); }
.sheet-total .vl { font-weight: 800; font-size: 1.2rem; color: var(--text); letter-spacing: -.02em; }

/* ===== Checkout list ===== */
.checkout-list {
  background: var(--grad-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px; margin-bottom: var(--sp-4);
}
.checkout-list .cl-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .84rem; padding: 5px 0; color: var(--text);
}
.checkout-list .cl-row .cl-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.checkout-list .cl-row .cl-qty { color: var(--muted); margin: 0 8px; }
.checkout-list .cl-row .cl-sub { font-weight: 700; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(30, 15, 30, .5);
  z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .2s var(--ease-out);
  backdrop-filter: blur(3px);
}
.modal-overlay.hidden { display: none !important; }
.modal-sheet {
  background: #fff;
  width: 100%; max-width: 640px;
  border-radius: 24px 24px 0 0;
  max-height: 90vh; overflow-y: auto;
  padding: var(--sp-6);
  padding-bottom: calc(var(--sp-8) + env(safe-area-inset-bottom));
  animation: sheetUp .38s var(--ease-spring);
  box-shadow: 0 -12px 48px rgba(0,0,0,.14);
}

/* ===== Perlu beli (stok) ===== */
.stok-warn {
  border: 1px solid #fee2e2;
  border-left: 4px solid var(--danger);
  border-radius: var(--r-md);
  background: #fff;
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-sm);
}
.stok-warn .t { font-weight: 700; color: var(--danger); font-size: .9rem; }

/* ===== Laporan (tutup toko) ===== */
.laporan {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: .82rem; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  box-shadow: var(--shadow-sm);
}

/* ===== Spacing utilities ===== */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--sp-2); }
.mb-2 { margin-bottom: var(--sp-3); }
.mb-3 { margin-bottom: var(--sp-5); }
.mb-4 { margin-bottom: var(--sp-6); }
.mt-1 { margin-top: var(--sp-2); }
.mt-2 { margin-top: var(--sp-3); }
.mt-3 { margin-top: var(--sp-5); }
.me-1 { margin-right: var(--sp-2); }
.me-2 { margin-right: var(--sp-3); }
.p-3 { padding: var(--sp-5); }
.p-4 { padding: var(--sp-6); }
.py-2 { padding-top: var(--sp-3); padding-bottom: var(--sp-3); }
.py-3 { padding-top: var(--sp-5); padding-bottom: var(--sp-5); }
.px-3 { padding-left: var(--sp-5); padding-right: var(--sp-5); }
.gap-2 { gap: var(--sp-3); }
.gap-3 { gap: var(--sp-5); }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.w-100 { width: 100%; }
.grow { flex: 1; min-width: 0; }
.d-none { display: none !important; }

/* ===== Animations ===== */
@keyframes slideUp { from { transform: translateY(40px); opacity: .4; } to { transform: translateY(0); opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { 0% { transform: scale(.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes growUp { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(.96); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }
@keyframes pillIn { from { transform: scaleX(0); opacity: .4; } to { transform: scaleX(1); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(20px); } }

/* Homepage hero greeting */
.hero {
  background: var(--grad);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-brand);
  margin-bottom: var(--sp-6);
}
.hero::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}
.hero::before {
  content: '';
  position: absolute;
  bottom: -60px; right: 30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}
.hero .h1 { font-size: 1.5rem; font-weight: 800; position: relative; z-index: 1; }
.hero .sub { font-size: .84rem; opacity: .92; position: relative; z-index: 1; }
.hero .date { font-size: .72rem; opacity: .8; position: relative; z-index: 1; margin-top: 8px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }

/* Login */
.login-bg {
  background: var(--grad);
  background-size: 200% 200%;
  animation: gradShift 8s ease infinite;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.login-card {
  background: rgba(255, 255, 255, .97);
  border-radius: var(--r-xl);
  padding: var(--sp-8) var(--sp-6);
  width: 100%;
  max-width: 380px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
  animation: fadeSlideIn .5s var(--ease-out);
}
.login-card .logo {
  width: 68px; height: 68px; border-radius: 20px;
  background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin: 0 auto var(--sp-4);
  box-shadow: var(--shadow-brand);
  animation: popIn .6s var(--ease-spring);
}

/* Scrollbar (desktop) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d9c9de; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }
::-webkit-scrollbar-track { background: transparent; }

/* ===== Responsive mobile ===== */
@media (max-width: 359px) {
  .produk-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .stat-box { padding: 12px 6px; }
  .menu-grid { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .produk-btn .tambah-bar { padding: 10px 12px 12px; }
  .qty-stepper { padding: 3px 5px; gap: 6px; }
  .qty-stepper button { width: 24px; height: 24px; font-size: .9rem; }
  .bottom-nav a { font-size: .62rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}