/* 埋点漏斗视图专属样式：类名前缀 sbi-funnel-，沿用 social-v2 token。 */

.sbi-funnel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sbi-funnel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.sbi-funnel-head h1 {
  margin: 0 0 4px;
  color: var(--sbi-text);
  font-size: 22px;
  line-height: 1.2;
}

.sbi-funnel-head span {
  color: var(--sbi-text-2);
  font-size: 12.5px;
}

.sbi-funnel-apps {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.sbi-funnel-apps > span {
  padding: 5px 10px;
  border: 1px solid var(--sbi-border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--sbi-text-2);
  font-weight: 700;
}

.sbi-funnel-warning {
  display: grid;
  gap: 4px;
  padding: 10px 14px;
  border: 1px solid #f3ddc0;
  border-radius: 10px;
  background: var(--sbi-warn-bg);
  color: var(--sbi-warn-text);
  font-size: 12.5px;
}

.sbi-funnel-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.sbi-funnel-kpi {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
}

.sbi-funnel-kpi span {
  color: var(--sbi-text-2);
  font-size: 12.5px;
  font-weight: 700;
}

.sbi-funnel-kpi strong {
  color: var(--sbi-text);
  font-size: 23px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.sbi-funnel-grid {
  display: grid;
  grid-template-columns: minmax(380px, 0.95fr) minmax(520px, 1.25fr);
  gap: 16px;
}

.sbi-funnel-chart-card,
.sbi-funnel-table-card,
.sbi-funnel-cohort-card {
  min-width: 0;
}

.sbi-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 0;
}

.sbi-card-title h2 {
  margin: 0 0 3px;
  color: var(--sbi-text);
  font-size: 15px;
  line-height: 1.2;
}

.sbi-card-title span {
  color: var(--sbi-text-3);
  font-size: 12px;
}

.sbi-funnel-chart {
  height: 358px;
  margin: 8px 8px 12px;
}

.sbi-funnel-step-scroll {
  max-height: 390px;
  margin-top: 10px;
}

.sbi-funnel-step-table td:first-child {
  min-width: 150px;
}

.sbi-funnel-step-table td strong {
  display: block;
  color: var(--sbi-text);
}

.sbi-funnel-step-table td span {
  display: block;
  margin-top: 2px;
  color: var(--sbi-text-3);
  font-size: 11.5px;
}

.sbi-funnel-step-table tr.is-failure td {
  background: #fff7ed;
}

.sbi-funnel-step-table tr.is-failure td:first-child strong {
  color: #b45309;
}

.sbi-funnel-cohort-card {
  overflow: hidden;
}

.sbi-funnel-cohort-title {
  align-items: flex-start;
}

.sbi-funnel-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--sbi-border);
  border-radius: 9px;
  background: #f1f5fa;
}

.sbi-funnel-tabs button {
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--sbi-text-2);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.sbi-funnel-tabs button.is-active {
  background: #ffffff;
  color: var(--sbi-accent);
  box-shadow: 0 1px 3px rgba(16, 34, 56, 0.12);
}

.sbi-funnel-cohort-scroll {
  max-height: 520px;
  margin-top: 12px;
}

.sbi-funnel-cohort-table th,
.sbi-funnel-cohort-table td {
  min-width: 104px;
}

.sbi-funnel-cohort-table th:first-child,
.sbi-funnel-cohort-table td:first-child {
  min-width: 150px;
}

.sbi-funnel-empty-cell {
  padding: 34px 12px !important;
  color: var(--sbi-text-3);
  text-align: center !important;
}

.sbi-funnel-skeleton {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.sbi-funnel-skeleton .sbi-skeleton {
  height: 34px;
}

@media (max-width: 1360px) {
  .sbi-funnel-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sbi-funnel-grid {
    grid-template-columns: 1fr;
  }
}
