.ca-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ca-stat {
  display: block;
  padding: 16px 20px;
  text-align: left;
  cursor: pointer;
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgb(15 23 42 / 6%);
  transition: all 0.2s ease;

  &:hover {
    box-shadow: 0 6px 14px rgb(15 23 42 / 10%);
    transform: translateY(-1px);
  }

  .label {
    margin-bottom: 6px;
    font-size: 13px;
    color: rgb(0 0 0 / 45%);
  }

  .val {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    color: rgb(0 0 0 / 88%);

    &.blue {
      color: #1677ff;
    }

    &.green {
      color: #52c41a;
    }

    &.orange {
      color: #fa8c16;
    }
  }

  .sub {
    margin-top: 4px;
    font-size: 12px;
    color: rgb(0 0 0 / 45%);
  }
}

.ca-bars {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 140px;
}

.ca-bar-col {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  min-width: 0;
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: none;
}

.ca-bar-val {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  color: rgb(0 0 0 / 65%);
  text-align: center;
  white-space: nowrap;
}

.ca-bar {
  width: 100%;
  background: #1677ff;
  border-radius: 4px 4px 0 0;
  opacity: 0.8;
  transition: all 0.2s ease;
}

.ca-bar-col:hover .ca-bar {
  opacity: 1;
}

.ca-bar-lbl {
  font-size: 11px;
  color: rgb(0 0 0 / 45%);
}

.ca-donut-wrap {
  display: flex;
  gap: 24px;
  align-items: center;
}

.ca-donut {
  position: relative;
  flex-shrink: 0;
  width: 130px;
  height: 130px;
  border-radius: 50%;
}

.ca-donut-hole {
  position: absolute;
  inset: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;

  .num {
    font-size: 18px;
    font-weight: 700;
    color: rgb(0 0 0 / 88%);
  }

  .lbl {
    font-size: 11px;
    color: rgb(0 0 0 / 45%);
  }
}

.ca-legend {
  flex: 1;
  min-width: 0;
}

.ca-legend-item {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 6px 0;
  text-align: left;
  cursor: pointer;
  background: transparent;
  border: none;
}

.ca-legend-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.ca-legend-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  color: rgb(0 0 0 / 65%);
  white-space: nowrap;
}

.ca-legend-value {
  font-size: 13px;
  font-weight: 600;
  color: rgb(0 0 0 / 88%);
}

.ca-dist-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px 0;
  text-align: left;
  cursor: pointer;
  background: transparent;
  border: none;
}

.ca-dist-label {
  flex-shrink: 0;
  width: 90px;
  font-size: 13px;
  color: rgb(0 0 0 / 65%);
}

.ca-dist-bar {
  flex: 1;
  height: 20px;
  overflow: hidden;
  background: #f0f0f0;
  border-radius: 4px;
}

.ca-dist-bar-inner {
  display: inline-flex;
  height: 100%;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.ca-dist-val {
  flex-shrink: 0;
  width: 60px;
  font-weight: 500;
  color: rgb(0 0 0 / 88%);
  text-align: right;
}

.ca-rfm {
  display: grid;
  grid-template-columns: auto repeat(4, minmax(0, 1fr));
  gap: 2px;
  font-size: 12px;
}

.ca-rfm-header {
  padding: 8px;
  font-weight: 600;
  color: #6b7280;
  text-align: center;
  background: #f8f9fb;
}

.ca-rfm-label {
  padding: 8px 10px;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
  background: #f8f9fb;
}

.ca-rfm-cell {
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  transition: all 0.2s ease;

  &:hover {
    transform: scale(1.03);
  }

  &.hot {
    color: #1677ff;
    background: rgb(22 119 255 / 18%);
  }

  &.warm {
    color: #1677ff;
    background: rgb(22 119 255 / 10%);
  }

  &.cool {
    color: #fa8c16;
    background: rgb(250 140 22 / 10%);
  }

  &.cold {
    color: rgb(0 0 0 / 45%);
    background: #f8f9fb;
  }
}

.ca-rfm-cell-num {
  font-weight: 600;
}

.ca-rfm-cell-label {
  margin-top: 2px;
  font-size: 11px;
  opacity: 0.75;
}

.ca-top-card {
  overflow: hidden;
}

.ca-top-segment-btn {
  padding-inline: 0;
}

.ca-top-table {
  .ant-table-thead > tr > th {
    font-size: 13px;
    white-space: nowrap;
    background: #f8f9fb;
  }

  .ant-table-tbody > tr > td {
    vertical-align: middle;
  }
}

.ca-top-rank {
  font-weight: 700;
  color: #1677ff;
}

.ca-top-money {
  font-weight: 600;
}

.ca-top-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;

  .ant-tag {
    margin-inline-end: 0;
  }
}

.ca-top-action {
  padding-inline: 0;
}
