/* Tablas MD - estilos públicos y de vista previa */
.tmd-table-wrap {
	--tmd-primary: #6750a4;
	--tmd-on-primary: #ffffff;
	--tmd-header-bg: #6750a4;
	--tmd-header-color: #ffffff;
	--tmd-row-bg: #ffffff;
	--tmd-alt-bg: #f7f2fa;
	--tmd-hover-bg: #f3edf7;
	--tmd-text: #1d1b20;
	--tmd-border: #cac4d0;
	--tmd-radius: 12px;
	--tmd-font-size: 14px;
	--tmd-cell-y: 14px;
	--tmd-cell-x: 18px;

	box-sizing: border-box;
	margin: 1.5rem 0;
	overflow: hidden;
	border-radius: var(--tmd-radius);
	background: var(--tmd-row-bg);
	color: var(--tmd-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: var(--tmd-font-size);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.tmd-table-wrap *,
.tmd-table-wrap *::before,
.tmd-table-wrap *::after {
	box-sizing: border-box;
}

.tmd-table-wrap.tmd-shadow {
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.08);
}

.tmd-table-wrap.tmd-bordered {
	border: 1px solid var(--tmd-border);
}

.tmd-table-wrap.tmd-density-compact {
	--tmd-cell-y: 9px;
	--tmd-cell-x: 14px;
}

.tmd-table-heading {
	padding: 22px 22px 0;
}

.tmd-table-title {
	margin: 0;
	padding: 0;
	color: var(--tmd-text);
	font-size: 1.35em;
	font-weight: 600;
	line-height: 1.25;
}

	.tmd-table-title-center {
		text-align: center;
	}

.tmd-table-description {
	margin: 6px 0 0;
	color: var(--tmd-text);
	font-size: 0.92em;
	opacity: 0.72;
}

.tmd-toolbar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 22px;
}

.tmd-search-field {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: 8px;
	max-width: 430px;
	height: 44px;
	margin: 0;
	padding: 0 16px;
	border: 1px solid var(--tmd-border);
	border-radius: 999px;
	background: transparent;
	color: var(--tmd-text);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tmd-search-field:focus-within {
	border-color: var(--tmd-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tmd-primary) 18%, transparent);
}

.tmd-search-icon {
	font-size: 19px;
	line-height: 1;
	opacity: 0.68;
}

.tmd-search-field input {
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	box-shadow: none;
	appearance: none;
}

.tmd-search-field input::placeholder {
	color: currentColor;
	opacity: 0.55;
}

.tmd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: 40px;
	margin: 0;
	padding: 0 18px;
	border: 0;
	border-radius: 999px;
	font: inherit;
	font-size: 0.94em;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.tmd-btn-filled {
	background: var(--tmd-primary);
	color: var(--tmd-on-primary);
}

.tmd-btn-filled:hover,
.tmd-btn-filled:focus {
	background: var(--tmd-primary);
	color: var(--tmd-on-primary);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
	opacity: 0.92;
}

.tmd-search-submit {
	flex: 0 0 auto;
	min-height: 42px;
}

.tmd-table-scroll {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.tmd-table {
	width: auto;
	min-width: 100%;
	margin: 0;
	border: 0;
	border-collapse: separate;
	border-spacing: 0;
	background: var(--tmd-row-bg);
	color: var(--tmd-text);
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	table-layout: auto;
}

.tmd-table thead th {
	padding: var(--tmd-cell-y) var(--tmd-cell-x);
	background: var(--tmd-header-bg);
	color: var(--tmd-header-color);
	font-size: 0.86em;
	font-weight: 600;
	letter-spacing: 0.025em;
	text-align: left;
	text-transform: none;
	vertical-align: middle;
	white-space: nowrap;
}

.tmd-table thead th a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	color: inherit;
	font-weight: inherit;
	text-decoration: none;
}

.tmd-table thead th a:hover,
.tmd-table thead th a:focus {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tmd-sort-icon {
	display: inline-block;
	font-size: 11px;
	line-height: 1;
	opacity: 0.75;
}

.tmd-table tbody td {
	padding: var(--tmd-cell-y) var(--tmd-cell-x);
	border: 0;
	background: transparent;
	color: var(--tmd-text);
	font-size: inherit;
	text-align: left;
	vertical-align: top;
}

.tmd-table tbody tr {
	background: var(--tmd-row-bg);
	transition: background-color 0.12s ease;
}

.tmd-table.tmd-striped tbody tr:nth-child(even),
.tmd-striped .tmd-table tbody tr:nth-child(even) {
	background: var(--tmd-alt-bg);
}

.tmd-table tbody tr:hover {
	background: var(--tmd-hover-bg);
}

.tmd-bordered .tmd-table tbody td {
	border-bottom: 1px solid var(--tmd-border);
}

.tmd-bordered .tmd-table tbody tr:last-child td {
	border-bottom: 0;
}

.tmd-empty-value {
	opacity: 0.45;
}

.tmd-link {
	color: var(--tmd-primary);
	text-decoration: underline;
	text-underline-offset: 2px;
	word-break: break-word;
}

.tmd-link:hover,
.tmd-link:focus {
	color: var(--tmd-primary);
	text-decoration: none;
}

/* Columnas de enlace con icono */
.tmd-icon-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	max-width: 100%;
	padding: 2px;
	margin: -2px;
	border-radius: 8px;
	color: var(--tmd-primary);
	font-weight: 600;
	line-height: 1.25;
	text-decoration: none;
	vertical-align: middle;
}

.tmd-icon-link:hover,
.tmd-icon-link:focus {
	color: var(--tmd-primary);
	text-decoration: none;
}

.tmd-icon-link:hover .tmd-icon-link-text,
.tmd-icon-link:focus .tmd-icon-link-text {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tmd-icon-link:focus-visible {
	outline: 2px solid var(--tmd-primary);
	outline-offset: 2px;
}

.tmd-icon-link-icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
}

.tmd-icon-link-icon svg {
	display: block;
	width: 1.4em;
	height: 1.4em;
}

.tmd-icon-link-icon img {
	display: block;
	width: 1.4em;
	height: 1.4em;
	object-fit: contain;
}

.tmd-icon-link-text {
	overflow-wrap: normal;
	word-break: normal;
}

.tmd-icon-link-top,
.tmd-icon-link-bottom {
	flex-direction: column;
	align-items: center;
	gap: 4px;
	text-align: center;
}

.tmd-icon-link-top .tmd-icon-link-text {
	order: -1;
}

.tmd-icon-link-left .tmd-icon-link-text {
	order: -1;
}

.tmd-icon-link-only {
	gap: 0;
}

.tmd-chip {
	display: inline-flex;
	align-items: center;
	min-height: 24px;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 0.82em;
	font-weight: 600;
	line-height: 1.35;
	white-space: nowrap;
}

.tmd-chip-yes {
	background: color-mix(in srgb, var(--tmd-primary) 16%, transparent);
	color: var(--tmd-primary);
}

.tmd-chip-no {
	background: color-mix(in srgb, var(--tmd-text) 10%, transparent);
	color: var(--tmd-text);
	opacity: 0.7;
}

.tmd-table-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 14px 22px 18px;
	color: var(--tmd-text);
	font-size: 0.86em;
}

.tmd-results-count {
	opacity: 0.72;
}

.tmd-pagination {
	display: flex;
	align-items: center;
	gap: 4px;
}

.tmd-page {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	padding: 0 8px;
	border-radius: 999px;
	color: var(--tmd-text);
	font-size: 0.92em;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.12s ease;
}

a.tmd-page:hover,
a.tmd-page:focus {
	background: var(--tmd-hover-bg);
	color: var(--tmd-text);
	text-decoration: none;
}

.tmd-page-current {
	background: var(--tmd-primary);
	color: var(--tmd-on-primary);
}

.tmd-page-disabled {
	opacity: 0.3;
}

.tmd-page-ellipsis {
	opacity: 0.6;
}

.tmd-no-results td {
	padding: 34px var(--tmd-cell-x) !important;
	text-align: center !important;
	opacity: 0.65;
}

.tmd-empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 48px 24px;
	text-align: center;
}

.tmd-empty-state p {
	margin: 0;
	opacity: 0.7;
}

.tmd-empty-icon {
	font-size: 34px;
	opacity: 0.4;
}

.tmd-table-wrap .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
	white-space: nowrap;
}

.tmd-elementor-placeholder {
	padding: 28px;
	border: 2px dashed #cac4d0;
	border-radius: 12px;
	background: #f7f2fa;
	color: #49454f;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	text-align: center;
}

@media (max-width: 680px) {
	.tmd-table-wrap {
		margin: 1rem 0;
	}

	.tmd-table-heading {
		padding: 18px 16px 0;
	}

	.tmd-toolbar {
		flex-wrap: wrap;
		padding: 14px 16px;
	}

	.tmd-search-field {
		max-width: none;
	}

	.tmd-table-scroll {
		overflow: visible;
	}

	.tmd-table,
	.tmd-table thead,
	.tmd-table tbody,
	.tmd-table tr,
	.tmd-table th,
	.tmd-table td {
		display: block;
		width: 100%;
	}

	.tmd-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}

	.tmd-table tbody tr {
		padding: 10px 16px;
		border-bottom: 1px solid var(--tmd-border);
	}

	.tmd-table tbody tr:last-child {
		border-bottom: 0;
	}

	.tmd-table tbody td {
		display: flex;
		align-items: flex-start;
		justify-content: space-between;
		gap: 18px;
		padding: 7px 0;
		text-align: right;
		overflow-wrap: anywhere;
	}

	.tmd-table tbody td::before {
		content: attr(data-label);
		flex: 0 0 38%;
		color: var(--tmd-text);
		font-size: 0.86em;
		font-weight: 600;
		text-align: left;
		white-space: nowrap;
		opacity: 0.7;
	}

	.tmd-table tbody td .tmd-icon-link {
		margin-left: auto;
	}

	.tmd-no-results td {
		display: block;
		padding: 24px 0 !important;
	}

	.tmd-no-results td::before {
		content: "";
	}

	.tmd-table-footer {
		flex-direction: column;
		align-items: flex-start;
		padding: 14px 16px 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tmd-table-wrap *,
	.tmd-table-wrap *::before,
	.tmd-table-wrap *::after {
		transition: none !important;
	}
}
