:root {
	--sidebar-width: 250px;
	--sidebar-width-toolbar: 75px;
	--sidebar-width-mobile: 300px;
	--color-primary: #003366;
	--color-primary-dark: #004a80;
	--color-accent: #4e0d3a;
	--color-accent-hover: #720d5d;
	--color-text: #333333;
	--color-bg: #f4f7fa;
	--color-gutter: #e0e0e0;
	--color-gutter-hover: #bdbdbd;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: "Inter", sans-serif;
	background: var(--color-bg);
}

td {
	height: 3rem;
}

h1,
h2,
h3,
h4,
h5 {
	color: var(--color-primary);
}

p {
	color: var(--color-text);
}

.btn {
	transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
	--bs-btn-bg: var(--color-accent);
	--bs-btn-border-color: var(--color-accent);
	--bs-btn-hover-bg: var(--color-accent-hover);
	--bs-btn-hover-border-color: var(--color-accent-hover);
	--bs-btn-active-bg: var(--color-accent-hover);
	--bs-btn-active-border-color: var(--color-accent-hover);
}

.navbar {
	background: var(--color-primary);
}

.image-section {
	background: url("/assets/images/login-background.png") center / cover no-repeat;
	min-height: 100vh;
}

.user-icon {
	width: 60px;
	height: 60px;
}

#sidebar,
#sidebar-body {
	width: var(--sidebar-width);
	background: var(--color-primary) !important;
	color: #fff;
}

.gutter {
	background-color: var(--color-gutter);
	cursor: row-resize;
	transition: background-color 0.15s ease;
}

.gutter:hover {
	background-color: var(--color-gutter-hover);
}

#reports-table-body tr[data-report-id] {
	cursor: pointer;
}

#content {
	margin-top: 4rem;
}

/* --- Listing layout: containers sized to content --- */
#split-container {
	position: relative;
}

#gc-pdf-preview {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 100;
}

#table-section {
	width: 100%;
	max-width: 100%;
	align-self: flex-start;
}

gc-data-table thead.table-card-header th {
	position: sticky;
	top: 0;
	z-index: 1;
	background-color: #f8f9fa;
	border-bottom: 1px solid #dee2e6;
}

/* Empty state: comparable min height to avoid a jump between results ↔ empty. */
gc-data-table.card {
	min-height: 12rem;
}

/* --- Filtres : flexbox au contenu (remplace .row g-3) --- */
.filters-grid {
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-end;
	gap: 1rem;
}

.filters-fields {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: .75rem 1rem;
	flex: 1 1 0;
	min-width: 0;
}

.filter-field {
	flex: 0 1 auto;
	min-width: 0;
}

.filter-field>.form-control,
.filter-field>.form-select,
.filter-field>.dropdown {
	width: 100%;
}

.filter-field>.d-flex:has(.btn-check) {
	flex-wrap: nowrap !important;
}

.filter-field--sm {
	width: 10rem;
}

.filter-field--md {
	width: 14rem;
}

.filter-field--lg {
	width: 20rem;
}

.filter-field--grow {
	flex: 1 1 18rem;
	min-width: 0;
}

.filters-actions {
	flex-shrink: 0;
	align-self: flex-end;
}

@media (max-width: 767px) {
	.filters-grid {
		flex-wrap: wrap;
	}

	.filter-field {
		flex: 1 1 100%;
	}

	.filters-actions {
		width: 100%;
	}
}

/* --- Preview PDF : overlay glissant --- */
#preview-section {
	position: fixed;
	top: 0;
	right: 0;
	height: 100vh;
	z-index: 1045;
	transform: translateX(100%);
	opacity: 0;
	pointer-events: none;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

#preview-section.preview-open {
	transform: translateX(0);
	opacity: 1;
	pointer-events: auto;
}

/* On large screens, reserve space on the right (side-by-side).
   Below that, the preview overlaps the table (overlay). */
@media (min-width: 1400px) {
	#split-container.has-preview {
		padding-right: calc(var(--preview-width, 0px) + 1rem);
		transition: padding-right 0.25s ease;
	}
}

.full-screen-mode {
	left: 0 !important;
	right: 0 !important;
	width: 100vw !important;
}

.file-link:hover {
	text-decoration: underline !important;
}

.filter-pill {
	cursor: pointer;
	transition: all .15s;
}

.filter-pill:hover {
	border-color: #adb5bd !important;
	color: #212529 !important;
}

.filter-pill.active {
	background: #212529 !important;
	color: #fff !important;
	border-color: #212529 !important;
}

@media (max-width: 499px) {

	#sidebar,
	#sidebar-body {
		width: var(--sidebar-width-mobile);
	}
}

@media (min-width: 992px) {
	#sidebar {
		width: var(--sidebar-width);
		height: 100vh;
		position: sticky;
		top: 0;
		flex-shrink: 0;
		overflow: visible;
		/* the profile dropdown won't be clipped */
		transition: width 0.3s ease;
	}

	/* Toggling the variable -> #sidebar AND #sidebar-body shrink together */
	#sidebar.sidebar-collapsed {
		--sidebar-width: var(--sidebar-width-toolbar);
	}

	#sidebar-body {
		min-height: 100vh;
		transition: width 0.3s ease;
	}

	#sidebar-body .nav-link.active,
	#sidebar-body .nav-link:hover {
		background: var(--color-primary-dark);
	}

	#content {
		margin-top: 1rem;
	}

	#sidebar .nav-label,
	#sidebar .user-name {
		white-space: nowrap;
		overflow: hidden;
		max-width: 160px;
		transition: max-width 0.3s ease, opacity 0.2s ease;
	}

	/* The title is wider: give it room in expanded mode */
	#sidebar .brand-text {
		white-space: nowrap;
		overflow: hidden;
		max-width: 200px;
		transition: max-width 0.3s ease, opacity 0.2s ease;
	}

	#sidebar.sidebar-collapsed .nav-label,
	#sidebar.sidebar-collapsed .brand-text,
	#sidebar.sidebar-collapsed .user-name {
		max-width: 0;
		opacity: 0;
	}

	#sidebar.sidebar-collapsed .nav-link,
	#sidebar.sidebar-collapsed .brand-row,
	#sidebar.sidebar-collapsed .profile-toggle {
		justify-content: center !important;
	}

	#sidebar.sidebar-collapsed .nav-icon,
	#sidebar.sidebar-collapsed .user-name {
		margin-right: 0 !important;
		margin-left: 0 !important;
	}

	#sidebar.sidebar-collapsed .brand-link {
		flex-grow: 0 !important;
	}

	#sidebar.sidebar-collapsed .profile-toggle::after {
		display: none;
	}
}