body.azl-app .azl-app__shell {
	display: grid;
	grid-template-columns: var(--azl-layout-sidebar-width, 238px) minmax(0, 1fr);
	grid-template-rows: 1fr;
	align-items: stretch;
	min-height: 100vh;
	position: relative;
}

/*
 * Réserve la colonne gauche même si la sidebar est position:fixed
 * (sinon le main tombe en col 1 et passe sous la barre).
 */
body.azl-app .azl-app__shell::before {
	content: "";
	grid-column: 1;
	grid-row: 1;
	width: var(--azl-layout-sidebar-width, 238px);
	pointer-events: none;
}

body.azl-app .azl-app__overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgb(15 23 42 / 0.35);
	z-index: var(--azl-z-overlay);
}

body.azl-app .azl-main {
	grid-column: 2;
	width: 100%;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

body.azl-app {
	background: var(--azl-bg);
	color: var(--azl-text);
}

body.azl-app .azl-dashboard {
	padding: 0 var(--azl-layout-page-padding-x) 60px;
	align-items: start;
	width: 100%;
	box-sizing: border-box;
	gap: 20px;
}

/* Accueil maquette s1 : colonne unique + grille fil|widgets */
body.azl-app .azl-dashboard--s1 {
	display: flex;
	flex-direction: column;
}

body.azl-app .azl-dashboard--s1 .azl-dashboard__primary {
	width: 100%;
}

body.azl-app .azl-dashboard__cols {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--azl-layout-widgets-width);
	gap: 20px;
	align-items: start;
	width: 100%;
}

/* Accueil backup v1 : grille classique 2 colonnes */
body.azl-app .azl-dashboard--legacy {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--azl-layout-widgets-width);
}

@media (max-width: 1150px) {
	body.azl-app .azl-dashboard__cols,
	body.azl-app .azl-dashboard--legacy {
		grid-template-columns: 1fr;
	}

	body.azl-app .azl-dashboard__widgets {
		position: static;
	}
}

body.azl-app .azl-dashboard__primary {
	min-width: 0;
	display: flex;
	flex-direction: column;
	overflow: visible;
}

body.azl-app .azl-dashboard__main {
	width: 100%;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 20px;
	overflow: visible;
}

body.azl-app .azl-dashboard__widgets {
	position: sticky;
	top: var(--azl-space-6);
	height: fit-content;
	display: flex;
	flex-direction: column;
	gap: var(--azl-space-4);
}

body.azl-app .azl-section,
body.azl-app .azl-widget {
	background: var(--azl-neutral-0);
	border: 1px solid var(--azl-line);
	border-radius: var(--azl-radius-xl);
	padding: 22px;
	box-shadow: none;
}

body.azl-app .azl-footer {
	margin-top: auto;
	padding: var(--azl-space-6) var(--azl-layout-page-padding-x);
	border-top: 1px solid var(--azl-neutral-200);
	color: var(--azl-neutral-600);
	font-size: var(--azl-text-sm);
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: var(--azl-space-4);
}

body.azl-app .azl-footer__copyright {
	margin: 0;
	justify-self: start;
}

body.azl-app .azl-footer__menu {
	justify-self: center;
	grid-column: 2;
}

body.azl-app .azl-footer__spacer {
	grid-column: 3;
}

body.azl-app .azl-footer-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--azl-space-4);
}

body.azl-app .azl-footer-menu a {
	color: var(--azl-neutral-600);
	font-size: var(--azl-text-sm);
}

body.azl-app .azl-footer-menu a:hover {
	color: var(--azl-primary-600);
}

/* « Retour en haut » — fond teal AZL */
#ast-scroll-top {
	background-color: var(--azl-primary-500) !important;
	color: #fff !important;
	border-radius: 10px !important;
}

#ast-scroll-top:hover,
#ast-scroll-top:focus {
	background-color: var(--azl-primary-600) !important;
	color: #fff !important;
}

#ast-scroll-top .ast-icon.icon-arrow svg {
	fill: currentColor !important;
}

/* Portail headless : Astra n’injecte ni CSS ni JS → bouton autonome */
body.azl-portal #ast-scroll-top {
	display: none;
	position: fixed;
	right: 30px;
	bottom: 30px;
	z-index: 999;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: none;
	cursor: pointer;
	box-shadow: none;
	line-height: 1;
	outline: none;
}

body.azl-portal #ast-scroll-top .ast-icon.icon-arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}

body.azl-portal #ast-scroll-top .ast-icon.icon-arrow svg {
	display: block;
	fill: none !important;
	stroke: currentColor !important;
	transform: none;
}

@media (max-width: 1279px) {
	body.azl-app .azl-dashboard {
		grid-template-columns: minmax(0, 1fr);
	}

	body.azl-app .azl-dashboard__widgets {
		position: static;
	}
}

@media (max-width: 1023px) {
	body.azl-app .azl-app__shell {
		grid-template-columns: minmax(0, 1fr);
	}

	body.azl-app .azl-app__shell::before {
		display: none;
	}

	body.azl-app .azl-main {
		grid-column: 1;
	}
}

@media (max-width: 767px) {
	body.azl-app .azl-dashboard {
		padding: var(--azl-space-4);
		gap: var(--azl-space-4);
	}

	body.azl-app .azl-footer {
		padding: var(--azl-space-4);
	}

	body.azl-app.azl-sidebar-open .azl-app__overlay {
		display: block;
	}
}
