@media (min-width: 576px) {
	.navbar-vertical.navbar-expand-sm .navbar-nav {
		flex-grow: 0;
	}
}

/* ── Utilitaires partagés (ex-styles inline) ──────────────────────────────── */
/* État masqué togglé par JS — !important pour résister à un style.display='' ;
   rag.js / playground.js ajoutent/retirent cette classe (plus de style.display). */
.is-hidden {
	display: none !important;
}
/* Autorise le text-truncate d'un enfant dans un conteneur flex. */
.min-w-0 {
	min-width: 0;
}
.tnum {
	font-variant-numeric: tabular-nums;
}
.pre-wrap {
	white-space: pre-wrap;
}

/* ── Réglages ponctuels par page (trop courts pour un fichier dédié) ──────── */
.dash-chart {
	min-height: 260px;
} /* dashboard : conteneur ApexCharts */
.dash-qbar {
	height: 4px;
} /* dashboard : barre « Top questions » */
.user-checkbox-list {
	max-height: 320px;
} /* access_rag/edit : liste scrollable */
/* Aperçu widget : accent par défaut (surchargé dynamiquement par widget-preview.js). */
.s4wpv {
	--s4-accent: #3b82f6;
}

/* ── SweetAlert2 : popup aligne sur le theme Tabler ───────────────────────── */
.swal2-popup.swal-tabler {
	background: var(--tblr-bg-surface);
	color: var(--tblr-body-color);
	border: 1px solid var(--tblr-border-color);
	border-radius: var(--tblr-border-radius, 0.5rem);
}
.swal2-popup.swal-tabler .swal2-title,
.swal2-popup.swal-tabler .swal2-html-container {
	color: var(--tblr-body-color);
}
.swal2-popup.swal-tabler .swal2-actions {
	gap: 0.5rem;
}

/* ── Tom Select : aligne sur le theme Tabler ──────────────────────────────── */
/* Le theme bootstrap5 lit des variables --bs-* absentes de Tabler (qui n'expose
   que --tblr-*) ET code en dur la couleur du texte (color:#343a40). style.css est
   chargee APRES le theme : a specificite egale, ces regles l'emportent. On alias
   les --bs-* utiles (fond/bordure/rayon) et on force les couleurs sur les
   variables Tabler, pour coller au rendu des <select> natifs. */
.ts-wrapper,
.ts-dropdown {
	--bs-body-bg: var(--tblr-bg-surface);
	--bs-border-color: var(--tblr-border-color);
	--bs-border-color-translucent: var(
		--tblr-border-color-translucent,
		var(--tblr-border-color)
	);
	--bs-secondary-bg: var(--tblr-bg-surface-secondary, var(--tblr-bg-surface));
	--bs-tertiary-bg: var(--tblr-bg-surface-secondary, var(--tblr-bg-surface));
	--bs-border-radius: var(--tblr-border-radius, 0.375rem);
}
/* Controle : meme fond/bordure qu'un <select> natif Tabler. */
.ts-wrapper .ts-control {
	background-color: var(--tblr-bg-forms, #fff);
	border-color: var(--tblr-border-color);
}
/* Couleur du texte (surcharge le color:#343a40 code en dur du theme). */
.ts-control,
.ts-control input,
.ts-control .item,
.ts-dropdown,
.ts-dropdown .option {
	color: var(--tblr-body-color);
}
.ts-control input::placeholder {
	color: var(--tblr-secondary, #6c757d);
}
/* Menu : fond surface Tabler. */
.ts-dropdown {
	background-color: var(--tblr-bg-surface);
	border-color: var(--tblr-border-color);
}
/* Option survolee / active : surbrillance primaire, texte lisible. */
.ts-dropdown .option.active,
.ts-dropdown .option:hover,
.ts-dropdown .active {
	background-color: var(--tblr-primary);
	color: #fff;
}
/* Petite taille : suit form-select-sm (la classe est recopiee sur .ts-wrapper). */
.ts-wrapper.form-select-sm .ts-control {
	min-height: calc(1.5em + 0.5rem + 2px);
	padding: 0.25rem 0.5rem;
	font-size: 0.875rem;
}

.card-header .card-subtitle {
	margin-left: 15px;
}

.card {
	--tblr-card-spacer-y: 0.5rem;
	--tblr-card-spacer-x: 0.75rem;
	--tblr-card-cap-padding-y: 0.5rem;
	--tblr-card-cap-padding-x: 0.75rem;
}

@media (min-width: 1700px) {
	.container-xxl {
		max-width: 1620px;
	}
}

/* Indicateurs cliquables : chacun pilote la courbe centrale (cf. dashboard.js).
   L'indicateur sélectionné porte .active (Conversations par défaut). */
.indicator-row {
	cursor: pointer;
	border-left: 3px solid transparent;
	transition: background-color .12s ease, border-color .12s ease;
}
.indicator-row:hover { background-color: rgba(0, 0, 0, .03); }
.indicator-row.active {
	border-left-color: var(--tblr-primary, #066fd1);
	background-color: rgba(0, 0, 0, .05);
}
.indicator-row:focus-visible { outline: 2px solid var(--tblr-primary, #066fd1); outline-offset: -2px; }

/* Impression (export PDF du tableau de bord via le navigateur) : on retire le
   chrome applicatif (sidebar/pied/boutons déjà en .d-print-none) et on force
   fonds blancs / texte foncé pour un rendu lisible sur papier. */
@media print {
	html, body { background: #fff !important; color: #1a1d22 !important; }
	.navbar-vertical, .footer, .navbar-toggler { display: none !important; }
	.page-wrapper { margin: 0 !important; }
	.page-body { margin-top: 0 !important; }
	.card { background: #fff !important; color: #1a1d22 !important;
	        border: 1px solid #d0d5dd !important; box-shadow: none !important; break-inside: avoid; }
	.card-header, .card-body { background: #fff !important; }
	h1, h2, h3, .card-title, .h1 { color: #1a1d22 !important; }
	.text-secondary, .text-muted, .small { color: #5a6472 !important; }
	a { color: inherit !important; text-decoration: none !important; }
	/* Graphiques ApexCharts : libellés/grille forcés en sombre (sinon blancs sur blanc). */
	.apexcharts-text, .apexcharts-text tspan { fill: #4a5568 !important; }
	.apexcharts-gridline, .apexcharts-grid line { stroke: rgba(0,0,0,.12) !important; }
	@page { margin: 14mm; }
}

/* ── Dropzone fichier (champ image, file-dropzone.js) ─────────────────────── */
.s4-dropzone {
	position: relative;
	border: 1.5px dashed var(--tblr-border-color, #4b5563);
	border-radius: var(--tblr-border-radius-lg, .5rem);
	background-color: rgba(255, 255, 255, .02);
	transition: border-color .15s ease, background-color .15s ease;
}
.s4-dropzone.is-dragover {
	border-color: var(--tblr-primary, #066fd1);
	background-color: rgba(var(--tblr-primary-rgb, 6, 111, 209), .08);
}
/* Input natif retiré du flux mais focusable (accessibilité clavier). */
.s4-dropzone-input {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}
/* Invite : cible de clic tant qu'aucun fichier n'est choisi. */
.s4-dropzone-prompt {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: .15rem;
	margin: 0;
	padding: 2rem 1rem;
	text-align: center;
	cursor: pointer;
	color: var(--tblr-secondary, #6c7a91);
}
.s4-dropzone-icon {
	margin-bottom: .25rem;
	font-size: 2rem;
	line-height: 1;
	color: var(--tblr-primary, #066fd1);
}
.s4-dropzone-title { font-weight: 600; color: var(--tblr-body-color); }
.s4-dropzone-sub { font-size: .8125rem; }
/* Focus clavier sur l'input → halo sur l'invite. */
.s4-dropzone-input:focus-visible + .s4-dropzone-prompt {
	outline: 2px solid var(--tblr-primary, #066fd1);
	outline-offset: -2px;
	border-radius: inherit;
}
/* Aperçu de l'image (existante ou nouvellement choisie). */
.s4-dropzone-preview {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .75rem;
}
.s4-dropzone-preview img {
	flex: 0 0 auto;
	width: 64px; height: 64px;
	object-fit: cover;
	border-radius: var(--tblr-border-radius, .375rem);
	cursor: pointer;
}
.s4-dropzone-name {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	color: var(--tblr-body-color);
}

/* Cases à cocher des catégories (actualités / événements). Le thème de formulaire
   par défaut rend des paires input + label brutes : on les présente en « chips »
   alignées, lisibles en thème sombre comme clair. */
.category-checks {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}
.category-checks:empty::before {
	content: "Aucune catégorie pour l'instant.";
	color: var(--tblr-secondary, #888);
	font-size: .875rem;
}
.category-checks input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}
.category-checks label {
	display: inline-flex;
	align-items: center;
	gap: .375rem;
	margin: 0;
	padding: .25rem .625rem;
	border: 1px solid var(--tblr-border-color, #2b3648);
	border-radius: 999px;
	cursor: pointer;
	user-select: none;
	line-height: 1.4;
	transition: background-color .12s, border-color .12s, color .12s;
}
.category-checks label:hover {
	border-color: var(--tblr-primary, #066fd1);
}
.category-checks input[type="checkbox"]:checked + label {
	background-color: var(--tblr-primary, #066fd1);
	border-color: var(--tblr-primary, #066fd1);
	color: #fff;
}
.category-checks input[type="checkbox"]:focus-visible + label {
	outline: 2px solid var(--tblr-primary, #066fd1);
	outline-offset: 2px;
}
