:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-strong: #f9fafb;
  --ink: #17202a;
  --muted: #64748b;
  --line: #d8dee6;
  --line-strong: #b7c0cc;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --blue: #2563eb;
  --amber: #b45309;
  --red: #b42318;
  --green-soft: #e7f6f2;
  --amber-soft: #fff2d7;
  --red-soft: #ffe8e6;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
  min-width: 0;
}

button {
  border: 0;
  cursor: pointer;
}

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

.app-shell {
  min-height: 100vh;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 800;
}

.platform-logo {
  display: block;
  flex: 0 0 auto;
  aspect-ratio: 1566 / 538;
  line-height: 0;
}

.platform-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
  user-select: none;
}

.platform-logo-on-dark {
  display: none !important;
}

:root[data-theme="dark"] .platform-logo--adaptive .platform-logo-default {
  display: none;
}

:root[data-theme="dark"] .platform-logo--adaptive .platform-logo-on-dark {
  display: block !important;
}

.platform-logo--header {
  width: 118px;
}

.platform-logo--form {
  width: 154px;
}

.platform-logo--showcase-top {
  width: 138px;
}

.platform-logo--showcase {
  width: min(310px, 100%);
}

.brand h1,
.brand h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0;
  max-width: min(280px, 28vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand p,
.subtle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.field small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.provision-accounts {
  display: grid;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.provision-accounts-heading {
  display: grid;
  gap: 3px;
}

.provision-accounts-heading span {
  color: var(--muted);
  font-size: 0.82rem;
}

.field input,
.field select,
.field textarea,
.toolbar input,
.toolbar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 9px 11px;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 800;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.btn.primary:hover {
  background: var(--accent-dark);
}

.btn.danger {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

.btn.ghost {
  background: transparent;
}

.btn.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.86rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "brand session"
    "tabs tabs";
  gap: 10px 16px;
  align-items: center;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar .brand {
  grid-area: brand;
  margin-bottom: 0;
}

.brand-button {
  width: fit-content;
  max-width: 100%;
  padding: 4px 6px;
  margin: -4px -6px;
  background: transparent;
  color: inherit;
  text-align: left;
  border-radius: 8px;
}

.brand-button:hover,
.brand-button:focus-visible {
  background: var(--surface-strong);
  outline: 1px solid var(--line);
}

.brand-copy {
  min-width: 0;
}

.tabs {
  grid-area: tabs;
  display: flex;
  gap: 6px;
  justify-content: flex-start;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab {
  min-height: 38px;
  white-space: nowrap;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  background: var(--ink);
  color: white;
}

.session {
  grid-area: session;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  min-width: 0;
}

.role-badge,
.license-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--green-soft);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.license-badge.valid {
  background: var(--green-soft);
  color: var(--accent-dark);
}

.license-badge.internal {
  background: var(--amber-soft);
  color: var(--amber);
}

.license-badge.blocked {
  background: var(--red-soft);
  color: var(--red);
}

.sync-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--amber) 38%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--amber-soft) 78%, var(--surface));
  color: var(--amber);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0 10px;
}

.sync-warning {
  display: grid;
  gap: 3px;
  border: 1px solid color-mix(in srgb, var(--amber) 36%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--amber-soft) 82%, var(--surface));
  color: var(--ink);
  font-size: 0.85rem;
  padding: 9px 10px;
}

.sync-warning strong {
  color: var(--amber);
}

.sync-warning span {
  color: var(--muted);
}

.role-badge.admin {
  background: var(--amber-soft);
  color: var(--amber);
}

.role-badge.owner {
  background: #e0f2fe;
  color: #075985;
}

.role-badge.superadmin {
  background: var(--red-soft);
  color: var(--red);
}

.status-badge.voided {
  background: var(--red-soft);
  color: var(--red);
}

.status-badge.paid {
  background: var(--green-soft);
  color: var(--accent-dark);
}

.status-badge.refunded {
  background: var(--amber-soft);
  color: var(--amber);
}

.main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.pos-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 220px);
  gap: 10px;
  width: min(520px, 100%);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding: 16px;
}

.product-tile {
  display: grid;
  min-height: 124px;
  grid-template-rows: 1fr auto auto;
  align-items: start;
  gap: 8px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
}

.product-tile:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.08);
}

.product-name {
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.product-meta,
.ticket-meta,
.audit-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.price {
  font-size: 1.1rem;
  font-weight: 900;
}

.price-stack {
  display: inline-grid;
  gap: 2px;
  align-items: start;
}

.price-stack.compact {
  min-width: 86px;
}

.old-price {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: line-through;
}

.promo-price {
  color: var(--red);
}

.promo-badge {
  width: max-content;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.cart {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.cart-lines {
  display: grid;
  gap: 8px;
  min-height: 156px;
}

.empty-state {
  display: grid;
  min-height: 150px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.qty-controls {
  display: grid;
  grid-template-columns: 32px 34px 32px;
  gap: 4px;
  align-items: center;
}

.qty-controls .qty {
  text-align: center;
  font-weight: 850;
}

.square {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 900;
}

.totals {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.total-row strong {
  font-size: 1.3rem;
}

.total-row.total-due {
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 8px;
}

.total-row.total-due strong {
  color: var(--accent);
  font-size: 1.55rem;
}

.held-carts {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.held-header,
.held-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.held-header span {
  display: grid;
  min-width: 28px;
  min-height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 850;
}

.held-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 10px;
}

.held-card div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.held-card span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.held-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.ticket-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 14px 12px;
}

.ticket-filters [data-field="ticket-search"] {
  grid-column: 1 / -1;
}

.ticket-filters input,
.ticket-filters select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--control);
  color: var(--ink);
  padding: 8px 10px;
  font-weight: 780;
}

.payment-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.payment-switch button {
  min-height: 38px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.payment-switch button.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.quantity-offer-block {
  display: grid;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--green-soft) 72%, var(--surface));
  padding: 8px;
}

.quantity-offer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quantity-offer-heading span {
  font-weight: 900;
}

.quantity-offer-heading small,
.quantity-offer-note {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
}

.quantity-offer-lines {
  display: grid;
  gap: 4px;
  max-height: 158px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.quantity-offer-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 4px 5px;
}

.quantity-offer-product {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.quantity-offer-product span {
  display: grid;
  min-width: 0;
}

.quantity-offer-product strong,
.quantity-offer-product small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quantity-offer-product strong {
  font-size: 0.76rem;
}

.quantity-offer-product small {
  color: var(--muted);
  font-size: 0.66rem;
}

.quantity-offer-thumb {
  display: block;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 4px;
  overflow: hidden;
  object-fit: contain;
  background: white;
}

.quantity-offer-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.quantity-offer-controls {
  display: grid;
  grid-template-columns: 28px 22px 28px;
  align-items: center;
  justify-items: center;
  gap: 2px;
}

.quantity-offer-controls .square {
  width: 28px;
  height: 28px;
  min-height: 28px;
}

.quantity-offer-controls strong {
  font-size: 0.82rem;
}

.quantity-offer-total strong {
  color: var(--accent);
}

.checkout-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.checkout-actions .btn {
  min-height: 42px;
  padding: 0 10px;
}

.checkout-actions [data-action="checkout-print"] {
  background: var(--red);
  border-color: var(--red);
  color: #ffffff;
}

.checkout-actions [data-action="checkout-print"]:disabled {
  opacity: 0.72;
}

.receipt {
  display: grid;
  gap: 8px;
  border-radius: 8px;
  background: #111827;
  color: white;
  padding: 14px;
}

.receipt .subtle,
.receipt .product-meta {
  color: #cbd5e1;
}

.split-view {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 18px;
}

.split-view > .panel {
  min-width: 0;
}

.list {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.ticket-button,
.row-button {
  width: 100%;
  display: grid;
  gap: 5px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 11px;
}

.ticket-button.active,
.row-button.active {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}

.ticket-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.detail {
  display: grid;
  gap: 14px;
  padding: 16px;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.data-table td:last-child,
.data-table th:last-child {
  text-align: right;
}

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

.central-ean-grid {
  grid-template-columns: minmax(300px, 430px) minmax(0, 1fr);
}

.central-ean-list .toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.central-ean-actions {
  min-width: 220px;
}

.mono-code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
  white-space: nowrap;
}

.inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  color: var(--muted);
  font-weight: 700;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 190px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
}

.modal {
  width: min(480px, 100%);
  background: white;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 20px;
}

.modal-wide {
  width: min(760px, 100%);
}

.central-photo-modal {
  width: min(820px, 100%);
  max-height: calc(100svh - 40px);
  overflow-y: auto;
}

.central-photo-editor {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

.central-photo-preview-wrap {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.central-photo-preview {
  width: 100%;
  height: auto;
  min-height: 230px;
  aspect-ratio: 1 / 1;
}

.central-photo-preview img {
  padding: 14px;
}

.central-photo-actions {
  justify-content: flex-start;
}

.modal h2 {
  margin: 0 0 14px;
  font-size: 1.1rem;
}

.note-box {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.86rem;
}

.note-box strong {
  color: var(--ink);
}

.owner-license-output textarea {
  width: 100%;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--control);
  color: var(--ink);
  padding: 9px 10px;
  font-family: Consolas, 'Liberation Mono', monospace;
  font-size: 0.78rem;
  resize: vertical;
}

.create-from-scan-note {
  display: grid;
  gap: 4px;
  margin: 12px 16px 0;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--green-soft) 72%, var(--surface));
  padding: 10px 12px;
}

.create-from-scan-note strong {
  font-size: 0.9rem;
}

.create-from-scan-note span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.compact-table th,
.compact-table td {
  padding: 8px;
}

.mini-input {
  width: 74px;
  min-height: 34px;
  padding: 6px 8px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  min-width: 240px;
  max-width: min(420px, calc(100vw - 36px));
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transition: 160ms ease;
}

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

.production-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  border: 1px solid color-mix(in srgb, var(--amber) 32%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--amber-soft) 82%, var(--surface));
  padding: 12px 14px;
}

.production-banner.danger {
  border-color: color-mix(in srgb, var(--red) 32%, var(--line));
  background: color-mix(in srgb, var(--red-soft) 82%, var(--surface));
}

.production-banner div {
  display: grid;
  gap: 3px;
}

.production-banner strong {
  color: var(--ink);
}

.production-banner span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.kpi {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.kpi span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.kpi strong {
  display: block;
  margin-top: 5px;
  font-size: 1.35rem;
}

.kpi small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.25;
}

@media (max-width: 1040px) {
  .pos-grid,
  .split-view,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "tabs"
      "session";
  }

  .tabs {
    justify-content: flex-start;
  }

  .session {
    justify-content: space-between;
  }
}

@media (max-width: 640px) {
  .main,
  .topbar {
    padding: 14px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
  }

  .toolbar,
  .inline-fields,
  .kpi-row {
    grid-template-columns: 1fr;
  }

  .panel-header,
  .ticket-line {
    align-items: stretch;
    flex-direction: column;
  }

  .cart-line {
    grid-template-columns: 1fr;
  }

  .quick-service-strip {
    grid-template-columns: 1fr;
  }

  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

:root {
  color-scheme: light;
  --bg: #f2f2f0;
  --surface: #ffffff;
  --surface-strong: #f7f7f5;
  --control: #ffffff;
  --ink: #101010;
  --muted: #6c6c68;
  --line: #deded9;
  --line-strong: #b9b9b2;
  --accent: #101010;
  --accent-dark: #000000;
  --blue: #1f2937;
  --amber: #855d12;
  --red: #b42318;
  --green-soft: #eef5ef;
  --amber-soft: #f7efd9;
  --red-soft: #fae8e6;
  --shadow: 0 24px 60px rgba(16, 16, 16, 0.1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070707;
  --surface: #111111;
  --surface-strong: #191919;
  --control: #0c0c0c;
  --ink: #f5f5f0;
  --muted: #a7a7a0;
  --line: #2d2d2a;
  --line-strong: #4b4b45;
  --accent: #f5f5f0;
  --accent-dark: #ffffff;
  --blue: #d7d7d0;
  --amber: #e4c27a;
  --red: #ff867d;
  --green-soft: #1d2a22;
  --amber-soft: #2d2615;
  --red-soft: #321b19;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 280px),
    var(--bg);
}

:root[data-theme="dark"] body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0) 280px),
    var(--bg);
}

.login-card,
.panel,
.kpi,
.modal {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.login-card,
.panel,
.product-tile,
.ticket-button,
.row-button,
.cart-line,
.kpi {
  border-radius: 8px;
}

.topbar {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom-color: var(--line);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

.brand-mark {
  background: var(--ink);
  color: var(--bg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bg) 20%, transparent);
}

.field input,
.field select,
.field textarea,
.toolbar input,
.toolbar select,
.scan-controls input {
  background: var(--control);
  border-color: var(--line);
  color: var(--ink);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.toolbar input:focus,
.toolbar select:focus,
.scan-controls input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent);
}

#cart-discount,
#cash-received {
  background: #087a3f;
  border-color: #24b563;
  color: #ffffff;
  font-weight: 950;
  opacity: 1;
  -webkit-text-fill-color: #ffffff;
}

#cart-discount::placeholder,
#cash-received::placeholder {
  color: rgba(255, 255, 255, 0.72);
  -webkit-text-fill-color: rgba(255, 255, 255, 0.72);
}

#cart-discount:focus,
#cash-received:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(36, 181, 99, 0.32);
}

.btn {
  background: var(--surface-strong);
  border-color: var(--line);
  color: var(--ink);
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.btn:hover:not(:disabled),
.product-tile:hover:not(:disabled),
.ticket-button:hover,
.row-button:hover {
  transform: translateY(-1px);
}

.btn.primary,
.tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.btn.primary:hover {
  background: var(--accent-dark);
}

:root[data-theme="dark"] .btn.primary,
:root[data-theme="dark"] .tab.active {
  color: #050505;
}

.theme-toggle {
  width: 38px;
  min-width: 38px;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
}

.theme-icon {
  display: inline-grid;
  width: 1.25rem;
  height: 1.25rem;
  place-items: center;
}

.scan-strip {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(300px, 520px);
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.scan-strip strong {
  display: block;
  font-size: 1rem;
}

.scan-strip span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
}

.scan-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.customer-display-button {
  border-color: #0f8f88;
  background: #0f8f88;
  color: #ffffff;
}

.customer-display-button:hover:not(:disabled) {
  border-color: #08766f;
  background: #08766f;
  color: #ffffff;
}

.scan-actions {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.scan-controls input {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem;
  font-weight: 800;
}

.unknown-scan-stack {
  display: grid;
  gap: 8px;
}

.unknown-scan-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--amber) 42%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--amber-soft) 78%, var(--surface));
  padding: 9px 10px;
}

.unknown-scan-copy {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.unknown-scan-copy strong {
  color: var(--ink);
  font-size: 0.84rem;
  white-space: nowrap;
}

.unknown-scan-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unknown-scan-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.product-suggestion-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 8px;
}

.product-suggestion-card.muted,
.product-suggestion-card.warning {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.product-suggestion-card.warning {
  border-color: color-mix(in srgb, var(--danger) 44%, var(--line));
  color: var(--danger);
}

.suggestion-thumb {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.suggestion-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.suggestion-body {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.suggestion-body strong,
.suggestion-body span,
.suggestion-body small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-body span,
.suggestion-body small {
  color: var(--muted);
  font-size: 0.78rem;
}

.suggestion-actions {
  display: flex;
  justify-content: flex-end;
}

.code-chip {
  max-width: 160px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  padding: 3px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-sale-strip {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(360px, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.custom-sale-strip strong,
.custom-sale-strip span {
  display: block;
}

.custom-sale-strip span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.custom-sale-controls {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(110px, 0.72fr) minmax(78px, 0.45fr) 68px 84px auto;
  gap: 8px;
}

.custom-sale-controls input,
.custom-sale-controls select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  color: var(--ink);
  padding: 9px 10px;
  font-weight: 780;
}

.quick-service-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 70%, transparent);
  padding: 7px 10px;
}

.quick-service-strip h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.quick-service-button {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  color: var(--ink);
  padding: 5px 7px;
  text-align: left;
}

.quick-service-button:hover {
  border-color: var(--ink);
}

.quick-service-logo {
  display: grid;
  place-items: center;
  width: 58px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.quick-service-logo img {
  display: block;
  max-width: 52px;
  max-height: 28px;
  object-fit: contain;
}

.quick-service-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
  justify-items: center;
  text-align: center;
}

.quick-service-copy strong,
.quick-service-copy span {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-service-copy strong {
  font-size: 0.8rem;
  font-weight: 900;
}

.quick-service-copy span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 760;
}

.product-tile,
.ticket-button,
.row-button,
.cart-line {
  background: var(--control);
  border-color: var(--line);
  color: var(--ink);
}

.product-tile {
  grid-template-rows: 82px 1fr;
  min-height: 196px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.035);
}

.product-tile:hover {
  border-color: var(--ink);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.08);
}

.product-tile-body {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.product-photo,
.product-thumb {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #111111;
  font-weight: 900;
}

.product-photo {
  width: 100%;
  height: 82px;
  border-radius: 7px;
}

.product-thumb {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 6px;
  font-size: 0.76rem;
}

.product-photo img,
.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
}

.product-photo.missing,
.product-thumb.missing {
  background: var(--surface-strong);
  color: var(--muted);
}

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

.media-cell {
  width: 64px;
}

.price-edit-cell,
.cost-edit-cell {
  min-width: 150px;
}

.barcode-edit-cell {
  display: grid;
  min-width: 148px;
  gap: 6px;
}

.quick-barcode-editor {
  min-width: 230px;
}

.price-cell-main {
  display: grid;
  gap: 3px;
  margin-bottom: 6px;
}

.quick-price-editor {
  display: grid;
  grid-template-columns: minmax(82px, 1fr) auto auto;
  gap: 6px;
  align-items: center;
}

.quick-price-editor input {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--control);
  color: var(--ink);
  padding: 6px 8px;
  font-weight: 850;
}

.barcode-chip,
.mono {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0;
}

.barcode-chip {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.age-chip {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--red) 30%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--red-soft) 76%, var(--surface));
  color: var(--red);
  padding: 0 8px;
  font-size: 0.75rem;
  font-weight: 900;
}

.payment-switch,
.square {
  background: var(--surface-strong);
  border-color: var(--line);
}

.payment-switch button.active {
  background: var(--control);
  color: var(--ink);
}

.receipt {
  background: var(--ink);
  color: var(--bg);
}

:root[data-theme="dark"] .receipt {
  background: #f5f5f0;
  color: #050505;
}

:root[data-theme="dark"] .receipt .product-meta {
  color: #4c4c47;
}

.data-table th {
  color: var(--muted);
  letter-spacing: 0;
}

.data-table th,
.data-table td {
  border-bottom-color: var(--line);
}

.admin-stack {
  display: grid;
  gap: 18px;
}

.product-admin-grid {
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
}

.product-admin-grid > .admin-stack:first-child {
  overflow: visible;
}

.product-side-block {
  overflow: hidden;
}

.product-side-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
  padding: 10px;
}

.product-side-nav .btn {
  min-height: 34px;
  padding: 0 8px;
  font-size: 0.78rem;
}

.product-side-section {
  border-bottom: 1px solid var(--line);
}

.product-side-section:last-child {
  border-bottom: 0;
}

.product-side-section:not(.product-main-form) .panel-header {
  background: var(--surface-strong);
  padding-block: 12px;
}

.product-side-section:not(.product-main-form) .detail {
  padding-block: 12px;
}

.product-main-form .panel-header {
  padding: 10px 12px;
}

.product-main-form .detail {
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 10px 12px 12px;
}

.product-main-form .detail > .field:first-of-type,
.product-main-form .detail > .inline-fields,
.product-main-form .detail > .promo-editor,
.product-main-form .detail > .price-history,
.product-main-form .detail > .btn.primary {
  grid-column: 1 / -1;
}

.product-main-form .field {
  gap: 3px;
}

.product-main-form .field label {
  font-size: 0.74rem;
}

.product-main-form .field input,
.product-main-form .field select {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 0.9rem;
}

.product-main-form .inline-fields {
  gap: 8px;
}

.product-main-form .product-three-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-main-form .product-four-fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.product-main-form .promo-editor {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding: 8px;
}

.product-main-form .promo-editor .field {
  min-width: 0;
}

.product-main-form .check-row {
  min-height: 30px;
}

.product-main-form .btn.primary[data-action="save-product"] {
  min-height: 36px;
}

.product-catalog-panel .detail {
  overflow-x: visible;
}

.product-catalog-panel.is-collapsed .catalog-detail {
  padding-bottom: 12px;
}

.catalog-panel-header > div {
  display: grid;
  gap: 3px;
}

.catalog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.catalog-detail {
  gap: 12px;
}

.catalog-collapsed-note {
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
  padding: 8px 10px;
}

.catalog-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(190px, 280px);
  gap: 10px;
  align-items: end;
}

.catalog-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 8px 10px;
}

.catalog-pagination.is-bottom {
  margin-top: 2px;
}

.catalog-pagination > span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.catalog-page-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.catalog-page-buttons .btn {
  min-width: 34px;
}

.catalog-page-gap {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--muted);
  font-weight: 850;
  padding: 0 4px;
}

.catalog-group-list {
  display: grid;
  gap: 12px;
}

.catalog-category-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.catalog-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
  padding: 10px 12px;
}

.catalog-category-header div {
  display: grid;
  gap: 2px;
}

.catalog-category-header strong {
  font-size: 0.95rem;
}

.catalog-category-header span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.catalog-product-list {
  display: grid;
}

.catalog-product-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.15fr) minmax(190px, 0.95fr) minmax(280px, 1.15fr) minmax(86px, auto);
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 12px;
}

.catalog-product-row:last-child {
  border-bottom: 0;
}

.catalog-product-row.is-inactive {
  opacity: 0.62;
}

.catalog-product-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.catalog-product-main > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.catalog-product-main strong {
  overflow-wrap: anywhere;
  line-height: 1.18;
}

.catalog-product-main .barcode-edit-cell {
  justify-content: start;
}

.catalog-product-facts,
.catalog-price-grid {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.catalog-product-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.catalog-price-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.catalog-product-facts span,
.catalog-price-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  padding: 8px;
}

.catalog-product-facts small,
.catalog-price-card small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.catalog-product-facts strong,
.catalog-price-card strong {
  overflow-wrap: anywhere;
  line-height: 1.18;
}

.catalog-price-card .price-cell-main {
  margin-bottom: 2px;
}

.catalog-price-card .quick-price-editor {
  grid-template-columns: minmax(62px, 1fr) auto auto;
  gap: 4px;
}

.catalog-price-card .btn.small {
  min-height: 28px;
  padding: 0 8px;
}

.catalog-price-card .status-badge {
  justify-self: start;
  white-space: normal;
}

.cost-indicative-check,
.indicative-cost-note {
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 800;
}

.cost-indicative-check {
  margin-top: 4px;
}

.catalog-margin.danger strong {
  color: var(--red);
}

.catalog-margin span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-row-actions {
  display: grid;
  gap: 6px;
  min-width: 86px;
}

.catalog-row-actions .btn {
  width: 100%;
}

.customer-admin-grid {
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
}

.customer-select-field select {
  font-weight: 850;
}

.dashboard-page,
.settings-page {
  display: grid;
  gap: 16px;
}

.dashboard-head .panel-header {
  align-items: center;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}

.dashboard-kpis.compact-kpis {
  padding: 0;
}

.dashboard-kpis .kpi {
  margin: 0;
}

.photo-run-kpi.is-running {
  border-color: var(--blue);
}

.photo-run-kpi.is-success {
  border-color: var(--accent);
}

.photo-run-kpi.is-warning {
  border-color: var(--amber);
}

.photo-run-kpi.is-error {
  border-color: var(--red);
}

.quality-panel .detail {
  gap: 10px;
}

.quality-panel.is-collapsed .detail {
  padding-bottom: 12px;
}

.quality-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.quality-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.catalog-coverage {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.catalog-coverage strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.quality-pill {
  display: grid;
  gap: 2px;
  min-height: 66px;
  align-content: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.quality-pill span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.quality-pill strong {
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
}

.quality-pill small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.quality-pill.primary {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
}

.quality-pill.danger {
  border-color: color-mix(in srgb, var(--red) 44%, var(--line));
  background: color-mix(in srgb, var(--red-soft) 40%, var(--surface));
}

.quality-note,
.quality-more-row td {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.quality-note {
  padding: 8px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
}

.quality-note.compact {
  min-height: 38px;
  display: flex;
  align-items: center;
}

.catalog-quality-details {
  display: grid;
  gap: 10px;
}

.quality-more-row td {
  text-align: center;
}

.status-badge.success {
  background: var(--green-soft);
  color: var(--accent-dark);
}

.status-badge.warning {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-badge.danger {
  background: var(--red-soft);
  color: var(--red);
}

.colruyt-rti-detail {
  gap: 10px;
}

.colruyt-rti-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
}

.colruyt-rti-list {
  display: grid;
  gap: 8px;
}

.colruyt-rti-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1.1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.colruyt-rti-row.is-conflict {
  border-color: color-mix(in srgb, var(--amber) 55%, var(--line));
  background: color-mix(in srgb, var(--amber-soft) 32%, var(--surface-strong));
}

.colruyt-rti-current,
.colruyt-rti-suggestion {
  min-width: 0;
}

.colruyt-rti-current,
.colruyt-rti-suggestion > div {
  display: grid;
  gap: 3px;
}

.colruyt-rti-current span,
.colruyt-rti-suggestion span,
.colruyt-rti-current small {
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.colruyt-rti-suggestion .colruyt-rti-conflict {
  color: var(--amber);
  font-weight: 800;
}

.colruyt-rti-suggestion {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.colruyt-rti-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.colruyt-rti-result {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.colruyt-rti-result span {
  color: var(--muted);
  font-size: 0.86rem;
}

.colruyt-rti-result.success {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}

.colruyt-rti-result.warning {
  border-color: color-mix(in srgb, var(--amber) 55%, var(--line));
  background: color-mix(in srgb, var(--amber-soft) 28%, var(--surface-strong));
}

.colruyt-rti-result.danger {
  border-color: color-mix(in srgb, var(--red) 55%, var(--line));
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(360px, 1.25fr);
  gap: 16px;
  align-items: start;
}

.dashboard-wide {
  grid-column: 1 / -1;
}

.cash-grid {
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
}

.cash-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px;
}

.cash-summary .kpi {
  margin: 0;
}

.settings-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.settings-wide {
  grid-column: 1 / -1;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 12px;
  color: var(--text);
  font-weight: 850;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.settings-form textarea {
  min-height: 86px;
}

.license-card,
.license-warning,
.age-warning,
.discount-warning {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 12px;
}

.license-card span,
.license-card small {
  color: var(--muted);
  font-weight: 750;
}

.license-card strong {
  font-size: 1.05rem;
}

.license-card.valid {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: color-mix(in srgb, var(--green-soft) 78%, var(--surface));
}

.license-card.internal {
  border-color: color-mix(in srgb, var(--amber) 30%, var(--line));
  background: color-mix(in srgb, var(--amber-soft) 78%, var(--surface));
}

.license-card.blocked,
.license-warning,
.age-warning,
.discount-warning.active {
  border-color: color-mix(in srgb, var(--red) 32%, var(--line));
  background: color-mix(in srgb, var(--red-soft) 82%, var(--surface));
  color: var(--red);
  font-weight: 850;
}

.discount-warning {
  border-color: color-mix(in srgb, var(--amber) 28%, var(--line));
  background: color-mix(in srgb, var(--amber-soft) 78%, var(--surface));
  color: var(--amber);
  font-size: 0.84rem;
  font-weight: 820;
}

.security-list {
  display: grid;
  gap: 10px;
}

.readiness-score {
  display: grid;
  min-width: 96px;
  min-height: 58px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 8px 12px;
}

.readiness-score strong {
  font-size: 1.2rem;
  line-height: 1;
}

.readiness-score span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.readiness-score.ok {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: color-mix(in srgb, var(--green-soft) 78%, var(--surface));
}

.readiness-score.warning {
  border-color: color-mix(in srgb, var(--amber) 30%, var(--line));
  background: color-mix(in srgb, var(--amber-soft) 78%, var(--surface));
}

.readiness-score.danger {
  border-color: color-mix(in srgb, var(--red) 32%, var(--line));
  background: color-mix(in srgb, var(--red-soft) 82%, var(--surface));
  color: var(--red);
}

.readiness-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.readiness-summary .kpi {
  margin: 0;
}

.readiness-list {
  display: grid;
  gap: 8px;
}

.readiness-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 12px;
}

.readiness-item div {
  display: grid;
  gap: 4px;
}

.readiness-item span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 720;
  line-height: 1.35;
}

.readiness-item em {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.readiness-item-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.readiness-section {
  display: grid;
  gap: 10px;
}

.readiness-section + .readiness-section {
  margin-top: 16px;
}

.readiness-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.readiness-section-title span {
  display: inline-grid;
  min-width: 28px;
  min-height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
}

.readiness-item.ok {
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
}

.readiness-item.warning {
  border-color: color-mix(in srgb, var(--amber) 30%, var(--line));
}

.readiness-item.danger {
  border-color: color-mix(in srgb, var(--red) 32%, var(--line));
  background: color-mix(in srgb, var(--red-soft) 82%, var(--surface));
}

.readiness-item.danger em {
  color: var(--red);
}

.security-item {
  display: grid;
  gap: 4px;
  border: 1px solid color-mix(in srgb, var(--amber) 30%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--amber-soft) 82%, var(--surface));
  padding: 12px;
}

.security-item.danger {
  border-color: color-mix(in srgb, var(--red) 32%, var(--line));
  background: color-mix(in srgb, var(--red-soft) 82%, var(--surface));
}

.security-item.ok {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: color-mix(in srgb, var(--green-soft) 78%, var(--surface));
}

.security-item strong {
  font-size: 0.96rem;
}

.security-item span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
}

.production-page {
  display: grid;
  gap: 14px;
}

.production-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 16px;
  align-items: stretch;
  padding: 18px;
}

.production-hero-copy {
  display: grid;
  align-content: start;
  gap: 12px;
}

.production-hero-copy h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1;
}

.production-hero-copy p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-weight: 680;
  line-height: 1.45;
}

.production-next {
  align-items: start;
  max-width: 760px;
}

.production-next.valid {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: color-mix(in srgb, var(--green-soft) 78%, var(--surface));
}

.production-score-card {
  display: grid;
  align-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 16px;
}

.production-score-card.ok {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: color-mix(in srgb, var(--green-soft) 78%, var(--surface));
}

.production-score-card.warning {
  border-color: color-mix(in srgb, var(--amber) 30%, var(--line));
  background: color-mix(in srgb, var(--amber-soft) 78%, var(--surface));
}

.production-score-card.danger {
  border-color: color-mix(in srgb, var(--red) 32%, var(--line));
  background: color-mix(in srgb, var(--red-soft) 82%, var(--surface));
}

.production-score-card > span,
.production-score-card small,
.production-score-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.production-score-card > strong {
  font-size: 3.2rem;
  line-height: 0.9;
}

.production-score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.production-score-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  padding: 10px;
}

.production-score-grid strong {
  font-size: 1.1rem;
}

.production-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.production-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.production-technical-stack {
  display: grid;
  gap: 14px;
}

.production-recette-list {
  display: grid;
  gap: 8px;
}

.production-recette-list div {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 10px;
}

.production-recette-list strong {
  display: inline-grid;
  min-height: 28px;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--accent);
}

.production-recette-list span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 730;
  line-height: 1.35;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.backup-actions {
  display: inline-flex;
  gap: 8px;
  justify-content: flex-end;
  white-space: nowrap;
}

.import-result {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ean-import-result {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.import-result strong {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  font-size: 0.86rem;
}

.import-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.file-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--ink);
  padding: 0 10px;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.catalog-import-preview {
  display: grid;
  gap: 10px;
}

.import-preview-table {
  font-size: 0.86rem;
}

.import-errors {
  display: grid;
  gap: 6px;
}

.import-errors span {
  border: 1px solid color-mix(in srgb, var(--red) 32%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--red-soft) 82%, var(--surface));
  color: var(--red);
  padding: 9px 10px;
  font-size: 0.84rem;
  font-weight: 800;
}

.promo-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 10px;
}

.promo-editor .check-row {
  grid-column: 1 / -1;
}

.promo-editor .field,
.promo-editor input {
  min-width: 0;
}

.label-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px auto auto;
  gap: 8px;
  align-items: center;
}

.label-controls select,
.label-controls input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--control);
  color: var(--ink);
  padding: 8px 10px;
  font-weight: 800;
}

.shopping-panel .panel-header {
  align-items: center;
}

.shopping-summary {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(150px, 210px) minmax(260px, 0.9fr) minmax(260px, 1fr);
  gap: 10px;
  align-items: stretch;
}

.shopping-summary .kpi {
  margin: 0;
}

.shopping-toolbar {
  width: 100%;
  grid-template-columns: 1fr;
}

.shopping-scan-card {
  display: grid;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--green-soft) 52%, var(--surface));
  padding: 12px;
}

.shopping-scan-head {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}

.shopping-scan-head h3 {
  margin: 0;
}

.shopping-scan-controls,
.shopping-new-product-grid {
  display: grid;
  gap: 8px;
}

.shopping-scan-controls {
  grid-template-columns: minmax(170px, 1.3fr) auto minmax(92px, 0.55fr) minmax(110px, 0.68fr) minmax(110px, 0.68fr) auto;
  align-items: end;
}

.shopping-new-product-grid {
  grid-template-columns: minmax(180px, 1.2fr) minmax(140px, 0.85fr) minmax(90px, 0.45fr) minmax(150px, 0.8fr);
  padding-top: 2px;
}

.shopping-scan-card .field input,
.shopping-scan-card .field select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--control);
  color: var(--ink);
  padding: 8px 10px;
  font-weight: 800;
}

.shopping-scan-lookup,
.shopping-scan-save {
  min-height: 38px;
}

.shopping-scan-product {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(120px, auto);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.shopping-scan-product strong,
.shopping-scan-product span {
  display: block;
}

.compact-kpi {
  min-width: 0;
  margin: 0;
  padding: 8px 10px;
}

.camera-modal {
  width: min(560px, 100%);
  display: grid;
  gap: 12px;
}

.modal-header {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}

.modal-header h2 {
  margin-bottom: 4px;
}

.camera-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050505;
}

.camera-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-target {
  position: absolute;
  inset: 24%;
  border: 3px solid #ffffff;
  border-radius: 8px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.34);
  pointer-events: none;
}

.camera-fallback-actions {
  display: flex;
  justify-content: flex-end;
}

.camera-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.camera-status {
  min-height: 58px;
}

.camera-status span {
  display: block;
}

.supplier-order-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.supplier-order-control select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--control);
  color: var(--ink);
  padding: 8px 10px;
  font-weight: 800;
}

.shopping-table input[type="number"] {
  width: 92px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--control);
  color: var(--ink);
  padding: 7px 9px;
  font-weight: 800;
}

.order-control {
  display: inline-grid;
  grid-template-columns: 92px auto;
  gap: 8px;
  align-items: center;
  justify-content: end;
}

.stock-panel .panel-header {
  align-items: center;
}

.compact-header {
  margin-bottom: 12px;
}

.compact-header .actions {
  align-items: center;
}

.compact-header input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--control);
  color: var(--ink);
  padding: 7px 9px;
  font-weight: 780;
}

.inventory-panel,
.receiving-panel,
.stock-loss-panel {
  margin-bottom: 16px;
}

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

.inventory-head > div {
  display: grid;
  gap: 3px;
}

.inventory-controls,
.receiving-controls,
.stock-loss-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 96px 126px auto;
  gap: 8px;
  margin-bottom: 10px;
}

.stock-loss-controls {
  grid-template-columns: minmax(190px, 1fr) 82px 132px minmax(180px, 1fr) auto;
}

.inventory-controls input,
.inventory-controls select,
.receiving-controls input,
.receiving-controls select,
.stock-loss-controls input,
.stock-loss-controls select,
.inventory-empty input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--control);
  color: var(--ink);
  padding: 8px 10px;
  font-weight: 800;
}

.loss-history-table {
  margin-top: 10px;
}

.inventory-summary {
  margin-top: 10px;
}

.inventory-history {
  margin-top: 14px;
}

.inventory-empty {
  display: grid;
  gap: 10px;
}

.stock-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.stock-summary .kpi {
  margin: 0;
}

.stock-toolbar {
  width: 100%;
  grid-template-columns: minmax(260px, 520px);
  margin-bottom: 12px;
}

.stock-table input[type="number"] {
  width: 96px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--control);
  color: var(--ink);
  padding: 7px 9px;
  font-weight: 800;
}

.stock-track {
  width: max-content;
  min-height: 36px;
  padding: 7px 9px;
}

.stock-actions {
  display: inline-flex;
  gap: 8px;
  justify-content: flex-end;
  white-space: nowrap;
}

.stock-history-panel {
  margin-top: 16px;
}

.closure-panel .panel-header {
  align-items: center;
}

.date-input {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--control);
  color: var(--ink);
  padding: 5px 9px;
  font-weight: 800;
}

.range-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(64px, 1fr));
  gap: 4px;
  padding: 4px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.range-switch button {
  min-height: 30px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.range-switch button.active {
  background: var(--ink);
  color: var(--bg);
}

.closure-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.closure-summary .kpi {
  margin: 0;
}

.closure-count-panel {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(220px, 1.4fr) minmax(140px, 0.8fr);
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.closure-count-panel .field,
.closure-count-panel .kpi {
  margin: 0;
}

.cash-count-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  max-width: 100%;
  overflow: hidden;
  padding: 10px;
}

.cash-count-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(104px, auto);
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.cash-count-header .section-title {
  margin-bottom: 4px;
}

.cash-count-header .product-meta {
  font-size: 0.78rem;
}

.cash-count-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(144px, 100%), 1fr));
  gap: 6px;
}

.cash-count-row {
  display: grid;
  grid-template-columns: minmax(44px, 0.78fr) 42px minmax(48px, 0.72fr);
  gap: 5px;
  align-items: center;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  padding: 5px;
}

.cash-count-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 850;
}

.cash-count-row input {
  width: 100%;
  min-width: 0;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 3px 4px;
  font-size: 0.84rem;
  font-weight: 850;
  text-align: center;
  appearance: textfield;
}

.cash-count-row input::-webkit-outer-spin-button,
.cash-count-row input::-webkit-inner-spin-button {
  margin: 0;
}

.cash-count-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  white-space: nowrap;
  font-size: 0.8rem;
}

.compact-kpi {
  margin: 0;
}

.monthly-z-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 12px;
}

.monthly-z-panel .section-title {
  margin-bottom: 4px;
}

.monthly-z-panel > .product-meta {
  grid-column: 1 / -1;
}

.compact-actions {
  flex-wrap: wrap;
  gap: 6px;
}

.closure-seller-actions {
  justify-content: flex-end;
  margin: 12px 0;
}

.comparison-card {
  border: 1px solid var(--line);
}

.comparison-card small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.25;
}

.comparison-card.good {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background: color-mix(in srgb, var(--green-soft) 80%, var(--surface));
}

.comparison-card.low {
  border-color: color-mix(in srgb, var(--amber) 34%, var(--line));
  background: color-mix(in srgb, var(--amber-soft) 82%, var(--surface));
}

.closure-charts {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  margin: 16px 0;
}

.closure-history-panel {
  margin-bottom: 16px;
}

.chart-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 14px;
}

.bar-list {
  display: grid;
  gap: 10px;
}

.mini-divider {
  height: 1px;
  margin: 12px 0;
  background: var(--line);
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(92px, 150px) minmax(90px, 1fr) minmax(82px, auto);
  gap: 10px;
  align-items: center;
}

.bar-label {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.bar-label strong,
.bar-label span {
  overflow-wrap: anywhere;
}

.bar-label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.bar-track {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--blue));
}

.bar-value {
  justify-self: end;
  white-space: nowrap;
}

.closure-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: start;
}

.section-title {
  margin: 2px 0 10px;
  color: var(--muted);
  font-size: 0.86rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.empty-state.compact {
  min-height: 72px;
}

.toast {
  background: var(--ink);
  color: var(--bg);
  border: 1px solid color-mix(in srgb, var(--bg) 16%, transparent);
}

:root[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.72);
}

@media (max-width: 1040px) {
  .scan-strip,
  .custom-sale-strip,
  .dashboard-grid,
  .cash-grid,
  .cash-summary,
  .settings-grid,
  .product-admin-grid,
  .customer-admin-grid,
  .shopping-summary,
  .stock-summary,
  .readiness-summary,
  .production-hero,
  .production-grid,
  .closure-summary,
  .closure-count-panel,
  .closure-charts,
  .closure-grid,
  .monthly-z-panel {
    grid-template-columns: 1fr;
  }

  .monthly-z-panel > .product-meta {
    grid-column: auto;
  }

  .shopping-scan-controls,
  .shopping-new-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shopping-scan-controls .field:first-child,
  .shopping-scan-save {
    grid-column: 1 / -1;
  }

  .custom-sale-controls {
    grid-template-columns: minmax(150px, 1fr) minmax(120px, 0.75fr) minmax(84px, 0.5fr) 68px 84px;
  }

  .custom-sale-controls .btn {
    grid-column: 1 / -1;
  }

  .product-admin-grid > .admin-stack:first-child {
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
    scrollbar-gutter: auto;
  }
}

@media (max-width: 640px) {
  .topbar {
    position: static;
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "tabs"
      "session";
    gap: 10px;
    padding: 12px;
  }

  .brand {
    margin-bottom: 0;
  }

  .brand h1 {
    font-size: 1rem;
  }

  .tabs {
    justify-content: flex-start;
    margin: 0 -2px;
    padding-bottom: 4px;
  }

  .tab {
    min-height: 42px;
  }

  .session {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .main {
    padding: 12px;
  }

  .production-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .held-card {
    align-items: stretch;
    flex-direction: column;
  }

  .held-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .custom-sale-controls {
    grid-template-columns: 1fr 1fr;
  }

  .custom-sale-controls input:first-child,
  .custom-sale-controls .btn {
    grid-column: 1 / -1;
  }

  .panel-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .scan-controls,
  .copy-row,
  .ticket-filters,
  .import-result,
  .promo-editor,
  .product-main-form .product-three-fields,
  .product-main-form .product-four-fields,
  .label-controls,
  .supplier-order-control,
  .order-control,
  .inventory-controls,
  .receiving-controls,
  .stock-loss-controls,
  .stock-actions,
  .backup-actions,
  .colruyt-rti-row,
  .colruyt-rti-toolbar {
    grid-template-columns: 1fr;
  }

  .readiness-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .readiness-item em {
    justify-content: center;
  }

  .readiness-item-side {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .production-score-grid {
    grid-template-columns: 1fr;
  }

  .production-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .stock-actions,
  .backup-actions,
  .colruyt-rti-actions {
    display: grid;
  }

  .actions,
  .date-input {
    width: 100%;
  }

  .range-switch {
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
  }

  .actions .btn {
    flex: 1 1 128px;
  }

  .chart-panel {
    padding: 12px;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .cash-count-header {
    grid-template-columns: 1fr;
  }

  .bar-value {
    justify-self: start;
  }

  .shopping-table input[type="number"],
  .stock-table input[type="number"],
  .stock-toolbar {
    width: 100%;
  }

  .product-tile {
    min-height: 206px;
  }
}

@media screen {
  .app-shell,
  .topbar,
  .main,
  .panel,
  .panel-header,
  .detail,
  .list,
  .cart,
  .cart-lines,
  .cart-line,
  .product-grid,
  .product-tile,
  .product-tile-body,
  .ticket-button,
  .row-button,
  .admin-stack,
  .product-side-block,
  .product-side-section,
  .chart-panel,
  .dashboard-page,
  .settings-page,
  .shopping-panel,
  .shopping-scan-card,
  .shopping-scan-controls,
  .shopping-new-product-grid,
  .shopping-scan-product,
  .stock-panel,
  .closure-panel,
  .quality-panel,
  .colruyt-rti-panel,
  .colruyt-rti-row,
  .colruyt-rti-current,
  .colruyt-rti-suggestion,
  .product-catalog-panel,
  .catalog-detail,
  .catalog-pagination,
  .catalog-page-buttons,
  .catalog-group-list,
  .catalog-category-group,
  .catalog-product-row,
  .catalog-product-main,
  .catalog-product-facts,
  .catalog-price-grid {
    min-width: 0;
    max-width: 100%;
  }

  .pos-grid,
  .split-view,
  .admin-grid,
  .product-admin-grid,
  .customer-admin-grid,
  .dashboard-grid,
  .cash-grid,
  .settings-grid,
  .shopping-summary,
  .closure-grid,
  .closure-charts {
    min-width: 0;
    max-width: 100%;
  }

  .tabs,
  .session,
  .actions,
  .held-actions,
  .backup-actions,
  .stock-actions,
  .table-actions,
  .import-toolbar {
    flex-wrap: wrap;
    min-width: 0;
    max-width: 100%;
  }

  .tab,
  .btn,
  .role-badge,
  .license-badge,
  .status-badge,
  .barcode-chip,
  .mono {
    max-width: 100%;
  }

  .btn,
  .tab,
  .role-badge,
  .license-badge,
  .status-badge {
    overflow-wrap: anywhere;
    text-align: center;
  }

  .scan-strip,
  .custom-sale-strip {
    grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
    max-width: 100%;
  }

  .scan-controls,
  .custom-sale-controls,
  .catalog-filters,
  .toolbar,
  .ticket-filters,
  .inline-fields,
  .promo-editor,
  .label-controls,
  .supplier-order-control,
  .inventory-controls,
  .receiving-controls,
  .stock-loss-controls,
  .closure-count-panel,
  .cash-count-header,
  .bar-row,
  .copy-row {
    min-width: 0;
    max-width: 100%;
  }

  .data-table {
    max-width: 100%;
    table-layout: auto;
  }

  .data-table th,
  .data-table td {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .table-actions,
  .stock-actions,
  .backup-actions,
  .order-control,
  .quick-barcode-editor,
  .price-edit-cell,
  .cost-edit-cell,
  .barcode-edit-cell {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
  }

  .stock-track {
    width: auto;
    max-width: 100%;
  }
}

@media screen and (max-width: 1040px) {
  .scan-strip,
  .custom-sale-strip {
    grid-template-columns: 1fr;
  }

  .catalog-product-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .catalog-row-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 1180px) {
  .pos-grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  }

  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  }
}

@media screen and (max-width: 760px) {
  .central-ean-list .toolbar,
  .central-photo-editor {
    grid-template-columns: 1fr;
  }

  .central-ean-actions {
    min-width: 0;
  }

  .central-photo-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .central-photo-actions .btn {
    width: 100%;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(136px, 100%), 1fr));
  }

  .data-table {
    display: table;
    overflow-x: visible;
    table-layout: fixed;
    white-space: normal;
  }

  .data-table th,
  .data-table td {
    padding: 8px 6px;
  }

  .quick-price-editor {
    grid-template-columns: 1fr;
  }

  .shopping-scan-head,
  .modal-header {
    display: grid;
  }

  .shopping-scan-head .actions,
  .modal-header .btn {
    justify-content: stretch;
  }

  .shopping-scan-head .actions .btn,
  .modal-header .btn,
  .camera-fallback-actions .btn,
  .shopping-scan-controls .btn,
  .shopping-scan-save {
    width: 100%;
  }

  .camera-fallback-actions {
    justify-content: stretch;
  }

  .shopping-scan-controls,
  .shopping-new-product-grid,
  .shopping-scan-product {
    grid-template-columns: 1fr;
  }

  .shopping-scan-product .product-thumb {
    width: 58px;
    height: 58px;
  }

  .camera-backdrop {
    align-items: stretch;
    padding: 10px;
  }

  .camera-modal {
    align-self: center;
    max-height: calc(100svh - 20px);
    overflow-y: auto;
  }

  .catalog-filters,
  .catalog-price-grid {
    grid-template-columns: 1fr;
  }

  .catalog-category-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .catalog-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-page-buttons {
    justify-content: flex-start;
  }

  .catalog-actions,
  .quality-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .catalog-actions .btn,
  .quality-actions .btn {
    width: 100%;
  }

  .cash-count-row {
    grid-template-columns: minmax(40px, 0.8fr) 40px minmax(46px, 0.7fr);
  }
}

@media screen and (max-width: 420px) {
  .product-grid,
  .dashboard-kpis,
  .quality-summary-strip,
  .stock-summary,
  .closure-summary,
  .cash-count-grid,
  .catalog-product-facts {
    grid-template-columns: 1fr;
  }

  .payment-switch,
  .range-switch,
  .held-actions {
    grid-template-columns: 1fr;
  }

  .product-tile {
    min-height: 190px;
  }
}

@media screen {
  .pos-shell {
    display: grid;
    height: 100dvh;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .pos-shell .topbar {
    position: static;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand tabs session";
    gap: 8px 12px;
    padding: 8px 14px;
  }

  .pos-shell .brand {
    gap: 8px;
    min-width: 0;
  }

  .pos-shell .brand-mark {
    width: 36px;
    height: 36px;
  }

  .pos-shell .brand h1 {
    font-size: 1rem;
  }

  .pos-shell .brand p {
    display: none;
  }

  .pos-shell .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0;
  }

  .pos-shell .tab {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 10px;
  }

  .pos-shell .session {
    flex-wrap: wrap;
    gap: 6px;
  }

  .pos-shell .session strong {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pos-shell .btn.small,
  .pos-shell .theme-toggle {
    min-height: 32px;
  }

  .pos-main {
    display: grid;
    height: 100%;
    min-height: 0;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 8px;
    overflow: hidden;
    padding: 10px 14px;
  }

  .pos-main .production-banner,
  .pos-main .scan-strip,
  .pos-main .custom-sale-strip,
  .pos-main .kpi-row {
    margin: 0;
  }

  .pos-main .production-banner {
    padding: 8px 10px;
  }

  .pos-main .scan-strip,
  .pos-main .custom-sale-strip {
    padding: 8px 10px;
    gap: 10px;
    box-shadow: none;
  }

  .pos-main .scan-strip {
    grid-template-columns: minmax(116px, 0.34fr) minmax(0, 1fr);
  }

  .pos-main .custom-sale-strip {
    grid-template-columns: minmax(116px, 0.26fr) minmax(0, 1fr);
  }

  .pos-main .scan-strip span,
  .pos-main .custom-sale-strip span {
    display: none;
  }

  .pos-main .scan-strip strong,
  .pos-main .custom-sale-strip strong {
    font-size: 0.92rem;
  }

  .pos-main .scan-controls {
    grid-template-columns: minmax(0, 1fr) auto auto auto auto;
    gap: 6px;
  }

  .pos-main .scan-controls input {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 0.94rem;
  }

  .pos-main .unknown-scan-panel {
    padding: 6px 8px;
  }

  .pos-main .unknown-scan-copy {
    gap: 6px;
  }

  .pos-main .unknown-scan-copy small {
    display: none;
  }

  .pos-main .product-suggestion-card {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    padding: 6px;
  }

  .pos-main .suggestion-thumb {
    width: 34px;
    height: 34px;
  }

  .pos-main .suggestion-body small {
    display: none;
  }

  .pos-main .custom-sale-controls {
    grid-template-columns: minmax(108px, 1fr) minmax(92px, 0.7fr) 76px 52px 70px auto;
    gap: 6px;
  }

  .pos-main .custom-sale-controls input,
  .pos-main .custom-sale-controls select {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 0.92rem;
  }

  .pos-main .kpi-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .pos-main .kpi {
    padding: 7px 10px;
  }

  .pos-main .kpi span {
    font-size: 0.72rem;
  }

  .pos-main .kpi strong {
    margin-top: 2px;
    font-size: 1.05rem;
  }

  .pos-main .pos-grid {
    height: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.42fr);
    gap: 10px;
    align-items: stretch;
  }

  .pos-main .pos-grid > .panel {
    display: grid;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .pos-main .pos-grid > .pos-products-panel {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .pos-main .panel-header {
    gap: 8px;
    padding: 8px 10px;
  }

  .pos-main .panel-title {
    font-size: 0.95rem;
  }

  .pos-main .toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(120px, 180px);
    gap: 6px;
  }

  .pos-main .toolbar input,
  .pos-main .toolbar select {
    min-height: 34px;
    padding: 7px 9px;
  }

  .pos-main .quick-service-strip {
    padding: 5px 7px;
    gap: 6px;
  }

  .pos-main .quick-service-button {
    grid-template-columns: 52px minmax(0, 1fr);
    min-height: 42px;
    padding: 4px 6px;
    gap: 7px;
  }

  .pos-main .quick-service-logo {
    width: 52px;
    height: 32px;
  }

  .pos-main .quick-service-logo img {
    max-width: 48px;
    max-height: 26px;
  }

  .pos-main .quick-service-copy strong {
    font-size: 0.72rem;
  }

  .pos-main .quick-service-copy span {
    font-size: 0.56rem;
  }

  .pos-main .product-grid {
    align-content: start;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 8px;
    overflow-y: auto;
    padding: 8px;
  }

  .pos-main .product-tile {
    min-height: 136px;
    grid-template-rows: 54px minmax(0, 1fr);
    gap: 5px;
    padding: 7px;
  }

  .pos-main .product-photo {
    height: 54px;
  }

  .pos-main .product-photo img,
  .pos-main .product-thumb img {
    padding: 3px;
  }

  .pos-main .product-tile-body {
    gap: 4px;
  }

  .pos-main .product-name {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.86rem;
    line-height: 1.12;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .pos-main .product-meta {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.72rem;
    line-height: 1.2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .pos-main .barcode-chip {
    min-height: 20px;
    padding: 0 6px;
    font-size: 0.66rem;
  }

  .pos-main .price {
    font-size: 1rem;
  }

  .pos-main .cart {
    align-content: start;
    min-height: 0;
    gap: 8px;
    overflow-y: auto;
    padding: 8px 10px;
  }

  .pos-main .cart-lines {
    min-height: 82px;
    max-height: min(30dvh, 190px);
    gap: 6px;
    overflow-y: auto;
  }

  .pos-main .empty-state {
    min-height: 72px;
    padding: 10px;
  }

  .pos-main .cart-line {
    gap: 6px;
    padding: 7px;
  }

  .pos-main .product-thumb {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .pos-main .qty-controls {
    grid-template-columns: 28px 30px 28px;
    gap: 3px;
  }

  .pos-main .square {
    width: 28px;
    height: 28px;
  }

  .pos-main .totals {
    gap: 6px;
    padding-top: 8px;
  }

  .pos-main .field {
    gap: 4px;
  }

  .pos-main .field label {
    font-size: 0.74rem;
  }

  .pos-main .field input,
  .pos-main .field select {
    min-height: 32px;
    padding: 5px 8px;
  }

  .pos-main .total-row {
    gap: 8px;
  }

  .pos-main .total-row strong {
    font-size: 1rem;
  }

  .pos-main .total-row.total-due strong {
    font-size: 1.28rem;
  }

  .pos-main .payment-switch button {
    min-height: 32px;
    font-size: 0.86rem;
  }

  .pos-main .receipt {
    gap: 4px;
    padding: 8px;
    font-size: 0.82rem;
  }

  .pos-main .held-carts {
    gap: 6px;
    padding-top: 8px;
  }

  .pos-main .held-card {
    padding: 7px;
  }
}

@media screen and (max-width: 1180px) {
  .pos-shell .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "brand session"
      "tabs tabs";
  }

  .pos-shell .session {
    justify-content: flex-end;
  }
}

@media screen and (max-width: 900px) {
  .pos-shell .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "brand session"
      "tabs tabs";
  }

  .pos-shell .session {
    justify-content: flex-end;
  }

  .pos-main {
    padding: 8px;
  }

  .pos-main .scan-strip,
  .pos-main .custom-sale-strip {
    grid-template-columns: 1fr;
  }

  .pos-main .scan-controls {
    grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  }

  .pos-main .custom-sale-controls {
    grid-template-columns: minmax(0, 1fr) minmax(94px, 0.7fr) 70px 50px 68px auto;
  }

  .pos-main .pos-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.45fr);
  }
}

@media screen and (max-width: 700px) {
  .pos-shell .topbar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "tabs"
      "session";
    gap: 6px;
    padding: 8px;
  }

  .pos-shell .session {
    justify-content: flex-start;
  }

  .pos-shell .tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    overflow-x: visible;
  }

  .pos-shell .tab {
    width: 100%;
    min-width: 0;
    padding: 0 4px;
    font-size: 0.72rem;
    line-height: 1.1;
    white-space: normal;
  }

  .pos-main {
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 6px;
  }

  .pos-main .scan-strip,
  .pos-main .custom-sale-strip,
  .pos-main .panel-header,
  .pos-main .cart {
    padding: 7px;
  }

  .pos-main .scan-controls,
  .pos-main .custom-sale-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-main .unknown-scan-panel {
    align-items: stretch;
  }

  .pos-main .unknown-scan-copy {
    flex-wrap: wrap;
  }

  .pos-main .scan-controls input,
  .pos-main .custom-sale-controls input:first-child,
  .pos-main .custom-sale-controls .btn {
    grid-column: 1 / -1;
  }

  .pos-main .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .pos-main .kpi {
    padding: 6px 8px;
  }

  .pos-main .pos-grid {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(150px, 0.52fr) minmax(190px, 0.48fr);
    gap: 8px;
  }

  .pos-main .panel-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .pos-main .toolbar {
    grid-template-columns: 1fr;
  }

  .pos-main .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 7px;
  }

  .pos-main .product-tile {
    min-height: 118px;
    grid-template-rows: 42px minmax(0, 1fr);
  }

  .pos-main .product-photo {
    height: 42px;
  }

  .pos-main .cart-lines {
    max-height: 120px;
  }
}

@media screen and (max-width: 420px) {
  .pos-shell .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "brand session"
      "tabs tabs";
    gap: 5px 6px;
    padding: 6px;
  }

  .pos-shell .brand-mark {
    width: 32px;
    height: 32px;
  }

  .pos-shell .session {
    flex-wrap: nowrap;
    justify-content: flex-end;
    overflow-x: auto;
  }

  .pos-shell .session .license-badge,
  .pos-shell .session .role-badge,
  .pos-shell .session strong {
    display: none;
  }

  .pos-shell .tab {
    min-height: 32px;
    padding: 0 8px;
  }

  .pos-shell .btn.small,
  .pos-shell .theme-toggle {
    min-height: 30px;
    padding: 0 8px;
  }

  .pos-main {
    gap: 5px;
    padding: 6px;
  }

  .pos-main .scan-strip,
  .pos-main .custom-sale-strip {
    padding: 5px 6px;
  }

  .pos-main .scan-strip > div:first-child,
  .pos-main .custom-sale-strip > div:first-child {
    display: none;
  }

  .pos-main .scan-controls {
    grid-template-columns: minmax(0, 1fr) 62px 76px 54px 72px;
  }

  .pos-main .unknown-scan-panel {
    display: grid;
    gap: 6px;
  }

  .pos-main .unknown-scan-actions {
    justify-content: stretch;
  }

  .pos-main .unknown-scan-actions .btn {
    flex: 1 1 0;
  }

  .pos-main .product-suggestion-card {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .pos-main .suggestion-thumb {
    width: 30px;
    height: 30px;
  }

  .pos-main .suggestion-actions {
    grid-column: 1 / -1;
  }

  .pos-main .suggestion-actions .btn {
    width: 100%;
  }

  .pos-main .custom-sale-controls {
    grid-template-columns: minmax(74px, 1fr) minmax(62px, 0.72fr) 48px 36px 48px 50px;
  }

  .pos-main .scan-controls input,
  .pos-main .custom-sale-controls input,
  .pos-main .custom-sale-controls select {
    min-height: 32px;
    padding: 5px 6px;
    font-size: 0.82rem;
  }

  .pos-main .scan-controls .btn,
  .pos-main .custom-sale-controls .btn {
    min-height: 32px;
    padding: 0 6px;
    font-size: 0.76rem;
  }

  .pos-main .scan-controls input,
  .pos-main .custom-sale-controls input:first-child,
  .pos-main .custom-sale-controls .btn {
    grid-column: auto;
  }

  .pos-main .kpi-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .pos-main .kpi {
    padding: 5px;
  }

  .pos-main .kpi span {
    overflow: hidden;
    font-size: 0.62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pos-main .kpi strong {
    font-size: 0.9rem;
  }

  .pos-main .panel-header {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    padding: 6px;
  }

  .pos-main .toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .pos-main .toolbar select {
    display: none;
  }

  .pos-main .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-main .payment-switch {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pos-main .product-tile {
    min-height: 112px;
    grid-template-rows: 40px minmax(0, 1fr);
  }

  .pos-main .product-photo {
    height: 40px;
  }
}

.print-root {
  display: none;
}

@media print {
  @page {
    size: 80mm auto;
    margin: 4mm;
  }

  body * {
    visibility: hidden;
  }

  .print-root,
  .print-root * {
    visibility: visible;
  }

  .print-root {
    display: block;
    position: absolute;
    inset: 0 auto auto 0;
    width: 72mm;
    background: #ffffff;
    color: #000000;
    font-family: "Courier New", monospace;
    font-size: 11px;
    line-height: 1.28;
  }

  .print-ticket h1 {
    margin: 0 0 4px;
    font-size: 16px;
    text-align: center;
  }

  .print-ticket p {
    margin: 1px 0;
  }

  .print-center {
    text-align: center;
  }

  .print-separator {
    border-top: 1px dashed #000000;
    margin: 7px 0;
  }

  .print-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 3px 0;
  }

  .print-total {
    font-size: 14px;
    font-weight: 900;
  }

  .print-section-title {
    display: block;
    margin: 4px 0;
    text-align: center;
    font-size: 10px;
    text-transform: uppercase;
  }

  .print-lines,
  .print-vat {
    width: 100%;
    border-collapse: collapse;
  }

  .print-lines td,
  .print-vat th,
  .print-vat td {
    padding: 2px 0;
    text-align: left;
    vertical-align: top;
  }

  .print-lines td:nth-child(2),
  .print-lines td:nth-child(3),
  .print-vat th:nth-child(n + 2),
  .print-vat td:nth-child(n + 2) {
    text-align: right;
  }

  .print-lines td:first-child {
    width: 42%;
  }

  .print-lines span {
    display: block;
    font-size: 9px;
  }

  .label-print-root {
    width: 194mm;
    font-family: Arial, sans-serif;
    font-size: 10px;
    line-height: 1.12;
  }

  .print-label-sheet {
    display: grid;
    grid-template-columns: repeat(3, 62mm);
    gap: 3mm;
    align-items: start;
  }

  .price-label {
    display: grid;
    grid-template-rows: auto minmax(10mm, auto) auto auto auto auto;
    gap: 1.2mm;
    min-height: 32mm;
    padding: 2mm;
    border: 1px solid #000000;
    break-inside: avoid;
    page-break-inside: avoid;
    overflow: hidden;
  }

  .label-shop,
  .label-tax,
  .label-code {
    text-align: center;
    font-size: 8px;
  }

  .label-shop {
    font-weight: 800;
    text-transform: uppercase;
  }

  .label-name {
    display: -webkit-box;
    overflow: hidden;
    text-align: center;
    font-size: 10px;
    line-height: 1.12;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .label-price {
    text-align: center;
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
  }

  .label-barcode {
    display: grid;
    height: 11mm;
    gap: 0;
    background: #ffffff;
  }

  .label-barcode.code128 {
    height: 12mm;
    padding: 0 2mm;
  }

  .label-barcode span.on {
    background: #000000;
  }

  .label-code-only {
    display: grid;
    height: 11mm;
    place-items: center;
    border: 1px solid #000000;
    font-weight: 900;
    letter-spacing: 2px;
  }
}

/* Visual polish: stronger hierarchy while keeping the POS compact and fast. */
@media screen {
  :root[data-theme="dark"] {
    --bg: #080a09;
    --surface: #111412;
    --surface-strong: #181c19;
    --control: #0b0e0c;
    --ink: #f7f8f4;
    --muted: #9da59f;
    --line: #2b302c;
    --line-strong: #555d57;
    --shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
  }

  body,
  :root[data-theme="dark"] body {
    background: var(--bg);
  }

  ::selection {
    background: var(--ink);
    color: var(--bg);
  }

  * {
    scrollbar-color: var(--line-strong) transparent;
    scrollbar-width: thin;
  }

  *::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  *::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--line-strong);
    background-clip: padding-box;
  }

  .login-page {
    position: relative;
    isolation: isolate;
    padding: 32px 20px;
  }

  .login-page::before {
    position: fixed;
    z-index: -1;
    inset: 0;
    border: 12px solid color-mix(in srgb, var(--surface) 70%, transparent);
    content: "";
    pointer-events: none;
  }

  .login-shell {
    display: grid;
    width: min(920px, 100%);
    min-height: 540px;
    grid-template-columns: minmax(0, 0.92fr) minmax(380px, 1.08fr);
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 34px 100px rgba(0, 0, 0, 0.52);
  }

  .login-showcase {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-width: 0;
    padding: 34px;
    background: #f3f5f2;
    color: #081729;
  }

  .login-showcase-top,
  .login-showcase-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .login-showcase-top > i {
    display: block;
    width: 38px;
    height: 2px;
    background: currentColor;
  }

  .login-showcase-main {
    display: grid;
    align-content: center;
    gap: 22px;
  }

  .login-showcase-mark {
    display: grid;
    width: 118px;
    height: 118px;
    place-items: center;
    border: 2px solid currentColor;
    border-radius: 8px;
    font-size: 2.75rem;
    font-weight: 950;
  }

  .login-showcase-main h1 {
    max-width: 300px;
    margin: 0;
    font-size: 2.4rem;
    line-height: 1.02;
    overflow-wrap: anywhere;
  }

  .login-showcase-main p {
    margin: 10px 0 0;
    font-size: 0.82rem;
    font-weight: 800;
    opacity: 0.66;
    text-transform: uppercase;
  }

  .login-showcase-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 14px;
  }

  .login-showcase-bars i {
    display: block;
    width: 4px;
    background: currentColor;
  }

  .login-showcase-bars i:nth-child(1) {
    height: 6px;
  }

  .login-showcase-bars i:nth-child(2) {
    height: 10px;
  }

  .login-showcase-bars i:nth-child(3) {
    height: 14px;
  }

  .login-card {
    align-content: center;
    width: 100%;
    border: 0;
    border-radius: 0;
    padding: 54px 48px;
    box-shadow: none;
  }

  .login-card .brand {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 24px;
  }

  .login-card .login-form-brand {
    display: block;
  }

  .login-card .brand-mark {
    width: 48px;
    height: 48px;
    border: 1px solid var(--ink);
    font-size: 1rem;
  }

  .login-card .platform-logo--form {
    width: 148px;
  }

  .login-card .brand h1,
  .login-card .brand h2 {
    max-width: none;
    overflow: visible;
    font-size: 1.5rem;
    text-overflow: clip;
    white-space: normal;
  }

  .login-card .field {
    gap: 8px;
  }

  .login-card .field label {
    color: var(--ink);
    font-size: 0.78rem;
    text-transform: uppercase;
  }

  .login-card .field input {
    min-height: 48px;
    border-color: var(--line-strong);
    padding-inline: 14px;
  }

  .login-card .btn.primary {
    min-height: 48px;
    margin-top: 8px;
    font-size: 0.98rem;
  }

  .topbar {
    border-bottom-color: var(--line-strong);
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  }

  .topbar .brand-mark {
    border: 1px solid color-mix(in srgb, var(--ink) 24%, var(--line));
  }

  .topbar .brand-copy h1 {
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-button:hover,
  .brand-button:focus-visible {
    background: var(--surface-strong);
    outline-color: var(--line-strong);
  }

  .tab {
    position: relative;
    border: 1px solid transparent;
  }

  .tab:hover:not(.active) {
    border-color: var(--line);
    background: var(--surface-strong);
    color: var(--ink);
  }

  .tab.active {
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.22);
  }

  .panel,
  .scan-strip,
  .custom-sale-strip,
  .kpi {
    border-color: var(--line);
  }

  .panel {
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
  }

  .panel-header {
    background: color-mix(in srgb, var(--surface-strong) 72%, var(--surface));
  }

  .panel-title {
    font-weight: 900;
  }

  .scan-strip {
    border-left: 3px solid var(--ink);
  }

  .custom-sale-strip {
    border-left: 3px solid var(--line-strong);
  }

  .scan-controls input {
    border-color: var(--line-strong);
  }

  .btn {
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ink) 5%, transparent);
  }

  .btn:hover:not(:disabled) {
    border-color: var(--line-strong);
  }

  .btn.primary {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  }

  .kpi {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  }

  .kpi::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 2px;
    background: var(--line-strong);
    content: "";
  }

  .quick-service-strip {
    border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  }

  .quick-service-button {
    transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
  }

  .quick-service-button:hover {
    background: var(--surface-strong);
    transform: translateY(-1px);
  }

  .product-grid {
    background: color-mix(in srgb, var(--bg) 54%, var(--surface));
  }

  .product-tile {
    position: relative;
    overflow: hidden;
    border-color: var(--line);
    background: var(--control);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.16);
    transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
  }

  .product-tile:hover:not(:disabled) {
    border-color: var(--line-strong);
    background: var(--surface-strong);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
  }

  .product-photo {
    border-color: color-mix(in srgb, var(--line) 78%, #ffffff);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
  }

  .product-name {
    color: var(--ink);
    font-weight: 900;
  }

  .barcode-chip {
    border-color: color-mix(in srgb, var(--line) 80%, transparent);
    background: var(--surface);
  }

  .pos-grid > aside.panel {
    border-color: var(--line-strong);
    box-shadow: -8px 14px 38px rgba(0, 0, 0, 0.26);
  }

  .cart-line {
    background: var(--control);
    transition: border-color 120ms ease, background 120ms ease;
  }

  .cart-line:hover {
    border-color: var(--line-strong);
    background: var(--surface-strong);
  }

  .empty-state {
    background: color-mix(in srgb, var(--control) 74%, transparent);
  }

  .totals {
    border-top-color: var(--line-strong);
  }

  .total-row.total-due {
    margin-inline: -4px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--surface-strong);
    padding: 8px 10px;
  }

  .total-row.total-due strong {
    color: var(--ink);
  }

  .payment-switch {
    background: var(--control);
  }

  .payment-switch button.active {
    background: var(--ink);
    color: var(--bg);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28);
  }

  .quantity-offer-block {
    border-left: 3px solid #26a269;
    background: color-mix(in srgb, #123724 38%, var(--surface));
  }

  .quantity-offer-line {
    background: color-mix(in srgb, var(--control) 86%, transparent);
  }

  .checkout-actions .btn {
    font-weight: 900;
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.22);
  }

  .checkout-actions [data-action="checkout"] {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--bg);
  }

  .checkout-actions [data-action="checkout-print"] {
    background: #c4433c;
    border-color: #db5c54;
  }

  .checkout-actions [data-action="checkout-print"]:hover:not(:disabled) {
    background: #d14b43;
  }

  .receipt {
    border: 1px solid #d8d8d2;
    background: #f3f3ed;
    color: #111411;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  }

  .receipt .subtle,
  .receipt .product-meta {
    color: #555b56;
  }

  @media (max-width: 700px) {
    .login-page::before {
      border-width: 6px;
    }

    .login-shell {
      width: min(440px, 100%);
      min-height: 0;
      grid-template-columns: 1fr;
    }

    .login-showcase {
      min-height: 132px;
      grid-template-columns: auto minmax(0, 1fr);
      grid-template-rows: 1fr;
      align-items: center;
      gap: 18px;
      padding: 22px;
    }

    .login-showcase-top,
    .login-showcase-footer {
      display: none;
    }

    .login-showcase-main {
      display: contents;
    }

    .platform-logo--showcase {
      width: 132px;
    }

    .login-showcase-mark {
      width: 70px;
      height: 70px;
      font-size: 1.7rem;
    }

    .login-showcase-main h1 {
      font-size: 1.65rem;
    }

    .login-card {
      padding: 30px 24px 32px;
    }

    .login-card .platform-logo--form {
      width: 128px;
    }

    .pos-grid > aside.panel {
      box-shadow: 0 -6px 26px rgba(0, 0, 0, 0.24);
    }
  }
}

@media screen and (max-width: 700px) {
  .pos-shell .platform-logo--header {
    width: 92px;
  }

  .pos-shell .topbar .brand-copy h1 {
    max-width: 82px;
    font-size: 0.88rem;
  }
}

@media screen and (max-width: 420px) {
  .pos-shell .platform-logo--header {
    width: 74px;
  }

  .pos-shell .topbar .brand-copy h1 {
    max-width: 58px;
    font-size: 0.78rem;
  }
}
