/* =========================================================================
   PWD Tables — Front-end Styles
   ========================================================================= */

.pwd-table-wrap {
	margin: 1.5em 0;
	width: 100%;
}

/* THE KEY: only the table container scrolls, not the page */
.pwd-table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	/* scrollbar styling via inline CSS per-instance */
}

/* Search bar */
.pwd-table-search-wrap {
	margin-bottom: 10px;
}
.pwd-table-search {
	width: 100%;
	max-width: 300px;
	padding: 8px 12px;
	border: 1px solid #E2E8F0;
	border-radius: 8px;
	font-size: 13px;
	outline: none;
	box-sizing: border-box;
	transition: border-color .15s;
}
.pwd-table-search:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

/* Table base */
.pwd-table {
	border-collapse: collapse;
	width: 100%;
	/* min-width ensures horizontal scroll kicks in before content wraps */
	min-width: 100%;
}

/* Caption */
.pwd-table caption {
	caption-side: bottom;
	font-size: 12px;
	color: #A0AEC0;
	padding: 8px 0 0;
	text-align: left;
}

/* Cells */
.pwd-table thead th,
.pwd-table tbody td {
	vertical-align: middle;
}

/* Sortable headers */
.pwd-table.is-sortable thead th[data-sortable] {
	cursor: pointer;
	user-select: none;
	position: relative;
	padding-right: 28px;
}
.pwd-table.is-sortable thead th[data-sortable]:hover {
	filter: brightness(1.1);
}
.pwd-sort-icon {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 10px;
	height: 12px;
	display: inline-block;
}
.pwd-sort-icon::before,
.pwd-sort-icon::after {
	content: '';
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
}
.pwd-sort-icon::before {
	top: 0;
	border-bottom: 4px solid currentColor;
	opacity: .4;
}
.pwd-sort-icon::after {
	bottom: 0;
	border-top: 4px solid currentColor;
	opacity: .4;
}
th[aria-sort="ascending"]  .pwd-sort-icon::before { opacity: 1; }
th[aria-sort="descending"] .pwd-sort-icon::after  { opacity: 1; }

/* Empty state */
.pwd-table-empty {
	text-align: center;
	color: #A0AEC0;
	font-style: italic;
	padding: 32px !important;
}

/* Hidden row (search filter) */
.pwd-table tbody tr.pwd-hidden { display: none; }
