/* =========================================================
   Streamworks — Table styles (theme tokens from global.css)
   ========================================================= */

app-table-client-side,
app-table-server-side {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
	overflow: hidden;
}

.stream-table-wrapper {
	width: 100%;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: 2px 2px 8px 8px;
	padding: var(--stream-space-lg);
	background: var(--stream-color-surface);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid var(--stream-color-border);
	box-shadow:
		0 10px 40px var(--stream-color-shadow),
		inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.stream-table-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: var(--stream-space-lg);
	flex-wrap: wrap;
	flex-shrink: 0;
}

.stream-search-box {
	position: relative;
	width: 260px;
	max-width: 100%;
}

.stream-search-box i {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--stream-color-text-soft);
	font-size: 12px;
}

.stream-search-box input {
	width: 100%;
	height: 36px;
	border: none;
	outline: none;
	border-radius: 8px;
	padding: 0 12px 0 34px;
	background: var(--stream-color-surface-strong);
	color: var(--stream-color-text);
	font-size: 13px;
	box-shadow: 0 2px 8px var(--stream-color-shadow);
}

.stream-toolbar-right {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.stream-rows-select {
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--stream-color-surface);
	padding: 0 10px;
	border-radius: 8px;
	height: 36px;
}

.stream-rows-select span {
	font-size: 12px;
	color: var(--stream-color-text-muted);
}

.stream-rows-select select {
	border: none;
	outline: none;
	background: transparent;
	font-size: 12px;
	color: var(--stream-color-text);
	cursor: pointer;
}

.stream-action-btn {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	border: none;
	cursor: pointer;
	background: var(--stream-color-surface-strong);
	color: var(--stream-color-text-muted);
	font-size: 12px;
	transition: 0.25s;
	box-shadow: 0 2px 8px var(--stream-color-shadow);
}

.stream-action-btn:hover {
	transform: translateY(-2px);
	background: var(--stream-color-surface-strong);
}

.stream-table-container {
	flex: 1;
	min-height: 0;
	overflow: auto;
	border-radius: 12px;
	scrollbar-gutter: stable;
}

.stream-table-container table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	min-width: 900px;
}

.stream-table-container thead {
	position: sticky;
	top: 0;
	z-index: 3;
	/* Opaque stack: theme mid-tone under translucent surface so rows don’t bleed through */
	background-color: var(--stream-color-bg-mid);
	background-image: linear-gradient(
		var(--stream-color-surface-strong),
		var(--stream-color-surface-strong)
	);
}

.stream-table-container thead th {
	position: sticky;
	top: 0;
	z-index: 2;
	background-color: var(--stream-color-bg-mid);
	background-image: linear-gradient(
		var(--stream-color-surface-strong),
		var(--stream-color-surface-strong)
	);
	box-shadow: 0 1px 0 var(--stream-color-border-soft);
}

.stream-table-container th {
	text-align: left;
	padding: 18px 20px;
	font-size: 13px;
	font-weight: 600;
	color: var(--stream-color-text-muted);
	border-bottom: 1px solid var(--stream-color-border-soft);
}

.stream-table-container td {
	padding: 18px 20px;
	font-size: 14px;
	color: var(--stream-color-text);
	border-bottom: 1px solid var(--stream-color-border-soft);
}

.stream-table-serial {
	width: 56px;
	min-width: 56px;
	max-width: 56px;
	text-align: center !important;
	padding-left: 12px !important;
	padding-right: 12px !important;
	color: var(--stream-color-text-muted);
	white-space: nowrap;
}

.stream-table-container tbody tr {
	transition: 0.25s;
}

.stream-table-container tbody tr:hover {
	background: var(--stream-color-surface);
}

.stream-table-user {
	display: flex;
	align-items: center;
	gap: 12px;
}

.stream-avatar {
	width: 34px;
	height: 34px;
	border-radius: 8px;
	background: var(--stream-color-primary-gradient);
	color: white;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 12px;
}

.stream-status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
}

.stream-status.stream-status-active {
	background: var(--stream-color-success-soft);
	color: var(--stream-color-success);
}

.stream-status.stream-status-pending {
	background: var(--stream-color-warning-soft);
	color: var(--stream-color-warning);
}

.stream-status.stream-status-blocked {
	background: var(--stream-color-danger-soft);
	color: var(--stream-color-danger);
}

.stream-table-actions {
	display: flex;
	gap: 10px;
}

.stream-mini-btn {
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 8px;
	background: var(--stream-color-surface-strong);
	cursor: pointer;
	color: var(--stream-color-text-muted);
	transition: 0.2s;
	font-size: 12px;
}

.stream-mini-btn:hover {
	transform: translateY(-2px);
}

.stream-table-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	margin-top: var(--stream-space-lg);
	flex-wrap: wrap;
	flex-shrink: 0;
}

.stream-total-rows {
	color: var(--stream-color-text-muted);
	font-size: 14px;
}

.stream-pagination {
	display: flex;
	align-items: center;
	gap: 10px;
}

.stream-page-btn {
	width: 34px;
	height: 34px;
	border: none;
	border-radius: 8px;
	background: var(--stream-color-surface-strong);
	color: var(--stream-color-text-muted);
	cursor: pointer;
	transition: 0.25s;
	font-weight: 600;
	font-size: 12px;
}

.stream-page-btn:hover {
	background: var(--stream-color-surface);
}

.stream-page-btn.stream-active {
	background: var(--stream-color-primary-gradient);
	color: white;
}

@media (max-width: 768px) {
	.stream-table-wrapper {
		padding: 18px;
		border-radius: 24px;
	}

	.stream-table-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.stream-toolbar-right {
		justify-content: space-between;
	}

	.stream-table-footer {
		flex-direction: column;
		align-items: flex-start;
	}

	.stream-pagination {
		flex-wrap: wrap;
	}
}
