/* ==========================================================================
   KasirKita POS — Prototype Styles
   ========================================================================== */

:root {
  /* Core Surfaces */
  --bg-canvas: #F5F6F1;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F3ED;
  --bg-elevated: #FAFBF8;

  /* Brand Palette (Warna.jpg — Electric Lime & Obsidian) */
  --brand-lime: #A8E745;
  --brand-lime-hover: #99D735;
  --brand-lime-soft: #EEF7DF;
  --brand-lime-border: #D5E7B9;
  --brand-olive: #3F5E16;
  --brand-olive-deep: #283D0D;

  /* Ink & Borders */
  --ink-primary: #192017;
  --ink-secondary: #586354;
  --ink-muted: #677262;
  --border-subtle: #E2E7DD;
  --border-strong: #CFD6C6;

  /* Semantic */
  --success-bg: #E6F7E9;
  --success-text: #15803D;
  --warning-bg: #FEF3C7;
  --warning-soft: #FEF8E7;
  --warning-border: #FDE68A;
  --warning-text: #B45309;
  --danger-bg: #FEE2E2;
  --danger-soft: #FEF2F2;
  --danger-border: #FCA5A5;
  --danger-text: #DC2626;

  /* Radii & Shadows */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(27, 41, 22, 0.025);
  --shadow-float: 0 12px 32px rgba(18, 20, 19, 0.12);
  --shadow-lime: 0 5px 16px rgba(89, 137, 21, 0.16);

  /* Timing */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --sidebar-w: clamp(188px, 15vw, 224px);
  --topbar-h: 62px;
  --workspace-gutter: clamp(16px, 1.6vw, 26px);
  --shell-edge: 12px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-canvas);
  color: var(--ink-primary);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  transition: transform 150ms var(--ease), background-color 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease), opacity 180ms var(--ease);
}

button:active:not(:disabled) {
  transform: scale(0.975);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand-olive);
  outline-offset: 2px;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* ==========================================================================
   App Shell (Desktop / Tablet Split Default + Mobile Preview Mode)
   ========================================================================== */

body.mobile-preview {
  background: #E8EBE2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 16px;
}

.preview-toolbar {
  display: none;
}

body.mobile-preview .preview-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  background: var(--ink-primary);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

body.mobile-preview .preview-toolbar button {
  background: var(--brand-lime);
  color: var(--ink-primary);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
}

.app-shell {
  display: flex;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-canvas);
  position: relative;
  overflow: hidden;
  container: pos-app / inline-size;
}

body.mobile-preview .app-shell {
  width: min(414px, 100%);
  height: min(868px, 100%);
  border-radius: 34px;
  border: 6px solid var(--ink-primary);
  box-shadow: 0 24px 56px rgba(27, 41, 22, 0.19);
}

/* ==========================================================================
   Sidebar (Desktop / Tablet)
   ========================================================================== */

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 10px 12px;
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 20;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 6px 21px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--brand-lime);
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-name {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
}

.brand-sub {
  font-size: 11px;
  color: var(--ink-secondary);
}

.brand-header > div:last-child,
.mobile-brand-bar > div:last-child {
  min-width: 0;
}

.brand-header .brand-sub,
.mobile-brand-bar .brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-header .brand-sub {
  white-space: normal;
  line-height: 1.3;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 39px;
  padding: 0 9px;
  border-radius: 8px;
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 500;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.nav-item:hover {
  background: var(--bg-subtle);
  color: var(--ink-primary);
}

.nav-item.active {
  background: var(--brand-lime-soft);
  color: var(--ink-primary);
  border-color: var(--brand-lime-border);
  font-weight: 650;
}

.nav-item.active .icon {
  color: var(--brand-olive);
  stroke-width: 2.15;
}

.nav-pill {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  background: var(--brand-lime-soft);
  color: var(--brand-olive-deep);
}

.nav-pill.warn {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.sidebar-status-card {
  background: var(--ink-primary);
  color: #FFFFFF;
  border-radius: 10px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 24px;
}

.status-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--brand-lime);
  font-size: 12px;
  font-weight: 700;
}

.status-meta {
  font-size: 11px;
  color: #A3ACA5;
  line-height: 1.4;
}

.sidebar-status-card .btn-lime-sm {
  border-radius: 7px;
  height: 32px;
  padding-inline: 8px;
  font-size: 11px;
  white-space: nowrap;
}

.btn-lime-sm {
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--brand-lime);
  color: var(--ink-primary);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
}

.btn-lime-sm:hover {
  background: var(--brand-lime-hover);
}

/* ==========================================================================
   Main Column & Topbar
   ========================================================================== */

.main-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 var(--workspace-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 15;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 25px);
  flex: 1;
  min-width: 0;
}

.topbar-view-title {
  display: none;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.main-col:has(#view-kasir.active) .topbar-view-title {
  display: block;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  height: 38px;
  padding: 0 5px 0 11px;
  width: 100%;
  max-width: 460px;
  min-width: 0;
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease);
}

.search-wrap > .icon { color: var(--ink-muted); }

.search-wrap:focus-within {
  border-color: var(--ink-primary);
  background: var(--bg-surface);
}

.search-wrap input {
  border: none;
  background: transparent;
  flex: 1;
  min-width: 0;
  font-size: 13px;
  outline: none;
}

.search-wrap input::placeholder {
  color: var(--ink-muted);
}

.scan-pill-btn {
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--brand-lime-soft);
  color: var(--brand-olive-deep);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.scan-pill-btn:hover {
  background: var(--brand-lime);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.view-mode-btn {
  height: 34px;
  padding: 0 9px;
  border-radius: 7px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--ink-primary);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.view-mode-btn:hover {
  border-color: var(--ink-primary);
}

.mobile-brand-bar {
  display: none;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mobile-kasir-heading { display: none; }

.icon-circle-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--ink-primary);
}

.icon-circle-btn:hover {
  background: var(--brand-lime-soft);
  border-color: var(--brand-lime-border);
}

.notif-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger-text);
  border: 2px solid var(--bg-surface);
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 4px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.profile-chip:hover {
  border-color: var(--border-strong);
}

.avatar-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink-primary);
  color: var(--brand-lime);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.profile-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.profile-role {
  font-size: 10px;
  color: var(--ink-secondary);
}

.offline-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: var(--radius-pill);
  background: var(--brand-lime-soft);
  color: var(--brand-olive);
  font-size: 11px;
  font-weight: 500;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16A34A;
}

/* ==========================================================================
   Main Viewport & Views
   ========================================================================== */

.workspace {
  flex: 1 1 0;
  min-height: 0;
  padding: 17px var(--workspace-gutter) 20px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: #BBC7B4 transparent;
}

.view-panel {
  display: none;
  flex-direction: column;
  gap: 18px;
  animation: fadeSlide 180ms var(--ease);
}

.view-panel.active {
  display: flex;
}

.page-heading {
  display: none;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.page-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.045em;
}

.page-action.chip-outline {
  height: 40px;
  gap: 8px;
  border-radius: 10px;
}

.page-action .nav-pill {
  min-width: 22px;
  padding-inline: 6px;
  text-align: center;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   KPI Cards & Hero Dashboard
   ========================================================================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-card);
  min-width: 0;
  text-align: left;
}

.kpi-card > :last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

button.kpi-card:hover {
  border-color: var(--brand-lime-border);
  background: var(--bg-elevated);
}

.kpi-card.hero-lime {
  background: radial-gradient(circle at 105% -20%, rgba(255, 255, 255, 0.27) 0 28%, transparent 28.5% 38%, rgba(255, 255, 255, 0.17) 38.5% 47%, transparent 47.5%), var(--brand-lime);
  border-color: var(--brand-lime);
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon.dark { background: var(--ink-primary); color: var(--brand-lime); }
.kpi-icon.lime { background: var(--brand-lime-soft); color: var(--brand-olive); }
.kpi-icon.success { background: var(--success-bg); color: var(--success-text); }
.kpi-icon.warn { background: var(--warning-bg); color: var(--warning-text); }
.kpi-icon.danger { background: var(--danger-bg); color: var(--danger-text); }

.kpi-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.kpi-card.hero-lime .kpi-label,
.kpi-card.hero-lime .kpi-sub {
  color: var(--brand-olive-deep);
}

.kpi-value {
  display: block;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.02em;
  margin: 2px 0;
  line-height: 1.2;
}

.kpi-sub {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.kpi-sub.pos { color: var(--success-text); }
.kpi-sub.warn { color: var(--warning-text); }

/* Dashboard Mobile/Hero Bento */
.dash-hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
}

.hero-lime-panel {
  background: var(--brand-lime);
  border-radius: var(--radius-xl);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-lime);
}

.hero-lime-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-trx-pill {
  background: rgba(18, 20, 19, 0.1);
  color: var(--ink-primary);
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
}

.hero-big-num {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink-primary);
}

.hero-mini-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(18, 20, 19, 0.08);
  border-radius: 14px;
  padding: 12px;
}

.hero-mini-label {
  font-size: 10px;
  color: var(--brand-olive-deep);
  font-weight: 600;
}

.hero-mini-val {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-primary);
  margin-top: 2px;
}

.dark-alert-banner {
  background: var(--ink-primary);
  color: #fff;
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dark-alert-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-lime-box {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--brand-lime);
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.shortcut-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-primary);
}

.shortcut-btn:hover {
  border-color: var(--brand-lime);
  background: var(--brand-lime-soft);
}

.shortcut-ic {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--bg-canvas);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   POS Split Workspace (Catalog + Sticky Cart Panel)
   ========================================================================== */

.pos-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(278px, 23vw, 352px);
  gap: 15px;
  align-items: start;
}

.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
}

.catalog-panel,
.cart-panel {
  border-radius: 11px;
  padding: 14px;
  box-shadow: none;
}

.catalog-panel {
  gap: 10px;
}

.catalog-view.chip-outline {
  height: 32px;
  border-radius: 7px;
  flex-shrink: 0;
}

.catalog-icon-button {
  width: 48px;
  height: 48px;
  padding: 0;
  justify-content: center;
  flex-shrink: 0;
}

.chip-outline.catalog-icon-button {
  height: 48px;
  border-radius: 7px;
}

.catalog-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border-subtle);
}

.catalog-filter-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-inline-start: auto;
  flex-shrink: 0;
}

.catalog-count {
  color: var(--ink-muted);
  font-size: 11px;
  white-space: nowrap;
}

#categoryPills { gap: 3px; }

#categoryPills .cat-pill {
  height: 32px;
  padding-inline: 10px;
  border-radius: 6px;
  font-weight: 500;
}

#categoryPills .cat-pill.active {
  font-weight: 650;
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.cat-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 3px;
  margin: -3px;
  scrollbar-width: none;
  min-width: 0;
  max-width: 100%;
}

.cat-pills::-webkit-scrollbar { display: none; }

.cat-pill {
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.cat-pill:hover {
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

.cat-pill.active {
  background: var(--brand-lime-soft);
  color: var(--brand-olive-deep);
  border-color: var(--brand-lime-border);
  font-weight: 700;
}

.chip-outline {
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip-outline:hover {
  background: var(--bg-subtle);
}

/* Mobile inline search bar inside Kasir */
.mobile-search-bar {
  display: none;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.catalog-empty {
  grid-column: 1 / -1;
}

.product-grid.list-mode {
  grid-template-columns: 1fr;
}

.product-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  transition: border-color 180ms var(--ease);
}

.product-card.selected {
  border-color: var(--brand-lime-hover);
}

.product-add {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  touch-action: manipulation;
}

.product-add:focus-visible { outline-offset: -4px; }
.product-add[aria-disabled="true"] { cursor: not-allowed; }
.product-add:active:not([aria-disabled="true"]) { background: rgb(63 94 22 / 0.10); }
.product-add:active:not(:disabled),
.product-quantity-minus:active:not(:disabled) { transform: none; }

@media (hover: hover) {
  .product-card:not(.selected):has(.product-add:hover:not([aria-disabled="true"])) {
    border-color: var(--border-strong);
  }
}

.product-grid.list-mode .product-card {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding-inline: 6px 88px;
}

.product-photo-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-subtle);
}

.product-grid.list-mode .product-photo-wrap {
  width: 48px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 6px;
}

.product-photo {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-photo-placeholder {
  width: 28%;
  height: auto;
  aspect-ratio: 1;
  color: var(--ink-muted);
  opacity: 0.48;
}

.product-photo + .product-photo-placeholder { visibility: hidden; }

:is(.cart-thumb, .prod-list-thumb)[src^="assets/catalog/"] {
  object-fit: contain;
  background: var(--bg-surface);
}

.product-quantity {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-end: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  height: 32px;
  max-width: calc(100% - 24px);
  padding-inline: 34px 9px;
  border-radius: var(--radius-pill);
  background: var(--brand-lime);
  color: var(--brand-olive-deep);
  font-size: 14px;
  font-weight: 650;
  line-height: 18px;
  pointer-events: none;
}

.product-quantity[hidden] { display: none; }

.product-grid.list-mode .product-quantity {
  inset-block-start: calc(50% - 16px);
  max-width: 76px;
}

/* Extend the minus hit area to the left without covering the quantity. */
.product-quantity-minus {
  position: absolute;
  inset-block-start: -8px;
  inset-inline-start: -16px;
  display: grid;
  place-items: center end;
  width: 48px;
  height: 48px;
  padding-inline-end: 3px;
  border-radius: var(--radius-pill);
  pointer-events: auto;
  touch-action: manipulation;
}

.product-quantity-minus span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-lime-soft);
  font-size: 19px;
  line-height: 1;
}

.product-quantity-minus:active span { background: var(--brand-lime-border); }
.product-quantity-minus:focus-visible { outline-offset: -2px; }

.product-quantity-value,
.product-name,
.product-price,
.product-description,
.product-stock {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  min-height: 90px;
  padding: 8px;
}

.product-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  color: var(--ink-primary);
}

.product-price {
  font-size: 17px;
  font-weight: 700;
  line-height: 20px;
  color: var(--ink-primary);
}

.product-description,
.product-stock {
  font-size: 11px;
  line-height: 15px;
  color: var(--ink-muted);
}

.product-stock.low { color: var(--warning-text); }
.product-stock.out { color: var(--danger-text); }
.product-grid.list-mode .product-body {
  min-height: 0;
  gap: 0;
  padding: 5px 0;
}

.product-grid.list-mode .product-name { font-size: 13px; line-height: 17px; }
.product-list-pricing {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}
.product-list-separator {
  flex-shrink: 0;
  color: var(--ink-muted);
}
.product-grid.list-mode .product-price { flex-shrink: 0; max-width: 65%; font-size: 14px; line-height: 18px; }
.product-grid.list-mode .product-stock { line-height: 14px; }

.mini-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 1px;
  flex-shrink: 0;
}

.mini-stepper button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}

.mini-stepper .st-minus {
  background: var(--bg-surface);
  color: var(--ink-primary);
}

.mini-stepper .st-plus {
  background: var(--brand-lime);
  color: var(--ink-primary);
}

.mini-stepper button:hover {
  background: var(--brand-lime-soft);
}

.mini-stepper .st-qty {
  font-size: 12px;
  font-weight: 800;
  min-width: 16px;
  text-align: center;
}

/* ==========================================================================
   Right Cart Panel (Desktop/Tablet) & Mobile Sticky Checkout Bar
   ========================================================================== */

.cart-panel {
  position: sticky;
  top: 12px;
  max-height: calc(100dvh - var(--topbar-h) - 2 * var(--shell-edge) - 26px);
  gap: 10px;
}

.cart-panel > .stack-md {
  min-height: 0;
  gap: 10px;
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cart-heading {
  min-width: 0;
  overflow-wrap: anywhere;
}

.cart-empty-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--brand-lime-soft);
  color: var(--brand-olive);
}

.cart-clear.btn-xs {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 7px;
  justify-content: center;
  flex-shrink: 0;
}

.cart-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.cart-items-scroll {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 300px;
  min-height: 0;
  scrollbar-width: thin;
}

.empty-state.cart-empty {
  background: var(--bg-elevated);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  padding: 18px 10px;
  gap: 4px;
  font-size: 12px;
}

.cart-empty strong {
  font-size: 13px;
  color: var(--ink-primary);
}

.cart-empty-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  margin-bottom: 4px;
}

.cart-item-row {
  background: var(--bg-canvas);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cart-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cart-thumb {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.cart-item-name {
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-meta {
  font-size: 11px;
  color: var(--ink-secondary);
}

#cartContextMeta { display: none; }
.cart-item-actions { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.cart-item-actions button { color: var(--ink-secondary); font-size: 11px; min-height: 32px; text-align: left; }
.cart-item-actions button:hover { color: var(--brand-olive); }

.cart-modifiers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.mod-pill {
  height: 32px;
  border-radius: 6px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.mod-pill span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mod-pill.active {
  background: var(--brand-lime-soft);
  border-color: var(--brand-lime-border);
  color: var(--brand-olive);
  font-weight: 700;
}

.cart-divider {
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.cart-payment {
  display: grid;
  gap: 6px;
}

.payment-label {
  font-size: 12px;
  font-weight: 700;
}

.pay-method-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.pm-pill {
  height: 34px;
  border-radius: 8px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.pm-pill.active {
  background: var(--brand-lime-soft);
  color: var(--brand-olive-deep);
  border-color: var(--brand-lime-border);
  font-weight: 700;
}

.pm-pill.kasbon {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: var(--warning-text);
}

.pm-pill.kasbon.active {
  background: var(--warning-text);
  color: #fff;
  border-color: var(--warning-text);
}

.summary-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sum-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-secondary);
}

.sum-row strong {
  color: var(--ink-primary);
  text-align: right;
}
.sum-row.discount strong { color: var(--success-text); }

.sum-row.total {
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  color: var(--ink-primary);
  font-weight: 700;
  font-size: 15px;
}

.sum-row.total strong {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

/* Primary Buttons (Touch Target >= 48px) */
.btn-primary {
  height: 50px;
  width: 100%;
  border-radius: 8px;
  background: var(--ink-primary);
  color: var(--brand-lime);
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
}

.btn-primary:hover:not(:disabled) {
  background: #1F2421;
  box-shadow: 0 8px 20px rgba(18, 20, 19, 0.2);
}

.cart-panel .btn-primary:disabled {
  background: var(--bg-subtle);
  color: var(--ink-muted);
  opacity: 1;
}

.btn-lime {
  height: 48px;
  border-radius: var(--radius-pill);
  background: var(--brand-lime);
  color: var(--ink-primary);
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
}

.btn-lime:hover:not(:disabled) {
  background: var(--brand-lime-hover);
}

.btn-soft-lime {
  height: 44px;
  width: 100%;
  border-radius: 10px;
  background: var(--brand-lime-soft);
  border: 1px solid var(--brand-lime-border);
  color: var(--brand-olive);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
}

.btn-soft-lime:hover:not(:disabled) {
  background: #E0F5C0;
}

.btn-outline {
  height: 44px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--ink-primary);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
}

.btn-danger {
  height: 46px;
  border-radius: var(--radius-pill);
  background: var(--danger-text);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 18px;
}

/* ==========================================================================
   Mobile Sticky Cart Bar & Floating 5-Tab Bottom Navigation
   ========================================================================== */

.mobile-cart-bar {
  display: none;
  background: var(--bg-surface);
  padding: 10px var(--workspace-gutter);
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.mobile-cart-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mobile-cart-summary .icon {
  color: var(--brand-olive);
}

.mobile-cart-total {
  font-size: 16px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.mobile-cart-bar .row-actions {
  justify-content: flex-end;
}

.mobile-cart-bar .btn-xs,
.mobile-cart-bar .btn-primary {
  width: auto;
  height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 12px;
  transition: background-color 140ms var(--ease), transform 140ms var(--ease);
}

.mobile-bottom-nav {
  --nav-idle: clamp(44px, 12cqw, 52px);
  --nav-active: clamp(56px, 15cqw, 62px);
  display: none; align-items: center; gap: 5px; height: calc(var(--nav-active) + 14px); box-sizing: border-box;
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-pill);
  box-shadow: 0 6px 20px rgba(27, 41, 22, 0.11); margin: 0 12px calc(12px + env(safe-area-inset-bottom)); padding: 6px; flex-shrink: 0;
}
.mob-nav-btn {
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 var(--nav-idle); width: var(--nav-idle); height: var(--nav-idle); min-width: var(--nav-idle);
  overflow: hidden; border-radius: var(--radius-pill); background: var(--bg-subtle); color: var(--ink-secondary);
  transition: flex-grow 260ms cubic-bezier(.4, 0, .2, 1), height 260ms cubic-bezier(.4, 0, .2, 1), background-color 260ms cubic-bezier(.4, 0, .2, 1), color 260ms cubic-bezier(.4, 0, .2, 1), padding 260ms cubic-bezier(.4, 0, .2, 1);
}
.mob-nav-btn.active {
  flex-grow: 1; height: var(--nav-active); justify-content: flex-start; padding: 0 10px 0 5px;
  background: var(--brand-lime-soft); color: var(--brand-olive-deep);
}
.mob-nav-icon {
  display: grid; place-items: center;
  width: calc(var(--nav-idle) - 10px); height: calc(var(--nav-idle) - 10px); flex: 0 0 calc(var(--nav-idle) - 10px);
  border-radius: 50%; transition: width 260ms cubic-bezier(.4, 0, .2, 1), height 260ms cubic-bezier(.4, 0, .2, 1), flex-basis 260ms cubic-bezier(.4, 0, .2, 1), background-color 260ms cubic-bezier(.4, 0, .2, 1);
}
.mob-nav-btn.active .mob-nav-icon {
  width: calc(var(--nav-active) - 10px); height: calc(var(--nav-active) - 10px); flex: 0 0 calc(var(--nav-active) - 10px);
  background: var(--brand-lime); color: var(--ink-primary);
}
.mob-nav-btn .icon { width: 21px; height: 21px; transition: width 260ms cubic-bezier(.4, 0, .2, 1), height 260ms cubic-bezier(.4, 0, .2, 1); }
.mob-nav-btn.active .icon { width: 26px; height: 26px; stroke-width: 2.15; }
.mob-nav-label {
  max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap;
  font-size: 13.5px; font-weight: 700; transform: translateX(-5px);
  transition: max-width 260ms cubic-bezier(.4, 0, .2, 1), opacity 260ms cubic-bezier(.4, 0, .2, 1), transform 260ms cubic-bezier(.4, 0, .2, 1), margin 260ms cubic-bezier(.4, 0, .2, 1);
}
.mob-nav-btn.active .mob-nav-label {
  flex: 1; text-align: center; max-width: 120px; margin-left: 6px; opacity: 1; transform: translateX(0);
}
@container pos-app (max-width: 340px) {
  .mobile-bottom-nav { --nav-idle: 42px; --nav-active: 52px; gap: 3px; margin-inline: 8px; }
  .mob-nav-btn.active { justify-content: center; padding: 0; }
  .mob-nav-btn.active .mob-nav-label { flex: 0; max-width: 0; margin-left: 0; opacity: 0; }
}

/* Cart review shared by mobile and tablet */
.mob-cart-sheet { display: flex; flex-direction: column; gap: 12px; }
.modal-actions.cart-review-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}
.modal-actions.cart-review-actions > button {
  width: 100%;
  min-width: 0;
  height: 50px;
  min-height: 46px;
  padding-inline: 8px;
  justify-content: center;
  white-space: nowrap;
}
.mob-cart-items { max-height: 50dvh; overflow-y: auto; padding-right: 2px; }
.cart-item-row.cart-review-item { flex: 0 0 auto; gap: 7px; padding: 11px; }
.cart-review-item .cart-item-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  overflow-wrap: anywhere;
}
.cart-review-line-total { display: block; font-size: 13px; font-weight: 800; color: var(--ink-primary); margin-top: 2px; }
.mini-stepper.cart-review-stepper { border-radius: var(--radius-pill); background: var(--bg-surface); padding: 3px; gap: 6px; }
.mini-stepper.cart-review-stepper button { width: 34px; height: 34px; border-radius: 50%; font-size: 17px; }
.cart-review-stepper .st-minus { background: var(--bg-subtle); color: var(--ink-primary); }
.cart-review-stepper .st-plus { background: var(--brand-lime); color: var(--ink-primary); }
.cart-review-stepper .st-qty { min-width: 20px; font-size: 13px; }
.mob-item-tag {
  font-size: 11px; font-weight: 600; color: var(--ink-secondary);
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: 8px; padding: 4px 9px;
}
.mob-item-tag.discount { color: var(--success-text); background: var(--success-bg); border-color: transparent; }
.cart-review-item .cart-item-actions { gap: 6px; padding-top: 2px; }
.cart-review-item .cart-item-actions button {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; min-height: 30px; padding: 0 10px;
  border-radius: var(--radius-pill); background: var(--bg-surface); border: 1px solid var(--border-subtle);
  color: var(--ink-secondary); font-size: 11px; font-weight: 600;
}
.cart-review-item .cart-item-actions button:hover { border-color: var(--brand-lime-border); color: var(--brand-olive-deep); }
.cart-review-item .cart-item-actions button.has-val {
  background: var(--brand-lime-soft); border-color: var(--brand-lime-border); color: var(--brand-olive-deep); font-weight: 700;
}
.cart-modifiers.cart-review-modifiers { flex-shrink: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cart-review-modifiers .mod-pill { height: 40px; border-radius: 10px; padding-inline: 8px; font-size: 12px; gap: 5px; }
.cart-review-modifiers .icon { flex-shrink: 0; }
.mob-inline-editor { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.mob-disc-toggle {
  display: inline-flex; align-items: center; height: 42px; padding: 3px; flex-shrink: 0;
  border-radius: 12px; background: var(--bg-subtle); border: 1px solid var(--border-subtle); gap: 2px;
}
.mob-disc-toggle button {
  height: 34px; min-width: 34px; padding: 0 9px; border-radius: 9px;
  font-size: 12px; font-weight: 700; color: var(--ink-secondary);
}
.mob-disc-toggle button.active {
  background: var(--ink-primary); color: var(--brand-lime);
}
.mob-inline-input {
  flex: 1; min-width: 0; height: 42px; padding: 0 13px; border-radius: 12px;
  border: 1.5px solid var(--brand-olive); background: var(--bg-surface);
  font-size: 13px; font-weight: 500; outline: none; box-shadow: 0 0 0 3px var(--brand-lime-soft);
}
.mob-inline-ok {
  height: 42px; padding: 0 16px; border-radius: 12px; flex-shrink: 0;
  background: var(--ink-primary); color: var(--brand-lime); font-size: 13px; font-weight: 800;
}
.mob-inline-ok:hover { background: var(--brand-olive-deep); }
.cust-search-wrap { max-width: none; height: 44px; border-radius: 12px; }
.cust-picker-list { max-height: 42dvh; overflow-y: auto; }
.cust-empty-hint { font-size: 12px; color: var(--ink-secondary); text-align: center; padding: 14px 8px 6px; }
.cust-add-trigger { margin-top: 6px; }
.cust-quick-add {
  display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px;
  background: var(--bg-canvas); border: 1px solid var(--brand-lime-border);
}

/* Checkout / Pembayaran Sheet */
.pay-sheet { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.pay-sheet > :not(.pay-fields), .pay-fields > * { flex-shrink: 0; }
.pay-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 3px;
  margin: -3px;
}
.pay-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pay-head-btn { width: 34px; height: 34px; font-size: 16px; font-weight: 700; }
.pay-head-spacer { width: 34px; height: 34px; flex-shrink: 0; }
.pay-head-title { flex: 1; text-align: center; font-size: 16px; }
.pay-total-box {
  background: var(--brand-lime-soft); border: 1px solid var(--brand-lime-border);
  border-radius: 16px; padding: 14px 16px; text-align: center;
  display: flex; flex-direction: column; gap: 2px;
}
.pay-total-label { font-size: 12px; font-weight: 600; color: var(--brand-olive); }
.pay-total-amount { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; color: var(--brand-olive-deep); line-height: 1.15; }
.pay-total-sub { font-size: 11px; font-weight: 600; color: var(--brand-olive); margin-top: 2px; }
.pay-backdate-wrap { display: flex; flex-direction: column; gap: 6px; }
.pay-backdate-toggle {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 12px; font-weight: 600; color: var(--ink-secondary); padding: 2px 0;
}
.pay-backdate-toggle:hover, .pay-backdate-toggle.active { color: var(--brand-olive-deep); }
.pay-date-input { height: 38px; font-size: 12px; }
.pay-debt-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 11px; border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--bg-surface);
}
.pay-debt-card.active { background: var(--warning-soft); border-color: var(--warning-border); }
.pay-methods-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.pay-methods-3 .pm-pill {
  height: 40px; border-radius: 12px; font-size: 12px;
  border: 1.5px solid var(--border-subtle); background: var(--bg-surface);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.pay-methods-3 .pm-pill .icon {
  width: 15px; height: 15px; flex: 0 0 15px;
}
.pay-methods-3 .pm-pill.active {
  background: var(--brand-lime-soft); border-color: var(--brand-olive);
  color: var(--brand-olive-deep); font-weight: 700;
}
.pay-manual-hint { font-size: 11px; color: var(--warning-text); margin-top: 2px; }
.pay-amount-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.form-input.pay-amount-input {
  height: 40px; text-align: center; font-size: 16px; font-weight: 800;
  background: var(--bg-surface); border: 1.5px solid var(--border-subtle);
}
.pay-denom-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pay-denom-btn {
  height: 38px; border-radius: 10px; border: 1px solid var(--border-subtle);
  background: var(--bg-surface); font-size: 12px; font-weight: 700; color: var(--ink-primary);
}
.pay-denom-btn:hover { background: var(--bg-subtle); border-color: var(--border-strong); }
.pay-denom-btn.exact.active {
  background: var(--brand-lime-soft); border-color: var(--brand-olive); color: var(--brand-olive-deep);
}
.pay-reset-link {
  font-size: 12px; font-weight: 600; color: var(--ink-secondary);
  min-height: 26px; padding-inline: 8px;
}
.pay-reset-link:hover { color: var(--danger-text); }
.pay-meta-row { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.85fr); gap: 8px; }
.pay-cust-btn {
  height: 42px; padding: 0 11px; border-radius: 12px; border: 1px solid var(--border-subtle);
  background: var(--bg-surface); display: flex; align-items: center; gap: 7px;
  text-align: left; min-width: 0; font-size: 12px; font-weight: 600; color: var(--ink-secondary);
}
.pay-cust-btn.selected { color: var(--ink-primary); border-color: var(--brand-lime-border); background: var(--bg-elevated); }
.pay-cust-btn.required { border-color: var(--warning-text); background: var(--warning-soft); color: var(--warning-text); }
.pay-cust-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-cust-check { color: var(--success-text); }
.pay-table-wrap {
  height: 42px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--border-subtle);
  background: var(--bg-surface); display: flex; align-items: center; gap: 5px;
}
.pay-table-wrap:focus-within { border-color: var(--ink-primary); }
.pay-table-hash { font-size: 13px; font-weight: 700; color: var(--ink-muted); }
.pay-table-wrap input {
  border: none; background: transparent; width: 100%; min-width: 0;
  font-size: 12px; font-weight: 600; outline: none;
}
.form-input.pay-note-input { height: 40px; font-size: 12px; background: var(--bg-surface); }
.pay-sheet .pay-summary-banner { padding: 8px 12px; border-radius: 12px; }
.pay-summary-banner .cb-val { font-size: 16px; }
.change-banner.debt { background: var(--warning-soft); border-color: var(--warning-border); }
.change-banner.debt .cb-label, .change-banner.debt .cb-val { color: var(--warning-text); }
.pay-confirm-btn { height: 48px; border-radius: 12px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .mob-nav-btn, .mob-nav-icon, .mob-nav-label { transition: none; } }

/* ==========================================================================
   Lists, Badges, Tables, Charts & Receipts
   ========================================================================== */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.lunas { background: var(--success-bg); color: var(--success-text); }
.status-badge.kasbon { background: var(--warning-bg); color: var(--warning-text); }
.status-badge.open { background: var(--brand-lime-soft); color: var(--brand-olive); }
.status-badge.refund { background: var(--danger-bg); color: var(--danger-text); }
.status-badge.muted { background: var(--bg-subtle); color: var(--ink-secondary); }

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.list-row:last-child { border-bottom: none; }

.two-col-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.three-col-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 320px);
  gap: 18px;
  align-items: start;
}

/* Dark P&L Card */
.pnl-dark-card {
  background: var(--ink-primary);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pnl-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #A3ACA5;
}

.pnl-line strong { color: #fff; font-weight: 700; }
.pnl-line.neg strong { color: #FCA5A5; }
.pnl-line.lime strong { color: var(--brand-lime); }

.pnl-line.divider {
  padding-top: 10px;
  border-top: 1px solid #2A2E2B;
  color: #fff;
  font-weight: 700;
}

.pnl-profit-banner {
  background: var(--brand-lime);
  color: var(--ink-primary);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  margin-top: 4px;
}

.pnl-profit-banner span:last-child {
  font-size: 20px;
}

/* Data Viz Stacked & Progress Bars */
.stacked-bar {
  height: 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  display: flex;
  gap: 3px;
  overflow: hidden;
}

.bar-seg {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 350ms var(--ease);
}

.progress-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  overflow: hidden;
  margin-top: 5px;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--brand-lime);
}

/* Thermal Receipt 58mm / 80mm Preview */
.thermal-paper {
  background: #FAFBF8;
  border: 1px dashed #BFC7B8;
  border-radius: 14px;
  padding: 18px 16px;
  font-family: 'Inter', monospace;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--ink-primary);
  margin: 0 auto;
  width: 100%;
  max-width: 280px;
  transition: max-width 220ms var(--ease);
}

.thermal-paper.w80 {
  max-width: 340px;
}

.thermal-center { text-align: center; }
.thermal-dash {
  border-top: 1px dashed #B8C0B1;
  margin: 4px 0;
}
.thermal-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  gap: 8px;
}
.thermal-row.bold { font-weight: 800; font-size: 13px; }

/* Info / Rule Banners */
.info-banner {
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.info-banner.lime {
  background: var(--brand-lime-soft);
  border: 1px solid var(--brand-lime-border);
  color: var(--brand-olive);
}

.info-banner.warn {
  background: var(--warning-soft);
  border: 1px solid var(--warning-border);
  color: #92400E;
}

.info-banner.danger {
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field.full { grid-column: 1 / -1; }

.form-field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-secondary);
}

.form-input {
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  padding: 0 13px;
  font-size: 13px;
  font-weight: 600;
  width: 100%;
}

.form-input:focus {
  border-color: var(--ink-primary);
  background: var(--bg-surface);
}

/* Switch Toggle */
.switch {
  width: 44px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: #D9DFD2;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  transition: background-color 180ms var(--ease);
  flex-shrink: 0;
}

.switch.on {
  background: var(--ink-primary);
  justify-content: flex-end;
}

.switch-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
}

.switch.on .switch-knob {
  background: var(--brand-lime);
}

/* Modals */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 20, 19, 0.56);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: var(--bg-surface);
  border-radius: 24px;
  width: 100%;
  max-width: 460px;
  max-height: 100%;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  animation: popIn 180ms var(--ease);
}

.modal-card:has(> .pay-sheet) {
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  overflow: hidden;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-title {
  font-size: 17px;
  font-weight: 800;
}

/* Toast Notification */
.toast {
  position: absolute;
  bottom: 24px;
  right: 24px;
  background: var(--ink-primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 48px);
  box-shadow: var(--shadow-float);
  transform: translateY(80px);
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms var(--ease), opacity 220ms var(--ease);
  z-index: 200;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand-lime);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 28px 16px;
  color: var(--ink-secondary);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Section Headers, Segmented Tabs & Interactive Controls */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
}

.section-sub {
  font-size: 12px;
  color: var(--ink-secondary);
  margin-top: 2px;
}

.seg-tabs {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 3px;
}

.seg-tab {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.seg-tab.active {
  background: var(--ink-primary);
  color: var(--brand-lime);
  font-weight: 700;
}

.quick-cash-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.quick-cash-btn {
  height: 36px;
  border-radius: 10px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-primary);
}

.quick-cash-btn:hover {
  background: var(--brand-lime-soft);
  border-color: var(--brand-lime-border);
  color: var(--brand-olive);
}

.change-banner {
  background: var(--brand-lime-soft);
  border: 1px solid var(--brand-lime-border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.change-banner.short {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.change-banner .cb-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-olive);
}

.change-banner.short .cb-label {
  color: var(--danger-text);
}

.change-banner .cb-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink-primary);
}

.change-banner.short .cb-val {
  color: var(--danger-text);
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-canvas);
  cursor: pointer;
}

.radio-card.selected {
  border-color: var(--ink-primary);
  background: var(--brand-lime-soft);
}

.radio-card input {
  margin-top: 3px;
  accent-color: var(--ink-primary);
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.modal-actions > * {
  flex: 1;
}

.prod-list-thumb {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}

.more-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.more-menu-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  box-shadow: var(--shadow-card);
}

.more-menu-card:hover {
  border-color: var(--brand-lime-border);
  background: var(--brand-lime-soft);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-xs {
  height: 30px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--ink-primary);
}

.btn-xs:hover {
  background: var(--bg-subtle);
}

.btn-xs.lime {
  background: var(--brand-lime);
  border-color: var(--brand-lime);
  color: var(--ink-primary);
}

.btn-xs.soft {
  background: var(--brand-lime-soft);
  border-color: var(--brand-lime-border);
  color: var(--brand-olive);
}

.btn-xs.danger {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.photo-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.photo-pick-btn {
  padding: 2px;
  border-radius: 10px;
  border: 2px solid transparent;
  overflow: hidden;
  aspect-ratio: 1;
}

.photo-pick-btn.selected {
  border-color: var(--ink-primary);
  box-shadow: 0 0 0 2px var(--brand-lime);
}

.photo-pick-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
  display: block;
}

.text-muted { color: var(--ink-secondary); font-size: 12px; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flex-row { display: flex; align-items: center; gap: 8px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.stack-md { display: flex; flex-direction: column; gap: 12px; }
.hidden { display: none !important; }

/* The app and the phone preview share the same layout at the same width. */
@container pos-app (max-width: 1180px) {
  .three-col-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container pos-app (1024px < width <= 1100px) {
  .product-grid:not(.list-mode) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@container pos-app (max-width: 1024px) {
  .main-col { --workspace-gutter: 18px; }
  .sidebar { display: none; }
  .topbar { height: 62px; }
  .mobile-brand-bar { display: flex; }
  .topbar .desktop-only { display: none; }
  .topbar-right { gap: 8px; }
  .profile-chip { padding: 3px; }
  .mobile-search-bar { display: flex; max-width: none; height: 48px; }
  .mobile-search-bar input { font-size: 16px; }
  .mobile-search-bar .scan-pill-btn { height: 36px; }
  .page-heading { display: flex; }
  .pos-split, .dash-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .cart-panel { display: none; }
  .workspace { padding-block: 18px 22px; }
  .mobile-bottom-nav { display: flex; }
  .mobile-cart-bar.visible { display: flex; }
  .toast { bottom: calc(clamp(56px, 15cqw, 62px) + 34px + env(safe-area-inset-bottom)); right: 14px; max-width: calc(100% - 28px); }
  .main-col:has(.mobile-cart-bar.visible) ~ .toast { bottom: calc(clamp(56px, 15cqw, 62px) + 106px + env(safe-area-inset-bottom)); }
  .modal-backdrop.open + .toast { top: 70px; bottom: auto; }
}

@container pos-app (max-width: 720px) {
  .three-col-grid, .two-col-grid { grid-template-columns: minmax(0, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-value { font-size: 18px; }
  .kpi-card { padding: 12px; gap: 9px; }
  .kpi-icon { width: 32px; height: 32px; border-radius: 8px; }
}

@container pos-app (max-width: 560px) {
  .main-col { --workspace-gutter: 14px; }
  .topbar { height: calc(58px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
  .mobile-brand-bar .brand-name { font-size: 14px; }
  .mobile-brand-bar .brand-mark { width: 34px; height: 34px; }
  .page-title { font-size: 27px; }
  .view-panel { gap: 14px; }
  .panel-card { padding: 13px; border-radius: 14px; }
  .pos-kpis {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: clamp(162px, 42cqw, 205px);
    padding: 3px var(--workspace-gutter) 5px;
    margin: -3px calc(-1 * var(--workspace-gutter)) -5px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    scroll-padding-inline: var(--workspace-gutter);
  }
  .pos-kpis .kpi-card { padding: 10px; gap: 8px; scroll-snap-align: start; }
  .pos-kpis .kpi-value { font-size: 16px; }
  .pos-kpis .kpi-label { font-size: 11px; }
  .catalog-panel { gap: 10px; }
  #categoryPills .cat-pill { height: 38px; padding-inline: 10px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .product-photo-wrap { height: clamp(92px, 27cqw, 122px); }
  .product-name { font-size: 13px; }
  .product-meta { font-size: 11px; }
  .product-price { font-size: 13px; }
  .btn-add-circle { width: 34px; height: 34px; }
  .product-grid:not(.list-mode) .product-foot .mini-stepper button { width: 23px; height: 29px; }
  .list-row { flex-wrap: wrap; }
  .list-row > div { min-width: 0; overflow-wrap: anywhere; }
  .modal-backdrop { align-items: flex-end; padding: 12px 0 0; }
  .modal-card {
    max-width: none;
    border-radius: 20px 20px 0 0;
    padding: 17px 16px calc(17px + env(safe-area-inset-bottom));
  }
}

@container pos-app (max-width: 380px) {
  .product-grid:not(.list-mode) .product-foot .mini-stepper button { width: 21px; }
  .product-price { font-size: 12px; }
  .product-foot { gap: 4px; }
}

@media (max-height: 610px) {
  .cart-panel { position: static; max-height: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@container pos-app (max-width: 1024px) {
  .main-col:has(#view-kasir.active) .mobile-kasir-heading { display: flex; align-items: center; justify-content: space-between; width: 100%; }
  .mobile-kasir-heading .page-title { display: flex; align-items: center; gap: 8px; font-size: 22px; }
  .mobile-kasir-heading .page-title .icon { width: 22px; height: 22px; }
  .main-col:has(#view-kasir.active) .mobile-brand-bar, .main-col:has(#view-kasir.active) .topbar-right { display: none; }
  .main-col:has(#view-kasir.active) .topbar { border-bottom: 0; }
  #view-kasir .catalog-panel { display: grid; grid-template-columns: minmax(0, 1fr) 48px 48px; gap: 10px; padding: 0; border: 0; background: transparent; }
  #view-kasir .mobile-search-bar { grid-column: 1; min-width: 0; }
  #view-kasir .mobile-scan-btn { display: flex; grid-column: 2; }
  #view-kasir .catalog-filters, #view-kasir .catalog-filter-meta { display: contents; }
  #view-kasir .catalog-count { display: none; }
  #view-kasir .catalog-view { grid-column: 3; }
  #view-kasir .catalog-view span { display: none; }
  #view-kasir #categoryPills { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  #view-kasir #categoryPills .cat-pill { border-radius: 999px; }
  #view-kasir .product-grid { grid-column: 1 / -1; grid-row: 3; }
  .product-grid:not(.list-mode) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-grid.list-mode { grid-template-columns: 1fr; }
  .product-photo-wrap { height: auto; }
  .mobile-cart-bar.visible { position: absolute; z-index: 20; left: var(--workspace-gutter); right: var(--workspace-gutter); bottom: calc(clamp(56px, 15cqw, 62px) + 34px + env(safe-area-inset-bottom)); background: var(--brand-lime); border-radius: 16px; box-shadow: 0 8px 22px rgba(27, 41, 22, 0.22); }
  .mobile-cart-bar .btn-xs.soft { background: var(--bg-surface); color: var(--brand-olive-deep); }
  .mobile-cart-bar .btn-primary { background: var(--brand-olive-deep); color: var(--bg-surface); }
  .mobile-bottom-nav { position: relative; z-index: 21; }
}

@container pos-app (width < 840px) {
  .main-col:has(#view-kasir.active) .workspace {
    overflow: hidden;
  }
  #view-kasir.active {
    height: 100%;
    min-height: 0;
  }
  #view-kasir .pos-split {
    flex: 1;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
  }
  #view-kasir .catalog-panel {
    min-height: 0;
    grid-template-rows: auto auto minmax(0, 1fr);
  }
  #view-kasir .product-grid {
    min-height: 0;
    grid-auto-rows: max-content;
    align-content: start;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
  }
  .main-col:has(.mobile-cart-bar.visible) #view-kasir .product-grid {
    padding-block-end: 74px;
    scroll-padding-block-end: 74px;
  }
}

.tablet-rail { display: none; }
@container pos-app (min-width: 840px) {
  .sidebar { display: none; }
  .tablet-rail { display: flex; flex: 0 0 76px; width: 76px; flex-direction: column; align-items: center; gap: 10px; padding: 12px 6px; background: var(--bg-surface); border-right: 1px solid var(--border-subtle); }
  .tablet-rail nav { display: flex; flex-direction: column; width: 100%; gap: 3px; }
  .tablet-nav-item { min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 12px; color: var(--ink-secondary); font-size: 10px; transition: background-color 180ms, color 180ms; }
  .tablet-nav-item .icon { width: 24px; height: 24px; }
  .tablet-nav-item.active { background: var(--brand-lime-soft); color: var(--brand-olive-deep); font-weight: 700; }
  .tablet-nav-item.active .icon { background: var(--brand-lime); border-radius: 7px; box-sizing: content-box; padding: 5px; }
  .tablet-status, .tablet-profile { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: var(--brand-olive); }
  .tablet-status { margin-top: auto; }
  .tablet-profile { background: var(--brand-lime-soft); font-weight: 700; }
  .mobile-bottom-nav, .mobile-cart-bar.visible { display: none; }
  .topbar { height: 62px; padding: 0 14px; gap: 10px; }
  .main-col:has(#view-kasir.active) .topbar { background: var(--bg-canvas); border-bottom: 0; justify-content: flex-start; }
  .main-col:has(#view-kasir.active) .topbar-left { flex: 0 1 auto; }
  .topbar .desktop-only { display: flex; }
  .main-col:has(#view-kasir.active) .mobile-kasir-heading, .main-col:has(#view-kasir.active) .mobile-brand-bar { display: none; }
  .main-col:has(#view-kasir.active) .topbar-right { display: none; }
  .topbar-right .view-mode-btn, .topbar-right .offline-chip, .topbar-right .profile-chip { display: none; }
  .search-wrap { height: 48px; max-width: 520px; }
  .search-wrap .scan-pill-btn { height: 38px; }
  .main-col:has(#view-kasir.active) .workspace { padding: 0; overflow: hidden; }
  #view-kasir.active { height: 100%; min-height: 0; }
  #view-kasir .pos-split { height: 100%; min-height: 0; grid-template-columns: minmax(0, 1fr) clamp(300px, 29cqw, 360px); gap: 0; align-items: stretch; }
  #view-kasir .catalog-panel { display: flex; min-height: 0; overflow-y: auto; padding: 14px; border: 0; border-radius: 0; background: transparent; }
  #view-kasir .mobile-search-bar, #view-kasir .mobile-scan-btn { display: none; }
  #view-kasir .catalog-filters { display: flex; border: 0; padding-bottom: 0; }
  #view-kasir .catalog-filter-meta { display: flex; }
  #view-kasir .catalog-count { display: block; }
  #view-kasir .catalog-view span { display: inline; }
  #view-kasir #categoryPills { width: auto; min-width: 0; overflow-x: auto; }
  #view-kasir .product-grid:not(.list-mode) { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
  #view-kasir .cart-panel { display: flex; position: static; height: 100%; max-height: none; min-height: 0; border: 0; border-left: 1px solid var(--border-subtle); border-radius: 0; padding: 14px; gap: 10px; }
  .cart-panel > .stack-md { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
  .cart-panel .cart-items-scroll { flex: 1; max-height: none; }
  .cart-panel .cart-payment { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tablet-nav-item { transition: none; } }

.tablet-scan-btn, .tablet-layout-toggle, .tablet-openbill, .tablet-cart-header { display: none; }
@container pos-app (min-width: 840px) {
  .main-col:has(#view-kasir.active) .topbar { padding: 0; gap: 0; }
  .main-col:has(#view-kasir.active) .topbar-left { position: relative; top: 3px; flex: 1 1 0; min-width: 0; padding: 0 12px 0 14px; gap: 10px; }
  .main-col:has(#view-kasir.active) .topbar-left .search-wrap { flex: 1; width: auto; max-width: none; }
  .main-col:has(#view-kasir.active) .topbar-left .search-wrap .scan-pill-btn { display: none; }
  .main-col:has(#view-kasir.active) .tablet-scan-btn,
  .main-col:has(#view-kasir.active) .tablet-layout-toggle,
  .main-col:has(#view-kasir.active) .tablet-openbill {
    display: inline-flex;
  }
  .main-col:has(#view-kasir.active) .tablet-openbill {
    height: 48px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .tablet-cart-header { flex: 0 0 clamp(320px, 29cqw, 360px); height: 62px; display: flex; align-items: center; gap: 6px; padding: 0 10px; background: var(--bg-surface); border-left: 1px solid var(--border-subtle); }
  .tablet-cart-header strong { min-width: 0; flex: 1; font-size: 14px; white-space: nowrap; }
  .tablet-cart-menu { position: relative; flex-shrink: 0; }
  .tablet-cart-menu summary { list-style: none; display: grid; place-items: center; width: 40px; height: 48px; cursor: pointer; font-size: 22px; }
  .tablet-cart-menu summary::-webkit-details-marker { display: none; }
  .tablet-cart-menu button { position: absolute; z-index: 30; right: 0; width: 180px; min-height: 48px; padding: 10px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 8px; color: var(--ink-primary); box-shadow: var(--shadow-float); }
  .tablet-cart-menu #tabletClearCart { top: 48px; color: var(--danger-text); }
  #view-kasir .pos-split { grid-template-columns: minmax(0, 1fr) clamp(320px, 29cqw, 360px); }
  #view-kasir .catalog-view { display: none; }
  #view-kasir .catalog-panel { overflow: hidden; }
  #view-kasir .product-grid { overflow-y: auto; min-height: 0; align-content: start; }
  #view-kasir .product-grid { grid-auto-rows: max-content; }
  #view-kasir .cart-panel { padding-top: 0; }
  .cart-panel .cart-header { display: none; }
  .main-col:not(:has(#view-kasir.active)) .tablet-cart-header { display: none; }
}

@container pos-app (min-width: 840px) {
  .main-col:has(#view-kasir.active) {
    position: relative;
    --cart-track: clamp(320px, 29cqw, 360px);
  }
  .main-col:has(#view-kasir.active) .topbar {
    position: absolute;
    inset: 0 var(--cart-track) auto 0;
    height: var(--topbar-h);
    padding: 0;
  }
  #view-kasir .catalog-panel { gap: 14px; padding-top: calc(var(--topbar-h) + 12px); }
  #view-kasir .pos-split { grid-template-columns: minmax(0, 1fr) var(--cart-track); }
  #view-kasir .cart-panel { margin: 7px 12px 12px 0; width: auto; height: auto; padding: 12px; border: 1px solid var(--border-subtle); border-radius: 18px; overflow: hidden; }
  .cart-panel .tablet-cart-header { display: flex; flex: 0 0 auto; width: 100%; height: auto; min-height: 48px; padding: 0; border: 0; gap: 3px; }
  .tablet-cart-header strong { font-size: 16px; }
  .tablet-cart-menu summary { width: 38px; }
  .cart-panel > .stack-md { overflow: hidden; }
  .cart-panel .cart-items-scroll { padding-right: 2px; }
  .cart-panel .cart-divider { padding-top: 0; border: 0; gap: 8px; }
}
