/* Sora POS — gaya mobile-first, tanpa dependensi */
:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #17202a;
  --muted: #7b8794;
  --line: #e6e2d9;
  --brand: #0f1720;
  --accent: #c8102e;
  --accent-soft: #fdecef;
  --ok: #1f8a53;
  --ok-soft: #e8f6ee;
  --warn: #b8760b;
  --radius: 16px;
  --shadow: 0 8px 28px rgba(23, 32, 42, .10);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  min-height: 100dvh;
}
button { font-family: inherit; cursor: pointer; }
h2 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.3px; }
h3 { font-size: 17px; margin: 0 0 8px; }
hr { border: 0; border-top: 1px dashed #cfcac0; margin: 10px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 22px; }
.ok { color: var(--ok); }
.err { color: var(--accent); }
.warn { color: var(--warn); }

/* ---------- layout ---------- */
#app { max-width: 720px; margin: 0 auto; padding-bottom: 78px; min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(246, 244, 239, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; letter-spacing: 1.5px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.brand .thin { font-weight: 400; letter-spacing: 2px; color: var(--muted); }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); display: inline-block; }
.who { display: flex; align-items: center; gap: 8px; }
.pill {
  font-size: 12px; padding: 5px 10px; border-radius: 999px;
  background: #ece8df; color: #4a5260; font-weight: 600; white-space: nowrap;
}
.pill.owner { background: #0f1720; color: #fff; }
.pill.supervisor { background: #eee3fb; color: #5b2d8e; }
.pill.kasir { background: #e6f0fb; color: #1d4f86; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.shiftbar {
  font-size: 12.5px; color: #5c6773; padding: 6px 16px;
  background: #efece4; border-bottom: 1px solid var(--line);
}
.view { padding: 16px; }
.panel { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel.narrow { max-width: 440px; margin: 0 auto; }

/* ---------- tombol ---------- */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 12px; padding: 12px 16px; font-size: 15px; font-weight: 650;
  transition: transform .06s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:disabled { background: #b9bec6; border-color: #b9bec6; }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--accent-soft); color: var(--accent); border-color: #f6c9d2; }
.btn.block { display: block; width: 100%; margin-top: 10px; }
.btn.big { padding: 15px; font-size: 16.5px; }
.btn.sm { padding: 7px 11px; font-size: 13px; border-radius: 9px; }
.icon {
  border: 0; background: transparent; font-size: 18px; width: 40px; height: 40px;
  border-radius: 10px; color: var(--muted);
}
.icon:hover { background: #eee9df; }
.link { border: 0; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; padding: 4px; }
.link.danger { color: var(--accent); }
.linkback { border: 0; background: none; padding: 0 0 10px; color: var(--muted); font-size: 14px; }

/* ---------- form ---------- */
.input {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 16px; background: #fff; color: var(--ink); outline: none;
}
.input:focus { border-color: #9aa4b2; }
.input.big { font-size: 22px; font-weight: 700; padding: 15px; }
.input.sm { padding: 8px 9px; font-size: 14px; width: 78px; }
.lbl { display: block; font-size: 13px; font-weight: 650; color: #55606d; margin: 16px 0 6px; }
.field { margin: 16px 0; }
.field > label { display: block; font-size: 13px; font-weight: 650; color: #55606d; margin-bottom: 7px; }
.inline { display: flex; gap: 8px; }
.inline .input { flex: 1; }
.quickrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 9px 14px; font-size: 14px; font-weight: 600;
}

/* ---------- login ---------- */
.loginwrap { padding: 32px 20px; max-width: 420px; margin: 0 auto; text-align: center; }
.logo {
  font-size: 46px; font-weight: 800; letter-spacing: 6px; color: var(--brand);
  margin: 24px 0 4px;
}
.userlist { display: grid; gap: 10px; margin: 22px 0; }
.usercard {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px;
}
.usercard small { display: block; color: var(--muted); font-size: 12.5px; text-transform: capitalize; }
.avatar {
  width: 42px; height: 42px; border-radius: 12px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 18px;
}
.pinbox { display: none; background: #fff; border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.pinbox.open { display: block; }
.pin {
  width: 100%; text-align: center; font-size: 30px; letter-spacing: 12px;
  padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; margin: 10px 0 4px;
}

/* ---------- POS ---------- */
.poswrap { padding-bottom: 90px; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tab {
  flex: 1; padding: 11px 10px; border-radius: 12px; border: 1.5px solid var(--line);
  background: #fff; font-weight: 650; font-size: 14px; color: #5c6773;
}
.tab.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prod {
  position: relative; text-align: left; background: #fff; border: 1.5px solid var(--line);
  border-radius: 14px; padding: 14px 13px; min-height: 112px;
  display: flex; flex-direction: column; gap: 3px; box-shadow: 0 2px 8px rgba(23,32,42,.04);
}
.prod:active { background: #faf7f1; }
.prodname { font-weight: 750; font-size: 15.5px; line-height: 1.2; }
.prodket { font-size: 11.5px; color: var(--muted); flex: 1; }
.prodprice { font-weight: 800; font-size: 16px; color: var(--accent); }
.stock { position: absolute; top: 10px; right: 10px; font-size: 10.5px; color: var(--muted); background: #f1eee7; padding: 2px 6px; border-radius: 6px; }

.cartbar {
  position: fixed; left: 0; right: 0; bottom: 66px; z-index: 25;
  max-width: 720px; margin: 0 auto; padding: 0 14px;
  transform: translateY(120%); transition: transform .2s ease;
}
.cartbar.show { transform: translateY(0); }
.cartbar > * { box-shadow: var(--shadow); }
.cartbar { display: flex; flex-direction: column; }
.cartinfo {
  background: var(--brand); color: #fff; border-radius: 14px 14px 0 0;
  padding: 10px 14px; display: flex; justify-content: space-between; align-items: center;
}
.cartinfo span { font-weight: 800; }
.cartbar .btn { border-radius: 0 0 14px 14px; padding: 14px; font-size: 16px; }

/* ---------- sheet keranjang ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 40; background: rgba(15,23,32,.35);
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
}
.sheet.open { opacity: 1; pointer-events: auto; }
.sheetpanel {
  width: 100%; max-width: 720px; background: var(--card);
  border-radius: 20px 20px 0 0; max-height: 88dvh;
  display: flex; flex-direction: column;
  box-shadow: 0 -10px 40px rgba(23, 32, 42, .18);
  animation: sheetup .18s ease;
}
@keyframes sheetup { from { transform: translateY(24px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.sheethead { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.sheethead h3 { margin: 0; }
.sheetbody { overflow-y: auto; padding: 8px 16px; flex: 1; }
.sheettotal { padding: 14px 16px 20px; border-top: 1px solid var(--line); background: #fbf9f5; }
.cartline { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0ece4; }
.cline-main { flex: 1; min-width: 0; }
.cline-main b { display: block; font-size: 14.5px; }
.cline-main small { color: var(--muted); font-size: 12px; }
.qtybox { display: flex; align-items: center; gap: 2px; background: #f1eee7; border-radius: 9px; padding: 2px; }
.qtybox button { width: 32px; height: 32px; border: 0; background: transparent; font-size: 18px; font-weight: 700; }
.qtybox span { min-width: 22px; text-align: center; font-weight: 700; }
.cline-price { font-weight: 700; font-size: 14px; min-width: 78px; text-align: right; }
.icon.del { width: 30px; height: 30px; font-size: 15px; }

/* ---------- modal pilih ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50; background: rgba(15,23,32,.4);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .16s ease;
}
.modal.open { opacity: 1; pointer-events: auto; }
.modalcard { width: 100%; max-width: 720px; background: #fff; border-radius: 20px 20px 0 0; padding: 18px 16px 22px; }
.modalhead { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.modalhead h3 { margin: 0; }
.opts { display: flex; gap: 8px; flex-wrap: wrap; }
.opt {
  flex: 1; min-width: 70px; border: 1.5px solid var(--line); background: #fff;
  border-radius: 12px; padding: 10px 8px; font-weight: 650; font-size: 14px;
}
.opt small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.opt.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.opt.on small { color: #cfd6de; }

/* ---------- bayar ---------- */
.bigtotal { font-size: 38px; font-weight: 800; letter-spacing: -1px; margin: 6px 0 4px; }
.paygrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 4px; }
.paymethod {
  padding: 14px 8px; border-radius: 12px; border: 1.5px solid var(--line);
  background: #fff; font-weight: 700; font-size: 14.5px;
}
.paymethod.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.paysummary { background: #fbf9f5; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 16px; }
.row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 14.5px; }
.row b { font-weight: 750; }
.row.total { font-size: 18px; padding-top: 8px; }
.row.promo b { color: var(--ok); }
.msg { font-size: 13px; margin-top: 8px; padding: 8px 10px; border-radius: 9px; background: #f4f1ea; }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.msg.err { background: var(--accent-soft); color: var(--accent); }

/* ---------- struk ---------- */
.receiptwrap { padding-top: 8px; }
.receipt {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 16px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px; color: #222;
}
.rhead { text-align: center; }
.rlogo { font-size: 26px; font-weight: 800; letter-spacing: 4px; }
.rsmall { font-size: 11px; color: #666; }
.rline { display: flex; justify-content: space-between; flex-wrap: wrap; padding: 2px 0; }
.rline small { width: 100%; color: #777; font-size: 10.5px; }
.rline.total { font-size: 15px; font-weight: 800; padding-top: 6px; }
.rcenter { text-align: center; margin-top: 8px; }
.receiptbtns { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.receiptbtns .btn { flex: 1; }

/* ---------- tabel ---------- */
.tablewrap { overflow-x: auto; margin-top: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid #f0ece4; white-space: nowrap; }
.table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; }
.table td.warn { color: var(--warn); font-weight: 700; }
.table td.ok { color: var(--ok); font-weight: 700; }
.cashbox { background: #fbf9f5; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-top: 16px; }

/* ---------- laporan ---------- */
.subtabs { display: flex; gap: 6px; overflow-x: auto; margin: 12px 0 4px; padding-bottom: 2px; }
.subtab {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 13px; font-size: 13px; font-weight: 650; white-space: nowrap; color: #5c6773;
}
.subtab.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.row.btns { justify-content: flex-end; margin-top: 8px; }
.txlist { display: grid; gap: 8px; }
.tx {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: #fbf9f5; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.tx small { display: block; color: var(--muted); font-size: 11.5px; }
.txright { text-align: right; }
.auditlist { margin-top: 10px; }
.audit { padding: 10px 0; border-bottom: 1px solid #f0ece4; }
.audit b { text-transform: capitalize; }
.audit small { display: block; color: var(--muted); font-size: 11.5px; }

/* ---------- kelola ---------- */
.promolist { display: grid; gap: 8px; }
.promocard {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fbf9f5;
}
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; align-items: center; }
.formgrid .lbl { margin: 6px 0 0; }
.settingsblock { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.settingsblock:first-of-type { border-top: 0; padding-top: 0; margin-top: 8px; }

/* ---------- nav bawah ---------- */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  max-width: 720px; margin: 0 auto;
}
.navbtn {
  flex: 1; border: 0; background: none; padding: 9px 4px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; color: var(--muted); font-weight: 600;
}
.navbtn span { font-size: 19px; filter: grayscale(1); opacity: .6; }
.navbtn.on { color: var(--brand); }
.navbtn.on span { filter: none; opacity: 1; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 86px; transform: translate(-50%, 20px);
  background: #17202a; color: #fff; padding: 11px 16px; border-radius: 12px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .2s ease;
  z-index: 60; max-width: 88vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--accent); }

/* ---------- cetak ---------- */
@media print {
  body { background: #fff; }
  .topbar, .bottomnav, .receiptbtns, .shiftbar, .toast, .cartbar { display: none !important; }
  #app { padding: 0; max-width: none; }
  .view { padding: 0; }
  .panel { box-shadow: none; padding: 0; }
  .receipt { border: 0; font-size: 12px; width: 58mm; }
}

/* ---------- dashboard ---------- */
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.stat { background: #fbf9f5; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; }
.stat small { display: block; color: var(--muted); font-size: 11.5px; }
.stat b { font-size: 19px; letter-spacing: -.4px; }
.splitbar { display: flex; gap: 6px; margin-top: 12px; }
.sb { color: #fff; font-size: 12px; padding: 9px 10px; border-radius: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb.cash { background: #1f8a53; }
.sb.qris { background: #1d4f86; }
.bars { margin-top: 6px; }
.barrow { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 3px 0; }
.barrow span { width: 44px; color: var(--muted); }
.bartrack { flex: 1; height: 9px; background: #eee9df; border-radius: 99px; overflow: hidden; }
.barfill { height: 100%; background: var(--brand); border-radius: 99px; }
.barrow b { width: 88px; text-align: right; font-size: 12px; }

/* ---------- pegawai ---------- */
.peglist { display: grid; gap: 10px; margin-top: 12px; }
.pegrow { display: flex; align-items: flex-end; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fbf9f5; }
.pegmain { flex: 1; }
.pegmain small { display: block; margin-top: 4px; text-transform: capitalize; }

/* ---------- install banner (PWA) ---------- */
.installbar { position: fixed; left: 8px; right: 8px; bottom: 76px; z-index: 60; display: flex; align-items: center; gap: 8px; background: #0f1720; color: #fff; border-radius: 12px; padding: 10px 12px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.installbar span { flex: 1; line-height: 1.25; }
.installbar .btn { padding: 7px 12px; font-size: 12.5px; }
.installbar .ibx { background: transparent; border: 0; color: #fff; font-size: 15px; opacity: .7; }
