/* Statistics lays its sections out against its own width, so the same view
   works beside the WordPress sidebar (Manage Event) and on the standalone
   page. Sections are spaced by the gap, not by their own margins. */
.fair-event-statistics {
	display: flex;
	flex-direction: column;
	gap: 16px;
	container: fair-event-statistics / inline-size;
}

.fair-event-statistics > *,
.fair-event-statistics > .components-notice {
	margin-top: 0;
	margin-bottom: 0;
}

/* Manage Event caps card content at 600px for its form tabs; charts and
   capacity bars use the whole card instead. */
.fair-events-manage-event .fair-event-statistics .components-card__body > * {
	max-width: none;
}

.fair-event-statistics__summary {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	align-items: baseline;
}

.fair-event-statistics__section-intro {
	color: #50575e;
}

.fair-event-statistics__history {
	max-width: 320px;
}

/* Two charts side by side when both stay readable; one column otherwise. The
   sales and activity pairs share this grid, so their columns line up. */
.fair-event-statistics__chart-pair {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
}

@container fair-event-statistics (min-width: 800px) {
	.fair-event-statistics__chart-pair {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@container fair-event-statistics (max-width: 599px) {
	.fair-event-statistics__history {
		max-width: none;
	}

	.fair-event-statistics__summary {
		gap: 12px 20px;
	}
}

.fair-event-statistics__chart-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 280px;
}

.fair-event-statistics__chart-card {
	min-width: 0;
	margin: 0;
}

.fair-event-statistics__chart-title {
	margin: 0;
	overflow-wrap: anywhere;
}

.fair-event-statistics__activity-chart {
	min-width: 0;
}

/* Title + event subtitle on the left, download action on the right. The action
   wraps onto its own row when a long event name leaves no room beside it. The
   card-scoped selector outranks the Flex component's own nowrap rule. */
.fair-event-statistics__chart-card .fair-event-statistics__chart-header {
	flex-wrap: wrap;
	gap: 8px 16px;
}

.fair-event-statistics__chart-heading {
	flex: 1 1 200px;
	min-width: 0;
}

.fair-event-statistics__chart-subtitle {
	margin: 4px 0 0;
	color: #50575e;
	overflow-wrap: anywhere;
}

.fair-event-statistics__download {
	flex: 0 0 auto;
}

.fair-event-statistics__capacity-note {
	margin: 0 0 16px;
	color: #50575e;
}

.fair-event-statistics__capacity-list {
	display: grid;
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fair-event-statistics__capacity-row {
	min-width: 0;
	margin: 0;
}

.fair-event-statistics__capacity-heading {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	align-items: center;
}

.fair-event-statistics__capacity-name {
	min-width: 0;
	overflow-wrap: anywhere;
}

.fair-event-statistics__capacity-badge {
	padding: 2px 8px;
	border-radius: 2px;
	font-size: 12px;
	font-weight: 600;
}

.is-full .fair-event-statistics__capacity-badge {
	background: #fcf9e8;
	color: #614200;
}

.is-over .fair-event-statistics__capacity-badge {
	background: #fcf0f1;
	color: #8a2424;
}

.fair-event-statistics__capacity-bar {
	height: 12px;
	margin-top: 8px;
	overflow: hidden;
	border-radius: 2px;
	background: #dcdcde;
}

.fair-event-statistics__capacity-fill {
	height: 100%;
	background: #3858e9;
}

.is-full .fair-event-statistics__capacity-fill {
	background: #bd8600;
}

.is-over .fair-event-statistics__capacity-fill {
	background: #d63638;
}

.fair-event-statistics__capacity-figures {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 24px;
	margin: 8px 0 0;
}

.fair-event-statistics__capacity-figures > div {
	display: flex;
	gap: 6px;
	align-items: baseline;
}

.fair-event-statistics__capacity-figures dt {
	color: #50575e;
}

.fair-event-statistics__capacity-figures dd {
	margin: 0;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.fair-event-statistics__revenue-flag {
	margin-left: 8px;
	font-size: 14px;
	font-weight: 400;
}

.fair-event-statistics__revenue-unavailable {
	font-size: 18px;
	color: #757575;
}

.fair-event-statistics__chart-note {
	margin: 8px 0 0;
	color: #757575;
}

.fair-event-statistics-page__back {
	margin: 4px 0 16px;
}

.fair-event-statistics__event-heading {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	overflow-wrap: anywhere;
}

.fair-event-statistics__empty {
	margin: 12px 0 0;
	color: #50575e;
}
