/* ── Style du back-office Bové ────────────────────────────────────────────────
   Reprise de la charte du back-office `bove-materiel` (assets/styles/admin.scss
   + _variables.scss), compilée à la main : ici pas de build npm (Node 18 EOL),
   les feuilles sont écrites directement en CSS.
   Chargée en dernier : c'est elle qui fixe les variables --tblr-*. */

/* ── Palette Bové (alias sémantiques de _variables.scss) ──────────────────── */
:root {
	--bove-blue: #3471dc;
	--bove-green: #60993e;
	--bove-orange: #e67f0d;
	--bove-red: #af1b3f;
	--bove-gray: #acacac;
	--bove-dark-gray: #8e8e8e;
	--bove-black: #332f30;

	--tblr-primary: var(--bove-blue);
	--tblr-primary-rgb: 52, 113, 220;
	--tblr-success: var(--bove-green);
	--tblr-success-rgb: 96, 153, 62;
	--tblr-warning: var(--bove-orange);
	--tblr-warning-rgb: 230, 127, 13;
	--tblr-danger: var(--bove-red);
	--tblr-danger-rgb: 175, 27, 63;
	--tblr-link-color: var(--bove-blue);
	--tblr-link-hover-color: #2a5cb4;
}

/* La barre latérale est la seule zone sombre du back-office (data-bs-theme="dark"
   posé sur l'<aside>) ; le reste de l'application n'a qu'un thème : clair. */

.btn-primary,
.btn-check:checked + .btn-primary {
	--tblr-btn-bg: var(--bove-blue);
	--tblr-btn-border-color: var(--bove-blue);
	--tblr-btn-hover-bg: #2a5cb4;
	--tblr-btn-hover-border-color: #2a5cb4;
	--tblr-btn-active-bg: #244e9a;
	--tblr-btn-active-border-color: #244e9a;
}

.btn-outline-primary {
	--tblr-btn-color: var(--bove-blue);
	--tblr-btn-border-color: var(--bove-blue);
	--tblr-btn-hover-bg: var(--bove-blue);
	--tblr-btn-hover-border-color: var(--bove-blue);
}

.text-primary { color: var(--bove-blue) !important; }
.bg-primary { background-color: var(--bove-blue) !important; }

/* Pastilles d'état, reprises de $label*Background / $label*Color. */
.badge.bg-success-lt, .status-success {
	background: #f0fdf4;
	color: #166534;
}
.badge.bg-warning-lt, .status-warning {
	background: #fff7ed;
	color: #9a3412;
}
.badge.bg-danger-lt, .status-danger {
	background: #fef2f2;
	color: #991b1b;
}
.badge.bg-secondary-lt {
	background: #f8fafc;
	color: #334155;
}
.badge.bg-info-lt, .badge.bg-blue-lt {
	background: #eff6ff;
	color: #1e40af;
}

/* ── Coquille d'administration ───────────────────────────────────────────── */
.admin-shell .navbar-brand {
	min-height: 3.5rem;
}

.admin-shell .admin-brand-logo {
	display: block;
	width: auto;
	height: 2.75rem;
}

/* « RH » à côté du logo, toujours en bleu Bové : image séparée, que le filtre
   ci-dessous (logo blanc sur la barre sombre) ne touche pas. */
.admin-shell .admin-brand {
	display: inline-flex;
	align-items: flex-end;
}

.admin-shell .admin-brand-rh {
	display: block;
	width: auto;
	height: 2.75rem;
	margin-left: .35rem;
}

/* La barre latérale est toujours sombre : le logo passe en blanc. */
.admin-shell .navbar-vertical .admin-brand-logo {
	filter: brightness(0) invert(1);
}

.admin-shell .table-responsive {
	min-height: 0;
}

/* Bande d'en-tête de page (fil d'ariane + titre) — $pageHeadingBackground. */
.admin-shell .page-header {
	background: radial-gradient(ellipse 40% 130% at right bottom, #d7dbe0, rgb(215 219 224 / 0)), #ebebea;
	border-bottom: 1px solid var(--tblr-border-color);
	margin-top: 0;
	padding: 1.25rem 0;
}

.admin-shell .page-body {
	margin-top: 1.5rem;
}

.card-footer {
	background-color: var(--tblr-card-bg, var(--tblr-bg-surface));
}

.admin-user-email {
	max-width: 18rem;
	overflow-wrap: anywhere;
}

.admin-role-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
}

/* ── Entrée de menu « lien + chevron » ───────────────────────────────────── */
.admin-nav-link-split {
	padding-right: 0;
}

.admin-nav-link-split__main {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}

.admin-nav-link-split__main:hover,
.admin-nav-link-split__main:focus {
	color: inherit;
	text-decoration: none;
}

.admin-nav-link-split .nav-link-toggle {
	flex: 0 0 auto;
	color: inherit;
}

/* ── En-tête horizontal ──────────────────────────────────────────────────── */
.admin-header {
	display: flex;
	flex-direction: column;
	width: 100%;
	padding-top: 0.25rem;
	padding-bottom: 0.5rem;
}

.admin-header__top {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	width: 100%;
	min-height: 2.5rem;
}

@media (max-width: 767.98px) {
	.admin-header {
		padding-bottom: 0.75rem;
	}
}

/* ── Recherche globale ───────────────────────────────────────────────────── */
.admin-global-search {
	position: relative;
	align-items: center;
	max-width: 32rem;
	min-width: 0;
}

.admin-global-search--mobile {
	width: 100%;
	max-width: none;
	padding-top: 0.5rem;
}

.admin-global-search--mobile .admin-global-search__input {
	padding-right: 0.75rem;
}

.admin-global-search__field {
	position: relative;
	width: 100%;
}

.admin-global-search__icon {
	position: absolute;
	top: 50%;
	left: 0.65rem;
	z-index: 1;
	color: var(--tblr-muted);
	pointer-events: none;
	transform: translateY(-50%);
}

.admin-global-search__input {
	padding-left: 2.25rem;
	padding-right: 4.5rem;
}

.admin-global-search__kbd {
	position: absolute;
	top: 50%;
	right: 0.5rem;
	z-index: 1;
	padding: 0.1rem 0.35rem;
	border: 1px solid var(--tblr-border-color);
	border-radius: var(--tblr-border-radius-sm);
	background: var(--tblr-bg-surface-secondary);
	color: var(--tblr-muted);
	font-size: 0.7rem;
	line-height: 1.2;
	pointer-events: none;
	transform: translateY(-50%);
}

.admin-global-search__panel {
	position: absolute;
	top: calc(100% + 0.35rem);
	right: 0;
	left: 0;
	z-index: 1050;
	overflow: auto;
	max-height: min(24rem, 70vh);
	padding: 0.35rem 0;
	border: 1px solid var(--tblr-border-color);
	border-radius: var(--tblr-border-radius);
	background: var(--tblr-bg-surface, #fff);
	box-shadow: var(--tblr-box-shadow-dropdown);
}

.admin-global-search__hint {
	padding: 0.75rem 1rem;
	color: var(--tblr-muted);
	font-size: 0.875rem;
}

.admin-global-search__loading {
	font-style: italic;
}

.admin-global-search__group-label {
	padding: 0.35rem 1rem 0.15rem;
	color: var(--tblr-muted);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.admin-global-search__item {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	padding: 0.5rem 1rem;
	color: inherit;
	text-decoration: none;
}

.admin-global-search__item:hover,
.admin-global-search__item.is-active {
	background: var(--tblr-bg-surface-secondary);
	color: inherit;
	text-decoration: none;
}

.admin-global-search__item-icon {
	flex: 0 0 auto;
	color: var(--tblr-muted);
	line-height: 1.4;
}

.admin-global-search__item-body {
	display: flex;
	min-width: 0;
	flex-direction: column;
}

.admin-global-search__item-label {
	overflow: hidden;
	font-size: 0.875rem;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.admin-global-search__item-subtitle {
	overflow: hidden;
	color: var(--tblr-muted);
	font-size: 0.75rem;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.admin-shell .page-wrapper > .navbar .admin-header__top > .admin-global-search {
	flex: 1;
	min-width: 0;
	max-width: none;
}

/* ── Contenus rich text rendus dans le back-office ───────────────────────── */
.admin-wysiwyg > * + * {
	margin-top: 0.75rem;
}

.admin-wysiwyg p,
.admin-wysiwyg div {
	margin-bottom: 0;
}

.admin-wysiwyg p > strong:only-child {
	display: block;
	font-weight: 600;
	color: var(--tblr-body-color);
}

.admin-wysiwyg ul {
	padding-left: 1.25rem;
	list-style: disc;
}

.admin-wysiwyg ol {
	padding-left: 1.25rem;
	list-style: decimal;
}

.admin-wysiwyg li {
	margin: 0.25rem 0;
}

.admin-wysiwyg blockquote {
	padding-left: 1rem;
	color: var(--tblr-secondary);
	border-left: 2px solid var(--tblr-border-color);
}

/* ── Page d'authentification ─────────────────────────────────────────────── */
.page-auth-logo {
	width: min(220px, 70vw);
	height: auto;
}

/* ── Bascule de compte (« Changer de compte », super admin) ──────────────── */
.admin-switch-user__menu {
	width: min(22rem, calc(100vw - 2rem));
	padding-bottom: 0.25rem;
}

.admin-switch-user__results {
	overflow-y: auto;
	max-height: min(18rem, 50vh);
}

.admin-switch-user__item {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	white-space: normal;
}

.admin-switch-user__item-label {
	font-size: 0.875rem;
	font-weight: 500;
	overflow-wrap: anywhere;
}

.admin-switch-user__item-subtitle {
	color: var(--tblr-muted);
	font-size: 0.75rem;
	overflow-wrap: anywhere;
}

.admin-switch-user__hint {
	padding: 0.75rem 1rem;
	color: var(--tblr-muted);
	font-size: 0.875rem;
}

.admin-switch-user__hint--loading {
	font-style: italic;
}

/* ── Alertes ──────────────────────────────────────────────────────────────── */
/* Tabler 1.x pose `.alert { display: flex; gap: 1rem }` et attend un balisage
   `.alert-icon` + `<div>`. Nos alertes écrivent du texte courant (icône, <strong>,
   <code>, titre) directement dans le bloc : en flex, chaque élément devenait une
   colonne et le texte se cassait. On revient au flux normal ; les alertes qui
   veulent une ligne flexible le demandent explicitement (`d-flex`, prioritaire). */
.alert {
	display: block;
}
