/* EXTRANET - FENETRE DE RECHERCHE CREATEUR / EQUIPE DE LA PAGE DE LOGIN (mode admin) */
/* La page de login ne charge pas extranet-general-new.css : cette feuille reprend les jetons et composants du nouveau theme (champs .f-input, boutons .aur-btn, tableau .aur-table, paginator) en les limitant a la fenetre (.lsd) pour ne rien modifier du formulaire de connexion. */

/* 0. Jetons : mode sombre par defaut, mode clair via <html class="light"> */
.lsd {
	--lsd-bg: #12141f;
	--lsd-panel: rgba(255, 255, 255, .045);
	--lsd-input-bg: rgba(255, 255, 255, .075);
	--lsd-border: rgba(255, 255, 255, .09);
	--lsd-border-strong: rgba(255, 255, 255, .16);
	--lsd-input-border: 1px solid rgba(255, 255, 255, .16);
	--lsd-ink: #f2f3f9;
	--lsd-ink-dim: #9a9db8;
	--lsd-ink-faint: #7b7688;
	--lsd-accent: #ff3860;
	--lsd-accent-2: #ff5f7e;
	--lsd-accent-soft: rgba(255, 56, 96, .14);
	--lsd-row-hover: rgba(255, 255, 255, .04);
	--lsd-radius: 18px;
	--lsd-radius-field: 8px;
	--lsd-radius-btn: 8px;
	--lsd-shadow: 0 24px 60px rgba(0, 0, 0, .6);
	--lsd-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	--lsd-font-display: 'Chakra Petch', 'Inter', sans-serif;
}

html.light .lsd {
	--lsd-bg: #ffffff;
	--lsd-panel: #fbf7ff;
	--lsd-input-bg: #ffffff;
	--lsd-border: #ece2f8;
	--lsd-border-strong: #1b1526;
	--lsd-input-border: 2px solid #1b1526;
	--lsd-ink: #1b1526;
	--lsd-ink-dim: #6c6580;
	--lsd-ink-faint: #a79fbc;
	--lsd-accent: #fe2c55;
	--lsd-accent-2: #fe2c55;
	--lsd-accent-soft: #ffe3ea;
	--lsd-row-hover: #faf8fe;
	--lsd-radius: 26px;
	--lsd-radius-field: 12px;
	--lsd-radius-btn: 999px;
	--lsd-shadow: 0 24px 60px rgba(27, 21, 38, .25);
	--lsd-font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	--lsd-font-display: 'Baloo 2', 'Manrope', sans-serif;
}

/* 1. Fenetre : centree horizontalement par showDialogAdm(), hauteur limitee a l'ecran avec defilement interne */
.lsd {
	position: absolute;
	z-index: 99999;
	width: 880px;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 32px);
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	overflow: hidden;
	background-color: var(--lsd-bg);
	border: 1px solid var(--lsd-border);
	border-radius: var(--lsd-radius);
	box-shadow: var(--lsd-shadow);
	font-family: var(--lsd-font);
	font-size: 13px;
	color: var(--lsd-ink);
	text-align: left;
}

html.light .lsd {
	border: 2px solid var(--lsd-ink);
}

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

/* Voile derriere la fenetre (le fond de page reste visible mais attenue) */
.lsd-backdrop {
	position: fixed;
	inset: 0;
	z-index: 99998;
	background-color: rgba(5, 6, 12, .6);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}

html.light .lsd-backdrop {
	background-color: rgba(27, 21, 38, .35);
}

.lsd-inner {
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1 1 auto;
}

/* 2. En-tete : titre a gauche, bouton de fermeture a droite */
.lsd-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 20px 24px;
	border-bottom: 1px solid var(--lsd-border);
	flex: none;
}

.lsd-head-text {
	flex: 1;
	min-width: 0;
}

.lsd-eyebrow {
	margin-bottom: 4px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--lsd-accent);
}

.lsd-title {
	margin: 0;
	font-family: var(--lsd-font-display);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--lsd-ink);
}

.lsd-close,
.lsd-close:visited {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 36px;
	height: 36px;
	border: 1px solid var(--lsd-border-strong);
	border-radius: 10px;
	background-color: var(--lsd-input-bg);
	color: var(--lsd-ink);
	font-size: 18px;
	text-decoration: none;
	transition: background-color .12s ease, color .12s ease;
}

.lsd-close:hover,
.lsd-close:focus {
	background-color: var(--lsd-accent-soft);
	border-color: var(--lsd-accent);
	color: var(--lsd-accent);
	text-decoration: none;
}

/* 3. Corps : seule zone qui defile */
.lsd-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 20px 24px 24px;
}

/* Messages JSF eventuels */
.lsd-messages {
	margin: 0 0 16px;
	padding: 10px 14px;
	list-style: none;
	border-radius: var(--lsd-radius-field);
	background-color: var(--lsd-accent-soft);
	color: var(--lsd-accent);
	font-size: 12.5px;
}

.lsd-messages:empty {
	display: none;
}

/* Barre de bascule de mode / connexion directe */
.lsd-modes {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--lsd-border);
}

.lsd-intro {
	margin: 0 0 16px;
	color: var(--lsd-ink-dim);
	font-size: 13px;
}

/* 4. Filtres : grille de champs, libelle au-dessus */
.lsd-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 14px 16px;
}

.lsd-field {
	min-width: 0;
}

.lsd-label {
	display: block;
	margin-bottom: 6px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--lsd-ink-faint);
}

/* Les regles globales (input[type=text], select) d'extranet-general.css sont neutralisees */
.lsd input.lsd-input,
.lsd select.lsd-input {
	display: block;
	width: 100%;
	height: 40px;
	margin: 0;
	padding: 0 12px;
	border: var(--lsd-input-border);
	border-radius: var(--lsd-radius-field);
	background-color: var(--lsd-input-bg);
	color: var(--lsd-ink);
	font-family: inherit;
	font-size: 13px;
	line-height: 1.25;
	box-shadow: none;
	outline: none;
	transition: border-color .12s ease, box-shadow .12s ease;
}

.lsd select.lsd-input {
	padding-right: 34px;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%239a9db8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 14px 14px;
	cursor: pointer;
}

.lsd input.lsd-input::placeholder {
	color: var(--lsd-ink-faint);
}

.lsd input.lsd-input:focus,
.lsd select.lsd-input:focus {
	border-color: var(--lsd-accent);
	box-shadow: 0 0 0 3px var(--lsd-accent-soft);
}

.lsd input.lsd-input:disabled,
.lsd select.lsd-input:disabled {
	opacity: .55;
	cursor: not-allowed;
}

/* Options des listes : fond opaque et texte lisibles dans les deux modes */
.lsd select option {
	background-color: var(--lsd-bg);
	color: var(--lsd-ink);
}

/* 5. Boutons (memes rendus que .aur-btn-primary / .aur-btn-ghost) */
.lsd-actions {
	display: flex;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 18px;
}

.lsd input.lsd-btn,
.lsd button.lsd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	height: auto;
	min-height: 38px;
	margin: 0;
	padding: 10px 18px;
	border-radius: var(--lsd-radius-btn);
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: .2px;
	text-transform: none;
	cursor: pointer;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	box-shadow: none;
	text-shadow: none;
	filter: none;
	transition: transform .12s ease, background-color .12s ease, border-color .12s ease;
}

.lsd input.lsd-btn:hover,
.lsd button.lsd-btn:hover {
	transform: translateY(-1px);
}

.lsd .lsd-btn-primary {
	background: linear-gradient(135deg, var(--lsd-accent), var(--lsd-accent-2));
	border: 1px solid var(--lsd-accent);
	color: #ffffff;
}

.lsd .lsd-btn-ghost {
	background: var(--lsd-input-bg);
	border: 1px solid var(--lsd-border-strong);
	color: var(--lsd-ink);
}

html.light .lsd .lsd-btn-ghost {
	border-color: var(--lsd-ink);
}

.lsd .lsd-btn-ghost:hover {
	border-color: var(--lsd-accent);
	color: var(--lsd-accent);
}

/* Bouton de connexion dans le tableau : plus compact */
.lsd input.lsd-btn-sm {
	min-height: 32px;
	padding: 8px 14px;
	font-size: 12px;
}

/* 6. Resultats */
.lsd-results {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--lsd-border);
}

.lsd-empty {
	padding: 22px 16px;
	border: 1px dashed var(--lsd-border-strong);
	border-radius: var(--lsd-radius-field);
	background-color: var(--lsd-panel);
	color: var(--lsd-ink-dim);
	text-align: center;
}

html.light .lsd-empty {
	border-color: var(--lsd-border);
}

/* Tableau plat (comme .aur-table) */
.lsd-table {
	width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
	margin: 0;
	background: transparent;
}

.lsd-table th {
	padding: 0 10px 10px;
	border: 0;
	border-bottom: 1px solid var(--lsd-border-strong);
	background: none;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 1.1px;
	text-transform: uppercase;
	color: var(--lsd-ink-faint);
	text-align: left;
	vertical-align: bottom;
	white-space: nowrap;
}

html.light .lsd-table th {
	border-bottom-width: 2px;
}

.lsd-table td {
	padding: 12px 10px;
	border: 0;
	border-bottom: 1px solid var(--lsd-border);
	background: transparent;
	color: var(--lsd-ink-dim);
	vertical-align: middle;
	text-align: left;
	overflow-wrap: anywhere;
}

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

.lsd-table th:first-child,
.lsd-table td:first-child {
	padding-left: 4px;
}

.lsd-table th:last-child,
.lsd-table td:last-child {
	padding-right: 4px;
	text-align: right;
}

.lsd-table tbody tr {
	transition: background-color .12s ease;
}

.lsd-table tbody tr:hover td {
	background-color: var(--lsd-row-hover);
}

.lsd-table a,
.lsd-table a:visited {
	color: var(--lsd-ink-dim);
	text-decoration: underline;
	text-decoration-color: var(--lsd-border-strong);
	text-underline-offset: 2px;
}

.lsd-table a:hover {
	color: var(--lsd-accent);
}

/* Cellule "nom" : avatar + libelle renforce */
.lsd-person {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--lsd-ink);
	font-weight: 600;
}

.lsd-person img,
.lsd-avatar {
	flex: none;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	object-fit: cover;
}

.lsd-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--lsd-accent), #8a63ff);
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
}

.lsd-strong {
	color: var(--lsd-ink);
	font-weight: 600;
}

.lsd-sub {
	display: block;
	margin-top: 2px;
	font-size: 12px;
}

/* Lien TikTok : @compte + logo */
.lsd-tiktok,
.lsd-tiktok:visited {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-decoration: none !important;
}

.lsd-tiktok .logo-tiktok-login {
	width: 18px;
	height: 18px;
	border-radius: 4px;
}

/* 7. Paginator (fragment partage : p.paginator) */
.lsd p.paginator {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
	margin: 18px 0 0;
}

.lsd p.paginator input {
	float: none;
	width: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--lsd-border-strong);
	border-radius: 10px;
	background-color: var(--lsd-input-bg);
	background-position: center center;
	color: var(--lsd-ink);
	font-family: inherit;
	font-weight: 600;
	cursor: pointer;
}

html.light .lsd p.paginator input {
	border: 1.5px solid var(--lsd-border);
}

.lsd p.paginator input:hover {
	border-color: var(--lsd-accent);
}

.lsd p.paginator input.current {
	background-color: var(--lsd-accent-soft);
	border-color: var(--lsd-accent);
	color: var(--lsd-accent);
	cursor: default;
}

/* Ordre du DOM : first, previous, pages..., last, next */
.lsd p.paginator input.next {
	order: 1;
}

.lsd p.paginator input.last {
	order: 2;
}

.lsd p.paginator input.first,
.lsd p.paginator input.previous,
.lsd p.paginator input.next,
.lsd p.paginator input.last {
	background-repeat: no-repeat !important;
	background-position: center center !important;
	background-size: 13px 13px !important;
}

.lsd p.paginator input.first {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23f5f3f8' d='M19 5.5v13L9.5 12zM5 5.5h2.2v13H5z'/%3E%3C/svg%3E") !important;
}

.lsd p.paginator input.previous {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23f5f3f8' d='M15.5 5.5v13L6 12z'/%3E%3C/svg%3E") !important;
}

.lsd p.paginator input.next {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23f5f3f8' d='M8.5 5.5v13L18 12z'/%3E%3C/svg%3E") !important;
}

.lsd p.paginator input.last {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23f5f3f8' d='M5 5.5v13L14.5 12zM16.8 5.5H19v13h-2.2z'/%3E%3C/svg%3E") !important;
}

html.light .lsd p.paginator input.first {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2317151f' d='M19 5.5v13L9.5 12zM5 5.5h2.2v13H5z'/%3E%3C/svg%3E") !important;
}

html.light .lsd p.paginator input.previous {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2317151f' d='M15.5 5.5v13L6 12z'/%3E%3C/svg%3E") !important;
}

html.light .lsd p.paginator input.next {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2317151f' d='M8.5 5.5v13L18 12z'/%3E%3C/svg%3E") !important;
}

html.light .lsd p.paginator input.last {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2317151f' d='M5 5.5v13L14.5 12zM16.8 5.5H19v13h-2.2z'/%3E%3C/svg%3E") !important;
}

/* 8. Mobile */
@media (max-width: 600px) {
	.lsd {
		max-width: calc(100vw - 16px);
		border-radius: 14px;
	}

	.lsd-head,
	.lsd-body {
		padding-left: 16px;
		padding-right: 16px;
	}

	.lsd-title {
		font-size: 18px;
	}

	.lsd-grid {
		grid-template-columns: 1fr;
	}

	.lsd-actions input.lsd-btn,
	.lsd-modes input.lsd-btn {
		flex: 1 1 auto;
	}
}
