:root {
  --bg: #eef2f6;
  --panel: #fbfcfd;
  --ink: #102033;
  --muted: #66758a;
  --line: #d9e2ec;
  --line-strong: #c8d3df;
  --primary: #0f7f5b;
  --primary-dark: #0b6347;
  --accent: #c83d35;
  --warn: #b7791f;
  --good: #23704a;
  --soft-green: #edf8f3;
  --soft-red: #fff0ef;
  --soft-yellow: #fff5db;
  --shadow: 0 12px 28px rgba(26, 39, 54, 0.065);
  --ui-scale: 1;
  --space-scale: 1;
  --font-scale: 1;
  --control-scale: 1;
  --panel-pad: 18px;
  --pos-gap: 18px;
  --topbar-gap: 12px;
  --topbar-control: 38px;
  --scan-control: 46px;
  --scan-side-button: 46px;
  --input-font: 19px;
  --row-pad-y: 13px;
  --row-pad-x: 14px;
  --cart-name-font: 17px;
  --quick-card-height: 72px;
  --pay-method-height: 54px;
  --complete-sale-height: 64px;
  --pos-sticky-top: 18px;
  --pos-panel-offset: 108px;
  --cart-height-offset: 258px;
  --cart-min-height: 520px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Segoe UI, Arial, sans-serif;
  letter-spacing: 0;
}

body[data-screen-scale="0.7"] {
  --ui-scale: 0.82;
  --space-scale: 0.72;
  --font-scale: 0.86;
  --control-scale: 0.84;
  --pos-panel-offset: 66px;
  --cart-height-offset: 208px;
  --cart-min-height: 390px;
}

body[data-screen-scale="0.8"] {
  --ui-scale: 0.88;
  --space-scale: 0.8;
  --font-scale: 0.9;
  --control-scale: 0.9;
  --pos-panel-offset: 72px;
  --cart-height-offset: 220px;
  --cart-min-height: 430px;
}

body[data-screen-scale="0.9"] {
  --ui-scale: 0.94;
  --space-scale: 0.9;
  --font-scale: 0.95;
  --control-scale: 0.95;
  --pos-panel-offset: 80px;
  --cart-height-offset: 238px;
  --cart-min-height: 470px;
}

body[data-screen-scale="1"] {
  --ui-scale: 1;
  --space-scale: 1;
  --font-scale: 1;
  --control-scale: 1;
  --pos-panel-offset: 88px;
  --cart-height-offset: 258px;
  --cart-min-height: 520px;
}

body[data-screen-scale="1.1"] {
  --ui-scale: 1.06;
  --space-scale: 1.06;
  --font-scale: 1.06;
  --control-scale: 1.06;
  --pos-panel-offset: 96px;
  --cart-height-offset: 278px;
  --cart-min-height: 560px;
}

body[data-screen-scale="1.3"] {
  --ui-scale: 1.16;
  --space-scale: 1.16;
  --font-scale: 1.16;
  --control-scale: 1.16;
  --pos-panel-offset: 108px;
  --cart-height-offset: 310px;
  --cart-min-height: 620px;
}

body[data-screen-scale="1.5"] {
  --ui-scale: 1.28;
  --space-scale: 1.28;
  --font-scale: 1.28;
  --control-scale: 1.28;
  --pos-panel-offset: 122px;
  --cart-height-offset: 348px;
  --cart-min-height: 690px;
}

body[data-screen-scale] {
  --panel-pad: calc(18px * var(--space-scale));
  --pos-gap: calc(18px * var(--space-scale));
  --topbar-gap: calc(12px * var(--space-scale));
  --topbar-control: calc(38px * var(--control-scale));
  --scan-control: calc(46px * var(--control-scale));
  --scan-side-button: calc(46px * var(--control-scale));
  --input-font: calc(19px * var(--font-scale));
  --row-pad-y: calc(13px * var(--space-scale));
  --row-pad-x: calc(14px * var(--space-scale));
  --cart-name-font: calc(17px * var(--font-scale));
  --quick-card-height: calc(72px * var(--control-scale));
  --pay-method-height: calc(54px * var(--control-scale));
  --complete-sale-height: calc(64px * var(--control-scale));
  --pos-sticky-top: calc(18px * var(--space-scale));
  --pos-panel-offset: calc((48px * var(--space-scale)) + var(--topbar-control) + var(--topbar-gap) + (8px * var(--space-scale)));
}

body[data-quick-columns="2"] {
  --quick-columns: 2;
}

body[data-quick-columns="3"] {
  --quick-columns: 3;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

#app {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

.sidebar {
  display: none;
}

#app.sidebar-collapsed {
  grid-template-columns: 1fr;
}

#app.sidebar-collapsed .sidebar {
  display: none;
}

#app.cashier-mode {
  grid-template-columns: 1fr;
}

#app.cashier-mode .sidebar {
  display: none;
}

#app.cashier-mode .main {
  width: 100%;
}

.sidebar {
  background: #17202a;
  color: #f7fafc;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  gap: 22px;
  min-height: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px;
  flex-shrink: 0;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: #f7fafc;
  color: #17202a;
  display: grid;
  place-items: center;
  font-weight: 900;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #aab6c3;
  font-size: 13px;
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  align-content: start;
  scrollbar-width: thin;
  scrollbar-color: rgba(210, 224, 240, 0.28) transparent;
}

.nav::-webkit-scrollbar {
  width: 5px;
}

.nav::-webkit-scrollbar-track {
  background: transparent;
}

.nav::-webkit-scrollbar-thumb {
  background: rgba(210, 224, 240, 0.24);
  border-radius: 999px;
}

.nav-group,
.nav-group-toggle {
  margin: 12px 8px 2px;
  color: #8090a4;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-group-toggle {
  width: calc(100% - 16px);
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 7px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease;
}

.nav-group-toggle:hover,
.nav-group-toggle.open {
  color: #d8e4f0;
  background: rgba(255, 255, 255, 0.06);
}

.nav-group-caret {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: 0.72;
  transform: rotate(45deg);
  transition: transform 0.18s ease, opacity 0.16s ease;
}

.nav-group-toggle.open .nav-group-caret {
  transform: rotate(225deg);
  opacity: 0.95;
}

.nav-item.nav-collapsed {
  display: none;
}

.nav-item {
  color: #dfe7ef;
  background: transparent;
  text-align: left;
  padding: 13px 14px;
  border-radius: 7px;
  transition: background 0.15s ease, color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nav-item:hover,
.nav-item.active {
  background: #253241;
  color: #ffffff;
}

.nav-badge {
  min-width: 24px;
  height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ffdf6e;
  color: #17202a;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.critical-nav.has-alert .nav-badge {
  animation: criticalPulse 1.2s ease-in-out infinite;
}

@keyframes criticalPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 223, 110, 0.52);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 223, 110, 0);
  }
}

.topbar-critical-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.topbar-critical-btn span {
  min-width: 20px;
  min-height: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(23, 32, 42, 0.1);
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 850;
}

.topbar-critical-btn.has-alert {
  background: #c93d36;
  border-color: #c93d36;
  color: #ffffff;
  animation: topbarCriticalPulse 1.25s ease-in-out infinite;
}

.topbar-critical-btn.has-alert span {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

@keyframes topbarCriticalPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(201, 61, 54, 0.28);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(201, 61, 54, 0);
  }
}

.sidebar-footer,
.sidebar-account {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 16px;
  color: #aab6c3;
  display: grid;
  gap: 4px;
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar-account {
  margin-top: 0;
  padding-top: 10px;
}

.sidebar-footer strong {
  color: #ffffff;
}

.sidebar-account button {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-account button:hover {
  background: rgba(20, 122, 99, 0.18);
  border-color: rgba(110, 221, 185, 0.38);
}

.sidebar-account span,
.sidebar-account small {
  color: #aab6c3;
  font-size: 12px;
}

.sidebar-account strong {
  color: #ffffff;
  font-size: 14px;
}

.main {
  padding: 22px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  position: relative;
  padding: 0;
  background: transparent;
}

.pos-top-actions {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 25fr) minmax(0, 50fr) minmax(260px, 25fr);
  gap: 18px;
  align-items: center;
  pointer-events: none;
  z-index: 1;
}

.pos-top-actions[hidden] {
  display: none !important;
}

.pos-top-action-cell {
  min-width: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.pos-top-action-cell-quick {
  justify-content: flex-end;
}

.pos-top-action-cell-sale {
  justify-content: flex-start;
}

.pos-floating-group,
.pos-floating-action {
  pointer-events: auto;
}

.pos-floating-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 4px 8px;
  border: 1px solid rgba(20, 122, 99, 0.16);
  border-radius: 999px 999px 999px 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 22px rgba(12, 24, 48, 0.08);
  backdrop-filter: blur(8px);
}

.pos-floating-action {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--primary-dark);
  box-shadow: none;
}

.pos-floating-action:hover {
  background: #f1fbf6;
  color: var(--primary);
}

.pos-floating-action:disabled {
  opacity: 0.45;
}

.pos-floating-action svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pos-floating-action-leaf {
  width: 40px;
  min-width: 40px;
  height: 34px;
  min-height: 34px;
  border: 1px solid rgba(20, 122, 99, 0.18);
  border-radius: 999px 999px 999px 11px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 22px rgba(12, 24, 48, 0.08);
  clip-path: polygon(0 0, 100% 0, 100% 72%, 82% 100%, 0 100%);
}

.pos-floating-separator {
  width: 1px;
  height: 22px;
  background: var(--line);
}

.topbar-title,
.quick-products-head {
  display: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  margin-left: auto;
}

.topbar form {
  display: none;
}

.sidebar-toggle,
.topbar-sale-btn,
.topbar-credit-btn,
.recent-sales-toggle,
.account-icon-btn {
  min-height: 38px;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 700;
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
}

.hamburger-icon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 18px;
  height: 18px;
}

.hamburger-icon span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.topbar-sale-btn,
.account-icon-btn {
  display: inline-flex;
  align-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  justify-content: center;
  font-size: 17px;
  line-height: 1;
}

.sale-currency-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  width: 24px;
  height: 24px;
}

.sale-home-icon {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reset-svg-icon {
  width: 22px;
  height: 22px;
  stroke-width: 2.35;
}

.topbar-svg-icon {
  display: block;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scale-svg-icon {
  width: 22px;
  height: 22px;
}

.account-svg-icon {
  width: 23px;
  height: 23px;
  stroke-width: 2.45;
}

.account-menu {
  position: relative;
  display: inline-flex;
}

.account-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 35;
  width: 210px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(12, 24, 48, 0.16);
}

.account-popover-head {
  display: grid;
  gap: 2px;
  padding: 6px 6px 10px;
}

.account-popover-head span,
.account-popover-head small {
  color: var(--muted);
  font-size: 12px;
}

.account-popover-head strong {
  color: var(--ink);
  font-size: 15px;
}

.account-menu .account-logout-form {
  display: block;
}

.account-logout-btn {
  width: 100%;
  min-height: 40px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.clock {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 11px;
  min-width: 0;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.clock span {
  display: inline;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.clock strong {
  display: inline;
  font-size: 14px;
  margin-top: 0;
  white-space: nowrap;
}

.user-chip {
  display: grid;
  gap: 2px;
  text-align: left;
  min-width: 132px;
  padding: 9px 12px;
}

.user-chip span,
.user-chip small {
  display: block;
}

.user-chip small {
  color: var(--muted);
  font-size: 12px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 25fr) minmax(0, 50fr) minmax(260px, 25fr);
  gap: 18px;
  align-items: start;
}

.recent-sales-toggle {
  min-height: 38px;
}

.recent-sales-menu {
  position: relative;
}

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

.recent-sales-dialog .dialog-content {
  max-height: min(520px, calc(100vh - 240px));
  overflow: auto;
}

.recent-sale-card,
.empty-inline {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 7px;
  padding: 10px 12px;
  min-height: 68px;
  text-align: left;
}

.recent-sale-card {
  display: grid;
  gap: 3px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.recent-sale-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(12, 24, 48, 0.08);
}

.recent-sale-card span,
.recent-sale-card small,
.empty-inline {
  color: var(--muted);
  font-size: 12px;
}

.recent-sale-card strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.checkout,
.payment-panel,
.quick-products-panel,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.checkout {
  min-height: calc(100vh - 108px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.quick-products-panel {
  padding: 12px;
  position: sticky;
  top: 18px;
  height: calc(100vh - 108px);
  max-height: calc(100vh - 108px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
}

.quick-product-empty span,
.quick-product-card span {
  color: var(--muted);
  font-size: 12px;
}

.quick-product-grid {
  display: grid;
  grid-template-columns: repeat(var(--quick-columns, 3), minmax(0, 1fr));
  gap: 8px;
  align-content: start;
  min-height: 0;
  overflow: hidden;
}

.quick-product-card,
.quick-product-empty {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--quick-bg, #ffffff);
  padding: 4px;
  text-align: center;
}

.quick-product-card {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background-position: center;
  background-size: var(--quick-image-size, cover);
  background-repeat: no-repeat;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body[data-quick-shape="square"] #quickProductGrid .quick-product-card,
body[data-quick-shape="square"] #quickProductGrid .quick-product-empty {
  aspect-ratio: 1 / 1;
  min-height: 0;
}

.quick-product-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(12, 24, 48, 0.08);
}

.quick-product-card strong {
  color: var(--quick-text, var(--ink));
  font-size: clamp(14px, 0.92vw, 17px);
  font-weight: 650;
  line-height: 1.12;
  overflow-wrap: anywhere;
  hyphens: auto;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.quick-product-card.has-image strong {
  max-width: calc(100% - 8px);
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
}

.quick-product-card.hide-text {
  padding: 0;
}

.quick-product-add {
  flex-direction: column;
  gap: 4px;
  border-style: dashed;
  color: var(--primary-dark);
  background: #f4fbf7;
}

.quick-product-add strong {
  color: var(--primary-dark);
  font-size: 26px;
  line-height: 1;
}

.quick-product-results {
  display: grid;
  gap: 8px;
}

.quick-product-result {
  width: 100%;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
}

.quick-product-result:hover {
  border-color: var(--primary);
  background: #f4fbf7;
}

.quick-product-result span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.quick-product-result small {
  color: var(--muted);
  font-size: 12px;
}

.quick-product-result em {
  color: var(--primary-dark);
  font-style: normal;
  font-weight: 700;
}

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

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

.mini-actions button {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
}

.quick-product-empty {
  display: grid;
  gap: 4px;
  align-content: center;
  background: #f8fafc;
  grid-column: 1 / -1;
  min-height: 120px;
}

.quick-products-groups {
  display: flex;
  gap: 5px;
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.quick-products-groups[hidden] {
  display: none;
}

.quick-products-groups button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 30px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-products-groups button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.quick-products-footer {
  display: grid;
  align-items: center;
  min-height: calc(var(--scan-control) + (10px * var(--space-scale)) + 1px);
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.quick-product-pages {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 7px;
  min-width: 0;
  align-items: center;
}

.quick-page-row {
  display: flex;
  gap: 5px;
  min-width: 0;
}

.quick-product-pages button {
  min-width: 0;
  min-height: 30px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-product-pages button:disabled {
  opacity: 0.38;
}

.quick-page-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.quick-manage-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 12px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quick-manage-icon {
  display: block;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-editor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
  max-height: min(70vh, 680px);
  overflow: auto;
}

.quick-editor-modes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.quick-layout-setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
  gap: 10px;
  align-items: center;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
}

.quick-layout-setting span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
}

.quick-column-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.quick-column-choice button,
.quick-shape-choice button {
  min-height: 38px;
  padding: 8px;
  color: #263445;
  font-size: 13px;
  font-weight: 750;
}

.quick-shape-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.quick-column-choice button + button,
.quick-shape-choice button + button {
  border-left: 1px solid var(--line);
}

.quick-column-choice button.active,
.quick-shape-choice button.active {
  color: var(--primary-dark);
  background: var(--soft-green);
}

.quick-editor-modes.is-menu {
  position: static;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-height: 260px;
  align-content: center;
  padding: 16px 0;
  border-bottom: 0;
}

.quick-editor-modes button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 700;
}

.quick-editor-modes.is-menu button {
  min-height: 92px;
  font-size: 18px;
  background: #f8fafc;
  color: var(--ink);
}

.quick-editor-modes button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.quick-editor-modes.is-menu button.active {
  background: #f8fafc;
  border-color: var(--line);
  color: var(--ink);
}

.quick-editor-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.section-title {
  display: grid;
  gap: 3px;
}

.section-title strong {
  color: var(--ink);
  font-size: 15px;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
}

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

.quick-dialog-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.quick-back-btn {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}

.quick-sort-input {
  display: grid;
  grid-template-columns: auto 74px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.quick-sort-input input {
  min-height: 34px;
  padding: 7px 8px;
  text-align: center;
}

.quick-design-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
}

.quick-design-preview {
  min-height: 54px;
}

.quick-design-preview strong {
  font-size: 13px;
  -webkit-line-clamp: 2;
}

.quick-design-dialog {
  width: min(560px, calc(100vw - 28px));
}

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

.quick-design-large-preview {
  min-height: 122px;
  cursor: default;
}

.quick-design-large-preview strong {
  font-size: 24px;
  -webkit-line-clamp: 3;
}

.quick-design-colors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-design-colors label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.quick-design-colors input[type="color"] {
  width: 100%;
  min-height: 42px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

#quickGroupList .quick-product-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

#quickGroupList .mini-actions {
  flex-wrap: nowrap;
}

#quickGroupList .mini-actions button {
  min-height: 44px;
  padding: 8px 12px;
  font-size: 13px;
}

.scan-panel {
  padding: 18px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

label {
  display: grid;
  gap: 7px;
  color: #2d3743;
  font-weight: 700;
  font-size: 14px;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink);
  border-radius: 7px;
  padding: 12px 13px;
  outline: none;
  min-height: 44px;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 122, 99, 0.13);
}

.scan-row {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) var(--scan-side-button) calc(var(--scan-side-button) * 1.28);
  gap: 8px;
  align-items: center;
  margin-top: 0;
}

.scan-panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.cart-scroll-controls {
  display: grid;
  grid-template-columns: repeat(2, 48px);
  gap: 7px;
  width: 103px;
  height: 58px;
}

.cart-nav-btn,
.pending-scan-qty-btn,
.custom-sale-shortcut-btn {
  width: var(--scan-side-button);
  min-width: var(--scan-side-button);
  height: var(--scan-control);
  min-height: var(--scan-control);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: #10203a;
  box-shadow: 0 6px 14px rgba(12, 24, 48, 0.04);
  box-sizing: border-box;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
  vertical-align: middle;
}

.scan-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0;
}

.cart-nav-caret {
  display: block;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  border-right: 2.8px solid currentColor;
  border-bottom: 2.8px solid currentColor;
  opacity: 0.9;
  transform-origin: center;
}

.cart-nav-caret-up {
  transform: translateY(4px) rotate(225deg);
}

.cart-nav-caret-down {
  transform: translateY(-4px) rotate(45deg);
}

.scan-reset-btn {
  width: 58px;
  height: 58px;
  font-size: 48px;
  font-weight: 900;
  line-height: 0;
}

.scan-reset-btn span {
  display: block;
  transform: translateY(-1px);
}

.pending-scan-qty-btn {
  width: calc(var(--scan-side-button) * 1.28);
  min-width: calc(var(--scan-side-button) * 1.28);
  font-size: 18px;
  font-weight: 900;
}

.custom-sale-shortcut-btn {
  color: var(--primary-dark);
}

.custom-sale-shortcut-btn svg {
  width: calc(22px * var(--ui-scale));
  height: calc(22px * var(--ui-scale));
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.custom-sale-shortcut-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pending-scan-qty-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(20, 122, 99, 0.22);
}

#barcodeInput {
  font-size: var(--input-font);
  font-weight: 800;
  min-height: var(--scan-control);
  height: var(--scan-control);
  padding-top: 0;
  padding-bottom: 0;
}

.primary,
.secondary,
.danger,
.ghost {
  border-radius: 7px;
  min-height: 42px;
  padding: 10px 14px;
  font-weight: 800;
  white-space: nowrap;
}

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

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

.secondary {
  background: #edf1f5;
  color: #243140;
  border: 1px solid #d5dee7;
}

.login-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
  white-space: normal;
}

.trial-banner {
  margin: 0 0 12px;
  padding: 12px 16px;
  border: 1px solid #b8e6cc;
  border-radius: 7px;
  color: #0f5132;
  background: #e9f7ef;
  font-weight: 800;
}

.trial-banner.warning {
  border-color: #f0d48a;
  color: #7a4f05;
  background: #fff7db;
}

.danger {
  background: var(--soft-red);
  color: #9d2f20;
}

.ghost {
  background: transparent;
  color: var(--primary);
}

.huge {
  width: 100%;
  min-height: 62px;
  font-size: 20px;
}

.cart-table-wrap {
  min-height: 520px;
  position: relative;
}

.cart-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
}

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

.cart-table th,
.data-table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  background: #fbfcfd;
}

.cart-name {
  display: grid;
  gap: 3px;
}

.cart-name strong {
  font-size: 17px;
}

.cart-name span,
.small-muted {
  color: var(--muted);
  font-size: 12px;
}

.qty-control {
  display: inline-grid;
  grid-template-columns: 36px 64px 36px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  overflow: hidden;
  align-items: center;
  background: white;
}

.qty-control button {
  height: 38px;
  background: #eef2f6;
  color: #1f2935;
  font-weight: 900;
}

.qty-control input {
  min-height: 38px;
  border: 0;
  border-left: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
  border-radius: 0;
  text-align: center;
  padding: 4px;
  font-weight: 800;
}

.empty {
  position: absolute;
  inset: 90px 20px auto;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

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

.payment-panel {
  padding: 18px;
  display: grid;
  gap: 14px;
  position: sticky;
  top: 18px;
}

.total-box {
  background: #17202a;
  color: white;
  border-radius: 8px;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  text-align: center;
  gap: 0;
}

.total-box.has-discount {
  grid-template-columns: 1fr;
}

.total-box-cell {
  min-width: 0;
}

.total-box span {
  color: #b9c5d0;
  display: block;
  margin-bottom: 6px;
}

.total-box strong {
  font-size: 36px;
  line-height: 1.1;
}

.total-box.has-discount strong {
  font-size: 36px;
  white-space: nowrap;
}

.pay-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.payment-adjustments {
  display: grid;
  gap: 10px;
}

.cash-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(104px, 0.9fr);
  gap: 8px;
  align-items: stretch;
}

.discount-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.payment-adjustments label,
.discount-mode-field,
.discount-input-field,
.discount-payable-field {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.discount-mode-field,
.discount-input-field,
.discount-payable-field {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.discount-mode-field > span,
.discount-input-field > span,
.discount-payable-field > span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.discount-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #d7e0e8;
  border-radius: 7px;
  min-height: 42px;
}

.discount-mode button {
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: #263445;
  font-weight: 650;
}

.discount-mode button + button {
  border-left: 1px solid #d7e0e8;
}

.discount-mode button.active {
  background: var(--soft-green);
  color: var(--primary-dark);
  box-shadow: inset 0 0 0 1px #198a61;
}

.discount-input-wrap {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.discount-mode-toggle {
  position: relative;
  align-self: stretch;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #ffffff;
  color: var(--primary-dark);
  min-width: 38px;
  padding: 0;
  overflow: hidden;
}

.discount-mode-toggle.percent-mode {
  background: #ffffff;
}

.discount-mode-pair {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: center;
  width: 100%;
  height: 100%;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  pointer-events: none;
}

.discount-mode-pair span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #637084;
  background: #ffffff;
}

.discount-mode-pair span:first-child {
  font-size: 15px;
}

.discount-mode-toggle:not(.percent-mode) .discount-mode-currency,
.discount-mode-toggle.percent-mode .discount-mode-percent {
  color: #ffffff;
  background: var(--primary);
}

.discount-input-wrap input,
.payment-adjustments input {
  min-height: 42px;
  padding: 9px 11px;
}

.cash-box label,
.change-field {
  gap: 3px;
  font-size: 12px;
}

.change-field {
  display: grid;
  color: var(--ink);
  font-weight: 700;
}

.cash-box input {
  min-height: 42px;
}

.discount-input-wrap input {
  border: 0;
  border-radius: 0;
  text-align: left;
}

.held-sale-btn {
  position: relative;
}

.held-sale-btn.has-held {
  border-color: #20a36a;
  color: var(--primary-dark);
  box-shadow: 0 0 0 1px rgba(0, 137, 83, 0.18);
}

.held-sale-btn #heldSaleCount {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 5px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
}

.pos-floating-action.held-sale-btn #heldSaleCount {
  position: absolute;
  right: -7px;
  top: -7px;
  min-width: 19px;
  height: 19px;
  margin-left: 0;
  padding: 0 5px;
  border: 2px solid #ffffff;
  font-size: 11px;
  box-shadow: 0 5px 12px rgba(20, 122, 99, 0.25);
}

.custom-sale-content {
  padding-top: 10px;
}

.custom-unit-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: min(250px, 100%);
  margin: 0 auto 10px;
  padding: 0;
}

.custom-unit-toggle button {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 850;
}

.custom-unit-toggle button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.held-sale-picker-list {
  display: grid;
  gap: 9px;
}

.held-sale-picker-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.held-sale-picker-item > button {
  min-height: 38px;
  padding: 8px 12px;
}

.held-sale-picker-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.held-sale-picker-main strong,
.held-sale-picker-main span,
.held-sale-picker-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.held-sale-picker-main strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.held-sale-picker-main span,
.held-sale-picker-main small {
  color: var(--muted);
  font-size: 12px;
}

.discount-payable {
  display: grid;
  align-content: center;
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid #d8eadf;
  border-radius: 8px;
  background: #f1fbf6;
}

.discount-payable strong {
  color: var(--primary-dark);
  font-size: 19px;
  line-height: 1.1;
  font-weight: 850;
}

.change-box {
  display: grid;
  align-content: center;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #d8eadf;
  border-radius: 8px;
  background: #f1fbf6;
}

.change-box strong {
  color: var(--primary-dark);
  font-size: 16px;
  line-height: 1.1;
  font-weight: 850;
}

.pay-method {
  border-radius: 7px;
  padding: 14px;
  background: #edf1f5;
  color: #273444;
  font-weight: 900;
  border: 1px solid #d5dee7;
}

.pay-method.active {
  background: var(--soft-green);
  border-color: #90c9b8;
  color: var(--primary-dark);
}

.credit-sale-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.credit-sale-box[hidden] {
  display: none;
}

.credit-selected-customer {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.credit-selected-customer strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credit-selected-debt {
  color: #2f3c4a;
  font-size: 15px;
  font-weight: 800;
}

.credit-clear-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-color: #f0b8b1;
  background: #fff1ef;
  color: #c7392a;
  font-weight: 700;
}

.credit-clear-btn:hover {
  border-color: #d95043;
  background: #ffe5e1;
}

.credit-picker-results {
  display: grid;
  gap: 8px;
}

.credit-picker-row {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
}

.credit-picker-row:hover {
  border-color: var(--primary);
  background: #f4fbf7;
}

.credit-quick-row {
  cursor: default;
}

.credit-quick-row button {
  min-height: 36px;
  padding: 7px 11px;
  font-weight: 600;
}

.credit-quick-row:hover {
  border-color: var(--line);
  background: #ffffff;
}

.credit-picker-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.credit-picker-row small {
  color: var(--muted);
}

.credit-picker-row em {
  color: var(--primary-dark);
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.credit-picker-new {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.credit-metrics {
  margin-bottom: 14px;
}

.credit-detail-title {
  margin: 4px 0 16px;
}

.credit-detail-title h2 {
  margin: 0;
  font-size: 26px;
}

.credit-detail-title p {
  margin: 5px 0 0;
  color: var(--muted);
}

.credit-lock-panel {
  max-width: 560px;
}

.credit-unlock-form {
  max-width: 420px;
}

.quick-stats,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.quick-stats div,
.metric {
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.quick-stats span,
.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.quick-stats strong,
.metric strong {
  display: block;
  font-size: 22px;
  margin-top: 4px;
}

.receipt {
  min-height: 150px;
  background: #faf7ef;
  border: 1px solid #e4d8bd;
  border-radius: 8px;
  padding: 14px;
  color: #4b3f2f;
  font-family: Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.toolbar h2 {
  margin: 0;
  font-size: 20px;
}

.toolbar-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.mobile-label-queue-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.mobile-label-queue-btn span {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.mobile-label-queue-btn.has-pending {
  border-color: rgba(11, 139, 97, 0.58);
  color: var(--primary-dark);
  background: #e8fff5;
  box-shadow: 0 0 0 0 rgba(11, 139, 97, 0.36);
  animation: queuePulse 1.35s ease-in-out infinite;
}

@keyframes queuePulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(11, 139, 97, 0.36);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(11, 139, 97, 0);
  }
}

.panel {
  padding: 18px;
}

.panel + .panel {
  margin-top: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.badge.good {
  background: var(--soft-green);
  color: var(--good);
}

.badge.warn {
  background: var(--soft-yellow);
  color: var(--warn);
}

.badge.danger {
  background: var(--soft-red);
  color: #9d2f20;
}

.search-results {
  position: absolute;
  z-index: 20;
  left: 18px;
  right: 138px;
  top: 92px;
  max-height: 300px;
  overflow: auto;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-result {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: white;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.search-result:hover {
  background: #f5faf8;
}

.dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  width: min(760px, 86vw);
  max-height: 88vh;
  overflow: hidden;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

.dialog.small {
  width: min(460px, 78vw);
}

.dialog::backdrop {
  background: rgba(23, 32, 42, 0.48);
}

.dialog form,
.dialog > div {
  max-height: inherit;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.dialog form > header,
.dialog form > footer,
.dialog > div > header,
.dialog > div > footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.dialog form > footer,
.dialog > div > footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: space-between;
}

.dialog form > footer:has(> button),
.dialog > div > footer:has(> button) {
  justify-content: center;
}

.dialog h2 {
  margin: 0;
}

.quantity-product-box {
  display: grid;
  align-items: center;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

#quantityForm > .quantity-top-row,
#quantityForm > .quantity-action-row {
  margin: 0 18px;
}

#quantityForm > .quantity-top-row {
  margin-top: 16px;
}

#quantityForm > .quantity-action-row {
  margin-top: 6px;
  margin-bottom: 16px;
}

.quantity-top-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.quantity-product-box strong {
  display: none;
}

.quantity-product-box span {
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

.quantity-input-box {
  position: relative;
  display: grid;
  min-height: 48px;
}

.quantity-input-box span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  clip: rect(0, 0, 0, 0);
}

.quantity-input-box input {
  min-height: 48px;
  padding-right: 62px;
  font-size: 21px;
  font-weight: 750;
}

.quantity-input-box input::placeholder {
  color: #8d98a7;
  font-weight: 600;
  opacity: 0.58;
}

.quantity-input-box strong {
  position: absolute;
  right: 8px;
  top: 50%;
  min-width: 46px;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  pointer-events: none;
}

.quantity-action-row {
  display: grid;
  grid-template-columns: minmax(0, 0.68fr);
  gap: 8px;
  align-items: stretch;
}

.quantity-action-row.has-scale {
  grid-template-columns: minmax(0, 1fr) minmax(118px, 0.34fr);
}

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

.quantity-quick-buttons button {
  min-height: 42px;
  font-weight: 600;
}

.quantity-scale-box {
  display: grid;
}

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

.quantity-scale-box button {
  min-height: 42px;
  font-weight: 650;
}

.cart-count-summary {
  display: grid;
  gap: 4px;
  margin: 16px 18px 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  text-align: center;
}

.cart-count-summary strong {
  font-size: 16px;
  line-height: 1.2;
}

.cart-count-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.cart-count-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0 18px 16px;
}

.cart-count-grid button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
}

.cart-count-grid button.active {
  border-color: var(--primary);
  background: var(--soft-green);
  color: var(--primary-dark);
}

#cartCountDialog[data-mode="pending"] .cart-count-summary {
  display: none;
}

#cartCountDialog[data-mode="pending"] .cart-count-grid {
  margin-top: 16px;
}

#cartCountDialog[data-mode="pending"] .cart-count-grid button {
  min-height: 54px;
}

.cart-count-footer {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) auto minmax(92px, 1fr);
  align-items: center;
  gap: 10px;
}

.cart-count-footer span {
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.dialog-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.status-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.status-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.status-switch span {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5df;
  border: 1px solid var(--line-strong);
  position: relative;
  box-shadow: inset 0 2px 4px rgba(23, 32, 42, 0.12);
}

.status-switch span::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(23, 32, 42, 0.22);
  transition: transform 0.15s ease;
}

.status-switch input:checked + span {
  background: var(--primary);
  border-color: var(--primary);
}

.status-switch input:checked + span::after {
  transform: translateX(18px);
}

.form-warning {
  margin: 0;
  color: #9d2f20;
  background: var(--soft-red);
  border: 1px solid #efb8b0;
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.45;
  font-size: 13px;
}

.dialog-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.price-conflict-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.price-conflict-item strong {
  color: var(--text);
}

.price-conflict-item span {
  color: var(--muted);
  font-size: 13px;
}

.price-conflict-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.price-conflict-values div {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.price-conflict-values b {
  color: var(--text);
  font-size: 16px;
}

.sale-dialog {
  width: min(920px, calc(100vw - 28px));
}

.dialog-content {
  padding: 18px;
  display: grid;
  gap: 14px;
  max-height: min(70vh, 720px);
  overflow: auto;
}

.sale-detail-scroll-actions,
.sale-detail-footer-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sale-detail-scroll-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sale-detail-scroll-btn .cart-nav-caret {
  width: 15px;
  height: 15px;
  border-width: 2.5px;
}

.sale-detail-scroll-btn:disabled {
  opacity: 0.38;
  cursor: default;
}

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

.detail-grid div {
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.detail-grid strong {
  display: block;
  font-size: 14px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: #eef2f6;
  font-size: 24px;
  line-height: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  overflow-y: auto;
  overflow-x: hidden;
}

.form-grid.one {
  grid-template-columns: 1fr;
}

.managed-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.managed-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 20px;
  color: var(--ink);
  font-weight: 800;
  font-size: 13px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.inline-check input {
  width: 15px;
  height: 15px;
  min-height: 15px;
  accent-color: var(--primary);
}

.inline-check:has(input:checked) {
  color: var(--primary-strong);
}

.field-disabled input {
  background: #eef2f6;
  color: var(--muted);
  border-color: #d5dee7;
  cursor: not-allowed;
  box-shadow: none;
}

.dialog-footer-note {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 6px;
}

.dialog-footer-note .dialog-note {
  font-size: 12px;
}

.dialog-footer-note .form-warning {
  padding: 8px 10px;
}

.dialog-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: end;
}

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

.muted {
  color: var(--muted);
  margin: 0;
  padding: 0 18px;
}

.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 40;
  background: #17202a;
  color: white;
  border-radius: 8px;
  padding: 13px 16px;
  box-shadow: var(--shadow);
  max-width: 420px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -18px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-leaving {
  opacity: 0;
  transform: translate(-50%, -18px);
}

.busy-overlay {
  align-items: center;
  background: transparent;
  border: 0;
  bottom: 0;
  color: inherit;
  height: 100%;
  justify-content: center;
  left: 0;
  margin: 0;
  max-height: none;
  max-width: none;
  padding: 0;
  position: fixed;
  right: 0;
  top: 0;
  width: 100%;
}

.busy-overlay[open] {
  display: flex;
}

.busy-overlay::backdrop {
  background: rgba(7, 24, 45, 0.36);
}

.busy-overlay > div {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  display: grid;
  gap: 8px;
  justify-items: center;
  min-width: 240px;
  padding: 22px 26px;
}

.busy-overlay strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.busy-overlay small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.busy-spinner {
  animation: busy-spin 0.8s linear infinite;
  border: 4px solid #dbe7f0;
  border-radius: 999px;
  border-top-color: var(--primary);
  height: 38px;
  width: 38px;
}

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

.row-actions button,
.data-table button,
.receipt-actions button,
.dialog footer .secondary,
.dialog footer .danger,
.list-footer button,
.pager button {
  font-weight: 600;
}

.list-intro-actions {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}

.list-intro-actions span {
  font-size: 13px;
  font-weight: 650;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.row-actions button {
  min-height: 34px;
  padding: 7px 10px;
}

.row-actions .secondary,
.row-actions .danger,
.row-actions .ghost,
.data-table .secondary,
.data-table .danger,
.data-table .ghost,
.receipt-actions .secondary,
.receipt-actions .danger,
.dialog footer .secondary,
.dialog footer .danger {
  font-weight: 600;
}

.list-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.compact-control {
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.compact-control select,
.list-controls input {
  min-height: 40px;
  padding: 9px 11px;
}

.list-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  padding-top: 12px;
}

.record-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.per-page-select {
  width: auto;
  min-width: 58px;
  min-height: 32px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 12px;
}

.pager {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pager button {
  min-height: 34px;
  padding: 7px 10px;
}

.inline-form,
.stock-entry {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto;
  gap: 8px;
  align-items: center;
}

.inline-form input,
.stock-entry select {
  min-height: 40px;
  padding: 9px 11px;
}

.bulk-panel {
  display: grid;
  gap: 14px;
}

.bulk-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  position: relative;
  z-index: 1;
}

.bulk-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bulk-form input,
.bulk-form select,
.bulk-form button {
  position: relative;
  z-index: 2;
}

.bulk-summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.bulk-preview {
  min-height: 72px;
}

.selection-bar {
  display: grid;
  gap: 12px;
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid #b9d9cf;
  border-radius: 8px;
  background: #f0faf6;
}

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

.embedded-bulk-form {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.selection-bar .bulk-preview:empty {
  display: none;
}

.settings-group {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 13px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.settings-group.nested {
  padding: 12px;
  background: #ffffff;
}

.settings-menu-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.settings-menu-grid[hidden] {
  display: none;
}

.settings-subhead {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.settings-back-btn {
  min-height: 38px;
  padding: 8px 14px;
}

.settings-subhead div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.settings-subhead strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.settings-subhead span {
  color: var(--muted);
  font-size: 12px;
}

.settings-menu-card {
  min-width: 0;
  min-height: 78px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 9px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: center;
  box-shadow: 0 10px 24px rgba(12, 24, 48, 0.05);
}

.settings-menu-card:hover,
.settings-menu-card.active {
  border-color: rgba(10, 135, 87, 0.32);
  background: #f4fbf7;
}

.settings-menu-card span {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--soft-green);
  color: var(--primary-dark);
  font-size: 19px;
  font-weight: 850;
}

.settings-menu-card strong {
  max-width: 100%;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.settings-menu-card small,
.settings-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.settings-empty {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fbfcfd;
}

#view-settings.active {
  display: flex;
  justify-content: center;
}

.settings-panel {
  width: min(1320px, 100%);
  margin: 0 auto;
}

.settings-panel .toolbar {
  margin-bottom: 0;
}

.settings-panel .settings-form {
  grid-template-columns: 1fr;
  width: 100%;
}

.settings-panel .settings-subhead,
.settings-panel .settings-group.wide,
.settings-panel .settings-empty,
.settings-panel .settings-save-row {
  width: min(1160px, 100%);
  margin-right: auto;
  margin-left: auto;
}

.settings-panel .settings-menu-grid {
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-save-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.settings-save-btn {
  width: min(360px, 100%);
  min-width: 240px;
  min-height: 48px;
}

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

.design-color-picker {
  max-width: 520px;
  position: relative;
}

.color-picker-trigger {
  width: 100%;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(12, 24, 48, 0.04);
}

.color-picker-trigger:hover,
.color-picker-trigger:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 122, 99, 0.13);
}

.color-picker-swatch {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--swatch-color);
  width: 46px;
  height: 46px;
}

.color-picker-trigger strong {
  min-width: 0;
  font-size: 16px;
  font-weight: 800;
}

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

.settings-inline {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
}

.scale-diagnostic-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.scale-diagnostic-result {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.scale-diagnostic-result[hidden] {
  display: none;
}

.scale-diagnostic-result.good {
  border-color: rgba(11, 139, 97, 0.38);
  background: #f0faf6;
}

.scale-diagnostic-result.warn {
  border-color: rgba(190, 128, 24, 0.34);
  background: #fffaf0;
}

.scale-diagnostic-result span,
.scale-diagnostic-result small {
  color: var(--muted);
  line-height: 1.4;
}

.scale-diagnostic-result pre {
  max-height: 160px;
  overflow: auto;
  margin: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f9fb;
  color: var(--ink);
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.35;
}

.backup-status-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.system-info-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.backup-status-card > div,
.system-info-card > div,
.backup-file-list > div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.backup-status-card span,
.system-info-card span,
.backup-file-list small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.backup-status-card strong,
.system-info-card strong,
.backup-file-list span {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-status-card .backup-path {
  grid-column: span 2;
}

.system-info-card .system-path {
  grid-column: span 2;
}

.system-info-card .system-ok strong {
  color: var(--primary);
}

.system-info-card .system-error strong,
.danger-text {
  color: var(--danger);
}

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

.backup-show-all-btn {
  width: fit-content;
}

.backup-list-dialog {
  max-width: 680px;
}

.backup-list-summary {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 12px;
}

.backup-file-list-full {
  max-height: min(58vh, 520px);
  overflow: auto;
  padding-right: 4px;
}

.bulk-unit-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(68px, 96px));
  gap: 8px;
  align-items: end;
}

.bulk-unit-fields input {
  width: 100%;
  min-width: 0;
}

.critical-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fb;
}

.reports-panel {
  display: grid;
  gap: 14px;
}

.report-toolbar {
  align-items: end;
  gap: 12px;
}

.report-presets {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.report-presets .active-soft {
  background: var(--soft-green);
  border-color: #90c9b8;
  color: var(--primary-dark);
}

.report-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 180px)) auto auto;
  gap: 10px;
  align-items: end;
  margin-left: auto;
}

.report-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.report-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.report-column {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.report-column .panel + .panel {
  margin-top: 0;
}

.report-period {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.report-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  height: 338px;
  min-height: 338px;
  margin-top: 0;
}

.report-card .toolbar {
  min-height: 34px;
  align-items: center;
  margin-bottom: 0;
}

.report-card h2 {
  font-size: 17px;
}

.report-card .table-scroll {
  max-height: 224px;
  overflow: auto;
}

.report-card .empty-static {
  min-height: 224px;
}

.report-table-note {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.report-stock-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-self: start;
}

.report-stock-grid div {
  min-height: 96px;
}

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

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 10px;
}

.section-heading h3 {
  margin: 0;
  font-size: 16px;
}

.critical-config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 12px;
  margin-bottom: 12px;
}

.critical-settings-card,
.critical-special-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.critical-default-fields,
.critical-special-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.critical-default-fields label,
.critical-special-form label {
  font-weight: 800;
}

.critical-default-fields input,
.critical-special-form input,
.critical-special-form select,
.critical-special-row input {
  min-height: 38px;
}

.unit-summary.compact .unit-metric {
  min-height: 60px;
  padding: 10px 12px;
}

.critical-special-card {
  margin-bottom: 14px;
}

.critical-special-form {
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 170px) auto;
  margin-bottom: 10px;
}

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

.critical-special-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, 120px) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fb;
}

.critical-special-row span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.unit-metric {
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fb;
  color: var(--ink);
  text-align: left;
  box-shadow: inset 0 -2px 0 rgba(20, 122, 99, 0.08);
}

.unit-metric:hover,
.unit-metric.active {
  border-color: var(--primary);
  background: var(--soft-green);
}

.unit-metric:disabled {
  cursor: default;
  opacity: 1;
}

.unit-metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.unit-metric strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.critical-level-control {
  display: grid;
  grid-template-columns: minmax(78px, 110px) auto auto;
  gap: 6px;
  align-items: center;
}

.critical-level-control input {
  min-height: 34px;
  padding: 7px 8px;
}

.critical-stock-table {
  table-layout: fixed;
}

.critical-stock-table th:first-child,
.critical-stock-table td:first-child {
  width: auto;
}

.critical-stock-table th:nth-child(2),
.critical-stock-table td:nth-child(2) {
  width: 150px;
}

.critical-stock-table th:nth-child(3),
.critical-stock-table td:nth-child(3),
.critical-stock-table th:nth-child(4),
.critical-stock-table td:nth-child(4) {
  width: 118px;
  text-align: right;
  white-space: nowrap;
}

.critical-stock-table th:nth-child(5),
.critical-stock-table td:nth-child(5) {
  width: 116px;
  text-align: right;
  white-space: nowrap;
}

.critical-stock-table th:nth-child(6),
.critical-stock-table td:nth-child(6) {
  width: 124px;
  text-align: right;
  white-space: nowrap;
}

.critical-stock-table .critical-level-control {
  display: flex;
  justify-content: flex-end;
}

.critical-stock-table .critical-level-control .ghost {
  min-height: 36px;
  padding: 8px 12px;
  white-space: nowrap;
}

.compact-toolbar {
  margin: 4px 0 10px;
}

.compact-toolbar h2 {
  font-size: 16px;
}

.preview-limit {
  padding: 10px 2px 0;
}

.detail-controls {
  grid-template-columns: minmax(220px, 1fr) minmax(110px, 150px);
  margin-bottom: 0;
}

.data-table input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
}

.table-header-tools {
  display: flex;
  justify-content: flex-end;
}

.header-sort {
  width: auto;
  min-width: 96px;
  min-height: 32px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

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

.switch-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.settings-switch-card {
  cursor: pointer;
}

.settings-switch-card:has(input:checked) {
  border-color: rgba(10, 135, 87, 0.34);
  background: #f0fbf5;
}

.switch-line input {
  width: 22px;
  min-height: 22px;
  cursor: pointer;
}

.print-slip {
  width: 280px;
  background: #fffaf0;
  border: 1px solid #e6d7b8;
  border-radius: 8px;
  padding: 14px;
  font-family: Consolas, monospace;
  white-space: pre-wrap;
}

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

.print-area {
  display: none;
}

.print-center-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (min-width: 1280px) {
  .print-center-grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  }
}

.print-controls {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 90px auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.mobile-label-queue {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.mobile-label-queue-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.mobile-label-queue-head h3 {
  margin: 0;
  font-size: 17px;
}

.mobile-label-queue-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.mobile-label-job-list {
  display: grid;
  gap: 10px;
}

.mobile-label-job-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.mobile-label-job-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.mobile-label-job-main .badge {
  justify-self: start;
}

.mobile-label-job-main strong,
.mobile-label-job-main span,
.mobile-label-job-main small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-label-job-main span,
.mobile-label-job-main small {
  color: var(--muted);
}

.mobile-label-job-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.mobile-label-queue-dialog-body {
  min-height: 220px;
}

.mobile-label-queue-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f7fa;
}

.mobile-label-queue-tabs button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 6px;
  padding: 7px 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.mobile-label-queue-tabs button.active {
  color: var(--primary-dark);
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(12, 24, 48, 0.08);
}

.mobile-label-queue-tabs span {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--primary);
  font-size: 12px;
}

.mobile-label-queue-dialog-body .mobile-label-job-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  background: #ffffff;
}

.mobile-label-queue-dialog-body .mobile-label-job-actions {
  align-items: center;
}

.mobile-label-group-card {
  align-items: start;
}

.mobile-label-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mobile-label-group-items {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.mobile-label-group-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  gap: 10px;
  align-items: center;
}

.mobile-label-group-item span,
.mobile-label-group-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-label-group-item small {
  text-align: right;
}

.label-preview-wrap {
  overflow: auto;
  padding: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #f8fafc;
}

.print-settings-dialog-body {
  max-height: min(68vh, 620px);
  overflow: auto;
}

.print-preview-dialog > div {
  width: min(760px, calc(100vw - 28px));
}

.print-preview-body {
  display: grid;
  justify-items: center;
  overflow: auto;
  background: #f8fafc;
}

.modal-label-preview {
  width: 100%;
  max-width: 100%;
  background: #edf2f7;
}

.shelf-label {
  width: var(--label-width, 80mm);
  height: var(--label-height, 40mm);
  display: grid;
  grid-auto-rows: min-content;
  align-content: stretch;
  gap: var(--label-gap, 1.2mm);
  overflow: hidden;
  box-sizing: border-box;
  margin: 0;
  transform: translate(var(--label-offset-x, 0), var(--label-offset-y, 0));
  border: 0;
  outline: var(--label-border-width, 1px) solid #111827;
  outline-offset: -1px;
  background: white;
  color: #0f172a;
  padding: var(--label-padding, 3mm);
  font-family: Arial, sans-serif;
  font-size: var(--label-font, 12px);
  line-height: 1.15;
  contain: layout paint;
}

.shelf-label.preview {
  width: min(var(--label-width, 80mm), 100%);
  min-height: 120px;
  height: auto;
}

.label-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--label-name-lines, 2);
  font-size: var(--label-name-font, 13px);
  font-weight: var(--label-name-weight, 700);
  overflow: hidden;
  word-break: break-word;
}

.label-price {
  font-size: var(--label-price-font, 32px);
  font-weight: var(--label-price-weight, 800);
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.label-unit,
.label-meta,
.label-barcode,
.label-price-small {
  color: #334155;
  font-size: var(--label-meta-font, 10px);
  font-weight: var(--label-meta-weight, 600);
}

.label-unit {
  text-align: right;
  font-weight: 700;
}

.label-barcode {
  font-family: Consolas, monospace;
  font-size: var(--label-barcode-text-font, 10px);
  margin-top: var(--label-barcode-gap, 1.5mm);
  letter-spacing: 0;
  color: #0f172a;
}

.barcode-label {
  grid-template-rows: auto var(--label-barcode-height, 16mm) auto auto;
  text-align: center;
}

.barcode-title {
  grid-row: 1;
}

.label-barcode-graphic {
  grid-row: 2;
  height: var(--label-barcode-height, 16mm);
  min-height: 0;
}

.barcode-label .label-barcode {
  grid-row: 3;
}

.label-price-small {
  grid-row: 4;
}

.shelf-right-barcode-label {
  display: grid;
  grid-template-rows: 14mm minmax(0, 1fr) 5.8mm;
  align-content: stretch;
  gap: 0;
  padding: 0;
  outline: 0;
  border: var(--label-border-width, 1.4px) solid #000;
  box-shadow: none;
  border-radius: 2.6mm;
  font-family: Arial, Helvetica, sans-serif;
  color: #000;
}

.shelf-right-barcode-label.preview {
  width: min(var(--label-width, 95mm), 100%);
  min-height: 132px;
}

.shelf-reference-title {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0.8mm 2.6mm;
  border-bottom: var(--label-border-width, 1px) solid #000;
  font-weight: var(--label-name-weight, 800);
  text-align: center;
}

.shelf-reference-title span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  line-height: 1.04;
  word-break: break-word;
}

.shelf-reference-title-large span {
  -webkit-line-clamp: 1;
  font-size: clamp(17px, calc(var(--label-name-font, 13px) * 1.65), 24px);
  line-height: 1;
  white-space: nowrap;
}

.shelf-reference-title-balanced span {
  -webkit-line-clamp: 2;
  font-size: clamp(15px, calc(var(--label-name-font, 13px) * 1.28), 20px);
}

.shelf-reference-title-compact span {
  -webkit-line-clamp: 2;
  font-size: clamp(13px, calc(var(--label-name-font, 13px) * 1.02), 18px);
}

.shelf-reference-body {
  display: grid;
  grid-template-columns: minmax(0, 50%) minmax(0, 50%);
  height: 100%;
  min-height: 0;
  border-bottom: var(--label-border-width, 1px) solid #000;
  overflow: hidden;
}

.shelf-reference-barcode-block {
  display: grid;
  grid-template-rows: minmax(0, calc(var(--label-barcode-height, 14mm) - 0.8mm)) auto;
  align-content: center;
  min-width: 0;
  min-height: 0;
  padding: 0.7mm 1.4mm 0.5mm;
  border-right: var(--label-border-width, 1px) solid #000;
  overflow: hidden;
}

.shelf-reference-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--label-name-lines, 2);
  overflow: hidden;
  font-size: clamp(13px, calc(var(--label-name-font, 13px) * 1.05), 20px);
  font-weight: var(--label-name-weight, 700);
  line-height: 1.02;
  word-break: break-word;
}

.shelf-reference-meta {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-top: 1.2mm;
  font-size: clamp(11px, calc(var(--label-meta-font, 9px) * 1.22), 16px);
  font-weight: 700;
}

.shelf-reference-spacer {
  min-height: 0;
}

.shelf-reference-barcode-graphic {
  width: 100%;
  height: calc(var(--label-barcode-height, 14mm) - 0.8mm);
  overflow: hidden;
}

.shelf-reference-barcode-graphic .barcode-svg,
.shelf-reference-barcode-graphic .barcode-lines,
.shelf-reference-barcode-graphic .barcode-invalid {
  width: 100%;
  height: 100%;
}

.shelf-reference-barcode-text {
  overflow: hidden;
  margin-top: var(--label-barcode-gap, 0.4mm);
  font-family: Consolas, monospace;
  font-size: clamp(10px, calc(var(--label-barcode-text-font, 9px) * 1.2), 14px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 1.6px;
  white-space: nowrap;
}

.shelf-reference-price-block {
  display: grid;
  align-items: center;
  justify-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0.7mm 3mm;
  overflow: hidden;
}

.shelf-reference-price {
  display: flex;
  align-items: flex-end;
  align-self: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  color: #000;
  font-weight: var(--label-price-weight, 900);
  line-height: 0.8;
  white-space: nowrap;
}

.shelf-reference-price-whole {
  font-size: clamp(42px, calc(var(--label-price-font, 28px) * 1.55), 58px);
  letter-spacing: 0;
}

.shelf-reference-price-cents {
  margin-left: 0.4mm;
  font-size: clamp(30px, calc(var(--label-price-font, 28px) * 1.12), 42px);
  letter-spacing: 0;
}

.shelf-reference-price-currency {
  margin-left: 1mm;
  padding-bottom: 0.7mm;
  font-size: clamp(26px, calc(var(--label-price-font, 28px) * 0.95), 34px);
  line-height: 0.8;
}

.shelf-reference-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr) minmax(0, 1.18fr);
  align-items: center;
  gap: 0;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  font-size: clamp(8px, calc(var(--label-meta-font, 8px) * 0.95), 10px);
  font-weight: 700;
  line-height: 1;
}

.shelf-reference-footer span {
  min-width: 0;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0 1.4mm;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-reference-footer span + span {
  border-left: var(--label-border-width, 1px) solid #000;
}

.barcode-lines {
  width: 100%;
  height: var(--label-barcode-height, 16mm);
  background: repeating-linear-gradient(
    90deg,
    #0f172a 0 1px,
    transparent 1px 3px,
    #0f172a 3px 5px,
    transparent 5px 8px
  );
}

.barcode-svg {
  width: 100%;
  height: var(--label-barcode-height, 16mm);
  display: block;
  fill: #0f172a;
  shape-rendering: crispEdges;
}

.ean-barcode-svg text {
  fill: #0f172a;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
}

.barcode-invalid {
  width: 100%;
  height: var(--label-barcode-height, 16mm);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(15, 23, 42, 0.42);
  color: #334155;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.label-sheet {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0;
}

.slim-action {
  min-height: 34px;
  padding: 7px 10px;
}

.settings-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.compact-check {
  min-height: 40px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff;
}

.advanced-settings {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.advanced-settings summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
}

.advanced-settings .settings-inline {
  margin-top: 10px;
}

.settings-test-print {
  margin-top: 12px;
}

@media (max-width: 980px) {
  .print-center-grid {
    grid-template-columns: 1fr;
  }

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

.download-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.form-error {
  color: #9d2f20;
  background: var(--soft-red);
  border: 1px solid #efb8b0;
  border-radius: 7px;
  padding: 10px 12px;
}

.login-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 8%, rgba(30, 80, 115, 0.36), transparent 34%),
    linear-gradient(145deg, #0f1d29 0%, #172433 55%, #0d1620 100%);
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vh, 24px) 4vw;
  overflow: hidden;
}

.login-shell {
  width: min(780px, 82vw);
}

.login-card {
  background: white;
  border-radius: 16px;
  overflow: visible;
  padding: clamp(20px, 2.5vw, 28px);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.25);
}

.login-card:has(#loginForm:not([hidden])) {
  width: min(440px, 76vw);
  margin: 0 auto;
}

.login-brand {
  color: var(--ink);
  padding: 0 0 clamp(16px, 2.8vh, 26px);
  align-items: center;
  gap: clamp(12px, 2vw, 20px);
}

.login-brand .brand-mark {
  background: #ffffff;
  color: white;
  width: clamp(54px, 7vw, 72px);
  height: clamp(54px, 7vw, 72px);
  border-radius: 15px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.login-brand strong {
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.1;
}

.login-brand span {
  color: var(--muted);
  font-size: clamp(15px, 1.8vw, 18px);
  margin-top: 6px;
}

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

.login-check {
  justify-content: flex-start;
  align-self: auto;
}

.login-hint {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.login-window-controls {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 6;
  display: flex;
  gap: 8px;
}

.login-window-controls button {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #dbe6f2;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  cursor: pointer;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
}

.login-window-controls button span {
  display: block;
  width: 1em;
  line-height: 1;
  text-align: center;
}

#loginWindowMinimizeBtn span {
  transform: translateY(-4px);
}

#loginWindowCloseBtn span {
  transform: translateY(-1px);
}

.login-window-controls button:hover {
  background: rgba(255, 255, 255, 0.15);
}

.login-window-controls button.danger:hover {
  color: #ffffff;
  background: #d83b32;
  border-color: #d83b32;
}

.login-window-controls button.danger {
  color: #ffd7d7;
  border-color: rgba(216, 59, 50, 0.42);
}

.login-license-actions {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 5;
  display: flex;
  gap: 8px;
  align-items: center;
}

.login-license-badge,
.login-license-now {
  appearance: none;
  border-radius: 7px;
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
}

.login-license-badge {
  color: #0f5132;
  background: #e9f7ef;
  border: 1px solid #b8e6cc;
}

.login-license-now {
  color: #ffffff;
  background: #008953;
  border: 1px solid #008953;
  cursor: pointer;
}

.login-license-now:hover {
  filter: brightness(0.98);
}

.login-license-badge.warning {
  color: #7a4a00;
  background: #fff7e6;
  border-color: #ffd98a;
}

.login-license-badge.trial {
  color: #12436a;
  background: #eaf4ff;
  border-color: #badcff;
}

.license-panel {
  display: grid;
  gap: 14px;
}

.license-activation-layout {
  gap: clamp(12px, 2vh, 18px);
}

.license-panel.compact {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.license-message {
  display: grid;
  gap: 4px;
  color: #123047;
  background: #eef7f3;
  border: 1px solid #bfe4d2;
  border-radius: 8px;
  padding: 12px;
}

.license-message strong {
  font-size: 16px;
}

.license-message span {
  color: #426072;
  font-size: 13px;
  line-height: 1.45;
}

.license-copy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.license-action-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.license-action-row.split {
  justify-content: space-between;
}

.license-action-row.equal {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.license-panel textarea {
  width: 100%;
  resize: vertical;
  min-height: 84px;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.4;
}

.license-panel textarea[readonly] {
  color: #405367;
  background: #f6f8fb;
}

.license-form {
  padding-top: 4px;
}

.license-form label {
  color: var(--ink);
  font-size: clamp(15px, 1.7vw, 18px);
  font-weight: 800;
}

.license-form textarea {
  margin-top: 10px;
  min-height: clamp(54px, 9vh, 76px);
  font-size: clamp(14px, 1.5vw, 16px);
  font-family: inherit;
  resize: vertical;
}

.license-result {
  color: #0f5132;
  background: #e9f7ef;
  border: 1px solid #b8e6cc;
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.license-result.danger {
  color: #9d2f20;
  background: var(--soft-red);
  border-color: #efb8b0;
}

.license-choice-grid {
  display: grid;
  gap: 10px;
}

.license-choice,
.license-request-note {
  display: grid;
  width: 100%;
  text-align: left;
  gap: 12px;
  color: #123047;
  background: #ffffff;
  border: 1px solid #cfe3f8;
  border-radius: 8px;
  padding: 12px;
}

.license-choice {
  cursor: pointer;
}

.license-choice:hover {
  border-color: #8ec5f5;
  background: #f7fbff;
}

.license-choice.primary-choice {
  color: #ffffff;
  background: #008953;
  border-color: #008953;
}

.license-choice.expired {
  cursor: default;
}

.license-choice strong,
.license-choice span,
.license-request-note strong,
.license-request-note span {
  display: block;
}

.license-choice span,
.license-request-note span {
  color: #526779;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 3px;
}

.license-choice.primary-choice span {
  color: rgba(255, 255, 255, 0.82);
}

.license-choice.expired {
  color: #7a4a00;
  background: #fff7e6;
  border-color: #ffd98a;
}

.license-request-note {
  grid-template-columns: 1fr auto;
  align-items: center;
  background: #f7f9fb;
  border-color: var(--line);
}

.license-hero,
.license-request-card,
.license-trial-wide {
  display: grid;
  align-items: center;
  gap: clamp(12px, 2vw, 22px);
  border-radius: 12px;
  padding: clamp(14px, 2.5vw, 24px);
}

.license-hero {
  grid-template-columns: clamp(56px, 7vw, 86px) 1fr;
  color: #0f2f20;
  background: linear-gradient(100deg, #f0fbf5 0%, #ffffff 100%);
  border: 1px solid #a9dfc1;
}

.license-hero-icon {
  width: clamp(48px, 6vw, 64px);
  height: clamp(48px, 6vw, 64px);
  display: grid;
  place-items: center;
  color: #ffffff;
  background: #008953;
  border-radius: 999px;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 900;
  line-height: 1;
}

.license-hero strong,
.license-request-card strong,
.license-trial-wide strong {
  display: block;
  color: var(--ink);
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.2;
}

.license-hero span,
.license-request-card span,
.license-trial-wide span {
  display: block;
  color: #334155;
  font-size: clamp(14px, 1.8vw, 18px);
  line-height: 1.55;
  margin-top: 8px;
}

.license-request-card {
  grid-template-columns: clamp(50px, 6.5vw, 78px) minmax(0, 1fr) auto;
  background: #ffffff;
  border: 1px solid #c8d4e2;
}

.license-side-icon {
  width: clamp(42px, 5.4vw, 56px);
  height: clamp(42px, 5.4vw, 56px);
  display: grid;
  place-items: center;
  color: #008953;
  background: #edf9f3;
  border: 1px solid #cbeada;
  border-radius: 999px;
  font-size: clamp(20px, 2.8vw, 26px);
  font-weight: 900;
}

.license-request-card small {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-top: 8px;
}

.license-copy-btn {
  min-height: clamp(52px, 8vh, 74px);
  min-width: min(240px, 26vw);
  color: #008953;
  border-color: #008953;
  font-size: clamp(13px, 1.4vw, 16px);
  font-weight: 900;
}

.license-trial-wide {
  grid-template-columns: clamp(50px, 6.5vw, 78px) minmax(0, 1fr) minmax(190px, 30%);
  background: #fbfdff;
  border: 1px solid #9bc4ff;
}

.license-calendar-icon {
  width: clamp(44px, 5.8vw, 58px);
  height: clamp(44px, 5.8vw, 58px);
  display: grid;
  place-items: center;
  color: #1264d8;
  border: 4px solid #1264d8;
  border-radius: 8px;
  font-size: clamp(25px, 3.6vw, 34px);
  font-weight: 900;
}

.license-trial-btn {
  min-height: clamp(52px, 8vh, 72px);
  color: #ffffff;
  background: #1264d8;
  border: 1px solid #1264d8;
  border-radius: 8px;
  font-size: clamp(15px, 2vw, 20px);
  font-weight: 900;
  cursor: pointer;
}

.login-license-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  color: #0f172a;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: 16px;
}

.login-license-footer span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.login-license-footer img {
  width: 30px;
  height: 30px;
  border-radius: 6px;
}

[hidden] {
  display: none !important;
}

@media (max-height: 760px) {
  .login-body {
    padding: 12px 4vw;
  }

  .login-shell {
    width: min(740px, 82vw);
  }

  .login-card {
    padding: 18px 22px;
  }

  .login-brand {
    gap: 12px;
    padding-bottom: 12px;
  }

  .login-brand .brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 11px;
  }

  .login-brand strong {
    font-size: 23px;
  }

  .login-brand span {
    font-size: 14px;
    margin-top: 2px;
  }

  .license-activation-layout {
    gap: 10px;
  }

  .license-hero,
  .license-request-card,
  .license-trial-wide {
    gap: 12px;
    padding: 12px 14px;
  }

  .license-hero {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .license-request-card {
    grid-template-columns: 44px minmax(0, 1fr) 190px;
  }

  .license-trial-wide {
    grid-template-columns: 44px minmax(0, 1fr) 190px;
  }

  .license-hero-icon,
  .license-side-icon,
  .license-calendar-icon {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }

  .license-calendar-icon {
    border-width: 3px;
  }

  .license-hero strong,
  .license-request-card strong,
  .license-trial-wide strong {
    font-size: 17px;
  }

  .license-hero span,
  .license-request-card span,
  .license-trial-wide span {
    font-size: 13px;
    line-height: 1.35;
    margin-top: 3px;
  }

  .license-request-card small {
    display: none;
  }

  .license-copy-btn,
  .license-trial-btn {
    min-height: 42px;
    min-width: 0;
    font-size: 13px;
  }

  .license-form {
    gap: 8px;
    padding-top: 0;
  }

  .license-form label {
    font-size: 14px;
  }

  .license-form textarea {
    min-height: 42px;
    margin-top: 5px;
    font-size: 13px;
  }

  .license-action-row.equal {
    gap: 8px;
  }

  .license-action-row.equal button,
  .license-form > .primary.huge {
    min-height: 42px;
    font-size: 14px;
  }

  .license-result {
    padding: 7px 10px;
    font-size: 12px;
  }

  .login-license-footer {
    padding-top: 8px;
    font-size: 12px;
  }

  .login-license-footer img {
    width: 22px;
    height: 22px;
  }
}

@media (max-width: 720px) {
  .login-body {
    padding: clamp(12px, 3vh, 22px) 4vw;
  }

  .login-shell {
    width: 90vw;
  }

  .license-hero,
  .license-request-card,
  .license-trial-wide {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
  }

  .license-copy-btn,
  .license-trial-btn {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
    min-height: 50px;
  }

  .license-action-row.equal {
    gap: 10px;
  }

  .login-license-actions {
    max-width: calc(100vw - 118px);
    overflow: hidden;
  }

  .login-license-badge,
  .login-license-now {
    white-space: nowrap;
  }

  .login-license-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .login-shell,
  .login-card:has(#loginForm:not([hidden])) {
    width: 94vw;
  }

  .license-hero,
  .license-request-card,
  .license-trial-wide {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  #app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .nav {
    grid-template-columns: 1fr;
  }

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

  .payment-panel {
    position: static;
  }

  .list-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .critical-level-control {
    grid-template-columns: 1fr;
  }

  .credit-sale-box {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 861px) and (max-width: 1100px) {
  .main {
    padding: 12px;
  }

  .topbar {
    margin-bottom: 12px;
  }

  .pos-layout {
    grid-template-columns: minmax(180px, 25fr) minmax(340px, 50fr) minmax(230px, 25fr);
    gap: 12px;
  }

  .checkout,
  .quick-products-panel,
  .payment-panel {
    top: 12px;
    height: calc(100vh - 92px);
    max-height: calc(100vh - 92px);
  }

  .quick-products-panel,
  .payment-panel,
  .checkout,
  .scan-panel {
    padding: 12px;
  }
}

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

  .topbar,
  .toolbar,
  .report-toolbar {
    align-items: stretch;
    flex-direction: column;
    display: flex;
  }

  .report-filter {
    margin-left: 0;
  }

  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    grid-template-columns: 1fr;
  }

  .unit-summary,
  .bulk-unit-fields,
  .critical-settings,
  .report-filter,
  .report-metrics,
  .report-columns {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .settings-form,
  .settings-inline,
  .settings-menu-grid,
  .grid-2,
  .metric-grid,
  .list-controls,
  .detail-grid,
  .inline-form,
  .stock-entry,
  .bulk-form {
    grid-template-columns: 1fr;
  }

  .list-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .bulk-actions,
  .bulk-summary,
  .dialog form > footer,
  .dialog > div > footer,
  .dialog-footer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .cart-table th:nth-child(3),
  .cart-table td:nth-child(3) {
    display: none;
  }

  .search-results {
    left: 18px;
    right: 18px;
    top: 120px;
  }
}

@media print {
  @page {
    margin: 0;
  }

  body * {
    visibility: hidden !important;
  }

  #printArea,
  #printArea * {
    visibility: visible !important;
  }

  #printArea {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: white;
    color: black;
  }

  .print-receipt {
    width: var(--receipt-width, 80mm);
    margin: 0;
    padding: 0 var(--receipt-padding-x, 4mm);
    border: 0;
    color: black;
    background: white;
    font-family: Consolas, monospace;
    font-size: var(--receipt-font-size, 11px);
    line-height: 1.35;
    white-space: pre-wrap;
    box-sizing: border-box;
    display: block;
    overflow: visible;
  }

  .print-receipt::before,
  .print-receipt::after {
    content: "";
    display: block;
    width: 100%;
  }

  .print-receipt::before {
    height: var(--receipt-padding-top, 1mm);
  }

  .print-receipt::after {
    height: var(--receipt-padding-bottom, 3mm);
  }

  .label-sheet {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
  }

  .print-labels .label-sheet {
    display: block;
  }

  .shelf-label {
    break-inside: avoid;
    page-break-inside: avoid;
    border-color: #000;
    box-shadow: none;
  }

  .print-labels .shelf-label {
    margin: 0 !important;
    break-after: page;
    page-break-after: always;
  }

  .print-labels .shelf-label:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .print-report {
    width: 100%;
    padding: 12mm;
    color: #000;
    background: #fff;
    font-family: Arial, sans-serif;
    font-size: 11px;
  }

  .print-report section {
    margin-bottom: 10mm;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-report h1 {
    margin: 0 0 3mm;
    font-size: 18px;
  }

  .print-report p {
    margin: 0 0 4mm;
    color: #444;
  }

  .print-report table {
    width: 100%;
    border-collapse: collapse;
  }

  .print-report th,
  .print-report td {
    padding: 6px 7px;
    border: 1px solid #222;
    text-align: left;
    vertical-align: top;
  }

  .print-report th {
    background: #eee;
    font-weight: 700;
  }
}

/* Desktop app visual refresh */
:root {
  --bg: #eef2f6;
  --panel: #fbfcfd;
  --ink: #102033;
  --muted: #66758a;
  --line: #d9e2ec;
  --line-strong: #c8d3df;
  --primary: #0f7f5b;
  --primary-dark: #0b6347;
  --sidebar: #10263a;
  --sidebar-2: #17334d;
  --shadow: 0 14px 34px rgba(12, 24, 48, 0.065);
}

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

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

#app {
  height: 100vh;
  min-height: 0;
  grid-template-columns: 270px minmax(0, 1fr);
  overflow: hidden;
  background: var(--bg);
}

#app.cashier-mode {
  grid-template-columns: minmax(0, 1fr);
}

#app.sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

#app.sidebar-collapsed .sidebar {
  display: none;
}

#app.cashier-mode .sidebar {
  display: none;
}

#app.cashier-mode .main {
  width: 100%;
}

.sidebar {
  height: 100vh;
  min-height: 0;
  position: sticky;
  top: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 10%, rgba(14, 135, 87, 0.22), transparent 28%),
    linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 10px 0 30px rgba(7, 24, 45, 0.16);
  padding: 28px 12px 22px;
  gap: 24px;
}

.brand {
  padding: 6px;
  flex-shrink: 0;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #ffffff;
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.brand strong {
  font-size: inherit;
  line-height: 1.1;
}

.brand span {
  color: #c8d3e1;
  font-size: 13px;
}

.nav {
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  align-content: start;
  grid-template-columns: 1fr;
  scrollbar-width: thin;
  scrollbar-color: rgba(210, 224, 240, 0.26) transparent;
}

.nav::-webkit-scrollbar {
  width: 5px;
}

.nav::-webkit-scrollbar-track {
  background: transparent;
}

.nav::-webkit-scrollbar-thumb {
  background: rgba(210, 224, 240, 0.22);
  border-radius: 999px;
}

.nav-group,
.nav-group-toggle {
  margin: 12px 10px 0;
  color: #8fa2ba;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-group-toggle {
  width: calc(100% - 20px);
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 8px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  color: #8fa2ba;
  transition: background 0.16s ease, color 0.16s ease;
}

.nav-group-toggle:hover,
.nav-group-toggle.open {
  color: #edf5ff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-group-caret {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: 0.7;
  transform: rotate(45deg);
  transition: transform 0.18s ease, opacity 0.16s ease;
}

.nav-group-toggle.open .nav-group-caret {
  transform: rotate(225deg);
  opacity: 0.95;
}

.nav-item.nav-collapsed {
  display: none;
}

.nav-item {
  position: relative;
  min-height: auto;
  padding: 13px 14px;
  border-radius: 8px;
  color: #ecf3fb;
  font-size: inherit;
  font-weight: inherit;
}

.nav-item::before {
  content: none;
}

.nav-item::after {
  content: "";
  position: absolute;
  left: -12px;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-item.active::after {
  width: 8px;
}

.sidebar-footer {
  margin: auto 0 0;
  padding: 12px 13px;
  gap: 3px;
  color: #d5deea;
  font-size: 13px;
  display: grid;
  text-decoration: none;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: background 0.16s ease, border-color 0.16s ease;
}

.sidebar-footer span,
.sidebar-footer strong {
  position: static;
  padding-left: 0;
}

.sidebar-footer span {
  color: #aab6c3;
  font-size: 12px;
}

.sidebar-footer strong {
  color: #ffffff;
  font-size: 15px;
}

.sidebar-footer:hover {
  background: rgba(20, 122, 99, 0.18);
  border-color: rgba(110, 221, 185, 0.38);
}

.sidebar-footer span::before {
  content: none;
}

.sidebar-footer strong::before {
  content: none;
}

.main {
  height: 100vh;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 28px;
  background: var(--bg);
}

.topbar {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.topbar-title {
  display: none;
  align-items: center;
  gap: 12px;
}

.page-icon {
  display: none;
  width: 0;
  height: 0;
}

.topbar h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
}

.topbar p {
  font-size: inherit;
}

.topbar-actions {
  gap: 8px;
  margin-left: auto;
}

.clock,
.user-chip {
  min-height: 0;
  border-radius: 8px;
  border-color: var(--line);
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(12, 24, 48, 0.04);
}

.clock {
  min-width: 0;
  min-height: 38px;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  min-width: 132px;
  padding: 9px 12px;
}

.user-chip span {
  font-weight: 700;
}

.pos-layout {
  grid-template-columns: minmax(0, 25fr) minmax(0, 50fr) minmax(260px, 25fr);
  gap: 18px;
}

.checkout,
.payment-panel,
.quick-products-panel,
.panel {
  border-radius: 8px;
  border-color: var(--line);
  box-shadow: 0 12px 32px rgba(12, 24, 48, 0.06);
}

.scan-panel {
  padding: 18px;
}

label {
  color: #17243a;
}

.scan-row {
  grid-template-columns: auto minmax(120px, 1fr) var(--scan-side-button) calc(var(--scan-side-button) * 1.28);
  gap: 8px;
}

#barcodeInput {
  min-height: var(--scan-control);
  height: var(--scan-control);
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 0 13px;
  font-size: var(--input-font);
  color: #111c30;
}

#barcodeInput::placeholder {
  color: #8d97a5;
  font-weight: 500;
  opacity: 0.62;
}

.secondary {
  background: #ffffff;
  border: 1px solid var(--line);
  color: #10203a;
  box-shadow: 0 8px 18px rgba(12, 24, 48, 0.04);
}

.primary {
  background: linear-gradient(180deg, #0b985f, #087b4f);
  box-shadow: 0 10px 24px rgba(10, 135, 87, 0.22);
}

.cart-table-wrap {
  min-height: min(520px, calc(100vh - 300px));
  max-height: calc(100vh - 258px);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scrollbar-width: none;
}

.cart-table-wrap::-webkit-scrollbar {
  display: none;
}

.cart-table {
  table-layout: fixed;
}

.cart-col-product {
  width: auto;
}

.cart-col-qty {
  width: 58px;
}

.cart-col-price {
  width: 106px;
}

.cart-col-total {
  width: 104px;
}

.cart-col-action {
  width: 36px;
}

.cart-table th,
.cart-table td,
.data-table th,
.data-table td {
  padding: 13px 14px;
}

.cart-table th:nth-child(3),
.cart-table th:nth-child(4),
.cart-table th:nth-child(2),
.cart-qty-cell,
.cart-table .money-cell {
  text-align: center;
}

.cart-table th:nth-child(2),
.cart-table td:nth-child(2),
.cart-table th:nth-child(3),
.cart-table td:nth-child(3),
.cart-table th:nth-child(4),
.cart-table td:nth-child(4) {
  border-left: 1px solid var(--line);
}

.cart-table th:nth-child(5),
.cart-table td:nth-child(5) {
  border-left: 1px solid var(--line);
}

.cart-table th:nth-child(2),
.cart-table td:nth-child(2) {
  padding-left: 3px;
  padding-right: 3px;
}

.cart-table th:nth-child(5),
.cart-table td:nth-child(5) {
  padding-left: 0;
  padding-right: 0;
}

.cart-table .money-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  line-height: 1.15;
  font-size: 15px;
}

.cart-price-cell strong,
.cart-total-cell strong {
  display: inline-block;
  line-height: 1.15;
  font-size: 16px;
  font-weight: 800;
  vertical-align: baseline;
}

.cart-actions-cell {
  position: relative;
  padding: 0;
  text-align: center;
  background: #e53935;
}

.cart-row:nth-child(even) .cart-actions-cell {
  background: #ef5350;
}

.cart-row.selected .cart-actions-cell {
  background: #d93632;
}

.cart-row {
  cursor: pointer;
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

.cart-row.selected {
  background: #f1faf6;
  box-shadow: inset 3px 0 0 var(--primary);
}

.cart-row:focus-visible {
  outline: 2px solid rgba(20, 122, 99, 0.35);
  outline-offset: -2px;
}

.cart-qty-cell strong {
  display: inline-block;
  min-width: 36px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.15;
  vertical-align: baseline;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.cart-qty-edit {
  display: inline-grid;
  place-items: center;
  width: 100%;
  min-height: 42px;
  padding: 0 1px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.cart-price-edit {
  display: inline-grid;
  place-items: center;
  gap: 5px;
  width: 100%;
  min-width: 82px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.cart-price-edit strong {
  font-size: 17px;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.cart-price-edit.readonly {
  cursor: pointer;
}

.cart-delete-btn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 850;
  line-height: 1;
}

.cart-delete-btn:hover {
  background: rgba(120, 0, 0, 0.16);
}

.cart-delete-x {
  font-size: 20px;
  line-height: 1;
}

.price-edit-summary {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.price-edit-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.cart-table th,
.data-table th {
  background: #fbfcfe;
  color: #637186;
  font-size: 13px;
}

.cart-name strong {
  font-size: 17px;
  font-weight: 700;
}

.cart-name span,
.small-muted {
  color: #65748a;
  font-size: 12px;
}

.qty-control {
  grid-template-columns: 36px 64px 36px;
  border-color: var(--line);
}

.qty-control button,
.qty-control input {
  height: 38px;
  min-height: 38px;
  font-size: inherit;
}

.qty-control button {
  background: #ffffff;
}

.qty-open-control {
  display: grid;
  grid-template-columns: minmax(64px, 1fr) 78px;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.qty-open-control strong {
  display: block;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
}

.qty-open-control button {
  min-height: 38px;
  padding: 7px 10px;
  font-weight: 600;
}

.danger {
  background: #fff0f0;
  border: 1px solid #ffd4d4;
  color: #f01820;
}

.payment-panel {
  padding: 18px;
  top: 18px;
}

.total-box {
  background:
    radial-gradient(circle at 82% 0%, rgba(58, 138, 172, 0.13), transparent 42%),
    linear-gradient(180deg, #16354d, #10283d);
  border-radius: 8px;
  padding: 18px;
}

.total-box span {
  color: #d6e2ed;
  font-size: inherit;
}

.total-box strong {
  font-size: 36px;
  font-weight: 700;
}

.pay-method {
  min-height: 0;
  background: #ffffff;
  border-color: var(--line);
  font-size: inherit;
}

.pay-method.active {
  background: #edf8f3;
  border: 2px solid var(--primary);
  color: var(--primary-dark);
}

.huge {
  min-height: 62px;
  font-size: 20px;
}

.quick-stats div,
.metric {
  min-height: 0;
  background: #ffffff;
  border-color: var(--line);
  padding: 16px;
}

.quick-stats strong,
.metric strong {
  font-size: 22px;
  font-weight: 700;
}

.receipt,
.print-slip {
  background: #ffffff;
  border-color: var(--line);
  color: #18253b;
  line-height: 1.55;
}

.panel {
  padding: 18px;
}

.toolbar h2 {
  font-size: 20px;
  font-weight: 700;
}

.toast {
  background: #07182d;
}

.topbar .secondary,
.topbar .clock {
  min-height: 42px;
  padding: 8px 13px;
  font-size: 14px;
  font-weight: 750;
}

.topbar-critical-btn span {
  min-width: 22px;
  min-height: 22px;
  font-size: 12px;
}

.quick-product-grid {
  gap: 9px;
}

.quick-product-card,
.quick-product-empty {
  min-height: 72px;
  padding: 4px;
}

.quick-product-card strong {
  font-size: 16px;
  font-weight: 680;
  line-height: 1.16;
  -webkit-line-clamp: 2;
}

.quick-products-footer {
  gap: 8px;
}

.quick-product-pages button,
.quick-manage-btn {
  height: 38px;
  min-height: 38px;
}

.quick-product-pages button {
  min-width: 0;
  font-size: 14px;
}

.quick-manage-btn {
  width: 38px;
  min-width: 38px;
}

#barcodeInput {
  min-height: 58px;
  font-size: 22px;
  font-weight: 750;
}

.scan-row .secondary {
  min-height: 52px;
  font-size: 15px;
}

.cart-table th {
  font-size: 14px;
}

.cart-name strong {
  font-size: 16px;
  line-height: 1.2;
}

.qty-control {
  grid-template-columns: 42px 70px 42px;
}

.qty-control button,
.qty-control input {
  height: 42px;
  min-height: 42px;
  font-size: 16px;
}

.payment-panel {
  gap: 12px;
}

.total-box {
  padding: 17px 18px;
}

.total-box span {
  font-size: 15px;
}

.total-box strong {
  font-size: 34px;
}

.discount-mode-field > span,
.discount-input-field > span,
.discount-payable-field > span,
.cash-box label,
.change-field {
  font-size: 12px;
  font-weight: 750;
}

.discount-mode,
.discount-input-wrap,
.discount-payable,
.cash-box input,
.change-box {
  min-height: 44px;
}

.discount-mode button {
  min-height: 42px;
  font-size: 15px;
  font-weight: 750;
}

.discount-input-wrap input,
.payment-adjustments input {
  min-height: 44px;
  font-size: 15px;
}

.discount-payable strong,
.change-box strong {
  font-size: 18px;
}

.pay-method {
  min-height: 54px;
  padding: 12px 14px;
  font-size: 17px;
  font-weight: 800;
}

.huge {
  min-height: 64px;
  font-size: 20px;
  font-weight: 850;
}

.quick-stats div {
  padding: 14px 16px;
}

.quick-stats span {
  font-size: 12px;
}

.quick-stats strong {
  font-size: 24px;
}

@media (max-width: 860px) {
  html,
  body {
    overflow: auto;
  }

  #app {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar,
  .main {
    height: auto;
    min-height: 0;
    overflow: visible;
  }
}

@media (max-width: 860px) {
  .pos-layout {
    grid-template-columns: 1fr;
  }

  .quick-products-panel {
    position: static;
    height: auto;
    max-height: none;
  }

  .checkout {
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

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

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

@media (min-width: 861px) and (max-width: 1100px) {
  html,
  body {
    overflow: hidden;
  }

  #app {
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
  }

  .main {
    padding: 12px;
    overflow: auto;
  }

  .topbar {
    margin-bottom: 12px;
  }

  .pos-layout {
    grid-template-columns: minmax(180px, 25fr) minmax(340px, 50fr) minmax(230px, 25fr);
    gap: 12px;
  }

  .checkout,
  .quick-products-panel,
  .payment-panel {
    position: sticky;
    top: 12px;
    height: calc(100vh - 92px);
    max-height: calc(100vh - 92px);
  }

  .checkout,
  .quick-products-panel,
  .payment-panel,
  .scan-panel {
    padding: 12px;
  }
}

@media (max-width: 720px) {
  .quick-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 721px) and (max-width: 920px) {
  .app-menu-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.topbar .secondary,
.topbar .clock {
  min-height: 42px;
  padding: 8px 13px;
  font-size: 14px;
  font-weight: 750;
}

.topbar .clock {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.topbar .clock strong {
  font-size: 15px;
  margin: 0;
}

.touch-keyboard-dialog {
  border: 0;
  border-radius: 10px;
  padding: 0;
  width: min(960px, 86vw);
  max-height: 88vh;
  overflow: hidden;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

.touch-keyboard-dialog[data-mode="number"] {
  width: min(420px, 72vw);
}

.touch-keyboard-dialog::backdrop {
  background: rgba(23, 32, 42, 0.5);
}

.touch-keyboard-dialog > div {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: inherit;
  background: #ffffff;
}

.touch-keyboard-dialog header,
.touch-keyboard-dialog footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: clamp(10px, 2vh, 14px) clamp(12px, 2vw, 16px);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.touch-keyboard-dialog header {
  justify-content: space-between;
}

.touch-keyboard-dialog footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.touch-keyboard-main-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.touch-keyboard-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.touch-keyboard-cursor-actions {
  display: grid;
  grid-template-columns: repeat(2, 52px);
  gap: 6px;
}

.touch-keyboard-main-actions {
  gap: 10px;
  margin-left: auto;
  justify-content: flex-end;
}

.touch-keyboard-dialog h2 {
  margin: 0;
  font-size: 20px;
}

.touch-keyboard-content {
  display: grid;
  gap: clamp(8px, 1.5vh, 12px);
  padding: clamp(12px, 2vw, 16px);
  overflow: auto;
}

#touchKeyboardDisplay {
  width: 100%;
  min-height: clamp(44px, 7vh, 56px);
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 750;
}

.touch-keyboard-keys.number {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(7px, 1.4vw, 10px);
}

.touch-keyboard-keys.text {
  display: grid;
  gap: clamp(6px, 1.2vw, 9px);
}

.touch-key-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: clamp(5px, 1vw, 8px);
}

.touch-key-row.actions {
  grid-template-columns: 120px minmax(0, 1fr) 72px 72px;
}

.touch-keyboard-keys button {
  min-height: clamp(42px, 7vh, 56px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 800;
}

.touch-keyboard-keys.number button {
  min-height: clamp(50px, 9vh, 68px);
  font-size: clamp(20px, 4vw, 26px);
}

.touch-keyboard-keys button:active {
  background: var(--soft-green);
  border-color: var(--primary);
}

.touch-keyboard-dialog footer button {
  min-height: clamp(42px, 6.5vh, 48px);
  min-width: clamp(64px, 10vw, 78px);
  font-size: clamp(14px, 2vw, 16px);
}

#touchKeyboardLeft,
#touchKeyboardRight {
  min-width: clamp(44px, 7vw, 52px);
  width: clamp(44px, 7vw, 52px);
  min-height: clamp(44px, 7vh, 56px);
  padding: 0;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 900;
  line-height: 1;
}

#touchKeyboardApply {
  min-width: clamp(96px, 16vw, 118px);
}

/* Final compact scaling and popup menu behavior */
#app,
#app.cashier-mode,
#app.sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.sidebar {
  display: none !important;
}

.main {
  padding: calc(24px * var(--space-scale)) calc(28px * var(--space-scale));
}

.topbar {
  margin-bottom: var(--topbar-gap);
}

.topbar .secondary,
.topbar .clock,
.topbar-sale-btn,
.account-icon-btn {
  width: var(--topbar-control);
  min-width: var(--topbar-control);
  height: var(--topbar-control);
  min-height: var(--topbar-control);
}

.topbar .clock {
  width: auto;
  padding: calc(7px * var(--space-scale)) calc(11px * var(--space-scale));
  gap: calc(10px * var(--space-scale));
  font-size: calc(14px * var(--font-scale));
}

.topbar .clock strong {
  font-size: calc(15px * var(--font-scale));
}

.topbar-svg-icon,
.scale-svg-icon {
  width: calc(22px * var(--ui-scale));
  height: calc(22px * var(--ui-scale));
}

.reset-svg-icon {
  width: calc(22px * var(--ui-scale));
  height: calc(22px * var(--ui-scale));
}

.account-svg-icon {
  width: calc(23px * var(--ui-scale));
  height: calc(23px * var(--ui-scale));
}

.sale-currency-icon {
  font-size: calc(26px * var(--font-scale));
}

.sale-home-icon {
  width: calc(23px * var(--ui-scale));
  height: calc(23px * var(--ui-scale));
}

.topbar-reset-btn {
  width: var(--topbar-control);
  min-width: var(--topbar-control);
  height: var(--topbar-control);
  min-height: var(--topbar-control);
}

.pos-layout {
  gap: var(--pos-gap);
}

.checkout,
.quick-products-panel,
.payment-panel {
  height: calc(100vh - var(--pos-panel-offset));
  max-height: calc(100vh - var(--pos-panel-offset));
}

.quick-products-panel,
.payment-panel {
  top: var(--pos-sticky-top);
}

.checkout {
  top: 0;
  min-height: calc(100vh - var(--pos-panel-offset));
}

.quick-products-panel,
.payment-panel,
.scan-panel,
.panel {
  padding: var(--panel-pad);
}

.scan-panel {
  padding: calc(10px * var(--space-scale)) var(--panel-pad);
}

.quick-products-panel {
  padding: calc(10px * var(--space-scale)) var(--panel-pad) var(--panel-pad);
}

.cart-table-wrap {
  min-height: 0;
  height: 100%;
  max-height: none;
}

.scan-row {
  gap: calc(10px * var(--space-scale));
}

.cart-scroll-controls {
  grid-template-columns: repeat(2, var(--scan-side-button));
  gap: calc(7px * var(--space-scale));
  width: calc((var(--scan-side-button) * 2) + (7px * var(--space-scale)));
  height: var(--scan-control);
}

.cart-nav-btn,
.pending-scan-qty-btn,
.custom-sale-shortcut-btn {
  width: var(--scan-side-button);
  min-width: var(--scan-side-button);
  height: var(--scan-control);
  min-height: var(--scan-control);
}

.pending-scan-qty-btn {
  width: calc(var(--scan-side-button) * 1.28);
  min-width: calc(var(--scan-side-button) * 1.28);
  font-size: calc(18px * var(--font-scale));
}

.custom-sale-shortcut-btn {
  font-size: calc(32px * var(--font-scale));
}

.cart-nav-caret {
  width: calc(15px * var(--ui-scale));
  height: calc(15px * var(--ui-scale));
}

#barcodeInput {
  min-height: var(--scan-control);
  font-size: var(--input-font);
}

.quick-products-groups {
  gap: calc(7px * var(--space-scale));
  padding-bottom: calc(10px * var(--space-scale));
}

.quick-products-groups button {
  min-height: var(--scan-control);
  font-size: calc(18px * var(--font-scale));
  font-weight: 900;
  line-height: 1;
}

.quick-products-footer {
  padding-top: calc(10px * var(--space-scale));
}

.quick-product-pages {
  gap: calc(7px * var(--space-scale));
  grid-template-columns: var(--scan-side-button) minmax(0, 1fr) var(--scan-side-button);
}

.quick-product-pages button {
  height: var(--scan-control);
  min-height: var(--scan-control);
  font-size: calc(24px * var(--font-scale));
  font-weight: 900;
  line-height: 1;
}

.quick-page-status {
  min-height: var(--scan-control);
  font-size: calc(15px * var(--font-scale));
}

.quick-manage-btn {
  width: var(--scan-side-button);
  min-width: var(--scan-side-button);
  height: var(--scan-control);
  min-height: var(--scan-control);
}

.cart-table th,
.cart-table td,
.data-table th,
.data-table td {
  padding: var(--row-pad-y) var(--row-pad-x);
}

.cart-name strong {
  font-size: var(--cart-name-font);
}

.quick-product-card,
.quick-product-empty {
  min-height: var(--quick-card-height);
}

.quick-product-card strong {
  font-size: calc(16px * var(--font-scale));
  font-weight: 680;
}

.pay-method {
  min-height: var(--pay-method-height);
  font-size: calc(17px * var(--font-scale));
}

.huge {
  min-height: var(--complete-sale-height);
  font-size: calc(20px * var(--font-scale));
}

.total-box strong {
  font-size: calc(34px * var(--font-scale));
}

.app-menu-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(7, 24, 45, 0.28);
}

@media (min-width: 1440px) {
  .app-menu-dialog {
    width: min(1060px, calc(100vw - 56px));
  }
}

.app-menu-dialog::backdrop {
  background: rgba(7, 24, 45, 0.42);
}

.app-menu-dialog > div {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100vh - 28px);
  background: #ffffff;
}

.app-menu-dialog header,
.app-menu-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.app-menu-dialog footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.app-menu-dialog header div {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.app-menu-dialog header strong {
  font-size: 18px;
}

.app-menu-dialog header span {
  color: var(--muted);
  font-size: 13px;
}

.app-menu-close {
  min-height: 38px;
}

.app-menu-nav {
  padding: 16px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(12, 24, 48, 0.18) transparent;
}

.app-menu-back {
  min-height: 38px;
}

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

.app-menu-system-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.app-menu-card {
  min-width: 0;
  min-height: 106px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: center;
  box-shadow: 0 10px 24px rgba(12, 24, 48, 0.05);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.app-menu-card:hover {
  border-color: rgba(10, 135, 87, 0.32);
  background: #f4fbf7;
  box-shadow: 0 14px 30px rgba(12, 24, 48, 0.08);
}

.app-menu-settings-card {
  min-height: 82px;
  gap: 7px;
  padding: 10px 8px;
}

.app-menu-card-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--soft-green);
  color: var(--primary-dark);
  font-size: 22px;
  font-weight: 850;
}

.app-menu-settings-card .app-menu-card-icon {
  width: 34px;
  height: 34px;
  font-size: 18px;
}

.app-menu-card-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-menu-card strong {
  max-width: 100%;
  overflow: hidden;
  color: #17243a;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-access-content {
  display: grid;
  gap: 14px;
}

.mobile-access-hero {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(10, 135, 87, 0.24);
  border-radius: 8px;
  background: var(--soft-green);
}

.mobile-access-hero strong {
  font-size: 16px;
}

.mobile-access-hero span,
.mobile-access-url-label,
.mobile-access-ip-list span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.mobile-access-url-label {
  display: grid;
  gap: 7px;
}

.mobile-access-url-label input {
  font-weight: 850;
}

.mobile-access-qr {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mobile-access-qr > div {
  min-width: 148px;
  min-height: 148px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.mobile-access-qr svg {
  width: 148px;
  height: 148px;
  display: block;
}

.mobile-access-qr span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.mobile-access-ip-list {
  display: grid;
  gap: 8px;
}

.mobile-access-ip-list button {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.mobile-apk-download-btn {
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.mobile-apk-download-btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.app-menu-nav .nav-group-toggle {
  width: 100%;
  margin: 8px 0 4px;
  min-height: 34px;
  color: #66748a;
  background: #f7f9fc;
}

.app-menu-nav .nav-group-toggle:hover,
.app-menu-nav .nav-group-toggle.open {
  color: var(--primary-dark);
  background: var(--soft-green);
}

.app-menu-nav .nav-item {
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  margin-bottom: 6px;
  padding: 12px 13px;
}

.app-menu-nav .nav-item:hover,
.app-menu-nav .nav-item.active {
  color: var(--primary-dark);
  background: var(--soft-green);
  border-color: rgba(10, 135, 87, 0.22);
}

.app-menu-nav .nav-item::after {
  left: -1px;
  border-radius: 8px 0 0 8px;
}

.app-menu-support {
  min-width: 0;
  flex: 1;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  background: #f9fbfd;
}

.app-menu-support span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.app-menu-support strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Final topbar and payment column alignment */
.topbar .topbar-quick-menu-btn,
.topbar .topbar-credit-btn,
.topbar .topbar-critical-btn,
.topbar .recent-sales-toggle {
  width: auto;
  min-width: max-content;
  height: var(--topbar-control);
  min-height: var(--topbar-control);
  padding: 0 calc(13px * var(--space-scale));
  font-size: calc(14px * var(--font-scale));
  line-height: 1;
}

.topbar .topbar-critical-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.window-control-btn {
  width: var(--topbar-control);
  min-width: var(--topbar-control);
  height: var(--topbar-control);
  min-height: var(--topbar-control);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #10203a;
  background: #ffffff;
}

.window-control-btn span {
  display: block;
  position: relative;
  width: 18px;
  height: 18px;
  font-size: calc(28px * var(--font-scale));
  font-weight: 750;
  line-height: 16px;
  text-align: center;
}

#windowMinimizeBtn span::before {
  content: none;
}

.window-minimize-icon {
  color: #10203a;
  font-size: calc(30px * var(--font-scale));
  font-weight: 850;
  line-height: 0.65;
}

.window-close-btn:hover {
  border-color: #f0b4b4;
  background: #fff0f0;
  color: #c92a2a;
}

.topbar .clock {
  width: auto;
  min-width: max-content;
}

.payment-panel {
  gap: calc(12px * var(--space-scale));
}

.payment-adjustments {
  display: grid;
  gap: calc(10px * var(--space-scale));
}

.discount-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(8px * var(--space-scale));
  align-items: end;
}

.discount-mode-field {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: calc(8px * var(--space-scale));
  align-items: end;
}

.discount-mode-field > span {
  align-self: center;
}

.discount-mode {
  width: 100%;
  min-height: calc(44px * var(--control-scale));
}

.discount-mode button {
  min-height: calc(42px * var(--control-scale));
}

.discount-input-field,
.discount-payable-field,
.cash-box label,
.change-field {
  display: grid;
  grid-template-rows: auto minmax(calc(44px * var(--control-scale)), auto);
  gap: 4px;
  min-width: 0;
}

.discount-input-wrap,
.discount-payable,
.cash-box input,
.change-box {
  min-height: calc(44px * var(--control-scale));
  height: calc(44px * var(--control-scale));
}

.discount-input-wrap input,
.cash-box input {
  min-height: 100%;
  height: 100%;
}

.discount-payable,
.change-box {
  display: flex;
  align-items: center;
}

.cash-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(8px * var(--space-scale));
  align-items: end;
}

.pay-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(10px * var(--space-scale));
}

.pay-method {
  width: 100%;
  min-height: var(--pay-method-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 861px) and (max-width: 1100px) {
  .total-box.has-discount {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .total-box.has-discount .total-box-cell {
    display: grid;
    justify-items: center;
  }

  .total-box.has-discount strong {
    font-size: 36px;
  }

  .cash-box {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cash-box label,
  .change-field {
    grid-template-rows: auto minmax(calc(44px * var(--control-scale)), auto);
  }

  .cash-box input,
  .change-box {
    width: 100%;
    min-height: calc(44px * var(--control-scale));
    height: calc(44px * var(--control-scale));
  }

  .cart-col-product {
    width: auto;
  }

  .cart-col-qty {
    width: 42px;
  }

  .cart-col-price {
    width: 62px;
  }

  .cart-col-total {
    width: 64px;
  }

  .cart-col-action {
    width: 32px;
  }

  .cart-table th,
  .cart-table td {
    padding: calc(9px * var(--space-scale)) calc(2px * var(--space-scale));
  }

  .cart-table th {
    font-size: calc(11px * var(--font-scale));
  }

  .cart-table th:first-child,
  .cart-table td:first-child {
    padding-left: calc(10px * var(--space-scale));
  }

  .cart-table th:last-child,
  .cart-table td:last-child {
    padding-right: 0;
    padding-left: 0;
  }

  .cart-name {
    gap: 4px;
    min-width: 0;
  }

  .cart-name strong {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    color: #0f1c2f;
    font-size: calc(14px * var(--font-scale));
    font-weight: 650;
    line-height: 1.18;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .cart-name span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: calc(10.5px * var(--font-scale));
  }

  .cart-qty-cell strong {
    min-width: 0;
    font-size: calc(14px * var(--font-scale));
    line-height: 1.15;
  }

  .cart-qty-edit {
    min-height: calc(42px * var(--control-scale));
  }

  .cart-table .money-cell {
    font-size: calc(12px * var(--font-scale));
    line-height: 1.15;
  }

  .cart-price-cell strong,
  .cart-total-cell strong {
    font-size: calc(12.5px * var(--font-scale));
    line-height: 1.15;
    font-weight: 800;
  }

  .cart-delete-btn {
    min-width: 0;
    min-height: 0;
    border-radius: 0;
  }

  .cart-delete-x {
    font-size: calc(19px * var(--font-scale));
  }
}

.cash-box {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: calc(8px * var(--space-scale));
  align-items: stretch;
}

.cash-note {
  grid-column: span 2;
}

.cash-value-box {
  grid-column: span 3;
}

.cash-note,
.cash-value-box {
  min-width: 0;
  min-height: calc(52px * var(--control-scale));
  height: calc(52px * var(--control-scale));
  border-radius: 7px;
}

.cash-note {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  overflow: hidden;
  padding: 6px 7px;
  border: 1px solid rgba(17, 36, 54, 0.16);
  color: #102030;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.36);
}

.cash-note::before,
.cash-note::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.cash-note::before {
  inset: 5px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 5px;
}

.cash-note::after {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(17, 36, 54, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.cash-note span,
.cash-note small {
  position: relative;
  z-index: 1;
}

.cash-note span {
  font-size: clamp(17px, calc(19px * var(--font-scale)), 24px);
  line-height: 1;
}

.cash-note small {
  font-size: clamp(10px, calc(11px * var(--font-scale)), 13px);
  line-height: 1;
}

.cash-note:active {
  transform: translateY(1px);
  filter: brightness(0.98);
}

.note-5 {
  background: linear-gradient(135deg, #b88955, #f6d5a4 50%, #a86f3e);
}

.note-10 {
  background: linear-gradient(135deg, #cf7d73, #ffd0c8 50%, #b85a52);
}

.note-20 {
  background: linear-gradient(135deg, #7fa173, #d9efd2 50%, #5e8d5d);
}

.note-50 {
  background: linear-gradient(135deg, #d39a49, #ffe0a4 50%, #bc762a);
}

.note-100 {
  background: linear-gradient(135deg, #7d94c8, #d3e0ff 50%, #546fae);
}

.note-200 {
  background: linear-gradient(135deg, #8c79ba, #ded2ff 50%, #6d58a2);
}

.cash-value-box {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: 1px solid #d8eadf;
  background: #f1fbf6;
  color: var(--primary-dark);
  text-align: center;
}

.cash-value-box.has-value {
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 6px;
  justify-content: stretch;
  text-align: left;
}

.cash-received-box {
  position: relative;
  cursor: pointer;
}

.cash-received-box.has-value {
  border-color: #198a61;
  box-shadow: inset 0 0 0 1px rgba(25, 138, 97, 0.18);
}

.change-box {
  border-color: #bfd0e3;
  background: #eef5ff;
  color: #163f68;
}

.change-box.has-value {
  border-color: #8eb1d8;
  box-shadow: inset 0 0 0 1px rgba(22, 63, 104, 0.12);
}

.cash-received-box input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.cash-value-box strong {
  overflow: hidden;
  max-width: 100%;
  color: inherit;
  font-size: clamp(12px, calc(15px * var(--font-scale)), 18px);
  line-height: 1.1;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cash-value-box.has-value strong {
  justify-self: end;
  align-self: center;
  text-align: right;
}

.cash-value-label {
  display: flex;
  gap: 3px;
  align-self: center;
  justify-self: start;
  color: rgba(15, 31, 51, 0.68);
  font-size: clamp(9px, calc(10.5px * var(--font-scale)), 12px);
  font-weight: 800;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
}

.cash-value-label[hidden] {
  display: none;
}

.change-box .cash-value-label {
  color: rgba(22, 63, 104, 0.72);
}

@media (min-width: 861px) and (max-width: 1100px) {
  .cash-value-label {
    display: grid;
    gap: 1px;
  }

  .cash-value-label[hidden] {
    display: none;
  }
}

.cash-value-box strong.placeholder {
  color: #7d8b9b;
  font-size: clamp(11px, calc(13px * var(--font-scale)), 15px);
}

.change-box strong.placeholder {
  color: #53708f;
  font-size: clamp(12px, calc(14px * var(--font-scale)), 16px);
}

.change-box strong:not(.placeholder) {
  font-size: clamp(15px, calc(19px * var(--font-scale)), 23px);
}

.cash-note,
.cash-value-box {
  min-height: calc(44px * var(--control-scale));
  height: calc(44px * var(--control-scale));
}

.cash-note {
  padding: 0;
  background: #edf1f5;
}

.cash-note img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
}

.cash-note::before {
  z-index: 1;
  inset: 2px;
  border-color: rgba(255, 255, 255, 0.42);
  border-radius: 5px;
}

.cash-note::after {
  display: none;
}

.cash-note span,
.cash-note small {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* POS top action tabs */
.topbar > :not(.pos-top-actions) {
  position: relative;
  z-index: 2;
}

.pos-top-actions {
  grid-template-columns: minmax(0, 25fr) minmax(0, 50fr) minmax(260px, 25fr);
  gap: var(--pos-gap);
}

.pos-floating-action.held-sale-btn.has-held {
  background: #f1fbf6;
  color: var(--primary);
  box-shadow: none;
}

@media (min-width: 861px) and (max-width: 1100px) {
  .pos-top-actions {
    grid-template-columns: minmax(180px, 25fr) minmax(340px, 50fr) minmax(230px, 25fr);
  }
}

@media (max-width: 860px) {
  .pos-top-actions {
    display: none !important;
  }
}

/* Final narrow POS scan action guard */
@media (max-width: 1100px) {
  .scan-action-btn {
    width: var(--scan-side-button) !important;
    min-width: var(--scan-side-button) !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  .scan-action-btn span,
  .scan-action-btn.held-sale-btn #heldSaleCount {
    display: none !important;
  }
}

/* Narrow POS scan actions: icon only */
@media (max-width: 1100px) {
  .scan-action-btn {
    width: var(--scan-side-button);
    min-width: var(--scan-side-button);
    padding: 0;
    gap: 0;
  }

  .scan-action-btn span,
  .scan-action-btn.held-sale-btn #heldSaleCount {
    display: none !important;
  }
}

/* POS column-top layout */
.topbar {
  display: none;
}

.main {
  padding: calc(18px * var(--space-scale));
}

.pos-layout {
  gap: var(--pos-gap);
}

.checkout {
  min-height: calc(100vh - (36px * var(--space-scale)));
}

.quick-products-panel,
.payment-panel {
  top: calc(18px * var(--space-scale));
  height: calc(100vh - (36px * var(--space-scale)));
  max-height: calc(100vh - (36px * var(--space-scale)));
}

.quick-products-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  padding: calc(14px * var(--space-scale));
}

.quick-products-head {
  min-height: var(--scan-control);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(10px * var(--space-scale));
  padding: 0 calc(2px * var(--space-scale)) calc(10px * var(--space-scale));
  border-bottom: 1px solid rgba(16, 32, 58, 0.08);
}

.quick-products-head strong {
  min-width: 0;
  color: var(--ink);
  font-size: clamp(18px, calc(20px * var(--font-scale)), 27px);
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-panel-icon-btn {
  width: calc(var(--scan-side-button) * 0.82);
  min-width: calc(var(--scan-side-button) * 0.82);
  height: calc(var(--scan-control) * 0.82);
  min-height: calc(var(--scan-control) * 0.82);
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--primary);
  box-shadow: none;
}

.pos-panel-icon-btn:hover {
  background: #f1fbf6;
  color: var(--primary-dark);
}

.pos-panel-icon-btn svg,
.scan-action-btn svg,
.barcode-entry-wrap svg {
  width: calc(21px * var(--ui-scale));
  height: calc(21px * var(--ui-scale));
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scan-panel {
  padding: calc(14px * var(--space-scale)) calc(16px * var(--space-scale));
}

.scan-row {
  grid-template-columns: auto minmax(180px, 1fr) var(--scan-side-button) calc(var(--scan-side-button) * 1.28);
  gap: calc(8px * var(--space-scale));
}

.pos-scan-actions {
  display: inline-flex;
  align-items: center;
  gap: calc(8px * var(--space-scale));
}

.scan-action-btn {
  height: var(--scan-control);
  min-height: var(--scan-control);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(8px * var(--space-scale));
  padding: 0 calc(13px * var(--space-scale));
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: #10203a;
  box-shadow: 0 6px 14px rgba(12, 24, 48, 0.04);
  font-size: clamp(12px, calc(13px * var(--font-scale)), 16px);
  font-weight: 900;
  line-height: 1;
}

.scan-action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.scan-action-btn.held-sale-btn.has-held {
  border-color: rgba(15, 127, 91, 0.55);
  background: #f1fbf6;
  color: var(--primary-dark);
}

.barcode-entry-wrap {
  height: var(--scan-control);
  min-height: var(--scan-control);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: calc(9px * var(--space-scale));
  width: 100%;
  padding: 0 calc(12px * var(--space-scale));
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #ffffff;
  color: var(--primary-dark);
}

.barcode-entry-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 122, 99, 0.13);
}

.barcode-entry-wrap #barcodeInput {
  min-height: 0;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.payment-panel {
  padding: calc(14px * var(--space-scale));
  display: flex;
  flex-direction: column;
  gap: calc(10px * var(--space-scale));
}

.payment-panel-head {
  min-height: var(--scan-control);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: calc(8px * var(--space-scale));
}

.payment-panel .topbar-actions {
  width: 100%;
  justify-content: flex-end;
  gap: calc(7px * var(--space-scale));
  margin-left: 0;
}

.payment-panel .topbar-sale-btn,
.payment-panel .account-icon-btn,
.payment-panel .recent-sales-toggle,
.payment-panel .window-control-btn,
.payment-panel .topbar-critical-btn {
  width: calc(var(--scan-side-button) * 0.86);
  min-width: calc(var(--scan-side-button) * 0.86);
  height: calc(var(--scan-control) * 0.86);
  min-height: calc(var(--scan-control) * 0.86);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 7px;
  font-size: clamp(12px, calc(13px * var(--font-scale)), 16px);
}

.payment-panel .topbar-critical-btn {
  width: auto;
  min-width: calc(var(--scan-side-button) * 0.86);
  gap: calc(6px * var(--space-scale));
  padding: 0 calc(9px * var(--space-scale));
}

.payment-panel .topbar-critical-btn span {
  min-width: calc(20px * var(--ui-scale));
  height: calc(20px * var(--ui-scale));
  min-height: calc(20px * var(--ui-scale));
  padding: 1px calc(6px * var(--space-scale));
}

.payment-panel .topbar-svg-icon {
  width: calc(20px * var(--ui-scale));
  height: calc(20px * var(--ui-scale));
}

.view-page-controls {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: calc(10px * var(--space-scale));
  margin: 0 0 calc(10px * var(--space-scale));
}

.view-window-actions {
  display: inline-flex;
  align-items: center;
  gap: calc(7px * var(--space-scale));
}

.view-home-btn {
  width: var(--scan-side-button);
  min-width: var(--scan-side-button);
  height: var(--scan-control);
  min-height: var(--scan-control);
  display: none;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: 0 6px 14px rgba(12, 24, 48, 0.04);
}

.view-home-btn svg {
  width: calc(21px * var(--ui-scale));
  height: calc(21px * var(--ui-scale));
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

body:not([data-active-view="pos"]) .view-home-btn {
  display: grid;
}

body:not([data-active-view="pos"]) .view-page-controls {
  display: flex;
}

@media (max-width: 1180px) {
  .scan-action-btn span:not(#heldSaleCount) {
    display: none;
  }

  .scan-action-btn {
    width: var(--scan-side-button);
    min-width: var(--scan-side-button);
    padding: 0;
  }
}

/* POS cart header and left scrollbar refinement */
.cart-table-wrap {
  overflow-y: auto;
  overflow-x: hidden;
  direction: rtl;
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 32, 58, 0.16) transparent;
}

.cart-table-wrap:hover {
  scrollbar-color: rgba(15, 127, 91, 0.62) transparent;
}

.cart-table-wrap::-webkit-scrollbar {
  display: block;
  width: 7px;
}

.cart-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.cart-table-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(16, 32, 58, 0.14);
}

.cart-table-wrap:hover::-webkit-scrollbar-thumb {
  background: rgba(15, 127, 91, 0.62);
}

.cart-table {
  direction: ltr;
}

.cart-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fbfcfd;
  box-shadow: 0 1px 0 var(--line);
}

.checkout {
  position: relative;
  z-index: 0;
}

.payment-panel {
  position: sticky;
  z-index: 20;
}

.payment-panel-head,
.payment-panel .topbar-actions,
.payment-panel .recent-sales-menu {
  position: relative;
  z-index: 30;
}

/* Compact icon-only topbar */
.topbar {
  min-height: var(--topbar-control);
}

.topbar > .clock {
  order: 0;
  margin-right: auto;
}

.topbar-actions {
  margin-left: auto;
}

.topbar .topbar-credit-btn,
.topbar .topbar-critical-btn,
.topbar .recent-sales-toggle,
.topbar .topbar-sale-btn,
.topbar .account-icon-btn {
  width: var(--topbar-control);
  min-width: var(--topbar-control);
  height: var(--topbar-control);
  min-height: var(--topbar-control);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar .topbar-credit-btn,
.topbar .topbar-critical-btn,
.topbar .recent-sales-toggle {
  color: #10203a;
  background: #ffffff;
}

.topbar .topbar-credit-btn:hover,
.topbar .topbar-critical-btn:hover,
.topbar .recent-sales-toggle:hover {
  border-color: rgba(20, 122, 99, 0.32);
  color: var(--primary);
  background: #f5fbf8;
}

.ledger-svg-icon,
.stock-svg-icon,
.recent-sale-svg-icon {
  width: calc(23px * var(--ui-scale));
  height: calc(23px * var(--ui-scale));
}

.topbar .topbar-critical-btn {
  position: relative;
  gap: 0;
}

.topbar .topbar-critical-btn span {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  min-height: 20px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 11px;
  line-height: 1;
}

/* Final payment column action layout */
.payment-section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(18px * var(--control-scale));
  color: #10203a;
  font-size: clamp(13px, calc(14px * var(--font-scale)), 17px);
  font-weight: 850;
  line-height: 1;
  text-align: center;
}

.payment-section-title::before,
.payment-section-title::after {
  content: "";
  flex: 1 1 0;
  max-width: 86px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(16, 32, 58, 0.18));
}

.payment-section-title::before {
  margin-right: 10px;
}

.payment-section-title::after {
  margin-left: 10px;
  background: linear-gradient(90deg, rgba(16, 32, 58, 0.18), transparent);
}

.sale-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  gap: calc(10px * var(--space-scale));
}

.sale-action-row .huge,
.sale-cancel-btn {
  min-height: var(--complete-sale-height);
}

.sale-cancel-btn {
  border-color: #f0b4b4;
  color: #b42318;
  background: #fff4f2;
  font-size: calc(18px * var(--font-scale));
  font-weight: 900;
}

.sale-cancel-btn:hover {
  border-color: #d92d20;
  background: #fee4e2;
}

.quick-stats div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: calc(48px * var(--control-scale));
  padding: calc(10px * var(--space-scale)) calc(14px * var(--space-scale));
}

.quick-stats span,
.quick-stats strong {
  display: inline-flex;
  align-items: center;
  margin-top: 0;
  line-height: 1;
}

.quick-stats span {
  color: #10203a;
  font-size: clamp(14px, calc(15px * var(--font-scale)), 18px);
  font-weight: 800;
}

.quick-stats strong {
  color: var(--primary-dark);
  font-size: clamp(20px, calc(23px * var(--font-scale)), 28px);
  font-weight: 900;
}

.backup-usb-status {
  display: grid;
  gap: 3px;
}

.backup-usb-status.ok {
  border-color: #bfe8d2;
  background: #f1fbf6;
}

.backup-usb-status.warn {
  border-color: #ffe0a6;
  background: #fffbeb;
}

.backup-usb-status small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Small POS top refinements */
.payment-panel-head .topbar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: calc(7px * var(--space-scale));
}

.payment-head-left-actions,
.payment-head-window-actions {
  display: inline-flex;
  align-items: center;
  gap: calc(7px * var(--space-scale));
  min-width: 0;
}

.scan-action-btn.held-sale-btn.has-held span:not(#heldSaleCount) {
  display: inline;
  min-width: 0;
  height: auto;
  margin-left: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  line-height: 1;
}

.scan-action-btn.held-sale-btn #heldSaleCount {
  display: inline-grid;
  place-items: center;
  min-width: calc(20px * var(--ui-scale));
  height: calc(20px * var(--ui-scale));
  margin-left: 0;
  padding: 0 calc(6px * var(--space-scale));
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 11px;
  line-height: 1;
}

.sale-cancel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
}

@media (max-width: 1100px) {
  .scan-action-btn span:not(#heldSaleCount) {
    display: none;
  }

  .scan-action-btn {
    width: var(--scan-side-button);
    min-width: var(--scan-side-button);
    padding: 0;
  }

  .payment-panel .topbar-critical-btn span {
    display: none;
  }

  .payment-panel .topbar-critical-btn {
    width: calc(var(--scan-side-button) * 0.86);
    min-width: calc(var(--scan-side-button) * 0.86);
    padding: 0;
  }
}

/* Stable POS column action cards */
.pos-top-actions {
  grid-template-columns: minmax(0, 25fr) minmax(0, 50fr) minmax(260px, 25fr);
  gap: var(--pos-gap);
  align-items: stretch;
}

.pos-top-action-cell {
  align-items: center;
}

.pos-top-action-cell-quick,
.pos-top-action-cell-sale {
  justify-content: flex-end;
}

.pos-top-action-card {
  width: auto;
  min-width: 0;
  min-height: var(--topbar-control);
  display: flex;
  align-items: center;
  padding: calc(5px * var(--space-scale)) calc(7px * var(--space-scale));
  border: 0;
  border-radius: 8px 8px 8px 3px;
  background: var(--card);
  box-shadow: none;
  pointer-events: auto;
}

.pos-top-action-card-quick {
  justify-content: flex-end;
  margin-left: auto;
}

.pos-top-action-card-sale {
  justify-content: flex-start;
  margin-right: auto;
}

.pos-floating-group {
  min-height: calc(var(--topbar-control) - 10px);
  padding: 0;
  gap: calc(8px * var(--space-scale));
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.pos-floating-action {
  width: calc(var(--topbar-control) - 10px);
  min-width: calc(var(--topbar-control) - 10px);
  height: calc(var(--topbar-control) - 10px);
  min-height: calc(var(--topbar-control) - 10px);
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
}

.pos-floating-action-leaf {
  width: calc(var(--topbar-control) - 8px);
  min-width: calc(var(--topbar-control) - 8px);
  height: calc(var(--topbar-control) - 8px);
  min-height: calc(var(--topbar-control) - 8px);
  border: 0;
  border-radius: 6px;
  clip-path: none;
}

.pos-floating-action-text {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: calc(82px * var(--control-scale));
  gap: calc(7px * var(--space-scale));
  padding: 0 calc(8px * var(--space-scale));
  border: 0;
  background: transparent;
  color: #10203a;
  font-size: clamp(13px, calc(14px * var(--font-scale)), 17px);
  font-weight: 900;
  line-height: 1;
}

.pos-floating-action-text span:not(#heldSaleCount) {
  display: inline-flex;
  align-items: center;
}

.pos-floating-action svg {
  width: calc(21px * var(--ui-scale));
  height: calc(21px * var(--ui-scale));
}

.pos-floating-separator {
  height: calc(var(--topbar-control) - 18px);
  background: rgba(16, 32, 58, 0.16);
}

@media (min-width: 861px) and (max-width: 1100px) {
  .pos-top-actions {
    grid-template-columns: minmax(180px, 25fr) minmax(340px, 50fr) minmax(230px, 25fr);
  }
}

@media (max-width: 860px) {
  .pos-top-actions {
    display: none !important;
  }
}

/* EOF guard: 1024-style scan buttons must stay icon-only */
@media (max-width: 1100px) {
  .scan-action-btn {
    width: var(--scan-side-button) !important;
    min-width: var(--scan-side-button) !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  .scan-action-btn span,
  .scan-action-btn.held-sale-btn #heldSaleCount {
    display: none !important;
  }
}
