:root {
  color-scheme: light;
  --ink: #241c0f;
  --muted: #74684d;
  --line: #ead68d;
  --paper: #fff8df;
  --panel: #ffffff;
  --accent: #f6c52f;
  --accent-strong: #bb8500;
  --accent-dark: #b98200;
  --accent-soft: #ffec9a;
  --accent-pale: #fff6d6;
  --warn: #b45309;
  --warn-soft: #fff7d6;
  --shadow: 0 18px 46px rgba(142, 99, 0, 0.13);
  --soft-shadow: 0 8px 24px rgba(142, 99, 0, 0.1);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 248, 223, 0.82) 260px),
    var(--paper);
  color: var(--ink);
}

.owner-home-panel {
  margin-bottom: 18px;
}

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

.owner-portal-card {
  align-items: center;
  background: linear-gradient(135deg, #fffdf4, #fff4c8);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  display: grid;
  gap: 14px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 20px;
  text-align: left;
}

.owner-portal-card:hover,
.owner-portal-card:focus-visible {
  border-color: var(--accent-strong);
  box-shadow: var(--soft-shadow);
  transform: translateY(-2px);
}

.owner-portal-card strong,
.owner-portal-card small,
.owner-portal-card b {
  display: block;
}

.owner-portal-card small {
  color: var(--muted);
  margin-top: 5px;
}

.owner-portal-card b {
  color: var(--accent-strong);
  white-space: nowrap;
}

.owner-portal-icon {
  align-items: center;
  background: var(--accent);
  border-radius: 12px;
  display: inline-flex;
  font-size: 24px;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.online-order-filters {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(140px, 1fr));
  margin: 0 0 16px;
}

@media (max-width: 760px) {
  .owner-portal-grid,
  .online-order-filters {
    grid-template-columns: 1fr;
  }
}

body.menu-open {
  overflow: hidden;
}

body.customer-service-mode .admin-toolbar,
body.customer-service-mode .admin-global-filter {
  display: none !important;
}

[hidden] {
  display: none !important;
}

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

button {
  cursor: pointer;
}

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

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

.login-card {
  display: grid;
  gap: 16px;
  max-width: 460px;
  padding: 24px;
  width: 100%;
}

.login-brand {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: 86px minmax(0, 1fr);
}

.login-brand img {
  aspect-ratio: 1;
  border-radius: 999px;
  height: 86px;
  object-fit: contain;
  width: 86px;
}

.login-card h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: 0;
  line-height: 1.05;
}

.login-brand span {
  color: var(--muted);
  display: block;
  font-size: 14px;
  font-weight: 750;
  margin-top: 4px;
}

.demo-users {
  display: grid;
  gap: 5px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  padding-top: 14px;
}

.demo-users strong {
  color: var(--ink);
}

.login-status {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.login-error {
  color: #b91c1c;
  font-weight: 750;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(16px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
  background: #fffaf5;
  position: sticky;
  top: 0;
  z-index: 4;
  box-shadow: 0 8px 24px rgba(124, 45, 18, 0.08);
}

.app-header h1,
.panel h2,
.dialog-card h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

.app-header h1 {
  font-size: clamp(26px, 3vw, 38px);
}

.panel h2,
.dialog-card h2 {
  font-size: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-actions,
.order-actions,
.product-actions,
.line-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-actions {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: flex-end;
}

.danger-button {
  border-color: #ffd4d4 !important;
  color: #b42318 !important;
}

.danger-button:hover {
  background: #fff2f2 !important;
}

.header-actions select {
  min-width: 170px;
}

.sales-mode .manager-only,
.sales-mode .advanced-field {
  display: none !important;
}

.sales-mode .app-header h1 {
  font-size: clamp(24px, 7vw, 34px);
}

.sales-mode .workspace {
  grid-template-columns: minmax(300px, 1fr) minmax(340px, 0.9fr) minmax(280px, 0.75fr);
}

.sales-mode .catalog-panel,
.sales-mode .order-panel,
.sales-mode .history-panel {
  padding: 16px;
}

.sales-mode .history-panel .stats-grid {
  display: none;
}

.sales-mode .totals div:nth-child(2) {
  display: none;
}

.sales-mode .product-photo {
  display: flex;
}

.sales-mode .product-card,
.sales-mode .history-card,
.sales-mode .cart-line {
  border-radius: 10px;
}

.sales-mode .primary-button,
.sales-mode .ghost-button {
  border-radius: 10px;
}

.sales-mode #saveOrderButton {
  min-height: 54px;
  font-size: 17px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 1.2fr) minmax(280px, 0.9fr);
  gap: 18px;
  padding: 18px clamp(16px, 3vw, 36px) 34px;
}

.panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.catalog-panel,
.order-panel,
.history-panel,
.admin-panel {
  padding: 20px;
}

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

.catalog-panel .panel-heading {
  align-items: center;
}

.primary-button,
.ghost-button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 12px;
  min-height: 46px;
  padding: 0 18px;
  font-weight: 750;
}

.primary-button {
  background: linear-gradient(180deg, #ffd958 0%, var(--accent) 100%);
  color: #241c0f;
  box-shadow: 0 10px 22px rgba(242, 194, 48, 0.27);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.ghost-button {
  background: #fffdf7;
  border-color: var(--line);
  color: var(--ink);
}

.ghost-button:hover,
.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-pale);
}

.icon-button {
  width: 42px;
  flex: 0 0 42px;
  padding: 0;
  background: #fff;
  border-color: var(--line);
  font-size: 22px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.shared-commerce-sync-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 5px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef5ec;
  color: #255c42 !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  line-height: 1.2;
}

.shared-commerce-sync-failed {
  background: #fff0ec;
  color: #a63825 !important;
}

.shared-commerce-sync-skipped,
.shared-commerce-sync-not_required {
  background: #f4f1e8;
  color: #766b55 !important;
}

.search-row {
  margin-bottom: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

select {
  appearance: auto;
  min-height: 46px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(242, 194, 48, 0.2);
}

.catalog-list,
.history-list,
.cart-list {
  display: grid;
  gap: 10px;
}

.product-card,
.history-card,
.cart-line {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.product-card {
  display: grid;
  gap: 12px;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.product-card:hover {
  box-shadow: 0 12px 26px rgba(124, 45, 18, 0.12);
  transform: translateY(-1px);
}

.product-photo,
.product-photo-large {
  align-items: center;
  background: #fff3e4;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 750;
  justify-content: center;
  overflow: hidden;
}

.product-photo {
  aspect-ratio: 16 / 8.5;
}

.product-photo-large {
  aspect-ratio: 16 / 10;
}

.product-photo img,
.product-photo-large img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.product-top,
.history-top,
.cart-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.product-card h3,
.history-card h3 {
  margin: 0;
  font-size: 16px;
}

.product-card p,
.history-card p,
.empty-state {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.price {
  color: var(--accent-strong);
  font-weight: 850;
  white-space: nowrap;
}

.stock-warning {
  color: var(--warn) !important;
  font-weight: 800;
}

.tag {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}

.product-actions button,
.line-actions button {
  min-height: 36px;
  padding: 0 12px;
}

.customer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.customer-phone-field {
  display: grid;
  grid-template-columns: minmax(118px, 0.7fr) minmax(0, 1.3fr);
  gap: 8px;
}

.customer-phone-field select,
.customer-phone-field input {
  min-width: 0;
  width: 100%;
}

.sales-user-field {
  border: 0;
  display: grid;
  gap: 8px;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.sales-user-field legend {
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  margin-bottom: 7px;
  padding: 0;
}

.sales-user-checklist {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 176px;
  overflow-y: auto;
}

.sales-user-option {
  align-items: center;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
}

.sales-user-option:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.sales-user-option input {
  accent-color: var(--accent-strong);
  flex: 0 0 auto;
  height: 18px;
  margin: 0;
  width: 18px;
}

.sales-user-option span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.sales-user-split-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin: 0;
}

.sales-user-split-hint[data-split="true"] {
  color: var(--accent-dark);
}

@media (max-width: 640px) {
  .sales-user-checklist { grid-template-columns: 1fr; }
}

label {
  color: var(--ink);
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 750;
}

label span {
  color: var(--muted);
  font-weight: 600;
}

.full {
  grid-column: 1 / -1;
}

.payment-select-field select {
  font-size: 16px;
  font-weight: 800;
}

.payment-choice-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: -4px;
}

.payment-choice {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 8px;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  min-height: 48px;
  padding: 0 8px;
}

.payment-choice input {
  accent-color: var(--accent-deep);
  height: 17px;
  margin: 0;
  padding: 0;
  width: 17px;
}

.payment-choice-active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 10px 22px rgba(242, 194, 48, 0.25);
  color: #1f1a0d;
}

.payment-split-editor {
  background: #fffaf0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.payment-split-heading {
  align-items: baseline;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.payment-split-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.payment-split-grid label {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) minmax(100px, 1fr);
}

.payment-split-grid label span {
  font-size: 13px;
  font-weight: 800;
}

.payment-split-grid input {
  min-width: 0;
}

.payment-split-total {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  justify-content: flex-end !important;
}

.payment-split-total[data-complete="true"] {
  color: #187b3a;
}

.customer-insight {
  align-items: center;
  background: #fff8df;
  border: 1px solid #f0d681;
  border-radius: 10px;
  color: var(--ink);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
}

.customer-insight strong,
.customer-insight span {
  display: block;
}

.customer-insight strong {
  font-size: 14px;
}

.customer-insight span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.cart-line {
  align-items: center;
}

.line-main {
  min-width: 0;
}

.line-main strong {
  display: block;
}

.quantity-control {
  display: inline-grid;
  grid-template-columns: 34px 42px 34px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.quantity-control button {
  min-height: 34px;
  border: 0;
  background: var(--accent-pale);
  font-weight: 850;
}

.quantity-control span {
  text-align: center;
  font-weight: 800;
}

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

.totals div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

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

.grand-total {
  font-size: 21px;
  color: var(--ink) !important;
}

.order-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.printer-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}

#printerStatus {
  background: var(--warn-soft);
  border-radius: 999px;
  color: var(--warn);
  font-size: 13px;
  font-weight: 750;
  min-height: 30px;
  padding: 6px 12px;
}

#printerStatus.connected {
  background: #dcfce7;
  color: #166534;
}

.logo-preview {
  align-items: center;
  background: #fffaf5;
  border: 1px dashed var(--line);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  min-height: 110px;
  padding: 12px;
}

.logo-preview img {
  max-height: 96px;
  max-width: 180px;
  object-fit: contain;
}

.pos-header {
  align-items: center;
  background:
    radial-gradient(circle at 58% -90%, rgba(255, 255, 255, 0.7) 0 34%, transparent 35%),
    linear-gradient(180deg, #ffdc5d 0%, #f4bd22 100%);
  box-shadow: 0 10px 28px rgba(155, 106, 0, 0.22);
  color: var(--ink);
  display: grid;
  grid-template-columns: 56px 1fr auto;
  min-height: 68px;
  padding: 0 8px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.pos-icon-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  border-radius: 14px;
  color: var(--ink);
  display: flex;
  font-size: 28px;
  height: 48px;
  justify-content: center;
  padding: 0;
  width: 48px;
}

.pos-header-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.language-toggle {
  align-items: center;
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(185, 133, 0, 0.18);
  border-radius: 999px;
  color: rgba(36, 28, 15, 0.58);
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  gap: 6px;
  min-height: 38px;
  padding: 0 10px;
  white-space: nowrap;
}

.language-toggle-button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: rgba(36, 28, 15, 0.58);
  font-size: inherit;
  font-weight: inherit;
  min-height: 28px;
  padding: 0 4px;
}

.language-toggle-button-active {
  color: var(--ink);
}

.ticket-title {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: center;
  min-width: 0;
}

.ticket-title strong {
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.ticket-title span {
  align-items: center;
  background: #fff;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(122, 86, 0, 0.16);
  color: var(--accent-strong);
  display: inline-flex;
  font-size: 18px;
  font-weight: 850;
  height: 34px;
  justify-content: center;
  min-width: 34px;
  padding: 0 8px;
}

.pos-workspace {
  margin: 0 auto;
  max-width: 820px;
  min-height: calc(100vh - 64px);
  padding: 22px 18px 36px;
}

.pos-event-strip {
  align-items: end;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--soft-shadow);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(150px, 0.45fr) minmax(240px, 1fr) auto;
  margin-bottom: 16px;
  padding: 14px 16px;
}

.pos-event-strip label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 850;
  gap: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pos-event-strip select {
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 750;
  min-height: 48px;
  min-width: 0;
  padding: 0 12px;
}

.pos-event-strip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  max-width: 220px;
  overflow: hidden;
  padding-bottom: 13px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.charge-button {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, transparent 38%),
    linear-gradient(180deg, #ffd84c 0%, #f0b414 100%);
  border: 0;
  border-radius: 20px;
  box-shadow: 0 16px 34px rgba(184, 126, 0, 0.22);
  color: #fff8df;
  display: block;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.35;
  min-height: 96px;
  padding: 18px;
  text-align: center;
  text-transform: uppercase;
  width: 100%;
}

.charge-button span {
  color: #fff;
  font-size: 22px;
}

.charge-button:active,
.pos-product-card:active {
  transform: scale(0.99);
}

.catalog-panel {
  border-radius: 18px;
  box-shadow: var(--soft-shadow);
  margin-top: 22px;
  overflow: hidden;
  padding: 0;
}

.catalog-toolbar {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, 38%);
}

.catalog-toolbar select,
.catalog-toolbar input {
  border: 0;
  border-radius: 0;
  min-height: 64px;
}

.catalog-toolbar select {
  border-right: 1px solid var(--line);
  font-size: 19px;
}

.catalog-toolbar input {
  font-size: 17px;
}

.catalog-toolbar input:focus,
.catalog-toolbar select:focus {
  box-shadow: inset 0 -3px 0 var(--accent);
}

.category-tabs {
  background: #fffaf0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 800;
  min-height: 36px;
  padding: 0 14px;
}

.category-tab-active {
  background: linear-gradient(180deg, #ffdc62 0%, var(--accent) 100%);
  border-color: var(--accent);
  color: #1f1a10;
  box-shadow: 0 8px 18px rgba(202, 146, 0, 0.18);
}

.catalog-list {
  background: linear-gradient(180deg, rgba(255, 252, 241, 0.85), rgba(255, 250, 235, 0.52));
  gap: 0;
  padding: 12px;
}

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

.pos-product-lane {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 218, 72, 0.12), transparent 44%),
    rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(231, 195, 93, 0.78);
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(123, 86, 0, 0.055);
  display: grid;
  gap: 8px;
  overflow: hidden;
}

.pos-product-lane-head {
  align-items: center;
  background: linear-gradient(180deg, rgba(255, 247, 214, 0.96), rgba(255, 252, 243, 0.88));
  border-bottom: 1px solid rgba(231, 195, 93, 0.66);
  display: flex;
  justify-content: space-between;
  min-height: 62px;
  padding: 12px 14px;
}

.pos-product-lane-head span {
  color: #9a760f;
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pos-product-lane-head strong {
  color: #241a10;
  display: block;
  font-size: 18px;
  line-height: 1.15;
  margin-top: 2px;
}

.pos-product-lane-head b {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(230, 195, 91, 0.78);
  border-radius: 999px;
  color: #b37a00;
  display: inline-flex;
  font-size: 14px;
  font-weight: 950;
  justify-content: center;
  min-height: 34px;
  min-width: 34px;
  padding: 0 10px;
}

.pos-product-lane-list {
  display: grid;
  gap: 0;
}

.pos-product-card {
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  cursor: pointer;
  display: grid;
  gap: 14px;
  grid-template-columns: 62px minmax(0, 1fr);
  min-height: 82px;
  padding: 12px 20px 12px 14px;
}

.pos-product-card:hover {
  background: #fffaf0;
  box-shadow: inset 4px 0 0 var(--accent);
  transform: none;
}

.pos-product-card .product-photo {
  aspect-ratio: 1;
  background: #f6efd9;
  border: 0;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(187, 133, 0, 0.08);
  display: flex !important;
  height: 52px;
  position: relative;
  width: 52px;
}

.pos-product-card .product-photo img {
  object-fit: cover;
}

.pos-product-card .product-top {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.pos-product-card h3 {
  font-size: 20px;
  font-weight: 760;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-product-composition {
  color: #786d58;
  display: block !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  margin: 4px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-product-meta {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-top: 5px;
}

.pos-product-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.product-qty-badge {
  align-items: center;
  background: var(--accent);
  border: 2px solid #fff;
  border-radius: 999px;
  bottom: -2px;
  color: #1f1a10;
  display: flex;
  font-size: 13px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  min-width: 24px;
  padding: 0 6px;
  position: absolute;
  right: -4px;
}

.pos-product-card p,
.pos-product-card .tag,
.pos-product-actions .primary-button {
  display: none;
}

.pos-product-card .pos-product-composition {
  display: block;
}

.pos-product-card .price {
  color: #3d2f14;
  font-size: 20px;
  font-weight: 820;
}

.pos-product-actions {
  justify-content: flex-end;
}

.pos-product-actions .ghost-button {
  min-height: 34px;
  padding: 0 10px;
}

.pos-product-actions .compact-button {
  min-width: 56px;
}

.pos-product-actions .danger-button {
  color: #a23b12;
}

.pos-product-lane .pos-product-card {
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(233, 201, 111, 0.58);
  min-height: 88px;
  padding: 12px 14px;
}

.pos-product-lane .pos-product-card:last-child {
  border-bottom: 0;
}

.pos-product-lane .pos-product-card:hover {
  background: #fff9e8;
  box-shadow: inset 4px 0 0 var(--accent);
}

.pos-product-lane .pos-product-actions {
  grid-column: 2;
  justify-content: flex-start;
}

.product-card.sold-out {
  opacity: 0.5;
}

.menu-backdrop {
  background: rgba(34, 29, 18, 0.42);
  backdrop-filter: blur(2px);
  inset: 0;
  position: fixed;
  z-index: 20;
}

.side-menu {
  background: #fffdfa;
  box-sizing: border-box;
  box-shadow: 12px 0 32px rgba(34, 29, 18, 0.22);
  display: grid;
  grid-auto-rows: max-content;
  height: 100vh;
  left: 0;
  max-width: min(88vw, 380px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  position: fixed;
  top: 0;
  width: 360px;
  z-index: 30;
}

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

.side-menu > * {
  max-width: 100%;
  min-width: 0;
}

.side-menu-brand {
  background:
    radial-gradient(circle at 88% -18%, rgba(255, 255, 255, 0.35) 0 40%, transparent 41%),
    linear-gradient(135deg, #ffdf63 0%, #e8ad17 100%);
  color: #fffaf0;
  display: grid;
  gap: 7px;
  min-height: 132px;
  padding: 28px 22px 22px;
  position: relative;
}

.side-menu-brand strong {
  font-size: 18px;
  line-height: 1.2;
}

.side-menu-brand span {
  font-size: 17px;
  line-height: 1.2;
}

.menu-close-button {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 20px;
  height: 34px;
  position: absolute;
  right: 10px;
  top: 10px;
  width: 34px;
}

.menu-nav {
  display: grid;
  gap: 2px;
  padding: 16px 10px 14px;
}

.menu-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 14px;
  color: var(--ink);
  display: grid;
  font-size: 17px;
  font-weight: 750;
  gap: 18px;
  grid-template-columns: 40px minmax(0, 1fr);
  min-height: 56px;
  padding: 0 14px;
  text-align: left;
  width: 100%;
}

.menu-sales-panel input,
.menu-settings-panel input,
.menu-settings-panel select {
  min-width: 0;
  width: 100%;
}

.menu-item:hover,
.menu-item-active {
  background: #fff4c7;
  color: var(--accent-strong);
}

.menu-item-active {
  box-shadow: inset 4px 0 0 var(--accent);
}

.menu-item-muted {
  color: #8a8170;
  opacity: 0.72;
}

.menu-icon {
  color: #777;
  display: inline-grid;
  height: 28px;
  place-items: center;
  position: relative;
  width: 28px;
}

.menu-item-active .menu-icon {
  color: var(--accent-strong);
}

.icon-sales::before {
  border: 3px solid currentColor;
  border-radius: 3px;
  content: "";
  height: 15px;
  width: 18px;
}

.icon-sales::after {
  border: 3px solid currentColor;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  content: "";
  height: 8px;
  left: 8px;
  position: absolute;
  top: 2px;
  width: 10px;
}

.icon-receipts::before {
  border: 3px solid currentColor;
  content: "";
  height: 22px;
  width: 18px;
}

.icon-receipts::after {
  box-shadow:
    0 0 0 1px currentColor,
    0 6px 0 1px currentColor,
    0 12px 0 1px currentColor;
  content: "";
  height: 0;
  position: absolute;
  width: 12px;
}

.icon-crm::before {
  border: 3px solid currentColor;
  border-radius: 999px;
  content: "";
  height: 10px;
  position: absolute;
  top: 2px;
  width: 10px;
}

.icon-crm::after {
  border: 3px solid currentColor;
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  content: "";
  height: 12px;
  position: absolute;
  top: 14px;
  width: 22px;
}

.icon-items::before {
  box-shadow:
    0 0 0 2px currentColor,
    0 8px 0 2px currentColor,
    0 16px 0 2px currentColor;
  content: "";
  height: 0;
  left: 9px;
  position: absolute;
  width: 17px;
}

.icon-items::after {
  box-shadow:
    0 0 0 2px currentColor,
    0 8px 0 2px currentColor,
    0 16px 0 2px currentColor;
  content: "";
  height: 0;
  left: 2px;
  position: absolute;
  width: 2px;
}

.icon-reports::before {
  border-bottom: 3px solid currentColor;
  border-left: 3px solid currentColor;
  content: "";
  height: 22px;
  width: 24px;
}

.icon-reports::after {
  background: currentColor;
  box-shadow:
    7px -6px 0 currentColor,
    14px -13px 0 currentColor;
  content: "";
  height: 8px;
  left: 7px;
  position: absolute;
  top: 15px;
  width: 4px;
}

.icon-settings::before {
  border: 5px solid currentColor;
  border-radius: 999px;
  content: "";
  height: 8px;
  width: 8px;
}

.icon-settings::after {
  border-bottom: 4px solid currentColor;
  border-top: 4px solid currentColor;
  content: "";
  height: 20px;
  left: 10px;
  position: absolute;
  top: 4px;
  transform: rotate(45deg);
  width: 8px;
}

.icon-printer::before {
  border: 3px solid currentColor;
  border-radius: 3px;
  content: "";
  height: 14px;
  position: absolute;
  top: 9px;
  width: 22px;
}

.icon-printer::after {
  border: 3px solid currentColor;
  border-bottom: 0;
  content: "";
  height: 9px;
  position: absolute;
  top: 2px;
  width: 15px;
}

.icon-logout::before {
  border: 3px solid currentColor;
  border-radius: 3px;
  content: "";
  height: 20px;
  width: 16px;
}

.icon-logout::after {
  border-right: 3px solid currentColor;
  border-top: 3px solid currentColor;
  content: "";
  height: 9px;
  position: absolute;
  right: 2px;
  top: 8px;
  transform: rotate(45deg);
  width: 9px;
}

.menu-status-line {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 750;
  margin: -8px 22px 8px 70px;
}

.menu-settings-panel,
.menu-manager-tools,
.settings-action-row {
  display: grid;
  gap: 11px;
}

.menu-sales-panel {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 13px;
  min-width: 0;
  overflow: hidden;
  padding: 16px 20px 20px;
}

.menu-sales-panel > *,
.menu-sales-panel label,
.menu-sales-panel input,
.menu-sales-panel button {
  max-width: 100%;
  min-width: 0;
}

.side-menu .sales-date-grid {
  grid-template-columns: 1fr;
}

.side-menu .sales-quick-actions,
.side-menu .sales-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sales-panel-heading {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.sales-panel-heading h2 {
  font-size: 20px;
  margin: 0;
}

.sales-date-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.sales-quick-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
}

.admin-filter-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 0.55fr 0.55fr 0.9fr 1.35fr 0.95fr;
}

.online-filter-grid,
.online-form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.online-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.online-orders-panel {
  display: grid;
  gap: 16px;
}

.fair-online-attribution {
  background: linear-gradient(135deg, #fff8dd 0%, #ffffff 72%);
  border: 1px solid #e5c65d;
  border-radius: 18px;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.fair-online-attribution-heading {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.fair-online-attribution h3 {
  color: var(--ink);
  font-size: 22px;
  margin: 2px 0 5px;
}

.fair-online-attribution-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  margin: 0;
  max-width: 620px;
}

.fair-online-attribution-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.fair-online-attribution-summary article {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #ead798;
  border-radius: 13px;
  display: grid;
  gap: 4px;
  min-height: 84px;
  padding: 13px;
}

.fair-online-attribution-summary span,
.fair-online-attribution-row span,
.fair-online-review-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.fair-online-attribution-summary strong {
  color: var(--accent-dark);
  font-size: 19px;
}

.fair-online-review-card {
  background: #fff4e4 !important;
  border-color: #e3b26c !important;
}

.fair-online-attribution-list {
  border-top: 1px solid #ecd889;
  display: grid;
}

.fair-online-attribution-row {
  align-items: center;
  border-bottom: 1px solid #f0e6bd;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 12px 4px;
}

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

.fair-online-attribution-row strong {
  color: var(--ink);
  font-size: 14px;
}

.fair-online-attribution-row b {
  color: var(--accent-dark);
  flex: 0 0 auto;
  font-size: 15px;
}

.fair-online-attribution-loading,
.fair-online-attribution-error,
.fair-online-attribution-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}

.fair-online-attribution-error { color: #b64a27; }

.fair-compare-panel,
.fair-compare-summary,
.fair-compare-list {
  display: grid;
  gap: 14px;
}

.fair-compare-filter {
  display: grid;
  gap: 5px;
  min-width: 140px;
}

.fair-compare-filter label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.fair-compare-summary { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

.fair-compare-summary article {
  background: #fffdf7;
  border: 1px solid #ead798;
  border-radius: 13px;
  display: grid;
  gap: 5px;
  min-height: 86px;
  padding: 13px;
}

.fair-compare-summary span,
.fair-compare-summary small,
.fair-compare-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.fair-compare-summary strong,
.fair-compare-row b { color: var(--accent-dark); font-size: 18px; }

.fair-compare-onsite { background: #f4f4f1 !important; border-style: dashed !important; }
.fair-compare-list { border-top: 1px solid #eee2b4; }

.fair-compare-row {
  align-items: center;
  border-bottom: 1px solid #f1e9cd;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 12px 4px;
}

.fair-compare-row div { display: grid; gap: 3px; min-width: 0; }
.fair-compare-row strong { color: var(--ink); font-size: 14px; }
.fair-compare-row b { flex: 0 0 auto; font-size: 15px; }
.fair-compare-message { color: var(--muted); font-weight: 700; margin: 0; }
.fair-compare-message-error { color: #b64a27; }

.sales-filter-bar {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 420px) minmax(190px, auto);
  margin-bottom: 14px;
}

.sales-summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

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

.fair-overview-hero {
  align-items: stretch;
  background:
    linear-gradient(135deg, rgba(255, 239, 167, 0.95) 0%, rgba(255, 251, 239, 0.98) 48%, #ffffff 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 0.78fr) minmax(420px, 1.22fr);
  padding: 24px;
  box-shadow: 0 18px 46px rgba(142, 99, 0, 0.1);
}

.fair-overview-hero strong {
  color: var(--ink);
  display: block;
  font-size: clamp(28px, 3.4vw, 48px);
  line-height: 1.05;
}

.fair-overview-hero p {
  color: var(--muted);
  font-weight: 800;
  margin: 10px 0 0;
}

.overview-label {
  color: var(--accent-dark);
  display: block;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

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

.overview-meta-grid span {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(214, 167, 44, 0.45);
  border-radius: 12px;
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 5px;
  padding: 12px;
  min-height: 70px;
}

.overview-meta-grid strong {
  font-size: 16px;
  line-height: 1.15;
}

.owner-reminder-card {
  display: grid;
  gap: 12px;
}

.owner-reminders {
  background: #fff;
  border: 1px solid rgba(214, 167, 44, 0.58);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(202, 146, 0, 0.08);
  display: grid;
  gap: 8px;
  padding: 14px;
}

.owner-reminders h3 {
  color: var(--accent-dark);
  font-size: 13px;
  letter-spacing: 0.08em;
  margin: 0 0 2px;
  text-transform: uppercase;
}

.owner-reminders p {
  align-items: center;
  background: #fff9e9;
  border: 1px solid rgba(214, 167, 44, 0.32);
  border-radius: 10px;
  color: var(--ink);
  display: flex;
  font-size: 14px;
  font-weight: 850;
  gap: 8px;
  margin: 0;
  padding: 9px 10px;
}

.owner-reminders p::before {
  background: var(--accent);
  border-radius: 999px;
  content: "";
  flex: 0 0 8px;
  height: 8px;
  width: 8px;
}

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

.fair-kpi-grid div {
  align-items: center;
  background: #ffffff;
  border-color: rgba(214, 167, 44, 0.58);
  display: grid;
  grid-template-columns: 62px 1fr;
  grid-template-rows: auto auto auto;
  box-shadow: 0 12px 30px rgba(202, 146, 0, 0.08);
  min-height: 118px;
  min-width: 0;
  overflow: hidden;
  padding: 18px;
  position: relative;
}

.report-kpi::before {
  align-items: center;
  align-self: start;
  background: radial-gradient(circle at 30% 20%, #fff8dc 0%, #ffe28a 100%);
  border-radius: 999px;
  color: var(--accent-dark);
  content: "$";
  display: flex;
  font-size: 25px;
  font-weight: 950;
  grid-row: 1 / 4;
  height: 50px;
  justify-content: center;
  width: 50px;
}

.kpi-orders::before {
  content: "▣";
}

.kpi-products::before {
  content: "□";
}

.kpi-commission::before {
  content: "%";
}

.fair-kpi-grid strong {
  font-size: 30px;
  letter-spacing: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.fair-kpi-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.admin-sales-breakdown {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.fair-overview-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.overview-section {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.overview-section-wide {
  grid-column: 1 / -1;
}

.overview-section-heading {
  align-items: end;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.overview-section-heading h3 {
  font-size: 23px;
  margin: 2px 0 0;
}

.daily-sales-list,
.product-overview-list,
.salesperson-overview-list,
.closing-overview-list,
.product-detail-list {
  display: grid;
  gap: 10px;
}

.daily-sales-row,
.product-detail-list article,
.salesperson-row,
.closing-row {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(234, 214, 141, 0.8);
  border-radius: 13px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 0.72fr) minmax(160px, 1fr) auto;
  padding: 13px 14px;
}

.product-detail-list article,
.salesperson-row,
.closing-row {
  grid-template-columns: 1fr auto;
}

.product-detail-list .product-detail-row {
  grid-template-columns: 46px 1fr auto;
}

.product-mini-photo {
  align-items: center;
  background: #fff4d6;
  border-radius: 12px;
  color: var(--muted);
  display: flex;
  font-size: 10px;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  overflow: hidden;
  width: 42px;
}

.product-mini-photo img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.daily-sales-row strong,
.product-detail-list strong,
.salesperson-row strong,
.closing-row strong {
  color: var(--ink);
  font-size: 16px;
}

.daily-sales-row span,
.product-detail-list span,
.salesperson-row span,
.closing-row span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-top: 3px;
}

.daily-sales-bar {
  background: rgba(214, 167, 44, 0.13);
  border-radius: 999px;
  height: 13px;
  overflow: hidden;
}

.daily-sales-bar span {
  background: linear-gradient(90deg, #f4aa00 0%, #ffd74a 100%);
  border-radius: inherit;
  display: block;
  height: 100%;
  margin: 0;
}

.major-product-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.major-product-grid div {
  background: linear-gradient(180deg, #fff7d8 0%, #ffffff 100%);
  border: 1px solid rgba(214, 167, 44, 0.58);
  border-radius: 14px;
  display: grid;
  gap: 6px;
  min-height: 100px;
  padding: 14px;
}

.major-product-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.major-product-grid strong,
.product-detail-list b,
.salesperson-row b,
.closing-row b {
  color: var(--ink);
  font-size: 18px;
}

.major-product-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

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

.payment-overview-list .payment-row {
  min-height: 68px;
  padding-left: 48px;
  position: relative;
}

.payment-overview-list .payment-row::before {
  align-items: center;
  background: #fff2bc;
  border-radius: 12px;
  color: var(--accent-dark);
  content: "$";
  display: flex;
  font-size: 17px;
  font-weight: 950;
  height: 28px;
  justify-content: center;
  left: 12px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
}

.payment-overview-list .payment-card::before {
  content: "▭";
}

.payment-overview-list .payment-ewallet::before {
  content: "▤";
}

.payment-overview-list .payment-bank::before {
  content: "⌂";
}

.payment-overview-list .payment-unpaid::before {
  color: #d3483d;
  content: "!";
}

.closing-row-done {
  background: #f5ffe8;
  border-color: #cfe7a3;
}

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

.closing-row {
  min-height: 82px;
}

.sales-summary-grid div,
.sales-breakdown div {
  background: #fffaf0;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 4px;
  padding: 11px;
}

.sales-summary-grid span,
.sales-breakdown span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sales-summary-grid strong,
.sales-breakdown strong {
  color: var(--ink);
  font-size: 17px;
}

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

.sales-breakdown div {
  align-items: center;
  grid-template-columns: 1fr auto;
}

.sales-target-progress {
  display: grid;
  gap: 10px;
}

.sales-target-card {
  background: linear-gradient(180deg, #fffdf6 0%, #fff8df 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 10px;
  padding: 13px;
}

.sales-target-card-met {
  background: linear-gradient(180deg, #f7ffe9 0%, #ffffff 100%);
  border-color: #cfe7a3;
}

.sales-target-card strong {
  color: var(--ink);
  display: block;
  font-size: 20px;
  line-height: 1.1;
}

.sales-target-card small,
.sales-target-label {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 850;
  margin-top: 4px;
}

.sales-target-label {
  color: var(--accent-dark);
  letter-spacing: 0.08em;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.sales-target-numbers {
  display: grid;
  gap: 6px;
}

.sales-target-numbers span {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 850;
  justify-content: space-between;
}

.sales-target-numbers b {
  color: var(--ink);
  font-size: 14px;
  text-align: right;
}

.sales-target-track {
  background: #fff1b9;
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.sales-target-track i {
  background: linear-gradient(90deg, #f6bd18 0%, #d09300 100%);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.sales-target-card-met .sales-target-track i {
  background: linear-gradient(90deg, #69b84f 0%, #238b45 100%);
}

.sales-target-orders {
  display: grid;
  gap: 8px;
}

.sales-target-allowance {
  border-top: 1px dashed rgba(120, 92, 25, 0.18);
  display: grid;
  gap: 8px;
  margin-top: 2px;
  padding-top: 10px;
}

.sales-target-track-allowance {
  background: #f1e7c5;
}

.sales-target-track-allowance i {
  background: linear-gradient(90deg, #d7a31a 0%, #9f7200 100%);
}

.menu-settings-panel {
  border-top: 1px solid var(--line);
  padding: 16px 20px 20px;
}

.menu-manager-tools {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 14px;
}

.menu-manager-tools strong {
  color: var(--muted);
  font-size: 13px;
}

.logout-menu-button {
  margin-top: 4px;
}

.side-menu #printerStatus {
  width: fit-content;
}

.history-panel {
  border-top: 1px solid var(--line);
  box-shadow: none;
  margin-top: 0;
  padding: 16px 20px 20px;
}

.side-menu .stats-grid {
  grid-template-columns: 1fr;
}

.side-menu .history-card {
  border-radius: 10px;
}

.history-close-button {
  align-items: center;
  background: #fff8df;
  border: 1px solid #f0dfac;
  border-radius: 999px;
  color: #7a5b06;
  cursor: pointer;
  display: none;
  font-size: 26px;
  font-weight: 850;
  height: 46px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 46px;
}

.menu-version {
  align-self: end;
  color: #aaa;
  display: block;
  font-size: 16px;
  margin-top: auto;
  padding: 18px 22px;
}

.checkout-dialog {
  border-radius: 18px 18px 0 0;
  margin: auto auto 0;
  max-height: 92vh;
  max-width: 760px;
  overflow: auto;
  width: min(760px, 100vw);
}

.checkout-dialog .order-panel {
  border: 0;
  border-radius: 18px 18px 0 0;
  box-shadow: none;
}

.checkout-heading-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.checkout-close-button {
  align-items: center;
  background: #fffdf6;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 30px;
  font-weight: 900;
  height: 58px;
  justify-content: center;
  line-height: 1;
  width: 58px;
}

.checkout-close-button:active {
  transform: translateY(1px);
}

.checkout-edit-tools {
  background: #fff9e9;
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 14px 0;
  padding: 14px;
}

.checkout-edit-tools-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.checkout-edit-tools-head h3 {
  font-size: 22px;
  margin: 2px 0 0;
}

.checkout-edit-tools-head span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-align: right;
}

.checkout-edit-tools input {
  margin-bottom: 10px;
  min-height: 52px;
  width: 100%;
}

.checkout-product-picker {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.checkout-product-option {
  align-items: center;
  background: #fffdf6;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 14px;
  text-align: left;
}

.checkout-product-option strong,
.checkout-product-option small {
  display: block;
}

.checkout-product-option small {
  color: var(--muted);
  font-weight: 800;
  margin-top: 3px;
}

.checkout-product-option b {
  align-items: center;
  background: var(--brand);
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 34px;
  height: 34px;
  justify-content: center;
}

.checkout-dialog .order-actions {
  background: transparent;
  margin: 16px 0 0;
  padding: 0;
  position: static;
}

.checkout-dialog .order-actions button {
  flex: 1 1 150px;
}

.admin-view {
  background: var(--paper);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.stats-grid div,
.admin-stat {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(180deg, #fffdf7 0%, #fff7dc 100%);
}

.stats-grid span,
.admin-stat span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.stats-grid strong,
.admin-stat strong {
  font-size: 18px;
}

.history-card {
  display: grid;
  gap: 10px;
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.warning-pill {
  background: var(--warn-soft);
  color: var(--warn);
}

dialog {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(520px, calc(100vw - 28px));
  box-shadow: 0 26px 70px rgba(25, 33, 36, 0.24);
}

dialog::backdrop {
  background: rgba(25, 33, 36, 0.32);
  backdrop-filter: blur(2px);
}

.fair-native-select {
  display: none;
}

.fair-picker-trigger {
  align-items: center;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-weight: 950;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 16px;
  text-align: left;
  width: 100%;
}

.fair-picker-trigger:hover,
.fair-picker-trigger:focus-visible {
  box-shadow: 0 0 0 5px rgba(248, 198, 40, 0.18);
  outline: none;
}

.fair-picker-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fair-picker-dialog {
  border-radius: 24px;
  max-width: min(920px, calc(100vw - 28px));
  overflow: hidden;
  width: 920px;
}

.fair-picker-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 28px 90px rgba(80, 53, 0, 0.24);
  max-height: min(760px, calc(100vh - 30px));
  overflow: auto;
}

.fair-picker-head {
  align-items: center;
  background: linear-gradient(135deg, #ffda51 0%, #f5b80f 100%);
  display: flex;
  justify-content: space-between;
  padding: 22px 26px;
}

.fair-picker-head h2 {
  font-size: 30px;
  line-height: 1.1;
  margin: 2px 0 0;
}

.fair-picker-search-row {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 18px 20px 12px;
}

.fair-picker-search {
  align-items: center;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  gap: 12px;
  min-height: 58px;
  padding: 0 16px;
}

.fair-picker-search input {
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: 18px;
  font-weight: 900;
  min-width: 0;
  outline: 0;
  padding: 0;
  width: 100%;
}

.fair-picker-search span {
  color: var(--accent-strong);
  font-size: 22px;
  font-weight: 950;
}

.fair-picker-chip {
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 950;
  padding: 0 18px;
}

.fair-picker-chip-active {
  background: var(--accent);
  color: var(--ink);
}

.fair-picker-list {
  padding: 0 20px 20px;
}

.fair-picker-all-row,
.fair-picker-event {
  background: #fff;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
  width: 100%;
}

.fair-picker-all-row {
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  gap: 4px;
  margin: 6px 0 16px;
  padding: 15px 18px;
}

.fair-picker-all-row span {
  color: var(--muted);
  font-weight: 800;
}

.fair-picker-group {
  margin-top: 16px;
}

.fair-picker-group > p {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.08em;
  margin: 0 0 9px;
  text-transform: uppercase;
}

.fair-picker-events {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.fair-picker-event {
  align-items: center;
  border-bottom: 1px solid rgba(214, 167, 44, 0.32);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 16px 18px;
}

.fair-picker-event:last-child {
  border-bottom: 0;
}

.fair-picker-event:hover,
.fair-picker-all-row:hover {
  background: #fff8df;
}

.fair-picker-event-active {
  background: linear-gradient(90deg, #fff4bf 0%, #fffdf7 100%);
  box-shadow: inset 5px 0 0 var(--accent);
}

.fair-picker-event strong {
  display: block;
  font-size: 20px;
  line-height: 1.15;
}

.fair-picker-event small {
  color: var(--muted);
  display: block;
  font-size: 15px;
  font-weight: 850;
  margin-top: 6px;
}

.fair-picker-event b {
  white-space: nowrap;
}

.dialog-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.user-dialog-card {
  max-height: min(860px, calc(100vh - 52px));
  overflow: auto;
}

.event-dialog-card {
  max-height: min(860px, calc(100vh - 52px));
  overflow: auto;
}

.event-daily-targets {
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.event-daily-targets-heading h3 {
  font-size: 18px;
  margin: 0;
}

.event-daily-targets-heading p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  margin: 5px 0 0;
}

.event-daily-target-grid {
  display: grid;
  gap: 8px;
}

.event-daily-target-row {
  align-items: center;
  background: #fff;
  border: 1px solid #efe4c2;
  border-radius: 13px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(110px, 0.85fr) minmax(130px, 1fr) minmax(130px, 1fr);
  padding: 10px 12px;
}

.event-daily-target-row strong,
.event-daily-target-row span {
  min-width: 0;
}

.event-daily-target-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.event-daily-target-row input {
  min-width: 0;
}

.event-daily-target-empty {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

@media (max-width: 600px) {
  .event-daily-target-row {
    grid-template-columns: 1fr;
  }
}

.user-management-card {
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.user-management-card:hover {
  border-color: #d9a600;
  box-shadow: 0 12px 28px rgba(184, 126, 0, 0.14);
  transform: translateY(-1px);
}

.user-management-card:focus-visible {
  outline: 3px solid rgba(255, 204, 45, 0.45);
  outline-offset: 3px;
}

.user-management-card-inactive {
  background: #fffaf1;
  border-style: dashed;
  opacity: 0.82;
}

@media (min-width: 761px) {
  .user-dialog {
    border-radius: 26px;
    width: min(1120px, calc(100vw - 64px));
  }

  .user-dialog-card {
    gap: 18px 22px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 32px;
  }

  .user-dialog-card .panel-heading,
  .user-dialog-card .checkbox-stack,
  .user-dialog-card .order-actions {
    grid-column: 1 / -1;
  }

  .user-dialog-card .panel-heading {
    align-items: center;
  }

  .user-dialog-card .checkbox-stack {
    background: #fffdf7;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px;
  }

  .user-dialog-card .order-actions {
    justify-content: flex-end;
  }

  #eventDialog {
    width: min(980px, calc(100vw - 64px));
  }

  .event-dialog-card {
    gap: 18px 22px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 32px;
  }

  .event-dialog-card .panel-heading,
  .event-dialog-card .event-daily-targets,
  .event-dialog-card .order-actions {
    grid-column: 1 / -1;
  }
}

.import-dialog-card {
  width: min(760px, calc(100vw - 28px));
}

.import-preview {
  background: #fffdf6;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

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

.import-preview-grid div {
  background: #fff;
  border: 1px solid #f1dda5;
  border-radius: 12px;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
}

.import-preview-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.import-preview-grid strong {
  color: var(--ink);
  font-size: 18px;
  overflow-wrap: anywhere;
}

.import-warning-list {
  color: #8a5b00;
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.import-warning-list:empty {
  display: none;
}

.import-warning-list p {
  background: #fff4d1;
  border-radius: 10px;
  margin: 0;
  padding: 9px 11px;
}

.closing-preview-panel {
  background: #fffdf6;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.closing-context-card {
  background: linear-gradient(135deg, #fff8df 0%, #fffdf6 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 10px 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px;
}

.closing-context-card h3 {
  font-size: 20px;
  line-height: 1.15;
  margin: 2px 0 6px;
}

.closing-context-card span,
.closing-context-card small,
.closing-context-card p {
  color: var(--muted);
  display: block;
  font-weight: 800;
}

.closing-context-card p {
  border-top: 1px solid rgba(214, 167, 44, 0.24);
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 10px;
}

.closing-context-date {
  align-self: start;
  background: #fff;
  border: 1px solid rgba(214, 167, 44, 0.36);
  border-radius: 12px;
  min-width: 150px;
  padding: 10px 12px;
  text-align: right;
}

.closing-context-date strong {
  color: var(--text);
  display: block;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.1;
  margin: 4px 0;
}

.closing-preview-heading {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.closing-preview-heading h3 {
  font-size: 18px;
  margin: 0;
}

.closing-preview-heading > strong,
.closing-preview-heading > span {
  color: var(--accent-strong);
  font-weight: 900;
  white-space: nowrap;
}

.closing-payment-summary,
.cash-count-rows {
  display: grid;
  gap: 8px;
}

.closing-payment-row {
  align-items: center;
  border-top: 1px solid rgba(214, 167, 44, 0.26);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-top: 8px;
}

.closing-payment-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.closing-payment-row span {
  color: var(--muted);
  font-weight: 800;
}

.closing-payment-row strong {
  font-size: 18px;
}

.closing-payment-total {
  background: var(--accent-pale);
  border: 0;
  border-radius: 10px;
  margin-top: 2px;
  padding: 10px 12px;
}

.cash-count-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(86px, 1fr) minmax(76px, 96px) minmax(92px, 1fr);
}

.cash-count-row span,
.cash-count-row strong {
  font-weight: 900;
}

.cash-count-row input {
  min-height: 44px;
  text-align: center;
}

.cash-count-row strong {
  text-align: right;
}

.cash-count-total {
  align-items: center;
  background: #fff8e6;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  font-weight: 900;
  justify-content: space-between;
  padding: 10px 12px;
}

.cash-count-balanced strong {
  color: #15803d;
}

.cash-count-short strong {
  color: #b91c1c;
}

.cash-count-over strong {
  color: #b45309;
}

.inventory-dialog-card {
  box-sizing: border-box;
  max-height: min(900px, calc(100vh - 42px));
  min-width: 0;
  overflow: auto;
  width: 100%;
}

#inventoryDialog {
  max-width: calc(100vw - 32px);
  width: min(1480px, calc(100vw - 32px));
}

.inventory-filter-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.5fr) minmax(180px, 0.8fr) minmax(180px, 0.8fr);
}

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

.inventory-summary-grid > div {
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
}

.inventory-summary-grid span,
.inventory-summary-grid small {
  color: var(--muted);
  font-weight: 800;
}

.inventory-summary-grid strong {
  font-size: 24px;
  line-height: 1;
}

.inventory-summary-grid .inventory-summary-good {
  background: #f1faf3;
}

.inventory-summary-grid .inventory-summary-warn {
  background: #fff3f1;
}

.inventory-table-panel {
  min-width: 0;
}

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

.inventory-count-card {
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  gap: 12px;
  padding: 14px 16px;
}

.inventory-count-card-heading {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.inventory-count-card-heading h4 {
  font-size: 20px;
  line-height: 1.1;
  margin: 0;
  overflow-wrap: anywhere;
}

.inventory-count-card-heading span,
.inventory-count-card-stats small,
.inventory-count-card-note span,
.inventory-count-card-input span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.inventory-count-card-heading span {
  display: block;
  margin-top: 4px;
}

.inventory-count-card-input label {
  align-items: center;
  display: flex;
  gap: 8px;
}

.inventory-count-card-input input {
  border: 2px solid var(--gold);
  border-radius: 12px;
  font-size: 22px;
  font-weight: 900;
  min-height: 52px;
  padding: 8px 12px;
  text-align: center;
  width: 112px;
}

.inventory-count-card-stats {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.inventory-count-card-stats > div {
  background: #fff8e7;
  border-radius: 10px;
  display: grid;
  gap: 4px;
  padding: 9px 10px;
}

.inventory-count-card-stats strong {
  font-size: 20px;
  line-height: 1;
}

.inventory-count-card-difference {
  background: #f5f7f4 !important;
}

.inventory-count-card-note {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 42px minmax(0, 1fr);
}

.inventory-count-card-note input {
  min-height: 38px;
  padding: 7px 10px;
}

.inventory-table-wrap {
  overflow-x: auto;
}

.inventory-table {
  border-collapse: collapse;
  min-width: 900px;
  width: 100%;
}

.inventory-table th,
.inventory-table td {
  border-top: 1px solid rgba(214, 167, 44, 0.26);
  padding: 10px 8px;
  text-align: right;
  white-space: nowrap;
}

.inventory-table th:first-child,
.inventory-table td:first-child,
.inventory-table th:last-child,
.inventory-table td:last-child {
  text-align: left;
}

.inventory-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.inventory-table td:first-child strong,
.inventory-table td:first-child small {
  display: block;
}

.inventory-table td:first-child small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.inventory-table input {
  min-height: 38px;
  padding: 7px 9px;
  text-align: right;
  width: 86px;
}

.inventory-table td:last-child input {
  text-align: left;
  width: 140px;
}

.inventory-variance-ok {
  color: #15803d;
  font-weight: 900;
}

.inventory-variance-bad {
  color: #b91c1c;
  font-weight: 900;
}

.pos-product-stock {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  margin: 6px 0 0;
}

.pos-product-stock-low {
  color: #b45309;
}

@media (max-width: 900px) {
  .inventory-dialog-card {
    padding: 18px;
  }

  .inventory-filter-grid,
  .inventory-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .inventory-filter-grid label:first-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 761px) {
  .inventory-card-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1400px) {
  .inventory-card-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .inventory-filter-grid,
  .inventory-summary-grid {
    grid-template-columns: 1fr;
  }

  .inventory-count-card {
    padding: 12px;
  }

  .inventory-count-card-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .inventory-count-card-input label {
    align-items: center;
    justify-content: space-between;
  }

  .inventory-count-card-input input {
    width: 132px;
  }

  .inventory-count-card-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.receipt-sheet {
  display: none;
}

.admin-view {
  background:
    radial-gradient(circle at 82% -20%, rgba(246, 197, 47, 0.25), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 248, 223, 0.48) 280px);
  padding: 20px clamp(18px, 3vw, 40px) 34px;
}

.admin-mode .pos-workspace {
  display: none;
}

.admin-mode .admin-view {
  min-height: calc(100vh - 72px);
}

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

.admin-toolbar h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: 0;
  line-height: 0.98;
}

.admin-tabs {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: flex;
  gap: 7px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding: 7px;
  scrollbar-width: thin;
}

.admin-global-filter {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
}

.report-filter-panel {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: none;
}

.report-filter-panel .panel-heading h2 {
  font-size: 18px;
}

.report-range-pill {
  background: #fff1a9;
  color: var(--accent-dark);
}

.admin-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  margin: 6px 0 0;
}

.after-sales-card {
  gap: 8px;
}

.after-sales-card .product-actions {
  margin-top: 4px;
}

.followup-tool {
  background: #fffdf6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px;
}

.followup-tool-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.followup-tool h3 {
  font-size: 20px;
  margin: 0 0 4px;
}

.followup-tool p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  margin: 0;
}

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

.followup-summary span {
  background: var(--gold-soft);
  border-radius: 999px;
  color: var(--gold-deep);
  font-size: 13px;
  font-weight: 850;
  padding: 8px 12px;
  white-space: nowrap;
}

.followup-template-label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 850;
}

.followup-template-label textarea {
  min-height: 130px;
  resize: vertical;
}

.followup-customer-card .ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 720px) {
  .followup-tool-head {
    display: grid;
  }

  .followup-summary {
    justify-content: flex-start;
  }
}

.admin-product-item {
  gap: 8px;
}

.product-management-heading {
  background: rgba(255, 253, 246, 0.96);
  border-bottom: 1px solid var(--line);
  margin: -18px -18px 18px;
  padding: 18px;
  position: sticky;
  top: 0;
  z-index: 8;
}

.product-management-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.product-management-actions button {
  min-height: 44px;
  white-space: nowrap;
}

.product-management-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.admin-product-item .inline-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.product-arrange-list {
  user-select: none;
}

.product-arrange-item {
  cursor: grab;
  transition: box-shadow 0.16s ease, transform 0.16s ease;
}

.product-arrange-item:active {
  cursor: grabbing;
}

.product-arrange-item.product-dragging {
  box-shadow: 0 16px 34px rgba(167, 120, 0, 0.18);
  opacity: 0.78;
  transform: scale(0.99);
}

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

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

.product-drag-handle {
  align-items: center;
  background: var(--gold-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-dark);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 18px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.management-card-head strong {
  min-width: 0;
}

.management-card-actions {
  flex: 0 0 auto;
}

.product-arrange-controls {
  gap: 8px;
}

.management-card-meta {
  line-height: 1.45;
}

.user-event-access {
  display: grid;
  gap: 8px;
}

.user-event-access-main {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.user-event-access-label {
  color: #7f6f55;
  font-weight: 850;
}

.user-event-access-count {
  color: var(--ink);
  font-size: 14px;
}

.user-event-chip-row,
.user-event-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.user-event-chip {
  align-items: center;
  background: #fff8df;
  border: 1px solid #edd38a;
  border-radius: 999px;
  color: #725b23;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  max-width: 230px;
  min-height: 28px;
  overflow: hidden;
  padding: 5px 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-event-details {
  margin-top: 2px;
}

.user-event-details summary {
  color: #b27a00;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  list-style-position: inside;
  width: max-content;
}

.user-event-details[open] .user-event-chip-list {
  border-top: 1px solid #f0dfac;
  margin-top: 8px;
  max-height: 180px;
  overflow: auto;
  padding-top: 8px;
}

.management-chip {
  align-items: center;
  background: #fff7d7;
  border: 1px solid #f0dfac;
  border-radius: 999px;
  color: #7a5b06;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  min-height: 30px;
  padding: 4px 10px;
}

.admin-tab {
  background: transparent;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  cursor: pointer;
  flex: 0 0 auto;
  font: inherit;
  font-weight: 800;
  padding: 10px 14px;
  white-space: nowrap;
}

.admin-tab-active {
  background: linear-gradient(180deg, #ffdc62 0%, var(--accent) 100%);
  box-shadow: 0 8px 18px rgba(202, 146, 0, 0.18);
  color: var(--ink);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

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

.admin-panel[hidden],
.admin-stats[hidden] {
  display: none !important;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

td {
  font-size: 14px;
}

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

.ranking-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(142, 99, 0, 0.06);
}

.ranking-item div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.event-region-group {
  background: rgba(255, 253, 246, 0.74);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.event-region-heading {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.event-region-heading h3 {
  font-size: 28px;
  line-height: 1.05;
  margin: 0;
}

.event-region-summary {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.event-region-summary > span {
  background: var(--gold-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  padding: 8px 12px;
}

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

.event-management-card {
  box-shadow: none;
}

.crm-panel {
  grid-column: 1 / -1;
}

.crm-panel .panel-heading {
  align-items: center;
}

.crm-panel .panel-heading input {
  max-width: 280px;
}

.crm-card {
  background: linear-gradient(180deg, #fffaf5 0%, #ffffff 100%);
}

.crm-pagination {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 4px 2px;
}

.crm-pagination > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.crm-pagination > div {
  display: flex;
  gap: 8px;
}

.crm-clickable-card,
.location-clickable-row,
.dashboard-clickable,
.salesperson-clickable-row {
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.crm-clickable-card:hover,
.location-clickable-row:hover,
.dashboard-clickable:hover,
.salesperson-clickable-row:hover {
  border-color: #d9a600;
  box-shadow: 0 12px 28px rgba(184, 126, 0, 0.14);
  transform: translateY(-1px);
}

.crm-clickable-card:focus-visible,
.location-clickable-row:focus-visible,
.dashboard-clickable:focus-visible,
.salesperson-clickable-row:focus-visible {
  outline: 3px solid rgba(255, 204, 45, 0.45);
  outline-offset: 3px;
}

.commission-card-hint {
  color: #b77c00;
  font-weight: 800;
}

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

.checkbox-stack strong {
  font-size: 13px;
}

.check-row {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: row;
  gap: 9px;
  padding: 10px 12px;
}

.check-row input {
  width: auto;
}

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

.event-access-header > div:first-child {
  display: grid;
  gap: 3px;
}

.event-access-header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.event-access-actions,
.event-access-group-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-button {
  border-radius: 12px;
  font-size: 13px;
  min-height: 36px;
  padding: 8px 12px;
}

.event-access-search {
  width: 100%;
}

.event-access-groups {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.event-access-group {
  background: #fffaf0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.event-access-group[hidden] {
  display: none;
}

.event-access-group summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-weight: 900;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 14px;
}

.event-access-group summary small {
  color: #b77c00;
  font-weight: 900;
}

.event-access-group-actions {
  border-top: 1px solid var(--line);
  padding: 10px 12px 0;
}

.event-access-list {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
}

.event-access-row span {
  display: grid;
  gap: 2px;
}

.event-access-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 700px) {
  .event-access-header {
    display: grid;
  }

  .event-access-actions .mini-button,
  .event-access-group-actions .mini-button {
    flex: 1;
  }

  .event-access-groups {
    max-height: 300px;
  }
}

/* Fair report dashboard redesign */
.admin-mode .pos-header {
  box-shadow: 0 1px 0 rgba(218, 161, 20, 0.32);
}

@media (min-width: 981px) {
  .admin-mode .pos-header {
    background: #fff;
    grid-template-columns: 56px minmax(260px, auto) 1fr auto;
    min-height: 72px;
    padding: 0 24px;
  }

  .admin-mode .pos-header::before {
    background: url("assets/wing-foong-logo.png") left center / 64px 64px no-repeat;
    color: #21170c;
    content: "FairFlow POS\a Wing Foong Bazhen";
    display: block;
    font-size: 13px;
    font-weight: 850;
    grid-column: 2;
    grid-row: 1;
    line-height: 1.2;
    min-height: 66px;
    padding: 17px 0 0 78px;
    white-space: pre;
  }

  .admin-mode .ticket-title {
    display: none;
  }

  .admin-mode #menuButton {
    background: #fff8dc;
    border: 1px solid #f2d57a;
    display: flex;
    grid-column: 1;
    grid-row: 1;
  }

  .admin-mode .pos-header-actions {
    grid-column: 4;
    justify-self: end;
  }

  .admin-mode #moreMenuButton {
    display: none;
  }
}
}

.admin-view {
  background: #fff;
  color: #21170c;
  padding: 22px clamp(18px, 2vw, 34px) 32px;
}

.admin-mode .admin-view {
  min-height: calc(100vh - 68px);
}

.admin-toolbar {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: auto minmax(420px, 1fr) auto;
  margin-bottom: 18px;
}

.admin-toolbar h2 {
  color: #21170c;
  font-size: clamp(34px, 3.1vw, 46px);
  font-weight: 950;
  line-height: 1;
}

.admin-fair-strip {
  align-items: center;
  display: flex;
  gap: 20px;
  min-width: 0;
}

.admin-fair-select {
  align-items: center;
  background: #fff;
  border: 1px solid #ecc96a;
  border-radius: 10px;
  display: inline-flex;
  gap: 18px;
  min-height: 44px;
  min-width: 260px;
  padding: 0 16px;
}

.admin-fair-select strong {
  font-size: 18px;
  line-height: 1.1;
}

.admin-fair-select span {
  color: #5f4d2d;
  font-size: 18px;
  margin-left: auto;
}

.admin-fair-date {
  color: #4f4129;
  font-size: 16px;
  font-weight: 750;
  white-space: nowrap;
}

.fair-status-pill {
  background: #eff9df;
  border: 1px solid #bfd98c;
  color: #258333;
  font-size: 13px;
  min-height: 30px;
}

.export-report-button::before {
  content: "⇩";
  font-size: 18px;
  line-height: 1;
}

.admin-tabs {
  background: #fff;
  border: 1px solid #ecd27f;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  gap: 12px;
  margin: -6px calc(clamp(18px, 2vw, 34px) * -1) 18px;
  padding: 8px clamp(18px, 2vw, 34px);
}

.admin-tab {
  border-radius: 9px;
  font-size: 15px;
  font-weight: 850;
  min-height: 42px;
  padding: 0 18px;
}

.admin-tab-active {
  background: linear-gradient(180deg, #ffdc5b, #f6bf1f);
  color: #21170c;
}

.report-filter-panel {
  background: rgba(255, 253, 247, 0.92);
  border: 1px solid #ecd27f;
  border-radius: 22px;
  box-shadow: 0 14px 36px rgba(104, 76, 20, 0.08);
  margin-bottom: 18px;
  padding: 14px 16px;
}

.report-filter-panel .panel-heading {
  display: none;
}

.admin-report-summary {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.admin-report-title {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.admin-report-title > div {
  min-width: 0;
}

.admin-report-mark {
  align-items: center;
  background: linear-gradient(135deg, #ffdc5b, #f6bf1f);
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(246, 191, 31, 0.24);
  display: grid;
  flex: 0 0 auto;
  font-size: 18px;
  font-weight: 950;
  height: 42px;
  place-items: center;
  width: 42px;
}

.admin-report-title h2 {
  color: #21170c;
  font-size: clamp(24px, 2.4vw, 34px);
  letter-spacing: -0.045em;
  line-height: 1.05;
  margin: 0 0 4px;
}

.admin-report-title p {
  color: #756b58;
  font-size: 14px;
  font-weight: 850;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-filter-toggle {
  align-items: center;
  background: #fffdfa;
  border: 1px solid #edcc66;
  border-radius: 999px;
  color: #21170c;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  justify-self: end;
  min-height: 44px;
  min-width: 190px;
  padding: 0 14px;
}

.admin-filter-toggle span {
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.admin-filter-toggle strong {
  color: #8a6c16;
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-filter-toggle b {
  color: #a87700;
  font-size: 17px;
  line-height: 1;
}

.report-filter-content {
  display: grid;
  gap: 20px;
  margin-top: 16px;
}

/* The boss chooses the business scope before narrowing the time range. */
.report-filter-section-scope {
  order: -1;
}

.report-filter-panel.is-loading .admin-filter-toggle {
  cursor: progress;
  opacity: 0.72;
}

.report-filter-panel.is-loading .admin-filter-toggle::after {
  animation: admin-filter-pulse 0.9s ease-in-out infinite alternate;
  background: #d48a00;
  border-radius: 50%;
  content: "";
  height: 7px;
  margin-left: 2px;
  width: 7px;
}

@keyframes admin-filter-pulse {
  to { opacity: 0.25; transform: scale(0.78); }
}

.report-detail-skeleton {
  display: grid;
  gap: 12px;
  min-height: 118px;
  padding: 20px;
}

.report-skeleton {
  animation: report-skeleton-shimmer 1.1s ease-in-out infinite alternate;
  background: linear-gradient(90deg, #f1eadb 20%, #fffdf7 48%, #f1eadb 76%);
  border-radius: 9px;
  display: block;
  height: 18px;
  width: 100%;
}

.report-skeleton-short { width: 56%; }

.report-skeleton-inline {
  display: inline-block;
  height: 1em;
  min-width: 68px;
  vertical-align: -0.1em;
}

@keyframes report-skeleton-shimmer {
  to { opacity: 0.54; }
}

.report-filter-panel.is-collapsed .report-filter-content {
  display: none;
}

.report-filter-section {
  border-top: 1px solid #eee0b1;
  display: grid;
  gap: 13px;
  padding-top: 16px;
}

.report-filter-section-heading {
  align-items: end;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.report-filter-section-heading .eyebrow {
  margin: 0 0 2px;
}

.report-filter-section-heading h3 {
  color: #21170c;
  font-size: 17px;
  margin: 0;
}

.report-filter-section-heading > span:not(.report-range-pill) {
  color: #806e4e;
  font-size: 12px;
  font-weight: 750;
}

.report-period-grid {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(150px, 0.6fr) minmax(150px, 0.6fr) minmax(320px, 1.3fr) minmax(330px, 1.45fr);
}

.report-filter-section-scope .admin-filter-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(190px, 0.8fr) minmax(290px, 1.3fr) minmax(210px, 0.9fr);
}

.report-filter-panel label,
.report-period-grid label {
  color: #46391f;
  font-size: 12px;
  font-weight: 750;
}

.report-filter-panel select,
.report-filter-panel input {
  border-color: #e9c96c;
  border-radius: 8px;
  min-height: 40px;
  padding: 8px 12px;
}

.sales-date-grid {
  gap: 12px;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
}

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

@media (max-width: 1180px) {
  .report-period-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-filter-section-scope .admin-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .report-period-grid,
  .report-filter-section-scope .admin-filter-grid {
    grid-template-columns: 1fr;
  }

  .report-filter-section-heading {
    align-items: start;
    flex-direction: column;
    gap: 5px;
  }
}

.sales-quick-actions button {
  border-radius: 8px;
  min-height: 38px;
}

.sales-quick-actions .admin-period-active,
.ghost-button.admin-period-active {
  background: linear-gradient(180deg, #ffdc62 0%, var(--accent) 100%);
  border-color: var(--accent);
  box-shadow: 0 8px 18px rgba(202, 146, 0, 0.16);
  color: var(--ink);
}

.admin-event-date-picker {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-event-date-picker > div {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 750;
  gap: 2px;
  margin-right: 4px;
}

.admin-event-date-picker strong {
  color: var(--ink);
  font-size: 14px;
}

.event-date-chip {
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  min-height: 34px;
  padding: 0 12px;
}

.event-date-chip-active {
  background: linear-gradient(180deg, #ffdc62 0%, var(--accent) 100%);
  border-color: var(--accent);
  box-shadow: 0 8px 18px rgba(202, 146, 0, 0.16);
}

.admin-panel[data-admin-panel="overview"] {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.settlement-panel {
  display: grid;
  gap: 18px;
}

.settlement-date-actions {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settlement-date-actions label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 6px;
  min-width: 190px;
}

.settlement-period-summary {
  background: linear-gradient(135deg, var(--accent-pale) 0%, #fff 100%);
  border: 1px solid #ecd27f;
  border-radius: 14px;
  display: grid;
  gap: 4px;
  min-width: 190px;
  padding: 10px 14px;
}

.settlement-period-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settlement-period-summary strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
}

.settlement-summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.settlement-card {
  background: linear-gradient(135deg, #fff 0%, #fffaf0 100%);
  border: 1px solid #ecd27f;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(156, 102, 0, 0.055);
  cursor: pointer;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.settlement-card:hover,
.settlement-fair-row:hover {
  border-color: var(--accent);
  box-shadow: 0 16px 30px rgba(202, 146, 0, 0.14);
  transform: translateY(-1px);
}

.settlement-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.settlement-card strong {
  color: var(--ink);
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.settlement-card small {
  color: var(--muted);
  font-weight: 800;
}

.settlement-card-ewallet {
  background: linear-gradient(135deg, #fff4cf 0%, #fff 100%);
  border-color: #e6b21f;
}

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

.settlement-fair-row {
  background: #fff;
  border: 1px solid #ecd27f;
  border-radius: 16px;
  cursor: pointer;
  display: grid;
  gap: 12px;
  padding: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.settlement-fair-main {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
}

.settlement-fair-main strong,
.settlement-fair-main b {
  color: var(--ink);
  font-size: clamp(20px, 1.5vw, 28px);
  line-height: 1.1;
}

.settlement-fair-main small,
.settlement-fair-meta {
  color: var(--muted);
  font-weight: 800;
}

.settlement-fair-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settlement-fair-meta span {
  background: #fff8dd;
  border-radius: 999px;
  padding: 5px 10px;
}

.settlement-closed {
  color: #15803d;
}

.settlement-open {
  color: #b77900;
}

.settlement-payment-strip {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.settlement-payment-strip span {
  background: #fffdf7;
  border: 1px solid #f1db91;
  border-radius: 12px;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
}

.settlement-payment-strip small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settlement-payment-strip b {
  color: var(--ink);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.settlement-closing-button {
  justify-self: end;
}

@media (max-width: 760px) {
  .settlement-date-actions,
  .settlement-period-summary,
  .settlement-date-actions label {
    width: 100%;
  }

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

  .settlement-card {
    padding: 13px;
  }

  .settlement-card strong {
    font-size: 22px;
  }

  .settlement-fair-main {
    grid-template-columns: 1fr;
  }

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

  .settlement-closing-button {
    justify-self: stretch;
  }
}

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

.fair-kpi-grid {
  gap: 14px;
  grid-column: span 8;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.owner-reminders-panel {
  grid-column: span 4;
}

.daily-section {
  grid-column: span 5;
}

.product-section {
  grid-column: span 7;
}

.payment-section,
.team-section,
.closing-section {
  grid-column: span 4;
}

.overview-section,
.fair-kpi-grid div {
  background: #fff;
  border: 1px solid #ecd27f;
  border-radius: 10px;
  box-shadow: 0 12px 26px rgba(156, 102, 0, 0.055);
}

.overview-section {
  gap: 12px;
  padding: 14px;
}

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

.owner-performance-panel {
  background: #fff;
  display: grid;
  gap: 22px;
  padding: clamp(20px, 2vw, 30px);
}

.owner-performance-heading {
  align-items: start;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding-bottom: 20px;
}

.owner-performance-heading h2 {
  color: var(--ink);
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0;
}

.owner-performance-heading .admin-note {
  max-width: 46ch;
}

.owner-performance-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.owner-performance-controls > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.owner-performance-controls .ghost-button {
  min-height: 35px;
  padding: 0 12px;
}

.owner-performance-modebar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 13px;
}

.owner-performance-toggle-group {
  align-items: center;
  background: #fffaf0;
  border: 1px solid #ead28c;
  border-radius: 999px;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
}

.owner-performance-toggle-group > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  padding: 0 8px 0 10px;
}

.owner-performance-toggle-group button,
.owner-performance-quick-switches button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  min-height: 32px;
  padding: 0 13px;
}

.owner-performance-toggle-group button.owner-performance-toggle-active,
.owner-performance-quick-switches button.owner-performance-quick-active {
  background: #1a1209;
  color: #fff;
  box-shadow: 0 9px 18px rgba(33, 23, 12, 0.12);
}

.owner-performance-quick-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.owner-performance-quick-switches button {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid #ead28c;
  color: var(--ink);
  max-width: 184px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-performance-quick-switches button.owner-performance-quick-active {
  background: #fff1bd;
  border-color: #cf9425;
  color: #9c6200;
}

.owner-performance-quick-select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #9c6200 50%) right 17px center / 6px 6px no-repeat,
    linear-gradient(135deg, #9c6200 50%, transparent 50%) right 12px center / 6px 6px no-repeat,
    rgba(255, 255, 255, 0.82);
  border: 1px solid #ead28c;
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  min-height: 34px;
  min-width: 132px;
  padding: 0 32px 0 14px;
  width: min(210px, 100%);
}

.owner-performance-currency {
  align-items: center;
  display: inline-flex;
  gap: 7px;
}

.owner-performance-currency > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.owner-performance-currency select {
  background: #fff;
  border: 1px solid #e2c56f;
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  min-height: 35px;
  padding: 0 28px 0 10px;
}

.owner-performance-year {
  align-items: flex-end;
  display: grid;
  justify-items: end;
  line-height: 1.1;
}

.owner-performance-year strong {
  color: var(--accent-dark);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.owner-performance-year span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.owner-performance-year b {
  color: var(--ink);
  font-size: clamp(22px, 2vw, 30px);
  font-variant-numeric: tabular-nums;
  margin-top: 5px;
}

.owner-performance-kpis {
  border-bottom: 1px solid #eadfb9;
  border-top: 1px solid #eadfb9;
  display: grid;
  grid-template-columns: minmax(1.35fr, 1.7fr) repeat(3, minmax(130px, 0.75fr));
}

.owner-performance-kpis article {
  display: grid;
  gap: 7px;
  min-height: 92px;
  padding: 18px 20px;
}

.owner-performance-kpis article + article {
  border-left: 1px solid #eadfb9;
}

.owner-performance-kpis span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.owner-performance-kpis strong {
  color: var(--ink);
  font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
  font-size: clamp(18px, 1.65vw, 25px);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.owner-performance-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

.owner-performance-side {
  display: grid;
  gap: 18px;
}

.owner-performance-section {
  border-top: 3px solid var(--accent);
  overflow: hidden;
}

.owner-performance-section-head {
  align-items: baseline;
  border-bottom: 1px solid #eadfb9;
  display: flex;
  justify-content: space-between;
  padding: 0 0 12px;
}

.owner-performance-section-head span {
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.owner-performance-section-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.owner-performance-rank-row {
  align-items: center;
  border-bottom: 1px solid #f0e6c8;
  display: grid;
  min-height: 56px;
  padding: 10px 0;
}

.owner-performance-rank-row:last-child {
  border-bottom: 0;
}

.owner-performance-trend {
  align-items: end;
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  min-height: 266px;
  padding-top: 12px;
}

.owner-performance-month-row {
  align-content: end;
  display: grid;
  gap: 7px;
  grid-template-rows: auto minmax(118px, 1fr) auto auto;
  min-height: 238px;
  padding: 0 3px;
  text-align: center;
}

.owner-performance-month-row > span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 950;
}

.owner-performance-bar {
  align-items: end;
  background: linear-gradient(180deg, #fffdf8, #fbf3dc);
  border: 1px solid #efe2b7;
  display: flex;
  min-height: 118px;
  padding: 5px;
}

.owner-performance-bar i {
  background: linear-gradient(180deg, #f4c431, #c48b08);
  display: block;
  min-height: 0;
  transition: height 200ms ease;
  width: 100%;
}

.owner-performance-month-row > strong {
  color: var(--ink);
  font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
  font-size: clamp(11px, 0.86vw, 14px);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.owner-performance-month-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.owner-performance-zero-months {
  border-top: 1px solid #f0e6c8;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  margin: 12px 0 0;
  padding-top: 12px;
}

.owner-performance-month-grid {
  display: none;
}

.owner-performance-month-row {
  background: transparent;
  border: 0;
}

.owner-performance-month-row small,
.owner-performance-rank-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.owner-performance-rank-row b {
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.owner-performance-rank-row {
  gap: 11px;
  grid-template-columns: 28px minmax(0, 1fr) minmax(120px, auto);
}

.owner-performance-rank-row > span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 950;
}

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

.owner-performance-rank-row strong {
  color: var(--ink);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 840px) {
  .owner-performance-layout {
    grid-template-columns: 1fr;
  }

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

  .owner-performance-kpis article:nth-child(3) {
    border-left: 0;
    border-top: 1px solid #eadfb9;
  }

  .owner-performance-kpis article:nth-child(4) {
    border-top: 1px solid #eadfb9;
  }
}

@media (max-width: 560px) {
  .owner-performance-heading {
    align-items: start;
    flex-direction: column;
    gap: 12px;
  }

  .owner-performance-year {
    justify-items: start;
  }

  .owner-performance-panel {
    gap: 18px;
    padding: 18px;
  }

  .owner-performance-kpis {
    grid-template-columns: 1fr;
  }

  .owner-performance-kpis article,
  .owner-performance-kpis article + article {
    border-left: 0;
    border-top: 1px solid #eadfb9;
  }

  .owner-performance-kpis article:first-child {
    border-top: 0;
  }

  .owner-performance-trend {
    gap: 10px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    min-height: auto;
  }

  .owner-performance-month-row {
    grid-template-rows: auto minmax(78px, 1fr) auto auto;
    min-height: 184px;
  }

  .owner-performance-bar {
    min-height: 78px;
  }

  .owner-performance-month-row > strong {
    font-size: 11px;
  }

  .owner-performance-rank-row {
    gap: 7px 9px;
    grid-template-columns: 25px minmax(0, 1fr);
  }

  .owner-performance-rank-row > b {
    grid-column: 2;
    grid-row: 2;
    text-align: left;
  }
}

.owner-performance-layout,
.owner-performance-comparison {
  gap: 18px;
}

.owner-performance-kpis {
  border: 0;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.owner-performance-kpis article {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #eadfb9;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(70, 47, 10, 0.06);
  min-height: 96px;
  padding: 16px 18px;
}

.owner-performance-kpis article + article {
  border-left: 1px solid #eadfb9;
}

.owner-performance-section {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,251,240,0.94));
  border: 1px solid #dfc37f;
  border-radius: 20px;
  box-shadow: 0 14px 32px rgba(70, 47, 10, 0.08);
  overflow: hidden;
}

.owner-performance-section-head {
  align-items: center;
  border-bottom: 1px solid #eadfb9;
  min-height: 64px;
  padding: 14px 18px;
}

.owner-performance-section-head b {
  background: #fff6d8;
  border: 1px solid #e7ca7f;
  border-radius: 999px;
  color: var(--ink);
  font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 950;
  padding: 7px 10px;
}

.owner-performance-chart-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 16px 18px 0;
}

.owner-performance-chart-stats-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.owner-performance-chart-stats article {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid #ecd8a6;
  border-radius: 14px;
  padding: 10px 12px;
}

.owner-performance-chart-stats span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 900;
}

.owner-performance-chart-stats strong {
  color: var(--ink);
  display: block;
  font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
  font-size: clamp(13px, 1.08vw, 17px);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.owner-performance-chart-wrap {
  padding: 10px 18px 18px;
}

.owner-performance-chart {
  display: block;
  height: auto;
  width: 100%;
}

.owner-chart-grid line {
  stroke: #eee3c6;
  stroke-width: 1;
}

.owner-chart-axis {
  stroke: #d8c48d;
  stroke-width: 1.2;
}

.owner-chart-bar {
  fill: url("#ownerPerformanceGoldGradient");
  filter: drop-shadow(0 8px 10px rgba(198, 129, 21, 0.15));
}

.owner-performance-bar-chart .owner-chart-bar {
  fill: #d89413;
}

.owner-chart-peak .owner-chart-bar {
  fill: #151515;
}

.owner-chart-peak .owner-chart-value {
  fill: #151515;
  font-weight: 950;
}

.owner-chart-value {
  fill: var(--muted);
  font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 850;
}

.owner-chart-label,
.owner-chart-y-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.owner-chart-area {
  fill: rgba(198, 129, 21, 0.16);
}

.owner-chart-line {
  fill: none;
  stroke: #c68115;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.owner-performance-order-line circle {
  fill: #fff;
  stroke: #c68115;
  stroke-width: 3;
}

.owner-performance-fair-list {
  display: grid;
  gap: 10px;
  padding: 12px 14px 14px;
}

.owner-performance-fair-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #f0e2bf;
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(70, 47, 10, 0.045);
  display: grid;
  gap: 13px;
  grid-template-columns: 34px minmax(190px, 1.2fr) 78px 78px 78px minmax(155px, 0.9fr) 24px;
  min-height: 70px;
  padding: 11px 12px;
}

.owner-performance-fair-row-top {
  background: linear-gradient(90deg, #fff3c7 0%, #fffdf8 48%, #fff 100%);
  border-color: #d8aa3d;
}

.owner-performance-fair-rank {
  align-items: center;
  background: #fff0bf;
  border-radius: 12px;
  color: #a86a00;
  display: inline-flex;
  font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 950;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.owner-performance-fair-row-top .owner-performance-fair-rank {
  background: #111722;
  color: #fff;
}

.owner-performance-fair-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.owner-performance-fair-main strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-performance-fair-main small,
.owner-performance-fair-metric span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.owner-performance-fair-metric {
  display: grid;
  gap: 2px;
}

.owner-performance-fair-metric b,
.owner-performance-fair-sales strong {
  color: var(--ink);
  font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
}

.owner-performance-fair-sales {
  display: grid;
  gap: 7px;
  justify-items: end;
  min-width: 0;
}

.owner-performance-fair-sales strong {
  font-size: 14px;
  overflow-wrap: anywhere;
  text-align: right;
}

.owner-performance-fair-sales i {
  background: #f0e5cc;
  border-radius: 999px;
  display: block;
  height: 7px;
  overflow: hidden;
  width: 100%;
}

.owner-performance-fair-sales em {
  background: linear-gradient(90deg, #111722, #c68115);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.owner-performance-fair-open {
  background: transparent;
  border: 0;
  color: #bc7b09;
  font-size: 24px;
  font-weight: 950;
  line-height: 1;
  padding: 0;
}

@media (max-width: 980px) {
  .owner-performance-chart-stats,
  .owner-performance-chart-stats-two {
    grid-template-columns: 1fr;
  }

  .owner-performance-fair-row {
    grid-template-columns: 32px minmax(0, 1fr) 24px;
  }

  .owner-performance-fair-main,
  .owner-performance-fair-sales,
  .owner-performance-fair-metric {
    grid-column: 2;
  }

  .owner-performance-fair-open {
    grid-column: 3;
    grid-row: 1;
  }

  .owner-performance-fair-sales {
    justify-items: start;
  }

  .owner-performance-fair-sales strong {
    text-align: left;
  }
}

/* Online operations is a first-class FairFlow workspace, not a Fair report. */
body.online-operations-active .admin-toolbar,
body.online-operations-active .admin-tabs {
  display: none;
}

/* Unified Fair Flow workspaces: Fair operations, online operations and reports. */
.online-orders-panel {
  grid-column: 1 / -1;
  min-width: 0;
}

.online-workspace-nav {
  align-items: center;
  border-bottom: 1px solid rgba(174, 120, 8, 0.18);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 14px;
}

.online-workspace-nav button {
  background: #fffdf8;
  border: 1px solid #ead9ad;
  border-radius: 999px;
  color: #5c4720;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 760;
  padding: 10px 14px;
}

.online-workspace-nav button.is-active {
  background: linear-gradient(135deg, #f6b900, #e38a00);
  border-color: #e38a00;
  box-shadow: 0 8px 18px rgba(219, 139, 0, 0.2);
  color: #271900;
}

.online-workspace-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.online-workspace-summary > div {
  background: linear-gradient(135deg, #fff7d9, #fffdf8 76%);
  border: 1px solid #ebdcb5;
  border-radius: 16px;
  display: grid;
  gap: 4px;
  min-height: 88px;
  padding: 16px;
}

.online-workspace-summary span { color: #78684b; font-size: 13px; font-weight: 700; }
.online-workspace-summary strong { color: #2b2115; font-size: 30px; line-height: 1; }

.online-workspace-note {
  background: #fff8df;
  border: 1px solid #ebcd70;
  border-radius: 16px;
  color: #5f4717;
  padding: 16px 18px;
}

.online-workspace-note p { margin: 6px 0 0; }

.online-order-row { cursor: pointer; }
.online-order-row:hover td { background: #fff9e8; }

.online-order-workspace-dialog {
  background: transparent;
  border: 0;
  border-radius: 26px;
  max-width: min(920px, calc(100vw - 32px));
  padding: 0;
  width: 100%;
}

.online-order-workspace-dialog::backdrop { background: rgba(47, 39, 25, 0.5); backdrop-filter: blur(5px); }

.online-order-workspace-card {
  background: #fffdf8;
  border: 1px solid #ead8a0;
  border-radius: 26px;
  box-shadow: 0 28px 72px rgba(53, 38, 9, 0.28);
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 520px;
  overflow: hidden;
}

.online-order-workspace-steps {
  background: linear-gradient(180deg, #fff2ba, #fff9df);
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 26px 14px;
}

.online-order-workspace-steps button {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #3a2d1b;
  display: grid;
  gap: 10px;
  grid-template-columns: 26px minmax(0, 1fr);
  padding: 12px 10px;
  text-align: left;
}

.online-order-workspace-steps button.is-active {
  background: #fffdf8;
  border-color: #d29310;
  box-shadow: 0 8px 18px rgba(156, 106, 0, 0.12);
}

.online-order-workspace-steps b {
  align-items: center;
  background: #fff;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.online-order-workspace-steps .is-active b { background: #d9980c; color: #fff; }
.online-order-workspace-steps span { display: grid; font-size: 14px; font-weight: 900; line-height: 1.1; }
.online-order-workspace-steps small { color: #766444; font-size: 11px; font-weight: 700; margin-top: 3px; }

.online-order-workspace-main { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; padding: 28px 30px 20px; }
.online-order-workspace-head { align-items: start; display: flex; gap: 20px; justify-content: space-between; }
.online-order-workspace-head h2 { font-size: 28px; }
.online-order-workspace-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.online-order-workspace-chips span { background: #f3edd9; border-radius: 999px; color: #625438; font-size: 12px; font-weight: 800; padding: 6px 9px; }
.online-order-workspace-content { min-height: 0; padding: 20px 0; }

.online-order-workspace-callout {
  background: #fff2bd;
  border: 1px solid #ead58b;
  border-radius: 16px;
  color: #513f19;
  padding: 16px 18px;
}
.online-order-workspace-callout strong { font-size: 17px; }
.online-order-workspace-callout p { margin: 6px 0 0; }

.online-order-workspace-facts { display: grid; gap: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 16px 0 0; }
.online-order-workspace-facts div { border-bottom: 1px solid #eee4cb; min-height: 72px; padding: 14px 12px 14px 0; }
.online-order-workspace-facts .wide { grid-column: 1 / -1; }
.online-order-workspace-facts dt { color: #7b6a4c; font-size: 12px; font-weight: 800; }
.online-order-workspace-facts dd { color: #2f2519; font-size: 14px; font-weight: 800; line-height: 1.45; margin: 5px 0 0; }
.online-order-workspace-facts.compact div { min-height: 58px; }

.online-order-workspace-timeline { list-style: none; margin: 14px 0 0; padding: 0; }
.online-order-workspace-timeline li { align-items: center; border-bottom: 1px solid #eee4cb; display: grid; gap: 12px; grid-template-columns: 12px minmax(0, 1fr) auto; min-height: 70px; }
.online-order-workspace-timeline li > span { background: #d9980c; border-radius: 999px; height: 10px; width: 10px; }
.online-order-workspace-timeline li.done > span { background: #168255; }
.online-order-workspace-timeline strong { display: block; font-size: 14px; }
.online-order-workspace-timeline small { color: #77684f; display: block; margin-top: 4px; }
.online-order-workspace-timeline em { color: #7d6b4d; font-size: 12px; font-style: normal; }
.online-order-workspace-actions { align-items: center; border-top: 1px solid #eee4cb; display: flex; gap: 10px; justify-content: flex-end; padding-top: 16px; }

@media (max-width: 700px) {
  .online-order-workspace-card { grid-template-columns: 1fr; max-height: calc(100dvh - 24px); overflow-y: auto; }
  .online-order-workspace-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 12px; }
  .online-order-workspace-steps button { grid-template-columns: 1fr; padding: 8px; text-align: center; }
  .online-order-workspace-steps small { display: none; }
  .online-order-workspace-main { padding: 20px; }
  .online-order-workspace-facts { grid-template-columns: 1fr; }
  .online-order-workspace-facts .wide { grid-column: auto; }
}

@media (max-width: 760px) {
  .online-workspace-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .online-workspace-summary > div { min-height: 70px; padding: 13px; }
  .online-workspace-summary strong { font-size: 25px; }
}

.location-view-toggle {
  align-items: center;
  background: #fff8df;
  border: 1px solid #ecd27f;
  border-radius: 999px;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
}

.location-view-button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: #766b55;
  font-size: 14px;
  font-weight: 900;
  min-height: 38px;
  padding: 0 14px;
}

.location-view-button-active {
  background: linear-gradient(180deg, #ffdc58 0%, #f6bd18 100%);
  color: #21170c;
  box-shadow: 0 8px 18px rgba(184, 126, 0, 0.18);
}

.location-report-list {
  display: grid;
  gap: 0;
}

.location-report-chart {
  display: grid;
  gap: 12px;
}

.location-report-header,
.location-report-row {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 1.45fr) minmax(150px, 1fr) 90px 120px 80px;
  padding: 14px 16px;
}

.location-report-header {
  border-bottom: 1px solid #ecd27f;
  color: #766b55;
  font-size: 13px;
  font-weight: 900;
}

.location-report-row {
  align-items: center;
  border-bottom: 1px solid #f0d98b;
}

.location-report-row:last-child {
  border-bottom: 0;
}

.location-report-row strong,
.location-report-row span {
  color: #21170c;
  font-weight: 900;
}

.location-report-row small,
.location-report-row em {
  color: #766b55;
  display: block;
  font-size: 13px;
  font-style: normal;
  font-weight: 750;
  margin-top: 4px;
}

.location-chart-row {
  align-items: center;
  border: 1px solid #ecd27f;
  border-radius: 16px;
  display: grid;
  gap: 14px;
  grid-template-columns: 42px minmax(0, 1fr);
  padding: 16px;
}

.insight-drawer-backdrop {
  background: rgba(24, 18, 8, 0.28);
  inset: 0;
  position: fixed;
  z-index: 79;
}

.insight-drawer {
  background: #fffdf7;
  border-left: 1px solid #e8c968;
  box-shadow: -20px 0 54px rgba(84, 56, 0, 0.18);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  max-width: min(680px, 92vw);
  position: fixed;
  right: 0;
  top: 0;
  width: 680px;
  z-index: 80;
}

.insight-drawer-wide {
  border: 1px solid #e8c968;
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(84, 56, 0, 0.22);
  height: calc(100vh - 48px);
  left: 50%;
  max-width: min(1320px, calc(100vw - 48px));
  right: auto;
  top: 24px;
  transform: translateX(-50%);
  width: min(1320px, calc(100vw - 48px));
}

.location-detail-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.location-detail-layout > .insight-summary-grid,
.location-products-section,
.location-orders-section {
  grid-column: 1 / -1;
}

.insight-drawer-head {
  align-items: start;
  border-bottom: 1px solid #ecd27f;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 22px 24px;
}

.insight-drawer-head h2 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.05;
  margin: 4px 0 6px;
}

.insight-drawer-head span {
  color: #766b55;
  font-weight: 800;
}

.insight-drawer-close {
  align-items: center;
  background: #fffaf0;
  border: 1px solid #e4c35b;
  border-radius: 18px;
  color: #21170c;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 30px;
  font-weight: 950;
  height: 58px;
  justify-content: center;
  width: 58px;
}

.insight-drawer-body {
  display: grid;
  gap: 16px;
  overflow: auto;
  padding: 18px 24px 28px;
}

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

.insight-summary-grid div {
  background: #fff8df;
  border: 1px solid #ecd27f;
  border-radius: 14px;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
}

.insight-summary-grid span,
.insight-customer-profile span {
  color: #766b55;
  font-size: 13px;
  font-weight: 850;
}

.insight-summary-grid strong {
  color: #21170c;
  font-size: 20px;
  font-weight: 950;
  min-width: 0;
  overflow-wrap: anywhere;
}

.insight-section {
  background: #fff;
  border: 1px solid #ecd27f;
  border-radius: 18px;
  display: grid;
  gap: 10px;
  padding: 16px;
}

.insight-section h3 {
  font-size: 20px;
  margin: 0 0 4px;
}

.insight-compact-row,
.insight-order-row {
  align-items: center;
  border-top: 1px solid #f0d98b;
  display: grid;
  gap: 12px;
  padding: 12px 0;
}

.insight-compact-row:first-of-type,
.insight-order-row:first-of-type {
  border-top: 0;
}

.insight-compact-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.insight-compact-row div,
.insight-order-row div,
.insight-customer-profile {
  display: grid;
  gap: 4px;
}

.insight-compact-row span,
.insight-order-row span,
.insight-order-row small {
  color: #766b55;
  font-size: 13px;
  font-weight: 800;
}

.insight-compact-row strong,
.insight-order-row strong,
.insight-compact-row b,
.insight-order-row b {
  color: #21170c;
  font-weight: 950;
}

.insight-order-row {
  grid-template-columns: minmax(0, 1.35fr) minmax(130px, auto);
}

.insight-order-row small {
  overflow-wrap: anywhere;
}

.insight-order-actions {
  display: flex !important;
  flex-wrap: wrap;
  grid-column: 1 / -1;
}

.insight-order-actions .ghost-button {
  min-height: 38px;
  padding: 0 12px;
}

.insight-target-met {
  background: rgba(40, 142, 75, 0.06);
  border-radius: 12px;
  padding-left: 10px;
  padding-right: 10px;
}

.insight-target-met b {
  color: #187a3a;
}

.insight-target-miss {
  background: rgba(193, 39, 45, 0.06);
  border-radius: 12px;
  padding-left: 10px;
  padding-right: 10px;
}

.insight-target-miss b {
  color: #b3261e;
}

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

.commission-order-row {
  align-items: start;
  background: #fffdf6;
  border: 1px solid #f0d98b;
  border-radius: 14px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(90px, auto) minmax(90px, auto);
  padding: 12px;
}

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

.commission-order-row strong,
.commission-order-row b {
  color: #21170c;
  font-weight: 950;
}

.commission-order-row span,
.commission-order-row small {
  color: #766b55;
  font-size: 12px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.commission-order-row b {
  font-size: 16px;
  text-align: right;
}

.location-chart-rank {
  align-items: center;
  background: #fff3bf;
  border: 1px solid #f0d98b;
  border-radius: 14px;
  color: #bb8500;
  display: flex;
  font-size: 18px;
  font-weight: 950;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.location-chart-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.location-chart-heading {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-width: 0;
}

.location-chart-heading strong,
.location-chart-heading span {
  color: #21170c;
  font-weight: 950;
}

.location-chart-heading strong {
  display: block;
  font-size: 18px;
}

.location-chart-heading small,
.location-chart-meta {
  color: #766b55;
  font-size: 13px;
  font-weight: 800;
}

.location-chart-heading span {
  font-size: 18px;
  text-align: right;
  white-space: nowrap;
}

.location-chart-track {
  background: #fff4c7;
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
}

.location-chart-track i {
  background: linear-gradient(90deg, #f6bd18 0%, #d09300 100%);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.location-chart-meta {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.overview-section-heading h3 {
  color: #21170c;
  font-size: 17px;
  font-weight: 900;
}

.fair-kpi-grid div {
  align-content: center;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: none;
  min-height: 126px;
  min-width: 0;
  overflow: hidden;
  padding: 18px;
  position: relative;
}

.report-kpi::before {
  display: none;
}

.fair-kpi-grid span {
  color: #6f624b;
  display: block;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.2;
  min-width: 0;
}

.fair-kpi-grid strong {
  color: #21170c;
  display: block;
  font-size: clamp(24px, 1.65vw, 32px);
  font-weight: 950;
  line-height: 1.05;
  margin-top: 14px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fair-kpi-grid small {
  color: #7a6c55;
  display: block;
  font-size: 13px;
  line-height: 1.25;
  margin-top: 10px;
  min-width: 0;
}

.owner-reminders {
  border: 0;
  box-shadow: none;
  gap: 0;
  padding: 0;
}

.owner-reminder-item {
  align-items: center;
  background: transparent;
  border-top: 1px solid #f0dfac;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 28px 1fr auto;
  min-height: 48px;
  padding: 9px 0;
  text-align: left;
  width: 100%;
}

.owner-reminder-item:hover {
  background: #fff8df;
}

.owner-reminder-item:focus-visible {
  outline: 3px solid rgba(246, 197, 47, 0.38);
  outline-offset: 2px;
}

.owner-reminder-static {
  cursor: default;
  grid-template-columns: 28px 1fr;
}

.owner-reminder-static:hover {
  background: transparent;
}

.owner-reminder-item:first-child {
  border-top: 0;
}

.owner-reminder-item > span {
  align-items: center;
  color: #ef9a00;
  display: flex;
  font-size: 20px;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.owner-reminder-calendar > span::before {
  content: "◷";
}

.owner-reminder-warning > span::before {
  content: "⚠";
}

.owner-reminder-trophy > span::before {
  content: "♕";
}

.owner-reminder-item strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.owner-reminder-item small {
  color: #7a6c55;
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.owner-reminder-item b {
  color: #5f4d2d;
  font-size: 26px;
  font-weight: 500;
}

.daily-sales-list::before {
  color: #6f624b;
  content: "日期  净销售额  订单数  产品数量";
  display: grid;
  font-size: 12px;
  font-weight: 750;
  grid-template-columns: 1fr 1.2fr 0.7fr 0.8fr;
  padding: 0 2px 8px;
}

.daily-sales-row {
  background: transparent;
  border: 0;
  border-top: 1px solid #f0dfac;
  border-radius: 0;
  box-shadow: none;
  gap: 10px;
  grid-template-columns: minmax(120px, 0.9fr) minmax(120px, 1fr) minmax(92px, 0.65fr) 52px minmax(72px, 0.75fr);
  min-height: 39px;
  padding: 8px 2px;
}

.daily-sales-row strong,
.daily-sales-row span,
.daily-sales-row b {
  align-self: center;
  color: #21170c;
  font-size: 13px;
  font-weight: 750;
  margin: 0;
}

.daily-sales-row span,
.daily-sales-row b {
  text-align: right;
}

.daily-sales-bar {
  height: 14px;
}

.daily-total-row {
  background: #fff4cf;
  border-radius: 7px;
  padding-left: 8px;
  padding-right: 8px;
}

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

.product-composition-missing {
  align-items: center;
  background: linear-gradient(120deg, #fff9e8 0%, #ffffff 72%);
  border: 1px solid #ead29a;
  border-left: 4px solid #cf8d08;
  border-radius: 12px;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 16px 18px;
}

.product-composition-missing div {
  display: grid;
  gap: 4px;
}

.product-composition-missing span {
  color: #9a6900;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.product-composition-missing strong {
  color: #2c2115;
  font-size: 16px;
}

.product-composition-missing p {
  color: #726148;
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 720px) {
  .product-composition-missing {
    align-items: start;
    flex-direction: column;
  }
}

.major-product-grid div {
  border-radius: 9px;
  gap: 4px;
  min-height: 86px;
  padding: 12px;
  position: relative;
}

.major-product-grid span {
  color: #21170c;
  font-size: 14px;
}

.major-product-grid small {
  color: #7a6c55;
}

.major-product-grid b {
  bottom: 12px;
  color: #21170c;
  font-size: 18px;
  position: absolute;
  right: 12px;
}

.product-detail-list {
  border: 1px solid #f0dfac;
  border-radius: 9px;
  gap: 0;
  overflow: hidden;
}

.product-detail-list article {
  border: 0;
  border-top: 1px solid #f0dfac;
  border-radius: 0;
  grid-template-columns: 42px 1fr auto;
  padding: 10px 12px;
}

.product-detail-list article:first-child {
  border-top: 0;
}

.product-detail-list strong,
.product-detail-list b {
  font-size: 14px;
}

.product-detail-list span {
  font-size: 12px;
}

.product-total-row {
  background: #fff4cf;
}

.payment-overview-list {
  display: block;
}

.payment-overview-list .payment-donut {
  display: none;
}

.payment-overview-list .payment-legend {
  background: transparent;
  border: 0;
  border-radius: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  padding: 0;
}

.payment-overview-list .payment-row {
  background: #fffaf0;
  border: 1px solid #f0dfac;
  border-radius: 10px;
  display: grid;
  gap: 5px;
  min-height: 82px;
  min-width: 0;
  padding: 11px 12px;
}

.payment-overview-list .payment-row::before {
  display: none;
}

.payment-row span {
  color: #46391f;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.payment-row strong,
.payment-row small {
  font-size: 13px;
  line-height: 1.2;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
}

.payment-row strong {
  color: #21170c;
  font-size: clamp(16px, 1.2vw, 20px);
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
}

.payment-row small {
  color: #7a6c55;
  font-weight: 750;
}

.salesperson-overview-list {
  border: 1px solid #f0dfac;
  border-radius: 9px;
  gap: 0;
  overflow: hidden;
}

.salesperson-overview-list::before {
  color: #6f624b;
  content: "销售员        净销售额       订单       应付佣金";
  display: grid;
  font-size: 12px;
  font-weight: 750;
  grid-template-columns: 1fr 0.9fr 0.5fr 0.8fr;
  padding: 10px 12px;
}

.salesperson-row {
  border: 0;
  border-top: 1px solid #f0dfac;
  border-radius: 0;
  grid-template-columns: 1fr 0.9fr 0.5fr 0.8fr;
  padding: 10px 12px;
}

.salesperson-row strong,
.salesperson-row span,
.salesperson-row b {
  color: #21170c;
  font-size: 13px;
  font-weight: 750;
  margin: 0;
}

.salesperson-row span,
.salesperson-row b {
  text-align: right;
}

.salesperson-total-row {
  background: #fff4cf;
}

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

.closing-row {
  align-content: center;
  background: #fff;
  border-radius: 9px;
  gap: 9px;
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 128px;
  padding: 12px;
  text-align: center;
}

.closing-row strong {
  font-size: 15px;
}

.closing-row span {
  background: #fde8e8;
  border-radius: 8px;
  color: #d72e2e;
  font-size: 13px;
  font-weight: 900;
  margin: 0;
  padding: 8px 12px;
}

.closing-row small {
  color: #7a6c55;
  font-size: 12px;
  font-weight: 750;
}

.closing-row-done span {
  background: #eef8e9;
  color: #26823e;
}

@media (max-width: 980px) {
  .admin-view {
    padding: 16px 12px 26px;
  }

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

  .admin-toolbar .header-actions,
  .report-filter-panel .admin-filter-grid,
  .report-filter-panel .sales-filter-bar {
    display: none;
  }

  .admin-tabs {
    display: flex;
    overflow-x: auto;
  }

  .report-filter-panel .admin-filter-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-event-date-picker {
    display: flex;
  }

  .admin-toolbar h2 {
    font-size: 24px;
    text-align: center;
  }

  .admin-fair-strip {
    background: #fff;
    border: 1px solid #ecd27f;
    border-radius: 12px;
    display: grid;
    gap: 4px;
    grid-template-columns: 54px 1fr auto;
    padding: 18px;
  }

  .admin-fair-strip::before {
    color: #db8800;
    content: "▦";
    font-size: 36px;
    grid-row: span 2;
  }

  .admin-fair-select {
    border: 0;
    min-height: 0;
    min-width: 0;
    padding: 0;
  }

  .admin-fair-select strong {
    font-size: 21px;
  }

  .admin-fair-select span {
    display: none;
  }

  .admin-fair-date {
    font-size: 16px;
    grid-column: 2;
  }

  .fair-status-pill {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .report-filter-panel {
    border-radius: 12px;
    padding: 0;
  }

  .report-filter-panel .panel-heading {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 48px;
  }

  .report-filter-panel .panel-heading h2 {
    font-size: 16px;
  }

  .report-filter-panel .panel-heading::before {
    content: "≡";
    font-weight: 900;
    margin-right: 8px;
    transform: rotate(90deg);
  }

  .report-range-pill {
    display: none;
  }

  .admin-report-grid,
  .fair-kpi-grid,
  .closing-overview-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fair-kpi-grid,
  .owner-reminders-panel,
  .daily-section,
  .product-section,
  .payment-section,
  .team-section,
  .closing-section {
    grid-column: 1 / -1;
  }

  .fair-kpi-grid {
    gap: 10px;
  }

  .fair-kpi-grid div {
    min-height: 104px;
    padding: 14px;
  }

  .report-kpi::before {
    height: 38px;
    right: 12px;
    top: 12px;
    width: 38px;
  }

  .fair-kpi-grid span {
    font-size: 15px;
    padding-right: 46px;
  }

  .fair-kpi-grid strong {
    font-size: 24px;
  }

  .overview-section {
    border-radius: 12px;
    padding: 12px;
  }

  .daily-sales-list::before {
    content: "每日销售                         销售额        订单      件/盒";
    grid-template-columns: 1fr 0.8fr 0.45fr 0.45fr;
  }

  .daily-sales-row {
    grid-template-columns: minmax(110px, 1fr) minmax(110px, 1fr) 88px 40px 42px;
  }

  .daily-sales-row strong,
  .daily-sales-row span,
  .daily-sales-row b {
    font-size: 13px;
  }

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

  .payment-overview-list {
    grid-template-columns: 1fr;
  }

  .payment-overview-list .payment-donut {
    display: none;
  }

  .payment-overview-list .payment-legend {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  }

  .payment-overview-list .payment-row {
    align-content: center;
    grid-template-columns: 1fr;
    justify-items: start;
    text-align: left;
  }

  .payment-row span {
    font-size: 11px;
    white-space: normal;
  }

  .payment-row strong,
  .payment-row small {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .admin-view {
    padding: 16px 12px 22px;
  }

  .admin-report-grid {
    gap: 10px;
  }

  .fair-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .fair-kpi-grid div {
    border-radius: 12px;
    min-height: 102px;
  }

  .owner-reminder-item {
    min-height: 54px;
  }

  .daily-sales-row {
    grid-template-columns: minmax(95px, 1.1fr) minmax(80px, 1fr) 82px 32px 40px;
  }

  .daily-sales-bar {
    height: 8px;
  }

  .major-product-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .major-product-grid div {
    min-height: 88px;
    padding: 10px;
  }

  .product-detail-list article {
    grid-template-columns: 38px 1fr auto;
  }

  .payment-legend {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  }

  .payment-row span {
    font-size: 11px;
  }

  .payment-row strong {
    font-size: 16px;
  }

  .salesperson-overview-list::before {
    display: none;
  }

  .salesperson-row {
    grid-template-columns: 1fr auto auto;
  }

  .salesperson-row b {
    display: none;
  }

  .closing-overview-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .closing-row {
    min-height: 96px;
    padding: 10px 8px;
  }
}

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

  .history-panel {
    grid-column: 1 / -1;
  }

  .admin-grid,
  .admin-stats,
  .admin-filter-grid,
  .import-preview-grid,
  .online-filter-grid,
  .online-form-grid,
  .admin-sales-summary,
  .admin-sales-breakdown,
  .fair-overview-layout {
    grid-template-columns: 1fr 1fr;
  }

  .fair-overview-hero {
    grid-template-columns: 1fr;
  }

  .overview-meta-grid,
  .major-product-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body.menu-open.menu-receipts-mode .side-menu {
    max-width: 100vw;
    width: 100vw;
  }

  body.menu-open.menu-receipts-mode .menu-backdrop {
    opacity: 0;
  }

  body.menu-receipts-mode .side-menu-brand,
  body.menu-receipts-mode .menu-nav,
  body.menu-receipts-mode #menuSalesPanel,
  body.menu-receipts-mode #menuSettingsPanel {
    display: none;
  }

  body.menu-receipts-mode .history-panel {
    border-top: 0;
    padding: 18px 18px 24px;
  }

  body.menu-receipts-mode .history-panel .panel-heading {
    align-items: flex-start;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  body.menu-receipts-mode .history-panel h2 {
    font-size: 26px;
    line-height: 1.08;
  }

  body.menu-receipts-mode .history-panel .status-pill {
    flex: 0 0 auto;
  }

  body.menu-receipts-mode .history-close-button {
    display: inline-flex;
  }

  body.menu-receipts-mode .history-card {
    border-radius: 8px;
    padding: 14px;
  }

  body.menu-receipts-mode .history-top {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body.menu-receipts-mode .history-card h3,
  body.menu-receipts-mode .history-card p {
    min-width: 0;
  }

  body.menu-receipts-mode .history-card .product-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  body.menu-receipts-mode .history-card .product-actions button {
    min-height: 42px;
    padding-left: 8px;
    padding-right: 8px;
    width: 100%;
  }

  .app-header {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }

  .header-actions,
  .order-actions,
  .printer-tools {
    width: 100%;
  }

  .header-actions button,
  .header-actions select,
  .order-actions button,
  .printer-tools button {
    flex: 1 1 160px;
  }

  .workspace {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .catalog-panel .panel-heading,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .dialog-card .panel-heading {
    align-items: flex-start;
    flex-direction: row;
  }

  .dialog-card .panel-heading .icon-button {
    border-radius: 999px;
    font-size: 24px;
    min-height: 42px;
    padding: 0;
  }

  .customer-grid,
  .stats-grid,
  .admin-grid,
  .admin-stats,
  .admin-filter-grid,
  .import-preview-grid,
  .online-filter-grid,
  .online-form-grid,
  .sales-filter-bar,
  .sales-date-grid,
  .admin-sales-summary,
  .admin-sales-breakdown,
  .fair-overview-hero,
  .fair-overview-layout,
  .overview-meta-grid,
  .major-product-grid,
  .daily-sales-row {
    grid-template-columns: 1fr;
  }

  .daily-sales-row {
    align-items: stretch;
  }

  .admin-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .sales-mode .workspace {
    gap: 12px;
    grid-template-columns: 1fr;
  }

  .sales-mode .catalog-panel,
  .sales-mode .order-panel,
  .sales-mode .history-panel {
    padding: 14px;
  }

  .sales-mode .customer-grid {
    gap: 10px;
  }

  .sales-mode .product-card {
    gap: 10px;
  }

  .sales-mode .product-top,
  .sales-mode .history-top,
  .sales-mode .cart-line {
    gap: 10px;
  }

  .sales-mode .line-actions {
    justify-content: flex-end;
  }

  .sales-mode .order-actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin: 14px -14px -14px;
    padding: 10px 14px 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 26%);
  }

  .sales-mode #clearOrderButton {
    flex: 0.7 1 110px;
  }

  .sales-mode #saveBluetoothOrderButton,
  .sales-mode #savePrintOrderButton {
    flex: 1 1 150px;
  }

  .sales-mode #saveOrderButton {
    flex: 1.3 1 180px;
  }

  .pos-header {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    min-height: 58px;
    padding: 0 4px;
  }

  .ticket-title strong {
    font-size: 22px;
  }

  .pos-icon-button {
    height: 42px;
    width: 42px;
  }

  .language-toggle {
    font-size: 12px;
    gap: 4px;
    min-height: 34px;
    padding: 0 8px;
  }

  .pos-workspace {
    min-height: calc(100vh - 58px);
    padding: 14px 0 26px;
  }

  .pos-event-strip {
    border-left: 0;
    border-right: 0;
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: 0;
    padding: 11px 14px;
  }

  .pos-event-strip span {
    max-width: none;
    padding-bottom: 0;
    text-align: left;
  }

  .charge-button {
    margin: 10px auto 20px;
    min-height: 86px;
    width: calc(100% - 28px);
  }

  .catalog-panel {
    border-left: 0;
    border-right: 0;
    margin-top: 0;
  }

  .catalog-toolbar {
    grid-template-columns: minmax(0, 1fr) 82px;
  }

  .catalog-toolbar select,
  .catalog-toolbar input {
    min-height: 58px;
  }

  .catalog-toolbar input {
    min-width: 0;
    padding-inline: 9px;
  }

  .pos-product-card {
    grid-template-columns: 62px minmax(0, 1fr);
    min-height: 96px;
    padding-right: 14px;
  }

  .pos-product-card .product-top {
    align-items: start;
    gap: 8px;
  }

  .pos-product-card .tag {
    display: none;
  }

  .pos-product-card h3 {
    display: -webkit-box;
    font-size: 17px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: clip;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
  }

  .pos-product-card .price {
    align-self: center;
    font-size: 17px;
    line-height: 1.2;
    white-space: nowrap;
  }

  .pos-product-composition {
    font-size: 13px;
    margin-top: 4px;
    min-height: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .side-menu {
    max-width: 88vw;
    width: 340px;
  }

  .checkout-dialog .customer-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 420px) {
  .catalog-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .catalog-toolbar select {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }

  .catalog-toolbar input::placeholder {
    color: #8f8674;
  }

  .pos-product-card {
    gap: 10px;
    grid-template-columns: 54px minmax(0, 1fr);
    padding-left: 10px;
  }

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

  .pos-product-card .product-photo {
    height: 46px;
    width: 46px;
  }

  .pos-product-card h3 {
    font-size: 16px;
  }

  .pos-product-card .price {
    font-size: 16px;
  }

  .pos-product-composition {
    font-size: 12px;
  }

  .pos-product-actions .ghost-button {
    font-size: 13px;
  }
}

@media (max-width: 560px) {
  .admin-view .fair-kpi-grid div {
    padding: 14px 10px 12px;
  }

  .admin-view .report-kpi::before {
    display: none;
  }

  .admin-view .fair-kpi-grid span {
    font-size: 13px;
    padding-right: 0;
  }

  .admin-view .fair-kpi-grid strong {
    font-size: 21px;
    white-space: nowrap;
  }

  .admin-view .fair-kpi-grid small {
    font-size: 11px;
  }

  .admin-view .daily-sales-list::before {
    display: none;
  }

  .admin-view .daily-sales-row {
    background: #fff;
    border: 1px solid #f0dfac;
    border-radius: 10px;
    grid-template-columns: 1fr auto auto auto;
    padding: 12px;
  }

  .admin-view .daily-sales-row strong {
    order: 1;
  }

  .admin-view .daily-sales-row span:nth-of-type(1) {
    order: 2;
  }

  .admin-view .daily-sales-row span:nth-of-type(2) {
    order: 3;
  }

  .admin-view .daily-sales-row b {
    order: 4;
  }

  .admin-view .daily-sales-bar {
    grid-column: 1 / -1;
    order: 5;
  }

  .admin-view .daily-total-row {
    background: #fff4cf;
  }

  .admin-view .daily-total-row > div {
    display: none;
  }
}

@media (max-width: 760px) {
  .admin-view .fair-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .admin-view .payment-overview-list {
    grid-template-columns: 1fr;
  }

  .admin-view .closing-overview-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Local dashboard clarity prototype */
body.admin-mode {
  background:
    radial-gradient(circle at 18% -10%, rgba(255, 218, 95, 0.22), transparent 28rem),
    linear-gradient(180deg, #fffdf8 0%, #f7f5ef 100%);
}

body.admin-mode .admin-view {
  background: transparent;
  padding: 22px clamp(18px, 2vw, 32px) 34px;
}

body.admin-mode .admin-toolbar {
  align-items: end;
  grid-template-columns: minmax(250px, 0.55fr) minmax(0, 1.35fr) auto;
  margin-bottom: 14px;
}

body.admin-mode .admin-toolbar h2 {
  letter-spacing: 0;
}

body.admin-mode .admin-fair-strip {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  justify-self: start;
  min-width: 0;
}

body.admin-mode .admin-toolbar .header-actions {
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: max-content;
}

body.admin-mode .admin-fair-date {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.admin-mode .fair-status-pill {
  flex: 0 0 auto;
}

body.admin-mode .report-filter-panel,
body.admin-mode .overview-section,
body.admin-mode .fair-kpi-grid > div {
  background: rgba(255, 255, 255, 0.92);
  border-color: #ead38e;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(83, 60, 13, 0.055);
}

body.admin-mode .admin-report-grid {
  align-items: start;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.92fr);
}

body.admin-mode .fair-kpi-grid {
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.admin-mode .report-kpi {
  align-items: center;
  display: grid;
  gap: 4px 14px;
  grid-template-columns: minmax(0, 1fr) 48px;
  min-height: 116px;
  padding: 18px;
}

body.admin-mode .report-kpi::after {
  align-items: center;
  background: #fff4cf;
  border: 1px solid #f0d16e;
  border-radius: 999px;
  color: #d49400;
  content: "$";
  display: flex;
  font-size: 22px;
  font-weight: 950;
  grid-column: 2;
  grid-row: 1 / span 3;
  height: 48px;
  justify-content: center;
  width: 48px;
}

body.admin-mode .kpi-orders::after {
  content: "□";
}

body.admin-mode .kpi-products::after {
  content: "▣";
}

body.admin-mode .kpi-commission::after {
  content: "%";
}

body.admin-mode .fair-kpi-grid span,
body.admin-mode .fair-kpi-grid strong,
body.admin-mode .fair-kpi-grid small {
  min-width: 0;
  padding: 0;
}

body.admin-mode .fair-kpi-grid strong {
  font-size: clamp(26px, 2.25vw, 34px);
  line-height: 1.05;
  margin-top: 8px;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  word-break: keep-all;
}

body.admin-mode #adminSalesRangeGross,
body.admin-mode #adminSalesRangeRefunds {
  font-size: clamp(24px, 2vw, 32px);
}

body.admin-mode .owner-reminders-panel {
  display: none !important;
}

body.admin-mode .daily-section,
body.admin-mode .payment-section {
  grid-column: 1;
}

body.admin-mode .product-section,
body.admin-mode .team-section {
  grid-column: 2;
}

body.admin-mode .closing-section {
  grid-column: 1 / -1;
}

body.admin-mode .overview-section {
  border-radius: 22px;
  padding: 18px;
}

body.admin-mode .overview-section-heading {
  align-items: flex-start;
}

body.admin-mode .overview-section-heading h3 {
  font-size: 22px;
  letter-spacing: -0.035em;
}

body.admin-mode .overview-section-heading p {
  color: #756b58;
  font-size: 14px;
  font-weight: 800;
  margin: 4px 0 0;
}

body.admin-mode .daily-zero-toggle {
  border-radius: 999px;
  min-height: 40px;
  padding: 0 14px;
}

body.admin-mode .daily-sales-list::before {
  content: "";
  display: none;
}

body.admin-mode .daily-sales-row {
  background: #fff;
  border: 1px solid rgba(197, 148, 36, 0.18);
  border-radius: 16px;
  gap: 14px;
  grid-template-columns: minmax(118px, 0.8fr) minmax(160px, 1fr) minmax(120px, 0.7fr) minmax(86px, 0.55fr) minmax(96px, 0.62fr);
  min-height: 64px;
  padding: 12px 14px;
}

body.admin-mode .daily-sales-row + .daily-sales-row {
  margin-top: 9px;
}

body.admin-mode .daily-sales-row:not(.daily-total-row):hover {
  border-color: rgba(246, 191, 31, 0.55);
  box-shadow: 0 10px 24px rgba(104, 76, 20, 0.08);
  transform: translateY(-1px);
}

body.admin-mode .daily-sales-bar {
  background: #f5eddd;
  border-radius: 999px;
  height: 12px;
}

body.admin-mode .daily-sales-bar span {
  background: linear-gradient(90deg, #f6bf1f, #df9808);
  border-radius: inherit;
}

body.admin-mode .product-detail-list article {
  min-height: 58px;
}

body.admin-mode .report-side-tabs {
  background: #f9f1df;
  border-radius: 16px;
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 14px;
  padding: 5px;
}

body.admin-mode .report-side-tabs span,
body.admin-mode .report-side-tabs button {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 12px;
  color: #6d5e46;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  padding: 9px 6px;
  text-align: center;
}

body.admin-mode .report-side-tabs .active {
  background: #fff;
  box-shadow: 0 5px 14px rgba(101, 72, 16, 0.12);
  color: #21170c;
}

body.admin-mode .report-side-tabs button:hover,
body.admin-mode .report-side-tabs button:focus-visible {
  background: rgba(255, 255, 255, 0.7);
  color: #21170c;
  outline: 2px solid #d99600;
  outline-offset: 2px;
}

body.admin-mode .report-side-tabs button.active:hover,
body.admin-mode .report-side-tabs button.active:focus-visible {
  background: #fff;
}

body.admin-mode .overview-section-focus {
  box-shadow: 0 0 0 4px rgba(228, 165, 19, 0.22), 0 16px 34px rgba(93, 65, 15, 0.1);
}

body.admin-mode .payment-overview-list {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

body.admin-mode .payment-total-line {
  align-items: center;
  background: #fff8df;
  border: 1px solid #f0dfac;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 46px;
  padding: 10px 12px;
}

body.admin-mode .payment-total-line span {
  color: #6f624b;
  font-size: 13px;
  font-weight: 850;
}

body.admin-mode .payment-total-line strong {
  color: #21170c;
  font-size: clamp(17px, 1.35vw, 22px);
  font-weight: 950;
  overflow-wrap: anywhere;
  text-align: right;
}

body.admin-mode .payment-overview-list .payment-legend {
  display: grid;
  gap: 0;
  grid-template-columns: 1fr;
}

body.admin-mode .payment-overview-list .payment-row {
  align-items: center;
  background: transparent;
  border: 0;
  border-top: 1px solid #f0dfac;
  border-radius: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(100px, 1fr) minmax(120px, auto) minmax(44px, auto);
  min-height: 44px;
  padding: 9px 2px;
}

body.admin-mode .payment-overview-list .payment-row:first-child {
  border-top: 0;
}

body.admin-mode .payment-row strong,
body.admin-mode .payment-row small {
  text-align: right;
}

body.admin-mode .payment-row strong {
  font-size: 16px;
}

body.admin-mode .salesperson-row,
body.admin-mode .salesperson-overview-list::before {
  grid-template-columns: minmax(130px, 1fr) minmax(120px, 0.9fr) minmax(48px, 0.45fr) minmax(92px, 0.7fr);
}

body.admin-mode .closing-overview-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

body.admin-mode .closing-row {
  min-height: 96px;
}

/* Refined report UI: keep the dashboard as a true overview and move working detail into a dedicated surface. */
body.refined-report-ui .admin-report-grid > .overview-section {
  display: none !important;
}

body.refined-report-ui .test-overview-grid {
  display: grid;
  gap: 18px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
}

.test-overview-card {
  background: #ffffff;
  border: 1px solid #ead38e;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(83, 60, 13, 0.06);
  min-width: 0;
  overflow: hidden;
  padding: 22px;
  position: relative;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.test-overview-card::before {
  background: linear-gradient(90deg, #d9a726, #f4d36f 55%, transparent);
  content: "";
  height: 3px;
  left: 22px;
  opacity: 0.9;
  position: absolute;
  right: 38%;
  top: 0;
}

.test-overview-card--products,
.test-overview-card--daily {
  box-shadow: 0 16px 34px rgba(83, 60, 13, 0.085);
}

.test-overview-card--products::before,
.test-overview-card--daily::before {
  height: 4px;
  right: 24px;
}

.test-overview-card-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.test-overview-card h3 {
  color: #21170c;
  font-size: 23px;
  margin: 0;
}

.test-overview-card:hover {
  box-shadow: 0 16px 36px rgba(83, 60, 13, 0.1);
  transform: translateY(-1px);
}

.test-overview-card p {
  color: #76684f;
  font-size: 13px;
  font-weight: 700;
  margin: 5px 0 0;
}

.test-overview-card-head .ghost-button {
  background: #fff9e7;
  border-color: #e1bd5a;
  flex: 0 0 auto;
  font-size: 14px;
  min-height: 38px;
  padding: 8px 13px;
  white-space: nowrap;
}

.test-overview-card--products .ghost-button,
.test-overview-card--daily .ghost-button {
  background: #21170c;
  border-color: #21170c;
  color: #fffdf8;
}

.test-overview-card--products .ghost-button:hover,
.test-overview-card--products .ghost-button:focus-visible,
.test-overview-card--daily .ghost-button:hover,
.test-overview-card--daily .ghost-button:focus-visible {
  background: #49350f;
  border-color: #49350f;
}

.test-overview-card-head .ghost-button:active {
  transform: translateY(1px);
}

.test-overview-rows,
.workspace-simple-list {
  border-top: 1px solid #f0e1b3;
}

.test-overview-row {
  align-items: center;
  border-bottom: 1px solid #f0e8d2;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(100px, 0.9fr) minmax(110px, 1.3fr) minmax(100px, auto);
  min-height: 58px;
  padding: 10px 0;
  position: relative;
}

.test-overview-card--products .test-overview-row:first-child,
.test-overview-card--daily .test-overview-row:first-child {
  background: #fffaf0;
  border-radius: 10px;
  margin-inline: -10px;
  padding-inline: 10px;
}

.test-overview-row strong {
  color: #21170c;
  font-size: 15px;
}

.test-overview-row span {
  color: #76684f;
  font-size: 12px;
  font-weight: 750;
}

.test-overview-row b {
  color: #21170c;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  text-align: right;
}

.test-overview-card--salespeople .test-overview-row b,
.test-overview-card--payments .test-overview-row b {
  font-size: 17px;
}

body.refined-report-ui .major-product-grid > :nth-child(n + 4),
body.refined-report-ui .product-detail-list .product-detail-row:nth-of-type(n + 4) {
  display: none;
}

/* Test-edition controls share one restrained glass surface so actions feel connected without competing with the data. */
body.refined-report-ui button {
  -webkit-backdrop-filter: blur(12px) saturate(1.08);
  backdrop-filter: blur(12px) saturate(1.08);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 246, 216, 0.62));
  border-color: rgba(210, 163, 45, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 16px rgba(89, 61, 8, 0.09);
  color: #34240f;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

body.refined-report-ui button:hover,
body.refined-report-ui button:focus-visible {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.93), rgba(255, 233, 170, 0.72));
  border-color: rgba(183, 128, 10, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 9px 20px rgba(89, 61, 8, 0.14);
  outline: 0;
  transform: translateY(-1px);
}

body.refined-report-ui button:active {
  box-shadow: inset 0 1px 4px rgba(89, 61, 8, 0.15);
  transform: translateY(1px);
}

/* POS checkout stays high contrast: the payable amount is the primary sales action. */
body.refined-report-ui .charge-button {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 239, 182, 0.78));
  border: 1px solid rgba(194, 139, 14, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 12px 26px rgba(122, 82, 8, 0.13);
  color: #3a280d;
}

body.refined-report-ui .charge-button span {
  color: #21170c;
  display: inline-block;
  font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: -0.04em;
}

body.refined-report-ui .charge-button:hover,
body.refined-report-ui .charge-button:focus-visible {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 226, 137, 0.84));
  border-color: rgba(157, 104, 0, 0.9);
}

body.refined-report-ui .test-overview-card--products .ghost-button,
body.refined-report-ui .test-overview-card--daily .ghost-button {
  background: linear-gradient(135deg, rgba(55, 38, 12, 0.82), rgba(105, 75, 18, 0.68));
  border-color: rgba(237, 200, 104, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 237, 172, 0.28), 0 8px 18px rgba(54, 37, 9, 0.17);
  color: #fffdf8;
}

body.refined-report-ui .test-overview-card--products .ghost-button:hover,
body.refined-report-ui .test-overview-card--products .ghost-button:focus-visible,
body.refined-report-ui .test-overview-card--daily .ghost-button:hover,
body.refined-report-ui .test-overview-card--daily .ghost-button:focus-visible {
  background: linear-gradient(135deg, rgba(72, 50, 14, 0.91), rgba(137, 94, 13, 0.76));
  border-color: rgba(255, 222, 132, 0.86);
}

/* Step 1 — an executive filter summary, with the full form only on demand. */
body.refined-report-ui .report-filter-panel {
  -webkit-backdrop-filter: blur(16px) saturate(1.04);
  backdrop-filter: blur(16px) saturate(1.04);
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.88), rgba(255, 250, 237, 0.74));
  border-color: rgba(214, 174, 67, 0.58);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(83, 60, 13, 0.06);
  padding: 12px 16px;
}

body.refined-report-ui .admin-report-summary {
  gap: 20px;
}

body.refined-report-ui .admin-report-mark {
  background: rgba(255, 211, 71, 0.72);
  border: 1px solid rgba(194, 143, 20, 0.32);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
  font-size: 16px;
  height: 38px;
  width: 38px;
}

body.refined-report-ui .admin-report-title h2 {
  font-size: clamp(21px, 2vw, 28px);
  letter-spacing: -0.035em;
  margin-bottom: 3px;
}

body.refined-report-ui .admin-report-title p {
  color: #76684f;
  font-size: 13px;
  font-weight: 750;
}

body.refined-report-ui .admin-filter-toggle {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 241, 198, 0.58));
  border-color: rgba(205, 158, 39, 0.52);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 5px 14px rgba(89, 61, 8, 0.07);
  gap: 9px;
  min-height: 42px;
  min-width: 0;
  padding: 0 12px;
}

body.refined-report-ui .admin-filter-toggle strong {
  color: #87620f;
  max-width: 126px;
}

body.refined-report-ui .report-filter-panel:not(.is-collapsed) .report-filter-content {
  margin-top: 16px;
}

body.refined-report-ui .report-filter-section {
  border-color: rgba(234, 211, 142, 0.78);
}

body.refined-report-ui .report-filter-section-heading > span:not(.report-range-pill) {
  color: #806e4e;
}

@media (max-width: 720px) {
  body.refined-report-ui .admin-report-summary {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  body.refined-report-ui .admin-filter-toggle {
    justify-self: stretch;
  }

  body.refined-report-ui .admin-filter-toggle strong {
    max-width: none;
  }
}

/* Step 2 — KPI cards: one financial hero, three quieter operational signals. */
body.refined-report-ui .fair-kpi-grid {
  gap: 14px;
}

body.refined-report-ui .report-kpi {
  -webkit-backdrop-filter: blur(14px) saturate(1.03);
  backdrop-filter: blur(14px) saturate(1.03);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 250, 238, 0.7));
  border-color: rgba(234, 211, 142, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 11px 26px rgba(83, 60, 13, 0.055);
  min-height: 126px;
  position: relative;
}

body.refined-report-ui .report-kpi:not(.kpi-sales)::before {
  background: linear-gradient(90deg, #c69521, rgba(198, 149, 33, 0));
  bottom: 0;
  content: "";
  height: 2px;
  left: 18px;
  opacity: 0.54;
  position: absolute;
  right: 48%;
}

body.refined-report-ui .report-kpi::after {
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background: rgba(255, 245, 208, 0.66);
  border-color: rgba(214, 171, 56, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

body.refined-report-ui .report-kpi span {
  color: #76684f;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.01em;
}

body.refined-report-ui .report-kpi strong {
  color: #21170c;
  font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
  font-size: clamp(25px, 2.15vw, 33px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.055em;
}

body.refined-report-ui .report-kpi small {
  color: #8a795e;
  font-size: 12px;
  font-weight: 750;
}

body.refined-report-ui .report-kpi.kpi-sales {
  background: linear-gradient(135deg, #0d1d2d, #142436 68%, #2d210d);
  border-color: rgba(218, 170, 42, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 228, 140, 0.16), 0 14px 30px rgba(24, 20, 9, 0.16);
}

body.refined-report-ui .report-kpi.kpi-sales span,
body.refined-report-ui .report-kpi.kpi-sales small,
body.refined-report-ui .report-kpi.kpi-sales strong {
  color: #fffdf8;
}

body.refined-report-ui .report-kpi.kpi-sales::after {
  background: rgba(211, 148, 0, 0.16);
  border-color: rgba(240, 191, 65, 0.48);
  color: #ffbd2e;
}

body.refined-report-ui .report-kpi:hover {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 15px 32px rgba(83, 60, 13, 0.095);
}

/* KPI symbols are category cues only: never share the number's layout column. */
body.refined-report-ui .report-kpi {
  display: block;
  padding: 20px 72px 17px 20px;
}

body.refined-report-ui .report-kpi::after {
  font-size: 15px;
  height: 32px;
  position: absolute;
  right: 16px;
  top: 16px;
  width: 32px;
}

body.refined-report-ui .report-kpi strong {
  display: block;
  margin-top: 9px;
  overflow: visible;
  white-space: nowrap;
}

body.refined-report-ui .report-kpi small {
  display: block;
  margin-top: 12px;
}

/* A primary action stays dark enough for white text, even with the shared glass treatment. */
body.refined-report-ui .primary-button {
  background: linear-gradient(135deg, rgba(33, 23, 12, 0.92), rgba(85, 60, 15, 0.84));
  border-color: rgba(235, 198, 95, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 236, 173, 0.2), 0 8px 18px rgba(48, 33, 9, 0.17);
  color: #fffdf8;
}

body.refined-report-ui .primary-button:hover,
body.refined-report-ui .primary-button:focus-visible {
  background: linear-gradient(135deg, rgba(50, 34, 11, 0.96), rgba(122, 81, 12, 0.88));
  border-color: rgba(255, 222, 132, 0.84);
  color: #fffdf8;
}

/* Step 3 — each overview card gets a real-data marker, not a decorative chart. */
body.refined-report-ui .test-overview-row {
  grid-template-columns: 30px minmax(96px, 0.9fr) minmax(92px, 1.15fr) minmax(102px, auto);
}

.test-overview-marker {
  align-items: center;
  border: 1px solid rgba(214, 171, 56, 0.38);
  border-radius: 9px;
  color: #9a6700;
  display: inline-flex;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  height: 25px;
  justify-content: center;
  letter-spacing: 0.02em;
  width: 25px;
}

.test-overview-row--products .test-overview-rank {
  background: rgba(255, 247, 220, 0.72);
}

.test-overview-row--daily .test-overview-date {
  background: rgba(255, 248, 231, 0.86);
  color: #76684f;
}

.test-overview-row--payments .test-overview-payment {
  background: rgba(255, 237, 180, 0.42);
}

.test-overview-row--salespeople .test-overview-person {
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  color: #21170c;
}

body.refined-report-ui .test-overview-row--payments span {
  color: #9a6700;
}

@media (max-width: 720px) {
  body.refined-report-ui .crm-toolbar,
  body.refined-report-ui .crm-history-filters {
    grid-template-columns: 1fr;
  }

  body.refined-report-ui .test-overview-row {
    gap: 8px;
    grid-template-columns: 27px minmax(0, 1fr) auto;
  }

  body.refined-report-ui .test-overview-row > span {
    grid-column: 2;
  }

body.refined-report-ui .test-overview-row > b {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

/* Step 4 — CRM cards prioritise identity and repeat purchases over dense sentences. */
body.refined-report-ui .crm-card {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.9), rgba(255, 249, 233, 0.7));
  border-color: rgba(234, 211, 142, 0.86);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 20px rgba(83, 60, 13, 0.045);
  gap: 14px;
  padding: 18px 20px;
}

body.refined-report-ui .crm-card-heading {
  align-items: baseline;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

body.refined-report-ui .crm-card-heading strong:first-child {
  color: #21170c;
  font-size: 20px;
}

body.refined-report-ui .crm-card-heading strong:last-child {
  font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

body.refined-report-ui .crm-toolbar {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(420px, auto) minmax(240px, 320px);
}

body.refined-report-ui .crm-source-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
}

body.refined-report-ui .crm-source-toggle .is-active {
  background: #1e5b44;
  border-color: #1e5b44;
  color: #fff;
}

body.refined-report-ui .crm-history-filters {
  display: grid;
  gap: 9px;
  grid-template-columns: minmax(150px, 0.7fr) minmax(240px, 1.35fr);
}

body.refined-report-ui .crm-history-filters label {
  color: #76684f;
  display: grid;
  font-size: 11px;
  font-weight: 800;
  gap: 5px;
  letter-spacing: 0.02em;
}

body.refined-report-ui .crm-history-filters select,
body.refined-report-ui .crm-toolbar input {
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(222, 173, 47, 0.64);
  min-height: 44px;
}

body.refined-report-ui .crm-history-filters select:disabled {
  background: rgba(244, 238, 218, 0.72);
  color: #9a8c70;
}

body.refined-report-ui .crm-customer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

body.refined-report-ui .crm-customer-meta span {
  background: rgba(255, 249, 231, 0.82);
  border: 1px solid rgba(234, 211, 142, 0.72);
  border-radius: 999px;
  color: #76684f;
  font-size: 12px;
  font-weight: 750;
  padding: 5px 9px;
}

body.refined-report-ui .crm-card-content {
  align-items: stretch;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(225px, 0.42fr) minmax(0, 1fr);
}

body.refined-report-ui .crm-customer-summary {
  align-content: start;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 6px 0;
}

body.refined-report-ui .crm-customer-source {
  color: #786a52;
  display: grid;
  font-size: 12px;
  font-weight: 750;
  gap: 4px;
}

body.refined-report-ui .crm-customer-source span,
body.refined-report-ui .crm-customer-address {
  color: #786a52;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}

body.refined-report-ui .crm-purchase-panel {
  background: linear-gradient(135deg, rgba(255, 249, 231, 0.92), rgba(255, 255, 255, 0.72));
  border: 1px solid rgba(234, 211, 142, 0.72);
  border-radius: 13px;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 13px 14px 14px;
}

body.refined-report-ui .crm-purchase-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

body.refined-report-ui .crm-purchase-heading small {
  color: #5e4d2f;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

body.refined-report-ui .crm-purchase-heading span {
  color: #9a6700;
  font-size: 12px;
  font-weight: 850;
}

body.refined-report-ui .crm-purchase-chips {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

body.refined-report-ui .crm-purchase-chips > span {
  align-items: center;
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 243, 201, 0.58));
  border: 1px solid rgba(214, 171, 56, 0.42);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: #5e4d2f;
  display: flex;
  font-size: 12px;
  font-weight: 750;
  gap: 8px;
  justify-content: space-between;
  min-height: 38px;
  padding: 7px 9px;
}

body.refined-report-ui .crm-purchase-chips em {
  font-style: normal;
  line-height: 1.3;
  min-width: 0;
}

body.refined-report-ui .crm-purchase-chips b {
  color: #9a6700;
  flex: 0 0 auto;
  font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

body.refined-report-ui .crm-purchase-panel-empty p {
  color: #806e4e;
  font-size: 12px;
  margin: 0;
}

body.refined-report-ui .crm-card .product-actions {
  border-top: 1px solid rgba(234, 211, 142, 0.72);
  justify-content: flex-end;
  margin-top: 2px;
  padding-top: 13px;
}

body.refined-report-ui .crm-pagination {
  align-items: center;
  border-top: 1px solid rgba(234, 211, 142, 0.72);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 6px;
  padding: 16px 4px 2px;
}

body.refined-report-ui .crm-pagination > span {
  color: #746247;
  font-size: 13px;
  font-weight: 800;
}

body.refined-report-ui .crm-pagination > div {
  display: flex;
  gap: 8px;
}

@media (max-width: 720px) {
  body.refined-report-ui .crm-card-heading {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  body.refined-report-ui .crm-card-content {
    gap: 14px;
    grid-template-columns: 1fr;
  }

  body.refined-report-ui .crm-customer-summary {
    padding: 0;
  }

  body.refined-report-ui .crm-purchase-chips {
    grid-template-columns: 1fr;
  }

  body.refined-report-ui .crm-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  body.refined-report-ui .crm-pagination > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.report-workspace[hidden] {
  display: none;
}

.report-workspace {
  background: #fffdf8;
  inset: 0;
  min-height: 100dvh;
  overflow: auto;
  padding: clamp(20px, 3vw, 48px);
  position: fixed;
  z-index: 90;
}

.report-workspace-head {
  align-items: center;
  border-bottom: 1px solid #ebd994;
  display: grid;
  gap: 18px;
  grid-template-columns: auto minmax(170px, 1fr) minmax(240px, auto);
  margin: 0 auto;
  max-width: 1680px;
  padding: 0 0 20px;
}

.report-workspace-head h2 {
  color: #21170c;
  font-size: clamp(28px, 3vw, 42px);
  margin: 0;
}

.report-workspace-head .eyebrow {
  margin-bottom: 3px;
}

.report-workspace-back {
  white-space: nowrap;
}

.report-workspace-context {
  color: #71634b;
  display: grid;
  gap: 5px;
  font-size: 13px;
  font-weight: 800;
  justify-self: end;
  text-align: right;
}

.report-workspace-breadcrumb {
  align-items: center;
  color: #9a6700;
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 900;
  gap: 7px;
  justify-content: flex-end;
}

.report-workspace-breadcrumb b {
  color: #c7ad6a;
  font-weight: 700;
}

.report-workspace-body {
  margin: 28px auto 0;
  max-width: 1680px;
}

.workspace-kpi-strip {
  background: #fff;
  border: 1px solid #ead38b;
  border-radius: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 24px;
  overflow: hidden;
}

.workspace-kpi-strip > div {
  display: grid;
  gap: 7px;
  padding: 22px 26px;
}

.workspace-kpi-strip > div + div {
  border-left: 1px solid #efe2b4;
}

.workspace-kpi-strip span {
  color: #71634b;
  font-size: 13px;
  font-weight: 850;
}

.workspace-kpi-strip strong {
  color: #21170c;
  font-size: clamp(22px, 2.2vw, 32px);
}

.workspace-table-wrap {
  background: #fff;
  border: 1px solid #ead38b;
  border-radius: 16px;
  overflow: hidden;
}

.workspace-kpi-strip-simple {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 760px;
}

.workspace-report-facts {
  background: linear-gradient(120deg, #fffdf8, #fff7df);
  border: 1px solid #ead38b;
  border-radius: 16px;
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(300px, 0.66fr);
  margin-bottom: 20px;
  max-width: 820px;
  overflow: hidden;
}

.workspace-report-facts > div {
  display: grid;
  gap: 4px;
  padding: 15px 20px 16px;
}

.workspace-report-facts > div + div {
  border-left: 1px solid #eadcae;
}

.workspace-report-facts span {
  color: #806e4e;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.workspace-report-facts strong {
  color: #21170c;
  font-size: clamp(18px, 1.55vw, 23px);
  line-height: 1.2;
}

.workspace-simple-report {
  padding: 0 28px 4px;
}

.workspace-simple-report .workspace-section-heading {
  margin: 0;
  padding: 22px 0 15px;
}

.workspace-simple-report .workspace-section-heading > span {
  background: #fff5d8;
  border: 1px solid #ebc968;
  border-radius: 999px;
  color: #76500b;
  font-size: 13px;
  font-weight: 850;
  padding: 6px 11px;
}

.workspace-report-column-head,
.workspace-report-row {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: 32px minmax(220px, 1.5fr) minmax(132px, 0.46fr) minmax(156px, 0.7fr);
}

.workspace-report-column-head {
  border-bottom: 1px solid #eedda8;
  color: #817055;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  padding: 13px 0 11px;
}

.workspace-report-column-head span:nth-of-type(2),
.workspace-report-column-head span:nth-of-type(3) {
  text-align: right;
}

.workspace-report-row {
  border-bottom: 1px solid #f2e8c9;
  min-height: 76px;
  padding: 12px 0;
}

.workspace-report-row:last-child {
  border-bottom: 0;
}

.workspace-report-row:hover {
  background: linear-gradient(90deg, rgba(255, 246, 219, 0.7), rgba(255, 255, 255, 0));
}

.workspace-report-marker {
  align-items: center;
  background: #fff3cb;
  border: 1px solid #eec96d;
  border-radius: 9px;
  color: #9b6700;
  display: inline-flex;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  letter-spacing: 0.03em;
  width: 28px;
}

.workspace-report-row strong {
  color: #21170c;
  font-size: 17px;
  line-height: 1.3;
  min-width: 0;
  overflow-wrap: anywhere;
}

.workspace-report-row > span {
  color: #786a52;
  font-size: 14px;
  font-weight: 800;
  text-align: right;
}

.workspace-report-row > b {
  color: #21170c;
  font-size: 17px;
  text-align: right;
}

.workspace-simple-list {
  background: #fff;
  border: 1px solid #ead38b;
  border-radius: 16px;
  padding: 0 24px;
}

.workspace-table-head,
.workspace-table-row {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(110px, 1fr) minmax(130px, 1.25fr) 70px minmax(128px, 1fr) minmax(105px, 1fr) minmax(120px, 1.1fr) minmax(120px, auto);
  padding: 17px 24px;
}

.workspace-table-head {
  background: #fff8e4;
  color: #6f624b;
  font-size: 13px;
  font-weight: 900;
}

.workspace-table-row {
  border-top: 1px solid #f0e1b3;
  color: #312517;
  font-size: 15px;
  font-weight: 750;
}

.workspace-table-row:hover {
  background: #fffaf0;
}

.workspace-table-row strong,
.workspace-table-row b {
  color: #21170c;
  font-size: 16px;
}

.workspace-table-row span,
.workspace-table-row b {
  text-align: right;
}

.table-link-button {
  background: transparent;
  border: 0;
  color: #a26e05;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 6px 0;
  text-align: right;
  white-space: nowrap;
}

.table-link-button:hover,
.table-link-button:focus-visible {
  color: #6e4800;
  text-decoration: underline;
}

.workspace-detail-section,
.workspace-order-hero {
  background: #fff;
  border: 1px solid #ead38b;
  border-radius: 16px;
}

.workspace-detail-section {
  padding: 24px;
}

.workspace-section-heading {
  align-items: center;
  border-bottom: 1px solid #f0e1b3;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 16px;
}

.workspace-section-heading .eyebrow {
  margin: 0 0 3px;
}

.workspace-section-heading h3 {
  color: #21170c;
  font-size: 22px;
  margin: 0;
}

.workspace-section-heading > span,
.workspace-hint {
  color: #76684f;
  font-size: 13px;
  font-weight: 750;
}

.workspace-hint {
  margin: 14px 0 6px;
}

.workspace-order-list {
  display: grid;
}

.workspace-order-row {
  align-items: center;
  border-bottom: 1px solid #f0e8d2;
  cursor: pointer;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 17px 0;
  transition: background-color 160ms ease, padding 160ms ease;
}

.workspace-order-row:last-child {
  border-bottom: 0;
}

.workspace-order-row:hover,
.workspace-order-row:focus-visible {
  background: #fffaf0;
  outline: 0;
  padding-inline: 12px;
}

.workspace-order-row > div,
.workspace-order-row-side {
  display: grid;
  gap: 4px;
}

.workspace-package-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 6px;
}

.workspace-order-share {
  align-items: center;
  background: #f7f4ec;
  border: 1px solid #dfd4b9;
  border-radius: 999px;
  color: #655638 !important;
  display: inline-flex;
  font-size: 12px !important;
  justify-self: start;
  margin-top: 4px;
  padding: 4px 8px;
}

.workspace-order-share.is-shared {
  background: #fff0bc;
  border-color: #e5b42d;
  color: #775000 !important;
}

.workspace-package-chip {
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 248, 225, 0.64));
  border: 1px solid rgba(214, 171, 56, 0.42);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 4px 12px rgba(109, 75, 12, 0.07);
  color: #5e4d2f;
  display: inline-flex;
  font-size: 12px;
  font-weight: 750;
  gap: 4px;
  line-height: 1.25;
  padding: 6px 9px;
}

.workspace-package-chip b {
  color: #9a6700;
  font-size: inherit;
}

.workspace-order-row strong,
.workspace-order-row b {
  color: #21170c;
  font-size: 16px;
}

.workspace-order-row span,
.workspace-order-row small,
.workspace-order-row-side span {
  color: #76684f;
  font-size: 13px;
  font-weight: 700;
}

.workspace-order-row-side {
  justify-items: end;
  text-align: right;
}

.workspace-detail-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
}

.workspace-order-hero {
  align-items: end;
  background: linear-gradient(125deg, #21170c, #49350f);
  border-color: #21170c;
  color: #fffdf8;
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 28px;
}

.workspace-order-hero .eyebrow,
.workspace-order-hero span {
  color: #f4d36f;
}

.workspace-order-hero h3,
.workspace-order-hero strong {
  color: #fffdf8;
}

.workspace-order-hero h3 {
  font-size: clamp(25px, 3vw, 36px);
  margin: 4px 0;
}

.workspace-order-hero strong {
  font-size: clamp(28px, 3vw, 40px);
}

.workspace-customer-card {
  align-items: center;
  background: #fffaf0;
  border: 1px solid #ecd99f;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  padding: 18px;
}

.workspace-customer-card > div {
  display: grid;
  gap: 4px;
}

.workspace-customer-card strong,
.workspace-customer-card b {
  color: #21170c;
}

.workspace-customer-card span,
.workspace-customer-card small {
  color: #76684f;
  font-size: 13px;
  font-weight: 700;
}

.workspace-customer-card b {
  color: #a26e05;
  font-size: 14px;
}

.workspace-product-list article {
  align-items: center;
  border-bottom: 1px solid #f0e8d2;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 16px 0;
}

.workspace-product-list article:last-child {
  border-bottom: 0;
}

.workspace-product-list strong,
.workspace-product-list b {
  color: #21170c;
}

.workspace-product-list span {
  color: #76684f;
  font-size: 13px;
  font-weight: 700;
}

.customer-profile-editor {
  display: grid;
  gap: 16px;
}

.customer-profile-editor label {
  color: #312517;
  display: grid;
  font-size: 14px;
  font-weight: 850;
  gap: 7px;
}

.customer-profile-editor input,
.customer-profile-editor textarea {
  background: #fffdf8;
  border: 1px solid #e6cd82;
  border-radius: 12px;
  color: #21170c;
  font: inherit;
  min-height: 46px;
  padding: 11px 13px;
}

.customer-profile-editor textarea {
  min-height: 86px;
  resize: vertical;
}

.customer-profile-editor input:disabled,
.customer-profile-editor textarea:disabled {
  background: #faf6eb;
  color: #76684f;
  cursor: not-allowed;
}

.customer-profile-editor-note {
  background: #fff8e4;
  border-left: 3px solid #c69521;
  color: #6e5c3d;
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  padding: 11px 13px;
}

.customer-profile-editor-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

body.report-workspace-open {
  overflow: hidden;
}

@media (max-width: 980px) {
  body.refined-report-ui .test-overview-grid {
    grid-template-columns: 1fr;
  }

  .report-workspace {
    padding: 18px 14px;
  }

  .report-workspace-head {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .report-workspace-context {
    justify-self: start;
    text-align: left;
  }

  .report-workspace-breadcrumb {
    justify-content: flex-start;
  }

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

  .workspace-kpi-strip-simple {
    grid-template-columns: 1fr;
  }

  .workspace-kpi-strip > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid #efe2b4;
  }

  .workspace-kpi-strip > div:nth-child(4) {
    border-top: 1px solid #efe2b4;
  }

  .workspace-table-wrap {
    overflow-x: auto;
  }

  .workspace-table-head,
  .workspace-table-row {
    min-width: 940px;
  }

  .workspace-detail-grid {
    grid-template-columns: 1fr;
  }

  .workspace-order-row {
    align-items: start;
  }

  .workspace-report-facts {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .workspace-report-facts > div + div {
    border-left: 0;
    border-top: 1px solid #eadcae;
  }

  .workspace-report-column-head,
  .workspace-report-row {
    grid-template-columns: 30px minmax(0, 1fr) minmax(126px, auto);
  }

  .workspace-report-column-head span:nth-of-type(2),
  .workspace-report-row > span {
    display: none;
  }

  .workspace-report-column-head span:nth-of-type(3),
  .workspace-report-row > b {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .workspace-report-row > span {
    grid-column: 2;
  }
}

@media (max-width: 620px) {
  .workspace-simple-report {
    padding: 0 17px 4px;
  }

  .workspace-simple-report .workspace-section-heading {
    align-items: start;
    gap: 10px;
  }

  .workspace-report-row {
    gap: 11px;
    grid-template-columns: 28px minmax(0, 1fr) minmax(105px, auto);
  }

  .workspace-report-row strong,
  .workspace-report-row > b {
    font-size: 15px;
  }

  .workspace-report-marker {
    height: 26px;
    width: 26px;
  }
}

@media (max-width: 980px) {
  body.admin-mode .admin-toolbar {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  body.admin-mode .admin-report-grid {
    grid-template-columns: 1fr;
  }

  body.admin-mode .fair-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-mode .daily-section,
  body.admin-mode .product-section,
  body.admin-mode .payment-section,
  body.admin-mode .team-section,
  body.admin-mode .closing-section {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .fair-online-attribution {
    border-radius: 14px;
    padding: 14px;
  }

  .fair-online-attribution-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .fair-online-attribution-heading .ghost-button {
    width: 100%;
  }

  .fair-online-attribution-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fair-online-attribution-summary article {
    min-height: 76px;
    padding: 11px;
  }

  .fair-online-attribution-row {
    align-items: start;
  }

  .fair-online-attribution-row b {
    font-size: 14px;
  }

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

  .fair-compare-filter {
    width: 100%;
  }

  .fair-compare-row {
    align-items: start;
  }

  body.admin-mode .admin-tabs {
    background: #fff;
    border-radius: 12px;
    display: flex;
    gap: 6px;
    margin: 0 0 12px;
    overflow-x: auto;
    padding: 6px 16px;
    scroll-padding-inline: 16px;
    scrollbar-width: none;
  }

  body.admin-mode .admin-tabs::-webkit-scrollbar {
    display: none;
  }

  body.admin-mode .admin-tab {
    border-radius: 10px;
    flex: 0 0 auto;
    font-size: 13px;
    min-height: 38px;
    padding: 0 12px;
  }

  body.admin-mode .admin-view {
    padding: 14px 10px 24px;
  }

  body.admin-mode .report-filter-panel {
    padding: 12px;
  }

  body.admin-mode .admin-filter-toggle {
    align-items: center;
    background: #fffdfa;
    border: 1px solid #edcc66;
    border-radius: 10px;
    color: #21170c;
    display: grid;
    gap: 8px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 46px;
    padding: 0 12px;
    width: 100%;
  }

  body.admin-mode .admin-filter-toggle span {
    font-size: 15px;
    font-weight: 900;
  }

  body.admin-mode .admin-filter-toggle strong {
    color: #8a6c16;
    font-size: 12px;
    font-weight: 850;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.admin-mode .admin-filter-toggle b {
    color: #a87700;
    font-size: 18px;
    line-height: 1;
  }

  body.admin-mode .report-filter-panel.is-collapsed .admin-filter-grid,
  body.admin-mode .report-filter-panel.is-collapsed .admin-event-date-picker,
  body.admin-mode .report-filter-panel.is-collapsed .sales-filter-bar {
    display: none;
  }

  body.admin-mode .report-filter-panel:not(.is-collapsed) .admin-filter-grid,
  body.admin-mode .report-filter-panel:not(.is-collapsed) .sales-filter-bar {
    margin-top: 12px;
  }

  body.admin-mode .admin-fair-strip {
    box-sizing: border-box;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    width: 100%;
  }

  body.admin-mode .admin-fair-select,
  body.admin-mode .admin-fair-select strong,
  body.admin-mode .admin-fair-date {
    min-width: 0;
  }

  body.admin-mode .admin-fair-select strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.admin-mode .admin-fair-date {
    font-size: 12px;
    line-height: 1.25;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  body.admin-mode .report-filter-panel .panel-heading {
    justify-content: flex-start;
    min-height: auto;
    padding: 0 0 10px;
  }

  body.admin-mode .report-filter-panel .panel-heading::before,
  body.admin-mode .report-filter-panel .panel-heading .eyebrow {
    display: none;
  }

  body.admin-mode .report-filter-panel .panel-heading h2 {
    color: #21170c;
    font-size: 15px;
    font-weight: 900;
  }

  body.admin-mode .fair-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-mode .report-kpi {
    gap: 6px;
    grid-template-columns: 1fr;
    min-height: 116px;
    padding: 14px;
  }

  body.admin-mode .report-kpi::after {
    grid-column: 1;
    grid-row: 1;
    height: 34px;
    justify-self: end;
    width: 34px;
    font-size: 16px;
  }

  body.admin-mode .fair-kpi-grid span {
    font-size: 13px;
  }

  body.admin-mode .fair-kpi-grid strong,
  body.admin-mode #adminSalesRangeNet {
    font-size: clamp(22px, 7vw, 30px);
    line-height: 1.08;
  }

  body.admin-mode #adminSalesRangeGross,
  body.admin-mode #adminSalesRangeRefunds {
    font-size: clamp(19px, 5.3vw, 22px);
    white-space: nowrap;
  }

  body.admin-mode .daily-sales-list::before {
    display: none;
  }

  body.admin-mode .daily-sales-row {
    grid-template-columns: 1fr auto auto;
  }

  body.admin-mode .daily-sales-row strong {
    grid-column: 1;
  }

  body.admin-mode .daily-sales-bar {
    grid-column: 1 / -1;
  }

  body.admin-mode .daily-sales-row span:nth-of-type(1) {
    grid-column: 1;
    text-align: left;
  }

  body.admin-mode .daily-sales-row span:nth-of-type(2),
  body.admin-mode .daily-sales-row b {
    text-align: right;
  }

  body.admin-mode .major-product-grid {
    grid-template-columns: 1fr;
  }

  body.admin-mode .product-detail-list article {
    grid-template-columns: 42px 1fr;
  }

  body.admin-mode .product-detail-list article b {
    grid-column: 2;
    justify-self: start;
  }

  body.admin-mode .payment-overview-list .payment-row {
    grid-template-columns: 1fr auto;
  }

  body.admin-mode .payment-row small {
    grid-column: 1 / -1;
    text-align: left;
  }

  body.admin-mode .salesperson-row,
  body.admin-mode .salesperson-overview-list::before {
    grid-template-columns: 1fr auto auto;
  }

  body.admin-mode .salesperson-row b,
  body.admin-mode .salesperson-overview-list::before {
    font-size: 12px;
  }

  body.admin-mode [data-admin-panel="products"] .ranking-item,
  body.admin-mode [data-admin-panel="team"] .ranking-item,
  body.admin-mode [data-admin-panel="events"] .ranking-item {
    border-radius: 8px;
    gap: 10px;
    padding: 14px;
  }

  body.admin-mode .management-card-head {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
  }

  body.admin-mode .management-card-head strong {
    font-size: 18px;
    line-height: 1.15;
  }

  body.admin-mode .management-card-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
    justify-content: stretch;
    width: 100%;
  }

  body.admin-mode .product-management-heading {
    margin: -14px -14px 14px;
    padding: 14px;
  }

  body.admin-mode .product-management-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
  }

  body.admin-mode .product-management-actions button {
    width: 100%;
  }

  body.admin-mode .product-title-row {
    align-items: flex-start;
  }

  body.admin-mode .product-drag-handle {
    height: 34px;
    width: 34px;
  }

  body.admin-mode .management-card-actions .ghost-button {
    min-height: 40px;
    width: 100%;
  }

  body.admin-mode .management-card-meta {
    color: #6f624b;
    font-size: 14px;
  }

  body.admin-mode .user-event-chip {
    max-width: 100%;
  }

  body.admin-mode .user-event-details[open] .user-event-chip-list {
    max-height: 220px;
  }

  body.admin-mode [data-admin-panel="events"] .management-card-actions {
    grid-template-columns: 1fr minmax(130px, auto);
  }

  body.admin-mode [data-admin-panel="events"] .management-chip {
    justify-content: center;
    min-height: 40px;
  }

  body.admin-mode .event-region-group {
    border-radius: 12px;
    gap: 10px;
    padding: 12px;
  }

  body.admin-mode .event-region-heading {
    align-items: stretch;
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
  }

  body.admin-mode .event-region-heading h3 {
    font-size: 22px;
  }

  body.admin-mode .event-region-summary {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  body.admin-mode .event-region-summary .ghost-button,
  body.admin-mode .event-region-summary > span {
    justify-content: center;
    text-align: center;
    width: 100%;
  }
}

/* Mobile admin order cards */
@media (max-width: 760px) {
  body.admin-mode [data-admin-panel="orders"] .table-wrap {
    overflow: visible;
  }

  body.admin-mode [data-admin-panel="orders"] table,
  body.admin-mode [data-admin-panel="orders"] tbody,
  body.admin-mode [data-admin-panel="orders"] tr,
  body.admin-mode [data-admin-panel="orders"] td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  body.admin-mode [data-admin-panel="orders"] table {
    border: 0;
    min-width: 0;
  }

  body.admin-mode [data-admin-panel="orders"] thead {
    display: none;
  }

  body.admin-mode [data-admin-panel="orders"] tbody {
    display: grid;
    gap: 10px;
  }

  body.admin-mode [data-admin-panel="orders"] tr {
    background: #fff;
    border: 1px solid #ead38e;
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(83, 60, 13, 0.05);
    padding: 12px;
  }

  body.admin-mode [data-admin-panel="orders"] td {
    align-items: start;
    border: 0;
    display: grid;
    font-size: 13px;
    gap: 10px;
    grid-template-columns: minmax(78px, 0.36fr) minmax(0, 1fr);
    padding: 7px 0;
  }

  body.admin-mode [data-admin-panel="orders"] td::before {
    color: #7a6c55;
    content: attr(data-label);
    font-size: 12px;
    font-weight: 850;
  }

  body.admin-mode [data-admin-panel="orders"] td span {
    color: #7a6c55;
  }

  body.admin-mode [data-admin-panel="orders"] td[data-label="金额"] strong {
    color: #21170c;
    font-size: 18px;
  }

  body.admin-mode [data-admin-panel="orders"] td[data-label="操作"] {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
  }

  body.admin-mode [data-admin-panel="orders"] td[data-label="操作"]::before {
    display: none;
  }

  body.admin-mode [data-admin-panel="orders"] td[data-label="操作"] .ghost-button {
    flex: 1 1 88px;
    min-height: 38px;
  }
}

/* Checkout flow polish */
@media (max-width: 760px) {
  .sales-mode .checkout-dialog {
    border-radius: 14px 14px 0 0;
    max-height: 94vh;
  }

  .sales-mode .checkout-dialog .order-panel {
    padding: 14px;
  }

  .sales-mode .checkout-dialog .panel-heading {
    align-items: flex-start;
    gap: 6px;
  }

  .sales-mode .checkout-dialog .checkout-close-button {
    border-radius: 12px;
    font-size: 28px;
    height: 52px;
    width: 52px;
  }

  .sales-mode .checkout-dialog .cart-line {
    align-items: start;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .sales-mode .checkout-dialog .line-actions {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto;
    justify-content: stretch;
    width: 100%;
  }

  .sales-mode .checkout-dialog .quantity-control {
    grid-template-columns: 1fr 1.15fr 1fr;
    justify-self: stretch;
  }

  .sales-mode .checkout-dialog .customer-grid {
    gap: 12px;
  }

  .sales-mode .checkout-dialog .payment-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-mode .checkout-dialog .payment-choice {
    min-height: 46px;
  }

  .sales-mode .checkout-dialog .payment-split-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .sales-mode .checkout-dialog .payment-split-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sales-mode .checkout-dialog .totals {
    background: #fff8df;
    border: 1px solid #f0dfac;
    border-radius: 8px;
    margin-top: 14px;
    padding: 12px;
  }

  .sales-mode .checkout-dialog .order-actions {
    background: transparent;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 14px 0 0;
    padding: 0;
    position: static;
  }

  .sales-mode .checkout-dialog .order-actions button {
    flex: none;
    min-height: 48px;
    width: 100%;
  }

  .sales-mode .checkout-dialog #saveOrderButton {
    grid-column: 1 / -1;
    min-height: 54px;
  }

  .sales-mode .checkout-dialog #saveBluetoothOrderButton,
  .sales-mode .checkout-dialog #savePrintOrderButton {
    font-size: 14px;
  }
}

@media (max-width: 760px) {
  body.admin-mode .location-report-panel .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  body.admin-mode .location-view-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  body.admin-mode .location-report-header {
    display: none;
  }

  body.admin-mode .location-report-row {
    align-items: start;
    border: 1px solid #ecd27f;
    border-radius: 12px;
    gap: 8px;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 10px;
  }

  body.admin-mode .location-report-row div {
    grid-column: 1 / -1;
  }

  body.admin-mode .location-report-row span {
    background: #fff8df;
    border-radius: 8px;
    padding: 8px;
  }

  body.admin-mode .location-chart-row {
    align-items: start;
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 12px;
  }

  body.admin-mode .location-chart-rank {
    border-radius: 12px;
    font-size: 15px;
    height: 34px;
    width: 34px;
  }

  body.admin-mode .location-chart-heading {
    display: grid;
    gap: 6px;
  }

  body.admin-mode .commission-order-row,
  .commission-order-row {
    grid-template-columns: 1fr;
  }

  body.admin-mode .commission-order-row b,
  .commission-order-row b {
    text-align: left;
  }

  body.admin-mode .location-chart-heading span {
    font-size: 17px;
    text-align: left;
    white-space: normal;
  }

  body.admin-mode .location-chart-meta {
    display: grid;
    gap: 4px;
  }

  .insight-drawer {
    border-left: 0;
    max-width: 100vw;
    width: 100vw;
  }

  .insight-drawer-wide {
    border-radius: 0;
    height: 100vh;
    left: 0;
    max-width: 100vw;
    top: 0;
    transform: none;
    width: 100vw;
  }

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

  .insight-drawer-head {
    padding: 18px 18px 14px;
  }

  .insight-drawer-body {
    padding: 14px 16px 24px;
  }

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

  .insight-compact-row,
  .insight-order-row {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .insight-order-amount {
    align-items: start;
  }

  .closing-context-card {
    grid-template-columns: 1fr;
  }

  .closing-context-date {
    text-align: left;
  }

  .fair-picker-dialog {
    max-width: calc(100vw - 20px);
    width: calc(100vw - 20px);
  }

  .fair-picker-panel {
    max-height: calc(100vh - 20px);
  }

  .fair-picker-head {
    padding: 18px;
  }

  .fair-picker-head h2 {
    font-size: 26px;
  }

  .fair-picker-search-row {
    grid-template-columns: 1fr;
  }

  .fair-picker-search input {
    font-size: 16px;
  }

  .fair-picker-chip {
    min-height: 48px;
  }

  .fair-picker-event {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .fair-picker-event b {
    white-space: normal;
  }
}

/* React Bits-inspired polish: Magic Bento cards, Pill Nav tabs, and Animated Content. */
.rb-magic-card {
  --rb-x: 50%;
  --rb-y: 50%;
  isolation: isolate;
  overflow: hidden;
  position: relative;
  transform: translateZ(0);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.rb-magic-card::before {
  background:
    radial-gradient(
      320px circle at var(--rb-x) var(--rb-y),
      rgba(255, 207, 48, 0.28),
      rgba(255, 230, 123, 0.12) 34%,
      transparent 64%
    );
  content: "";
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transition: opacity 0.2s ease;
  z-index: 0;
}

.rb-magic-card > * {
  position: relative;
  z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
  .rb-magic-card:hover {
    border-color: rgba(214, 160, 0, 0.62);
    box-shadow: 0 18px 44px rgba(128, 91, 0, 0.12);
    transform: translateY(-2px);
  }

  .rb-magic-card:hover::before {
    opacity: 1;
  }
}

.rb-pill-nav {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 235, 0.92)),
    rgba(255, 255, 255, 0.92);
  border-color: rgba(228, 190, 86, 0.72);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 8px 26px rgba(128, 91, 0, 0.06);
  gap: 6px;
  padding: 6px;
}

.rb-pill-nav .admin-tab {
  border-radius: 999px;
  min-height: 42px;
  padding: 10px 18px;
  transition:
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.rb-pill-nav .admin-tab-active {
  background: linear-gradient(180deg, #ffe37a 0%, #ffc928 100%);
  box-shadow: 0 9px 22px rgba(210, 151, 0, 0.22);
}

@media (hover: hover) and (pointer: fine) {
  .rb-pill-nav .admin-tab:hover {
    background: rgba(255, 239, 180, 0.72);
    color: var(--ink);
    transform: translateY(-1px);
  }

  .rb-pill-nav .admin-tab-active:hover {
    background: linear-gradient(180deg, #ffe37a 0%, #ffc928 100%);
  }
}

.rb-animated-content:not([hidden]) {
  animation: rb-content-enter 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes rb-content-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 720px) {
  .rb-pill-nav {
    border-radius: 18px;
  }

  .rb-pill-nav .admin-tab {
    min-height: 44px;
    padding: 10px 15px;
  }

  body.admin-mode .fair-kpi-grid strong {
    font-size: clamp(20px, 6vw, 26px);
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }
}

@media (max-width: 480px) {
  body.admin-mode .fair-kpi-grid {
    grid-template-columns: 1fr;
  }

  body.admin-mode .report-kpi {
    min-height: 106px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rb-magic-card,
  .rb-magic-card::before,
  .rb-pill-nav .admin-tab,
  .rb-animated-content:not([hidden]) {
    animation: none;
    transition: none;
  }
}

/* Product management: React Bits-inspired MagicBento cards. */
.admin-product-bento-grid {
  align-items: stretch;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.admin-product-bento-grid .admin-product-item {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 213, 74, 0.16), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 252, 242, 0.96));
  border-color: rgba(226, 190, 90, 0.78);
  border-radius: 14px;
  color: #241a10;
  display: grid;
  gap: 14px;
  grid-template-rows: 1fr auto;
  min-height: 216px;
  opacity: 1;
  padding: 16px;
}

.admin-product-bento-grid .admin-product-item:not(.pending-item) {
  animation: product-card-enter 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(min(var(--product-index, 0), 10) * 28ms);
}

.admin-product-card-main {
  align-items: flex-start;
  display: grid !important;
  gap: 14px;
  grid-template-columns: 72px minmax(0, 1fr);
}

.admin-product-thumb {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 248, 224, 0.98), rgba(255, 239, 178, 0.82));
  border: 1px solid rgba(235, 199, 91, 0.78);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: #b57a00;
  display: flex !important;
  flex: 0 0 auto;
  font-size: 28px;
  font-weight: 950;
  height: 72px;
  justify-content: center;
  overflow: hidden;
  width: 72px;
}

.admin-product-thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.admin-product-copy {
  display: grid !important;
  gap: 10px;
  min-width: 0;
}

.admin-product-bento-grid .management-card-head {
  align-items: flex-start;
  display: flex !important;
  gap: 10px;
  justify-content: space-between;
}

.admin-product-bento-grid .management-card-head strong {
  color: #241a10;
  display: block;
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.admin-product-bento-grid .management-chip {
  background: rgba(255, 245, 207, 0.92);
  color: #9a6900;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-product-meta-grid {
  display: grid !important;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-product-meta-pill {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(238, 209, 125, 0.7);
  border-radius: 10px;
  color: var(--ink);
  display: grid !important;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px;
}

.admin-product-meta-pill small {
  color: #8a7b61;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.admin-product-meta-pill b {
  color: #241a10;
  font-size: 15px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.admin-product-sku {
  background: rgba(255, 247, 218, 0.7);
  border: 1px dashed rgba(221, 184, 82, 0.75);
  border-radius: 999px;
  color: #776a51;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  justify-self: start;
  max-width: 100%;
  overflow: hidden;
  padding: 5px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-product-bento-grid .management-card-actions {
  align-items: center;
  align-self: end;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  width: 100%;
}

.admin-product-bento-grid .management-card-actions .ghost-button,
.admin-product-bento-grid .management-card-actions .compact-button {
  border-radius: 12px;
  min-height: 42px;
  padding: 10px 14px;
}

.admin-product-bento-grid.product-arrange-list {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.admin-product-bento-grid.admin-product-lanes-grid {
  align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.admin-product-lane {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 217, 74, 0.14), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 251, 238, 0.96));
  border: 1px solid rgba(226, 190, 90, 0.78);
  border-radius: 18px;
  box-shadow: 0 16px 38px rgba(128, 91, 0, 0.06);
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
}

.admin-product-lane-head {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 4px 4px 10px;
}

.admin-product-lane-head span {
  color: #b57a00;
  display: block;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-product-lane-head strong {
  color: #241a10;
  display: block;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.05;
  margin-top: 3px;
}

.admin-product-lane-head b {
  background: rgba(255, 241, 187, 0.9);
  border: 1px solid rgba(232, 194, 87, 0.72);
  border-radius: 999px;
  color: #a36d00;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 950;
  padding: 8px 12px;
}

.admin-product-lane-list {
  display: grid;
  gap: 10px;
}

.admin-product-lanes-grid .admin-product-lane .admin-product-item {
  animation-delay: calc(min(var(--product-index, 0), 8) * 18ms);
  border-radius: 14px;
  box-shadow: none;
  min-height: 0;
  padding: 14px;
}

.admin-product-lanes-grid .admin-product-lane .admin-product-card-main {
  grid-template-columns: 62px minmax(0, 1fr);
}

.admin-product-lanes-grid .admin-product-lane .admin-product-thumb {
  height: 62px;
  width: 62px;
}

.admin-product-lanes-grid .admin-product-lane .admin-product-meta-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-product-bento-grid .product-arrange-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-product-bento-grid .product-arrange-controls .compact-button {
  min-width: 0;
  width: 100%;
}

.product-management-actions {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 249, 228, 0.9));
  border: 1px solid rgba(232, 198, 98, 0.64);
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(155, 103, 0, 0.08);
  padding: 6px;
}

.product-management-actions .ghost-button,
.product-management-actions .primary-button {
  border-radius: 999px;
}

@keyframes product-card-enter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 760px) {
  .admin-product-bento-grid,
  .admin-product-bento-grid.product-arrange-list,
  .admin-product-bento-grid.admin-product-lanes-grid {
    grid-template-columns: 1fr;
  }

  .admin-product-card-main {
    position: relative;
    grid-template-columns: 1fr;
  }

  .admin-product-thumb {
    border-radius: 12px;
    font-size: 22px;
    height: 58px;
    position: absolute;
    right: 0;
    top: 0;
    width: 58px;
  }

  .admin-product-copy {
    padding-right: 72px;
  }

  .admin-product-meta-grid {
    grid-template-columns: 1fr;
  }

  .admin-product-bento-grid .management-card-head {
    display: grid !important;
    grid-template-columns: 1fr auto;
  }

  .admin-product-bento-grid .management-card-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-product-bento-grid .product-arrange-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-management-actions {
    border-radius: 16px;
    padding: 8px;
  }

  .admin-product-lane {
    border-radius: 16px;
    padding: 12px;
  }

  .admin-product-lane-head {
    align-items: flex-start;
  }

  .admin-product-lanes-grid .admin-product-lane .admin-product-card-main {
    grid-template-columns: 1fr;
  }

  .admin-product-lanes-grid .admin-product-lane .admin-product-meta-grid {
    grid-template-columns: 1fr;
  }
}

/* Modern POS dashboard preview shell */
.admin-desktop-sidebar {
  display: none;
}

@media (min-width: 1180px) {
  body.admin-mode {
    background:
      radial-gradient(circle at 55% -12%, rgba(255, 212, 76, 0.18), transparent 28rem),
      linear-gradient(180deg, #fffdf8 0%, #f8f6f0 48%, #fffaf0 100%);
  }

  body.admin-mode .admin-desktop-sidebar {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 251, 240, 0.92)),
      #fff;
    border-right: 1px solid rgba(224, 190, 105, 0.58);
    box-shadow: 18px 0 50px rgba(82, 58, 8, 0.055);
    color: #22190f;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 16px;
    height: 100dvh;
    left: 0;
    overflow-y: auto;
    padding: 22px 16px 26px;
    position: fixed;
    top: 0;
    width: 248px;
    z-index: 30;
  }

  body.admin-mode .admin-sidebar-brand {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 0 8px 14px;
  }

  body.admin-mode .admin-sidebar-brand img {
    aspect-ratio: 1;
    height: 44px;
    object-fit: contain;
    width: 44px;
  }

  body.admin-mode .admin-sidebar-brand strong {
    display: block;
    font-size: 22px;
    font-weight: 950;
    line-height: 1;
  }

  body.admin-mode .admin-sidebar-brand span {
    color: #d28400;
    display: block;
    font-size: 11px;
    font-weight: 850;
    margin-top: 3px;
  }

  body.admin-mode .admin-sidebar-modules {
    align-content: start;
    display: grid;
    gap: 12px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-color: rgba(200, 142, 0, 0.34) transparent;
    scrollbar-width: thin;
  }

  body.admin-mode .admin-sidebar-modules::-webkit-scrollbar {
    width: 5px;
  }

  body.admin-mode .admin-sidebar-modules::-webkit-scrollbar-thumb {
    background: rgba(200, 142, 0, 0.34);
    border-radius: 999px;
  }

  body.admin-mode .admin-sidebar-module {
    display: grid;
    gap: 6px;
  }

  body.admin-mode .admin-rail-module {
    align-items: center;
    background: linear-gradient(135deg, #fffdf7, #fff4cb);
    border: 1px solid rgba(224, 181, 65, 0.55);
    border-radius: 24px;
    color: #2b2115;
    display: grid;
    gap: 12px;
    grid-template-columns: 48px minmax(0, 1fr) 14px;
    min-height: 76px;
    padding: 10px 13px;
    text-align: left;
    transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  }

  body.admin-mode .admin-rail-module:hover,
  body.admin-mode .admin-sidebar-module.is-expanded .admin-rail-module {
    background: radial-gradient(circle at 100% 0%, rgba(255, 205, 61, 0.28), transparent 62%), #fff1c8;
    box-shadow: inset 6px 0 0 #f5a400, 0 16px 32px rgba(150, 100, 0, 0.09);
  }

  body.admin-mode .admin-rail-module > span {
    display: grid;
    font-size: 17px;
    font-weight: 950;
    line-height: 1.08;
  }

  body.admin-mode .admin-rail-module small {
    color: #74684d;
    font-size: 11px;
    font-weight: 750;
    margin-top: 3px;
  }

  body.admin-mode .admin-rail-module > i {
    color: #b98200;
    font-size: 22px;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
    transition: transform 160ms ease;
  }

  body.admin-mode .admin-sidebar-module.is-expanded .admin-rail-module > i {
    transform: rotate(90deg);
  }

  body.admin-mode .admin-rail-submenu {
    display: grid;
    gap: 5px;
    padding: 0 0 6px;
  }

  body.admin-mode .admin-rail-submenu .admin-rail-link {
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 56px;
    padding: 7px 10px;
  }

  body.admin-mode .admin-rail-submenu .admin-rail-link span {
    font-size: 14px;
  }

  body.admin-mode .admin-rail-submenu .admin-rail-link small {
    font-size: 10px;
  }

  body.admin-mode .admin-rail-submenu .admin-rail-icon {
    border-radius: 15px;
    font-size: 19px;
    height: 42px;
    width: 42px;
  }

  body.admin-mode .admin-sidebar-section {
    display: grid;
    gap: 10px;
  }

  body.admin-mode .admin-sidebar-section > span {
    color: #897b62;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    padding: 0 14px 3px;
    text-transform: uppercase;
  }

  body.admin-mode .admin-rail-link {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 28px;
    color: #2b2115;
    display: grid;
    gap: 16px;
    grid-template-columns: 62px minmax(0, 1fr);
    min-height: 82px;
    padding: 10px 16px;
    text-align: left;
  }

  body.admin-mode .admin-rail-link span {
    display: grid;
    font-size: 19px;
    font-weight: 900;
    line-height: 1.08;
  }

  body.admin-mode .admin-rail-link small {
    color: #74684d;
    font-size: 13px;
    font-weight: 750;
    margin-top: 5px;
  }

  body.admin-mode .admin-rail-icon {
    align-items: center;
    background: #fff7d9;
    border: 1px solid transparent;
    border-radius: 22px;
    color: #cf8500;
    display: flex;
    font-size: 28px;
    height: 62px;
    justify-content: center;
    line-height: 1;
    width: 62px;
  }

  body.admin-mode .admin-rail-link.admin-tab-active,
  body.admin-mode .admin-rail-link:hover {
    background:
      radial-gradient(circle at 100% 0%, rgba(255, 205, 61, 0.2), transparent 62%),
      #fff3d2;
    box-shadow: inset 6px 0 0 #f5a400, 0 16px 32px rgba(150, 100, 0, 0.09);
    color: #a96d00;
  }

  body.admin-mode .admin-rail-link.admin-tab-active .admin-rail-icon,
  body.admin-mode .admin-rail-link:hover .admin-rail-icon {
    background: linear-gradient(180deg, #ffcf39, #f6a400);
    border-color: rgba(182, 117, 0, 0.22);
    color: #fff;
  }

  body.admin-mode .admin-sidebar-footer {
    align-self: end;
    border-top: 1px solid rgba(224, 190, 105, 0.54);
    color: #74684d;
    display: grid;
    gap: 5px;
    margin-top: 10px;
    padding: 12px 6px 0;
  }

  body.admin-mode .admin-sidebar-footer span {
    color: #9b8b70;
    font-size: 11px;
    font-weight: 800;
  }

  body.admin-mode .admin-sidebar-footer strong {
    color: #078b5d;
    font-size: 12px;
    font-weight: 850;
  }

  body.admin-mode .pos-header,
  body.admin-mode .admin-view {
    margin-left: 248px;
  }

  body.admin-mode .pos-header {
    backdrop-filter: blur(18px);
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid rgba(224, 190, 105, 0.58);
    box-shadow: none;
    min-height: 74px;
    position: sticky;
    top: 0;
    z-index: 20;
  }

  body.admin-mode #menuButton {
    display: none;
  }

  body.admin-mode .pos-header::before {
    content: "";
    display: none;
  }

  body.admin-mode .pos-header-actions {
    grid-column: 4;
  }

  body.admin-mode .admin-view {
    padding: 24px 30px 34px;
  }

  body.admin-mode .admin-toolbar {
    align-items: center;
    grid-template-columns: minmax(260px, auto) minmax(280px, 1fr) auto;
    margin-bottom: 18px;
  }

  body.admin-mode .admin-toolbar h2 {
    font-size: clamp(34px, 3vw, 50px);
  }

  body.admin-mode .admin-toolbar .header-actions {
    gap: 12px;
  }

  body.admin-mode .admin-toolbar .header-actions button,
  body.admin-mode .language-toggle {
    border-radius: 14px;
  }

  body.admin-mode .admin-tabs {
    backdrop-filter: blur(18px);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 251, 240, 0.88)),
      #fff;
    border: 1px solid rgba(224, 190, 105, 0.62);
    border-radius: 999px;
    box-shadow: 0 14px 42px rgba(76, 54, 12, 0.09);
    justify-content: center;
    margin: 0 auto 18px;
    max-width: 860px;
    position: static;
    top: auto;
    z-index: 12;
  }

  body.admin-mode .admin-tab {
    border-radius: 999px;
    min-width: 96px;
  }

  body.admin-mode .report-filter-panel {
    border-radius: 18px;
    box-shadow: 0 18px 52px rgba(76, 54, 12, 0.075);
    margin-bottom: 18px;
  }

  body.admin-mode .fair-kpi-grid {
    gap: 16px;
  }

  body.admin-mode .report-kpi {
    border-radius: 18px;
    min-height: 150px;
    padding: 24px;
  }

  body.admin-mode .fair-kpi-grid > .kpi-sales {
    background:
      radial-gradient(circle at 14% 82%, rgba(255, 167, 0, 0.26), transparent 28%),
      linear-gradient(135deg, #102031 0%, #09131f 100%);
    border-color: rgba(255, 176, 0, 0.72);
    box-shadow: 0 18px 50px rgba(9, 19, 31, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: #fff;
  }

  body.admin-mode .fair-kpi-grid > .kpi-sales span,
  body.admin-mode .fair-kpi-grid > .kpi-sales small {
    color: rgba(255, 255, 255, 0.78);
  }

  body.admin-mode .fair-kpi-grid > .kpi-sales strong {
    color: #fff;
  }

  body.admin-mode .fair-kpi-grid > .kpi-sales::after {
    background: rgba(255, 166, 0, 0.16);
    border-color: rgba(255, 178, 35, 0.42);
    color: #ffb21f;
  }

  body.admin-mode .fair-kpi-grid > .kpi-sales::before {
    background:
      linear-gradient(135deg, transparent 0 18%, rgba(255, 169, 0, 0.95) 18% 22%, transparent 22% 38%, rgba(255, 169, 0, 0.95) 38% 42%, transparent 42% 62%, rgba(255, 169, 0, 0.95) 62% 66%, transparent 66%),
      radial-gradient(220px circle at var(--rb-x) var(--rb-y), rgba(255, 198, 49, 0.24), transparent 60%);
    bottom: 16px;
    content: "";
    height: 34px;
    left: 20px;
    opacity: 0.22;
    position: absolute;
    right: 72px;
    top: auto;
  }

  body.admin-mode .overview-section {
    border-radius: 18px;
    box-shadow: 0 18px 52px rgba(76, 54, 12, 0.07);
    padding: 20px;
  }
}

body.admin-mode .admin-tabs.rb-pill-nav {
  box-sizing: border-box;
  justify-content: flex-start;
  margin-inline: auto;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-inline: 12px;
  scroll-padding-inline: 12px;
  scrollbar-width: none;
  width: fit-content;
}

body.admin-mode .admin-tabs.rb-pill-nav::-webkit-scrollbar {
  display: none;
}

body.admin-mode .admin-tabs.rb-pill-nav .admin-tab:first-child {
  margin-left: 0;
}

body.admin-mode .admin-tabs.rb-pill-nav .admin-tab:last-child {
  margin-right: 0;
}

.major-product-grid div {
  align-items: end;
  grid-template-columns: minmax(0, 1fr) auto;
}

.major-product-grid div > span,
.major-product-grid div > small,
.major-product-grid .major-product-amount {
  grid-column: 1;
  min-width: 0;
}

.major-product-grid .major-product-amount {
  line-height: 1.12;
  overflow-wrap: anywhere;
  padding-right: 8px;
}

.major-product-grid .major-product-qty {
  align-self: end;
  grid-column: 2;
  grid-row: 2 / span 2;
  justify-self: end;
  min-width: 2.4ch;
  position: static;
  text-align: right;
  white-space: nowrap;
}

.product-composition-fields {
  background: #fffdf8;
  border: 1px solid var(--line, #ead17d);
  border-radius: 14px;
  margin: 4px 0 16px;
  padding: 16px;
}

.product-composition-fields legend {
  color: var(--ink, #2a1d10);
  font-weight: 800;
  padding-inline: 6px;
}

.product-composition-fields p {
  color: var(--muted, #766b58);
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0 0 12px;
}

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

.product-composition-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

@media (max-width: 640px) {
  .product-composition-fields {
    padding: 13px;
  }

  .product-composition-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body.admin-mode .admin-tabs.rb-pill-nav {
    border-radius: 16px;
    margin-inline: 0;
    max-width: 100%;
    padding-inline: 10px;
    scroll-padding-inline: 10px;
    width: 100%;
  }
}

.historical-fair-data-note {
  margin: 0 0 14px;
  padding: 10px 13px;
  border: 1px solid rgba(201, 139, 0, 0.3);
  border-radius: 12px;
  background: linear-gradient(100deg, rgba(255, 244, 205, 0.78), rgba(255, 255, 255, 0.82));
  color: #6f5120;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.45;
}

@media print {
  body {
    background: #fff;
  }

  #app,
  dialog {
    display: none !important;
  }

  .receipt-sheet {
    display: block;
    color: #000;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.35;
    margin: 0;
    width: 72mm;
  }

  .receipt {
    padding: 0;
  }

  .receipt-logo {
    display: block;
    height: 28mm;
    margin: 0 auto 4px;
    object-fit: contain;
    width: 28mm;
  }

  .receipt h1,
  .receipt p {
    margin: 0;
  }

  .receipt h1 {
    font-size: 18px;
    text-align: center;
    margin-bottom: 6px;
  }

  .receipt p {
    white-space: pre-line;
  }

  .receipt hr {
    border: 0;
    border-top: 1px dashed #000;
    margin: 8px 0;
  }

  .receipt-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
  }

  .receipt-items {
    display: grid;
    gap: 5px;
  }

  .receipt-total {
    font-size: 15px;
    font-weight: 800;
  }
}

/* Restored FairFlow report canvas ------------------------------------------------
   The owner-approved dashboard used a broad, readable canvas. Keep newer data
   and drill-down features, but present Sales in that familiar full-report view. */
body.legacy-report-ui .test-overview-grid {
  display: none !important;
}

body.legacy-report-ui .admin-report-grid > .overview-section {
  display: block;
}

body.legacy-report-ui .admin-report-grid {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
}

body.legacy-report-ui .fair-kpi-grid {
  grid-column: 1 / -1;
}

body.legacy-report-ui .report-overview-column {
  align-content: start;
  display: grid;
  gap: 18px;
  min-width: 0;
}

body.legacy-report-ui .report-overview-column--left {
  grid-column: 1;
}

body.legacy-report-ui .report-overview-column--right {
  grid-column: 2;
}

body.legacy-report-ui .report-overview-column > .overview-section {
  grid-column: auto;
}

body.legacy-report-ui .closing-section {
  grid-column: 1 / -1;
}

body.legacy-report-ui .admin-report-grid > .overview-section {
  background: rgba(255, 253, 247, 0.94);
  border: 1px solid rgba(224, 182, 72, 0.54);
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(93, 65, 15, 0.08);
  padding: 20px;
}

body.legacy-report-ui .overview-section-heading h3 {
  font-size: 24px;
  letter-spacing: -0.035em;
}

body.legacy-report-ui .overview-section-heading p {
  color: #756b58;
  font-weight: 750;
}

/* Product cards: give the desktop summary enough room for the two facts
   owners scan first — sales value and delivered quantity. */
body.legacy-report-ui .product-section .major-product-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.legacy-report-ui .product-section .major-product-grid > div {
  align-items: start;
  background: linear-gradient(145deg, #fff9e7 0%, #fffdf8 68%);
  border: 1px solid rgba(224, 182, 72, 0.72);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(93, 65, 15, 0.06);
  display: grid;
  gap: 7px 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto 1fr;
  min-height: 142px;
  padding: 16px 17px;
  position: relative;
}

body.legacy-report-ui .product-section .major-product-grid > div::before {
  background: #d99600;
  border-radius: 4px;
  content: "";
  height: 4px;
  left: 16px;
  position: absolute;
  right: 16px;
  top: 0;
  transform: translateY(-1px);
}

body.legacy-report-ui .product-section .major-product-grid span {
  color: #21170c;
  font-size: 17px;
  font-weight: 900;
  grid-column: 1;
  grid-row: 1;
  line-height: 1.22;
  min-width: 0;
}

body.legacy-report-ui .product-section .major-product-grid small {
  color: #7b6b50;
  font-size: 12px;
  font-weight: 800;
  grid-column: 1 / -1;
  grid-row: 2;
  letter-spacing: 0.03em;
}

body.legacy-report-ui .product-section .major-product-grid .major-product-amount {
  align-self: end;
  color: #21170c;
  font-size: clamp(1.05rem, 1.35vw, 1.38rem);
  font-variant-numeric: tabular-nums;
  grid-column: 1 / -1;
  grid-row: 3;
  letter-spacing: -0.025em;
  line-height: 1.05;
  min-width: 0;
  overflow: visible;
  overflow-wrap: anywhere;
  padding-right: 0;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
}

body.legacy-report-ui .product-section .major-product-grid .major-product-qty {
  align-self: end;
  background: rgba(255, 240, 187, 0.82);
  border: 1px solid rgba(217, 150, 0, 0.28);
  border-radius: 999px;
  color: #21170c;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  min-width: max-content;
  padding: 7px 9px;
  position: static;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  body.legacy-report-ui .product-section .major-product-grid {
    grid-template-columns: 1fr;
  }
}

body.legacy-report-ui .report-filter-panel:not(.is-collapsed) .report-filter-content {
  display: grid;
}

@media (min-width: 1180px) {
  body.legacy-report-ui.admin-mode .admin-desktop-sidebar {
    display: grid !important;
  }

  body.legacy-report-ui.admin-mode .pos-header,
  body.legacy-report-ui.admin-mode .admin-view {
    /* The desktop sidebar is fixed at 248px.  Do not let the restored
       report canvas draw underneath it or the page appears horizontally
       shifted after returning from POS. */
    margin-left: 248px !important;
  }

  body.legacy-report-ui.admin-mode .pos-header {
    background: rgba(255, 255, 255, 0.96);
    display: grid;
    grid-template-columns: 1fr auto;
    min-height: 72px;
    padding: 0 clamp(24px, 3vw, 52px);
  }

  body.legacy-report-ui.admin-mode .pos-header::before {
    background: url("assets/wing-foong-logo.png") left center / 52px 52px no-repeat;
    color: #21170c;
    content: "FairFlow POS\A Wing Foong Bazhen";
    display: block;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.25;
    min-height: 60px;
    padding: 16px 0 0 64px;
    white-space: pre;
  }

  body.legacy-report-ui.admin-mode .ticket-title {
    display: none;
  }

  body.legacy-report-ui.admin-mode .pos-header-actions {
    grid-column: auto;
  }

  body.legacy-report-ui.admin-mode .admin-view {
    margin: 0 0 0 248px;
    max-width: 1760px;
    padding: 24px clamp(24px, 3vw, 48px) 42px;
  }

  body.legacy-report-ui.admin-mode .admin-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  }

  body.legacy-report-ui.admin-mode .admin-toolbar .header-actions {
    flex-wrap: wrap;
    min-width: 0;
  }

  body.legacy-report-ui.admin-mode .admin-tabs {
    background: rgba(255, 253, 247, 0.9);
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(93, 65, 15, 0.07);
    box-sizing: border-box;
    margin-inline: 0;
    max-width: 100%;
    overflow-x: auto;
    width: 100%;
  }
}

/* A compact sidebar preserves the same workspace hierarchy.  At the smaller
   end of desktop widths, turn the legacy report into one column before its
   payment figures and product cards have to compete for horizontal space. */
@media (min-width: 1180px) and (max-width: 1420px) {
  body.legacy-report-ui.admin-mode .report-period-grid,
  body.legacy-report-ui.admin-mode .report-filter-section-scope .admin-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.legacy-report-ui.admin-mode .admin-report-summary,
  body.legacy-report-ui.admin-mode .report-filter-content,
  body.legacy-report-ui.admin-mode .report-filter-section {
    max-width: 100%;
    min-width: 0;
  }

  body.legacy-report-ui.admin-mode .admin-report-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.legacy-report-ui.admin-mode .report-overview-column--left,
  body.legacy-report-ui.admin-mode .report-overview-column--right {
    grid-column: 1;
  }

  body.legacy-report-ui.admin-mode .product-section .major-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  body.legacy-report-ui .admin-report-grid {
    grid-template-columns: 1fr;
  }

  body.legacy-report-ui .report-overview-column {
    display: contents;
  }

  body.legacy-report-ui .daily-section {
    order: 1;
  }

  body.legacy-report-ui .product-section {
    order: 2;
  }

  body.legacy-report-ui .payment-section {
    order: 3;
  }

  body.legacy-report-ui .team-section {
    order: 4;
  }

  body.legacy-report-ui .closing-section {
    order: 5;
    grid-column: 1;
  }
}
