.ap-table {
	width: 100%;
}

.ap-table-scroll {
	width: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
}

.ap-table table {
	width: max-content;
	min-width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
}

.ap-table th,
.ap-table td {
	width: var(--ap-table-column-width, 300px);
	min-width: var(--ap-table-column-width, 300px);
	max-width: var(--ap-table-column-width, 300px);
	padding: 0.65em 0.8em;
	border: 1px solid #ccc;
	text-align: left;
	vertical-align: top;
}

.ap-table thead th {
	font-weight: 600;
	background: #f0f0f0;
}

.ap-table tfoot td {
	font-weight: 600;
	background: #f7f7f7;
}

.ap-table tbody tr:nth-child(even) {
	background: #fafafa;
}

.ap-table th > *,
.ap-table td > * {
	max-width: 100%;
}

.ap-table p:first-child {
	margin-top: 0;
}

.ap-table p:last-child {
	margin-bottom: 0;
}

/*
 * Fit-to-container mode.
 */

.ap-table--fit .ap-table-scroll {
	overflow-x: visible;
}

.ap-table--fit table {
	width: 100%;
	min-width: 0;
	table-layout: fixed;
}

.ap-table--fit th,
.ap-table--fit td {
	width: auto;
	min-width: 0;
	max-width: none;
}

/*
 * On small screens, prevent fit-to-container tables
 * from compressing dense columns into unusable widths.
 */

@media (max-width: 767px) {
	.ap-table--fit .ap-table-scroll {
		overflow-x: auto;
	}

	.ap-table--fit table {
		width: max-content;
		min-width: 100%;
		table-layout: auto;
	}

	.ap-table--fit th,
	.ap-table--fit td {
		width: var(--ap-table-column-width, 300px);
		min-width: var(--ap-table-column-width, 300px);
		max-width: var(--ap-table-column-width, 300px);
	}
}

/*
 * Search.
 */

.ap-table-search {
	position: relative;
	width: 240px;
	max-width: 100%;
}

.ap-table-search-input {
	width: 100%;
	height: 50px;
	padding: 6px 34px 6px 10px;
	border: 1px solid #ccc;
	border-radius: 3px;
	background: #fff;
	color: inherit;
	font: inherit;
	line-height: 1.4;
}
.ap-table-search-input::placeholder { color: #8C8C8C; }


.ap-table-search-input:focus {
	border-color: #2271b1;
	outline: 1px solid #2271b1;
	outline-offset: -1px;
}

.ap-table-search-clear {
	position: absolute;
	top: 50%;
	right: 5px;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: #666;
	font-size: 20px;
	font-weight: 400;
	line-height: 36px;
	cursor: pointer;
	transform: translateY(-50%);
}

.ap-table-search-clear:hover {
	color: #111;
}

.ap-table-search-clear:focus {
	outline: 1px solid #2271b1;
	outline-offset: 1px;
}

.ap-table-search-clear[hidden] {
	display: none;
}


/*
 * Search results.
 */

.ap-table-search-highlight {
	 padding: 0;
	 background: #ffeb3b;
	 color: inherit;
 }

.ap-table-no-results {
	margin-top: 1rem;
	padding: 1rem;
	border: 1px solid #ccc;
	background: #f7f7f7;
	font-size: 1rem;
}

.ap-table-no-results[hidden] {
	display: none;
}

/*
 * Frontend controls.
 */

.ap-table-toolbar {
	position: relative;
	display: flex;
	gap: 8px;
	align-items: center;
	justify-content: flex-end;
	margin-bottom: 10px;
}

.ap-table-columns-toggle {
	padding: 6px 12px;
	border: 1px solid #ccc;
	border-radius: 3px;
	background: #fff;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.ap-table-columns-toggle:hover {
	background: #f5f5f5;
}

.ap-table-export-menu {
	position: relative;
}

.ap-table-export-options {
	position: absolute;
	z-index: 100;
	top: calc(100% + 4px);
	right: 0;
	display: grid;
	min-width: 170px;
	gap: 4px;
	padding: 8px;
	border: 1px solid #ccc;
	border-radius: 3px;
	background: #fff;
	box-shadow: 0 3px 10px rgb(0 0 0 / 15%);
}

.ap-table-export-options[hidden] {
	display: none;
}

.ap-table-export-options button {
	text-align: left;
}

.ap-table-columns-panel {
	position: absolute;
	z-index: 90;
	top: calc(100% + 4px);
	right: 0;
	min-width: 220px;
	padding: 12px;
	border: 1px solid #ccc;
	border-radius: 3px;
	background: #fff;
	box-shadow: 0 3px 10px rgb(0 0 0 / 15%);
}

.ap-table-columns-panel[hidden] {
	display: none;
}

.ap-table-column-option {
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 8px 0;
	cursor: pointer;
}

.ap-table-column-option input {
	margin: 0;
}

.ap-table-columns-actions {
	display: flex;
	gap: 8px;
	margin-bottom: 8px;
	padding-bottom: 8px;
	border-bottom: 1px solid #eee;
}

/*
 * Hidden columns.
 */

.ap-table-column-hidden {
	display: none;
}

/*
 * Table sorting
 */

.ap-table-sort-button {
	display: inline-flex;
	gap: 4px;
	align-items: center;
	width: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font-family: inherit;
	font-size: 1rem;
	font-weight: inherit;
	text-align: left;
	cursor: pointer;
	text-decoration: underline;
}

.ap-table-sort-button:hover {
	text-decoration: underline;
}

.ap-table-sort-button:focus {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ap-table-sort-indicator {
	display: inline-block;
	min-width: 1em;
}

.ap-table-row-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
}

.ap-table-row-toggle::before {
	content: "+";
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: currentColor;
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	line-height: 20px;
	background: #000000;
}

.ap-table-row-toggle[aria-expanded="true"]::before {
	content: "−";
}

.ap-table-row-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/*
 * Generated expand/collapse column.
 */

.ap-table col.ap-table-expand-column {
	width: 1%;
}

.ap-table th.ap-table-expand-cell,
.ap-table td.ap-table-expand-cell {
	width: 1%;
	min-width: 0;
	max-width: none;
	white-space: nowrap;
}

/*
 * Form controls and buttons.
 */

.ap-table button:not(.ap-table-sort-button):not(.ap-table-search-clear) {
	 font: inherit;
	 font-weight: 700 !important;
	 color: #333;
	 background: #fff;
	 border: 1px solid #949494;
	 border-radius: 4px;
	 cursor: pointer;
	 padding: 0.75rem 1rem;
 }

 .ap-table button:not(.ap-table-sort-button):not(.ap-table-search-clear):hover {
	 background: #f5f5f5;
 }

.ap-table button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ap-table-row-toggle-label {
	display: inline-block;
}

/*
 * Column visibility checkboxes.
 */

.ap-table-column-option input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	width: 24px;
	height: 24px;
	margin: 0;
	padding: 0;
	border: 1px solid #949494;
	border-radius: 4px;
	background: #fff;
	cursor: pointer;
	display: inline-grid;
	place-content: center;
	flex: 0 0 24px;
}

.ap-table-column-option input[type="checkbox"]::before {
	content: "";
	width: 12px;
	height: 6px;
	border-left: 3px solid transparent;
	border-bottom: 3px solid transparent;
	transform: rotate(-45deg) scale(0);
	transform-origin: center;
}

.ap-table-column-option input[type="checkbox"]:checked::before {
	transform: rotate(-45deg) scale(1);
}

.ap-table-column-option input[type="checkbox"]:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}
