/**
 * Affiliate Management — light overrides only.
 * Prefer Tutor LMS / theme classes for structure.
 */

.am-empty-state {
	padding: 1.5rem 0;
}

.am-empty-state__headline {
	margin: 0 0 0.5rem;
	font-size: 1.05rem;
	color: var(--jbs-ink, #1c1d1f);
}

.am-empty-state__message {
	margin: 0;
	opacity: 0.85;
	color: var(--jbs-text, #2d2f31);
	max-width: 32rem;
}

.am-empty-state__actions {
	margin-top: 1.25rem;
}

.am-empty-state__actions .tutor-btn,
.am-empty-state__actions .button {
	text-decoration: none;
}

.am-table-empty {
	position: relative;
	margin: 1rem 0;
	min-height: 14rem;
	overflow: hidden;
	border-radius: 0.5rem;
}

.am-table--ghost {
	pointer-events: none;
	user-select: none;
	opacity: 0.45;
	filter: grayscale(0.15);
}

.am-table--ghost th {
	color: #9ca3af;
}

.am-table--ghost__cell {
	display: block;
	height: 0.7rem;
	border-radius: 0.25rem;
	background: rgba(0, 0, 0, 0.06);
}

.am-empty-state--overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 2rem 1.5rem;
	text-align: center;
	background: linear-gradient(
		180deg,
		rgba(255, 255, 255, 0.72) 0%,
		rgba(255, 255, 255, 0.92) 45%,
		rgba(255, 255, 255, 0.96) 100%
	);
}

.am-empty-state--overlay .am-empty-state__headline {
	font-size: 1.125rem;
}

.am-empty-state--overlay .am-empty-state__message {
	max-width: 28rem;
}

.am-admin-tabs {
	display: flex;
	gap: 1rem;
	margin: 1rem 0 1.5rem;
}

.am-admin-tabs__item {
	text-decoration: none;
}

.am-admin-tabs__item.is-active {
	font-weight: 600;
}

/* Horizontal sub-nav tabs (Affiliate Program / Affiliate dashboard). */
.am-sub-nav {
	margin: 0 0 1.25rem;
}

.am-sub-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.am-sub-nav li {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Inactive: muted text only — theme link color must not win. */
.tutor-dashboard .am-sub-nav a,
.am-sub-nav a {
	display: inline-flex;
	align-items: center;
	padding: 0.5rem 0.95rem;
	border-radius: 0.5rem;
	background: transparent !important;
	color: #6b7280 !important;
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.3;
	text-decoration: none;
	box-shadow: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.tutor-dashboard .am-sub-nav a:hover,
.tutor-dashboard .am-sub-nav a:focus,
.am-sub-nav a:hover,
.am-sub-nav a:focus {
	background: transparent !important;
	color: #374151 !important;
	outline: none;
}

/* Active only: light-blue pill. */
.tutor-dashboard .am-sub-nav li.is-active a,
.tutor-dashboard .am-sub-nav li.is-active a:hover,
.tutor-dashboard .am-sub-nav li.is-active a:focus,
.am-sub-nav li.is-active a,
.am-sub-nav li.is-active a:hover,
.am-sub-nav li.is-active a:focus {
	background: #e0f6fd !important;
	color: #0e95d0 !important;
	font-weight: 600;
}

.am-dashboard-panel {
	margin-top: 0.25rem;
	padding: 1.25rem 1.35rem 1.5rem;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 0.75rem;
}

.am-dashboard-panel > h2,
.am-dashboard-panel > .tutor-h4 {
	margin: 0 0 1rem;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--jbs-ink, #1c1d1f);
}

.am-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0.5rem 0 0;
	background: #fff;
}

.am-table th,
.am-table td {
	padding: 0.75rem 0.85rem;
	text-align: left;
	vertical-align: middle;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.am-table th {
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: #6b7280;
	background: rgba(0, 0, 0, 0.02);
}

.am-table tbody tr:last-child td {
	border-bottom: none;
}

.am-stat-list {
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0;
	display: grid;
	gap: 0.75rem;
}

.am-stat-list li {
	padding: 0.75rem 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.am-overview--affiliate .am-overview__stats {
	grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
	margin-bottom: 1rem;
}

.am-overview--affiliate .am-overview__hint {
	margin: 0;
	font-size: 0.9rem;
	color: var(--jbs-text-muted, #6a6f73);
}

.am-overview--affiliate .am-overview__hint .tutor-btn {
	margin-top: 0.25rem;
}

.am-table a {
	color: var(--tutor-color-primary, #3e64de);
	text-decoration: none;
	font-weight: 600;
}

.am-table a:hover,
.am-table a:focus {
	text-decoration: underline;
}

.am-form p {
	margin: 0 0 1rem;
}

.am-form label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
}

.am-form input[type="number"],
.am-form input[type="text"],
.am-form select,
.am-form textarea {
	max-width: 28rem;
	width: 100%;
}

/* Theme-aligned dashboard forms (Withdrawals, Settings, etc.). */
.am-form--theme {
	max-width: 28rem;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	margin: 0 0 1.5rem;
}

.am-form--theme .am-form__field {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 0;
}

.am-form--theme .tutor-form-label {
	display: block;
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	color: var(--jbs-ink, #1c1d1f);
}

.am-form--theme .tutor-form-control,
.am-form--theme .tutor-form-select {
	width: 100%;
	max-width: none;
	box-sizing: border-box;
	background: #fff;
	border: 1px solid var(--jbs-border, #d1d7dc);
	border-radius: 0;
	padding: 0.85rem 1rem;
	min-height: 48px;
	line-height: 1.4;
	box-shadow: none;
	color: var(--jbs-text, #2d2f31);
	font-size: 0.95rem;
	appearance: none;
}

.am-form--theme select.tutor-form-control,
.am-form--theme .tutor-form-select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 1rem center;
	padding-right: 2.5rem;
}

.am-form--theme .tutor-form-control:focus,
.am-form--theme .tutor-form-select:focus {
	outline: none;
	border-color: var(--tutor-color-primary, #3e64de);
	box-shadow: 0 0 0 3px rgba(62, 100, 222, 0.15);
}

.am-form--theme .am-form__actions {
	margin: 0.25rem 0 0;
}

.am-form--theme .tutor-btn:disabled,
.am-form--theme .tutor-btn[disabled] {
	opacity: 0.55;
	cursor: not-allowed;
}

/* Wider offer form so preview grid is not crushed. */
.am-form--theme.am-form--offer {
	max-width: 40rem;
}

.am-form--theme .am-form__row {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.25rem;
}

.am-form--theme .am-form__row .am-form__field {
	min-width: 0;
}

.am-input-affix {
	position: relative;
	display: block;
	width: 100%;
}

.am-input-affix .tutor-form-control {
	width: 100%;
}

.am-input-affix.is-percent .tutor-form-control {
	padding-right: 2.5rem;
}

.am-input-affix__suffix {
	display: none;
	position: absolute;
	top: 50%;
	right: 1rem;
	transform: translateY(-50%);
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--jbs-text, #2d2f31);
	pointer-events: none;
	line-height: 1;
}

.am-input-affix.is-percent .am-input-affix__suffix {
	display: block;
}

.am-form--theme .tutor-h5 {
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--jbs-ink, #1c1d1f);
}

.am-earnings-preview .am-preview-grid {
	border-radius: 0.75rem;
	background: #fff;
}

.am-preview-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
	gap: 0.75rem 1.25rem;
	margin: 0 0 0.5rem;
	padding: 1rem;
	border: 1px solid rgba(0, 0, 0, 0.08);
}

@media (max-width: 640px) {
	.am-form--theme .am-form__row {
		grid-template-columns: 1fr;
	}
}

.am-preview-grid dt {
	margin: 0;
	font-size: 0.85rem;
	opacity: 0.75;
}

.am-preview-grid dd {
	margin: 0.15rem 0 0;
	font-weight: 600;
}

.am-notice {
	padding: 0.75rem 1rem;
	margin: 0 0 1rem;
	border-left: 4px solid #2271b1;
	background: #f0f6fc;
}

.am-notice--error {
	border-left-color: #d63638;
	background: #fcf0f1;
}

.am-notice--success {
	border-left-color: #00a32a;
	background: #edfaef;
}

.am-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.65rem;
	margin: 1rem 0 1.25rem;
}

.am-filters__field {
	box-sizing: border-box;
	min-height: 2.5rem;
	min-width: 10.5rem;
	padding: 0.55rem 0.75rem;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 0.5rem;
	background: #fff;
	color: #1f2937;
	font: inherit;
	font-size: 0.9rem;
	line-height: 1.35;
	appearance: none;
	-webkit-appearance: none;
}

.am-filters select.am-filters__field {
	padding-right: 2rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	background-size: 0.7rem;
}

.am-filters__field::placeholder {
	color: #9ca3af;
}

.am-filters__field:hover {
	border-color: rgba(0, 0, 0, 0.22);
}

.am-filters__field:focus {
	outline: none;
	border-color: #1f2937;
	box-shadow: 0 0 0 3px rgba(31, 41, 55, 0.08);
}

.am-filters__submit {
	box-sizing: border-box;
	min-height: 2.5rem;
	padding: 0.55rem 1.1rem;
	border: 1px solid #1f2937;
	border-radius: 0.5rem;
	background: #1f2937;
	color: #fff;
	font: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.35;
	cursor: pointer;
}

.am-filters__submit:hover {
	background: #111827;
	border-color: #111827;
}

.am-filters__submit:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(31, 41, 55, 0.16);
}

.am-link {
	word-break: break-all;
	font-size: 0.85rem;
}

.am-link-row {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
}

.am-link-row .am-link {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
}

.am-link-copy {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	height: auto;
	padding: 0.15rem;
	margin: 0;
	border: none;
	border-radius: 0;
	background: transparent;
	color: var(--jbs-ink, #1c1d1f);
	cursor: pointer;
	box-shadow: none;
	transition: color 0.15s ease, opacity 0.15s ease;
}

.am-link-copy:hover,
.am-link-copy:focus {
	background: transparent;
	border: none;
	color: var(--jbs-accent, #13aff0);
	box-shadow: none;
}

.am-link-copy:focus-visible {
	outline: none;
	box-shadow: var(--jbs-focus-ring, 0 0 0 3px rgba(19, 175, 240, 0.25));
}

.am-link-copy.is-copied {
	color: var(--jbs-accent, #13aff0);
	opacity: 0.75;
}

.am-link-copy__icon {
	display: block;
	width: 1.375rem;
	height: 1.375rem;
}

.am-link-copy .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.am-mark-paid-form {
	margin-top: 0.75rem;
	padding: 0.75rem;
	border: 1px solid rgba(0, 0, 0, 0.1);
	background: #fff;
}

.am-status-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 1rem 0 1.25rem;
	padding: 0;
	border: none;
	background: transparent;
}

.am-status-tabs .nav-tab {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	margin: 0;
	padding: 0.45rem 0.85rem;
	border: none;
	border-radius: 0.5rem;
	background: transparent;
	color: #4b5563;
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.3;
	text-decoration: none;
	box-shadow: none;
}

.am-status-tabs .nav-tab:hover,
.am-status-tabs .nav-tab:focus {
	background: rgba(224, 246, 253, 0.55);
	color: #0e95d0;
	outline: none;
}

.am-status-tabs .nav-tab.nav-tab-active,
.am-status-tabs .nav-tab.nav-tab-active:hover,
.am-status-tabs .nav-tab.nav-tab-active:focus {
	background: #e0f6fd;
	color: #0e95d0;
	font-weight: 600;
}

.am-status-tabs .count {
	opacity: 0.7;
	font-weight: 400;
}

.am-actions .button {
	margin: 0 0.25rem 0.25rem 0;
}

.am-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
}

.am-actions form {
	display: inline-flex;
	margin: 0;
}

.am-actions .tutor-btn {
	margin: 0;
}

.am-btn--danger,
.am-actions .am-btn--danger {
	color: var(--jbs-danger, #d32f2f) !important;
	border-color: transparent !important;
	background: transparent !important;
}

.am-btn--danger:hover,
.am-btn--danger:focus,
.am-actions .am-btn--danger:hover,
.am-actions .am-btn--danger:focus {
	color: var(--jbs-danger, #d32f2f) !important;
	background: rgba(211, 47, 47, 0.08) !important;
	border-color: transparent !important;
}

/* Affiliate Management — Dashboard overview layout */
.am-overview {
	position: relative;
	margin-top: 0.75rem;
}

.am-overview__stats {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
	gap: 0.85rem;
	margin-bottom: 1.25rem;
}

.am-overview__card {
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 0.75rem;
	padding: 1rem 1.1rem;
	min-height: 5.5rem;
}

.am-overview__card-label {
	font-size: 0.8rem;
	opacity: 0.7;
	margin-bottom: 0.35rem;
}

.am-overview__card-value {
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.2;
	color: #1f2937;
}

.am-overview__card-meta {
	margin-top: 0.35rem;
	font-size: 0.75rem;
	opacity: 0.65;
}

.am-overview__panels {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: 1rem;
}

.am-overview__panel {
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 0.75rem;
	padding: 1rem 1.15rem 1.15rem;
	min-height: 12rem;
}

.am-overview__panel h2 {
	margin: 0 0 0.85rem;
	font-size: 1rem;
}

.am-overview__panel-placeholder {
	min-height: 7.5rem;
	border-radius: 0.5rem;
	background: repeating-linear-gradient(
		-45deg,
		rgba(0, 0, 0, 0.03),
		rgba(0, 0, 0, 0.03) 8px,
		rgba(0, 0, 0, 0.06) 8px,
		rgba(0, 0, 0, 0.06) 16px
	);
}

.am-overview--empty .am-overview__body {
	filter: grayscale(0.15);
}

.am-overview__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	background: rgba(255, 255, 255, 0.72);
	backdrop-filter: blur(1px);
	border-radius: 0.75rem;
	z-index: 2;
}

.am-overview__overlay-card {
	max-width: 28rem;
	text-align: center;
	padding: 1.25rem 1.5rem;
	background: rgba(255, 255, 255, 0.95);
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 0.75rem;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.am-overview__overlay-headline {
	margin: 0 0 0.5rem;
	font-size: 1.05rem;
	color: #111827;
}

.am-overview__overlay-message {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.45;
	color: #4b5563;
}

.am-overview__overlay-card .am-empty-state__actions {
	margin-top: 1.15rem;
}

/* Payment account modal step form */
body.am-pa-modal-open {
	overflow: hidden;
}

.am-pa-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
}

.am-pa-modal.is-open,
.am-pa-modal:not([hidden]) {
	display: flex;
}

.am-pa-modal[hidden] {
	display: none !important;
}

.am-pa-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
}

.am-pa-modal__window {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 28rem;
	max-height: min(90vh, 40rem);
	overflow: auto;
	background: #fff;
	border-radius: 0.5rem;
	box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
	padding: 2.75rem 1.5rem 1.25rem;
}

.am-pa-modal__close {
	position: absolute;
	top: 0.65rem;
	right: 0.75rem;
	z-index: 2;
	border: 0;
	background: transparent;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	color: #6b7280;
	padding: 0.15rem 0.35rem;
}

.am-pa-modal__close:hover,
.am-pa-modal__close:focus-visible {
	color: #111827;
}

.am-pa-modal__title {
	margin: 0 0 1.15rem;
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.25;
	color: #111827;
}

.am-pa-modal__field {
	margin-bottom: 1rem;
}

.am-pa-modal__label {
	display: block;
	margin-bottom: 0.4rem;
	font-size: 0.95rem;
	font-weight: 500;
	color: #374151;
}

.am-pa-modal__control {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 0.45rem 0.6rem;
	border: 1px solid #c5c9d0;
	border-radius: 0.2rem;
	background: #fff;
	font-size: 0.95rem;
	line-height: 1.4;
	color: #111827;
}

.am-pa-modal__control:focus {
	outline: 2px solid rgba(59, 130, 246, 0.35);
	outline-offset: 1px;
	border-color: #93c5fd;
}

.am-pa-modal__hint {
	margin: 0.35rem 0 0;
	font-size: 0.85rem;
	color: #6b7280;
}

.am-pa-modal__static {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.45;
	color: #374151;
}

.am-pa-modal__check {
	display: flex;
	align-items: flex-start;
	gap: 0.45rem;
	font-size: 0.9rem;
	color: #374151;
}

.am-pa-modal__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.5rem;
}

.am-pa-modal__btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 4.5rem;
	padding: 0.35rem 0.85rem;
	border: 1px solid #b8bec8;
	border-radius: 0.2rem;
	background: #f3f4f6;
	color: #111827;
	font-size: 0.9rem;
	line-height: 1.35;
	cursor: pointer;
}

.am-pa-modal__btn:hover,
.am-pa-modal__btn:focus-visible {
	background: #e5e7eb;
}

.am-pa-modal__btn--primary {
	background: #2563eb;
	border-color: #2563eb;
	color: #fff;
}

.am-pa-modal__btn--primary:hover,
.am-pa-modal__btn--primary:focus-visible {
	background: #1d4ed8;
	border-color: #1d4ed8;
	color: #fff;
}

.am-pa-modal__cancel {
	margin: 1rem 0 0;
}

.am-pa-modal__cancel a,
.am-pa-modal__cancel-btn {
	appearance: none;
	border: 0;
	background: transparent;
	padding: 0;
	font-size: 0.95rem;
	color: #60a5fa;
	text-decoration: none;
	cursor: pointer;
}

.am-pa-modal__cancel a:hover,
.am-pa-modal__cancel-btn:hover {
	color: #3b82f6;
	text-decoration: underline;
}

.am-wizard__progress {
	display: flex;
	gap: 0.35rem;
	margin: 0 1.75rem 1.25rem 0;
}

.am-wizard__progress span {
	flex: 1;
	height: 3px;
	border-radius: 999px;
	background: #e5e7eb;
}

.am-wizard__progress span.is-active,
.am-wizard__progress span.is-done {
	background: #93c5fd;
}

.am-wizard__panel {
	margin-bottom: 0.25rem;
}

.am-review-summary {
	padding: 0.75rem 1rem;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 0.35rem;
	margin-bottom: 1rem;
	background: #f9fafb;
	font-size: 0.92rem;
}

.am-review-summary p {
	margin: 0 0 0.4rem;
}

.am-review-summary p:last-child {
	margin-bottom: 0;
}

.am-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

@media (max-width: 480px) {
	.am-pa-modal__window {
		padding: 2.5rem 1rem 1rem;
	}

	.am-pa-modal__actions {
		width: 100%;
	}

	.am-pa-modal__btn {
		flex: 1;
	}
}

/* Affiliate registration signup */
.am-registration .am-notice {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border-radius: 0.375rem;
}

.am-registration .am-notice--error {
	background: #fef2f2;
	color: #991b1b;
}

.am-registration .am-notice--success {
	background: #ecfdf5;
	color: #065f46;
}

.am-registration .am-notice p {
	margin: 0;
}

.am-registration__form .tutor-form-check {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
}

.am-registration__form .tutor-form-check-label {
	line-height: 1.4;
}

