:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --text: #172026;
  --muted: #66737f;
  --line: #d8e0e6;
  --blue: #2563eb;
  --green: #16835f;
  --green-bg: #dff6ec;
  --gray-bg: #edf1f4;
  --danger: #c24135;
}

* { box-sizing: border-box; }
html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}
a, a:visited, a:hover, a:active { text-decoration: none; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: block;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", Arial, sans-serif;
  overflow-wrap: break-word;
}
img, svg, video, canvas { max-width: 100%; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a, [role="button"] { touch-action: manipulation; }
input, select, textarea { max-width: 100%; }
input[type="file"] { min-width: 0; max-width: 100%; overflow: hidden; }
#systemShell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 256px minmax(0, 1fr); transition: grid-template-columns .2s ease; }
#systemShell.sidebar-collapsed { grid-template-columns: 72px minmax(0, 1fr); }

@media (min-width: 821px) {
  .desktop-sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  .desktop-sidebar-head { flex: 0 0 auto; }
  .desktop-sidebar > .sidebar-nav { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; scrollbar-gutter: stable; }
}

.sidebar {
  background: #fff;
  color: #4b5563;
  border-right: 1px solid #e4e8ef;
  padding: 18px 10px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.desktop-sidebar-head { display: block; }
.desktop-sidebar-head .brand { min-width: 0; }
.desktop-sidebar { padding-bottom: 4px; }
.desktop-sidebar-footer { display: flex; flex: 0 0 26px; justify-content: flex-end; overflow-y: hidden; scrollbar-gutter: stable; }
.desktop-sidebar-toggle {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #7d8798;
  box-shadow: none;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}
.desktop-sidebar-toggle:hover, .desktop-sidebar-toggle:focus-visible { background: #edf5ff; color: #2f6fbb; }
.desktop-sidebar-toggle:focus-visible { outline: 2px solid #8cbcff; outline-offset: 2px; }
.desktop-sidebar-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.desktop-sidebar-toggle .sidebar-expand-icon { display: none; }
.desktop-sidebar-flyout {
  position: fixed;
  z-index: 80;
  width: 218px;
  padding: 8px;
  border: 1px solid #d8e1ec;
  border-radius: 10px;
  background: rgba(255,255,255,.98);
  box-shadow: 8px 14px 28px rgba(35, 52, 72, .2);
}
.desktop-sidebar-flyout > strong { display: flex; align-items: center; gap: 9px; padding: 7px 9px 9px; border-bottom: 1px solid #e6ebf1; color: #40546a; font-size: 13px; }
.desktop-sidebar-flyout > strong .nav-icon { color: #5a6e86; }
.desktop-sidebar-flyout > div { display: grid; gap: 2px; padding-top: 5px; }
.desktop-sidebar-flyout .nav { min-height: 30px; padding: 6px 9px; font-size: 13px; }
.desktop-sidebar-flyout .nav.active { background: #315bea; color: #fff; }
.sidebar-collapsed .desktop-sidebar { padding: 16px 10px 4px; scrollbar-gutter: auto; }
.sidebar-collapsed .desktop-sidebar-head { display: grid; justify-items: center; }
.sidebar-collapsed .desktop-sidebar .brand { justify-content: center; padding: 3px 0 17px; }
.sidebar-collapsed .desktop-sidebar .brand > span,
.sidebar-collapsed .desktop-sidebar .nav-label,
.sidebar-collapsed .desktop-sidebar .quick-menu-section,
.sidebar-collapsed .desktop-sidebar .menu-title-main > span:not(.nav-icon),
.sidebar-collapsed .desktop-sidebar .menu-caret { display: none; }
.sidebar-collapsed .desktop-sidebar-footer { justify-content: center; scrollbar-gutter: auto; }
.sidebar-collapsed .desktop-sidebar > .sidebar-nav { scrollbar-gutter: auto; }
.sidebar-collapsed .desktop-sidebar-toggle .sidebar-collapse-icon { display: none; }
.sidebar-collapsed .desktop-sidebar-toggle .sidebar-expand-icon { display: block; }
.sidebar-collapsed .desktop-sidebar > .sidebar-nav > .nav,
.sidebar-collapsed .desktop-sidebar .menu-title { justify-content: center; width: 40px; height: 40px; min-height: 40px; margin: 0 auto; padding: 0; border-color: transparent; border-radius: 10px; background: transparent; }
.sidebar-collapsed .desktop-sidebar > .sidebar-nav > .nav { width: 40px; height: 40px; min-height: 40px; margin: 0 auto 8px; padding: 0; border-radius: 10px; }
.sidebar-collapsed .desktop-sidebar .menu-title-main { display: grid; place-items: center; min-width: auto; }
.sidebar-collapsed .desktop-sidebar .nav-icon { width: 20px; height: 20px; flex-basis: 20px; }
.sidebar-collapsed .desktop-sidebar .menu-title:hover { border-color: #d8e6f6; background: #eef5ff; color: #2f6fbb; }
.sidebar-collapsed .desktop-sidebar .menu-title:hover .nav-icon { color: currentColor; }
.sidebar-collapsed .desktop-sidebar .menu-group.has-active .menu-title { border-color: #315bea; background: #315bea; color: #fff; box-shadow: 0 4px 10px rgba(49,91,234,.2); }
.sidebar-collapsed .desktop-sidebar .menu-group.has-active .menu-title .nav-icon { color: currentColor; }
.sidebar-collapsed .desktop-sidebar .menu-items { display: none; }
.sidebar-collapsed .desktop-sidebar .menu-group { margin: 5px 0; }
.mobile-menu-bar, .mobile-menu-backdrop, .mobile-menu-drawer { display: none; }
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #40454f;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.3px;
  padding: 7px 10px 25px;
}
.brand-mark { display: block; width: 29px; height: 29px; flex: 0 0 29px; border-radius: 8px; object-fit: contain; }
.nav, .nav:visited, .nav:hover, .nav:active {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #667085;
  text-align: left;
  min-height: 22px;
  padding: 5px 14px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
}
.nav:hover { background: #f1f5ff; color: #2f5cf0; }
.nav.active { background: #315bea; color: #fff; box-shadow: 0 4px 10px rgba(49,91,234,.18); }
.nav-icon { display: inline-flex; flex: 0 0 18px; width: 18px; height: 18px; color: #7d8798; }
.nav-icon svg { display: block; width: 100%; height: 100%; }
.nav.active .nav-icon, .nav:hover .nav-icon { color: currentColor; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-nav { min-width: 0; }
.menu-group { margin: 5px 0; padding-top: 0; border-top: 0; }
.menu-group:first-of-type { border-top: 0; }
.menu-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 1px solid #e7ebf2;
  border-radius: 7px;
  background: #f6f8fb;
  color: #505a6c;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 14px;
  text-align: left;
  cursor: pointer;
}
.menu-title:hover, .menu-title:focus-visible { color: #1d4ed8; outline: 0; }
.menu-title-main, .quick-menu-title { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.menu-title .nav-icon { color: #748096; }
.menu-caret { font-size: 16px; line-height: 1; transform: rotate(0deg); transition: transform .15s ease; }
.menu-group.is-collapsed .menu-caret { transform: rotate(-90deg); }
.menu-group.is-collapsed .menu-items { display: none; }
.menu-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; margin-top: 4px; }
.subnav {
  position: relative;
  margin-left: 0;
  min-height: 22px;
  padding-top: 5px;
  padding-bottom: 5px;
  padding-left: 14px;
  font-size: 12px;
  transition: background-color .15s ease, color .15s ease, transform .15s ease;
}
.subnav .nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Use the available desktop submenu width before truncating its label. */
.desktop-sidebar .nav.subnav { padding-right: 4px; }
.desktop-sidebar .subnav .nav-label { flex: 1 1 auto; }
.desktop-sidebar .subnav[data-view="pendingSkus"] { gap: 4px; }
.desktop-sidebar .subnav .pending-sku-badge { flex: 0 0 auto; margin-left: 0; }
.menu-group + .menu-group { margin-top: 9px; }
.menu-title:hover, .menu-title:focus-visible { background: #eef3fb; }
.subnav.active { padding-left: 14px; background: #eaf2ff; color: #1d4ed8; box-shadow: none; }
.subnav .nav-icon { display: none; }
.subnav.active::before { position: absolute; left: 4px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: #315bea; content: ''; }
.quick-menu-section { margin: 5px 0 10px; padding: 6px 0 10px; border-block: 1px solid #edf0f4; }
.quick-menu-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 2px 14px 3px; color: #505a6c; font-size: 12px; font-weight: 600; }
.quick-menu-settings { border: 0; padding: 2px 4px; color: #64748b; background: transparent; cursor: pointer; font: inherit; font-size: 12px; }
.quick-menu-settings:hover, .quick-menu-settings:focus-visible { color: #1d4ed8; outline: 0; }

.settings-page { width: min(800px, 100%); max-width: 100%; box-sizing: border-box; margin: 0 auto; padding: 28px 32px 34px; overflow: visible; }
.settings-hero { display: flex; align-items: center; gap: 16px; padding-bottom: 24px; border-bottom: 1px solid #e2e8f0; }
.settings-hero h2 { margin: 0 0 6px; font-size: 28px; color: #0f172a; }
.settings-hero p, .settings-panel-heading p { margin: 0; color: #64748b; line-height: 1.6; }
.settings-hero-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: #eff6ff; color: #2563eb; font-size: 25px; }
.settings-notice { display: flex; gap: 12px; align-items: baseline; margin: 22px 0; padding: 14px 16px; border: 1px solid #bfdbfe; border-radius: 10px; background: #eff6ff; color: #1e40af; }
.settings-notice strong { white-space: nowrap; }
.settings-panel { position: relative; z-index: 2; overflow: visible; margin-top: 20px; padding: 22px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
.settings-panel.settings-panel-menu-open { z-index: 30; }
.settings-panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; }
.settings-panel h3 { margin: 0 0 5px; font-size: 18px; color: #0f172a; }
.settings-sync-header, .settings-sync-row { display: grid; grid-template-columns: 22px 1.2fr 1fr 1.4fr 80px; align-items: center; gap: 12px; }
.settings-sync-header { padding: 0 14px 8px; color: #94a3b8; font-size: 12px; }
.settings-sync-row { min-height: 64px; padding: 10px 14px; border-top: 1px solid #f1f5f9; }
.settings-sync-enabled, .settings-block-time label { display: flex; align-items: center; gap: 9px; color: #334155; }
.settings-sync-enabled input { width: 17px; height: 17px; accent-color: #2563eb; }
.settings-sync-row input[type="time"], .settings-sync-row select, .settings-block-time input { width: 100%; min-height: 40px; padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #0f172a; font: inherit; }
.sync-kind-menu { position: relative; }
.sync-kind-button { width: 100%; min-height: 40px; padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #0f172a; text-align: left; font: inherit; cursor: pointer; }
.sync-kind-button span { float: right; color: #64748b; }
.sync-kind-options { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; padding: 4px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; box-shadow: 0 8px 22px rgba(15,23,42,.16); }
.sync-kind-options button { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 5px; background: transparent; color: #0f172a; text-align: left; font: inherit; cursor: pointer; }
.sync-kind-options button:hover { background: #eff6ff; color: #1d4ed8; }
.settings-sync-row .sync-remove { color: #b91c1c; }
.settings-time-fields { display: inline-grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 4px; min-width: 170px; padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; }
.settings-time-fields input { width: 100%; min-width: 0; padding: 4px 1px; border: 0; outline: 0; background: transparent; color: #0f172a; text-align: center; font: inherit; }
.settings-time-fields b { color: #94a3b8; font-weight: 500; }
.settings-time-fields:focus-within { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.settings-time-fields input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.settings-time-fields input[type="number"]::-webkit-inner-spin-button,
.settings-time-fields input[type="number"]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.settings-manual-header, .settings-manual-row { display: grid; grid-template-columns: 1.15fr 1fr 24px 1fr 80px; align-items: center; gap: 12px; }
.settings-manual-header, .settings-manual-row { grid-template-columns: 22px 1.15fr 1fr 24px 1fr 80px; }
.settings-manual-header { padding: 0 14px 8px; color: #94a3b8; font-size: 12px; }
.settings-manual-row { min-height: 64px; padding: 10px 14px; border-top: 1px solid #f1f5f9; }
.settings-manual-row .manual-block-remove { color: #b91c1c; }
.settings-drag-handle { color: #94a3b8; cursor: grab; user-select: none; font-size: 20px; line-height: 1; text-align: center; }
.settings-drag-handle:active { cursor: grabbing; }
.settings-row-dragging { opacity: .45; background: #eff6ff; }
.settings-empty { padding: 18px; border: 1px dashed #cbd5e1; border-radius: 8px; text-align: center; color: #94a3b8; }
.settings-block-time { display: flex; align-items: end; gap: 14px; max-width: 560px; }
.settings-block-time label { display: block; flex: 1; }
.settings-block-time label span { display: block; margin-bottom: 7px; color: #475569; font-size: 13px; }
.settings-time-dash { padding-bottom: 11px; color: #94a3b8; }
.settings-actions { display: flex; justify-content: flex-end; margin-top: 22px; }
.settings-actions .primary, .settings-panel .primary { min-height: 42px; padding: 0 20px; border: 0; border-radius: 8px; background: #2563eb; color: #fff; cursor: pointer; font: inherit; }
.settings-actions .primary:hover, .settings-panel .primary:hover { background: #1d4ed8; }
.daily-sales-limit-switch { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; color: #334155; font-weight: 650; cursor: pointer; }
.daily-sales-limit-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.daily-sales-limit-track { position: relative; width: 48px; height: 27px; border-radius: 20px; background: #94a3b8; transition: background .15s; }
.daily-sales-limit-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.daily-sales-limit-switch input:checked + .daily-sales-limit-track { background: #2563eb; }
.daily-sales-limit-switch input:checked + .daily-sales-limit-track::after { transform: translateX(21px); }
.daily-sales-limit-switch input:focus-visible + .daily-sales-limit-track { outline: 3px solid #93c5fd; outline-offset: 3px; }
.sales-sync-progress-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 20px; }
.sales-sync-retry-switch { font-size: 13px; gap: 9px; }
.sales-sync-retry-switch input:disabled + .daily-sales-limit-track { opacity: .6; }
.daily-sales-limit-time-row { display: grid; gap: 9px; margin-top: 20px; color: #334155; font-weight: 650; }
.daily-sales-limit-time-control { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.daily-sales-limit-time-fields { display: inline-flex; align-items: center; gap: 7px; }
.daily-sales-limit-time-fields > b { padding-bottom: 3px; color: #94a3b8; font-size: 24px; font-weight: 500; }
.daily-sales-limit-part { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 76px; height: 76px; box-sizing: border-box; border: 1px solid #cbd5e1; border-radius: 12px; background: #f8fafc; cursor: ns-resize; transition: border-color .15s, background .15s, box-shadow .15s; }
.daily-sales-limit-part:hover { border-color: #60a5fa; background: #eff6ff; }
.daily-sales-limit-part:focus-within { border-color: #2563eb; background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.daily-sales-limit-part span { color: #64748b; font-size: 12px; font-weight: 500; line-height: 1.2; }
.daily-sales-limit-part input { width: 56px; height: 36px; padding: 0; border: 0; outline: 0; background: transparent; color: #0f172a; font: inherit; font-size: 27px; font-weight: 700; line-height: 36px; text-align: center; font-variant-numeric: tabular-nums; cursor: ns-resize; }
.daily-sales-limit-time-control button { min-height: 44px; padding: 0 16px; border: 1px solid #bfdbfe; border-radius: 9px; background: #eff6ff; color: #1d4ed8; font-weight: 650; }
.daily-sales-limit-time-control button:hover { background: #dbeafe; border-color: #93c5fd; }
.daily-sales-limit-time-row small { color: #64748b; font-size: 13px; font-weight: 400; line-height: 1.5; }
@media (max-width: 460px) { .daily-sales-limit-part { width: 64px; height: 70px; } .daily-sales-limit-part input { width: 50px; font-size: 24px; } .daily-sales-limit-time-fields { gap: 4px; } }
.api-settings-page .settings-hero-icon { font-size: 13px; font-weight: 800; letter-spacing: .4px; }
.api-settings-page .factory-callback-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.api-settings-page .factory-callback-field { min-width: 0; }
.api-settings-page .factory-callback-choice { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; color: #334155; font-size: 13px; font-weight: 650; cursor: pointer; }
.api-settings-page .factory-callback-choice input { width: 16px; height: 16px; margin: 0; accent-color: #2563eb; }
@media (max-width: 700px) { .api-settings-page .factory-callback-grid { grid-template-columns: 1fr; } }
.api-settings-page .listing-filter { display: flex; flex-direction: column; align-items: stretch; gap: 7px; width: 100%; height: auto; min-height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.api-settings-page .listing-filter:hover, .api-settings-page .listing-filter:focus-within { border: 0; background: transparent; box-shadow: none; }
.api-settings-page .listing-filter > span:first-child { color: #334155; font-size: 13px; font-weight: 650; }
.api-settings-page .listing-filter input { width: 100%; height: 42px; min-width: 0; box-sizing: border-box; padding: 8px 11px; border: 1px solid #cbd5e1; border-radius: 7px; background: #f8fafc; color: #0f172a; font: inherit; }
.api-settings-page .listing-filter input:hover { background: #fff; border-color: #93c5fd; }
.api-settings-page .listing-filter input:focus { border-color: #2563eb; outline: 0; box-shadow: 0 0 0 3px rgba(37,99,235,.12); background: #fff; }
.api-settings-page .listing-toolbar-grid { grid-template-columns: repeat(2, minmax(0, 240px)); justify-content: start; gap: 16px; }
.api-settings-page .form-hint { margin: 10px 0 0; color: #64748b; font-size: 13px; line-height: 1.6; }
.api-settings-page .form-hint code { padding: 2px 5px; border-radius: 4px; background: #f1f5f9; color: #475569; font-size: 12px; overflow-wrap: anywhere; }
.api-settings-page .settings-actions { align-items: center; gap: 12px; }
.api-settings-page #factoryCallbackTestResult { margin: 0; color: #166534; font-weight: 600; }
.api-settings-page .settings-panel > .ghost { min-height: 40px; padding: 0 15px; border-radius: 7px; }
.mail-settings-page { width: min(1040px, 100%); max-width: 100%; }
.mail-settings-page .settings-panel-heading { align-items: flex-start; }
.mail-settings-page .settings-panel-heading p { max-width: 680px; font-size: 13px; }
.mail-trigger-action { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 6px; }
.mail-trigger-restriction { color: #dc2626; font-size: 12px; line-height: 1.3; }
.sales-sync-plan-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.sales-sync-plan-actions button { margin-top: 0; white-space: nowrap; }
.mail-settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mail-feedback-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mail-feedback-failure-grid { margin-top: 18px; padding-top: 18px; border-top: 1px solid #e2e8f0; }
.mail-feedback-grid .mail-setting-field small { min-height: 0; }
.mail-setting-field { display: flex; min-width: 0; flex-direction: column; gap: 7px; color: #334155; font-size: 13px; font-weight: 650; }
.mail-setting-field input { width: 100%; min-width: 0; height: 42px; box-sizing: border-box; padding: 8px 11px; border: 1px solid #cbd5e1; border-radius: 7px; background: #f8fafc; color: #0f172a; font: inherit; font-weight: 400; }
.mail-setting-field input:focus { border-color: #2563eb; outline: 0; box-shadow: 0 0 0 3px rgba(37,99,235,.12); background: #fff; }
.mail-setting-field small { min-height: 34px; color: #718096; font-size: 12px; font-weight: 400; line-height: 1.5; }
.mail-secure-toggle { display: flex; align-items: center; gap: 9px; margin-top: 17px; color: #475569; font-size: 13px; }
.mail-secure-toggle input { width: 16px; height: 16px; accent-color: #2563eb; }
.mail-config-state { padding: 5px 9px; border-radius: 99px; background: #f1f5f9; color: #64748b; font-size: 12px; white-space: nowrap; }
.mail-inline-actions { justify-content: flex-start; align-items: center; gap: 12px; }
.mail-inline-actions .ghost, #mailHistoryRefresh { min-height: 38px; padding: 0 14px; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; color: #334155; cursor: pointer; }
.mail-inline-actions .ghost:hover, #mailHistoryRefresh:hover { border-color: #93c5fd; color: #1d4ed8; }
.mail-inline-actions .form-hint { margin: 0; overflow-wrap: anywhere; }
.mail-settings-page .mail-save-actions { margin-top: 12px; }
.mail-trigger-panel { padding: 14px 20px 12px; }
.mail-trigger-panel .settings-panel-heading { align-items: center; margin-bottom: 6px; }
.mail-trigger-panel .settings-panel-heading p { line-height: 1.4; }
#mailTriggerSalesUpdate { min-height: 38px; padding: 0 18px; border: 0; border-radius: 8px; background: #2563eb; color: #fff; font: inherit; cursor: pointer; white-space: nowrap; }
#mailTriggerSalesUpdate:hover { background: #1d4ed8; }
#mailTriggerSalesUpdate:disabled, .mail-settings-page button:disabled { opacity: .58; cursor: wait; }
.mail-trigger-panel > .form-hint { margin: 0; overflow-wrap: anywhere; }
.mail-history-list { display: grid; gap: 10px; }
.mail-history-item { padding: 12px 15px 10px; border: 1px solid #dce5ef; border-radius: 9px; background: #fff; }
.mail-history-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 13px; }
.mail-history-heading > time { color: #7b8ba1; font-size: 12px; }
.mail-history-heading > code { max-width: 100%; margin-left: 0; color: #94a3b8; font-size: 11px; overflow-wrap: anywhere; text-align: left; }
.mail-history-heading > .mail-request-date { margin-left: auto; color: #7b8ba1; font-size: 12px; white-space: nowrap; }
.mail-status-pill { padding: 3px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.mail-status-pill.is-waiting { background: #f1f5f9; color: #64748b; }
.mail-status-pill.is-active { background: #ecfdf5; color: #047857; }
.mail-status-pill.is-completed { background: #ecfdf5; color: #047857; }
.mail-status-pill.is-failed { background: #fef2f2; color: #dc2626; }
.mail-timeline { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; min-width: 0; padding: 0 2px 5px; }
.mail-timeline::before { position: absolute; z-index: 0; top: 30px; right: 3%; left: 3%; height: 8px; border-radius: 99px; background: #e5e7eb; box-shadow: inset 0 1px 2px rgba(15, 23, 42, .08); content: ''; }
.mail-timeline-step { position: relative; z-index: 2; display: grid; justify-items: center; align-content: start; min-width: 0; text-align: center; }
.mail-timeline-step time { display: block; min-height: 16px; margin: 0 0 5px; color: #41464b; font-size: 11px; font-weight: 400; line-height: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mail-timeline-dot { position: relative; display: grid; place-items: center; width: 26px; height: 26px; box-sizing: border-box; margin: 0 auto 8px; border: 3px solid #f1f2f3; border-radius: 50%; background: #969a9e; color: #fff; font-size: 14px; font-weight: 750; line-height: 1; box-shadow: 0 0 0 1px #d2d5d8; }
.mail-timeline-dot > svg { display: block; width: 14px; height: 14px; }
.mail-timeline-step.is-sent .mail-timeline-dot, .mail-timeline-step.is-done .mail-timeline-dot { border-color: #eaf3d8; background: #99c83d; box-shadow: 0 0 0 1px #c9dc9a, 0 1px 3px rgba(62, 98, 11, .2); }
.mail-timeline-step.is-active .mail-timeline-dot { border-color: #fff0c2; background: #edbd22; box-shadow: 0 0 0 1px #e5bd4b, 0 1px 4px rgba(129, 94, 8, .23); }
.mail-timeline-step.is-failed .mail-timeline-dot { border-color: #ffe0e0; background: #e5484d; box-shadow: 0 0 0 1px #f2a0a2, 0 1px 3px rgba(140, 20, 25, .18); }
.mail-timeline-step strong { color: #41464b; font-size: 12px; font-weight: 650; line-height: 1.4; }
.mail-timeline-step.is-failed strong { color: #c93439; }
.mail-timeline-note { margin-top: 3px; color: #858b91; font-size: 11px; line-height: 1.45; }
.mail-timeline-step.is-active .mail-timeline-note { color: #a17c11; }
.mail-timeline-step.is-failed .mail-timeline-note { color: #c93439; }
.mail-timeline-connector { position: absolute; z-index: 1; top: 30px; display: block; height: 8px; }
.mail-timeline-fill { position: absolute; top: 0; left: 0; display: block; height: 8px; border-radius: 99px; background: #edbd22; transition: width .8s linear; }
.mail-timeline-fill.is-complete { background: #99c83d; }
.mail-timeline-fill.is-failed { background: #e5484d; }
.mail-progress-marker { position: absolute; z-index: 2; top: -17px; display: grid; justify-items: center; width: 40px; transform: translateX(-50%); pointer-events: none; }
.mail-progress-percent { margin-bottom: 1px; padding: 1px 4px; border: 1px solid rgba(148,163,184,.3); border-radius: 8px; background: rgba(255,255,255,.96); color: #536273; font-size: 10px; font-weight: 600; line-height: 12px; white-space: nowrap; box-shadow: 0 1px 2px rgba(15,23,42,.12); }
.mail-progress-arrow { width: 0; height: 0; border-top: 6px solid #fff; border-right: 5px solid transparent; border-left: 5px solid transparent; filter: drop-shadow(0 1px 1px rgba(15,23,42,.45)); }
.mail-progress-label { display: block; max-width: 100%; margin-top: 3px; color: #8a6a12; font-size: 10px; line-height: 1.45; }
.mail-timeline-connector:nth-child(2) { left: 16.666667%; width: 33.333333%; }
.mail-timeline-connector:nth-child(4) { left: 50%; width: 33.333333%; }
.mail-history-error { margin: 9px 0 0; color: #b91c1c; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.mail-history-details { margin-top: 12px; border-top: 1px solid #edf1f5; color: #64748b; }
.mail-history-details summary { padding-top: 10px; color: #718096; font-size: 12px; cursor: pointer; user-select: none; }
.mail-history-details summary:hover { color: #2563eb; }
.mail-detail-row { display: grid; gap: 5px; padding: 10px 0; border-bottom: 1px solid #eef2f7; font-size: 11px; line-height: 1.5; }
.mail-detail-row > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.mail-detail-row strong { color: #475569; }
.mail-detail-row time, .mail-detail-row small { color: #8a99ac; }
.mail-detail-row p { max-height: 4.5em; margin: 0; overflow: auto; color: #64748b; overflow-wrap: anywhere; }
.mail-yidao-guide { border-color: #bfdbfe; background: linear-gradient(135deg, #fff 0%, #f8fbff 100%); }
.mail-yidao-guide ol { display: grid; gap: 10px; margin: 0; padding-left: 22px; color: #475569; font-size: 13px; line-height: 1.65; }
.mail-yidao-guide ol strong { color: #1e293b; }
.mail-template { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 12px; margin-top: 16px; align-items: baseline; font-size: 12px; }
.mail-template > span { color: #64748b; }
.mail-template code { padding: 7px 9px; border-radius: 6px; background: #eff6ff; color: #1e40af; overflow-wrap: anywhere; }
.mail-yidao-guide > .form-hint { margin: 12px 0 0; line-height: 1.6; }
@media (max-width: 800px) {
  .mail-settings-page { width: 100%; padding: 20px 14px 24px; }
  .mail-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .mail-trigger-panel .settings-panel-heading { align-items: flex-start; flex-direction: column; }
  .mail-history-item { padding-inline: 12px; }
  .mail-timeline-step strong { font-size: 11px; }
  .mail-timeline-note, .mail-timeline-step time { font-size: 10px; }
  .mail-template { grid-template-columns: minmax(0, 1fr); gap: 5px; }
}
@media (max-width: 520px) { .mail-settings-grid { grid-template-columns: minmax(0, 1fr); } .mail-settings-page .settings-notice { align-items: flex-start; flex-direction: column; } }
@media (max-width: 700px) { .api-settings-page .listing-toolbar-grid { grid-template-columns: 1fr; } .api-settings-page .settings-actions[style] { align-items: flex-start; flex-direction: column; } }
@media (max-width: 700px) { .settings-page { padding: 20px 16px; } .settings-sync-header, .settings-manual-header { display: none; } .settings-sync-row { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 14px 0; } .settings-sync-row .settings-time-fields { grid-column: 2 / -1; width: 100%; min-width: 0; } .settings-manual-row { grid-template-columns: 22px minmax(0, 1fr); gap: 8px; padding: 14px 0; } .settings-manual-row .settings-time-fields, .settings-manual-row .settings-time-dash { grid-column: 2 / -1; width: 100%; min-width: 0; } .settings-sync-enabled { grid-column: 2 / -1; } .settings-sync-row .sync-remove, .settings-manual-row .manual-block-remove { justify-self: start; } .settings-manual-row .settings-sync-enabled, .settings-manual-row .manual-block-remove { grid-column: 2 / -1; } .settings-panel-heading, .settings-notice, .settings-block-time { display: block; } .settings-panel-heading button { margin-top: 14px; } .settings-time-dash { display: block; padding: 8px 0; } }
.quick-menu-items { display: grid; gap: 2px; }
.quick-menu-empty { padding: 5px 42px; color: #98a2b3; font-size: 12px; }
.quick-nav { min-height: 22px; padding-top: 5px; padding-bottom: 5px; padding-left: 42px; font-size: 12px; transition: background-color .15s ease, color .15s ease, transform .15s ease; }
.quick-nav .nav-icon { margin-left: -28px; }
.quick-menu-dialog { width: min(460px, calc(100vw - 28px)); border: 1px solid var(--line); border-radius: 12px; padding: 20px; color: var(--text); background: var(--panel); box-shadow: 0 18px 50px rgba(23,32,38,.25); }
.quick-menu-dialog::backdrop { background: rgba(23,32,38,.42); }
.quick-menu-dialog h2 { margin: 0; font-size: 20px; }
.quick-menu-dialog .dialog-hint { margin: 6px 0 14px; font-size: 13px; }
.quick-menu-choice-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; max-height: 48vh; overflow: auto; }
.quick-menu-choice-list label { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--gray-bg); cursor: grab; font-size: 14px; transition: border-color .12s, background .12s, opacity .12s; }
.quick-menu-choice-list label:active { cursor: grabbing; }
.quick-menu-choice-list label.is-dragging { opacity: .45; }
.quick-menu-choice-list label.is-drag-over { border-color: var(--blue); background: #eef4ff; }
.quick-menu-drag-placeholder { min-height: 38px; border: 1px dashed var(--blue); border-radius: 7px; background: #eef4ff; }
.quick-menu-drag-handle { margin-left: auto; color: var(--muted); letter-spacing: -3px; font-size: 16px; user-select: none; }
.quick-menu-choice-list input { accent-color: var(--blue); }
.quick-menu-dialog menu { display: flex; justify-content: flex-end; gap: 8px; margin: 18px 0 0; padding: 0; }
.quick-menu-dialog menu button { min-height: 36px; padding: 7px 14px; border: 0; border-radius: 8px; cursor: pointer; font: inherit; }
.quick-menu-dialog .quick-menu-save { color: #fff; background: var(--blue); }

.main { min-width: 0; background: #f5f7fb; }
.topbar {
  min-height: 68px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}
.topbar-page { display: flex; align-items: center; min-width: 0; gap: 15px; flex: 1 1 auto; }
.topbar-status-indicators { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 3px; min-width: 0; margin-left: auto; padding: 0 12px; color: #64748b; }
.inventory-batch-topbar-status { display: grid; grid-template-columns: max-content 1fr; gap: 8px; flex: 0 0 auto; width: 100%; color: #64748b; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.topbar-last-import-status { display: block; flex: 0 0 auto; }
.topbar-last-import-status[hidden] { display: none; }
.topbar-status-indicators .daily-sales-last-import { display: grid; grid-template-columns: max-content 1fr; align-self: stretch; width: 100%; gap: 8px; margin: 0; color: #64748b; font-size: 12px; }
.topbar-status-indicators .daily-sales-update-time, .topbar-status-indicators .topbar-status-time { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.topbar-status-indicators .daily-sales-last-import:hover, .topbar-status-indicators .daily-sales-last-import:focus-visible { color: #1d4ed8; }
.topbar-status-indicators .daily-sales-last-import-tooltip { background: rgba(255,255,255,.98); backdrop-filter: blur(10px); }
/* Compact global sales sync: only visible while the robot is executing. */
.topbar-sales-sync-progress { display: flex; align-items: center; gap: 7px; width: 100%; min-height: 12px; }
.topbar-sales-sync-progress[hidden] { display: none; }
.topbar-sales-sync-track { flex: 1 1 auto; min-width: 0; height: 4px; overflow: hidden; border-radius: 999px; background: #e3e6eb; }
.topbar-sales-sync-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: #91c936; }
.topbar-sales-sync-percent { flex: 0 0 29px; color: #64748b; font-size: 10px; line-height: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.topbar-menu-mark { position: relative; width: 18px; height: 14px; flex: 0 0 18px; border-block: 2px solid #7c8595; }
.topbar-menu-mark::after { position: absolute; left: 0; right: 0; top: 5px; height: 2px; background: #7c8595; content: ''; }
.page-breadcrumb { display: flex; align-items: center; gap: 12px; min-width: 0; color: #7b8493; font-size: 16px; white-space: nowrap; }
.breadcrumb-item.is-current { color: #424957; font-weight: 600; }
.breadcrumb-separator { color: #c1c7d0; font-size: 20px; font-weight: 300; }
.page-description { flex: 1 1 auto; min-width: 0; margin: 0 0 0 2px; max-width: none; overflow: visible; color: #8a94a4; font-size: 13px; line-height: 1.45; text-align: left; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
.topbar-user { position: relative; align-self: center; flex: 0 0 auto; margin-top: 0; }
.topbar-user-trigger { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 3px 4px 3px 3px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; }
.topbar-user-trigger:hover, .topbar-user.open .topbar-user-trigger, .topbar-user-trigger:focus-visible { border-color: var(--line); background: var(--gray-bg); outline: 0; }
.topbar-avatar { display: grid; place-items: center; width: 28px; height: 28px; overflow: hidden; flex: 0 0 28px; border: 1px solid var(--line); border-radius: 7px; background: #eaf1f5; color: var(--blue); font-size: 13px; font-weight: 400; }
.topbar-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.topbar-user-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 400; }
.topbar-user-arrow { width: 8px; height: 8px; margin: -4px 2px 0 3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
.topbar-user.open .topbar-user-arrow { margin-top: 4px; transform: rotate(225deg); }
.topbar-user-menu { position: absolute; z-index: 30; top: calc(100% + 7px); right: 0; display: none; min-width: 142px; max-width: calc(100vw - 20px); padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 10px 24px rgba(23,32,38,.16); }
.topbar-user.open .topbar-user-menu { display: grid; gap: 2px; }
.topbar-user-menu button { width: 100%; padding: 9px 11px; border: 0; border-radius: 5px; background: transparent; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.topbar-user-menu button:hover, .topbar-user-menu button:focus-visible { background: var(--gray-bg); outline: 0; }
p { margin: 6px 0 0; color: var(--muted); }
#app { min-height: calc(100vh - 100px); margin: 16px 18px 28px; padding: 20px; border: 1px solid #e6eaf0; border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(31,41,55,.02); }
#app.tool-page-app { padding: 0; background: #f4f7fb; overflow: hidden; }
.tool-page-frame { display: block; width: 100%; height: calc(100dvh - 104px); min-height: 640px; border: 0; border-radius: 7px; background: #f4f7fb; }

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 16px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.metric { font-size: 30px; font-weight: 750; margin-top: 8px; }
.toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.toolbar:has(.listing-toolbar-grid) { display: block; width: 100%; }
.toolbar:has(.listing-toolbar-grid) > .listing-toolbar-grid { width: 100%; }
.toolbar > input, .toolbar > select { width: 100%; height: 38px; min-width: 0; background: var(--gray-bg); transition: border-color .15s, background .15s, box-shadow .15s; }
.toolbar > input:hover, .toolbar > select:hover, .toolbar > input:focus, .toolbar > select:focus { background: #fff; border-color: #58aeb2; box-shadow: 0 0 0 2px rgba(22,131,95,.12); outline: 0; }
.toolbar > button { min-height: 38px; }
.toolbar > .push-right { margin-left: 0; }
.toolbar-action-group { grid-column: 4; display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.toolbar-action-group button { min-height: 38px; white-space: nowrap; }
.toolbar > label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.listing-toolbar-grid { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: center; container-type: inline-size; }
.listing-toolbar-grid .listing-filter { min-width: 0; width: 100%; }
  .matrix-search-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.matrix-store-filter { position: relative; min-width: 0; height: 38px; border: 1px solid var(--line); border-radius: 4px; background: var(--gray-bg); z-index: 6; }
.matrix-store-trigger { width: 100%; height: 100%; display: flex; align-items: center; gap: 8px; padding: 0 9px; border: 0; background: transparent; font: inherit; cursor: pointer; text-align: left; }
.matrix-store-trigger span { color: var(--text); font-weight: 600; white-space: nowrap; }
.matrix-store-trigger em { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #9aa5ad; font-style: normal; }
.matrix-store-trigger b { width: 9px; height: 9px; margin: -5px 3px 0 0; border-right: 1.6px solid var(--text); border-bottom: 1.6px solid var(--text); transform: rotate(45deg); flex: 0 0 auto; }
.matrix-store-filter.open { background: #fff; border-color: #58aeb2; box-shadow: 0 0 0 2px rgba(22,131,95,.12); }
.matrix-store-filter.open .matrix-store-trigger b { transform: rotate(225deg); margin-top: 5px; }
.matrix-store-options { display: none; position: absolute; left: -1px; right: -1px; top: calc(100% + 5px); max-height: 260px; overflow-y: auto; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 20px rgba(23,32,38,.16); }
.matrix-store-filter.open .matrix-store-options { display: grid; gap: 2px; }
.matrix-store-options label { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 4px; cursor: pointer; }
.matrix-store-options label:hover { background: var(--gray-bg); }
.matrix-store-options input { width: 18px; height: 18px; accent-color: var(--green); }
.matrix-store-filter-inline { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-height: 36px; height: auto; margin-bottom: 12px; padding: 4px 9px; z-index: 1; }
.sales-query-toolbar + .matrix-store-filter-inline { margin-top: 12px; }
.matrix-board-store-filter { margin-bottom: 4px; }
.matrix-store-label { color: var(--text); font-weight: 600; white-space: nowrap; }
.daily-sales-workspace .analysis-store-filter-row > .matrix-store-label,
.daily-sales-workspace .analysis-store-filter-row > .inventory-account-picker > button { font-size: 13px; }
.matrix-store-filter-inline .matrix-store-options { position: static; display: flex; flex-wrap: wrap; gap: 4px 14px; max-height: none; padding: 0; overflow: visible; border: 0; box-shadow: none; background: transparent; }
.matrix-store-filter-inline .matrix-store-options label { padding: 2px 4px; gap: 5px; }
.matrix-store-filter-inline .matrix-store-options label.is-disabled { opacity: .42; cursor: not-allowed; }
.matrix-store-filter-inline .matrix-store-options label.is-zero-sales > span { color: #a0a8b3; }
.daily-sales-offline-account-filter { display: flex; align-items: center; gap: 10px; min-width: 0; margin-left: auto; padding-left: 14px; border-left: 1px solid #d8e1ea; }
.table-column-settings-trigger + .daily-sales-offline-account-filter { margin-left: 0; }
.daily-sales-offline-account-filter .matrix-store-options { gap: 4px 12px; }
.daily-sales-offline-account-filter .matrix-store-options label { white-space: nowrap; }
.daily-sales-offline-account-filter .matrix-store-options label:first-child { margin-right: 2px; padding-right: 12px; border-right: 1px solid #d8e1ea; font-weight: 600; }
.table-column-settings-trigger { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; margin-left: auto; padding: 6px 9px; color: #40546a; background: #fff; border: 1px solid #cbd7e5; border-radius: 5px; font-size: 13px; white-space: nowrap; cursor: pointer; }
.table-column-settings-trigger:hover { color: #1479c9; border-color: #7ca8db; background: #f5f9ff; }
.table-column-settings-trigger svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.daily-sales-compare-trigger { flex: 0 0 auto; margin-left: auto; padding: 6px 12px; border: 1px solid #a9dec7; border-radius: 5px; background: #e5f7ed; color: #176d48; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.daily-sales-compare-trigger:hover:not(:disabled) { background: #d4f0e1; border-color: #72c9a2; }
.daily-sales-compare-trigger:disabled { opacity: .54; cursor: not-allowed; }
.daily-sales-compare-trigger + .table-column-settings-trigger { margin-left: 0; }
.daily-sales-compare-dialog { position: absolute; top: 16px; bottom: auto; width: min(1520px, calc(100vw - 32px)); max-width: none; max-height: none; box-sizing: border-box; margin: 0 auto; overflow: visible; padding: 0; border: 1px solid #d5e3e0; border-radius: 12px; background: #fff; box-shadow: 0 24px 70px rgba(22, 44, 43, .24); color: #263a45; }
.daily-sales-compare-dialog[open] { display: flex; flex-direction: column; }
.daily-sales-compare-dialog::backdrop { background: rgba(23, 38, 48, .4); }
.daily-sales-compare-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 14px 10px; border-bottom: 1px solid #e3ecea; }
.daily-sales-compare-head h2 { margin: 0; font-size: 20px; }
.daily-sales-compare-head p { margin: 6px 0 0; color: #607582; font-size: 13px; }
.daily-sales-compare-product-heading { display: flex; align-items: stretch; gap: 10px; min-width: 0; }
.daily-sales-compare-product-photo { position: relative; flex: 0 0 auto; aspect-ratio: 3 / 4; align-self: stretch; overflow: hidden; border-radius: 5px; background: #f2f6f5; }
.daily-sales-compare-dialog .daily-sales-compare-product-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; cursor: default; }
.daily-sales-compare-product-text { min-width: 0; }
.daily-sales-compare-product-text p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daily-sales-compare-close { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 6px; background: #f2f6f5; color: #526875; cursor: pointer; }
.daily-sales-compare-close svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.daily-sales-compare-content { min-width: 0; overflow: visible; padding: 12px 14px 14px; }
.daily-sales-other-stores { align-self: center; margin-top: 6px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: #2461ae; font-size: 12px; cursor: pointer; }
.daily-sales-other-stores:hover { background: transparent; color: #174b8c; text-decoration: underline; }
.sales-hierarchical-table:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"]) .sales-stock-status,
.other-store-sales-dialog .sales-stock-status { color: #4b5563; }
.other-store-sales-dialog { position: fixed; inset: 20px; width: min(1480px, calc(100vw - 40px)); max-height: calc(100dvh - 40px); margin: auto; overflow: hidden; }
.other-store-sales-dialog .daily-sales-compare-head { flex: 0 0 auto; }
.other-store-sales-content { min-height: 0; overflow: auto; padding: 12px 14px 16px; }
.other-store-sales-note { margin: 0 0 10px; color: #64748b; font-size: 12px; }
.other-store-sales-table-wrap { overflow: auto; border: 1px solid #dce5eb; border-radius: 8px; }
.other-store-sales-table { width: 100%; min-width: 1280px; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.other-store-sales-table th, .other-store-sales-table td { padding: 8px 6px; border-right: 1px solid #dfe5ea; border-bottom: 1px solid #dfe5ea; text-align: center; }
.other-store-sales-table thead th { background: #f4f6f8; color: #40546a; font-weight: 500; white-space: nowrap; }
.other-store-sales-table thead tr:first-child th { background: #edf3fb; font-weight: 600; }
.other-store-sales-table thead tr:first-child th:first-child { width: 160px; }
.other-store-sales-table thead tr:first-child th:nth-child(2) { width: 190px; }
.other-store-sales-table .other-sales-group-end, .other-store-sales-table .other-store-sales-sku { border-right: 1px solid #4f83c2; }
.other-store-sales-table tr > :last-child { border-right: 0; }
.other-store-sales-summary > td { background: #f2f7ff; font-weight: 600; }
.other-store-sales-table .other-store-sales-product { padding: 12px 8px; font-weight: 400; }
.other-store-sales-product img { width: 80px; height: 100px; object-fit: cover; align-self: center; border-radius: 5px; }
.other-store-sales-product small { display: block; color: #718497; }
.other-store-sales-table .other-store-sales-sku { text-align: left; }
.other-store-sales-sku .sales-size-tier { margin-left: 6px; }
.other-store-sales-sku small { font-size: 11px; }
.other-store-sales-badge { align-self: flex-start; padding: 3px 9px; border-radius: 4px; background: #dcecff; color: #235dac; font-weight: 600; }
.other-store-sales-badge.is-current-store { background: #ffedd5; color: #c2410c; }
.pending-sku-badge { margin-left: 5px; padding: 1px 5px; border-radius: 9px; background: #fee2e2; color: #b91c1c; font-size: 11px; }
.pending-sku-count { color: #64748b; font-size: 13px; }
.pending-sku-count strong { color: #c2410c; }
.pending-sku-table td { vertical-align: middle; }
.pending-sku-table th:first-child { width: 210px; }
.pending-sku-table td:first-child { white-space: nowrap; font-size: 13px; }
.pending-sku-status { display: inline-block; padding: 3px 7px; border-radius: 4px; background: #ffedd5; color: #c2410c; }
.pending-sku-status.is-ready { background: #dbeafe; color: #1d4ed8; }
.pending-sku-reason { display: block; margin-top: 5px; max-width: 450px; color: #64748b; overflow-wrap: anywhere; }
.daily-sales-compare-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.daily-sales-compare-kpis > div { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 1px solid #dce8e4; border-radius: 8px; background: #f9fcfa; cursor: default; }
.daily-sales-compare-kpis > div:focus-visible { outline: 2px solid #4db68b; outline-offset: 2px; }
.daily-sales-compare-kpis span { color: #617582; font-size: 13px; }
.daily-sales-compare-kpis strong { color: #1c3a35; font-size: 23px; line-height: 1.2; }
.daily-sales-compare-target-card label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.daily-sales-compare-target-label { white-space: nowrap; }
.daily-sales-compare-target-label small { font-size: 12px; font-weight: 400; color: #80938b; }
.daily-sales-compare-target-control { display: flex; align-items: center; gap: 5px; min-width: 0; }
.daily-sales-compare-dialog .daily-sales-compare-target-control .daily-sales-compare-target-input { flex: 1; width: 0; }
.daily-sales-compare-calculate { flex: 0 0 auto; height: 30px; padding: 0 8px; border: 1px solid #8bc7aa; border-radius: 5px; background: #dbf2e5; color: #215b48; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.daily-sales-compare-calculate:hover { background: #cfeadb; }
.daily-sales-compare-calculate:focus-visible { outline: 2px solid #4caa7d; outline-offset: 2px; }
.daily-sales-compare-order-total { text-align: center; }
.daily-sales-compare-dialog .daily-sales-compare-order-input { display: block; width: 100%; min-width: 0; box-sizing: border-box; height: 28px; padding: 3px 4px; border: 1px solid #b8d9c9; border-radius: 5px; background: #fff; color: #215b48; font: inherit; font-weight: 600; text-align: center; }
.daily-sales-compare-dialog .daily-sales-compare-order-input:focus { border-color: #4caa7d; outline: 2px solid rgba(76, 170, 125, .18); outline-offset: 1px; }
.daily-sales-compare-dialog .daily-sales-compare-target-input { height: 30px; font-size: 20px; line-height: 1.2; }
.daily-sales-compare-table-wrap .daily-sales-compare-order-cell { padding: 3px; cursor: default; }
.daily-sales-compare-dialog .daily-sales-compare-table-wrap .daily-sales-compare-order-input { font-weight: 400; }
.daily-sales-compare-dialog .daily-sales-compare-days { color: #1479c9; font-weight: 700; }
.daily-sales-compare-dialog .daily-sales-compare-days-input { display: block; width: 100%; min-width: 0; box-sizing: border-box; height: 28px; padding: 3px 4px; border: 1px solid #b8d9c9; border-radius: 5px; background: #fff; font: inherit; color: #1479c9; text-align: center; }
.daily-sales-compare-dialog .daily-sales-compare-days-input:focus { border-color: #4caa7d; outline: 2px solid rgba(76, 170, 125, .18); outline-offset: 1px; }
.daily-sales-compare-table-wrap .daily-sales-compare-days-cell { padding: 3px; text-align: center; cursor: default; }
.daily-sales-compare-section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; margin: 14px 0 8px; }
.daily-sales-compare-section-head h3 { margin: 0; font-size: 16px; }
.daily-sales-compare-section-head span { color: #6a7d86; font-size: 12px; }
.daily-sales-compare-toggle-all { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 0; border: 0; border-radius: 0; background: transparent; color: #2461ae; font: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; }
.daily-sales-compare-toggle-all span { color: inherit; }
.daily-sales-compare-toggle-all svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.daily-sales-compare-toggle-all:hover:not(:disabled) { background: transparent; color: #174b8c; text-decoration: underline; }
.daily-sales-compare-toggle-all:focus-visible { outline: 2px solid #93c5fd; outline-offset: 3px; }
.daily-sales-compare-toggle-all:disabled { opacity: .5; cursor: default; }
.daily-sales-compare-table-wrap { overflow-x: auto; max-height: none; border: 1px solid #d8e5e1; border-radius: 8px; }
.daily-sales-compare-table-wrap > table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px; text-align: right; }
.daily-sales-compare-table-wrap th, .daily-sales-compare-table-wrap td { padding: 5px 3px; border-left: 1px solid #e7eeeb; border-right: 1px solid #e7eeeb; border-bottom: 1px solid #e7eeeb; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.daily-sales-compare-table-wrap thead th { position: sticky; top: 0; z-index: 1; background: #dbf2e5; color: #41665a; font-weight: 600; }
.daily-sales-compare-table-wrap > table > thead > tr > th:first-child { position: sticky; left: 0; z-index: 3; width: 80px; min-width: 0; text-align: left; }
.daily-sales-compare-table-wrap > table > tbody > tr > th:first-child { position: sticky; left: 0; z-index: 2; width: 80px; min-width: 0; background: #fff; text-align: left; }
.daily-sales-compare-table-wrap > table > tbody > .daily-sales-compare-grand-total > th:first-child { background: #fff; }
.daily-sales-compare-table-wrap > table > tbody > .daily-sales-compare-size-row > th:first-child { background: #eff7f3; }
.daily-sales-compare-table-wrap > table > thead > tr > th:nth-child(9), .daily-sales-compare-table-wrap > table > tbody > tr > td:nth-child(9), .daily-sales-compare-table-wrap > table > thead > tr > th:nth-child(12), .daily-sales-compare-table-wrap > table > tbody > tr > td:nth-child(12), .daily-sales-compare-table-wrap > table > thead > tr > th:nth-child(15), .daily-sales-compare-table-wrap > table > tbody > tr > td:nth-child(15), .daily-sales-compare-table-wrap > table > thead > tr > th:last-child, .daily-sales-compare-table-wrap > table > tbody > tr > td:last-child { border-left: 2px solid #d2e8dc; }
/* 已有分隔线由右侧单元格绘制，避免新增的相邻边框使它变粗。 */
.daily-sales-compare-table-wrap > table > :is(thead, tbody) > tr > :is(th, td):is(:nth-child(8), :nth-child(11), :nth-child(14), :nth-child(17)) { border-right: 0; }
.daily-sales-compare-table-wrap tbody th strong { display: block; }
.daily-sales-compare-table-wrap tbody th small { display: block; margin-top: 3px; color: #71818c; font-weight: 400; }
.daily-sales-compare-table-wrap .daily-sales-compare-subtotal { background: #f2f8f5; font-weight: 600; }
.daily-sales-compare-table-wrap .daily-sales-compare-grand-total { background: transparent; color: #155b3d; font-weight: 700; }
.daily-sales-compare-size-row { background: #eff7f3; color: #215b48; font-weight: 600; }
.daily-sales-compare-size-row.is-expandable { cursor: pointer; }
.daily-sales-compare-table-wrap .daily-sales-compare-group-gap > td { height: 10px; padding: 0 !important; border: 0 !important; background: #fff; font-size: 0; line-height: 0; }
.daily-sales-compare-size-group > .daily-sales-compare-size-row > :is(th, td) { border-top: 1px solid #c8dfd4; }
.daily-sales-compare-size-group > tr:nth-last-child(1 of :not([hidden])) > :is(th, td) { border-bottom: 1px solid #c8dfd4; }
.daily-sales-compare-size-group > tr:not(.daily-sales-compare-group-gap) > th:first-child { border-left: 1px solid #c8dfd4; }
.daily-sales-compare-size-group > tr:not(.daily-sales-compare-group-gap) > td:last-child { border-right: 1px solid #c8dfd4; }
.daily-sales-compare-expand { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: #215b48; font: inherit; font-weight: 700; cursor: pointer; }
.daily-sales-compare-expand::before { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }
.daily-sales-compare-expand[aria-expanded="true"]::before { transform: rotate(45deg); }
.daily-sales-compare-store-row[hidden] { display: none; }
.daily-sales-compare-store-row { background: transparent; }
.daily-sales-compare-table-wrap > table > tbody > .daily-sales-compare-store-row > th:first-child { padding-left: 14px; background: #fff; color: #456a5c; font-weight: 600; }
.daily-sales-compare-store-row.is-store-focused,
.daily-sales-compare-table-wrap > table > tbody > .daily-sales-compare-store-row.is-store-focused > :is(th, td) { background: #ffedd5; }
.daily-sales-compare-shared-mark { display: inline-block; margin-left: 2px; color: #7e978c; font-size: 10px; font-weight: 400; }
.daily-sales-compare-note { margin: 8px 0 0; color: #647784; font-size: 12px; }
@media (max-width: 1365px) {
  .daily-sales-compare-table-wrap > table { min-width: 0; table-layout: fixed; font-size: 12px; }
  .daily-sales-compare-table-wrap th, .daily-sales-compare-table-wrap td { padding: 5px 3px; }
  .daily-sales-compare-table-wrap thead th { overflow: visible; text-overflow: clip; white-space: normal; word-break: break-all; line-height: 1.25; }
  .daily-sales-compare-table-wrap > table > thead > tr > th:first-child,
  .daily-sales-compare-table-wrap > table > tbody > tr > th:first-child { width: 80px; min-width: 0; }
}
@media (max-width: 1100px) { .daily-sales-compare-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.daily-sales-compare-dialog .daily-sales-compare-table-wrap > table { min-width: var(--compare-table-min-width) !important; }
.daily-sales-compare-dialog .daily-sales-compare-table-wrap thead th { white-space: nowrap; word-break: normal; overflow-wrap: normal; }
.daily-sales-compare-dialog .daily-sales-compare-table-wrap :is(th, td) { text-align: center !important; vertical-align: middle; }
.daily-sales-compare-dialog .daily-sales-compare-table-wrap > table > tbody > .daily-sales-compare-store-row > th:first-child { padding-left: 3px; }
.daily-sales-compare-dialog .daily-sales-compare-expand { justify-content: center; }
@media (max-width: 820px) { .daily-sales-compare-dialog { width: calc(100vw - 16px); } .daily-sales-compare-content { padding: 12px; } .daily-sales-compare-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.table-column-settings-popover { position: fixed; z-index: 1000; max-height: min(640px, calc(100vh - 16px)); overflow: auto; box-sizing: border-box; padding: 16px; background: #fff; border: 1px solid #d7e1ed; border-radius: 8px; box-shadow: 0 12px 30px rgba(33, 56, 83, .2); color: #35465a; }
.table-column-settings-popover > strong { display: block; margin-bottom: 10px; font-size: 14px; }
.table-column-setting-list { display: grid; gap: 3px; }
.table-column-setting-group { padding: 4px 0; border-bottom: 1px solid #edf1f5; }
.table-column-setting-group:last-child { border-bottom: 0; }
.table-column-setting-parent, .table-column-setting-parent > label, .table-column-setting-children label { display: flex; align-items: center; gap: 8px; min-height: 28px; cursor: pointer; }
.table-column-setting-parent { justify-content: space-between; font-weight: 600; }
.table-column-setting-expand { width: 26px; height: 26px; padding: 0; border: 0; background: transparent; cursor: pointer; position: relative; }
.table-column-setting-expand::after { content: ''; position: absolute; left: 8px; top: 8px; width: 8px; height: 8px; border-right: 1.5px solid #62788f; border-bottom: 1.5px solid #62788f; transform: rotate(45deg); transition: transform .15s ease; }
.table-column-setting-expand[aria-expanded="true"]::after { top: 11px; transform: rotate(225deg); }
.table-column-setting-children { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 2px 0 3px 26px; }
.table-column-setting-children[hidden] { display: none; }
.table-column-setting-parent input, .table-column-setting-children input { width: 15px; height: 15px; margin: 0; accent-color: #009c98; }
.table-column-setting-children label { font-size: 13px; color: #617386; }
.table-column-setting-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.table-column-setting-actions button { padding: 6px 12px; border: 1px solid #b8c6d5; border-radius: 4px; color: #40546a; background: #fff; cursor: pointer; }
.table-column-setting-actions .primary { color: #fff; background: #009c98; border-color: #009c98; }
.matrix-search-grid .listing-filter-actions { grid-column: 4; grid-row: 1; }
.query-toolbar-grid .listing-filter-actions { grid-column: 4; grid-row: 1; }
.sales-query-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sales-query-toolbar > .sales-sku-filter { flex: 0 1 320px; min-width: 220px; }
.sales-query-toolbar > .sales-filter-multi { flex: 0 1 190px; min-width: 170px; }
.sales-query-toolbar > .sales-range-filter { flex: 0 1 230px; min-width: 210px; }
.sales-date-controls { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto; }
.sales-date-controls .sales-period-actions { flex: 0 0 auto; }
.sales-date-controls .generic-date-range { flex: 0 1 430px; width: 430px; min-width: 360px; }
.sales-query-toolbar > .listing-filter-actions { flex: 0 0 auto; margin-left: auto; }
@container (max-width: 1300px) {
  .sales-query-toolbar { flex-wrap: wrap; }
  .sales-query-toolbar > .sales-sku-filter { flex-basis: 300px; }
  .sales-query-toolbar > .sales-filter-multi { flex-basis: 220px; }
  .sales-query-toolbar > .sales-range-filter { flex-basis: 240px; }
  .sales-date-controls { flex: 1 1 600px; }
}
.daily-sales-import-page-toolbar { grid-template-columns: minmax(260px, 520px) minmax(220px, 360px) auto; justify-content: start; }
.daily-sales-import-page-toolbar .listing-filter-actions { grid-column: 3; grid-row: 1; justify-content: flex-start; }
.query-toolbar-grid:has(#skuImportFile) { grid-template-columns: minmax(260px, 520px) minmax(220px, 360px) auto; justify-content: start; }
.query-toolbar-grid:has(#listingImportFile) { grid-template-columns: minmax(300px, 520px) minmax(190px, 300px) minmax(190px, 300px) auto; justify-content: start; }
.query-toolbar-grid:has(#batchDelistFile) { grid-template-columns: minmax(300px, 560px) minmax(190px, 300px) auto; justify-content: start; }
.daily-sales-file-filter { min-width: 0; }
.daily-sales-file-filter { display: flex; align-items: center; }
.daily-sales-file-control { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; flex: 1; }
.daily-sales-file-control button.daily-sales-choose-file { height: 30px; padding: 4px 12px; background: #5f98e5; border-color: #5f98e5; color: #fff; }
.daily-sales-file-control button.daily-sales-choose-file:hover { background: #4b87d8; border-color: #4b87d8; }
.daily-sales-file-control button.daily-sales-clear-file { flex: 0 0 auto; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: #e8eef6; color: #60758d; font-size: 18px; line-height: 22px; }
.daily-sales-file-control button.daily-sales-clear-file:hover { background: #d8e3f0; color: #1f5f9f; }
.daily-sales-file-control.is-dragging { outline: 2px dashed #5f98e5; outline-offset: 2px; background: #e8f2ff; }
.daily-sales-file-control em { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-style: normal; }
.listing-filter-actions { display: flex; justify-content: flex-end; gap: 8px; align-items: center; min-width: 0; white-space: nowrap; }
.listing-filter-actions button { flex: 0 0 auto; white-space: nowrap; }
.listing-export-progress[hidden] { display: none !important; }
.listing-export-progress { width: 100%; margin: 0 0 14px; }
.listing-export-progress-track { width: 100%; height: 7px; overflow: hidden; border-radius: 4px; background: #dfe7f0; }
.listing-export-progress i { display: block; width: var(--export-progress, 0%); height: 100%; border-radius: inherit; background: var(--blue); transition: width .15s ease; }
.listing-more-button { display: inline-flex; align-items: center; gap: 8px; }
.listing-more-button b { width: 9px; height: 9px; border-right: 1.6px solid var(--text); border-bottom: 1.6px solid var(--text); transform: rotate(45deg); margin-top: -5px; }
.listing-toolbar-grid.expanded .listing-more-button b { transform: rotate(225deg); margin-top: 5px; }
.listing-filter { height: 38px; padding: 0 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--gray-bg); transition: border-color .15s, background .15s, box-shadow .15s; }
.listing-toolbar-grid .listing-filter { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.listing-filter:focus-within, .listing-filter:hover { background: #fff; border-color: #58aeb2; box-shadow: 0 0 0 2px rgba(22,131,95,.12); }
.listing-filter > span:first-child { white-space: nowrap; color: var(--text); font-weight: 600; }
.listing-filter input, .listing-filter select { height: 30px; min-width: 150px; border: 0; outline: 0; border-radius: 0; padding: 4px 6px; background: transparent; }
.listing-filter select { background-color: transparent; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23172026' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 6px center; padding-right: 24px; }
.listing-filter select { position: relative; z-index: 2; cursor: pointer; pointer-events: auto; appearance: none; -webkit-appearance: none; }
.listing-filter > input, .listing-filter > select { flex: 1 1 auto; width: auto; min-width: 0; color: var(--text); }
.listing-filter input::placeholder { color: #9aa5ad; }
.listing-filter select[multiple] { height: 30px; min-height: 30px; }
.multi-select { position: relative; padding: 0; z-index: 5; }
.multi-select > button { width: 100%; height: 100%; border: 0; background: transparent; display: flex; align-items: center; gap: 8px; padding: 0 9px; font: inherit; cursor: pointer; }
.multi-select > button span { color: var(--text); font-weight: 600; }
.multi-select > button em { flex: 1; text-align: left; color: #9aa5ad; font-style: normal; }
.multi-select > button b { width: 9px; height: 9px; margin: -5px 3px 0 0; border-right: 1.6px solid var(--text); border-bottom: 1.6px solid var(--text); transform: rotate(45deg); flex: 0 0 auto; }
.inventory-account-picker { min-width: 260px; max-width: 420px; height: 38px; }
.inventory-account-picker > button em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inventory-account-picker .multi-options label { justify-content: flex-start; gap: 5px; min-height: 32px; padding: 4px 10px; width: auto; }
.inventory-account-picker .multi-options input[type="checkbox"] { width: 18px; min-width: 18px; height: 18px; flex: 0 0 18px; margin: 0; padding: 0; accent-color: var(--green); }
.multi-options { display: none; position: absolute; left: -1px; right: -1px; top: calc(100% + 5px); padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 20px rgba(23,32,38,.16); }
.multi-select.open .multi-options { display: grid; gap: 2px; }
.multi-options label { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 4px; color: var(--text); cursor: pointer; }
.multi-options label:hover { background: var(--gray-bg); }
.multi-options input { width: 18px; height: 18px; accent-color: var(--green); }
.form-multi-select { position: relative; display: grid; align-self: start; gap: 6px; min-width: 0; z-index: 5; }
.form-multi-select > .field-label { color: var(--muted); font-size: 13px; line-height: 1.2; }
.form-multi-trigger { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 38px; min-height: 38px; box-sizing: border-box; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.form-multi-trigger span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-multi-trigger b { width: 9px; height: 9px; margin: -5px 3px 0 8px; border-right: 1.6px solid var(--text); border-bottom: 1.6px solid var(--text); transform: rotate(45deg); flex: 0 0 auto; }
.form-multi-select.open .form-multi-trigger { background: #fff; border-color: #58aeb2; }
.form-multi-select.open .form-multi-trigger b { margin-top: 5px; transform: rotate(225deg); }
.form-multi-options { display: none; z-index: 20; max-height: 260px; padding: 6px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 8px 20px rgba(23,32,38,.16); }
.form-multi-select.open .form-multi-options { display: grid; position: fixed; gap: 2px; }
.form-multi-options label { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 7px 10px; border-radius: 4px; color: var(--text); cursor: pointer; }
.form-multi-options label:hover { background: var(--gray-bg); }
.form-multi-options input { width: 18px; height: 18px; accent-color: var(--green); }
.toolbar > label input, .toolbar > label select { min-width: 180px; }
.toolbar > label select[multiple] { min-height: 40px; }
.listing-more-filters { display: contents; }
.listing-more-filters[hidden] { display: none; }
.listing-more-filters > .listing-filter { grid-row: 2; }
.listing-more-filters > .listing-filter.listing-more-third-row { grid-row: 3; }
.listing-filter-actions { grid-column: 4; grid-row: 2; }
.listing-toolbar-grid.expanded .listing-filter-actions { grid-row: 2; }
.listing-more-filters label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
/* 各店铺推款记录：默认两行七项筛选；展开后操作区独占最下一行右侧。 */
.listing-records-toolbar .listing-records-filter-1 { grid-column: 1; grid-row: 1; }
.listing-records-toolbar .listing-records-filter-2 { grid-column: 2; grid-row: 1; }
.listing-records-toolbar .listing-records-filter-3 { grid-column: 3; grid-row: 1; }
.listing-records-toolbar .listing-records-filter-4 { grid-column: 4; grid-row: 1; }
.listing-records-toolbar .listing-records-filter-5 { grid-column: 1; grid-row: 2; }
.listing-records-toolbar .listing-records-filter-6 { grid-column: 2; grid-row: 2; }
.listing-records-toolbar .listing-records-filter-7 { grid-column: 3; grid-row: 2; }
.listing-records-toolbar:not(.expanded) .listing-filter-actions { grid-column: 4; grid-row: 2; }
.listing-records-toolbar.expanded .listing-records-filter { grid-column: auto; grid-row: auto; }
.listing-records-toolbar.expanded .listing-more-filters > .listing-filter { grid-row: auto; }
.listing-records-toolbar.expanded .listing-filter-actions { grid-column: 3 / 5; grid-row: 3; justify-content: flex-end; }
.range-fields { display: flex; flex: 1; min-width: 0; align-items: center; justify-content: center; gap: 5px; }
.range-fields b { flex: 0 0 12px; text-align: center; color: var(--muted); }
.range-fields input { flex: 1; width: auto; min-width: 0; text-align: center; }
.wide-search { width: min(520px, 48vw); }
.push-right { margin-left: auto; }
.form-static {
  color: var(--text);
  line-height: 1.7;
  background: #f6f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
}
input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  background: #fff;
}
select { appearance: none; -webkit-appearance: none; background-color: #fff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23172026' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.inline-field {
  display: flex;
  align-items: center;
  gap: 10px;
}
.inline-field input { flex: 1; min-width: 0; }
.field-hint {
  min-width: 92px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.field-block {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.field-label { color: var(--muted); }
.radio-row {
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 38px;
}
.radio-field {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  white-space: nowrap;
  flex: 0 0 auto;
}
.radio-field input {
  width: 16px;
  height: 16px;
}
button {
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
button.ghost {
  background: #eef3f7;
  color: var(--text);
}
button.danger { background: var(--danger); }
button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 0 0;
  color: var(--muted);
}
.pagination-jump { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.pagination-jump input { width: 58px; height: 32px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; text-align: center; background: #fff; }
.pagination-jump input::-webkit-outer-spin-button,
.pagination-jump input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pagination-jump input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.pagination-jump button { padding: 6px 9px; }
.import-file-example { color: var(--danger); font-weight: 400; }
.page-note a[href*="seller.tiktokshopglobalselling.com"] { color: var(--blue); text-decoration: underline; }
.pagination select {
  width: auto;
  min-width: 112px;
}

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}
table { width: 100%; border-collapse: collapse; min-width: 760px; table-layout: fixed; }
.data-table.matrix th:first-child, .data-table.matrix td:first-child { width: 200px; min-width: 200px; white-space: nowrap; }
.data-table.table-matrix th:first-child, .data-table.table-matrix td:first-child { width: 130px; min-width: 130px; white-space: nowrap; }
th, td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
th {
  background: #f0f4f7;
  font-weight: 700;
  position: relative;
  user-select: none;
}
.th-sort {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 700;
}
.col-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 4;
}
.col-resizer:hover { background: rgba(37, 99, 235, .18); }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--gray-bg); }
.image-clickable, img[src*="/uploads/"] { cursor: zoom-in; }
.image-lightbox { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 50px; background: rgba(0, 0, 0, .62); }
.image-lightbox-filename { position: absolute; top: 18px; left: 24px; max-width: calc(100vw - 100px); color: #fff; font-size: 14px; line-height: 1.4; word-break: break-all; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.image-lightbox img { max-width: min(90vw, 1100px); max-height: 88vh; object-fit: contain; box-shadow: 0 18px 60px rgba(0,0,0,.3); }
.image-lightbox-close { position: absolute; top: 18px; right: 24px; width: 42px; height: 42px; padding: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: #172026; font-size: 30px; line-height: 1; }
.password-dialog { width: min(420px, 90vw); }
.password-dialog form { padding: 24px; }
.password-dialog h2 { margin: 0 0 8px; }
.password-dialog p { margin: 0 0 16px; }
.page-form { max-width: 900px; margin: 28px auto; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.page-form-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.page-form-head h2 { margin: 0; font-size: 24px; }
.page-form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.form-error { color: #c24135; font-size: 13px; padding: 8px 0; }
.input-invalid { border-color: #c24135 !important; box-shadow: 0 0 0 1px #c24135; }
.input-error-mark { color: #c24135; font-weight: 700; margin-left: 5px; }
.label-error { color: #c24135; font-size: 12px; font-weight: 400; margin-left: 8px; }
.page-form .form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.page-form .form-grid > label:not(.full), .page-form .form-grid > .field-block:not(.full) { min-width: 0; width: 100%; }
.page-form .form-grid > label:not(.full) input, .page-form .form-grid > label:not(.full) select { width: 100%; min-width: 0; }
.page-form .form-grid > .field-block:not(.full) .radio-row { flex-wrap: wrap; }
.sku-price-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: end; }
.sku-price-row > label { min-width: 0; }
.sku-meta-row { display: flex; gap: 18px; min-width: 0; }
.sku-price-row > .sku-meta-row, .sku-meta-row > .field-block { min-width: 0; }
.sku-price-row > label input { width: 100%; min-width: 0; box-sizing: border-box; }
.sku-create-details-row { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.125fr) minmax(0, 1.125fr); gap: 14px; align-items: end; }
.sku-create-details-row > label { min-width: 0; }
.sku-create-details-row input, .sku-create-details-row select { width: 100%; min-width: 0; box-sizing: border-box; }
.sku-create-details-row .input-clear-wrap { min-width: 0; }
.catalog-upload-controls, .catalog-detail-toolbar, .catalog-confirm { display:flex; gap:14px; align-items:center; flex-wrap:wrap; }
.catalog-upload-controls label, .catalog-detail-toolbar label { display:grid; gap:6px; }
.catalog-upload-controls .daily-sales-file-filter { display:flex; align-items:center; gap:10px; flex:1 1 360px; min-width:0; }
.catalog-store-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(420px,1fr)); gap:14px; margin:16px 0; }
.catalog-store-card { border:1px solid var(--line); border-left:4px solid var(--green); border-radius:10px; padding:14px; min-width:0; }
.catalog-store-card.is-blocked { border-left-color:#c68413; }
.catalog-store-heading { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; }
.catalog-store-heading input, .catalog-confirm input { width:auto; }
.catalog-store-stats { display:flex; gap:12px; flex-wrap:wrap; margin:12px 0; font-size:13px; }
.catalog-store-stats b { font-size:15px; }
.catalog-store-card li { margin:6px 0; overflow-wrap:anywhere; }
.catalog-store-actions { display:flex; gap:14px; align-items:center; margin-top:12px; }
.catalog-mapping { display:grid; gap:6px; margin-top:12px; }
.catalog-mapping span { display:flex; gap:6px; align-items:center; }
.catalog-mapping input[type="checkbox"] { width:auto; }
.catalog-sync-page .catalog-correction-row { display:flex; flex-direction:row; flex-wrap:wrap; align-items:center; justify-content:flex-start; gap:8px; margin:0; }
.catalog-correction-row > span { flex:0 0 auto; white-space:nowrap; }
.catalog-replacement-arrow { flex:0 0 18px; color:var(--muted); }
.catalog-sync-page .catalog-correction-row > input { box-sizing:border-box; width:200px; min-width:200px; max-width:200px; flex:0 0 200px; padding:8px 10px; }
.catalog-sync-page .catalog-ignore-choice { display:flex; flex-direction:row; align-items:center; gap:6px; margin:0; }
.catalog-sync-page .catalog-ignore-choice > input { flex:0 0 auto; margin:0; }

.catalog-confirm { padding:16px; border:1px solid var(--line); border-radius:10px; margin:16px 0; background:var(--gray-bg); }
.catalog-sync-page .catalog-confirm > label { display:flex; flex-direction:row; align-items:flex-start; gap:8px; flex:1 1 300px; min-width:0; margin:0; }
.catalog-sync-page .catalog-confirm > label > input { width:14px; height:14px; min-width:14px; flex:0 0 14px; margin:5px 0 0; padding:0; }
.catalog-sync-page .catalog-confirm > label > span { flex:1; min-width:0; font-size:16px; line-height:1.5; color:var(--text); }
.catalog-confirm > button { flex:0 0 auto; margin-left:auto; }
.catalog-detail-toolbar { margin:16px 0; }
.catalog-change-table { min-width:1400px; }
.catalog-history { margin-top:24px; }
.catalog-history summary { cursor:pointer; margin-bottom:12px; font-weight:600; }
.catalog-json-detail { max-height:440px; overflow:auto; white-space:pre-wrap; background:var(--gray-bg); padding:14px; }

@media (max-width:700px) { .catalog-store-grid { grid-template-columns:minmax(0,1fr); } .catalog-confirm { align-items:stretch; } }
@media (max-width: 700px) {
  .sku-create-details-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
.sku-meta-row > .field-block { flex: 0 0 auto; }
.sku-price-row .radio-row { flex-wrap: nowrap; gap: 8px; white-space: nowrap; }
.sku-meta-row .radio-row { width: max-content; max-width: 100%; }
.sku-price-row .radio-field { gap: 4px; }
.page-form .form-grid > label.full .radio-row { flex-wrap: wrap; }
.profile-page { max-width: 1080px; }
.profile-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 18px; }
.profile-card { display: grid; gap: 14px; align-content: start; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.profile-card h3 { margin: 0; font-size: 18px; color: var(--text); }
.profile-card label { width: 100%; }
.profile-card input, .profile-card textarea { width: 100%; }
.profile-card input:disabled { background: var(--gray-bg); color: var(--muted); }
.profile-card textarea { min-height: 104px; resize: vertical; }
.profile-avatar-row { display: flex; align-items: center; gap: 18px; padding-bottom: 6px; }
.profile-avatar { width: 104px; height: 104px; flex: 0 0 104px; overflow: hidden; display: grid; place-items: center; border-radius: 8px; background: #eaf1f5; color: var(--blue); font-size: 38px; font-weight: 700; border: 1px solid var(--line); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-avatar-cell { text-align: center; }
.admin-list-avatar { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; display: inline-grid; place-items: center; vertical-align: middle; background: #e8eef3; color: #52687a; font-size: 16px; font-weight: 600; }
.admin-list-avatar-fallback { border-radius: 50%; }
.profile-avatar-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.profile-avatar-controls strong { width: 100%; color: var(--text); font-size: 15px; }
.profile-avatar-controls p { width: 100%; margin: 0 0 2px; font-size: 12px; }
.profile-upload-button { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 8px 12px; cursor: pointer; }
.profile-upload-button input { display: none; }
.profile-note { margin: -4px 0 2px; font-size: 13px; }
.avatar-picker-backdrop { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); background: rgba(23,32,38,.48); }
.avatar-picker-backdrop[hidden] { display: none !important; }
.avatar-picker { width: min(900px, 96vw); max-height: min(720px, 90vh); max-height: min(720px, 90dvh); overflow: hidden; display: flex; flex-direction: column; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 24px 80px rgba(0,0,0,.25); }
.avatar-picker-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.avatar-picker-head h3 { margin: 0; font-size: 20px; }
.avatar-picker-head p { margin: 5px 0 0; font-size: 13px; }
.avatar-picker-close { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--gray-bg); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; }
.qq-avatar-grid { display: grid; grid-template-columns: repeat(15, minmax(36px, 1fr)); gap: 5px; overflow: auto; padding: 12px 2px; }
.qq-avatar-option { aspect-ratio: 1; min-width: 0; padding: 3px; border: 2px solid transparent; border-radius: 7px; background: #f3f6f8; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.qq-avatar-option:hover, .qq-avatar-option:focus-visible { border-color: #58aeb2; background: #e8f4f3; transform: translateY(-1px); outline: 0; }
.qq-avatar-option img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 4px; image-rendering: auto; }
.avatar-picker-loading { grid-column: 1 / -1; min-height: 160px; display: grid; place-items: center; color: var(--muted); }
.avatar-picker-actions { display: flex; justify-content: flex-end; padding-top: 12px; border-top: 1px solid var(--line); }
.sale-category-field { width: 100%; }
.sale-category-row { width: 100%; min-height: 42px; align-items: center; flex-wrap: wrap; }
.style-half-field { min-width: 0; }
.style-half-field select { width: 100%; }
.input-clear-wrap { position: relative; display: flex; align-items: center; width: 100%; }
.input-clear-wrap > input, .input-clear-wrap > select { width: 100%; padding-right: 38px; }
.input-clear-wrap > select { padding-right: 62px; }
.input-clear-wrap > select + .input-clear-button { right: 34px; }
.input-clear-button { position: absolute; right: 8px; top: 50%; display: grid; place-items: center; width: 24px; height: 24px; min-height: 24px; padding: 0; transform: translateY(-50%); border: 0; border-radius: 0; background: transparent; color: #687280; font-size: 18px; line-height: 1; cursor: pointer; }
.input-clear-button:hover { background: transparent; color: var(--text); }
.copy-text-target { display: inline-flex; align-items: center; gap: 8px; color: inherit; cursor: pointer; }
.copy-text-target:hover { color: var(--blue); }
.relation-style-no.copy-text-target { width: fit-content; }
.relation-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 168px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.relation-summary-bundle { position: relative; }
.relation-summary-bundle .relation-type { position: absolute; top: 12px; left: 16px; z-index: 1; }
.relation-summary-bundle .relation-summary-style-row { padding-top: 30px; }
.relation-peer-group { display: block; min-height: 0; padding: 0; overflow: hidden; }
.relation-peer-head { display: flex; align-items: center; justify-content: flex-start; gap: 10px; min-height: 50px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #fafcfd; }
.relation-peer-head > div { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-width: 0; }
.relation-peer-head > div > strong { font-size: 15px; }
.relation-peer-head > div > span:last-child { color: var(--muted); font-size: 13px; }
.relation-peer-members { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 8px; min-width: 0; padding: 10px; }
.relation-peer-main-column { min-width: 0; height: 248px; }
.relation-peer-related-block { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 5px; min-width: 0; height: 248px; }
.relation-peer-related-title { color: var(--muted); font-size: 12px; font-weight: 700; }
.relation-peer-related-scroll { display: grid; grid-auto-rows: 70px; align-content: start; gap: 6px; min-width: 0; min-height: 0; padding-right: 3px; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; scrollbar-width: auto; }
.relation-peer-related-scroll::-webkit-scrollbar { width: 10px; }
.relation-peer-related-scroll::-webkit-scrollbar-thumb { border: 2px solid #fff; border-radius: 999px; background: #9aa5ad; }
.relation-peer-related-scroll::-webkit-scrollbar-track { background: var(--gray-bg); }
.relation-peer-member { display: flex; align-items: center; gap: 6px; min-width: 0; width: 100%; height: 70px; padding: 6px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.relation-peer-member:not(.relation-peer-primary) { width: 100%; min-width: 0; max-width: 100%; }
.relation-peer-member:hover { border-color: #b8c9d6; background: #fbfdff; }
.relation-peer-primary { flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 7px; border-color: #d8dee3; background: #f3f5f7; }
.relation-peer-photo { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; overflow: hidden; border-radius: 8px; background: var(--gray-bg); }
.relation-peer-primary .relation-peer-photo { width: min(100%, 100px); height: auto; aspect-ratio: 3 / 4; flex: 0 1 auto; border-radius: 7px; }
.relation-peer-photo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.relation-peer-photo-empty { color: var(--muted); font-size: 11px; }
.relation-peer-info { display: grid; gap: 3px; min-width: 0; }
.relation-peer-info strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.relation-peer-primary .relation-peer-info { justify-items: center; gap: 5px; text-align: center; }
.relation-peer-primary .relation-peer-info strong { font-size: 15px; }
.relation-peer-info > span { color: var(--muted); font-size: 10px; }
.relation-member-role { width: fit-content; padding: 2px 7px; border-radius: 999px; background: var(--gray-bg); color: var(--muted) !important; font-size: 11px !important; font-weight: 700; }
.relation-peer-primary .relation-member-role { background: #dfeaff; color: #2854a8 !important; }
.relation-summary-main { display: flex; align-items: center; gap: 20px; min-width: 0; }
.relation-summary-photo { display: grid; place-items: center; width: 104px; height: 104px; flex: 0 0 104px; overflow: hidden; border-radius: 8px; background: var(--gray-bg); color: var(--muted); font-size: 13px; }
.relation-summary-photo img { width: 100%; height: 100%; object-fit: cover; }
.relation-summary-info { min-width: 0; }
.relation-summary-info strong { margin-left: 10px; font-size: 22px; }
.relation-summary-info p { margin: 12px 0; color: var(--muted); font-size: 15px; }
.relation-summary-previews { display: flex; align-items: center; gap: 7px; }
.relation-summary-previews img, .relation-preview-empty { width: 40px; height: 40px; display: block; object-fit: cover; border-radius: 5px; background: var(--gray-bg); }
.relation-summary-skus { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.relation-summary-style-row { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; min-width: 0; }
.relation-summary-style-row .relation-summary-skus { display: inline-flex; flex: 0 1 auto; min-width: 0; margin-top: 0; }
.relation-sku-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid #c9dafa; border-radius: 5px; background: #f7faff; color: var(--text); font-size: 12px; line-height: 1.2; }
.relation-sku-tag:hover { border-color: var(--blue); color: var(--blue); }
.relation-style-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid #c9dafa; border-radius: 5px; background: #f7faff; color: var(--text); font-size: 12px; line-height: 1.2; }
.relation-style-tag:hover { border-color: var(--blue); color: var(--blue); }
.relation-sku-empty { color: var(--muted); font-size: 12px; }
.relation-view-button { flex: 0 0 auto; min-height: 34px; padding: 6px 11px; white-space: nowrap; font-size: 14px; }
.relation-drawer { display: none; position: fixed; inset: 0; z-index: 100; }
.relation-drawer.open { display: block; }
.relation-drawer-backdrop { position: absolute; inset: 0; background: rgba(23, 32, 38, .38); }
.relation-drawer-panel { position: absolute; top: 0; right: 0; display: flex; flex-direction: column; width: min(720px, 92vw); height: 100%; height: 100dvh; padding: 22px; overflow: hidden; background: #fff; box-shadow: -12px 0 30px rgba(23,32,38,.2); }
.relation-drawer-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.relation-drawer-panel h2, .relation-drawer-panel p { margin: 0; }
.relation-drawer-panel p { margin-top: 5px; color: var(--muted); font-size: 13px; }
.relation-drawer-close { width: 34px; height: 34px; padding: 0; background: transparent; color: var(--muted); font-size: 26px; }
.relation-drawer-body { display: flex; flex-direction: column; overflow-y: auto; padding-top: 16px; }
.relation-drawer-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.relation-drawer-actions { display: flex; justify-content: flex-end; margin-top: auto; padding: 18px 0 4px; position: sticky; bottom: 0; background: #fff; }
.relation-delete-group-button { border-color: #d94b45; background: #d94b45; color: #fff; }
.relation-delete-group-button:hover { border-color: #b93833; background: #b93833; }
.relation-drawer-main .relation-style-card { max-width: none; }
.relation-drawer-related { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.relation-drawer-related h3 { grid-column: 1 / -1; margin: 0; font-size: 16px; }
.relation-drawer-related .relation-style-card { min-width: 0; }
.relation-drawer-members { grid-template-columns: 1fr; gap: 12px; margin-top: 0; }
.relation-drawer-member-card { display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: start; gap: 20px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.relation-drawer-style-pane { display: grid; align-self: stretch; align-content: center; justify-items: center; gap: 9px; min-width: 0; }
.relation-drawer-member-photo { display: grid; place-items: center; width: 150px; height: 200px; overflow: hidden; border-radius: 8px; background: var(--gray-bg); object-fit: cover; }
.relation-drawer-style-pane > div { display: grid; justify-items: center; gap: 5px; min-width: 0; text-align: center; }
.relation-drawer-style-pane > div > span { color: var(--muted); font-size: 12px; }
.relation-drawer-style-pane strong { max-width: 160px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 19px; }
.relation-drawer-member-skus { min-width: 0; padding-left: 18px; border-left: 1px solid var(--line); }
.relation-drawer-member-skus > div:first-child { margin-bottom: 9px; color: var(--muted); font-size: 12px; }
.relation-drawer-sku-row { display: grid; grid-template-columns: repeat(3, minmax(94px, 1fr)); align-items: start; gap: 10px; min-width: 0; }
.relation-drawer-sku-card { display: grid; grid-template-rows: 78px auto; justify-items: center; gap: 6px; min-width: 0; min-height: 112px; padding: 7px; border: 1px solid #d5dfe7; border-radius: 7px; background: #fafcfd; text-align: center; font-size: 12px; line-height: 1.25; }
.relation-drawer-sku-photo { display: grid; place-items: center; width: 78px; height: 78px; overflow: hidden; border-radius: 5px; background: var(--gray-bg); color: var(--muted); object-fit: cover; font-size: 10px; }
.relation-drawer-sku-card strong { justify-self: center; max-width: 100%; min-width: 0; gap: 2px; white-space: nowrap; font-size: 10.5px; }
.relation-drawer-sku-card .copy-icon { width: 10px; height: 10px; flex: 0 0 10px; }
.relation-drawer-sku-card .copy-icon::before, .relation-drawer-sku-card .copy-icon::after { width: 5px; height: 5px; border-width: 1px; }
.copy-icon { position: relative; display: inline-block; width: 16px; height: 16px; flex: 0 0 16px; }
.copy-icon::before, .copy-icon::after { content: ''; position: absolute; width: 8px; height: 8px; border: 1.5px solid currentColor; border-radius: 2px; background: transparent; }
.copy-icon::before { left: 1px; top: 5px; }
.copy-icon::after { left: 5px; top: 1px; background: var(--panel); }
.picker-value { position: absolute; width: 1px !important; height: 1px; opacity: 0; pointer-events: none; }
.custom-picker { position: relative; width: 100%; }
.custom-picker-trigger { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 42px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); font: inherit; text-align: left; }
.custom-picker-trigger b { width: 9px; height: 9px; border-right: 1.6px solid var(--text); border-bottom: 1.6px solid var(--text); transform: rotate(45deg) translateY(-2px); }
.custom-picker.open .custom-picker-trigger { border-color: #58aeb2; box-shadow: 0 0 0 2px rgba(22,131,95,.12); }
.custom-picker.open .custom-picker-trigger b { transform: rotate(225deg) translate(-1px, -2px); }
.custom-picker-options { display: none; position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; padding: 5px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 8px 20px rgba(23,32,38,.16); }
.custom-picker.open .custom-picker-options { display: grid; gap: 2px; }
.custom-picker-options button { width: 100%; padding: 8px 9px; border: 0; border-radius: 4px; background: transparent; color: var(--text); font: inherit; text-align: left; }
.custom-picker-options button:hover, .custom-picker-options button.selected { background: var(--gray-bg); }
.style-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.style-suggestion { padding: 5px 9px; background: #eef4ff; color: var(--blue); }
.mini-add { margin-left: 8px; padding: 2px 7px; border-radius: 50%; font-size: 15px; line-height: 1.1; }
.photo-tile { position: relative; width: 132px; height: 176px; border: 1px dashed var(--line); border-radius: 8px; overflow: hidden; background: #fff; cursor: pointer; }
.photo-tile.empty { display: grid; place-items: center; align-content: center; color: var(--text); }
.photo-empty { font-size: 32px; line-height: 1; text-align: center; }
.photo-empty small { display: block; font-size: 14px; }
.photo-tile img { width: 100%; height: 146px; object-fit: cover; display: block; }
.photo-caption { position: absolute; bottom: 0; left: 0; right: 0; height: 30px; display: grid; place-items: center; background: rgba(0,0,0,.42); color: #fff; }
.photo-tile.empty .photo-caption { background: #aaa; }
.photo-tile input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-actions { position: absolute; top: 56px; left: 0; right: 0; display: flex; justify-content: center; gap: 12px; z-index: 2; }
.photo-actions button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; }
.photo-paste-tile { width: 390px; height: 216px; cursor: default; }
.photo-paste-tile.empty { display: block; color: var(--text); }
.photo-paste-tile:focus { border-color: #2c84d8; box-shadow: 0 0 0 3px rgba(44,132,216,.16); outline: 0; }
.photo-paste-tile.dragging { border-color: #16835f; background: #f2fbf7; }
.photo-paste-content { height: 186px; display: flex; align-items: center; gap: 18px; padding: 14px 16px; }
.photo-select-trigger { width: 96px; min-width: 96px; min-height: 122px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 8px; border: 1px dashed #8db5dd; border-radius: 7px; background: #f5f9ff; color: #276da9; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.photo-select-trigger:hover { border-color: #2c84d8; background: #eaf4ff; }
.photo-select-trigger:focus-visible { outline: 2px solid #2c84d8; outline-offset: 2px; }
.photo-select-plus { font-size: 31px; font-weight: 400; line-height: 1; }
.photo-paste-guide { display: grid; gap: 6px; min-width: 0; color: #5a6c7d; font-size: 12px; line-height: 1.4; }
.photo-paste-guide strong { color: var(--text); font-size: 14px; }
.photo-paste-guide small { color: #8493a1; font-size: 11px; }
.photo-paste-tile .photo-file-input { position: absolute; width: 1px; height: 1px; min-height: 0; inset: auto; right: 0; bottom: 0; opacity: 0; pointer-events: none; }
.photo-preview-content { height: 186px; display: flex; align-items: center; gap: 14px; padding: 10px 12px; }
.photo-paste-tile .photo-preview-image { width: 182px; height: 166px; flex: 0 0 182px; display: block; object-fit: contain; object-position: center; border-radius: 6px; background: #f4f6f8; }
.photo-preview-guide { display: grid; align-content: center; gap: 7px; min-width: 0; color: #5a6c7d; font-size: 12px; line-height: 1.4; }
.photo-preview-guide strong { color: var(--text); font-size: 14px; }
.photo-preview-guide small { color: #8493a1; font-size: 11px; }
.photo-paste-tile .photo-actions { position: static; display: flex; justify-content: flex-start; gap: 9px; margin-top: 3px; }
.photo-paste-tile .photo-action-button { position: relative; width: 31px; height: 31px; display: grid; place-items: center; padding: 0; border: 1px solid #cbd8e4; border-radius: 50%; background: #fff; color: #3b668c; cursor: pointer; }
.photo-paste-tile .photo-action-button:hover { border-color: #2c84d8; background: #eef6ff; color: #176ab3; }
.photo-paste-tile .photo-action-button.danger { color: #bf4c4c; }
.photo-paste-tile .photo-action-button.danger:hover { border-color: #e59a9a; background: #fff1f1; color: #b62d2d; }
.photo-paste-tile .photo-action-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.photo-paste-tile .photo-action-button[data-photo-reupload] svg { transform: translate(-1px, 1px); }
.photo-paste-tile .photo-action-button::after { content: attr(data-tooltip); position: absolute; left: 50%; bottom: calc(100% + 7px); z-index: 4; padding: 4px 7px; border-radius: 4px; background: #263746; color: #fff; font-size: 11px; line-height: 1.2; white-space: nowrap; opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(2px); transition: opacity .15s ease, transform .15s ease; }
.photo-paste-tile .photo-action-button:hover::after, .photo-paste-tile .photo-action-button:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 480px) {
  .photo-paste-tile { width: 100%; max-width: 390px; }
  .photo-paste-content { gap: 12px; padding: 14px 12px; }
  .photo-preview-content { gap: 10px; padding: 10px; }
  .photo-paste-tile .photo-preview-image { width: 48%; flex-basis: 48%; }
}
.password-dialog input { display: block; width: 100%; }
.image-preview {
  min-height: 72px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fafcfd;
}
.image-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--gray-bg);
}
.badge.on { background: var(--green-bg); color: var(--green); }
.status-action { border: 0; border-radius: 999px; padding: 5px 10px; cursor: pointer; font: inherit; }
.status-up { background: var(--green-bg); color: var(--green); }
.status-partial { background: #fff3cd; color: #9a6700; }
.status-down { background: #fee2e2; color: #c24135; }
.form-grid.factory-size-form { grid-template-columns: repeat(7, minmax(0, 1fr)); column-gap: 0; row-gap: 12px; }
.form-grid.factory-size-form > .check-field {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.factory-size-checkbox-group {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.factory-size-checkbox-group .check-field { border: 0; border-radius: 0; background: transparent; }
.factory-size-checkbox-group .check-field:first-child { border-right: 1px solid var(--line); }
.form-grid.factory-size-form > .check-field:nth-child(1) {
  border-right: 0;
}
.factory-size-form .check-field {
  justify-content: center;
  min-width: 0;
  padding: 10px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  white-space: nowrap;
}
.factory-size-form > .full, .factory-size-form > .quick-replies { grid-column: 1 / -1; }
.factory-size-summary { display: inline-block; padding: 4px 8px; border-radius: 4px; font-weight: 600; white-space: nowrap; }
.factory-size-summary.partial { background: #fff3cd; color: #9a6700; }
.factory-size-summary.all { background: #fee2e2; color: var(--danger); }
.factory-size-status-cell { white-space: nowrap; }
.factory-size-status { font-weight: 400; }
.factory-size-status.delisted { color: var(--danger); }
.factory-size-status.normal { color: var(--green); }
.factory-size-separator { color: var(--muted); padding: 0 4px; }
.quick-replies { display: flex; grid-column: 1 / -1; align-items: center; gap: 8px; width: 100%; margin-top: -4px; overflow-x: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.quick-replies > span, .quick-replies button { flex: 0 0 auto; white-space: nowrap; }
.quick-replies button { min-height: 30px; padding: 4px 10px; }
.actions { display: flex; gap: 8px; }
.data-table td.actions {
  display: table-cell;
  width: 160px;
  min-width: 160px;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: middle;
}
.data-table td.actions > button { display: inline-block; vertical-align: middle; margin-right: 8px; }
.data-table td.actions > button:last-child { margin-right: 0; }
.data-table th.actions-column { width: 160px !important; min-width: 160px; }
.data-table.table-skus th.actions-column { width: 250px !important; min-width: 250px; }
.data-table.table-skus td.actions { width: 250px; min-width: 250px; }
.logout-btn { margin-top: auto; color: #fca5a5; background: transparent; text-align: left; }
.login-page { position: fixed; inset: 0; z-index: 100; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); overflow-y: auto; background: #eef3f7; }
.login-page[hidden], #systemShell[hidden] { display: none !important; }
.login-panel { width: min(390px, 90vw); padding: 34px; background: #fff; border-radius: 8px; box-shadow: 0 18px 50px rgba(20,32,42,.12); display: grid; gap: 16px; }
.login-panel h1 { margin: 0; }
.login-error { min-height: 20px; color: #b42318; }
.page-state { min-height: 120px; display: grid; place-items: center; gap: 8px; text-align: center; color: var(--muted); }
.page-state.error-state { color: var(--danger); }
.page-state.error-state p { margin: 0; color: var(--muted); }
.table-empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.material-copy { color: var(--blue); text-decoration: underline; cursor: pointer; }
#toast {
  position: fixed;
  top: max(24px, calc(env(safe-area-inset-top) + 8px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  width: max-content;
  max-width: calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right));
  padding: 10px 22px;
  border-radius: 8px;
  background: rgba(20, 32, 42, .9);
  color: #fff;
  opacity: 1;
  transition: opacity .35s ease;
}
#toast.toast-hide { opacity: 0; }
.import-row-error { color: #c2392b; font-size: 12px; margin-left: 4px; }
.import-row-success { color: #16866d; }
.import-progress { margin: 12px 0 16px; padding: 12px 16px; border: 1px solid #d5e0e7; border-radius: 8px; background: #f7fafc; }
.import-progress-head { display: flex; justify-content: space-between; align-items: center; color: #526b7d; margin-bottom: 8px; }
.import-progress-head strong { color: #1769e0; font-variant-numeric: tabular-nums; }
.import-progress-track { height: 8px; overflow: hidden; border-radius: 5px; background: #e1e9ef; }
.import-progress-bar { width: 0; height: 100%; border-radius: inherit; background: #1769e0; transition: width .35s ease; }
.import-store-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.import-store-stat { display: inline-flex; align-items: center; gap: 12px; min-height: 38px; padding: 7px 12px; border: 1px solid #d5e0e7; border-radius: 8px; background: #f7fafc; color: var(--text); cursor: pointer; }
.import-store-stat:hover, .import-store-stat.active { border-color: #1769e0; background: #f2f7ff; box-shadow: 0 0 0 2px rgba(23,105,224,.08); }
.import-store-stat strong { color: #1769e0; }
.import-store-stat span { color: var(--muted); font-size: 13px; }
.import-store-stat b { font-variant-numeric: tabular-nums; }

dialog {
  width: min(620px, 92vw);
  max-width: calc(100vw - 20px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(0,0,0,.22);
  overflow: hidden;
}
dialog::backdrop { background: rgba(23, 32, 38, .48); }
dialog.admin-log-operation-dialog { width: min(760px, calc(100vw - 32px)); max-width: none; max-height: min(78dvh, 680px); padding: 0; color: var(--text); background: var(--panel); }
.admin-log-operation-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.admin-log-operation-dialog-header h2 { margin: 0; font-size: 17px; }
.admin-log-operation-dialog-header button { flex: 0 0 auto; }
.admin-log-operation-full-text { max-height: calc(78dvh - 70px); margin: 0; padding: 20px; overflow: auto; color: var(--text); font: inherit; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-log-operation-cell { max-width: 520px; }
.admin-log-operation { display: block; width: 100%; min-width: 0; padding: 0; overflow: hidden; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.admin-log-operation:hover { color: var(--blue, #1769e0); text-decoration: underline; }
dialog h2 { margin: 0 0 16px; }
#dialogForm { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 22px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid.listing-modal-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.listing-modal-form > label, .listing-modal-form > .field-block { min-width: 0; }
.listing-modal-form input, .listing-modal-form select { min-width: 0; }
.form-grid.matrix-cell-form { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.matrix-cell-form label { min-width: 0; }
.matrix-cell-form input, .matrix-cell-form select { min-width: 0; padding: 8px 9px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
label.full { grid-column: 1 / -1; }
.page-form .form-grid > .full { grid-column: 1 / -1; }
.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.check-field input {
  width: 16px;
  height: 16px;
}
menu { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 0 0; margin: 0; }

.matrix {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  table-layout: auto;
}
.matrix col:nth-child(n + 4) { width: auto; }
.matrix th:first-child, .matrix td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
}
.matrix th:first-child {
  background: #f0f4f7;
}
.table-matrix .matrix-cost-price-cell { text-align: center; white-space: nowrap; }
.table-matrix th[data-sort="matrix_cost_price"] .th-sort { text-align: center; }
.matrix-sku-cell { position: relative; overflow: visible; }
.matrix-sku-label { position: relative; display: inline-flex; align-items: center; max-width: 100%; padding-right: 4px; }
.new-style-badge { position: absolute; top: -11px; right: -8px; padding: 1px 4px; border-radius: 3px; color: #fff; background: #e04444; font-size: 9px; font-weight: 700; line-height: 1.2; letter-spacing: .2px; }
.cell {
  min-width: 0;
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--gray-bg);
  color: var(--muted);
  cursor: pointer;
}
.cell.on {
  background: var(--green-bg);
  color: var(--green);
  font-weight: 700;
}
.matrix-link-summary { min-height: 42px; display: flex; flex-direction: column; justify-content: center; gap: 2px; line-height: 1.2; }
.matrix-link-summary strong { font-size: 13px; }
  .matrix-link-summary small { font-size: 11px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .matrix-spu-scope { margin: 10px 0 2px; padding: 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
  .matrix-spu-scope b { color: var(--green); font-weight: 650; }
  .matrix-spu-focus-store { background: rgba(245, 158, 11, .10) !important; box-shadow: inset 0 0 0 1px rgba(217, 119, 6, .34); }
  .matrix-cell-readonly { cursor: not-allowed; opacity: .72; }
.matrix-links-dialog { width: min(1050px, calc(100vw - 24px)); max-width: none; }
.matrix-links-dialog .matrix-spu-lock-notice { margin-right: auto; min-width: 0; color: #dc2626; font-size: 13px; opacity: 0; transition: opacity .4s ease; pointer-events: none; }
.matrix-links-dialog .matrix-spu-lock-notice.is-visible { opacity: 1; }
.matrix-links-dialog #dialogActions { display: flex; align-items: center; gap: 8px; width: 100%; }
.matrix-links-dialog .matrix-spu-lock-notice { flex: 1 1 auto; text-align: left; }
.matrix-links-editor { display: block; width: 100%; max-width: 100%; overflow: visible; }
.matrix-links-editor #matrixLinkRows { display: grid; gap: 0; }
.matrix-link-head, .matrix-link-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(170px, 1fr) 100px 130px 130px minmax(150px, 1fr) 38px; gap: 10px; align-items: center; }
.matrix-link-head { padding: 0 0 6px; color: var(--muted); font-size: 13px; }
.matrix-link-row { padding: 7px 0; border-top: 1px solid var(--line); }
.matrix-link-row input, .matrix-link-row select { min-width: 0; width: 100%; box-sizing: border-box; padding: 7px 8px; }
.matrix-link-row > :nth-child(-n+5), .matrix-link-head > :nth-child(-n+5) { width: 100%; justify-self: stretch; }
  .matrix-link-row input:disabled, .matrix-link-row select:disabled { color: var(--muted); background: var(--gray-bg); }
  .matrix-link-status { display: flex; align-items: center; gap: 10px; min-height: 34px; white-space: nowrap; }
  .matrix-link-status label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-size: 14px; }
  .matrix-link-status input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.matrix-link-operation-placeholder { display: block; width: 42px; height: 1px; }
.matrix-link-add { margin-top: 10px; }

.relation-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); width: 100%; gap: 10px; padding: 10px; overflow: hidden; border: 0; border-radius: 8px; background: transparent; }
.relation-group { min-width: 0; padding: 18px; border: 1px solid var(--line); margin: -1px 0 0 -1px; }
.relation-group-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; color: var(--muted); }
.relation-group-head > div { display: flex; align-items: center; gap: 10px; }
.relation-group-head strong { color: var(--text); font-size: 18px; }
.relation-type { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 9px; border-radius: 999px; background: var(--green-bg); color: var(--green); font-size: 13px; font-weight: 700; }
.relation-type.bundle { background: #e8eefc; color: #2854a8; }
.relation-type { white-space: nowrap; min-width: max-content; }
.relation-comparison { display: grid; grid-template-columns: minmax(175px, .85fr) 44px minmax(175px, 1fr); align-items: stretch; gap: 10px; }
.relation-related-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; min-width: 0; }
.relation-style-card { position: relative; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafcfd; }
.main-style-card { border-color: #91b5f7; background: #f7faff; }
.relation-card-heading { display: flex; align-items: center; justify-content: space-between; min-height: 30px; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.relation-remove { width: 30px; height: 30px; padding: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; }
.relation-remove:hover { background: #fde8e6; color: var(--danger); }
.relation-style-photo { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 5px; background: var(--gray-bg); object-fit: contain; }
.relation-photo-empty { display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.relation-style-no { display: block; margin-top: 10px; font-size: 18px; }
.relation-sku-title { margin-top: 10px; color: var(--muted); font-size: 12px; }
.relation-sku-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.relation-sku-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 8px; border: 1px solid #d5dfe7; border-radius: 4px; background: #fff; font-size: 12px; }
.relation-sku-empty { color: var(--muted); font-size: 12px; }
.relation-remark { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.5; }
.relation-link-mark { display: grid; grid-template-rows: 1fr auto 1fr; place-items: center; color: var(--muted); font-size: 12px; }
.relation-link-mark span { grid-row: 1 / -1; grid-column: 1; width: 1px; height: 100%; background: var(--line); }
.relation-edit-link { grid-row: 2; grid-column: 1; position: relative; z-index: 1; padding: 5px 6px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.relation-edit-link:hover { border-color: var(--blue); background: #eef5ff; color: var(--blue); }
.relation-link-edit { display: none; }
.relation-edit-link:hover .relation-link-label { display: none; }
.relation-edit-link:hover .relation-link-edit { display: inline; }
.relation-empty { text-align: center; padding: 42px 18px; }
.relation-empty p { margin-top: 8px; }
.relation-picker { min-width: 0; }
.relation-picker.full { grid-column: 1 / -1; }
.relation-picker > .field-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: 13px; }
.relation-picker-count { color: var(--blue); }
.relation-picker-search input { width: 100%; }
.relation-picker-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 300px; margin-top: 8px; padding: 6px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: #fafcfd; }
.relation-picker-options > label { display: flex; grid-template-columns: none; align-items: center; gap: 8px; min-width: 0; padding: 7px; border-radius: 4px; color: var(--text); cursor: pointer; }
.relation-picker-options > label:hover { background: var(--gray-bg); }
.relation-picker-options input { flex: 0 0 auto; width: 18px; height: 18px; }
.relation-option-photo { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 4px; overflow: hidden; background: var(--gray-bg); }
.relation-option-photo img { width: 100%; height: 100%; object-fit: cover; }
.relation-picker-options strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relation-search-pickers { display: grid; gap: 16px; min-width: 0; }
.relation-search-pickers.full { grid-column: 1 / -1; }
.relation-search-picker { min-width: 0; }
.relation-search-picker > .field-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: 13px; }
.relation-search-picker > .relation-style-search { width: 100%; }
.relation-search-results { max-height: 286px; margin-top: 6px; padding: 5px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 8px 22px rgba(23,32,38,.12); }
.relation-search-result { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 58px; padding: 5px 8px; border-radius: 4px; background: #fff; color: var(--text); text-align: left; }
.relation-search-result:hover, .relation-search-result:focus { background: #eef4ff; color: var(--text); }
.relation-search-result > span:last-child { color: var(--blue); font-size: 12px; }
.relation-result-photo { display: grid; place-items: center; width: 46px; height: 46px; overflow: hidden; border-radius: 4px; background: var(--gray-bg); color: var(--muted); }
.relation-result-photo img { width: 100%; height: 100%; object-fit: contain; }
.relation-result-photo i { font-size: 11px; font-style: normal; }
.relation-no-results { padding: 18px 10px; text-align: center; color: var(--muted); font-size: 13px; }
.relation-main-selected, .relation-selected-styles { display: grid; gap: 6px; margin-top: 8px; }
.relation-selected-style { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 58px; padding: 6px 8px; border: 1px solid #c9dafa; border-radius: 8px; background: #f7faff; }
.relation-selected-style > span:last-child { color: var(--blue); font-size: 12px; }
.relation-selected-style > button { width: 32px; height: 32px; padding: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 22px; }
.relation-selected-style > button:hover { background: #fde8e6; color: var(--danger); }

@media (max-width: 820px) {
  :root { color-scheme: light; }
  html, body { width: 100%; min-width: 0; overflow-x: hidden; }
  #systemShell { display: block; min-height: 100dvh; }
  .desktop-sidebar { display: none; }
  .desktop-sidebar-toggle { display: none; }
  .mobile-menu-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: block;
    width: 100%;
    padding: calc(8px + env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left));
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 3px 10px rgba(23,32,38,.14);
  }
  .mobile-menu-bar-head { display: flex; align-items: center; gap: 10px; min-height: 38px; }
  .mobile-menu-brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; color: #40454f; font-size: 16px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-brand-mark { display: block; width: 29px !important; height: 29px !important; max-width: 29px; max-height: 29px; flex: 0 0 29px; border-radius: 8px; object-fit: contain; }
  .mobile-menu-toggle {
    position: relative;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--gray-bg);
    color: var(--text);
    cursor: pointer;
  }
  .mobile-menu-toggle > span,
  .mobile-menu-toggle > span::before,
  .mobile-menu-toggle > span::after { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; content: ''; transition: transform .16s ease, opacity .16s ease; }
  .mobile-menu-toggle > span::before { transform: translateY(-6px); }
  .mobile-menu-toggle > span::after { transform: translateY(4px); }
  .mobile-menu-open .mobile-menu-toggle > span { background: transparent; }
  .mobile-menu-open .mobile-menu-toggle > span::before { transform: translateY(0) rotate(45deg); }
  .mobile-menu-open .mobile-menu-toggle > span::after { transform: translateY(-2px) rotate(-45deg); }

  .mobile-quick-nav { display: block; width: 100%; min-width: 0; margin-top: 6px; }
  .mobile-quick-nav > .nav, .mobile-quick-nav > .menu-group { display: none; }
  .mobile-quick-nav .quick-menu-section { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px; width: 100%; min-width: 0; margin: 0; padding: 0; border: 0; }
  .mobile-quick-nav .quick-menu-heading { display: flex; gap: 4px; padding: 0; color: #96a5b2; white-space: nowrap; }
  .mobile-quick-nav .quick-menu-settings { padding: 4px 5px; border: 1px solid #3b4a55; border-radius: 5px; }
  .mobile-quick-nav .quick-menu-items { display: flex; gap: 5px; width: 100%; min-width: 0; padding: 0 0 1px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .mobile-quick-nav .quick-menu-items::-webkit-scrollbar { display: none; }
  .mobile-quick-nav .quick-nav { width: auto; min-width: max-content; flex: 0 0 auto; padding: 6px 10px; border: 1px solid #33434e; border-radius: 8px; background: #202d37; color: #dbe3ea; font-size: 13px; line-height: 1.3; }
  .mobile-quick-nav .quick-nav.active { border-color: #52636f; background: #31404b; color: #fff; }
  .mobile-quick-nav .quick-menu-empty { padding: 5px 8px; color: #91a0ab; white-space: nowrap; }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 48;
    display: block;
    background: rgba(12,18,22,.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
  }
  .mobile-menu-drawer {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 49;
    display: flex;
    flex-direction: column;
    width: min(84vw, 310px);
    max-width: calc(100vw - 42px);
    padding: calc(12px + env(safe-area-inset-top)) 10px calc(16px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    overflow: hidden;
    background: #fff;
    color: var(--text);
    box-shadow: 10px 0 30px rgba(23,32,38,.18);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform .2s ease, visibility 0s linear .2s;
  }
  body.mobile-menu-open { overflow: hidden; }
  body.mobile-menu-open .mobile-menu-backdrop { opacity: 1; pointer-events: auto; }
  body.mobile-menu-open .mobile-menu-drawer { transform: translateX(0); visibility: visible; transition: transform .2s ease; }
  .mobile-menu-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 0 0 auto; min-height: 46px; padding: 0 4px 10px 8px; border-bottom: 1px solid var(--line); }
  .mobile-menu-drawer-head strong { font-size: 18px; }
  .mobile-menu-close { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 7px; background: var(--gray-bg); color: var(--text); cursor: pointer; font-size: 27px; font-weight: 300; line-height: 1; }
  .mobile-drawer-nav { display: block; flex: 1 1 auto; width: 100%; min-width: 0; padding-top: 9px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
  .mobile-drawer-nav .nav { display: block; width: 100%; min-width: 0; padding: 9px 11px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-drawer-nav .quick-menu-section { margin: 5px 0 10px; padding: 7px 0 9px; }
  .mobile-drawer-nav .quick-menu-heading { padding: 0 10px 5px; }
  .mobile-drawer-nav .quick-menu-items { display: grid; gap: 2px; }
  .mobile-drawer-nav .quick-menu-empty { padding: 5px 20px; }
  .mobile-drawer-nav .menu-group { display: block; width: 100%; min-width: 0; margin: 5px 0; overflow: hidden; border: 0; border-radius: 7px; background: transparent; }
  .mobile-drawer-nav .menu-title { width: 100%; min-width: 0; min-height: 22px; padding: 5px 10px; border: 1px solid #e7ebf2; border-radius: 7px; background: #f6f8fb; color: #505a6c; font-size: 13px; white-space: nowrap; }
  .mobile-drawer-nav .menu-title > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .mobile-drawer-nav .menu-caret { flex: 0 0 auto; margin-left: 8px; }
  .mobile-drawer-nav .menu-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; width: 100%; min-width: 0; padding: 4px 0 0; }
  .mobile-drawer-nav .menu-group.is-collapsed .menu-items { display: none; }
  .mobile-drawer-nav .subnav, .mobile-drawer-nav .quick-nav { padding-left: 18px; }
  .logout-btn { display: inline-block; width: auto; margin: 0; }
  .topbar { height: auto; min-height: 68px; gap: 10px; align-items: flex-start; padding: 13px 14px; padding: 13px max(14px, env(safe-area-inset-right)) 13px max(14px, env(safe-area-inset-left)); }
  .topbar { flex-wrap: wrap; }
  .topbar-page { gap: 9px; min-width: 0; }
  .topbar-status-indicators { order: 3; flex: 1 0 100%; align-items: stretch; gap: 3px; padding: 0; }
  .topbar-menu-mark { display: none; }
  .page-breadcrumb { gap: 7px; min-width: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; }
  .breadcrumb-item { overflow: hidden; text-overflow: ellipsis; }
  .breadcrumb-item:not(.is-current):not(:first-child), .breadcrumb-separator:nth-of-type(2) { display: none; }
  .page-description { display: none; }

  .page-instruction { display: block; margin-top: 4px; }
  .page-instruction a { color: #2563eb; text-decoration: underline; }
  .topbar-user-name { max-width: 100px; }
  .topbar-user-trigger { min-height: 44px; }
  .mobile-menu-toggle, .mobile-menu-close { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .mobile-menu-toggle { flex-basis: 44px; }
  #app { width: auto; min-height: calc(100vh - 150px); margin: 10px; padding: 14px 10px 28px; padding: 14px max(10px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  #app.tool-page-app { padding: 0; }
  .tool-page-frame { height: calc(100dvh - 150px); min-height: 720px; border-radius: 7px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card { padding: 12px; min-width: 0; }
  .metric { font-size: 24px; }
  .toolbar { grid-template-columns: 1fr; gap: 8px; }
  /* Toolbar buttons are grouped after their filters in app.js. Keep the
     action group in the single mobile column and let long action rows wrap. */
  .toolbar-action-group { grid-column: 1; justify-content: flex-start; flex-wrap: wrap; }
  .toolbar-action-group button { flex: 1 1 120px; min-height: 44px; }
  .listing-toolbar-grid, .matrix-search-grid { grid-template-columns: 1fr; gap: 8px; }
  .daily-sales-import-page-toolbar { grid-template-columns: 1fr; }
  .query-toolbar-grid:has(#skuImportFile),
  .query-toolbar-grid:has(#listingImportFile),
  .query-toolbar-grid:has(#batchDelistFile) { grid-template-columns: 1fr; }
  .listing-records-toolbar .listing-records-filter,
  .listing-records-toolbar .listing-more-filters > .listing-filter,
  .listing-records-toolbar .listing-filter-actions { grid-column: 1; grid-row: auto; width: 100%; min-width: 0; }
  .query-toolbar-grid .listing-filter-actions,
  .matrix-search-grid .listing-filter-actions,
  .listing-toolbar-grid .listing-filter-actions,
  .listing-toolbar-grid.expanded .listing-filter-actions { grid-column: 1; grid-row: auto; justify-content: stretch; flex-wrap: wrap; }
  .listing-filter-actions button { flex: 1 1 0; min-width: 0; min-height: 40px; }
  .listing-filter-actions { white-space: normal; }
  .listing-toolbar-grid .listing-filter-actions button { flex: 1 1 120px; min-width: 0; white-space: normal; line-height: 1.3; }
  .sales-query-toolbar > .listing-filter-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .sales-query-toolbar > .listing-filter-actions button { width: 100%; min-width: 0; padding-inline: 4px; white-space: normal; line-height: 1.3; word-break: keep-all; }
  .matrix-store-filter-inline { align-items: flex-start; flex-wrap: wrap; }
  .daily-sales-offline-account-filter { flex: 1 1 100%; min-width: 0; }
  .listing-filter { min-width: 0; height: 42px; }
  .listing-toolbar-grid .listing-filter { font-size: 13px; }
  .listing-filter input, .listing-filter select { height: 34px; font-size: 16px; }
  .listing-filter input[type="file"] { width: 100%; padding-inline: 2px; }
  .daily-sales-import-page-toolbar .listing-filter-actions { grid-column: 1; grid-row: auto; }
  .multi-select > button { min-height: 40px; }
  .multi-options { max-height: 55vh; overflow-y: auto; }
  .listing-more-filters > .listing-filter { grid-row: auto; }
  .listing-more-filters > .listing-filter.listing-more-third-row { grid-row: auto; }
  .range-fields { gap: 4px; }
  .range-fields input { min-width: 0; }
  input, select, textarea { font-size: 16px; }
  .table-wrap { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 760px; }
  th, td { padding: 9px 10px; }
  /* Keep the full table in its own horizontal scroll area on phones.
     A sticky action column would cover the preceding data columns on iOS. */
  .table-wrap { overscroll-behavior-x: contain; }
  .col-resizer { display: none; }
  .pagination { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .pagination > span, .pagination-jump { max-width: 100%; }
  .pagination-jump input { width: 54px; font-size: 16px; }
  .page-form { width: 100%; max-width: none; margin: 0; padding: 16px; }
  .page-form-head { gap: 12px; flex-wrap: wrap; }
  .page-form-head h1 { font-size: 22px; }
  .form-grid, .page-form .form-grid { grid-template-columns: minmax(0, 1fr); }
  .sku-price-row { grid-template-columns: 1fr; gap: 12px; }
  .sku-meta-row { display: grid; grid-template-columns: 1fr; gap: 12px; width: 100%; }
  .sku-meta-row > .field-block { width: 100%; }
  .sku-meta-row .radio-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: none;
    gap: 8px;
    white-space: normal;
  }
  .sku-price-row .radio-field { min-width: 0; }
  .sale-category-row {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }
  .sale-category-row .radio-field {
    min-width: 0;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    white-space: normal;
    box-sizing: border-box;
  }
  .profile-layout { grid-template-columns: 1fr; }
  .profile-page { width: 100%; margin: 0; padding: 16px; }
  .profile-card { min-width: 0; }
  .profile-avatar-row { flex-wrap: wrap; }
  .page-form-actions { flex-wrap: wrap; }
  .page-form-actions button { flex: 1 1 120px; min-height: 42px; }
  .qq-avatar-grid { grid-template-columns: repeat(10, minmax(36px, 1fr)); gap: 5px; }
  dialog { width: calc(100vw - 20px - env(safe-area-inset-left) - env(safe-area-inset-right)); max-width: none; max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  #dialogForm { max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; padding: 16px; }
  menu { flex-wrap: wrap; padding-top: 12px; }
  menu button { min-height: 42px; flex: 1 1 120px; }
  .image-lightbox { padding: 20px 10px; padding: max(20px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .image-lightbox-filename { top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); max-width: calc(100vw - 72px); font-size: 13px; }
  .image-lightbox-close { top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); }
  .image-lightbox img { max-width: 94vw; max-height: 82dvh; }
  .relation-group { padding: 12px; }
  .relation-groups { grid-template-columns: 1fr; border-radius: 8px; }
  .relation-group { margin: 0; border: 0; }
  .relation-group + .relation-group { border-top: 1px solid var(--line); }
  .relation-group-head { align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
  .relation-group-head > span { font-size: 12px; }
  .relation-comparison { grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr); align-items: start; gap: 7px; }
  .relation-link-mark { display: grid; grid-template-rows: 1fr auto 1fr; align-self: stretch; min-height: 180px; }
  .relation-link-mark::before, .relation-link-mark::after { content: none; }
  .relation-link-mark span { display: block; }
  .relation-related-list { grid-template-columns: 1fr; }
  .relation-style-card { padding: 9px; }
  .relation-style-photo { max-height: 190px; aspect-ratio: 1 / 1; }
  .relation-style-no { font-size: 16px; overflow-wrap: anywhere; }
  .relation-sku-chip { max-width: 100%; padding: 3px 6px; overflow-wrap: anywhere; white-space: normal; font-size: 11px; }
  .relation-card-heading { min-height: 28px; }
  .relation-picker-options { grid-template-columns: 1fr; max-height: 42dvh; }
  .relation-drawer-panel { width: 100%; padding: 16px; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .relation-drawer-related { grid-template-columns: 1fr; }
  .relation-drawer-member-card { grid-template-columns: 140px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .relation-drawer-member-photo { width: 126px; height: 168px; }
  .relation-drawer-member-skus { padding-left: 12px; }
  .relation-summary { gap: 12px; min-height: 148px; padding: 14px; }
  .relation-peer-group { padding: 0; }
  .relation-peer-members { grid-template-columns: minmax(125px, .8fr) minmax(180px, 1.2fr); gap: 9px; padding: 10px; }
  .relation-peer-main-column, .relation-peer-related-block { height: 270px; }
  .relation-peer-primary .relation-peer-photo { width: min(100%, 132px); }
  .relation-summary-main { gap: 12px; }
  .relation-summary-photo { width: 80px; height: 80px; flex-basis: 80px; }
  .relation-summary-info strong { font-size: 18px; }
  .relation-summary-info p { font-size: 13px; }
  .relation-summary-previews img, .relation-preview-empty { width: 32px; height: 32px; }
  .relation-view-button { min-height: 34px; padding-inline: 10px; font-size: 13px; }
}

@media (max-width: 430px) {
  .mobile-menu-brand { font-size: 15px; }
  .mobile-menu-drawer { width: min(88vw, 300px); }
  .topbar { padding-left: 11px; padding-right: 11px; }
  #app { margin: 8px; padding-left: 8px; padding-right: 8px; }
  .cards { gap: 6px; }
  .card { padding: 10px; }
  .card h3 { font-size: 14px; }
  .metric { font-size: 22px; }
  .qq-avatar-grid { grid-template-columns: repeat(6, minmax(34px, 1fr)); gap: 4px; }
  .topbar-user-name { max-width: 74px; }
  .topbar-user-trigger { gap: 4px; }
  .page-note { padding: 10px; }
  .page-note ol, .page-note ul { margin: 0; padding-left: 22px; }
  .import-result-panel { padding: 10px; }
  .import-result-summary { gap: 8px; }
  .import-result-summary span { width: 100%; }
  .relation-group { padding: 8px; }
  .relation-drawer-member-card { grid-template-columns: 112px minmax(0, 1fr); gap: 8px; padding: 9px; }
  .relation-drawer-member-photo { width: 102px; height: 136px; }
  .relation-drawer-member-skus { padding-left: 8px; }
  .relation-drawer-sku-row { grid-template-columns: 1fr; gap: 8px; }
  .relation-group-head { gap: 6px; }
  .relation-group-head > div { gap: 6px; }
  .relation-group-head strong { font-size: 15px; }
  .relation-type { min-height: 23px; padding: 2px 7px; font-size: 11px; }
  .relation-comparison { grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); gap: 4px; }
  .relation-link-mark { min-height: 150px; }
  .relation-edit-link { padding: 4px 2px; font-size: 10px; }
  .relation-style-card { padding: 7px; }
  .relation-style-photo { max-height: 150px; }
  .relation-style-no { margin-top: 7px; font-size: 14px; }
  .relation-sku-title { margin-top: 7px; font-size: 10px; }
  .relation-sku-list { gap: 4px; margin-top: 5px; }
  .relation-sku-chip { min-height: 23px; font-size: 10px; }
  .relation-remove { width: 28px; height: 28px; }
}

@media (max-width: 820px) and (max-height: 500px) and (orientation: landscape) {
  .mobile-menu-bar { position: relative; }
  .mobile-menu-drawer { width: min(58vw, 300px); }
  .topbar { min-height: 58px; padding-block: 9px; }
  .page-description { display: none; }
}

@media (pointer: coarse) {
  .matrix-store-options label, .multi-options label, .custom-picker-options button { min-height: 44px; }
  .check-field input, .matrix-store-options input, .multi-options input, .radio-field input { min-width: 20px; min-height: 20px; }
  .copy-text-target { min-height: 36px; }
}

@media (max-height: 650px) {
  .login-page { place-items: start center; }
  .login-panel { margin: 8px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
.sku-recolor-input {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: stretch;
}

.sku-recolor-input > span {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #eef3f7;
  border: 1px solid #d4dee7;
  border-right: 0;
  border-radius: 8px 0 0 8px;
  color: #17232d;
  font-weight: 600;
  white-space: nowrap;
}
.delist-reason-cell { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: help; }

.sku-recolor-input input {
  min-width: 0;
  border-radius: 0 8px 8px 0;
}

@media (max-width: 600px) {
  .sku-recolor-input > span { padding-inline: 9px; }
}

/* Dashboard: a compact operational overview rather than a marketing page. */
.dashboard-page { display: grid; gap: 18px; max-width: 1680px; margin: 0 auto; }
.dashboard-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.dashboard-period-copy { display: grid; gap: 3px; flex: 0 0 auto; }
.dashboard-period-copy strong { font-size: 15px; }
.dashboard-period-copy span { color: var(--muted); font-size: 13px; }
.dashboard-period-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.generic-date-range.dashboard-period-actions { justify-content: stretch; flex-wrap: nowrap; gap: 0; }
.dashboard-period-actions button { min-height: 34px; padding: 6px 12px; }
.dashboard-period-actions .is-active { border-color: #9fbeff; background: #edf4ff; color: #1d4ed8; }
.dashboard-period-actions label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.dashboard-period-actions input { width: 138px; height: 34px; padding-inline: 8px; font-size: 13px; }

.dashboard-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.dashboard-kpi {
  position: relative;
  display: grid;
  gap: 5px;
  min-width: 0;
  min-height: 128px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.dashboard-kpi::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: #8ea0af; }
.dashboard-kpi.sales::before { background: #0aa39a; }
.dashboard-kpi.primary::before { background: var(--blue); }
.dashboard-kpi.success::before { background: var(--green); }
.dashboard-kpi.warning::before { background: #d5962d; }
.dashboard-kpi.danger::before { background: var(--danger); }
.dashboard-kpi > span { color: var(--muted); font-size: 14px; }
.dashboard-kpi strong { color: var(--text); font-size: 32px; line-height: 1.08; letter-spacing: 0; }
.dashboard-kpi strong.sales-import-missing-number { color: var(--danger); }
.dashboard-kpi small.sales-import-missing-text { color: var(--muted); }
.dashboard-kpi .sales-import-missing-stores { color: var(--danger); }
.dashboard-sales-import-link { cursor: pointer; }
.dashboard-sales-import-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.dashboard-delist-actionable { cursor: pointer; }
.dashboard-kpi small { min-height: 18px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.dashboard-store-sales { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; max-height: 38px; overflow: hidden; }
.dashboard-store-sales b { padding: 1px 3px; border-radius: 3px; color: var(--muted); font-style: normal; font-weight: 500; cursor: help; }
.dashboard-store-sales b:hover { background: #e9f7f6; color: #07857e; }
.dashboard-period-comparison.is-up { color: var(--green); }
.dashboard-period-comparison.is-down { color: var(--danger); }
.dashboard-period-comparison.is-flat { color: var(--muted); }

.dashboard-primary-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr) minmax(240px, 1fr); gap: 18px; align-items: start; }
.dashboard-push-panel { display: flex; flex-direction: column; }
.dashboard-new-style-panel { display: flex; flex-direction: column; overflow: hidden; }
.dashboard-new-style-panel .dashboard-panel-head, .dashboard-new-style-panel .dashboard-trend-summary, .dashboard-new-style-panel .dashboard-trend { flex: 0 0 auto; }
.dashboard-push-panel .dashboard-panel-head { flex: 0 0 auto; }
.dashboard-push-list { display: flex; flex: 1 1 auto; flex-direction: column; justify-content: space-evenly; min-height: 0; padding: 0 12px 8px; }
.dashboard-push-item { display: flex; flex: 1 1 0; align-items: center; gap: 8px; min-width: 0; padding: 6px 0; border: 0; border-bottom: 1px solid #edf1f4; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.dashboard-push-item:last-child { border-bottom: 0; }
.dashboard-push-photo { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; overflow: hidden; border-radius: 8px; background: var(--gray-bg); color: var(--muted); font-size: 10px; }
.dashboard-push-photo img { width: 100%; height: 100%; object-fit: cover; }
.dashboard-push-info { display: grid; min-width: 0; flex: 1; gap: 3px; }
.dashboard-push-info strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-push-info small { color: var(--muted); font-size: 11px; }
.dashboard-push-item .dashboard-sync-badge, .dashboard-push-item .dashboard-done-badge { flex: 0 0 auto; max-width: 45%; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-push-done-badge { cursor: pointer; }
.dashboard-secondary-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.dashboard-exception-panel { grid-column: 1 / -1; }
.dashboard-panel { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; }
.dashboard-sales-trend-panel { margin-bottom: 18px; }
.dashboard-sales-charts { position: relative; padding: 14px 18px 0; overflow: hidden; }
.dashboard-sales-chart-block + .dashboard-sales-chart-block { margin-top: 8px; padding-top: 10px; border-top: 1px solid #edf1f4; }
.dashboard-sales-chart-block.is-hidden { display: none; }
.dashboard-sales-chart-label { padding-left: 42px; color: var(--text); font-size: 12px; font-weight: 700; }
.dashboard-sales-chart { display: block; width: 100%; min-width: 680px; height: auto; overflow: visible; color: var(--muted); font-size: 12px; }
.dashboard-sales-gridline { stroke: #e8eef3; stroke-width: 1; }
.dashboard-sales-line { fill: none; stroke-width: 1; stroke-linejoin: round; stroke-linecap: round; }
.dashboard-sales-line.is-hidden { display: none; }
.dashboard-sales-crosshair { stroke: #64748b; stroke-width: 1.2; stroke-dasharray: 4 4; pointer-events: none; }
.dashboard-sales-hover-zone { fill: transparent; cursor: crosshair; }
.dashboard-sales-tooltip { position: absolute; z-index: 3; width: 190px; padding: 10px 12px; border: 1px solid rgba(148,163,184,.55); border-radius: 8px; background: rgba(255,255,255,.76); box-shadow: 0 8px 24px rgba(30,55,80,.16); pointer-events: none; font-size: 12px; }
.dashboard-sales-tooltip strong, .dashboard-sales-tooltip em { display: block; margin-bottom: 7px; font-style: normal; font-weight: 700; }
.dashboard-sales-tooltip div { display: flex; align-items: center; gap: 6px; line-height: 21px; }
.dashboard-sales-tooltip div i { width: 7px; height: 7px; border-radius: 50%; }
.dashboard-sales-tooltip div span { flex: 1; }
.dashboard-sales-tooltip div b { font-weight: 600; }
.dashboard-sales-tooltip em { margin: 7px 0 0; padding-top: 7px; border-top: 1px solid #edf1f4; }
.dashboard-sales-scale-note { margin: 4px 18px 10px; color: var(--muted); font-size: 12px; text-align: center; }
.dashboard-sales-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 16px; padding: 0 18px 16px; }
.dashboard-sales-legend label { display: inline-flex; align-items: center; gap: 5px; color: var(--text); cursor: pointer; }
.dashboard-sales-legend input { margin: 0; accent-color: var(--blue); }
.dashboard-sales-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 50%; }
.sales-comparison-page { display: grid; gap: 18px; }
.sales-comparison-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(120deg, #f8fbff, #fff); }
.sales-comparison-hero h2 { margin: 0; font-size: 22px; }
.sales-comparison-hero p { margin: 6px 0 0; color: var(--muted); }
.sales-comparison-controls { display: flex; align-items: center; gap: 10px; }
.sales-comparison-period-actions { display: flex; align-items: center; gap: 6px; }
.sales-comparison-mode-actions { display: inline-flex; gap: 6px; margin-top: 12px; }
.sales-comparison-mode-actions .ghost { min-height: 34px; padding: 6px 12px; }
.sales-comparison-mode-actions .ghost.is-active { border-color: #9fbeff; background: #edf4ff; color: #1d4ed8; }
.sales-comparison-date-label { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--muted); }
.sales-comparison-date-label input { min-height: 34px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: #fff; }
.sales-comparison-period-actions .ghost { min-height: 34px; padding: 6px 10px; }
.sales-comparison-period-actions .ghost.is-active { border-color: #9fbeff; background: #edf4ff; color: #1d4ed8; }
.sales-comparison-controls .generic-date-range { width: 430px; }
.sales-comparison-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.sales-comparison-chart-area { position: relative; padding: 20px 20px 0; overflow: hidden; }
.sales-comparison-chart { display: block; width: 100%; min-width: 760px; color: var(--muted); font-size: 12px; }
.sales-comparison-gridline { stroke: #e8eef3; stroke-width: 1; }
.sales-comparison-line { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.sales-comparison-line.is-hidden { display: none; }
.sales-comparison-chart g.is-hidden { display: none; }
.sales-comparison-point { fill: transparent; cursor: crosshair; }
.sales-comparison-crosshair { stroke: #64748b; stroke-width: 1; stroke-dasharray: 4 4; pointer-events: none; }
.sales-comparison-hover-zone { cursor: crosshair; }
.daily-sales-last-import { position: relative; align-self: center; flex: 0 0 auto; margin: 0 10px 0 auto; color: #477996; font-size: 13px; cursor: pointer; white-space: nowrap; }
.daily-sales-last-import:hover, .daily-sales-last-import:focus-visible { color: #1d4ed8; }
.daily-sales-last-import:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; border-radius: 3px; }
.daily-sales-last-import-tooltip { position: fixed; z-index: 1000; width: 250px; max-width: calc(100vw - 16px); max-height: min(420px, calc(100vh - 16px)); overflow-y: auto; box-sizing: border-box; padding: 11px 13px; border: 1px solid rgba(148,163,184,.42); border-radius: 9px; background: rgba(255,255,255,.4); backdrop-filter: blur(7px); box-shadow: 0 10px 24px rgba(30,55,80,.14); color: #1f2937; font-size: 12px; pointer-events: none; }
.daily-sales-last-import-tooltip[hidden] { display: none; }
.daily-sales-last-import-tooltip > strong { display: block; margin: 0 0 7px; color: #1f2937; font-size: 14px; font-weight: 700; }
.daily-sales-last-import-tooltip > div { display: flex; align-items: center; gap: 8px; min-height: 24px; line-height: 1.4; }
.daily-sales-last-import-tooltip > div i { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; }
.daily-sales-last-import-tooltip > div span { flex: 1 1 auto; color: #1f2937; }
.daily-sales-last-import-tooltip > div b { margin-left: 8px; color: #1f2937; font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.daily-sales-last-import + .daily-sales-compare-trigger { margin-left: 0; }
.sales-comparison-tooltip { position: absolute; z-index: 3; width: 224px; padding: 11px 13px; border: 1px solid rgba(148,163,184,.42); border-radius: 9px; background: rgba(255,255,255,.15); backdrop-filter: blur(7px); box-shadow: 0 10px 24px rgba(30,55,80,.14); pointer-events: none; font-size: 12px; }
.sales-comparison-tooltip strong, .sales-comparison-tooltip em { display: block; margin-bottom: 7px; font-style: normal; font-weight: 700; }
.sales-comparison-tooltip div { display: flex; align-items: center; gap: 7px; line-height: 22px; }
.sales-comparison-tooltip div i { width: 7px; height: 7px; border-radius: 50%; }
.sales-comparison-tooltip div span { flex: 0 0 auto; }
.sales-comparison-tooltip div b { font-weight: 600; }
.sales-comparison-tooltip div small { display: inline; flex: 0 0 auto; margin-left: 4px; color: #64748b; font-size: 10px; line-height: 1; white-space: nowrap; }
.sales-comparison-tooltip div b { margin-left: auto; white-space: nowrap; }
.sales-comparison-tooltip em { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid rgba(100,116,139,.28); }
.sales-comparison-note { margin: 0 20px 12px; color: var(--muted); font-size: 12px; text-align: center; }
.sales-comparison-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px 18px; padding: 0 20px 18px; }
.sales-comparison-legend label { display: inline-flex; align-items: center; gap: 5px; color: var(--text); cursor: pointer; }
.sales-comparison-legend input { margin: 0; accent-color: var(--blue); }
.sales-comparison-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 50%; }
@media (max-width: 1180px) {
  .sales-comparison-hero { align-items: flex-start; flex-direction: column; }
  .sales-comparison-controls { flex-wrap: wrap; width: 100%; }
}
@media (max-width: 820px) {
  .sales-comparison-controls .generic-date-range { width: 100%; max-width: 100%; min-width: 0; }
}
.dashboard-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 16px 18px 12px; border-bottom: 1px solid #ebf0f3; }
.dashboard-panel-head h2 { margin: 0; font-size: 18px; line-height: 1.25; }
.dashboard-panel-head p { margin-top: 4px; font-size: 13px; line-height: 1.4; }
.dashboard-panel-head .ghost { min-height: 34px; padding: 6px 10px; white-space: nowrap; }

.dashboard-trend-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; padding: 16px 18px 0; }
.dashboard-trend-summary strong { color: var(--blue); font-size: 30px; line-height: 1; }
.dashboard-trend-summary span { color: var(--text); font-size: 14px; font-weight: 700; }
.dashboard-trend-summary em { margin-left: 8px; color: var(--muted); font-size: 12px; font-style: normal; }
.dashboard-trend { display: flex; align-items: end; gap: 3px; height: 105px; padding: 12px 18px 10px; border-bottom: 0; }
.dashboard-trend-column { position: relative; display: grid; flex: 1 1 0; align-items: end; min-width: 5px; height: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }
.dashboard-trend-column i { display: block; min-height: 4px; border-radius: 3px 3px 0 0; background: #86aef8; transition: background .15s, transform .15s; }
.dashboard-trend-column:hover i { background: var(--blue); transform: translateY(-2px); }
.dashboard-trend-column::after { content: attr(data-tooltip); position: absolute; z-index: 2; bottom: calc(100% + 8px); left: 50%; padding: 6px 9px; border: 1px solid #d9e3ec; border-radius: 5px; background: #1f2d3a; color: #fff; font-size: 12px; line-height: 1.2; white-space: nowrap; opacity: 0; pointer-events: none; transform: translate(-50%, 4px); transition: opacity .15s, transform .15s; }
.dashboard-trend-column:hover::after, .dashboard-trend-column:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.dashboard-trend-column span { position: absolute; bottom: -17px; left: 50%; color: #8a98a4; font-size: 10px; transform: translateX(-50%); }
.dashboard-new-sku-list { position: relative; display: grid; flex: 1 1 auto; grid-template-columns: repeat(8, 90px); grid-template-rows: max-content; grid-auto-flow: column; grid-auto-columns: 90px; align-content: start; min-height: 0; box-sizing: border-box; gap: 10px; padding: 30px 18px 8px; overflow-x: auto; overflow-y: hidden; }
.dashboard-new-sku-list::before { content: ''; position: absolute; top: 18px; right: 0; left: 0; height: 1px; background: #ebf0f3; pointer-events: none; }
.dashboard-new-sku { display: grid; gap: 5px; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--text); text-align: center; cursor: pointer; }
.dashboard-new-sku[hidden] { display: none; }
.dashboard-new-sku:hover strong { color: var(--blue); }
.dashboard-new-sku-photo { display: grid; place-items: center; width: 90px; height: 90px; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 8px; background: var(--gray-bg); color: var(--muted); font-size: 11px; }
.dashboard-new-sku-photo img { width: 100%; height: 100%; object-fit: cover; }
.dashboard-new-sku strong { width: 100%; overflow: hidden; color: var(--text); font-size: 12px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-new-sku small { width: 100%; color: var(--muted); font-size: 11px; text-align: center; }
.dashboard-new-sku small .date-cell { font-size: inherit; }

.dashboard-delist-list { display: grid; padding: 3px 12px 10px; }
.dashboard-delist-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; padding: 6px 5px; border: 0; border-bottom: 1px solid #ebf0f3; background: transparent; color: var(--text); text-align: left; cursor: default; }
.dashboard-delist-item:hover { background: #f8fafc; }
.dashboard-delist-item:last-child { border-bottom: 0; }
.dashboard-delist-photo { display: grid; place-items: center; width: 40px; height: 40px; overflow: hidden; border-radius: 5px; background: var(--gray-bg); color: var(--muted); font-size: 10px; }
.dashboard-delist-photo img { width: 100%; height: 100%; object-fit: cover; }
.dashboard-delist-info { display: grid; min-width: 0; gap: 2px; }
.dashboard-delist-info strong, .dashboard-delist-info em, .dashboard-delist-info small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-delist-info strong { font-size: 13px; }
.dashboard-delist-sku-copy { width: fit-content; }
.delisted-listing-stores { color: var(--blue); text-decoration: none; cursor: pointer; }
.delisted-sku-maintenance-link { color: var(--blue); text-decoration: none; }
.delisted-sku-maintenance-link:hover { color: var(--blue); text-decoration: none; }
.dashboard-date-range { position: relative; display: inline-flex; align-items: stretch; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.generic-date-range { justify-self: stretch; width: 100%; max-width: 100%; min-width: 0; flex-wrap: nowrap; overflow: visible; }
.dashboard-date-range-label { display: inline-flex; align-items: center; padding: 0 9px; border-right: 1px solid var(--line); font-size: 13px; line-height: 1; font-weight: 600; color: var(--text); background: var(--gray-bg); white-space: nowrap; }
.listing-toolbar-grid .generic-date-range .dashboard-date-range-label {
  /* Keep the date label visually consistent with ordinary filter labels. */
  padding: 0 9px;
  font-size: 13px;
  line-height: 1;
  font-weight: 600;
  color: var(--text);
  background: var(--gray-bg);
}
.dashboard-period-actions .dashboard-date-range-trigger { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) 22px; align-items: center; gap: 8px; min-width: 0; width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: 0; background: transparent; color: var(--text); text-align: left; white-space: nowrap; }
.dashboard-date-range-trigger strong { font-size: 13px; font-weight: 500; white-space: nowrap; }
.dashboard-date-range-trigger b { color: var(--muted); font-weight: 400; }
.dashboard-calendar-glyph { position: relative; width: 15px; height: 14px; border: 2px solid #7c8795; border-radius: 2px; }
.dashboard-calendar-glyph::before { content: ''; position: absolute; left: -2px; right: -2px; top: 2px; border-top: 2px solid #7c8795; }
.dashboard-date-popup { position: absolute; z-index: 80; top: calc(100% + 7px); right: 0; width: 520px; padding: 0 8px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 12px 28px rgba(22, 34, 51, .18); }
.dashboard-date-popup[hidden] { display: none; }
.dashboard-date-popup > header { display: grid; grid-template-columns: 28px 28px 1fr 28px 28px; align-items: center; height: 42px; border-bottom: 1px solid var(--line); }
.dashboard-period-actions .dashboard-date-popup > header button { min-height: 28px; padding: 0; border: 0; background: transparent; color: #687280; font-size: 21px; font-weight: 300; }
.dashboard-period-actions .dashboard-date-popup > header button:hover { color: var(--blue); background: #f3f7fb; }
.dashboard-calendar-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 5px; }
.dashboard-calendar-month h3 { margin: -34px 0 18px; text-align: center; font-size: 14px; font-weight: 600; pointer-events: none; }
.dashboard-calendar-week, .dashboard-calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.dashboard-calendar-week { margin-bottom: 3px; color: #9299a2; }
.dashboard-calendar-week span { display: grid; place-items: center; height: 23px; font-size: 11px; }
.dashboard-period-actions .dashboard-calendar-day { min-height: 0; height: 29px; padding: 0; border: 0; border-radius: 0; background: transparent; color: #17202b; font-size: 12px; }
.dashboard-period-actions .dashboard-calendar-day:hover { background: #e7f6f5; color: #087f79; }
.dashboard-period-actions .dashboard-calendar-day.is-outside { color: #c3c7cc; }
.dashboard-period-actions .dashboard-calendar-day.is-in-range { background: #d9f1ef; color: #17202b; }
.dashboard-period-actions .dashboard-calendar-day.is-preview-range { background: #d9f1ef; color: #17202b; }
.dashboard-period-actions .dashboard-calendar-day.is-preview-end { border-radius: 4px; background: #8fd8d3; color: #075e59; font-weight: 700; }
.dashboard-period-actions .dashboard-calendar-day.is-range-start,
.dashboard-period-actions .dashboard-calendar-day.is-range-end { border-radius: 5px; background: #0aa39a; color: #fff; font-weight: 700; }
.dashboard-period-actions .dashboard-calendar-day.is-today:not(.is-range-start):not(.is-range-end) { box-shadow: inset 0 0 0 1px #0aa39a; }
.dashboard-delist-info em { color: #9a532f; font-size: 12px; font-style: normal; }
.dashboard-delist-info small { color: var(--muted); font-size: 11px; }
.dashboard-sync-badge, .dashboard-done-badge { padding: 3px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.dashboard-sync-badge { background: #fde9e5; color: var(--danger); }
.dashboard-done-badge { background: var(--green-bg); color: var(--green); }

.dashboard-store-note { padding: 5px 8px; border-radius: 4px; background: #f0f4f7; color: var(--muted); font-size: 12px; white-space: nowrap; }
.dashboard-store-layout { display: grid; grid-template-columns: minmax(340px, .95fr) minmax(470px, 1.35fr); min-height: 318px; }
.dashboard-store-chart { display: grid; align-content: start; gap: 7px; padding: 16px 18px; border-right: 1px solid #ebf0f3; }
.dashboard-store-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) 82px; align-items: center; gap: 9px; width: 100%; min-height: 28px; padding: 0; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.dashboard-store-row:hover .dashboard-store-name { color: var(--blue); }
.dashboard-store-name { display: flex; align-items: center; gap: 4px; overflow: hidden; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-store-name i { padding: 1px 3px; border-radius: 3px; background: #edf0f2; color: #7f8a93; font-size: 9px; font-style: normal; font-weight: 400; }
.dashboard-store-bars { display: grid; align-content: center; gap: 3px; min-width: 0; }
.dashboard-store-bars i { display: block; min-width: 2px; height: 7px; border-radius: 4px; }
.dashboard-store-bars .listed, .dashboard-chart-legend .listed { background: var(--green); }
.dashboard-store-bars .delisted, .dashboard-chart-legend .delisted { background: #d5962d; }
.dashboard-store-action { display: flex; justify-content: flex-end; gap: 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.dashboard-store-action b { color: var(--green); font-weight: 700; }
.dashboard-store-action em { color: #aa6e1d; font-style: normal; }
.dashboard-chart-legend { display: flex; gap: 14px; padding-top: 7px; color: var(--muted); font-size: 11px; }
.dashboard-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dashboard-chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dashboard-store-metrics { min-width: 0; overflow-x: auto; }
.dashboard-store-metric-head, .dashboard-store-metric-row { display: grid; grid-template-columns: minmax(78px, 1fr) 88px minmax(128px, 1.25fr) minmax(110px, 1fr) 74px; align-items: center; column-gap: 10px; min-width: 570px; }
.dashboard-store-metric-head { min-height: 42px; padding: 0 16px; border-bottom: 1px solid #ebf0f3; background: #f7f9fa; color: var(--muted); font-size: 12px; font-weight: 700; }
.dashboard-store-metric-row { width: 100%; min-height: 35px; padding: 0 16px; border: 0; border-bottom: 1px solid #edf1f3; background: transparent; color: var(--text); font-size: 12px; text-align: left; cursor: pointer; }
.dashboard-store-metric-row:hover { background: #f8fafc; }
.dashboard-store-metric-row:last-child { border-bottom: 0; }
.dashboard-store-metric-row strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-store-metric-row > span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.dashboard-coverage { display: inline-block; width: 62px; height: 6px; overflow: hidden; border-radius: 8px; background: #e8edf1; }
.dashboard-coverage b { display: block; height: 100%; border-radius: inherit; background: var(--blue); }

.dashboard-exception-list { display: grid; gap: 8px; padding: 14px 18px 18px; }
.dashboard-exception { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 52px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); text-align: left; cursor: pointer; }
.dashboard-exception:hover { border-color: #b7c8d5; background: #f9fbfc; }
.dashboard-exception.has-issue { border-color: #f0c9c3; background: #fffafa; }
.dashboard-exception > span { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.dashboard-exception strong { color: var(--green); font-size: 20px; }
.dashboard-exception.has-issue strong { color: var(--danger); }
.dashboard-exception em { overflow: hidden; color: var(--text); font-size: 13px; font-style: normal; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-exception small { max-width: 48%; overflow: hidden; color: var(--muted); font-size: 11px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-activity-list { display: grid; padding: 4px 18px 12px; }
.dashboard-activity { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: start; gap: 9px; padding: 10px 0; border-bottom: 1px solid #ebf0f3; }
.dashboard-activity:last-child { border-bottom: 0; }
.dashboard-activity > span { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #86aef8; }
.dashboard-activity div { min-width: 0; }
.dashboard-activity strong { font-size: 12px; }
.dashboard-activity p { margin: 2px 0 0; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-activity time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.dashboard-empty { display: grid; place-items: center; min-height: 150px; padding: 16px; color: var(--muted); font-size: 13px; text-align: center; }
.dashboard-empty.compact { grid-column: 1 / -1; min-height: 68px; }

/* Listing toolbars respond to the width actually left beside the sidebar.
   Keep a date range as one intact control; when its grid cell is too narrow,
   move the whole control to a new row instead of wrapping its contents. */
@container (max-width: 1400px) {
  .query-toolbar-grid:has(> .generic-date-range) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* The preset buttons are a single control.  At the sidebar-preserving
     desktop widths, don't let the grid squeeze them into one half-width cell
     and make the presets fall into a vertical staircase. */
  .query-toolbar-grid > .sales-period-actions {
    grid-column: 1 / -1;
    grid-row: auto;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    min-width: 0;
    padding-bottom: 1px;
  }
  .query-toolbar-grid > .generic-date-range {
    grid-column: 1 / -1;
    grid-row: auto;
  }
  .query-toolbar-grid > .generic-date-range .dashboard-date-range-trigger {
    min-width: 0;
  }
  .query-toolbar-grid .listing-filter-actions {
    grid-column: auto;
    grid-row: auto;
  }
}

@container (max-width: 700px) {
  .query-toolbar-grid:has(> .generic-date-range) {
    grid-template-columns: minmax(0, 1fr);
  }
  .query-toolbar-grid > .generic-date-range,
  .query-toolbar-grid .listing-filter-actions {
    grid-column: 1;
  }
  .query-toolbar-grid > .sales-period-actions {
    grid-column: 1;
    grid-row: auto;
  }
}
.sticky-table-header-layer {
  position: fixed;
  z-index: 35;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 3px 10px rgba(23,32,38,.14);
  pointer-events: auto;
  scrollbar-width: none;
}
.sticky-table-header-layer::-webkit-scrollbar { display: none; }
.sticky-table-header-layer > table { margin: 0; border: 0; }
.sticky-table-header-layer th { position: relative; }
.sticky-table-header-layer .col-resizer { display: none; }

@media (max-width: 1080px) {
  .dashboard-primary-grid { grid-template-columns: 1fr; }
  .dashboard-new-style-panel, .dashboard-push-panel, .dashboard-delist-panel { height: auto; }
  .dashboard-delist-panel { min-height: auto; }
  .dashboard-store-layout { grid-template-columns: 1fr; }
  .dashboard-store-chart { border-right: 0; border-bottom: 1px solid #ebf0f3; }

  /* Keep the shared date-range filter inside its grid cell on tablets and
     narrow desktop windows.  The old max-content width made the label and
     trigger overflow into neighboring filters. */
  .listing-filter:has(> .generic-date-range) { min-width: 0; padding: 0; overflow: hidden; }
  .generic-date-range { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: stretch; width: 100%; max-width: 100%; min-width: 0; }
  .generic-date-range .dashboard-date-range-trigger { min-width: 0; width: 100%; grid-template-columns: minmax(0, 1fr) 14px minmax(0, 1fr) 18px; gap: 4px; padding-inline: 7px; overflow: hidden; }
  .generic-date-range .dashboard-date-range-trigger strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 1180px) {
  .dashboard-sales-charts,
  .sales-comparison-chart-area { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .sales-comparison-chart-area { overflow-y: hidden; }
  .dashboard-page { gap: 12px; }
  .dashboard-controls { align-items: flex-start; flex-direction: column; gap: 10px; padding: 12px; }
  .dashboard-period-actions { justify-content: flex-start; width: 100%; }
  .dashboard-period-actions label { flex: 1 1 145px; }
  .dashboard-period-actions input { flex: 1; min-width: 0; width: auto; }
  .dashboard-date-range { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: stretch; width: 100%; height: 42px; }
  .dashboard-date-range-label { min-width: 0; padding-inline: 9px; }
  .dashboard-period-actions .dashboard-date-range-trigger { min-width: 0; width: auto; grid-template-columns: minmax(0, 1fr) 14px minmax(0, 1fr) 18px; gap: 4px; padding-inline: 7px; overflow: hidden; }
  .dashboard-date-range-trigger strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .dashboard-date-range-trigger .dashboard-range-start { text-align: left; }
  .dashboard-date-range-trigger .dashboard-range-separator { text-align: center; white-space: nowrap; }
  .dashboard-date-range-trigger .dashboard-range-end { text-align: right; }
  .dashboard-date-range-trigger .dashboard-calendar-glyph { justify-self: end; }
  /* All pages use the same range picker.  Keep the label and trigger inside
     the filter width on narrow screens so the two dates cannot push the
     control outside its grid cell. */
  .listing-filter:has(> .generic-date-range) { min-width: 0; padding: 0; overflow: hidden; }
  .generic-date-range { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: stretch; width: 100%; max-width: 100%; height: 100%; min-width: 0; border: 0; border-radius: 0; background: transparent; }
  .generic-date-range .dashboard-date-range-trigger { min-width: 0; width: 100%; grid-template-columns: minmax(0, 1fr) 14px minmax(0, 1fr) 18px; gap: 4px; padding-inline: 7px; overflow: hidden; }
  .generic-date-range .dashboard-date-range-trigger strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .generic-date-range .dashboard-date-range-trigger .dashboard-range-start { text-align: left; }
  .generic-date-range .dashboard-date-range-trigger .dashboard-range-separator { text-align: center; white-space: nowrap; }
  .generic-date-range .dashboard-date-range-trigger .dashboard-range-end { text-align: right; }
  .generic-date-range .dashboard-date-range-trigger .dashboard-calendar-glyph { justify-self: end; }
  .dashboard-date-popup { position: fixed; top: 50%; right: 12px; left: 12px; width: auto; max-height: calc(100vh - 24px); overflow: auto; transform: translateY(-50%); }
  .dashboard-calendar-panels { grid-template-columns: 1fr; }
  .dashboard-calendar-month + .dashboard-calendar-month { display: none; }
  .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dashboard-kpi { min-height: 114px; padding: 13px; }
  .dashboard-kpi strong { font-size: 26px; }
  .dashboard-secondary-grid { grid-template-columns: 1fr; gap: 12px; }
  .dashboard-panel-head { padding: 14px; }
  .dashboard-new-sku-list { grid-template-columns: repeat(6, 90px); padding: 22px 14px 14px; }
  .dashboard-trend { padding-inline: 14px; }
  .dashboard-delist-list { padding-inline: 10px; }
  .dashboard-store-chart { padding-inline: 14px; }
  .dashboard-store-metric-head, .dashboard-store-metric-row { padding-inline: 14px; }
  .dashboard-exception-list, .dashboard-activity-list { padding-inline: 14px; }

  .sales-query-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .sales-query-toolbar > .sales-sku-filter, .sales-date-controls, .sales-query-toolbar > .listing-filter-actions { grid-column: 1; width: 100%; min-width: 0; }
  .sales-query-toolbar > .sales-sku-filter { grid-row: 1; }
  .sales-date-controls { display: flex; flex-direction: column; align-items: stretch; gap: 8px; grid-row: 2; }
  .sales-date-controls .sales-period-actions { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .sales-date-controls .sales-period-actions .ghost { min-height: 44px; flex: 0 0 auto; }
  .sales-date-controls .generic-date-range { width: 100%; min-width: 0; flex: 0 0 auto; }
  .sales-query-toolbar > .listing-filter-actions { grid-row: 3; margin-left: 0; justify-content: stretch; }
  .listing-date-range-filter { height: auto; min-height: 58px; padding-block: 5px; flex-wrap: wrap; align-content: center; row-gap: 2px; }
  .listing-date-range-filter > span:first-child { flex: 0 0 100%; }
  .listing-date-range-filter .range-fields { flex: 0 0 100%; width: 100%; }
  .listing-date-range-filter .range-fields input { height: 30px; padding-inline: 2px; font-size: 14px; }
}

@media (max-width: 500px) {
  .dashboard-period-actions button { flex: 0 0 auto; }
  .dashboard-period-actions > button:last-child { flex: 1 0 74px; }
  .dashboard-date-range-label { padding-inline: 8px; }
  .dashboard-new-sku-list { grid-template-columns: repeat(4, 90px); }
  .dashboard-delist-item { grid-template-columns: 36px minmax(0, 1fr); }
  .dashboard-delist-photo { width: 36px; height: 36px; }
  .dashboard-sync-badge, .dashboard-done-badge { grid-column: 2; justify-self: start; }
  .dashboard-store-row { grid-template-columns: 48px minmax(0, 1fr) 70px; }
  .dashboard-exception { align-items: flex-start; flex-direction: column; gap: 3px; }
  .dashboard-exception small { max-width: 100%; text-align: left; }
  .dashboard-activity { grid-template-columns: 8px minmax(0, 1fr); }
  .dashboard-activity time { grid-column: 2; }
}

@media (max-width: 380px) {
  .dashboard-date-range-label { padding-inline: 6px; font-size: 12px; }
  .dashboard-period-actions .dashboard-date-range-trigger { grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr) 16px; gap: 3px; padding-inline: 5px; }
  .dashboard-date-range-trigger strong { font-size: 12px; }
  .generic-date-range .dashboard-date-range-trigger { grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr) 16px; gap: 3px; padding-inline: 5px; }
  .generic-date-range .dashboard-date-range-trigger strong { font-size: 12px; }
}

.sales-board { display: grid; gap: 14px; }
.sales-spu-group { overflow: hidden; border: 1px solid #dce5eb; border-radius: 8px; background: #fff; }
.sales-spu-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; background: #e7f0ff; color: #162b45; font-size: 17px; }
.sales-spu-head span { color: #526679; font-size: 14px; }
.sales-spu-head b, .sales-sku-total b { color: #009c98; font-size: 18px; }
.sales-table-head { display: grid; grid-template-columns: minmax(250px, 1fr) 120px 90px 80px 80px 80px 58px; gap: 8px; padding: 11px 20px; color: #718191; background: #fafcfd; border-top: 1px solid #edf1f4; border-bottom: 1px solid #edf1f4; font-size: 13px; text-align: center; }
.sales-table-head span:first-child { text-align: left; }
.sales-sku-row { display: grid; grid-template-columns: minmax(250px, 1fr) 100px minmax(360px, 2fr); align-items: start; gap: 14px; padding: 14px 20px; border-top: 1px solid #edf1f4; }
.sales-sku-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sales-sku-info strong { display: block; color: #172333; font-size: 16px; }
.sales-sku-info span { display: block; margin-top: 5px; color: #718191; font-size: 13px; }
.sales-sku-photo { width: 58px; height: 58px; flex: 0 0 58px; border-radius: 8px; object-fit: cover; background: #f1f4f6; }
.sales-sku-total { padding-top: 15px; color: #718191; font-size: 13px; }
.sales-detail-list { display: grid; gap: 7px; }
.sales-detail-row { display: grid; grid-template-columns: 70px 120px 90px 80px 80px 45px 58px; align-items: center; gap: 8px; min-height: 34px; color: #4d6070; font-size: 13px; }
.sales-detail-row strong { color: #009c98; font-size: 16px; }
.sales-detail-row .ghost { padding: 5px 9px; font-size: 12px; }
.sales-size-input { min-width: 0; }
.sales-size-input label { text-align: center; }
.sales-size-input input { text-align: center; }
.sales-result-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  background: #fff;
  border: 1px solid #dce5eb;
  border-radius: 8px;
}
.sales-result-table {
  width: 100%;
  min-width: 1247px;
  table-layout: auto;
  border-collapse: collapse;
}
.sales-result-table th,
.sales-result-table td {
  border-right: 1px solid #dfe5ea;
  border-bottom: 1px solid #dfe5ea;
  padding: 10px 12px;
  text-align: center;
  vertical-align: middle;
}
.sales-result-table th:last-child,
.sales-result-table td:last-child { border-right: 0; }
.sales-result-table thead th {
  height: 42px;
  color: #596b7b;
  background: #f4f6f8;
  font-weight: 500;
}
.sales-result-table th:nth-child(1) { width: 260px; min-width: 260px; text-align: left; }
.sales-result-table th:nth-child(n+3):nth-child(-n+11) {
  /* Nine quantity columns share the available space equally. */
  width: calc((100% - 493px) / 9);
  min-width: 80px;
}
.sales-result-table th:nth-child(2) { width: 180px; min-width: 180px; }
.sales-result-table th:nth-child(9),
.sales-result-table th:nth-child(10),
.sales-result-table th:nth-child(11) { width: 100px; }
.sales-result-table th:nth-child(12) { width: 100px; min-width: 100px; }
.sales-result-table tbody tr:last-child td { border-bottom: 0; }
.sales-result-table .sales-spu-summary td {
  height: 44px;
  color: #172b45;
  background: #e4efff;
  font-size: 14px;
}
.sales-result-table .sales-spu-summary td:first-child {
  padding-left: 18px;
  text-align: left;
}
.sales-result-table .sales-spu-summary strong { font-size: 15px; }
.sales-result-table .sales-spu-summary b {
  color: #009c98;
  font-size: 17px;
}
.sales-result-table .sales-product-cell {
  padding: 6px 10px;
  text-align: left;
  white-space: nowrap;
}
.sales-table-product {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.sales-table-product img,
.sales-table-photo-empty {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 8px;
  object-fit: cover;
  background: #f0f3f5;
}
.sales-table-product strong {
  display: block;
  margin-top: 2px;
  color: #162638;
  font-size: 15px;
  line-height: 1.4;
  white-space: nowrap;
}
.sales-table-product small {
  display: block;
  margin-top: 2px;
  color: #718191;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.sales-result-table .sales-size-name {
  color: #253849;
  font-weight: 600;
}
.sales-result-table .sales-qty-value {
  color: #009c98;
  font-size: 15px;
}
.sales-result-table .sales-row-total {
  color: #008f8b;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  background: transparent;
}
.sales-result-table .sales-daily-data-row:hover td { background: #f8fbff; }
.sales-result-table .sales-daily-data-row:hover .sales-row-total { background: #eaf8f7; }
.sales-hierarchical-table { --sales-offline-col-width: 88px; --sales-group-border: #4f83c2; --sales-visible-column-count: 19; min-width: 2250px; width: 100%; table-layout: fixed; }
.sales-hierarchical-table:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"]) { --sales-visible-column-count: 24; min-width: 2568px; }
.sales-hierarchical-table thead tr:first-child th:first-child { width: 186px; min-width: 186px; }
.sales-hierarchical-table thead tr:first-child th:nth-child(2) { width: 216px; min-width: 216px; }
.sales-hierarchical-table thead tr:nth-child(2) th { width: calc((100% - 402px) / var(--sales-visible-column-count)); min-width: 0; }
.sales-hierarchical-table .sales-stock-status { display: block; width: 100%; color: #1479c9; font-weight: 600; text-align: center; white-space: nowrap; }
.sales-hierarchical-table .sales-stock-tier { display: block; width: 100%; text-align: center; white-space: nowrap; }
.sales-hierarchical-table .sales-size-tier { margin-left: 18px; font-size: 12px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.sales-warehouse-days-danger { color: #dc2626; font-weight: 700; }
.sales-warehouse-days-warning { color: #d97706; font-weight: 700; }
.sales-warehouse-days-infinite { color: #5d7287; font-weight: 700; }
.sales-warehouse-low { color: #dc2626; font-weight: 700; }
.sales-filter-multi { position: relative; }
.sales-filter-multi > .sales-filter-trigger { width: 100%; height: 100%; border: 0; background: transparent; display: flex; align-items: center; gap: 8px; padding: 0 9px; font: inherit; cursor: pointer; }
.sales-filter-multi > .sales-filter-trigger span { color: var(--text); font-weight: 600; white-space: nowrap; }
.sales-filter-multi > .sales-filter-trigger em { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: left; color: #9aa5ad; font-style: normal; white-space: nowrap; }
.sales-filter-multi > .sales-filter-trigger b { width: 9px; height: 9px; margin: -5px 3px 0 0; border-right: 1.6px solid var(--text); border-bottom: 1.6px solid var(--text); transform: rotate(45deg); flex: 0 0 auto; }
.sales-filter-multi.open > .sales-filter-trigger b { margin-top: 5px; transform: rotate(225deg); }
.sales-filter-multi.open .sales-filter-options { display: grid; gap: 2px; max-height: 260px; overflow-y: auto; }
.sales-filter-options .sales-filter-all { border-bottom: 1px solid #d7e0e7; margin-bottom: 4px; padding-bottom: 8px; font-weight: 600; }
.sales-hierarchical-table thead tr:first-child th { background: #edf3fb; color: #40546a; font-weight: 600; }
.sales-hierarchical-table thead th { text-align: center !important; }
.sales-hierarchical-table .sales-group-end { border-right: 1px solid var(--sales-group-border) !important; }
.sales-hierarchical-table .table-column-group-end { border-right: 1px solid var(--sales-group-border) !important; }
/* 最右侧使用容器的普通边框；隐藏列后也不把最后一个分组的深色线作为外边框。 */
.sales-hierarchical-table:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"]) tr > :nth-last-child(1 of :not([hidden])) { border-right: 0 !important; }
.sales-hierarchical-table tbody .sales-group-summary > td:nth-child(2),
.sales-hierarchical-table tbody .sales-daily-data-row > td:first-child {
  border-right: 1px solid var(--sales-group-border) !important;
}
.sales-sort-header { border: 0; padding: 0; color: inherit; background: transparent; font: inherit; cursor: pointer; }
.sales-hierarchical-table .sales-sort-header { white-space: nowrap; }
.sales-sort-header:hover { color: #1479c9; }
.sales-sort-header.is-active { color: #1479c9; font-weight: 700; }
.sales-hierarchical-table .sales-group-summary td { background: #f2f7ff; font-weight: 600; color: #273b52; }
.sales-hierarchical-table .sales-group-summary td small { font-weight: 400; }
.sales-hierarchical-table .sales-daily-data-row td:first-child { text-align: left; min-width: 130px; }
.sales-hierarchical-table .sales-offline-group { background: #edf3fb; }
.sales-hierarchical-table .sales-offline-subhead { background: #f4f6f8; }
.sales-hierarchical-table .sales-offline-stock-cell { vertical-align: middle; background: #fff; }
.sales-hierarchical-table .sales-offline-group,
.sales-hierarchical-table .sales-offline-subhead,
.sales-hierarchical-table .sales-offline-stock-cell {
  position: static;
  width: var(--sales-offline-col-width);
  min-width: var(--sales-offline-col-width);
  max-width: var(--sales-offline-col-width);
}
.sales-hierarchical-table .sales-offline-group {
  width: calc(var(--sales-offline-col-width) * 3);
  min-width: calc(var(--sales-offline-col-width) * 3);
  max-width: calc(var(--sales-offline-col-width) * 3);
}
.sales-hierarchical-table:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"]) .sales-offline-group { width: calc(var(--sales-offline-col-width) * 4); min-width: calc(var(--sales-offline-col-width) * 4); max-width: calc(var(--sales-offline-col-width) * 4); }
.sales-hierarchical-table:not(:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"])) tbody .sales-offline-stock-cell:nth-last-child(3) { border-left: 1px solid var(--sales-group-border) !important; }
.sales-hierarchical-table:not(:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"])) thead tr:nth-child(2) .sales-offline-subhead:nth-last-child(3) { border-left: 1px solid var(--sales-group-border) !important; }
.sales-hierarchical-table:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"]) tbody .sales-offline-on_hand_qty { border-left: 1px solid var(--sales-group-border) !important; }
.sales-hierarchical-table:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"]) thead [data-table-column="onHand"] { border-left: 1px solid var(--sales-group-border) !important; }
.sales-hierarchical-table .sales-order-group { width: 450px; min-width: 450px; max-width: 450px; border-left: 1px solid var(--sales-group-border) !important; }
.sales-result-table-wrap > .sales-hierarchical-table:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"]) thead tr:nth-child(2) .sales-order-subhead { width: 110px !important; min-width: 110px !important; max-width: 110px; white-space: normal; }
.sales-hierarchical-table :is(.sales-order-input, .sales-order-days) { display: block; width: 80px !important; max-width: 80px !important; min-width: 80px !important; box-sizing: border-box; height: 28px; padding: 3px 4px; border: 1px solid #b8d9c9; border-radius: 5px; background: #fff; color: #215b48; font: inherit; text-align: center; }
.sales-hierarchical-table :is(.sales-order-input, .sales-order-days):focus { border-color: #4caa7d; outline: 2px solid rgba(76, 170, 125, .18); outline-offset: 1px; }
.sales-hierarchical-table .sales-offline-group { border-left: 1px solid var(--sales-group-border) !important; }
.sales-hierarchical-table .sales-group-summary .sales-offline-stock-cell { background: #f2f7ff; }
.sales-offline-days-value,
.sales-hierarchical-table .sales-order-days { color: #1479c9; font-weight: 700; }
.sales-hierarchical-table .sales-offline-stock-empty { color: #b7c7bc; }
.sales-offline-stock-value { display: inline-block; min-width: 28px; color: inherit; font-weight: 700; text-decoration: underline dotted; text-underline-offset: 3px; cursor: crosshair; }
.sales-hierarchical-table .sales-offline-on_hand_qty .sales-offline-stock-value { color: #60a5fa; }
.sales-offline-stock-value:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; border-radius: 3px; }
.sales-offline-tooltip { position: fixed; z-index: 1000; width: 190px; padding: 10px 11px; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff; box-shadow: 0 10px 30px rgba(15,23,42,.18); color: #334155; font-size: 13px; pointer-events: none; }
.sales-offline-tooltip-title { display: block; margin-bottom: 8px; color: #0f172a; }
.sales-offline-tooltip-list { display: grid; gap: 4px; max-height: 180px; overflow-y: auto; }
.sales-offline-tooltip-row, .sales-offline-tooltip-total { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sales-offline-tooltip-row strong, .sales-offline-tooltip-total strong { color: #334155; }
.sales-offline-tooltip-total { margin-top: 8px; padding-top: 8px; border-top: 1px solid #e2e8f0; font-weight: 700; }
.sales-offline-tooltip-empty { color: #94a3b8; }
.sales-hierarchical-table td { padding: 8px 10px; }
.sales-hierarchical-table .sales-table-product img,
.sales-hierarchical-table .sales-table-photo-large { width: 92px; height: 116px; flex-basis: 92px; border-radius: 6px; }
.sales-hierarchical-table .sales-product-cell { width: 186px; min-width: 186px; white-space: normal; }
.sales-hierarchical-table .sales-table-product small { display: block; }
.legacy-sales-table { min-width: 1500px; }
.legacy-sales-table th:first-child { width: 300px; min-width: 300px; }
.legacy-sales-table th:nth-child(2) { width: 210px; min-width: 210px; }
.legacy-sales-table .sales-table-product small { display: block; }
.legacy-sales-trend { width: 112px; height: 34px; flex: 0 0 112px; }
.legacy-sales-store-filter .legacy-sales-store-all-option { margin-right: 5px; padding-right: 12px !important; border-right: 1px solid #cbd5e1; }
.toolbar:has(.legacy-sales-toolbar) { position: relative; z-index: 8; overflow: visible; }
.sales-query-toolbar.legacy-sales-toolbar:not(.factory-inventory-toolbar) { min-width: 0; grid-template-columns: 300px 300px 300px max-content max-content; justify-content: start; }
.legacy-sales-toolbar > .sales-filter-multi { width: 100%; min-width: 0; }
.legacy-sales-toolbar > .sales-filter-multi.open { z-index: 15; }
.legacy-sales-toolbar > .sales-date-controls { grid-column: 4; grid-row: 1; width: max-content; max-width: none; gap: 10px; margin-left: 8px; }
.legacy-sales-toolbar > .sales-date-controls .sales-period-actions { flex-wrap: nowrap; gap: 4px; }
.legacy-sales-toolbar > .sales-date-controls .sales-period-actions .ghost { padding-inline: 7px; white-space: nowrap; }
.legacy-sales-toolbar > .sales-date-controls .generic-date-range { width: 320px; min-width: 320px; max-width: 320px; flex: 0 0 320px; }
.legacy-sales-toolbar > .listing-filter-actions { grid-column: 5; grid-row: 1; margin-left: 0; justify-content: flex-end; flex-wrap: nowrap; }
.legacy-sales-store-filter { flex-wrap: wrap; }
.sales-product-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.sales-hierarchical-table .sales-product-stack img,
.sales-hierarchical-table .sales-product-stack .sales-table-photo-large { align-self: center; }
.sales-hierarchical-table .sales-product-stack > strong { white-space: nowrap; font-size: 14px; }
.stock-alert-product-heading { display: inline-flex; align-items: center; gap: 4px; min-height: 18px; }
.stock-alert-product-heading > strong { color: #162638; font-size: 14px; line-height: 1.45; white-space: nowrap; }
.stock-alert-copy-button { width: 20px; height: 20px; min-height: 20px; padding: 1px; border: 0; background: transparent; color: #526579; cursor: pointer; }
.stock-alert-copy-button:hover, .stock-alert-copy-button:focus-visible { color: var(--blue); outline: 0; }
.stock-alert-copy-button .copy-icon { width: 16px; height: 16px; flex: 0 0 16px; }
.sales-product-stack img, .sales-product-stack .sales-table-photo-large { width: 92px; height: 116px; object-fit: cover; border-radius: 6px; background: #f0f3f5; }
.sales-product-stack strong { color: #162638; line-height: 1.45; }
.sales-product-stack small { color: #718191; line-height: 1.4; }
.sales-product-stack .copy-text-target { gap: 4px; white-space: nowrap; flex-shrink: 0; }
.sales-product-stack > small:not(.sales-stock-status) { white-space: nowrap; overflow-wrap: normal; }
.sales-product-stack .copy-icon { width: 13px; height: 13px; }
.sales-product-heading { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.sales-product-heading > strong { font-size: 14px; }
.sales-listing-status { font-size: 12px; font-weight: 600; white-space: nowrap; flex-shrink: 0; padding: 1px 5px; border-radius: 4px; line-height: 1.4; }
.sales-listing-status.is-active { color: var(--blue); background: #dbeafe; }
.sales-listing-status.is-inactive { color: #dc2626; background: #fee2e2; }
.sales-listing-status.is-unregistered { color: #c48245; background: #fff5e9; }
.sales-hierarchical-table:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"]) .sales-product-cell,
.sales-hierarchical-table:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"]) thead tr:first-child th:first-child { width: 240px; min-width: 240px; }
.sales-hierarchical-table:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"]) thead tr:nth-child(2) th { width: calc((100% - 456px) / var(--sales-visible-column-count)); }
.sales-result-table .ghost { padding: 6px 10px; font-size: 12px; }
.sales-result-table .page-state { height: 120px; }
.sales-total-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}
.sales-total-cell > strong { flex: 0 0 auto; }
.sales-trend-wrap {
  position: relative;
  width: 112px;
  height: 34px;
  flex: 0 0 112px;
  overflow: visible;
}
.sales-trend-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.sales-trend-area { fill: rgba(15, 159, 154, .12); }
.sales-trend-line {
  fill: none;
  stroke: #0f9f9a;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sales-trend-point {
  display: none;
  fill: #0f9f9a;
  stroke: #fff;
  stroke-width: 1.5;
}
.sales-trend-hit { fill: transparent; cursor: crosshair; }
.sales-trend-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  bottom: auto;
  z-index: 10000;
  display: none;
  padding: 4px 7px;
  border-radius: 4px;
  background: #1f2937;
  color: #fff;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
@media (max-width: 900px) {
  .sales-total-cell { gap: 4px; min-width: 0; }
  .sales-trend-wrap { width: 82px; height: 30px; flex-basis: 82px; }
}
.sales-period-actions {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: 1px;
}
.sales-period-actions .ghost { padding: 8px 13px; }
.sales-period-actions .ghost.is-active { color: var(--blue); background: #e8f0ff; }
.sales-period-summary { margin: 12px 0 8px; color: var(--muted); font-size: 13px; }
.inventory-refresh-countdown { color: var(--blue); font-weight: 600; white-space: nowrap; }
.page-note { margin: 12px 0; padding: 12px 14px; color: var(--muted); background: #f5f8fa; border: 1px solid var(--line); border-radius: 8px; }
.stock-alert-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.stock-alert-table-wrap { overflow: auto; max-height: calc(100vh - 330px); }
.stock-alert-table { min-width: 2720px; table-layout: fixed; }
.stock-alert-table th { width: 88px; min-width: 88px; white-space: nowrap; }
.stock-alert-table thead tr:first-child th:first-child { width: 186px; min-width: 186px; }
.stock-alert-table thead tr:first-child th:nth-child(2) { width: 216px; min-width: 216px; }
.stock-alert-table .stock-alert-sales-compact { width: 62px; min-width: 62px; max-width: 62px; padding-left: 5px; padding-right: 5px; }
.stock-alert-table th:nth-last-child(4) { width: 190px; min-width: 190px; }
.stock-alert-table th:nth-last-child(1) { width: 180px; min-width: 180px; }
.stock-alert-table .sales-group-summary td { background: #eef5ff; font-weight: 600; }
.stock-alert-policy-dialog { width: min(1080px, calc(100vw - 40px)); max-width: none; }
.form-grid.stock-alert-policy-form { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stock-alert-policy-form > label { min-width: 0; }
.stock-alert-policy-form > label:not(.full) { grid-column: span 2; }
.stock-alert-policy-form > .full { grid-column: 1 / -1; }
.stock-alert-policy-form > label input,
.stock-alert-policy-form > label textarea { width: 100%; box-sizing: border-box; }
.stock-alert-policy-form small { color: var(--muted); font-size: 12px; }
.stock-alert-tier-settings { display: grid; grid-template-columns: repeat(5, minmax(90px, 1fr)); gap: 14px; padding: 0; border: 0; background: transparent; }
.stock-alert-tier-settings label { min-width: 0; }
.stock-alert-tier-settings input { width: 100%; box-sizing: border-box; }
.stock-alert-tier-filter { margin: 0; align-self: end; }
.stock-alert-table .sales-sort-header { display: inline-flex; align-items: center; justify-content: center; gap: 5px; width: 100%; white-space: nowrap; }
.stock-alert-table .sales-sort-header.is-active { color: #1769e0; font-weight: 700; }
.stock-alert-sort-arrow { display: inline-block; width: 10px; text-align: center; }
.stock-alert-detail-cell { cursor: help; }
.stock-alert-table .stock-alert-crosshair,
.stock-alert-table .stock-alert-crosshair * { cursor: crosshair !important; }
.stock-alert-account-filter { margin-left: auto; }
.stock-alert-progress-overlay { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; pointer-events: none; background: transparent; }
.stock-alert-progress-overlay[hidden] { display: none; }
.stock-alert-progress-card { width: min(520px, calc(100vw - 48px)); padding: 22px 26px 24px; color: #1976d2; text-align: center; background: transparent; }
.stock-alert-progress-title { margin-bottom: 13px; font: 500 25px/1.2 system-ui, sans-serif; letter-spacing: .06em; color: #2589f5; text-shadow: 0 0 8px rgba(37,137,245,.75), 0 0 22px rgba(31,126,230,.48); }
.stock-alert-loading-dots { display: inline-block; width: 1.5em; white-space: nowrap; vertical-align: bottom; }
.stock-alert-loading-dots-inner { display: inline-block; white-space: nowrap; text-align: left; }
.stock-alert-progress-message { min-height: 20px; margin-bottom: 11px; color: #526579; font-size: 13px; text-shadow: 0 1px 0 rgba(255,255,255,.8); }
.stock-alert-progress-track { position: relative; height: 17px; padding: 3px; overflow: hidden; border: 1px solid rgba(43,117,190,.72); border-radius: 999px; background: rgba(18,52,88,.24); box-shadow: inset 0 1px 5px rgba(12,47,83,.32), 0 0 8px rgba(42,135,220,.28); }
.stock-alert-progress-fill { position: relative; width: 36%; height: 100%; overflow: hidden; border-radius: inherit; background: repeating-linear-gradient(135deg, #2988ed 0 5px, #8bd1ff 5px 8px); box-shadow: 0 0 6px 2px #49a7ff, 0 0 13px 4px rgba(59,153,245,.68), inset 0 1px 2px rgba(255,255,255,.95); }
.stock-alert-progress-fill::after { position: absolute; inset: 0; content: ''; background: linear-gradient(90deg, transparent, rgba(255,255,255,.95), transparent); transform: translateX(-120%); animation: stock-alert-shine 1.5s ease-in-out infinite; }
.stock-alert-progress-overlay.is-indeterminate .stock-alert-progress-fill { animation: stock-alert-travel 1.4s linear infinite; }
@keyframes stock-alert-shine { to { transform: translateX(120%); } }
@keyframes stock-alert-travel { from { transform: translateX(-115%); } to { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) {
  .stock-alert-progress-overlay.is-indeterminate .stock-alert-progress-fill { animation-duration: 1.4s !important; animation-iteration-count: infinite !important; }
  .stock-alert-progress-fill::after { animation-duration: 1.5s !important; animation-iteration-count: infinite !important; }
}
.stock-alert-table tbody .sales-daily-data-row > td:nth-child(11),
.stock-alert-table tbody .sales-daily-data-row > td:nth-child(15),
.stock-alert-table tbody .sales-daily-data-row > td:nth-child(17),
.stock-alert-table tbody .sales-daily-data-row > td:nth-child(20),
.stock-alert-table tbody .sales-group-summary > td:nth-child(12),
.stock-alert-table tbody .sales-group-summary > td:nth-child(16),
.stock-alert-table tbody .sales-group-summary > td:nth-child(18),
.stock-alert-table tbody .sales-group-summary > td:nth-child(21) { border-right: 1px solid var(--sales-group-border) !important; }
@media (max-width: 760px) {
  .stock-alert-kpi-grid { grid-template-columns: repeat(4, minmax(115px, 1fr)); overflow-x: auto; }
  .form-grid.stock-alert-policy-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stock-alert-tier-settings { grid-template-columns: repeat(5, minmax(82px, 1fr)); overflow-x: auto; }
}
.import-result-panel { margin-top: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.import-result-summary { display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); margin-bottom: 14px; }
.import-result-summary span { padding: 8px 12px; background: #f5f8fa; border-radius: 5px; }
.daily-sales-import-change { margin: 0 0 14px; padding: 10px 12px; border: 1px solid #c9e7d8; border-radius: 6px; background: #f0faf4; color: #187547; }
.daily-sales-import-change.is-decrease { border-color: #f0d6a8; background: #fff9ed; color: #8a5b13; }
.daily-sales-undo-link { align-self: center; color: var(--blue); cursor: pointer; text-decoration: none; white-space: nowrap; }
.daily-sales-undo-link:hover { color: var(--blue-dark, #1558c0); text-decoration: none; }
.import-result-errors h3 { margin: 10px 0; color: var(--danger, #c53d36); font-size: 15px; }
.import-result-errors table { width: 100%; }
dialog.sales-detail-dialog { width: min(920px, 92vw); }
dialog.sales-detail-dialog .sales-detail-product-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 20px; }
.sales-detail-product-photo { flex: 0 0 42px; width: 42px; height: 56px; object-fit: cover; border-radius: 5px; }
dialog.sales-detail-dialog img.sales-detail-product-photo { cursor: default; }
.sales-detail-product-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sales-detail-product-heading .sales-detail-period { display: block; margin: 0; font-weight: 400; line-height: 1.4; }
.sales-detail-fields { display: block; width: 100%; min-width: 0; }
.sales-detail-period { margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.sales-detail-table-wrap { max-height: 55vh; max-height: 55dvh; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.sales-detail-table { width: 100%; min-width: 0; table-layout: fixed; }
.sales-detail-table th, .sales-detail-table td { padding: 8px 6px; text-align: center; white-space: normal; overflow-wrap: anywhere; }
.sales-detail-table th { background: #f4f6f8; }
.sales-detail-table th:nth-child(1) { width: 54px; }
.sales-detail-table th:nth-child(2) { width: 150px; }
.sales-detail-table th:nth-child(n+3):nth-child(-n+8) { width: 40px; padding-left: 3px; padding-right: 3px; }
.sales-detail-table th:nth-child(n+9):nth-child(-n+11) { width: 60px; padding-left: 4px; padding-right: 4px; }
.sales-detail-table td:nth-child(2) { overflow: visible; white-space: nowrap; }
.sales-detail-table td:nth-child(2) .sales-total-cell { justify-content: flex-start; gap: 6px; }
.sales-detail-table tbody tr.sales-spu-summary:last-child td { border-bottom: 0; }
.sales-detail-table tbody tr.sales-spu-summary td { font-weight: 700; }
.daily-sales-dialog .form-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: 14px; row-gap: 12px; }
.daily-sales-dialog .form-grid > label:not(.sales-size-input):not(.full) { grid-column: span 2; }
.daily-sales-dialog .form-grid > label.sales-size-input { grid-column: span 1; width: 76px; justify-self: center; text-align: center; }
.daily-sales-dialog .form-grid > label.sales-size-input input { width: 76px; box-sizing: border-box; text-align: center; }
.sales-size-summary { margin: -2px 0 4px 0; color: #637687; font-size: 12px; }
@media (max-width: 900px) {
  .sales-table-head { display: none; }
  .sales-sku-row { grid-template-columns: 1fr 80px; }
  .sales-detail-list { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .matrix-link-head { display: none; }
  .matrix-link-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .matrix-link-row > :nth-child(-n+5) { width: 100%; }
  .matrix-link-row .matrix-link-remove { justify-self: end; }
  .form-grid.factory-size-form { grid-template-columns: repeat(7, minmax(0, 1fr)); overflow-x: auto; }
  .daily-sales-dialog .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .daily-sales-dialog .form-grid > label:not(.sales-size-input):not(.full) { grid-column: 1 / -1; }
  .daily-sales-dialog .form-grid > label.sales-size-input { grid-column: span 1; width: 70px; }
  .daily-sales-dialog .form-grid > label.sales-size-input input { width: 70px; }
}
@media (max-width: 560px) {
  .sales-spu-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .sales-sku-row { padding: 12px; }
  .sales-detail-row { grid-template-columns: 52px 82px 70px 62px 62px 38px 50px; gap: 3px; font-size: 11px; }
}

.inventory-grouped-table .inventory-merged-cell { vertical-align: middle; }
.inventory-grouped-table tbody tr:nth-child(6n+1):not(:first-child) td { border-top: 2px solid #aebdca; }
.inventory-grouped-table td:nth-child(2) { max-width: 420px; white-space: normal; line-height: 1.45; }


.inventory-trend { margin-left: 5px; font-weight: 800; }
.inventory-trend-up { color: #0f9f6e; }
.inventory-trend-down { color: #dc3f2f; }


.inventory-product-name { margin-bottom: 7px; color: var(--text); font-weight: 600; line-height: 1.45; }
.inventory-image-cell { width: 92px; text-align: center; vertical-align: middle; }
.inventory-image-cell img, .inventory-image-cell .sales-table-photo-empty { display: inline-block; width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: #f0f3f5; }


.inventory-system-sku { display: inline-flex; align-items: center; font-weight: 700; }
.inventory-product-name { margin-top: 6px; margin-bottom: 0; color: var(--muted); font-weight: 400; line-height: 1.4; }
.inventory-grouped-table tbody td:not([rowspan]) { padding: 3px 12px; }
.inventory-image-cell { width: 110px; padding: 0 !important; overflow: hidden; vertical-align: middle; }
.inventory-image-cell img { display: block; width: 100%; height: 100%; min-height: 100%; object-fit: contain; object-position: center; border-radius: 0; background: transparent; }
.inventory-image-cell .sales-table-photo-empty { display: block; width: 100%; height: 100%; min-height: 64px; border-radius: 0; }

.inventory-image-cell img { width: auto; height: auto; max-width: 70%; max-height: 70%; min-height: 0; margin: 0 auto; object-fit: contain; object-position: center; }
.inventory-image-cell .sales-table-photo-empty { width: 70%; height: 70%; min-height: 52px; margin: 0 auto; }



.inventory-sync-button { background: #fff0dc; border: 1px solid #f4c98d; color: #b56516; }
.inventory-sync-button:hover { background: #ffe4bd; border-color: #edae63; color: #8f4b09; }
.inventory-sync-countdown { color: var(--muted); font-size: 12px; line-height: 1.1; white-space: nowrap; }
.factory-inventory-summary { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.factory-inventory-summary > .inventory-refresh-countdown { position: absolute; left: 50%; transform: translateX(-50%); }




.inventory-change-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; padding: 2px 0; border: 0; border-radius: 0; background: transparent; }
.inventory-change-filter > span { margin-right: 4px; color: var(--muted); font-size: 14px; font-weight: 600; }
.inventory-change-filter label { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 10px; border: 1px solid #ccd8e1; border-radius: 16px; background: #fff; color: #40586a; cursor: pointer; }
.inventory-change-filter label:has(input:checked) { border-color: #1769e0; background: #edf5ff; color: #1769e0; }
.inventory-change-filter input { margin: 0; }
.inventory-change-filter small { margin-left: auto; color: var(--muted); }

.inventory-change-button { border: 1px solid #ccd8e1; border-radius: 16px; background: #fff; color: #40586a; cursor: pointer; padding: 5px 12px; font-size: 14px; }
.inventory-change-button.is-active { border-color: #1769e0; background: #edf5ff; color: #1769e0; }
.inventory-change-button:hover { border-color: #1769e0; }


.inventory-sort-header { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: 0; }
.inventory-sort-header:hover { color: #1769e0; }





.inventory-grouped-table { width: 100%; table-layout: fixed; }
.inventory-grouped-table th:nth-child(1), .inventory-grouped-table td:nth-child(1) { width: 24%; }
.inventory-grouped-table th:nth-child(2), .inventory-grouped-table td:nth-child(2) { width: 11%; }
.inventory-grouped-table th:nth-child(3), .inventory-grouped-table td:nth-child(3) { width: 10%; }
.inventory-grouped-table th:nth-child(4), .inventory-grouped-table td:nth-child(4), .inventory-grouped-table th:nth-child(5), .inventory-grouped-table td:nth-child(5), .inventory-grouped-table th:nth-child(6), .inventory-grouped-table td:nth-child(6) { width: 18.333%; }
.inventory-grouped-table .inventory-sort-header { display: block; width: 100%; }
.inventory-grouped-table .inventory-product-name { overflow-wrap: anywhere; }

/* 工厂库存查询：按屏幕宽度自适应，保持排序前后列宽稳定 */
.factory-inventory-page,
.inventory-query-page { min-width: 0; }
.inventory-grouped-table-wrap,
.inventory-grouped-table { min-width: 0; }

@media (min-width: 1281px) {
  .inventory-grouped-table th:nth-child(1), .inventory-grouped-table td:nth-child(1) { width: 28%; }
  .inventory-grouped-table th:nth-child(2), .inventory-grouped-table td:nth-child(2) { width: 12%; }
  .inventory-grouped-table th:nth-child(3), .inventory-grouped-table td:nth-child(3) { width: 9%; }
  .inventory-grouped-table th:nth-child(4), .inventory-grouped-table td:nth-child(4),
  .inventory-grouped-table th:nth-child(5), .inventory-grouped-table td:nth-child(5),
  .inventory-grouped-table th:nth-child(6), .inventory-grouped-table td:nth-child(6) { width: 17%; }
}

@media (min-width: 821px) and (max-width: 1280px) {
  .inventory-grouped-table th:nth-child(1), .inventory-grouped-table td:nth-child(1) { width: 25%; }
  .inventory-grouped-table th:nth-child(2), .inventory-grouped-table td:nth-child(2) { width: 12%; }
  .inventory-grouped-table th:nth-child(3), .inventory-grouped-table td:nth-child(3) { width: 10%; }
  .inventory-grouped-table th:nth-child(4), .inventory-grouped-table td:nth-child(4),
  .inventory-grouped-table th:nth-child(5), .inventory-grouped-table td:nth-child(5),
  .inventory-grouped-table th:nth-child(6), .inventory-grouped-table td:nth-child(6) { width: 17.666%; }
  .inventory-grouped-table th, .inventory-grouped-table td { padding-left: 8px; padding-right: 8px; }
  .inventory-image-cell img, .inventory-image-cell .sales-table-photo-empty { max-width: 64%; max-height: 64%; }
}

@media (max-width: 820px) {
  .sales-query-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .sales-query-toolbar > .sales-sku-filter,
  .sales-query-toolbar > .sales-filter-multi,
  .sales-query-toolbar > .sales-range-filter,
  .sales-query-toolbar > .inventory-change-filter,
  .sales-query-toolbar > .listing-filter-actions { width: 100%; min-width: 0; }
  .sales-query-toolbar > .listing-filter-actions { margin-left: 0; justify-content: flex-start; flex-wrap: wrap; }
  .inventory-change-filter { margin: 0; gap: 6px; }
  .inventory-change-filter > span { flex-basis: 100%; margin-right: 0; }
  .sales-period-summary { line-height: 1.7; }
  .sales-result-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .inventory-grouped-table { min-width: 680px; }
}

@media (max-width: 600px) {
  .inventory-grouped-table { min-width: 620px; font-size: 12px; }
  .inventory-grouped-table th, .inventory-grouped-table td { padding: 5px 6px; }
  .inventory-grouped-table th:nth-child(1), .inventory-grouped-table td:nth-child(1) { width: 24%; }
  .inventory-grouped-table th:nth-child(2), .inventory-grouped-table td:nth-child(2) { width: 14%; }
  .inventory-grouped-table th:nth-child(3), .inventory-grouped-table td:nth-child(3) { width: 11%; }
  .inventory-grouped-table th:nth-child(4), .inventory-grouped-table td:nth-child(4),
  .inventory-grouped-table th:nth-child(5), .inventory-grouped-table td:nth-child(5),
  .inventory-grouped-table th:nth-child(6), .inventory-grouped-table td:nth-child(6) { width: 17%; }
  .inventory-image-cell { width: auto; }
  .inventory-image-cell img, .inventory-image-cell .sales-table-photo-empty { max-width: 70%; max-height: 70%; }
  .inventory-system-sku { font-size: 12px; }
  .inventory-product-name { font-size: 11px; }
  .inventory-sync-button { margin-left: 0; }
  .pagination { flex-wrap: wrap; gap: 6px; }
}

/* 工厂库存查询：图片圆角与高度适配 */
.inventory-grouped-table .inventory-image-cell img {
  width: auto;
  height: 80%;
  max-width: 90%;
  max-height: 80%;
  min-height: 0;
  border-radius: 8px;
  object-fit: contain;
  object-position: center;
}
.inventory-grouped-table .inventory-image-cell .sales-table-photo-empty {
  width: 80%;
  height: 80%;
  min-height: 0;
  border-radius: 8px;
}


/* 工厂库存查询：窄屏图片圆角固定 */
@media (max-width: 820px) {
  .inventory-grouped-table .inventory-image-cell { overflow: hidden; }
  .inventory-grouped-table .inventory-image-cell img,
  .inventory-grouped-table .inventory-image-cell .sales-table-photo-empty {
    border-radius: 8px !important;
    clip-path: inset(0 round 8px);
  }
}


/* 工厂库存查询：强制图片裁剪圆角 */
.inventory-grouped-table .inventory-image-cell { overflow: hidden !important; }
.inventory-grouped-table .inventory-image-cell img,
.inventory-grouped-table .inventory-image-cell .sales-table-photo-empty {
  display: block !important;
  overflow: hidden !important;
  border-radius: 8px !important;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  clip-path: inset(0 round 8px) !important;
}


.inventory-grouped-table .inventory-image-frame {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
}
.inventory-grouped-table .inventory-image-frame img,
.inventory-grouped-table .inventory-image-frame .sales-table-photo-empty {
  border-radius: 8px !important;
  overflow: hidden;
}


/* 工厂库存查询：由图片框稳定裁剪圆角 */
.inventory-grouped-table .inventory-image-frame {
  width: fit-content;
  max-width: 90%;
  margin: 0 auto;
  overflow: hidden !important;
  border-radius: 8px !important;
  clip-path: inset(0 round 8px);
  transform: translateZ(0);
}
.inventory-grouped-table .inventory-image-frame img,
.inventory-grouped-table .inventory-image-frame .sales-table-photo-empty {
  display: block !important;
  width: auto !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border-radius: 0 !important;
  clip-path: none !important;
  -webkit-mask-image: none !important;
}


/* 工厂库存查询：数量与变动列 */
.inventory-quantity-cell { white-space: nowrap; overflow: visible; }
.inventory-quantity-layout { position: relative; display: block; width: 100%; min-height: 1.2em; overflow: visible; }
/* 数量个位固定在单元格中心线；变动值不参与数量定位。 */
.inventory-quantity-value { position: absolute; right: 50%; bottom: 0; display: block; box-sizing: border-box; width: 4ch; min-width: 4ch; text-align: right; font-variant-numeric: tabular-nums; line-height: 1; }
.inventory-quantity-layout .inventory-delta { position: absolute; left: 50%; bottom: 0; margin-left: 4px; max-width: none; overflow: visible; white-space: nowrap; line-height: 1; transform: none; }

/* 菜单悬停不改变位置、内边距或字号。 */
.sidebar .nav.subnav:hover,
.sidebar .nav.subnav.active:hover {
  position: relative !important;
  top: 0 !important;
  left: 0 !important;
  margin-left: 0 !important;
  margin-inline-start: 0 !important;
  padding-left: 14px !important;
  font-size: 12px !important;
  transform: none !important;
}

/* 工厂库存查询：紧凑货号列与合计库存列 */
.inventory-grouped-table th:nth-child(1),
.inventory-grouped-table td:nth-child(1) { width: 11.2%; }
.inventory-grouped-table th:nth-child(2),
.inventory-grouped-table td:nth-child(2) { width: 12%; }
.inventory-grouped-table th:nth-child(3),
.inventory-grouped-table td:nth-child(3) { width: 9%; }
.inventory-grouped-table th:nth-child(4),
.inventory-grouped-table td:nth-child(4),
.inventory-grouped-table th:nth-child(5),
.inventory-grouped-table td:nth-child(5),
.inventory-grouped-table th:nth-child(6),
.inventory-grouped-table td:nth-child(6),
.inventory-grouped-table th:nth-child(7),
.inventory-grouped-table td:nth-child(7) { width: 16.95%; }
.inventory-grouped-table td:nth-child(1) .inventory-system-sku,
.inventory-grouped-table td:nth-child(1) .inventory-product-name { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }

.factory-owner-account-page { display: block; width: min(800px, 100%); max-width: 100%; margin: 0 auto; }
.factory-owner-account-page > * + * { margin-top: 20px; }
.factory-owner-account-card { padding: 18px; }
.factory-owner-account-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.factory-owner-account-head h2 { margin: 0 0 5px; font-size: 20px; }
.factory-owner-account-head p { margin: 0; color: var(--muted); }
.factory-owner-account-columns, .factory-owner-account-row { display: grid; grid-template-columns: 22px minmax(150px, 1.1fr) minmax(150px, 1fr) minmax(150px, 1fr) 80px; align-items: center; gap: 12px; min-width: 0; }
.factory-owner-account-columns { padding: 0 8px 8px; color: var(--muted); font-size: 13px; }
.factory-owner-account-row { min-height: 64px; padding: 10px 14px; border-top: 1px solid #e8eef2; }
.factory-owner-account-row > input { box-sizing: border-box; display: block; width: 100%; min-width: 0; height: 40px; padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #0f172a; font: inherit; overflow: visible; }
.factory-owner-account-row .owner-account-code, .factory-owner-account-row .owner-account-remark { min-width: 0; width: 100%; text-overflow: clip; }
.factory-owner-account-actions { display: flex; justify-content: flex-end; }
@media (max-width: 700px) { .factory-owner-account-page { width: 100%; max-width: calc(100vw - 20px); padding-left: 16px; padding-right: 16px; } .factory-owner-account-head { align-items: stretch; flex-direction: column; } .factory-owner-account-columns { display: none; } .factory-owner-account-row { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; padding: 12px 0; } .factory-owner-account-row .settings-sync-enabled { grid-column: 2 / -1; } .factory-owner-account-row .owner-account-code, .factory-owner-account-row .owner-account-remark { grid-column: 2 / -1; } .factory-owner-account-row .owner-account-remove { grid-column: 2 / -1; justify-self: start; } }
.sidebar .nav.subnav,
.sidebar .nav.subnav.active,
.sidebar .nav.subnav:focus-visible {
  font-size: 12px !important;
  transform: none !important;
}
.sidebar .nav.quick-nav:hover {
  position: relative !important;
  top: 0 !important;
  left: 0 !important;
  margin-left: 0 !important;
  margin-inline-start: 0 !important;
  padding-left: 42px !important;
  font-size: 12px !important;
  transform: none !important;
}
.sidebar .nav.quick-nav,
.sidebar .nav.quick-nav.active,
.sidebar .nav.quick-nav:focus-visible {
  font-size: 12px !important;
  transform: none !important;
}
.mobile-drawer-nav .nav.subnav:hover,
.mobile-drawer-nav .nav.subnav.active:hover,
.mobile-drawer-nav .nav.quick-nav:hover,
.mobile-quick-nav .nav.quick-nav:hover {
  position: relative !important;
  top: 0 !important;
  left: 0 !important;
  margin-left: 0 !important;
  margin-inline-start: 0 !important;
  padding-left: 18px !important;
  transform: none !important;
}
.inventory-delta { display: inline-block; min-width: 0; font-size: 12px; font-weight: 400; line-height: 1; }
.inventory-delta-up { color: #246fe5; }
.inventory-delta-down { color: #dc3f2f; }
.inventory-sort-controls { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.inventory-sort-title { line-height: 1.2; }
.inventory-sort-actions { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.inventory-sort-header { font-size: 12px; color: var(--muted); }
.inventory-sort-header.is-active { color: #1769e0; font-weight: 700; }
.inventory-grouped-table { min-width: 760px; }
.inventory-grouped-table th:nth-child(1), .inventory-grouped-table td:nth-child(1) { width: 28%; }
.inventory-grouped-table th:nth-child(2), .inventory-grouped-table td:nth-child(2) { width: 12%; }
.inventory-grouped-table th:nth-child(3), .inventory-grouped-table td:nth-child(3) { width: 9%; }
.inventory-grouped-table th:nth-child(4), .inventory-grouped-table td:nth-child(4),
.inventory-grouped-table th:nth-child(5), .inventory-grouped-table td:nth-child(5),
.inventory-grouped-table th:nth-child(6), .inventory-grouped-table td:nth-child(6) { width: 17%; }
@media (max-width: 820px) {
  .inventory-grouped-table { min-width: 700px; }
  .inventory-quantity-cell, .inventory-quantity-layout { overflow: visible; }
  .inventory-quantity-value { flex-basis: 4ch; width: 4ch; }
  .inventory-delta { font-size: 10px; }
}
@media (max-width: 600px) {
  .inventory-grouped-table { min-width: 660px; }
  .inventory-sort-controls { gap: 5px; }
  .inventory-sort-actions { gap: 4px; }
}

/* 工厂库存查询：手机端采用货号卡片，避免六列表格被压缩得不可读。 */
.inventory-mobile-list { display: none; }
.inventory-summary-main { display: flex; flex-wrap: wrap; min-width: 0; align-items: center; gap: 12px; }
.inventory-export-button { flex-shrink: 0; padding: 6px 12px; white-space: nowrap; }
.inventory-summary-totals { display: inline-flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 820px) {
  /* 顶部只保留菜单入口和系统名称；快速访问放在侧滑菜单中，避免所有页面横向溢出。 */
  .mobile-menu-bar .mobile-quick-nav { display: none !important; }
  /* The top navigation needs only the top safe-area inset. Adding the bottom
     inset here inflated the sticky table-header offset and left a blank strip
     above the header on phones with a home-indicator area. */
  .mobile-menu-bar { padding-bottom: 8px; }
  .mobile-menu-bar-head { min-height: 42px; }
  .mobile-drawer-nav .nav { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 10px 12px; white-space: nowrap; }
  .mobile-drawer-nav .subnav, .mobile-drawer-nav .quick-nav { padding-left: 18px !important; }
  .mobile-drawer-nav .subnav .nav-icon, .mobile-drawer-nav .quick-nav .nav-icon { margin-left: 0 !important; }
  .mobile-drawer-nav .nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .mobile-quick-nav .quick-menu-title .nav-icon { display: none; }
  .mobile-quick-nav .quick-menu-title { font-size: 13px; }
  .mobile-quick-nav .quick-menu-heading { gap: 3px; }
  .factory-inventory-toolbar .listing-filter-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex-wrap: nowrap; }
  .factory-inventory-toolbar .listing-filter-actions button { width: 100%; padding-inline: 4px; }
  .factory-inventory-summary { align-items: stretch; flex-direction: column; gap: 4px; margin: 12px 0 10px; }
  .inventory-summary-main { display: block; }
  .inventory-summary-main .inventory-export-button { margin-top: 8px; }
  .inventory-summary-meta { display: block; margin-bottom: 4px; }
  .inventory-summary-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .inventory-summary-totals > * { min-width: 0; padding: 5px 4px; border-radius: 5px; background: #f3f7fa; text-align: center; white-space: nowrap; font-size: 12px; }
  .inventory-summary-totals strong { color: #0b817d; }
  .factory-inventory-summary > .inventory-refresh-countdown { position: static; align-self: center; transform: none; }
  .inventory-sync-countdown { align-self: flex-end; margin-top: 1px; }
  .inventory-desktop-table { display: none; }
  .inventory-mobile-list { display: grid; gap: 10px; }
  .inventory-mobile-card { overflow: hidden; border: 1px solid #dce5eb; border-radius: 9px; background: #fff; }
  .inventory-mobile-card-head { display: flex; align-items: center; gap: 9px; min-height: 58px; padding: 8px 10px; border-bottom: 1px solid #e6edf2; background: #fbfcfd; }
  .inventory-mobile-photo { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; overflow: hidden; border-radius: 6px; background: #f0f3f5; color: #8190a0; font-size: 10px; font-style: normal; }
  .inventory-mobile-photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
  .inventory-mobile-photo i { font-style: normal; }
  .inventory-mobile-product { display: grid; min-width: 0; gap: 3px; }
  .inventory-mobile-product strong { color: var(--text); font-size: 14px; line-height: 1.2; }
  .inventory-mobile-product small { overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
  .inventory-mobile-data { display: grid; }
  .inventory-mobile-data-row { display: grid; grid-template-columns: 34px repeat(3, minmax(0, 1fr)); min-height: 38px; border-top: 1px solid #edf1f4; }
  .inventory-mobile-data-row:first-child { border-top: 0; }
  .inventory-mobile-size, .inventory-mobile-metric { display: flex; align-items: center; justify-content: center; gap: 2px; min-width: 0; padding: 4px 2px; text-align: center; }
  .inventory-mobile-size { border-right: 1px solid #edf1f4; color: #257b9b; font-size: 13px; font-weight: 700; }
  .inventory-mobile-metric { position: relative; flex-wrap: wrap; border-right: 1px solid #edf1f4; color: #168f8b; }
  .inventory-mobile-metric:last-child { border-right: 0; }
  .inventory-mobile-metric small { flex-basis: 100%; color: #7c8996; font-size: 10px; line-height: 1; }
  .inventory-mobile-metric b { font-size: 14px; line-height: 1.05; }
  .inventory-mobile-metric.is-total b { color: #087f7b; font-size: 15px; }
  .inventory-mobile-metric .inventory-delta { margin: 0; font-size: 10px; line-height: 1; }
}

.factory-inventory-toolbar { flex-wrap: wrap; }
.factory-inventory-toolbar > .inventory-account-filter { flex: 0 1 300px; width: 300px; min-width: 220px; }
.inventory-account-trigger em { min-width: 0; overflow: hidden; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.inventory-account-ellipsis { flex: 0 0 auto; padding: 0 5px; color: #6d7b87; font-style: normal; font-weight: 700; }
.inventory-account-selected { display: inline-flex; align-items: center; gap: 5px; margin-left: 3px; padding: 3px 7px; border-radius: 4px; background: #edf1f4; font-style: normal; line-height: 16px; flex: 0 0 auto; vertical-align: middle; }
.inventory-account-selected [data-remove-account] { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; cursor: pointer; border-radius: 50%; color: #52708a; font-size: 17px; font-weight: 700; line-height: 16px; vertical-align: middle; }
.inventory-account-selected [data-remove-account]:hover { background: #dce8f3; color: #1f5f9f; }
.multi-select.open .inventory-account-options { display: flex; flex-wrap: nowrap; align-items: center; width: max-content; min-width: 100%; max-height: none; right: auto; overflow: visible; padding: 6px 8px; white-space: nowrap; }
.multi-select.open .inventory-account-options label { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; min-height: 32px; padding: 4px 10px; white-space: nowrap; }
.multi-select.open .inventory-account-options label input { width: 18px; min-width: 18px; height: 18px; margin: 0; padding: 0; flex: 0 0 18px; }
.inventory-account-all { border-right: 1px solid #d7e0e7; margin-right: 4px; padding-right: 16px !important; font-weight: 600; }
@media (max-width: 1100px) { .factory-inventory-toolbar > .inventory-account-filter { flex: 1 1 100%; width: 100%; min-width: 0; } }
@media (min-width: 1101px) {
  .factory-inventory-toolbar { display: grid; grid-template-columns: minmax(240px, 320px) minmax(220px, 300px) minmax(0, 1fr) max-content; gap: 10px; align-items: center; }
  .factory-inventory-toolbar > .inventory-account-filter { width: 100%; min-width: 0; }
  .factory-inventory-toolbar > .inventory-change-filter { min-width: 0; }
  .factory-inventory-toolbar > .listing-filter-actions { justify-self: end; margin-left: 0; }
}

/* 备货分析：两行筛选共享同一组列边界，第五列上方放系统分层、下方放操作按钮。 */
.sales-query-toolbar:not(.factory-inventory-toolbar) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.24fr) minmax(0, 1.24fr) auto; gap: 10px; align-items: center; }
.sales-query-toolbar:has(#dailySalesStockTierFilter) { grid-template-columns: repeat(5, minmax(0, 1fr)) max-content; }
.sales-query-toolbar:has(#dailySalesStockTierFilter) > .sales-sku-filter:nth-child(4) { grid-column: 4 / 6; }
.sales-query-toolbar:not(.factory-inventory-toolbar) > .sales-secondary-filter-row { display: contents; }
#dailySalesStockTierFilter { grid-column: 6; grid-row: 1; width: 100%; min-width: 0; }
.sales-secondary-filter-row > .sales-filter-multi,
.sales-secondary-filter-row > .sales-range-filter { width: 100%; min-width: 0; }
.sales-secondary-filter-row > .sales-filter-multi:nth-child(1) { grid-column: 1; grid-row: 2; }
.sales-secondary-filter-row > .sales-filter-multi:nth-child(2) { grid-column: 2; grid-row: 2; }
.sales-secondary-filter-row > .sales-range-filter:nth-child(3) { grid-column: 3; grid-row: 2; }
.sales-secondary-filter-row > .sales-range-filter:nth-child(4) { grid-column: 4; grid-row: 2; }
.sales-secondary-filter-row > .sales-range-filter:nth-child(5) { grid-column: 5; grid-row: 2; }
.sales-secondary-filter-row > .listing-filter-actions { grid-column: 6; grid-row: 2; margin-left: 0; }
@media (min-width: 821px) {
  /* 页面随正文滚动；备货分析固定筛选区与两级表头。 */
  #app:has(.daily-sales-workspace) { min-height: 0; margin-bottom: 28px; }
  .daily-sales-workspace { min-width: 0; }
  .daily-sales-fixed-controls { min-width: 0; }
  .analysis-store-filter-row { position: sticky; top: 0; z-index: 12; margin-top: 12px; background: #fff; box-shadow: 0 2px 6px rgba(39,57,76,.13); }
  .daily-sales-workspace:not(.stock-alert-workspace) .daily-sales-fixed-controls { position: sticky; top: 0; z-index: 20; padding-bottom: 0; background: transparent; box-shadow: none; }
  .daily-sales-workspace:has(:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"])) .daily-sales-fixed-controls { z-index: 40; padding-bottom: 4px; background: #fff; box-shadow: 0 2px 6px rgba(39,57,76,.13); }
  .daily-sales-workspace:not(.stock-alert-workspace) .daily-sales-fixed-controls > .toolbar { margin-bottom: 4px; }
  .daily-sales-workspace:not(.stock-alert-workspace) .analysis-store-filter-row { position: static; margin-top: 4px; margin-bottom: 4px; background: transparent; box-shadow: none; }
  .daily-sales-workspace:has(:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"])) .analysis-store-filter-row { margin-bottom: 0; background: #fff; }
  .daily-sales-data-scroll { display: block; min-width: 0; margin-top: 4px; }
  .daily-sales-data-scroll .sales-result-table-wrap { width: 100%; overflow-x: auto; overflow-y: visible; overscroll-behavior-x: contain; scrollbar-gutter: stable; border-bottom: 0; border-radius: 8px 8px 0 0; }
  /* 备货分析随页面纵向滚动，表格只需横向滚动；不预留空的纵向滚动条槽，避免右侧出现白条。 */
  .daily-sales-workspace:not(.stock-alert-workspace) .daily-sales-data-scroll .sales-result-table-wrap { scrollbar-gutter: auto; }
  .daily-sales-workspace:not(.stock-alert-workspace) .daily-sales-data-scroll .sales-hierarchical-table thead tr:first-child th:last-child { border-top-right-radius: 8px; }
  /* 备货分析通过克隆完整 thead 固定，避免跨两行表头的 rowspan 单元格被分层定位后错位。 */
  .daily-sales-workspace:not(.stock-alert-workspace) .daily-sales-data-scroll .sales-hierarchical-table thead,
  .daily-sales-workspace:not(.stock-alert-workspace) .daily-sales-data-scroll .sales-hierarchical-table thead th { position: static; }
  .stock-alert-workspace .daily-sales-data-scroll .sales-hierarchical-table thead tr:first-child th { position: sticky; top: 0; z-index: 11; }
  .stock-alert-workspace .daily-sales-data-scroll .sales-hierarchical-table thead tr:nth-child(2) th { position: sticky; top: 37px; z-index: 12; }
  .daily-sales-data-scroll .sales-hierarchical-table thead th { box-shadow: 0 2px 5px rgba(39,57,76,.12); }
  .daily-sales-fixed-pagination { min-width: 0; border: 1px solid #dce5eb; border-top: 1px solid #dfe5ea; border-radius: 0 0 8px 8px; background: #fff; }
  .daily-sales-fixed-pagination .sales-pagination { margin: 0; padding: 10px 12px; }
}
@container (max-width: 1300px) {
  .sales-query-toolbar:not(.factory-inventory-toolbar) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-query-toolbar:has(#dailySalesStockTierFilter) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-query-toolbar:has(#dailySalesStockTierFilter) > .sales-sku-filter:nth-child(4) { grid-column: auto; }
  #dailySalesStockTierFilter { grid-column: 1 / -1; grid-row: auto; }
  .sales-secondary-filter-row > .sales-filter-multi:nth-child(n),
  .sales-secondary-filter-row > .sales-range-filter:nth-child(n) { grid-column: auto; grid-row: auto; }
  .sales-secondary-filter-row > .listing-filter-actions { grid-column: 1 / -1; grid-row: auto; justify-content: flex-end; }
}
@media (min-width: 821px) {
  .sales-query-toolbar:has(#dailySalesStockTierFilter) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-query-toolbar:has(#dailySalesStockTierFilter) > .sales-sku-filter:nth-child(4) { grid-column: auto; }
  #dailySalesStockTierFilter { grid-column: 1 / -1; grid-row: auto; }
  .sales-secondary-filter-row > .sales-filter-multi:nth-child(n),
  .sales-secondary-filter-row > .sales-range-filter:nth-child(n) { grid-column: auto; grid-row: auto; }
  .sales-secondary-filter-row > .listing-filter-actions { grid-column: 1 / -1; grid-row: auto; justify-content: flex-end; }
}
@media (max-width: 820px) {
  .daily-sales-offline-account-filter { width: 100%; margin-left: 0; padding: 7px 0 0; border-top: 1px solid #d8e1ea; border-left: 0; flex-wrap: wrap; }
  .sales-query-toolbar:not(.factory-inventory-toolbar) { grid-template-columns: minmax(0, 1fr); }
  .sales-query-toolbar:has(#dailySalesStockTierFilter) { grid-template-columns: minmax(0, 1fr); }
  #dailySalesStockTierFilter { grid-column: 1; grid-row: auto; }
  .sales-secondary-filter-row > .sales-filter-multi:nth-child(n),
  .sales-secondary-filter-row > .sales-range-filter:nth-child(n) { grid-column: 1; grid-row: auto; }
  .sales-secondary-filter-row > .listing-filter-actions { grid-column: 1; grid-row: auto; width: 100%; justify-content: stretch; flex-wrap: wrap; }
}

/* 工厂库存表最终列宽：货号列为原来的约 40%，合计库存与数量列等宽。 */
.inventory-grouped-table th:nth-child(1), .inventory-grouped-table td:nth-child(1) { width: 14.56%; }
.inventory-grouped-table th:nth-child(2), .inventory-grouped-table td:nth-child(2) { width: 12%; }
.inventory-grouped-table th:nth-child(3), .inventory-grouped-table td:nth-child(3) { width: 9%; }
.inventory-grouped-table th:nth-child(4), .inventory-grouped-table td:nth-child(4),
.inventory-grouped-table th:nth-child(5), .inventory-grouped-table td:nth-child(5),
.inventory-grouped-table th:nth-child(6), .inventory-grouped-table td:nth-child(6),
.inventory-grouped-table th:nth-child(7), .inventory-grouped-table td:nth-child(7) { width: 16.11%; }

/* 销量统计筛选栏：给日期和操作按钮留出空间，窄屏时再逐行排列。 */
.sales-query-toolbar.legacy-sales-toolbar:not(.factory-inventory-toolbar) { grid-template-columns: minmax(185px, 1.2fr) minmax(145px, .85fr) minmax(145px, .85fr) max-content max-content; }
@media (max-width: 1500px) {
  .sales-query-toolbar.legacy-sales-toolbar:not(.factory-inventory-toolbar) { grid-template-columns: minmax(160px, 1fr) minmax(140px, .85fr) minmax(140px, .85fr) max-content; }
  .legacy-sales-toolbar > .sales-date-controls { grid-column: 1 / 4; grid-row: 2; width: 100%; max-width: 100%; min-width: 0; margin-left: 0; }
  .legacy-sales-toolbar > .sales-date-controls .generic-date-range { width: auto; min-width: 250px; max-width: 320px; flex: 1 1 250px; }
  .legacy-sales-toolbar > .listing-filter-actions { grid-column: 4; grid-row: 2; }
}
@media (max-width: 1100px) {
  .sales-query-toolbar.legacy-sales-toolbar:not(.factory-inventory-toolbar) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legacy-sales-toolbar > .sales-sku-filter { grid-column: 1 / -1; }
  .legacy-sales-toolbar > .sales-date-controls { grid-column: 1 / -1; grid-row: auto; flex-wrap: wrap; width: 100%; }
  .legacy-sales-toolbar > .listing-filter-actions { grid-column: 1 / -1; grid-row: auto; }
}
@media (max-width: 820px) {
  .sales-query-toolbar.legacy-sales-toolbar:not(.factory-inventory-toolbar) { grid-template-columns: minmax(0, 1fr); }
  .legacy-sales-toolbar > .sales-sku-filter,
  .legacy-sales-toolbar > .sales-filter-multi,
  .legacy-sales-toolbar > .sales-date-controls,
  .legacy-sales-toolbar > .listing-filter-actions { grid-column: 1; width: 100%; min-width: 0; }
  .legacy-sales-toolbar > .sales-date-controls { flex-direction: column; align-items: stretch; }
  .legacy-sales-toolbar > .sales-date-controls .sales-period-actions { width: 100%; overflow-x: auto; }
  .legacy-sales-toolbar > .sales-date-controls .generic-date-range { width: 100%; min-width: 0; max-width: none; flex-basis: auto; }
  .legacy-sales-toolbar > .sales-date-controls .generic-date-range {
    position: relative;
    inset: auto;
    left: 0;
    right: auto;
    align-self: stretch;
    flex: 0 0 42px;
    height: 42px;
  }
}
.inventory-grouped-table td:nth-child(1) .inventory-system-sku,
.inventory-grouped-table td:nth-child(1) .inventory-product-name { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.listing-import-calibrate { display: flex; align-items: center; gap: 7px; margin: 8px 0 4px; color: #526579; font-size: 12px; }
.listing-import-calibrate input { margin: 0; }
.listing-time-source { display: block; margin-top: 2px; color: #718497; font-size: 11px; }

.forecast-settings-page { width: 100%; max-width: 1240px; box-sizing: border-box; margin: 0 auto; padding: 28px 30px 32px; }
.forecast-settings-page .settings-hero { flex-wrap: wrap; }
.forecast-settings-page .settings-panel-heading { display: flex; align-items: center; }
.forecast-settings-page .settings-panel-heading > div { min-width: 0; }
.forecast-settings-version { margin-left: auto; color: #64748b; font-size: 13px; white-space: nowrap; }
.forecast-settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.forecast-setting-field { display: grid; gap: 7px; color: #334155; font-size: 13px; }
.forecast-setting-field > span { font-weight: 650; }
.forecast-setting-field small { min-height: 34px; color: #718096; line-height: 1.5; }
.forecast-setting-input { display: flex; align-items: center; gap: 8px; }
.forecast-setting-input input { width: 100%; min-width: 0; min-height: 40px; box-sizing: border-box; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #0f172a; font: inherit; }
.forecast-setting-input input:focus { border-color: #2563eb; outline: 0; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.forecast-setting-input b { color: #64748b; font-weight: 500; }
.forecast-weight-total { color: #047857; white-space: nowrap; }
.forecast-weight-total.is-invalid { color: #b91c1c; }
.forecast-settings-page .forecast-advanced { padding: 0; }
.forecast-advanced > summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 22px; color: #0f172a; cursor: pointer; list-style: none; }
.forecast-advanced > summary::-webkit-details-marker { display: none; }
.forecast-advanced > summary::after { content: '⌄'; color: #64748b; }
.forecast-advanced[open] > summary::after { content: '⌃'; }
.forecast-advanced > summary span { margin-left: auto; color: #718096; font-size: 12px; font-weight: 400; }
.forecast-advanced .forecast-settings-grid { padding: 0 22px 22px; }
.forecast-settings-actions { justify-content: space-between; }
.forecast-settings-actions .ghost, .forecast-preview-controls .primary, .forecast-history-panel .ghost { min-height: 40px; padding: 0 15px; border-radius: 8px; }
.forecast-preview-controls { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, .8fr) auto; align-items: end; gap: 12px; }
.forecast-preview-field { display: grid; gap: 7px; min-width: 0; color: #334155; font-size: 13px; }
.forecast-preview-field > span { font-weight: 650; }
.forecast-sku-autocomplete { position: relative; min-width: 0; }
.forecast-sku-autocomplete > input { width: 100%; height: 40px; min-width: 0; box-sizing: border-box; padding: 8px 11px; border: 1px solid #cbd5e1; border-radius: 7px; background: #f8fafc; color: #0f172a; font: inherit; }
.forecast-sku-autocomplete > input:focus { border-color: #2563eb; outline: 0; box-shadow: 0 0 0 3px rgba(37,99,235,.12); background: #fff; }
.forecast-sku-suggestions { position: absolute; z-index: 60; top: calc(100% + 5px); left: 0; right: 0; max-height: 280px; overflow-y: auto; padding: 5px; border: 1px solid #d5dee8; border-radius: 8px; background: #fff; box-shadow: 0 10px 24px rgba(15,23,42,.16); }
.forecast-sku-suggestions[hidden] { display: none; }
.forecast-sku-suggestions button { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-width: 0; padding: 9px 10px; border: 0; border-radius: 5px; background: transparent; color: #24364a; font: inherit; text-align: left; cursor: pointer; }
.forecast-sku-suggestions button:hover, .forecast-sku-suggestions button.is-active { background: #eff6ff; color: #1d4ed8; }
.forecast-sku-suggestions button small { overflow: hidden; color: #718096; text-overflow: ellipsis; white-space: nowrap; }
.forecast-sku-empty { padding: 10px; color: #718096; }
.forecast-store-filter { position: relative; z-index: 6; min-width: 0; }
.forecast-store-trigger { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; min-width: 0; padding: 0 11px; border: 1px solid #cbd5e1; border-radius: 7px; background: #f8fafc; color: #0f172a; font: inherit; text-align: left; cursor: pointer; }
.forecast-store-trigger em { flex: 1 1 auto; min-width: 0; overflow: hidden; color: #64748b; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.forecast-store-trigger b { width: 8px; height: 8px; flex: 0 0 8px; margin: -4px 2px 0 0; border-right: 1.5px solid #526579; border-bottom: 1.5px solid #526579; transform: rotate(45deg); }
.forecast-store-filter.open .forecast-store-trigger { border-color: #58aeb2; background: #fff; }
.forecast-store-filter.open .forecast-store-trigger b { margin-top: 4px; transform: rotate(225deg); }
.forecast-store-options { display: none; position: absolute; z-index: 50; top: calc(100% + 5px); right: 0; width: max-content; min-width: 100%; max-width: min(720px, calc(100vw - 36px)); max-height: 280px; overflow-y: auto; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 10px; border: 1px solid #d5dee8; border-radius: 8px; background: #fff; box-shadow: 0 10px 24px rgba(15,23,42,.16); }
.forecast-store-filter.open .forecast-store-options { display: flex; }
.forecast-store-options label { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 7px; border-radius: 5px; color: #334155; white-space: nowrap; cursor: pointer; }
.forecast-store-options label:hover { background: #f1f5f9; }
.forecast-store-options input { width: 16px; height: 16px; margin: 0; accent-color: #16835f; }
.forecast-settings-page .forecast-preview-controls .listing-filter { display: flex; flex-direction: column; align-items: stretch; gap: 7px; width: 100%; min-width: 0; height: auto; min-height: 0; box-sizing: border-box; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.forecast-settings-page .forecast-preview-controls .listing-filter:hover, .forecast-settings-page .forecast-preview-controls .listing-filter:focus-within { border: 0; background: transparent; box-shadow: none; }
.forecast-settings-page .forecast-preview-controls .listing-filter > span:first-child { color: #334155; font-size: 13px; font-weight: 650; }
.forecast-settings-page .forecast-preview-controls .listing-filter input { width: 100%; min-width: 0; height: 40px; box-sizing: border-box; padding: 8px 11px; border: 1px solid #cbd5e1; border-radius: 7px; background: #f8fafc; color: #0f172a; font: inherit; }
.forecast-settings-page .forecast-preview-controls .listing-filter input:focus { border-color: #2563eb; outline: 0; box-shadow: 0 0 0 3px rgba(37,99,235,.12); background: #fff; }
.forecast-preview-controls .primary { min-width: 100px; }
.forecast-preview-result { margin-top: 16px; }
.forecast-preview-table-wrap { overflow-x: auto; border: 1px solid #dce5eb; border-radius: 8px; }
.forecast-preview-table { width: 100%; min-width: 1120px; table-layout: fixed; border-collapse: collapse; background: #fff; font-size: 13px; }
.forecast-preview-table th, .forecast-preview-table td { padding: 9px 6px; border-bottom: 1px solid #e4ebf1; text-align: center; white-space: nowrap; }
.forecast-preview-table th { white-space: normal; line-height: 1.35; overflow-wrap: anywhere; }
.forecast-preview-table th:nth-child(1) { width: 58px; }
.forecast-preview-table th:nth-child(2) { width: 76px; }
.forecast-preview-table th:nth-child(n+3):nth-child(-n+7) { width: 56px; }
.forecast-preview-table th:nth-child(n+8):nth-child(-n+12) { width: 116px; }
.forecast-preview-table th:nth-child(13) { width: 72px; }
.forecast-preview-table thead th { background: #f1f5f9; color: #40566e; font-weight: 650; }
.forecast-preview-table tbody tr:last-child td { border-bottom: 0; }
.forecast-preview-table tbody tr:hover { background: #f7fbff; }
.forecast-new-value { color: #047857; font-weight: 700; }
.forecast-version-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 15px; padding: 12px 2px; border-top: 1px solid #edf1f5; }
.forecast-version-row > div { display: grid; gap: 4px; min-width: 0; }
.forecast-version-row small { line-height: 1.55; overflow-wrap: anywhere; }
.forecast-version-row small, .forecast-settings-footnote { color: #718096; font-size: 12px; }
.forecast-settings-footnote { margin: 16px 2px 0; }
@media (max-width: 800px) {
  .forecast-settings-page { width: 100%; padding: 18px 14px 22px; }
  .forecast-settings-version { width: 100%; margin-left: 62px; }
  .forecast-settings-page .settings-panel-heading { display: flex; align-items: flex-start; gap: 12px; }
  .forecast-settings-page .settings-panel-heading button { margin-top: 0; }
  .forecast-settings-grid { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .forecast-setting-field small { min-height: 0; }
  .forecast-preview-controls { grid-template-columns: minmax(0, 1fr); }
  .forecast-preview-controls .primary { justify-self: start; }
  .forecast-store-options { right: auto; left: 0; width: max-content; max-width: calc(100vw - 52px); }
  .forecast-settings-actions { flex-wrap: wrap; gap: 10px; }
  .forecast-version-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .forecast-version-row button { justify-self: start; }
  .forecast-advanced > summary { flex-wrap: wrap; padding: 16px; }
  .forecast-advanced > summary::marker { content: ''; }
  .forecast-advanced > summary strong { flex: 1 1 auto; }
  .forecast-advanced > summary::after { margin-left: auto; }
  .forecast-advanced > summary span { order: 2; width: 100%; margin-left: 0; }
  .forecast-advanced .forecast-settings-grid { padding: 0 16px 16px; }
}

/* Compact mobile filters for daily sales pages. Keep labels readable while
   placing short filters side by side and fitting action buttons to their text. */
@media (min-width: 381px) and (max-width: 820px) {
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter,
  #dailySalesStockTierFilter,
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .sales-filter-multi,
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .sales-range-filter,
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .listing-filter-actions {
    grid-row: auto;
    width: 100%;
    min-width: 0;
  }
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:first-child,
  #dailySalesStockTierFilter,
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .listing-filter-actions { grid-column: 1 / -1; }
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:not(:first-child),
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .sales-filter-multi,
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .sales-range-filter { grid-column: auto; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:nth-child(4) {
    grid-column: auto;
    grid-row: auto;
  }
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .listing-filter-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) .sales-secondary-filter-row > .listing-filter-actions button {
    min-width: 0;
    min-height: 38px;
    padding-inline: 3px;
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
    word-break: keep-all;
  }
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) .sales-secondary-filter-row > .sales-filter-multi,
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) .sales-secondary-filter-row > .sales-range-filter {
    grid-column: auto;
    grid-row: auto;
    min-width: 0;
  }
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > #dailySalesStockTierFilter {
    grid-column: 1 / -1;
    grid-row: auto;
  }
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) .sales-secondary-filter-row > .listing-filter-actions {
    grid-column: 1 / -1;
    grid-row: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .sales-query-toolbar.legacy-sales-toolbar:not(.factory-inventory-toolbar) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
  .legacy-sales-toolbar > .sales-sku-filter,
  .legacy-sales-toolbar > .sales-date-controls {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }
  .legacy-sales-toolbar > .sales-filter-multi {
    grid-column: auto;
    width: 100%;
    min-width: 0;
  }
  .legacy-sales-toolbar > .sales-date-controls { flex-direction: column; align-items: stretch; gap: 6px; }
  .legacy-sales-toolbar > .sales-date-controls .sales-period-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    width: 100%;
    overflow: visible;
  }
  .legacy-sales-toolbar > .sales-date-controls .sales-period-actions button {
    flex: 1 1 62px;
    min-width: 0;
    min-height: 36px;
    padding-inline: 5px;
    font-size: 12px;
    white-space: nowrap;
  }
  .legacy-sales-toolbar > .listing-filter-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    min-width: 0;
  }
  .legacy-sales-toolbar > .listing-filter-actions button {
    min-width: 0;
    min-height: 38px;
    padding-inline: 4px;
    font-size: 13px;
    white-space: nowrap;
  }

  .matrix-store-filter-inline { gap: 7px; padding-inline: 7px; }
  .matrix-store-filter-inline .matrix-store-options { gap: 3px 7px; }
  .matrix-store-filter-inline .matrix-store-options label { padding: 2px; font-size: 13px; }
  .daily-sales-offline-account-filter { gap: 7px; }
  .daily-sales-offline-account-filter .matrix-store-options { gap: 3px 7px; }
  .table-column-settings-trigger { margin-left: 0; padding: 5px 7px; font-size: 12px; }
}

@media (max-width: 380px) {
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) {
    grid-template-columns: minmax(0, 1fr);
  }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) {
    grid-template-columns: minmax(0, 1fr);
  }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:nth-child(4) {
    grid-column: 1;
    grid-row: auto;
  }
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter,
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > #dailySalesStockTierFilter,
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:first-child,
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:not(:first-child),
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > #dailySalesStockTierFilter,
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .sales-filter-multi,
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .sales-range-filter,
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .listing-filter-actions { grid-column: 1; }
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .listing-filter-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) .sales-secondary-filter-row > .listing-filter-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sales-query-toolbar:not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) .sales-secondary-filter-row > .listing-filter-actions button {
    padding-inline: 3px;
    font-size: 12px;
  }
  .sales-query-toolbar.legacy-sales-toolbar:not(.factory-inventory-toolbar) > .listing-filter-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }
  .legacy-sales-toolbar > .listing-filter-actions button { padding-inline: 2px; font-size: 12px; }
}

/* iPad widths: let the filter block scroll with the page so it cannot pin a
   tall store selector over the results; keep just the table header managed by
   the existing sticky-header layer. */
@media (min-width: 821px) and (max-width: 1366px) {
  .topbar { padding-inline: 14px; }
  .topbar-page { gap: 8px; }
  .topbar-page .page-description { display: none; }
  .topbar-status-indicators { max-width: 230px; padding-inline: 6px; }
  .inventory-batch-topbar-status { font-size: 11px; }
  .daily-sales-workspace .daily-sales-fixed-controls,
  .daily-sales-workspace:has(:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"])) .daily-sales-fixed-controls {
    position: static;
    top: auto;
    z-index: auto;
    padding-bottom: 0;
    background: transparent;
    box-shadow: none;
  }
  .daily-sales-workspace .analysis-store-filter-row,
  .daily-sales-workspace:has(:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"])) .analysis-store-filter-row {
    position: static;
    top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin: 6px 0;
    padding: 6px 8px;
    background: #fff;
    box-shadow: none;
  }
  .daily-sales-workspace .analysis-store-filter-row > .matrix-store-label { order: 1; }
  .daily-sales-workspace .analysis-store-filter-row > .matrix-store-options { order: 2; flex: 1 1 calc(100% - 84px); min-width: 0; gap: 3px 8px; }
  .daily-sales-workspace .analysis-store-filter-row > .daily-sales-compare-trigger { order: 3; min-height: 34px; margin-left: 0; padding: 5px 8px; font-size: 12px; }
  .daily-sales-workspace .analysis-store-filter-row > .table-column-settings-trigger { order: 4; margin-left: 0; padding: 5px 8px; font-size: 12px; }
  .daily-sales-workspace .analysis-store-filter-row > .daily-sales-offline-account-filter {
    order: 5;
    flex: 1 1 100%;
    min-width: 0;
    gap: 6px;
    margin: 0;
    padding: 6px 0 0;
    border-top: 1px solid #d8e1ea;
    border-left: 0;
  }
  .daily-sales-workspace .analysis-store-filter-row > .daily-sales-offline-account-filter .matrix-store-options { gap: 3px 8px; }
  .daily-sales-workspace .analysis-store-filter-row .matrix-store-options label { min-height: 30px; padding: 2px 3px; }
}

@media (min-width: 900px) and (max-width: 1100px) {
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter,
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > #dailySalesStockTierFilter,
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .sales-filter-multi,
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .sales-range-filter { grid-column: auto; grid-row: auto; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .listing-filter-actions {
    grid-column: 1 / -1;
    grid-row: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
}

@media (min-width: 1101px) and (max-width: 1366px) {
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
  }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:nth-child(1) { grid-column: 1; grid-row: 1; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:nth-child(2) { grid-column: 2; grid-row: 1; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:nth-child(3) { grid-column: 3; grid-row: 1; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:nth-child(4) { grid-column: 4; grid-row: 1; }
  #dailySalesStockTierFilter { grid-column: 1; grid-row: 2; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) .sales-secondary-filter-row > .sales-filter-multi:nth-child(1) { grid-column: 2; grid-row: 2; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) .sales-secondary-filter-row > .sales-filter-multi:nth-child(2) { grid-column: 3; grid-row: 2; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) .sales-secondary-filter-row > .sales-range-filter:nth-child(3) { grid-column: 4; grid-row: 2; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) .sales-secondary-filter-row > .sales-range-filter:nth-child(4) { grid-column: 1; grid-row: 3; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) .sales-secondary-filter-row > .sales-range-filter:nth-child(5) { grid-column: 2; grid-row: 3; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) .sales-secondary-filter-row > .listing-filter-actions {
    grid-column: 3 / 5;
    grid-row: 3;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) .sales-secondary-filter-row > .listing-filter-actions button {
    min-width: 0;
    min-height: 38px;
    padding-inline: 3px;
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
    word-break: keep-all;
  }
}

/* 宽屏电脑上，备货分析的筛选控件按每行五项排列。 */
@media (min-width: 1367px) {
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) {
    grid-template-columns: repeat(15, minmax(0, 1fr));
    align-items: stretch;
  }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:nth-child(1) { grid-column: 1 / span 3; grid-row: 1; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:nth-child(2) { grid-column: 4 / span 3; grid-row: 1; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:nth-child(3) { grid-column: 7 / span 3; grid-row: 1; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:nth-child(4) { grid-column: 10 / span 3; grid-row: 1; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > #dailySalesStockTierFilter { grid-column: 13 / span 3; grid-row: 1; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .sales-filter-multi:nth-child(1) { grid-column: 1 / span 3; grid-row: 2; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .sales-filter-multi:nth-child(2) { grid-column: 4 / span 3; grid-row: 2; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .sales-range-filter:nth-child(3) { grid-column: 7 / span 2; grid-row: 2; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .sales-range-filter:nth-child(4) { grid-column: 9 / span 2; grid-row: 2; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .sales-range-filter:nth-child(5) { grid-column: 11 / span 2; grid-row: 2; }
  .sales-query-toolbar:has(#dailySalesStockTierFilter):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .listing-filter-actions {
    grid-column: 13 / span 3;
    grid-row: 2;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
  }
}

/* The legacy sales search area uses explicit grid rows so the date picker and
   action buttons cannot inherit the older flex sizing and overlap on iPad. */
@media (min-width: 821px) {
  .sales-query-toolbar.legacy-sales-toolbar:not(.factory-inventory-toolbar) {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }
  .legacy-sales-toolbar > .sales-sku-filter { grid-column: 1 / 3; grid-row: 1; width: 100%; min-width: 0; }
  .legacy-sales-toolbar > #legacySalesStockModeFilter { grid-column: 3; grid-row: 1; width: 100%; min-width: 0; }
  .legacy-sales-toolbar > #legacySalesJitStatusFilter { grid-column: 4; grid-row: 1; width: 100%; min-width: 0; }
  .legacy-sales-toolbar > .sales-date-controls {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
    height: auto;
    min-width: 0;
    margin: 0;
  }
  .legacy-sales-toolbar > .sales-date-controls .sales-period-actions {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    width: max-content;
    min-width: 0;
    overflow: visible;
  }
  .legacy-sales-toolbar > .sales-date-controls .sales-period-actions button {
    flex: 0 0 auto;
    min-height: 38px;
    padding-inline: 7px;
    font-size: 13px;
    white-space: nowrap;
  }
  .legacy-sales-toolbar > .sales-date-controls .generic-date-range {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    inset: auto;
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 40px;
    min-height: 40px;
    margin: 0;
    flex: none;
  }
  .legacy-sales-toolbar > .listing-filter-actions {
    grid-column: 1 / -1;
    grid-row: 3;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    min-width: 0;
    margin: 0;
  }
  .legacy-sales-toolbar > .listing-filter-actions button {
    min-width: 0;
    min-height: 38px;
    padding-inline: 8px;
    font-size: 13px;
    white-space: nowrap;
  }
}

@media (min-width: 821px) and (max-width: 940px) {
  .sales-query-toolbar.legacy-sales-toolbar:not(.factory-inventory-toolbar) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legacy-sales-toolbar > .sales-sku-filter { grid-column: 1 / -1; grid-row: 1; }
  .legacy-sales-toolbar > #legacySalesStockModeFilter { grid-column: 1; grid-row: 2; }
  .legacy-sales-toolbar > #legacySalesJitStatusFilter { grid-column: 2; grid-row: 2; }
  .legacy-sales-toolbar > .sales-date-controls { grid-column: 1 / -1; grid-row: 3; grid-template-columns: minmax(0, 1fr); }
  .legacy-sales-toolbar > .sales-date-controls .sales-period-actions { grid-column: 1; grid-row: 1; }
  .legacy-sales-toolbar > .sales-date-controls .generic-date-range { grid-column: 1; grid-row: 2; }
  .legacy-sales-toolbar > .listing-filter-actions { grid-column: 1 / -1; grid-row: 4; }
}

@media (min-width: 1101px) {
  .legacy-sales-toolbar > .sales-date-controls { grid-column: 1 / 4; grid-row: 2; }
  .legacy-sales-toolbar > .listing-filter-actions { grid-column: 4; grid-row: 2; }
}
.audit-result { display: inline-block; padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
.audit-result-success { color: #15803d; background: #f0fdf4; }
.audit-result-failed { color: #b91c1c; background: #fef2f2; }
.audit-result-partial { color: #c2410c; background: #fff7ed; }
.audit-result-neutral { color: #475569; background: #f1f5f9; }
.pending-sku-tabs { margin: 0 0 12px; }
.pending-sku-tabs button { min-width: 110px; }
.pending-sku-tabs button span { margin-left: 6px; font-size: 12px; }
.pending-sku-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pending-sku-status.is-ignored { color: #64748b; background: #f1f5f9; }

.sales-tier-value.sales-tier-s, .sales-tier-value.sales-tier-a { display: inline-block; min-width: 18px; padding: 1px 5px; border-radius: 4px; text-align: center; font-weight: 600; line-height: 1.4; }
.sales-tier-value.sales-tier-s { color: #dc2626; background: #fee2e2; }
.sales-tier-value.sales-tier-a { color: #c48245; background: #fff5e9; }

/* Compact desktop tables follow the usable page width, including browser zoom
   and the expanded sidebar. Mobile layouts and wide desktop layouts keep their
   existing rules. */
#app { container-type: inline-size; container-name: workspace; }
@media (min-width: 821px) {
  @container workspace (max-width: 1600px) {
    .table-wrap > .data-table,
    .sales-result-table-wrap > .sales-result-table,
    .forecast-preview-table,
    .stock-planning-scroll > .stock-planning-table {
      width: 100%;
      min-width: 100% !important;
      max-width: none;
      table-layout: auto;
    }
    .table-wrap > .data-table th:not(.user-sized-column),
    .table-wrap > .data-table td,
    .sales-result-table-wrap > .sales-result-table th,
    .sales-result-table-wrap > .sales-result-table td,
    .forecast-preview-table th,
    .forecast-preview-table td {
      width: auto !important;
      min-width: 0 !important;
      padding: 7px 8px;
      overflow: visible;
      text-overflow: clip;
    }
    .table-wrap > .data-table td.actions { width: auto; min-width: 0; }
    .data-table :is([data-sort="remark"], [data-sort="operation"], [data-sort="error_message"]),
    .data-table td:is(.remark-cell, .admin-log-operation-cell) {
      max-width: 36ch;
      white-space: normal;
      overflow-wrap: anywhere;
    }
    .sales-hierarchical-table thead tr:nth-child(2) th { width: auto; }
    .sales-result-table-wrap > .sales-hierarchical-table thead tr:first-child th:first-child,
    .sales-result-table-wrap > .sales-hierarchical-table .sales-product-cell {
      width: 1px !important;
      padding: 8px;
    }
    .sales-hierarchical-table .sales-product-cell .sales-product-stack {
      width: max-content;
      min-width: 186px;
      max-width: none;
      overflow-wrap: normal;
    }
    .sales-result-table-wrap > .sales-hierarchical-table:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"]) thead tr:first-child th:first-child,
    .sales-result-table-wrap > .sales-hierarchical-table:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"]) .sales-product-cell { width: 240px !important; min-width: 240px; }
    .sales-hierarchical-table .sales-product-stack .sales-stock-status { white-space: normal; }
    .sales-hierarchical-table .sales-size-tier { margin-left: 8px; }
    .inventory-grouped-table col, .table-wrap > .data-table col { width: auto !important; }
    .stock-planning-table col:nth-child(n+3) { width: auto !important; }
    .stock-planning-table th, .stock-planning-table td { padding: 5px 6px; }
    .forecast-preview-table td { max-width: 36ch; white-space: normal; overflow-wrap: anywhere; }
    .matrix-store-filter-inline,
    .daily-sales-workspace .analysis-store-filter-row { gap: 5px 8px; padding: 6px 8px; flex-wrap: wrap; }
    .matrix-store-filter-inline > .matrix-store-options,
    .daily-sales-workspace .analysis-store-filter-row > .matrix-store-options {
      flex: 0 1 auto;
      width: auto;
      min-width: 0;
      gap: 3px 6px;
    }
    .matrix-store-filter-inline .matrix-store-options label,
    .daily-sales-workspace .analysis-store-filter-row .matrix-store-options label {
      flex: 0 0 auto;
      width: auto;
      min-width: 0;
      min-height: 28px;
      padding: 2px;
      gap: 4px;
      white-space: nowrap;
    }
    .matrix-store-filter-inline .matrix-store-options input {
      width: 16px;
      height: 16px;
      min-width: 16px;
      margin: 0;
      flex: 0 0 16px;
    }
    .stock-planning-store-options, .stock-planning-account-options { gap: 4px 7px; }
    .stock-planning-store-options label { gap: 4px; padding: 2px; }
    .daily-sales-workspace .analysis-store-filter-row > .daily-sales-offline-account-filter {
      flex: 0 1 auto;
      padding: 0;
      border-top: 0;
    }
    .daily-sales-workspace .analysis-store-filter-row > .daily-sales-compare-trigger { margin-left: auto; }
  }
}

/* Floating cells use the measured source rectangles: no second table layout
   or cumulative fractional column rounding at browser zoom ratios. */
.sticky-table-header-layer th::after {
  content: ''; position: absolute; top: 0; bottom: 0;
  right: calc(var(--sticky-border-right-width, 0px) / -2);
  border-right: var(--sticky-border-right-width, 0px) solid var(--sticky-border-right-color, transparent);
  pointer-events: none;
}
.sticky-table-header-layer th::before {
  content: ''; position: absolute; left: 0; right: 0;
  bottom: calc(var(--sticky-border-bottom-width, 0px) / -2);
  border-bottom: var(--sticky-border-bottom-width, 0px) solid var(--sticky-border-bottom-color, transparent);
  pointer-events: none;
}

.sku-remark-preview { display: block; width: 164px; max-width: 164px; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.sku-remark-preview:hover, .sku-remark-preview:focus-visible { color: var(--blue); text-decoration: underline; }

/* 推款状态位于第二行备货模式之前，各筛选保持独立列。 */
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) .sales-listing-status-filter { position: relative; width: 100%; min-width: 0; cursor: pointer; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) .sales-listing-status-filter > span { position: relative; z-index: 3; pointer-events: none; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) .sales-listing-status-filter select { position: absolute; inset: 0; width: 100%; height: 100%; min-width: 0; padding-left: 76px; }
@media (min-width: 1367px) {
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) { grid-template-columns: repeat(21, minmax(0, 1fr)); }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:nth-child(1) { grid-column: 1 / span 4; grid-row: 1; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:nth-child(2) { grid-column: 5 / span 4; grid-row: 1; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:nth-child(3) { grid-column: 9 / span 4; grid-row: 1; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:nth-child(4) { grid-column: 13 / span 4; grid-row: 1; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > #dailySalesStockTierFilter { grid-column: 17 / span 5; grid-row: 1; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > :is(.listing-filter, .listing-filter-actions):nth-child(1) { grid-column: 1 / span 3; grid-row: 2; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > :is(.listing-filter, .listing-filter-actions):nth-child(2) { grid-column: 4 / span 3; grid-row: 2; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > :is(.listing-filter, .listing-filter-actions):nth-child(3) { grid-column: 7 / span 3; grid-row: 2; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > :is(.listing-filter, .listing-filter-actions):nth-child(4) { grid-column: 10 / span 3; grid-row: 2; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > :is(.listing-filter, .listing-filter-actions):nth-child(5) { grid-column: 13 / span 3; grid-row: 2; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > :is(.listing-filter, .listing-filter-actions):nth-child(6) { grid-column: 16 / span 3; grid-row: 2; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > :is(.listing-filter, .listing-filter-actions):nth-child(7) { grid-column: 19 / span 3; grid-row: 2; }
}
@media (min-width: 821px) and (max-width: 1366px) {
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:nth-child(1) { grid-column: 1; grid-row: 1; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:nth-child(2) { grid-column: 2; grid-row: 1; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:nth-child(3) { grid-column: 3; grid-row: 1; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-sku-filter:nth-child(4) { grid-column: 4; grid-row: 1; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > #dailySalesStockTierFilter { grid-column: 5; grid-row: 1; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > :is(.listing-filter, .listing-filter-actions):nth-child(1) { grid-column: 1; grid-row: 2; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > :is(.listing-filter, .listing-filter-actions):nth-child(2) { grid-column: 2; grid-row: 2; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > :is(.listing-filter, .listing-filter-actions):nth-child(3) { grid-column: 3; grid-row: 2; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > :is(.listing-filter, .listing-filter-actions):nth-child(4) { grid-column: 4; grid-row: 2; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > :is(.listing-filter, .listing-filter-actions):nth-child(5) { grid-column: 5; grid-row: 2; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > :is(.listing-filter, .listing-filter-actions):nth-child(6) { grid-column: 1; grid-row: 3; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .listing-filter-actions { grid-column: 2 / -1; grid-row: 3; }
}
@media (max-width: 820px) {
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > :is(.listing-filter, .listing-filter-actions):nth-child(n) { grid-column: auto; grid-row: auto; }
.sales-query-toolbar:has(#q_sales_listing_status):not(.factory-inventory-toolbar):not(.legacy-sales-toolbar) > .sales-secondary-filter-row > .listing-filter-actions { grid-column: 1 / -1; }
}

/* Factory inventory uses seven columns; keep widths stable across workspace breakpoints.
   Body cell positions vary because product/image cells span six size rows. */
.sales-result-table-wrap > .sales-result-table.inventory-grouped-table { table-layout: fixed; }
.sales-result-table-wrap > .sales-result-table.inventory-grouped-table :is(th, td) { width: auto !important; }
.sales-result-table-wrap > .sales-result-table.inventory-grouped-table th:nth-child(1) { width: 14.56% !important; }
.sales-result-table-wrap > .sales-result-table.inventory-grouped-table th:nth-child(2) { width: 12% !important; }
.sales-result-table-wrap > .sales-result-table.inventory-grouped-table th:nth-child(3) { width: 160px !important; }
.sales-result-table-wrap > .sales-result-table.inventory-grouped-table th:nth-child(4) { width: 7% !important; }
.sales-result-table-wrap > .sales-result-table.inventory-grouped-table th:nth-child(n+5) { width: calc((66.44% - 160px) / 3) !important; }
.inventory-grouped-table .inventory-cost-price-cell { text-align: center; vertical-align: middle; white-space: nowrap; }

/* Highlight the whole goods group, then the specific size under the pointer. */
@media (hover: hover) {
  .sales-result-table.inventory-grouped-table > .inventory-product-group:hover > tr > td { background: #eff9ee; }
  .sales-result-table.inventory-grouped-table > .inventory-product-group > tr:has(> td:not([rowspan]):hover) > td:not([rowspan]) { background: #d9efd6; }
}

.inventory-price-header { max-width: 100%; flex-wrap: nowrap; gap: 8px; }
.inventory-price-types { display: inline-flex; align-items: center; justify-content: center; flex-wrap: nowrap; gap: 0 2px; font-size: inherit; line-height: 1.4; color: var(--muted); }
.inventory-price-supply { color: var(--blue); background: #dbeafe; }
.inventory-price-cost { color: #c48245; background: #fff5e9; }
.inventory-price.sales-tier-value, .inventory-price.sales-listing-status { font-weight: 400; font-size: 12px; }

.inventory-price-types :is(.inventory-price-supply, .inventory-price-cost) { padding: 1px 5px; border-radius: 4px; white-space: nowrap; }
.inventory-grouped-table .inventory-product-name { font-size: 0.875em; }
.menu-group.has-active > .menu-title { background: #e6edf8; border-color: #cfdaec; }

.table-column-setting-parent > span { flex: 1; font-size: 13px; color: var(--muted); }

.sales-hierarchical-table .sales-order-days-sort { white-space: normal; }
.sales-hierarchical-table .sales-order-copy-button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; box-sizing: border-box; margin-top: 0; padding: 0; border: 1px solid #b8d9c9; border-radius: 5px; background: #fff; color: #215b48; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.sales-hierarchical-table .sales-order-copy-button:hover { background: #eef8f2; }

.sales-result-table-wrap > .sales-hierarchical-table:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"]) thead tr:nth-child(2) .sales-order-quantity-subhead { width: 132px !important; min-width: 132px !important; max-width: 132px; }
.sales-order-quantity-control { display: grid; grid-template-columns: 80px 28px; min-width: 114px; align-items: center; gap: 6px; }
.sales-order-copy-slot { width: 28px; }

.sales-result-table-wrap > .sales-hierarchical-table:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"]) thead tr:nth-child(2) .sales-order-days-subhead { width: 98px !important; min-width: 98px !important; max-width: 98px; }
.sales-result-table-wrap > .sales-hierarchical-table:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"]) tbody [data-table-column="orderDays"] { min-width: 98px !important; }
.sales-result-table-wrap > .sales-hierarchical-table:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"]) tbody [data-table-column="orderQuantity"] { min-width: 132px !important; }
/* 两级分组表头在固定布局下会均分组宽度，无法给复制图标预留空间。
   由单元格最小宽度参与排版，窄窗口通过表格横向滚动展示完整输入框。 */
.sales-result-table-wrap > .sales-hierarchical-table:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"]) { table-layout: auto !important; }

@media (min-width: 701px) and (max-width: 1050px) {
  .matrix-links-dialog .matrix-links-editor { overflow-x: auto; }
  .matrix-links-dialog .matrix-link-head, .matrix-links-dialog #matrixLinkRows { min-width: 940px; }
}

/* 首个成功业务日候选：沿用看板矩阵，仅改变店铺单元格颜色。 */
.matrix .cell.jit-first-success,.matrix .cell.on.jit-first-success{background:#fff1df;border-color:#e7a352;color:#a95b13;}
.jit-cell-status{display:block;margin-top:5px;line-height:1.5;white-space:normal;}
.jit-success-controls{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-top:12px;}
.jit-success-controls>label{display:flex;align-items:center;gap:6px;font-size:13px;}
.jit-success-controls input[type=checkbox]{width:auto;}
.jit-success-controls input[type=date]{width:155px;}
.jit-exception-reason{display:block;color:#a95b13;white-space:normal;margin-top:6px;}
.jit-success-matrix .matrix-link-summary{min-height:64px;}
.jit-success-matrix{min-width:780px;}

/* 测款记录范围选项卡 */
.jit-record-tabs{display:flex;gap:24px;width:100%;border-bottom:1px solid #dce3ed;}
.jit-record-tab{position:relative;border:0;border-radius:0;background:transparent;color:#64748b;padding:12px 4px;min-height:44px;font-size:14px;font-weight:500;white-space:nowrap;}
.jit-record-tab:hover{background:transparent;color:#2563eb;}
.jit-record-tab.is-active{background:transparent;color:#2563eb;font-weight:600;}
.jit-record-tab.is-active::after{content:"";position:absolute;bottom:-1px;left:0;right:0;height:3px;border-radius:3px 3px 0 0;background:#2563eb;}
.jit-record-tab span{display:inline-block;margin-left:5px;padding:1px 7px;border-radius:10px;background:#eef2f6;color:#64748b;font-size:12px;}
.jit-record-tab.is-active span{background:#eaf2ff;color:#2563eb;}
.jit-record-tab:focus-visible{outline:2px solid #93b4f8;outline-offset:-2px;}
@media(max-width:480px){.jit-record-tabs{gap:12px;}.jit-record-tab{font-size:13px;}}

/* 测款日期列按日期内容收窄，保留其他看板列宽。 */
.table-wrap > .data-table.jit-success-matrix th:first-child:not(.user-sized-column),
.table-wrap > .data-table.jit-success-matrix td:first-child { width: 130px !important; min-width: 130px !important; max-width: 130px; }
.matrix-save-overlay { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; background: rgba(15,23,42,.3); cursor: wait; }
.matrix-save-overlay[hidden] { display: none; }
.matrix-save-progress { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 28px 36px; border-radius: 12px; background: #fff; color: #334155; box-shadow: 0 12px 40px rgba(0,0,0,.15); }
.matrix-save-spinner { width: 38px; height: 38px; border: 4px solid #dbeafe; border-top-color: #2563eb; border-radius: 50%; animation: matrix-save-spin .8s linear infinite; }
@keyframes matrix-save-spin { to { transform: rotate(360deg); } }
/* User group permissions use the same dialog and table as account management. */
.permission-note { margin-bottom: 16px; padding: 16px; line-height: 1.7; }
.permission-menu-fieldset { grid-column: 1 / -1; min-width: 0; border: 1px solid #dde3ed; border-radius: 10px; padding: 12px; }
.permission-tree { display: grid; gap: 6px; }
.permission-group-form .permission-tree { max-height: 50vh; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.permission-tree-group { padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; }
.permission-tree-parent { display: flex; align-items: center; gap: 6px; min-height: 26px; margin-bottom: 2px; color: var(--text); }
.permission-tree-children { display: grid; gap: 0; padding-left: 22px; }
.permission-tree-children label { display: flex; align-items: center; gap: 6px; margin: 0; line-height: 20px; }
.permission-tree input { width: 14px; height: 14px; padding: 0; margin: 0; flex-shrink: 0; }

.permission-page-row { display: grid; grid-template-columns: 230px minmax(0, 1fr); align-items: start; min-width: 0; padding: 3px 0; }
.permission-page-row > label { min-width: 0; padding-right: 10px; color: var(--text); }
.permission-operation-list { display: flex; flex-wrap: wrap; gap: 2px 14px; min-width: 0; padding: 0; }
.permission-operation-list label { font-size: 12px; }
.permission-batch { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; align-items: center; }
.permission-batch select { max-width: 240px; }
.permission-batch [data-permission-summary] { width: 100%; color: var(--muted); font-size: 12px; }
.sales-hierarchical-table:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"]) .sales-product-cell .sales-product-stack { width: 100%; min-width: 0; margin-inline: auto; align-items: center; text-align: center; }
.sales-hierarchical-table:is([data-analysis-table="dailySales"], [data-analysis-table="factoryChaseList"]) .sales-product-heading { justify-content: center; }
.sales-product-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; align-self: stretch; column-gap: 6px; }
.sales-product-actions .daily-sales-other-stores { grid-column: 2; margin: 0; }
.sales-product-actions .sales-focus-heart { grid-column: 3; justify-self: start; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 4px; border: 0; border-radius: 6px; background: transparent; color: #555; box-shadow: none; }
.sales-focus-heart svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sales-product-actions .sales-focus-heart.is-focused { color: #e53945; }
.sales-focus-heart.is-focused svg { fill: currentColor; }
.sales-product-actions .sales-focus-heart:disabled { opacity: 1; cursor: default; }
.sales-product-actions .sales-focus-heart[data-permission-blocked] { opacity: .5; cursor: not-allowed; }
.sales-product-actions .sales-focus-heart:not(:disabled):hover { background: #fff0f1; color: #e53945; }
.factory-chase-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.factory-chase-store-filter .matrix-store-options { flex: 1 1 350px; }
.factory-chase-status { display: grid; gap: 4px; padding: 8px 12px; font-size: 12px; color: var(--muted); }
.factory-chase-status strong { color: #b45309; font-weight: 500; }
.form-grid.factory-chase-settings-form { grid-template-columns: minmax(0, 1fr); }
.factory-chase-settings-form > .form-static { display: block; min-height: 0; padding: 0; border: 0; background: transparent; }
.factory-chase-settings-form .sales-range-filter { display: flex; flex-direction: row; align-items: center; gap: 12px; width: 100%; height: auto; min-height: 48px; padding: 8px 10px; box-sizing: border-box; }
.factory-chase-settings-form .sales-range-filter > span:first-child { flex: 0 0 70px; }
.factory-chase-settings-form .range-fields { display: flex; gap: 10px; align-items: center; }
.factory-chase-settings-form .range-fields input { width: 0; min-width: 0; flex: 1; height: 32px; }
.factory-chase-settings-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.sales-result-table-wrap > .sales-hierarchical-table .factory-chase-remark-head,
.sales-result-table-wrap > .sales-hierarchical-table .factory-chase-remark-cell { width: 240px !important; min-width: 240px !important; max-width: 320px; white-space: normal; }
.sales-hierarchical-table .factory-chase-remark-cell { position: relative; text-align: left; vertical-align: middle; }
.factory-chase-remark-content { position: absolute; inset: 0; box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; padding: 8px 10px; }
.factory-chase-remark-content .factory-chase-remark-input { display: block; flex: 1 1 0; width: 100%; height: 0; min-height: 0; box-sizing: border-box; padding: 8px; resize: none; overflow: auto; border: 1px solid #d8e2ee; border-radius: 5px; background: #fff; color: #273b52; font: inherit; font-weight: 400; line-height: 1.6; text-align: left; }
.factory-chase-remark-input[readonly] { background: #f8fafc; }
.factory-chase-remark-actions { display: flex; flex: 0 0 28px; justify-content: center; align-items: center; gap: 12px; }
.factory-chase-remark-actions button { min-height: 28px; padding: 4px 14px; font-size: 12px; font-weight: 400; }
.factory-chase-remark-actions .factory-chase-images { padding: 4px 0; border: 0; background: none; color: #2563eb; white-space: nowrap; }
.chase-images-dialog { width: min(60vw, 1800px); max-width: none; height: min(780px, calc(100dvh - 48px)); max-height: none; padding: 0; border: 1px solid #dce4ef; border-radius: 12px; color: #253b53; box-shadow: 0 24px 80px #142d4d40; overflow: hidden; }
.chase-images-dialog[open] { display: flex; flex-direction: column; }
.chase-images-dialog.is-expanded { width: calc(100vw - 16px); height: calc(100dvh - 16px); }
.chase-images-dialog::backdrop { background: #172b4d70; }
.chase-images-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid #e5eaf1; gap: 12px; }
.chase-images-header h2 { margin: 0; font-size: 18px; }
.chase-images-count { display: inline-block; font-size: 13px; color: #637b98; background: #eef3fa; border-radius: 20px; padding: 3px 10px; margin-left: 8px; font-weight: 400; }
.chase-images-skc { font-size: 12px; color: #6b7f96; margin: 7px 0 0; overflow-wrap: anywhere; }
.chase-images-close { font-size: 24px; border: none; padding: 2px 10px; }
.chase-images-body { display: grid; grid-template-columns: 214px minmax(0,1fr); flex: 1; min-height: 0; }
.chase-images-sidebar { min-width: 0; padding: 16px; border-right: 1px solid #e5eaf1; overflow: auto; }
.chase-images-list-title { margin: 0 0 12px; font-size: 13px; font-weight: 600; }
.chase-images-list-title { display: flex; justify-content: space-between; align-items: center; }
.chase-images-refresh { border: 0; background: none; color: #2563eb; padding: 0; min-height: 20px; font-size: 12px; }
.chase-images-list { display: grid; gap: 12px; }
.chase-images-card { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 5px; }
.chase-images-thumb { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; width: 100%; min-width: 0; padding: 7px; border: 1px solid #d9e2ee; background: #fff; color: #4d617b; border-radius: 7px; font-size: 12px; }
.chase-images-thumb[aria-pressed="true"] { border-color: #3978eb; background: #f0f6ff; box-shadow: 0 0 0 1px #3978eb; }
.chase-images-thumb img { width: 100%; height: 72px; object-fit: contain; background: #f5f7fa; }
.chase-images-card small { font-size: 10px; color: #7d8da1; line-height: 1.5; overflow-wrap: anywhere; }
.chase-images-card .chase-image-delete { padding: 2px 0 2px 5px; min-height: 24px; background: none; border: 0; color: #d44848; font-size: 12px; }
.chase-images-delete-hint { margin: 18px 0 0; font-size: 11px; line-height: 1.7; color: #8794a5; }
.chase-images-list-empty { font-size: 12px; color: #8b99ac; }
.chase-images-viewer { display: flex; min-width: 0; min-height: 0; flex-direction: column; background: #f6f8fb; }
.chase-images-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #e5eaf1; font-size: 12px; background: #fff; }
.chase-images-toolbar > div { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.chase-images-toolbar button { padding: 4px 8px; min-height: 28px; font-size: 12px; }
.chase-images-zoom { display: inline-block; min-width: 37px; text-align: center; color: #74859c; }
.chase-images-stage { flex: 1; min-height: 0; min-width: 0; overflow: auto; overscroll-behavior: contain; touch-action: none; }
.chase-images-stage.can-pan { cursor: grab; }
.chase-images-stage.is-panning { cursor: grabbing; user-select: none; }
.chase-images-canvas { display: grid; place-items: center; min-width: 100%; min-height: 100%; box-sizing: border-box; padding: 16px; }
.chase-images-preview { max-width: none; max-height: none; object-fit: contain; box-shadow: 0 2px 12px #233b561a; user-select: none; -webkit-user-drag: none; }
.chase-images-preview[hidden] { display: none; }
.chase-images-empty { margin: 0; color: #8391a6; white-space: pre-line; text-align: center; font-size: 13px; line-height: 2; padding: 20px; }
.chase-images-preview-hint { margin: 0; padding: 8px 12px; font-size: 11px; color: #8492a5; text-align: center; }
.chase-images-footer { border-top: 1px solid #e5eaf1; padding: 14px 20px; background: #fff; }
.chase-images-drop { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px; border: 1px dashed #b5c8e4; border-radius: 7px; background: #f7faff; padding: 12px; font-size: 13px; color: #5e7698; }
.chase-images-drop[hidden] { display: none; }
.chase-images-drop.is-dragging { border-color: #3676ee; background: #eaf2ff; }
.chase-images-drop button { font-size: 12px; min-height: 30px; padding: 5px 12px; }
.chase-images-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 10px; }
.chase-images-message { font-size: 12px; color: #7c8ba0; margin: 0; line-height: 1.6; }
.chase-images-message.is-error { color: #cf4444; }
.chase-images-done { flex-shrink: 0; font-size: 13px; padding: 6px 20px; }
@media (max-width: 640px) {
  .chase-images-dialog { width: calc(100vw - 16px); height: calc(100dvh - 24px); border-radius: 9px; }
  .chase-images-header { padding: 12px 14px; }
  .chase-images-header h2 { font-size: 16px; }
  .chase-images-body { display: flex; flex-direction: column; }
  .chase-images-sidebar { flex: 0 0 auto; padding: 10px 12px; max-height: 146px; border-right: 0; border-bottom: 1px solid #e5eaf1; }
  .chase-images-list-title,.chase-images-delete-hint { display: none; }
  .chase-images-list { display: flex; gap: 10px; }
  .chase-images-card { flex: 0 0 96px; }
  .chase-images-thumb { padding: 4px; gap: 2px; }
  .chase-images-thumb img { height: 42px; }
  .chase-images-card small { font-size: 9px; }
  .chase-images-viewer { flex: 1; }
  .chase-images-toolbar { padding: 7px 9px; gap: 5px; }
  .chase-images-current { display: none; }
  .chase-images-toolbar > div { width: 100%; justify-content: center; }
  .chase-images-footer { padding: 10px 12px; }
  .chase-images-drop { padding: 9px; gap: 7px; font-size: 11px; }
  .chase-images-message { font-size: 11px; }
}
.sales-result-table-wrap > .sales-hierarchical-table[data-analysis-table="factoryChaseList"] { table-layout: fixed !important; }
.sales-result-table-wrap > .sales-hierarchical-table[data-analysis-table="factoryChaseList"] :is(th, td) { width: auto !important; min-width: 0 !important; max-width: none; }
.sales-result-table-wrap > .sales-hierarchical-table[data-analysis-table="factoryChaseList"] .factory-chase-remark-head,
.sales-result-table-wrap > .sales-hierarchical-table[data-analysis-table="factoryChaseList"] .factory-chase-remark-cell { border-left: 1px solid #dfe5ea !important; padding-inline: 14px; }
.sales-hierarchical-table[data-analysis-table="factoryChaseList"] :is(thead tr:first-child, tbody tr.sales-group-summary) > :nth-last-child(2 of :not([hidden])) { border-right-color: #dfe5ea !important; }
.sales-hierarchical-table[data-analysis-table="factoryChaseList"] .factory-chase-remark-content { min-width: 0; max-width: none; align-items: stretch; }
[data-permission-blocked] { cursor: not-allowed; opacity: .55; }

#dialog.permission-group-dialog { width: min(980px, calc(100vw - 32px)); }
#dialog.permission-group-dialog menu { position: sticky; bottom: -1px; z-index: 2; padding: 12px 0; margin-bottom: 0; background: #fff; border-top: 1px solid var(--line); }
@media (max-width: 600px) {
  .permission-tree-children { padding-left: 14px; }
  .permission-page-row { grid-template-columns: 1fr; gap: 2px; }
  .permission-operation-list { padding-left: 20px; gap: 2px 12px; }
}

/* Product tables share one header and are separated only by whitespace. */
#pageSub.factory-chase-page-summary { display: block; font-size: 12px; line-height: 1.6; }
@media (max-width: 1366px) {
  .topbar-page:has(#pageSub.factory-chase-page-summary) { flex-wrap: wrap; row-gap: 4px; }
  #pageSub.factory-chase-page-summary { flex-basis: 100%; margin-left: 0; }
}
.factory-chase-query-filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 10px 0; }
.factory-chase-query-filters > .listing-filter { width: 100%; min-width: 0; }
.factory-chase-query-filters > .sales-sku-filter { display: flex; align-items: center; gap: 8px; padding: 0 9px; }
.factory-chase-query-filters > .sales-sku-filter > span { flex-shrink: 0; font-weight: 600; }
.factory-chase-query-filters > .sales-sku-filter > input { flex: 1; min-width: 0; width: 0; height: 36px; border: 0; background: transparent; padding: 0; }
@media (max-width: 600px) {
  .factory-chase-query-filters { grid-template-columns: minmax(0, 1fr); }
}
.daily-sales-workspace .daily-sales-data-scroll .factory-chase-product-table-wrap { border: 1px solid #dce5eb; border-radius: 8px; }
.daily-sales-workspace .daily-sales-data-scroll .factory-chase-table-head-wrap { border-radius: 8px 8px 0 0; border-bottom: 0; }
.factory-chase-table-head-wrap + .factory-chase-product-table-wrap { border-top: 0 !important; border-top-left-radius: 0 !important; border-top-right-radius: 0 !important; }
.factory-chase-product-table-wrap + .factory-chase-product-table-wrap { margin-top: 14px; }
.factory-chase-workspace .daily-sales-fixed-pagination { margin-top: 12px; border: 1px solid #dce5eb; border-radius: 8px; }
.sales-product-stack .factory-chase-link-store { color: #355f8a; font-weight: 600; }

/* Integrated care label generator and the shared composition editor. */
.care-label-material-dialog { width: min(1100px, 96vw); max-width: 96vw; height: min(780px, 90vh); max-height: 90vh; padding: 0; border: 0; border-radius: 12px; overflow: hidden; }
.care-label-material-dialog iframe { display: block; width: 100%; height: 100%; border: 0; }
.care-label-material-dialog::backdrop { background: rgba(15,23,42,.45); }
.care-text-preview { display: block; max-width: 260px; max-height: 64px; overflow: hidden; white-space: pre-line; font-size: 12px; }
.care-label-frame { min-height: 760px; }
.care-composition-manager { justify-self: start; align-self: center; min-width: 100px; }
.care-label-link-button { padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--blue); font: inherit; cursor: pointer; }
.care-label-link-button:hover { background: transparent; text-decoration: underline; }
.care-label-link-button:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* 推款看板：固定基础信息列，剩余空间分配给店铺列。 */
.table-wrap > .data-table.table-matrix:not(.jit-success-matrix) { table-layout: fixed; min-width: var(--matrix-min-width, 760px) !important; }
.table-wrap > .data-table.table-matrix:not(.jit-success-matrix) th[data-sort="create_time"]:not(.user-sized-column) { width: 130px !important; }
.table-wrap > .data-table.table-matrix:not(.jit-success-matrix) th[data-sort="sku_no"]:not(.user-sized-column) { width: 150px !important; }
.table-wrap > .data-table.table-matrix:not(.jit-success-matrix) th[data-sort="sku_photo"]:not(.user-sized-column) { width: 90px !important; }
.table-wrap > .data-table.table-matrix:not(.jit-success-matrix) th[data-sort="matrix_cost_price"]:not(.user-sized-column) { width: 150px !important; }
.data-table.table-matrix:not(.jit-success-matrix) :is(th, td, .th-sort) { text-align: center; vertical-align: middle; }
.data-table.table-matrix:not(.jit-success-matrix) .thumb { display: block; margin-inline: auto; }
.data-table.table-matrix:not(.jit-success-matrix) .matrix-cost-price-cell .inventory-price { font-size: inherit; }
