:root {
  color: #182024;
  background: #eef2f3;
  --label-width: 58mm;
  --label-height: 38mm;
  --label-page-width: 198mm;
  --label-page-height: 50mm;
  --label-columns: 3;
  --barcode-scale: 0.55mm;
  --receipt-width: 80mm;
  --receipt-height: 120mm;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.2;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  min-width: 0;
}

select {
  padding-right: 32px !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #53676b 50%),
    linear-gradient(135deg, #53676b 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

input[type="date"]::-webkit-date-and-time-value {
  min-height: 1.2em;
  text-align: left;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #173a3d;
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 26px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.login-card label {
  display: grid;
  gap: 7px;
  color: #415257;
  font-size: 13px;
  font-weight: 700;
}

.login-card input {
  height: 44px;
  padding: 0 12px;
  border: 1px solid #ccd7d7;
  border-radius: 8px;
  outline: 0;
}

.login-brand {
  color: #173a3d;
  margin-bottom: 6px;
}

.login-screen.hidden {
  display: none;
}

.shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  color: #f8fbfb;
  background: #173a3d;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #103033;
  border-radius: 8px;
  background: #9fe1d2;
  font-weight: 900;
}

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

.brand small,
.metric small,
.eyebrow {
  color: #6f7f83;
}

.sidebar .brand small,
.sidebar .metric small {
  color: #bcd1d1;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: #dfeeee;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
}

.nav button.active,
.nav button:hover {
  color: #0b2a2d;
  background: #e8f7f1;
}

.store-switcher {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.store-switcher label {
  display: grid;
  gap: 6px;
}

.store-switcher span,
.store-switcher small {
  color: #bdd4d4;
  font-size: 12px;
}

.store-switcher select {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  color: #0e3031;
  border: 0;
  border-radius: 8px;
  outline: 0;
  background: #f4fbf8;
  font-weight: 800;
}

.field-label {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
  color: #415257;
  font-size: 13px;
  font-weight: 700;
}

.checkout-meta-row {
  display: grid;
  grid-template-columns: minmax(88px, 0.9fr) minmax(84px, 0.8fr) minmax(118px, 1.25fr);
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.checkout-meta-row .field-label {
  margin-bottom: 0;
}

.field-label input,
.field-label select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #ccd7d7;
  border-radius: 8px;
  outline: 0;
  background: #ffffff;
}

.metric-stack {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.metric {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  min-width: 0;
}

.topbar-title .eyebrow {
  max-width: min(640px, 52vw);
  margin: 0;
  overflow: hidden;
  color: #6f7f83;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.account-menu {
  position: relative;
}

.account-menu-trigger {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 148px;
  min-width: 112px;
  min-height: 34px;
  padding: 5px 28px 5px 10px;
  color: #12302d;
  text-align: left;
  border: 1px solid #cfdada;
  border-radius: 999px;
  background: #fbfdfd;
  cursor: pointer;
  box-shadow: 0 6px 18px rgb(15 38 43 / 6%);
}

.account-menu-trigger::after {
  position: absolute;
  top: 50%;
  right: 11px;
  width: 6px;
  height: 6px;
  content: "";
  border-right: 1.5px solid #46615d;
  border-bottom: 1.5px solid #46615d;
  transform: translateY(-65%) rotate(45deg);
}

.account-menu-trigger span {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-trigger small {
  min-width: 0;
  overflow: hidden;
  color: #6d7f7b;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  display: grid;
  min-width: 136px;
  padding: 5px;
  border: 1px solid #d8e0df;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgb(23 43 39 / 16%);
}

.account-menu-panel button {
  width: 100%;
  min-height: 32px;
  padding: 6px 9px;
  color: #163934;
  text-align: left;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
}

.account-menu-panel button:hover {
  background: #f0f7f5;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 13px;
}

h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.status-pill {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #cfdada;
  border-radius: 999px;
  background: #ffffff;
}

.notice {
  min-height: 38px;
  padding: 9px 12px;
  color: #19423e;
  border: 1px solid #b8ded5;
  border-radius: 8px;
  background: #f4fffb;
}

.pos-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 0.8fr);
  gap: 18px;
}

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

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  align-items: start;
}

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

.inventory-side {
  display: grid;
  gap: 16px;
}

.inventory-log table {
  min-width: 640px;
}

.inventory-operation-form {
  grid-template-columns: minmax(260px, 1.45fr) 140px 150px minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: start;
  margin-bottom: 4px;
}

.inventory-operation-form label {
  min-height: 66px;
}

.inventory-operation-form .selector-summary {
  overflow: hidden;
  min-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-operation-form .primary-inline {
  align-self: start;
  margin-top: 25px;
  min-height: 38px;
  white-space: nowrap;
}

.inventory-operation-hint {
  margin: -2px 0 12px;
  color: #66777b;
  font-size: 12px;
  line-height: 1.45;
}

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

.inventory-summary article {
  padding: 12px;
  border: 1px solid #d8e4e2;
  border-radius: 8px;
  background: #f7fbfa;
}

.inventory-summary small,
.inventory-summary strong {
  display: block;
}

.inventory-summary small {
  margin-bottom: 4px;
  color: #66777b;
}

.inventory-summary strong {
  font-size: 20px;
}

.stock-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  color: #31555a;
  border-radius: 999px;
  background: #e7f0ef;
  font-size: 12px;
  font-weight: 800;
}

.stock-badge.low {
  color: #a1351e;
  background: #ffe1d8;
}

.settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.settings-menu {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d8e0e1;
  border-radius: 8px;
  background: #ffffff;
}

.settings-menu button {
  min-height: 42px;
  padding: 0 12px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
}

.settings-menu button.active,
.settings-menu button:hover {
  color: #0b2a2d;
  background: #e8f7f1;
}

.settings-pages {
  min-width: 0;
}

.panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid #d8e0e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(15, 38, 43, 0.08);
}

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

.compact-title {
  margin: 0 0 8px;
}

.scan-form,
.toolbar {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.scan-form label,
.product-form label {
  display: grid;
  gap: 7px;
  color: #415257;
  font-size: 13px;
  font-weight: 700;
}

.input-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 10px;
}

.input-with-action input,
.toolbar input {
  height: 50px;
  padding: 0 14px;
  border: 1px solid #c9d4d5;
  border-radius: 8px;
  outline: 0;
  background: #f8faf9;
}

.toolbar input {
  width: min(420px, 100%);
  height: 42px;
}

.member-directory {
  width: 100%;
}

.member-directory > .panel-title {
  align-items: center;
  min-height: 38px;
  margin-bottom: 14px;
}

.member-directory > .panel-title .primary-inline {
  align-self: center;
}

.member-toolbar {
  grid-template-columns: minmax(260px, 420px) 180px minmax(0, 1fr);
  align-items: end;
}

#tab-members .member-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 180px minmax(0, 1fr);
  align-items: center;
}

.member-toolbar input,
.member-toolbar select {
  height: 42px;
  padding: 0 12px;
  border: 1px solid #c9d4d5;
  border-radius: 8px;
  outline: 0;
  background: #f8faf9;
}

.member-editor-dialog {
  width: min(640px, 100%);
}

.coupon-dialog {
  width: min(520px, 100%);
}

.follow-fieldset {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid #d6e1e0;
  border-radius: 8px;
  background: #f8fbfa;
}

.benefit-config-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dce7e6;
  border-radius: 8px;
  background: #f8fbfa;
}

.subsection-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  justify-content: space-between;
}

.subsection-title span {
  color: #66787c;
  font-size: 12px;
}

.custom-benefit-builder {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 110px auto;
  gap: 10px;
  align-items: end;
}

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

.benefit-config-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid #d9e5e3;
  border-radius: 8px;
  background: #ffffff;
}

.benefit-config-row strong,
.benefit-config-row span {
  display: block;
}

.benefit-config-row span {
  margin-top: 3px;
  color: #62767a;
  font-size: 12px;
}

.follow-fieldset legend {
  padding: 0 4px;
  color: #415257;
  font-size: 13px;
  font-weight: 800;
}

.check-line {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  min-height: 28px;
}

.check-line input {
  width: auto !important;
  height: auto !important;
}

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

.follow-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #415257;
  background: #edf3f2;
  font-size: 12px;
  font-weight: 800;
}

.follow-badge.due {
  color: #a43c10;
  background: #ffe1c9;
}

.follow-badge.scheduled {
  color: #176049;
  background: #dff5ed;
}

.follow-badge.muted {
  color: #66777b;
  background: #edf1f0;
}

tr.member-follow-due {
  background: #fff9f0;
  box-shadow: inset 4px 0 0 #e68a2e;
}

.input-with-action button,
.primary-action {
  min-height: 38px;
  padding: 0 16px;
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  background: #d7472f;
}

.ghost-button,
.danger-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #cbd7d8;
  border-radius: 8px;
  background: #ffffff;
}

.ghost-button:hover {
  border-color: #53a391;
  color: #0f594d;
}

.danger-button {
  color: #b32d1f;
  border-color: #efc7c0;
  background: #fff8f7;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  max-height: calc(100vh - 260px);
  overflow: auto;
  padding-right: 4px;
}

.product-tile {
  display: grid;
  gap: 8px;
  min-height: 148px;
  padding: 14px;
  text-align: left;
  border: 1px solid #dbe2e2;
  border-radius: 8px;
  background: #ffffff;
}

.product-tile:hover {
  border-color: #53a391;
  box-shadow: inset 0 0 0 1px #53a391;
}

.product-tile strong {
  line-height: 1.35;
}

.product-tile span {
  color: #66777b;
  font-size: 13px;
}

.product-tile b {
  color: #d7472f;
  font-size: 20px;
}

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

.file-input {
  display: none;
}

.file-name {
  min-width: 150px;
  max-width: 260px;
  min-height: 32px;
  padding: 7px 10px;
  color: #5e7075;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #d6e1e0;
  border-radius: 8px;
  background: #f8fbfa;
  font-size: 12px;
}

.category {
  width: fit-content;
  padding: 3px 8px;
  color: #164345 !important;
  border-radius: 999px;
  background: #ddf3ec;
}

.checkout-panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 150px);
}

.cart-lines {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 140px;
  max-height: calc(100vh - 430px);
  overflow: auto;
}

.empty {
  margin: 0;
  color: #708084;
}

.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e1e7e7;
  border-radius: 8px;
}

.cart-line.promo-line {
  border-color: #efb24b;
  background: #fff9ed;
  box-shadow: inset 4px 0 0 #e39418;
}

.cart-line-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cart-line-main strong,
td strong {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.cart-line-main span,
td span,
.order-item span {
  color: #718185;
  font-size: 12px;
}

.promo-badge {
  width: fit-content;
  padding: 3px 8px;
  color: #9a3a09 !important;
  border-radius: 999px;
  background: #ffe1ae;
  font-size: 12px;
  font-weight: 800;
}

.cart-line-controls {
  display: grid;
  grid-template-columns: minmax(92px, 0.8fr) minmax(168px, 1.2fr) auto auto;
  gap: 6px;
  align-items: center;
}

.stepper {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  height: 32px;
  border: 1px solid #ccd7d7;
  border-radius: 8px;
  overflow: hidden;
}

.stepper button,
.icon-button {
  display: grid;
  place-items: center;
  border: 0;
  background: #f2f5f5;
}

.stepper input {
  min-width: 0;
  text-align: center;
  border: 0;
  border-right: 1px solid #ccd7d7;
  border-left: 1px solid #ccd7d7;
}

.cart-line select,
.product-form input,
.product-form select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #ccd7d7;
  border-radius: 8px;
  outline: 0;
  background: #ffffff;
}

.adjust-editor {
  display: grid;
  grid-template-columns: 104px minmax(58px, 1fr);
  gap: 6px;
}

.adjust-editor select,
.adjust-editor input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #ccd7d7;
  border-radius: 8px;
  outline: 0;
  background: #ffffff;
}

.line-total {
  align-self: center;
  justify-self: end;
  color: #d7472f;
  font-size: 14px;
  white-space: nowrap;
}

.cart-line .icon-button {
  min-width: 42px;
  min-height: 32px;
  border-radius: 8px;
}

.payment-box {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  font-size: 13px;
}

.payment-code-box {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #cfe2df;
  border-radius: 8px;
  background: #f7fbfa;
  color: #32464b;
  font-weight: 800;
}

.payment-code-box input {
  height: 40px;
  padding: 0 10px;
  border: 1px solid #bfd1d2;
  border-radius: 8px;
  outline: 0;
  font-size: 14px;
  letter-spacing: 0;
}

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

.payment-code-entry button {
  min-height: 40px;
  white-space: nowrap;
}

.payment-code-box small {
  color: #66787c;
  font-weight: 600;
  line-height: 1.35;
}

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

.checkout-print-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  color: #415257;
  border: 1px solid #d4dfde;
  border-radius: 8px;
  background: #f8fbfa;
  font-size: 13px;
  font-weight: 800;
}

.benefit-box {
  display: grid;
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid #d6e4de;
  border-radius: 8px;
  background: #f7fbf7;
}

.benefit-box .empty,
.cart-lines > .empty {
  color: #66777b;
  font-size: 13px;
  line-height: 1.45;
}

.benefit-box label {
  display: grid;
  gap: 6px;
  color: #415257;
  font-size: 12px;
  font-weight: 700;
}

.benefit-box select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #ccd7d7;
  border-radius: 8px;
  background: #ffffff;
}

.benefit-head,
.benefit-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #5c6f73;
  font-size: 12px;
}

.benefit-summary strong {
  color: #173a3d;
}

.benefit-check {
  min-height: auto;
}

.member-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #31555a;
  background: #e7f0ef;
  font-size: 12px;
  font-weight: 800;
}

.member-badge.vip {
  color: #8a3b00;
  background: #ffdfad;
}

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

.payment-options {
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.segmented button {
  min-height: 36px;
  border: 1px solid #cbd7d8;
  border-radius: 8px;
  background: #ffffff;
  font-size: 13px;
}

.segmented button.selected {
  color: #ffffff;
  border-color: #173a3d;
  background: #173a3d;
}

.totals {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  padding: 10px 0;
  border-top: 1px solid #e0e7e7;
  border-bottom: 1px solid #e0e7e7;
}

.totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  color: #506266;
  font-size: 13px;
}

.totals strong {
  color: #172528;
  font-size: 18px;
  line-height: 1.2;
}

.discount-total-row strong,
#cart-discount-total {
  color: #d7472f;
}

.totals div:last-child strong {
  color: #d7472f;
  font-size: 20px;
}

.primary-action {
  width: 100%;
  min-height: 48px;
  font-weight: 800;
}

.primary-inline {
  min-height: 32px;
  padding: 0 12px;
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  background: #d7472f;
}

.held-orders {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e0e7e7;
}

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

.held-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dbe6e4;
  border-radius: 8px;
  background: #f8fbfa;
}

.held-item div:first-child {
  display: grid;
  gap: 3px;
}

.held-item span {
  color: #718185;
  font-size: 12px;
}

.product-form {
  display: grid;
  align-content: start;
  gap: 12px;
}

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

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

.coupon-tier-grid fieldset {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid #d6e1e0;
  border-radius: 8px;
  background: #f8fbfa;
}

.coupon-tier-grid legend {
  padding: 0 4px;
  color: #415257;
  font-size: 12px;
  font-weight: 800;
}

.checkbox {
  display: flex !important;
  align-items: center;
  min-height: 38px;
}

.checkbox input {
  width: auto;
}

.table-wrap {
  overflow: auto;
}

.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: #415257;
  font-size: 13px;
}

.pager-button {
  width: 32px;
  height: 32px;
  border: 1px solid #cbd7d8;
  border-radius: 4px;
  background: #ffffff;
  font-size: 18px;
  line-height: 1;
}

.pager-button:disabled {
  cursor: not-allowed;
  color: #9aa8ab;
  background: #f2f5f5;
}

.pager-input {
  width: 48px;
  height: 32px;
  padding: 0 6px;
  text-align: center;
  border: 1px solid #cbd7d8;
  border-radius: 4px;
  background: #ffffff;
}

.pager-total {
  color: #627277;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.member-table {
  table-layout: fixed;
  min-width: 1030px;
}

.member-table th {
  position: relative;
  user-select: none;
  white-space: nowrap;
}

.member-table td {
  height: 64px;
}

.member-table td,
.member-table th {
  overflow: hidden;
}

.member-table td > strong,
.member-table td > span,
.member-table td > .follow-badge {
  max-width: 100%;
}

.member-table td > strong,
.member-table td > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-table td > span {
  display: block;
  white-space: nowrap;
}

.column-resizer {
  position: absolute;
  top: 8px;
  right: -4px;
  z-index: 2;
  width: 8px;
  height: calc(100% - 16px);
  cursor: col-resize;
}

.column-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  right: 3px;
  width: 1px;
  height: 100%;
  background: #d4dfde;
}

.column-resizer:hover::after,
.resizing-columns .column-resizer::after {
  width: 2px;
  background: #53a391;
}

.resizing-columns,
.resizing-columns * {
  cursor: col-resize !important;
  user-select: none !important;
}

th,
td {
  padding: 13px 10px;
  text-align: left;
  border-bottom: 1px solid #e3e9e9;
  vertical-align: middle;
}

th {
  color: #566a6f;
  font-size: 13px;
}

td:first-child strong,
td:first-child span {
  display: block;
}

td:first-child strong + span {
  margin-top: 3px;
}

.warn {
  color: #c23726;
  font-weight: 800;
}

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

.nowrap-actions {
  flex-wrap: nowrap;
}

td.row-actions {
  display: table-cell;
  white-space: nowrap;
}

td.row-actions > * {
  margin: 2px 6px 2px 0;
  vertical-align: middle;
}

td.wide-actions {
  white-space: normal;
}

.wide-actions {
  min-width: 430px;
}

.mini-input {
  width: 86px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #ccd7d7;
  border-radius: 8px;
}

.member-action-cell {
  overflow: visible !important;
  white-space: nowrap;
}

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

.member-actions .ghost-button {
  min-width: 52px;
}

.action-menu {
  position: relative;
  display: inline-block;
}

.action-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #cbd7d8;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  list-style: none;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu summary[disabled] {
  cursor: not-allowed;
  color: #9aa8ab;
  background: #f2f5f5;
}

.action-menu[open] summary {
  border-color: #53a391;
  background: #f3fbf8;
}

.action-menu > div {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: grid;
  gap: 4px;
  min-width: 132px;
  padding: 6px;
  border: 1px solid #d6e1e0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 38, 43, 0.16);
}

.action-menu button {
  min-height: 32px;
  padding: 0 10px;
  text-align: left;
  border: 0;
  border-radius: 6px;
  background: #ffffff;
}

.action-menu button:hover {
  background: #f0f7f4;
}

.action-menu button:disabled {
  cursor: not-allowed;
  color: #9aa8ab;
  background: #ffffff;
}

.danger-menu-item {
  color: #d7472f;
}

.weight-input {
  width: 74px;
  text-align: center;
}

.tiny-input {
  width: 58px;
}

.mini-select {
  width: 170px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #ccd7d7;
  border-radius: 8px;
  background: #ffffff;
}

.selector-button {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  color: #173a3d;
  text-align: left;
  border: 1px solid #cbdada;
  border-radius: 8px;
  background: #ffffff;
  font-weight: 800;
}

.selector-summary {
  color: #66777b;
  font-size: 12px;
  line-height: 1.4;
}

.repair-customer-field {
  gap: 8px;
}

.customer-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  width: 100%;
  min-height: 78px;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid #cbdada;
  border-radius: 8px;
  background: #f8fbfa;
}

.customer-card:hover {
  border-color: #53a391;
  box-shadow: inset 0 0 0 1px #53a391;
}

.customer-card-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.customer-card-main strong {
  color: #172528;
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.customer-card-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #31555a;
  background: #e7f0ef;
  font-size: 12px;
  font-weight: 800;
}

.customer-card-badge.vip {
  color: #8a3b00;
  background: #ffdfad;
}

.customer-card-badge.normal {
  color: #0f594d;
  background: #ddf3ec;
}

.customer-card-action {
  align-self: start;
  min-height: 28px;
  padding: 5px 10px;
  color: #0f594d;
  border: 1px solid #b9d6d1;
  border-radius: 8px;
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.customer-card small {
  grid-column: 1 / -1;
  color: #5f7075;
  font-size: 12px;
  line-height: 1.45;
}

.password-mini {
  width: 118px;
}

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

.payment-log-section {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e1e8e8;
}

.status-badge.pending,
.status-badge.refunded,
.status-badge.failed {
  display: inline-grid;
  min-height: 22px;
  place-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-badge.pending {
  color: #7a4b00;
  background: #fff0c5;
}

.status-badge.refunded {
  color: #5c6570;
  background: #edf0f2;
}

.status-badge.failed {
  color: #aa2618;
  background: #ffe1dc;
}

.compact-toolbar {
  margin-bottom: 10px;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.label-filter {
  grid-template-columns: minmax(220px, 1fr) 180px auto auto;
}

.prepaid-filter,
.finance-filter {
  grid-template-columns: 160px 160px minmax(220px, 1fr) auto auto;
}

.filter-bar label {
  display: grid;
  gap: 6px;
  color: #415257;
  font-size: 12px;
  font-weight: 700;
}

.filter-bar input,
.filter-bar select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #ccd7d7;
  border-radius: 8px;
  outline: 0;
  background: #ffffff;
}

.filter-bar .ghost-button,
.filter-bar .primary-inline {
  align-self: end;
  height: 36px;
  min-height: 36px;
  padding: 0 16px;
  white-space: nowrap;
}

.summary-strip,
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.summary-strip span,
.report-grid article {
  padding: 12px;
  border: 1px solid #d8e4e2;
  border-radius: 8px;
  background: #f7fbfa;
}

.report-grid small,
.report-grid strong {
  display: block;
}

.report-grid small {
  color: #66777b;
  margin-bottom: 6px;
}

.report-grid strong {
  font-size: 22px;
}

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

.report-columns h2 {
  margin: 0 0 10px;
  font-size: 18px;
  letter-spacing: 0;
}

.order-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dfe7e7;
  border-radius: 8px;
}

.order-select-item.selected {
  border-color: #53a391;
  background: #f5fffb;
  box-shadow: inset 4px 0 0 #53a391;
}

.order-select-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
}

.order-select-control input {
  width: auto;
}

.repair-list {
  gap: 8px;
}

.repair-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 12px;
}

.repair-item.settled {
  border-color: #9ed7bc;
  background: #f5fcf7;
  box-shadow: inset 4px 0 0 #35a66f;
}

.repair-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.repair-main p {
  margin: 0;
  color: #415257;
  line-height: 1.45;
}

.repair-money {
  color: #d7472f;
  font-size: 22px;
  line-height: 1.15;
}

.repair-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  gap: 6px;
  justify-items: stretch;
}

.repair-actions button {
  min-height: 30px;
  padding: 0 8px;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 6px;
  padding: 2px 8px;
  color: #36535a;
  border-radius: 999px;
  background: #eef5f2;
  font-size: 12px;
}

.status-badge.settled {
  color: #167248;
  background: #dff7e9;
}

.table-sort-button {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0;
  color: inherit;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 800;
}

.table-sort-button:hover {
  color: #173a3d;
}

.order-item p {
  grid-column: 1 / -1;
  margin: 0;
  color: #415257;
  line-height: 1.55;
}

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

.order-item .repair-actions {
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  gap: 6px;
}

.order-item ul {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.order-item li {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef5f2;
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.setup-card {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 160px;
  padding: 18px;
  border: 1px solid #d8e0e1;
  border-radius: 8px;
  background: #ffffff;
}

.setup-card p {
  margin: 0;
  color: #5e7075;
  line-height: 1.6;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-list.vertical {
  display: grid;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 34px;
  padding: 5px 8px 5px 10px;
  border: 1px solid #d3dfde;
  border-radius: 999px;
  background: #f5faf8;
}

.chip button {
  min-width: 24px;
  min-height: 24px;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: #e4eeee;
}

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

.account-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 150px auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #d3dfde;
  border-radius: 8px;
  background: #f5faf8;
}

.account-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.account-row strong {
  overflow-wrap: anywhere;
}

.account-row span {
  color: #718185;
  font-size: 12px;
}

.store-list {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.store-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.5fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #d3dfde;
  border-radius: 8px;
  background: #f5faf8;
}

.store-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.store-row strong,
.store-row span {
  overflow-wrap: anywhere;
}

.store-row span {
  color: #718185;
  font-size: 12px;
}

.hint {
  margin: 0;
  color: #66777b;
  line-height: 1.6;
}

.print-area {
  display: none;
}

.print-label {
  display: grid;
  align-content: start;
  gap: 4px;
  width: var(--label-width);
  min-height: var(--label-height);
  padding: 5mm;
  break-inside: avoid;
  border: 1px solid #d8e0e1;
  background: #ffffff;
}

.print-label strong {
  font-size: 13px;
  line-height: 1.25;
}

.print-label span,
.print-label small {
  color: #415257;
  font-size: 10px;
}

.print-label b {
  color: #d7472f;
  font-size: 18px;
}

.barcode {
  display: block;
  height: 15mm;
  margin-top: 2mm;
  overflow: hidden;
  background: #fff;
}

.barcode-svg {
  display: block;
  width: 100%;
  height: 100%;
  color: #111;
}

.scanner-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 30, 32, 0.62);
}

.picker-modal {
  position: fixed;
  inset: 0;
  z-index: 82;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 30, 32, 0.58);
}

.picker-dialog {
  display: grid;
  gap: 12px;
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  padding: 16px;
  border: 1px solid #c9dadb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 60px rgb(10 30 32 / 20%);
}

.picker-dialog > input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid #ccd7d7;
  border-radius: 8px;
  outline: 0;
}

.recharge-dialog {
  width: min(520px, 100%);
}

.recharge-dialog label {
  display: grid;
  gap: 7px;
  color: #415257;
  font-size: 13px;
  font-weight: 800;
}

.recharge-dialog input,
.recharge-dialog select {
  height: 38px;
  padding: 0 10px;
  border: 1px solid #ccd7d7;
  border-radius: 8px;
  outline: 0;
  background: #ffffff;
}

.recharge-summary {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid #d9e6e2;
  border-radius: 8px;
  background: #f7fbfa;
}

.recharge-summary span {
  color: #66777b;
  font-size: 12px;
}

.recharge-total-line {
  min-height: 34px;
  padding: 8px 10px;
  color: #173a3d;
  border: 1px solid #d9e6e2;
  border-radius: 8px;
  background: #f4fffb;
  font-size: 13px;
  font-weight: 800;
}

.picker-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  max-height: 460px;
}

.picker-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid #dce6e5;
  border-radius: 8px;
  background: #fbfdfd;
}

.picker-item strong,
.picker-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.picker-item span {
  color: #708084;
  font-size: 12px;
}

.picker-item b {
  grid-row: 1 / span 2;
  grid-column: 2;
  white-space: nowrap;
}

.picker-item.selected {
  border-color: #d7472f;
  background: #fff5f2;
  box-shadow: inset 4px 0 0 #d7472f;
}

.scanner-dialog {
  display: grid;
  gap: 12px;
  width: min(520px, 100%);
  padding: 16px;
  border: 1px solid #c9dadb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(8, 35, 38, 0.22);
}

.scanner-viewport {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: #102628;
}

.scanner-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-frame {
  position: absolute;
  inset: 16%;
  border: 3px solid #e04831;
  border-radius: 8px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.24);
}

.scanner-status {
  margin: 0;
  color: #42575a;
  font-weight: 700;
  line-height: 1.45;
}

.barcode-svg text {
  fill: #111;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 11px;
  letter-spacing: 0;
}

.qr-code {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #ffffff;
}

.qr-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.receipt-paper {
  width: var(--receipt-width);
  max-width: var(--receipt-width);
  min-height: auto;
  padding: 2.5mm 3mm;
  font-family: "Courier New", "Microsoft YaHei", monospace;
  color: #111;
  background: #ffffff;
  break-inside: avoid;
}

.receipt-paper h2 {
  margin: 0 0 2mm;
  text-align: center;
  font-size: 16px;
  letter-spacing: 0;
}

.receipt-paper p {
  margin: 1.5mm 0;
  font-size: 12px;
}

.receipt-paper table {
  table-layout: fixed;
  border-collapse: collapse;
  min-width: 0;
  width: 100%;
  margin: 3mm 0;
  font-size: 12px;
}

.receipt-paper th,
.receipt-paper td {
  padding: 1mm 0;
  vertical-align: top;
  border-bottom: 1px dashed #aaa;
}

.receipt-paper th {
  color: #333;
  text-align: left;
  font-weight: 800;
}

.receipt-paper th:nth-child(2),
.receipt-paper td:nth-child(2) {
  width: 12mm;
  text-align: center;
}

.receipt-paper th:last-child,
.receipt-paper td:last-child {
  width: 20mm;
  text-align: right;
}

.receipt-item-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.receipt-item-name strong,
.receipt-item-name small {
  display: block;
}

.receipt-item-name small {
  color: #555;
  font-size: 10px;
}

.template-designer-panel {
  margin-top: 18px;
}

.designer-toolbar {
  display: grid;
  grid-template-columns: 140px 130px 130px 160px auto minmax(180px, 1fr) auto auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.designer-toolbar label,
.designer-properties label {
  display: grid;
  gap: 6px;
  color: #415257;
  font-size: 12px;
  font-weight: 700;
}

.designer-toolbar input,
.designer-toolbar select,
.designer-properties input,
.designer-properties select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #ccd7d7;
  border-radius: 8px;
  outline: 0;
  background: #ffffff;
}

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

.designer-canvas {
  position: relative;
  overflow: hidden;
  border: 1px dashed #94aaa9;
  border-radius: 8px;
  background:
    linear-gradient(#eef5f2 1px, transparent 1px),
    linear-gradient(90deg, #eef5f2 1px, transparent 1px),
    #ffffff;
  background-size: 20px 20px;
}

.designer-element {
  position: absolute;
  padding: 3px 5px;
  border: 1px solid #9fb9b7;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
  cursor: move;
  user-select: none;
}

.designer-element.selected {
  border-color: #d7472f;
  box-shadow: 0 0 0 2px rgba(215, 71, 47, 0.16);
}

.designer-properties {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d8e0e1;
  border-radius: 8px;
  background: #f8fbfa;
}

.designed-print {
  position: relative;
  break-inside: avoid;
  border: 1px solid #d8e0e1;
  background: #ffffff;
}

.designed-print .barcode,
.preview-barcode,
.designed-print .qr-code,
.preview-qr {
  height: 100%;
  margin: 0;
}

.designer-receipt-items {
  display: grid;
  gap: 4px;
  width: 100%;
  color: #111;
  font-family: "Courier New", "Microsoft YaHei", monospace;
  line-height: 1.35;
}

.designer-receipt-item-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 58px;
  gap: 6px;
  padding-bottom: 3px;
  border-bottom: 1px dashed #999;
  color: #333;
  font-size: 11px;
  font-weight: 800;
}

.designer-receipt-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 58px;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px dashed #c7c7c7;
}

.designer-receipt-item strong,
.designer-receipt-item span,
.designer-receipt-item b,
.designer-receipt-item small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.designer-receipt-item strong {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.designer-receipt-item span,
.designer-receipt-item b {
  text-align: right;
  white-space: nowrap;
}

.designer-receipt-item small {
  grid-column: 1 / -1;
  color: #555;
  font-size: 10px;
}

.receipt-amount-line,
.receipt-total {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.receipt-amount-line strong,
.receipt-total strong {
  font-weight: 800;
}

.receipt-total {
  font-weight: 800;
}

select {
  background-image:
    linear-gradient(45deg, transparent 50%, #53676b 50%),
    linear-gradient(135deg, #53676b 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

@media (max-width: 1050px) {
  .shell,
  .pos-grid,
  .management-grid,
  .inventory-layout,
  .settings-grid,
  .settings-layout,
  .designer-toolbar,
  .designer-layout,
  .coupon-tier-grid,
  .custom-benefit-builder,
  .inventory-operation-form,
  .label-filter,
  .filter-bar,
  .report-columns,
  .checkout-meta-row {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    gap: 16px;
  }

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

  .metric-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
  }

  .checkout-panel {
    min-height: auto;
  }

  .cart-lines,
  .product-grid {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .order-item {
    grid-template-columns: 1fr;
  }

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

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

  .account-menu,
  .account-menu-trigger {
    width: 100%;
  }

  .account-menu-panel {
    right: auto;
    left: 0;
    width: 100%;
  }

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

  .segmented,
  .payment-options,
  .payment-code-entry,
  .cart-line-controls,
  .form-row,
  .metric-stack {
    grid-template-columns: 1fr;
  }

  .panel-title,
  .row-actions,
  .import-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .file-name {
    max-width: none;
    width: 100%;
  }

  .ghost-button,
  .danger-button {
    width: 100%;
  }

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

@media print {
  html,
  body {
    background: #ffffff;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
  }

  body * {
    visibility: hidden;
  }

  body.printing-receipt > :not(#receipt-print-area) {
    display: none !important;
  }

  body.printing-labels > :not(#label-print-area) {
    display: none !important;
  }

  #label-print-area,
  #label-print-area *,
  #receipt-print-area,
  #receipt-print-area * {
    visibility: visible;
  }

  #label-print-area {
    position: static;
    display: grid;
    grid-template-columns: repeat(var(--label-columns), var(--label-width));
    gap: 3mm;
    align-content: start;
    width: var(--label-page-width);
    min-height: 0;
    height: auto;
    overflow: visible;
    padding: 6mm;
  }

  #receipt-print-area {
    position: static;
    display: block;
    width: var(--receipt-width);
    min-height: 0;
    height: auto;
    overflow: visible;
    padding: 0;
  }

  .receipt-paper,
  .designed-print {
    border: 0;
    box-shadow: none;
  }
}
