@media print {
	/* Key rule: print can't "scroll". Make scroll containers expand so content can paginate. */
	html,
	body {
		height: auto !important;
		overflow: visible !important;
	}

	/* Common app/layout wrappers that often cap height or create scroll regions */
	.empty-layout,
	.main-wrapper,
	.main-content,
	main,
	.content,
	.content-wrapper,
	.content-container,
	.RV_contentSection,
	.RV_chartsView,
	.CreateNewReportContainer,
	.CreateNewReportContainer.ReportViewerScreen,
	.CreateNewReportContainer.ReportViewerScreen.content-wrapper,
	.CNR_landingChartsWrapper {
		height: auto !important;
		max-height: none !important;
		overflow: visible !important;
		position: static !important;
	}

	/* If any child elements use fixed positioning/sticky toolbars, disable for print */
	*[style*="position:fixed"],
	*[style*="position: sticky"] {
		position: static !important;
	}

	/* Hide left sidebar and any explicitly marked non-print elements */
	.sidebar,
	.no-export {
		display: none !important;
	}

	/* Reset grid so content doesn't shift into the sidebar column */
	.main-wrapper {
		display: block !important;
		grid-template-columns: none !important;
		grid-template-areas: none !important;
	}

	/* Make the main content span full width for printing */
	html,
	body,
	.main-content {
		margin: 0 !important;
		padding: 0 !important;
		background: #ffffff !important;
		width: 100% !important;
	}

	.main-content {
		display: block !important;
		grid-column: auto !important;
	}

	/* Ensure the ReportViewer container uses available width */
	.CreateNewReportContainer.ReportViewerScreen.content-wrapper {
		width: 100% !important;
	}

	/* Tweak common button classes just in case any remain */
	.btn,
	.telerik-button,
	.k-button,
	.k-button-group {
		display: none !important;
	}

	/* Hide Telerik Grid pagination and toolbars in print */
	.k-grid .k-pager,
	.k-grid .k-pager-wrap,
	.k-grid .k-pager-numbers,
	.k-grid .k-pager-sizes,
	.k-grid .k-pager-info,
	.k-grid .k-pager-nav,
	.k-grid-pager,
	.k-pager,
	.k-toolbar {
		display: none !important;
	}

	/* Help pagination: avoid cutting a chart/card in half when possible */
	.CNR_landingChartsWrapper > *,
	.k-card,
	.k-chart,
	canvas,
	svg {
		break-inside: avoid !important;
		page-break-inside: avoid !important;
	}

	/* The export wrapper should not force a new page; let the browser pack content naturally */
	.export-pdf,
	.CNR_landingChartsWrapper {
		break-before: auto !important;
		page-break-before: auto !important;
		break-after: auto !important;
		page-break-after: auto !important;
	}

	/* The grid is typically taller than a page; allow splitting even though we avoid-split for other cards. */
	.CNR_landingChartsWrapper > .grid-container,
	.CNR_landingChartsWrapper > .grid-container *,
	.grid-container,
	.grid-container *,
	.k-grid,
	.k-grid *,
	.k-grid-content,
	.k-grid-content * {
		break-inside: auto !important;
		page-break-inside: auto !important;
	}

	/* Remove “scroll viewport” behavior inside Telerik grid so it can paginate */
	.k-grid,
	.k-grid-content,
	.k-grid-aria-root,
	.k-grid-container {
		height: auto !important;
		max-height: none !important;
		overflow: visible !important;
	}

	/* Grids are often taller than a page; allowing them to split prevents blank pages */
	.CreateNewReportContainer .CNR_gridSection,
	.CreateNewReportContainer .CNR_gridSection *,
	.k-grid,
	.k-grid *,
	.k-grid-content,
	.k-grid-content * {
		break-inside: auto !important;
		page-break-inside: auto !important;
		break-before: auto !important;
		page-break-before: auto !important;
	}

	/* Prevent a forced blank page between filter and grid */
	.CreateNewReportContainer .CNR_filter_section {
		break-after: avoid-page !important;
		page-break-after: avoid !important;
		margin-bottom: 0 !important;
		padding-bottom: 0 !important;
	}

	/* In app.css the grid wrapper has height:56vh and min-height:530px; this can push it to the next page. */
	.CreateNewReportContainer .CNR_gridSection {
		height: auto !important;
		min-height: 0 !important;
		max-height: none !important;
		background: transparent !important;
		background-image: none !important;
	}

	/* Ensure large charts can scale to page width */
	img,
	svg,
	canvas {
		max-width: 100% !important;
	}

	/* Page setup for better print margins */
	@page {
		size: A4;
		margin: 12mm;
	}
}
