/* Layout responsive */
#dashboard_pie_chart .spr-chart-wrap {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* canvas zone */
#dashboard_pie_chart .spr-chart-canvas {
  min-height: 300px; /* đảm bảo có không gian cho chart */
  position: relative;
}

/* legend zone (HTML legend) */
#dashboard_pie_chart .spr-chart-legend {
  color: #fff; /* chữ trắng theo yêu cầu */
}

/* Danh sách legend */
#dashboard_pie_chart .spr-chart-legend-list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap; /* <768: nằm dưới và tự wrap */
  gap: 8px 16px;
}

/* Mỗi dòng legend item */
#dashboard_pie_chart .spr-chart-legend-item {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

/* Ô màu */
#dashboard_pie_chart .spr-legend-box {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  flex: 0 0 12px;
  outline: 1px solid rgba(255, 255, 255, 0.2);
}

/* Nhãn legend (trắng) */
#dashboard_pie_chart .spr-legend-label {
  color: #fff;
  line-height: 1.2;
}

/* ≥768px: chart trái, legend phải, mỗi dòng 1 mục (cột) */
@media (min-width: 768px) {
  #dashboard_pie_chart .spr-chart-wrap {
    flex-direction: row;
    align-items: stretch;
  }

  #dashboard_pie_chart .spr-chart-canvas {
    flex: 1 1 auto;
  }

  #dashboard_pie_chart .spr-chart-legend {
    flex: 0 0 260px; /* độ rộng cột chú thích */
    margin: auto;
  }

  #dashboard_pie_chart .spr-chart-legend-list {
    flex-direction: column;
    flex-wrap: nowrap; /* mỗi dòng 1 mục */
    gap: 10px;
  }
}
