/*
 * Structure générale de l'application : barre du haut, menu latéral, contenu.
 * Remplace le "container-fluid / #wrapper / #menu / #content" de l'ancien thème.
 */

.app-shell {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* --- Barre du haut --- */

.app-topbar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: var(--ag-topbar-height);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--ag-space-4);
	padding: 0 var(--ag-space-5);
	background: var(--ag-color-surface);
	border-bottom: 1px solid var(--ag-color-border);
	box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
	z-index: var(--ag-z-topbar);
}

.app-topbar__brand {
	display: flex;
	align-items: center;
	gap: var(--ag-space-3);
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ag-topbar-logo {
	display: block;
	height: 32px;
	width: auto;
	flex-shrink: 0;
}

.ag-brand-societe {
	font-weight: var(--ag-font-weight-semibold);
	font-size: var(--ag-font-size-lg);
	color: var(--ag-color-text);
	overflow: hidden;
	text-overflow: ellipsis;
	padding-left: var(--ag-space-3);
	border-left: 1px solid var(--ag-color-border);
}

.app-topbar__menu-toggle {
	display: none;
	padding: var(--ag-space-2);
	border-radius: var(--ag-radius-sm);
	color: var(--ag-color-text);
}

.app-topbar__actions {
	display: flex;
	align-items: center;
	gap: var(--ag-space-2);
	flex-shrink: 0;
}

/* --- Menu latéral --- */

.app-sidebar {
	position: fixed;
	top: var(--ag-topbar-height);
	left: 0;
	bottom: 0;
	width: var(--ag-sidebar-width);
	background: var(--ag-color-surface);
	border-right: 1px solid var(--ag-color-border);
	z-index: var(--ag-z-sidebar);
	overflow: hidden;
}

.app-sidebar__scroll {
	height: 100%;
	overflow-y: auto;
	padding: var(--ag-space-4) var(--ag-space-3) var(--ag-space-7);
}

/* --- Zone de contenu --- */

.app-content {
	flex: 1 0 auto;
	margin-left: var(--ag-sidebar-width);
	padding-top: var(--ag-topbar-height);
}

.app-content__inner {
	width: 100%;
	padding: var(--ag-space-6);
}

/* --- Fil d'ariane --- */

.app-breadcrumb {
	display: flex;
	align-items: center;
	gap: var(--ag-space-2);
	color: var(--ag-color-text-muted);
	font-size: var(--ag-font-size-sm);
	margin-bottom: var(--ag-space-5);
}

.app-breadcrumb a {
	color: var(--ag-color-text-muted);
}

.app-breadcrumb a:hover {
	color: var(--ag-color-primary);
}

/* --- Pied de page --- */

.app-footer {
	flex-shrink: 0;
	margin-left: var(--ag-sidebar-width);
	padding: var(--ag-space-5) var(--ag-space-6) var(--ag-space-6);
	color: var(--ag-color-text-muted);
	font-size: var(--ag-font-size-xs);
	display: flex;
	justify-content: center;
	align-items: center;
	gap: var(--ag-space-4);
	flex-wrap: wrap;
	text-align: center;
}

.app-footer a:hover {
	color: var(--ag-color-primary);
}

/* --- Responsive --- */

@media (max-width: 960px) {
	.app-topbar__menu-toggle {
		display: inline-flex;
	}

	.app-sidebar {
		transform: translateX(-100%);
		transition: transform var(--ag-transition-base);
		box-shadow: var(--ag-shadow-lg);
	}

	.app-shell.is-sidebar-open .app-sidebar {
		transform: translateX(0);
	}

	.app-shell.is-sidebar-open::after {
		content: "";
		position: fixed;
		inset: 0;
		top: var(--ag-topbar-height);
		background: rgba(16, 24, 40, 0.35);
		z-index: calc(var(--ag-z-sidebar) - 1);
	}

	.app-content,
	.app-footer {
		margin-left: 0;
	}

	.app-content__inner {
		padding: var(--ag-space-4);
	}
}
