/* ===== متغیرهای مشترک ===== */
:root {
	--cl-brand: var(--wd-brand-color, #2563eb);
	--cl-bg: #f7f8fa;
	--cl-border: #e4e7eb;
	--cl-text: #1f2430;
	--cl-radius: 12px;
}

/* ===== آیکن ورود در هدر ===== */
.cl-icon-wrap { position: relative; display: inline-block; direction: rtl; }
.cl-icon-btn {
	display: flex; align-items: center; gap: 8px;
	background: none; border: none; cursor: pointer;
	color: inherit; font-size: 14px; font-weight: 600; padding: 6px 4px;
}
.cl-icon-label { white-space: nowrap; }
.cl-icon-dropdown {
	position: absolute; top: calc(100% + 10px); left: 0;
	background: #fff; border: 1px solid var(--cl-border); border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0,0,0,0.15); min-width: 200px; padding: 8px;
	display: none; z-index: 9999;
}
.cl-icon-wrap.cl-open .cl-icon-dropdown { display: block; }
.cl-dropdown-item {
	display: block; padding: 10px 14px; border-radius: 8px; text-decoration: none;
	color: var(--cl-text); font-size: 14px;
}
.cl-dropdown-item:hover { background: var(--cl-bg); }
.cl-dropdown-logout { color: #e11d48; }

/* ===== فرم ورود OTP ===== */
.cl-auth-wrap { direction: rtl; max-width: 440px; margin: 40px auto; padding: 0 15px; }
.cl-auth-card {
	background: #fff; border: 1px solid var(--cl-border); border-radius: var(--cl-radius);
	padding: 28px; box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.cl-auth-tabs { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid var(--cl-border); }
.cl-auth-tab {
	flex: 1; text-align: center; padding: 10px; text-decoration: none;
	color: #6b7280; font-size: 14px; font-weight: 600; border-bottom: 3px solid transparent;
}
.cl-auth-tab.cl-active { color: var(--cl-brand); border-bottom-color: var(--cl-brand); }
.cl-auth-title { font-size: 19px; font-weight: 700; margin: 0 0 6px; color: var(--cl-text); }
.cl-auth-sub { font-size: 13.5px; color: #6b7280; margin: 0 0 20px; }

.cl-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.cl-field label { font-size: 13.5px; font-weight: 600; color: var(--cl-text); }
.cl-field input, .cl-field textarea, .cl-field select {
	padding: 11px 14px; border: 1.5px solid var(--cl-border); border-radius: 8px;
	font-size: 15px; font-family: inherit; width: 100%; box-sizing: border-box; background: #fff;
}
.cl-field input:focus, .cl-field textarea:focus { outline: none; border-color: var(--cl-brand); }
.cl-field input:disabled { background: var(--cl-bg); color: #9ca3af; }

.cl-error { color: #e11d48; font-size: 13px; min-height: 16px; margin-bottom: 8px; }
.cl-msg { font-size: 13.5px; font-weight: 600; min-height: 18px; margin-bottom: 10px; }
.cl-msg.cl-success { color: #16a34a; }
.cl-msg.cl-error { color: #e11d48; }

.cl-btn-primary {
	width: 100%; padding: 13px; border: none; border-radius: 9px;
	background: var(--cl-brand); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
}
.cl-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.cl-btn-link {
	width: 100%; margin-top: 10px; background: none; border: none; color: var(--cl-brand);
	font-size: 13px; cursor: pointer; text-decoration: underline;
}

/* ===== داشبورد ===== */
.cl-dash-wrap { direction: rtl; max-width: 900px; margin: 30px auto; padding: 0 15px; }
.cl-dash-header {
	display: flex; justify-content: space-between; align-items: center;
	background: #fff; border: 1px solid var(--cl-border); border-radius: var(--cl-radius);
	padding: 20px; margin-bottom: 20px;
}
.cl-dash-title { font-size: 19px; font-weight: 700; color: var(--cl-text); }
.cl-dash-sub { font-size: 13px; color: #6b7280; margin-top: 4px; }
.cl-logout-link { color: #e11d48; text-decoration: none; font-size: 13.5px; font-weight: 600; }

.cl-tabs-nav {
	display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;
	background: #fff; border: 1px solid var(--cl-border); border-radius: var(--cl-radius); padding: 10px;
}
.cl-tab-btn {
	padding: 9px 16px; border: none; border-radius: 8px; background: var(--cl-bg);
	color: var(--cl-text); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.cl-tab-btn.cl-active { background: var(--cl-brand); color: #fff; }

.cl-tab-panel {
	display: none; background: #fff; border: 1px solid var(--cl-border); border-radius: var(--cl-radius); padding: 22px;
}
.cl-tab-panel.cl-active { display: block; }

.cl-hint { font-size: 13.5px; color: #6b7280; margin: 0 0 16px; line-height: 1.7; }
.cl-empty { color: #9ca3af; text-align: center; padding: 20px 0; }

.cl-table-wrap {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--cl-border);
	border-radius: 8px;
}
.cl-table { width: 100%; min-width: 640px; border-collapse: collapse; margin-top: 0; }
.cl-table th, .cl-table td { border: 1px solid var(--cl-border); padding: 10px; text-align: right; font-size: 13.5px; white-space: nowrap; }
.cl-table th { background: var(--cl-bg); font-weight: 700; }
.cl-btn-small { display: inline-block; padding: 5px 12px; border-radius: 6px; background: var(--cl-brand); color: #fff; text-decoration: none; font-size: 12.5px; border: none; cursor: pointer; }
.cl-inline-commission { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cl-commission-input { width: 90px; padding: 5px 8px; border: 1.5px solid var(--cl-border); border-radius: 6px; font-size: 12.5px; }
.cl-commission-saved-msg { font-size: 11.5px; font-weight: 600; }

.cl-vip-desc { font-size: 14px; line-height: 1.8; color: var(--cl-text); margin-bottom: 18px; }
.cl-vip-locked { background: var(--cl-bg); border: 1px dashed var(--cl-border); border-radius: 8px; padding: 16px; text-align: center; color: #6b7280; font-size: 13.5px; }

.cl-reward-box { background: var(--cl-bg); border: 1px solid var(--cl-border); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.cl-reward-label { font-size: 13px; color: #6b7280; margin-bottom: 4px; }
.cl-reward-value { font-size: 18px; font-weight: 700; color: var(--cl-brand); margin-bottom: 6px; }
.cl-reward-desc { font-size: 12.5px; color: #9ca3af; line-height: 1.6; }

.cl-docs-list { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.cl-doc-item { display: flex; justify-content: space-between; align-items: center; background: var(--cl-bg); border: 1px solid var(--cl-border); border-radius: 8px; padding: 10px 14px; font-size: 13.5px; }
.cl-doc-delete { background: none; border: none; color: #e11d48; font-size: 12.5px; cursor: pointer; }

/* ===== ریسپانسیو ===== */
@media (max-width: 600px) {
	.cl-dash-header { flex-direction: column; align-items: flex-start; gap: 10px; }

	/* نوار تب‌ها در موبایل: از حالت افقیِ اسکرول‌شونده به لیست عمودی و کامل */
	.cl-tabs-nav {
		flex-direction: column;
		flex-wrap: nowrap;
		overflow-x: visible;
		gap: 8px;
		padding: 10px;
	}
	.cl-tab-btn {
		width: 100%;
		white-space: normal;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 13px 16px;
		font-size: 14px;
		border-radius: 10px;
		background: var(--cl-bg);
		border: 1.5px solid transparent;
		transition: background 0.2s, border-color 0.2s;
	}
	.cl-tab-btn::after {
		content: "‹";
		font-size: 18px;
		opacity: 0.4;
		margin-right: 4px;
	}
	.cl-tab-btn.cl-active {
		background: #fff;
		color: var(--cl-brand);
		border-color: var(--cl-brand);
		box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
	}
	.cl-tab-btn.cl-active::after { opacity: 1; }

	.cl-table { font-size: 12px; min-width: 560px; }
	.cl-table th, .cl-table td { padding: 8px; }
	.cl-auth-card { padding: 20px; }
}

