/* Agent Commissions — Frontend (My Account) styles */

.wcac-dashboard { padding: 8px 0; }

.wcac-referral-box {
	background: #f0f7ff;
	border: 1px solid #c5d9f0;
	border-radius: 6px;
	padding: 16px 20px;
	margin-block-end: 24px;
}

.wcac-ref-link {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-block-start: 8px;
}

.wcac-ref-link input[type="text"] {
	flex: 1;
	min-width: 0;
	font-family: monospace;
	font-size: 13px;
}

/* Stats cards */
.wcac-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-block-end: 24px;
}

.wcac-stat-card {
	background: #fafafa;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	padding: 16px 24px;
	min-width: 140px;
}

.wcac-stat-net {
	border-color: #2271b1;
	background: #f0f7ff;
}

.wcac-stat-reversed {
	border-color: #d63638;
	background: #fcf0f1;
}

.wcac-stat-reversed .value {
	color: #d63638;
}

.wcac-stat-card .label {
	font-size: 11px;
	font-weight: 600;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-block-end: 6px;
}

.wcac-stat-card .value {
	font-size: 22px;
	font-weight: 700;
	color: #1d2327;
}

/* Commission table */
.wcac-table {
	width: 100%;
	border-collapse: collapse;
	margin-block-end: 16px;
}

.wcac-table th,
.wcac-table td {
	padding: 10px 12px;
	border-block-end: 1px solid #eee;
	text-align: start;
	vertical-align: middle;
}

.wcac-table th {
	background: #f5f5f5;
	font-weight: 600;
	font-size: 13px;
}

/* Status colours */
.wcac-status-pending   { color: #9e6c00; font-weight: 600; }
.wcac-status-approved  { color: #008a20; font-weight: 600; }
.wcac-status-paid      { color: #2271b1; font-weight: 600; }
.wcac-status-cancelled { color: #72777c; }
.wcac-status-reversed  { color: #d63638; font-weight: 600; }

.wcac-amount-negative {
	color: #d63638;
	font-weight: 600;
}

/* Pagination */
.wcac-pagination a,
.wcac-pagination strong {
	display: inline-block;
	min-width: 28px;
	padding: 4px 8px;
	margin-inline-end: 4px;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	text-align: center;
	text-decoration: none;
}

.wcac-pagination strong {
	background: #2271b1;
	color: #fff;
	border-color: #2271b1;
}

/* RTL support via logical properties — already uses margin-inline-start / margin-block-end above */

/* ── Affiliate registration form ────────────────────────── */

.wcac-register-box {
	max-width: 480px;
	margin: 0 auto;
	padding: 32px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.wcac-register-intro {
	margin-block-end: 20px;
	color: #555;
	line-height: 1.6;
}

.wcac-register-form p {
	margin-block-end: 16px;
}

.wcac-register-form label {
	display: block;
	font-weight: 600;
	margin-block-end: 4px;
}

.wcac-register-form .input-text {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 15px;
	box-sizing: border-box;
}

.wcac-register-form .input-text:focus {
	border-color: #2271b1;
	outline: none;
	box-shadow: 0 0 0 2px rgba(34,113,177,.2);
}

.wcac-register-form .button.alt {
	width: 100%;
	padding: 12px;
	font-size: 16px;
}

.wcac-register-login {
	text-align: center;
	color: #666;
	font-size: 13px;
	margin-block-start: 12px;
}

.wcac-register-success {
	background: #f0f7ff;
	border-color: #c5d9f0;
}

.wcac-footer-affiliate-link {
	text-align: center;
	padding: 12px;
	font-size: 13px;
}

.wcac-footer-affiliate-link a {
	color: inherit;
	text-decoration: underline;
}

/* ── Affiliate checkbox on WC registration form ─────── */

.wcac-affiliate-label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-weight: 400;
	cursor: pointer;
}

.wcac-affiliate-label input[type="checkbox"] {
	margin-block-start: 3px;
	flex-shrink: 0;
}

/* ── Smart notices ─────────────────────────────────── */

.wcac-notice {
	border-radius: 6px;
	padding: 14px 18px;
	margin-block-end: 20px;
	border-inline-start: 4px solid;
}

.wcac-notice strong {
	display: block;
	margin-block-end: 4px;
}

.wcac-notice p { margin: 4px 0 0; }

.wcac-notice-info {
	background: #f0f7ff;
	border-color: #2271b1;
	color: #1d2327;
}

.wcac-notice-success {
	background: #f0faf2;
	border-color: #008a20;
	color: #1d2327;
}

.wcac-notice-warning {
	background: #fffbf0;
	border-color: #9e6c00;
	color: #1d2327;
}

.wcac-notice-link {
	color: inherit;
	font-weight: 600;
}

/* ── Bank / payment info section ──────────────────── */

.wcac-bank-section {
	margin-block-start: 36px;
	padding-block-start: 24px;
	border-block-start: 1px solid #eee;
}

.wcac-bank-section h3 {
	margin-block-end: 4px;
}

.wcac-bank-section > .description {
	color: #666;
	margin-block-end: 18px;
}

.wcac-bank-form {
	max-width: 560px;
}

.wcac-bank-field {
	margin-block-end: 18px;
}

.wcac-bank-field label {
	display: block;
	font-weight: 600;
	margin-block-end: 5px;
}

.wcac-bank-field select,
.wcac-bank-field .input-text {
	width: 100%;
	max-width: 420px;
	padding: 9px 12px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 14px;
	box-sizing: border-box;
}

.wcac-bank-field textarea.input-text {
	resize: vertical;
}

.wcac-bank-field select:focus,
.wcac-bank-field .input-text:focus {
	border-color: #2271b1;
	outline: none;
	box-shadow: 0 0 0 2px rgba(34,113,177,.2);
}

.wcac-bank-field small {
	display: block;
	color: #666;
	font-size: 12px;
	margin-block-start: 4px;
}

/* ── Dashboard tabs ─────────────────────────────────── */

.wcac-tabs {
	display: flex;
	gap: 4px;
	border-block-end: 2px solid #e0e0e0;
	margin-block-end: 24px;
}

.wcac-tab-btn {
	background: none;
	border: none;
	padding: 10px 18px;
	font-size: 14px;
	font-weight: 600;
	color: #666;
	cursor: pointer;
	border-block-end: 2px solid transparent;
	margin-block-end: -2px;
}

.wcac-tab-btn:hover {
	color: #2271b1;
}

.wcac-tab-btn.wcac-tab-active {
	color: #2271b1;
	border-block-end-color: #2271b1;
}

.wcac-tab-panel[hidden] {
	display: none;
}

/* ── Commission filter form ────────────────────────── */

.wcac-filter-form {
	margin-block-end: 20px;
}

.wcac-filter-row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 16px;
}

.wcac-filter-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.wcac-filter-field label {
	font-size: 12px;
	font-weight: 600;
	color: #555;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.wcac-filter-field select,
.wcac-filter-field input[type="date"] {
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 14px;
	background: #fff;
	min-width: 140px;
}

.wcac-filter-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.wcac-btn-reset {
	background: transparent !important;
	color: #666 !important;
	border-color: #c3c4c7 !important;
	box-shadow: none !important;
}

.wcac-btn-reset:hover {
	color: #1d2327 !important;
	border-color: #8c8f94 !important;
}

@media (max-width: 600px) {
	.wcac-filter-row {
		flex-direction: column;
		align-items: stretch;
	}
	.wcac-filter-field select,
	.wcac-filter-field input[type="date"] {
		width: 100%;
	}
	.wcac-filter-actions {
		flex-direction: column;
		align-items: stretch;
	}
	.wcac-filter-actions .button {
		text-align: center;
	}
}

/* ── Mobile layout ──────────────────────────────────── */

@media (max-width: 782px) {

	.wcac-dashboard {
		padding: 4px 0;
	}

	/* Stats: steady 2-up grid instead of flex-wrap, which can leave an
	   orphaned card alone on its own row at odd widths. */
	.wcac-stats {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}

	.wcac-stat-card {
		min-width: 0;
		padding: 12px 14px;
	}

	.wcac-stat-card .value {
		font-size: 18px;
	}

	/* Tabs: scroll horizontally instead of wrapping onto a second line —
	   wrapped tab labels look broken and are hard to tap accurately. */
	.wcac-tabs {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.wcac-tabs::-webkit-scrollbar {
		display: none;
	}

	.wcac-tab-btn {
		flex: 0 0 auto;
		white-space: nowrap;
		padding: 10px 14px;
		font-size: 13px;
	}

	/* Tables: WooCommerce's shop_table_responsive pattern — hide the header
	   row and lay each cell out as a labelled row using data-title, so every
	   commission/payout becomes a readable card instead of a cramped,
	   horizontally-scrolling table. */
	.wcac-table thead {
		display: none;
	}

	.wcac-table,
	.wcac-table tbody,
	.wcac-table tr,
	.wcac-table td {
		display: block;
		width: 100%;
	}

	.wcac-table tr {
		border: 1px solid #e0e0e0;
		border-radius: 6px;
		margin-block-end: 12px;
		padding: 4px 12px;
	}

	.wcac-table td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 12px;
		padding: 8px 0;
		border-block-end: 1px solid #f0f0f0;
		text-align: end;
	}

	.wcac-table td:last-child {
		border-block-end: none;
	}

	.wcac-table td::before {
		content: attr(data-title);
		font-weight: 600;
		font-size: 12px;
		color: #666;
		text-transform: uppercase;
		letter-spacing: 0.03em;
		text-align: start;
		flex-shrink: 0;
	}

	.wcac-bank-form,
	.wcac-bank-field select,
	.wcac-bank-field .input-text {
		max-width: none;
	}
}
