/**
 * Registru Membri — stiluri de frontend.
 *
 * Fără framework-uri externe. Culorile sunt expuse ca variabile, ca tema
 * să le poată suprascrie ușor.
 */

.rm-lista {
	--rm-text: #1f2328;
	--rm-muted: #6b7280;
	--rm-border: #e3e6ea;
	--rm-border-strong: #d0d5dd;
	--rm-bg: #ffffff;
	--rm-bg-soft: #f7f8fa;
	--rm-accent: #1b4965;
	--rm-accent-contrast: #ffffff;
	--rm-focus: var(--rm-accent);
	--rm-radius: 8px;

	/* Fontul și dimensiunea vin din temă; nu impunem nimic. */
	font-family: inherit;
	font-size: inherit;
	color: var(--rm-text);
	line-height: 1.5;
}

.rm-screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

/* Stare de focus vizibilă și consecventă pe toate controalele. */
.rm-lista a:focus-visible,
.rm-lista button:focus-visible,
.rm-lista input:focus-visible,
.rm-lista select:focus-visible {
	outline: 2px solid var(--rm-focus);
	outline-offset: 2px;
	border-radius: 4px;
}

.rm-lista *,
.rm-lista *::before,
.rm-lista *::after {
	box-sizing: border-box;
}

/* ---------- Filtre ---------- */

.rm-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 16px;
	margin: 0 0 18px;
	padding: 16px;
	background: var(--rm-bg-soft);
	border: 1px solid var(--rm-border);
	border-radius: var(--rm-radius);
}

.rm-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.rm-field--search {
	flex: 1 1 260px;
}

.rm-label {
	font-size: 0.82em;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: var(--rm-muted);
	margin: 0;
}

.rm-search-wrap {
	display: flex;
	gap: 8px;
}

.rm-lista input[type="search"],
.rm-lista select.rm-select {
	font: inherit;
	color: var(--rm-text);
	background: var(--rm-bg);
	border: 1px solid var(--rm-border-strong);
	border-radius: 6px;
	padding: 8px 10px;
	max-width: 100%;
	min-height: 40px;
}

.rm-lista input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
}

.rm-lista input[type="search"]:focus,
.rm-lista select.rm-select:focus {
	border-color: var(--rm-accent);
}

.rm-button {
	font: inherit;
	cursor: pointer;
	border: 1px solid var(--rm-border-strong);
	background: var(--rm-bg);
	color: var(--rm-text);
	border-radius: 6px;
	padding: 8px 14px;
	min-height: 40px;
}

.rm-button--primary {
	background: var(--rm-accent);
	border-color: var(--rm-accent);
	color: var(--rm-accent-contrast);
}

.rm-button:hover {
	filter: brightness(0.96);
}

.rm-reset {
	font-size: 0.88em;
	color: var(--rm-muted);
	align-self: center;
	text-decoration: underline;
}

/* ---------- Alfabet ---------- */

.rm-alphabet {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 0 0 16px;
}

.rm-letter {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 8px;
	border: 1px solid var(--rm-border);
	border-radius: 6px;
	background: var(--rm-bg);
	color: var(--rm-text);
	font-size: 0.88em;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.12s ease, border-color 0.12s ease;
}

a.rm-letter:hover,
a.rm-letter:focus {
	background: var(--rm-bg-soft);
	border-color: var(--rm-border-strong);
	text-decoration: none;
}

/*
 * Litera activă trebuie să fie imediat vizibilă: fundal plin, contur propriu
 * și greutate mai mare, nu doar o nuanță diferită.
 */
.rm-letter.is-active {
	background: var(--rm-accent);
	border-color: var(--rm-accent);
	color: var(--rm-accent-contrast);
	font-weight: 700;
	box-shadow: 0 0 0 2px var(--rm-bg), 0 0 0 3px var(--rm-accent);
}

a.rm-letter.is-active:hover {
	background: var(--rm-accent);
	border-color: var(--rm-accent);
}

.rm-letter.is-empty {
	color: var(--rm-muted);
	opacity: 0.45;
	cursor: default;
}

/* ---------- Sumar ---------- */

.rm-summary {
	margin: 0 0 10px;
	font-size: 0.88em;
	color: var(--rm-muted);
}

.rm-empty {
	margin: 0;
	padding: 24px;
	text-align: center;
	background: var(--rm-bg-soft);
	border: 1px dashed var(--rm-border-strong);
	border-radius: var(--rm-radius);
	color: var(--rm-muted);
}

/* ---------- Tabel ---------- */

.rm-table-wrap {
	overflow-x: auto;
	border: 1px solid var(--rm-border);
	border-radius: var(--rm-radius);
	background: var(--rm-bg);
}

.rm-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95em;
}

.rm-table th,
.rm-table td {
	padding: 10px 12px;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid var(--rm-border);
}

.rm-table thead th {
	position: sticky;
	top: 0;
	background: var(--rm-bg-soft);
	font-size: 0.82em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--rm-muted);
	white-space: nowrap;
	border-bottom: 1px solid var(--rm-border-strong);
}

.rm-table tbody tr:last-child td {
	border-bottom: 0;
}

.rm-table tbody tr:hover {
	background: var(--rm-bg-soft);
}

.rm-col--nr {
	width: 1%;
	white-space: nowrap;
	color: var(--rm-muted);
	font-variant-numeric: tabular-nums;
}

.rm-col--nume,
.rm-col--prenume {
	font-weight: 600;
}

.rm-col--data_nasterii,
.rm-col--data_deces,
.rm-col--data_primire {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.rm-profile-link {
	color: var(--rm-accent);
	text-decoration: none;
	border-bottom: 1px solid currentColor;
}

.rm-profile-link:hover {
	text-decoration: none;
	opacity: 0.8;
}

.rm-muted {
	color: var(--rm-muted);
}

.rm-row--inactiv {
	background: repeating-linear-gradient(
		-45deg,
		transparent,
		transparent 10px,
		rgba(0, 0, 0, 0.012) 10px,
		rgba(0, 0, 0, 0.012) 20px
	);
}

/* ---------- Badge ---------- */

.rm-badge {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 999px;
	font-size: 0.75em;
	font-weight: 700;
	line-height: 1.7;
	white-space: nowrap;
}

.rm-badge--da {
	background: #e6f4ea;
	color: #17603a;
}

.rm-badge--nu {
	background: #f1f2f4;
	color: #5c626b;
}

/* ---------- Paginare ---------- */

.rm-pagination {
	margin: 18px 0 0;
}

.rm-pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rm-pagination li {
	margin: 0;
}

.rm-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border: 1px solid var(--rm-border);
	border-radius: 6px;
	background: var(--rm-bg);
	color: var(--rm-text);
	font-size: 0.88em;
	text-decoration: none;
}

.rm-pagination a.page-numbers:hover {
	background: var(--rm-bg-soft);
}

.rm-pagination .page-numbers.current {
	background: var(--rm-accent);
	border-color: var(--rm-accent);
	color: var(--rm-accent-contrast);
	font-weight: 700;
}

.rm-pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
}

/* ---------- Profil ---------- */

.rm-profil {
	--rm-text: #1f2328;
	--rm-muted: #6b7280;
	--rm-border: #e3e6ea;
	--rm-bg-soft: #f7f8fa;

	font-family: inherit;
	font-size: inherit;
	margin: 0 0 24px;
	padding: 18px 20px;
	background: var(--rm-bg-soft);
	border: 1px solid var(--rm-border);
	border-radius: 8px;
}

.rm-profil__title {
	margin: 0 0 12px;
	font-size: 1.4em;
}

.rm-profil__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 12px 24px;
	margin: 0;
}

.rm-profil__item {
	margin: 0;
	min-width: 0;
}

.rm-profil__grid dt {
	margin: 0 0 2px;
	font-size: 0.75em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--rm-muted);
}

.rm-profil__grid dd {
	margin: 0;
	font-size: 1em;
	color: var(--rm-text);
	overflow-wrap: break-word;
}

.rm-notice {
	padding: 10px 14px;
	border-left: 4px solid #d0a215;
	background: #fdf7e3;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
	.rm-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.rm-table-wrap {
		overflow-x: visible;
		border: 0;
		background: transparent;
	}

	.rm-table,
	.rm-table tbody,
	.rm-table tr,
	.rm-table td {
		display: block;
		width: 100%;
	}

	.rm-table tr {
		margin: 0 0 12px;
		border: 1px solid var(--rm-border);
		border-radius: var(--rm-radius);
		background: var(--rm-bg);
		padding: 6px 4px;
	}

	.rm-table td {
		display: flex;
		gap: 12px;
		align-items: baseline;
		justify-content: space-between;
		border-bottom: 1px solid var(--rm-border);
		padding: 8px 12px;
	}

	.rm-table tr td:last-child {
		border-bottom: 0;
	}

	.rm-table td::before {
		content: attr(data-label);
		flex: 0 0 42%;
		font-size: 0.75em;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.03em;
		color: var(--rm-muted);
	}

	.rm-col--nr {
		width: auto;
	}

	.rm-filters {
		flex-direction: column;
		align-items: stretch;
	}

	.rm-field--search {
		flex: 1 1 auto;
	}
}
