.customer-performance-view {
  min-width: 0;
  padding: 0 0 28px;
  color: #1f3447;
  font-family: "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
}

.cp-page-header {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px;
  border-bottom: 1px solid #c9d8e5;
  background:
    radial-gradient(circle at 82% 0, rgba(83, 151, 199, .16), transparent 34%),
    linear-gradient(135deg, #f8fbfd, #edf4f9);
}

.cp-page-header h2 {
  margin: 3px 0 5px;
  color: #173f5e;
  font-size: 25px;
  line-height: 1.2;
}

.cp-page-header p {
  margin: 0;
  color: #6a7f91;
  font-size: 13px;
  font-weight: 650;
}

.cp-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cp-live-badge {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid #8ebcae;
  border-radius: 999px;
  background: #effaf6;
  color: #26725d;
  font-size: 12px;
  font-weight: 900;
}

.cp-live-badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #29a17f;
  box-shadow: 0 0 0 4px rgba(41, 161, 127, .12);
}

.cp-export-button,
.cp-refresh-button,
.cp-filter-card button,
.cp-pagination button {
  min-height: 36px;
  border: 1px solid #9db3c6;
  border-bottom-color: #7894aa;
  border-radius: 5px;
  background: linear-gradient(#fff, #e8f0f6);
  color: #315b7c;
  padding: 0 15px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 1px 0 #fff, 0 2px 4px rgba(36, 73, 101, .11);
}

.cp-refresh-button,
#customerPerformanceSearchButton,
#customerPerformanceActivityForm button[type="submit"] {
  border-color: #246799;
  border-bottom-color: #174b73;
  background: linear-gradient(#4a91c5, #2b72a8 56%, #246596);
  color: #fff;
}

.cp-export-button:hover,
.cp-refresh-button:hover,
.cp-filter-card button:hover,
.cp-pagination button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.cp-basis-banner {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 24px;
  border-bottom: 1px solid #d3e0e9;
  background: #f7fafc;
  color: #587085;
  font-size: 12px;
}

.cp-basis-banner strong {
  color: #255d84;
  font-size: 12px;
}

.cp-basis-banner time {
  margin-left: auto;
  color: #73889a;
  white-space: nowrap;
}

.cp-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 24px 0;
  border-bottom: 1px solid #c9d8e5;
  background: #fff;
}

.cp-tabs button {
  position: relative;
  min-width: 142px;
  min-height: 41px;
  border: 0;
  background: transparent;
  color: #687d8f;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.cp-tabs button.active { color: #1e6090; }
.cp-tabs button.active::after {
  position: absolute;
  right: 14px;
  bottom: -1px;
  left: 14px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #2e78ad;
  content: "";
}

.cp-panel { padding: 16px 24px 0; }

.cp-filter-card {
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(360px, 1.25fr) minmax(360px, 1.25fr);
  align-items: end;
  gap: 14px 18px;
  padding: 15px 16px;
  border: 1px solid #c5d5e2;
  border-radius: 7px;
  background: #f7fafc;
  box-shadow: 0 5px 15px rgba(40, 77, 105, .06);
}

.cp-filter-period,
.cp-filter-dimension,
.cp-filter-search {
  display: flex;
  align-items: end;
  gap: 8px;
}

.cp-filter-label {
  align-self: center;
  color: #315a79;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.cp-filter-card label {
  min-width: 0;
  flex: 1 1 0;
  display: grid;
  gap: 5px;
  color: #60788c;
  font-size: 11px;
  font-weight: 850;
}

.cp-filter-card input,
.cp-filter-card select {
  width: 100%;
  min-width: 0;
  height: 36px;
  box-sizing: border-box;
  border: 1px solid #aebfd0;
  border-radius: 5px;
  background: #fff;
  color: #294c68;
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}

.cp-filter-card input:focus,
.cp-filter-card select:focus {
  border-color: #3d85b8;
  outline: none;
  box-shadow: 0 0 0 3px rgba(47, 126, 181, .12);
}

.cp-filter-period i {
  align-self: center;
  color: #8092a2;
  font-style: normal;
}

.cp-entity-field { position: relative; }
.cp-entity-field input { padding-right: 34px; }
.cp-entity-field > button {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 28px;
  min-height: 28px;
  border: 0;
  background: transparent;
  padding: 0;
  color: #7890a3;
  font-size: 19px;
  box-shadow: none;
}

.cp-entity-suggestions {
  position: absolute;
  z-index: 70;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  max-height: 264px;
  overflow: auto;
  border: 1px solid #91adc3;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(20, 52, 76, .22);
}

.cp-entity-suggestions button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-bottom: 1px solid #e5edf3;
  border-radius: 0;
  background: #fff;
  color: #294e6a;
  padding: 7px 10px;
  text-align: left;
  box-shadow: none;
}

.cp-entity-suggestions button:hover { background: #eef6fb; transform: none; }
.cp-entity-suggestions small { color: #8193a2; }

.cp-error {
  margin-top: 14px;
  padding: 12px 15px;
  border: 1px solid #d99b9b;
  border-left: 4px solid #b94e4e;
  border-radius: 5px;
  background: #fff4f4;
  color: #913e3e;
  font-size: 13px;
  font-weight: 850;
}

.cp-loading {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #5f7689;
}

.cp-loading i {
  width: 27px;
  height: 27px;
  border: 3px solid #d7e3ec;
  border-top-color: #327daf;
  border-radius: 50%;
  animation: cp-spin .72s linear infinite;
}

.cp-loading strong { color: #315a79; font-size: 14px; }
.cp-loading span { font-size: 12px; }
@keyframes cp-spin { to { transform: rotate(360deg); } }

.cp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-top: 15px;
}

.cp-kpi {
  position: relative;
  min-height: 118px;
  overflow: hidden;
  padding: 17px 18px;
  border: 1px solid #c6d7e4;
  border-radius: 7px;
  background: linear-gradient(145deg, #fff, #f5f9fc);
  box-shadow: 0 7px 18px rgba(35, 69, 95, .07);
}

.cp-kpi::after {
  position: absolute;
  top: -29px;
  right: -24px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: rgba(50, 126, 177, .08);
  content: "";
}

.cp-kpi > span { display: block; color: #688094; font-size: 11px; font-weight: 900; }
.cp-kpi strong {
  display: block;
  margin: 9px 0 8px;
  color: #173f5e;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cp-kpi small { color: #7c8f9f; font-size: 11px; font-weight: 750; }
.cp-kpi small.up { color: #c13f3f; }
.cp-kpi small.down { color: #17805f; }

.cp-data-quality {
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 12px 0;
  padding: 8px 14px;
  border: 1px solid #d5e0e8;
  border-radius: 6px;
  background: #fafcfd;
  color: #647b8e;
  font-size: 11px;
}
.cp-data-quality > div { display: flex; align-items: center; gap: 9px; }
.cp-data-quality strong { color: #315a78; }
.cp-data-quality b { color: #9a641d; }

.cp-grid { display: grid; gap: 13px; }
.cp-analysis-grid { grid-template-columns: minmax(0, 1.5fr) minmax(270px, .8fr); }
.cp-card {
  min-width: 0;
  border: 1px solid #c6d7e4;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 7px 18px rgba(35, 69, 95, .06);
}
.cp-card > header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 15px;
  border-bottom: 1px solid #dbe5ec;
  background: #f9fbfd;
}
.cp-card > header span { display: block; color: #6e8496; font-size: 10px; font-weight: 900; }
.cp-card > header h3 { margin: 3px 0 0; color: #244d6b; font-size: 15px; }
.cp-card > header strong,
.cp-card > header small { color: #4c718d; font-size: 11px; font-weight: 850; }

.cp-trend-chart { min-height: 260px; padding: 12px 8px 2px; }
.cp-trend-chart svg { width: 100%; height: 260px; overflow: visible; }
.cp-trend-chart .grid { stroke: #dce7ee; stroke-width: 1; }
.cp-trend-chart .zero { stroke: #9fb2c1; stroke-width: 1.2; }
.cp-trend-chart .profit-line { fill: none; stroke: #2d78ac; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.cp-trend-chart .profit-area { fill: url(#cpProfitArea); }
.cp-trend-chart .point { fill: #fff; stroke: #2d78ac; stroke-width: 1.8; }
.cp-trend-chart .point.negative { stroke: #b84e4e; }
.cp-trend-chart text { fill: #718798; font-size: 9px; font-weight: 700; }
.cp-chart-empty { min-height: 250px; display: grid; place-items: center; color: #7d91a1; font-size: 13px; }
.cp-trend-data { margin: 4px 13px 13px; color: #657c8f; font-size: 11px; }
.cp-trend-data summary { cursor: pointer; font-weight: 850; }

.cp-ranking-list { padding: 7px 12px 12px; }
.cp-ranking-item {
  width: 100%;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 3px;
  border: 0;
  border-bottom: 1px solid #edf1f4;
  background: transparent;
  color: #31546f;
  text-align: left;
  cursor: pointer;
}
.cp-ranking-item:hover { background: #f2f7fa; }
.cp-ranking-item > i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f0f6;
  color: #55748b;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
}
.cp-ranking-item:nth-child(-n+3) > i { background: #e5c874; color: #604808; }
.cp-ranking-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 850; }
.cp-ranking-item small { color: #8193a2; font-size: 9px; }
.cp-ranking-item b { color: #245b80; font-size: 11px; font-variant-numeric: tabular-nums; }
.cp-ranking-empty { min-height: 150px; display: grid; place-items: center; color: #8597a5; font-size: 12px; text-align: center; }

.cp-orders-card,
.cp-activity-card { margin-top: 13px; }
.cp-table-scroll { width: 100%; overflow: auto; }
.cp-card table { width: 100%; border-collapse: collapse; color: #39566e; font-size: 11px; }
.cp-card th {
  height: 37px;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid #b9cbd9;
  background: #edf3f7;
  color: #45647c;
  padding: 6px 9px;
  text-align: left;
  white-space: nowrap;
}
.cp-card td { min-height: 42px; border-bottom: 1px solid #e2e9ee; padding: 8px 9px; vertical-align: middle; }
.cp-card tbody tr:nth-child(even) td { background: #fbfcfd; }
.cp-card tbody tr:hover td { background: #eef6fb; }
.cp-card .money { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cp-orders-table { min-width: 1050px; }
.cp-orders-table a { color: #226895; font-weight: 900; text-decoration: none; }
.cp-orders-table a:hover { text-decoration: underline; }
.cp-cell-stack { display: grid; gap: 3px; }
.cp-cell-stack small { color: #8697a5; }
.cp-profit-positive { color: #176d61; font-weight: 900; }
.cp-profit-negative { color: #b23f3f; font-weight: 900; }
.cp-status {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  border: 1px solid #b9cbd8;
  border-radius: 999px;
  background: #f2f6f8;
  color: #60798d;
  padding: 0 7px;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}
.cp-status.NEGATIVE,
.cp-status.RISK { border-color: #d59696; background: #fff0f0; color: #a73e3e; }
.cp-status.MISSING_SOURCE,
.cp-status.ATTENTION { border-color: #d9bc80; background: #fff8e7; color: #916521; }
.cp-status.ACTIVE { border-color: #88b9aa; background: #eef9f5; color: #27735e; }
.cp-status.NEVER,
.cp-status.EXCLUDED { border-color: #bac2ca; background: #f3f4f5; color: #6f7b85; }

.cp-pagination {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 13px;
  border-top: 1px solid #d9e3ea;
  background: #fafcfd;
}
.cp-pagination button { min-width: 34px; min-height: 31px; padding: 0 9px; }
.cp-pagination button.active { border-color: #286b9a; background: #337eaf; color: #fff; }
.cp-pagination button:disabled { opacity: .46; cursor: not-allowed; }
.cp-pagination span { color: #718697; padding: 0 7px; font-size: 11px; }

.cp-activity-filter { grid-template-columns: 170px 170px minmax(280px, 1fr) auto auto; }
.cp-status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.cp-status-card {
  min-height: 73px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 13px;
  border: 1px solid #cedce6;
  border-left: 4px solid #8ba9bd;
  border-radius: 6px;
  background: #fff;
}
.cp-status-card span { color: #667e91; font-size: 11px; font-weight: 850; }
.cp-status-card strong { color: #274e69; font-size: 21px; font-variant-numeric: tabular-nums; }
.cp-status-card.RISK { border-left-color: #bd5353; }
.cp-status-card.ATTENTION { border-left-color: #c18a31; }
.cp-status-card.ACTIVE { border-left-color: #3d947b; }
.cp-activity-table { min-width: 960px; }

.cp-empty-row td { height: 150px; color: #8294a3; text-align: center; font-size: 12px; }

@media (max-width: 1420px) {
  .cp-filter-card { grid-template-columns: 1fr 1fr; }
  .cp-filter-search { grid-column: 1 / -1; }
  .cp-activity-filter { grid-template-columns: 160px 170px minmax(260px, 1fr) auto auto; }
}

@media (max-width: 980px) {
  .cp-page-header { align-items: flex-start; flex-direction: column; }
  .cp-header-actions { flex-wrap: wrap; }
  .cp-basis-banner { align-items: flex-start; flex-wrap: wrap; }
  .cp-basis-banner time { width: 100%; margin-left: 0; }
  .cp-panel { padding-right: 12px; padding-left: 12px; }
  .cp-filter-card { grid-template-columns: 1fr; }
  .cp-filter-search { grid-column: auto; }
  .cp-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp-analysis-grid { grid-template-columns: 1fr; }
  .cp-status-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cp-activity-filter { grid-template-columns: 1fr 1fr; }
  .cp-activity-search { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .cp-page-header { padding: 17px 14px; }
  .cp-tabs { padding-left: 8px; padding-right: 8px; }
  .cp-tabs button { min-width: 0; flex: 1 1 0; }
  .cp-filter-period,
  .cp-filter-dimension,
  .cp-filter-search { flex-wrap: wrap; }
  .cp-filter-card label { min-width: 130px; }
  .cp-kpi-grid { grid-template-columns: 1fr; }
  .cp-data-quality { align-items: flex-start; flex-direction: column; }
  .cp-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
