/* ═══════════════════════════════════════════════════════════
   Facture Suisse Facile — Styles d'impression
   On masque toute l'UI et on imprime uniquement la facture A4.
   ═══════════════════════════════════════════════════════════ */

@media print {
	@page {
		size: A4;
		margin: 0;
	}

	html, body {
		background: #fff !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	.app-header,
	.app-footer,
	.page-header,
	.editor-header,
	.editor-panel,
	.preview-scaler > :not(.invoice-page),
	.app-nav,
	.app-menu-toggle {
		display: none !important;
	}

	.view { display: none !important; }
	#view-facture {
		display: block !important;
	}

	.app-main {
		max-width: none !important;
		padding: 0 !important;
		margin: 0 !important;
	}

	.editor-layout {
		display: block !important;
		gap: 0 !important;
	}
	.editor-preview {
		position: static !important;
	}
	.preview-scaler {
		background: transparent !important;
		padding: 0 !important;
		border: 0 !important;
		overflow: visible !important;
	}

	#invoicePages {
		display: block !important;
		gap: 0 !important;
	}

	.invoice-page {
		width: 210mm !important;
		min-height: 297mm !important;
		height: 297mm !important;
		margin: 0 !important;
		padding: 0 !important;
		box-shadow: none !important;
		transform: none !important;
		overflow: hidden !important;
		page-break-after: always;
		break-after: page;
	}
	.invoice-page:last-child {
		page-break-after: avoid;
		break-after: avoid;
	}
}

/* ── Scaling du preview à l'écran ──
   On utilise `zoom` (et non transform: scale) pour que le layout box
   soit RÉELLEMENT réduit, ce qui évite les gros espaces vides et les
   positionnements absolus qui sortent de leur container. */

.preview-scaler {
	display: flex;
	justify-content: center;
}

.invoice-page {
	zoom: 0.72;
}

@media (max-width: 1400px) {
	.invoice-page { zoom: 0.62; }
}
@media (max-width: 1200px) {
	.invoice-page { zoom: 0.54; }
}
@media (max-width: 1100px) {
	.invoice-page { zoom: 0.85; }
}
@media (max-width: 820px) {
	.invoice-page { zoom: 0.64; }
}
@media (max-width: 640px) {
	.invoice-page { zoom: 0.48; }
}

@media print {
	.invoice-page {
		zoom: 1 !important;
	}
}
