:root {
  color-scheme: light;
  --bg: #f4f8f7;
  --surface: #ffffff;
  --surface-2: #f7faf9;
  --text: #18302d;
  --muted: #687b77;
  --line: #dce8e5;
  --border: var(--line);
  --brand: #18a486;
  --brand-dark: #10836c;
  --brand-soft: #e8f7f3;
  --good: #168465;
  --warn: #a66c10;
  --danger: #cf4f55;
  --amber-bg: #fff8e8;
  --red-bg: #fff2f2;
  --green-bg: #eaf8f3;
  --shadow: 0 5px 16px rgba(40, 78, 70, 0.055);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial,
    sans-serif;
}

.task-id-result {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.task-id-result code {
  min-width: 96px;
  padding: 10px 14px;
  border: 1px solid #b8c7c1;
  border-radius: 6px;
  background: #f5f8f7;
  color: #174f40;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 1100px) {
  .catalog-filter-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
}

@media (max-width: 640px) {
  .catalog-filter-grid {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  background: var(--bg);
  color: var(--text);
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease,
    color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled,
button.is-disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

input {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(24, 164, 134, 0.18);
  outline-offset: 2px;
}

.login-body {
  min-width: 0;
  min-height: 100vh;
  background: var(--bg);
}

.login-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  background: var(--surface);
}

.login-product {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 20px;
  border-right: 1px solid var(--line);
  background: #fbfdfc;
  color: var(--text);
}

.login-brand {
  padding: 0 0 20px;
}

.login-brand .brand-mark {
  background: var(--brand);
}

.login-summary {
  max-width: 270px;
}

.login-summary > span {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
}

.login-summary h1 {
  margin: 10px 0 0;
  font-size: 25px;
  line-height: 1.35;
}

.login-summary p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.login-environment {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.login-environment i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.login-environment span,
.login-environment strong {
  font-size: 12px;
}
.login-environment span { color: var(--muted); }

.login-card {
  display: grid;
  place-items: center;
  padding: 48px;
  background: var(--surface);
}

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

.login-card-head {
  margin-bottom: 24px;
}

.login-card-head h2 {
  margin: 6px 0 0;
  font-size: 23px;
  line-height: 30px;
}

.login-card-head span {
  color: var(--muted);
  font-size: 12px;
}

.form-field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.form-field span {
  color: #526173;
  font-size: 13px;
  font-weight: 650;
}

.form-field input,
.form-field select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-color: #cfd8e5;
  background: #fbfcfe;
}

.form-field.compact {
  margin-bottom: 0;
}

.login-submit {
  width: 100%;
  height: 44px;
  margin-top: 6px;
  font-weight: 700;
}

.login-message {
  min-height: 20px;
  margin-top: 10px;
  color: var(--danger);
  font-size: 13px;
}

@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-product { min-height: 190px; padding: 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-summary h1 { font-size: 20px; }
  .login-summary p, .login-environment { display: none; }
  .login-card { place-items: start center; padding: 28px 18px; }
  .login-form-panel { padding: 22px; box-shadow: none; }
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(920px, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #fbfdfc;
  color: var(--text);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 5px 12px rgba(24, 164, 134, 0.2);
  font-size: 13px;
  font-weight: 800;
}

.brand strong {
  display: block;
  font-size: 15px;
  line-height: 20px;
}

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

.nav-group {
  display: grid;
  gap: 4px;
  padding: 16px 0;
}

.nav-section-label {
  margin: 16px 12px 6px;
  color: #8a9b97;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-section-label:first-child {
  margin-top: 4px;
}

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

.module-entry {
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
}

.module-entry span,
.module-entry p,
.detail-page-toolbar span {
  color: var(--muted);
}

.module-entry strong {
  display: block;
  margin-top: 10px;
  font-size: 32px;
}

.module-entry p {
  margin: 10px 0 20px;
  line-height: 1.6;
}

.detail-page-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.focused-management-panel {
  max-width: 920px;
}

.empty-workflow {
  min-height: 280px;
  padding: 44px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.empty-workflow strong {
  font-size: 20px;
}

.empty-workflow p {
  max-width: 720px;
  margin: 10px 0 22px;
  color: var(--muted);
  line-height: 1.7;
}

.nav-item {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 7px;
  color: #536a65;
  text-decoration: none;
  font-size: 14px;
}

.nav-item:hover,
.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.nav-item.active {
  box-shadow: inset 3px 0 0 var(--brand);
  font-weight: 650;
}

.nav-icon {
  color: #7b928d;
}

.nav-item b {
  min-width: 22px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  background: #e7efed;
  color: #647975;
  text-align: center;
  line-height: 18px;
  font-size: 11px;
}

.nav-subgroup {
  display: grid;
  gap: 3px;
  padding: 0 0 8px 36px;
}

.nav-subitem {
  display: block;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 6px;
  color: #748883;
  text-decoration: none;
  font-size: 13px;
  line-height: 16px;
}

.nav-subitem:hover,
.nav-subitem.selected {
  background: #edf7f4;
  color: var(--brand-dark);
}

.sidebar-panel {
  margin-top: auto;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #d8e9e5;
  background: #f0f8f6;
}

.panel-title {
  margin-bottom: 10px;
  font-size: 12px;
  color: #647a75;
}

.sync-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
  font-size: 12px;
  color: #536a65;
}

meter {
  width: 100%;
  height: 8px;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

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

.context {
  min-width: 0;
}

.topbar-title {
  font-size: 15px;
  line-height: 22px;
}

.user-chip {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 148px;
  padding: 3px 8px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.user-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

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

.user-chip strong {
  font-size: 13px;
}

.user-chip span {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.context label,
.inline-field {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

select {
  width: 132px;
  height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
}

.icon-button:hover {
  border-color: #a8d9ce;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.primary-button,
.ghost-button,
.link-button {
  height: 34px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 14px;
  white-space: nowrap;
}

.primary-button {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
  box-shadow: 0 3px 8px rgba(24, 164, 134, 0.18);
}

.primary-button:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  box-shadow: 0 5px 12px rgba(16, 131, 108, 0.22);
}

.ghost-button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.ghost-button:hover {
  border-color: #a8d9ce;
  background: #f2faf8;
  color: var(--brand-dark);
}

.ghost-button.selected {
  background: var(--brand-soft);
  border-color: #b8e2d9;
  color: var(--brand);
  font-weight: 650;
}

.link-button {
  height: 28px;
  padding: 0;
  background: transparent;
  color: var(--brand);
}

.link-button:hover {
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.workspace-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 24px 24px 14px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  font-weight: 760;
  letter-spacing: 0;
}

.workspace-header p,
.section-toolbar span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.session-banner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr minmax(260px, 1.4fr);
  gap: 10px;
  margin: 0 24px 16px;
  padding: 12px;
  border: 1px solid #cce5df;
  border-radius: 8px;
  background: #f1f9f7;
}

.session-banner div {
  min-width: 0;
  padding: 8px 10px;
  border-right: 1px solid #dcece8;
}

.session-banner div:last-child {
  border-right: 0;
}

.session-banner span,
.session-banner strong {
  display: block;
}

.session-banner span {
  color: #526173;
  font-size: 12px;
}

.session-banner strong {
  overflow: hidden;
  margin-top: 4px;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.is-disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.date-switcher,
.segmented {
  display: flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.date-switcher button,
.segmented button {
  height: 28px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  padding: 0 11px;
  color: var(--muted);
  white-space: nowrap;
}

.date-switcher .selected,
.segmented .selected {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 650;
}

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

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

.metric {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 15px;
  display: grid;
  align-content: space-between;
}

.metric::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: #6bc7b3;
  content: "";
}

.metric:nth-child(2)::before {
  background: #68a9dc;
}

.metric:nth-child(3)::before {
  background: #8bc879;
}

.metric:nth-child(4)::before {
  background: #e9b75f;
}

.metric:nth-child(5)::before {
  background: #9b94d3;
}

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

.metric strong {
  margin: 5px 0;
  font-size: 28px;
  line-height: 34px;
}

.metric.warning {
  background: var(--surface);
}

.metric.danger {
  background: var(--surface);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 16px;
  padding: 0 24px 16px;
}

.work-panel {
  min-width: 0;
}

.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.section-toolbar.compact {
  padding-bottom: 12px;
}

.status-banner {
  margin: 0 24px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: #526173;
  font-size: 13px;
  font-weight: 650;
}

.status-banner.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: var(--good);
}

.status-banner.danger {
  border-color: #fecdd3;
  background: #fff1f2;
  color: var(--danger);
}

.source-management-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.source-management-entry a {
  color: var(--brand);
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.shopify-connect-panel {
  margin-bottom: 16px;
}

.shopify-oauth-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(180px, 1fr) minmax(260px, 1.4fr) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
}

.shopify-store-form {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.shopify-store-form .wide {
  grid-column: span 2;
}

.shopify-form-actions {
  display: grid;
  gap: 8px;
}

.shopify-form-actions span,
.muted-cell,
.empty-cell {
  color: var(--muted);
  font-size: 13px;
}

.empty-cell {
  text-align: center;
  padding: 20px 12px;
}

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

.danger-link {
  color: var(--danger);
}

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

.queue-list {
  display: grid;
  gap: 10px;
  padding: 14px 16px 16px;
}

.queue-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 10px 10px 10px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.queue-status {
  width: 4px;
  height: 42px;
  border-radius: 0 4px 4px 0;
  background: var(--brand);
}

.queue-item.urgent .queue-status {
  background: var(--danger);
}

.queue-item.warn .queue-status {
  background: var(--warn);
}

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

.queue-item strong {
  font-size: 14px;
  line-height: 20px;
}

.queue-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.queue-item button {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
}

.platform-list {
  display: grid;
  gap: 4px;
  padding: 10px 12px 13px;
}

.platform-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 8px;
  border-radius: 7px;
}

.platform-row:hover {
  background: var(--surface-2);
}

.platform-logo {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.amazon {
  background: #27364a;
}

.ebay {
  background: #276fc2;
}

.temu {
  background: #ef5b2a;
}

.walmart {
  background: #1476d4;
}

.giga {
  background: #184f91;
}

.shein {
  background: #1d1d1d;
}

.shopify {
  background: #12805c;
}

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

.platform-row strong {
  font-size: 14px;
}

.platform-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.platform-row em {
  font-style: normal;
  font-weight: 700;
  text-align: right;
}

.ok {
  color: var(--good);
}

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

.bad {
  color: var(--danger);
}

.table-panel {
  margin: 0 24px 24px;
}

.source-hub {
  margin: 0 24px 16px;
}

.shein-platform-panel {
  margin: 0 24px 16px;
}

.shein-overview-grid,
.shein-management-grid,
.shein-api-grid {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
}

.shein-overview-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-bottom: 0;
}

.shein-overview-grid article,
.shein-config-card,
.shein-api-grid article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.shein-overview-grid article {
  min-height: 106px;
  padding: 13px;
}

.shein-overview-grid span,
.shein-overview-grid strong,
.shein-overview-grid em,
.shein-api-grid strong,
.shein-api-grid span,
.shein-api-grid em {
  display: block;
}

.shein-overview-grid span {
  color: var(--muted);
  font-size: 12px;
}

.shein-overview-grid strong {
  overflow: hidden;
  margin-top: 8px;
  font-size: 15px;
  line-height: 21px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shein-overview-grid em,
.shein-api-grid em {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 18px;
}

.shein-management-grid {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
  padding-bottom: 0;
}

.inline-toolbar {
  border-bottom-color: var(--line);
}

.shein-step-list {
  display: grid;
  gap: 8px;
  padding: 14px 16px 16px;
}

.shein-step-list div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 42px;
}

.shein-step-list b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #141a22;
  color: #ffffff;
  font-size: 12px;
}

.shein-step-list span {
  color: #354254;
  font-size: 13px;
  line-height: 19px;
}

.compact-list {
  padding-top: 12px;
}

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

.shein-api-grid article {
  min-height: 118px;
  padding: 13px;
}

.shein-api-grid strong {
  font-size: 14px;
  line-height: 20px;
}

.shein-api-grid span {
  overflow: hidden;
  margin-top: 8px;
  color: var(--brand);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

.store-flow article {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #c8d9f2;
  border-radius: 8px;
  background: #f4f8ff;
}

.store-flow span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--brand);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.store-flow strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-platform-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 16px 16px;
}

.source-card,
.store-platform-card {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.source-card.active,
.store-platform-card.active {
  border-color: #b9d2f5;
  background: #f4f8ff;
}

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

.source-card-head strong,
.source-card-head span,
.source-card p,
.store-platform-card p,
.source-kpi-grid span,
.source-kpi-grid strong,
.source-rule-list strong,
.source-rule-list span,
.source-title-cell strong,
.source-title-cell span {
  display: block;
}

.source-card-head strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-card-head span,
.source-card p,
.store-platform-card p,
.source-rule-list span,
.source-title-cell span {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.source-logo,
.source-avatar {
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 800;
}

.source-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 14px;
}

.source-logo.collect,
.source-avatar.collect {
  background: #8a5b12;
}

.source-logo.upload,
.source-avatar.upload {
  background: #526173;
}

.source-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.source-kpi-grid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.source-kpi-grid span {
  color: var(--muted);
  font-size: 12px;
}

.source-kpi-grid strong {
  margin-top: 4px;
  font-size: 18px;
  line-height: 22px;
}

.source-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-rule-list {
  display: grid;
  gap: 8px;
  padding: 14px 16px 16px;
}

.source-rule-list article {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.source-rule-list strong {
  font-size: 13px;
  line-height: 18px;
}

.source-filter-bar {
  display: grid;
  grid-template-columns: 190px 190px minmax(260px, 1fr);
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.source-filter-bar.compact-filter-bar {
  grid-template-columns: minmax(260px, 420px);
}

.source-filter-bar .inline-field {
  min-width: 0;
}

.source-filter-bar select,
.source-filter-bar input {
  width: 100%;
  min-width: 0;
}

.source-search-field input {
  padding: 0 10px;
}

.source-title-cell {
  display: grid;
  grid-template-columns: 32px minmax(180px, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 260px;
}

.source-title-cell strong {
  overflow: hidden;
  max-width: 360px;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-avatar {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: #184f91;
  font-size: 12px;
}

tr.is-hidden {
  display: none;
}

.foundation-grid {
  align-items: stretch;
}

.permission-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px 16px;
}

.permission-map article {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.permission-map strong,
.permission-map span,
.account-row strong,
.account-row span {
  display: block;
}

.permission-map strong {
  font-size: 14px;
}

.permission-map span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

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

.account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.account-row strong {
  font-size: 14px;
}

.account-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.account-row em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

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

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  height: 46px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

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

tbody tr:hover {
  background: #f9fbff;
}

.progress {
  display: inline-block;
  width: 66px;
  height: 7px;
  margin-right: 8px;
  overflow: hidden;
  border-radius: 10px;
  background: #e4e9f1;
  vertical-align: middle;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.progress.complete i {
  background: var(--good);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 650;
}

.tag.warning {
  background: var(--amber-bg);
  color: var(--warn);
}

.tag.danger {
  background: var(--red-bg);
  color: var(--danger);
}

.tag.ok {
  background: var(--green-bg);
  color: var(--good);
}

.tag.neutral {
  background: #eef2f7;
  color: #526173;
}

.is-hidden {
  display: none !important;
}

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

.table-management-grid {
  align-items: start;
}

.management-panel,
.table-management-grid .table-panel,
.giga-account-management .table-panel {
  margin: 0;
}

.giga-account-management {
  grid-template-columns: minmax(360px, 0.78fr) minmax(0, 1.22fr);
}

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

.ops-form .wide-field {
  grid-column: span 2;
}

.checkbox-dropdown-field {
  min-width: 0;
}

.checkbox-dropdown {
  position: relative;
}

.checkbox-dropdown summary {
  display: flex;
  min-height: 42px;
  align-items: center;
  padding: 9px 36px 9px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  list-style: none;
}

.checkbox-dropdown summary::-webkit-details-marker {
  display: none;
}

.checkbox-dropdown summary::after {
  position: absolute;
  right: 13px;
  content: "⌄";
  color: var(--muted);
}

.checkbox-dropdown summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkbox-dropdown-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 5px);
  left: 0;
  display: grid;
  width: 100%;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 14px 32px rgba(17, 24, 39, 0.16);
}

.checkbox-dropdown-menu label {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.checkbox-dropdown-menu label:hover {
  background: var(--surface-2);
}

.checkbox-dropdown-menu input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.sync-progress-cell {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 190px;
}

.sync-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface-2);
}

.sync-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 180ms ease;
}

.sync-progress-track.is-indeterminate i {
  width: 38%;
  animation: sync-progress-flow 1.2s ease-in-out infinite;
}

@keyframes sync-progress-flow {
  from { transform: translateX(-110%); }
  to { transform: translateX(270%); }
}

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

.sync-settings-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.75fr);
  gap: 14px;
  align-items: stretch;
}

.sync-settings-workspace > .work-panel {
  margin: 0;
}

.sync-detail-panel {
  min-width: 0;
  max-height: none;
  align-self: start;
}

.sync-detail-scroll {
  display: grid;
  gap: 18px;
  max-height: none;
  overflow: visible;
  padding: 16px;
}

.sync-live-banner {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.sync-live-banner > i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}

.sync-live-banner.is-live > i {
  background: var(--brand);
  box-shadow: 0 0 0 5px rgba(116, 78, 245, 0.12);
  animation: sync-live-pulse 1.5s ease-in-out infinite;
}

@keyframes sync-live-pulse {
  50% { box-shadow: 0 0 0 9px rgba(116, 78, 245, 0.04); }
}

.sync-live-banner strong,
.sync-live-banner span { display: block; }
.sync-live-banner span { margin-top: 3px; color: var(--muted); font-size: 12px; }

.sync-failure-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  padding: 13px;
  border: 1px solid #efb8bd;
  border-left: 3px solid var(--danger);
  border-radius: 6px;
  background: var(--red-bg);
}

.sync-failure-card span,
.sync-failure-card strong { display: block; }
.sync-failure-card span { color: var(--muted); font-size: 11px; }
.sync-failure-card strong { margin-top: 3px; }
.sync-failure-card p,
.sync-failure-card small,
.sync-failure-card button { grid-column: 1 / -1; }
.sync-failure-card p { margin: 2px 0 0; color: var(--danger); line-height: 1.5; overflow-wrap: anywhere; }
.sync-failure-card small { color: var(--text); line-height: 1.5; }
.sync-failure-card button { justify-self: start; }

.sync-flow-line {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.sync-flow-line span {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.sync-flow-line span.active { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.sync-flow-line b { font-weight: 400; }

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

.sync-stream-metrics > div { padding: 9px; border-left: 2px solid var(--brand); background: var(--surface-2); }
.sync-stream-metrics span, .sync-stream-metrics strong { display: block; }
.sync-stream-metrics span { color: var(--muted); font-size: 11px; }
.sync-stream-metrics strong { margin-top: 3px; font-variant-numeric: tabular-nums; }

.sync-stage-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sync-stage-list li {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  min-height: 58px;
  color: var(--muted);
}

.sync-stage-list li:not(:last-child)::after {
  position: absolute;
  top: 17px;
  bottom: -4px;
  left: 6px;
  width: 2px;
  background: var(--line);
  content: "";
}

.sync-stage-list li > i {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}

.sync-stage-list li.completed > i,
.sync-stage-list li.active > i {
  border-color: var(--brand);
  background: var(--brand);
}

.sync-stage-list li.failed > i {
  border-color: var(--danger);
  background: var(--danger);
}

.sync-stage-list li.completed:not(:last-child)::after {
  background: var(--brand);
}

.sync-stage-list strong,
.sync-stage-list span {
  display: block;
}

.sync-stage-list li.active strong,
.sync-stage-list li.completed strong {
  color: var(--text);
}

.sync-stage-list span {
  margin-top: 4px;
  font-size: 12px;
}

.sync-detail-counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sync-detail-counts > div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.sync-detail-counts span,
.sync-condition-list span {
  color: var(--muted);
  font-size: 12px;
}

.sync-detail-counts strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.sync-condition-list {
  display: grid;
  gap: 8px;
}

.sync-condition-list h3 {
  margin: 0 0 3px;
  font-size: 14px;
}

.sync-condition-list > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.sync-condition-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-detail-message {
  padding: 11px;
  border-radius: 6px;
  background: var(--surface-2);
}

.sync-detail-message.danger {
  color: var(--danger);
  background: var(--red-bg);
}

.sync-detail-message p {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.sync-detail-time {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.sync-run-link {
  display: grid;
  max-width: 320px;
  padding: 0;
  text-align: left;
}

.sync-run-link small {
  margin-top: 3px;
  color: var(--muted);
}

@media (max-width: 1280px) {
  .sync-settings-workspace {
    grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.8fr);
  }
}

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

.form-actions {
  align-self: end;
}

.bulk-actions {
  justify-content: flex-end;
}

.bulk-actions select,
.bulk-actions input {
  width: auto;
  min-width: 128px;
}

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

.crawler-form .wide-field {
  grid-column: span 2;
}

.crawler-table td strong,
.crawler-table td small {
  display: block;
}

.crawler-table td small {
  margin-top: 4px;
  color: var(--muted);
}

.crawler-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 14px;
}

.crawler-pagination select {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.sync-run-actions {
  max-width: 760px;
}

.sync-run-actions input[type="datetime-local"] {
  min-width: 184px;
}

.sync-run-actions input[type="number"] {
  width: 92px;
  min-width: 92px;
  padding: 0 8px;
}

.row-actions {
  min-width: 92px;
}

.select-cell {
  width: 44px;
  text-align: center;
}

.select-cell input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}

.ops-table.catalog-table {
  width: 100%;
  min-width: 1540px;
  table-layout: fixed;
}

.catalog-table .col-select { width: 44px; }
.catalog-table .col-image { width: 66px; }
.catalog-table .col-source { width: 100px; }
.catalog-table .col-account { width: 120px; }
.catalog-table .col-sku { width: 160px; }
.catalog-table .col-title { width: 360px; }
.catalog-table .col-amount { width: 100px; }
.catalog-table .col-currency { width: 72px; }
.catalog-table .col-usd { width: 110px; }
.catalog-table .col-stock { width: 76px; }
.catalog-table .col-completeness { width: 112px; }
.catalog-table .col-status { width: 92px; }
.catalog-table .col-time { width: 142px; }
.catalog-table .col-action { width: 70px; }

.catalog-title-cell {
  min-width: 0;
  max-width: 0;
}

.catalog-table th,
.catalog-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-title-cell .table-link,
.catalog-sku-cell .table-link {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.table-link,
.missing-field-button,
.table-sort-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.table-link:hover { color: var(--brand); }
.numeric-cell { text-align: right; font-variant-numeric: tabular-nums; }
.table-sort-button { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.table-sort-button span { color: #9aa0ad; }
.table-sort-button.active, .table-sort-button.active span { color: var(--brand); }
.missing-field-button { color: #c73847; text-decoration: underline; text-decoration-style: dotted; }
.complete-label { color: #16835d; }

.product-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 8px 2px 22px;
}
.product-detail-header h2 { margin: 5px 0; max-width: 980px; font-size: 24px; }
.product-detail-header p, .product-detail-header span { color: var(--muted); }
.product-detail-summary {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 28px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.product-detail-main-image .product-image-button,
.product-detail-main-image .product-image-placeholder { width: 150px; height: 150px; }
.product-detail-main-image .product-image-button img { width: 150px; height: 150px; }
.product-detail-summary dl, .detail-definition-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 18px 28px;
  margin: 0;
}
.product-detail-summary dl div, .detail-definition-grid div { min-width: 0; }
.product-detail-summary dt, .detail-definition-grid dt { color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.product-detail-summary dd, .detail-definition-grid dd { margin: 0; overflow-wrap: anywhere; }
.detail-band { padding: 24px 0; border-bottom: 1px solid var(--line); }
.detail-band h3 { margin: 0 0 16px; font-size: 16px; }
.missing-detail { border-left: 3px solid #df4c5b; padding-left: 16px; }
.missing-detail ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 10px 0 0; margin: 0; }
.missing-detail li { display: flex; gap: 6px; padding: 6px 9px; background: #fff2f3; border-radius: 4px; }
.missing-detail code { color: #8a6267; }
.complete-detail { color: #16835d; }
.compliance-evidence {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid #16835d;
  border-radius: 6px;
  background: var(--surface-2);
}
.compliance-evidence.is-blocked { border-color: #efb8bd; border-left-color: var(--danger); background: var(--red-bg); }
.compliance-evidence span, .compliance-evidence strong { display: block; }
.compliance-evidence span { color: var(--muted); font-size: 11px; }
.compliance-evidence strong { margin-top: 4px; overflow-wrap: anywhere; }
.compliance-evidence.is-blocked strong { color: var(--danger); }
.compliance-evidence p { grid-column: 1 / -1; margin: 0; line-height: 1.55; }
.product-description-detail { max-width: 1000px; white-space: pre-wrap; line-height: 1.7; }
.product-media-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.product-media-grid .product-image-button,
.product-media-grid .product-image-placeholder { width: 88px; height: 88px; }
.product-media-grid .product-image-button img { width: 88px; height: 88px; }
.raw-payload { margin-top: 12px; border: 1px solid var(--line); border-radius: 4px; }
.raw-payload summary { padding: 12px 14px; cursor: pointer; font-weight: 600; }
.raw-payload pre { max-height: 360px; overflow: auto; margin: 0; padding: 14px; background: #f7f8fa; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .product-detail-header { flex-direction: column; }
  .product-detail-summary { grid-template-columns: 1fr; }
  .product-detail-summary dl, .detail-definition-grid { grid-template-columns: 1fr; }
  .compliance-evidence { grid-template-columns: 1fr; }
}

@media (max-width: 1180px) {
  .sync-settings-workspace { grid-template-columns: 1fr; }
  .sync-detail-panel { width: 100%; }
}

.catalog-table tbody tr.is-selected {
  background: #f5f2ff;
}

.compact-action {
  height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

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

.store-choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.store-choice-list label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.store-choice-list input,
.listing-create-panel input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.listing-workspace {
  display: grid;
  grid-template-columns: minmax(520px, 1.15fr) minmax(420px, 0.85fr);
  gap: 16px;
  align-items: stretch;
}

.listing-log-panel {
  min-width: 0;
  height: 510px;
  display: flex;
  flex-direction: column;
}

.listing-log-scroll {
  min-height: 0;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.listing-condition-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.listing-condition-strip span {
  font-size: 12px;
  color: var(--muted);
}

.listing-condition-strip span:not(:last-child)::after {
  content: " /";
  color: var(--line-strong);
}

.listing-log-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.listing-log-heading,
.listing-log-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.listing-log-heading {
  justify-content: space-between;
}

.listing-log-heading strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listing-log-meta {
  flex-wrap: wrap;
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
}

.listing-log-item code {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.listing-log-item p,
.listing-log-item time {
  display: block;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.listing-log-error {
  color: var(--danger) !important;
}

.listing-log-running {
  min-height: 180px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
}

.online-products-table {
  min-width: 980px;
  table-layout: fixed;
}

.online-products-table th,
.online-products-table td {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-products-table td[title],
.online-handle-cell {
  cursor: help;
}

.online-products-table th:nth-child(1) { width: 140px; }
.online-products-table th:nth-child(2) { width: auto; }
.online-products-table th:nth-child(3) { width: 160px; }
.online-products-table th:nth-child(4),
.online-products-table th:nth-child(5) { width: 72px; }
.online-products-table th:nth-child(6),
.online-products-table th:nth-child(7) { width: 104px; }
.online-products-table th:nth-child(8) { width: 140px; }

.mapping-table {
  min-width: 1180px;
  table-layout: fixed;
}

.mapping-table th,
.mapping-table td {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mapping-table th:nth-child(1) { width: 48px; }
.mapping-table th:nth-child(2) { width: 130px; }
.mapping-table th:nth-child(3) { width: auto; }
.mapping-table th:nth-child(4) { width: 120px; }
.mapping-table th:nth-child(5) { width: 160px; }
.mapping-table th:nth-child(6) { width: 210px; }
.mapping-table th:nth-child(7),
.mapping-table th:nth-child(8) { width: 96px; }
.mapping-table th:nth-child(9) { width: 140px; }

.mapping-table td[title] {
  cursor: help;
}

.catalog-filter-panel {
  padding: 14px 16px;
}

.catalog-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
}

.catalog-filter-grid label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.catalog-filter-grid input,
.catalog-filter-grid select {
  width: 100%;
}

.catalog-filter-grid .form-actions {
  align-self: end;
}

.shopify-console-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.shopify-console-tabs button {
  padding: 10px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.shopify-console-tabs button.selected {
  border-bottom-color: var(--brand);
  color: var(--brand);
  font-weight: 700;
}

.shopify-console-editor {
  margin-bottom: 14px;
}

.shopify-console-table {
  min-width: 1080px;
  table-layout: fixed;
}

.shopify-console-table th,
.shopify-console-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-table,
.sync-log-table {
  min-width: 1080px;
}

.source-products-table {
  min-width: 1420px;
}

.export-history-table {
  min-width: 1160px;
}

.product-cell {
  display: grid;
  grid-template-columns: 42px minmax(180px, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 260px;
}

.product-image-button,
.product-image-placeholder {
  display: grid;
  width: 50px;
  min-width: 50px;
  height: 50px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
}

.product-image-button {
  padding: 0;
  cursor: zoom-in;
}

.product-image-button img {
  width: 50px;
  height: 50px;
  object-fit: cover;
}

.product-image-button.image-load-error img {
  display: none;
}

.product-image-button.image-load-error::after {
  content: "无图";
  color: var(--muted);
  font-size: 11px;
}

.product-cell strong {
  display: block;
  overflow: hidden;
  max-width: 360px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.image-preview-open {
  overflow: hidden;
}

.product-image-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.72);
}

.product-image-preview {
  display: grid;
  width: min(920px, 92vw);
  max-height: 92vh;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.product-image-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.product-image-preview-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image-preview-head button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 26px;
  cursor: pointer;
}

.product-image-preview-body {
  display: grid;
  min-height: 240px;
  max-height: calc(92vh - 62px);
  place-items: center;
  overflow: auto;
  padding: 16px;
  background: var(--surface-2);
}

.product-image-preview-body img {
  max-width: 100%;
  max-height: calc(92vh - 94px);
  object-fit: contain;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 26, 34, 0.42);
}

.modal {
  width: min(620px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(12, 22, 36, 0.28);
}

.large-modal {
  width: min(980px, 100%);
}

.shopify-publish-body {
  max-height: min(72vh, 720px);
  overflow: auto;
}

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

.shopify-publish-body textarea {
  min-height: 76px;
  resize: vertical;
}

.shopify-publish-body .wide {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  color: var(--text);
  font-size: 13px;
}

.option-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

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

.modal-actions {
  justify-content: flex-end;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

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

.selected-product-list article {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.selected-product-list strong,
.selected-product-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.export-warning {
  padding: 10px 12px;
  border: 1px solid #f5c2c7;
  border-radius: 7px;
  background: var(--red-bg);
  color: var(--danger);
  font-size: 13px;
  font-weight: 650;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  max-width: 420px;
  padding: 11px 13px;
  border: 1px solid #bbf7d0;
  border-radius: 7px;
  background: #f0fdf4;
  color: var(--good);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 700;
}

.toast.danger {
  border-color: #fecdd3;
  background: #fff1f2;
  color: var(--danger);
}

@media (max-width: 900px) {
  .module-entry-grid {
    grid-template-columns: 1fr;
  }
  body {
    min-width: 0;
  }

  .login-body {
    padding: 14px;
  }

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

  .login-product,
  .login-card {
    padding: 22px;
  }

  .login-summary h1 {
    font-size: 26px;
    line-height: 34px;
  }

  .login-scope-grid {
    grid-template-columns: 1fr;
    margin-top: 28px;
  }

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .topbar,
  .workspace-header,
  .section-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .context,
  .top-actions,
  .filter-actions {
    flex-wrap: wrap;
  }

  .metric-grid,
  .content-grid,
  .session-banner,
  .source-method-grid,
  .store-flow,
  .store-platform-grid,
  .shein-overview-grid,
  .shein-management-grid,
  .shein-api-grid,
  .management-grid,
  .ops-form,
  .source-filter-bar,
  .shopify-oauth-form,
  .shopify-publish-grid {
    grid-template-columns: 1fr;
  }

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

  .shopify-store-form .wide {
    grid-column: auto;
  }

  .ops-form .wide-field {
    grid-column: auto;
  }

  .session-banner div {
    border-right: 0;
    border-bottom: 1px solid #d8e6fa;
  }

  .session-banner div:last-child {
    border-bottom: 0;
  }
}

/* CrossERP console visual system: light canvas, compact navigation, restrained violet accent. */
:root {
  --bg: #dfe5fb;
  --surface: #ffffff;
  --surface-2: #fafafe;
  --text: #191b22;
  --muted: #747783;
  --line: #e7e7ed;
  --border: var(--line);
  --brand: #7651ee;
  --brand-dark: #5f3fd1;
  --brand-soft: #f1edff;
  --good: #1a9a69;
  --warn: #d38a20;
  --danger: #d95763;
  --shadow: 0 1px 2px rgba(29, 24, 49, 0.035);
}

body {
  padding: 0;
  background: var(--surface);
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  grid-template-columns: 232px minmax(920px, 1fr);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

.sidebar {
  height: 100vh;
  padding: 18px 16px;
  background: #ffffff;
  border-right-color: #eeeeF3;
}

.brand {
  min-height: 58px;
  padding: 4px 8px 16px;
  border-bottom: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  background: var(--brand);
  box-shadow: none;
}

.brand strong {
  font-size: 16px;
}

.brand span {
  color: #999ba5;
}

.nav-group {
  gap: 3px;
  padding-top: 14px;
  overflow-y: auto;
}

.nav-section-label {
  margin: 18px 12px 7px;
  color: #a0a1aa;
  font-size: 10px;
}

.nav-item {
  min-height: 40px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #696b75;
}

.nav-item:hover {
  background: #f8f7fc;
  color: var(--brand-dark);
}

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
  box-shadow: none;
}

.nav-icon {
  color: currentColor;
}

.sidebar-panel {
  border-color: var(--line);
  border-radius: 7px;
  background: #fbfbfd;
}

.main {
  background: #ffffff;
}

.topbar {
  min-height: 72px;
  padding: 13px 28px;
  background: #ffffff;
  backdrop-filter: none;
}

.topbar-title {
  color: #8a8c96;
  font-size: 13px;
}

.user-chip,
select,
input,
.icon-button,
.ghost-button {
  border-color: var(--line);
  box-shadow: none;
}

.user-chip {
  border-color: transparent;
}

.user-avatar {
  border-radius: 50%;
  background: #eee9ff;
  color: var(--brand-dark);
}

.primary-button {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: none;
}

.primary-button:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  box-shadow: none;
}

.ghost-button:hover,
.icon-button:hover {
  border-color: #cfc5f5;
  background: #f8f6ff;
  color: var(--brand-dark);
}

.workspace-header {
  padding: 30px 30px 18px;
}

h1 {
  font-size: 25px;
  font-weight: 720;
}

.session-banner {
  margin: 0 30px 20px;
  padding: 10px 12px;
  border-color: #e4def9;
  border-radius: 7px;
  background: #faf8ff;
}

.session-banner div {
  border-right-color: #e9e4f7;
}

.metric-grid,
.content-grid {
  padding-right: 30px;
  padding-left: 30px;
}

.metric,
.work-panel,
.module-entry {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 106px;
  padding: 16px 18px;
}

.metric::before {
  display: none;
}

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

.section-toolbar {
  padding: 17px 18px;
}

th {
  background: #fbfaff;
  color: #6f7079;
  font-weight: 650;
}

tbody tr:hover {
  background: #faf9ff;
}

.tag.ok {
  background: #eaf8f2;
  color: #19855f;
}

.tag.warning {
  background: #fff4df;
  color: #ad7119;
}

.tag.danger {
  background: #fff0f1;
  color: #c74b56;
}

.module-entry,
.empty-workflow {
  background: #ffffff;
}

.empty-workflow {
  margin: 0 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

@media (max-width: 900px) {
  body {
    padding: 0;
  }

  .app-shell {
    width: 100%;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sidebar {
    height: auto;
    position: static;
    padding-bottom: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-group {
    max-height: 248px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-y: auto;
  }

  .nav-section-label {
    grid-column: 1 / -1;
  }

  .sidebar-panel {
    display: none;
  }

  .main,
  .focused-management-panel {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .workspace-header,
  .metric-grid,
  .content-grid {
    padding-right: 16px;
    padding-left: 16px;
  }

  .workspace-header {
    align-items: stretch;
  }

  .date-switcher {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
  }

  .date-switcher button {
    flex: 0 0 auto;
  }

  .session-banner,
  .empty-workflow {
    margin-right: 16px;
    margin-left: 16px;
  }
}
