/* ===== Token ===== */
[hidden] { display: none !important; }
:root {
  --ink: #12343b;        /* teal tinta: teks utama, sidebar */
  --ink-2: #1d4a52;
  --bg: #e9eeec;         /* abu kehijauan: latar kerja */
  --paper: #ffffff;
  --paper-2: #f6f8f7;
  --line: #d3dcd9;
  --muted: #5b6e6b;
  --accent: #f4b731;     /* kunyit: tombol bayar / aksi utama */
  --accent-ink: #3b2a00;
  --ok: #2e7d5b;
  --ok-bg: #e2f1e9;
  --warn: #9a6400;
  --warn-bg: #fdf1d6;
  --bad: #b8432f;
  --bad-bg: #f8e3df;
  --radius-s: 6px;
  --radius: 10px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --side-w: 232px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
a { color: var(--ink-2); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.ic { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ===== Shell ===== */
.shell { display: flex; min-height: 100vh; background: linear-gradient(to right, var(--ink) var(--side-w), transparent 0); }
@media (max-width: 900px) { .shell { background: none; } }
.side {
  width: var(--side-w);
  background: var(--ink);
  color: #dfe9e7;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex: none;
  z-index: 40;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 20px 18px 16px; }
.brand img { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: #fff; }
.brand strong { display: block; color: #fff; font-size: 1rem; }
.brand span { font-size: .78rem; color: #9fb7b3; }
.venue-switch { padding: 0 18px 12px; }
.venue-switch label { font-size: .75rem; color: #9fb7b3; display: block; margin-bottom: 4px; }
.venue-switch select { width: 100%; background: var(--ink-2); color: #fff; border: 1px solid #2f5f67; }
.side nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 2px; flex: 1; overflow-y: auto; }
.side nav a {
  display: flex; gap: 12px; align-items: center;
  color: #c9d8d5; text-decoration: none;
  padding: 10px 12px; border-radius: var(--radius-s); font-weight: 500;
}
.side nav a:hover { background: var(--ink-2); color: #fff; }
.side nav a.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.me { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-top: 1px solid #24515a; }
.me strong { display: block; color: #fff; font-size: .9rem; }
.me span { font-size: .75rem; color: #9fb7b3; }
.me a { color: #c9d8d5; padding: 6px; border-radius: 6px; display: inline-flex; }
.me a:hover { background: var(--ink-2); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 28px 6px; }
.topbar h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; }
.topbar-extra { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.content { padding: 14px 28px 40px; flex: 1; }
.only-mobile { display: none !important; }
.scrim { display: none; }

@media (max-width: 900px) {
  .side { position: fixed; left: 0; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(18, 52, 59, .45); z-index: 30; }
  .only-mobile { display: inline-flex !important; }
  .topbar { padding: 12px 16px 4px; }
  .topbar h1 { font-size: 1.2rem; }
  .content { padding: 10px 16px 32px; }
}

/* ===== Form ===== */
label { display: flex; flex-direction: column; gap: 5px; font-size: .85rem; font-weight: 600; color: var(--ink); }
input, select, textarea {
  font: inherit; font-size: .95rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: 9px 11px; min-height: 40px; width: 100%;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink-2); outline: 2px solid rgba(244, 183, 49, .55); outline-offset: 0; }
.field-row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.field-row > * { flex: 1 1 140px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 600px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.form { display: flex; flex-direction: column; gap: 12px; }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 18px; min-height: 18px; }
.hint { font-size: .78rem; color: var(--muted); font-weight: 400; }

/* ===== Tombol ===== */
.btn {
  font: inherit; font-weight: 600; font-size: .9rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 8px 16px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--accent); border-color: #dca21f; color: var(--accent-ink); }
.btn.primary:hover { background: #f0aa13; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: var(--ink-2); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(18, 52, 59, .06); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: .82rem; }
.btn.block { width: 100%; }
.btn.big { min-height: 56px; font-size: 1.05rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { background: none; border: 0; padding: 6px; color: inherit; cursor: pointer; border-radius: 6px; display: inline-flex; }
.icon-btn:hover { background: rgba(18, 52, 59, .08); }

/* ===== Panel & tabel ===== */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel + .panel { margin-top: 16px; }
.panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-h .muted { font-size: .82rem; }
.toolbar { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1 1 220px; }
.toolbar label { font-size: .78rem; }

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .78rem; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid #e8edeb; vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--paper-2); }
.tbl .num, .tbl .right { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.sub { font-size: .78rem; color: var(--muted); }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: .85rem; color: var(--muted); }

.tag { display: inline-block; font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #e6ecea; color: var(--ink-2); white-space: nowrap; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }

.alert { padding: 10px 14px; border-radius: var(--radius-s); font-size: .9rem; }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty h2 { color: var(--ink); margin-bottom: 6px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { font: inherit; font-weight: 600; font-size: .9rem; background: none; border: 0; padding: 10px 14px; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }

/* ===== Modal & toast ===== */
dialog.modal { border: 0; border-radius: var(--radius); padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 24px 60px rgba(18, 52, 59, .3); color: var(--ink); }
dialog.modal.wide { width: min(820px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(18, 52, 59, .5); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); z-index: 1; }
.modal-b { padding: 18px 20px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--paper-2); position: sticky; bottom: 0; flex-wrap: wrap; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; pointer-events: none; }
#toast div { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: var(--radius-s); font-weight: 600; font-size: .9rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); animation: toast-in .18s ease-out; }
#toast div.bad { background: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ===== Ringkasan / dashboard ===== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { font-size: .82rem; color: var(--muted); font-weight: 500; }
.stat .v { font-size: 1.45rem; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .d { font-size: .78rem; margin-top: 2px; color: var(--muted); }
.stat .d.up { color: var(--ok); }
.stat .d.down { color: var(--bad); }
.stat.hero { background: var(--ink); color: #fff; border-color: var(--ink); }
.stat.hero .k, .stat.hero .d { color: #a9c2be; }
.stat.hero .d.up { color: #8fe0b8; }
.stat.hero .d.down { color: #ffb4a6; }
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.dash-grid > .panel + .panel { margin-top: 0; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 180px; padding-top: 10px; }
.bars .b { flex: 1; background: #7fa39c; border-radius: 4px 4px 0 0; min-height: 2px; position: relative; cursor: pointer; }
.bars .b.today { background: var(--accent); }
.bars .b:hover { background: var(--ink-2); }
.bars-x { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: 6px; }
.chart-tip { font-size: .85rem; color: var(--muted); min-height: 1.4em; margin-top: 4px; }
.list-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #edf1ef; font-size: .9rem; }
.list-row:last-child { border-bottom: 0; }
.meter { height: 6px; border-radius: 3px; background: #e6ecea; margin-top: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ink-2); }

/* ===== Kasir ===== */
body.kasir .content { padding-top: 6px; padding-bottom: 16px; }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; height: calc(100vh - 92px); }
.pos-left { display: flex; flex-direction: column; min-height: 0; }
.search-big { position: relative; }
.search-big .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-big input { min-height: 52px; font-size: 1.05rem; padding-left: 44px; border-width: 2px; border-color: var(--ink); }
.cats { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; flex: none; }
.cats button { font: inherit; font-size: .84rem; font-weight: 600; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; white-space: nowrap; }
.cats button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.prod-area { flex: 1; overflow-y: auto; min-height: 0; padding-bottom: 8px; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.prod {
  text-align: left; font: inherit; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0; cursor: pointer; display: flex; flex-direction: column; overflow: hidden; color: var(--ink);
}
.prod:hover { border-color: var(--ink-2); }
.prod:active { transform: scale(.98); }
.prod .pic { aspect-ratio: 4/3; background: var(--paper-2); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 800; color: #b5c6c2; }
.prod .pic img { width: 100%; height: 100%; object-fit: cover; }
.prod .t { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.prod .n { font-size: .88rem; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod .p { font-size: .9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.prod .s { font-size: .74rem; color: var(--muted); }
.prod .s.low { color: var(--bad); font-weight: 600; }
/* Mode retail: daftar padat, cocok untuk ribuan produk */
.prod-list .prod { flex-direction: row; align-items: center; padding: 10px 14px; gap: 12px; border-radius: var(--radius-s); }
.prod-list { display: flex; flex-direction: column; gap: 6px; }
.prod-list .prod .t { padding: 0; flex: 1; }
.prod-list .prod .p { margin-left: auto; }
.prod-list .prod .bc { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Struk berjalan: panel keranjang meniru kertas thermal */
.receipt {
  background: var(--paper);
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex; flex-direction: column; min-height: 0;
  position: relative;
  box-shadow: 0 1px 0 var(--line), 0 10px 30px rgba(18, 52, 59, .08);
}
.receipt::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px;
  background: radial-gradient(circle at 10px -2px, transparent 8px, var(--paper) 8.5px) 0 0 / 20px 10px repeat-x;
}
.rc-head { padding: 14px 16px 10px; border-bottom: 1px dashed #b9c7c3; }
.rc-head .row { display: flex; gap: 8px; align-items: center; }
.rc-head .who { display: flex; gap: 6px; margin-top: 8px; }
.rc-head .who input { min-height: 38px; }
.cu-pick { position: relative; flex: 1; }
.cu-drop { position: absolute; top: 100%; left: 0; right: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-s); box-shadow: 0 10px 24px rgba(18, 52, 59, .15); z-index: 10; max-height: 260px; overflow-y: auto; }
.cu-drop button { display: block; width: 100%; text-align: left; font: inherit; background: none; border: 0; padding: 9px 12px; cursor: pointer; font-size: .88rem; }
.cu-drop button:hover, .cu-drop button.on { background: var(--paper-2); }
.cu-chip { display: flex; align-items: center; gap: 6px; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px 6px 6px 10px; font-size: .88rem; flex: 1; min-height: 38px; }
.cu-chip b { flex: 1; }
.rc-lines { flex: 1; overflow-y: auto; padding: 4px 16px; min-height: 80px; }
.rc-line { padding: 10px 0; border-bottom: 1px dotted #cfd9d6; }
.rc-line .top { display: flex; justify-content: space-between; gap: 10px; }
.rc-line .nm { font-weight: 600; font-size: .9rem; }
.rc-line .amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-line .ctl { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.rc-line .ctl .unit { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.rc-line .note { font-size: .78rem; color: var(--muted); font-style: italic; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.qty button { font: inherit; width: 32px; height: 32px; border: 0; background: var(--paper-2); cursor: pointer; font-size: 1.05rem; color: var(--ink); }
.qty button:hover { background: #e3eae8; }
.qty input { width: 56px; min-height: 32px; height: 32px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; text-align: center; padding: 0 4px; font-variant-numeric: tabular-nums; }
.rc-empty { text-align: center; padding: 40px 10px; color: var(--muted); font-size: .9rem; }
.rc-sum { padding: 10px 16px 16px; border-top: 1px dashed #b9c7c3; }
.rc-sum .r { display: flex; justify-content: space-between; font-size: .88rem; padding: 2px 0; font-variant-numeric: tabular-nums; }
.rc-sum .r button { font: inherit; font-size: .85rem; background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline dotted; cursor: pointer; }
.rc-sum .grand { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0 12px; }
.rc-sum .grand span { font-weight: 600; }
.rc-sum .grand strong { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rc-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; }
.cart-fab { display: none; }

@media (max-width: 699px) {
  .pos { grid-template-columns: 1fr; height: auto; }
  .prod-area { overflow: visible; }
  .receipt { position: fixed; inset: 0; z-index: 50; border-radius: 0; transform: translateY(100%); transition: transform .2s ease; }
  .receipt::after { display: none; }
  body.cart-open .receipt { transform: none; }
  .cart-fab { display: flex; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 45; justify-content: space-between; box-shadow: 0 10px 30px rgba(18, 52, 59, .3); }
  body.kasir .content { padding-bottom: 90px; }
}
.only-cart-mobile { display: none; }
@media (max-width: 699px) { .only-cart-mobile { display: inline-flex; } }

/* Pembayaran */
.pay-total { text-align: center; padding: 6px 0 14px; }
.pay-total .k { color: var(--muted); font-size: .85rem; }
.pay-total .v { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { font: inherit; font-weight: 600; font-size: .88rem; flex: 1 1 auto; padding: 10px 12px; border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius-s); cursor: pointer; color: var(--ink); }
.seg button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.cash-in { font-size: 1.5rem !important; font-weight: 700; text-align: right; min-height: 56px !important; font-variant-numeric: tabular-nums; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick button { font: inherit; font-size: .85rem; font-weight: 600; padding: 7px 10px; border-radius: var(--radius-s); border: 1px dashed #a8bab6; background: var(--paper-2); cursor: pointer; color: var(--ink); font-variant-numeric: tabular-nums; }
.change { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; border-radius: var(--radius-s); background: var(--paper-2); margin-top: 12px; }
.change strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.change.ok { background: var(--ok-bg); color: var(--ok); }
.change.warn { background: var(--warn-bg); color: var(--warn); }

/* Detail transaksi */
.trx-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 16px; margin-bottom: 14px; font-size: .88rem; }
.trx-meta div span { display: block; color: var(--muted); font-size: .76rem; }
.status-steps { display: flex; gap: 4px; margin: 6px 0 14px; }
.status-steps button { flex: 1; font: inherit; font-size: .84rem; font-weight: 600; padding: 9px 6px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; color: var(--muted); }
.status-steps button:first-child { border-radius: var(--radius-s) 0 0 var(--radius-s); }
.status-steps button:last-child { border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.status-steps button.done { background: var(--ok-bg); color: var(--ok); border-color: #bfe0cf; }
.status-steps button.on { background: var(--ok); color: #fff; border-color: var(--ok); }

/* Login */
body.auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: var(--ink); }
.auth-card { background: var(--paper); width: min(380px, 100%); padding: 34px 28px 28px; border-radius: var(--radius); display: flex; flex-direction: column; gap: 14px; position: relative; }
.auth-card.wide { width: min(520px, 100%); }
.auth-card h1 { font-size: 1.5rem; font-weight: 800; }
.auth-card p { margin: -8px 0 4px; }
.auth-tape { position: absolute; top: 0; left: 28px; width: 56px; height: 8px; background: var(--accent); border-radius: 0 0 4px 4px; }

@media print {
  .side, .topbar, .toolbar, .btn, #toast, .cart-fab { display: none !important; }
  body { background: #fff; }
  .panel { border: 0; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
.trx-meta div span.tag { display: inline-block; }

/* ===== Tampilan HP (m-kasir.html, m-produk.html) ===== */
body.hp { --hp-top: 56px; --hp-nav: 62px; background: var(--bg); }
.hp-top {
  position: fixed; top: 0; left: 0; right: 0; height: var(--hp-top); z-index: 40;
  display: flex; align-items: center; gap: 8px; padding: 0 8px 0 14px;
  background: var(--ink); color: #fff;
}
.hp-brand { flex: 1; min-width: 0; line-height: 1.2; }
.hp-brand strong { display: block; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-brand span { font-size: .74rem; color: #a9c2be; }
.hp-top .btn.ghost { color: #dfe9e7; }
.hp-top .icon-btn { color: #dfe9e7; padding: 10px; }
.hp-main { padding: calc(var(--hp-top) + 10px) 12px calc(var(--hp-nav) + 16px) !important; }
.hp-nav {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--hp-nav); z-index: 40;
  display: flex; background: var(--paper); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.hp-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .76rem; font-weight: 600; }
.hp-nav a .ic { width: 22px; height: 22px; }
.hp-nav a.on { color: var(--ink); }
.hp-nav a.on .ic { color: var(--ink); background: var(--accent); border-radius: 999px; padding: 3px 14px; width: 52px; height: 28px; }

/* Kasir di HP: pakai tata letak keranjang layar penuh */
body.hp .pos { display: block; height: auto; }
body.hp .search-big { position: sticky; top: calc(var(--hp-top) + 6px); z-index: 5; display: flex; gap: 6px; }
body.hp .search-big input { min-height: 48px; font-size: 1rem; }
body.hp .cats { position: sticky; top: calc(var(--hp-top) + 58px); z-index: 4; background: var(--bg); margin: 0 -12px; padding: 8px 12px; }
body.hp .prod-area { overflow: visible; }
body.hp .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
body.hp .prod-list .prod { padding: 12px; }
body.hp .receipt { position: fixed; inset: 0; z-index: 50; border-radius: 0; transform: translateY(100%); transition: transform .2s ease; }
body.hp .receipt::after { display: none; }
body.hp.cart-open .receipt { transform: none; }
body.hp .only-cart-mobile { display: inline-flex; }
body.hp .cart-fab { display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(var(--hp-nav) + 10px); z-index: 45; justify-content: space-between; box-shadow: 0 10px 30px rgba(18, 52, 59, .3); }
body.hp .rc-head .row { flex-wrap: wrap; }
body.hp .rc-line .ctl { flex-wrap: wrap; }
body.hp .qty button { width: 40px; height: 40px; }
body.hp .qty input { height: 40px; min-height: 40px; }
.scan-btn { flex: none; width: 52px; min-height: 48px; border-radius: var(--radius-s); border: 2px solid var(--ink); background: var(--paper); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
body.hp .search-big .ic { left: 14px; }
@media (min-width: 768px) {
  /* Di tablet tetap rapi: konten di tengah */
  .hp-main { max-width: 720px; margin: 0 auto; }
  body.hp .prod-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Daftar produk HP */
.mp-list { display: flex; flex-direction: column; gap: 8px; }
.mp-item { display: flex; gap: 12px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; text-align: left; font: inherit; color: var(--ink); cursor: pointer; width: 100%; }
.mp-item .pic { width: 52px; height: 52px; flex: none; border-radius: 8px; background: var(--paper-2); display: flex; align-items: center; justify-content: center; font-weight: 800; color: #b5c6c2; overflow: hidden; }
.mp-item .pic img { width: 100%; height: 100%; object-fit: cover; }
.mp-item .t { flex: 1; min-width: 0; }
.mp-item .n { font-weight: 600; font-size: .95rem; line-height: 1.25; }
.mp-item .m { font-size: .76rem; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.mp-item .p { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mp-item .p b { display: block; font-size: 1rem; }
.mp-item .p s { font-size: .74rem; color: var(--muted); }
.mp-count { font-size: .8rem; color: var(--muted); margin: 0 0 8px; }

/* Pengelompokan barang di kasir */
.grp-h {
  grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline;
  font-size: .82rem; font-weight: 700; color: var(--ink-2);
  padding: 12px 4px 4px; border-bottom: 2px solid var(--line); margin-bottom: 2px;
  position: sticky; top: 0; z-index: 2; background: var(--bg);
}
.grp-h span:last-child { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.grp-h:first-child { padding-top: 0; }
.cats .grp-toggle { border-style: dashed; }
.cats .grp-toggle.on { background: var(--accent); border-color: #dca21f; border-style: solid; color: var(--accent-ink); }
body.hp .grp-h { top: calc(var(--hp-top) + 110px); }

/* ===== Tablet ===== */
/* Tablet tegak (700–900px): menu samping tersembunyi, kasir tetap berdampingan dengan keranjang */
@media (min-width: 700px) and (max-width: 1000px) {
  .pos { grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; height: calc(100vh - 76px); }
  .receipt .rc-head .row { flex-wrap: wrap; }
  .rc-sum .grand strong { font-size: 1.6rem; }
  .rc-line .ctl { flex-wrap: wrap; }
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
/* Tablet mendatar (901–1279px): menu samping menjadi kolom ikon agar area kerja lebih lebar */
.brand-ini { display: none; }
@media (min-width: 901px) and (max-width: 1279px) {
  :root { --side-w: 84px; }
  .brand { justify-content: center; padding: 16px 8px 12px; }
  .brand > div { display: none; }
  .brand .brand-ini { display: flex; font-size: .95rem; width: 44px; height: 44px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 800; align-items: center; justify-content: center; }
  .side nav { padding: 6px; }
  .side nav a { flex-direction: column; gap: 4px; padding: 10px 2px; font-size: .68rem; text-align: center; line-height: 1.15; }
  .me { flex-direction: column; gap: 6px; padding: 12px 6px; }
  .me > div { display: none; }
  .content { padding-left: 20px; padding-right: 20px; }
  .topbar { padding-left: 20px; padding-right: 20px; }
  .pos { grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; }
}
/* Layar sentuh: target sentuh lebih besar */
@media (pointer: coarse) {
  .qty button { width: 42px; height: 42px; }
  .qty input { height: 42px; min-height: 42px; width: 58px; }
  .btn.small { min-height: 38px; padding: 6px 12px; }
  .cats button { padding: 9px 16px; }
  .rc-sum .r { padding: 5px 0; }
  .tbl td { padding-top: 12px; padding-bottom: 12px; }
  .icon-btn { padding: 10px; }
}
