:root {
	--primary: #2563eb;
	--bg: #f6f7fb;
	--card: #ffffff;
	--border: #e5e7eb;
	--text: #111827;
	--muted: #6b7280;
}

* { box-sizing: border-box; }

body {
	font-family: 'Segoe UI', Tahoma, 'Cairo', sans-serif;
	background: var(--bg);
	color: var(--text);
	margin: 0;
	padding: 0 16px 40px;
}

.app-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 0;
	max-width: 900px;
	margin: 0 auto;
}

.app-header h1 { margin: 0; font-size: 1.4rem; }

.actions button {
	background: var(--primary);
	color: #fff;
	border: 0;
	padding: 10px 14px;
	border-radius: 8px;
	cursor: pointer;
	margin-inline-start: 8px;
	font-size: 0.95rem;
}

.actions button:hover { filter: brightness(0.95); }

.invoice {
	background: var(--card);
	max-width: 900px;
	margin: 0 auto;
	padding: 24px;
	border-radius: 12px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.parties, .meta, .totals {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
	margin-bottom: 20px;
}

.party h3 { margin: 0 0 8px; font-size: 1rem; color: var(--muted); }

input, textarea, select {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--border);
	border-radius: 6px;
	font: inherit;
	background: #fff;
	margin-bottom: 6px;
}

textarea { min-height: 70px; resize: vertical; }

label { display: block; color: var(--muted); font-size: 0.9rem; }

table.items {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 20px;
}

.items th, .items td {
	border-bottom: 1px solid var(--border);
	padding: 8px;
	text-align: start;
	vertical-align: middle;
}

.items th { background: #f9fafb; font-weight: 600; font-size: 0.9rem; }

.items input { margin: 0; }

.remove {
	background: transparent;
	border: 0;
	color: #dc2626;
	cursor: pointer;
	font-size: 1rem;
}

.summary {
	grid-column: 1 / -1;
	text-align: end;
	line-height: 1.9;
}

.summary .grand {
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--primary);
	margin-top: 6px;
}

@media print {
	.no-print { display: none !important; }
	body { background: #fff; padding: 0; }
	.invoice { box-shadow: none; border: 0; max-width: 100%; }
}
