/**
 * ProCoach Events — managed participants table.
 *
 * Reuses the procoach-plist class names the designers already style; everything
 * new is additive and low-specificity so it can be overridden from the theme.
 */

/* The designers cap the original name-only list at 520px; the managed table
   carries four columns, so let it use the full width of its container. */
.procoach-plist--managed {
	margin-top: 2em;
	max-width: 100%;
}

.procoach-plist__filter {
	display: block;
	width: 100%;
	max-width: 340px;
	margin: 0 0 1em;
	padding: 0.5em 0.7em;
	box-sizing: border-box;
}

.procoach-plist__table--managed {
	width: 100%;
	border-collapse: collapse;
}

.procoach-plist__table--managed th,
.procoach-plist__table--managed td {
	text-align: left;
	padding: 0.55em 0.6em;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.1 );
	vertical-align: middle;
}

.procoach-plist__table--managed th {
	font-size: 0.85em;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	opacity: 0.7;
}

.procoach-plist__email {
	word-break: break-all;
}

.procoach-plist__team:empty::after {
	content: "—";
	opacity: 0.4;
}

.procoach-plist__opt-head,
.procoach-plist__opts {
	white-space: nowrap;
	text-align: right;
}

/* Buttons ---------------------------------------------------------------- */

.procoach-plist__act {
	cursor: pointer;
	font: inherit;
	font-size: 0.88em;
	line-height: 1.4;
	color: #1f2933;
	background: #fff;
	border: 1px solid rgba( 0, 0, 0, 0.25 );
	border-radius: 5px;
	padding: 0.35em 0.8em;
	margin-left: 0.35em;
	text-shadow: none;
}

.procoach-plist__act:hover {
	background: #f2f4f7;
	color: #1f2933;
}

.procoach-plist__act--primary {
	background: #2a5bd7;
	border-color: transparent;
	color: #fff;
	font-weight: 600;
}

.procoach-plist__act--primary:hover {
	background: #1f47ab;
	color: #fff;
}

.procoach-plist__act--danger {
	color: #8a2c20;
	border-color: rgba( 138, 44, 32, 0.35 );
}

.procoach-plist__act--danger:hover {
	background: #fdf0ef;
	color: #8a2c20;
}

/* Inline edit / confirm rows --------------------------------------------- */

.procoach-plist__editrow > td,
.procoach-plist__confirmrow > td {
	background: rgba( 0, 0, 0, 0.03 );
}

.procoach-plist__form {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.75em;
}

.procoach-plist__form label {
	display: flex;
	flex-direction: column;
	gap: 0.2em;
	flex: 1 1 190px;
	min-width: 0;
	font-size: 0.85em;
}

.procoach-plist__form input[type="text"] {
	padding: 0.4em 0.6em;
	width: 100%;
	box-sizing: border-box;
}

.procoach-plist__formbtns {
	flex: 0 0 auto;
	white-space: nowrap;
}

.procoach-plist__form--confirm {
	align-items: center;
	justify-content: space-between;
}

/* Pager ------------------------------------------------------------------ */

.procoach-plist__pager {
	display: flex;
	align-items: center;
	gap: 0.75em;
	margin-top: 1em;
}

.procoach-plist__page-btn {
	cursor: pointer;
	font: inherit;
	line-height: 1;
	color: #1f2933;
	background: #fff;
	border: 1px solid rgba( 0, 0, 0, 0.25 );
	border-radius: 5px;
	padding: 0.35em 0.75em;
}

.procoach-plist__page-btn:hover {
	background: #f2f4f7;
}

.procoach-plist__page-info {
	font-size: 0.88em;
	opacity: 0.75;
}

/* Notices + removed list -------------------------------------------------- */

.procoach-plist__notice {
	padding: 0.8em 1em;
	border-radius: 6px;
	border: 1px solid transparent;
	margin: 0 0 1em;
}

.procoach-plist__notice--ok {
	background: #eefaf1;
	border-color: #b7e2c4;
}

.procoach-plist__notice--err {
	background: #fdf0ef;
	border-color: #f0c2bd;
}

.procoach-plist__empty {
	opacity: 0.75;
}

.procoach-plist__removed {
	margin-top: 1.5em;
	font-size: 0.95em;
}

.procoach-plist__removed summary {
	cursor: pointer;
	opacity: 0.8;
}

.procoach-plist__removed td {
	opacity: 0.75;
}

@media ( max-width: 600px ) {
	.procoach-plist__table--managed th:nth-child(2),
	.procoach-plist__table--managed td.procoach-plist__email {
		word-break: break-all;
	}

	.procoach-plist__act {
		margin: 0.15em 0 0.15em 0.3em;
	}
}

/* Certificate button sits beside the moderator's Take attendance button and
   inherits its styling; it only needs separating. */
.procoach-modbar__btn--cert {
	margin-left: 0.5em;
}

/* Detail card ------------------------------------------------------------ */

.procoach-plist__namebtn {
	cursor: pointer;
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	text-align: left;
	text-decoration: underline;
	text-decoration-style: dotted;
	text-underline-offset: 3px;
}

.procoach-plist__namebtn:hover,
.procoach-plist__namebtn:focus {
	text-decoration-style: solid;
}

body.procoach-card-open {
	overflow: hidden;
}

/* The [hidden] attribute is only display:none at UA-stylesheet strength, so any
   display rule of ours beats it. Elements below that we hide with .hidden = true
   must therefore opt back out explicitly, or they are permanently on screen. */
.procoach-card[hidden],
.procoach-plist__pager[hidden] {
	display: none;
}

.procoach-card {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25em;
}

.procoach-card__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.45 );
}

.procoach-card__panel {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 460px;
	max-height: 85vh;
	overflow-y: auto;
	background: #fff;
	color: #1f2933;
	border-radius: 10px;
	padding: 1.5em 1.6em 1.4em;
	box-shadow: 0 18px 50px rgba( 0, 0, 0, 0.28 );
}

.procoach-card__x {
	position: absolute;
	top: 0.55em;
	right: 0.7em;
	cursor: pointer;
	font: inherit;
	font-size: 1.5em;
	line-height: 1;
	color: #1f2933;
	background: none;
	border: 0;
	padding: 0.1em 0.25em;
	opacity: 0.55;
}

.procoach-card__x:hover,
.procoach-card__x:focus {
	opacity: 1;
}

.procoach-card__name {
	margin: 0 1.5em 0.9em 0;
	font-size: 1.25em;
	line-height: 1.25;
}

.procoach-card__grid {
	display: grid;
	grid-template-columns: 9em 1fr;
	gap: 0.4em 1em;
	margin: 0 0 1.4em;
	font-size: 0.94em;
}

.procoach-card__grid dt {
	margin: 0;
	font-weight: 600;
	opacity: 0.65;
}

.procoach-card__grid dd {
	margin: 0;
	word-break: break-word;
}

.procoach-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	border-top: 1px solid rgba( 0, 0, 0, 0.1 );
	padding-top: 1.1em;
}

.procoach-card__actions .procoach-plist__act {
	margin-left: 0;
	text-decoration: none;
	display: inline-block;
}

.procoach-card__actions .is-disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.procoach-card__hint {
	margin: 0.8em 0 0;
	font-size: 0.85em;
	opacity: 0.7;
}

.procoach-card__hint:empty {
	display: none;
}

@media ( max-width: 480px ) {
	.procoach-card__grid {
		grid-template-columns: 1fr;
		gap: 0.15em;
	}

	.procoach-card__grid dt {
		margin-top: 0.6em;
	}
}

/* Certificates panel ------------------------------------------------------ */

button.procoach-modbar__btn {
	cursor: pointer;
	font: inherit;
}

.procoach-certs {
	margin-top: 1.5em;
}

.procoach-certs__intro {
	margin: 0 0 1em;
	font-size: 0.9em;
	opacity: 0.75;
}

.procoach-certs__name {
	display: block;
	font-weight: 600;
}

.procoach-certs__email {
	display: block;
	font-size: 0.85em;
	opacity: 0.7;
	word-break: break-all;
}

.procoach-certs__dl {
	display: block;
	font-size: 0.8em;
	opacity: 0.65;
}

/*
 * Certificate-name state, under the participant's registered name.
 *
 * "Name set" is the one that matters — it is the row where Reopen name does
 * something — so it gets the solid chip and the open state stays quiet.
 */
.procoach-certs__cname {
	display: block;
	margin-top: 0.35em;
	font-size: 0.8em;
	line-height: 1.5;
}

.procoach-certs__lock {
	display: inline-block;
	padding: 0.1em 0.5em;
	border-radius: 999px;
	background: #e7eefb;
	border: 1px solid #c2d3f2;
	color: #23458f;
	font-weight: 600;
	white-space: nowrap;
	cursor: help;
}

.procoach-certs__lock--open {
	background: transparent;
	border-color: rgba( 0, 0, 0, 0.18 );
	color: inherit;
	font-weight: 400;
	opacity: 0.65;
	cursor: default;
}

/* Only shown when it differs from the name they registered with. */
.procoach-certs__prints {
	display: block;
	margin-top: 0.2em;
	opacity: 0.8;
	overflow-wrap: anywhere;
}

.procoach-certs__muted {
	font-size: 0.88em;
	opacity: 0.6;
}

.procoach-certs__table .procoach-plist__act {
	margin: 0.15em 0.3em 0.15em 0;
	text-decoration: none;
	display: inline-block;
}

.procoach-certs__table td {
	vertical-align: top;
}

/* Bulk approval ----------------------------------------------------------- */

.procoach-plist[hidden],
.procoach-certs[hidden] {
	display: none;
}

.procoach-certs__bulk {
	margin: 0 0 0.75em;
}

.procoach-certs__bulk .procoach-plist__act {
	margin-left: 0;
}

.procoach-certs__tick {
	width: 2.2em;
	text-align: center;
}

.procoach-certs__tick input {
	margin: 0;
}

.procoach-certs__count {
	font-variant-numeric: tabular-nums;
}
