/* Shared responsive listing tables (links, QR, pixels, domains, etc.) */

[class$="-page__table-wrap"],
.apk-builder-page__table-wrap,
.apk-topup-page__table-wrap {
	position: relative;
	max-width: 100%;
	overflow-x: auto;
	overflow-y: visible;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	scrollbar-width: thin;
	scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
}

[class$="-page__table-wrap"]::-webkit-scrollbar,
.apk-builder-page__table-wrap::-webkit-scrollbar,
.apk-topup-page__table-wrap::-webkit-scrollbar {
	height: 8px;
}

[class$="-page__table-wrap"]::-webkit-scrollbar-thumb,
.apk-builder-page__table-wrap::-webkit-scrollbar-thumb,
.apk-topup-page__table-wrap::-webkit-scrollbar-thumb {
	background: rgba(148, 163, 184, 0.45);
	border-radius: 999px;
}

[class$="-page__table"],
.apk-builder-page__table,
.apk-topup-page__table {
	width: 100%;
	margin: 0;
	border-collapse: separate;
	border-spacing: 0;
}

/* Desktop / tablet: keep a usable min width so columns don't squash */
@media (min-width: 768px) {
	[class$="-page__table"],
	.apk-builder-page__table,
	.apk-topup-page__table {
		min-width: 640px;
	}
}

/* Tablet: tighter padding while scrolling horizontally */
@media (max-width: 991.98px) and (min-width: 768px) {
	[class$="-page__table"] thead th,
	[class$="-page__table"] tbody td,
	.apk-builder-page__table thead th,
	.apk-builder-page__table tbody td,
	.apk-topup-page__table thead th,
	.apk-topup-page__table tbody td {
		padding-left: 0.85rem;
		padding-right: 0.85rem;
	}
}

/* Mobile: stack rows as cards — no horizontal scroll needed */
@media (max-width: 767.98px) {
	[class$="-page__table-wrap"],
	.apk-builder-page__table-wrap,
	.apk-topup-page__table-wrap {
		overflow-x: visible;
	}

	[class$="-page__table"],
	.apk-builder-page__table,
	.apk-topup-page__table {
		min-width: 0 !important;
	}

	[class$="-page__table"] thead,
	.apk-builder-page__table thead,
	.apk-topup-page__table thead {
		display: none;
	}

	[class$="-page__table"],
	[class$="-page__table"] tbody,
	[class$="-page__table"] tr,
	[class$="-page__table"] td,
	.apk-builder-page__table,
	.apk-builder-page__table tbody,
	.apk-builder-page__table tr,
	.apk-builder-page__table td,
	.apk-topup-page__table,
	.apk-topup-page__table tbody,
	.apk-topup-page__table tr,
	.apk-topup-page__table td {
		display: block;
		width: 100%;
	}

	[class$="-page__table"] tbody tr,
	.apk-builder-page__table tbody tr,
	.apk-topup-page__table tbody tr {
		position: relative;
		padding: 1rem 1rem 0.85rem;
		border-bottom: 1px solid rgba(148, 163, 184, 0.12);
	}

	[class$="-page__table"] tbody tr:last-child,
	.apk-builder-page__table tbody tr:last-child,
	.apk-topup-page__table tbody tr:last-child {
		border-bottom: 0;
	}

	[class$="-page__table"] tbody td,
	.apk-builder-page__table tbody td,
	.apk-topup-page__table tbody td {
		border: 0 !important;
		padding: 0.3rem 0 !important;
		background: transparent !important;
	}

	[class$="-page__table"] tbody tr:hover td,
	.apk-builder-page__table tbody tr:hover td,
	.apk-topup-page__table tbody tr:hover td {
		background: transparent !important;
	}

	[class$="-page__table"] td.d-none,
	[class$="-page__table"] td[data-bulk-table].d-none,
	.apk-builder-page__table td.d-none,
	.apk-topup-page__table td.d-none {
		display: none !important;
	}

	[class$="-page__table"] td:last-child,
	.apk-builder-page__table td:last-child,
	.apk-topup-page__table td:last-child {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: flex-end;
		gap: 0.35rem;
		padding-top: 0.55rem !important;
	}

	[class$="-page__name-link"],
	[class$="-page__name-cell"] .text-truncate {
		max-width: 100%;
		white-space: normal;
	}

	[class$="-page__subtitle-text"] {
		max-width: 100% !important;
	}

	[class$="-page__name-cell"] {
		align-items: flex-start;
	}

	[class$="-page__avatar"] {
		width: 44px !important;
		height: 44px !important;
	}

	[class$="-page__meta"] {
		display: inline-flex !important;
		flex-direction: row !important;
		flex-wrap: wrap !important;
		align-items: center;
		gap: 0.55rem;
		padding: 0.15rem 0;
		width: 100%;
		min-width: 0;
	}

	[class$="-page__features"] {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: wrap !important;
		align-items: center;
		gap: 0.5rem;
		width: 100%;
		min-width: 0;
	}

	[class$="-page__actions"] {
		width: 100%;
		justify-content: flex-end;
		gap: 0.25rem;
	}

	[class$="-page__toolbar-actions"] {
		width: 100%;
	}

	[class$="-page__toolbar-actions"] > * {
		flex: 1 1 auto;
	}
}
