.fim-wrap, .fim-wrap * {
	font-family: 'Vazirmatn', Tahoma, sans-serif !important;
	box-sizing: border-box;
}
.fim-wrap {
	direction: rtl;
	text-align: right;
	max-width: 980px;
	margin: 0 auto;
	color: #1a1a1a;
	line-height: 1.9;
	font-size: 14.5px;
}
.fim-header { text-align: center; margin-bottom: 18px; }
.fim-bismillah { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.fim-header h2 { margin: 0 0 4px; font-size: 21px; }

.fim-section-title {
	background: #f3f4f6;
	border-right: 5px solid #2c5f8a;
	padding: 8px 12px;
	margin: 26px 0 10px;
	font-size: 16px;
	font-weight: 700;
}
.fim-note { color: #555; font-size: 13px; margin: 4px 0 10px; }
.fim-muted { color: #888; font-style: italic; }

.fim-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 6px;
}
.fim-table td, .fim-table th {
	border: 1px solid #b9c0c8;
	padding: 7px 8px;
	vertical-align: middle;
	font-size: 13.5px;
}
.fim-table th {
	background: #eaeef2;
	font-weight: 700;
	text-align: center;
}
.fim-table td.fim-label {
	background: #f7f8f9;
	font-weight: 600;
	white-space: normal;
	width: 220px;
}
.fim-table input[type=text],
.fim-table input[type=number],
.fim-table input[type=time],
.fim-table select,
.fim-table textarea {
	width: 100%;
	border: 1px solid #cfd4da;
	border-radius: 4px;
	padding: 5px 7px;
	font-size: 13.5px;
	background: #fff;
}
.fim-table textarea { resize: vertical; }

.fim-radio-group { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.fim-radio { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; white-space: nowrap; cursor: pointer; }
.fim-radio input { margin: 0; }

.fim-guide-list { font-size: 13px; color: #333; margin: 4px 0 16px; padding-right: 22px; }
.fim-guide-list li { margin-bottom: 3px; }

.fim-legend-table th { background: #dde6ee; }

.fim-btn-add {
	background: #eef3f8;
	border: 1px dashed #7c93a8;
	color: #2c5f8a;
	padding: 7px 14px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 13.5px;
	margin: 4px 0 20px;
}
.fim-btn-add:hover { background: #dfe9f2; }

.fim-btn-remove-row {
	background: #fdeeee;
	border: 1px solid #e6b4b4;
	color: #b23333;
	border-radius: 4px;
	cursor: pointer;
	font-size: 12px;
	padding: 4px 8px;
}

.fim-declaration {
	background: #fbf7ec;
	border: 1px solid #e6d9ab;
	padding: 12px;
	border-radius: 6px;
	margin-bottom: 10px;
	font-size: 13.5px;
}

.fim-submit-row { margin: 22px 0; text-align: center; }
.fim-btn-submit {
	display: inline-block;
	background: #2c5f8a;
	color: #fff !important;
	border: none;
	padding: 12px 32px;
	font-size: 15px;
	border-radius: 8px;
	cursor: pointer;
	text-decoration: none;
}
.fim-btn-submit:hover { background: #234b6d; }
.fim-btn-approve { background: #2f8a52; }
.fim-btn-approve:hover { background: #256b40; }
.fim-btn-return { background: #b23333; margin-right: 10px; }
.fim-btn-return:hover { background: #8f2828; }
.fim-btn-draft {
	display: inline-block;
	background: #fff;
	color: #2c5f8a !important;
	border: 2px solid #2c5f8a;
	padding: 10px 26px;
	font-size: 14px;
	border-radius: 8px;
	cursor: pointer;
	margin-left: 10px;
}
.fim-btn-draft:hover { background: #eef3f8; }

.fim-message {
	margin: 14px 0;
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 13.5px;
}
.fim-message.success { background: #e7f6ec; color: #1e6b3a; border: 1px solid #b6e2c3; }
.fim-message.error { background: #fdeeee; color: #a12626; border: 1px solid #f0c2c2; }

.fim-result-box {
	background: #eef8f0;
	border: 1px solid #bfe3c8;
	border-radius: 10px;
	padding: 20px;
	text-align: center;
	margin-top: 24px;
}
.fim-result-box #fim-tracking-code {
	font-size: 22px;
	color: #1e6b3a;
	letter-spacing: 2px;
}

.fim-edit-banner {
	background: #fff3cd;
	border: 1px solid #ffe08a;
	border-radius: 8px;
	padding: 14px 18px;
	margin-bottom: 20px;
}
.fim-edit-banner-rejected {
	background: #fdeeee;
	border: 1px solid #f0b8b8;
}
.fim-reject-comment {
	background: #fff;
	border: 1px solid #e6b4b4;
	border-radius: 6px;
	padding: 10px 12px;
	font-size: 14px;
	font-weight: 600;
	color: #8a2020;
	margin: 8px 0 !important;
}
.fim-edit-banner strong { display: block; margin-bottom: 6px; font-size: 15px; }
.fim-edit-banner p { margin: 4px 0; font-size: 13.5px; }

.fim-locked-field {
	background: #f0f0f0 !important;
	color: #555 !important;
	cursor: not-allowed;
	font-weight: 600;
}

.fim-tabs { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 2px solid #e2e5e9; padding-bottom: 0; }
.fim-tab {
	display: inline-block;
	padding: 8px 16px;
	border-radius: 6px 6px 0 0;
	background: #f3f4f6;
	color: #444;
	text-decoration: none;
	font-size: 13.5px;
	border: 1px solid #e2e5e9;
	border-bottom: none;
}
.fim-tab.active { background: #2c5f8a; color: #fff; border-color: #2c5f8a; }

.fim-chief-lookup { text-align: center; margin: 30px 0; }
.fim-lookup-row { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.fim-lookup-row input { border: 1px solid #cfd4da; border-radius: 6px; padding: 10px 14px; font-size: 18px; letter-spacing: 3px; text-align: center; width: 200px; }

.fim-chief-review-box { margin-top: 24px; border-top: 2px dashed #ccc; padding-top: 20px; }

.fim-timeline-current td { background: #eef8f0; font-weight: 700; }

.fim-scorecard-table th { background: #dde6ee; }
.fim-scorecard-total-row td { background: #eef8f0; }

.fim-track-table .fim-track-code { font-size: 18px; font-weight: 700; letter-spacing: 2px; color: #2c5f8a; }

/* حالت چاپ / PDF */
.fim-print-toolbar { text-align: center; padding: 14px; background: #f3f4f6; }
.fim-print-toolbar button {
	background: #2c5f8a; color: #fff; border: none; padding: 10px 26px;
	border-radius: 6px; font-size: 14px; cursor: pointer; font-family: 'Vazirmatn', sans-serif;
}
@media print {
	.no-print { display: none !important; }
	.fim-print { max-width: 100%; font-size: 11.5px; }
	/* عنوان بخش باید همراه اولین محتوای بعد از خودش بماند، نه تنها در پایین صفحه رها شود */
	.fim-section-title { break-inside: avoid; break-after: avoid; }
	/*
	 * نکتهٔ مهم: قبلاً «break-inside: avoid» روی خودِ جدول (.fim-table) بود، یعنی کل جدول
	 * یک بلوک تجزیه‌ناپذیر تلقی می‌شد. برای جدول‌های کوچک (سه‌چهار ردیفی) بی‌ضرر بود، اما برای
	 * جدول‌های بلند (مثل معیارهای کارنامه یا ردیف‌های عملیات در گزارش)، اگر کل جدول در فضای
	 * باقی‌ماندهٔ صفحه جا نمی‌شد، مرورگر کل آن را یکجا به صفحهٔ بعد می‌فرستاد و نصفهٔ صفحهٔ فعلی
	 * خالی می‌ماند. حالا فقط از نصفه‌شدنِ هر ردیف به‌تنهایی جلوگیری می‌شود؛ خودِ جدول می‌تواند
	 * بین صفحات ادامه پیدا کند.
	 */
	.fim-table { break-inside: auto; }
	.fim-table tr { break-inside: avoid; }
	.fim-table thead { display: table-header-group; }
}

@media (max-width: 700px) {
	.fim-wrap { font-size: 13px; }
	.fim-table td.fim-label { width: auto; }
	table.fim-table, table.fim-table tbody, table.fim-table tr, table.fim-table td, table.fim-table th { display: block; width: 100%; }
	.fim-table th { display: none; }
	.fim-table td { border-bottom: none; }
	.fim-table tr { border: 1px solid #b9c0c8; margin-bottom: 8px; border-radius: 6px; overflow: hidden; }
}
