/**
 * Affiliate Payment Ledger - Frontend Salesperson Dashboard CSS
 */

.affwp-ledger-frontend-wrap {
	margin: 25px 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: #2c3338;
}

.affwp-ledger-intro {
	margin-bottom: 24px;
}

.affwp-ledger-title {
	font-size: 22px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 0 6px;
}

.affwp-ledger-desc {
	font-size: 14px;
	color: #666;
	margin: 0;
}

/* Salesperson Summary Cards Grid */
.affwp-ledger-summary-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 20px;
	margin-bottom: 35px;
}

.affwp-summary-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 22px;
	display: flex;
	align-items: flex-start;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	position: relative;
	overflow: hidden;
}

.affwp-summary-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.affwp-summary-card .card-icon-wrap {
	width: 46px;
	height: 46px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-right: 16px;
	flex-shrink: 0;
}

.affwp-summary-card.card-earned {
	border-top: 4px solid #3b82f6;
}

.affwp-summary-card.card-earned .card-icon-wrap {
	background: #eff6ff;
	color: #2563eb;
}

.affwp-summary-card.card-paid {
	border-top: 4px solid #10b981;
}

.affwp-summary-card.card-paid .card-icon-wrap {
	background: #ecfdf5;
	color: #059669;
}

.affwp-summary-card.card-balance.has-balance {
	border-top: 4px solid #f59e0b;
	background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
}

.affwp-summary-card.card-balance.has-balance .card-icon-wrap {
	background: #fef3c7;
	color: #d97706;
}

.affwp-summary-card.card-balance.settled {
	border-top: 4px solid #64748b;
}

.affwp-summary-card.card-balance.settled .card-icon-wrap {
	background: #f1f5f9;
	color: #64748b;
}

.affwp-summary-card .card-content {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.affwp-summary-card .card-label {
	font-size: 13px;
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 6px;
}

.affwp-summary-card .card-value {
	font-size: 26px;
	font-weight: 800;
	color: #0f172a;
	line-height: 1.2;
}

.affwp-summary-card .card-value.balance-value {
	color: #d97706;
}

.affwp-summary-card.card-balance.settled .balance-value {
	color: #059669;
}

.affwp-summary-card .card-hint {
	font-size: 12px;
	color: #94a3b8;
	margin-top: 6px;
}

/* History Section */
.affwp-ledger-history-section {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 24px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.affwp-ledger-section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-bottom: 16px;
	border-bottom: 1px solid #f1f5f9;
	margin-bottom: 20px;
}

.affwp-ledger-section-header h4 {
	font-size: 17px;
	font-weight: 700;
	color: #1e293b;
	margin: 0;
}

.affwp-ledger-count {
	font-size: 12px;
	font-weight: 600;
	color: #64748b;
	background: #f1f5f9;
	padding: 4px 10px;
	border-radius: 20px;
}

/* Table Responsive */
.affwp-ledger-table-responsive {
	overflow-x: auto;
}

.affwp-ledger-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	text-align: left;
}

.affwp-ledger-table th {
	background: #f8fafc;
	color: #475569;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 12px 16px;
	border-bottom: 1px solid #e2e8f0;
}

.affwp-ledger-table th:first-child {
	border-top-left-radius: 8px;
}

.affwp-ledger-table th:last-child {
	border-top-right-radius: 8px;
}

.affwp-ledger-table td {
	padding: 14px 16px;
	border-bottom: 1px solid #f1f5f9;
	font-size: 14px;
	color: #334155;
	vertical-align: middle;
}

.affwp-ledger-table tr:last-child td {
	border-bottom: none;
}

.affwp-ledger-table tr:hover td {
	background-color: #fafbfc;
}

.payment-amount {
	color: #047857;
	font-size: 15px;
	font-weight: 700;
}

.payment-ref {
	background: #f1f5f9;
	padding: 3px 6px;
	border-radius: 4px;
	font-family: monospace;
	font-size: 12px;
	color: #334155;
}

.method-tag {
	display: inline-block;
	padding: 3px 9px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	background: #e2e8f0;
	color: #475569;
}

.method-tag.method-check {
	background: #ecfdf5;
	color: #065f46;
}

.method-tag.method-direct_deposit,
.method-tag.method-ach {
	background: #eff6ff;
	color: #1e40af;
}

.method-tag.method-paypal {
	background: #fff7ed;
	color: #9a3412;
}

.payment-notes {
	font-size: 13px;
	color: #64748b;
}

/* Empty State */
.affwp-ledger-empty {
	text-align: center;
	padding: 45px 20px;
}

.affwp-ledger-empty .empty-icon {
	font-size: 44px;
	margin-bottom: 12px;
	opacity: 0.7;
}

.affwp-ledger-empty p {
	margin: 0 0 6px;
	font-size: 15px;
	color: #1e293b;
}

.affwp-ledger-empty .empty-sub {
	font-size: 13px;
	color: #64748b;
	max-width: 500px;
	margin: 0 auto;
	line-height: 1.5;
}

/* Mobile responsive fallback */
@media (max-width: 768px) {
	.affwp-ledger-summary-grid {
		grid-template-columns: 1fr;
	}

	.affwp-ledger-table thead {
		display: none;
	}

	.affwp-ledger-table tr {
		display: block;
		margin-bottom: 15px;
		border: 1px solid #e2e8f0;
		border-radius: 8px;
		padding: 10px 14px;
	}

	.affwp-ledger-table td {
		display: flex;
		justify-content: space-between;
		padding: 8px 0;
		border-bottom: 1px solid #f1f5f9;
	}

	.affwp-ledger-table td:last-child {
		border-bottom: none;
	}

	.affwp-ledger-table td::before {
		content: attr(data-th);
		font-weight: 600;
		color: #64748b;
		font-size: 12px;
		text-transform: uppercase;
	}
}
