/**
 * استایل داشبورد اقساط مشتری — قسطینو
 */

/* ===== ریست و پایه ===== */
.ci-client-dash {
	direction: rtl;
	text-align: right;
	font-family: inherit;
	max-width: 960px;
	margin: 0 auto;
}

/* ===== کارت‌های خلاصه ===== */
.ci-client-dash__cards {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
	margin-bottom: 28px;
}
.ci-client-dash__card {
	background: #fff;
	border-radius: 14px;
	padding: 18px 16px;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	box-shadow: 0 1px 4px rgba(0,0,0,.06);
	border: 1px solid #e5e7eb;
	transition: box-shadow .2s, transform .2s;
}
.ci-client-dash__card:hover {
	box-shadow: 0 4px 16px rgba(0,0,0,.08);
	transform: translateY(-2px);
}
.ci-client-dash__card-icon {
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
}
.ci-client-dash__card--paid .ci-client-dash__card-icon {
	background: #d1fae5;
	color: #059669;
}
.ci-client-dash__card--remain .ci-client-dash__card-icon {
	background: #fef3c7;
	color: #d97706;
}
.ci-client-dash__card--total .ci-client-dash__card-icon {
	background: #eef2ff;
	color: #6366f1;
}
.ci-client-dash__card--next .ci-client-dash__card-icon {
	background: #fce7f3;
	color: #db2777;
}
.ci-client-dash__card-body {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.ci-client-dash__card-label {
	font-size: .78rem;
	color: #6b7280;
	margin-bottom: 2px;
}
.ci-client-dash__card-value {
	font-size: 1.25rem;
	font-weight: 700;
	color: #111827;
	line-height: 1.3;
}
.ci-client-dash__card-value small {
	font-size: .7em;
	font-weight: 500;
	color: #9ca3af;
}
.ci-client-dash__card-sub {
	font-size: .8rem;
	color: #6b7280;
	margin-top: 2px;
}

/* ===== حالت خالی ===== */
.ci-client-dash__empty {
	text-align: center;
	padding: 48px 16px;
	color: #9ca3af;
}
.ci-client-dash__empty svg {
	margin-bottom: 12px;
	color: #d1d5db;
}
.ci-client-dash__empty p {
	font-size: 1rem;
	margin: 0;
}

/* ===== گروه سفارش ===== */
.ci-client-dash__order-group {
	background: #fff;
	border-radius: 14px;
	border: 1px solid #e5e7eb;
	box-shadow: 0 1px 4px rgba(0,0,0,.04);
	margin-bottom: 20px;
	overflow: hidden;
}
.ci-client-dash__order-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 14px 18px;
	background: #f9fafb;
	border-bottom: 1px solid #e5e7eb;
}
.ci-client-dash__order-title {
	font-size: .95rem;
	font-weight: 700;
	color: #374151;
}
.ci-client-dash__order-title small {
	font-weight: 400;
	color: #9ca3af;
	margin-right: 6px;
}
.ci-client-dash__order-link {
	font-size: .82rem;
	color: #6366f1;
	text-decoration: none;
	font-weight: 500;
}
.ci-client-dash__order-link:hover {
	text-decoration: underline;
}

.ci-client-dash__order-plan {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 18px;
	background: #fff;
	border-bottom: 1px solid #eef2f7;
	color: #64748b;
	font-size: .82rem;
}

.ci-client-dash__order-plan strong {
	color: #111827;
	font-size: .9rem;
}

/* ===== جدول ===== */
.ci-client-dash__table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
.ci-client-dash__table {
	width: 100%;
	border-collapse: collapse;
	min-width: 540px;
}
.ci-client-dash__table thead th {
	padding: 10px 14px;
	font-size: .78rem;
	font-weight: 600;
	color: #6b7280;
	text-align: right;
	background: #fafafa;
	border-bottom: 1px solid #e5e7eb;
	white-space: nowrap;
}
.ci-client-dash__table tbody td {
	padding: 12px 14px;
	font-size: .88rem;
	color: #374151;
	border-bottom: 1px solid #f3f4f6;
	vertical-align: middle;
}
.ci-client-dash__table tbody tr:last-child td {
	border-bottom: none;
}

/* شماره قسط */
.ci-client-dash__inst-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background: #eef2ff;
	color: #6366f1;
	font-weight: 700;
	font-size: .82rem;
}

/* بج وضعیت */
.ci-client-dash__badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: .76rem;
	font-weight: 600;
	white-space: nowrap;
}
.ci-client-dash__badge--paid {
	background: #d1fae5;
	color: #065f46;
}
.ci-client-dash__badge--pending {
	background: #fef3c7;
	color: #92400e;
}
.ci-client-dash__badge--overdue {
	background: #fee2e2;
	color: #991b1b;
}

/* دکمه پرداخت */
.ci-client-dash__pay-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 5px 14px;
	border-radius: 8px;
	border: 1px solid #6366f1;
	background: #6366f1;
	color: #fff;
	text-decoration: none;
	font-size: .8rem;
	font-weight: 600;
	cursor: pointer;
	transition: background .2s, opacity .2s;
}
.ci-client-dash__pay-btn:hover {
	background: #4f46e5;
}
.ci-client-dash__pay-btn:disabled {
	opacity: .5;
	cursor: not-allowed;
	background: #a5b4fc;
	border-color: #a5b4fc;
}
.ci-client-dash__paid-check {
	color: #059669;
	font-size: 1.1rem;
	font-weight: 700;
}

/* ===== هاور ردیف ===== */
.ci-client-dash__table tbody tr:hover {
	background: #f9fafb;
}

/* ===== خط رنگی سمت راست ردیف ===== */
.ci-client-dash__row--paid td:first-child {
	box-shadow: inset 3px 0 0 #059669;
}
.ci-client-dash__row--pending td:first-child {
	box-shadow: inset 3px 0 0 #f59e0b;
}
.ci-client-dash__row--overdue td:first-child {
	box-shadow: inset 3px 0 0 #ef4444;
}
.ci-client-dash__row--down-payment {
	background: #fffbeb;
}
.ci-client-dash__row--down-payment td:first-child {
	box-shadow: inset 3px 0 0 #f59e0b;
}

/* ===== ریسپانسیو ===== */
@media (max-width: 768px) {
	.ci-client-dash__cards {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}
}
@media (max-width: 520px) {
	.ci-client-dash__cards {
		grid-template-columns: 1fr;
	}
	.ci-client-dash__card {
		padding: 14px 12px;
	}
	.ci-client-dash__order-header,
	.ci-client-dash__order-plan {
		align-items: flex-start;
		flex-direction: column;
	}
	/* جدول ریسپانسیو — تبدیل به کارت */
	.ci-client-dash__table,
	.ci-client-dash__table thead,
	.ci-client-dash__table tbody,
	.ci-client-dash__table th,
	.ci-client-dash__table td,
	.ci-client-dash__table tr {
		display: block;
	}
	.ci-client-dash__table thead {
		display: none;
	}
	.ci-client-dash__table tbody td {
		padding: 8px 14px;
		text-align: right;
		position: relative;
		padding-right: 45%;
		border-bottom: 1px solid #f3f4f6;
	}
	.ci-client-dash__table tbody td::before {
		content: attr(data-label);
		position: absolute;
		right: 14px;
		font-size: .78rem;
		font-weight: 600;
		color: #6b7280;
	}
	.ci-client-dash__table tbody tr {
		margin-bottom: 10px;
		border: 1px solid #e5e7eb;
		border-radius: 10px;
		overflow: hidden;
	}
	.ci-client-dash__row--paid td:first-child,
	.ci-client-dash__row--pending td:first-child,
	.ci-client-dash__row--overdue td:first-child,
	.ci-client-dash__row--down-payment td:first-child {
		box-shadow: none;
	}
	.ci-client-dash__row--paid { border-right: 3px solid #059669; }
	.ci-client-dash__row--pending { border-right: 3px solid #f59e0b; }
	.ci-client-dash__row--overdue { border-right: 3px solid #ef4444; }
}
