/* Block "event-reports": statistics table, scrolls inside its block if too wide */

.k-block-type-event-reports {
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.k-block-type-event-reports table {
  /* Fixed layout: name and date have a set width, the number columns
     share the remaining space equally */
  table-layout: fixed;
  width: 100%;
  min-width: 56rem;
  border: 0;
  border-collapse: collapse;
  background-color: #fff;
  font-size: 0.85rem;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.k-block-type-event-reports th,
.k-block-type-event-reports td {
  padding: 0.45rem 0.5rem;
  border: 0;
  text-align: right;
}

.k-block-type-event-reports th:first-child,
.k-block-type-event-reports td:first-child {
  text-align: left;
}

.k-block-type-event-reports thead th:first-child {
  width: 8.8rem;
}

.k-block-type-event-reports thead th:nth-child(2) {
  width: 3.3rem;
}

.k-block-type-event-reports thead th {
  background-color: #fff;
  border-bottom: 4px solid var(--highlight-green);
  color: var(--primary-blue);
  font-family: "Raleway", sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  vertical-align: bottom;
}

.k-block-type-event-reports .event-reports-emoji {
  margin-right: 0.25em;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 1em;
  font-weight: 400;
  line-height: 1;
}

/* Number columns: text is right-aligned, so little space is needed on the left */
.k-block-type-event-reports thead th:nth-child(n + 3) {
  padding-left: 0.2rem;
}

.k-block-type-event-reports tbody td {
  border-bottom: 1px solid var(--border-grey);
}

.k-block-type-event-reports tbody tr:nth-child(odd) td {
  background-color: #f7f8f9;
}

/* Success rate: pill coloured by value, --rate-hue is set per cell (0 = red, 120 = green) */
.k-block-type-event-reports .event-reports-rate {
  display: inline-block;
  margin: -0.1rem -0.35rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background-color: hsl(var(--rate-hue, 60) 75% 84%);
}

/* Totals of a year, first row of each year's group */
.k-block-type-event-reports tbody tr.event-reports-year td {
  background-color: #e1f1eb;
  border-top: 2px solid var(--highlight-green);
  font-weight: 700;
}

.k-block-type-event-reports tbody tr.event-reports-year td:first-child {
  font-family: "Raleway", sans-serif;
  font-weight: 600;
  white-space: nowrap;
}

.k-block-type-event-reports tbody td:first-child {
  font-weight: 700;
}

.k-block-type-event-reports tbody td:nth-child(2) {
  color: #4a525c;
  white-space: nowrap;
}

/* Totals (orders, successful, postponed, success rate) are set apart from the categories */
.k-block-type-event-reports th:nth-child(6),
.k-block-type-event-reports td:nth-child(6) {
  border-right: 1px solid var(--border-grey);
}

/* Block "event-stats": totals as cards, same look as the event-dates tiles */

.k-block-type-event-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.6rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.k-block-type-event-stats .event-stats-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  padding: 0.6rem 0.75rem;
  background-color: #fff;
  border-bottom: 4px solid var(--highlight-green);
}

.k-block-type-event-stats .event-stats-value {
  font-family: "Raleway", sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.k-block-type-event-stats .event-stats-label {
  font-family: "Raleway", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
}

.k-block-type-event-stats .event-stats-meta {
  color: #4a525c;
  font-size: 0.75rem;
}
