:root {
  --brand: #0f766e;
  --brand-strong: #115e59;
  --brand-soft: #e3f3f0;
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #f7f9fa;
  --line: #e2e7eb;
  --line-strong: #cbd3da;
  --text: #17212b;
  --text-2: #46525f;
  --muted: #6b7785;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #b45309;
  --warn-soft: #fdf3e1;
  --danger: #c81e1e;
  --danger-soft: #fdecec;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { line-height: 1.25; }
a { color: var(--brand); }
button { font: inherit; color: inherit; }
.boot { min-height: 100dvh; display: grid; place-items: center; color: var(--muted); }

/* ---------- kontrol dasar */
input, select, textarea {
  font: inherit; color: var(--text); width: 100%; min-height: 40px; padding: 8px 11px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
}
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 1px;
}
input:disabled { background: var(--surface-2); color: var(--muted); }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); flex: none; }
input[type=file] { padding: 7px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-strong); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(15, 23, 42, .05); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-ghost { background: transparent; border-color: transparent; color: var(--danger); }
.btn.danger-ghost:hover { background: var(--danger-soft); }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.on { background: var(--brand-soft); color: var(--brand-strong); }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 8px;
  background: transparent; cursor: pointer; color: inherit; flex: none;
}
.icon-btn:hover { background: rgba(15, 23, 42, .07); }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; text-decoration: underline dotted; }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.hint { font-size: 12px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; cursor: pointer; }
.checks { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-bottom: 8px; }
.input-group { display: flex; gap: 6px; }
.input-group > input { flex: 1; min-width: 0; }
.form-section { font-size: 12px; margin: 18px 0 8px; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }
.form-error { color: var(--danger); font-size: 14px; margin: 4px 0 12px; }
.form-error:empty { display: none; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.pre-line { white-space: pre-line; }
.mono { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 13px; }
.neg { color: var(--danger); }
.pos-val { color: var(--ok); font-weight: 700; }
.warn-text { color: var(--warn); font-weight: 600; }
.link { display: inline-block; margin-top: 8px; font-size: 14px; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: #eef1f4; color: var(--text-2); white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.muted { background: #eef1f4; color: var(--muted); }

.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 32px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { background: var(--warn-soft); border: 1px solid #f3d7a8; border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.error-box p { margin: 0 0 10px; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; grid-column: 1 / -1; }
.empty.small { padding: 8px; font-size: 13px; }
.empty p { margin: 6px 0 2px; font-weight: 600; color: var(--text-2); }

/* ---------- tabel */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card .table-wrap, .modal .table-wrap { border-radius: 8px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.tbl th, .tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--surface-2); }
.tbl td.empty { padding: 24px; }
.qty-input { width: 110px; min-height: 34px; padding: 4px 8px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 2px; color: var(--muted); font-size: 13px; }
.pager:only-child, .pager span:only-child { margin-left: auto; }

/* ---------- toast & modal */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(460px, calc(100% - 24px)); }
.toast { background: #17212b; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: 14px; transition: opacity .3s, transform .3s; }
.toast.ok { background: #14532d; }
.toast.error { background: #7f1d1d; }
.toast.warn { background: #78350f; }
.toast.hide { opacity: 0; transform: translateY(6px); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 50; display: grid; place-items: center; padding: 12px; }
.modal { background: var(--surface); border-radius: 14px; width: min(520px, 100%); max-height: calc(100dvh - 24px); display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.modal.wide { width: min(980px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 4px 18px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 8px 18px 12px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.modal-foot .danger-ghost { margin-right: auto; }
.summary { background: var(--surface-2); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.trow { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.trow > span:last-child { text-align: right; }
.trow.grand { font-weight: 700; font-size: 17px; border-top: 1px dashed var(--line-strong); margin-top: 4px; padding-top: 6px; }
.trow.note { color: var(--muted); font-size: 13px; }
.menu-list { display: flex; flex-direction: column; gap: 2px; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; font-size: 15px; }
.menu-item:hover { background: var(--surface-2); }
.menu-item.active { background: var(--brand-soft); }
.menu-item small { color: var(--muted); }
.op-list { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0 12px; max-height: 300px; overflow: auto; }
.op { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.op:last-child { border-bottom: 0; }
.op small { display: block; color: var(--danger); }
.op.bad { background: var(--danger-soft); }
.error-list { max-height: 260px; overflow: auto; font-size: 14px; }
.update-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 90; display: flex; gap: 12px; align-items: center; background: #17212b; color: #fff; padding: 8px 8px 8px 16px; border-radius: 10px; box-shadow: var(--shadow); width: max-content; max-width: calc(100% - 24px); }
.update-bar span { font-size: 14px; }

/* ---------- login / setup */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.auth-card { background: var(--surface); border-radius: 16px; padding: 28px; width: min(400px, 100%); box-shadow: var(--shadow); }
.auth-card.wide { width: min(640px, 100%); }
.auth-card h2 { margin-top: 0; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.brand img { border-radius: 10px; flex: none; }
.brand strong { display: block; font-size: 17px; }
.brand small { display: block; color: var(--muted); }

/* ---------- kerangka back office */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100dvh; }
.side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100dvh; overflow: auto; }
.side .brand { padding: 0 6px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-weight: 500; }
.nav-link:hover { background: var(--surface-2); }
.nav-link.active { background: var(--brand-soft); color: var(--brand-strong); font-weight: 650; }
.side-user { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding: 12px 6px 0; margin-top: 12px; }
.side-user strong, .side-user small { display: block; }
.side-user small { color: var(--muted); font-size: 12px; }
.side-user-actions { display: flex; }
.side-overlay { display: none; }
.topbar { display: none; }
.main { padding: 24px 28px 48px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.page-head h1 { margin: 0; font-size: 22px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page > p.muted { margin: 0 0 14px; max-width: 80ch; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.filters > select, .filters > input { width: auto; min-width: 150px; }
.filters > input[type=search] { flex: 1 1 200px; }
.date-range { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.date-range input { width: auto; }
.date-range select { width: auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; min-width: 0; }
.card-title { font-size: 15px; margin: 0 0 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: 12px; }
.table-toggle { margin-top: 10px; }
.table-toggle summary { cursor: pointer; color: var(--brand); font-size: 14px; margin-bottom: 8px; }

/* ---------- tab, laba/rugi, kedaluwarsa, izin */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 4px 0 14px; overflow-x: auto; }
.tab-btn { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--brand-strong); border-bottom-color: var(--brand); }
.pl { display: flex; flex-direction: column; }
.pl-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.pl-row small { color: var(--muted); }
.pl-row.minus > span:last-child { color: var(--text-2); }
.pl-row.sub { font-weight: 700; border-bottom: 1px solid var(--line-strong); }
.pl-row.total { font-weight: 800; font-size: 18px; border-bottom: 0; padding-top: 10px; }
.pl-row.total.pos > span:last-child { color: var(--ok); }
.pl-row.total.neg > span:last-child { color: var(--danger); }
.exp-buckets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.exp-bucket { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.exp-bucket strong { font-size: 20px; }
.exp-bucket span { font-size: 12px; color: var(--text-2); }
.exp-bucket small { font-size: 11px; color: var(--muted); }
.exp-bucket.expired { background: var(--danger-soft); border-color: #f3c4c4; }
.exp-bucket.d7 { background: #fff1ec; }
.exp-bucket.d30 { background: var(--warn-soft); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 12px; }
.tier-row.three { grid-template-columns: 1.4fr 1fr 1fr auto; }
.tier-row.four { grid-template-columns: 1fr 0.8fr 1fr 1.2fr auto; }
.inline-field { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2); }
.inline-field .qty-input { width: 80px; }
.date-input { min-height: 34px; padding: 4px 8px; width: auto; }
.cust-btn { display: flex; align-items: center; gap: 10px; margin: 8px 12px 0; padding: 8px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left; }
.cust-btn > span { display: flex; flex-direction: column; min-width: 0; }
.cust-btn small { color: var(--muted); font-size: 12px; }
.cust-btn.on { border-style: solid; border-color: var(--brand); background: var(--brand-soft); }
.cust-list { max-height: 50vh; overflow: auto; margin-top: 8px; }
.unit-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-strong); font-size: 12px; font-weight: 700; }

/* ---------- anti-kecurangan */
.lock-screen { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: linear-gradient(160deg, var(--brand-strong), #0b3b38); }
.lock-screen .auth-card { text-align: center; }
.lock-screen input { text-align: center; font-size: 24px; letter-spacing: .4em; margin: 8px 0; }
.lock-screen .btn.block { margin-top: 8px; }
.lock-ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 8px; background: var(--brand-soft); color: var(--brand-strong); }
.alert-card { border-color: #f3d7a8; background: var(--warn-soft); }
.alert-card.high { border-color: #f3c4c4; background: var(--danger-soft); }
.alert-head { display: flex; align-items: center; gap: 12px; }
.alert-head > div { flex: 1; min-width: 0; }
.alert-head .btn { text-decoration: none; color: inherit; }
.kpi.wide { grid-column: span 2; }
.chips.static { flex-wrap: wrap; padding-top: 4px; }

/* ---------- grafik */
.chart { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: #edf0f3; stroke-width: 1; }
.chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; }
.chart .value-label { fill: var(--text-2); font-size: 11px; font-weight: 600; }
.chart .bar { fill: var(--brand); transition: fill .1s; }
.chart .bar.hover { fill: var(--brand-strong); }
.chart .hit { fill: transparent; cursor: default; outline: none; }
.chart .hit:focus-visible { fill: rgba(15, 118, 110, .08); }
.chart-tip { position: absolute; z-index: 2; pointer-events: none; background: #17212b; color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 12px; display: flex; flex-direction: column; white-space: nowrap; box-shadow: var(--shadow); }
.chart-tip strong { font-size: 12px; }
.chart-tip span { font-size: 14px; font-weight: 700; }
.chart-tip small { opacity: .8; }

/* ---------- produk & stok */
.variant-row { border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px 6px; margin-bottom: 10px; background: var(--surface-2); }
.variant-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 10px; }
.variant-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.tier-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.tier-row .icon-btn { margin-bottom: 12px; }
.picker { margin-bottom: 12px; }
.picker-list { border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; max-height: 240px; overflow: auto; background: var(--surface); }
.picker-list:empty { display: none; }
.picker-item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; }
.picker-item:hover, .picker-item:focus-visible { background: var(--brand-soft); }
.picker-item small { color: var(--muted); }
.picker-empty { padding: 10px 12px; color: var(--muted); font-size: 14px; }
.scan-video { width: 100%; max-height: 55vh; border-radius: 8px; background: #000; display: block; }

/* ---------- layar kasir */
.pos { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100dvh; background: var(--bg); }
.pos-top { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--brand-strong); color: #fff; }
.pos-top .icon-btn:hover { background: rgba(255, 255, 255, .12); }
.pos-title { flex: 1; min-width: 0; }
.pos-title strong { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-title small { display: block; opacity: .85; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.sync-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #86efac; }
.sync-pill.busy .dot { background: #fde68a; animation: pulse 1s infinite; }
.sync-pill.warn { background: #fef3c7; color: #92400e; }
.sync-pill.warn .dot { background: #d97706; }
.sync-pill.off { background: #fee2e2; color: #991b1b; }
.sync-pill.off .dot { background: #dc2626; }
@keyframes pulse { 50% { opacity: .3; } }
.pos-body { display: grid; grid-template-columns: minmax(0, 1fr) 390px; min-height: 0; }
.pos-left { display: flex; flex-direction: column; min-height: 0; padding: 12px 12px 0; }
.pos-searchbar { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 6px 0 12px; }
.pos-searchbar:focus-within { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.search-ico { color: var(--muted); display: grid; }
.pos-search { border: 0; min-height: 48px; font-size: 16px; padding: 8px 4px; background: transparent; }
.pos-search:focus-visible { outline: none; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: thin; }
.chips:empty { display: none; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: 14px; white-space: nowrap; cursor: pointer; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.product-grid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; gap: 8px; padding: 10px 0 16px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 96px; padding: 10px 12px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: transform .06s, border-color .12s; }
.tile:hover { border-color: var(--brand); }
.tile:active { transform: scale(.97); }
.tile-name { font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-var { font-size: 13px; color: var(--text-2); }
.tile-foot { margin-top: auto; padding-top: 6px; display: flex; justify-content: space-between; align-items: baseline; gap: 6px; width: 100%; }
.tile-price { font-weight: 700; color: var(--brand-strong); font-variant-numeric: tabular-nums; }
.tile-stock { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tile.out .tile-stock { color: var(--danger); font-weight: 600; }
.pos-right { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-left: 1px solid var(--line); }
.cart-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.cart-head .row-actions { gap: 2px; }
.cart-lines { flex: 1; overflow: auto; min-height: 0; }
.cart-lines .empty { color: var(--muted); padding-top: 48px; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "info info" "qty total"; gap: 6px 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); align-items: center; }
.cart-info { grid-area: info; display: flex; flex-direction: column; align-items: flex-start; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; min-width: 0; }
.cart-name { font-weight: 600; }
.cart-name small { color: var(--text-2); font-weight: 500; }
.cart-sub { font-size: 12px; color: var(--muted); }
.cart-total { grid-area: total; text-align: right; font-variant-numeric: tabular-nums; }
.qty { grid-area: qty; display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; justify-self: start; }
.qty-btn { width: 36px; height: 34px; border: 0; background: var(--surface-2); display: grid; place-items: center; cursor: pointer; }
.qty-btn:hover { background: var(--brand-soft); }
.qty-val { min-width: 44px; height: 34px; border: 0; background: var(--surface); font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.cart-line.flash { animation: flash .6s ease-out; }
@keyframes flash { from { background: var(--brand-soft); } to { background: transparent; } }
.cart-totals { padding: 10px 16px 4px; border-top: 1px solid var(--line); }
.cart-totals .trow.grand { font-size: 20px; }
.pay-btn { margin: 8px 16px 16px; min-height: 58px; font-size: 18px; justify-content: space-between; padding: 8px 18px; }
.pay-btn small { font-size: 12px; opacity: .7; font-weight: 500; }
.pos-tabs { display: none; }

.pay-total { text-align: center; padding: 4px 0 12px; }
.pay-total small { display: block; color: var(--muted); }
.pay-total strong { font-size: 32px; font-variant-numeric: tabular-nums; }
.methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; }
.method { min-height: 44px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font-weight: 600; cursor: pointer; font-size: 14px; }
.method.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); box-shadow: inset 0 0 0 1px var(--brand); }
.big-input { font-size: 22px; font-weight: 700; min-height: 52px; font-variant-numeric: tabular-nums; }
.quick-cash { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.change-line { display: flex; justify-content: space-between; align-items: center; background: var(--surface-2); border-radius: 8px; padding: 10px 14px; font-size: 16px; }
.change-line strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.change-big { text-align: center; margin-bottom: 12px; }
.change-big small { display: block; color: var(--muted); }
.change-big strong { font-size: 34px; color: var(--brand-strong); font-variant-numeric: tabular-nums; }

/* ---------- struk */
.receipt { font: 12px/1.35 ui-monospace, Consolas, "Courier New", monospace; color: #000; background: #fff; }
.receipt.p58 { font-size: 11px; }
.receipt .r-center { text-align: center; }
.receipt .big { font-size: 1.4em; }
.receipt .b { font-weight: 700; }
.receipt .r-left { word-break: break-word; }
.receipt .r-pair { display: flex; justify-content: space-between; gap: 8px; }
.receipt .r-pair span:first-child { white-space: pre-wrap; }
.receipt .r-pair span:last-child { white-space: nowrap; }
.receipt .r-sep { border-top: 1px dashed #000; margin: 4px 0; }
.receipt-preview { background: #e9edf0; border-radius: 8px; padding: 16px; display: flex; justify-content: center; max-height: 58vh; overflow: auto; }
.receipt-preview .receipt { padding: 12px 12px 18px; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); width: 270px; }
.receipt-preview .receipt.p80 { width: 350px; }
#print-area { display: none; }

@media print {
  @page { margin: 0; }
  html, body { background: #fff !important; height: auto; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
  #print-area .receipt { width: 100%; padding: 2mm 3mm 6mm; }
}

/* ---------- layar kecil */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .shell.nav-open .side { transform: none; }
  .shell.nav-open .side-overlay { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 30; }
  .topbar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .main { padding: 16px 16px 40px; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .exp-buckets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tier-row.three, .tier-row.four { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .pos-body { grid-template-columns: minmax(0, 1fr); }
  .pos[data-tab=products] .pos-right, .pos[data-tab=cart] .pos-left { display: none; }
  .pos-right { border-left: 0; }
  .pos-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .pos-tabs .tab { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 52px; border: 0; background: none; font-weight: 600; color: var(--muted); cursor: pointer; }
  .pos-tabs .tab.active { color: var(--brand-strong); box-shadow: inset 0 3px 0 var(--brand); }
  .tab-badge:not(:empty) { background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .pos-title small { font-size: 11px; }
  .update-bar { bottom: auto; top: 64px; }
  .page-head h1 { font-size: 19px; }
}
@media (max-width: 480px) {
  .methods { grid-template-columns: repeat(2, 1fr); }
  .auth-card { padding: 20px; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { border-radius: 14px 14px 0 0; max-height: 94dvh; }
  .filters > select, .filters > input { flex: 1 1 140px; min-width: 0; }
}

/* ---------- kasir dengan keyboard */
kbd { display: inline-block; min-width: 22px; padding: 1px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--text-2); font: 600 11px/1.4 ui-monospace, Consolas, monospace; text-align: center; margin-left: 6px; vertical-align: middle; }
.pay-btn small { margin-left: 8px; opacity: .85; }
.kb-hints { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 2px 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.kb-hints:empty { display: none; }
.kb-hints kbd { margin: 0 4px 0 0; }
.kb-help { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.tile.kb-sel { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), inset 0 0 0 1px var(--brand); background: var(--brand-soft); }
.tile-sku { font: 600 11px/1.3 ui-monospace, Consolas, monospace; color: var(--brand-strong); letter-spacing: .02em; }
.cart-lines:focus { outline: none; }
.cart-lines:focus .cart-line.kb-sel { box-shadow: inset 4px 0 0 var(--brand); background: var(--brand-soft); }
.cart-line.kb-sel { background: var(--surface-2); }
.qty-modal .qty-input { text-align: right; font-size: 30px; }
.qty-preview { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 12px; margin-top: 8px; border-radius: 8px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.qty-preview strong { font-size: 20px; color: var(--brand-strong); }
.pay-input { text-align: right; font-size: 30px; }
.quick-cash .btn.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); box-shadow: inset 0 0 0 1px var(--brand); }
.menu-item .grow { flex: 1; }
.keys-list .menu-item { padding: 9px 12px; }
.keys-list .menu-item.capturing { background: var(--warn-soft); }
.keys-list .menu-item.capturing kbd { color: var(--warn); border-color: var(--warn); }
.keys-list .menu-item:focus-visible, .menu-list .menu-item:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* nota besar setelah transaksi (bisa ditunjukkan ke pelanggan) */
.receipt-modal.big { width: min(760px, 100%); }
.receipt-modal.big .receipt-preview { max-height: 66vh; padding: 20px; }
.receipt-modal.big .receipt-preview .receipt { width: 400px; font-size: 16px; }
.receipt-modal.big .receipt-preview .receipt.p80 { width: 500px; }
.receipt-preview:focus { outline: none; }
.receipt-modal.no-print .receipt-preview .receipt { width: 480px; font-size: 19px; }
.receipt-modal.no-print .receipt-preview { max-height: 70vh; }
.print-alert { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 16px; margin-bottom: 12px; border-radius: 10px; background: var(--danger); color: #fff; }
.print-alert[hidden] { display: none; }
.print-alert strong { font-size: 26px; letter-spacing: .03em; }
.print-alert span { font-size: 18px; font-weight: 600; }
.print-alert small { opacity: .9; }
.print-alert .btn { margin-top: 6px; background: #fff; color: var(--danger); border-color: #fff; }

/* tentang aplikasi */
.auth { align-content: center; gap: 12px; }
.about-link { color: var(--muted); }
.about { text-align: center; }
.about h2 { margin: 8px 0 2px; }
.about-ver { font-weight: 600; margin: 0 0 10px; }
.about-by { margin-top: 14px; font-size: 1.05rem; }
.about .heart { color: #e0245e; }

@media (pointer: coarse) { .kb-hints, .kb-help { display: none; } }
@media (max-width: 820px) {
  .receipt-modal.big .receipt-preview .receipt, .receipt-modal.no-print .receipt-preview .receipt { width: 100%; font-size: 14px; }
}

/* sinkron Shopee */
.kpi-value.small-val { font-size: 17px; }
.steps { margin: 4px 0 12px; padding-left: 20px; color: var(--text-2); }
.steps li { margin-bottom: 4px; }
.pick-list { max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; }
.pick-list .menu-item small { color: var(--muted); }
.row-actions.wrap { flex-wrap: wrap; }
.row-actions.nowrap { flex-wrap: nowrap; justify-content: flex-end; }

/* kategori & harga */
.badge.special { background: var(--brand-soft); color: var(--brand-strong); }
.pc-kpis { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pc-kpi { text-align: left; cursor: pointer; border: 1px solid var(--line); font: inherit; }
.pc-kpi:hover { border-color: var(--brand); }
.pc-kpi.active { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.pc-moved { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.pc-help { margin: 4px 0 12px; }
.pc-help summary { cursor: pointer; color: var(--brand-strong); font-weight: 600; }
.pc-help ul { margin: 8px 0 0; padding-left: 20px; color: var(--text-2); }
.pc-help li { margin-bottom: 4px; }
.pc-dash .chips.static { margin: 6px 0 4px; }

/* penjelasan hak akses */
.access-box { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px 20px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); margin: 6px 0 10px; }
.access-box > p { grid-column: 1 / -1; margin: 0; }
.access-box ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.access-box li { margin-bottom: 4px; }
@media (max-width: 720px) { .access-box { grid-template-columns: minmax(0, 1fr); } }

/* cadangan VPS */
.offsite-src { padding: 8px 0; border-top: 1px solid var(--line); }
.offsite-src .row-actions { margin-top: 4px; }

/* asisten AI */
.ai-text { white-space: pre-line; line-height: 1.55; }
.chat-log { max-height: 55vh; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); margin: 10px 0; }
.chat-msg { max-width: 85%; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.chat-msg.user { align-self: flex-end; background: var(--brand-soft); border-color: transparent; }
.chat-msg small { display: block; margin-top: 4px; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; }
.chat-input textarea { flex: 1; }
.grid-ev { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 1.3fr) 80px auto; gap: 6px; align-items: center; margin-bottom: 6px; }

@media (max-width: 720px) { .grid-ev { grid-template-columns: minmax(0, 1fr); } }
.tabs.wrap { flex-wrap: wrap; overflow: visible; }
.pick-cell { display: flex; flex-direction: column; gap: 4px; min-width: 200px; }
.pick-cell .mini-search { font-size: 13px; padding: 4px 8px; }

/* impor Olsera */
.modal.olsera-modal { width: min(1180px, 100%); }
.olsera-help p { margin: 0 0 6px; }
.olsera-table { max-height: 52vh; overflow: auto; }
.olsera-table tr.row-off td { opacity: .55; }
.olsera-notes { max-width: 340px; }
.map-box { margin: 10px 0; }
.map-box summary { cursor: pointer; font-weight: 600; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 12px; margin-top: 8px; }
.olsera-foot { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 0 2px; background: var(--surface); border-top: 1px solid var(--line); margin-top: 8px; }
.ok-box { padding: 12px 14px; border-radius: 12px; background: var(--ok-soft); color: var(--text); margin: 10px 0; }
.warn-box { padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--text); margin: 10px 0; }
/* stok di lokasi lain (kasir) */
.where-line { margin: -4px 0 8px; }
.where-qty { font-size: 1.15em; }
