:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #d9e2ec;
  --text: #15202b;
  --muted: #66788a;
  --blue: #1f6feb;
  --green: #12805c;
  --amber: #a15c00;
  --red: #bd2c38;
  --purple: #6f42c1;
  --hover-bg: #f1f5f9;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  background: #111827;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  padding: 22px 18px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  background: #f8cf25;
  font-weight: 800;
  border-radius: 8px;
  overflow: hidden;
  flex: 0 0 42px;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
}

.brand-subtitle {
  color: #a8b3c3;
  font-size: 12px;
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 6px;
  padding: 22px 0;
}

.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  padding: 12px 14px;
  border-radius: 7px;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: #263245;
  color: #ffffff;
}

.sidebar-foot {
  margin-top: auto;
  color: #cbd5e1;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.ok {
  background: #2fb344;
}

.app {
  margin-left: 248px;
  min-height: 100vh;
  padding: 24px;
}

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

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

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

h2 {
  font-size: 17px;
}

h3 {
  font-size: 14px;
  margin-bottom: 10px;
}

.topbar p {
  margin-top: 6px;
  color: var(--muted);
}

.top-actions,
.form-actions,
.row-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.row-actions {
  margin-top: 10px;
}

button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  min-height: 36px;
  padding: 0 14px;
  border-radius: 7px;
  cursor: pointer;
}

.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.secondary {
  background: #eef6ff;
  color: #164a8b;
  border-color: #c7ddf4;
}

.icon-btn {
  width: 38px;
  padding: 0;
  font-size: 20px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

body.tenant-mode #adminUserSection,
body.tenant-mode #adminPaymentConfigSection,
body.tenant-mode #adminPaymentsSection,
body.tenant-mode #simulateBtn,
body.tenant-mode #addProductBtn,
body.tenant-mode #addOrderBtn {
  display: none !important;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}

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

.metric strong {
  display: block;
  font-size: 26px;
  margin-top: 8px;
}

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

/* Accounts page: give more space to account list */
#accounts .split {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: start;
}

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

.panel-head {
  flex: 0 0 auto;
  min-height: 58px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.panel-head h2 {
  white-space: nowrap;
  flex-shrink: 0;
}
.panel-head .muted {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

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

.stack,
.log-list,
.conversation-list,
.timeline {
  padding: 14px;
}

.item {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}

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

.item-foot {
  margin-top: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.badge.low,
.badge.待交易 {
  color: var(--green);
  border-color: #b7dfcc;
  background: #ecfdf3;
}

.badge.medium,
.badge.待发货 {
  color: var(--amber);
  border-color: #efd6a4;
  background: #fff7e6;
}

.badge.high,
.badge.收货中 {
  color: var(--red);
  border-color: #f0b6bb;
  background: #fff0f2;
}

.badge.pending,
.badge.demo,
.badge.发货中 {
  color: var(--purple);
  border-color: #d7c7f4;
  background: #f5f0ff;
}

.pending-badge {
  color: #fff;
  background: #e74c3c;
  border-color: #e74c3c;
  font-weight: 600;
}

.log-list {
  max-height: 430px;
  overflow: auto;
}

.log {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  font-size: 14px;
}

.log:last-child {
  border-bottom: 0;
}

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

.mini-kpi {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.mini-kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.mini-kpi strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.log-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.log-row pre {
  margin: 8px 0 0;
  padding: 8px;
  border-radius: 6px;
  background: #f1f5f9;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  color: #475569;
}

.queue-actions {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  flex-wrap: wrap;
}

.danger-soft {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.danger-soft:hover {
  background: #ffe4e6;
}

.compact-btn {
  padding: 5px 9px;
  min-height: 28px;
  font-size: 12px;
}

.compact-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

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

.seller-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.seller-card {
  min-height: 78px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 12px;
  cursor: pointer;
}

.seller-card.active,
.seller-card:hover {
  border-color: #8bb8ee;
  background: #f1f7ff;
}

.seller-avatar,
.customer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  background: linear-gradient(135deg, #1f6feb, #6f42c1);
  color: #fff;
  border: 0;
  padding: 0;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.seller-avatar.avatar-missing,
.customer-avatar.avatar-missing {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #d8e0ea;
}

.customer-avatar-wrap {
  width: 44px;
  height: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 10px;
  cursor: pointer;
}

.avatar-image {
  position: relative;
  overflow: hidden;
}

.avatar-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-image span {
  opacity: 0;
}

.seller-info {
  display: grid;
  min-width: 0;
}

.seller-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seller-info span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.seller-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: end;
}

.account-list {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.account-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 12px;
}

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

.account-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-stats span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 13px;
}

/* Status badges */
.status-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.status-online { background: #dcfce7; color: #166534; }
.status-pending { background: #fef9c3; color: #854d0e; }
.status-offline { background: #f3f4f6; color: #6b7280; }

/* Device tag */
.device-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eff6ff; color: #1e40af;
  white-space: nowrap;
}
.device-tag.no-device { background: #fff7ed; color: #9a3412; }

/* Account action buttons */
.account-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.btn-sm {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.btn-sm:hover { background: var(--hover-bg); }
.btn-sm.danger:hover { background: #fef2f2; border-color: #fca5a5; }

.pay-proof-label {
  display: block;
  margin: 12px 0 6px;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.pay-proof-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin:0; font-size: 16px; }
.modal-body { padding: 16px 20px; display: grid; gap: 12px; }
.modal-body label { font-size: 13px; color: var(--muted); font-weight: 600; }
.modal-body input, .modal-body select {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 6px;
  font-size: 14px;
}
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px; border-top: 1px solid var(--line);
}
.close-btn {
  background: none; border: none; font-size: 20px;
  cursor: pointer; color: var(--muted); padding: 0 4px;
}
.close-btn:hover { color: #111; }

.connect-card {
  padding: 16px;
  display: grid;
  gap: 14px;
  color: var(--muted);
}

.login-qr-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.login-qr-panel.hidden {
  display: none;
}

.login-qr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
}

.login-qr-head .secondary {
  min-height: 32px;
  padding: 0 12px;
}

.login-qr-box {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 260px;
  border: 1px dashed #c7ddf4;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.login-qr-box img {
  display: block;
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.login-qr-placeholder {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.publish-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.2fr) minmax(360px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

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

.publish-form textarea {
  min-height: 84px;
  resize: vertical;
}

.publish-form .span-2,
.form-section-title {
  grid-column: 1 / -1;
}

.form-section-title {
  font-weight: 800;
  padding-left: 10px;
  border-left: 4px solid #f4d000;
}

.publish-task-list {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.publish-task {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.publish-task-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.publish-task-info {
  min-width: 0;
  flex: 1;
}
.publish-task-info strong {
  display: block;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.publish-task-info .muted {
  font-size: 12px;
  line-height: 1.6;
}
.publish-task-status {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.publish-task-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.publish-task-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.xgj-task {
  border-left: 3px solid #facc15;
}

.error-line {
  margin-top: 4px;
  color: #dc2626;
  font-size: 12px;
}

/* ── Required field marker ── */
.form-label-required::after {
  content: " *";
  color: #dc2626;
  font-weight: 700;
}

/* ── Radio group (shipping) ── */
.radio-group {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.radio-label {
  display: flex !important;
  align-items: center;
  gap: 5px;
  font-weight: 400;
  cursor: pointer;
}
.radio-label input[type="radio"] {
  width: auto;
  min-height: auto;
}

/* ── Price input with ¥ prefix ── */
.price-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}
.price-input-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31,111,235,0.12);
}
.price-prefix {
  padding: 0 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  border-right: 1px solid var(--line);
  background: #f8fafc;
}
.price-input-wrap input {
  border: none !important;
  border-radius: 0 !important;
  min-height: 36px;
}
.price-input-wrap input:focus {
  outline: none;
  box-shadow: none;
}

/* ── Character counter ── */
.char-counter {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 11px;
  color: var(--muted);
  background: rgba(255,255,255,0.85);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

/* ── Image Drop Zone ── */
.image-drop-zone {
  border: 2px dashed #3a4a62;
  border-radius: 10px;
  min-height: 120px;
  background: #f8fafc;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.image-drop-zone:hover,
.image-drop-zone:focus-within {
  border-color: var(--blue);
  background: #eef6ff;
}
.image-drop-zone.drag-over {
  border-color: var(--blue);
  background: #dceeff;
  border-style: solid;
}
.image-drop-zone.has-images {
  border-style: solid;
  border-color: var(--line);
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  text-align: center;
}
.image-drop-zone.has-images .drop-zone-content {
  padding: 12px 16px;
}

.drop-zone-text {
  color: var(--text);
  font-size: 14px;
  margin: 10px 0 4px;
}
.drop-zone-hint {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.link-btn {
  background: none !important;
  border: none !important;
  color: var(--blue) !important;
  padding: 0 !important;
  min-height: auto !important;
  font-size: inherit !important;
  cursor: pointer !important;
  text-decoration: underline;
}
.link-btn:hover {
  color: #164a8b !important;
}

/* Image previews in drop zone */
.drop-zone-previews {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px 14px;
  align-items: flex-start;
}
.image-upload-summary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}
.image-upload-summary strong {
  color: var(--text);
}
.image-upload-summary span {
  color: var(--muted);
  font-size: 12px;
  margin-left: 8px;
}
.image-upload-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.preview-thumb {
  width: 96px;
  height: 112px;
  border-radius: 8px;
  border: 2px solid var(--line);
  position: relative;
  overflow: hidden;
  background: #e2e8f0;
}
.preview-thumb img {
  width: 100%;
  height: 76px;
  object-fit: cover;
}
.preview-thumb.main-thumb {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(31,111,235,0.25);
}
.preview-role {
  position: absolute;
  top: 4px;
  left: 0;
  background: rgba(15,23,42,0.72);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 0 6px 6px 0;
}
.preview-thumb.main-thumb .preview-role {
  background: rgba(31,111,235,0.9);
}
.preview-thumb .set-main-thumb {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,0.92);
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
}
.preview-thumb.main-thumb .set-main-thumb {
  display: none;
}
.preview-thumb .remove-thumb {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  display: none;
}
.preview-thumb:hover .remove-thumb {
  display: block;
}

.product-agent-notes {
  max-width: 360px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-desc-cell {
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 13px;
}

.product-submeta {
  margin-top: 3px;
}

.product-incentive {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-top: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff4e6;
  color: #b45309;
  font-size: 12px;
  font-weight: 700;
}

.product-status-actions {
  min-width: 230px;
}

.product-pool-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}

.product-pool-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}

.product-pool-stats button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  min-height: 34px;
  background: var(--surface);
  color: var(--muted);
}

.product-pool-stats button.active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.product-pool-stats button strong {
  color: var(--text);
}

.product-pool-stats button.active strong {
  color: #fff;
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.segmented-control button {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 7px 12px;
  min-height: 32px;
}

.segmented-control button.active {
  background: #111827;
  color: #fff;
}

/* ── Advanced options ── */
.form-advanced {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  margin-top: 2px;
}
.form-advanced summary {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  user-select: none;
}
.form-advanced summary:hover {
  color: var(--blue);
}
.form-advanced[open] summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}
.form-advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  padding: 14px;
}
.form-advanced-grid .span-2 {
  grid-column: 1 / -1;
}
@media (max-width: 760px) {
  .form-advanced-grid {
    grid-template-columns: 1fr;
  }
}

.row-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.row-actions button {
  padding: 4px 8px;
  font-size: 12px;
}

.panel-foot {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}

/* ── Mode Tabs ── */
.mode-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.mode-tab {
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.mode-tab:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: #eef6ff;
}

.mode-tab.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.badge-yellow {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 10px;
  font-weight: 600;
}
.badge-green {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: #d1fae5;
  color: #065f46;
  font-size: 10px;
  font-weight: 600;
}
/* AI sourcing results */
.ai-result-row { cursor: pointer; transition: background .15s; }
.ai-result-row:hover { background: #f0f7ff; }
.ai-score-bar { display: flex; gap: 4px; align-items: center; }
.ai-score-bar .score-chip { padding: 1px 6px; border-radius: 4px; font-size: 11px; background: #f0f0f0; color: #666; }
.ai-score-bar .score-chip.highlight { background: #e6f4ff; color: #1677ff; }
.ai-fallback-toggle {
  min-height: 36px;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.ai-fallback-toggle input {
  width: 16px;
  height: 16px;
}
.ai-material-box { background: #fafafa; border: 1px solid #e8e8e8; border-radius: 8px; padding: 16px; }
.ai-material-box textarea { width: 100%; border: 1px solid #d9d9d9; border-radius: 6px; padding: 8px; font-size: 13px; resize: vertical; min-height: 60px; font-family: inherit; }
.ai-material-box textarea:focus { border-color: #1677ff; outline: none; }
.ai-material-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ── Sourcing Pool Cards ── */
.sourcing-card { transition: box-shadow .15s; }
.sourcing-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.sourcing-img-wrap { flex-shrink: 0; }
.sourcing-img-placeholder {
  width: 80px; height: 80px; border-radius: 6px;
  background: #f5f5f5; display: flex; align-items: center;
  justify-content: center; color: #bbb; font-size: 12px; flex-shrink: 0;
}

/* ── AI Placeholder ── */
.ai-placeholder {
  padding: 32px 24px;
  text-align: center;
}

.ai-placeholder-icon {
  font-size: 56px;
  margin-bottom: 12px;
}

.ai-placeholder h3 {
  font-size: 20px;
  margin: 0 0 8px;
}

.ai-placeholder > p {
  color: var(--muted);
  margin-bottom: 24px;
}

.ai-steps {
  display: grid;
  gap: 16px;
  text-align: left;
  max-width: 480px;
  margin: 0 auto 24px;
}

.ai-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.ai-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.ai-step strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.ai-step p {
  margin: 0;
  font-size: 13px;
}

.ai-config-preview {
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  text-align: left;
}

.ai-config-preview h4 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
}

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

.ai-config-grid label {
  font-size: 13px;
  color: var(--muted);
  display: grid;
  gap: 5px;
}

.ai-config-grid input,
.ai-config-grid select {
  opacity: 0.6;
  cursor: not-allowed;
}

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

@media (max-width: 760px) {
  .publish-form {
    grid-template-columns: 1fr;
  }
}

.product-cell {
  display: grid;
  grid-template-columns: 52px minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
}

/* Thumbnail wrapper */
.thumb-wrap {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s;
}
.thumb-wrap:hover { transform: scale(1.05); }
.thumb-wrap.thumb-empty {
  border: 2px dashed #3a4a62;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
}
.thumb-wrap.thumb-broken::after {
  content: "⚠";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #263245;
  border-radius: 8px;
  font-size: 16px;
  color: #f59e0b;
}

.product-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: #263245;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.empty-thumb {
  border: 0;
  color: #4a5e7a;
  font-size: 12px;
}

/* Hover preview */
.thumb-preview {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  margin-top: 8px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.thumb-preview img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.thumb-wrap:hover .thumb-preview { display: block; }

/* ── Image Editor Overlay ── */
.image-editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-editor-card {
  background: #1a2332;
  border: 1px solid #334155;
  border-radius: 14px;
  width: 440px;
  max-width: 92vw;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  overflow: hidden;
}
.image-editor-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid #2a3a52;
}
.image-editor-head h3 { margin: 0 0 4px; font-size: 16px; }
.image-editor-head .muted { font-size: 12px; }
.image-editor-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.image-editor-preview {
  width: 100%;
  height: 200px;
  background: #111827;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #2a3a52;
}
.image-editor-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.image-editor-preview span {
  color: #5a6e8a;
  font-size: 14px;
}
.image-editor-body label {
  font-size: 13px;
  color: #8fa0ba;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.image-editor-body input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #111827;
  color: #e2e8f0;
  font-size: 13px;
  font-family: inherit;
}
.image-editor-body input:focus {
  outline: none;
  border-color: #1f6feb;
  box-shadow: 0 0 0 3px rgba(31,111,235,0.18);
}
.image-editor-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.inbox-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  height: calc(100vh - 210px);
  min-height: 680px;
}

.list-panel,
.detail-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.stage-tabs {
  flex: 0 0 auto;
  padding: 12px 14px 0;
}

.group-tabs,
.stage-tabs-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stage-tabs-row {
  margin-top: 8px;
}

.group-tab {
  font-weight: 700;
}

.stage-tab {
  min-height: 34px;
  background: #fff;
}

.conversation-list,
.timeline {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.stage-tab.active,
.stage-tab:hover {
  color: #164a8b;
  border-color: #9cc3ee;
  background: #eef6ff;
}

.stage-tab span {
  color: var(--muted);
  margin-left: 4px;
}

.conversation {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  background: #fff;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.conversation.active,
.conversation:hover {
  border-color: #8bb8ee;
  background: #f1f7ff;
}

.conversation-body {
  min-width: 0;
}

.conversation-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.conversation-line strong,
.latest-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.latest-text {
  margin-top: 7px;
  color: #344256;
  font-size: 14px;
}

.message {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  line-height: 1.55;
}

.message.inbound {
  background: #f1f5f9;
  border: 1px solid #dbe4ee;
}

.message.outbound {
  background: #e8f1ff;
  border: 1px solid #c8ddfb;
  margin-left: auto;
}

.message-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.agent-run {
  border: 1px solid #d6e2f0;
  background: #fbfdff;
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
}

.agent-reply {
  margin-top: 8px;
  line-height: 1.55;
}

.empty {
  color: var(--muted);
  padding: 18px;
}

.form-grid {
  padding: 16px;
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #344256;
  font-size: 13px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 38px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.code-block {
  margin: 14px;
  padding: 14px;
  min-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  background: #0f172a;
  color: #dbeafe;
  border-radius: 8px;
  line-height: 1.55;
  font-size: 13px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  background: #f3f6fa;
  color: #475569;
  font-weight: 700;
}

.task-board {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.task-board > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.task-board p {
  color: #344256;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #111827;
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transform: translateY(80px);
  opacity: 0;
  transition: 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1200px) {
  .seller-strip {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .app {
    margin-left: 0;
  }

  .topbar,
  .split,
  .inbox-layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

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

/* ── Login Overlay ── */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 36px;
  overflow: auto;
  background:
    linear-gradient(120deg, rgba(248, 207, 37, 0.16) 0 22%, transparent 22% 100%),
    linear-gradient(180deg, #f7fafc 0%, #eef4f8 100%);
  transition: opacity 0.4s, visibility 0.4s;
}

.login-overlay::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(17, 48, 45, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 48, 45, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(90deg, rgba(0,0,0,0.7), transparent 78%);
}

.login-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-shell {
  position: relative;
  width: min(1180px, 100%);
  min-height: min(720px, calc(100vh - 72px));
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) 420px;
  overflow: hidden;
  border: 1px solid rgba(21, 32, 43, 0.08);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.18);
}

.login-hero-panel {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 46px;
  color: #ecfeff;
  background:
    linear-gradient(135deg, rgba(18, 128, 92, 0.42), transparent 48%),
    linear-gradient(160deg, #12312e 0%, #16243a 58%, #251c33 100%);
}

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

.login-brandline img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #f8cf25;
}

.login-brandline strong,
.login-brandline span {
  display: block;
}

.login-brandline strong {
  font-size: 18px;
  color: #ffffff;
}

.login-brandline span {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(236, 254, 255, 0.68);
}

.login-hero-copy {
  max-width: 620px;
}

.login-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(248, 207, 37, 0.42);
  border-radius: 8px;
  background: rgba(248, 207, 37, 0.12);
  color: #fde68a;
  font-size: 13px;
  font-weight: 700;
}

.login-hero-copy h1 {
  margin-top: 18px;
  max-width: 620px;
  color: #ffffff;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.08;
  font-weight: 850;
  letter-spacing: 0;
}

.login-hero-copy p {
  margin-top: 16px;
  max-width: 560px;
  color: rgba(236, 254, 255, 0.72);
  font-size: 15px;
  line-height: 1.8;
}

.login-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.login-status-strip div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(236, 254, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.84);
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.status-dot.ok { background: #34d399; }
.status-dot.blue { background: #60a5fa; }
.status-dot.amber { background: #fbbf24; }

.login-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: auto;
}

.login-insight-card {
  min-height: 130px;
  padding: 16px;
  border: 1px solid rgba(236, 254, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.login-insight-card span {
  color: #f8cf25;
  font-size: 12px;
  font-weight: 800;
}

.login-insight-card strong {
  display: block;
  margin-top: 10px;
  color: #ffffff;
  font-size: 17px;
}

.login-insight-card p {
  margin-top: 8px;
  color: rgba(236, 254, 255, 0.68);
  font-size: 13px;
  line-height: 1.55;
}

.login-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding-top: 4px;
}

.login-flow div {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(236, 254, 255, 0.14);
  border-radius: 8px;
  background: rgba(6, 18, 28, 0.26);
}

.login-flow b,
.login-flow span {
  display: block;
}

.login-flow b {
  color: #f8cf25;
  font-size: 12px;
}

.login-flow span {
  margin-top: 4px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
}

.login-auth-panel {
  display: grid;
  align-items: center;
  padding: 44px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.96)),
    #ffffff;
}

.login-card {
  position: relative;
  width: 100%;
  padding: 34px;
  background: #ffffff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.10);
}

.login-header {
  margin-bottom: 28px;
}

.login-mark {
  margin-bottom: 18px;
  display: inline-flex;
}

.login-mark img {
  width: 44px;
  height: 44px;
  display: block;
  object-fit: cover;
  border-radius: 10px;
  border: 0;
  background: #f8cf25;
}

.login-header h2 {
  font-size: 26px;
  font-weight: 850;
  color: #15202b;
  margin: 0 0 8px;
  letter-spacing: 0;
}

.login-header p {
  font-size: 13px;
  color: #66788a;
  letter-spacing: 0;
  margin: 0;
}

.login-form .field {
  margin-bottom: 20px;
}

.login-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #7890a8;
  pointer-events: none;
}

.login-form input {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid #cbd8e6;
  border-radius: 8px;
  background: #f8fafc;
  color: #15202b;
  font-size: 14px;
  outline: none;
  transition: border 0.2s, background 0.2s, box-shadow 0.2s;
}

.input-wrap input {
  padding-left: 40px;
}

.login-form input::placeholder {
  color: #94a3b8;
}

.login-form input:focus {
  border-color: #1f6feb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(31,111,235,0.12);
}

.login-btn {
  width: 100%;
  padding: 13px;
  margin-top: 8px;
  background: linear-gradient(135deg, #1f6feb, #12805c);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(31,111,235,0.35);
}

.login-btn:active {
  transform: scale(0.98);
}

.login-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.login-error {
  text-align: center;
  font-size: 13px;
  color: #f87171;
  margin: 12px 0 0;
  min-height: 20px;
}
.demo-btn {
  background: linear-gradient(135deg, #27ae60, #2ecc71) !important;
  margin-top: 8px;
  font-size: 13px !important;
}
.demo-btn:hover { opacity: 0.9; }

.login-foot {
  text-align: center;
  font-size: 12px;
  color: #66788a;
  margin-top: 24px;
}

.login-foot a {
  color: #1f6feb;
  font-weight: 700;
  text-decoration: none;
}

.login-foot a:hover {
  text-decoration: underline;
}

@media (max-width: 980px) {
  .login-overlay {
    padding: 18px;
    place-items: start center;
  }

  .login-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-hero-panel {
    padding: 28px;
  }

  .login-hero-copy h1 {
    font-size: 32px;
  }

  .login-insight-grid {
    grid-template-columns: 1fr;
  }

  .login-auth-panel {
    order: -1;
    padding: 22px;
  }
}

@media (max-width: 560px) {
  .login-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-card {
    padding: 24px;
  }
}

/* Login visual refresh: softer background, lighter product signal */
.login-overlay {
  padding: 34px;
  background:
    linear-gradient(118deg, rgba(248, 207, 37, 0.10) 0 14%, transparent 14% 100%),
    linear-gradient(152deg, rgba(18, 128, 92, 0.10) 0 32%, transparent 32% 100%),
    linear-gradient(34deg, rgba(31, 111, 235, 0.055) 0 42%, transparent 42% 100%),
    linear-gradient(180deg, #fbfdf9 0%, #f1f8f4 46%, #f6f9fc 100%);
}

.login-overlay::before {
  background:
    linear-gradient(rgba(18, 128, 92, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 111, 235, 0.04) 1px, transparent 1px),
    linear-gradient(128deg, transparent 0 58%, rgba(255, 255, 255, 0.58) 58% 100%);
  background-size: 42px 42px, 42px 42px, 100% 100%;
  mask-image: linear-gradient(90deg, rgba(0,0,0,0.42), rgba(0,0,0,0.22) 55%, transparent 80%);
}

.login-shell {
  width: min(1120px, 100%);
  min-height: min(668px, calc(100vh - 68px));
  grid-template-columns: minmax(0, 1fr) 416px;
  border: 1px solid rgba(119, 137, 156, 0.22);
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.92)),
    rgba(255, 255, 255, 0.84);
  box-shadow: 0 30px 84px rgba(30, 41, 59, 0.16);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.login-hero-panel {
  position: relative;
  justify-content: space-between;
  padding: 42px 46px;
  color: #15202b;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(18, 128, 92, 0.13), transparent 43%),
    linear-gradient(24deg, rgba(248, 207, 37, 0.08), transparent 46%),
    linear-gradient(145deg, #fafff8 0%, #eff8f5 54%, #f7fbff 100%);
}

.login-hero-panel::before {
  content: "";
  position: absolute;
  inset: 40px 34px auto auto;
  width: 46%;
  height: 46%;
  border: 1px solid rgba(31, 111, 235, 0.13);
  border-radius: 10px;
  transform: rotate(-7deg) skewY(-4deg);
  background:
    linear-gradient(90deg, rgba(31, 111, 235, 0.09) 0 1px, transparent 1px 100%),
    linear-gradient(rgba(18, 128, 92, 0.09) 0 1px, transparent 1px 100%);
  background-size: 34px 34px;
}

.login-hero-panel::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 34%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.72));
  pointer-events: none;
}

.login-brandline,
.login-value-card {
  position: relative;
  z-index: 1;
}

.login-brandline strong {
  color: #15202b;
}

.login-brandline span {
  color: #66788a;
}

.login-auth-panel {
  padding: 44px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,250,252,0.72)),
    rgba(255, 255, 255, 0.70);
}

.login-card {
  border-color: rgba(119, 137, 156, 0.24);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.13);
}

.login-header h2 {
  font-size: 24px;
}

.login-mark img,
.login-brandline img {
  box-shadow: 0 8px 20px rgba(248, 207, 37, 0.22);
}

.login-btn {
  background: linear-gradient(135deg, #1f6feb, #12805c);
}

.login-value-card {
  position: relative;
  z-index: 1;
  width: min(590px, 100%);
  margin: auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.login-value-card .login-kicker {
  min-height: 30px;
  border-color: rgba(248, 207, 37, 0.52);
  background: rgba(248, 207, 37, 0.16);
  color: #7a5a00;
}

.login-value-card h1 {
  margin-top: 18px;
  max-width: 540px;
  color: #15202b;
  font-size: 46px;
  line-height: 1.08;
  font-weight: 850;
  letter-spacing: 0;
}

.login-value-card h1 span {
  color: #12805c;
  white-space: nowrap;
}

.login-value-card p {
  margin-top: 14px;
  max-width: 520px;
  color: #52667a;
  font-size: 15px;
  line-height: 1.8;
}

.login-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(190px, 0.82fr);
  gap: 12px;
  margin-top: 22px;
}

.login-chat-preview,
.login-action-preview {
  border: 1px solid rgba(119, 137, 156, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.09);
}

.login-chat-preview {
  padding: 16px;
}

.login-preview-label {
  color: #12805c;
  font-size: 12px;
  font-weight: 800;
}

.login-chat-bubble {
  width: fit-content;
  max-width: 94%;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.login-chat-bubble.buyer {
  background: #f1f5f9;
  color: #334155;
}

.login-chat-bubble.agent {
  margin-left: auto;
  background: #eaf8f1;
  color: #0f6849;
}

.login-action-preview {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(248, 207, 37, 0.22), transparent),
    rgba(255, 255, 255, 0.86);
}

.login-action-preview span {
  color: #7a5a00;
  font-size: 12px;
  font-weight: 800;
}

.login-action-preview strong {
  margin-top: 8px;
  color: #15202b;
  font-size: 18px;
  line-height: 1.35;
}

.login-action-preview p {
  margin-top: 8px;
  color: #66788a;
  font-size: 12px;
  line-height: 1.55;
}

.login-value-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.login-value-list div {
  min-height: 132px;
  padding: 14px;
  border: 1px solid #e0e8ef;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.login-value-list div::before {
  content: "";
  display: block;
  width: 28px;
  height: 4px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: #1f6feb;
}

.login-value-list .accent-green::before {
  background: #12805c;
}

.login-value-list .accent-yellow::before {
  background: #f8cf25;
}

.login-value-list strong {
  display: block;
  color: #15202b;
  font-size: 15px;
}

.login-value-list span {
  display: block;
  margin-top: 5px;
  color: #66788a;
  font-size: 13px;
  line-height: 1.55;
}

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

  .login-auth-panel {
    order: -1;
    padding: 22px;
  }

  .login-hero-panel {
    padding: 28px;
  }

  .login-value-card {
    margin: 24px 0 0;
  }

  .login-value-card h1 {
    font-size: 32px;
  }

  .login-showcase,
  .login-value-list {
    grid-template-columns: 1fr;
  }

  .login-value-list div {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .login-overlay {
    padding: 14px;
  }

  .login-value-card {
    padding: 22px;
  }

  .login-value-card h1 {
    font-size: 29px;
  }
}

/* Premium login atmosphere: richer depth without fake metrics */
.login-overlay {
  background:
    linear-gradient(118deg, rgba(248, 207, 37, 0.36) 0 5.2%, transparent 5.4% 100%),
    linear-gradient(128deg, transparent 0 54%, rgba(248, 207, 37, 0.16) 54.2% 55.2%, transparent 55.4% 100%),
    linear-gradient(150deg, rgba(18, 128, 92, 0.52) 0 29%, transparent 29.2% 100%),
    linear-gradient(158deg, #06161f 0 38%, #0d2c33 38.2% 60%, transparent 60.2% 100%),
    linear-gradient(24deg, rgba(11, 45, 58, 0.22) 0 34%, transparent 34.2% 100%),
    linear-gradient(180deg, #eef8f3 0%, #f8fbff 100%);
}

.login-overlay::before {
  opacity: 0.7;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(135deg, rgba(248, 207, 37, 0.10) 0 1px, transparent 1px 18px),
    linear-gradient(118deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.22) 45%, transparent 76%);
  background-size: auto;
  mask-image: linear-gradient(118deg, rgba(0,0,0,0.9), rgba(0,0,0,0.62) 44%, rgba(0,0,0,0.18) 76%, transparent 92%);
}

.login-shell {
  border-color: rgba(255, 255, 255, 0.26);
  background:
    linear-gradient(90deg, rgba(8, 27, 36, 0.92) 0%, rgba(9, 30, 40, 0.84) 59.8%, rgba(255, 255, 255, 0.96) 60% 100%);
  box-shadow:
    0 42px 120px rgba(5, 14, 22, 0.36),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

.login-hero-panel {
  color: #f8fafc;
  background:
    linear-gradient(124deg, rgba(248, 207, 37, 0.18) 0 17%, transparent 17.2% 100%),
    linear-gradient(146deg, rgba(22, 163, 128, 0.28), transparent 52%),
    linear-gradient(162deg, #0a2229 0%, #102a38 52%, #171f32 100%);
}

.login-hero-panel::before {
  opacity: 0.46;
  border-color: rgba(148, 223, 213, 0.25);
  background:
    linear-gradient(90deg, rgba(148, 223, 213, 0.20) 0 1px, transparent 1px 100%),
    linear-gradient(rgba(248, 207, 37, 0.14) 0 1px, transparent 1px 100%);
}

.login-hero-panel::after {
  background: linear-gradient(180deg, transparent, rgba(5, 14, 22, 0.36));
}

.login-brandline strong,
.login-value-card h1,
.login-action-preview strong,
.login-value-list strong {
  color: #f8fafc;
}

.login-brandline span,
.login-value-card p,
.login-action-preview p,
.login-value-list span {
  color: rgba(226, 232, 240, 0.74);
}

.login-value-card h1 span {
  color: #67e8c4;
}

.login-value-card .login-kicker {
  border-color: rgba(248, 207, 37, 0.52);
  background: rgba(248, 207, 37, 0.12);
  color: #fde68a;
}

.login-chat-preview,
.login-action-preview,
.login-value-list div {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.10);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.login-preview-label {
  color: #67e8c4;
}

.login-chat-bubble.buyer {
  background: rgba(248, 250, 252, 0.13);
  color: rgba(226, 232, 240, 0.92);
}

.login-chat-bubble.agent {
  background: rgba(16, 185, 129, 0.18);
  color: #dcfce7;
}

.login-action-preview {
  background:
    linear-gradient(135deg, rgba(248, 207, 37, 0.22), transparent 56%),
    rgba(255, 255, 255, 0.10);
}

.login-action-preview span {
  color: #fde68a;
}

.login-auth-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.88)),
    rgba(255,255,255,0.86);
}

/* Office-photo login background */
.login-overlay {
  background:
    linear-gradient(90deg, rgba(3, 13, 19, 0.78) 0%, rgba(5, 21, 28, 0.52) 42%, rgba(245, 251, 248, 0.16) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.10), rgba(0, 0, 0, 0.30)),
    url("/xianyu/assets/login-office-bg.webp?v=20260620_office_bg2") center / cover no-repeat;
}

.login-overlay::before {
  opacity: 1;
  background:
    linear-gradient(112deg, rgba(248, 207, 37, 0.20) 0 7%, transparent 7.2% 100%),
    linear-gradient(150deg, rgba(20, 184, 166, 0.16) 0 32%, transparent 32.2% 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.30), transparent 54%, rgba(255, 255, 255, 0.16));
  mask-image: none;
}

.login-shell {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(8, 24, 31, 0.18);
  box-shadow:
    0 42px 130px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
}

.login-hero-panel {
  background:
    linear-gradient(132deg, rgba(248, 207, 37, 0.14) 0 16%, transparent 16.2% 100%),
    linear-gradient(162deg, rgba(3, 19, 25, 0.88) 0%, rgba(8, 36, 43, 0.74) 58%, rgba(16, 24, 38, 0.78) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.login-auth-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(246, 251, 249, 0.74)),
    rgba(255, 255, 255, 0.70);
  backdrop-filter: blur(16px) saturate(1.05);
  -webkit-backdrop-filter: blur(16px) saturate(1.05);
}

.login-card {
  background: rgba(255, 255, 255, 0.90);
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 26px 70px rgba(3, 13, 19, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.46) inset;
}

@media (max-width: 980px) {
  .login-overlay {
    background:
      linear-gradient(180deg, rgba(3, 13, 19, 0.50), rgba(3, 13, 19, 0.70)),
      url("/xianyu/assets/login-office-bg.webp?v=20260620_office_bg2") 42% center / cover no-repeat;
  }

  .login-shell {
    background: rgba(8, 24, 31, 0.20);
  }
}

/* ── Sidebar logout ── */
.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-foot-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #9ca3af;
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  background: rgba(255,255,255,0.05);
  color: #9ca3af;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.logout-btn:hover {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  border-color: rgba(239,68,68,0.3);
}

/* ── Traffic 流量机制 ── */
.traffic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}
@media (max-width: 1100px) {
  .traffic-grid { grid-template-columns: 1fr; }
}
.traffic-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.mobile-worker-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 34px;
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  font-size: 12px;
}

.mobile-worker-status-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.mobile-worker-status-main {
  color: var(--text);
  font-weight: 700;
}

.mobile-worker-diagnosis {
  color: var(--muted);
  line-height: 1.45;
}

.runtime-health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.runtime-health-item {
  min-height: 70px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.runtime-health-item:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.runtime-health-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.runtime-health-main strong {
  font-size: 14px;
}

@media (max-width: 800px) {
  .traffic-actions { grid-template-columns: 1fr; }
  .runtime-health-grid { grid-template-columns: 1fr; }
  .runtime-health-item:nth-child(odd) { border-right: 0; }
}
.traffic-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.traffic-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.traffic-card-head h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
.traffic-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}
.traffic-card .muted { font-size: 12px; }
.traffic-card button { font-size: 13px; padding: 6px 16px; }
.traffic-product-list {
  max-height: 400px;
  overflow-y: auto;
}
.mobile-publish-section {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mobile-publish-section .form-row label {
  font-weight: 500;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-publish-section select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  font-size: 14px;
}
.publish-product-preview {
  min-height: 60px;
  padding: 12px;
  background: var(--bg-subtle, #f9fafb);
  border-radius: 8px;
}
.form-actions {
  display: flex;
  gap: 8px;
}
.form-actions button { font-size: 13px; }

/* ── VIP Badge & Upgrade ── */
.vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  background: #f0f0f0;
  color: #666;
}
.vip-badge.vip-standard { background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff; }
.vip-badge.vip-pro { background: linear-gradient(135deg, #8b5cf6, #d946ef); color: #fff; }
.vip-badge.vip-enterprise { background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; }
.vip-badge.vip-admin { background: linear-gradient(135deg, #1f6feb, #6f42c1); color: #fff; }

.upgrade-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #8b5cf6;
  background: transparent;
  color: #8b5cf6;
  cursor: pointer;
  transition: all .2s;
}
.upgrade-btn:hover { background: #8b5cf6; color: #fff; }

/* ── Pricing Modal ── */
.pricing-panel { max-width: 700px; }
.pricing-info { padding: 12px 0 16px; font-size: 14px; color: var(--muted, #666); }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan-card {
  padding: 24px 16px;
  border-radius: 12px;
  border: 2px solid var(--border, #e5e7eb);
  text-align: center;
  transition: all .2s;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}
.plan-card:hover { border-color: #8b5cf6; transform: translateY(-2px); }
.plan-card.selected { border-color: #8b5cf6; box-shadow: 0 0 0 1px #8b5cf6; }
.plan-card .plan-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.plan-card .plan-price { font-size: 28px; font-weight: 800; color: #1f2937; margin: 8px 0; }
.plan-card .plan-price span { font-size: 14px; font-weight: 400; color: #999; }
.plan-card .plan-features { list-style: none; padding: 0; margin: 12px 0; text-align: left; flex: 1; }
.plan-card .plan-features li { padding: 4px 0; font-size: 13px; color: #666; }
.plan-card .plan-features li::before { content: "✓ "; color: #27ae60; font-weight: 700; }
.plan-card .plan-action { margin-top: auto; }
.plan-card .plan-action button {
  width: 100%; padding: 10px; border-radius: 8px; border: none;
  background: #8b5cf6; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .2s;
}
.plan-card .plan-action button:hover { opacity: .9; }
.plan-card.current-plan { border-color: #d1d5db; opacity: .7; }
.plan-card.current-plan .plan-action button { background: #d1d5db; cursor: not-allowed; }
.pricing-foot { text-align: center; padding-top: 16px; font-size: 12px; }

/* ── Payment modal ── */
.pay-panel { max-width: 400px; }
.pay-body { padding: 8px 0; }
.pay-plan-name { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.pay-qr-container { margin: 12px 0; }
.pay-qr-img-wrap { width: 220px; height: 220px; margin: 0 auto; border: 1px solid #e5e7eb; border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; }
.pay-qr-img { width: 100%; height: 100%; object-fit: contain; }
.pay-qr-placeholder { padding: 24px; text-align: center; color: #999; font-size: 13px; }
.pay-qr-loading { padding: 40px; text-align: center; color: #999; }
.pay-instructions { margin: 12px 0; font-size: 13px; color: #666; }
.pay-amount { margin: 8px 0; font-size: 16px; }
.pay-amount strong { color: #e74c3c; font-size: 22px; }
.pay-months { margin: 12px 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; }
.pay-select { padding: 8px 12px; border-radius: 8px; border: 1px solid #d1d5db; font-size: 14px; }
.pay-tabs { display: flex; gap: 8px; margin: 12px 0; justify-content: center; }
.pay-tab { padding: 8px 20px; border: 2px solid #e5e7eb; border-radius: 8px; background: #fff; font-size: 14px; cursor: pointer; color: #666; transition: all .2s; }
.pay-tab:hover { border-color: #2563eb; color: #2563eb; }
.pay-tab.active { border-color: #2563eb; background: #eff6ff; color: #2563eb; font-weight: 600; }
.pay-confirm-btn { width: 100%; margin-top: 8px; padding: 12px; font-size: 16px; }

/* ── Modal (shared) ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
}
.modal-overlay.hidden { display: none; }
.modal-panel {
  background: #fff; border-radius: 16px; padding: 24px;
  min-width: 360px; max-width: 90vw; max-height: 85vh; overflow-y: auto;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head h2 { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #999; line-height: 1; }
.modal-close:hover { color: #333; }

.phone-edit-panel {
  width: min(520px, 94vw);
  padding: 0;
  border-radius: 14px;
}

.phone-edit-top {
  height: 58px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.phone-edit-top strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.phone-edit-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

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

.phone-image-editor {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fafafa;
}

.phone-image-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.phone-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}

.phone-image-tile {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.phone-image-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.phone-image-tile span {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .74);
  color: #fff;
  font-size: 11px;
}

.phone-image-tools {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.phone-image-tools button {
  min-width: 24px;
  height: 24px;
  border: 0;
  border-radius: 5px;
  padding: 0 6px;
  background: rgba(15, 23, 42, .78);
  color: #fff;
  font-size: 12px;
  line-height: 24px;
  cursor: pointer;
}

.phone-image-tools button:hover {
  background: #1677ff;
}

.phone-image-empty {
  min-height: 70px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #fff;
}

.phone-image-editor textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: #fff;
  resize: vertical;
}

.phone-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.phone-field input,
.phone-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.phone-field textarea {
  resize: vertical;
  min-height: 84px;
}

/* ── Admin dashboard stat cards ── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 20px;
  min-width: 120px;
  text-align: center;
  flex: 1;
}
.stat-card .stat-val {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}
.stat-card .stat-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Admin payment QR settings ── */
.payment-config-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .8fr);
  gap: 18px;
  align-items: start;
}

.payment-config-status {
  min-height: 20px;
  text-align: right;
}

.payment-qr-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.payment-qr-admin-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.payment-qr-admin-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.payment-qr-admin-head > div {
  display: grid;
  gap: 4px;
}

.payment-qr-admin-head strong {
  font-size: 14px;
  color: var(--text);
}

.payment-qr-admin-head span:not(.payment-channel-mark) {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.payment-channel-mark {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.payment-channel-mark.alipay {
  color: #1677ff;
  background: #eaf3ff;
}

.payment-channel-mark.wechat {
  color: #16893b;
  background: #eaf8ef;
}

.payment-admin-preview {
  width: min(100%, 230px);
  aspect-ratio: 1;
  margin: 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
}

.payment-admin-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.payment-admin-preview-empty {
  padding: 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.payment-qr-admin-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}

.payment-qr-admin-actions .muted {
  min-width: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.payment-config-copy {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.payment-config-copy label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.payment-config-copy input,
.payment-config-copy textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

.payment-config-copy textarea {
  min-height: 104px;
  resize: vertical;
}

.payment-config-copy .muted {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 1080px) {
  .payment-config-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .payment-qr-admin-grid {
    grid-template-columns: 1fr;
  }

  .payment-config-status {
    text-align: left;
  }
}

/* ── Compact buttons in tables ── */
.compact-btn {
  padding: 2px 10px;
  font-size: 12px;
}
