/* Mobile-first tweaks */
body { background: #f7f9fc; }
.navbar-brand { letter-spacing: 0.3px; }
.table thead th { white-space: nowrap; }
.card { border: 0; box-shadow: 0 1px 3px rgba(3, 0, 71, 0.09); }
.btn-primary { box-shadow: 0 3px 10px rgba(13,110,253,.2); }
.form-label.required:after { content: ' *'; color: #dc3545; }
img.logo-preview { max-height: 64px; object-fit: contain; }
/* Make tables horizontally scrollable on small screens */
.table-responsive { overflow-x: auto; }

/* Invoice Theme (red/black) */
:root { --brand-red:#c8102e; --brand-dark:#111; }
.invoice-wrap { max-width: 900px; margin: 0 auto; background:#fff; border:2px solid var(--brand-red); box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.invoice-header { border-bottom: 3px solid var(--brand-red); padding: 16px 16px 8px; }
.invoice-brand { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.invoice-logo { max-height:75px; object-fit:contain; width:auto; height:auto; }
.invoice-title { color: var(--brand-red); font-weight:700; letter-spacing:1px; }
.invoice-meta { color:#555; }
.invoice-body { padding: 16px; }
.invoice-section { margin-bottom: 12px; }
.invoice-box { border:1px solid #e6e6e6; border-radius:6px; }
.invoice-table thead th { background: #222; color:#fff; border-color:#222; }
.invoice-table tbody td, .invoice-table thead th { border:1px solid #ddd; }
.totals-table th { font-weight:600; }
.invoice-footer { border-top:1px solid #eee; padding: 12px 16px; color:#444; font-size:.92rem; }
.signature { margin-top: 32px; border-top: 1px solid #ccc; padding-top: 8px; display:flex; justify-content:space-between; align-items:center; gap:12px; }
.signature .name { font-weight:600; color:#000; }
.thankyou { color: var(--brand-red); font-weight:600; margin-top: 8px; }
.nowrap { white-space: nowrap; }

@media print {
	@page { 
		size: A4 portrait;
		margin: 5mm;
	}
	html {
		width: 100%;
		height: 100%;
	}
	body {
		width: 100%;
		height: auto;
		margin: 0 !important;
		padding: 0 !important;
		background: #fff !important;
	}
	* {
		-webkit-print-color-adjust: exact !important;
		print-color-adjust: exact !important;
		color-adjust: exact !important;
	}
	.navbar, .btn, .alert, .no-print, nav, header, footer { 
		display: none !important; 
	}
	.container, main.container { 
		max-width: 100% !important; 
		width: 100% !important; 
		padding: 0 !important; 
		margin: 0 auto !important;
	}
	.invoice-wrap { 
		box-shadow: none !important; 
		border: 2px solid #000 !important; 
		width: 100% !important; 
		max-width: 100% !important; 
		margin: 0 auto !important;
		padding: 0 !important;
		page-break-after: avoid;
		background: #fff !important;
	}
	.invoice-header {
		padding: 16px 20px 12px !important;
		page-break-inside: avoid;
		border-bottom: 3px solid #000 !important;
	}
	.invoice-header .row {
		display: flex !important;
		flex-wrap: nowrap !important;
		gap: 16px !important;
	}
	.invoice-header .col-12 {
		width: 50% !important;
		max-width: 50% !important;
		flex: 0 0 50% !important;
	}
	.invoice-header .col-md-6 {
		width: 50% !important;
		max-width: 50% !important;
		flex: 0 0 50% !important;
	}
	.invoice-logo {
		max-width: 120px !important;
		max-height: 60px !important;
	}
	.invoice-box {
		max-width: 100% !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}
	.invoice-body {
		padding: 16px 20px !important;
	}
	.invoice-footer {
		padding: 12px 20px !important;
		border-top: 1px solid #000 !important;
	}
	.invoice-table thead th {
		background: #222 !important;
		color: #fff !important;
		-webkit-print-color-adjust: exact !important;
	}
	.invoice-title {
		color: #c8102e !important;
		-webkit-print-color-adjust: exact !important;
	}
	.thankyou {
		color: #c8102e !important;
		-webkit-print-color-adjust: exact !important;
	}
	.text-end {
		text-align: right !important;
	}
}
