:root {
  --bs-primary: #20946e;
  --bs-primary-rgb: 32, 148, 110;
  --bs-success: #20946e;
  --bs-success-rgb: 32, 148, 110;
  --bs-warning: #f28b16;
  --bs-warning-rgb: 242, 139, 22;
  --bs-danger: #d4464a;
  --bs-danger-rgb: 212, 70, 74;
}

.topbar-content {
  width: 100%;
  min-width: 0;
  padding: 0;
}

.brand-mark-image {
  display: block;
  flex: 0 0 29px;
  width: 29px;
  height: 29px;
}

.locale-mount { display: inline-flex; align-items: center; gap: 6px; }
.locale-flag { flex: 0 0 22px; width: 22px; height: 22px; border: 1px solid #dfe5dc; border-radius: 50%; object-fit: cover; }
.locale-select { min-height: 32px; padding: 0 25px 0 8px; border: 1px solid #dfe5dc; border-radius: 5px; background: #fff; color: #344239; font-size: 11px; }

.btn:focus-visible,
.form-control:focus-visible {
  outline: 3px solid rgba(32, 148, 110, .3);
  outline-offset: 2px;
}

.form-control {
  border-color: #d9d9d0;
}

.form-control:focus {
  border-color: #20946e;
  box-shadow: 0 0 0 3px rgba(32, 148, 110, .12);
}

.admin-tabs {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  flex-wrap: nowrap;
  margin-bottom: 19px;
  scrollbar-width: thin;
}

.admin-tab {
  flex: 0 0 auto;
  white-space: nowrap;
}

.admin-tab .bi {
  margin-right: 4px;
}

.admin-catalog-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 11px 14px;
  border: 1px solid #e3e7e2;
  border-radius: 6px;
  background: #f8faf7;
  color: #414941;
  font-size: 12px;
  font-weight: 700;
}

.admin-catalog-summary > span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-catalog-summary .bi {
  color: #347fc4;
  font-size: 15px;
}

.admin-catalog-summary small {
  color: #858b83;
  font-size: 10px;
  font-weight: 500;
}

.admin-catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  align-items: start;
  gap: 19px 20px;
}

.admin-catalog-group {
  min-width: 0;
}

.admin-catalog-group-head {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  padding-bottom: 7px;
  border-bottom: 1px solid #dfe3df;
  color: #4c554d;
}

.admin-catalog-group-head > .bi {
  color: #6e89a8;
  font-size: 13px;
}

.admin-catalog-group-head h3 {
  flex: 1;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.admin-catalog-group-head > span {
  color: #9aa098;
  font-size: 10px;
}

.admin-module-list {
  display: grid;
  gap: 7px;
}

.admin-module-card {
  width: 100%;
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid #e4e7e3;
  border-radius: 6px;
  background: #fff;
  color: #3d443e;
  text-align: left;
  white-space: normal;
  transition: border-color .15s, background .15s, transform .15s;
}

.admin-module-card:hover {
  transform: translateY(-1px);
  border-color: #9bbce1;
  background: #f8fbff;
}

.admin-module-icon {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 6px;
  background: #eff4fb;
  color: #4385cf;
  font-size: 18px;
}

.admin-module-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}

.admin-module-copy strong {
  overflow: hidden;
  color: #424a43;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-module-copy small {
  display: -webkit-box;
  overflow: hidden;
  color: #8b9088;
  font-size: 9px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.admin-module-arrow {
  flex: 0 0 auto;
  color: #a8aea6;
  font-size: 10px;
}

.admin-module-detail {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-module-detail strong {
  color: #515950;
  font-size: 11px;
}

.admin-module-detail p {
  margin: 5px 0 0;
  color: #747a72;
  font-size: 12px;
}

.admin-module-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px;
  border: 1px solid #dce8f5;
  border-radius: 6px;
  background: #f4f8fd;
  color: #596c7f;
  font-size: 11px;
  line-height: 1.6;
}

.admin-module-notice .bi {
  flex: 0 0 auto;
  color: #4385cf;
}

.table-tile.held {
  border-color: #e2b55d;
  background: #fff8e9;
}

.table-tile.reserved {
  border-color: #91acd0;
  background: #f1f5fb;
}

.table-status.current {
  color: #2878b4;
}

.table-status.current::before {
  background: #438ac3;
}

.table-status.held {
  color: #98620e;
}

.table-status.held::before {
  background: #daa742;
}

.table-status.reserved {
  color: #58749b;
}

.table-status.reserved::before {
  background: #7699c1;
}

.order-row.selected {
  margin: 0 -8px;
  padding-right: 8px;
  padding-left: 8px;
  border-radius: 5px;
  background: #f0f6fc;
}

.cashier-action-dialog {
  width: min(560px, 100%);
}

.cashier-action-hint {
  margin: 0 0 12px;
  color: #777d74;
  font-size: 11px;
  line-height: 1.55;
}

.cashier-form-field {
  display: grid;
  gap: 6px;
  color: #60675f;
  font-size: 11px;
}

.cashier-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cashier-function-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.cashier-function-grid .soft-button {
  min-height: 44px;
  text-align: left;
}

.held-order-row {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e2e5df;
  border-radius: 5px;
  background: #fff;
  color: #3e473f;
  text-align: left;
  cursor: pointer;
}

.held-order-row:hover {
  border-color: #d9af61;
  background: #fffaf0;
}

.held-order-row > span {
  display: grid;
  gap: 4px;
}

.held-order-row small {
  color: #81877f;
  font-size: 10px;
}

.held-order-row > strong {
  margin-left: auto;
  font-size: 12px;
}

.prebill-preview {
  padding: 15px;
  border: 1px dashed #cbd2c9;
  background: #fff;
}

.prebill-preview > div:first-child {
  display: grid;
  gap: 5px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eaebe6;
}

.prebill-preview > div:first-child span {
  color: #82877f;
  font-size: 10px;
}

.prebill-line,
.prebill-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0eb;
  font-size: 11px;
}

.prebill-total {
  margin-top: 4px;
  border-bottom: 0;
  color: #b43d34;
  font-weight: 750;
}

.menu-editor-dialog {
  width: min(1060px, 100%);
}

.menu-editor-dialog .dialog-header {
  align-items: flex-start;
}

.menu-editor-dialog .dialog-header h2 {
  font-size: 18px;
}

.menu-editor-subtitle {
  margin: 5px 0 0;
  color: #838980;
  font-size: 11px;
}

.menu-editor-body {
  padding: 16px 20px 18px;
}

.menu-editor-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 15px;
  border-bottom: 1px solid #e4e6df;
}

.menu-editor-tab {
  min-height: 40px;
  flex: 0 0 auto;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #626a61;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.menu-editor-tab .bi {
  margin-right: 6px;
}

.menu-editor-tab.active {
  border-bottom-color: #3188cf;
  color: #2673b5;
  font-weight: 700;
}

.menu-editor-panel {
  min-height: 330px;
  max-height: min(58vh, 520px);
  overflow: auto;
  padding: 14px;
  border: 1px solid #e5e8e3;
  border-radius: 6px;
  background: #fcfcfa;
}

.menu-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.menu-editor-toolbar h3 {
  margin: 0;
  font-size: 14px;
}

.menu-editor-toolbar p {
  margin: 4px 0 0;
  color: #848a81;
  font-size: 10px;
}

.menu-editor-toolbar > div:last-child {
  display: flex;
  align-items: center;
  gap: 7px;
}

.menu-editor-toolbar .setting-input {
  width: 190px;
}

.menu-table-wrap {
  overflow: auto;
  border: 1px solid #e1e4df;
  border-radius: 5px;
  background: #fff;
}

.menu-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  white-space: nowrap;
}

.menu-data-table th,
.menu-data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eceee9;
  text-align: left;
}

.menu-data-table th {
  position: sticky;
  top: 0;
  background: #f2f5f1;
  color: #596258;
  font-size: 10px;
}

.menu-data-table tbody tr:last-child td {
  border-bottom: 0;
}

.menu-status {
  color: #28805d;
}

.menu-data-table .soft-button {
  min-height: 29px;
  padding: 0 9px;
  font-size: 10px;
}

.menu-price-section {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d8e6ed;
  border-radius: 5px;
  background: #edf6fa;
}

.menu-price-section h4 {
  margin: 0 0 10px;
  color: #4b5d66;
  font-size: 12px;
}

.menu-price-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px 10px;
}

.menu-price-grid label,
.menu-discount-grid label,
.menu-price-accent > label {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(60px, .8fr) minmax(70px, 1.2fr);
  gap: 6px;
  color: #5e665e;
  font-size: 10px;
}

.menu-price-grid .setting-input,
.menu-discount-grid .setting-input,
.menu-price-accent .setting-input {
  height: 32px;
  font-size: 11px;
}

.menu-discount-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
}

.menu-hint {
  margin: 9px 0 0;
  color: #7e857c;
  font-size: 10px;
}

.menu-price-accent {
  border-color: #edd5b5;
  background: #fff5e8;
}

.menu-price-accent h4 {
  color: #765a36;
}

.menu-price-accent > label {
  max-width: 360px;
}

.online-preview-grid {
  display: grid;
  grid-template-columns: minmax(230px, .8fr) minmax(0, 1.2fr);
  gap: 15px;
}

.online-preview {
  padding: 12px;
  border: 1px solid #d4e8e1;
  border-radius: 5px;
  background: #eef8f4;
}

.online-preview-images {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 9px;
}

.online-preview-images img {
  width: 100%;
  height: 95px;
  border-radius: 4px;
  object-fit: cover;
}

.online-preview > span {
  color: #6d7a73;
  font-size: 10px;
}

.online-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 9px 14px;
}

.online-setting-row {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) minmax(80px, 1.2fr);
  align-items: center;
  gap: 8px;
  color: #5f675f;
  font-size: 10px;
}

.online-setting-row .setting-input {
  height: 34px;
}

.online-description {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  color: #5f675f;
  font-size: 10px;
}

.online-description textarea {
  resize: vertical;
}

.allergen-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.allergen-option {
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid #e1e6e0;
  border-radius: 5px;
  background: #fff;
  color: #4f584f;
  font-size: 11px;
}

.allergen-option input {
  accent-color: #3489cf;
}

.menu-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.menu-editor-footer > span {
  color: #878d84;
  font-size: 10px;
}

.menu-editor-footer > div {
  display: flex;
  gap: 7px;
}

.product-tile {
  min-height: 84px;
  align-items: center;
  flex-direction: row;
  gap: 9px;
  padding: 8px;
}

.product-thumbnail {
  display: block;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  border-radius: 6px;
  background: #f0f1eb;
  object-fit: cover;
}

.product-thumbnail-icon {
  display: grid;
  flex: 0 0 58px;
  place-items: center;
  color: #478363;
  font-size: 23px;
}

.product-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  align-self: stretch;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 0;
}

.product-name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.payment-icon .bi,
.toolbar-button .bi,
.soft-button .bi,
.admin-kpi .bi,
.admin-panel h3 .bi,
.store-symbol .bi {
  line-height: 1;
}

@media (max-width: 620px) {
  .topbar-content {
    gap: 8px;
  }

  .product-tile {
    min-height: 78px;
    gap: 6px;
    padding: 6px;
  }

  .product-thumbnail,
  .product-thumbnail-icon {
    flex-basis: 46px;
    width: 46px;
    height: 46px;
  }

  .product-thumbnail-icon {
    font-size: 20px;
  }

  .product-name {
    font-size: 11px;
  }

  .product-desc {
    font-size: 9px;
  }

  .admin-catalog-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .admin-catalog-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .menu-editor-body {
    padding: 12px;
  }

  .menu-editor-panel {
    min-height: 280px;
    max-height: 55vh;
    padding: 10px;
  }

  .menu-editor-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .menu-editor-toolbar > div:last-child {
    width: 100%;
  }

  .menu-editor-toolbar .setting-input {
    min-width: 0;
    flex: 1;
  }

  .menu-price-grid,
  .menu-discount-grid,
  .allergen-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .online-preview-grid,
  .online-settings {
    grid-template-columns: 1fr;
  }

  .menu-editor-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .cashier-form-grid {
    grid-template-columns: 1fr;
  }

  .cashier-function-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 621px) and (max-width: 1050px) {
  .admin-catalog-grid {
    grid-template-columns: repeat(2, minmax(210px, 1fr));
  }
}

/* Roomier cashier home and ordering workspace */
.pos-screen {
  width: min(1680px, 100%);
  padding: 28px clamp(24px, 3vw, 52px) 40px;
}

.pos-toolbar {
  min-height: 68px;
  margin-bottom: 22px;
}

.toolbar-title strong {
  font-size: 22px;
}

.pos-layout {
  min-height: min(820px, calc(100vh - 160px));
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  gap: 24px;
}

.ticket-panel,
.pos-main {
  border-radius: 12px;
}

.ticket-head {
  position: relative;
  isolation: isolate;
  padding: 27px 17px 14px;
  border: 1px solid #deded6;
  border-bottom: 1px solid #e8e7e0;
  background:
    repeating-linear-gradient(0deg, transparent 0 9px, rgba(98, 103, 94, .035) 10px, transparent 11px 20px),
    linear-gradient(180deg, #eeede6 0%, #e7e6de 100%);
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 4px rgba(36, 39, 34, .06);
}

.ticket-head::after {
  position: absolute;
  z-index: -1;
  inset: 9px 8px 0;
  border: 1px solid #deded6;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #fff 0%, #fbfaf5 100%);
  box-shadow: inset 0 1px 0 #fff, 0 -1px 3px rgba(36, 39, 34, .06);
  content: "";
}

.ticket-head::before {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 50%;
  width: min(72%, 220px);
  height: 21px;
  transform: translateX(-50%);
  border: 2px solid #9b9e99;
  border-radius: 4px;
  background:
    linear-gradient(180deg, transparent 0 76%, #f28b16 77% 84%, transparent 85%),
    linear-gradient(180deg, #fff 0%, #d9dbd6 27%, #aeb2ad 52%, #f8f8f5 68%, #c5c8c2 100%);
  box-shadow: 0 2px 3px rgba(36, 39, 34, .18), inset 0 1px 0 #fff, 0 0 0 1px rgba(255, 255, 255, .8);
  content: "";
}

.ticket-head > * {
  position: relative;
  z-index: 1;
}

.ticket-head h2 {
  font-size: 19px;
}

.ticket-headline,
.ticket-meta {
  color: var(--ink);
}

.ticket-meta {
  gap: 8px 14px;
  margin-top: 12px;
  font-size: 12px;
}

.ticket-meta strong,
.ticket-number {
  color: var(--ink);
}

.order-list {
  padding: 12px 18px;
}

.order-row {
  gap: 10px;
  padding: 15px 3px;
}

.order-name {
  font-size: 13px;
}

.order-sub {
  font-size: 11px;
  line-height: 1.5;
}

.order-controls {
  gap: 8px;
}

.qty-button {
  width: 30px;
  height: 30px;
}

.ticket-bottom {
  position: relative;
  isolation: isolate;
  padding: 16px 19px 19px;
  border-top: 1px solid #e8e7e0;
  background:
    repeating-linear-gradient(0deg, transparent 0 9px, rgba(98, 103, 94, .035) 10px, transparent 11px 20px),
    linear-gradient(180deg, #eeede6 0%, #e7e6de 100%);
  box-shadow: inset 0 -2px 4px rgba(36, 39, 34, .06);
}

.ticket-bottom::before {
  position: absolute;
  z-index: -1;
  inset: 0 8px 8px;
  border: 1px solid #deded6;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(180deg, #fbfaf5 0%, #fff 100%);
  box-shadow: inset 0 -1px 0 #fff, 0 1px 3px rgba(36, 39, 34, .06);
  content: "";
}

.ticket-bottom > * {
  position: relative;
  z-index: 1;
}

.ticket-actions {
  gap: 8px;
  margin-top: 15px;
}

.ticket-actions .soft-button {
  min-height: 42px;
  font-size: 11px;
}

.stage-content {
  padding: 25px;
}

.stage-header {
  margin-bottom: 21px;
}

.stage-header h2 {
  font-size: 20px;
}

.stage-header p {
  margin-top: 6px;
  font-size: 12px;
}

.floor-tabs {
  gap: 7px;
  padding: 5px;
}

.floor-tab {
  min-width: 66px;
  height: 38px;
}

.table-grid {
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 14px;
}

.table-tile {
  min-height: 120px;
  padding: 16px 15px;
  border-radius: 10px;
}

.table-name {
  font-size: 21px;
}

.table-seats {
  font-size: 12px;
}

.table-assigned-employee {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-status {
  font-size: 11px;
}

.table-summary {
  gap: 20px;
  margin-top: 23px;
  padding-top: 17px;
  font-size: 12px;
}

.ordering-layout {
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 17px;
}

.category-list {
  gap: 8px;
}

.category-button {
  min-height: 48px;
  padding: 10px 12px;
  font-size: 13px;
}

.product-tools {
  gap: 10px;
  margin-bottom: 14px;
}

.product-search {
  width: min(340px, 65%);
  height: 42px;
  font-size: 13px;
}

.product-grid {
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 14px;
  padding: 4px;
}

.product-grid.subcategory-grid {
  display: grid;
  align-content: start;
}

.subcategory-tile {
  display: flex;
  min-height: 96px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  padding: 15px;
  border: 1px solid #d9e4dc;
  border-radius: 6px;
  background: #f5f8f5;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.subcategory-tile:hover { border-color: #9dc4ad; background: #edf5ef; }
.subcategory-tile strong { font-size: 13px; }
.subcategory-tile small { color: #65736a; font-size: 11px; }

.product-tile {
  min-height: 116px;
  gap: 11px;
  padding: 14px;
  border-radius: 9px;
}

.product-thumbnail,
.product-thumbnail-icon {
  flex-basis: 64px;
  width: 64px;
  height: 64px;
}

.product-name {
  font-size: 13px;
}

.product-desc {
  font-size: 11px;
}

.product-price {
  font-size: 15px;
}

.order-tools {
  gap: 9px;
  padding: 15px 19px;
}

.order-tools .soft-button {
  min-height: 40px;
  padding: 0 13px;
  font-size: 12px;
}

@media (max-width: 1000px) {
  .pos-screen {
    padding: 22px 24px 30px;
  }

  .pos-layout {
    grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
    gap: 16px;
  }

  .table-grid {
    grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
    gap: 11px;
  }

  .table-tile {
    min-height: 108px;
  }

  .ordering-layout {
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 12px;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
  }
}

@media (max-width: 720px) {
  .pos-screen {
    padding: 16px 14px 24px;
  }

  .pos-layout {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 14px;
  }

  .stage-content {
    padding: 18px;
  }

  .table-grid {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 10px;
  }

  .table-tile {
    min-height: 100px;
    padding: 12px;
  }

  .table-summary {
    gap: 10px 16px;
  }

  .ordering-layout {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 9px;
  }

  .category-button {
    min-height: 43px;
    padding: 8px;
    font-size: 11px;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 9px;
  }

  .product-tile {
    min-height: 98px;
    gap: 8px;
    padding: 10px;
  }

  .product-thumbnail,
  .product-thumbnail-icon {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
  }
}

/* Compact, viewport-responsive cashier and table workspace */
.pos-screen {
  width: 100%;
  max-width: 1680px;
  min-width: 0;
  padding: clamp(10px, 2vw, 24px) clamp(10px, 3vw, 40px) 24px;
}

.pos-toolbar {
  min-width: 0;
  min-height: 48px;
  margin-bottom: clamp(8px, 1.5vh, 16px);
}

.pos-layout {
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(220px, min(30vw, 310px)) minmax(0, 1fr);
  gap: clamp(10px, 1.5vw, 20px);
}

.ticket-panel,
.pos-main {
  min-width: 0;
  min-height: 0;
}

.ticket-panel { min-height: clamp(340px, calc(100dvh - 190px), 680px); }
.pos-main { min-height: clamp(360px, calc(100dvh - 190px), 680px); }
.stage-content { padding: clamp(10px, 2vw, 22px); }
.stage-content.ordering-stage { display: flex; max-height: calc(100dvh - 190px); min-height: 0; flex-direction: column; overflow: hidden; }
.ordering-stage .ordering-layout { flex: 1; min-height: 0; overflow: hidden; }
.ordering-stage .category-list,
.ordering-stage .product-area { min-height: 0; }
.ordering-stage .product-grid { min-height: 0; }
.stage-header { flex-wrap: wrap; gap: 8px 12px; margin-bottom: clamp(10px, 1.8vh, 18px); }
.floor-tabs { max-width: 100%; flex-wrap: wrap; }
.floor-tab { min-width: 0; height: clamp(30px, 4vh, 36px); padding: 0 clamp(8px, 1vw, 12px); }
.table-grid { grid-template-columns: repeat(auto-fit, minmax(clamp(68px, 10vw, 112px), 1fr)); gap: clamp(6px, .9vw, 11px); }
.table-tile { min-width: 0; min-height: clamp(56px, 9vh, 88px); gap: 5px; padding: clamp(7px, .9vw, 12px); }
.table-name { font-size: clamp(14px, 1.55vw, 19px); }
.table-seats { font-size: clamp(9px, .9vw, 11px); }
.table-status { font-size: clamp(9px, .85vw, 10px); }
.table-summary { gap: 7px 14px; margin-top: clamp(10px, 1.5vh, 16px); padding-top: 10px; }

@media (max-width: 900px) {
  .pos-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .pos-main { order: 1; min-height: 0; }
  .ticket-panel { order: 2; min-height: 0; }
  .table-grid { grid-template-columns: repeat(auto-fit, minmax(clamp(72px, 15vw, 112px), 1fr)); }
  .table-tile { min-height: clamp(58px, 9vw, 78px); }
}

@media (max-width: 480px) {
  .pos-screen { padding: 8px 8px 16px; }
  .pos-toolbar { gap: 7px; }
  .toolbar-actions { max-width: 100%; }
  .stage-content { padding: 10px; }
  .stage-header h2 { font-size: 17px; }
  .table-grid { grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: 6px; }
  .table-tile { min-height: 58px; padding: 7px 6px; }
  .table-summary { font-size: 10px; }
}

@media (max-height: 620px) and (min-width: 901px) {
  .ticket-panel,
  .pos-main { min-height: 0; }
  .pos-layout { align-items: start; }
  .ticket-panel { max-height: calc(100dvh - 130px); }
  .order-list { min-height: 60px; }
  .ticket-bottom { padding: 10px 12px; }
  .ticket-actions { gap: 5px; margin-top: 8px; }
  .ticket-actions .soft-button { min-height: 32px; }
}

.pos-layout.manager-layout {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
}

.login-help-lookup { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 7px; margin-bottom: 16px; }
.login-help-lookup label { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.login-help-contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.login-help-channel { display: grid; align-content: start; justify-items: center; gap: 10px; min-width: 0; padding: 14px; border: 1px solid #d7e4ec; border-radius: 7px; background: #f6fbff; }
.login-help-channel.wechat { border-color: #d5e8dc; background: #f5fbf6; }
.login-help-channel h3 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 15px; }
.login-help-channel > h3 > i { color: #2187c7; }
.login-help-channel.wechat > h3 > i { color: #179b59; }
.login-help-contact-link { display: inline-flex; align-items: center; gap: 7px; color: #176d9f; font-size: 13px; font-weight: 650; text-decoration: none; }
.login-help-contact-link:hover { text-decoration: underline; }
.login-help-wechat-id { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.login-help-wechat-id code { color: #23653e; font-size: 13px; }
.login-help-unconfigured, .login-help-empty { color: var(--muted); font-size: 12px; }
.login-help-qr { display: grid; grid-template-rows: minmax(0, 1fr); width: min(190px, 100%); height: 190px; min-height: 0; place-items: center; overflow: hidden; border: 1px solid #e0e6e0; border-radius: 5px; background: #fff; color: var(--muted); font-size: 11px; }
.login-help-qr img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }

@media (max-width: 520px) {
  .login-help-contact-grid { grid-template-columns: 1fr; }
}

.pos-layout.manager-layout > .ticket-panel {
  display: none;
}

.pos-layout.manager-layout > .pos-main {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}

.gift-voucher-camera { display: block; width: min(100%, 480px); min-height: 180px; max-height: 42vh; margin: 12px auto; border: 1px solid #dfe5dc; border-radius: 10px; background: #151a16; object-fit: cover; }
.gift-voucher-scan-status { min-height: 22px; color: #68736a; font-size: 12px; }
.gift-voucher-scan-button { margin-bottom: 12px; }
#qr-order-alerts{position:fixed;right:18px;top:86px;width:min(350px,calc(100vw - 36px));max-height:65vh;overflow:auto;z-index:10050;display:grid;gap:10px}.qr-order-alert{padding:18px;background:#fff;border:2px solid #20836a;border-radius:14px;box-shadow:0 10px 30px #123b2530;color:#17382f}.qr-order-alert p{margin:10px 0}.qr-order-alert button{padding:7px 14px;border:1px solid #c9d9cd;border-radius:8px;background:#edf5ee;color:#17382f}.music-player{flex-wrap:wrap}.music-player select{font-size:12px;border:1px solid #c9d9cd;border-radius:7px;background:#fff;padding:5px}

.cashier-version { flex: 0 0 auto; white-space: nowrap; font: 600 11px system-ui; color: #61756a; padding: 4px 8px; border: 1px solid #d2ded5; border-radius: 6px; background: #f4f8f5; }
