:root {
  color-scheme: light;
  --ink: #18201d;
  --muted: #66736d;
  --line: #dce5df;
  --paper: #f5f4ee;
  --panel: #ffffff;
  --soft: #edf3ee;
  --deep: #12211c;
  --accent: #247053;
  --accent-strong: #174c39;
  --copper: #b46f3c;
  --blue: #2d6cdf;
  --good: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --shadow: 0 18px 50px rgba(22, 44, 34, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(36,112,83,.10), transparent 28%),
    linear-gradient(220deg, rgba(180,111,60,.14), transparent 32%),
    var(--paper);
}

button, input, select {
  font: inherit;
  border-radius: 8px;
}

button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 750;
}

button:hover { border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: .48; cursor: not-allowed; }
button:disabled:hover { border-color: var(--line); color: var(--ink); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.secondary { background: #f9fbf6; }
button.compact { padding: 7px 10px; font-size: 12px; }

.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbf6;
  color: var(--ink);
  text-decoration: none;
  font-weight: 750;
}

.home-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

input, select {
  border: 1px solid var(--line);
  background: white;
  padding: 10px 12px;
  min-width: 178px;
}

input[type="number"] { min-width: 80px; width: 88px; }
input[type="file"] { min-width: 250px; }

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 24px;
  background:
    linear-gradient(180deg, #13241e, #0d1815);
  color: #eef8ee;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #dff0de;
  color: #153d2b;
  font-weight: 950;
}
.brand strong { display: block; font-size: 16px; }
.brand small { color: #a8b8ac; font-size: 12px; }

.primary-nav { display: grid; gap: 9px; }
.nav-item {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.055);
  color: #eef8ee;
  padding: 12px 14px;
  text-align: left;
}
.nav-item span { font-weight: 850; }
.nav-item small { color: #b8c8bd; }
.nav-item.is-active, .nav-item:hover { background: #dff0de; color: #143b2a; }
.nav-item.is-active small, .nav-item:hover small { color: #456252; }

.side-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
}
.side-note p { margin: 10px 0 0; color: #c4d1c8; font-size: 12px; line-height: 1.55; }

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

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, h3, h4 { margin: 0; letter-spacing: 0; }
h1 { font-size: 34px; }
h2 { font-size: 24px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }

.hero-copy { margin: 10px 0 0; max-width: 760px; color: var(--muted); line-height: 1.6; }
.hero-actions, .filters, .button-row, .control-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(29,53,36,.04);
}
.stat b { display: block; font-size: 28px; }
.stat span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }

#soldStats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sold-seven-day-panel {
  margin: 12px 0;
  padding: 14px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.sold-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sold-chart-head strong { font-size: 14px; }
.sold-chart-head span { color: var(--muted); font-size: 12px; }
.sold-seven-day-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sold-seven-day-pane { min-width: 0; }
.sold-seven-day-pane > strong { display: block; margin: 10px 0 0 4px; color: var(--muted); font-size: 12px; }
.sold-seven-day-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(58px, 1fr));
  gap: 10px;
  height: 236px;
  margin-top: 12px;
  overflow-x: auto;
}
.sold-day-column {
  display: grid;
  grid-template-rows: 38px minmax(0, 1fr) 20px;
  gap: 5px;
  min-width: 58px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: default;
}
.sold-day-column:hover { background: #f6faf6; }
.sold-day-values { display: grid; align-content: start; text-align: center; font-variant-numeric: tabular-nums; }
.sold-day-values strong { font-size: 13px; }
.sold-day-values span { color: var(--muted); font-size: 11px; }
.sold-day-bars { display: flex; align-items: end; justify-content: center; gap: 8px; min-height: 0; border-bottom: 1px solid var(--line); }
.sold-day-bar { width: min(24px, 30%); min-height: 2px; border-radius: 4px 4px 0 0; transition: height .2s ease; }
.sold-day-bar.is-orders { background: #2f7d5b; }
.sold-day-bar.is-amount { background: #d4872e; }
.sold-day-label { color: var(--muted); font-size: 11px; text-align: center; }
.sold-seven-day-grid .sold-day-bar.is-orders { background: #2f7d5b; }
.sold-seven-day-grid .sold-day-bar.is-amount { background: #d4872e; }

.operation-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 12px;
  margin: 14px 0;
}

.operation-view-tabs {
  display: inline-flex;
  gap: 2px;
  margin-top: 10px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}
.operation-view-tab, .operation-flywheel-tab {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.operation-view-tab.is-active, .operation-flywheel-tab.is-active {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}
.operation-flywheel-averages { grid-template-columns: repeat(5, minmax(0, 1fr)); min-height: 76px; margin: 14px 0; }
.operation-flywheel-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: thin;
}
.operation-flywheel-tab { flex: 0 0 auto; border-bottom: 2px solid transparent; border-radius: 4px 4px 0 0; }
.operation-flywheel-tab.is-active { border-bottom-color: var(--accent); }
.operation-tab-count {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 10px;
  background: #e8efe9;
  color: var(--accent-strong);
  font-size: 11px;
}
.operation-keyword-section { margin: 6px 0 10px; }
.operation-keyword-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px 6px; }
.operation-keyword-summary-head strong { font-size: 12px; }
.operation-keyword-summary-head span { color: var(--muted); font-size: 11px; }
.operation-keyword-pager { display: flex; align-items: center; gap: 6px; }
.operation-keyword-pager button { min-height: 26px; padding: 3px 7px; font-size: 10px; }
.operation-keyword-summary-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  max-height: 300px;
  padding-right: 4px;
  overflow: auto;
  scrollbar-width: thin;
}
.operation-keyword-summary-list > div { display: grid; gap: 3px; min-height: 48px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcf8; }
.operation-keyword-summary-list span { color: var(--muted); font-size: 12px; }
.operation-flywheel-state { min-height: 24px; padding: 8px 0; color: var(--muted); font-size: 13px; }
.operation-flywheel-rule {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 36px;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  background: #f7faf6;
  color: var(--muted);
  font-size: 12px;
}
.operation-flywheel-rule strong { flex: 0 0 auto; color: var(--ink); font-size: 12px; }
.operation-flywheel-rule span { line-height: 1.45; }
.operation-flywheel-primary-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0 5px; }
.operation-flywheel-scope { color: var(--accent-strong); font-size: 12px; font-weight: 850; }
.operation-flywheel-table-scroll { min-height: 160px; max-height: min(68vh, 760px); overflow: auto; border-top: 1px solid var(--line); }
.operation-flywheel-table-scroll table { min-width: 1080px; table-layout: fixed; }
.operation-flywheel-table-scroll th { position: sticky; top: 0; z-index: 2; }
.operation-flywheel-table-scroll th:first-child { width: 360px; }
.operation-flywheel-table-scroll th { padding: 7px 8px; font-size: 11px; }
.operation-flywheel-table-scroll td { padding: 6px 8px; font-size: 12px; line-height: 1.3; }
.operation-flywheel-table-scroll td:not(:first-child) { font-size: 11px; }
.operation-flywheel-table-scroll .sub { margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; line-height: 14px; }
.operation-flywheel-product { min-width: 0; align-items: center; gap: 8px; }
.operation-flywheel-product .sku-thumb { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 6px; }
.operation-flywheel-product > div:first-child { flex: 0 0 44px; width: 44px; }
.operation-flywheel-identity { display: grid; gap: 1px; min-width: 0; overflow: hidden; }
.operation-flywheel-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 17px; }
.operation-flywheel-identity span { color: var(--muted); font-size: 10px; line-height: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operation-flywheel-id-line { white-space: nowrap; }
.operation-shop-title { display: grid; gap: 1px; margin-bottom: 3px; }
.operation-shop-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.operation-shop-title span { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.operation-shop-title.is-expanded span { display: block; -webkit-line-clamp: initial; }
.operation-all-shop-titles { min-height: 30px; }
.operation-expand-button { padding: 0; border: 0; background: transparent; color: var(--accent-strong); font-size: 12px; font-weight: 800; cursor: pointer; text-align: left; }
.operation-flywheel-table-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.operation-flywheel-table-actions label { font-size: 11px; }
.operation-flywheel-table-actions select { width: auto; min-width: 92px; height: 30px; padding: 4px 24px 4px 8px; font-size: 11px; }
.is-hidden { display: none !important; }

.operation-dashboard .card { min-width: 0; }
.operation-risk-card {
  align-self: start;
  padding: 10px 12px;
}
.operation-risk-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.operation-risk-toggle {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease;
}
.operation-risk-card:not(.is-collapsed) .operation-risk-toggle { transform: rotate(180deg); }
.operation-risk-card.is-collapsed .operation-risk-list { display: none; }
.operation-risk-card:not(.is-collapsed) .operation-risk-list { margin-top: 10px; max-height: 360px; overflow: auto; }
.operation-funnel, .operation-bars, .operation-risk-list { display: grid; gap: 10px; }
.funnel-row { display: grid; grid-template-columns: 118px minmax(0, 1fr) 54px; align-items: center; gap: 10px; }
.funnel-label { display: grid; gap: 2px; }
.funnel-label strong { font-size: 13px; }
.funnel-label span, .funnel-row em { color: var(--muted); font-size: 12px; font-style: normal; }
.funnel-track, .operation-bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eee8;
}
.funnel-track span, .operation-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #68a783);
}

.trend-bars {
  height: 168px;
  display: flex;
  align-items: end;
  gap: 4px;
  padding: 8px 2px 0;
  border-bottom: 1px solid var(--line);
}
.trend-bars span {
  flex: 1;
  min-width: 3px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #2d6cdf, #8db1ff);
}
.trend-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}
.trend-meta strong { color: var(--ink); }

.operation-bar-row { display: grid; gap: 6px; }
.bar-row-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.bar-row-head span { color: var(--muted); }

.risk-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}
.risk-item strong, .risk-item span, .risk-item small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.risk-item span, .risk-item small { color: var(--muted); font-size: 12px; }
.risk-item em {
  align-self: start;
  padding: 3px 7px;
  border-radius: 999px;
  background: #fff4dc;
  color: var(--warn);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}
.risk-item small { grid-column: 1 / -1; }

.today-todo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.todo-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "label value"
    "hint value";
  align-items: center;
  gap: 4px 16px;
  min-height: 76px;
  padding: 16px 18px;
  text-align: left;
  background: #f9fbf6;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(29,53,36,.04);
}

.todo-card span { grid-area: label; font-weight: 850; color: var(--ink); }
.todo-card strong { grid-area: value; font-size: 30px; color: var(--accent); }
.todo-card em { grid-area: hint; font-style: normal; color: var(--muted); font-size: 12px; }

.page, .subpage { display: none; }
.page.is-active, .subpage.is-active { display: block; }

.module-panel {
  background: rgba(255,255,255,.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

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

.control-strip {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  margin-bottom: 14px;
}
.control-strip label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 750; }
.inline-check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 750; }
.inline-check input { min-width: 16px; width: 16px; }
.check-filter-strip { align-items: center; }
.filter-count {
  margin-left: auto;
  color: var(--accent-strong);
  font-size: 13px;
}

.section-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.subtab { background: transparent; border-color: var(--line); }
.subtab.is-active { background: var(--deep); color: white; border-color: var(--deep); }

.status-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.status-filter, .purchase-status-filter {
  padding: 8px 12px;
  background: #f7faf4;
  color: var(--muted);
  border-color: var(--line);
  font-size: 13px;
}
.status-filter.is-active, .purchase-status-filter.is-active {
  background: var(--deep);
  color: #fff;
  border-color: var(--deep);
  box-shadow: 0 8px 18px rgba(22, 82, 59, .18);
}
.sold-status-filter.is-active {
  background: var(--deep);
  color: #fff;
  border-color: var(--deep);
  box-shadow: 0 8px 18px rgba(22, 82, 59, .18);
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  margin: 0 0 14px;
}
.filter-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.filter-grid input,
.filter-grid select {
  width: 100%;
  min-width: 0;
  height: 34px;
  font-size: 12px;
}
.filter-grid button {
  align-self: end;
  height: 34px;
}
.table-meta {
  padding: 10px 12px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.purchase-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 190px;
}
.manual-order-bind {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 7px;
  margin-top: 8px;
  min-width: 220px;
}
.manual-order-bind input {
  min-width: 0;
  height: 32px;
  border: 1px solid rgba(36,112,83,.18);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
  background: #fff;
}
.manual-order-bind[data-sync-mode="tracking"] input {
  border-color: rgba(37,99,235,.3);
  background: #f8fbff;
}
.system-listing-time {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 5px;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
.system-listing-time.is-new {
  color: #b42318;
  border-color: #f2a7a0;
  background: #fff1f0;
}
.system-listing-time.is-recent {
  color: #a15c00;
  border-color: #f1c27d;
  background: #fff8e8;
}
.system-listing-time.is-established {
  color: #176b43;
  border-color: #9dd7b7;
  background: #effaf3;
}
.system-listing-time.is-old,
.system-listing-time.is-unknown {
  color: #667085;
  border-color: #cfd5dc;
  background: #f4f6f8;
}
button.danger {
  color: var(--bad);
  border-color: rgba(185,28,28,.22);
  background: #fff7f7;
}
button.danger:hover {
  color: var(--bad);
  border-color: rgba(185,28,28,.42);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 360px;
  gap: 14px;
  align-items: start;
}

.order-list { display: grid; grid-template-columns: 1fr; gap: 10px; min-width: 0; }
.order-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  display: grid;
  gap: 12px;
  box-shadow: 0 12px 32px rgba(22, 44, 34, .055);
  min-width: 0;
  overflow: hidden;
}
.order-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(36,112,83,.12); }
.order-row-card { gap: 9px; padding: 12px; }
.order-row-main {
  display: grid;
  grid-template-columns: 180px minmax(190px, .65fr) minmax(360px, 1.45fr) minmax(220px, .85fr);
  gap: 12px;
  align-items: stretch;
  min-width: 0;
}
.order-top { display: flex; justify-content: space-between; gap: 12px; align-items: start; min-width: 0; }
.order-id { font-size: 16px; font-weight: 900; }
.order-meta, .sub, .muted { color: var(--muted); font-size: 12px; }
.order-seller { display: grid; gap: 3px; min-width: 0; }
.order-seller strong, .order-seller span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.supplier-mini, .row-logistics { display: grid; gap: 4px; min-width: 0; }
.supplier-mini strong, .supplier-mini span, .row-logistics strong, .row-logistics div {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-product { min-width: 0; }
.row-product > div { min-width: 0; }
.order-identity { display: grid; gap: 7px; min-width: 0; }
.order-action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 6px;
}
.order-action-stack .compact { padding-inline: 10px; }
.row-actions { justify-content: flex-end; }
.trace-brief { max-width: 100%; }
.order-products { display: grid; gap: 8px; min-width: 0; }
.product-line { padding: 10px; background: var(--soft); border-radius: 8px; min-width: 0; overflow: hidden; }
.order-products-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
  min-width: 0;
  align-content: stretch;
}
.order-product-link {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  min-height: 82px;
  height: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  color: var(--ink);
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.order-product-link:hover {
  border-color: rgba(36,112,83,.34);
  background: #f3faf4;
  transform: translateY(-1px);
}
.order-product-link.is-disabled { pointer-events: none; color: var(--ink); }
.product-image-button {
  width: 74px;
  height: 74px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #e9eee7;
  cursor: zoom-in;
  overflow: hidden;
}
.product-image-button.is-empty { display: block; cursor: default; }
.product-image-button.is-broken { position: relative; cursor: default; }
.product-image-button.is-broken::after {
  content: "暂无图";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.product-image-button.is-broken img { display: none; }
.product-image-button .thumb { width: 100%; height: 100%; border: 0; border-radius: 8px; }
.product-title-link {
  min-width: 0;
  color: var(--ink);
  font-weight: 800;
}
.product-thumb-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.product-thumb-body strong,
.product-thumb-body em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-thumb-body strong { font-size: 12px; font-style: normal; }
.product-thumb-body em { color: var(--muted); font-size: 11px; font-style: normal; }
.more-products {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 8px;
  border: 1px dashed rgba(36,112,83,.26);
  background: #f7faf4;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  padding: 28px;
  background: rgba(9, 17, 13, .78);
  backdrop-filter: blur(8px);
}
.image-modal.is-open { display: grid; }
.image-modal img {
  max-width: min(92vw, 980px);
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  background: #f8faf6;
  box-shadow: 0 30px 80px rgba(0,0,0,.38);
}
.image-modal-close {
  position: fixed;
  top: 22px;
  right: 26px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
}
.image-modal-title {
  max-width: min(92vw, 980px);
  margin-top: 12px;
  color: #eef8ee;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.inspector, .card, .table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(22, 44, 34, .05);
}
.inspector { position: sticky; top: 18px; padding: 16px; display: grid; gap: 14px; }
.inspector-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); }

.mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.mini-card { padding: 11px; background: #f7faf4; border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 4px; }
.mini-card span { color: var(--muted); font-size: 12px; }
.mini-card strong { font-size: 13px; word-break: break-word; }
.profit-number { font-size: 15px; font-weight: 900; }
.profit-number.good { color: var(--good); }
.profit-number.bad { color: var(--bad); }
.profit-number.muted { color: var(--muted); }

.penalty-upload-button {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.penalty-upload-button input { display: none; }

.penalty-table th:nth-child(1) { width: 19%; }
.penalty-table th:nth-child(2) { width: 9%; }
.penalty-table th:nth-child(3) { width: 19%; }
.penalty-table th:nth-child(4) { width: 18%; }
.penalty-table th:nth-child(5) { width: 16%; }

.penalty-logistics {
  display: grid;
  gap: 3px;
  line-height: 1.3;
}

.penalty-logistics span {
  color: var(--muted);
  font-size: 12px;
}

.penalty-timeline,
.penalty-intervals {
  display: grid;
  gap: 4px;
  line-height: 1.3;
}

.penalty-timeline span,
.penalty-timeline em,
.penalty-intervals span {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.penalty-intervals b { color: var(--ink); }

.profit-manual-cost {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}

.profit-manual-cost input {
  width: 112px;
  min-width: 112px;
  padding: 6px 7px;
  font-size: 12px;
}

.profit-manual-cost input[data-manual-purchase-note] {
  width: 150px;
  min-width: 150px;
}

.store-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 7px;
  margin: 0 5px 5px 0;
  background: #f8fbf7;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.store-chip b { color: var(--ink); }
.offer-order-line {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 48px minmax(90px, auto);
  gap: 8px;
  align-items: center;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.offer-order-line code {
  background: #eef6f0;
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--green);
}
.offer-order-line em {
  font-style: normal;
  text-align: right;
  color: var(--ink);
}

.stack-list { display: grid; gap: 8px; }
.stack-item { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcf8; }
.stack-item strong { display: block; font-size: 13px; }
.stack-item span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 14px; }
.card { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.logistics-pane, .timeline, .detail-pane { display: grid; gap: 10px; }

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

.logistics-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  min-width: 0;
}
.logistics-line strong,
.logistics-line .sub {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-facts {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf4;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.sync-result {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(21,128,61,.22);
  background: #eef8ef;
  color: #24643d;
}
.sync-result span { font-size: 12px; }

.timeline-item {
  position: relative;
  padding: 0 0 14px 17px;
  border-left: 3px solid var(--accent);
}
.timeline-item strong { display: block; font-size: 12px; color: var(--accent-strong); }
.timeline-item span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.timeline-item div { margin-top: 5px; color: var(--ink); font-size: 13px; line-height: 1.5; }

.section-block { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.section-block p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }

.empty { padding: 28px; color: var(--muted); text-align: center; }
.compact-empty { padding: 14px; }

.hint-band {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #fff7e8;
  border: 1px solid #efd4a8;
  border-radius: 8px;
  color: #79511c;
}
.muted-band { background: #f2f5ef; color: var(--muted); border-color: var(--line); }

.upload-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.upload-card {
  min-width: min(100%, 360px);
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px dashed rgba(36,112,83,.38);
  border-radius: 8px;
  background: #f8fbf6;
  color: var(--accent-strong);
  font-weight: 850;
}

.upload-card input { width: 100%; min-width: 0; }
.compact-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 0; }
.sku-thumb { outline: 2px solid rgba(36,112,83,.16); }

.table-wrap { overflow: auto; }
.workflow-table-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 6px 0;
}
.workflow-table-tools label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 750; }
.workflow-table-tools select { min-width: 118px; padding: 6px 8px; font-size: 12px; }
.workflow-table-tools .table-meta { min-width: 148px; text-align: right; }
.workflow-table-tools button { white-space: nowrap; }
.workflow-table-scroll { max-height: min(62vh, 650px); overflow: auto; border-top: 1px solid var(--line); }
.workflow-table-scroll thead th { position: sticky; top: 0; z-index: 3; }
.workflow-table { min-width: 940px; table-layout: fixed; }
.workflow-table th, .workflow-table td { padding: 6px 7px; font-size: 12px; line-height: 1.25; }
.workflow-table th { font-size: 11px; }
.workflow-table .sub { margin-top: 2px; font-size: 10px; line-height: 14px; }
.workflow-table .thumb { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 6px; }
.workflow-product-cell { min-width: 0; gap: 7px; }
.workflow-product-copy { min-width: 0; overflow: hidden; }
.workflow-product-title {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 15px;
}
.workflow-nowrap { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workflow-table .badge { margin: 1px 3px 1px 0; padding: 3px 6px; font-size: 10px; }
.workflow-table .purchase-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; min-width: 0; }
.workflow-table .purchase-actions button { min-width: 0; padding: 5px 6px; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sold-workflow-table .purchase-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.purchase-workflow-table .manual-order-bind { min-width: 0; grid-template-columns: minmax(80px, 1fr) auto; gap: 4px; margin-top: 4px; }
.purchase-workflow-table .manual-order-bind input { height: 26px; padding-inline: 6px; font-size: 10px; }
.purchase-workflow-table .manual-order-bind button { padding: 4px 5px; font-size: 10px; }
.purchase-workflow-table td:last-child > .sub { display: none; }
.purchase-workflow-table td:nth-child(5) .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.purchase-workflow-table td:nth-child(5) .sub:last-child { display: none; }
.purchase-workflow-table th:nth-child(1) { width: 17%; }
.purchase-workflow-table th:nth-child(2) { width: 22%; }
.purchase-workflow-table th:nth-child(3) { width: 13%; }
.purchase-workflow-table th:nth-child(4) { width: 5%; }
.purchase-workflow-table th:nth-child(5) { width: 19%; }
.purchase-workflow-table th:nth-child(6) { width: 24%; }
.sold-workflow-table th:nth-child(1) { width: 18%; }
.sold-workflow-table th:nth-child(2) { width: 25%; }
.sold-workflow-table th:nth-child(3) { width: 11%; }
.sold-workflow-table th:nth-child(4) { width: 15%; }
.sold-workflow-table th:nth-child(5) { width: 11%; }
.sold-workflow-table th:nth-child(6) { width: 20%; }

@media (max-width: 760px) {
  .workflow-table-tools { justify-content: flex-start; flex-wrap: wrap; }
  .workflow-table-tools label { flex: 1 1 140px; }
  .workflow-table-tools select { width: 100%; min-width: 0; }
  .workflow-table-tools .table-meta { flex: 1 1 100%; min-width: 0; text-align: left; }
}
.operation-table-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.operation-pager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.operation-pager strong {
  min-width: 54px;
  text-align: center;
  color: var(--ink);
}
.operation-table-scroll {
  max-height: min(68vh, 760px);
  overflow: auto;
  border-top: 1px solid var(--line);
}
.operation-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}
.operation-product-cell { min-width: 230px; }
.operation-table-scroll table { min-width: 1740px; table-layout: fixed; }
.operation-col-offer { width: 230px; }
.operation-col-links { width: 300px; }
.operation-col-metric { width: 105px; }
.operation-col-source { width: 160px; }
.sort-header-row th {
  padding-top: 6px;
  padding-bottom: 8px;
  background: #f8fbf6;
}
.table-sort-button {
  width: 100%;
  min-height: 28px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #435147;
  font-size: 12px;
  font-weight: 850;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
}
.table-sort-button:hover,
.table-sort-button.active {
  border-color: rgba(36,112,83,.22);
  background: #edf5ee;
  color: var(--accent-strong);
}
.metric-cell {
  padding: 10px 6px;
  text-align: center;
  white-space: nowrap;
}
.operation-table-scroll thead th:nth-child(n+3):nth-child(-n+12) { padding: 8px 4px; text-align: center; }
.operation-metric-value { display: grid; justify-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.operation-metric-value > strong { font-size: 14px; line-height: 1; }
.operation-shop-split { display: grid; width: 100%; gap: 3px; }
.operation-shop-split span { display: grid; grid-template-columns: 6px 18px 1fr; align-items: center; gap: 3px; color: var(--muted); font-size: 10px; line-height: 1.2; }
.operation-shop-split span i { width: 6px; height: 6px; border-radius: 2px; background: #2f7d5b; }
.operation-shop-split span b { font-weight: 800; text-align: left; }
.operation-shop-split span em { font-style: normal; text-align: right; }
.operation-shop-split [data-shop-code="02"] i { background: #2878c8; }
.operation-shop-split [data-shop-code="03"] i { background: #d4872e; }
.operation-shop-split [data-shop-code="04"] i { background: #32845d; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 13px; }
th { background: var(--soft); color: #435147; font-size: 12px; }
tr:hover td { background: #fbfcf8; }
.product-cell { display: flex; align-items: center; gap: 12px; min-width: 280px; }
.product-cell.is-sku-merged { border-left: 3px solid #6366f1; padding-left: 9px; }
.compact-product-cell { min-width: 0; align-items: flex-start; }
.thumb { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; background: #e9eee7; border: 1px solid var(--line); }
.title { font-weight: 800; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { margin-top: 3px; }
.sku-merge-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  border: 1px solid rgba(99,102,241,.24);
  background: #eef2ff;
  color: #4338ca;
}
.sku-merge-badge.is-other {
  border-color: rgba(14,116,144,.24);
  background: #ecfeff;
  color: #0e7490;
}
.check-chip {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  border: 1px solid rgba(21,128,61,.22);
  background: #f0fbf2;
  color: var(--good);
}
.check-chip.muted {
  border-color: var(--line);
  background: #f8faf6;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: #f8faf6;
  color: var(--muted);
  margin: 2px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge.good { color: var(--good); border-color: rgba(21,128,61,.25); background: #f0fbf2; }
.badge.warn { color: var(--warn); border-color: rgba(180,83,9,.25); background: #fff7ed; }
.badge.bad { color: var(--bad); border-color: rgba(185,28,28,.25); background: #fff1f2; }
.sync-chip {
  border: 1px solid var(--line);
  background: #f8faf6;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
}
.sync-chip.good { color: var(--good); background: #effaf0; border-color: rgba(21,128,61,.24); }
.sync-chip.warn { color: var(--warn); background: #fff7ed; border-color: rgba(180,83,9,.24); }
.sync-chip.bad { color: var(--bad); background: #fff1f2; border-color: rgba(185,28,28,.24); }

.sort-head {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0;
  text-align: left;
}
.sort-head:hover,
.sort-head.is-active {
  color: var(--accent);
}

a { color: var(--accent); text-decoration: none; font-weight: 800; }
pre {
  min-height: 420px;
  max-height: 640px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101914;
  color: #eef8ee;
  font: 12px/1.55 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
}

.reconciliation-panel { border-top: 3px solid #315f75; }
.reconciliation-tabs { overflow-x: auto; scrollbar-width: thin; }
.reconciliation-tabs .subtab { flex: 0 0 auto; }
.reconciliation-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
.reconciliation-summary-grid .mini-card { min-height: 76px; justify-content: center; }
.reconciliation-summary-grid .mini-card strong { font-size: 20px; }
.balance-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
  margin-bottom: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 5px solid #64748b;
  border-radius: 6px;
  background: #f8fafc;
}
.balance-banner strong { font-size: 16px; }
.balance-banner span { color: var(--muted); font-size: 12px; text-align: right; }
.balance-banner.is-balanced { border-left-color: var(--good); background: #f0fbf2; }
.balance-banner.is-balanced strong { color: var(--good); }
.balance-banner.is-different { border-left-color: var(--bad); background: #fff7f7; }
.balance-banner.is-different strong { color: var(--bad); }
.reconciliation-flow-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfcf8;
}
.reconciliation-flow-strip > div {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 2px 10px;
  padding: 14px;
  border-right: 1px solid var(--line);
}
.reconciliation-flow-strip > div:last-child { border-right: 0; }
.reconciliation-flow-strip b {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #315f75;
  color: #fff;
}
.reconciliation-flow-strip span { font-weight: 850; }
.reconciliation-flow-strip small { color: var(--muted); }
.reconciliation-upload-grid { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(280px, 1.2fr); }
.refund-summary-band { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; color: var(--muted); }
.refund-summary-band strong { color: var(--ink); }
.refund-source-note { margin-top: 6px; }
.reconciliation-payment-upload-grid { grid-template-columns: minmax(320px, 1fr); }
.payment-category-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}
.reconciliation-month-filter { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.reconciliation-month-filter select { min-width: 140px; }
.payment-category-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcf8;
  cursor: pointer;
}
.payment-category-option input { width: 17px; min-width: 17px; height: 17px; }
.payment-category-option span { display: grid; gap: 2px; min-width: 0; }
.payment-category-option strong { font-size: 13px; }
.payment-category-option small { color: var(--muted); font-size: 11px; }
.payment-category-option:has(input:checked) { border-color: #6f94a5; background: #f3f8fa; }
.channel-note {
  display: grid;
  gap: 5px;
  align-content: center;
  min-height: 76px;
  padding: 12px 14px;
  border-left: 4px solid var(--copper);
  background: #fffaf3;
}
.channel-note span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.reconciliation-item-line { display: grid; gap: 2px; min-width: 260px; padding: 4px 0; }
.reconciliation-item-line span { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 750; }
.reconciliation-item-line em { color: var(--muted); font-size: 12px; font-style: normal; }
.inventory-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-left: 5px solid #315f75;
  background: #f3f7f8;
}
.inventory-headline div { display: grid; gap: 4px; }
.inventory-headline span, .inventory-headline p { color: var(--muted); font-size: 12px; }
.inventory-headline strong { font-size: 22px; }
.inventory-headline p { margin: 0; }
.inventory-quantity { color: #315f75; font-size: 22px; }
.source-orders { max-width: 280px; word-break: break-all; }
button.inventory-dispatch-button {
  border-color: #315f75;
  background: #315f75;
  color: #fff;
}
button.inventory-dispatch-button:hover { border-color: #24495b; background: #24495b; color: #fff; }
.inventory-write-off-button { border-color: #d7a3a3; background: #fff8f8; color: #9b2f2f; }
.inventory-write-off-button:hover { border-color: #9b2f2f; background: #9b2f2f; color: #fff; }

.comprehensive-report-panel { display: grid; gap: 18px; }
.comprehensive-report-panel .panel-head { margin-bottom: 0; }
.report-scope-band {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border-left: 4px solid #315f75;
  background: #f1f7f9;
  color: #31505e;
  font-size: 13px;
}
.report-scope-band strong { color: #243b45; }
.report-section-head, .report-links-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}
.report-section-head > div, .report-links-head > div:first-child { display: grid; gap: 3px; }
.report-section-head span, .report-links-head span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.report-section-head strong, .report-links-head strong { font-size: 16px; }
.report-section-head small { max-width: 520px; color: var(--muted); text-align: right; }
.report-section-head.compact-head { align-items: center; margin-bottom: 13px; }
.report-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.report-metric {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 3px solid #315f75;
  border-radius: 6px;
  background: #fff;
  display: grid;
  align-content: center;
  gap: 5px;
}
.report-metric > span { color: var(--muted); font-size: 12px; }
.report-metric > strong { font-size: 24px; line-height: 1.1; }
.report-metric > small { min-height: 16px; color: var(--muted); font-size: 11px; }
.report-metric.is-sales { border-top-color: #2f7d5b; }
.report-metric.is-inventory { border-top-color: #d4872e; }
.report-metric.is-neutral { border-top-color: #6d7480; }
.report-metric.is-profit-before { border-top-color: #315f75; }
.report-metric.is-profit-after { border-top-color: #a23c3c; }
.report-money-flow {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 24px minmax(130px, 1fr) 24px minmax(130px, 1fr) 24px minmax(130px, 1fr) 24px minmax(150px, 1fr) 24px minmax(150px, 1fr);
  align-items: stretch;
  overflow-x: auto;
  padding-bottom: 4px;
}
.report-money-node {
  min-width: 130px;
  min-height: 92px;
  padding: 13px;
  border: 1px solid var(--line);
  border-bottom: 4px solid #315f75;
  background: #fff;
  display: grid;
  align-content: center;
  gap: 7px;
}
.report-money-node span { color: var(--muted); font-size: 11px; }
.report-money-node strong { font-size: 19px; white-space: nowrap; }
.report-money-node.is-revenue { border-bottom-color: #2f7d5b; }
.report-money-node.is-settlement { border-bottom-color: #315f75; }
.report-money-node.is-cost { border-bottom-color: #d4872e; }
.report-money-node.is-penalty, .report-money-node.is-profit-after { border-bottom-color: #a23c3c; }
.report-money-node.is-profit-before { border-bottom-color: #536f42; }
.report-flow-arrow { display: grid; place-items: center; color: #8b978e; font-size: 24px; }
.report-average-grid, .report-purchase-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.report-average-grid .report-metric { min-height: 82px; }
.report-split-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .78fr); gap: 22px; }
.report-band { min-width: 0; padding: 0; }
.report-purchase-grid .report-metric { min-height: 110px; }
.report-footnote { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.report-shop-distribution { display: grid; gap: 12px; }
.report-shop-row { display: grid; grid-template-columns: 72px minmax(120px, 1fr) 58px; align-items: center; gap: 10px; font-size: 12px; }
.report-shop-row > span { font-weight: 800; }
.report-shop-row > div { height: 12px; background: #edf1ec; overflow: hidden; }
.report-shop-row i { display: block; height: 100%; background: #315f75; }
.report-shop-row:nth-child(2) i { background: #d4872e; }
.report-shop-row:nth-child(3) i { background: #2f7d5b; }
.report-shop-row > strong { text-align: right; }
.report-links-head { align-items: center; margin-top: 2px; }
.report-link-filters { justify-content: flex-end; }
.report-link-filters input { min-width: 310px; }
.report-links-table-wrap { max-height: 580px; }
.report-links-table { min-width: 960px; }
.report-links-table thead { position: sticky; top: 0; z-index: 1; }
.report-platform-link { color: #315f75; font-weight: 850; text-decoration: none; }
.report-platform-link:hover { text-decoration: underline; }

@media (max-width: 1500px) {
  .split-layout, .detail-grid { grid-template-columns: 1fr; }
  .order-row-main { grid-template-columns: 1fr 1fr; }
  .inspector { position: static; }
}

@media (max-width: 1500px) and (min-width: 681px) {
  .order-row-main {
    grid-template-columns: minmax(220px, .9fr) minmax(0, 1.35fr);
    align-items: start;
  }

  .row-logistics {
    padding-top: 2px;
  }

  .order-products-strip {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .primary-nav { grid-template-columns: repeat(2, 1fr); }
  .topbar, .panel-head { align-items: stretch; flex-direction: column; }
  .order-list { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .operation-dashboard { grid-template-columns: 1fr; }
  .reconciliation-summary-grid, .reconciliation-flow-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reconciliation-flow-strip > div:nth-child(2) { border-right: 0; }
  .report-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-split-layout { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .refund-summary-band { align-items: flex-start; flex-direction: column; }
  .main, .sidebar { padding: 16px; }
  .primary-nav, .stats, .mini-grid, .today-todo { grid-template-columns: 1fr; }
  .filters, .hero-actions, .control-strip { align-items: stretch; flex-direction: column; }
  .filter-grid { grid-template-columns: 1fr; }
  input, select, input[type="file"] { width: 100%; min-width: 0; }
  h1 { font-size: 28px; }
  .order-row-main { grid-template-columns: 1fr; }
  .order-products-strip { grid-template-columns: 1fr; }
  .row-actions { justify-content: flex-start; }
  .funnel-row { grid-template-columns: 1fr; }
  .funnel-row em { text-align: right; }
  .reconciliation-summary-grid, .reconciliation-flow-strip, .reconciliation-upload-grid, .payment-category-filters { grid-template-columns: 1fr; }
  .reconciliation-flow-strip > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .reconciliation-flow-strip > div:last-child { border-bottom: 0; }
  .balance-banner, .inventory-headline { align-items: flex-start; flex-direction: column; }
  .balance-banner span { text-align: left; }
  .report-scope-band, .report-section-head, .report-links-head { align-items: flex-start; flex-direction: column; }
  .report-section-head small { text-align: left; }
  .report-metric-grid, .report-average-grid, .report-purchase-grid { grid-template-columns: 1fr; }
  .report-link-filters { width: 100%; }
  .report-link-filters input { min-width: 0; }
  .report-links-table-wrap { max-height: 520px; }
}

@media (max-width: 390px) {
  .operation-view-tabs { width: 100%; }
  .operation-view-tab { flex: 1; min-width: 0; padding-inline: 6px; font-size: 12px; }
  .operation-flywheel-averages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operation-flywheel-tabs { margin-inline: -2px; }
  .operation-flywheel-tab { font-size: 12px; }
  .operation-flywheel-table-scroll { max-width: 100%; }
  .operation-flywheel-product { min-width: 250px; }
  .operation-flywheel-rule { align-items: flex-start; flex-direction: column; gap: 2px; }
  .operation-flywheel-table-actions { width: 100%; }
}
