.cinv-last-update {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	color: #1d4ed8;
	border-radius: 8px;
	padding: 6px 12px;
	font-size: 12.5px;
	margin-bottom: 10px;
}

.cinv-last-update span {
	font-weight: 700;
}

.cinv-frontend-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 14px;
}

.cinv-frontend-filters form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	width: 100%;
}

.cinv-frontend-filters input[type="text"],
.cinv-frontend-filters select {
	padding: 7px 10px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 13.5px;
	font-family: inherit;
}

.cinv-frontend-filters input[type="text"] {
	min-width: 180px;
	flex: 1 1 180px;
}

.cinv-filter-btn {
	padding: 7px 16px;
	border: none;
	border-radius: 6px;
	background: #1d4ed8;
	color: #fff;
	cursor: pointer;
	font-size: 13.5px;
	font-family: inherit;
}

.cinv-filter-clear {
	font-size: 12.5px;
	color: #b32d2e;
	text-decoration: underline;
}

.cinv-frontend-wrap {
	width: 100%;
	overflow-x: auto;
	margin: 20px 0;
	font-family: inherit;
}

.cinv-frontend-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.cinv-frontend-table th {
	background: #1f2937;
	color: #fff;
	text-align: right;
	padding: 8px 10px;
	font-weight: 600;
	font-size: 13px;
	white-space: nowrap;
}

.cinv-frontend-table td {
	padding: 8px 10px;
	border-bottom: 1px solid #eceff1;
	font-size: 13px;
	color: #1f2937;
	vertical-align: middle;
}

.cinv-frontend-table tbody tr:last-child td {
	border-bottom: none;
}

.cinv-frontend-table tbody tr:hover {
	background: #f9fafb;
}

.cinv-row-image {
	width: 56px;
	text-align: center;
}

.cinv-row-status {
	white-space: nowrap;
	text-align: center;
}

.cinv-status {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 11.5px;
	font-weight: 600;
}

.cinv-status-done {
	background: #dcfce7;
	color: #15803d;
}

.cinv-status-pending {
	background: #fee2e2;
	color: #b91c1c;
}

.cinv-view-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	background: #2563eb;
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 5px 10px;
	cursor: pointer;
	font-size: 12px;
	transition: background 0.15s ease;
}

.cinv-view-btn:hover {
	background: #1d4ed8;
}

.cinv-view-btn--thumb {
	background: none;
	padding: 0;
	border-radius: 6px;
}

.cinv-view-btn--thumb:hover {
	background: none;
	opacity: 0.85;
}

.cinv-thumb {
	width: 40px;
	height: 40px;
	object-fit: contain;
	background: #f3f4f6;
	border-radius: 6px;
	display: block;
}

.cinv-no-image {
	color: #9ca3af;
}

/* پاپ‌آپ نمایش تصویر */
.cinv-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.75);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 24px;
}

.cinv-modal-overlay.cinv-open {
	display: flex;
}

.cinv-modal-box {
	background: #fff;
	border-radius: 10px;
	padding: 16px;
	max-width: 90vw;
	max-height: 90vh;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cinv-modal-title {
	font-size: 15px;
	font-weight: 600;
	margin-bottom: 10px;
	color: #1f2937;
}

.cinv-modal-img {
	max-width: 100%;
	max-height: 75vh;
	border-radius: 6px;
	object-fit: contain;
}

.cinv-modal-close {
	position: absolute;
	top: 8px;
	left: 8px;
	background: #f3f4f6;
	border: none;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	color: #374151;
}

.cinv-modal-close:hover {
	background: #e5e7eb;
}

.cinv-empty {
	background: #f9fafb;
	border: 1px dashed #d1d5db;
	border-radius: 8px;
	padding: 16px;
	text-align: center;
	color: #6b7280;
}

.cinv-frontend-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	flex-wrap: wrap;
	margin-top: 14px;
}

.cinv-fpage-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	padding: 0 8px;
	border-radius: 6px;
	text-decoration: none;
	font-size: 13px;
	color: #1f2937;
	background: #fff;
	border: 1px solid #e5e7eb;
}

.cinv-fpage-num.cinv-fpage-current {
	background: #2563eb;
	color: #fff;
	border-color: #2563eb;
	font-weight: 600;
}

/* در موبایل، جدول به‌صورت کارت‌های فشرده (هر ردیف = یک کارت) نمایش داده می‌شود
   تا نیازی به اسکرول افقی نباشد و همه‌ی ستون‌ها خوانا بمانند. */
@media (max-width: 640px) {
	.cinv-frontend-wrap {
		overflow-x: visible;
	}

	.cinv-frontend-table {
		border-radius: 0;
		box-shadow: none;
		background: transparent;
	}

	.cinv-frontend-table thead {
		display: none;
	}

	.cinv-frontend-table,
	.cinv-frontend-table tbody {
		display: block;
		width: 100%;
	}

	.cinv-frontend-table tbody tr {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		background: #fff;
		border: 1px solid #eceff1;
		border-radius: 10px;
		margin-bottom: 10px;
		padding: 10px 12px;
		gap: 4px 8px;
		box-sizing: border-box;
	}

	.cinv-frontend-table td {
		display: block;
		border-bottom: none;
		padding: 0;
		font-size: 12.5px;
		width: auto;
	}

	.cinv-frontend-table td[data-label="تصویر"] {
		order: 1;
		flex: 0 0 auto;
	}

	.cinv-frontend-table td[data-label="نام خودرو"] {
		order: 2;
		flex: 1 1 auto;
		min-width: 0;
		font-weight: 700;
		font-size: 13.5px;
	}

	.cinv-frontend-table td[data-label="وضعیت"] {
		order: 3;
		flex: 0 0 auto;
	}

	.cinv-frontend-table td[data-label="توضیحات"] {
		order: 8;
		flex: 1 1 100%;
		color: #4b5563;
		margin-top: 2px;
	}

	.cinv-frontend-table td[data-label="تاریخ واریزی"],
	.cinv-frontend-table td[data-label="موعد تحویل"],
	.cinv-frontend-table td[data-label="طرح"],
	.cinv-frontend-table td[data-label="رنگ خودرو"] {
		flex: 1 1 auto;
		min-width: max-content;
		background: #f9fafb;
		border: 1px solid #eef0f2;
		border-radius: 6px;
		padding: 3px 7px;
		margin-top: 4px;
	}

	.cinv-frontend-table td[data-label="تاریخ واریزی"] { order: 4; }
	.cinv-frontend-table td[data-label="موعد تحویل"] { order: 5; }
	.cinv-frontend-table td[data-label="رنگ خودرو"] { order: 6; }
	.cinv-frontend-table td[data-label="طرح"] { order: 7; }

	.cinv-frontend-table td[data-label="تاریخ واریزی"]::before,
	.cinv-frontend-table td[data-label="موعد تحویل"]::before,
	.cinv-frontend-table td[data-label="طرح"]::before,
	.cinv-frontend-table td[data-label="رنگ خودرو"]::before {
		content: attr(data-label) ": ";
		color: #9ca3af;
	}

	.cinv-row-image {
		width: auto;
	}

	.cinv-thumb {
		width: 40px;
		height: 40px;
	}

	.cinv-view-btn {
		padding: 4px 8px;
		font-size: 11px;
	}
}

/* ------------------------------------------------------------
 * تخمین‌گر زمان تحویل [car_invoice_estimator]
 * ------------------------------------------------------------ */
.cinv-estimator {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 16px 18px;
	margin: 20px 0;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
	font-family: inherit;
}

.cinv-estimator-title {
	margin: 0 0 6px;
	font-size: 16px;
	color: #1f2937;
}

.cinv-estimator-desc {
	margin: 0 0 14px;
	font-size: 13px;
	color: #6b7280;
	line-height: 1.8;
}

.cinv-estimator-row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: flex-end;
}

.cinv-estimator-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 180px;
}

.cinv-estimator-field--btn {
	min-width: 0;
}

.cinv-estimator-field label {
	font-size: 12.5px;
	color: #374151;
	font-weight: 600;
}

.cinv-estimator-field select,
.cinv-estimator-field input[type="text"] {
	padding: 8px 10px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 13px;
	background: #fff;
	color: #1f2937;
}

.cinv-estimator-btn {
	background: #1d4ed8;
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 9px 18px;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.cinv-estimator-btn:hover {
	background: #1e40af;
}

.cinv-estimator-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

.cinv-estimator-note {
	margin: 10px 0 0;
	font-size: 12px;
	color: #9ca3af;
}

.cinv-estimator-result {
	margin-top: 14px;
	font-size: 13.5px;
	line-height: 1.9;
	min-height: 1em;
}

.cinv-estimator-result.cinv-estimator-success {
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
	color: #065f46;
	border-radius: 8px;
	padding: 10px 12px;
}

.cinv-estimator-result.cinv-estimator-empty {
	background: #fffbeb;
	border: 1px solid #fde68a;
	color: #92400e;
	border-radius: 8px;
	padding: 10px 12px;
}

.cinv-estimator-result.cinv-estimator-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
	border-radius: 8px;
	padding: 10px 12px;
}

@media (max-width: 600px) {
	.cinv-estimator-row {
		flex-direction: column;
		align-items: stretch;
	}

	.cinv-estimator-field {
		min-width: 0;
	}

	.cinv-estimator-btn {
		width: 100%;
	}
}
