/* KalaAfzaar Invoice Manager - shared invoice stylesheet.
 * Used identically for the admin preview iframe, the print view, and the
 * "download PDF" (browser print-to-PDF) view, so all three outputs are
 * always pixel-identical.
 */

@font-face {
	font-family: 'Vazirmatn';
	src: local('Vazirmatn');
	font-weight: 400 700;
}

.kaf-im-standalone {
	margin: 0;
	padding: 0;
	background: #fff;
}

.kaf-im-invoice {
	direction: rtl;
	font-family: 'Vazirmatn', Tahoma, sans-serif;
	color: #1a1a1a;
	font-size: 13px;
	width: 100%;
	max-width: 900px;
	margin: 0 auto;
	padding: 20px;
	box-sizing: border-box;
}

.kaf-im-invoice table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

.kaf-im-invoice th,
.kaf-im-invoice td {
	border: 1px solid #444;
	padding: 6px 8px;
	text-align: center;
	vertical-align: middle;
	word-wrap: break-word;
}

.kaf-im-header-table {
	margin-bottom: 10px;
}

.kaf-im-header-table td {
	border: 1px solid #444;
}

.kaf-im-serial-box {
	width: 20%;
	text-align: center;
}

.kaf-im-box-label {
	font-size: 11px;
	color: #444;
}

.kaf-im-box-value {
	font-weight: 700;
	font-size: 14px;
}

.kaf-im-title-cell {
	width: 60%;
	font-size: 18px;
	font-weight: 700;
	text-align: center;
}

.kaf-im-logo-cell {
	width: 20%;
	text-align: center;
}

.kaf-im-logo {
	max-height: 60px;
	max-width: 100%;
}

.kaf-im-date-box {
	text-align: right;
	font-size: 12px;
}

.kaf-im-parties-table {
	margin-bottom: 10px;
}

.kaf-im-parties-table th {
	background: #f2f2f2;
	font-size: 13px;
	font-weight: 700;
	text-align: center;
}

.kaf-im-parties-table td {
	text-align: right;
	font-size: 12px;
}

.kaf-im-items-table {
	margin-bottom: 10px;
	table-layout: fixed;
}

.kaf-im-items-table th:nth-child(1),
.kaf-im-items-table td:nth-child(1) {
	width: 5%;
}

.kaf-im-items-table th:nth-child(2),
.kaf-im-items-table td:nth-child(2) {
	width: 26%;
}

.kaf-im-items-table th:nth-child(3),
.kaf-im-items-table td:nth-child(3) {
	width: 11%;
}

.kaf-im-items-table th:nth-child(4),
.kaf-im-items-table td:nth-child(4) {
	width: 8%;
}

.kaf-im-items-table th:nth-child(5),
.kaf-im-items-table td:nth-child(5) {
	width: 12.5%;
}

.kaf-im-items-table th:nth-child(6),
.kaf-im-items-table td:nth-child(6) {
	width: 12.5%;
}

.kaf-im-items-table th:nth-child(7),
.kaf-im-items-table td:nth-child(7) {
	width: 12.5%;
}

.kaf-im-items-table th:nth-child(8),
.kaf-im-items-table td:nth-child(8) {
	width: 12.5%;
}

.kaf-im-items-table thead th {
	background: #f2f2f2;
	font-size: 11.5px;
	font-weight: 700;
}

.kaf-im-items-table td {
	font-size: 12px;
}

.kaf-im-align-right {
	text-align: right !important;
}

.kaf-im-totals-table {
	width: 50%;
	margin-inline-start: auto;
	margin-bottom: 10px;
}

.kaf-im-totals-table td {
	font-size: 12.5px;
}

.kaf-im-grand-total-row td {
	font-weight: 700;
	background: #f7f7f7;
	font-size: 13.5px;
}

.kaf-im-description-box {
	border: 1px solid #444;
	padding: 8px;
	margin-bottom: 10px;
	font-size: 12px;
	text-align: right;
}

.kaf-im-signature-table {
	margin-top: 20px;
}

.kaf-im-signature-table td {
	height: 70px;
	vertical-align: bottom;
	text-align: center;
	font-size: 12px;
}

.kaf-im-signature {
	max-height: 55px;
	display: block;
	margin: 4px auto 0;
}

.kaf-im-footer-note {
	margin-top: 12px;
	font-size: 11px;
	color: #555;
	text-align: center;
	border-top: 1px dashed #999;
	padding-top: 6px;
}

@media print {
	body {
		margin: 0;
	}

	.kaf-im-invoice {
		padding: 0;
		max-width: 100%;
	}

	@page {
		size: A4;
		margin: 12mm;
	}
}
