.sales-ui {
  --sales-blue: #2f6cf6;
  --sales-teal: #0e8f9a;
  --sales-green: #0d9f78;
  --sales-amber: #d88412;
  --sales-coral: #df4d5c;
}

.sales-ui .brand-mark {
  background: #2f6cf6;
}

.period-switch,
.live-status {
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.period-switch:hover,
.live-status:hover {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--line));
  background: var(--primary-soft);
  color: var(--primary);
}

.live-status {
  background: var(--surface-2);
}

.live-status strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 680;
}

.live-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}

.sales-ui .content,
.sales-ui .workspace {
  min-width: 0;
  min-height: 0;
}

.sales-ui .workspace {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sales-ui .data-table .index-col {
  left: 0;
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 680;
}

.page-kicker::before {
  content: "";
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
}

.dashboard-scroll,
.analysis-scroll {
  scrollbar-gutter: stable;
}

.sales-metric-grid {
  grid-template-columns: repeat(6, minmax(142px, 1fr));
}

.sales-metric-grid .metric-card {
  min-height: 108px;
  text-align: left;
}

.metric-subline {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: var(--text-3);
  font-size: 10px;
  white-space: nowrap;
}

.metric-subline b {
  color: var(--text-2);
  font-weight: 650;
}

.metric-subline .danger { color: var(--danger); }
.metric-subline .success { color: var(--success); }
.metric-subline .warning { color: var(--warning); }

.operating-rail {
  display: grid;
  grid-template-columns: repeat(6, minmax(128px, 1fr));
  margin-bottom: 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.operating-node {
  min-width: 128px;
  min-height: 64px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background-color 150ms ease;
}

.operating-node:last-child { border-right: 0; }
.operating-node:hover { background: var(--surface-2); }

.operating-node > span:first-child {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
}

.operating-node.warning > span:first-child { background: var(--warning-soft); color: var(--warning); }
.operating-node.danger > span:first-child { background: var(--danger-soft); color: var(--danger); }
.operating-node.success > span:first-child { background: var(--success-soft); color: var(--success); }
.operating-node.teal > span:first-child { background: var(--teal-soft); color: var(--teal); }

.operating-node span:nth-child(2) { min-width: 0; }

.operating-node span:nth-child(2) strong,
.operating-node span:nth-child(2) em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operating-node span:nth-child(2) strong {
  font-size: 11px;
  font-weight: 620;
}

.operating-node span:nth-child(2) em {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 9px;
  font-style: normal;
}

.operating-node > b {
  color: var(--text);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 730;
}

.operating-node.warning > b { color: var(--warning); }
.operating-node.danger > b { color: var(--danger); }
.operating-node.success > b { color: var(--success); }

.sales-main-grid {
  grid-template-columns: minmax(0, 1.52fr) minmax(310px, 0.72fr);
}

.sales-lower-grid {
  grid-template-columns: minmax(0, 1.28fr) minmax(330px, 0.72fr);
}

.sales-chart {
  height: 232px;
  padding: 10px 14px 6px;
}

.sales-chart svg {
  width: 100%;
  height: 186px;
  overflow: visible;
}

.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-label {
  fill: var(--text-3);
  font-size: 9px;
}

.chart-line-leads,
.chart-line-orders,
.chart-line-gmv {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-leads { stroke: var(--primary); }
.chart-line-orders { stroke: var(--success); }
.chart-line-gmv { stroke: var(--warning); }
.chart-area-leads { fill: color-mix(in srgb, var(--primary) 8%, transparent); }

.chart-point {
  fill: var(--surface);
  stroke: var(--primary);
  stroke-width: 2;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-3);
  font-size: 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}

.legend-dot.green { background: var(--success); }
.legend-dot.amber { background: var(--warning); }
.legend-dot.red { background: var(--danger); }
.legend-dot.teal { background: var(--teal); }

.attainment-list {
  padding: 4px 0 7px;
}

.attainment-item {
  min-height: 49px;
  padding: 7px 14px;
}

.attainment-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.attainment-line span {
  min-width: 0;
  overflow: hidden;
  color: var(--text-2);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attainment-line strong {
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.attainment-line strong.warning { color: var(--warning); }
.attainment-line strong.danger { color: var(--danger); }
.attainment-line strong.success { color: var(--success); }

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--surface-3);
}

.progress-track i {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--bar-color, var(--primary));
}

.attainment-summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 3px 14px 7px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.attainment-summary span {
  color: var(--text-3);
  font-size: 10px;
}

.attainment-summary strong {
  color: var(--success);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.compact-ranking {
  padding: 2px 0;
}

.rank-row {
  min-height: 45px;
  display: grid;
  grid-template-columns: 24px minmax(94px, 0.8fr) minmax(120px, 1fr) 76px 70px;
  align-items: center;
  gap: 9px;
  padding: 5px 13px;
  border-bottom: 1px solid var(--line);
}

.rank-row:last-child { border-bottom: 0; }
.rank-row:hover { background: var(--surface-2); }

.rank-index {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
}

.rank-row:nth-child(1) .rank-index { background: var(--warning-soft); color: var(--warning); }
.rank-row:nth-child(2) .rank-index { background: var(--primary-soft); color: var(--primary); }
.rank-row:nth-child(3) .rank-index { background: var(--teal-soft); color: var(--teal); }

.rank-person {
  min-width: 0;
}

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

.rank-person strong { color: var(--text); font-size: 11px; }
.rank-person span { margin-top: 2px; color: var(--text-3); font-size: 9px; }

.rank-row > strong {
  color: var(--text);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.mini-progress {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(46px, 1fr) 34px;
  align-items: center;
  gap: 6px;
}

.mini-progress i {
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--surface-3);
}

.mini-progress i::after {
  content: "";
  display: block;
  width: var(--progress, 50%);
  height: 100%;
  border-radius: inherit;
  background: var(--bar-color, var(--primary));
}

.mini-progress b {
  color: var(--text-2);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.funnel-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(86px, 1fr));
  gap: 0;
  padding: 16px 14px 13px;
}

.funnel-step {
  position: relative;
  min-width: 0;
  padding: 0 10px 0 12px;
  border-right: 1px solid var(--line);
}

.funnel-step:last-child { border-right: 0; }

.funnel-step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 3px;
  border-radius: 2px;
  background: var(--step-color, var(--primary));
}

.funnel-step span,
.funnel-step strong,
.funnel-step em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funnel-step span { color: var(--text-3); font-size: 9px; }
.funnel-step strong { margin-top: 5px; color: var(--text); font-size: 17px; font-variant-numeric: tabular-nums; }
.funnel-step em { margin-top: 5px; color: var(--success); font-size: 9px; font-style: normal; }
.funnel-step em.down { color: var(--danger); }

.funnel-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 14px 13px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--warning) 20%, var(--line));
  border-radius: 6px;
  background: var(--warning-soft);
  color: var(--text-2);
  font-size: 10px;
}

.funnel-note strong { color: var(--warning); }

.page-shell {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
}

.page-shell .page-heading {
  flex: 0 0 auto;
  margin: 0;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.analysis-scroll {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 14px 16px 18px;
}

.filter-strip {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  overflow-x: auto;
}

.filter-strip .filter-field {
  min-width: 128px;
}

.filter-strip .filter-field select,
.filter-strip .filter-field input {
  height: 30px;
}

.filter-strip .filter-label {
  color: var(--text-3);
  font-size: 10px;
  white-space: nowrap;
}

.filter-strip .strip-actions {
  display: flex;
  gap: 7px;
  margin-left: auto;
}

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
  gap: 12px;
  margin-bottom: 12px;
}

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

.analysis-chart {
  height: 250px;
  padding: 12px 14px;
}

.bar-chart {
  height: 190px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 8px 24px;
  border-bottom: 1px solid var(--line);
}

.bar-group {
  min-width: 52px;
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.bar-column {
  position: relative;
  width: 26%;
  min-width: 8px;
  max-width: 22px;
  height: var(--bar-height, 50%);
  border-radius: 3px 3px 0 0;
  background: var(--bar-color, var(--primary));
}

.bar-column:hover::after {
  content: attr(data-value);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  z-index: 3;
  transform: translateX(-50%);
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
  font-size: 9px;
  white-space: nowrap;
}

.bar-group-labels {
  display: grid;
  grid-template-columns: repeat(var(--bar-count, 5), minmax(52px, 1fr));
  gap: 12px;
  padding: 6px 8px 0;
  color: var(--text-3);
  font-size: 9px;
  text-align: center;
}

.score-panel {
  min-height: 250px;
  display: grid;
  place-items: center;
  padding: 16px;
}

.score-ring {
  --score: 82;
  position: relative;
  width: 138px;
  height: 138px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--success) 0 calc(var(--score) * 1%), var(--surface-3) calc(var(--score) * 1%) 100%);
}

.score-ring::after {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: var(--surface);
}

.score-ring > span {
  position: relative;
  z-index: 1;
  text-align: center;
}

.score-ring strong,
.score-ring em { display: block; }
.score-ring strong { color: var(--text); font-size: 30px; font-variant-numeric: tabular-nums; }
.score-ring em { margin-top: 3px; color: var(--text-3); font-size: 10px; font-style: normal; }

.score-breakdown {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.score-breakdown div {
  min-width: 0;
  text-align: center;
}

.score-breakdown span,
.score-breakdown strong { display: block; }
.score-breakdown span { color: var(--text-3); font-size: 9px; }
.score-breakdown strong { margin-top: 3px; color: var(--text-2); font-size: 12px; }

.matrix-wrap {
  overflow: auto;
  padding: 12px 14px 14px;
}

.heatmap {
  min-width: 680px;
  display: grid;
  grid-template-columns: 120px repeat(7, minmax(64px, 1fr));
  gap: 4px;
}

.heatmap > div {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: var(--text-2);
  font-size: 10px;
}

.heatmap .heat-head {
  background: var(--surface-2);
  color: var(--text-3);
  font-weight: 650;
}

.heatmap .heat-label {
  justify-content: start;
  padding-left: 8px;
  background: var(--surface-2);
  color: var(--text-2);
}

.heatmap .heat-cell {
  background: color-mix(in srgb, var(--heat-color, var(--primary)) var(--heat-alpha, 12%), var(--surface));
  color: color-mix(in srgb, var(--heat-color, var(--primary)) 80%, var(--text));
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.table-page {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.table-page .page-heading {
  margin: 0;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.table-toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.table-search {
  width: 244px;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-3);
}

.table-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 11px;
}

.table-toolbar .chip-scroll {
  min-width: 0;
  display: flex;
  gap: 5px;
  overflow-x: auto;
}

.table-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.cell-link {
  color: var(--primary);
  font-weight: 620;
  cursor: pointer;
}

.cell-person {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.cell-avatar {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 9px;
  font-weight: 720;
}

.percentage-cell {
  min-width: 92px;
  display: grid;
  grid-template-columns: minmax(44px, 1fr) 36px;
  align-items: center;
  gap: 6px;
}

.percentage-cell i {
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--surface-3);
}

.percentage-cell i u {
  display: block;
  height: 100%;
  border-radius: inherit;
  text-decoration: none;
}

.percentage-cell b {
  color: var(--text-2);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.rule-signal {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-2);
  font-size: 10px;
}

.rule-signal::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal-color, var(--success));
}

.duplicate-callout {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--warning) 18%, var(--line));
  background: var(--warning-soft);
}

.duplicate-callout > span:first-child {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--surface);
  color: var(--warning);
}

.duplicate-callout div { min-width: 0; }
.duplicate-callout strong,
.duplicate-callout p { margin: 0; }
.duplicate-callout strong { color: var(--text); font-size: 11px; }
.duplicate-callout p { margin-top: 3px; color: var(--text-2); font-size: 10px; line-height: 1.45; }

.quality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.quality-stat {
  min-height: 96px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.quality-stat span,
.quality-stat strong,
.quality-stat em { display: block; }
.quality-stat span { color: var(--text-3); font-size: 10px; }
.quality-stat strong { margin-top: 8px; color: var(--text); font-size: 24px; font-variant-numeric: tabular-nums; }
.quality-stat em { margin-top: 6px; color: var(--success); font-size: 9px; font-style: normal; }
.quality-stat em.warning { color: var(--warning); }
.quality-stat em.danger { color: var(--danger); }

.check-list {
  padding: 3px 0;
}

.check-item {
  min-height: 54px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 88px 80px;
  align-items: center;
  gap: 10px;
  padding: 7px 13px;
  border-bottom: 1px solid var(--line);
}

.check-item:last-child { border-bottom: 0; }

.check-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--success-soft);
  color: var(--success);
}

.check-icon.warning { background: var(--warning-soft); color: var(--warning); }
.check-icon.danger { background: var(--danger-soft); color: var(--danger); }

.check-copy { min-width: 0; }
.check-copy strong,
.check-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-copy strong { color: var(--text); font-size: 11px; }
.check-copy span { margin-top: 3px; color: var(--text-3); font-size: 9px; }
.check-item > b { color: var(--text-2); font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }

.drawer-entity-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 780;
}

.sales-drawer {
  width: min(590px, 92vw);
}

.drawer-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.drawer-kpi {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.drawer-kpi span,
.drawer-kpi strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-kpi span { color: var(--text-3); font-size: 9px; }
.drawer-kpi strong { margin-top: 5px; color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }

.detail-section {
  margin-bottom: 14px;
}

.detail-section:last-child { margin-bottom: 0; }

.detail-section > h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 680;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.detail-pair {
  min-width: 0;
  min-height: 46px;
  padding: 7px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-pair:nth-child(2n) { border-right: 0; }
.detail-pair:nth-last-child(-n + 2) { border-bottom: 0; }
.detail-pair span,
.detail-pair strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-pair span { color: var(--text-3); font-size: 9px; }
.detail-pair strong { margin-top: 4px; color: var(--text-2); font-size: 11px; font-weight: 600; }

.signal-list {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.signal-row {
  min-height: 46px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}

.signal-row:last-child { border-bottom: 0; }
.signal-row > span:first-child { color: var(--success); }
.signal-row.warning > span:first-child { color: var(--warning); }
.signal-row.danger > span:first-child { color: var(--danger); }
.signal-row div { min-width: 0; }
.signal-row strong,
.signal-row em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signal-row strong { color: var(--text); font-size: 10px; }
.signal-row em { margin-top: 3px; color: var(--text-3); font-size: 9px; font-style: normal; }
.signal-row > b { color: var(--text-2); font-size: 10px; font-weight: 650; }

.evidence-box {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 10px;
  line-height: 1.7;
}

.evidence-box strong { color: var(--text); }

.timeline-list {
  position: relative;
  padding-left: 17px;
}

.timeline-list::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 7px;
  bottom: 7px;
  width: 1px;
  background: var(--line-strong);
}

.timeline-item {
  position: relative;
  padding: 0 0 16px 10px;
}

.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 4px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.timeline-item strong,
.timeline-item span { display: block; }
.timeline-item strong { color: var(--text); font-size: 10px; }
.timeline-item span { margin-top: 4px; color: var(--text-3); font-size: 9px; line-height: 1.5; }

.sales-modal {
  position: fixed;
  inset: 0;
  z-index: 52;
  display: grid;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.sales-modal.open {
  visibility: visible;
  opacity: 1;
}

.sales-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 22, 35, 0.42);
  backdrop-filter: blur(2px);
}

.sales-modal-panel {
  position: relative;
  width: min(640px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 42px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transform: translateY(10px) scale(0.985);
  transition: transform 220ms var(--ease);
}

.sales-modal.open .sales-modal-panel { transform: translateY(0) scale(1); }

.sales-modal-head {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

.sales-modal-head h2,
.sales-modal-head p { margin: 0; }
.sales-modal-head h2 { color: var(--text); font-size: 15px; }
.sales-modal-head p { margin-top: 4px; color: var(--text-3); font-size: 10px; }

.sales-modal-body {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 14px;
}

.sales-modal-foot {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.sales-modal-foot > span { color: var(--text-3); font-size: 9px; }
.sales-modal-foot > div { display: flex; gap: 8px; margin-left: auto; }

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

.form-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field.full { grid-column: 1 / -1; }
.form-field label { color: var(--text-2); font-size: 10px; font-weight: 620; }
.form-field label b { color: var(--danger); }

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
}

.form-field input,
.form-field select { height: 34px; padding: 0 9px; }
.form-field textarea { min-height: 86px; padding: 8px 9px; resize: vertical; line-height: 1.55; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.form-field small { color: var(--text-3); font-size: 9px; }

.upload-zone {
  min-height: 110px;
  display: grid;
  place-items: center;
  border: 1px dashed color-mix(in srgb, var(--primary) 45%, var(--line));
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  text-align: center;
}

.upload-zone strong,
.upload-zone span { display: block; }
.upload-zone strong { margin-top: 7px; font-size: 11px; }
.upload-zone span { margin-top: 4px; color: var(--text-3); font-size: 9px; }

.risk-note {
  min-height: 48px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 12px;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--warning) 22%, var(--line));
  border-radius: 6px;
  background: var(--warning-soft);
  color: var(--text-2);
  font-size: 10px;
  line-height: 1.55;
}

.risk-note > span { flex: 0 0 auto; color: var(--warning); }
.risk-note strong { color: var(--text); }

@media (max-width: 1500px) {
  .sales-metric-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .operating-rail { grid-template-columns: repeat(6, minmax(142px, 1fr)); }
}

@media (max-width: 1180px) {
  .period-switch { display: none; }
  .sales-main-grid,
  .sales-lower-grid,
  .analysis-grid { grid-template-columns: 1fr; }
  .quality-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}

@media (max-width: 920px) {
  .live-status { display: none; }
  .sales-metric-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .analysis-grid.equal { grid-template-columns: 1fr; }
  .rank-row { grid-template-columns: 24px minmax(88px, 1fr) minmax(110px, 1fr) 68px; }
  .rank-row > strong:last-child { display: none; }
  .funnel-strip { min-width: 640px; }
  .section-panel:has(.funnel-strip) { overflow-x: auto; }
}

@media (max-width: 760px) {
  .dashboard-scroll,
  .analysis-scroll { padding: 10px; }
  .page-shell .page-heading,
  .table-page .page-heading { padding: 10px 12px; }
  .page-heading-actions .secondary-button span,
  .page-heading-actions .primary-button span { display: none; }
  .page-heading-actions .secondary-button,
  .page-heading-actions .primary-button { width: 32px; padding: 0; }
  .sales-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-metric-grid .metric-card { min-height: 104px; }
  .metric-value { font-size: 20px; }
  .operating-rail { margin-bottom: 10px; }
  .sales-main-grid,
  .sales-lower-grid { gap: 10px; }
  .table-toolbar { flex-wrap: wrap; }
  .table-search { width: 100%; }
  .table-toolbar .chip-scroll { order: 3; width: 100%; }
  .table-toolbar-actions { margin-left: auto; }
  .quality-grid { grid-template-columns: 1fr 1fr; }
  .drawer-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-pair,
  .detail-pair:nth-child(2n),
  .detail-pair:nth-last-child(-n + 2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-pair:last-child { border-bottom: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .check-item { grid-template-columns: 30px minmax(0, 1fr) 72px; }
  .check-item > :last-child { display: none; }
}

@media (max-width: 480px) {
  .sales-metric-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .metric-card { padding: 10px; }
  .metric-label { font-size: 10px; }
  .metric-icon { width: 25px; height: 25px; }
  .metric-subline { font-size: 9px; }
  .sparkline { display: none; }
  .quality-grid { grid-template-columns: 1fr; }
  .score-breakdown { grid-template-columns: 1fr; }
  .sales-modal-panel { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .drawer-tabs { overflow-x: auto; }
  .drawer-tab { flex: 0 0 auto; }
}
