/* =========================================================================
   Compact card scale -- for narrow-column card widgets (e.g. a DPT left column
   / sidebar). At the theme's default type size a multi-column table clips in a
   size-4 column (the trailing column gets cropped), so opt a card into a
   smaller, tighter scale by adding .crm-compact to its root element. Universal:
   any left-column table widget can adopt it with a single class.
   ========================================================================= */
.crm-compact {
	font-size: .75rem;
}
.crm-compact table.table {
	font-size: .75rem;
}
/* Buttons (e.g. a card-header "Add" action) carry Clay's own .btn/.btn-sm
   font-size, so they don't inherit the compact scale — bring them down too. */
.crm-compact .btn {
	font-size: .75rem;
}
.crm-compact table.table th,
.crm-compact table.table td {
	padding-left: .375rem;
	padding-right: .375rem;
}
/* Let long headers wrap instead of forcing their single-line width — the main
   width reclaim in a size-4 column (e.g. "Member Role", "Created Date"). */
.crm-compact .clay-table-head .text-truncate,
.crm-compact .clay-table-head .text-truncate-inline {
	overflow: visible;
	text-overflow: clip;
	white-space: normal;
}
/* Shrink the sort toggle to an icon-sized hit target (was ~31px each). */
.crm-compact .clay-table-sort {
	height: 1rem;
	min-width: 0;
	padding: 0;
	width: 1rem;
}
.crm-compact .clay-table-sort .lexicon-icon {
	height: .75rem;
	margin: 0;
	width: .75rem;
}
.crm-compact .pagination-results,
.crm-compact .pagination-items-per-page .dropdown-toggle {
	font-size: .75rem;
}

/* =========================================================================
   Clay Table -- styling support for the ClayTable JS library (clay-table.js).

   The table itself uses Liferay's own Clay classes (table-list,
   table-head-bordered, table-striped, pagination-root, ...), so its look comes
   from the theme and is not duplicated here. These rules only cover the row
   action menu, which is portaled to <body> and positioned with fixed
   coordinates so it escapes the table-responsive overflow and is never clipped.
   ========================================================================= */

/* The kebab toggle carries .dropdown-toggle for Clay button styling, but must
   not render Bootstrap's caret next to the ellipsis icon. */
.clay-table-action-toggle.dropdown-toggle::after {
	display: none;
}

/* The portaled action menu sits above Bootstrap modals (z-index 1050) so it
   shows even when opened over a dialog, and renders as a block regardless of a
   theme's scoped .dropdown-menu display rules (it carries .show inline). */
.clay-table-action-menu {
	z-index: 1100;
}

.clay-table-action-menu.show {
	display: block;
}

/* An inactive sortable column's double arrow appears only while its header is
   hovered or holds focus; the sorted column's single arrow always shows.
   Opacity, not display, so a header keeps its width as the arrow comes and
   goes, and the button stays in the tab order (focus reveals it). A device
   that cannot hover keeps the arrows, or sorting there could not be found. */
@media (hover: hover) {
	.clay-table-sortable .clay-table-sort-inactive {
		opacity: 0;
		transition: opacity .15s ease-in-out;
	}
	.clay-table-sortable:hover .clay-table-sort-inactive,
	.clay-table-sortable:focus-within .clay-table-sort-inactive {
		opacity: 1;
	}
}

/* =========================================================================
   Clay Modal Form -- styling support for the ClayModalForm JS library
   (clay-modal-form.js).

   The modal reuses the theme's Bootstrap modal CSS, so only a small functional
   helper is defined here.
   ========================================================================= */

/* A fixed-height, vertically scrolling list -- e.g. a checkbox picker inside a
   modal form. Override the height per instance with the
   --clay-scroll-list-height custom property. */
.clay-scroll-list {
	min-height: var(--clay-scroll-list-height, 170px);
	max-height: var(--clay-scroll-list-height, 170px);
	overflow-y: auto;
}

/* =========================================================================
   Clay Table filter dropdown (ClayTable `filters`/`filterBar`).

   The markup uses standard Clay/Bootstrap dropdown classes so the theme
   supplies the chrome (menu box, items, headers, button). These rules add only
   what the theme does not: reliable show/hide (theme .dropdown-menu display can
   be scoped away — same reason the row-action menu carries an explicit rule),
   a scrollable menu, and the checkbox-item + count layout.
   ========================================================================= */
.clay-table-filter {
	position: relative;
	display: inline-block;
}
.clay-table-filter-toggle.dropdown-toggle::after {
	display: none; /* the label already signals a menu; drop the caret */
}
/* Match the OOTB Liferay management-toolbar Filter button look-and-feel: the
   engine emits a filled Bootstrap `.btn-secondary`, but the stock Filter control
   is transparent by default and picks up a light-gray fill on hover / focus /
   open. Restyle the toggle only (the HTML is unchanged). Selectors carry
   `.clay-table-filter` + `.btn-secondary` so they outrank Clay's own
   `.btn-secondary(:hover)` rules regardless of stylesheet load order. */
.clay-table-filter .clay-table-filter-toggle.btn-secondary {
	background-color: transparent;
	border-color: transparent;
	box-shadow: none;
	color: var(--gray-700, #6b6c7e);
}
.clay-table-filter .clay-table-filter-toggle.btn-secondary:hover,
.clay-table-filter .clay-table-filter-toggle.btn-secondary:focus,
.clay-table-filter .clay-table-filter-toggle.btn-secondary.show,
.clay-table-filter .clay-table-filter-toggle.btn-secondary[aria-expanded="true"] {
	background-color: var(--gray-200, #e7e7ed);
	border-color: transparent;
	box-shadow: none;
	color: var(--gray-900, #1a1a2e);
}
.clay-table-filter-menu {
	min-width: 220px;
	max-height: 340px;
	overflow-y: auto;
}
.clay-table-filter-menu.show {
	display: block;
}
.clay-table-filter-item {
	display: flex;
	align-items: center;
	gap: .5rem;
	white-space: nowrap;
	cursor: pointer;
}
.clay-table-filter-item input {
	margin: 0;
	flex: none;
}
.clay-table-filter-count {
	font-weight: 600;
}
/* Live per-option counts (ClayTable `facetCounts`): right-aligned and muted, so
   the labels still read as a list. An option no row would match is dimmed (it
   stays clickable: its count can rise when another facet's selection changes). */
.clay-table-filter-option-count {
	margin-left: auto;
	padding-left: 1rem;
	color: var(--secondary, #6b6c7e);
	font-variant-numeric: tabular-nums;
}
.clay-table-filter-item-empty {
	opacity: .55;
}
/* Default group layout: stacked, with a divider between groups (the engine
   wraps each filter field in .clay-table-filter-group). A consumer can
   flex/grid .clay-table-filter-groups to lay the groups out as columns. */
.clay-table-filter-group + .clay-table-filter-group {
	border-top: 1px solid var(--gray-300, #e7e7ed);
	margin-top: .25rem;
	padding-top: .25rem;
}

/* Active-filter summary chips — rendered next to the Filter button so the current
   selection stays glanceable and removable without opening the dropdown. Inherited by
   every filtered table; a chip marked inactive (config.chipInactive) is dimmed +
   struck through to signal it is not currently applied. */
.clay-table-filter-chips {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .375rem;
	margin-left: .5rem;
	vertical-align: middle;
}
.clay-table-filter-chip {
	display: inline-flex;
	align-items: center;
	gap: .25rem;
	padding: .15rem .25rem .15rem .6rem;
	border-radius: 999px;
	font-size: .8rem;
	line-height: 1.4;
	background: var(--gray-100, #f0f1f2);
	border: 1px solid var(--gray-300, #e7e7ed);
	color: var(--gray-900, #1a1a2e);
}
.clay-table-filter-chip-inactive {
	opacity: .55;
	text-decoration: line-through;
}
.clay-table-filter-chip-remove {
	border: 0;
	background: transparent;
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
	padding: 0 .25rem;
	color: inherit;
	border-radius: 999px;
}
.clay-table-filter-chip-remove:hover {
	color: var(--danger, #da1414);
}

/* =========================================================================
   Row selection + bulk actions (ClayTable `bulkActions`/`selectionBar`).
   The leading checkbox column and the "N selected" bar that appears when rows
   are checked. Neutral defaults; a consumer skin can retint.
   ========================================================================= */
.clay-table-select-col {
	width: 40px;
	text-align: center;
	vertical-align: middle;
}
.clay-table-select-col input {
	margin: 0;
	cursor: pointer;
}
/* Management-toolbar-style selection bar: count + clear checkbox on the left,
   quick bulk-action buttons + an Actions (ellipsis) overflow menu on the right.
   Highlighted (light primary tint) like Liferay's OOTB selection bar. */
.clay-table-selection-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin: .75rem 0;
	padding: .5rem .75rem;
	border-radius: 6px;
	background: var(--primary-l3, #e7f0f7);
	border: 1px solid var(--primary-l2, #b3d4e8);
}
.clay-table-selection-bar[hidden] {
	display: none;
}
.clay-table-selection-left {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
}
.clay-table-selection-left input {
	margin: 0;
	cursor: pointer;
}
.clay-table-selection-count {
	font-weight: 600;
}
.clay-table-selection-actions {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	flex-wrap: wrap;
}
.clay-table-bulk-menu {
	position: relative;
	display: inline-block;
}
.clay-table-bulk-toggle {
	cursor: pointer;
	padding: .25rem .4rem;
	line-height: 1;
}
.clay-table-bulk-dropdown {
	position: absolute;
	top: 100%;
	right: 0;
	display: none;
	min-width: 10rem;
	margin-top: .25rem;
	z-index: 1000;
}
.clay-table-bulk-dropdown.show {
	display: block;
}

/* =========================================================================
   ClayModal -- generic read-only "view" modal (window.ClayModal). Chrome comes
   from the theme's Bootstrap modal CSS; these are the small content niceties.
   ========================================================================= */
.clay-modal .modal-title { font-weight: 600; }
.clay-modal__meta {
	color: var(--secondary, #6b6f76);
	font-size: .8125rem;
	margin-bottom: .75rem;
	padding-bottom: .75rem;
	border-bottom: 1px solid var(--secondary-l2, #e7e7ed);
}
.clay-modal__body {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	line-height: 1.5;
}

/* =========================================================================
   Style Book token bridge -- Classic compiles Clay from Sass, so a component
   whose color Clay derives from a palette variable ships the literal value,
   and a Style Book override of that token never reaches it. Each rule here
   only re-reads the token Clay's own Sass names, with Classic's compiled
   literal as the fallback, so a page with no override renders unchanged.
   Colors only: spacing and shape are each host theme's call.
   ========================================================================= */

/* Clay: $sheet-border-color: $gray-300 */
.sheet { border-color: var(--gray-300, #e7e7ed); }
