/**
 * Shared styles for this plugin's four My Account tab / shortcode surfaces:
 * [bd_br_my_requests], [bd_br_manage_requests], [bd_br_manage_capacity_requests]
 * (split out of the previous one in 0.32.0, which used to render it as a
 * nested section), and [bd_br_capacity_stats]. None of these
 * templates render inside a plugin-owned wrapper element (they're echoed
 * straight into either WooCommerce's own .woocommerce-MyAccount-content div
 * or a bare shortcode-hosting page), so every rule below is scoped to this
 * plugin's own classes rather than bare element selectors.
 */

.bd-br-request-wrap {
	margin: 10px 0;
}

/* ── Section headings ─────────────────────────────────────────────────────
 * Used on every top-level <h2> across the three surfaces (also the "Request
 * history" / "License request history" heading, reused twice), giving each
 * stacked section its own breathing room and a light underline so distinct
 * blocks (pending table / history / capacity subsection) read as separate. */

.bd-br-section-title {
	margin-top: 1.75em;
	margin-bottom: 0.75em;
	padding-bottom: 0.4em;
	border-bottom: 2px solid #ddd;
}

/* ── Muted hint / description / empty-state text ─────────────────────────── */

.bd-br-hint {
	color: #666;
	font-style: italic;
	font-size: 0.92em;
	margin-top: 0.4em;
	margin-bottom: 1.25em;
}

.bd-br-empty {
	color: #666;
	font-style: italic;
}

/* ── Table polish (shared across all 5 table instances) ──────────────────── */

.bd-br-my-requests-table,
.bd-br-pending-table,
.bd-br-history-table,
.bd-br-capacity-stats-table {
	border-collapse: collapse;
	width: 100%;
	margin-bottom: 1.5em;
}

.bd-br-my-requests-table th,
.bd-br-pending-table th,
.bd-br-history-table th,
.bd-br-capacity-stats-table th {
	padding: 0.7em 1em;
	text-align: left;
	border-bottom: 2px solid #ddd;
	font-weight: 600;
}

.bd-br-my-requests-table td,
.bd-br-pending-table td,
.bd-br-history-table td,
.bd-br-capacity-stats-table td {
	padding: 0.7em 1em;
	vertical-align: middle;
	border-bottom: 1px solid #ececec;
}

.bd-br-my-requests-table tbody tr:nth-child(even),
.bd-br-pending-table tbody tr:nth-child(even),
.bd-br-history-table tbody tr:nth-child(even),
.bd-br-capacity-stats-table tbody tr:nth-child(even) {
	background-color: #fafafa;
}

.bd-br-my-requests-table tbody tr:hover,
.bd-br-pending-table tbody tr:hover,
.bd-br-history-table tbody tr:hover,
.bd-br-capacity-stats-table tbody tr:hover {
	background-color: #f2f6fb;
}

.bd-br-my-requests-table tbody tr:last-child td,
.bd-br-pending-table tbody tr:last-child td,
.bd-br-history-table tbody tr:last-child td,
.bd-br-capacity-stats-table tbody tr:last-child td {
	border-bottom: none;
}

/* ── Status badges ────────────────────────────────────────────────────────
 * Palette matches the suite's established badge convention (see
 * bd-reader/assets/css/my-account.css's .bd-badge--available/--full/--active):
 * soft green for a positive/final state, soft amber for a waiting state,
 * soft muted red for a negative/final state. */

.bd-br-status {
	display: inline-block;
	padding: 0.2em 0.6em;
	border-radius: 3px;
	font-size: 0.85em;
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
}

/* In attesa — arancio */
.bd-br-status--pending {
	background: #fff3cd;
	color: #856404;
}

/* Approvata — verde */
.bd-br-status--approved {
	background: #d4edda;
	color: #155724;
}

/* Rifiutata — rosso tenue */
.bd-br-status--rejected {
	background: #f8d7da;
	color: #721c24;
}

/* ── Action buttons / forms ───────────────────────────────────────────────
 * Keep WooCommerce's own .button styling; just give the 1-3 adjacent forms
 * per row comfortable, vertically-aligned spacing and stop them wrapping
 * awkwardly mid-row. */

.bd-br-pending-table .bd-br-action-form,
.bd-br-my-requests-table .bd-br-action-form {
	display: inline-flex;
	align-items: center;
	margin-right: 8px;
	margin-bottom: 4px;
	vertical-align: middle;
}

.bd-br-pending-table .bd-br-action-form:last-child,
.bd-br-my-requests-table .bd-br-action-form:last-child {
	margin-right: 0;
}

.bd-br-pending-table td:last-child,
.bd-br-my-requests-table td:last-child {
	white-space: nowrap;
}

/* ── [bd_br_capacity_stats]: card-style per-team blocks ──────────────────── */

.bd-br-team-heading {
	margin-top: 1.75em;
	margin-bottom: 0;
	padding: 0.6em 1em;
	background-color: #f6f7f7;
	border: 1px solid #e2e2e2;
	border-bottom: none;
	border-radius: 4px 4px 0 0;
	font-size: 1.05em;
}

.bd-br-team-heading:first-of-type {
	margin-top: 0.5em;
}

.bd-br-team-heading + .bd-br-capacity-stats-table {
	margin-top: 0;
	border: 1px solid #e2e2e2;
	border-top: none;
	border-radius: 0 0 4px 4px;
	overflow: hidden;
}

.bd-br-team-heading + .bd-br-capacity-stats-table th {
	background-color: #fbfbfb;
}

/* ── Requester chips ("Requested by" cell of the two pending tables) ──────
 * Values deliberately match bd-reservations' watchers chips
 * (assets/css/team-manager.css .bd-res-watchers-list li) so the two
 * manager-facing surfaces read as one visual language rather than two
 * dialects of the same idea.
 *
 * The overflow list is a native <details>: it needs no JavaScript, works from
 * the keyboard and on touch, and holds hundreds of names in a scrollable
 * panel — none of which a title="" tooltip can do. */

.bd-br-requesters,
.bd-br-requesters-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35em;
}

.bd-br-requester-chip {
	display: inline-block;
	padding: 0.15em 0.6em;
	background: #f0f0f1;
	color: #3c434a;
	border: 1px solid #dcdcde;
	border-radius: 999px;
	font-size: 0.85em;
	line-height: 1.6;
	white-space: nowrap;
}

/* The "+N" chip is the only affordance saying the row opens, so it is the one
 * that gets the caret and the stronger tone. */
.bd-br-requester-chip--more {
	background: #dcdcde;
	border-color: #c3c4c7;
	font-weight: 600;
	cursor: pointer;
}

.bd-br-requester-chip--more::after {
	content: " \25BE";
	display: inline-block;
	transition: transform 0.15s ease;
}

.bd-br-requesters-details[open] .bd-br-requester-chip--more::after {
	transform: rotate(180deg);
}

/* The default disclosure triangle is a list-item marker that breaks the chip
 * row's flex layout, so it is removed in both its standard and WebKit forms. */
.bd-br-requesters-summary {
	cursor: pointer;
	list-style: none;
}

.bd-br-requesters-summary::-webkit-details-marker {
	display: none;
}

.bd-br-requesters-summary:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.bd-br-requesters-full {
	max-height: 240px;
	overflow-y: auto;
	margin: 0.6em 0 0;
	padding: 0.4em 0.6em;
	background: #fbfbfb;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	list-style: none;
	font-size: 0.9em;
}

.bd-br-requesters-full li {
	padding: 0.15em 0;
	margin: 0;
}

.bd-br-requesters-truncated {
	margin: 0.4em 0 0;
	color: #646970;
	font-size: 0.85em;
	font-style: italic;
}

/* Stands in for a name when identities are withheld suite-wide, or when the
 * "names shown" setting is 0. Italic + muted so it reads as a placeholder
 * rather than as a person — same treatment as bd-reservations'
 * .bd-res-reader--anonymized. */
.bd-br-requesters-anonymized {
	font-style: italic;
	opacity: 0.7;
}
