.swanpay-dashboard {
	max-width: 1200px;
	border: 0;
	background: transparent;
	box-shadow: none;
	overflow: visible;
}

.dashboard-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 24px;
	padding: 16px 0 24px;
}

.dashboard-header p, .muted, small {
	color: var(--sp-muted);
	font-size: 14px;
	line-height: 1.6;
}

.environment-control {
	display: grid;
	grid-template-columns: auto 110px;
	align-items: center;
	gap: 8px 12px;
}

.environment-control label {
	margin: 0;
}

#connection-status {
	grid-column: 2;
	font-size: 13px;
	color: var(--sp-muted);
}

.dashboard-tabs {
	display: flex;
	gap: 8px;
	border-bottom: 1px solid var(--sp-line);
	margin-bottom: 24px;
	overflow-x: auto;
}

.dashboard-tabs button {
	border: 0;
	border-bottom: 3px solid transparent;
	padding: 14px 20px;
	background: transparent;
	font: inherit;
	color: var(--sp-muted);
	cursor: pointer;
}

.dashboard-tabs button[aria-selected=true] {
	color: var(--sp-ink);
	border-color: var(--sp-ink);
	font-weight: 650;
}

.dashboard-content h1 {
	margin: 0 0 8px;
}

.dashboard-content h2 {
	font-size: 18px;
	margin: 0 0 20px;
}

.section-heading {
	display: flex;
	justify-content: space-between;
	align-items: start;
	gap: 24px;
	margin-bottom: 20px;
}

.section-heading p {
	color: var(--sp-muted);
	margin-bottom: 0;
}

.dashboard-panel {
	background: white;
	border: 1px solid var(--sp-line);
	border-radius: 20px;
	padding: 24px;
	margin: 24px 0;
}

.stat-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 16px;
}

.stat-card {
	padding: 20px;
	background: #fff;
	border: 1px solid var(--sp-line);
	border-radius: 18px;
}

.stat-card strong {
	display: block;
	font-size: 28px;
	margin: 12px 0;
}

.stat-card p {
	margin: 6px 0 0;
}

.table-scroll {
	position: relative;
	overflow-x: auto;
}

.dashboard-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.dashboard-content th {
	font-size: 12px;
	color: var(--sp-muted);
	text-align: left;
	font-weight: 600;
	background: var(--sp-soft);
}

.dashboard-content td, .dashboard-content th {
	padding: 16px 12px;
	border-bottom: 1px solid #e8edf0;
	vertical-align: middle;
}

.dashboard-content td {
	overflow-wrap: anywhere;
	max-width: 260px;
}

.dashboard-content td small {
	display: block;
	font-size: 12px;
}

.status-pill {
	display: inline-block;
	border-radius: 20px;
	padding: 5px 10px;
	background: #edf1f4;
	font-size: 12px;
	text-transform: capitalize;
}

.status-pill[data-status=active], .status-pill[data-status=succeeded], .status-pill[data-status=captured], .status-pill[data-status=booked] {
	background: #e7f5ed;
	color: #195c38;
}

.status-pill[data-status=unpaid], .status-pill[data-status=failed] {
	background: #fff0ed;
	color: #8b2520;
}

.filter-bar, #subscription-search {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	gap: 12px;
	margin: 20px 0;
}

.filter-bar label, #subscription-search label {
	flex-basis: 100%;
	margin: 0;
}

.filter-bar input, #subscription-search input {
	flex: 1;
	min-width: 180px;
	width: auto;
}

#transaction-filter > div {
	flex: 1 1 180px;
}

#transaction-filter :is(input, select) {
	width: 100%;
	margin-top: 8px;
}

.swanpay-dashboard button.swanpay-payment-button {
	flex: 0 0 auto;
	min-height: 42px;
	padding: 10px 16px;
}

.pagination, #subscription-cards > .swanpay-payment-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 16px;
	margin: 20px 0 0;
}

.card-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

.card-grid > h3, .card-grid > p {
	grid-column: 1 / -1;
	margin-bottom: 0;
}

.saved-card {
	padding: 20px;
	background: var(--sp-soft);
	border: 1px solid var(--sp-line);
	border-radius: 18px;
}

.saved-card h4 {
	margin: 0;
}

.saved-card input {
	font-weight: 400;
}

.settings-panel {
	max-width: 640px;
}

.empty-state {
	text-align: center;
	padding: 28px;
	color: var(--sp-muted);
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	clip: rect(0, 0, 0, 0);
	margin: -1px;
	white-space: nowrap;
}

@media (max-width: 640px) {
	.dashboard-header {
		align-items: start;
		flex-direction: column;
	}

	.card-grid {
		grid-template-columns: 1fr;
	}

	.dashboard-tabs button {
		padding: 12px 10px;
		font-size: 14px;
	}

	.dashboard-panel {
		padding: 16px;
	}

	.section-heading {
		flex-wrap: wrap;
	}

	.pagination, #subscription-cards > .swanpay-payment-actions {
		justify-content: space-between;
		gap: 8px;
	}
}

/* Merchant workspace, aligned with the Woo plugin. */
.swanpay-dashboard {
	margin-block: 0 32px;
	padding: 0 12px;
}

.dashboard-header {
	padding-block: 12px 28px;
}

.dashboard-header p {
	margin: 10px 0 0;
	font-size: 12px;
}

.dashboard-header-controls {
	display: flex;
	align-items: center;
	gap: 24px;
}

.environment-control {
	grid-template-columns: auto 100px;
	gap: 0 12px;
	font-size: 12px;
}

.environment-control select {
	background-color: #fff;
	border-radius: 999px;
	font-size: 13px;
	padding: 8px 12px;
	min-height: 40px;
}

#connection-status {
	font-size: 11px;
}

.dashboard-tabs {
	padding: 6px;
	margin-bottom: 32px;
	gap: 6px;
	border: 1px solid var(--sp-line);
	border-radius: 999px;
	background: #fff;
}

.dashboard-tabs button {
	flex: 1 0 auto;
	border: 0;
	border-radius: 999px;
	padding: 12px 20px;
	font-size: 13px;
	white-space: nowrap;
}

.dashboard-tabs button[aria-selected=true] {
	color: #fff;
	background: var(--sp-ink);
}

.dashboard-tabs button:hover:not([aria-selected=true]) {
	color: var(--sp-ink);
	background: var(--sp-soft);
}

.dashboard-content h1 {
	font: 600 clamp(26px, 3vw, 34px)/1.3 var(--sp-font);
	letter-spacing: -.035em;
}

.dashboard-content h2 {
	font-weight: 600;
}

.dashboard-content .section-heading p:not(.swanpay-eyebrow), .dashboard-content > #dashboard > section > p {
	font-size: 13px;
}

.dashboard-content .swanpay-eyebrow {
	color: var(--sp-link);
	margin: 0 0 8px;
	font-size: 11px;
}

.section-heading {
	align-items: center;
	margin-bottom: 28px;
}

.dashboard-panel {
	padding: 28px;
	box-shadow: 0 4px 20px #0c1a4403;
}

.stat-card {
	min-width: 0;
	padding: 24px;
	overflow-wrap: anywhere;
}

.stat-card:first-child {
	background: linear-gradient(120deg, #eaf9fc, #eef7ff);
	border-color: #cceafa;
}

.stat-card strong {
	font-size: clamp(28px, 3vw, 36px);
	font-weight: 600;
	letter-spacing: -.04em;
	font-variant-numeric: tabular-nums;
}

.stat-card small {
	font-size: 12px;
}

.table-scroll {
	border: 1px solid var(--sp-line);
	border-radius: 14px;
}

.dashboard-content table {
	min-width: 560px;
	font-size: 13px;
}

.dashboard-content th {
	white-space: nowrap;
}

.dashboard-content :is(th, td) {
	padding: 16px;
}

.dashboard-content tbody tr:last-child td {
	border-bottom: 0;
}

.dashboard-content tbody tr:hover {
	background: #f7fbff;
}

.swanpay-dashboard button.swanpay-payment-button {
	font-size: 12px;
	padding-inline: 18px;
}

.settings-panel {
	max-width: 760px;
}

.settings-panel .swanpay-flow-note {
	padding: 16px 18px;
	margin-top: 0;
	border-radius: 12px;
	background: #edf8ff;
	font-size: 13px;
}

.settings-panel .swanpay-flow-body p:empty {
	display: none;
}

.settings-panel .swanpay-flow-body label:first-of-type {
	margin-top: 20px;
}

.settings-panel .swanpay-payment-actions {
	margin-bottom: 0;
}

.saved-card {
	background: linear-gradient(140deg, #fff, #f6f7fb);
	padding: 24px;
}

.saved-card h4 {
	padding-bottom: 18px;
	border-bottom: 1px solid var(--sp-line);
	font-size: 14px;
	font-weight: 600;
}

.saved-card label {
	color: var(--sp-muted);
}

.saved-card button[type=button] {
	color: #a82b35;
}

.empty-state {
	background: var(--sp-soft);
	border-radius: 14px;
}

.dashboard-footer {
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 36px;
	padding: 24px 0 0;
	border-top: 1px solid var(--sp-line);
	color: var(--sp-muted);
	font-size: 11px;
}

@media (max-width: 640px) {
	.swanpay-dashboard {
		padding: 0;
	}

	.dashboard-header-controls {
		justify-content: space-between;
		width: 100%;
		gap: 12px;
	}

	.dashboard-tabs {
		border-radius: 18px;
		margin-bottom: 24px;
	}

	.dashboard-tabs button {
		padding: 10px 14px;
		font-size: 12px;
	}

	.dashboard-panel {
		padding: 20px;
	}

	.card-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.stat-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.saved-card {
		padding: 18px;
	}

	.pagination {
		flex-wrap: wrap;
	}
}

/* Input states, matching the SwanPay app onboarding form. */
.swanpay-dashboard :is(input:not([type=checkbox]), select) {
	transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.swanpay-dashboard input::placeholder {
	color: #9aa2b4;
	opacity: 1;
}

.swanpay-dashboard :is(input:not([type=checkbox]), select):hover {
	border-color: #bddff6;
}

.swanpay-dashboard :is(input:not([type=checkbox]), select):focus {
	border-color: var(--sp-link);
	background-color: #fff;
	box-shadow: 0 0 0 4px #59b5f733;
	outline: none;
}

.swanpay-dashboard :is(input, select)[aria-invalid=true],
.swanpay-dashboard :is(input, select)[aria-invalid=true]:is(:hover, :focus) {
	border-color: #b42335;
	background-color: #fff4f3;
	box-shadow: none;
}

.swanpay-dashboard :is(input, select)[aria-invalid=true]:focus {
	box-shadow: 0 0 0 4px #b4233526;
}

.dashboard-content .swanpay-flow-intro h2 {
	margin-bottom: 6px;
}
