/* XP dashboard tab — metric cards aligned with profile / exchange tokens */
.profile-page .xpd-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 20px;
}

.profile-page .xpd-period {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px;
	font-size: 13px;
	color: var(--pf-text-muted, #9ca3af);
}

.profile-page .xpd-period__label {
	font-weight: 600;
}

.profile-page .xpd-period__value {
	color: var(--pf-text, #f1f1f1);
	font-variant-numeric: tabular-nums;
}

.profile-page .xpd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 44px;
	padding: 0 18px;
	border-radius: var(--pf-radius-md, 12px);
	border: 1px solid transparent;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
	white-space: nowrap;
}

.profile-page .xpd-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.profile-page .xpd-btn--ghost {
	background: transparent;
	border-color: var(--pf-border, #393d40);
	color: var(--pf-text, #f1f1f1);
}

.profile-page .xpd-btn--ghost:hover:not(:disabled),
.profile-page .xpd-btn--ghost:focus-visible {
	border-color: var(--pf-accent, var(--lm-accent, #0d0dff));
	outline: none;
}

.profile-page .xpd-level {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-bottom: 20px;
	padding: 16px 18px;
	background: linear-gradient(
		135deg,
		color-mix(in srgb, var(--pf-accent, var(--lm-accent, #0d0dff)) 18%, var(--pf-surface-elevated, #272727)),
		var(--pf-surface-elevated, #272727)
	);
	border: 1px solid var(--pf-border, #393d40);
	border-radius: var(--pf-radius-md, 12px);
}

.profile-page .xpd-level__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	height: 48px;
	padding: 0 12px;
	border-radius: 14px;
	background: var(--pf-accent, var(--lm-accent, #0d0dff));
	color: var(--pf-on-accent, #fff);
	font-size: 18px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.profile-page .xpd-level__meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.profile-page .xpd-level__label {
	margin: 0;
	font-size: 12px;
	font-weight: 600;
	color: var(--pf-text-muted, #9ca3af);
}

.profile-page .xpd-level__title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--pf-text, #f1f1f1);
	line-height: 1.35;
	word-break: break-word;
}

.profile-page .xpd-metrics {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 14px;
	width: 100%;
	margin-bottom: 16px;
}

.profile-page .xpd-metric-card {
	background: var(--pf-surface-elevated, #272727);
	border: 1px solid var(--pf-border, #393d40);
	border-radius: var(--pf-radius-md, 12px);
	padding: 22px 18px;
	text-align: center;
	transition: border-color 0.2s ease, transform 0.2s ease;
}

.profile-page .xpd-metric-card:hover {
	border-color: var(--pf-accent, var(--lm-accent, #0d0dff));
	transform: translateY(-1px);
}

.profile-page .xpd-metric-card--accent {
	border-color: color-mix(in srgb, var(--pf-accent, var(--lm-accent, #0d0dff)) 45%, var(--pf-border, #393d40));
}

.profile-page .xpd-metric-card__label {
	margin: 0 0 12px;
	font-size: 13px;
	font-weight: 600;
	color: var(--pf-text-muted, #9ca3af);
	line-height: 1.4;
}

.profile-page .xpd-metric-card__num {
	margin: 0;
	font-size: 32px;
	font-weight: 800;
	color: var(--pf-text, #f1f1f1);
	font-variant-numeric: tabular-nums;
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.profile-page .xpd-metric-card__unit {
	margin-inline-start: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--pf-text-muted, #9ca3af);
}

.profile-page .xpd-hint {
	margin: 0;
	font-size: 13px;
	color: var(--pf-text-muted, #9ca3af);
	line-height: 1.5;
}

.profile-page .xpd-hint strong {
	color: var(--pf-text, #f1f1f1);
	font-weight: 600;
}

.profile-page .xpd-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 160px;
	padding: 28px 16px;
	text-align: center;
	color: var(--pf-text-muted, #9ca3af);
	border: 1px dashed var(--pf-border, #393d40);
	border-radius: var(--pf-radius-md, 12px);
	background: var(--pf-surface, #1c1c1c);
}

.profile-page .xpd-state--error {
	color: #fca5a5;
	border-color: color-mix(in srgb, #ef4444 40%, var(--pf-border, #393d40));
}

.profile-page .xpd-spinner {
	width: 28px;
	height: 28px;
	border: 3px solid var(--pf-border, #393d40);
	border-top-color: var(--pf-accent, var(--lm-accent, #0d0dff));
	border-radius: 50%;
	animation: xpd-spin 0.7s linear infinite;
}

@keyframes xpd-spin {
	to {
		transform: rotate(360deg);
	}
}

body.light-mode .profile-page .xpd-period__value,
body.light-mode .profile-page .xpd-level__title,
body.light-mode .profile-page .xpd-metric-card__num,
body.light-mode .profile-page .xpd-hint strong,
body.light-mode .profile-page .xpd-btn--ghost {
	color: var(--pf-text, #111827);
}

body.light-mode .profile-page .xpd-level,
body.light-mode .profile-page .xpd-metric-card,
body.light-mode .profile-page .xpd-state {
	background: var(--pf-surface-elevated, #fff);
}

@media (max-width: 640px) {
	.profile-page .xpd-metrics {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.profile-page .xpd-metric-card {
		padding: 18px 16px;
	}

	.profile-page .xpd-metric-card__num {
		font-size: 26px;
	}

	.profile-page .xpd-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.profile-page .xpd-btn {
		width: 100%;
	}
}

/* Embedded at top of تنظیمات پروفایل */
.profile-page .xpd-profile-section {
	margin-bottom: 28px;
	padding-bottom: 24px;
	border-bottom: 1px solid var(--pf-border, #393d40);
}

.profile-page .xpd-profile-section .tab-panel-header {
	margin-bottom: 16px;
}

.profile-page .xpd-profile-section .xpd-state {
	min-height: 120px;
}