:root {
  color-scheme: light;
  --ink: #18202a;
  --muted: #667085;
  --line: #d9e1e8;
  --paper: #ffffff;
  --soft: #f2f6f8;
  --brand: #0f8b8d;
  --accent: #f25c54;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #edf7f6 0%, #f8fafb 40%, #ffffff 100%);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.shell {
  width: min(940px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.wide {
  width: min(1180px, calc(100% - 32px));
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(32px, 6vw, 56px);
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
}

.muted {
  color: var(--muted);
}

.text-link {
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.qr {
  width: 138px;
  height: 138px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 8px;
}

.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 18px 42px rgba(28, 52, 65, 0.08);
}

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

.product-grid {
  display: grid;
  gap: 16px;
}

.category-picker {
  width: min(420px, 100%);
  margin-bottom: 18px;
}

.product {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.product h3 {
  margin-bottom: 4px;
  font-size: 22px;
}

.product p {
  margin-bottom: 0;
}

.detail-product {
  grid-template-columns: minmax(180px, 260px) 1fr;
  background: var(--paper);
}

.product-media {
  display: grid;
  place-items: center;
  min-height: 220px;
  border-radius: 8px;
  background: #f7f9fb;
  overflow: hidden;
}

.product-media img {
  width: 100%;
  height: 100%;
  max-height: 260px;
  object-fit: contain;
}

.product-body {
  display: grid;
  gap: 14px;
}

.category-name {
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.price {
  color: var(--accent);
  font-weight: 700;
}

.product-controls {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(110px, 140px);
  gap: 12px;
}

.size-reference {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.size-reference summary {
  color: var(--brand);
  cursor: pointer;
  font-weight: 800;
}

.size-reference img {
  display: block;
  width: min(100%, 620px);
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.selected-summary {
  margin-top: 16px;
  border: 1px solid #b8e4d6;
  border-radius: 8px;
  padding: 16px;
  background: #f0fbf7;
}

.selected-summary h3 {
  margin-bottom: 12px;
  font-size: 18px;
}

.selected-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.selected-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(15, 139, 141, 0.16);
  padding-bottom: 8px;
}

.selected-summary p {
  margin-bottom: 0;
  color: var(--brand);
  font-weight: 800;
}

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

.fields h2,
.fields .full {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  font: inherit;
  background: var(--paper);
}

textarea {
  resize: vertical;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkline input {
  width: 18px;
  height: 18px;
}

.payment-panel {
  display: grid;
  grid-template-columns: 1fr minmax(230px, 320px);
  gap: 18px;
  align-items: center;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid #b8e4d6;
  border-radius: 8px;
  background: #f0fbf7;
}

.payment-panel img {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  -webkit-touch-callout: default;
  user-select: auto;
}

.payment-qr-wrap {
  display: grid;
  gap: 12px;
}

.payment-qr-wrap a {
  display: block;
}

.checkout {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px -22px -22px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 0 0 8px 8px;
}

#total {
  display: block;
  margin-top: 4px;
  color: var(--accent);
  font-size: 30px;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.secondary {
  background: var(--ink);
}

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

.sync-status {
  min-height: 22px;
  color: var(--muted);
  font-weight: 700;
}

.result {
  margin-top: 16px;
  border-color: #87d3bf;
}

.status {
  color: var(--brand);
  font-weight: 800;
}

.hidden {
  display: none;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.lookup-panel {
  align-items: end;
}

.orders-result {
  margin-top: 16px;
}

.my-order-stats {
  margin-bottom: 16px;
}

.order-cards {
  display: grid;
  gap: 16px;
}

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

.order-card-head h2 {
  margin-bottom: 0;
}

.order-card-head strong {
  color: var(--accent);
  font-size: 28px;
}

.order-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.order-card dl div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
}

.order-card dt {
  color: var(--muted);
  font-weight: 800;
}

.order-card dd {
  margin: 0;
}

.order-pay-box {
  display: grid;
  gap: 12px;
  justify-items: start;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.order-pay-box h3 {
  margin-bottom: 6px;
  font-size: 20px;
}

.order-pay-box img {
  display: block;
  width: min(100%, 260px);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.order-pay-box button:disabled {
  cursor: default;
  opacity: 0.64;
}

.empty-state {
  text-align: center;
}

.stats article,
.summary-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 16px;
}

.stats span,
.summary-list span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.stats strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.summary-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.summary-list strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

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

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

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

th {
  color: var(--muted);
  font-size: 13px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.toggle input {
  width: 18px;
  height: 18px;
}

@media (max-width: 720px) {
  .header {
    align-items: flex-start;
  }

  .qr {
    width: 96px;
    height: 96px;
  }

  .fields,
  .stats {
    grid-template-columns: 1fr;
  }

  .detail-product,
  .payment-panel {
    grid-template-columns: 1fr;
  }

  .product-media {
    min-height: 180px;
  }

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

  .payment-panel img {
    justify-self: center;
  }

  .order-pay-box {
    grid-template-columns: 1fr;
  }

  .order-pay-box img {
    width: min(100%, 240px);
  }

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

  button,
  .button {
    width: 100%;
  }
}
