/* ============================================================
 * Perfiles de Usuario — estilos de frontend
 * Variables --pf-* inyectadas dinámicamente según el tema.
 * ============================================================ */

.perfiles-wrap {
	--pf-primary: #6366f1;
	--pf-accent: #ec4899;
	--pf-bg: #0f172a;
	--pf-card: #1e293b;
	--pf-text: #e2e8f0;
	--pf-muted: #94a3b8;
	--pf-banner-color: #6366f1;
	--pf-banner-img: none;
	--pf-banner-h: 220px;
	--pf-radius: 18px;

	color: var(--pf-text);
	font-family: inherit;
	max-width: 1100px;
	margin: 0 auto;
	box-sizing: border-box;
}

.perfiles-wrap *,
.perfiles-wrap *::before,
.perfiles-wrap *::after {
	box-sizing: border-box;
}

.perfiles-wrap .perfiles-icon {
	flex: 0 0 auto;
	vertical-align: middle;
}

/* ---------- Tarjeta ---------- */
.pf-card {
	background: var(--pf-card);
	border-radius: var(--pf-radius);
	overflow: hidden;
	box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .55);
	border: 1px solid rgba(255, 255, 255, .06);
}

.pf-body {
	padding: clamp(18px, 4vw, 34px);
}

/* ---------- Banner ---------- */
.pf-banner {
	position: relative;
	height: var(--pf-banner-h);
	background: var(--pf-banner-img), linear-gradient(120deg, var(--pf-banner-color), var(--pf-accent));
	background-size: cover;
	background-position: center;
	overflow: hidden;
}

/* Rayas / líneas animadas */
.pf-lines {
	position: absolute;
	inset: 0;
	background-image: repeating-linear-gradient(
		115deg,
		rgba(255, 255, 255, .10) 0,
		rgba(255, 255, 255, .10) 2px,
		transparent 2px,
		transparent 26px
	);
	opacity: .6;
	pointer-events: none;
}

.perfiles-animated .pf-lines {
	animation: pf-slide 9s linear infinite;
	background-size: 200% 200%;
}

.perfiles-animated .pf-banner::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .18), transparent);
	transform: translateX(-100%);
	animation: pf-shimmer 6s ease-in-out infinite;
}

@keyframes pf-slide {
	from { background-position: 0 0; }
	to   { background-position: 200% 0; }
}

@keyframes pf-shimmer {
	0%, 60% { transform: translateX(-100%); }
	100%    { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
	.perfiles-animated .pf-lines,
	.perfiles-animated .pf-banner::after {
		animation: none;
	}
}

/* ---------- Cabecera con avatar ---------- */
.pf-head {
	display: flex;
	align-items: flex-end;
	gap: 18px;
	padding: 0 clamp(18px, 4vw, 34px);
	margin-top: -40px;
	position: relative;
	z-index: 2;
}

.perfiles-avatar-center .pf-head {
	flex-direction: column;
	align-items: center;
	text-align: center;
	margin-top: -48px;
}

.pf-avatar img {
	width: 112px;
	height: 112px;
	border-radius: 50%;
	object-fit: cover;
	border: 4px solid var(--pf-card);
	box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6);
	background: var(--pf-card);
}

.pf-head-meta { padding-bottom: 6px; }

.pf-name {
	margin: 12px 0 0;
	font-size: clamp(1.4rem, 3vw, 2rem);
	line-height: 1.1;
	color: var(--pf-text);
}

.pf-role {
	margin: 4px 0 0;
	color: var(--pf-muted);
	font-size: .9rem;
}

/* ---------- Secciones ---------- */
.pf-section { margin-top: 28px; }

.pf-section-title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 1.05rem;
	margin: 0 0 16px;
	padding-bottom: 10px;
	color: var(--pf-text);
	position: relative;
}

.pf-section-title::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	height: 3px;
	width: 100%;
	border-radius: 3px;
	background: linear-gradient(90deg, var(--pf-primary), var(--pf-accent), transparent);
	background-size: 200% 100%;
}

.perfiles-animated .pf-section-title::after {
	animation: pf-slide 5s linear infinite;
}

.pf-section-title .perfiles-icon { color: var(--pf-primary); }

/* ---------- Formulario ---------- */
.pf-form .pf-field,
.pf-field {
	margin-bottom: 18px;
}

.pf-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	font-size: calc(var(--pf-label-size, 13px) * 1.1);
	margin-bottom: 7px;
	color: var(--pf-text);
}

.pf-label .perfiles-icon { color: var(--pf-primary); }

.pf-input,
.perfiles-wrap .acf-input input[type="text"],
.perfiles-wrap .acf-input input[type="email"],
.perfiles-wrap .acf-input input[type="url"],
.perfiles-wrap .acf-input input[type="number"],
.perfiles-wrap .acf-input textarea,
.perfiles-wrap .acf-input select {
	width: 100%;
	padding: 11px 14px;
	border-radius: calc(var(--pf-radius) * .55);
	border: 1px solid rgba(255, 255, 255, .12);
	background: rgba(255, 255, 255, .04);
	color: var(--pf-text);
	font-size: .95rem;
	transition: border-color .2s, box-shadow .2s;
}

.pf-input:focus,
.perfiles-wrap .acf-input input:focus,
.perfiles-wrap .acf-input textarea:focus,
.perfiles-wrap .acf-input select:focus {
	outline: none;
	border-color: var(--pf-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--pf-primary) 30%, transparent);
}

.pf-input::placeholder { color: var(--pf-muted); }

/* Etiquetas nativas de ACF integradas al tema */
.perfiles-wrap .acf-fields > .acf-field {
	border-top-color: rgba(255, 255, 255, .06);
	padding: 14px 0;
}

.perfiles-wrap .acf-label label {
	color: var(--pf-text);
	font-weight: 600;
}

.perfiles-wrap .acf-field .description,
.perfiles-wrap .acf-field p.description {
	color: var(--pf-muted);
}

/* ---------- Foto ---------- */
.pf-photo-row {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.pf-photo-preview {
	width: 84px;
	height: 84px;
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid var(--pf-primary);
}

.pf-file { position: relative; cursor: pointer; }
.pf-file input[type="file"] {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
}

.pf-file-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border-radius: 999px;
	border: 1px dashed rgba(255, 255, 255, .3);
	color: var(--pf-text);
	font-size: .88rem;
}

/* ---------- Botones ---------- */
.pf-actions { margin-top: 18px; }

.pf-btn,
.perfiles-wrap .acf-form-submit .acf-button,
.perfiles-wrap input[type="submit"].acf-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	border: none;
	border-radius: 999px;
	background: linear-gradient(120deg, var(--pf-primary), var(--pf-accent));
	color: #fff;
	font-weight: 600;
	font-size: .95rem;
	cursor: pointer;
	text-decoration: none;
	box-shadow: 0 10px 24px -10px var(--pf-primary);
	transition: transform .15s, box-shadow .2s, filter .2s;
}

.pf-btn:hover,
.perfiles-wrap .acf-button:hover {
	transform: translateY(-2px);
	filter: brightness(1.06);
	color: #fff;
}

/* ---------- Grid de solo lectura ---------- */
.pf-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 14px;
}

.pf-info {
	background: rgba(255, 255, 255, .04);
	border: 1px solid rgba(255, 255, 255, .07);
	border-radius: calc(var(--pf-radius) * .6);
	padding: 14px 16px;
	position: relative;
	overflow: hidden;
}

.pf-info::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 3px;
	background: linear-gradient(var(--pf-primary), var(--pf-accent));
}

.pf-info-label {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: calc(var(--pf-label-size, 13px) * .95);
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--pf-muted);
	margin-bottom: 6px;
}

.pf-info-label .perfiles-icon { width: 16px; height: 16px; color: var(--pf-primary); }

.pf-info-value {
	font-size: calc(var(--pf-value-size, 17px) * .95);
	color: var(--pf-text);
	word-break: break-word;
}

.pf-info-value a { color: var(--pf-primary); }

.pf-info-img {
	max-width: 100%;
	border-radius: 10px;
	margin-top: 4px;
}

/* ---------- Flash / vacíos ---------- */
.pf-flash {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	border-radius: calc(var(--pf-radius) * .6);
	margin-bottom: 20px;
	font-weight: 500;
}

.pf-flash-ok {
	background: color-mix(in srgb, #22c55e 18%, transparent);
	color: #bbf7d0;
	border: 1px solid color-mix(in srgb, #22c55e 40%, transparent);
}

.pf-flash .perfiles-icon { color: #4ade80; }

.pf-empty {
	color: var(--pf-muted);
	text-align: center;
	padding: 20px;
}

/* ============================================================
 * Datos del perfil — estilo compacto con lápiz (edición inline)
 * ============================================================ */
.pf-items {
	display: grid;
	grid-template-columns: repeat(var(--pf-cols-profile, 3), 1fr);
	gap: 22px 30px;
	margin-top: 6px;
}

@media (max-width: 780px) {
	.pf-items { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
	.pf-items { grid-template-columns: 1fr; }
}

/* Encabezado "Datos adicionales" */
.pf-extra-title {
	margin: 30px 0 14px;
	font-size: 1.05rem;
	font-weight: 800;
	color: var(--pf-text);
	display: inline-block;
	padding-bottom: 8px;
	position: relative;
}

.pf-extra-title::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	height: 3px;
	width: 100%;
	border-radius: 3px;
	background: linear-gradient(90deg, var(--pf-primary), var(--pf-accent));
	background-size: 200% 100%;
}

.perfiles-animated .pf-extra-title::after { animation: pf-slide 5s linear infinite; }

.pf-item {
	display: flex;
	align-items: flex-start;
	gap: 14px;
}

/* Icono redondo tipo "insignia" — escala con el tamaño elegido en Diseño */
.pf-item-ic {
	flex: 0 0 auto;
	width: calc(var(--pf-icon-size, 22px) * 2.18);
	height: calc(var(--pf-icon-size, 22px) * 2.18);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--pf-icon, var(--pf-primary));
	background: color-mix(in srgb, var(--pf-icon, var(--pf-primary)) 14%, transparent);
	border: 2px solid color-mix(in srgb, var(--pf-icon, var(--pf-primary)) 40%, transparent);
	box-shadow: 0 6px 16px -8px var(--pf-icon, var(--pf-primary));
}

.pf-item-ic .perfiles-icon { width: var(--pf-icon-size, 22px); height: var(--pf-icon-size, 22px); }

/* Un campo sin icono no deja el hueco de la insignia. */
.pf-item-ic:empty { display: none; }

.pf-item-body {
	flex: 1 1 auto;
	min-width: 0;
}

/* Fila superior: etiqueta + línea animada + lápiz */
.pf-item-top {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 4px;
}

.pf-item-label {
	font-size: var(--pf-label-size, 13px);
	font-weight: var(--pf-label-weight, 700);
	letter-spacing: .02em;
	text-transform: var(--pf-label-transform, none);
	color: var(--pf-label, var(--pf-primary));
	white-space: nowrap;
}

.pf-item-line {
	flex: 1 1 auto;
	height: 2px;
	min-width: 12px;
	border-radius: 2px;
	background-image: linear-gradient(90deg, color-mix(in srgb, var(--pf-primary) 55%, transparent), transparent);
	background-size: 200% 100%;
}

.perfiles-animated .pf-item-line { animation: pf-slide 4s linear infinite; }

/* Lápiz (pequeño, blindado contra los estilos del tema) */
.perfiles-wrap .pf-edit-btn {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	min-width: 0;
	min-height: 0;
	max-width: 22px;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: none;
	background: transparent;
	color: var(--pf-muted);
	cursor: pointer;
	line-height: 1;
	box-shadow: none;
	transition: color .15s, background .15s, transform .15s;
	padding: 0;
}

.perfiles-wrap .pf-edit-btn .perfiles-icon { width: 13px !important; height: 13px !important; }

.pf-edit-btn:hover {
	color: #fff;
	background: linear-gradient(120deg, var(--pf-primary), var(--pf-accent));
	transform: rotate(-8deg);
}

/* Valor mostrado */
.pf-item-value {
	font-size: var(--pf-value-size, 17px);
	font-weight: 600;
	color: var(--pf-value, var(--pf-text));
	word-break: break-word;
	line-height: 1.35;
}

.pf-item-value a { color: var(--pf-primary); }
.pf-empty-val { color: var(--pf-muted); font-weight: 400; }
.pf-item.is-editing .pf-item-value { display: none; }

/* Editor inline compacto */
.pf-item-editor { margin-top: 6px; }

.pf-input-sm {
	padding: 8px 11px !important;
	font-size: .92rem !important;
	max-width: 320px;
}

textarea.pf-input-sm { max-width: 100%; }

.pf-editor-actions {
	display: flex;
	gap: 8px;
	margin-top: 8px;
}

.pf-mini-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, .15);
	background: rgba(255, 255, 255, .04);
	color: var(--pf-text);
	font-size: .82rem;
	font-weight: 600;
	cursor: pointer;
}

.pf-mini-btn .perfiles-icon { width: 15px; height: 15px; }

.pf-mini-btn.pf-save {
	border: none;
	background: linear-gradient(120deg, var(--pf-primary), var(--pf-accent));
	color: #fff;
}

.pf-mini-btn:disabled { opacity: .6; cursor: default; }

.pf-check-group { display: flex; flex-wrap: wrap; gap: 10px; }

.pf-check {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: .9rem;
	color: var(--pf-text);
}

/* Botón de editar foto sobre el avatar */
.pf-avatar { position: relative; }

.pf-avatar-edit {
	position: absolute;
	right: 2px;
	bottom: 2px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 3px solid var(--pf-card);
	background: linear-gradient(120deg, var(--pf-primary), var(--pf-accent));
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: transform .15s;
}

.perfiles-avatar-center .pf-avatar-edit { right: calc(50% - 56px); }

.pf-avatar-edit:hover { transform: scale(1.08); }
.pf-avatar-edit .perfiles-icon { width: 16px; height: 16px; }

/* Toast */
.pf-toast {
	position: fixed;
	left: 50%;
	bottom: 26px;
	transform: translate(-50%, 20px);
	background: #0f172a;
	color: #fff;
	padding: 12px 22px;
	border-radius: 999px;
	font-size: .9rem;
	font-weight: 600;
	box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .6);
	opacity: 0;
	pointer-events: none;
	transition: opacity .25s, transform .25s;
	z-index: 9999;
	border: 1px solid rgba(255, 255, 255, .12);
}

.pf-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.pf-toast-ok { border-color: color-mix(in srgb, #22c55e 55%, transparent); }
.pf-toast-err { border-color: color-mix(in srgb, #ef4444 55%, transparent); }

/* ============================================================
 * Directorio
 * ============================================================ */
.pf-dir { color: var(--pf-text); }

.pf-dir-head {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 24px;
}

.pf-dir-title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: clamp(1.3rem, 3vw, 1.8rem);
}

.pf-dir-title .perfiles-icon { color: var(--pf-primary); width: 26px; height: 26px; }

.pf-search {
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--pf-card);
	border: 1px solid rgba(255, 255, 255, .1);
	border-radius: 999px;
	padding: 8px 16px;
}

.pf-search .perfiles-icon { color: var(--pf-muted); }

.pf-search input {
	background: transparent;
	border: none;
	color: var(--pf-text);
	outline: none;
	min-width: 200px;
	font-size: .92rem;
}

.pf-search input::placeholder { color: var(--pf-muted); }

.pf-dir-grid {
	display: grid;
	grid-template-columns: repeat(var(--pf-cols, 3), 1fr);
	gap: 20px;
}

/* Tarjeta de usuario */
.pf-uc {
	background: var(--pf-card);
	border-radius: var(--pf-radius);
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, .07);
	text-align: center;
	transition: transform .2s, box-shadow .25s;
	position: relative;
}

.pf-uc:hover {
	transform: translateY(-4px);
	box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .6);
}

.pf-uc-banner {
	height: 108px;
	position: relative;
	overflow: hidden;
	background: linear-gradient(120deg, var(--pf-banner-color), var(--pf-accent));
}

/* Foto sobre el banner (centrada y superpuesta) */
.pf-uc-avatar {
	position: absolute;
	top: 12px;
	left: 50%;
	transform: translateX(-50%);
	margin: 0;
	z-index: 2;
	line-height: 0;
}

.pf-uc-avatar img {
	width: 84px;
	height: 84px;
	border-radius: 50%;
	object-fit: cover;
	border: 4px solid #fff;
	background: var(--pf-card);
	box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5);
}

.pf-uc-name {
	margin: 14px 16px 4px;
	font-size: 1.1rem;
	color: var(--pf-text);
}

.pf-uc-fields {
	padding: 8px 18px 22px;
	text-align: left;
	display: flex;
	flex-direction: column;
	gap: 9px;
}

.pf-uc-row {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: calc(var(--pf-value-size, 17px) * .88);
	color: var(--pf-text);
}

.pf-uc-ic .perfiles-icon {
	width: calc(var(--pf-icon-size, 22px) * .78);
	height: calc(var(--pf-icon-size, 22px) * .78);
	color: var(--pf-icon, var(--pf-primary));
}

.pf-uc-ic:empty { display: none; }

.pf-uc-val { word-break: break-word; }
.pf-uc-val a { color: var(--pf-primary); }

/* Botón "Contactar" (pequeño, blindado contra los estilos del tema) */
.perfiles-wrap a.pf-uc-btn,
.perfiles-wrap .pf-uc-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	width: auto;
	max-width: max-content;
	margin: 4px 18px 20px;
	padding: 8px 16px;
	border: none;
	border-radius: 999px;
	background: linear-gradient(120deg, var(--pf-primary), var(--pf-accent));
	color: #fff;
	font-weight: 600;
	font-size: .82rem;
	line-height: 1;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
	align-self: flex-start;
	box-shadow: none;
	transition: transform .15s, filter .2s;
}

.perfiles-wrap .pf-uc-btn:hover,
.perfiles-wrap a.pf-uc-btn:hover,
.perfiles-wrap a.pf-uc-btn:focus {
	transform: translateY(-2px);
	filter: brightness(1.06);
	color: #fff;
	text-decoration: none;
}
.perfiles-wrap .pf-uc-btn .perfiles-icon { width: 15px; height: 15px; }
.pf-uc { display: flex; flex-direction: column; }
.pf-uc-fields { flex: 1 1 auto; }

/* Fila de acciones de la tarjeta (botón Contactar) */
.pf-uc-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 4px 18px 20px;
}
.perfiles-wrap .pf-uc-actions .pf-uc-btn { margin: 0; }
.perfiles-wrap .pf-uc-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border: 1px solid var(--pf-primary);
	border-radius: 999px;
	background: transparent;
	color: var(--pf-primary);
	font-weight: 600;
	font-size: .82rem;
	line-height: 1;
	text-decoration: none;
	transition: transform .15s, background .2s, color .2s;
}
.perfiles-wrap .pf-uc-link:hover {
	transform: translateY(-2px);
	background: var(--pf-primary);
	color: #fff;
}

/* ============================================================
 * Popup / modal del perfil
 * ============================================================ */
.pf-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.pf-modal[hidden] { display: none; }

.pf-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(2, 6, 23, .7);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity .22s;
}

.pf-modal.is-open .pf-modal-backdrop { opacity: 1; }

.pf-modal-card {
	position: relative;
	width: min(760px, 100%);
	max-height: 88vh;
	overflow: auto;
	background: var(--pf-card);
	color: var(--pf-text);
	border-radius: var(--pf-radius);
	border: 1px solid rgba(255, 255, 255, .1);
	box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .7);
	padding: 28px clamp(20px, 4vw, 36px) 34px;
	transform: translateY(16px) scale(.98);
	opacity: 0;
	transition: transform .24s, opacity .24s;
}

.pf-modal.is-open .pf-modal-card { transform: none; opacity: 1; }

.pf-modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, .08);
	color: var(--pf-text);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transition: background .15s;
}

.pf-modal-close:hover { background: rgba(255, 255, 255, .18); }

.pf-modal-head {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 6px;
	margin-bottom: 26px;
}

.pf-modal-head .pf-avatar img {
	width: 108px;
	height: 108px;
	border-radius: 50%;
	object-fit: cover;
	border: 4px solid var(--pf-bg);
	box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .7);
}

.pf-modal-head .pf-name { margin: 6px 0 0; font-size: 1.5rem; }

/* Paginación */
.pf-pagination {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 28px;
	flex-wrap: wrap;
}

.pf-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border-radius: 10px;
	background: var(--pf-card);
	color: var(--pf-text);
	border: 1px solid rgba(255, 255, 255, .1);
	text-decoration: none;
}

.pf-pagination .page-numbers.current {
	background: linear-gradient(120deg, var(--pf-primary), var(--pf-accent));
	color: #fff;
	border-color: transparent;
}

/* ============================================================
 * Responsive
 * ============================================================ */
@media (max-width: 900px) {
	.pf-dir-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
	.pf-dir-grid { grid-template-columns: 1fr; }
	.pf-head { flex-direction: column; align-items: center; text-align: center; }
	.pf-head-meta { padding-bottom: 0; }
	.pf-search input { min-width: 0; width: 100%; }
	.pf-search { width: 100%; }
	.pf-dir-head { flex-direction: column; align-items: stretch; }
}

/* ============================================================
 * Historial de cambios
 * ============================================================ */
.pf-hist-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	flex: 0 0 auto;
	border: none;
	border-radius: 50%;
	background: transparent;
	color: var(--pf-muted);
	cursor: pointer;
	opacity: .65;
	transition: opacity .15s, background .15s, color .15s;
}

.pf-hist-btn:hover {
	opacity: 1;
	color: var(--pf-primary);
	background: color-mix(in srgb, var(--pf-primary) 14%, transparent);
}

.pf-hist-btn .perfiles-icon { width: 16px; height: 16px; }

.pf-hist-card { text-align: left; }

.pf-hist-title {
	margin: 0 40px 18px 0;
	font-size: 1.15rem;
	color: var(--pf-text);
}

.pf-hist-body { max-height: 60vh; overflow: auto; }

.pf-history-list {
	list-style: none;
	margin: 0;
	padding: 0 0 0 18px;
	border-left: 2px solid color-mix(in srgb, var(--pf-primary) 35%, transparent);
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.pf-history-item { position: relative; }

.pf-history-item::before {
	content: "";
	position: absolute;
	left: -25px;
	top: 5px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--pf-primary);
	box-shadow: 0 0 0 3px var(--pf-card);
}

.pf-history-meta {
	font-size: .78rem;
	color: var(--pf-muted);
	margin-bottom: 4px;
}

.pf-history-meta strong { color: var(--pf-text); font-weight: 600; }

.pf-history-change {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: .9rem;
	line-height: 1.4;
}

.pf-history-old {
	color: var(--pf-muted);
	text-decoration: line-through;
	word-break: break-word;
}

.pf-history-arrow { color: var(--pf-primary); flex: 0 0 auto; }

.pf-history-new {
	color: var(--pf-value, var(--pf-text));
	font-weight: 600;
	word-break: break-word;
}

/* ============================================================
 * Geolocalización (mapa del domicilio)
 * ============================================================ */
.pf-geo-wrap:empty { display: none; }

.pf-geo-view { margin-top: 10px; }

.pf-geo-map {
	width: 100%;
	border-radius: calc(var(--pf-radius) * .6);
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, .12);
	background: rgba(255, 255, 255, .04);
	z-index: 0;
}

.pf-geo-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: 6px;
	font-size: .78rem;
	color: var(--pf-muted);
}

.pf-geo-link { color: var(--pf-primary); text-decoration: none; font-weight: 600; }
.pf-geo-link:hover { text-decoration: underline; }

.pf-geo-editor { margin-top: 12px; }

.pf-geo-tools {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 10px;
}

.pf-geo-clear { color: var(--pf-muted); }

.pf-geo-results {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-bottom: 10px;
	max-height: 160px;
	overflow: auto;
}

.pf-geo-result {
	text-align: left;
	padding: 8px 10px;
	border-radius: 10px;
	border: 1px solid rgba(255, 255, 255, .12);
	background: rgba(255, 255, 255, .04);
	color: var(--pf-text);
	font-size: .8rem;
	line-height: 1.35;
	cursor: pointer;
}

.pf-geo-result:hover { border-color: var(--pf-primary); }

.pf-geo-hint {
	margin: 8px 0 0;
	font-size: .76rem;
	color: var(--pf-muted);
}

.pf-geo-coords-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 8px;
}

.pf-geo-coords-row label {
	flex: 1 1 140px;
	font-size: .74rem;
	color: var(--pf-muted);
	display: flex;
	flex-direction: column;
	gap: 3px;
}

/* Leaflet dentro del tema oscuro */
.perfiles-wrap .leaflet-container {
	font: inherit;
	background: rgba(255, 255, 255, .05);
}

.perfiles-wrap .leaflet-control-attribution {
	background: rgba(15, 23, 42, .78);
	color: var(--pf-muted);
}

.perfiles-wrap .leaflet-control-attribution a { color: var(--pf-primary); }
