* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-columns: 108px 1fr;
  background: #f5f7fb;
  color: #1f2328;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.sidebar {
  min-height: 100vh;
  padding: 18px 14px;
  border-right: 1px solid #e8ecf3;
  background: #fff;
  color: #1f2328;
}

.brand {
  margin-bottom: 20px;
  color: #1f4fff;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}

.nav {
  width: 100%;
  height: 42px;
  margin-bottom: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #283342;
  cursor: pointer;
  font-size: 14px;
  text-align: center;
  padding: 0 8px;
}

.nav.active,
.nav:hover {
  background: #eef3ff;
  color: #2358ff;
}

.env {
  margin-top: 28px;
  color: #808997;
  font-size: 12px;
  word-break: break-all;
}

.muted {
  color: #747b86;
}

.main {
  padding: 26px 32px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding: 12px 16px;
  border: 1px solid #e8ecf3;
  border-radius: 14px;
  background: #fff;
}

.top-actions {
  display: flex;
  gap: 10px;
}

h1 {
  margin: 0;
  font-size: 24px;
}

p {
  margin: 4px 0 0;
  color: #747b86;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.panel {
  margin-bottom: 20px;
  padding: 20px;
  border: 1px solid #e6e8ec;
  border-radius: 12px;
  background: #fff;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.dashboard-main,
.dashboard-side {
  display: grid;
  align-content: start;
  gap: 16px;
}

.store-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0;
  border: 0;
  background: #eef3ff;
}

.status-title {
  font-size: 18px;
  font-weight: 800;
}

.status-title span {
  margin-left: 8px;
  color: #2358ff;
  font-size: 15px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(135deg, #1f72ff 0%, #3f66ec 100%);
  box-shadow: 0 12px 30px rgba(31, 114, 255, .2);
}

.status-stat {
  height: 96px;
  border-radius: 0;
  background: transparent;
  color: #fff;
  display: grid;
  gap: 4px;
  place-items: center;
}

.status-stat + .status-stat {
  border-left: 1px solid rgba(255, 255, 255, .14);
}

.status-stat strong {
  font-size: 28px;
  line-height: 1;
}

.status-stat span {
  opacity: .9;
}

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

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

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

.metric-card {
  min-height: 104px;
  padding: 18px;
  border: 1px solid #e8ecf3;
  border-radius: 14px;
  background: #fff;
}

.metric-card.clickable,
.status-stat {
  cursor: pointer;
}

.metric-card.clickable:hover {
  border-color: #9bb8ff;
  box-shadow: 0 10px 24px rgba(35, 88, 255, .12);
  transform: translateY(-1px);
}

.metric-card span,
.metric-card small {
  display: block;
  color: #687180;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  color: #060b16;
  font-size: 28px;
  line-height: 1.1;
}

.metric-card small {
  margin-top: 8px;
}

.dashboard-orders {
  display: grid;
  gap: 10px;
}

.dash-order {
  display: grid;
  grid-template-columns: 1.3fr 1.4fr 120px 96px;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid #e8ecf3;
  border-radius: 12px;
  background: #fff;
}

.dash-order strong,
.dash-order span {
  display: block;
}

.dash-order span,
.dash-order div:nth-child(2) {
  color: #687180;
}

.dash-order b {
  color: #ff4747;
}

.dash-order em {
  justify-self: end;
  border-radius: 999px;
  padding: 4px 10px;
  background: #fff3f3;
  color: #ff4747;
  font-style: normal;
  font-weight: 800;
}

.side-card {
  padding: 20px;
  border: 1px solid #e8ecf3;
  border-radius: 14px;
  background: #fff;
}

.side-card h3 {
  margin: 0 0 16px;
  font-size: 18px;
}

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

.side-grid div {
  padding: 12px;
  border-radius: 10px;
  background: #f7f8fb;
}

.side-grid span,
.side-grid strong {
  display: block;
}

.side-grid span {
  color: #687180;
  font-size: 12px;
}

.side-grid strong {
  margin-top: 6px;
  font-size: 20px;
}

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

.advice-item {
  padding: 12px;
  border-radius: 10px;
  background: #f7f8fb;
  color: #38404a;
}

.advice-item strong,
.advice-item span {
  display: block;
}

.advice-item span {
  margin-top: 4px;
  color: #687180;
}

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

label {
  display: grid;
  gap: 7px;
  color: #38404a;
  font-weight: 600;
}

.span-2 {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d9dde5;
  border-radius: 8px;
  padding: 10px 12px;
  color: #1f2328;
  font: inherit;
  outline: none;
  background: #fff;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #ff5558;
  box-shadow: 0 0 0 3px rgba(255, 85, 88, .1);
}

.file-row {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 10px;
}

.upload-status {
  min-height: 20px;
  margin-top: 7px;
  color: #667085;
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
}

.upload-status.is-working {
  color: #8a5a00;
}

.upload-status.is-success {
  color: #16835d;
}

.upload-status.is-error {
  color: #d92d20;
}

.product-images-field {
  min-width: 0;
  padding: 16px;
  border: 1px solid #e6e8ec;
  border-radius: 8px;
  background: #fafbfc;
}

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

.product-images-title {
  color: #38404a;
  font-weight: 700;
}

.product-images-subtitle {
  margin-top: 4px;
  color: #7a8492;
  font-size: 13px;
  font-weight: 500;
}

.product-images-picker {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 40px;
  border: 1px solid #d9dde5;
  border-radius: 8px;
  padding: 0 16px;
  background: #fff;
  color: #38404a;
  cursor: pointer;
  font-weight: 700;
}

.product-images-picker:hover {
  border-color: #ff5558;
  color: #e8474a;
}

.product-images-picker:focus-within {
  border-color: #ff5558;
  box-shadow: 0 0 0 3px rgba(255, 85, 88, .1);
}

.product-images-picker.is-disabled {
  cursor: wait;
  opacity: .65;
}

.product-images-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.product-image-editor {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.product-images-empty {
  grid-column: 1 / -1;
  display: grid;
  min-height: 116px;
  place-items: center;
  border: 1px dashed #cfd5de;
  border-radius: 8px;
  color: #8a94a3;
  font-size: 14px;
  font-weight: 500;
}

.product-image-item {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dfe3e9;
  border-radius: 8px;
  background: #fff;
  cursor: grab;
  user-select: none;
  transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.product-image-item:hover,
.product-image-item.is-drop-target {
  border-color: #ff5558;
  box-shadow: 0 0 0 3px rgba(255, 85, 88, .08);
}

.product-image-item.is-dragging {
  cursor: grabbing;
  opacity: .42;
}

.product-image-item.is-cover {
  border-color: #ff5558;
}

.product-image-preview {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #eef1f5;
}

.product-image-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.product-image-cover-badge,
.product-image-drag-handle {
  position: absolute;
  top: 8px;
  z-index: 1;
  min-height: 24px;
  border-radius: 6px;
  background: rgba(31, 35, 40, .78);
  color: #fff;
  font-size: 12px;
  line-height: 24px;
}

.product-image-cover-badge {
  left: 8px;
  padding: 0 8px;
  font-weight: 700;
}

.product-image-drag-handle {
  right: 8px;
  width: 28px;
  text-align: center;
}

.product-image-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 6px 8px;
}

.product-image-order {
  min-width: 0;
  overflow: hidden;
  color: #687180;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}

button.product-image-action {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #dfe3e9;
  border-radius: 6px;
  padding: 0;
  background: #fff;
  color: #5b6471;
  font-size: 17px;
  line-height: 1;
}

button.product-image-action:hover {
  border-color: #ff5558;
  color: #e8474a;
}

button.product-image-remove:hover {
  border-color: #ffd2d3;
  background: #fff5f5;
  color: #d92d20;
}

input[type="file"]:disabled {
  cursor: wait;
  opacity: .62;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.checkbox input {
  width: auto;
}

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

button {
  height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: #ff5558;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  cursor: wait;
  opacity: .65;
}

button.ghost {
  border: 1px solid #d9dde5;
  background: #fff;
  color: #38404a;
}

button.danger {
  border-color: #ffd2d3;
  color: #ff4747;
}

.list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.list.compact {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.card {
  overflow: hidden;
  border: 1px solid #e6e8ec;
  border-radius: 10px;
  background: #fff;
}

.thumb {
  width: 100%;
  height: 190px;
  object-fit: cover;
  background: #eee;
}

.card-body {
  padding: 14px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
}

.card-meta {
  margin-top: 8px;
  color: #747b86;
}

.review-text {
  margin-top: 12px;
  color: #38404a;
  line-height: 1.7;
}

.price {
  color: #ff4747;
  font-weight: 800;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.points-summary {
  margin-bottom: 20px;
}

.point-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 22px;
  border: 1px solid #dfe6f6;
  border-radius: 12px;
  background: #f7f9ff;
}

.point-summary-title {
  color: #1f2937;
  font-size: 19px;
  font-weight: 800;
}

.point-summary-title span {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  vertical-align: 2px;
}

.point-state-on {
  background: #e8f7ee;
  color: #16835d;
}

.point-state-off {
  background: #fff1f1;
  color: #c93838;
}

.point-summary-main p {
  max-width: 610px;
}

.point-summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(104px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #e1e6f0;
  border-radius: 8px;
  background: #e1e6f0;
}

.point-summary-metrics > div {
  min-width: 116px;
  padding: 12px 14px;
  background: #fff;
}

.point-summary-metrics span,
.point-summary-metrics strong {
  display: block;
}

.point-summary-metrics span {
  color: #6d7685;
  font-size: 12px;
}

.point-summary-metrics strong {
  margin-top: 5px;
  color: #1f4fff;
  font-size: 22px;
  line-height: 1.1;
}

.section-form-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.section-form-title h2,
.points-data-heading h2 {
  margin: 0;
  color: #222b35;
  font-size: 18px;
}

.section-form-title p,
.points-data-heading p {
  margin-top: 5px;
}

.points-data-heading {
  margin: 30px 0 14px;
}

.points-reward-list {
  margin-top: -6px;
}

.point-reward-points {
  margin-top: 9px;
  color: #e5514f;
  font-size: 18px;
  font-weight: 800;
}

.reward-image-empty {
  display: grid;
  place-items: center;
  color: #7b8492;
  background: #eef1f6;
}

.point-customer-card,
.point-redemption-card {
  padding: 18px;
  border: 1px solid #e3e8ef;
  border-radius: 10px;
  background: #fff;
}

.point-customer-head,
.point-redemption-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.point-customer-head > div:first-child,
.point-redemption-head > div:first-child {
  min-width: 0;
}

.point-customer-head strong,
.point-customer-head span,
.point-redemption-head strong,
.point-redemption-head span {
  display: block;
}

.point-customer-head > div:first-child > strong,
.point-redemption-head strong {
  overflow-wrap: anywhere;
  color: #1f2937;
  font-size: 16px;
}

.point-customer-head > div:first-child > span,
.point-redemption-head span {
  margin-top: 5px;
  color: #6d7685;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.point-balance {
  min-width: 90px;
  padding: 8px 10px;
  border: 1px solid #dce7fd;
  border-radius: 8px;
  background: #f3f7ff;
  text-align: right;
}

.point-balance small,
.point-balance strong {
  display: block;
}

.point-balance small {
  color: #6a7484;
  font-size: 12px;
}

.point-balance strong {
  margin-top: 3px;
  color: #1f4fff;
  font-size: 22px;
  line-height: 1.1;
}

.point-customer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin: 15px 0;
  color: #687180;
  font-size: 13px;
}

.point-adjust-row,
.point-redemption-actions {
  display: grid;
  grid-template-columns: minmax(160px, .8fr) minmax(220px, 1.4fr) auto;
  gap: 10px;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid #edf0f4;
}

.point-redemption-head {
  padding-bottom: 14px;
  border-bottom: 1px solid #edf0f4;
}

.point-redemption-status {
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff7df;
  color: #986400;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.point-redemption-status.status-shipped {
  background: #edf5ff;
  color: #2569bc;
}

.point-redemption-status.status-done {
  background: #e9f7ef;
  color: #16835d;
}

.point-redemption-status.status-cancelled {
  background: #f3f4f6;
  color: #737b87;
}

.point-redemption-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.8fr;
  gap: 16px;
  padding: 16px 0;
}

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

.point-redemption-grid small {
  margin-bottom: 5px;
  color: #747e8c;
  font-size: 12px;
}

.point-redemption-grid strong {
  color: #26313d;
  overflow-wrap: anywhere;
}

.point-reward-inline {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.point-reward-inline img {
  width: 58px;
  height: 58px;
  border: 1px solid #e4e8ee;
  border-radius: 7px;
  object-fit: cover;
  background: #f1f3f6;
}

.point-reward-inline span {
  display: block;
  margin-top: 5px;
  color: #e5514f;
  font-weight: 700;
}

.point-redemption-actions {
  grid-template-columns: minmax(120px, .65fr) minmax(170px, 1fr) minmax(155px, .85fr) minmax(130px, .7fr) minmax(160px, .9fr) 120px auto auto auto;
}

.points-transactions {
  overflow: hidden;
  border: 1px solid #e3e8ef;
  border-radius: 10px;
  background: #fff;
}

.point-transaction-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) minmax(150px, 1fr) 90px 86px;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
}

.point-transaction-row + .point-transaction-row {
  border-top: 1px solid #edf0f4;
}

.point-transaction-row strong,
.point-transaction-row span,
.point-transaction-row small {
  display: block;
}

.point-transaction-row > div:first-child span,
.point-transaction-row > div:nth-child(2) span,
.point-transaction-row > div:nth-child(2) small,
.point-transaction-row > div:last-child span {
  margin-top: 4px;
  color: #717a88;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.point-plus {
  color: #16835d;
  font-size: 16px;
  font-weight: 800;
}

.point-minus {
  color: #d44c49;
  font-size: 16px;
  font-weight: 800;
}

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

.feedback-list {
  display: grid;
  gap: 16px;
}

.feedback-tools {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 170px 210px 120px;
  gap: 12px;
  align-items: center;
}

.feedback-card {
  padding: 18px;
  border: 1px solid #e2e7e3;
  border-radius: 10px;
  background: #fff;
}

.feedback-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #edf0ed;
}

.feedback-status.status-processing {
  background: #fff7df;
  color: #986400;
}

.feedback-status.status-resolved {
  background: #ecf8f1;
  color: #16744f;
}

.feedback-status.status-closed {
  background: #f1f3f2;
  color: #68716c;
}

.feedback-meta-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.2fr 1fr;
  gap: 16px;
  padding: 16px 0;
}

.feedback-meta-grid span,
.feedback-meta-grid strong {
  display: block;
}

.feedback-meta-grid span {
  margin-bottom: 6px;
  color: #747b77;
  font-size: 12px;
}

.feedback-meta-grid strong {
  overflow-wrap: anywhere;
  color: #29342e;
}

.feedback-description {
  padding: 14px;
  border-radius: 8px;
  background: #f6f8f6;
  color: #303a35;
  line-height: 1.7;
}

.feedback-description > div:last-child {
  white-space: pre-wrap;
}

.feedback-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.feedback-evidence a {
  display: block;
  width: 96px;
  height: 96px;
  overflow: hidden;
  border: 1px solid #dfe5e0;
  border-radius: 8px;
  background: #f1f3f2;
}

.feedback-evidence img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.after-sale-admin-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #eadbd6;
  border-left: 3px solid #a83930;
  border-radius: 8px;
  background: #fffaf8;
}

.after-sale-admin-summary {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.after-sale-admin-summary strong {
  color: #6d241f;
  font-size: 14px;
}

.after-sale-admin-summary span {
  color: #7b7773;
  font-size: 12px;
}

.after-sale-admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.feedback-process-grid {
  display: grid;
  grid-template-columns: 170px minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #edf0ed;
}

.feedback-process-grid label {
  align-self: stretch;
  font-size: 13px;
}

.feedback-process-grid textarea {
  min-height: 88px;
}

.feedback-save {
  display: flex;
  align-items: flex-end;
}

.empty-panel,
.order-card {
  border: 1px solid #e6e8ec;
  border-radius: 10px;
  background: #fff;
}

.empty-panel {
  padding: 36px;
  color: #747b86;
  text-align: center;
}

.order-card {
  padding: 18px;
}

.order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #edf0f4;
}

.order-no {
  font-size: 17px;
  font-weight: 800;
}

.order-no-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.copy-btn,
.copy-mini {
  border: 1px solid #d9dde5;
  border-radius: 999px;
  background: #fff;
  color: #38404a;
  cursor: pointer;
  font-weight: 700;
}

.copy-btn {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.copy-btn.strong {
  border-color: #ffb6b8;
  background: #fff6f6;
  color: #ff4747;
}

.copy-mini {
  flex: none;
  height: 24px;
  padding: 0 8px;
  color: #687180;
  font-size: 12px;
}

.copy-btn:hover,
.copy-mini:hover {
  border-color: #ff7779;
  color: #ff4747;
}

.copy-value-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  line-height: 1.55;
}

.copy-value-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.muted-row {
  margin-top: 4px;
  color: #747b86;
}

.status {
  border-radius: 999px;
  padding: 5px 12px;
  background: #fff3f3;
  color: #ff4747;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.order-grid {
  display: grid;
  grid-template-columns: 180px 1.5fr 1fr 150px;
  gap: 14px;
  padding: 16px 0;
}

.field-label {
  margin-bottom: 5px;
  color: #747b86;
  font-size: 12px;
}

.order-items {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #edf0f4;
}

.order-item {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
}

.order-item img {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  background: #eee;
}

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

.order-tools {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 170px 170px 110px 140px;
  gap: 12px;
  align-items: center;
}

.filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -6px 0 14px;
  padding: 12px 14px;
  border: 1px solid #dbe6ff;
  border-radius: 10px;
  background: #f3f7ff;
  color: #2358ff;
  font-weight: 700;
}

.link-button {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2358ff;
  text-decoration: underline;
}

.export-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border-radius: 8px;
  background: #ff5558;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.export-link.ghost-link {
  border: 1px solid #d9dde5;
  background: #fff;
  color: #38404a;
}

.remark-value {
  display: inline-block;
  border-radius: 6px;
  padding: 4px 8px;
  background: #fff4d8;
  color: #8a5a00;
  font-weight: 700;
}

.shipping-row {
  display: grid;
  grid-template-columns: minmax(130px, .7fr) minmax(170px, 1.05fr) minmax(155px, .9fr) minmax(135px, .75fr) minmax(170px, 1fr) auto auto;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #edf0f4;
}

.shipping-status-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  padding-left: 2px;
}

.logistics-provider-notice {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #f0c36c;
  border-radius: 8px;
  background: #fff8e8;
  color: #6f4f12;
}

.logistics-provider-notice.ready {
  border-color: #a9d7c3;
  background: #edf8f3;
  color: #245f4c;
}

.logistics-provider-notice strong {
  flex: 0 0 auto;
}

.logistics-provider-notice span,
.logistics-warning-inline {
  line-height: 1.6;
}

.logistics-warning-inline {
  color: #b15b16;
}

.login-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(22, 24, 29, .72);
}

.login-mask.active {
  display: flex;
}

.login-panel {
  width: min(380px, calc(100vw - 40px));
  display: grid;
  gap: 14px;
  padding: 28px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
}

.login-title {
  font-size: 22px;
  font-weight: 800;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(22, 24, 29, .62);
}

.modal-mask.active {
  display: flex;
}

.modal-panel {
  width: min(980px, calc(100vw - 48px));
  max-height: calc(100vh - 60px);
  overflow: auto;
  border-radius: 12px;
  background: #fff;
  padding: 22px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.modal-head h2 {
  margin: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: 180px 1.5fr 1fr 180px;
  gap: 14px;
  padding: 14px;
  border-radius: 10px;
  background: #f6f7f9;
}

.detail-items,
.detail-form {
  margin-top: 18px;
}

.refund-audit-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #e3d6d0;
  border-left: 4px solid #9f332b;
  border-radius: 8px;
  background: #fffaf8;
}

.refund-audit-panel.is-success {
  border-color: #cfe0d8;
  border-left-color: #275f50;
  background: #f6fbf8;
}

.refund-audit-panel.is-processing {
  border-color: #e7dcc0;
  border-left-color: #9a6b19;
  background: #fffdf6;
}

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

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

.refund-audit-grid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.refund-audit-grid span,
.field-help {
  color: #76716d;
  font-size: 12px;
}

.refund-audit-grid strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.refund-audit-alert {
  padding: 10px 12px;
  border-radius: 6px;
  color: #7a2d26;
  background: #f8e9e6;
  font-size: 13px;
  line-height: 1.6;
}

#toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: none;
  min-width: 180px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #1f2328;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .16);
}

.spec-groups-field {
  min-width: 0;
  padding: 16px;
  border: 1px solid #e6e8ec;
  border-radius: 8px;
  background: #fffdfc;
}

.spec-groups-head,
.spec-group-card-head,
.spec-values-head,
.spec-group-actions,
.spec-value-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spec-groups-head,
.spec-group-card-head,
.spec-values-head {
  justify-content: space-between;
}

.spec-groups-editor {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.spec-group-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid #e1e5ea;
  border-radius: 8px;
  background: #fff;
}

.spec-group-card-head {
  align-items: flex-end;
}

.spec-group-name-field {
  display: grid;
  min-width: min(100%, 280px);
  gap: 6px;
  color: #55606e;
  font-size: 13px;
  font-weight: 650;
}

.spec-group-name-field input {
  min-width: 0;
}

.spec-group-actions,
.spec-value-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.spec-values-head {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #edf0f3;
  color: #667180;
  font-size: 13px;
  font-weight: 700;
}

.spec-values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.spec-value-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #e5e9ed;
  border-radius: 7px;
  background: #fbfcfd;
}

.spec-value-preview {
  display: grid;
  width: 76px;
  height: 76px;
  overflow: hidden;
  place-items: center;
  border-radius: 6px;
  background: #eef1f4;
}

.spec-value-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spec-value-empty {
  padding: 8px;
  color: #8a94a3;
  font-size: 12px;
  line-height: 17px;
  text-align: center;
}

.spec-value-body {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.spec-value-field {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  color: #737e8c;
  font-size: 12px;
  font-weight: 650;
}

.spec-value-field input {
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
}

.spec-value-actions {
  grid-column: 1 / -1;
  padding-top: 2px;
}

.compact-button {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 12px;
  line-height: 20px;
}

.danger-button {
  color: #d92d20;
}

.danger-button:hover {
  border-color: #ffc9c5;
  background: #fff5f4;
  color: #b42318;
}

@media (max-width: 900px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: 0;
  }

  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .status-strip,
  .metric-grid,
  .dash-order {
    grid-template-columns: 1fr;
  }

  .dash-order em {
    justify-self: start;
  }

  .file-row,
  .form-grid,
  .order-grid,
  .order-tools,
  .shipping-row,
  .feedback-tools,
  .feedback-meta-grid,
  .feedback-process-grid,
  .after-sale-admin-panel,
  .point-adjust-row,
  .point-redemption-grid,
  .point-redemption-actions,
  .point-transaction-row {
    grid-template-columns: 1fr;
  }

  .after-sale-admin-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .refund-audit-grid {
    grid-template-columns: 1fr;
  }

  .after-sale-admin-actions {
    justify-content: flex-start;
  }

  .span-2 {
    grid-column: auto;
  }

  .product-images-head {
    align-items: stretch;
    flex-direction: column;
  }

  .product-images-picker {
    width: 100%;
  }

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

  .point-summary-card {
    grid-template-columns: 1fr;
  }

  .point-summary-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 2026-08 release polish */
:root {
  --ink: #1d2723;
  --muted-ink: #68736e;
  --paper: #ffffff;
  --canvas: #f3f5f2;
  --line: #dfe5e1;
  --forest: #24483e;
  --forest-deep: #17342d;
  --forest-soft: #e8f0ec;
  --cinnabar: #a53e35;
  --cinnabar-soft: #f8eae7;
  --gold: #aa8249;
  --gold-soft: #f6f0e6;
}

body {
  grid-template-columns: 224px minmax(0, 1fr);
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: 100vh;
  min-height: 0;
  flex-direction: column;
  padding: 20px 14px 16px;
  overflow: hidden;
  border-right: 1px solid #29473f;
  background: var(--forest-deep);
  color: #f6f8f7;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 6px 22px;
  color: #fff;
  font-size: 17px;
  line-height: 1.2;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 6px;
  background: var(--cinnabar);
  color: #fff;
  font-family: "SimSun", serif;
  font-size: 20px;
}

.brand-copy {
  display: grid;
  gap: 3px;
}

.brand-copy small {
  color: rgba(255, 255, 255, .62);
  font-size: 11px;
  font-weight: 500;
}

.sidebar-nav {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .18) transparent;
}

.nav-group-label {
  margin: 18px 10px 7px;
  color: rgba(255, 255, 255, .45);
  font-size: 11px;
  font-weight: 700;
}

.nav-group-label:first-child {
  margin-top: 0;
}

.nav {
  display: flex;
  width: 100%;
  height: 40px;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: rgba(255, 255, 255, .76);
  font-size: 13px;
  text-align: left;
}

.nav-mark {
  display: grid;
  width: 24px;
  height: 24px;
  flex: none;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 5px;
  font-size: 11px;
}

.nav.active,
.nav:hover {
  border-color: rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.nav.active .nav-mark {
  border-color: #c7ad83;
  background: var(--gold-soft);
  color: #6e522b;
}

.env {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 2px 8px;
  margin: 16px 5px 0;
  padding: 12px 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 6px;
  color: rgba(255, 255, 255, .78);
  font-size: 12px;
}

.env-dot,
.connection-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5ac28b;
}

.env-dot {
  align-self: center;
}

.env small {
  grid-column: 2;
  overflow: hidden;
  color: rgba(255, 255, 255, .42);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  margin-bottom: 18px;
  padding: 13px 16px;
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(31, 45, 39, .06);
}

.topbar h1 {
  color: var(--ink);
  font-size: 22px;
  letter-spacing: 0;
}

.topbar p,
p {
  color: var(--muted-ink);
}

.top-actions {
  align-items: center;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #cfe2d8;
  border-radius: 6px;
  background: #f2f8f5;
  color: #376955;
  font-size: 12px;
}

.panel,
.side-card,
.metric-card,
.dash-order,
.order-card,
.feedback-card,
.point-summary-card,
.card {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: 0 5px 16px rgba(31, 45, 39, .035);
}

.panel {
  padding: 18px;
}

.dashboard-shell {
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
}

.store-status {
  border: 1px solid #d8e4de;
  background: var(--forest-soft);
}

.status-title span {
  color: #2c7859;
}

.status-strip {
  border: 1px solid #34584e;
  border-radius: 8px;
  background: var(--forest);
  box-shadow: 0 9px 20px rgba(36, 72, 62, .13);
}

.status-stat {
  height: 86px;
}

.status-stat:hover {
  background: rgba(255, 255, 255, .07);
}

.metric-card {
  position: relative;
  min-height: 112px;
  overflow: hidden;
}

.metric-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--forest);
  content: "";
}

.metric-card:nth-child(3n + 2)::before {
  background: var(--cinnabar);
}

.metric-card:nth-child(3n)::before {
  background: var(--gold);
}

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

.metric-card.clickable:hover {
  border-color: #9cb4aa;
  box-shadow: 0 9px 22px rgba(36, 72, 62, .1);
}

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

.side-grid div,
.advice-item {
  border-radius: 6px;
  background: #f4f6f4;
}

input,
select,
textarea {
  border-color: #cfd8d3;
  border-radius: 6px;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  border-color: #6f9485;
  box-shadow: 0 0 0 3px rgba(54, 102, 84, .1);
}

button,
.export-link {
  border-radius: 6px;
}

button:not(.nav):not(.status-stat):not(.link-button):not(.copy-btn):not(.copy-mini),
.export-link {
  transition: border-color .15s ease, background .15s ease, color .15s ease, opacity .15s ease;
}

button:not(.ghost):not(.nav):not(.status-stat):not(.link-button):not(.copy-btn):not(.copy-mini) {
  background: var(--forest);
}

button:not(.ghost):not(.nav):not(.status-stat):not(.link-button):not(.copy-btn):not(.copy-mini):hover {
  background: var(--forest-deep);
}

.view-state {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted-ink);
}

.view-state.is-loading {
  justify-content: flex-start;
}

.view-state.is-error {
  border-color: #e8c7c1;
  background: #fff8f6;
  color: #7f352f;
}

.view-state div,
.view-state div span {
  display: grid;
  gap: 3px;
}

.view-state div span {
  color: #86655f;
  font-size: 12px;
}

.loading-ring {
  width: 18px;
  height: 18px;
  border: 2px solid #d7e3de;
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: admin-spin .75s linear infinite;
}

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

.visitor-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px auto;
  align-items: end;
  gap: 14px;
}

.visitor-tools strong {
  font-size: 16px;
}

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

.visitor-summary-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.visitor-summary-card span,
.visitor-summary-card small {
  display: block;
  color: var(--muted-ink);
}

.visitor-summary-card strong {
  display: block;
  margin: 6px 0;
  color: var(--ink);
  font-size: 27px;
}

.privacy-note {
  margin-bottom: 12px;
  padding: 10px 13px;
  border-left: 3px solid var(--gold);
  background: var(--gold-soft);
  color: #6e5b3d;
  font-size: 12px;
}

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

.visitor-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) repeat(3, minmax(120px, 1fr)) auto;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.visitor-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.visitor-identity img,
.visitor-avatar-fallback {
  display: grid;
  width: 42px;
  height: 42px;
  flex: none;
  place-items: center;
  border: 1px solid #d6dfda;
  border-radius: 50%;
  background: var(--forest-soft);
  color: var(--forest);
  object-fit: cover;
}

.visitor-identity div,
.visitor-fact {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.visitor-identity span,
.visitor-fact span {
  overflow: hidden;
  color: var(--muted-ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visitor-fact strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visitor-badge {
  padding: 5px 8px;
  border-radius: 5px;
  background: #f1f3f2;
  color: #78817d;
  font-size: 11px;
  white-space: nowrap;
}

.visitor-badge.is-known {
  background: var(--forest-soft);
  color: #34705b;
}

.empty-panel {
  display: grid;
  gap: 6px;
  border-style: dashed;
  background: rgba(255, 255, 255, .72);
}

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

.empty-panel span {
  color: var(--muted-ink);
  font-size: 12px;
}

.product-policy-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.policy-tag {
  padding: 3px 7px;
  border: 1px solid #dce3ef;
  border-radius: 5px;
  color: #687386;
  font-size: 11px;
}

.policy-tag.on {
  border-color: #c8d8ff;
  background: #eef3ff;
  color: #2358ff;
}

.policy-tag.welfare,
.policy-tag.off {
  border-color: #eadcc4;
  background: #fff8ec;
  color: #8a5b1f;
}

.promotion-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.promotion-summary > div {
  display: grid;
  min-height: 92px;
  align-content: center;
  gap: 6px;
  padding: 15px;
  border: 1px solid #e3e8f2;
  border-radius: 8px;
  background: #fff;
}

.promotion-summary span {
  color: #747b86;
  font-size: 12px;
}

.promotion-summary strong {
  font-size: 25px;
}

.promotion-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, .82fr);
  gap: 16px;
  align-items: start;
}

.promotion-form {
  border-radius: 8px;
}

.coupon-product-scope {
  padding: 14px;
  border: 1px solid #e4e8ef;
  border-radius: 7px;
  background: #fafbfe;
}

.coupon-scope-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.coupon-scope-head span {
  color: #747b86;
  font-size: 12px;
  text-align: right;
}

.coupon-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 330px;
  overflow: auto;
}

.coupon-product-grid.disabled {
  opacity: .56;
}

.coupon-product-option {
  display: grid;
  grid-template-columns: auto 42px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #e4e8ef;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.coupon-product-option.welfare {
  border-color: #eadcc4;
  background: #fffaf2;
}

.coupon-product-option img {
  width: 42px;
  height: 42px;
  border-radius: 5px;
  background: #eef1f5;
  object-fit: cover;
}

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

.coupon-product-option strong,
.coupon-product-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coupon-product-option small {
  color: #747b86;
}

.promotion-records {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.promotion-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  border: 1px solid #e3e8f2;
  border-radius: 8px;
  background: #fff;
}

.promotion-record h3 {
  margin: 3px 0;
  font-size: 15px;
}

.promotion-record p {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-kicker {
  color: #2358ff;
  font-size: 11px;
}

.promotion-amount {
  color: #d64242;
  font-size: 19px;
  white-space: nowrap;
}

.promotion-rule {
  max-width: 150px;
  color: #566174;
  font-size: 12px;
  text-align: right;
}

.issue-coupon-form {
  margin-top: 18px;
}

.compact-record {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(130px, .7fr) minmax(220px, 1fr);
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid #edf0f5;
  background: #fff;
}

.compact-record:first-child {
  border-radius: 8px 8px 0 0;
}

.compact-record:last-child {
  border-bottom: 0;
  border-radius: 0 0 8px 8px;
}

.compact-record > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.compact-record span {
  overflow: hidden;
  color: #747b86;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .dashboard-side {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .visitor-card {
    grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(130px, 1fr)) auto;
  }

  .visitor-card .visitor-fact:nth-of-type(3) {
    display: none;
  }

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

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

@media (max-width: 900px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    display: block;
    height: auto;
    padding: 10px 12px;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid #29473f;
  }

  .brand,
  .env,
  .nav-group-label {
    display: none;
  }

  .sidebar-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
  }

  .nav {
    width: auto;
    min-width: max-content;
    flex: none;
    margin: 0;
    padding: 0 10px;
  }

  .nav-mark {
    display: none;
  }

  .main {
    padding: 14px 12px 40px;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    gap: 12px;
  }

  .connection-pill {
    display: none;
  }

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

  .status-stat + .status-stat {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, .12);
  }

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

  .visitor-tools,
  .visitor-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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

  .visitor-card .visitor-fact:nth-of-type(3) {
    display: grid;
  }

  .promotion-records,
  .coupon-product-grid {
    grid-template-columns: 1fr;
  }

  .compact-record {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions > * {
    flex: 1;
    text-align: center;
  }

  .metric-grid,
  .point-summary-metrics {
    grid-template-columns: 1fr;
  }

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

  .status-stat {
    height: 76px;
  }

  .status-stat:nth-child(2) {
    border-top: 0;
  }

  .status-stat:nth-child(odd) {
    border-right: 1px solid rgba(255, 255, 255, .12);
  }

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

  .store-status > button {
    width: 100%;
    white-space: nowrap;
  }

  .visitor-summary-card {
    min-height: 116px;
    padding: 14px;
  }

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

/* Mobile merchant workbench inspired by native seller apps. */
.mobile-commerce-dashboard {
  display: none;
}

@media (max-width: 900px) {
  body[data-active-view="dashboard"] {
    background: #f4f6fb;
  }

  body[data-active-view="dashboard"] .topbar {
    display: none;
  }

  body[data-active-view="dashboard"] #dashboardView.view.active {
    padding: 0 0 18px;
  }

  #dashboardView .dashboard-shell {
    display: none;
  }

  .mobile-commerce-dashboard {
    display: block;
    overflow: hidden;
    padding-bottom: 8px;
    background: #f4f6fb;
  }

  .mobile-store-hero {
    min-height: 238px;
    padding: calc(14px + env(safe-area-inset-top)) 16px 48px;
    background: #eef4ff;
    color: #151b2a;
  }

  .mobile-store-row {
    display: flex;
    min-height: 58px;
    align-items: center;
    gap: 10px;
  }

  .mobile-store-avatar {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border: 2px solid rgba(255, 255, 255, .88);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(46, 69, 119, .12);
    object-fit: cover;
  }

  .mobile-store-copy {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: 3px;
  }

  .mobile-store-copy strong {
    overflow: hidden;
    font-size: 20px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-store-copy span {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #68738a;
    font-size: 10px;
  }

  .mobile-store-copy i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #24b574;
    box-shadow: 0 0 0 3px rgba(36, 181, 116, .12);
  }

  .mobile-store-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 7px;
  }

  .mobile-store-actions button {
    display: grid;
    width: 34px;
    height: 34px;
    min-height: 34px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(49, 94, 251, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .8);
    color: #263451;
  }

  .mobile-store-actions button:last-child {
    border-color: #315efb;
    background: #315efb;
    color: #fff;
  }

  .mobile-store-actions svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }

  .mobile-core-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-top: 28px;
  }

  .mobile-core-metrics button {
    display: grid;
    min-width: 0;
    min-height: 82px;
    align-content: center;
    justify-items: center;
    gap: 4px;
    padding: 0 3px;
    border: 0;
    border-right: 1px solid rgba(74, 93, 130, .09);
    border-radius: 0;
    background: transparent;
    color: inherit;
  }

  .mobile-core-metrics button:last-child {
    border-right: 0;
  }

  .mobile-core-metrics span,
  .mobile-core-metrics small {
    overflow: hidden;
    max-width: 100%;
    color: #758098;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-core-metrics strong {
    font-size: 23px;
    font-weight: 700;
    line-height: 1.1;
  }

  .mobile-task-board {
    position: relative;
    z-index: 2;
    margin: -30px 12px 0;
    overflow: hidden;
    border-radius: 8px;
    background: #315efb;
    box-shadow: 0 9px 22px rgba(49, 94, 251, .2);
    color: #fff;
  }

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

  .mobile-task-grid button {
    display: grid;
    min-width: 0;
    min-height: 91px;
    align-content: center;
    justify-items: center;
    gap: 7px;
    padding: 8px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
  }

  .mobile-task-grid strong {
    font-size: 22px;
    line-height: 1;
  }

  .mobile-task-grid span {
    overflow: hidden;
    max-width: 100%;
    color: rgba(255, 255, 255, .82);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-task-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid rgba(255, 255, 255, .16);
    background: rgba(19, 53, 192, .18);
  }

  .mobile-task-footer button {
    display: flex;
    min-width: 0;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 6px;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, .14);
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, .86);
    font-size: 10px;
  }

  .mobile-task-footer button:last-child {
    border-right: 0;
  }

  .mobile-task-footer svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }

  .mobile-task-footer strong {
    color: #fff;
    font-size: 13px;
  }

  .mobile-announcement {
    display: grid;
    width: 100%;
    min-height: 51px;
    grid-template-columns: 28px auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    padding: 0 14px;
    border: 0;
    border-top: 1px solid #edf0f6;
    border-bottom: 1px solid #edf0f6;
    border-radius: 0;
    background: #fff;
    color: #222b3d;
    text-align: left;
  }

  .mobile-announcement-icon {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border-radius: 7px;
    background: #eef0ff;
    color: #4f5cf2;
  }

  .mobile-announcement-icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }

  .mobile-announcement strong {
    font-size: 13px;
  }

  .mobile-announcement > span:nth-of-type(2) {
    overflow: hidden;
    color: #677188;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-announcement b {
    color: #a3aabd;
    font-size: 19px;
    font-weight: 400;
  }

  .mobile-quick-section {
    margin-top: 10px;
    padding: 14px 12px 16px;
    border-top: 1px solid #edf0f6;
    border-bottom: 1px solid #edf0f6;
    background: #fff;
  }

  .mobile-quick-section h2 {
    margin: 0 0 11px;
    font-size: 14px;
  }

  .mobile-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    row-gap: 15px;
  }

  .mobile-quick-grid button {
    display: grid;
    min-width: 0;
    min-height: 63px;
    align-content: start;
    justify-items: center;
    gap: 7px;
    padding: 0 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #414b61;
  }

  .mobile-quick-grid i {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    font-style: normal;
    box-shadow: 0 5px 12px rgba(32, 57, 100, .1);
  }

  .mobile-quick-grid svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }

  .mobile-quick-grid span {
    overflow: hidden;
    max-width: 100%;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .quick-blue { background: #3975f6; }
  .quick-teal { background: #28b6a6; }
  .quick-coral { background: #ef6c62; }
  .quick-violet { background: #7b6ee6; }
  .quick-pink { background: #f15f87; }
  .quick-indigo { background: #516fe8; }
  .quick-mint { background: #31b99c; }
  .quick-gray { background: #8a92a4; }

  .mobile-operation-feed {
    margin-top: 10px;
    padding: 14px 12px 8px;
    border-top: 1px solid #edf0f6;
    background: #fff;
  }

  .mobile-section-title {
    display: flex;
    min-height: 38px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-section-title div {
    display: grid;
    gap: 1px;
  }

  .mobile-section-title span {
    font-size: 14px;
    font-weight: 700;
  }

  .mobile-section-title small {
    color: #939bad;
    font-size: 9px;
  }

  .mobile-section-title button {
    min-height: 27px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #63708a;
    font-size: 10px;
  }

  .mobile-business-feed {
    display: grid;
  }

  .mobile-business-item {
    display: grid;
    width: 100%;
    min-height: 68px;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 9px 0;
    border: 0;
    border-top: 1px solid #eef1f6;
    border-radius: 0;
    background: transparent;
    color: #283247;
    text-align: left;
  }

  .mobile-business-item > i {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 8px;
    background: #eef3ff;
    color: #315efb;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
  }

  .mobile-business-item.warning > i { background: #fff1e8; color: #e3732d; }
  .mobile-business-item.notice > i { background: #eaf8f5; color: #20977e; }
  .mobile-business-item.stock > i { background: #fff0f2; color: #d6536a; }
  .mobile-business-item.complete > i { background: #eaf8f0; color: #279264; }

  .mobile-business-item > span {
    display: grid;
    min-width: 0;
    gap: 3px;
  }

  .mobile-business-item > span strong,
  .mobile-business-item > span small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-business-item > span strong {
    font-size: 12px;
  }

  .mobile-business-item > span small {
    color: #8891a4;
    font-size: 9px;
  }

  .mobile-business-item > b {
    min-width: 53px;
    padding: 6px 8px;
    border-radius: 7px;
    background: #f1f4fb;
    color: #315efb;
    font-size: 10px;
    text-align: center;
  }

  .mobile-tab.active {
    color: #315efb;
  }

  .mobile-tab.active .mobile-tab-icon {
    background: #edf2ff;
    color: #315efb;
  }
}

/* Installable mobile admin shell */
.mobile-context,
.mobile-only-action,
.mobile-tabbar,
.mobile-more-mask {
  display: none;
}

.topbar-copy {
  min-width: 0;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}

.icon-button.mobile-only-action {
  display: none;
}

.icon-button svg,
.mobile-tab svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-button svg circle,
.mobile-tab svg circle {
  fill: currentColor;
  stroke: none;
}

.danger-text {
  color: var(--cinnabar) !important;
}

@media (max-width: 900px) {
  html {
    min-height: 100%;
    background: var(--canvas);
  }

  body {
    display: block;
    min-width: 320px;
    min-height: 100%;
    overflow-x: hidden;
    overscroll-behavior-y: none;
    background: var(--canvas);
    -webkit-tap-highlight-color: transparent;
  }

  body.mobile-sheet-open {
    overflow: hidden;
  }

  .sidebar {
    display: none;
  }

  .main {
    min-height: 100vh;
    padding: 0 0 calc(76px + env(safe-area-inset-bottom));
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    display: flex;
    min-height: calc(64px + env(safe-area-inset-top));
    align-items: center;
    flex-direction: row;
    gap: 10px;
    margin: 0;
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 4px 14px rgba(31, 45, 39, .055);
    backdrop-filter: blur(14px);
  }

  .topbar-copy {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: 1px;
  }

  .mobile-context {
    display: block;
    overflow: hidden;
    color: var(--muted-ink);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar h1 {
    overflow: hidden;
    font-size: 18px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar p,
  .connection-pill,
  .top-actions > .export-link,
  #refreshBtn,
  #logoutBtn {
    display: none;
  }

  .top-actions {
    display: flex;
    width: auto;
    flex: none;
    gap: 8px;
  }

  .top-actions > * {
    flex: none;
  }

  .icon-button.mobile-only-action {
    display: inline-grid;
  }

  .view.active {
    display: block;
    padding: 14px 12px 24px;
  }

  .panel,
  .side-card,
  .metric-card,
  .dash-order,
  .order-card,
  .feedback-card,
  .point-summary-card,
  .card {
    box-shadow: 0 3px 12px rgba(31, 45, 39, .045);
  }

  .panel {
    margin-bottom: 12px;
    padding: 14px;
  }

  .dashboard-shell,
  .dashboard-side,
  .promotion-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .dashboard-main,
  .dashboard-side {
    min-width: 0;
    gap: 12px;
  }

  .dashboard-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-main > *,
  .dashboard-side > * {
    min-width: 0;
    max-width: 100%;
  }

  .store-status {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .store-status > button {
    width: 100%;
  }

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

  .status-stat {
    height: 74px;
  }

  .status-stat + .status-stat {
    border-top: 1px solid rgba(255, 255, 255, .12);
    border-left: 0;
  }

  .status-stat:nth-child(2) {
    border-top: 0;
  }

  .status-stat:nth-child(odd) {
    border-right: 1px solid rgba(255, 255, 255, .12);
  }

  .metric-grid,
  .point-summary-metrics,
  .promotion-summary,
  .visitor-summary,
  .dashboard-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card,
  .visitor-summary-card {
    min-height: 104px;
    padding: 14px;
  }

  .section-row {
    align-items: center;
    flex-direction: row;
    gap: 10px;
  }

  .section-row h2 {
    font-size: 17px;
  }

  .section-row > button,
  .section-row > a {
    flex: none;
  }

  .form-grid,
  .feedback-process-grid,
  .visitor-tools,
  .visitor-card,
  .point-summary-card,
  .point-redemption-grid,
  .compact-record {
    grid-template-columns: minmax(0, 1fr);
  }

  .span-2 {
    grid-column: auto;
  }

  .form-grid,
  .feedback-process-grid {
    gap: 13px;
  }

  input,
  select,
  textarea,
  button,
  .ghost-link {
    min-height: 44px;
    font-size: 14px;
  }

  input,
  select,
  textarea {
    padding: 11px 12px;
  }

  .checkbox input,
  input[type="checkbox"],
  input[type="radio"] {
    min-height: 0;
  }

  .actions {
    flex-wrap: wrap;
  }

  .actions > button,
  .actions > .ghost-link {
    flex: 1 1 132px;
  }

  .file-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-images-field {
    padding: 12px;
  }

  .product-images-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .product-images-picker,
  .product-images-picker button {
    width: 100%;
  }

  .list,
  .list.compact,
  .promotion-records,
  .coupon-product-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .thumb {
    height: auto;
    max-height: 260px;
    aspect-ratio: 4 / 3;
  }

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

  .card-actions > * {
    min-width: 0;
  }

  .toolbar,
  .filter-bar,
  .order-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
  }

  .toolbar > *,
  .filter-bar > *,
  .order-tools > * {
    min-width: 0;
    width: 100%;
  }

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

  .order-card,
  .feedback-card,
  .point-customer-card,
  .point-redemption-card {
    padding: 14px;
  }

  .order-head,
  .feedback-head,
  .point-customer-head,
  .point-redemption-head {
    align-items: flex-start;
    gap: 10px;
  }

  .order-no {
    font-size: 15px;
    overflow-wrap: anywhere;
  }

  .order-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px 0;
  }

  .order-grid > * {
    min-width: 0;
  }

  .order-item {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .order-item img {
    width: 64px;
    height: 64px;
  }

  .order-actions,
  .point-redemption-actions,
  .point-adjust-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    gap: 8px;
  }

  .order-actions > *,
  .point-redemption-actions > *,
  .point-adjust-row > * {
    min-width: 0;
    width: 100%;
  }

  .feedback-process-grid {
    margin-top: 14px;
  }

  .feedback-save,
  .feedback-save button {
    width: 100%;
  }

  .point-summary-main,
  .point-balance,
  .point-customer-meta,
  .point-transaction-row,
  .promotion-record {
    min-width: 0;
  }

  .point-transaction-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .promotion-record {
    padding: 14px;
  }

  .promotion-rule {
    max-width: none;
    text-align: left;
  }

  .compact-record {
    padding: 13px 14px;
  }

  .modal-mask {
    align-items: flex-end;
    padding: 0;
  }

  .modal-panel {
    width: 100%;
    max-width: none;
    max-height: 92vh;
    margin: 0;
    padding: 16px 14px calc(18px + env(safe-area-inset-bottom));
    border-radius: 8px 8px 0 0;
  }

  .modal-head {
    position: sticky;
    top: -16px;
    z-index: 2;
    margin: -16px -14px 12px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
    background: #fff;
  }

  .login-mask {
    padding: 18px;
  }

  .login-panel {
    width: min(100%, 380px);
    padding: 24px 20px;
  }

  .mobile-tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: grid;
    height: calc(62px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 5px 6px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 -7px 22px rgba(31, 45, 39, .08);
    backdrop-filter: blur(16px);
  }

  .mobile-tab {
    display: grid;
    min-width: 0;
    height: 56px;
    min-height: 0;
    align-content: center;
    justify-items: center;
    gap: 2px;
    padding: 2px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #7c8581;
    font-size: 11px;
    font-weight: 600;
  }

  .mobile-tab-icon {
    display: grid;
    width: 28px;
    height: 27px;
    place-items: center;
  }

  .mobile-tab.active {
    background: var(--forest-soft);
    color: var(--forest-deep);
  }

  .mobile-tab.active .mobile-tab-icon {
    color: var(--cinnabar);
  }

  .mobile-more-mask {
    position: fixed;
    inset: 0;
    z-index: 130;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    background: rgba(18, 28, 24, .42);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  .mobile-more-mask.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-more-sheet {
    width: 100%;
    max-height: 89vh;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
    border-radius: 8px 8px 0 0;
    background: #fff;
    box-shadow: 0 -14px 42px rgba(22, 43, 36, .18);
    transform: translateY(24px);
    transition: transform .22s ease;
  }

  .mobile-more-mask.active .mobile-more-sheet {
    transform: translateY(0);
  }

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

  .mobile-more-head span {
    color: var(--muted-ink);
    font-size: 11px;
  }

  .mobile-more-head h2 {
    margin: 2px 0 0;
    font-size: 20px;
  }

  .mobile-more-status {
    display: grid;
    grid-template-columns: 9px minmax(0, 1fr);
    gap: 2px 8px;
    padding: 11px 12px;
    border: 1px solid #d4e4dc;
    border-radius: 6px;
    background: #f1f7f4;
    color: #315f50;
    font-size: 12px;
  }

  .mobile-more-status i {
    width: 8px;
    height: 8px;
    align-self: center;
    border-radius: 50%;
    background: #3aa873;
  }

  .mobile-more-status small {
    grid-column: 2;
    overflow: hidden;
    color: #71807a;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-menu-group {
    margin-top: 18px;
  }

  .mobile-menu-group h3 {
    margin: 0 0 9px;
    color: var(--muted-ink);
    font-size: 12px;
  }

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

  .mobile-menu-grid button {
    display: grid;
    min-width: 0;
    height: 76px;
    align-content: center;
    justify-items: center;
    gap: 6px;
    padding: 6px 3px;
    border: 1px solid var(--line);
    background: #fafbf9;
    color: var(--ink);
    font-size: 11px;
  }

  .mobile-menu-grid button.active {
    border-color: #afc7bb;
    background: var(--forest-soft);
    color: var(--forest-deep);
  }

  .mobile-menu-grid b {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid #bdcbc4;
    border-radius: 50%;
    color: var(--forest);
    font-family: "SimSun", serif;
    font-size: 14px;
  }

  .mobile-app-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }

  .mobile-app-actions > * {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .mobile-install-button {
    background: var(--forest);
  }

  .mobile-install-hint {
    margin: 12px 0 0;
    font-size: 11px;
    line-height: 1.6;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: center;
    flex-direction: row;
  }

  .top-actions {
    width: auto;
  }

  .metric-grid,
  .point-summary-metrics,
  .promotion-summary,
  .visitor-summary,
  .dashboard-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-row {
    align-items: center;
    flex-direction: row;
  }

  .section-row > div {
    min-width: 0;
    flex: 1;
  }

  .section-row p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .section-row button {
    max-width: 46%;
    padding: 0 12px;
  }

  .order-grid,
  .order-actions,
  .point-redemption-actions,
  .point-adjust-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .order-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .order-head .status {
    align-self: start;
  }

  .copy-value-row {
    flex-wrap: wrap;
  }

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

@media (display-mode: standalone) and (max-width: 900px) {
  .topbar {
    background: #fff;
  }

  .mobile-context {
    color: var(--cinnabar);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Android compact admin layout: separate from the desktop workspace. */
.mobile-product-toolbar {
  display: none;
}

@media (max-width: 900px) {
  :root {
    --mobile-gutter: 9px;
    --mobile-radius: 8px;
    --mobile-control: 36px;
  }

  body {
    color: #17231f;
    font-size: 13px;
    line-height: 1.45;
  }

  .main {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  .topbar {
    min-height: calc(52px + env(safe-area-inset-top));
    gap: 7px;
    padding: calc(6px + env(safe-area-inset-top)) var(--mobile-gutter) 6px;
    box-shadow: 0 2px 8px rgba(23, 52, 45, .05);
  }

  .topbar-copy {
    gap: 0;
  }

  .mobile-context {
    font-size: 9px;
    font-weight: 600;
  }

  .topbar h1 {
    font-size: 16px;
    line-height: 1.25;
  }

  .top-actions {
    gap: 6px;
  }

  .icon-button,
  .icon-button.mobile-only-action {
    width: 34px;
    height: 34px;
    min-height: 34px;
    flex-basis: 34px;
    border-radius: 7px;
  }

  .icon-button svg,
  .mobile-tab svg {
    width: 19px;
    height: 19px;
  }

  .view.active {
    padding: 8px var(--mobile-gutter) 14px;
  }

  .panel,
  .side-card,
  .metric-card,
  .dash-order,
  .order-card,
  .feedback-card,
  .point-summary-card,
  .card,
  .promotion-record,
  .compact-record {
    border-radius: var(--mobile-radius);
    box-shadow: 0 2px 8px rgba(27, 43, 37, .045);
  }

  .panel {
    margin-bottom: 8px;
    padding: 10px;
  }

  input,
  select,
  textarea,
  button,
  .ghost-link {
    min-height: var(--mobile-control);
    border-radius: 7px;
    font-size: 12px;
  }

  input,
  select,
  textarea {
    padding: 8px 9px;
  }

  textarea {
    min-height: 76px;
  }

  label {
    gap: 5px;
    font-size: 11px;
  }

  .dashboard-shell,
  .dashboard-main,
  .dashboard-side,
  .promotion-layout {
    gap: 8px;
  }

  .store-status {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 10px 11px;
  }

  .status-title {
    font-size: 13px;
  }

  .store-status p {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 3px;
    font-size: 10px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .store-status > button {
    width: auto;
    min-height: 32px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .status-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(72px, 1fr));
    overflow-x: auto;
    border-radius: var(--mobile-radius);
    scrollbar-width: none;
  }

  .status-strip::-webkit-scrollbar,
  .order-actions::-webkit-scrollbar,
  .after-sale-admin-actions::-webkit-scrollbar {
    display: none;
  }

  .status-stat {
    height: 58px;
    min-width: 72px;
    padding: 7px 5px;
  }

  .status-stat + .status-stat,
  .status-stat:nth-child(2),
  .status-stat:nth-child(odd) {
    border-top: 0;
    border-right: 0;
    border-left: 1px solid rgba(255, 255, 255, .12);
  }

  .status-stat:first-child {
    border-left: 0;
  }

  .status-stat strong {
    font-size: 18px;
    line-height: 1;
  }

  .status-stat span {
    margin-top: 4px;
    font-size: 9px;
  }

  .section-row {
    min-height: 34px;
    gap: 6px;
  }

  .section-row h2 {
    font-size: 14px;
  }

  .section-row p {
    font-size: 9px;
  }

  .section-row > button,
  .section-row > a {
    min-height: 30px;
    padding: 0 9px;
    font-size: 10px;
  }

  .metric-grid,
  .point-summary-metrics,
  .promotion-summary,
  .visitor-summary,
  .dashboard-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .metric-card,
  .visitor-summary-card {
    min-height: 72px;
    padding: 9px 10px;
  }

  .metric-card span,
  .metric-card small,
  .visitor-summary-card span,
  .visitor-summary-card small {
    font-size: 9px;
  }

  .metric-card strong,
  .visitor-summary-card strong {
    margin-top: 2px;
    font-size: 20px;
    line-height: 1.05;
  }

  .dash-order {
    display: grid;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 8px;
    padding: 9px 10px;
  }

  .dash-order strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dash-order span,
  .dash-order em {
    font-size: 9px;
  }

  .dash-order b {
    grid-row: 1 / span 2;
    grid-column: 2;
    align-self: center;
    font-size: 13px;
  }

  .side-card {
    padding: 10px;
  }

  .side-card h3 {
    margin-bottom: 7px;
    font-size: 12px;
  }

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

  .side-grid > div {
    min-height: 52px;
    padding: 7px 8px;
    border-radius: 7px;
  }

  .side-grid span,
  .advice-list,
  .low-stock-list {
    font-size: 9px;
  }

  .side-grid strong {
    font-size: 17px;
  }

  .form-grid,
  .feedback-process-grid {
    gap: 9px;
  }

  .mobile-product-toolbar {
    display: flex;
    min-height: 50px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--mobile-radius);
    background: var(--paper);
  }

  .mobile-product-toolbar div {
    display: grid;
    min-width: 0;
  }

  .mobile-product-toolbar strong {
    font-size: 13px;
  }

  .mobile-product-toolbar span {
    overflow: hidden;
    color: var(--muted-ink);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-product-toolbar button {
    min-height: 32px;
    padding: 0 10px;
    white-space: nowrap;
  }

  #productsView #productForm {
    display: none;
  }

  #productsView.mobile-editor-open #productForm {
    display: grid;
  }

  .product-images-field,
  .spec-groups-field {
    padding: 9px;
  }

  .product-images-head,
  .spec-groups-head {
    align-items: center;
    flex-direction: row;
    gap: 7px;
  }

  .product-images-title {
    font-size: 12px;
  }

  .product-images-subtitle,
  .upload-status {
    font-size: 9px;
  }

  .product-images-picker,
  .product-images-picker button {
    width: auto;
  }

  .list,
  .list.compact,
  .promotion-records,
  .coupon-product-grid {
    gap: 8px;
  }

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

  #productsList .card {
    overflow: hidden;
  }

  #productsList .thumb {
    height: auto;
    max-height: none;
    aspect-ratio: 1;
  }

  #productsList .card-body {
    padding: 8px;
  }

  #productsList .card-title {
    display: -webkit-box;
    min-height: 34px;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  #productsList .card-meta {
    overflow: hidden;
    margin-top: 3px;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #productsList .card-actions {
    gap: 5px;
    margin-top: 7px;
  }

  #productsList .card-actions > * {
    min-height: 30px;
    padding: 0 7px;
    font-size: 10px;
  }

  .toolbar,
  .filter-bar,
  .order-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .order-tools #orderKeyword {
    grid-column: 1 / -1;
  }

  .order-tools > *,
  .toolbar > *,
  .filter-bar > * {
    width: auto;
  }

  .order-tools .export-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .filter-summary {
    min-height: 32px;
    align-items: center;
    flex-direction: row;
    gap: 5px;
    margin: 0 0 7px;
    padding: 6px 8px;
    font-size: 9px;
  }

  .orders-list,
  .feedback-list {
    gap: 8px;
  }

  .order-card,
  .feedback-card,
  .point-customer-card,
  .point-redemption-card {
    padding: 10px;
  }

  .order-head,
  .feedback-head,
  .point-customer-head,
  .point-redemption-head {
    gap: 6px;
    padding-bottom: 7px;
  }

  .order-no {
    font-size: 12px;
  }

  .order-no-line,
  .copy-value-row {
    gap: 4px;
  }

  .copy-btn {
    min-height: 25px;
    padding: 0 7px;
    font-size: 9px;
  }

  .status {
    padding: 3px 7px;
    font-size: 9px;
  }

  .order-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    font-size: 10px;
  }

  .field-label,
  .feedback-meta-grid dt {
    font-size: 9px;
  }

  .order-item {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 8px;
    padding: 7px 0;
  }

  .order-item img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
  }

  .order-item strong {
    font-size: 11px;
  }

  .order-item span,
  .shipping-status-meta,
  .logistics-provider-notice {
    font-size: 9px;
  }

  .shipping-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 7px;
    padding-top: 8px;
  }

  .shipping-row > * {
    min-width: 0;
  }

  .order-actions,
  .after-sale-admin-actions,
  .point-redemption-actions {
    display: flex;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 6px;
    margin-top: 8px;
    padding-bottom: 1px;
    scrollbar-width: none;
  }

  .order-actions > *,
  .after-sale-admin-actions > *,
  .point-redemption-actions > * {
    width: auto;
    min-width: max-content;
    min-height: 32px;
    padding: 0 10px;
    font-size: 10px;
  }

  .feedback-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 6px;
  }

  .feedback-tools input {
    grid-column: 1 / -1;
  }

  .feedback-tools > * {
    min-width: 0;
  }

  .feedback-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
  }

  .feedback-meta-grid dd {
    font-size: 10px;
  }

  .feedback-description,
  .after-sale-admin-panel {
    margin-top: 7px;
    padding: 8px;
    font-size: 10px;
  }

  .after-sale-admin-summary strong {
    font-size: 11px;
  }

  .after-sale-admin-summary span,
  .feedback-description p {
    font-size: 9px;
  }

  .feedback-process-grid {
    margin-top: 8px;
  }

  .mobile-tabbar {
    height: calc(58px + env(safe-area-inset-bottom));
    padding: 3px 5px env(safe-area-inset-bottom);
    box-shadow: 0 -4px 14px rgba(31, 45, 39, .07);
  }

  .mobile-tab {
    height: 52px;
    gap: 1px;
    border-radius: 6px;
    font-size: 9px;
  }

  .mobile-tab-icon {
    width: 24px;
    height: 23px;
  }

  .mobile-more-sheet {
    max-height: min(82vh, 660px);
    padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
  }

  .mobile-more-head {
    margin-bottom: 8px;
  }

  .mobile-more-head h2 {
    font-size: 17px;
  }

  .mobile-more-status {
    padding: 8px 9px;
    font-size: 10px;
  }

  .mobile-menu-group {
    margin-top: 12px;
  }

  .mobile-menu-group h3 {
    margin-bottom: 6px;
    font-size: 10px;
  }

  .mobile-menu-grid {
    gap: 6px;
  }

  .mobile-menu-grid button {
    height: 60px;
    gap: 4px;
    font-size: 9px;
  }

  .mobile-menu-grid b {
    width: 25px;
    height: 25px;
    font-size: 12px;
  }

  .mobile-app-actions {
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
  }

  .mobile-install-hint {
    margin-top: 8px;
    font-size: 9px;
  }

  .modal-panel {
    padding: 12px 10px calc(14px + env(safe-area-inset-bottom));
  }

  .modal-head {
    top: -12px;
    margin: -12px -10px 9px;
    padding: 10px;
  }
}

@media (max-width: 560px) {
  .order-actions,
  .after-sale-admin-actions,
  .point-redemption-actions {
    display: flex;
    grid-template-columns: none;
  }

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

  .shipping-row > button:last-child {
    grid-column: 1 / -1;
  }
}

/* Keep the native mobile workbench independent from the legacy global button theme. */
@media (max-width: 900px) {
  body[data-active-view="dashboard"] .mobile-commerce-dashboard button {
    background: transparent !important;
  }

  body[data-active-view="dashboard"] .mobile-store-actions button {
    background: rgba(255, 255, 255, .82) !important;
  }

  body[data-active-view="dashboard"] .mobile-store-actions button:last-child {
    background: #315efb !important;
  }

  body[data-active-view="dashboard"] .mobile-task-board {
    background: #315efb;
  }

  body[data-active-view="dashboard"] .mobile-announcement {
    background: #fff !important;
  }

  body[data-active-view="dashboard"] .mobile-quick-section,
  body[data-active-view="dashboard"] .mobile-operation-feed {
    background: #fff;
  }

  .mobile-tabbar .mobile-tab {
    background: transparent !important;
  }

  .mobile-tabbar .mobile-tab.active {
    background: #eef2ff !important;
    color: #315efb;
  }
}

/* Foreground new-order alerts for the web dashboard and installed Android shell. */
.order-alert-toggle {
  position: relative;
}

.order-alert-toggle::after {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #20a66a;
  content: "";
}

.order-alert-toggle.is-muted {
  color: #98a2b3 !important;
}

.order-alert-toggle.is-muted::after {
  background: #a8b0bd;
}

.new-order-alert[hidden] {
  display: none !important;
}

.new-order-alert {
  position: fixed;
  top: 78px;
  right: 24px;
  z-index: 120;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 30px;
  align-items: center;
  gap: 11px;
  width: min(440px, calc(100vw - 48px));
  padding: 13px 12px;
  border: 1px solid #dce4e1;
  border-left: 4px solid #bf8c2f;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(21, 43, 37, .2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity .18s ease, transform .18s ease;
}

.new-order-alert.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.new-order-alert[data-kind="paid"] {
  border-left-color: #1d8c62;
}

.new-order-alert-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 7px;
  background: #f5ead4;
  color: #8a5d11;
}

.new-order-alert[data-kind="paid"] .new-order-alert-icon {
  background: #e6f3ed;
  color: #176b50;
}

.new-order-alert-icon svg,
.new-order-alert-close svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.new-order-alert-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.new-order-alert-copy strong {
  color: #17342d;
  font-size: 15px;
}

.new-order-alert-copy span {
  overflow: hidden;
  color: #68756f;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-order-alert-action {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: #17342d;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.new-order-alert-close {
  display: grid;
  width: 30px;
  height: 30px;
  min-height: 30px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #87918c;
}

@media (max-width: 900px) {
  .new-order-alert {
    top: calc(68px + env(safe-area-inset-top));
    right: 12px;
    left: 12px;
    grid-template-columns: 40px minmax(0, 1fr) auto 28px;
    width: auto;
    gap: 8px;
    padding: 11px 9px;
  }

  .new-order-alert-icon {
    width: 38px;
    height: 38px;
  }

  .new-order-alert-action {
    padding: 0 9px;
  }

  .mobile-store-actions .order-alert-toggle.is-muted {
    background: rgba(255, 255, 255, .65) !important;
    color: #9ba3b0 !important;
  }
}
