/*!
 * K&A Invoices - shared HTML/PDF invoice stylesheet (assets/invoice-template.css)
 *
 * Loaded on the front end (for the My Account "Invoices" tab) and inlined
 * into the HTML/PDF rendering. Keep selectors low-specificity so the host
 * theme can override anything via its own stylesheet.
 *
 * The renderer also inlines an --accent-color-derived CSS string into each
 * generated document so PDF engines that can't resolve external CSS still
 * get correct colors. This file mostly exists so the front-end (browser-
 * rendered) HTML stays in sync visually with the saved files.
 */

body.ka-invoice {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #1c1d23;
	margin: 24px;
	background: #fff;
}

.ka-inv__sheet {
	max-width: 780px;
	margin: 0 auto;
	padding: 0;
}

.ka-inv__head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	border-bottom: 3px solid var(--ka-invoice-accent, #1c1d23);
	padding-bottom: 14px;
	margin-bottom: 18px;
}

.ka-inv__brand { flex: 1; }
.ka-inv__brand p { margin: 0 0 4px; font-size: 13px; line-height: 1.5; }

.ka-inv__logo {
	max-height: 64px;
	max-width: 240px;
	display: block;
	margin-bottom: 8px;
}

.ka-inv__doctype { text-align: right; }
.ka-inv__doctype h1 {
	margin: 0;
	font-size: 28px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ka-invoice-accent, #1c1d23);
}
.ka-inv__doctype p { margin: 4px 0 0; font-size: 13px; color: #555; }

.ka-inv__meta {
	display: flex;
	gap: 32px;
	justify-content: space-between;
	margin-bottom: 18px;
}
.ka-inv__meta-block { flex: 1; }
.ka-inv__meta-block h4 {
	margin: 0 0 4px;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #888;
	font-weight: 700;
}
.ka-inv__meta-block p { margin: 0; font-size: 13px; line-height: 1.5; }

.ka-inv__items {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 18px;
	font-size: 13px;
}
.ka-inv__items thead {
	background: var(--ka-invoice-accent, #1c1d23);
	color: #fff;
}
.ka-inv__items th {
	padding: 9px 10px;
	text-align: left;
	font-weight: 600;
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
.ka-inv__items td {
	padding: 9px 10px;
	border-bottom: 1px solid #eee;
	vertical-align: top;
}
.ka-inv__items tbody tr:nth-child(even) td { background: #fafafa; }
.ka-inv__items .num { text-align: right; white-space: nowrap; }
.ka-inv__items .ctr { text-align: center; }

.ka-inv__totals {
	margin-left: auto;
	width: auto;
	border-collapse: collapse;
	font-size: 13px;
}
.ka-inv__totals td { padding: 5px 12px; }
.ka-inv__totals tr:last-child td {
	font-weight: 700;
	border-top: 2px solid var(--ka-invoice-accent, #1c1d23);
	font-size: 15px;
}

.ka-inv__terms {
	margin-top: 24px;
	padding: 14px 16px;
	background: #f7f7f7;
	border-left: 3px solid var(--ka-invoice-accent, #1c1d23);
	font-size: 12px;
	line-height: 1.5;
	color: #444;
}
.ka-inv__terms h4 {
	margin: 0 0 6px;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ka-invoice-accent, #1c1d23);
}
.ka-inv__terms p { margin: 0; }

.ka-inv__foot {
	margin-top: 24px;
	padding-top: 12px;
	border-top: 1px solid #eee;
	font-size: 11px;
	color: #777;
	text-align: center;
}

.ka-inv__notes {
	margin-top: 18px;
	font-size: 12px;
	color: #444;
}

.ka-invoices-list { width: 100%; }
.ka-invoices-list th, .ka-invoices-list td {
	padding: 8px 10px;
	border-bottom: 1px solid #eee;
	font-size: 13px;
}
.ka-invoices-list th { text-align: left; }

@media print {
	body.ka-invoice { margin: 0; }
	.ka-inv__sheet { max-width: none; }
	.ka-inv__head { page-break-after: avoid; }
	.ka-inv__items tr { page-break-inside: avoid; }
}
