:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --text: #111827;
  --muted: #667085;
  --line: #d7dde7;
  --primary: #c81e1e;
  --primary-dark: #991b1b;
  --blue: #1d4ed8;
  --green: #047857;
  --amber: #b45309;
  --red: #b42318;
  --shadow: 0 18px 50px rgba(17, 24, 39, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  letter-spacing: 0;
}

body.modal-open,
body:has(.modal-backdrop) {
  overflow: hidden;
}

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

button {
  border: 0;
  cursor: pointer;
}

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

.link-value {
  min-height: auto;
  background: transparent !important;
  color: var(--blue);
  padding: 0;
  font-weight: 800;
  text-align: left;
}

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

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

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

h1 {
  font-size: 22px;
  line-height: 1.25;
}

h2 {
  font-size: 16px;
  line-height: 1.35;
}

h3 {
  font-size: 14px;
  line-height: 1.4;
}

small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.info-tip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
  cursor: help;
}

.info-tip [role="tooltip"] {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 20;
  width: max-content;
  max-width: 280px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  white-space: normal;
}

.info-tip.right-tip [role="tooltip"] {
  top: 50%;
  left: calc(100% + 8px);
  transform: translateY(-50%);
}

.info-tip:hover [role="tooltip"],
.info-tip:focus [role="tooltip"] {
  opacity: 1;
}

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

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

th {
  background: var(--surface-2);
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

td strong {
  font-weight: 700;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 12px;
  align-content: center;
  color: var(--muted);
}

.boot-screen.error {
  color: var(--red);
}

.boot-mark,
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.auth-body {
  background: #eef2f7;
}

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

.auth-panel {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.brand-row,
.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-row {
  margin-bottom: 22px;
}

.brand-row p,
.side-brand span,
.topbar p {
  color: var(--muted);
  font-size: 13px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  margin-bottom: 18px;
}

.segmented button {
  min-height: 36px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(17, 24, 39, 0.12);
}

.auth-form,
.inline-form,
.filters {
  display: grid;
  gap: 12px;
}

.auth-form label,
.inline-form label,
.filters label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  align-items: end;
  gap: 10px;
}

.primary,
.secondary,
.ghost,
.icon-btn {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

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

.primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.secondary:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
}

.ghost {
  background: transparent;
  color: var(--muted);
}

.ghost:hover:not(:disabled) {
  color: var(--red);
}

.full {
  width: 100%;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  background: #111827;
  color: #fff;
  padding: 20px 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.side-brand {
  padding: 0 6px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.side-brand > div:nth-child(2) {
  min-width: 0;
}

.side-brand strong,
.side-brand span {
  display: block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-brand span {
  margin-top: 3px;
  color: #aab3c2;
}

.side-logout {
  min-height: 28px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #eef2ff;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.side-logout:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.nav {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.sidebar-footer {
  margin-top: auto;
  padding: 18px 6px 0;
}

.nav-group {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 12px;
}

.nav-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.nav-group h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f9fafb;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.nav-group h2::before {
  content: "";
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16);
}

.nav-group > div {
  display: grid;
  gap: 4px;
}

.nav button {
  min-height: 34px;
  border-radius: 8px;
  background: transparent;
  color: #d1d5db;
  text-align: left;
  padding: 0 12px 0 18px;
  font-size: 13px;
  font-weight: 700;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

#workspaceTabsRoot {
  position: sticky;
  top: 0;
  z-index: 80;
  margin: -26px -26px 18px;
  padding: 16px 22px 14px;
  background: #111827;
  border-bottom: 0;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.16);
}

.workspace-tabs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

.workspace-tab-list {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0;
  scrollbar-width: thin;
}

.workspace-tab {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 104px;
  max-width: 174px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  overflow: hidden;
  cursor: grab;
  transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
}

.workspace-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.workspace-tab.active {
  position: relative;
  z-index: 1;
  background: transparent;
  color: #fff;
  box-shadow: none;
}

.workspace-tab.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 30px;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
}

.workspace-tab.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.workspace-tab.drag-over {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(200, 30, 30, 0.16), 0 8px 18px rgba(16, 24, 40, 0.1);
}

.workspace-tab-main {
  min-width: 0;
  flex: 1 1 auto;
  height: 100%;
  background: transparent;
  color: inherit;
  padding: 0 6px 0 10px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.workspace-tab-refresh,
.workspace-tab-close {
  position: relative;
  z-index: 1;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  padding: 0;
  display: grid;
  place-items: center;
}

.workspace-tab-refresh {
  font-size: 12px;
  font-weight: 900;
}

.workspace-tab-close {
  margin-right: 4px;
  font-size: 15px;
  font-weight: 900;
}

.workspace-tab-close:disabled,
.workspace-tabs-close-all:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.workspace-tab-refresh:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.workspace-tab-close:hover {
  background: rgba(220, 38, 38, 0.18);
  color: #fecaca;
}

.workspace-tabs-close-all {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.workspace-tabs-close-all:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.workspace {
  margin-left: 232px;
  padding: 26px;
}

.topbar {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar-compact {
  min-height: auto;
  display: flex;
  justify-content: flex-end;
  margin: 0 0 12px;
}

.topbar h1,
.topbar p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions,
.actions,
.panel-head,
.job-meta,
.pager {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page {
  display: grid;
  gap: 16px;
}

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

.metric {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.metric.clickable {
  cursor: pointer;
}

.metric.clickable:hover {
  border-color: var(--primary);
  background: #fffafa;
}

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

.metric strong {
  font-size: 26px;
  line-height: 1;
}

.order-metric-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  overflow-x: auto;
  gap: 8px;
  padding-bottom: 0;
}

.order-metric-grid .metric {
  min-width: 96px;
  width: fit-content;
  min-height: 56px;
  gap: 4px;
  padding: 10px 12px;
}

.order-metric-grid .orders-metric-profit {
  min-width: 122px;
}

.order-metric-grid .metric span,
.order-metric-grid .metric strong {
  white-space: nowrap;
}

.order-metric-grid .metric span {
  font-size: 12px;
}

.order-metric-grid .metric strong {
  font-size: 20px;
}

.order-metric-grid .metric-loading {
  border-style: dashed;
  background: #f9fafb;
}

.order-metric-grid .metric-loading strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.metric-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid #d0d5dd;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: metric-spin 0.8s linear infinite;
}

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

.store-grid,
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 14px;
}

.dashboard-time-tabs {
  align-items: end;
  margin: 0;
  padding: 0;
  border-bottom: 0;
}

.dashboard-panel-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-panel-title .dashboard-time-tabs {
  flex: 1 1 620px;
  border-bottom: 0;
  padding-bottom: 0;
}

.dashboard-panel-title .dashboard-date-range {
  margin-left: 0;
}

.compliance-notice {
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.cost-time-tabs {
  align-items: end;
  margin: 0;
  padding: 0;
  border-bottom: 0;
}

.dashboard-date-range {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-left: 0;
}

.dashboard-date-range label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-date-range label {
  width: 132px;
}

.dashboard-date-range input {
  width: 100%;
}

.dashboard-date-range button {
  flex: 0 0 auto;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
  display: none;
  opacity: 0;
}

input[type="date"],
input[type="month"] {
  appearance: none;
  -webkit-appearance: none;
}

.dashboard-chart-panel {
  display: grid;
  gap: 12px;
}

.dashboard-chart-title-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.month-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.month-filter input {
  width: 132px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  font: inherit;
}

.dashboard-chart-mall-tabs {
  margin-bottom: 0;
}

.dashboard-chart-metrics {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.dashboard-chart-metrics button {
  min-height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #344054;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.dashboard-chart-metrics button.active,
.dashboard-chart-metrics button:hover {
  border-color: var(--primary);
  background: #fff5f5;
  color: var(--primary);
}

.dashboard-chart-summary {
  width: fit-content;
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 12px;
}

.dashboard-chart-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-chart-summary strong {
  font-size: 18px;
  line-height: 1;
}

.dashboard-bar-chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(34px, 1fr);
  justify-content: stretch;
  gap: 10px;
  min-height: 420px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 84px 14px 12px;
}

.dashboard-bar-item {
  display: grid;
  grid-template-rows: minmax(300px, 1fr) auto;
  gap: 8px;
  align-items: end;
  min-width: 34px;
}

.dashboard-bar-value {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -6px);
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: nowrap;
  z-index: 1;
}

.dashboard-bar-track {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.dashboard-bar-track b {
  width: min(26px, 72%);
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
}

.dashboard-bar-item.negative .dashboard-bar-track b {
  background: linear-gradient(180deg, #f97316, #dc2626);
}

.dashboard-bar-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

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

.dashboard-store-rank-grid {
  padding-top: 0;
}

.dashboard-store-card {
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  overflow: visible;
}

.dashboard-store-card.total {
  border-color: rgba(29, 78, 216, 0.35);
  background: #f8fbff;
}

.dashboard-store-card > header {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.dashboard-store-card > header strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-store-card > header span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-store-summary-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 128px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.dashboard-store-summary-card.total {
  border-color: rgba(29, 78, 216, 0.22);
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}

.dashboard-store-summary-card > header {
  min-width: 0;
}

.dashboard-store-summary-card > header strong,
.dashboard-top-list b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-store-summary-card > header span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-store-summary-card dl {
  display: grid;
  grid-template-columns: max-content minmax(max-content, 1.55fr) minmax(max-content, 1.25fr) max-content;
  gap: 8px;
  margin: 0;
}

.dashboard-store-summary-card dl > div {
  min-width: 0;
  border-radius: 7px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  padding: 7px 8px;
}

.dashboard-store-summary-card dt {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-store-summary-card dd {
  margin: 3px 0 0;
  font-weight: 800;
  white-space: nowrap;
  font-size: 13px;
}

.dashboard-top-list {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 8px;
}

.dashboard-top-list h3 {
  color: #344054;
}

.dashboard-top-list ol {
  display: grid;
  gap: 6px;
  align-content: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dashboard-top-list li {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 6px 8px;
}

.dashboard-top-list li > strong {
  color: var(--primary);
  font-size: 12px;
  white-space: nowrap;
}

.rank-name {
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.rank-image,
.rank-name img,
.rank-thumb {
  position: relative;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
}

.rank-name img {
  object-fit: cover;
}

.rank-image .image-hover-preview {
  position: absolute;
  left: calc(100% + 10px);
  top: -72px;
  z-index: 150;
  width: 220px;
  height: 220px;
  display: none;
  place-items: center;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.22);
  padding: 8px;
  pointer-events: none;
}

.rank-image .image-hover-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.rank-image.has-preview:hover {
  overflow: visible;
  z-index: 160;
}

.rank-image.has-preview:hover .image-hover-preview {
  display: grid;
}

.rank-title {
  position: relative;
}

.rank-title-wrap {
  position: relative;
  display: block;
  min-width: 0;
}

.rank-title-wrap:hover {
  z-index: 145;
}

.rank-title-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 170;
  width: min(420px, 72vw);
  max-height: 150px;
  overflow: auto;
  white-space: normal;
  line-height: 1.45;
  color: #111827;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  display: none;
}

.rank-title-wrap:hover .rank-title-popover {
  display: block;
}

.store-tile,
.plan-card {
  min-height: 154px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.store-tile.total {
  border-color: rgba(29, 78, 216, 0.35);
  background: #f8fbff;
}

.store-tile strong,
.plan-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-tile span,
.plan-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-tile dl,
.plan-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 0;
}

.store-tile dd,
.plan-card dd {
  font-size: 16px;
}

.panel,
.toolbar-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.panel {
  overflow: hidden;
}

.panel:has(.info-tip) {
  overflow: visible;
}

.panel:has(.goods-card-list) {
  overflow: visible;
}

.toolbar-panel {
  padding: 14px;
}

.module-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
}

.module-tabs button {
  min-height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #344054;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}

.module-tabs button.active {
  border-color: var(--primary);
  background: #fff5f5;
  color: var(--primary);
}

.page-secondary-tabs {
  margin-bottom: 12px;
}

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

.admin-entry {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 18px;
  text-align: left;
}

.admin-entry:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(200, 30, 30, 0.08);
}

.admin-entry strong {
  font-size: 16px;
}

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

.platform-filter {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto;
  gap: 12px;
  align-items: end;
}

.panel-tools {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head {
  overflow: visible;
  min-height: 56px;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.toggle-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.toggle-check input {
  width: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

.inline-form {
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 240px) auto;
  align-items: end;
}

.plan-create-form {
  grid-template-columns: repeat(6, minmax(120px, 1fr)) auto;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.period-create-form {
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 180px) minmax(120px, 160px) auto;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.market-sku-form {
  grid-template-columns: minmax(170px, 1fr) minmax(160px, 1fr) minmax(150px, 220px) minmax(150px, 220px) minmax(110px, 150px) auto;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.compact-inputs {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 6px;
}

.compact-inputs input {
  min-width: 0;
}

.filters {
  grid-template-columns: 180px 140px minmax(220px, 1fr) auto auto;
  align-items: end;
}

.goods-filters {
  grid-template-columns: 118px 156px minmax(220px, 1fr) 132px auto auto;
}

.goods-filters label:first-child {
  width: 118px;
}

.goods-filters label:nth-child(2) {
  width: 156px;
}

.goods-filters .goods-sort-label {
  width: 132px;
}

.compact-date-label {
  width: 132px;
  max-width: 132px;
}

.compact-date-label input {
  width: 100%;
  min-width: 0;
}

.goods-filters .compact-date-label {
  width: 132px;
  max-width: 132px;
  justify-self: start;
}

.business-filters {
  grid-template-columns: minmax(180px, 220px) minmax(180px, 220px) minmax(260px, 1fr) auto auto auto;
}

.order-filters {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 230px) minmax(230px, 280px) auto auto;
}

.inline-field {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.inline-field input,
.inline-field select {
  min-width: 0;
  flex: 1;
}

.inline-field .small {
  min-height: 30px;
  padding: 0 9px;
  white-space: nowrap;
}

.shipping-filters {
  grid-template-columns: minmax(160px, 220px) minmax(130px, 160px) minmax(120px, 150px) 150px 150px minmax(220px, 1fr) auto auto;
}

.shipping-batch-filters {
  grid-template-columns: minmax(180px, 1.2fr) minmax(100px, 130px) minmax(100px, 130px) minmax(180px, 1.3fr) minmax(110px, 150px) minmax(120px, 150px) minmax(120px, 150px) minmax(190px, 1fr) auto auto auto auto auto;
}

.shipping-template-fetch {
  grid-template-columns: minmax(180px, 1fr) auto;
  margin-bottom: 10px;
}

.shipping-settings-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 420px);
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.shipping-table {
  min-width: 1180px;
}

.shipping-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.shipping-row-actions button {
  min-width: 54px;
}

.shipping-goods-list {
  display: grid;
  gap: 8px;
  min-width: 260px;
}

.shipping-goods-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.shipping-goods-thumb {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #f8fafc;
}

.shipping-goods-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shipping-goods-thumb span {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}

.shipping-goods-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.shipping-goods-text strong,
.shipping-goods-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.print-preview-list {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: #f2f4f7;
}

.print-page {
  min-height: 360px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.print-page img {
  max-width: 100%;
  display: block;
}

.inline-settings-form {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.shipping-settings-grid .inline-settings-form {
  padding: 0;
  border-bottom: 0;
}

.compact-table {
  margin-top: 10px;
}

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

.order-time-tabs {
  position: relative;
  z-index: 25;
  flex-wrap: wrap;
  align-items: end;
  overflow: visible;
}

.orders-controls {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.orders-controls .mall-tabs,
.orders-controls .profit-tabs,
.orders-controls .order-time-tabs,
.orders-controls > .mall-tabs[aria-label="订单状态筛选"] {
  margin-bottom: 0;
  padding-bottom: 6px;
}

.orders-controls .order-tabs > button {
  min-width: 82px;
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.orders-controls .toolbar-panel {
  padding: 0;
  border: 0;
  background: transparent;
}

.orders-controls .filters {
  gap: 8px;
}

.orders-controls + .order-metric-grid {
  margin-top: -4px;
}

.date-range-filter {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  margin-left: 0;
}

.date-range-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.date-range-inline input {
  width: 118px;
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.date-range-inline button {
  min-height: 30px;
}

.date-range-inline em,
.date-range-filter em {
  color: var(--muted);
  font-style: normal;
}

.orders-controls .date-range-filter {
  gap: 6px;
}

.orders-controls .date-picker-field {
  width: 112px;
}

.orders-controls .date-input-button {
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.orders-controls .order-time-input {
  width: 86px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #101828;
  padding: 0 7px;
  font-size: 12px;
  font-weight: 700;
}

.date-picker-field {
  position: relative;
  display: grid;
  gap: 0;
  width: 118px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.date-input-button {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #101828;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.date-input-button.active,
.date-input-button:hover {
  border-color: var(--primary);
}

.date-picker-popover {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 6px);
  right: 0;
  width: 284px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.date-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: transparent;
}

.date-picker-floating {
  position: fixed;
  z-index: 81;
}

.date-picker-floating .date-picker-popover {
  position: static;
  width: 320px;
  max-width: calc(100vw - 28px);
}

.orders-json-modal {
  grid-template-rows: auto minmax(0, 1fr);
}

.sku-price-modal {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.customer-detail-modal {
  grid-template-rows: auto auto minmax(0, 1fr);
  left: max(16px, calc((100vw - 980px) / 2));
  right: max(16px, calc((100vw - 980px) / 2));
}

.purchase-modal,
.page-modal,
.goods-action-modal {
  grid-template-rows: auto minmax(0, 1fr);
  left: max(16px, calc((100vw - 920px) / 2));
  right: max(16px, calc((100vw - 920px) / 2));
}

.purchase-actions,
.page-actions {
  margin-left: auto;
}

.purchase-modal-body,
.page-modal-body {
  padding: 16px;
}

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

.modal-form .wide,
.modal-form .form-actions,
.modal-subsection {
  grid-column: 1 / -1;
}

.modal-form .form-actions {
  display: flex;
  justify-content: flex-end;
}

.batch-tools {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.batch-editor {
  min-height: 280px;
  border: 0;
  border-radius: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.modal-subsection {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.sku-price-summary {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.modal-inline-panel {
  margin: 0;
  border-width: 0 0 1px;
  border-radius: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag-badge {
  gap: 6px;
}

.tag-badge button {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: rgba(71, 84, 103, 0.12);
  color: #475467;
  cursor: pointer;
}

.sku-average-button {
  display: inline;
  vertical-align: baseline;
}

.table-sort-button {
  min-height: auto;
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.table-sort-button span {
  margin-left: 3px;
  color: var(--primary);
}

.table-sort-button:hover,
.table-sort-button.active {
  color: var(--primary);
}

.orders-json-viewer {
  max-height: none;
  min-height: 100%;
}

.date-picker-head {
  display: grid;
  grid-template-columns: 32px 1fr 32px 32px;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.date-picker-head strong {
  color: #101828;
  font-size: 13px;
  text-align: center;
}

.date-picker-week,
.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.date-picker-week span {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.date-picker-grid button,
.date-picker-empty {
  width: 32px;
  height: 30px;
}

.date-picker-grid button {
  flex: initial;
  min-width: 0;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #101828;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
}

.date-picker-grid button:hover,
.date-picker-grid button.today {
  border-color: var(--line);
  background: #f9fafb;
}

.date-picker-grid button.selected {
  border-color: var(--primary);
  background: #fff5f5;
  color: var(--primary);
}

.mall-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.mall-tabs button {
  min-height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #344054;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.mall-tabs button span,
.mall-tabs button small {
  pointer-events: none;
}

.mall-tabs button small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.mall-tabs button.active small {
  color: #9f1239;
}

.mall-tabs button.active {
  border-color: var(--primary);
  background: #fff5f5;
  color: var(--primary);
}

.mall-tabs.dashboard-time-tabs,
.mall-tabs.cost-time-tabs,
.mall-tabs.order-time-tabs,
.mall-tabs.sales-stats-tabs {
  align-items: center;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.order-tabs > button {
  min-width: 108px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.report-stats-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.report-stats-table {
  min-width: 1380px;
}

.shipping-stats-table {
  min-width: 960px;
}

.courier-stats-table {
  min-width: 820px;
}

.report-detail-modal {
  inset: 5vh max(16px, calc((100vw - 1280px) / 2));
}

.report-detail-table {
  min-width: 1180px;
}

.report-detail-table td:nth-child(3) {
  max-width: 360px;
  white-space: normal;
}

.report-overview-toolbar {
  width: 100%;
  display: grid;
  gap: 8px;
  border: 1px solid #d7dca6;
  background: #fffec8;
  padding: 10px 12px;
}

.report-shortcuts,
.report-date-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.report-shortcuts button {
  border: 0;
  background: transparent;
  color: #344054;
  padding: 2px 0;
  font-size: 13px;
  cursor: pointer;
}

.report-shortcuts button:hover {
  color: var(--primary);
  text-decoration: underline;
}

.report-date-search {
  color: #344054;
  font-size: 13px;
}

.report-date-search label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.report-date-search input,
.report-date-search select {
  width: 132px;
  min-height: 30px;
  border: 1px solid #98a2b3;
  background: #fff;
  padding: 0 8px;
}

.report-overview-panel {
  overflow: hidden;
}

.report-overview-title {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
  color: #344054;
}

.report-overview-wrap {
  border: 0;
}

.report-overview-table {
  min-width: 1280px;
}

.report-overview-table th {
  background: #eef3f3;
  color: #344054;
  font-weight: 500;
}

.report-overview-table th,
.report-overview-table td {
  white-space: nowrap;
  border-right: 1px solid #d9dee3;
}

.report-overview-table .report-total-row td {
  background: #fff9e3;
  font-weight: 500;
}

.overview-orange {
  color: #ff6a00;
}

.overview-green {
  color: #008000;
}

.report-stats-table th,
.report-stats-table td {
  white-space: nowrap;
}

.report-stats-table .report-total-row td {
  position: sticky;
  bottom: 0;
  background: #f8fafc;
  border-top: 1px solid #d0d5dd;
  font-weight: 800;
}

.sales-stats-panel {
  overflow: hidden;
}

.sales-stats-wrap {
  border-top: 1px solid var(--line);
}

.sales-stats-table {
  min-width: 1280px;
}

.sales-stats-table th {
  background: #eef3f3;
  color: #344054;
  font-weight: 500;
}

.sales-stats-table th,
.sales-stats-table td {
  border-right: 1px solid #d9dee3;
  white-space: nowrap;
}

.sales-product-row td {
  background: #fff;
}

.sales-sku-row td {
  background: #fffbe8;
}

.sales-product-thumb {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}

.sales-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.center {
  text-align: center;
}

.table-wrap input,
.table-wrap select {
  min-width: 110px;
}

.right {
  text-align: right;
  justify-content: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.good {
  background: #ecfdf3;
  color: var(--green);
}

.badge.warn {
  background: #fffaeb;
  color: var(--amber);
}

.badge.bad {
  background: #fef3f2;
  color: var(--red);
}

.badge.neutral {
  background: #eef2f7;
  color: #475467;
}

.badge.order-status-1 {
  background: #fff7ed;
  color: #c2410c;
}

.badge.order-category-pending_ship {
  background: #fff1f2;
  color: var(--primary);
}

.badge.order-category-pending_ship_exception,
.badge.order-category-refunding {
  background: #fffaeb;
  color: var(--amber);
}

.badge.order-category-shipped {
  background: #eff6ff;
  color: #1d4ed8;
}

.badge.order-category-completed {
  background: #ecfdf3;
  color: var(--green);
}

.badge.order-category-pending_pay,
.badge.order-category-closed {
  background: #f2f4f7;
  color: #475467;
}

.badge.order-category-refunded {
  background: #fef3f2;
  color: var(--red);
}

.badge.order-category-refund_only_all,
.badge.order-category-refund_only_processing,
.badge.order-category-refund_only_success {
  background: #fff7ed;
  color: #c2410c;
}

.badge.order-status-2 {
  background: #eff6ff;
  color: #1d4ed8;
}

.badge.order-status-3 {
  background: #ecfdf3;
  color: var(--green);
}

.badge.order-status-4,
.badge.order-status-7,
.badge.order-status-unknown {
  background: #f2f4f7;
  color: #475467;
}

.badge.refund-status-1 {
  background: #f8fafc;
  color: #64748b;
}

.badge.refund-status-2,
.badge.refund-status-3 {
  background: #fffaeb;
  color: var(--amber);
}

.badge.refund-status-4 {
  background: #fef3f2;
  color: var(--red);
}

.empty {
  min-height: 96px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  padding: 18px;
}

.empty.compact {
  min-height: 40px;
  padding: 8px;
}

.loading::after {
  content: "";
  width: 18px;
  height: 18px;
  margin-top: 10px;
  border: 2px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.goods-cell {
  min-width: 260px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.goods-cell img {
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
}

.goods-cell strong {
  display: -webkit-box;
  max-width: 360px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.goods-card-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.goods-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: visible;
}

.goods-main {
  display: grid;
  grid-template-columns: 34px 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.goods-index {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.goods-thumb {
  position: relative;
  width: 56px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  overflow: hidden;
}

.goods-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.goods-thumb span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.goods-thumb .image-hover-preview {
  position: absolute;
  left: calc(100% + 10px);
  top: -34px;
  z-index: 120;
  width: 220px;
  height: 220px;
  display: none;
  place-items: center;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.22);
  padding: 8px;
  pointer-events: none;
}

.goods-thumb .image-hover-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.goods-thumb.has-preview:hover {
  overflow: visible;
  z-index: 130;
}

.goods-thumb.has-preview:hover .image-hover-preview {
  display: grid;
}

.goods-info {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.goods-title {
  position: relative;
  font-weight: 800;
  line-height: 1.25;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.goods-title:hover {
  z-index: 100;
}

.goods-title:hover::after {
  content: attr(data-full-title);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 140;
  width: min(520px, 72vw);
  max-height: 160px;
  overflow: auto;
  white-space: normal;
  line-height: 1.45;
  color: #111827;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.goods-meta,
.goods-price-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  color: var(--muted);
  font-size: 12px;
}

.goods-price-row strong {
  color: var(--text);
}

.goods-price-row .badge {
  width: fit-content;
}

.goods-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.goods-actions button,
.sku-bind-cell button {
  min-height: 26px;
  border: 0;
  background: transparent;
  padding: 0 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.goods-actions button:hover,
.sku-bind-cell button:hover {
  text-decoration: underline;
}

.sku-bind-cell button.primary {
  color: var(--primary);
}

.sku-panel {
  border-top: 1px solid var(--line);
  overflow-x: auto;
}

.sku-panel table {
  min-width: 1380px;
  table-layout: fixed;
}

.sku-panel th:nth-child(1),
.sku-panel td:nth-child(1) {
  width: 220px;
}

.sku-panel th:nth-child(2),
.sku-panel td:nth-child(2) {
  width: 130px;
}

.sku-panel th:nth-child(12),
.sku-panel td:nth-child(12) {
  width: 180px;
}

.sku-panel th:nth-child(14),
.sku-panel td:nth-child(14) {
  width: 170px;
}

.sku-panel th,
.sku-panel td {
  padding: 6px 8px;
  font-size: 12px;
}

.sku-panel tbody tr[data-goods-sku-row] td {
  transition: background-color 0.12s ease;
}

.sku-panel td small {
  display: block;
  margin-top: 1px;
  line-height: 1.2;
}

.sku-cost-binding-cell strong,
.sku-cost-binding-cell small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sku-cost-binding-cell strong {
  font-size: 12px;
  font-weight: 800;
}

.sku-panel .link-value {
  font-size: 12px;
}

.sku-panel tbody tr[data-goods-sku-row]:hover td {
  background: #fff7ed;
}

.sku-bind-cell {
  white-space: nowrap;
}

.sku-bind-cell button {
  min-height: 22px;
  min-width: auto;
  white-space: nowrap;
}

.sku-action-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
  white-space: nowrap;
}

.cost-binding-modal {
  max-width: 980px;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.cost-binding-title {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.cost-binding-title-thumb {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}

.cost-binding-title-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cost-binding-title-text {
  min-width: 0;
}

.cost-binding-title-text p {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 3px;
}

.cost-binding-title-text p span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.cost-binding-title-text p em {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(4, 120, 87, 0.1);
  color: var(--green);
  padding: 2px 8px;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.cost-binding-sku-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
  white-space: nowrap;
}

.cost-binding-sku-nav button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.cost-binding-sku-nav span {
  min-width: 44px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.cost-binding-suggestion {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) minmax(220px, 1.4fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.cost-binding-suggestion span,
.cost-binding-suggestion em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.cost-binding-suggestion strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.cost-binding-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.1fr);
  gap: 14px;
  overflow: hidden;
  overscroll-behavior: contain;
  padding: 16px;
  background: var(--surface-2);
}

.cost-binding-products,
.cost-binding-skus {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cost-binding-products label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.cost-binding-list,
.cost-binding-sku-list {
  display: grid;
  gap: 8px;
}

.cost-binding-list button,
.cost-binding-sku-list button {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.cost-binding-list button.cost-binding-product-option {
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
}

.cost-binding-product-option img,
.cost-binding-product-thumb {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
}

.cost-binding-product-option img {
  object-fit: cover;
}

.cost-binding-list button.active,
.cost-binding-list button:hover,
.cost-binding-sku-list button:hover {
  border-color: rgba(37, 99, 235, 0.45);
  background: #eff6ff;
}

.cost-binding-list button.recommended,
.cost-binding-sku-list button.recommended {
  border-color: rgba(200, 30, 30, 0.34);
  background: #fff7ed;
}

.cost-binding-sku-list button.recommended.active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.cost-binding-product-option em,
.cost-binding-sku-list em {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 18px;
  margin-right: 6px;
  border-radius: 999px;
  background: rgba(200, 30, 30, 0.1);
  color: var(--primary);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  vertical-align: 1px;
}

.cost-binding-list span,
.cost-binding-skus header span {
  color: var(--muted);
  font-size: 12px;
}

.cost-binding-product-option span {
  min-width: 0;
}

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

.cost-binding-product-option strong {
  color: var(--text);
}

.cost-binding-product-option small {
  color: var(--muted);
}

.cost-binding-sku-list button {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.cost-binding-sku-list b {
  color: var(--primary);
}

.danger-text {
  color: var(--red);
}

.profit-negative {
  color: var(--red);
}

.profit-warning {
  color: #a16207;
}

.profit-plain {
  color: #101828;
}

.profit-good {
  color: var(--green);
}

.profit-hot {
  display: inline-flex;
  margin-left: 2px;
  line-height: 1;
}

.order-item-metrics strong.profit-negative,
.order-estimate-line strong.profit-negative {
  color: var(--red) !important;
}

.order-item-metrics strong.profit-warning,
.order-estimate-line strong.profit-warning {
  color: #a16207 !important;
}

.order-item-metrics strong.profit-plain,
.order-estimate-line strong.profit-plain {
  color: #101828 !important;
}

.order-item-metrics strong.profit-good,
.order-estimate-line strong.profit-good {
  color: var(--green) !important;
}

.order-card-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.order-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: visible;
}

.order-card-tools,
.order-courier-override,
.order-card select[data-field="order-courier-override"] {
  display: none !important;
}

.order-item-row {
  display: grid;
  gap: 12px;
}

.order-card-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.order-card-head small,
.order-item-info small,
.order-line-main,
.order-line-detail,
.order-subline,
.order-sku-line,
.order-item-metrics > span,
.order-estimates span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.order-card-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.order-item-metrics strong {
  color: var(--text);
}

.order-item-list {
  display: grid;
}

.order-item-row {
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: start;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.order-item-row:first-child {
  border-top: 0;
}

.order-item-thumb {
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  overflow: hidden;
}

.order-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-item-thumb span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.order-item-info {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.order-item-info strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
}

.order-line-main,
.order-line-detail {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(480px, 1.1fr);
  align-items: center;
  column-gap: 24px;
  row-gap: 4px;
}

.order-subline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, auto)) minmax(92px, 1fr);
  align-items: center;
  gap: 6px 10px;
  text-align: left;
}

.order-subline .badge {
  font-size: 11px;
  padding: 2px 7px;
}

.order-status-group {
  display: inline-flex;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.order-subline > span:not(.order-status-group) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-sku-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-item-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 5px 8px;
  text-align: left;
}

.order-item-metrics > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.order-item-metrics > span:nth-last-child(-n + 2) {
  padding: 2px 6px;
  border-radius: 999px;
  background: #f8fafc;
}

.order-item-metrics .actual-shipping-pill {
  padding: 2px 6px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #067647;
}

.order-cost-hover {
  position: relative;
  cursor: default;
}

.order-cost-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 50;
  display: none;
  width: 260px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: #111827;
  color: #f9fafb;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.22);
  font-size: 12px;
  line-height: 1.55;
  white-space: normal;
}

.order-cost-popover::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: #111827;
  transform: rotate(45deg);
}

.order-cost-hover:hover .order-cost-popover,
.order-cost-hover:focus .order-cost-popover,
.order-cost-hover:focus-within .order-cost-popover {
  display: grid;
  gap: 2px;
}

.order-cost-popover b,
.order-cost-popover strong {
  display: block;
  overflow: visible;
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
}

.order-cost-popover em,
.order-cost-popover i {
  display: block;
  color: #d1d5db;
  font-style: normal;
}

.order-cost-popover strong {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.order-item-metrics small {
  max-width: 120px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-estimates {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 6px;
}

.order-estimate-line {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 6px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #f9fafb;
  white-space: nowrap;
}

.order-estimate-line b {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-estimate-line em {
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-style: normal;
  font-weight: 700;
  padding: 1px 6px;
}

.cost-product-form {
  display: grid;
  grid-template-columns: 160px minmax(180px, 1fr) 160px repeat(4, 120px) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.cost-product-form label,
.cost-template-form label,
.sync-run-form label,
.sync-settings-form label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

.cost-template-form,
.sync-settings-form,
.sync-run-form {
  display: grid;
  align-items: end;
  gap: 12px;
}

.cost-template-form {
  grid-template-columns: minmax(180px, 1fr) 120px 120px 120px 120px auto;
}

.cost-template-form.box {
  grid-template-columns: minmax(180px, 1fr) 120px 120px auto;
}

.sync-run-form {
  grid-template-columns: minmax(220px, 1fr) 180px auto;
}

.sync-settings-form {
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
}

.cost-product-grid {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.cost-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.cost-card-head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.cost-card-head img,
.image-placeholder.small {
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
}

.image-placeholder.small {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.cost-card-main {
  min-width: 0;
  display: flex;
  align-items: center;
}

.cost-title-row {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 9px;
}

.cost-title-row strong {
  min-width: 180px;
  max-width: min(520px, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  line-height: 1.35;
}

.cost-meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #e4e7ec;
  border-radius: 999px;
  background: #f8fafc;
  padding: 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.cost-meta-chip.carton {
  color: #344054;
  background: #fff;
}

.cost-stat-pill {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 5px;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 4px 9px;
  white-space: nowrap;
}

.cost-stat-pill b {
  font-size: 17px;
  line-height: 1;
}

.cost-stat-pill em {
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.cost-stat-pill.sales {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.cost-stat-pill.profit {
  border-color: #bbf7d0;
  background: #ecfdf3;
  color: var(--green);
}

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

.cost-sku-collapse {
  border-top: 1px solid var(--line);
}

.cost-sku-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.cost-sku-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  padding: 0 10px;
  color: #344054;
  font-weight: 700;
}

.cost-action-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cost-actions-panel {
  padding: 10px 12px;
}

.compact-select {
  width: auto;
  min-width: 150px;
}

.cost-panel-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cost-panel-title .cost-time-tabs {
  flex: 1 1 620px;
}

.cost-panel-title .dashboard-date-range {
  margin-left: 0;
}

.cost-panel-title .order-tabs > button {
  min-width: 76px;
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.cost-modal .modal-scroll {
  background: var(--surface-2);
}

.cost-modal-body {
  padding: 16px;
}

.cost-editor-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cost-editor-form.compact {
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto;
}

.cost-editor-form label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.cost-editor-form .wide {
  grid-column: span 2;
}

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

.cost-product-fields {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 220px) 160px 140px;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cost-product-fields label,
.cost-file-picker,
.cost-sku-editor-row label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.cost-image-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cost-image-upload {
  width: 180px;
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.cost-image-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.cost-image-preview {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  gap: 4px;
  overflow: hidden;
  border: 1px dashed #98a2b3;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  background: var(--surface-2);
}

.cost-image-preview strong {
  font-size: 32px;
  line-height: 1;
  font-weight: 400;
}

.cost-image-preview small {
  font-size: 12px;
}

.cost-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cost-image-status {
  color: var(--muted);
  font-size: 12px;
}

.cost-image-upload:hover .cost-image-preview {
  border-color: var(--blue);
}

.cost-image-upload.uploading .cost-image-preview {
  opacity: 0.68;
}

.cost-image-upload.uploaded .cost-image-preview {
  border-style: solid;
  border-color: rgba(4, 120, 87, 0.35);
}

.cost-image-upload.uploaded .cost-image-status {
  color: var(--green);
}

.cost-sku-editor {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cost-sku-editor > header {
  min-height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.cost-sku-editor h3 {
  font-size: 15px;
}

.cost-sku-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.cost-sku-editor-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.3fr) 84px 96px 94px minmax(128px, 1fr) minmax(190px, 1.2fr) minmax(260px, 1.5fr) 34px;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-2);
}

.muted-cell {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.cost-sku-result {
  min-height: 38px;
  display: grid;
  grid-template-columns: repeat(3, minmax(64px, 1fr));
  gap: 8px;
  margin: 0;
}

.cost-sku-result dt {
  color: var(--muted);
  font-size: 11px;
}

.cost-sku-result dd {
  margin: 3px 0 0;
  font-size: 13px;
  font-weight: 700;
}

.cost-sku-result div:last-child dd {
  color: var(--primary);
}

.cost-shipping-preview,
.cost-quote-list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  overflow-x: auto;
}

.cost-shipping-preview span,
.cost-quote-list span {
  min-height: 24px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.cost-shipping-preview b,
.cost-quote-list b {
  color: #344054;
}

.cost-shipping-preview strong,
.cost-quote-list strong {
  color: var(--primary);
}

.cost-quote-list em {
  color: var(--muted);
  font-style: normal;
}

.cost-box-inline {
  white-space: nowrap;
}

.cost-product-submit {
  display: flex;
  justify-content: flex-end;
}

.cost-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.template-card {
  min-height: 92px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.template-card strong,
.template-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

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

.shipping-template-card {
  min-height: auto;
}

.shipping-template-list {
  grid-template-columns: 1fr;
}

.cost-book-row {
  grid-template-columns: minmax(220px, 1fr) 140px auto auto;
}

.cost-book-row label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.shipping-rule-list {
  display: grid;
  gap: 8px;
}

.shipping-rule-row {
  display: grid;
  grid-template-columns: 90px 90px 150px 110px minmax(140px, 1fr) 38px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.shipping-rule-row label {
  display: grid;
  gap: 5px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.icon-btn.small {
  width: 34px;
  min-height: 34px;
  font-size: 18px;
}

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

.box-template-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.box-template-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.box-template-row label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.goods-table th,
.goods-table td {
  white-space: nowrap;
}

.goods-table .goods-cell {
  white-space: normal;
}

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

.pager {
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 14px 16px;
  color: #1f2937;
}

.pager-count,
.pager-btn,
.pager-change,
.pager-size input {
  min-height: 48px;
  border: 2px solid #e5e7eb;
  border-radius: 0;
  background: #fff;
  color: #1f2937;
  font-size: 18px;
  line-height: 1;
}

.pager-count {
  display: inline-flex;
  align-items: center;
  padding: 0 20px;
}

.pager-btn,
.pager-change {
  padding: 0 22px;
  cursor: pointer;
}

.pager-btn:disabled {
  cursor: not-allowed;
  color: #98a2b3;
  background: #f8fafc;
}

.pager-page {
  min-width: 58px;
  padding: 0 16px;
}

.pager-page.active {
  border-color: #5a78a6;
  background: #5a78a6;
  color: #fff;
}

.pager-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #1f2937;
  font-size: 18px;
  white-space: nowrap;
}

.pager-size input {
  width: 58px;
  padding: 0 8px;
  text-align: center;
  font-weight: 700;
}

.pager-change {
  border-color: #9ca3af;
  font-weight: 800;
}

.job-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.job-row:last-child {
  border-bottom: 0;
}

.job-row strong,
.job-row span {
  display: block;
}

.job-row span,
.error-text {
  color: var(--muted);
  font-size: 13px;
}

.job-row.single {
  border-bottom: 0;
}

.progress {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.progress i {
  display: block;
  height: 100%;
  background: var(--blue);
}

.error-text {
  grid-column: 1 / -1;
  color: var(--red);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(17, 24, 39, 0.45);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(17, 24, 39, 0.45);
}

.modal-panel {
  position: fixed;
  inset: 5vh max(16px, calc((100vw - 1480px) / 2));
  z-index: 41;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  overscroll-behavior: contain;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-head {
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2,
.modal-head p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.modal-scroll {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 31;
  width: min(940px, 100vw);
  background: #fff;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.drawer-head {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2,
.drawer-head p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.icon-btn {
  width: 38px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.detail-scroll {
  overflow: auto;
  padding: 18px;
  display: grid;
  gap: 16px;
}

.detail-hero {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.detail-hero > img,
.image-placeholder {
  width: 220px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  object-fit: cover;
}

.image-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.detail-hero dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.detail-hero dl div,
.detail-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-hero dl div {
  min-height: 72px;
  padding: 12px;
}

dt {
  color: var(--muted);
  font-size: 12px;
}

dd {
  margin: 6px 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.detail-section {
  padding: 14px;
}

.detail-section h3 {
  margin-bottom: 12px;
}

.image-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.image-strip a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 1;
}

.image-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.desc-text,
.json-viewer {
  max-height: 420px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  color: #e5edf8;
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.55;
}

.desc-text {
  background: var(--surface-2);
  color: var(--text);
}

details {
  display: grid;
  gap: 10px;
}

details + details {
  margin-top: 10px;
}

summary {
  cursor: pointer;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 22px;
  top: 74px;
  z-index: 260;
  width: auto;
  max-width: min(360px, calc(100vw - 32px));
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.96);
  color: #fff;
  padding: 10px 14px;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.24);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
}

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

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

  .order-metric-grid {
    display: flex;
  }

  .inline-form,
  .plan-create-form,
  .period-create-form,
  .market-sku-form,
  .platform-filter,
  .panel-tools,
  .filters,
  .cost-product-form,
  .cost-product-fields,
  .cost-template-form,
  .cost-editor-form,
  .sync-run-form,
  .sync-settings-form,
  .shipping-settings-grid {
    grid-template-columns: 1fr 1fr;
  }

  .order-line-main,
  .order-line-detail {
    grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.1fr);
    column-gap: 28px;
  }

  .order-subline,
  .order-item-metrics {
    justify-content: flex-start;
    text-align: left;
  }

  .search-label {
    grid-column: 1 / -1;
  }
}

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

  .sidebar {
    position: static;
    width: auto;
    padding: 14px;
  }

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

  .nav-group {
    border-top: 0;
    padding-top: 0;
  }

  .nav-group h2 {
    padding: 0 4px;
  }

  .nav button {
    text-align: center;
    padding: 0 6px;
  }

  .workspace {
    margin-left: 0;
    padding: 14px;
  }

  #workspaceTabsRoot {
    margin: -14px -14px 14px;
    padding: 10px 14px 0;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .workspace-tabs {
    grid-template-columns: 1fr auto;
  }

  .workspace-tabs-close-all {
    justify-self: end;
  }

  .cost-binding-sku-nav {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .metric-grid,
  .inline-form,
  .plan-create-form,
  .period-create-form,
  .filters,
  .cost-product-form,
  .cost-product-fields,
  .cost-image-panel,
  .cost-sku-editor-row,
  .cost-template-form,
  .cost-editor-form,
  .cost-editor-form.compact,
  .box-template-row,
  .sync-run-form,
  .sync-settings-form,
  .shipping-settings-grid,
  .goods-main,
  .detail-hero,
  .detail-hero dl {
    grid-template-columns: 1fr;
  }

  .date-range-filter {
    justify-content: flex-start;
    flex-basis: auto;
    min-width: 0;
  }

  .dashboard-date-range {
    justify-content: flex-start;
    flex-basis: auto;
    min-width: 0;
  }

  .dashboard-store-summary-grid,
  .dashboard-store-rank-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-store-summary-card dl {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.35fr);
  }

  .date-picker-popover {
    left: 0;
    right: auto;
    width: min(284px, calc(100vw - 28px));
  }

  .cost-editor-form .wide {
    grid-column: auto;
  }

  .cost-template-grid,
  .cost-book-row,
  .shipping-rule-row {
    grid-template-columns: 1fr;
  }

  .panel-head-actions,
  .cost-card-actions {
    justify-content: flex-start;
  }

  .cost-card-head {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .cost-card-actions {
    grid-column: 1 / -1;
  }

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

  .goods-actions,
  .sku-bind-cell {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .detail-hero > img,
  .image-placeholder {
    width: 100%;
  }

  .job-row {
    grid-template-columns: 1fr;
  }

  .job-meta {
    flex-wrap: wrap;
  }

  .drawer {
    width: 100vw;
  }

  .modal-panel {
    inset: 12px;
  }

  .toast {
    top: auto;
    right: 14px;
    bottom: 14px;
  }

  .order-item-row {
    grid-template-columns: 1fr;
  }

  .order-line-main,
  .order-line-detail {
    grid-template-columns: 1fr;
  }

  .order-subline,
  .order-item-metrics {
    justify-content: flex-start;
    text-align: left;
  }

  .order-item-thumb {
    width: 72px;
    height: 72px;
  }

  .order-item-metrics span {
    min-width: calc(50% - 8px);
    justify-content: space-between;
  }

  .order-metric-grid {
    display: flex;
  }

  .cost-binding-body {
    grid-template-columns: 1fr;
    align-content: start;
    overflow: auto;
  }

  .cost-binding-products,
  .cost-binding-skus {
    min-height: auto;
    overflow: visible;
  }

  .cost-binding-suggestion {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

@media (max-width: 520px) {
  .auth-layout {
    padding: 12px;
  }

  .auth-panel {
    padding: 18px;
  }

  .code-row {
    grid-template-columns: 1fr;
  }

  .platform-filter {
    grid-template-columns: 1fr;
  }

  .panel-tools {
    grid-template-columns: 1fr;
  }

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

  .actions {
    flex-wrap: wrap;
  }
}
