/* POS GUN — tampilan. Semua warna turunan dari dua warna merek (--brand & --accent) yang diatur admin. */
:root {
  --brand: #1E7B34;   /* hijau Rotigun */
  --accent: #F5C518;  /* kuning emas Rotigun */
  --on-brand: #FFFFFF;
  --on-accent: #141414;
  /* Nilai cadangan (browser lama tanpa color-mix) */
  --m900: #0F3E1A; --m800: #186029; --m700: var(--brand); --m600: #3A8C4D; --m500: #5E9F6C;
  --m300: #A5CBAE; --m200: #CBE1D0; --m100: #E4F0E6; --m50: #F2F8F3;
  --bg: #F3F6F2; --card: #FFFFFF; --ink: #131A14; --muted: #4C564D; --line: #DDE5DE; --field: #8A968B;
  --crust: var(--accent); --cream: #FFF6E0;
  --danger: #B3261E;
  --warn-bg: #FFEBC2; --warn-ink: #774500;
  --bad-bg: #FDDCD6; --bad-ink: #9B2410;
  --ok-bg: #D8F0DC; --ok-ink: #1E5E2B;
  --sale-bg: #DCE8FA; --sale-ink: #1F4E8C;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20,14,12,.05), 0 6px 18px rgba(20,14,12,.06);
  --shadow-lg: 0 18px 50px rgba(20,14,12,.22);
  --top-h: 60px;
  --rail-w: 88px;
  --ease: cubic-bezier(.2,.8,.2,1);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
@supports (color: color-mix(in srgb, red, blue)) {
  :root {
    --m900: color-mix(in srgb, var(--brand) 50%, #000);
    --m800: color-mix(in srgb, var(--brand) 78%, #000);
    --m700: var(--brand);
    --m600: color-mix(in srgb, var(--brand) 85%, #fff);
    --m500: color-mix(in srgb, var(--brand) 68%, #fff);
    --m300: color-mix(in srgb, var(--brand) 40%, #fff);
    --m200: color-mix(in srgb, var(--brand) 22%, #fff);
    --m100: color-mix(in srgb, var(--brand) 12%, #fff);
    --m50:  color-mix(in srgb, var(--brand) 6%, #fff);
    --bg:   color-mix(in srgb, var(--brand) 5%, #F5F5F3);
    --line: color-mix(in srgb, var(--brand) 12%, #E3E3DF);
    --field: color-mix(in srgb, var(--brand) 22%, #8E8E88);
    --ink:  color-mix(in srgb, var(--brand) 12%, #151515);
    --muted: color-mix(in srgb, var(--brand) 10%, #545454);
    --cream: color-mix(in srgb, var(--accent) 16%, #fff);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); font-size: 15px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
body.noscroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--m700); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.muted { color: var(--muted); }
.r { text-align: right; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
:focus-visible { outline: 3px solid var(--m300); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Tombol & input ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 12px; padding: 10px 16px;
  font-weight: 650; background: var(--m100); color: var(--m800); text-decoration: none;
  min-height: 46px; transition: background .15s, box-shadow .15s, transform .08s var(--ease);
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--m700); color: var(--on-brand); box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn.primary:hover:not(:disabled) { background: var(--m800); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { background: var(--m50); border-color: var(--m200); }
.btn.danger-ghost { background: #fff; border-color: #EBC9C1; color: var(--danger); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.xl { min-height: 58px; font-size: 18px; }
.btn.block { width: 100%; }
.grow { flex: 1; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 0; background: rgba(255,255,255,.12); color: inherit; }
.icon-btn:hover { background: rgba(255,255,255,.22); }

input[type=text], input[type=search], input[type=date], input[type=time], input[type=password], input:not([type]), input[inputmode], select, textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  padding: 10px 12px; min-height: 46px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--field); }
input:focus, select:focus, textarea:focus { border-color: var(--m600); box-shadow: 0 0 0 4px var(--m100); }
.input-xl { font-size: 30px; font-weight: 800; text-align: right; min-height: 64px; letter-spacing: -.01em; }
.label { display: block; font-size: 13px; font-weight: 650; color: var(--muted); margin: 14px 0 6px; }
.label small { font-weight: 400; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
  padding: 7px 15px; font-weight: 650; font-size: 14px; white-space: nowrap; min-height: 40px;
  transition: background .15s, border-color .15s, color .15s, transform .08s;
}
.chip small { font-size: 11.5px; font-weight: 700; opacity: .7; background: var(--m50); border-radius: 99px; padding: 1px 7px; }
.chip:active { transform: scale(.96); }
.chip.on { background: var(--m700); border-color: var(--m700); color: var(--on-brand); }
.chip.on small { background: rgba(255,255,255,.22); opacity: 1; }

.seg { display: flex; gap: 6px; background: var(--m50); padding: 5px; border-radius: 14px; border: 1px solid var(--line); }
.seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: transparent; border-radius: 10px; padding: 10px; font-weight: 650; min-height: 46px; color: var(--muted); transition: background .15s, color .15s; }
.seg button.on { background: #fff; color: var(--m800); box-shadow: var(--shadow); }

.tabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line); padding: 4px; border-radius: 14px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs button { border: 0; background: transparent; padding: 9px 16px; border-radius: 10px; font-weight: 650; color: var(--muted); white-space: nowrap; min-height: 42px; }
.tabs button.on { background: var(--m700); color: var(--on-brand); }

/* ---------- Login ---------- */
#app { min-height: 100%; }
.login { position: relative; overflow: hidden; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: linear-gradient(160deg, var(--m800), var(--m900)); }
.login-art i { position: absolute; border-radius: 50%; background: var(--accent); opacity: .16; filter: blur(2px); }
.login-art i:nth-child(1) { width: 420px; height: 420px; top: -140px; left: -120px; }
.login-art i:nth-child(2) { width: 300px; height: 300px; bottom: -110px; right: -60px; background: #fff; opacity: .08; }
.login-art i:nth-child(3) { width: 140px; height: 140px; top: 18%; right: 14%; opacity: .22; }
.login-card { position: relative; width: 100%; max-width: 380px; background: #fff; border-radius: 26px; box-shadow: var(--shadow-lg); padding: 30px 26px 22px; text-align: center; animation: pop .3s var(--ease); }
.login-card h1 { font-size: 23px; color: var(--m800); margin-top: 12px; letter-spacing: -.01em; }
.login-card p { margin: 6px 0 0; color: var(--muted); }
.login-logo { width: 84px; height: 84px; margin: 0 auto; border-radius: 22px; overflow: hidden; background: var(--m50); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.login-logo img { width: 100%; height: 100%; object-fit: contain; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 22px 0 18px; height: 18px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--m300); transition: background .15s, transform .15s; }
.pin-dots i.on { background: var(--m700); border-color: var(--m700); transform: scale(1.12); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-9px); } 75% { transform: translateX(9px); } }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pinpad button { height: 64px; border-radius: 18px; border: 1px solid var(--line); background: var(--m50); font-size: 25px; font-weight: 650; transition: background .1s, transform .08s; }
.pinpad button:active { background: var(--m200); transform: scale(.95); }
.pinpad .ok { background: var(--m700); color: var(--on-brand); border-color: var(--m700); font-size: 17px; }
.pinpad .ghost { background: #fff; }
.login-err { color: var(--danger); min-height: 20px; margin-top: 12px; font-size: 14px; font-weight: 600; }
.powered { margin-top: 10px; font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.powered b { color: var(--m700); }

/* ---------- Kerangka: header + rel navigasi ---------- */
.layout { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); grid-template-rows: var(--top-h) minmax(0, 1fr); height: 100dvh; }
.topbar {
  grid-column: 1 / -1; z-index: 20; display: flex; align-items: center; gap: 14px;
  background: var(--m800); color: var(--on-brand); padding: 0 14px 0 12px;
  box-shadow: 0 2px 14px rgba(0,0,0,.18); border-bottom: 3px solid var(--accent);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.brand .mark { width: 40px; height: 40px; border-radius: 12px; overflow: hidden; background: #fff; flex: none; }
.brand .mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.brand-txt b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-txt small { font-size: 11px; font-weight: 700; letter-spacing: .12em; opacity: .75; text-transform: uppercase; }
.user { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 600; }
.clock { font-size: 13.5px; font-weight: 650; opacity: .85; font-variant-numeric: tabular-nums; margin-right: 4px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 13px; }
.uname { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.outlet-sel { width: auto; min-height: 40px; padding: 6px 10px; border-radius: 12px; border: 2px solid var(--accent); background: #fff; color: var(--ink); font-weight: 700; max-width: 210px; }
.outlet-pill { background: var(--accent); color: var(--on-accent); padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }

.rail { grid-row: 2; display: flex; flex-direction: column; gap: 6px; padding: 12px 8px; background: #fff; border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: none; z-index: 15; }
.rail a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 700; text-align: center; transition: background .15s, color .15s; position: relative; }
.rail a .ic { width: 24px; height: 24px; }
.rail a:hover { background: var(--m50); color: var(--m800); }
.rail a.active { background: var(--m100); color: var(--m800); }
.rail a.active::before { content: ""; position: absolute; left: -8px; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--m700); }
.main { grid-row: 2; min-width: 0; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.main > .page { flex: none; width: 100%; }

.page { max-width: 1120px; margin: 0 auto; padding: 20px 20px 40px; animation: fadein .25s var(--ease); }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h2 { font-size: 23px; color: var(--m900); letter-spacing: -.01em; }
.page-head input[type=date] { width: auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.card h3 { font-size: 16px; margin-bottom: 12px; color: var(--m900); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); grid-column: 1 / -1; }
.empty.loading { display: flex; align-items: center; justify-content: center; gap: 10px; }
.spin { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--m100); border-top-color: var(--m700); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.big-ic .ic { width: 56px; height: 56px; color: var(--m500); }

/* ---------- Kasir ---------- */
.pos { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
.catalog { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.catalog-top { padding: 14px 18px 8px; display: flex; flex-direction: column; gap: 10px; }
.search { position: relative; display: block; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 44px; border-radius: 14px; background: #fff; min-height: 48px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.grid {
  flex: 1; overflow-y: auto; padding: 6px 18px 28px; -webkit-overflow-scrolling: touch;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 14px; align-content: start;
}
.pcard {
  position: relative; display: flex; flex-direction: column; text-align: left; padding: 0;
  border: 1px solid var(--line); border-radius: 18px; background: #fff; overflow: hidden;
  box-shadow: var(--shadow); transition: transform .12s var(--ease), border-color .15s, box-shadow .15s;
}
.pcard:hover { border-color: var(--m300); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.pcard:active { transform: scale(.96); }
.pcard.added { animation: bump .35s var(--ease); }
.pcard.added::after { content: "+1"; position: absolute; right: 12px; top: 40%; font-weight: 900; font-size: 22px; color: var(--m700); animation: floatup .6s var(--ease) forwards; pointer-events: none; text-shadow: 0 2px 0 #fff; }
@keyframes bump { 40% { transform: scale(.94); } 70% { transform: scale(1.03); } }
@keyframes floatup { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-46px); } }
.pimg { aspect-ratio: 4 / 3; background: var(--m100); overflow: hidden; }
.pimg img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.pcard:hover .pimg img { transform: scale(1.04); }
.noimg { display: grid; place-items: center; background: linear-gradient(135deg, var(--m100), var(--cream)); }
.noimg span { font-size: 30px; font-weight: 900; color: var(--m600); letter-spacing: 1px; }
.pinfo { padding: 10px 12px 12px; }
.pname { font-weight: 650; font-size: 15px; line-height: 1.25; min-height: 2.5em; }
.pprice { color: var(--m700); font-weight: 800; margin-top: 4px; }
.ptag { position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,.94); color: var(--m800); font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.pbadge { position: absolute; top: 8px; right: 8px; background: var(--accent); color: var(--on-accent); min-width: 28px; height: 28px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 13px; padding: 0 8px; box-shadow: 0 3px 8px rgba(0,0,0,.18); animation: pop .25s var(--ease); }

.cart { background: #fff; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.cart-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cart-head h2 { font-size: 19px; flex: 1; color: var(--m900); }
.cart-list { flex: 1; overflow-y: auto; padding: 4px 0; }
.cart-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 56px 24px; text-align: center; color: var(--muted); }
.cart-empty .ic { width: 46px; height: 46px; color: var(--m300); margin-bottom: 6px; }
.cart-empty b { color: var(--ink); }
.cline { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px dashed var(--line); }
.cline.flash { animation: flash 1s var(--ease); }
@keyframes flash { from { background: var(--m100); } }
.cmain { flex: 1; min-width: 0; cursor: pointer; }
.cname { font-weight: 650; }
.ctop { font-size: 13px; color: var(--m700); display: flex; justify-content: space-between; gap: 8px; }
.ctop span { color: var(--muted); }
.cnote { font-size: 13px; color: var(--muted); font-style: italic; }
.cunit { font-size: 13px; color: var(--muted); margin-top: 2px; }
.cside { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; }
.ctotal { font-weight: 800; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.stepper button { width: 40px; height: 38px; border: 0; background: var(--m50); font-size: 20px; font-weight: 700; color: var(--m800); }
.stepper button:active { background: var(--m200); }
.stepper span { min-width: 34px; text-align: center; font-weight: 800; }
.stepper.lg button { width: 52px; height: 48px; font-size: 24px; }
.stepper.lg span { min-width: 50px; font-size: 18px; }
.cart-foot { padding: 14px 16px 16px; border-top: 1px solid var(--line); background: var(--m50); }
.total-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.total-row strong { font-size: 28px; color: var(--m900); letter-spacing: -.01em; }
.cart-fab, .only-mobile { display: none; }

/* ---------- Modal ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(20,16,14,.5); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 480px; max-height: calc(100dvh - 32px); overflow-y: auto; background: #fff; border-radius: 24px; padding: 22px; box-shadow: var(--shadow-lg); animation: pop .22s var(--ease); }
.modal.wide { max-width: 760px; }
@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.m-title { font-size: 21px; color: var(--m900); margin-bottom: 4px; letter-spacing: -.01em; }
.modal-foot { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; align-items: center; }

.pm { margin: -22px -22px 0; }
.pm-img { aspect-ratio: 16 / 9; background: var(--m100); }
.pm-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-img.noimg { aspect-ratio: 16 / 5; }
.pm-body { padding: 16px 22px 0; }
.pm-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.pm-head h3 { font-size: 21px; }
.pm-price { font-weight: 800; color: var(--m700); font-size: 18px; white-space: nowrap; }
.tops { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.top { display: flex; align-items: center; gap: 8px; text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 10px 12px; min-height: 52px; transition: border-color .15s, background .15s, transform .08s; }
.top:active { transform: scale(.97); }
.top .tname { flex: 1; font-weight: 650; font-size: 14px; }
.top .tprice { font-size: 13px; color: var(--m700); font-weight: 800; }
.tcheck { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--m300); flex: none; display: grid; place-items: center; transition: background .15s; }
.top.on { border-color: var(--m600); background: var(--m50); }
.top.on .tcheck { background: var(--m600); border-color: var(--m600); }
.top.on .tcheck::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.qty-row { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.qty-row .label { margin: 0; }

/* Pembayaran + numpad */
.pay { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
.pay-total { background: linear-gradient(135deg, var(--m700), var(--m800)); color: var(--on-brand); border-radius: 16px; padding: 16px 18px; margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.pay-total span { font-weight: 600; opacity: .85; font-size: 14px; }
.pay-total strong { font-size: 34px; letter-spacing: -.02em; }
.pay-methods button { flex-direction: column; gap: 4px; min-height: 64px; font-size: 14px; }
.pay-methods .ic { width: 24px; height: 24px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.change-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--m50); border: 1.5px solid var(--line); transition: background .2s, border-color .2s; }
.change-row strong { font-size: 24px; color: var(--m900); }
.change-row.good { background: var(--ok-bg); border-color: #9FD4A9; }
.change-row.good strong { color: var(--ok-ink); }
.change-row.minus { background: var(--bad-bg); border-color: #F0B3A8; }
.change-row.minus strong { color: var(--danger); }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-self: center; }
.numpad button { height: 62px; border-radius: 16px; border: 1px solid var(--line); background: var(--m50); font-size: 24px; font-weight: 750; transition: background .1s, transform .08s; }
.numpad button:active { background: var(--m200); transform: scale(.94); }
.numpad .np-del { background: #fff; color: var(--danger); }
.noncash { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; margin-top: 16px; padding: 22px 16px; border-radius: 16px; background: var(--sale-bg); color: var(--sale-ink); }
.noncash .ic { width: 40px; height: 40px; }
.noncash b { font-size: 18px; }
.pay:has(#numpad[hidden]) { grid-template-columns: 1fr; }

.success { text-align: center; padding-top: 8px; }
.success .check { width: 84px; height: 84px; margin: 0 auto 12px; }
.success .check svg { width: 100%; height: 100%; fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.success .check circle { stroke: var(--ok-ink); opacity: .2; fill: var(--ok-bg); }
.success .check path { stroke: var(--ok-ink); stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .45s .1s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.big-change { margin-top: 18px; background: var(--m50); border-radius: 16px; padding: 18px; }
.big-change span { display: block; color: var(--muted); font-weight: 650; }
.big-change strong { font-size: 40px; color: var(--m900); letter-spacing: -.02em; }

/* ---------- Tabel & daftar ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.stat span { display: block; font-size: 13px; color: var(--muted); font-weight: 650; }
.stat strong { font-size: 23px; color: var(--m900); }
.table-wrap { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); overflow-x: auto; }
.card .table-wrap { box-shadow: none; border: 0; border-radius: 0; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--m50); white-space: nowrap; }
.card .tbl th { background: transparent; padding-left: 0; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.card .tbl td { padding-left: 0; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--m50); }
.tbl tr.void td { color: var(--muted); text-decoration: line-through; }
.badge { display: inline-block; font-size: 11px; font-weight: 750; padding: 2px 9px; border-radius: 999px; background: var(--m100); color: var(--m800); text-decoration: none; white-space: nowrap; }
.badge.off { background: #EEE; color: #666; }
.badge.red, .badge.bad { background: var(--bad-bg); color: var(--bad-ink); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.ok { background: var(--ok-bg); color: var(--ok-ink); }
.bar { height: 6px; border-radius: 3px; background: var(--m100); margin-top: 4px; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--m500); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 > .card + .card { margin-top: 0; }

.plist { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.prow { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; text-align: left; border: 1px solid var(--line); transition: border-color .15s, transform .08s; }
.prow:hover { border-color: var(--m300); }
.prow:active { transform: scale(.98); }
.prow.off { opacity: .55; }
.prow .thumb { width: 66px; height: 66px; border-radius: 12px; overflow: hidden; flex: none; }
.prow .thumb.noimg span { font-size: 18px; }
.prow .thumb img { width: 100%; height: 100%; object-fit: cover; }
.prow .pi { flex: 1; min-width: 0; }
.prow .pi b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .pi small { color: var(--muted); }

/* ---------- Form ---------- */
.form label:not(.check) { display: block; font-size: 13px; font-weight: 650; color: var(--muted); margin-top: 12px; }
.form label:not(.check) > input, .form label:not(.check) > select, .form label:not(.check) > textarea { margin-top: 6px; color: var(--ink); font-weight: 400; font-size: 15px; }
.form textarea { min-height: 70px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-weight: 650; cursor: pointer; }
.check input { width: 21px; height: 21px; accent-color: var(--m700); flex: none; }
.img-up { display: flex; gap: 14px; align-items: center; }
.img-prev { width: 124px; height: 94px; border-radius: 14px; overflow: hidden; background: var(--m50); border: 1.5px dashed var(--m300); display: grid; place-items: center; font-size: 12px; color: var(--muted); text-align: center; flex: none; }
.img-prev img { width: 100%; height: 100%; object-fit: cover; }
.img-prev.logo img { object-fit: contain; }
.img-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.hint code { background: var(--m50); padding: 1px 5px; border-radius: 5px; }
.radio-row { display: flex; gap: 8px; margin-top: 6px; }
.colors { gap: 12px; }
.color-in { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 6px 10px 6px 6px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; }
.color-in input[type=color] { width: 44px; height: 34px; border: 0; padding: 0; background: none; cursor: pointer; }
.color-in code { font-weight: 700; color: var(--ink); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.swatch { width: 40px; height: 40px; border-radius: 12px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); background: linear-gradient(135deg, var(--b) 60%, var(--a) 60%); transition: transform .1s; }
.swatch:hover { transform: scale(1.08); }

.settings { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.preview-wrap { position: sticky; top: 12px; }
.receipt-box { background: var(--m50); border-radius: 14px; padding: 14px; display: flex; justify-content: center; margin-top: 12px; overflow-x: auto; }
.receipt-box .receipt { background: #fff; padding: 10px 8px; box-shadow: var(--shadow); }

/* Saklar & notifikasi WA */
.switch { position: relative; display: inline-block; width: 54px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #CFCFCB; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.switch input:checked + span { background: #25A244; }
.switch input:checked + span::after { transform: translateX(24px); }
.wa-events { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.check.tile { margin: 0; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-size: 14px; }
.check.tile:has(input:checked) { border-color: var(--m500); background: var(--m50); }
.test-to { width: 190px !important; }
.wa-stats { margin: 4px 0 8px; grid-template-columns: repeat(3, 1fr); }
.wa-log { max-height: 520px; overflow-y: auto; }
.err-txt { color: var(--danger); }

/* ---------- Struk ---------- */
.receipt { font-family: "Courier New", ui-monospace, Menlo, Consolas, monospace; color: #000; line-height: 1.35; word-wrap: break-word; }
.receipt.w58 { width: 48mm; }
.receipt.w80 { width: 72mm; }
.receipt.fs11 { font-size: 11px; } .receipt.fs12 { font-size: 12px; } .receipt.fs13 { font-size: 13px; }
.r-center { text-align: center; }
.r-store { font-weight: 700; font-size: 1.25em; }
.r-logo { text-align: center; margin-bottom: 4px; }
.r-logo img { max-width: 60%; max-height: 22mm; filter: grayscale(1); }
.r-gap { margin-top: 4px; }
.r-line { border-top: 1px dashed #000; margin: 6px 0; }
.r-row { display: flex; justify-content: space-between; gap: 6px; }
.r-item { margin-bottom: 4px; }
.r-sub { padding-left: 8px; }
.r-bold { font-weight: 700; font-size: 1.1em; }
.r-void { font-weight: 700; margin: 4px 0; }
.r-title { font-weight: 700; margin-top: 4px; letter-spacing: .5px; }
.r-head { font-weight: 700; margin: 2px 0; }
.r-row span:first-child { min-width: 0; }
.r-row span:last-child { white-space: nowrap; text-align: right; }
.r-sign { display: flex; justify-content: space-between; text-align: center; margin-top: 4px; }
.r-sign > div { width: 48%; }

#print-area { display: none; }
#print-area.measure { display: block; position: absolute; left: -10000px; top: 0; visibility: hidden; }
@media print {
  body { background: #fff; }
  body > * { display: none !important; }
  #print-area { display: block !important; }
}

/* ---------- Toast ---------- */
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; z-index: 80; background: var(--m900); color: #fff; padding: 13px 20px 13px 16px; border-radius: 14px; font-weight: 650; pointer-events: none; transition: .25s var(--ease); max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; }
#toast::before { content: "✓"; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.18); font-size: 13px; flex: none; }
#toast.err::before { content: "!"; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--danger); }

/* ---------- Umum tambahan ---------- */
.mb { margin-bottom: 14px; }
.nowrap { white-space: nowrap; }
.small { font-size: 12.5px; }
.small .ic { width: 15px; height: 15px; }
.page.wide { max-width: 1320px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.in { background: var(--ok-bg); color: var(--ok-ink); }
.btn.in:hover { filter: brightness(.96); }
.tbl tr.off td { opacity: .55; }
.menu-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.menu-list .btn { justify-content: flex-start; }
.card h3 small { font-weight: 400; }

.stat-btn { text-align: left; border: 2px solid transparent; cursor: pointer; font: inherit; transition: border-color .15s, transform .08s; }
.stat-btn:active { transform: scale(.98); }
.stat-btn.on { border-color: var(--m600); }
.stat-btn span .badge { font-size: 12px; display: inline-block; }

.mv { display: inline-block; font-size: 11.5px; font-weight: 750; padding: 2px 8px; border-radius: 6px; }
.mv.in { background: var(--ok-bg); color: var(--ok-ink); }
.mv.out { background: var(--bad-bg); color: var(--bad-ink); }
.mv.sale { background: var(--sale-bg); color: var(--sale-ink); }
.mv.adj { background: var(--warn-bg); color: var(--warn-ink); }

.filter-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.filter-row label { font-size: 13px; font-weight: 650; color: var(--muted); }
.filter-row input, .filter-row select { margin-top: 6px; }

.rc-row { display: grid; grid-template-columns: 1fr 96px 54px 44px; gap: 6px; align-items: center; margin-bottom: 8px; }
.form .rc-row select, .form .rc-row input { margin: 0; }
.rc-unit { font-size: 13px; color: var(--muted); }

/* ---------- Dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; animation: fadein .3s var(--ease) both; }
.kpi:nth-child(2) { animation-delay: .04s; } .kpi:nth-child(3) { animation-delay: .08s; } .kpi:nth-child(4) { animation-delay: .12s; }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 650; }
.kpi strong { font-size: 27px; color: var(--ink); letter-spacing: -.02em; }
.kpi small { font-size: 12.5px; }
.kpi.hero { background: linear-gradient(135deg, var(--m700), var(--m800)); color: var(--on-brand); border: 0; position: relative; overflow: hidden; }
.kpi.hero::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: var(--accent); opacity: .25; }
.kpi.hero span, .kpi.hero small, .kpi.hero strong { color: var(--on-brand); position: relative; z-index: 1; }
.kpi.hero strong { font-size: 31px; }
.kpi small.up { color: var(--ok-ink); font-weight: 750; }
.kpi small.down { color: var(--bad-ink); font-weight: 750; }
.kpi.hero small.up, .kpi.hero small.down { color: var(--on-brand); }
.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.dash-grid > .card { margin: 0; min-width: 0; }
.span2 { grid-column: span 2; }

.cc { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.cc-y { display: flex; flex-direction: column; justify-content: space-between; height: 180px; font-size: 11px; color: var(--muted); text-align: right; transform: translateY(-6px); }
.cc-main { min-width: 0; }
.cc-plot { position: relative; height: 180px; display: flex; align-items: flex-end; gap: 0; }
.cc-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.cc-grid i { border-top: 1px solid var(--line); }
.cc-col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; padding: 0 2px; cursor: default; }
.cc-col:hover { background: var(--m50); border-radius: 6px 6px 0 0; }
.cc-bar { width: 100%; max-width: 34px; background: var(--m300); border-radius: 6px 6px 0 0; animation: grow .5s var(--ease) both; transform-origin: bottom; }
@keyframes grow { from { transform: scaleY(0); } }
.cc-bar.hl { background: var(--m700); }
.cc-col:hover .cc-bar { background: var(--m600); }
.cc-x { display: flex; margin-top: 6px; }
.cc-x span { flex: 1; text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: visible; }

.lrows { display: flex; flex-direction: column; }
.lrow { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lrow:last-child { border-bottom: 0; }
.lrow.click { cursor: pointer; border-radius: 8px; }
.lrow.click:hover { background: var(--m50); }
.lrows.compact .lrow { padding: 8px 0; }
.lrow-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.hbar, .meter { height: 8px; border-radius: 4px; background: var(--m100); margin-top: 6px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--m500); border-radius: 4px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.stock-counts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.stock-counts a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); padding: 7px 11px; border: 1px solid var(--line); border-radius: 12px; }
.stock-counts a:hover { background: var(--m50); }
.all-good { padding: 24px 0; text-align: center; color: var(--ok-ink); font-weight: 750; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mini-stats div { background: var(--m50); border-radius: 12px; padding: 8px; text-align: center; }
.mini-stats b { display: block; font-size: 21px; margin-top: 4px; }

/* ---------- Multi-outlet ---------- */
.scope-note { margin: -6px 0 14px; color: var(--muted); }
.scope-note b { color: var(--ink); }
.scope-tag { display: inline-block; vertical-align: middle; font-size: 13px; font-weight: 750; background: var(--accent); color: var(--on-accent); padding: 3px 11px; border-radius: 999px; margin-left: 6px; }
.cart-outlet { display: block; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.pick-outlet { max-width: 760px; margin: 28px auto; text-align: center; }
.pick-outlet h2 { color: var(--m900); font-size: 25px; }
.outlet-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 20px; }
.outlet-grid .outlet-card { flex: 0 1 240px; }
.outlet-card { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 20px; border-radius: var(--radius); border: 2px solid var(--line); background: #fff; box-shadow: var(--shadow); transition: border-color .15s, transform .08s; }
.outlet-card:hover { border-color: var(--m600); }
.outlet-card:active { transform: scale(.98); }
.outlet-card b { font-size: 18px; color: var(--m800); }
.outlet-card span { color: var(--muted); font-size: 14px; }
.cell-aman { color: var(--ink); font-weight: 650; }
.cell-menipis { background: var(--warn-bg); color: var(--warn-ink); font-weight: 750; padding: 2px 8px; border-radius: 6px; }
.cell-habis { background: var(--bad-bg); color: var(--bad-ink); font-weight: 750; padding: 2px 8px; border-radius: 6px; }
.up { color: var(--ok-ink); font-weight: 750; }
.down { color: var(--bad-ink); font-weight: 750; }
.cmp-bar { min-width: 180px; }
.more { display: inline-block; margin-top: 10px; font-weight: 750; color: var(--m700); }

/* ---------- Offline & sinkron ---------- */
.net { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 7px 12px; font-weight: 750; font-size: 13px; white-space: nowrap; }
.net i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.net.on { background: rgba(255,255,255,.14); color: inherit; }
.net.on i { background: #5BE37D; box-shadow: 0 0 0 3px rgba(91,227,125,.25); }
.net.wait { background: var(--warn-bg); color: var(--warn-ink); }
.net.off { background: var(--bad-bg); color: var(--bad-ink); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .7; } }
.offline-note { background: var(--warn-bg); color: var(--warn-ink); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 650; margin: 12px 0 0; }
.pending-card { border: 2px solid var(--accent); }
.badge.sale { background: var(--sale-bg); color: var(--sale-ink); }
.device-pill { display: inline-block; margin-top: 8px; background: var(--m100); color: var(--m800); font-weight: 750; font-size: 13px; padding: 4px 12px; border-radius: 999px; }

.cl-date-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.cl-date-row label { flex: 1; min-width: 180px; margin-top: 0 !important; }
.cl-date-row .muted { padding-bottom: 12px; }

.ss-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 12px; max-height: 320px; overflow-y: auto; padding: 4px 8px; border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; }
.ss-item { margin-top: 6px !important; font-weight: 650; }
.merge-warn { border: 2px solid var(--accent); background: var(--cream); }
.ss-prev { border: 1px solid var(--line); border-radius: 12px; padding: 0 10px; max-height: 220px; overflow-y: auto; }

/* ---------- Cetak langsung ---------- */
.direct-print { margin-top: 16px; padding: 14px; border-radius: 14px; background: var(--cream); border: 1.5px solid var(--accent); font-size: 14px; }
.direct-print b { color: var(--ink); }
.direct-print p { margin: 6px 0; color: var(--muted); }
.direct-print ol { margin: 6px 0 10px; padding-left: 20px; color: var(--ink); }
.direct-print li { margin: 6px 0; }

/* ---------- Banner pasang aplikasi ---------- */
.install-bar { position: fixed; z-index: 45; top: 74px; right: 16px; width: min(380px, calc(100vw - 32px)); display: flex; align-items: center; gap: 12px; background: #fff; border: 2px solid var(--accent); border-radius: 18px; padding: 12px; box-shadow: var(--shadow-lg); animation: pop .2s; }
#install.inline { flex: none; }
#install.inline .install-bar { position: static; width: auto; margin: 10px 16px 0; animation: none; box-shadow: var(--shadow); }
.install-bar.warn-bar { border-color: var(--danger); background: #FFF8F6; align-items: flex-start; }
.bar-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.install-bar img { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.install-bar .grow > b { display: block; color: var(--m800); }
.install-bar span b { color: var(--ink); }
.install-bar span { display: block; font-size: 13px; color: var(--muted); }
body:has(.login) .install-bar { top: 16px; }

/* ---------- Transfer stok ---------- */
.mv.tf { background: #EBE2F7; color: #4E2A7A; }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 12px; margin-left: 4px; }
.tf-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.tf-list .card + .card { margin-top: 0; }
.tf.tf-in { border: 2px solid var(--accent); }
.tf-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.tf-dir { font-size: 12.5px; font-weight: 750; color: var(--m800); margin-left: 4px; }
.tf-route { display: flex; align-items: center; gap: 10px; margin: 10px 0; padding: 10px 12px; background: var(--m50); border-radius: 12px; font-weight: 750; }
.tf-route b { color: var(--m700); font-size: 18px; }
.tf-route select { flex: 1; width: auto; }
.tf-items { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.tf-alert { display: block; margin: 0 0 10px; padding: 8px 12px; border-radius: 12px; background: #EBE2F7; color: #4E2A7A; font-weight: 750; text-decoration: none; }

/* ---------- Outlet & akun kasir ---------- */
.outlet-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.outlet-cards .card + .card { margin-top: 0; }
.outlet-box.off { opacity: .6; }
.outlet-box .small { margin-top: 4px; }
.ob-name { font-size: 17px; color: var(--m800); }
.staff { display: flex; flex-wrap: wrap; gap: 6px; }
.staff-chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 650; font-size: 14px; }
.staff-chip:hover { border-color: var(--m700); background: var(--m50); }
.staff-chip.off { opacity: .55; }
.device-row { display: flex; gap: 10px; }
.device-row select { flex: 1; }

#tip { position: fixed; z-index: 90; pointer-events: none; background: var(--m900); color: #fff; font-size: 13px; padding: 7px 10px; border-radius: 8px; opacity: 0; transition: opacity .1s; max-width: 260px; }
#tip.show { opacity: 1; }

/* ================= Responsif =================
 * >= 1200 : desktop / tablet 10" landscape lebar (1280x800)
 * 901–1199: tablet 10" landscape kecil (1024x768, iPad 1080x810)
 * 761–900 : tablet 10" portrait (800x1280, 810x1080) → keranjang jadi laci geser
 * <= 760  : HP → navigasi pindah ke bawah
 */
@media (max-width: 1199px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid .span2 { grid-column: 1 / -1; }
  .pos { grid-template-columns: minmax(0, 1fr) 340px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 12px; }
  .settings { grid-template-columns: minmax(0, 1fr) 320px; }
  .clock { display: none; }
  .uname { display: none; }
}
@media (max-width: 1023px) {
  .settings { grid-template-columns: 1fr; }
  .preview-wrap { position: static; }
  .filter-row { grid-template-columns: 1fr 1fr; }
}
/* Tablet portrait: katalog penuh, keranjang sebagai laci dari kanan + tombol mengambang */
@media (max-width: 900px) {
  :root { --rail-w: 78px; }
  .pos { display: flex; flex-direction: column; }
  .catalog { flex: 1; }
  .grid { padding-bottom: 100px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .cart { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); z-index: 40; border-left: 0; box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .28s var(--ease); }
  .cart.open { transform: none; }
  body:has(.cart.open)::after { content: ""; position: fixed; inset: 0; background: rgba(20,16,14,.4); z-index: 35; animation: fade .2s; }
  .only-mobile { display: inline-flex; }
  .cart-fab {
    position: fixed; left: calc(var(--rail-w) + 16px); right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 30;
    display: flex; align-items: center; gap: 12px; border: 0; border-radius: 18px; padding: 14px 18px; min-height: 62px;
    background: var(--m700); color: var(--on-brand); font-weight: 650; font-size: 16px; box-shadow: 0 10px 28px color-mix(in srgb, var(--brand) 45%, transparent);
  }
  .cart-fab.added { animation: bump .35s var(--ease); }
  .cart-fab strong { margin-left: auto; font-size: 20px; }
  .fab-count { background: #fff; color: var(--m800); border-radius: 999px; min-width: 30px; height: 30px; display: grid; place-items: center; font-weight: 800; padding: 0 7px; }
  .pay { grid-template-columns: minmax(0, 1fr) 230px; gap: 16px; }
  .numpad button { height: 58px; }
}
/* HP */
@media (max-width: 760px) {
  :root { --top-h: 56px; }
  body { font-size: 15px; }
  .layout { display: block; height: auto; min-height: 100dvh; }
  .topbar { position: sticky; top: 0; height: var(--top-h); gap: 8px; padding: 0 10px; }
  .brand-txt small { display: none; }
  .brand-txt b { font-size: 15px; max-width: 34vw; }
  .outlet-sel { max-width: 140px; }
  .outlet-pill { max-width: 120px; padding: 6px 10px; font-size: 13px; }
  .avatar { display: none; }
  .rail { position: fixed; left: 0; right: 0; bottom: 0; flex-direction: row; justify-content: space-around; gap: 2px; padding: 6px 6px max(6px, env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0,0,0,.06); z-index: 30; overflow-x: auto; }
  .rail a { flex: 1; min-width: 56px; padding: 6px 2px; font-size: 10.5px; }
  .rail a.active::before { left: 25%; right: 25%; top: -6px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .main { display: block; overflow: visible; padding-bottom: 76px; }
  .pos { display: block; }
  .catalog { overflow: visible; }
  .catalog-top { position: sticky; top: var(--top-h); z-index: 5; background: var(--bg); padding: 10px 12px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 4px 12px 100px; overflow: visible; }
  .cart-fab { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .modal { padding: 16px; border-radius: 20px; }
  .modal.wide { max-width: 100%; }
  .pm { margin: -16px -16px 0; }
  .pm-body { padding: 14px 16px 0; }
  .tops { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .pay { grid-template-columns: 1fr; }
  .numpad button { height: 52px; font-size: 21px; }
  .page { padding: 14px 12px 32px; }
  .dash-grid { grid-template-columns: 1fr; }
  .kpi strong { font-size: 21px; }
  .kpis { gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi.hero strong { font-size: 23px; }
  .filter-row { grid-template-columns: 1fr 1fr; }
  .hide-sm { display: none; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .rc-row { grid-template-columns: 1fr 72px 44px 40px; }
  .cc-y, .cc-plot { height: 150px; }
  .test-to { width: 100% !important; }
  #toast { bottom: 90px; }
}
/* Landscape pendek (tablet 800px tinggi dengan keyboard / HP miring) */
@media (max-height: 560px) and (min-width: 761px) {
  .numpad button { height: 46px; }
  .pay-total strong { font-size: 26px; }
  .input-xl { min-height: 52px; font-size: 24px; }
}
.boot { display: grid; place-items: center; gap: 12px; min-height: 100dvh; align-content: center; font-weight: 600; }
.boot img { border-radius: 16px; animation: pop .5s var(--ease) infinite alternate; }
