:root {
  --bg: #eef4f0;
  --panel: #fff;
  --ink: #12241c;
  --muted: #5b6f66;
  --line: #d7e3dc;
  --side: #0f3d32;
  --side-2: #165544;
  --accent: #16a34a;
  --accent-2: #15803d;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 61, 50, .08);
  --mbar-h: 56px;
  --bnav-h: 64px;
  font-family: "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
button, input, select, a { font: inherit; -webkit-tap-highlight-color: transparent; }
input, select, textarea { font-size: 16px; max-width: 100%; }
img, video, canvas { max-width: 100%; }
code { background: #e8f5ee; padding: 1px 6px; border-radius: 6px; word-break: break-all; }

/* ===== Mobile first layout ===== */
.app { display: block; min-height: 100dvh; }
.main {
  min-width: 0;
  padding: calc(var(--mbar-h) + env(safe-area-inset-top, 0px) + 10px) 10px calc(var(--bnav-h) + env(safe-area-inset-bottom, 0px) + 82px);
}
.main.is-admin { padding-bottom: calc(var(--bnav-h) + env(safe-area-inset-bottom, 0px) + 20px); }
.main.is-kasir { padding-top: calc(var(--mbar-h) + env(safe-area-inset-top, 0px) + 8px); }

.mbar {
  display: flex;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 80;
  align-items: center;
  gap: 10px;
  height: calc(var(--mbar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 12px 0;
  background: #0f3d32;
  color: #fff;
}
.mbar-copy { flex: 1; min-width: 0; }
.mbar-copy b, .mbar-copy span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbar-copy span { font-size: 11px; opacity: .7; font-weight: 400; }
.micon {
  width: 44px; height: 44px; border: 0; background: transparent; position: relative; flex: none;
}
.micon span, .micon span:before, .micon span:after {
  display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px;
  position: absolute; left: 13px;
}
.micon span { top: 21px; }
.micon span:before, .micon span:after { content: ""; left: 0; }
.micon span:before { top: -6px; }
.micon span:after { top: 6px; }

.nav-mask, .cart-mask {
  display: none;
  position: fixed; inset: 0;
  background: rgba(8, 24, 18, .5);
  z-index: 90;
}
body.nav-open .nav-mask,
body.cart-open .cart-mask { display: block; }
body.nav-open, body.cart-open { overflow: hidden; }

.side {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: min(300px, 88vw);
  z-index: 100;
  background: linear-gradient(180deg, var(--side), #0b2b24);
  color: #e8f5ee;
  display: flex;
  flex-direction: column;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 14px 16px;
  transform: translateX(-105%);
  transition: transform .2s ease;
}
body.nav-open .side { transform: none; }
.brand { display: flex; gap: 10px; align-items: center; margin-bottom: 22px; }
.brand span, .who span { display: block; opacity: .7; font-size: 12px; }
.logo-mark {
  width: 40px; height: 40px; border-radius: 12px; background: var(--accent);
  display: grid; place-items: center; font-weight: 800; color: #fff;
}
.side nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; min-height: 0; }
.nav-label {
  margin: 16px 12px 6px; font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; opacity: .45;
}
.side nav a {
  color: #d7eee3; text-decoration: none; padding: 12px; border-radius: 10px;
}
.side nav a.on, .side nav a:hover { background: var(--side-2); color: #fff; }
.side-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.12);
  display: grid;
  gap: 10px;
}
.who { padding: 6px 4px; }
.who b { display: block; font-size: 14px; }
.pill { font-size: 12px; padding: 5px 10px; border-radius: 999px; width: fit-content; font-weight: 500; }
.pill.ok { background: #166534; }
.pill.warn { background: #b91c1c; }
.side-foot .btn {
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  padding: 12px;
  font-size: 14px;
}
.side-foot .btn:hover { background: rgba(255,255,255,.18); }

.bnav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -2px 10px rgba(0,0,0,.06);
}
.bnav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600;
  min-height: 52px;
}
.bnav a span { font-size: 20px; line-height: 1; }
.bnav a.on { color: var(--accent); }
.bnav a.on span { transform: scale(1.1); }
.bnav a i {
  width: 22px; height: 22px; border: 2px solid currentColor; border-radius: 7px; display: block;
}
.bnav a.on { color: var(--accent-2); }

.crumb { font-size: 12px; color: var(--muted); margin: 0 0 4px; }
.page-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.page-head p, .muted, .hint, .filter-sub { color: var(--muted); margin: 0; font-size: 13px; }
.page-head .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.page-head .btn { width: 100%; min-height: 44px; }

.toolbar, .toolbar.cardish, .topbar {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.toolbar.cardish {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px;
}
.toolbar.cardish input, .toolbar.cardish select { max-width: none; }

.desk-only { display: none !important; }
.scan-wrap { display: flex; flex-wrap: nowrap; gap: 8px; min-width: 0; align-items: stretch; }
.scan, input, select {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 12px; outline: none;
}
.scan { min-height: 46px; flex: 1 1 auto; width: auto; min-width: 0; }
input:focus, select:focus, .scan:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
.scan-wrap .btn { flex: 0 0 auto; min-height: 46px; min-width: 88px; padding: 10px 12px; }
.stats { display: none; }
.filter-sub { display: none; }
.kasir-top { margin-bottom: 8px; }

.btn {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 10px 12px; cursor: pointer; color: var(--ink);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 10px; font-size: 13px; min-height: 40px; }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.on { background: var(--side); color: #fff; border-color: var(--side); }

.badge {
  display: inline-block; background: #e8f5ee; color: #166534;
  border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 600;
}
.badge.ok { background: #dcfce7; color: #166534; }
.badge.off { background: #fee2e2; color: #991b1b; }
.stock-bad { font-weight: 700; }
.stock-bad.low { color: var(--danger); }
.stock-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qty-in { width: 72px !important; min-height: 40px; padding: 8px !important; }
.kpi, .kpi-4, .cards-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.kpi-card h2 { margin: 6px 0 0; font-size: 20px; }
.kpi-card span { color: var(--muted); font-size: 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.panel-head h3, .panel h3 { margin: 0 0 10px; }
.panel-head a { font-size: 13px; color: var(--accent-2); }
.row-between { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.stack { display: grid; gap: 10px; }
.empty { color: var(--muted); margin: 8px 0; }
.table-wrap.inner { border: 0; }
.cap { text-transform: capitalize; }
.user-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

.kasir { display: block; }
.filters {
  display: flex; gap: 6px; flex-wrap: nowrap;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 0 -10px 6px; padding: 0 10px 6px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 12px; min-height: 36px; font-weight: 600; font-size: 13px;
}
.chip.on { background: var(--c, var(--side)); color: #fff; border-color: transparent; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px; cursor: pointer; min-height: 92px; display: flex; flex-direction: column; gap: 4px;
}
.card .tag { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card b { line-height: 1.2; font-size: 12px; }
.card .price { margin-top: auto; color: var(--accent-2); font-weight: 800; font-size: 13px; }
.card .stk { font-size: 11px; color: var(--muted); }
.card.out { opacity: .45; }
.card.hit { outline: 2px solid var(--accent); }

.cart {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
  background: #fff; border: 1px solid var(--line);
  max-height: min(82vh, 640px); border-radius: 18px 18px 0 0;
  transform: translateY(110%); transition: transform .22s ease;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow);
}
body.cart-open .cart { transform: none; }
.cart-handle {
  display: block; width: 42px; height: 4px; border-radius: 99px;
  background: #c9d8d0; margin: 2px auto 10px;
}
.cart header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cart h2 { margin: 0; font-size: 18px; }
.cart-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0 0; }
.cart-items { min-height: 80px; max-height: 32vh; overflow: auto; display: grid; gap: 8px; margin: 10px 0; }
.line {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 8px;
  background: #f6faf7; border-radius: 10px;
}
.line .qty { display: flex; gap: 6px; align-items: center; }
.line .qty button { width: 40px; height: 40px; border-radius: 10px; }
.totals { display: grid; gap: 6px; border-top: 1px dashed var(--line); padding-top: 8px; }
.totals div, .disc-row { display: flex; justify-content: space-between; align-items: center; }
.grand { font-size: 20px; }
.pay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.pay-row .pay { margin-top: 0; }
.disc-row input { width: 110px; padding: 8px; }

.cart-dock {
  display: flex;
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(var(--bnav-h) + env(safe-area-inset-bottom, 0px) + 8px);
  z-index: 65;
  background: #0f3d32; color: #fff; border-radius: 16px;
  padding: 8px; gap: 8px; align-items: center;
  box-shadow: 0 10px 24px rgba(15, 61, 50, .28);
}
.dock-info {
  flex: 1; text-align: left; background: transparent; border: 0; color: inherit; padding: 8px 10px;
}
.dock-info span { display: block; font-size: 11px; opacity: .75; }
.dock-info b { font-size: 16px; }
.cart-dock .btn { min-height: 44px; padding: 0 12px; font-size: 13px; }
.cart-dock .btn.danger { padding: 0 10px; }

.modal {
  position: fixed; inset: 0; background: rgba(12, 28, 22, .45);
  display: grid; align-items: end; z-index: 110; padding: 0;
}
.sheet, .sheet.wide {
  background: #fff; width: 100%; max-width: none;
  border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  display: grid; gap: 8px; max-height: 92vh; overflow: auto;
}
.two { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .row-btns { display: grid; grid-template-columns: 1fr; gap: 8px; }
.row-btns .btn { min-height: 46px; }
#payModal .row-btns { grid-template-columns: 1fr 1fr; }
#payModal .row-btns .btn.primary { grid-column: 1 / -1; }
.pay-methods, .quick-cash, .row { display: flex; gap: 8px; flex-wrap: wrap; }
.pay-methods .btn, .quick-cash .btn { min-height: 44px; flex: 1; }
.hidden { display: none !important; }
.alert { background: #fef3c7; color: #92400e; padding: 10px 12px; border-radius: 10px; margin-bottom: 10px; }

.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table thead { display: none; }
.table, .table tbody, .table tr, .table td { display: block; }
.table tr {
  padding: 12px;
  border-bottom: 8px solid var(--bg);
}
.table td {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border: 0; padding: 6px 0; font-size: 14px;
}
.table td::before {
  content: attr(data-label);
  color: var(--muted); font-size: 12px; font-weight: 700; flex: none;
}
.table td.stock-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; }
.list { display: grid; gap: 8px; margin: 10px 0; }
.list .item {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex;
  justify-content: space-between; gap: 8px; align-items: center;
}
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.bar { height: 8px; background: #e5efe9; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--accent); }

/* Report Page Styles */
.report-filter {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.filter-group {
  flex: 1;
  min-width: 120px;
}
.filter-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.filter-group input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 10px;
}
.filter-row .btn {
  min-height: 48px;
  padding: 0 24px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.kpi-box {
  background: linear-gradient(135deg, #fff 0%, #f8faf9 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
}
.kpi-icon.trx { background: #e3f2fd; color: #1565c0; }
.kpi-icon.omzet { background: #e8f5e9; color: #2e7d32; }
.kpi-icon.disc { background: #fff3e0; color: #ef6c00; }
.kpi-icon.tax { background: #f3e5f5; color: #7b1fa2; }
.kpi-content { flex: 1; }
.kpi-content .label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}
.kpi-content .value {
  font-size: 24px;
  font-weight: 700;
  color: var(--txt);
  line-height: 1.1;
}

.report-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.report-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.report-card .card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: #fafbfa;
}
.report-card .card-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.cat-list, .pay-list {
  padding: 16px 20px;
  display: grid;
  gap: 14px;
}
.cat-item {
  display: grid;
  gap: 8px;
}
.cat-item .info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cat-item .name {
  font-weight: 600;
  font-size: 14px;
}
.cat-item .stats {
  font-size: 13px;
  color: var(--muted);
}
.cat-item .bar-wrap {
  height: 10px;
  background: #f0f4f2;
  border-radius: 99px;
  overflow: hidden;
}
.cat-item .bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #2e9d70 100%);
  border-radius: 99px;
  transition: width .3s ease;
}

.pay-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f8faf9;
  border-radius: 12px;
}
.pay-item .method {
  font-weight: 600;
  font-size: 14px;
  text-transform: capitalize;
}
.pay-item .detail {
  text-align: right;
}
.pay-item .count {
  font-size: 12px;
  color: var(--muted);
}
.pay-item .amount {
  font-weight: 600;
  color: var(--accent);
}

.report-card .table-wrap {
  padding: 0;
}
.report-table {
  margin: 0;
}
.report-table thead th {
  background: #f8faf9;
  padding: 14px 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}
.report-table tbody td {
  padding: 14px 16px;
  font-size: 14px;
}
.report-table tbody tr:nth-child(even) {
  background: #fafbfa;
}
.report-table .rank {
  width: 40px;
  text-align: center;
  font-weight: 700;
  color: var(--accent);
}
.report-table .rank.gold { color: #f9a825; }
.report-table .rank.silver { color: #78909c; }
.report-table .rank.bronze { color: #8d6e63; }

.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--muted);
}
.empty-state p {
  margin: 0;
  font-size: 14px;
}

/* Low Stock Alert */
.low-alert {
  background: linear-gradient(90deg, #fff8e1 0%, #ffecb3 100%);
  border: 1px solid #ffc107;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 12px 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.low-alert.hidden { display: none; }
.low-alert-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}
.low-alert-body { flex: 1; min-width: 0; }
.low-alert-title {
  font-weight: 600;
  font-size: 13px;
  color: #e65100;
  margin-bottom: 6px;
}
.low-alert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.low-chip {
  background: #fff;
  border: 1px solid #ffca28;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
}
.low-chip b { color: #d84315; }
.low-alert-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #e65100;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.cam-box {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 8px; margin-bottom: 8px;
}
#camReader {
  height: 148px;
  overflow: hidden;
  border-radius: 10px;
  background: #111;
  position: relative;
}
#camReader video,
#camReader canvas {
  width: 100% !important;
  height: 148px !important;
  max-height: 148px !important;
  object-fit: cover !important;
}
#camReader__scan_region {
  min-height: 0 !important;
  height: 148px !important;
  overflow: hidden;
}
#camReader__dashboard,
#camReader__dashboard_section,
#camReader__header_message,
#camReader__filescan {
  display: none !important;
}
.cam-box .btn { margin-top: 8px; width: 100%; }
label { font-size: 12px; color: var(--muted); display: block; margin-top: 4px; }

.login-body {
  min-height: 100dvh; display: grid; place-items: center;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(160deg, #1d6a54 0%, #0f3d32 50%, #0a2a22 100%);
}
.login-card {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-brand {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.login-brand .logo-mark {
  width: 56px;
  height: 56px;
  font-size: 22px;
  border-radius: 14px;
}
.login-brand h1 { margin: 0; font-size: 24px; line-height: 1.2; }
.login-brand p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.login-card form { display: grid; gap: 16px; }
.login-card label { margin-bottom: -10px; font-weight: 600; }
.login-card input {
  padding: 14px 16px;
  font-size: 16px;
  border-radius: 12px;
}
.login-card .btn {
  min-height: 52px;
  margin-top: 8px;
  font-size: 16px;
  border-radius: 12px;
}
.login-card .hint {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
}
.login-card .alert {
  margin-bottom: 8px;
}

.ticket-preview {
  background: #ececec;
  border-radius: 10px;
  padding: 12px 8px;
  display: flex;
  justify-content: center;
  overflow-x: auto;
}
.struk-pre {
  margin: 0 auto;
  background: #fff;
  padding: 10px 8px;
  font-family: "Courier New", Courier, ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.28;
  color: #111;
  white-space: pre;
  letter-spacing: 0;
  box-shadow: 0 1px 0 rgba(0,0,0,.06);
}
.print-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.print-bar select { min-height: 42px; }
.toast {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(var(--bnav-h) + env(safe-area-inset-bottom, 0px) + 84px);
  background: var(--side); color: #fff; padding: 10px 14px; border-radius: 10px; z-index: 120;
}
.scan-hit { box-shadow: inset 0 0 0 2px var(--accent); background: #ecfdf3 !important; }

@media print {
  .mbar, .bnav, .cart-dock, .side, .nav-mask, .cart-mask { display: none !important; }
}

@media (max-width: 400px) {
  .card { min-height: 84px; padding: 7px; }
  .card b { font-size: 11px; }
  .card .price { font-size: 12px; }
  .scan-wrap .btn { min-width: 78px; padding: 10px 8px; font-size: 13px; }
  .cart-dock { left: 8px; right: 8px; padding: 6px; }
  .dock-info b { font-size: 15px; }
}

/* ===== Desktop ===== */
@media (min-width: 961px) {
  .mbar, .bnav, .cart-dock, .cart-handle, .cart-close { display: none !important; }
  .nav-mask, .cart-mask { display: none !important; }
  body.nav-open .side, .side {
    position: relative;
    transform: none;
    width: auto;
    inset: auto;
    padding: 18px 14px;
  }
  .app {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 100vh;
  }
  .side { grid-column: 1; grid-row: 1; }
  .main { grid-column: 2; grid-row: 1; }
  .main { padding: 16px 18px 24px; }
  .main.is-admin { padding: 22px 26px 40px; }
  .page-head { flex-direction: row; align-items: center; justify-content: space-between; }
  .page-head h1 { font-size: 26px; }
  .page-head .row, .page-head .btn { width: auto; }
  .toolbar, .topbar {
    display: flex; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap;
  }
  .toolbar.cardish input, .toolbar.cardish select { max-width: 280px; }
  .desk-only { display: inline-flex !important; align-items: center; justify-content: center; }
  .mob-only { display: none !important; }
  .filter-sub { display: block; }
  .scan-wrap { flex-wrap: nowrap; flex: 1; }
  .scan-wrap .btn { flex: none; }
  .stats { display: flex; gap: 16px; }
  .stats span { display: block; color: var(--muted); font-size: 12px; }
  .kasir { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
  .filters { flex-wrap: wrap; overflow: visible; margin: 0 0 8px; padding: 0; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .cart {
    position: sticky; top: 12px; transform: none; max-height: none;
    border-radius: 14px; box-shadow: var(--shadow);
  }
  .modal { place-items: center; padding: 16px; align-items: center; }
  .sheet { width: min(440px, 100%); border-radius: 16px; padding: 18px; }
  .sheet.wide { width: min(640px, 100%); }
  .ticket-sheet { width: min(400px, 100%); }
  .two { grid-template-columns: 1fr 1fr; }
  .row-btns { display: flex; justify-content: flex-end; }
  .kpi { grid-template-columns: repeat(3, 1fr); }
  .kpi-4 { grid-template-columns: repeat(4, 1fr); }
  .cards-2 { grid-template-columns: 1fr 1fr; }
  .table thead { display: table-header-group; }
  .table, .table tbody, .table tr { display: table; width: 100%; }
  .table tr { display: table-row; padding: 0; border-bottom: 0; }
  .table td, .table th {
    display: table-cell; padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left;
  }
  .table td::before { content: none; }
  .table th { background: #f4faf6; font-size: 12px; text-transform: uppercase; color: var(--muted); }
  .toast { left: auto; right: 16px; bottom: 16px; width: auto; }
  .cam-box .btn { width: auto; }
  #camReader,
  #camReader video,
  #camReader canvas,
  #camReader__scan_region {
    height: 180px !important;
    max-height: 180px !important;
  }
  /* Report Desktop */
  .kpi-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .report-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
  .filter-row { flex-wrap: nowrap; }
  .filter-group { flex: 0 0 auto; min-width: 160px; }
}
