/**
 * Front end staff dashboard. Kept deliberately neutral so it inherits the
 * theme's typography and sits inside an Elementor section without fighting it.
 */

.ss-dash {
	--ss-dash-border: rgba( 0, 0, 0, 0.12 );
	--ss-dash-muted: rgba( 0, 0, 0, 0.55 );
	--ss-dash-bg-alt: rgba( 0, 0, 0, 0.02 );
	--ss-dash-accent: #1f6feb;
	--ss-dash-warn: #b3261e;

	font-size: 15px;
	line-height: 1.45;
}

.ss-dash *,
.ss-dash *::before,
.ss-dash *::after {
	box-sizing: border-box;
}

/* Gate screens ---------------------------------------------------------- */

.ss-dash--gate {
	display: flex;
	justify-content: center;
	padding: 32px 0;
}

.ss-dash-card {
	border: 1px solid var( --ss-dash-border );
	border-radius: 10px;
	padding: 28px 32px;
	max-width: 460px;
	width: 100%;
	text-align: center;
}

.ss-dash-card h2 {
	margin: 0 0 10px;
	font-size: 1.25em;
}

.ss-dash-card p {
	margin: 0 0 16px;
}

.ss-dash-card p:last-child {
	margin-bottom: 0;
}

/* Header ---------------------------------------------------------------- */

.ss-dash-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 16px;
	margin-bottom: 14px;
}

.ss-dash-title {
	margin: 0;
	font-size: 1.4em;
}

.ss-dash-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	font-size: 0.9em;
	color: var( --ss-dash-muted );
}

.ss-dash-user a {
	color: inherit;
	text-decoration: underline;
}

/* Notices --------------------------------------------------------------- */

.ss-dash-notice {
	border: 1px solid var( --ss-dash-border );
	border-left-width: 4px;
	border-radius: 4px;
	padding: 10px 14px;
	margin-bottom: 14px;
}

.ss-dash-notice--success {
	border-left-color: #1a7f37;
}

.ss-dash-notice--error {
	border-left-color: var( --ss-dash-warn );
}

/* Filters --------------------------------------------------------------- */

.ss-dash-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 10px 14px;
	padding: 14px;
	margin-bottom: 16px;
	border: 1px solid var( --ss-dash-border );
	border-radius: 8px;
	background: var( --ss-dash-bg-alt );
}

.ss-dash-field {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.ss-dash-field--grow {
	flex: 1 1 240px;
}

.ss-dash-field--actions {
	flex-direction: row;
	align-items: center;
	gap: 12px;
}

.ss-dash-field label {
	font-size: 0.8em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var( --ss-dash-muted );
}

.ss-dash-field input,
.ss-dash-field select {
	padding: 7px 10px;
	border: 1px solid var( --ss-dash-border );
	border-radius: 5px;
	background: #fff;
	font: inherit;
	font-size: 0.95em;
	max-width: 100%;
}

/* Buttons --------------------------------------------------------------- */

.ss-dash-button {
	display: inline-block;
	padding: 8px 16px;
	border: 0;
	border-radius: 5px;
	background: var( --ss-dash-accent );
	color: #fff;
	font: inherit;
	font-size: 0.95em;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}

.ss-dash-button:hover,
.ss-dash-button:focus {
	color: #fff;
	filter: brightness( 0.92 );
}

.ss-dash-button--small {
	padding: 5px 10px;
	font-size: 0.85em;
}

.ss-dash-link {
	color: var( --ss-dash-accent );
	text-decoration: underline;
}

/* Table ----------------------------------------------------------------- */

.ss-dash-table-wrap {
	overflow-x: auto;
	border: 1px solid var( --ss-dash-border );
	border-radius: 8px;
}

.ss-dash-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92em;
}

.ss-dash-table th,
.ss-dash-table td {
	padding: 10px 12px;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid var( --ss-dash-border );
}

.ss-dash-table thead th {
	font-size: 0.82em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var( --ss-dash-muted );
	white-space: nowrap;
	background: var( --ss-dash-bg-alt );
}

.ss-dash-table tbody tr:last-child td {
	border-bottom: 0;
}

.ss-dash-num {
	text-align: right;
	white-space: nowrap;
}

.ss-dash-order {
	font-weight: 600;
}

.ss-dash-sub {
	display: block;
	font-size: 0.85em;
	color: var( --ss-dash-muted );
	word-break: break-word;
}

.ss-dash-empty {
	padding: 28px 12px;
	text-align: center;
	color: var( --ss-dash-muted );
}

.ss-dash-status {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	background: var( --ss-dash-bg-alt );
	border: 1px solid var( --ss-dash-border );
	font-size: 0.85em;
	white-space: nowrap;
}

.ss-dash-status--completed {
	border-color: #1a7f37;
	color: #1a7f37;
}

.ss-dash-status--failed,
.ss-dash-status--cancelled {
	border-color: var( --ss-dash-warn );
	color: var( --ss-dash-warn );
}

.ss-dash-voucher {
	display: block;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	word-break: break-all;
}

.ss-dash-voucher + .ss-dash-voucher {
	margin-top: 6px;
}

.ss-dash-voucher--inactive {
	text-decoration: line-through;
	color: var( --ss-dash-muted );
}

.ss-dash-warn {
	color: var( --ss-dash-warn );
	font-weight: 600;
}

.ss-dash-action {
	margin: 0;
}

/* Pagination ------------------------------------------------------------ */

.ss-dash-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: 16px;
}

/* Small screens: the table becomes a stack of labelled cards -------------- */

@media ( max-width: 782px ) {
	.ss-dash-table-wrap {
		border: 0;
		border-radius: 0;
		overflow-x: visible;
	}

	.ss-dash-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect( 1px, 1px, 1px, 1px );
		white-space: nowrap;
	}

	.ss-dash-table tbody tr {
		display: block;
		margin-bottom: 12px;
		border: 1px solid var( --ss-dash-border );
		border-radius: 8px;
		overflow: hidden;
	}

	.ss-dash-table td {
		display: flex;
		justify-content: space-between;
		gap: 16px;
		text-align: right;
	}

	.ss-dash-table td::before {
		content: attr( data-label );
		font-size: 0.82em;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		color: var( --ss-dash-muted );
		text-align: left;
		flex: 0 0 auto;
	}

	.ss-dash-table td.ss-dash-empty {
		display: block;
		text-align: center;
	}

	.ss-dash-table td.ss-dash-empty::before {
		content: none;
	}
}

/* Selection swatch ------------------------------------------------------- */

.ss-dash-selection {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	text-align: left;
}

.ss-dash-swatch {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 1px solid rgba( 0, 0, 0, 0.15 );
	font-size: 0.6em;
	font-weight: 700;
	line-height: 1;
	overflow: hidden;
}

.ss-dash-selection-text {
	min-width: 0;
}

/* A circle whose configured value no longer matches what the order was sold
   at, or that has been deleted: shown blank rather than in a colour we can no
   longer vouch for. */
.ss-dash-swatch--blank {
	background: #fff;
	border-color: rgba( 0, 0, 0, 0.25 );
	border-style: dashed;
}
