/* TAZA POS — DESIGN.md tokens + register layout */

:root {
  --surface: #fbf8fa;
  --surface-dim: #dcd9db;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f5f3f4;
  --surface-container: #f0edef;
  --surface-container-high: #eae7e9;
  --surface-container-highest: #e4e2e3;
  --on-surface: #1b1b1d;
  --on-surface-variant: #45474c;
  --outline: #75777d;
  --outline-variant: #c5c6cd;
  --surface-tint: #545f73;
  --primary: #091426;
  --on-primary: #ffffff;
  --primary-container: #1e293b;
  --secondary: #5b5e67;
  --secondary-container: #dfe2ed;
  --on-secondary-container: #61646d;
  --error: #ba1a1a;
  --background: #fbf8fa;
  --sidebar-width: 380px;
  --nav-rail-width: 80px;
  --bottom-nav-height: 64px;
  --radius-sm: 0.125rem;
  --radius-lg: 0.25rem;
  --radius-xl: 0.5rem;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --touch-min: 44px;
  --shadow-l2: 0px 10px 15px -3px rgba(30, 41, 59, 0.1);
  --font: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --receipt-page-width: 80mm;
  --receipt-margin: 4mm;
}

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--on-surface);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  vertical-align: middle;
}

.nav-icon-fill { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }

.headline-lg { font-size: 24px; font-weight: 600; line-height: 32px; }
.headline-md { font-size: 18px; font-weight: 600; line-height: 24px; margin: 0; }
.body-sm { font-size: 12px; line-height: 16px; color: var(--on-surface-variant); }
.label-caps {
  font-size: 11px; font-weight: 700; line-height: 16px;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.display-price { font-size: 32px; font-weight: 700; line-height: 40px; }
.tnum { font-variant-numeric: tabular-nums; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* —— Lock screen —— */
.lock-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.lock-overlay {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--primary) 40%, transparent);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
}

.lock-bg-icon {
  font-size: 12rem;
  color: color-mix(in srgb, var(--on-primary) 8%, transparent);
  user-select: none;
}

.lock-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: var(--space-md);
  padding: var(--space-xl);
  background: var(--surface-container-lowest);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-l2);
}

.lock-content { text-align: center; }
.lock-subtitle { margin: 0 0 var(--space-lg); }

.brand-logo {
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
}
.brand-logo--lock {
  width: 96px;
  height: 96px;
  margin: 0 auto var(--space-sm);
}
.brand-logo--header {
  width: 40px;
  height: 40px;
}
.brand-logo--public {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-sm);
}
.lock-error {
  color: var(--error);
  font-size: 14px;
  margin: 0 0 var(--space-md);
}
.lock-empty { font-weight: 600; margin: var(--space-lg) 0 var(--space-sm); }
.lock-hint code { font-size: 11px; }

.unlock-form { text-align: left; }

.staff-picker { position: relative; margin-bottom: var(--space-lg); }

.staff-picker-toggle {
  width: 100%;
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  background: var(--surface-container-lowest);
  cursor: pointer;
  text-align: left;
}

.staff-picker-label { flex: 1; display: flex; flex-direction: column; }
.staff-option-name { font-weight: 600; font-size: 14px; color: var(--on-surface); }
.staff-option-role { display: block; }

.staff-list {
  list-style: none;
  margin: var(--space-xs) 0 0;
  padding: 0;
  position: absolute;
  left: 0; right: 0;
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-l2);
  max-height: 240px;
  overflow-y: auto;
  z-index: 10;
}

.staff-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.staff-option:hover { background: var(--surface-container-low); }

.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--secondary-container);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.avatar--sm { width: 36px; height: 36px; font-size: 12px; }

.pin-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.pin-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1px solid var(--outline-variant);
  background: var(--surface-container-highest);
}
.pin-dot--filled { background: var(--primary); border-color: var(--primary); }

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.pin-key {
  min-height: 64px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  background: var(--surface-container-lowest);
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pin-key:active { transform: scale(0.98); background: var(--surface-container-high); }
.pin-key--blank { border: none; background: transparent; pointer-events: none; }

.btn-primary {
  width: 100%;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* —— POS shell —— */
.pos-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pos-header {
  min-height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  padding-top: max(var(--space-sm), env(safe-area-inset-top, 0px));
  background: var(--surface);
  border-bottom: 1px solid var(--outline-variant);
  z-index: 50;
}

.pos-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex: 1;
  min-width: 0;
}
.pos-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
  text-decoration: none;
  color: inherit;
}

.pos-search-wrap { position: relative; display: none; flex: 1; min-width: 0; max-width: 20rem; }
@media (min-width: 768px) { .pos-search-wrap { display: flex; } }

.pos-search-icon {
  position: absolute;
  left: var(--space-sm);
  top: 50%;
  transform: translateY(-50%);
  color: var(--outline);
  font-size: 20px;
}

.pos-search {
  width: 100%;
  min-height: var(--touch-min);
  padding: var(--space-sm) var(--space-sm) var(--space-sm) 2.25rem;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  background: var(--surface-container-lowest);
  font-size: 14px;
}

.pos-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}
.lock-form { margin: 0; display: inline; }

.icon-btn {
  width: var(--touch-min); height: var(--touch-min);
  border: 0; border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--on-secondary-container);
}
.icon-btn:hover:not(:disabled) { background: var(--surface-container-low); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.pos-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

.pos-nav {
  width: var(--nav-rail-width);
  flex-shrink: 0;
  border-right: 1px solid var(--outline-variant);
  background: var(--surface);
  padding: var(--space-md) var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  border-radius: var(--radius-xl);
  background: transparent;
  color: var(--on-secondary-container);
  cursor: pointer;
  padding: var(--space-sm);
  text-decoration: none;
}
a.nav-item { color: inherit; }
.nav-item:disabled { opacity: 0.45; cursor: not-allowed; }
.nav-item--active {
  background: var(--secondary-container);
  color: var(--primary);
  font-weight: 700;
}

.pos-main-area {
  flex: 1;
  overflow: auto;
  min-width: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.catalog-panel { padding: var(--space-md); }

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.pill {
  padding: var(--space-sm) var(--space-md);
  border-radius: 999px;
  border: 1px solid var(--outline-variant);
  background: var(--surface-container-lowest);
  font-size: 13px;
  cursor: pointer;
}
.pill--active {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}
.pill:disabled { opacity: 0.45; cursor: not-allowed; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
}
@media (min-width: 480px) {
  .product-grid { gap: var(--space-md); }
}
@media (min-width: 768px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .product-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.product-card {
  position: relative;
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.product-card--oos { opacity: 0.65; filter: grayscale(0.8); }

.product-image {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--surface-container-high);
}
.product-image--placeholder {
  background: linear-gradient(135deg, var(--surface-container) 0%, var(--surface-container-high) 100%);
}

.product-sku { margin: 0; color: var(--on-surface-variant); }
.product-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.product-price { margin: 0; font-weight: 600; font-size: 14px; }
.product-price--struck { text-decoration: line-through; color: var(--outline); }

.stock-badge {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.stock-badge--in { background: #dcfce7; color: #166534; }
.stock-badge--low { background: color-mix(in srgb, var(--surface-tint) 15%, white); color: var(--surface-tint); }
.stock-badge--oos { background: var(--surface-container-highest); color: var(--outline); }

.pos-cart {
  width: var(--sidebar-width);
  flex-shrink: 0;
  border-left: 1px solid var(--outline-variant);
  background: var(--surface-container-lowest);
  display: none;
  flex-direction: column;
}
@media (min-width: 1024px) { .pos-cart { display: flex; } }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--outline-variant);
}

.btn-text {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-text:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-text--destructive { color: var(--error); }

.cart-warning-banner,
.picker-warning-banner {
  margin: 0 var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--error) 12%, var(--surface-container-lowest));
  color: var(--error);
  font-size: 13px;
  font-weight: 600;
}

.cart-lines {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0 var(--space-md);
}

.cart-line {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--outline-variant);
}
.cart-line--warning {
  border-left: 3px solid var(--error);
  padding-left: calc(var(--space-sm) - 3px);
  background: color-mix(in srgb, var(--error) 6%, transparent);
}

.cart-line-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}
.cart-line-thumb--placeholder {
  background: var(--surface-container-high);
}

.cart-line-body { flex: 1; min-width: 0; }
.cart-line-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-line-options,
.cart-line-sku { color: var(--on-surface-variant); margin: 2px 0; }
.cart-line-unit { font-size: 13px; margin: 2px 0; }
.cart-line-warning { color: var(--error); font-size: 12px; font-weight: 600; margin: 4px 0; }
.cart-line-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-xs);
}
.cart-qty-stepper .qty-btn {
  min-width: 44px;
  min-height: 44px;
}
.cart-line-total { font-weight: 700; font-size: 14px; }

.variant-add-error {
  color: var(--error);
  font-weight: 600;
  margin: var(--space-sm) 0;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}
.qty-btn {
  border: 1px solid var(--outline-variant);
  background: var(--surface-container-lowest);
  border-radius: var(--radius-md);
  width: 32px;
  height: 32px;
  font-size: 18px;
  cursor: pointer;
}
.qty-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.qty-value { min-width: 1.5rem; text-align: center; }

.btn-secondary {
  margin: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  background: var(--surface-container-lowest);
  font-weight: 600;
  cursor: pointer;
}
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

.cart-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-variant);
  padding: var(--space-lg);
}

.cart-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--outline-variant);
}

.cart-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: var(--space-sm);
}
.cart-tier-hint {
  margin: calc(-1 * var(--space-xs)) 0 var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface-container-lowest));
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}
.cart-row--total { font-weight: 700; margin-top: var(--space-md); }
.cart-row--tax-included {
  font-size: 13px;
  color: var(--on-surface-variant);
}
.estimate { font-size: 11px; font-weight: 400; color: var(--on-surface-variant); }

.btn-pay { margin-top: var(--space-md); }
.cart-secondary-actions {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-sm);
}

.pos-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--outline-variant);
  font-size: 12px;
  color: var(--on-surface-variant);
  background: var(--surface);
}
.pos-footer a { color: var(--primary); }

/* —— Catalog overlay + picker —— */
#pos-overlay:empty { display: none; }

#pos-busy {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: color-mix(in srgb, var(--primary) 40%, transparent);
  backdrop-filter: blur(4px);
}
#pos-busy.htmx-request {
  display: flex;
}

.pos-busy-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  min-width: 12rem;
  padding: var(--space-xl) var(--space-lg);
  background: var(--surface-container-lowest);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-l2);
}

.pos-busy-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--outline-variant);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: pos-busy-spin 0.7s linear infinite;
}

@keyframes pos-busy-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .pos-busy-spinner { animation: none; }
}

.pos-busy-label {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--on-surface);
}

.pos-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.pos-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  backdrop-filter: blur(4px);
}

.picker-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 56rem;
  max-height: 90vh;
  overflow: auto;
  background: var(--surface-container-lowest);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-l2);
  padding: var(--space-xl);
}

.picker-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.picker-bento {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
@media (min-width: 768px) {
  .picker-bento { grid-template-columns: repeat(3, 1fr); }
}

.picker-item {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  background: var(--surface-container-lowest);
  padding: 0;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  min-height: var(--touch-min);
}
.picker-item--featured { grid-column: span 1; }
@media (min-width: 768px) {
  .picker-item--featured { grid-column: span 2; }
}
.picker-item--selected { border-color: var(--primary); }
.picker-featured-badge {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  z-index: 2;
  background: var(--primary);
  color: var(--on-primary);
  padding: 2px 8px;
  border-radius: 999px;
}

.picker-image {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: var(--surface-container-high);
}
.picker-image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--outline);
}
.picker-image--placeholder .material-symbols-outlined { font-size: 3rem; }

.picker-card-body { padding: var(--space-md); }
.picker-title { margin: 0 0 var(--space-xs); font-size: 16px; font-weight: 600; }

.picker-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
}
.picker-footer .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.reload-form { margin: 0; }
.reload-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}
.reload-btn .material-symbols-outlined {
  font-size: 18px;
}

.catalog-empty, .catalog-error {
  padding: var(--space-xl);
  text-align: center;
  color: var(--on-surface-variant);
}
.catalog-banner {
  margin: 0 0 var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--surface-container-high);
  border-radius: var(--radius-lg);
  font-size: 13px;
}

.product-card--clickable {
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}
.product-card--clickable:hover { box-shadow: var(--shadow-l2); }
.product-image { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); }

/* —— Variant sheet —— */
.variant-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}
.variant-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--primary) 25%, transparent);
}
.variant-sheet-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 30rem;
  max-height: 90vh;
  overflow: auto;
  background: var(--surface-container-lowest);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-l2);
  padding: var(--space-xl);
}
.variant-sheet-close { position: absolute; top: var(--space-sm); right: var(--space-sm); }
.variant-sheet-header { margin-bottom: var(--space-lg); }
.variant-sheet-image-wrap {
  position: relative;
  margin-bottom: var(--space-md);
}
.variant-sheet-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-lg);
  display: block;
}
.variant-sheet-image--placeholder {
  background: var(--surface-container-high);
  min-height: 12rem;
}
.variant-stock-hero {
  position: absolute;
  left: var(--space-sm);
  right: var(--space-sm);
  bottom: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-l1);
}
.variant-stock-hero-qty {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}
.variant-stock-hero-sub {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
}
.variant-stock-hero--in {
  background: #dcfce7;
  color: #14532d;
}
.variant-stock-hero--low {
  background: color-mix(in srgb, var(--surface-tint) 18%, white);
  color: var(--surface-tint);
}
.variant-stock-hero--oos {
  background: color-mix(in srgb, var(--error) 12%, white);
  color: var(--error);
}

.variant-option { margin-bottom: var(--space-md); }
.variant-chips { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.variant-chip {
  min-height: var(--touch-min);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--outline-variant);
  border-radius: 999px;
  text-decoration: none;
  color: inherit;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
}
.variant-chip--selected {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}
.variant-chip--disabled { opacity: 0.4; pointer-events: none; }
.variant-chip--oos {
  opacity: 0.55;
  pointer-events: none;
  text-decoration: line-through;
  border-style: dashed;
}
.variant-chip-label { line-height: 1.2; }

.variant-unavailable { color: var(--error); font-weight: 600; margin: 0; }
.variant-meta {
  margin: var(--space-lg) 0 var(--space-md);
  padding: var(--space-md);
  background: var(--surface-container-low);
  border-radius: var(--radius-lg);
}
.variant-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.variant-meta-row .product-price { margin: 0; }
.variant-sku { margin: var(--space-sm) 0 0; color: var(--outline); }
.variant-inventory-hint {
  margin: 0;
  color: var(--outline);
  font-size: 14px;
}
.variant-peek { margin: var(--space-md) 0 var(--space-lg); }
.variant-peek-toggle {
  width: 100%;
  justify-content: center;
  min-height: var(--touch-min);
}
.variant-peek-panel { margin-top: var(--space-sm); }
.variant-stock-search-wrap {
  position: relative;
  display: block;
  margin-bottom: var(--space-sm);
}
.variant-stock-search-icon {
  position: absolute;
  left: var(--space-sm);
  top: 50%;
  transform: translateY(-50%);
  color: var(--outline);
  font-size: 18px;
  pointer-events: none;
}
.variant-stock-search {
  width: 100%;
  min-height: 2.5rem;
  padding: var(--space-sm) var(--space-sm) var(--space-sm) 2.25rem;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  background: var(--surface-container-lowest);
  font-size: 14px;
}
.variant-stock-search:focus {
  outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent);
  outline-offset: 1px;
}
.variant-stock-empty {
  margin: 0 0 var(--space-sm);
  font-size: 13px;
  color: var(--outline);
  text-align: center;
}
.variant-stock-table-wrap {
  max-height: 14rem;
  overflow: auto;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
}
.variant-stock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.variant-stock-table th,
.variant-stock-table td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--outline-variant);
}
.variant-stock-table th {
  position: sticky;
  top: 0;
  background: var(--surface-container-low);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--outline);
}
.variant-stock-table tbody tr:last-child td { border-bottom: none; }
.variant-stock-table tbody tr.variant-stock-row--available td {
  background: color-mix(in srgb, #dcfce7 55%, white);
}
.variant-stock-sku { color: var(--outline); font-size: 12px; }
.variant-stock-oos { color: var(--outline); }
.variant-stock-untracked { color: var(--outline); font-style: italic; }
.variant-resolved { margin: var(--space-md) 0; }
.variant-qty { margin: var(--space-lg) 0; }
.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}
.qty-stepper button {
  width: var(--touch-min);
  height: var(--touch-min);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  background: var(--surface-container-lowest);
}

/* —— Tablet & mobile: bottom nav, full-width catalog —— */
@media (max-width: 1023px) {
  .pos-body {
    flex-direction: column;
    position: relative;
  }

  .pos-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-around;
    gap: 0;
    border-right: 0;
    border-top: 1px solid var(--outline-variant);
    padding: var(--space-xs) var(--space-sm);
    padding-bottom: max(var(--space-xs), env(safe-area-inset-bottom, 0px));
    padding-left: max(var(--space-sm), env(safe-area-inset-left, 0px));
    padding-right: max(var(--space-sm), env(safe-area-inset-right, 0px));
    z-index: 40;
    overflow-x: auto;
    overscroll-behavior: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .nav-item {
    flex: 1 1 0;
    min-width: 52px;
    max-width: 76px;
    aspect-ratio: auto;
    min-height: 52px;
    padding: var(--space-xs) 2px;
    scroll-snap-align: center;
  }

  .nav-item .label-caps {
    font-size: 9px;
    letter-spacing: 0.02em;
    line-height: 1.15;
    text-align: center;
  }

  .pos-main-area {
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  }

  .pos-footer {
    display: none;
  }

  .pos-cart {
    display: none;
  }
}

@media (max-width: 767px) {
  .pos-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .pos-header-left {
    flex: 1 1 auto;
    gap: var(--space-sm);
  }

  .pos-brand .brand-logo--header {
    width: 36px;
    height: 36px;
  }

  .pos-search-wrap {
    display: flex;
    flex: 1 1 100%;
    order: 1;
    max-width: none;
    margin-top: var(--space-xs);
  }

  .catalog-panel {
    padding: var(--space-sm);
  }

  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }

  .category-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: var(--space-xs);
    margin-bottom: 0;
    gap: var(--space-sm);
  }

  .category-pills .pill {
    flex-shrink: 0;
    scroll-snap-align: start;
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
  }

  .reload-form {
    align-self: flex-end;
  }

  .reload-btn {
    min-height: var(--touch-min);
    padding: var(--space-sm) var(--space-md);
  }

  .pos-overlay,
  .variant-sheet-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .picker-card,
  .variant-sheet-card {
    width: 100%;
    max-width: none;
    max-height: 92vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--space-lg);
  }

  .picker-header {
    flex-direction: column;
    align-items: stretch;
  }

  .picker-footer {
    flex-direction: column-reverse;
  }

  .picker-footer .btn-primary,
  .picker-footer .btn-text {
    width: 100%;
    min-height: var(--touch-min);
    justify-content: center;
  }
}

@media (max-width: 374px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .nav-item .label-caps {
    display: none;
  }

  .nav-item {
    min-height: var(--touch-min);
    max-width: 56px;
  }
}

/* —— Checkout overlay (380px panel) —— */
.checkout-overlay {
  justify-content: flex-end;
  padding: 0;
}

.checkout-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--sidebar-width, 380px);
  height: 100%;
  max-height: 100vh;
  overflow-y: auto;
  background: var(--surface-container-lowest);
  box-shadow: var(--shadow-l2);
  display: flex;
  flex-direction: column;
  padding: var(--space-lg);
  gap: var(--space-md);
}

.checkout-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
}

.checkout-subtitle {
  margin: var(--space-xs) 0 0;
  color: var(--on-surface-variant);
}

.checkout-summary.card-surface {
  background: var(--surface-container-low);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}

.checkout-divider {
  border: none;
  border-top: 1px solid var(--outline-variant);
  margin: var(--space-sm) 0;
}

.cart-row--discount {
  color: var(--error);
}

.checkout-section-label {
  margin: 0 0 var(--space-sm);
  color: var(--on-surface-variant);
}

.payment-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.payment-option {
  --edc-bca: #0066ae;
  --edc-bsi: #00a0a0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  min-height: var(--touch-min);
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--outline-variant);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.payment-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.payment-option-label {
  font-weight: 600;
  font-size: 1rem;
}

.payment-option-check {
  opacity: 0;
  font-size: 1.25rem;
}

.payment-option--bca {
  border-color: var(--edc-bca);
  background: color-mix(in srgb, var(--edc-bca) 14%, white);
  color: var(--on-surface);
}

.payment-option--bsi {
  border-color: var(--edc-bsi);
  background: color-mix(in srgb, var(--edc-bsi) 14%, white);
  color: var(--on-surface);
}

.payment-option--bca:has(input:checked) {
  background: var(--edc-bca);
  border-color: var(--edc-bca);
  color: #fff;
}

.payment-option--bsi:has(input:checked) {
  background: var(--edc-bsi);
  border-color: var(--edc-bsi);
  color: #fff;
  box-shadow: inset 0 0 0 2px #f0b43c;
}

.payment-option:has(input:checked) .payment-option-check {
  opacity: 1;
}

.checkout-complete-form:not(:has(input[name="payment_method"]:checked)) ~ .checkout-footer .checkout-complete {
  opacity: 0.5;
  pointer-events: none;
}

.checkout-info-banner {
  background: var(--tertiary-fixed, #fadfb8);
  color: var(--on-tertiary-fixed, #271902);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.4;
  margin-top: var(--space-md);
}

.checkout-footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: auto;
}

.checkout-cancel,
.checkout-complete {
  width: 100%;
  min-height: var(--touch-min);
}

.checkout-code-warning {
  color: var(--error);
  margin: var(--space-xs) 0 0;
}

.cart-discount {
  padding: 0 var(--space-sm);
}

.cart-discount-form {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.cart-discount-input {
  flex: 1;
  min-height: var(--touch-min);
  padding: var(--space-sm);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-md);
}

.cart-discount-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.discount-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--secondary-container);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.discount-chip-remove {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}

.cart-pay-form {
  width: 100%;
}

.cart-pay-form .btn-pay {
  width: 100%;
}

/* —— Order confirmation —— */
.confirmation-shell {
  min-height: 100vh;
  background: var(--surface);
}

.confirmation-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.confirmation-card {
  width: 100%;
  max-width: 42rem;
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-l2);
  padding: var(--space-xl);
  text-align: center;
}

.confirmation-icon {
  width: 5rem;
  height: 5rem;
  margin: 0 auto var(--space-md);
  border-radius: 50%;
  background: #e0f2f1;
  border: 4px solid #004d40;
  color: #004d40;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirmation-icon .material-symbols-outlined {
  font-size: 3rem;
}

.confirmation-details {
  text-align: left;
  margin: var(--space-lg) 0;
}

.confirmation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  background: var(--surface-container-low);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}

.confirmation-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--outline-variant);
}

.confirmation-field--full {
  grid-column: 1 / -1;
  border-bottom: none;
  padding-bottom: 0;
}

.confirmation-status {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot--amber {
  background: #f59e0b;
}

.status-dot--green {
  background: #1b7a3d;
}

.confirmation-info {
  background: var(--surface-container-low);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  font-size: 13px;
  margin-bottom: var(--space-lg);
}

.confirmation-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.confirmation-actions form,
.confirmation-actions .btn-primary,
.confirmation-actions .btn-secondary {
  width: 100%;
}

/* —— Public receipt —— */
.public-receipt-shell {
  min-height: 100vh;
  background: var(--surface-container-low);
}

.public-receipt-main {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-lg);
}

.public-receipt-card {
  width: 100%;
  max-width: 28rem;
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-l2);
  padding: var(--space-lg);
}

.public-receipt-card--missing {
  text-align: center;
  margin-top: 10vh;
}

.public-receipt-header {
  margin-bottom: var(--space-lg);
  text-align: center;
}

.public-receipt-order {
  margin: 0;
}

.public-receipt-card--missing .brand-logo--public {
  margin-bottom: var(--space-md);
}

.public-receipt-status {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: var(--surface-container-low);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
}

.public-receipt-status .status-dot {
  margin-top: 4px;
  flex-shrink: 0;
}

.public-receipt-status-label {
  margin: 0 0 2px;
  font-weight: 600;
}

.public-receipt-status-help {
  margin: 0;
}

.public-receipt-meta,
.public-receipt-lines {
  margin-bottom: var(--space-lg);
}

.public-receipt-meta-row,
.public-receipt-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.public-receipt-meta-row {
  min-height: var(--touch-min);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--surface-container);
}

.public-receipt-meta-row:last-child {
  border-bottom: 0;
}

.public-receipt-lines-table {
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.public-receipt-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--space-md);
  align-items: start;
  min-height: var(--touch-min);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--surface-container);
}

.public-receipt-line:last-child {
  border-bottom: 0;
}

.public-receipt-total {
  margin-bottom: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--outline-variant);
  font-weight: 700;
}

.public-receipt-footer {
  margin: 0;
}

.public-receipt-notify {
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  background: var(--surface-container-low);
}

.public-receipt-notify .label-caps {
  margin: 0 0 var(--space-xs);
}

.public-receipt-notify .body-sm {
  margin: 0 0 var(--space-md);
}

.public-receipt-notify-error {
  color: var(--error, #b3261e);
}

.public-receipt-notify-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.public-receipt-notify-label {
  font-size: 0.875rem;
  font-weight: 600;
}

.public-receipt-notify-input {
  min-height: var(--touch-min);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-md);
  background: var(--surface-container-lowest);
  font: inherit;
}

.public-receipt-notify-submit {
  min-height: var(--touch-min);
  padding: var(--space-sm) var(--space-md);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--primary, #1b5e4b);
  color: var(--on-primary, #fff);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 767px) {
  .checkout-panel {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  .public-receipt-main {
    padding: var(--space-sm);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* —— Settings —— */
.settings-panel {
  padding: var(--space-lg);
  max-width: 720px;
}
.settings-header { margin-bottom: var(--space-lg); }
.settings-header .headline-md { margin-bottom: var(--space-xs); }
.settings-flash {
  background: var(--secondary-container);
  color: var(--primary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
}
.settings-error {
  background: #fce8e6;
  color: var(--error);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
}
.settings-section {
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
}
.settings-section-title {
  margin: 0 0 var(--space-md);
  font-size: 16px;
  font-weight: 600;
}
.settings-help { margin: 0 0 var(--space-md); }
.settings-check {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  font-size: 14px;
}
.settings-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}
.settings-field--grow { flex: 1; min-width: 0; }
.settings-field input,
.settings-field textarea {
  min-height: var(--touch-min);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  font: inherit;
  background: var(--surface-container-lowest);
}
.settings-field-row {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-end;
  margin-bottom: var(--space-sm);
}
.settings-field-row .btn-secondary { margin-bottom: var(--space-md); white-space: nowrap; }
.settings-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
.settings-tier-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: var(--space-sm);
  align-items: end;
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--surface-container);
}
.settings-tier-collections {
  grid-column: 1 / -1;
}
.settings-tier-row .settings-validate-host {
  grid-column: 1 / -1;
}
.settings-validate-host { min-height: 1.25rem; margin-bottom: var(--space-sm); }
.settings-validate { margin: 0; font-size: 13px; }
.settings-validate-title { margin: 0 0 var(--space-xs); }
.settings-validate-details {
  margin: 0;
  padding-left: 1.1rem;
  color: inherit;
}
.settings-validate--ok { color: #1b7a3d; }
.settings-validate--error { color: var(--error); }
.settings-footer {
  padding: var(--space-md) 0 var(--space-xl);
}
@media (max-width: 720px) {
  .settings-field-grid,
  .settings-tier-row {
    grid-template-columns: 1fr;
  }
  .settings-field-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* —— Support —— */
.support-panel {
  padding: var(--space-lg);
  max-width: 560px;
}
.support-header {
  margin-bottom: var(--space-lg);
}
.support-header .headline-md {
  margin: var(--space-md) 0 0;
}
.support-header-img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: var(--radius-lg);
  background: var(--surface-container);
}
.support-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
}
.support-lead {
  margin: 0;
  color: var(--on-surface);
}
.support-number {
  margin: 0;
}
.support-wa-link {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--primary);
  text-decoration: none;
}
.support-wa-link:hover {
  text-decoration: underline;
}
.support-hint {
  margin: 0 0 var(--space-md);
  color: var(--on-surface-variant);
}
.support-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  width: auto;
  text-decoration: none;
}
.support-wa-btn .material-symbols-outlined {
  font-size: 20px;
}

/* —— Staff Orders —— */
.orders-panel {
  padding: var(--space-lg);
  max-width: 960px;
}
.orders-header { margin-bottom: var(--space-lg); }
.orders-header .headline-md { margin-bottom: var(--space-xs); }
.orders-back {
  display: inline-block;
  margin-bottom: var(--space-md);
  color: var(--on-surface-variant);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.orders-back:hover { color: var(--primary); }
.orders-error {
  background: #fce8e6;
  color: var(--error);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
}
.orders-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  align-items: flex-end;
}
.orders-search-field,
.orders-status-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.orders-search-field { flex: 1; min-width: 12rem; }
.orders-search,
.orders-status {
  min-height: var(--touch-min);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  font: inherit;
  background: var(--surface-container-lowest);
}
.orders-empty {
  padding: var(--space-xl) var(--space-md);
  color: var(--on-surface-variant);
}
.orders-table {
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.orders-table-head,
.orders-row {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr 1fr 0.9fr 1fr 1.3fr;
  gap: var(--space-sm);
  align-items: center;
  min-height: var(--touch-min);
  padding: 0 var(--space-md);
}
.orders-table-head {
  background: var(--surface-container-low);
  border-bottom: 1px solid var(--outline-variant);
}
.orders-row {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--surface-container);
}
.orders-row:last-child { border-bottom: 0; }
.orders-row:hover { background: var(--surface-container-low); }
.orders-status-cell {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
.orders-pager {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-md);
}
.orders-pager .btn-secondary {
  margin: 0;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
}
.orders-detail .confirmation-grid {
  margin-bottom: var(--space-lg);
}
.orders-discounts,
.orders-lines {
  margin-bottom: var(--space-lg);
}
.orders-lines-table {
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
}
.orders-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--space-md);
  align-items: start;
  min-height: var(--touch-min);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--surface-container);
}
.orders-line:last-child { border-bottom: 0; }
.orders-detail-actions .btn-secondary {
  margin: 0;
  min-height: var(--touch-min);
}

@media (max-width: 900px) {
  .orders-table-head { display: none; }
  .orders-row {
    grid-template-columns: 1fr 1fr;
    padding: var(--space-sm) var(--space-md);
  }
}

/* —— Thermal receipt (80mm) —— */
.receipt-ticket {
  display: none;
  font-family: var(--font);
  color: #000;
  width: var(--receipt-page-width);
}
.receipt-store {
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}
.receipt-logo {
  display: block;
  width: 20mm;
  height: 20mm;
  margin: 0 auto 8px;
  object-fit: contain;
}
.receipt-meta,
.receipt-lines {
  margin-bottom: 8px;
}
.receipt-row,
.receipt-line,
.receipt-total {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  line-height: 16px;
}
.receipt-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: start;
  padding: 4px 0;
  border-bottom: 1px dashed #ccc;
}
.receipt-total {
  font-weight: 700;
  font-size: 14px;
  margin: 8px 0;
}
.receipt-qr-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #000;
}
.receipt-qr {
  display: block;
  width: 48mm;
  height: 48mm;
  margin: 8px auto;
  image-rendering: pixelated;
}
.receipt-url,
.receipt-footer {
  text-align: center;
  word-break: break-all;
}
.receipt-print-hint {
  margin: var(--space-sm) 0 0;
  color: var(--on-surface-variant);
}

@media screen {
  .receipt-ticket { display: none !important; }
}

@media print {
  @page {
    size: 80mm auto;
    margin: 4mm;
  }
  html, body {
    background: #fff !important;
    margin: 0;
    padding: 0;
    color: #000;
  }
  .no-print,
  .pos-header,
  .pos-nav,
  .pos-footer,
  .pos-cart,
  #cart-sidebar,
  #pos-overlay,
  #pos-busy,
  .confirmation-card {
    display: none !important;
  }
  .pos-shell,
  .pos-body,
  .pos-main-area,
  .confirmation-shell,
  .confirmation-main {
    display: block !important;
    background: #fff !important;
    min-height: 0 !important;
    height: auto !important;
    width: auto !important;
    padding: 0 !important;
    overflow: visible !important;
    box-shadow: none !important;
  }
  .receipt-ticket {
    display: block !important;
    width: 72mm;
    max-width: 100%;
  }
}


