/* =========================================================
   Starcafe POS — gaya dasar
   Tema: hijau tua + krem (mengikuti referensi desain).
   Ganti nilai di :root untuk mengganti tema seluruh aplikasi.
   ========================================================= */
:root {
  --ink: #1D2B22;          /* teks utama */
  --primary: #0F5C2E;      /* tombol utama, kartu aktif */
  --primary-dark: #0A4522;
  --accent: #7FB08A;       /* aksen / garis aktif */
  --accent-soft: #E3EFE3;  /* latar lembut (thumbnail, chip aktif) */
  --bg: #F3F1E3;           /* latar halaman krem */
  --white: #FFFFFF;
  --line: #DCE3D6;
  --line-strong: #B9CDB9;  /* garis tepi kartu menu */
  --muted: #6E7C71;
  --success: #1E7B3A;
  --success-soft: #E3F2E6;
  --danger: #D93A3A;
  --danger-soft: #FDECEC;
  --alert: #F26D6D;        /* label "perlu restock" */

  --r-sm: 12px;
  --r: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --shadow: 0 1px 2px rgba(15, 60, 30, .04), 0 6px 18px rgba(15, 60, 30, .05);
  --shadow-lg: 0 14px 40px rgba(15, 60, 30, .18);
  --tap: 48px;
  --font: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 18px; height: 18px; }

/* ---------- Tombol ---------- */
.btn {
  min-height: var(--tap);
  padding: 0 18px;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: var(--white);
  font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: var(--white); box-shadow: 0 4px 12px rgba(111, 78, 55, .25); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-ghost { background: var(--white); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--accent-soft); }
.btn-soft { background: var(--accent-soft); color: var(--ink); }
.btn-success { background: var(--success); color: var(--white); }
.btn-danger { background: var(--white); color: var(--danger); border-color: #EBC5C5; }
.btn-danger.solid { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn-lg { min-height: 58px; font-size: 17px; border-radius: var(--r-lg); }
.btn-block { width: 100%; }
.btn-icon { width: var(--tap); padding: 0; }
.badge {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--primary); color: var(--white); font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.badge.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(200, 162, 124, .35); } }

/* ---------- Input ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  min-height: var(--tap);
  width: 100%;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--white);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { padding: 12px 14px; min-height: 80px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200, 162, 124, .25); }
.search { position: relative; flex: 1; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 44px; }

/* Segmented control & chips */
.seg { display: inline-flex; background: var(--bg); border-radius: var(--r); padding: 4px; gap: 4px; }
.seg button {
  border: 0; background: transparent; min-height: 40px; padding: 0 14px; border-radius: 10px; font-weight: 600; color: var(--muted);
}
.seg button.on { background: var(--white); color: var(--ink); box-shadow: var(--shadow); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: var(--tap); padding: 0 16px; border-radius: var(--r);
  border: 1.5px solid var(--line); background: var(--white); font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip small { color: var(--muted); font-weight: 600; }
.chip.on { border-color: var(--primary); background: var(--accent-soft); color: var(--ink); }
.chip.on small { color: var(--primary); }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; min-height: 40px; }
.switch input { display: none; }
.switch i {
  width: 44px; height: 26px; border-radius: 13px; background: var(--line); position: relative; transition: background .15s; flex: none;
}
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--white); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s;
}
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(18px); }

.card { background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }

/* ---------- Layout aplikasi: header atas ---------- */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 16px 24px 10px; flex: none;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--primary); }
.brand .mark { width: 44px; height: 44px; border-radius: 14px; background: var(--primary); color: var(--white); display: grid; place-items: center; }
.brand .mark svg { width: 26px; height: 26px; }
.brand b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.02em; line-height: 1; text-transform: uppercase; }
.brand small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .7; margin-top: 3px; }
.today { color: var(--primary); font-weight: 700; font-size: 16px; margin-left: 18px; white-space: nowrap; }
.topbar .grow { flex: 1; }
.nav { display: flex; gap: 6px; background: var(--white); padding: 5px; border-radius: 999px; box-shadow: var(--shadow); }
.nav a {
  min-height: 42px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px;
  text-decoration: none; color: var(--muted); font-weight: 700; font-size: 14px; position: relative; white-space: nowrap;
}
.nav a:hover { color: var(--ink); }
.nav a.on { background: var(--primary); color: var(--white); }
.nav a .badge { background: var(--alert); min-width: 20px; height: 20px; font-size: 11px; }
.orders-total { color: var(--muted); font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.orders-total b { color: var(--ink); }
.pill-btn {
  min-height: 52px; padding: 0 20px; border-radius: 999px; border: 0; background: var(--white); box-shadow: var(--shadow);
  display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15.5px; text-decoration: none; color: var(--ink); position: relative;
}
.pill-btn.on { outline: 2px solid var(--primary); }
.pill-btn.round { width: 52px; padding: 0; justify-content: center; }
.pill-btn .dot-badge {
  position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; border-radius: 11px; padding: 0 6px;
  background: var(--danger); color: var(--white); font-size: 12px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg);
}
.avatar-btn { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--primary); padding: 3px; background: var(--white); }
.avatar-btn span { width: 100%; height: 100%; border-radius: 50%; background: var(--accent-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; }
.dropdown {
  position: fixed; z-index: 60; background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 8px; width: 240px; animation: pop .15s ease;
}
.dropdown .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dropdown .who b { display: block; }
.dropdown a, .dropdown button {
  width: 100%; min-height: 46px; border: 0; background: transparent; border-radius: 12px; display: flex; align-items: center; gap: 10px;
  padding: 0 12px; font-weight: 600; text-decoration: none; color: var(--ink); text-align: left;
}
.dropdown a:hover, .dropdown button:hover { background: var(--bg); }
.dropdown .net { padding: 8px 12px 4px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dropdown .net i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.dropdown .net.off i { background: var(--alert); }

.main { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.page { flex: 1; overflow: auto; padding: 14px 24px 24px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; flex: 1; }

/* ---------- Halaman kasir ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; height: 100%; padding: 8px 24px 0; }
.pos-menu { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.pos-top { display: flex; gap: 10px; align-items: center; }
.searchbar { position: relative; flex: 1; }
.searchbar svg { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--ink); width: 22px; height: 22px; }
.searchbar input {
  width: 100%; min-height: 56px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--white);
  padding: 0 64px 0 54px; font-size: 16px; font-weight: 600; outline: none;
}
.searchbar input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(15, 92, 46, .1); }
.searchbar kbd { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--primary); font: 700 14px var(--font); border: 1.5px solid var(--line-strong); border-radius: 8px; padding: 2px 8px; }

/* Kartu kategori besar */
.cats { display: flex; gap: 14px; margin: 16px 0; overflow-x: auto; padding: 2px; scrollbar-width: none; flex: none; }
.cats::-webkit-scrollbar { display: none; }
.cat-card {
  flex: 1 0 190px; min-height: 132px; border-radius: var(--r-xl); border: 0; background: var(--white); text-align: left; padding: 16px 18px;
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow);
  transition: transform .1s ease;
}
.cat-card:active { transform: scale(.98); }
.cat-card .status {
  align-self: flex-start; height: 30px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--ink); font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; position: relative; z-index: 1;
}
.cat-card .status.alert { background: var(--alert); border-color: var(--alert); color: var(--white); }
.cat-card h3 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; position: relative; z-index: 1; margin-top: 10px; }
.cat-card small { font-size: 14px; color: var(--muted); font-weight: 600; position: relative; z-index: 1; }
.cat-card .art { position: absolute; right: -14px; bottom: -22px; width: 130px; height: 130px; color: var(--ink); opacity: .07; transform: rotate(-12deg); }
.cat-card .art svg { width: 100%; height: 100%; stroke-width: 1.4; }
.cat-card.on { background: var(--primary); color: var(--white); }
.cat-card.on .status { border-color: rgba(255, 255, 255, .8); }
.cat-card.on .status.alert { border-color: var(--alert); }
.cat-card.on small { color: rgba(255, 255, 255, .85); }
.cat-card.on .art { color: var(--white); opacity: .22; }

/* Grid menu */
.menu-grid {
  flex: 1; overflow-y: auto; display: grid; gap: 16px; padding: 2px 4px 24px 2px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); align-content: start;
}
.menu-card {
  border: 1.5px solid var(--line-strong); background: var(--white); border-radius: var(--r-xl);
  padding: 14px 14px 16px; text-align: left; display: flex; flex-direction: column; gap: 4px; position: relative;
  transition: transform .1s ease, border-color .15s ease, box-shadow .15s ease;
}
.menu-card:hover { border-color: var(--primary); }
.menu-card:active { transform: scale(.98); }
.menu-card.in-cart { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.menu-card.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(.95); } 100% { transform: scale(1); } }
.thumb {
  height: 128px; border-radius: 18px; display: grid; place-items: center; font-size: 62px; overflow: hidden; margin-bottom: 8px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; }
.menu-card .name { font-weight: 800; font-size: 16.5px; line-height: 1.25; padding-right: 58px; min-height: 42px; display: flex; align-items: flex-end; }
.menu-card .price { font-weight: 600; font-size: 16px; color: var(--muted); padding-right: 58px; }
.menu-card .plus {
  position: absolute; right: 14px; bottom: 14px; width: 54px; height: 54px; border-radius: 50%; border: 1.5px solid var(--primary);
  color: var(--primary); display: grid; place-items: center; background: var(--white); transition: background .15s, color .15s;
}
.menu-card .plus svg { width: 26px; height: 26px; }
.menu-card.in-cart .plus { background: var(--primary); color: var(--white); }
.menu-card .dot {
  position: absolute; top: 12px; right: 12px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 15px; background: var(--accent-soft);
  color: var(--primary); display: grid; place-items: center; font-size: 14px; font-weight: 800;
}
.menu-card.sold { opacity: .6; }
.menu-card.sold .thumb { filter: grayscale(1); }
.menu-card.sold .plus { border-color: var(--line-strong); color: var(--muted); }
.ribbon {
  position: absolute; top: 14px; left: 14px; background: var(--alert); color: var(--white);
  font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
}

/* Panel struk / keranjang */
.cart {
  background: var(--white); border-radius: var(--r-xl) var(--r-xl) 0 0; display: flex; flex-direction: column; min-height: 0;
  box-shadow: var(--shadow);
}
.cart-head { padding: 18px 20px 12px; display: flex; flex-direction: column; gap: 12px; }
.receipt-title { display: flex; align-items: center; gap: 12px; }
.receipt-title .circle { width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; background: var(--white); color: var(--ink); flex: none; }
.receipt-title .circle:disabled { opacity: .4; }
.receipt-title h2 { flex: 1; text-align: right; font-size: 18px; line-height: 1.3; }
.receipt-title h2 small { display: block; font-size: 18px; }
.type-toggle { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--line-strong); border-radius: 999px; padding: 0; overflow: hidden; }
.type-toggle button { min-height: 52px; border: 0; background: transparent; font-weight: 700; color: var(--muted); border-radius: 999px; font-size: 15px; }
.type-toggle button.on { background: var(--primary); color: var(--white); }
.cust-fields { display: grid; grid-template-columns: 1fr 110px; gap: 10px; }
.cust-fields label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.cust-fields input { min-height: 50px; border-radius: 999px; border: 1.5px solid var(--line-strong); padding: 0 18px; font-weight: 700; font-size: 15px; outline: none; color: var(--ink); width: 100%; }
.cust-fields input:focus { border-color: var(--primary); }
.cart-label { font-size: 13px; font-weight: 600; color: var(--muted); padding: 2px 20px 8px; }
.cart-lines { flex: 1; overflow-y: auto; margin: 0 20px; border: 1.5px solid var(--line-strong); border-radius: var(--r-xl); padding: 4px 12px; }
.cart-lines.is-empty { border-style: dashed; display: grid; place-items: center; }
.line { padding: 12px 0; border-bottom: 1px solid var(--line); animation: slideIn .25s ease; display: flex; gap: 12px; }
.line:last-child { border-bottom: 0; }
@keyframes slideIn { from { opacity: 0; transform: translateX(12px); } }
.line-thumb { width: 64px; height: 64px; border-radius: 16px; background: var(--bg); display: grid; place-items: center; font-size: 32px; overflow: hidden; flex: none; }
.line-thumb img { width: 100%; height: 100%; object-fit: cover; }
.line-body { flex: 1; min-width: 0; }
.line-top { display: flex; gap: 8px; align-items: baseline; }
.line-main { flex: 1; min-width: 0; }
.line-name { font-weight: 800; font-size: 16px; }
.line-opts { font-size: 13px; color: var(--muted); margin-top: 2px; }
.line-opts b { color: var(--ink); font-weight: 700; }
.line-note { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.line-note svg { width: 16px; height: 16px; }
.line-price { font-weight: 800; white-space: nowrap; }
.line-ctrl { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.qty { display: inline-flex; align-items: center; background: var(--bg); border-radius: 999px; }
.qty button { width: 40px; height: 40px; border: 0; background: transparent; display: grid; place-items: center; border-radius: 50%; }
.qty button:active { background: var(--accent-soft); }
.qty span { min-width: 26px; text-align: center; font-weight: 800; }
.line-ctrl .sp { flex: 1; }
.icon-btn { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 12px; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn.del:hover { background: var(--danger-soft); color: var(--danger); }
.cart-foot { padding: 14px 20px 18px; display: flex; flex-direction: column; gap: 10px; }
.cart-foot h4 { font-size: 16px; }
.adjust { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 13.5px; font-weight: 600; }
.adjust .btn { min-height: 40px; padding: 0 14px; font-size: 13.5px; border-radius: 999px; }
.sum { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 14px; }
.sum dt { color: var(--muted); }
.sum dd { margin: 0; text-align: right; font-weight: 600; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed var(--line-strong); padding-top: 10px; }
.total-row span { font-weight: 700; }
.total-row strong { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.cart-actions { display: flex; gap: 8px; }
.cart-actions .btn { border-radius: 999px; }
.cart-actions .btn-primary { flex: 1; }

/* Empty state */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ill { width: 92px; height: 92px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; color: var(--accent); }
.empty .ill svg { width: 44px; height: 44px; stroke-width: 1.6; }
.empty b { color: var(--ink); font-size: 16px; }

/* ---------- Modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(40, 25, 20, .45); display: grid; place-items: center; z-index: 50;
  padding: 20px; animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--white); border-radius: 22px; box-shadow: var(--shadow-lg); width: min(560px, 100%); overflow: auto;
  max-height: calc(100dvh - 40px); display: flex; flex-direction: column; animation: pop .18s ease;
}
.modal.wide { width: min(880px, 100%); }
.modal.narrow { width: min(420px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head { padding: 20px 22px 8px; display: flex; align-items: center; gap: 10px; }
.modal-head h3 { flex: 1; font-size: 19px; }
.modal-body { padding: 10px 22px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { padding: 14px 22px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.modal-foot .grow { flex: 1; }
.opt-group h4 { font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }

/* Toast */
.toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--ink); color: var(--white); padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-lg);
  font-weight: 600; display: flex; align-items: center; gap: 10px; animation: toastIn .25s ease; font-size: 14.5px;
}
.toast.ok svg { color: #9ED3A1; }
.toast.err { background: var(--danger); }
.toast.out { opacity: 0; transform: translateY(-8px); transition: all .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } }

/* Numpad */
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.numpad button {
  min-height: 56px; border-radius: var(--r); border: 1px solid var(--line); background: var(--white);
  font-size: 20px; font-weight: 700;
}
.numpad button:active { background: var(--accent-soft); }
.numpad button.fn { font-size: 15px; color: var(--muted); }

/* ---------- Pembayaran ---------- */
.pay { display: grid; grid-template-columns: 300px 1fr; min-height: 470px; }
.pay-left { background: var(--bg); padding: 22px; border-radius: 22px 0 0 22px; display: flex; flex-direction: column; gap: 14px; }
.pay-left .big { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.methods { display: flex; flex-direction: column; gap: 8px; }
.method {
  min-height: 56px; border-radius: var(--r); border: 1.5px solid transparent; background: var(--white); text-align: left;
  padding: 0 16px; display: flex; align-items: center; gap: 12px; font-weight: 700;
}
.method.on { border-color: var(--primary); box-shadow: var(--shadow); }
.method svg { color: var(--primary); }
.pay-right { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.pay-right h3 { font-size: 18px; }
.amount-box { background: var(--bg); border-radius: var(--r); padding: 12px 16px; }
.amount-box small { color: var(--muted); font-weight: 600; }
.amount-box div { font-size: 30px; font-weight: 800; }
.change { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-radius: var(--r); background: var(--success-soft); color: var(--success); font-weight: 700; }
.change strong { font-size: 24px; }
.change.short { background: var(--accent-soft); color: var(--primary); }
.qris-box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px; }
.qris-box img { width: 250px; height: auto; max-height: 330px; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.qris-ph { width: 230px; height: 230px; border-radius: 12px; border: 2px dashed var(--line); display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 13px; padding: 16px; }

/* ---------- Struk ---------- */
.receipt {
  width: 300px; margin: 0 auto; background: var(--white); padding: 18px 16px; border: 1px solid var(--line); border-radius: 6px;
  font-family: "Courier New", ui-monospace, monospace; font-size: 12.5px; color: #111; line-height: 1.45;
}
.receipt .c { text-align: center; }
.receipt .b { font-weight: 700; }
.receipt .lg { font-size: 16px; }
.receipt .hr { border-top: 1px dashed #555; margin: 6px 0; }
.receipt .r { display: flex; justify-content: space-between; gap: 8px; }
.receipt .sub { padding-left: 10px; font-size: 11.5px; }
.receipt .void-stamp { border: 2px solid #111; text-align: center; font-weight: 700; padding: 4px; margin: 6px 0; }
#print-area { display: none; }

@media print {
  @page { size: 58mm auto; margin: 0; }
  body { background: #fff; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; }
  #print-area .receipt { width: 48mm; border: 0; padding: 2mm 0; margin: 0 auto; font-size: 9pt; }
}

/* ---------- Barista ---------- */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.col { background: rgba(255, 255, 255, .5); border-radius: var(--r-lg); padding: 12px; min-height: 300px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; font-weight: 800; }
.col-head .badge { background: var(--ink); }
.col-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.ticket { background: var(--white); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; animation: slideIn .25s ease; }
.ticket-top { display: flex; align-items: center; gap: 8px; }
.ticket-top .q { font-size: 22px; font-weight: 800; }
.ticket-top .who { flex: 1; font-weight: 600; }
.ticket-top .age { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.ticket-top .age.late { color: var(--primary); }
.ticket ul { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ticket li b { font-size: 15px; }
.ticket li .o { display: block; font-size: 12.5px; color: var(--muted); }
.ticket li .n { display: block; font-size: 12.5px; color: var(--primary); font-style: italic; }
.ticket.done { opacity: .7; box-shadow: none; border: 1px solid var(--line); }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--accent-soft); color: var(--primary); }
.tag.ok { background: var(--success-soft); color: var(--success); }
.tag.void { background: var(--danger-soft); color: var(--danger); }
.tag.dark { background: var(--ink); color: var(--white); }

/* ---------- Tabel & laporan ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; }
.kpi small { color: var(--muted); font-weight: 600; font-size: 13px; }
.kpi div { font-size: 24px; font-weight: 800; margin-top: 4px; letter-spacing: -.01em; }
.kpi em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.card h3 { font-size: 16px; margin-bottom: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--bg); }
.tbl tr.voided td { color: var(--muted); text-decoration: line-through; }
.tbl tr.voided td.keep { text-decoration: none; }
.bar-row { display: grid; grid-template-columns: 92px 1fr auto; gap: 10px; align-items: center; margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.bar { height: 12px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.chart svg { width: 100%; height: 220px; display: block; }
.chart text { font-size: 11px; fill: var(--muted); font-family: var(--font); }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.mini-thumb { width: 52px; height: 52px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; font-size: 26px; overflow: hidden; flex: none; }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.settings .card { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(820px, 100%); display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.login-brand { background: var(--ink); color: var(--bg); padding: 36px; display: flex; flex-direction: column; gap: 14px; }
.login-brand .logo { width: 64px; height: 64px; border-radius: 20px; background: var(--accent); display: grid; place-items: center; color: var(--ink); }
.login-brand .logo svg { width: 38px; height: 38px; }
.login-brand h1 { font-size: 32px; color: var(--white); }
.login-brand p { margin: 0; color: #CDB8A3; line-height: 1.6; }
.login-brand .hint { margin-top: auto; background: rgba(255, 255, 255, .07); border-radius: var(--r); padding: 14px; font-size: 13px; line-height: 1.7; }
.login-brand .hint a { color: var(--accent); }
.login-form { padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.users { display: flex; flex-direction: column; gap: 8px; }
.user-btn {
  min-height: 60px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--white); padding: 0 14px;
  display: flex; align-items: center; gap: 12px; text-align: left;
}
.user-btn.on { border-color: var(--primary); background: var(--accent-soft); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--ink); display: grid; place-items: center; font-weight: 800; flex: none; }
.user-btn b { display: block; }
.user-btn small { color: var(--muted); }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 6px 0; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent); }
.pin-dots i.f { background: var(--primary); border-color: var(--primary); }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }

/* ---------- Halaman pelanggan (pesan di meja) ---------- */
.cust { max-width: 560px; margin: 0 auto; min-height: 100dvh; padding-bottom: 110px; background: var(--bg); }
.cust-head { background: var(--ink); color: var(--white); padding: 22px 18px 18px; border-radius: 0 0 24px 24px; }
.cust-head .row { display: flex; align-items: center; gap: 12px; }
.cust-head .logo { width: 46px; height: 46px; border-radius: 14px; background: var(--accent); display: grid; place-items: center; color: var(--ink); }
.cust-head h1 { font-size: 21px; }
.cust-head p { margin: 2px 0 0; color: #CDB8A3; font-size: 13px; }
.cust-head .table-pill { margin-left: auto; background: var(--accent); color: var(--ink); font-weight: 800; padding: 8px 14px; border-radius: 999px; }
.cust .tabs { padding: 0 16px; }
.cust-list { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.cust-item { background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 10px; display: flex; gap: 12px; align-items: center; border: 0; text-align: left; width: 100%; }
.cust-item .mini-thumb { width: 72px; height: 72px; font-size: 34px; }
.cust-item .info { flex: 1; min-width: 0; }
.cust-item .info b { display: block; }
.cust-item .info small { color: var(--muted); display: block; margin: 2px 0 4px; font-size: 12.5px; }
.cust-item .add { width: 40px; height: 40px; border-radius: 12px; background: var(--primary); color: var(--white); display: grid; place-items: center; flex: none; }
.cust-item:disabled { opacity: .5; }
.cust-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; width: min(528px, calc(100% - 32px)); z-index: 20; }
.cust-bar .btn { width: 100%; justify-content: space-between; padding: 0 20px; }
.status-card { margin: 18px 16px; padding: 22px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.steps { display: flex; flex-direction: column; gap: 0; text-align: left; width: 100%; margin-top: 6px; }
.step { display: flex; gap: 12px; align-items: flex-start; padding-bottom: 14px; position: relative; color: var(--muted); }
.step::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step i { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: var(--white); flex: none; display: grid; place-items: center; }
.step.done { color: var(--ink); }
.step.done i { background: var(--success); border-color: var(--success); color: var(--white); }
.step.now { color: var(--ink); font-weight: 700; }
.step.now i { border-color: var(--primary); background: var(--accent-soft); }

/* ---------- Responsif ---------- */
@media (max-width: 1280px) {
  .today { display: none; }
  .pos { grid-template-columns: minmax(0, 1fr) 370px; gap: 16px; padding: 6px 18px 0; }
  .topbar { padding: 14px 18px 8px; }
  .page { padding: 12px 18px 20px; }
  .menu-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
  .thumb { height: 110px; }
}
@media (max-width: 1100px) {
  .orders-total { display: none; }
  .nav a span { display: none; }
  .pos { grid-template-columns: minmax(0, 1fr) 340px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .brand small, .pill-btn .lbl { display: none; }
  .pos { grid-template-columns: 1fr; grid-template-rows: 1fr auto; padding: 4px 12px 0; }
  .cart { max-height: 55dvh; }
  .grid-2, .settings, .board, .login-card, .pay { grid-template-columns: 1fr; }
  .pay-left { border-radius: 22px 22px 0 0; }
  .login-brand .hint { margin-top: 10px; }
}

/* Panel struk lebih padat agar daftar pesanan lega di tablet 800px */
.cart-head { padding: 16px 18px 10px; gap: 10px; }
.receipt-title .circle { width: 44px; height: 44px; }
.receipt-title h2 { font-size: 17px; }
.receipt-title h2 small { display: inline; font-size: 17px; margin-left: 6px; }
.type-toggle button { min-height: 46px; }
.cust-fields input { min-height: 46px; }
.cust-fields label { gap: 4px; }
.cart-label { padding: 0 18px 6px; }
.cart-lines { margin: 0 18px; }
.cart-foot { padding: 12px 18px 16px; gap: 8px; }
.adjust { flex-wrap: nowrap; justify-content: space-between; gap: 8px; }
.adjust .switch { gap: 6px; font-size: 13px; white-space: nowrap; }
.adjust .switch i { width: 38px; height: 22px; }
.adjust .switch i::after { width: 16px; height: 16px; }
.adjust .switch input:checked + i::after { transform: translateX(16px); }
.sum { font-size: 13.5px; gap: 2px 10px; }
.total-row { padding-top: 8px; }
.total-row strong { font-size: 26px; }
.cart-actions .btn-lg { min-height: 56px; }
.line-ctrl .line-note { border: 0; background: transparent; padding: 0; margin: 0; min-height: 40px; min-width: 0; max-width: 150px; text-align: left; }
.line-ctrl .line-note span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-ctrl .line-note:hover { color: var(--primary); }
.line-ctrl .icon-btn { width: 40px; height: 40px; }
.line { padding: 10px 0; gap: 10px; }
.line-thumb { width: 56px; height: 56px; border-radius: 14px; font-size: 28px; }
.line-ctrl { margin-top: 2px; }
.qty button { width: 36px; height: 36px; }
.line-ctrl .line-note, .line-ctrl .icon-btn { min-height: 36px; height: 36px; }

/* Foto menu berlatar putih: tampil utuh (contain), bukan dipotong */
.thumb { background: var(--white); }
.thumb img { object-fit: contain; border-radius: 0; }
.line-thumb, .mini-thumb { background: var(--white); border: 1px solid var(--line); }
.line-thumb img, .mini-thumb img { object-fit: contain; }

/* Layar sempit (HP / jendela kecil): kasir jadi satu kolom yang di-scroll */
@media (max-width: 900px) {
  .pos { display: block; overflow-y: auto; height: 100%; padding: 4px 12px 16px; }
  .pos-menu { overflow: visible; }
  .menu-grid { overflow: visible; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .cart { max-height: none; margin-top: 8px; border-radius: var(--r-xl); }
  .cart-lines { max-height: 50vh; min-height: 120px; }
  .cat-card { flex: 0 0 170px; }
  .topbar { gap: 8px; flex-wrap: wrap; }
}

/* Daftar pesanan tidak boleh mengecil sampai hilang; panel struk bisa di-scroll di layar pendek */
.cart { overflow-y: auto; }
.cart-lines { min-height: 150px; flex-shrink: 0; flex-grow: 1; }

/* Tab kategori pill (halaman pelanggan, kelola menu, dsb.) */
.tabs { display: flex; gap: 8px; margin: 14px 0 12px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--white);
  font-weight: 700; white-space: nowrap; color: var(--muted);
}
.tab.on { background: var(--primary); border-color: var(--primary); color: var(--white); }

/* Laporan */
.delta { font-style: normal; font-size: 12.5px; font-weight: 700; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.delta span { color: var(--muted); font-weight: 500; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tbl tfoot td { border-top: 2px solid var(--line-strong); border-bottom: 0; font-weight: 800; padding-top: 12px; }
.sum dt.strong, .sum dd.strong { color: var(--ink); font-weight: 800; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }

/* Logo toko */
.brand .mark.has-img, .cust-head .logo.has-img { background: var(--white); padding: 3px; overflow: hidden; }
.brand .mark img, .cust-head .logo img { width: 100%; height: 100%; object-fit: contain; }
.logo-full { background: var(--white); border-radius: var(--r-lg); padding: 14px; }
.logo-full img { display: block; width: 100%; max-height: 200px; object-fit: contain; }
.receipt-logo { width: 70%; max-width: 160px; display: block; margin: 0 auto 4px; }
@media print { .receipt-logo { width: 32mm; filter: grayscale(1) contrast(1.4); } }

/* HP/tablet: tampilan tetap normal, tidak zoom saat diketuk
   - touch-action: manipulation → ketuk dua kali tidak memicu zoom
   - kolom isian min. 16px → iPhone tidak auto-zoom saat kolom diketuk */
html, body, button, a, input, select, textarea, label { touch-action: manipulation; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (pointer: coarse) {
  input, select, textarea, .input { font-size: 16px !important; }
}
@media (max-width: 480px) { .modal-foot .btn-lg { font-size: 15px; white-space: nowrap; padding: 0 14px; } }
a.btn { text-decoration: none; color: var(--ink); }
a.btn-primary { color: var(--white); }

/* Cek pembayaran pesanan meja (layar barista) */
.pay-check { background: #FFF4F1; border: 1.5px solid #F7C5BC; border-radius: var(--r-lg); padding: 12px; margin-bottom: 16px; }
.pay-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pay-card { background: var(--white); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 8px; animation: slideIn .25s ease; }
.pay-card .who { flex: 1; font-weight: 700; }
.pay-amount { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.pay-amount small { font-size: 13px; color: var(--muted); font-weight: 700; }
.pay-actions { display: flex; gap: 8px; }
.pay-actions .grow { flex: 1; }
.pay-actions .btn { white-space: nowrap; padding: 0 12px; font-size: 14px; }
.pay-actions .btn-danger { flex: none; }

/* Deret yang bisa digeser (kategori, tab) + tombol panah */
.hscroll { position: relative; min-width: 0; }
.hscroll > .cats, .hscroll > .tabs { cursor: grab; }
.hscroll > .dragging { cursor: grabbing; user-select: none; scroll-behavior: auto; }
.hscroll > .dragging * { pointer-events: none; }
.hs-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--white); color: var(--primary); box-shadow: var(--shadow);
  display: none; place-items: center; padding: 0;
}
.hs-btn.l { left: -6px; }
.hs-btn.r { right: -6px; }
.hscroll.can-l .hs-btn.l, .hscroll.can-r .hs-btn.r { display: grid; }
.hscroll.can-r::after, .hscroll.can-l::before {
  content: ""; position: absolute; top: 0; bottom: 0; width: 48px; pointer-events: none; z-index: 2;
}
.hscroll.can-r::after { right: 0; background: linear-gradient(to left, var(--bg), transparent); }
.hscroll.can-l::before { left: 0; background: linear-gradient(to right, var(--bg), transparent); }
.cat-card { flex: 1 0 150px; }
.pos-menu > .hscroll { flex: none; }
.cat-card { flex: 1 0 172px; }
.cat-card h3 { white-space: nowrap; font-size: 24px; }
.cat-card .status { white-space: nowrap; }
/* Tombol panah tidak boleh keluar dari tepi layar (bikin halaman HP bisa tergeser) */
.hs-btn.l { left: 2px; }
.hs-btn.r { right: 2px; }
.hscroll { overflow: hidden; }
