/**
 * Affiliate dashboard — academy portal palette (indigo / navy, no teal/pink).
 */
.ao-affiliate-dashboard {
	--ao-aff-links-w: 240px;
	--ao-aff-primary: #4f46e5;
	--ao-aff-primary-deep: #1a1a2e;
	--ao-aff-accent: #6366f1;
	--ao-aff-accent-soft: #eef2ff;
	--ao-aff-surface: #f8fafc;
	--ao-aff-border: #e2e8f0;
	--ao-aff-muted: #64748b;
	--ao-aff-success: #4338ca;
	--ao-aff-warn: #b45309;
	max-width: 1120px;
	margin: 0 auto;
	padding: 1.75rem 1rem 2.5rem;
	font-family: 'Public Sans', system-ui, -apple-system, sans-serif;
	color: #0f172a;
	background:
		radial-gradient(ellipse 70% 45% at 0% 0%, rgba(79, 70, 229, 0.06), transparent 55%),
		radial-gradient(ellipse 50% 35% at 100% 0%, rgba(100, 116, 139, 0.05), transparent 50%);
}

.ao-shell-wrap .ao-affiliate-dashboard {
	max-width: none;
	margin: 0;
	padding: 0;
	background: transparent;
}

/* Match academy dashboard buttons; neutralize theme pink/magenta accents. */
.ao-shell-wrap[data-ao-shell="affiliate"] .ao-btn,
.ao-shell-wrap[data-ao-shell="affiliate"] .ao-btn-primary,
.ao-shell-wrap[data-ao-shell="affiliate"] button.ao-btn,
.ao-affiliate-dashboard .ao-btn,
.ao-affiliate-dashboard .ao-btn-primary {
	background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
	border-color: #4f46e5 !important;
	color: #fff !important;
	box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.ao-shell-wrap[data-ao-shell="affiliate"] .ao-btn:hover,
.ao-shell-wrap[data-ao-shell="affiliate"] .ao-btn-primary:hover,
.ao-affiliate-dashboard .ao-btn:hover,
.ao-affiliate-dashboard .ao-btn-primary:hover {
	background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%) !important;
	border-color: #4338ca !important;
	color: #fff !important;
}

.ao-shell-wrap[data-ao-shell="affiliate"] .ao-btn-outline,
.ao-affiliate-dashboard .ao-btn-outline {
	background: #fff !important;
	color: #1a1a2e !important;
	border-color: #cbd5e1 !important;
	box-shadow: none;
}

.ao-shell-wrap[data-ao-shell="affiliate"] .ao-btn-outline:hover,
.ao-affiliate-dashboard .ao-btn-outline:hover {
	background: #f8fafc !important;
	border-color: #94a3b8 !important;
	color: #1a1a2e !important;
}

.ao-shell-wrap[data-ao-shell="affiliate"] a:not(.ao-sidebar__link):not(.ao-sidebar__logout),
.ao-affiliate-dashboard a {
	color: #4f46e5;
}

.ao-affiliate-dashboard__header {
	margin-bottom: 1.35rem;
}

.ao-affiliate-dashboard__title {
	font-size: 1.625rem;
	font-weight: 700;
	margin: 0;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: #0f172a;
}

.ao-affiliate-dashboard__subtitle {
	font-size: 0.9375rem;
	color: var(--ao-aff-muted);
	margin: 0.35rem 0 0;
	max-width: 36rem;
	line-height: 1.45;
}

.ao-aff-sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Role label in shell foot */
[data-ao-shell="affiliate"] .ao-sidebar__user-role {
	text-transform: capitalize;
}

/* Links list lives in the Links tab, not under section nav */
.ao-aff-links-workspace {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	min-height: 360px;
}

@media (min-width: 900px) {
	.ao-aff-links-workspace {
		flex-direction: row;
		align-items: stretch;
		gap: 1.15rem;
	}
}

.ao-aff-links-panel {
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	min-height: 0;
	background: #fff;
	border: 1px solid var(--ao-aff-border);
	border-radius: 0.875rem;
	overflow: hidden;
}

@media (min-width: 900px) {
	.ao-aff-links-panel {
		width: var(--ao-aff-links-w);
	}
}

.ao-aff-links-workspace__main {
	flex: 1;
	min-width: 0;
}

.ao-aff-links-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.85rem 0.9rem;
	border-bottom: 1px solid var(--ao-aff-border);
	background: var(--ao-aff-surface);
}

.ao-aff-links-panel__title {
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 700;
	color: #0f172a;
	letter-spacing: -0.01em;
}

.ao-aff-links-panel__new {
	flex-shrink: 0;
	padding: 0.4rem 0.65rem;
	border: 1px solid #c7d2fe;
	border-radius: 0.45rem;
	background: var(--ao-aff-accent-soft);
	color: var(--ao-aff-primary-deep);
	font-size: 0.75rem;
	font-weight: 650;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ao-aff-links-panel__new:hover,
.ao-aff-links-panel__new.is-active {
	background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
	border-color: #4f46e5;
	color: #fff;
}

.ao-aff-links-panel__list {
	flex: 1;
	overflow-y: auto;
	padding: 0.5rem;
	margin: 0;
	list-style: none;
	max-height: 280px;
}

@media (min-width: 900px) {
	.ao-aff-links-panel__list {
		max-height: none;
	}
}

.ao-aff-link-item {
	margin-bottom: 0.25rem;
}

.ao-aff-link-item__btn {
	display: block;
	width: 100%;
	padding: 0.7rem 0.75rem;
	border: 1px solid transparent !important;
	border-radius: 0.5rem;
	background: transparent !important;
	background-color: transparent !important;
	color: #334155 !important;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
	box-shadow: none !important;
	text-decoration: none !important;
}

.ao-aff-link-item__btn:hover,
.ao-aff-link-item__btn:focus,
.ao-aff-link-item__btn:active {
	background: var(--ao-aff-surface) !important;
	background-color: var(--ao-aff-surface) !important;
	border-color: var(--ao-aff-border) !important;
	color: #0f172a !important;
	box-shadow: none !important;
}

.ao-aff-link-item__btn.is-active,
.ao-aff-link-item__btn.is-active:hover,
.ao-aff-link-item__btn.is-active:focus {
	background: var(--ao-aff-accent-soft) !important;
	background-color: var(--ao-aff-accent-soft) !important;
	border-color: #c7d2fe !important;
	color: #1a1a2e !important;
	box-shadow: none !important;
}

.ao-aff-link-item__title {
	font-size: 0.8125rem;
	font-weight: 650;
	line-height: 1.3;
	margin: 0;
	color: #0f172a !important;
}

.ao-aff-link-item__btn.is-active .ao-aff-link-item__title {
	color: #1a1a2e !important;
}

.ao-aff-link-item__meta {
	font-size: 0.6875rem;
	color: var(--ao-aff-muted) !important;
	margin: 0.2rem 0 0;
}

.ao-aff-link-item__badge {
	display: inline-block;
	padding: 0.12rem 0.4rem;
	border-radius: 999px;
	background: #e2e8f0;
	color: #475569;
	font-size: 0.625rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-top: 0.35rem;
	font-weight: 650;
}

.ao-aff-link-item__btn.is-active .ao-aff-link-item__badge {
	background: rgba(79, 70, 229, 0.15);
	color: var(--ao-aff-primary-deep);
}

.ao-aff-link-item__empty {
	font-size: 0.75rem;
	color: var(--ao-aff-muted);
	margin: 0;
	padding: 0.85rem 0.5rem;
	line-height: 1.45;
}

.ao-aff-main {
	flex: 1;
	min-width: 0;
	background: var(--ao-aff-surface);
	padding: 1.15rem;
	overflow-y: auto;
}

@media (min-width: 768px) {
	.ao-aff-main {
		padding: 1.5rem 1.75rem;
	}
}

.ao-aff-pane {
	display: none;
	animation: ao-aff-fade 0.2s ease;
}

.ao-aff-pane.is-active {
	display: block;
}

@keyframes ao-aff-fade {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.ao-aff-card {
	background: #fff;
	border: 1px solid var(--ao-aff-border);
	border-radius: 0.875rem;
	padding: 1.15rem 1.35rem;
	margin-bottom: 1rem;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.ao-aff-card:last-child {
	margin-bottom: 0;
}

.ao-aff-card--flush {
	padding: 0;
	overflow: hidden;
}

.ao-aff-card__title {
	font-size: 1rem;
	font-weight: 650;
	margin: 0 0 0.35rem;
	color: #0f172a;
	letter-spacing: -0.01em;
}

.ao-aff-card__hint {
	font-size: 0.8125rem;
	color: var(--ao-aff-muted);
	margin: 0 0 1rem;
	line-height: 1.45;
}

.ao-aff-callout {
	background: linear-gradient(135deg, #fff 0%, var(--ao-aff-accent-soft) 100%);
	border: 1px solid #c7d2fe;
	border-radius: 0.875rem;
	padding: 1rem 1.25rem;
	margin-bottom: 1rem;
}

.ao-aff-callout__label {
	font-size: 0.6875rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ao-aff-muted);
	font-weight: 600;
	margin: 0;
}

.ao-aff-callout__value {
	font-size: 1.35rem;
	font-weight: 700;
	margin: 0.25rem 0 0;
	color: var(--ao-aff-primary-deep);
	letter-spacing: -0.02em;
}

.ao-aff-stats {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.75rem;
	margin-bottom: 1rem;
}

@media (min-width: 640px) {
	.ao-aff-stats {
		grid-template-columns: repeat(4, 1fr);
	}
}

.ao-aff-stat {
	background: #fff;
	border: 1px solid var(--ao-aff-border);
	border-radius: 0.875rem;
	padding: 0.95rem 1rem;
	position: relative;
	overflow: hidden;
}

.ao-aff-stat::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: #cbd5e1;
}

.ao-aff-stat--pending::before {
	background: #f59e0b;
}

.ao-aff-stat--available::before {
	background: #6366f1;
}

.ao-aff-stat--paid::before {
	background: #4f46e5;
}

.ao-aff-stat__label {
	font-size: 0.6875rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ao-aff-muted);
	margin: 0;
	font-weight: 600;
}

.ao-aff-stat__value {
	font-size: 1.3rem;
	font-weight: 700;
	margin: 0.35rem 0 0;
	letter-spacing: -0.02em;
}

.ao-aff-verify-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.ao-aff-verify-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.65rem 0.75rem;
	background: #f8fafc;
	border: 1px solid var(--ao-aff-border);
	border-radius: 0.625rem;
}

.ao-aff-verify-item__label {
	font-size: 0.875rem;
	font-weight: 500;
	margin: 0;
	color: #334155;
}

.ao-aff-pill {
	display: inline-flex;
	align-items: center;
	padding: 0.15rem 0.55rem;
	border-radius: 999px;
	font-size: 0.6875rem;
	font-weight: 650;
	text-transform: capitalize;
	letter-spacing: 0.02em;
	line-height: 1.4;
}

.ao-aff-pill--ok {
	background: #eef2ff;
	color: var(--ao-aff-success);
}

.ao-aff-pill--pending {
	background: #fffbeb;
	color: var(--ao-aff-warn);
}

.ao-aff-pill--needed {
	background: #f1f5f9;
	color: #64748b;
}

.ao-aff-segment {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-bottom: 1rem;
	padding: 0.3rem;
	background: #f1f5f9;
	border-radius: 0.65rem;
	border: 1px solid var(--ao-aff-border);
}

.ao-aff-segment__btn {
	flex: 1 1 auto;
	min-width: 6.5rem;
	padding: 0.55rem 0.75rem;
	border: 1px solid transparent !important;
	border-radius: 0.45rem;
	background: transparent !important;
	background-color: transparent !important;
	color: #64748b !important;
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s, color 0.15s, box-shadow 0.15s;
	box-shadow: none !important;
	text-decoration: none !important;
}

.ao-aff-segment__btn:hover,
.ao-aff-segment__btn:focus,
.ao-aff-segment__btn:active {
	color: #0f172a !important;
	background: rgba(255, 255, 255, 0.7) !important;
	background-color: rgba(255, 255, 255, 0.7) !important;
	border-color: transparent !important;
	box-shadow: none !important;
}

.ao-aff-segment__btn.is-active,
.ao-aff-segment__btn.is-active:hover,
.ao-aff-segment__btn.is-active:focus {
	background: #fff !important;
	background-color: #fff !important;
	color: #1a1a2e !important;
	border-color: transparent !important;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

.ao-aff-type-hint {
	font-size: 0.8125rem;
	color: var(--ao-aff-muted);
	margin: 0.25rem 0 0;
	line-height: 1.45;
}

.ao-aff-type-hint.hidden {
	display: none;
}

.ao-aff-form-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: flex-end;
	margin-bottom: 0.5rem;
}

.ao-aff-form-field {
	flex: 1;
	min-width: 160px;
}

.ao-aff-form-field.hidden {
	display: none;
}

.ao-aff-form-field label,
.ao-aff-form-field .ao-label {
	display: block;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--ao-aff-muted);
	margin-bottom: 0.3rem;
}

.ao-aff-create-btn {
	flex-shrink: 0;
	min-height: 2.5rem;
}

.ao-aff-form-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
}

@media (min-width: 640px) {
	.ao-aff-form-grid {
		grid-template-columns: 1fr 1fr;
	}

	.ao-aff-form-field--full {
		grid-column: 1 / -1;
	}
}

.ao-aff-form-actions {
	margin: 1.25rem 0 0;
}

.ao-aff-actions-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	margin-bottom: 0.75rem;
}

.ao-aff-actions-row--code {
	align-items: flex-end;
}

.ao-aff-code-input {
	width: 8rem;
	max-width: 100%;
}

.ao-aff-pane-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.ao-aff-pane-toolbar__hint {
	font-size: 0.8125rem;
	color: var(--ao-aff-muted);
	margin: 0;
}

.ao-aff-table-wrap {
	overflow-x: auto;
}

.ao-aff-pricing-table,
.ao-aff-data-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.8125rem;
}

.ao-aff-pricing-table th,
.ao-aff-pricing-table td,
.ao-aff-data-table th,
.ao-aff-data-table td {
	padding: 0.65rem 0.85rem;
	border-bottom: 1px solid var(--ao-aff-border);
	text-align: left;
}

.ao-aff-pricing-table th,
.ao-aff-data-table th {
	font-weight: 650;
	color: var(--ao-aff-muted);
	font-size: 0.6875rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	background: #f8fafc;
}

.ao-aff-pricing-table td.num,
.ao-aff-pricing-table th.num,
.ao-aff-data-table td.num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.ao-aff-pricing-table .commission {
	color: var(--ao-aff-success);
	font-weight: 650;
}

.ao-aff-pricing-note {
	font-size: 0.75rem;
	color: var(--ao-aff-muted);
	margin: 0.75rem 0 0;
}

.ao-aff-detail-code {
	font-size: 0.8125rem;
	margin: 0 0 0.75rem;
	color: var(--ao-aff-muted);
}

.ao-aff-detail-code__label {
	font-weight: 600;
	margin-right: 0.35rem;
}

.ao-aff-detail-code code {
	font-size: 0.875rem;
	font-weight: 700;
	color: #3730a3;
	background: var(--ao-aff-accent-soft);
	padding: 0.15rem 0.45rem;
	border-radius: 0.35rem;
	letter-spacing: 0.04em;
}

.ao-aff-link-detail__url {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.25rem;
	padding: 0.75rem;
	background: #f8fafc;
	border: 1px solid var(--ao-aff-border);
	border-radius: 0.65rem;
}

.ao-aff-link-detail__url input {
	flex: 1;
	min-width: 200px;
	background: #fff;
}

.ao-aff-empty {
	font-size: 0.875rem;
	color: var(--ao-aff-muted);
	margin: 0;
	padding: 2rem 1.25rem;
	text-align: center;
	line-height: 1.5;
}

.ao-aff-card__head-pad {
	padding: 1.15rem 1.35rem 0.5rem;
}

.ao-aff-card__head-pad .ao-aff-card__hint {
	margin-bottom: 0.75rem;
}

.ao-aff-stats--analysis {
	margin-bottom: 1rem;
}

.ao-aff-muted-code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.75rem;
	color: var(--ao-aff-muted);
	letter-spacing: 0.03em;
}

.ao-aff-msg {
	font-size: 0.875rem;
	margin: 0 0 0.85rem;
	padding: 0.65rem 0.85rem;
	border-radius: 0.55rem;
	animation: ao-aff-fade 0.25s ease;
}

.ao-aff-msg.is-error {
	color: #b91c1c;
	background: #fef2f2;
	border: 1px solid #fecaca;
}

.ao-aff-msg.is-success {
	color: #3730a3;
	background: #eef2ff;
	border: 1px solid #c7d2fe;
}

.ao-aff-msg.hidden {
	display: none;
}

.ao-aff-join-card {
	text-align: center;
	padding: 2.5rem 1.75rem;
	background: #fff;
	border: 1px solid var(--ao-aff-border);
	border-radius: 1rem;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05);
	max-width: 28rem;
	margin: 0 auto;
}

.ao-aff-join-card__lead {
	color: #475569;
	margin: 0 0 1.25rem;
	line-height: 1.5;
	font-size: 0.9375rem;
}

.ao-aff-join-card .ao-aff-msg {
	margin-top: 1rem;
	margin-bottom: 0;
}

/*
 * Theme (pink #CC3366) often styles raw <button> elements.
 * Force academy palette on Links UI controls.
 */
.ao-shell-wrap[data-ao-shell="affiliate"] .ao-aff-segment__btn,
.ao-affiliate-dashboard .ao-aff-segment__btn,
.ao-shell-wrap[data-ao-shell="affiliate"] button.ao-aff-segment__btn,
.ao-affiliate-dashboard button.ao-aff-segment__btn {
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	border: 1px solid transparent !important;
	color: #64748b !important;
	box-shadow: none !important;
}

.ao-shell-wrap[data-ao-shell="affiliate"] .ao-aff-segment__btn.is-active,
.ao-affiliate-dashboard .ao-aff-segment__btn.is-active,
.ao-shell-wrap[data-ao-shell="affiliate"] button.ao-aff-segment__btn.is-active,
.ao-affiliate-dashboard button.ao-aff-segment__btn.is-active {
	background: #fff !important;
	background-color: #fff !important;
	background-image: none !important;
	color: #1a1a2e !important;
	border-color: transparent !important;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

.ao-shell-wrap[data-ao-shell="affiliate"] .ao-aff-link-item__btn,
.ao-affiliate-dashboard .ao-aff-link-item__btn,
.ao-shell-wrap[data-ao-shell="affiliate"] button.ao-aff-link-item__btn,
.ao-affiliate-dashboard button.ao-aff-link-item__btn {
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	border: 1px solid transparent !important;
	color: #334155 !important;
	box-shadow: none !important;
}

.ao-shell-wrap[data-ao-shell="affiliate"] .ao-aff-link-item__btn.is-active,
.ao-affiliate-dashboard .ao-aff-link-item__btn.is-active {
	background: #eef2ff !important;
	background-color: #eef2ff !important;
	border-color: #c7d2fe !important;
	color: #1a1a2e !important;
}

.ao-shell-wrap[data-ao-shell="affiliate"] .ao-aff-link-item__title,
.ao-affiliate-dashboard .ao-aff-link-item__title,
.ao-shell-wrap[data-ao-shell="affiliate"] .ao-aff-link-item__btn .ao-aff-link-item__title,
.ao-affiliate-dashboard .ao-aff-link-item__btn p {
	color: #0f172a !important;
}

.ao-shell-wrap[data-ao-shell="affiliate"] .ao-aff-links-panel__new,
.ao-affiliate-dashboard .ao-aff-links-panel__new,
.ao-shell-wrap[data-ao-shell="affiliate"] button.ao-aff-links-panel__new,
.ao-affiliate-dashboard button.ao-aff-links-panel__new {
	background: #eef2ff !important;
	background-image: none !important;
	border: 1px solid #c7d2fe !important;
	color: #1a1a2e !important;
	box-shadow: none !important;
}

.ao-shell-wrap[data-ao-shell="affiliate"] .ao-aff-links-panel__new.is-active,
.ao-shell-wrap[data-ao-shell="affiliate"] .ao-aff-links-panel__new:hover,
.ao-affiliate-dashboard .ao-aff-links-panel__new.is-active,
.ao-affiliate-dashboard .ao-aff-links-panel__new:hover {
	background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
	border-color: #4f46e5 !important;
	color: #fff !important;
}
