/* Supporto Desk, customer side. Colours come from the theme. */
.spd {
	--spd-blue: var(--wp--preset--color--brand, #2547f5);
	--spd-navy: var(--wp--preset--color--night, #0d1b3e);
	--spd-sun: var(--wp--preset--color--accent, #ffd23f);
	--spd-soft: var(--wp--preset--color--surface, #f3f6ff);
	--spd-line: var(--wp--preset--color--line, #e1e7fb);
	--spd-muted: var(--wp--preset--color--muted, #4b5b85);
	color: var(--spd-navy);
}

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

.spd-notice {
	margin: 0 0 16px;
	padding: 14px 18px;
	border-radius: 16px;
	background: #e8fbf3;
	font-weight: 600;
}

.spd-notice--error {
	background: #fff0ee;
}

.spd-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 18px;
}

.spd-head h2,
.woocommerce-MyAccount-content .spd-head h2 {
	margin: 0;
	font-size: 1.6rem;
}

.spd-head p {
	margin: 4px 0 0;
	color: var(--spd-muted);
}

.spd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 13px 22px;
	border: 0;
	border-radius: 14px;
	background: var(--spd-blue);
	color: #fff !important;
	font: inherit;
	font-weight: 800;
	text-decoration: none !important;
	cursor: pointer;
}

.spd-btn:hover {
	background: var(--wp--preset--color--brand-dark, #1b34c4);
}

.spd-link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--spd-blue);
	font: inherit;
	font-weight: 700;
	text-decoration: underline;
	cursor: pointer;
}

.spd-back a {
	font-weight: 700;
	text-decoration: none;
}

.spd-back a::before {
	content: "\2190  ";
}

.spd-empty {
	padding: 28px;
	border-radius: 20px;
	background: #fff;
	text-align: center;
}

.spd-empty p {
	margin: 6px 0 0;
	color: var(--spd-muted);
}

.spd-list {
	display: grid;
	gap: 10px;
}

.spd-row {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 18px;
	border-radius: 18px;
	background: #fff;
	color: var(--spd-navy) !important;
	text-decoration: none !important;
	transition: box-shadow 0.15s ease;
}

.spd-row:hover {
	box-shadow: inset 0 0 0 2px var(--spd-blue);
}

.spd-num {
	flex-shrink: 0;
	padding: 4px 10px;
	border-radius: 10px;
	background: var(--spd-soft);
	color: var(--spd-muted);
	font-size: 0.8125rem;
	font-weight: 800;
}

.spd-subj {
	flex: 1;
	min-width: 0;
}

.spd-subj strong {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.spd-subj small {
	color: var(--spd-muted);
	font-weight: 600;
}

.spd-pill {
	flex-shrink: 0;
	padding: 4px 11px;
	border-radius: 999px;
	background: var(--spd-soft);
	font-size: 0.75rem;
	font-weight: 800;
	white-space: nowrap;
}

.spd-pill--open { background: #e4e9ff; color: #1b34c4; }
.spd-pill--progress { background: #fff3cf; color: #7a5a00; }
.spd-pill--waiting { background: #ffe3de; color: #a2321f; }
.spd-pill--resolved { background: #dcf8ee; color: #0f7a55; }
.spd-pill--closed { background: #eceff5; color: #5b6476; }
.spd-pill--reply { background: var(--spd-sun); color: var(--spd-navy); }

.spd-ticket-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 18px;
}

.spd-ticket-head h2 {
	margin: 8px 0 4px;
	font-size: 1.5rem;
	line-height: 1.25;
}

.spd-meta {
	margin: 0;
	color: var(--spd-muted);
	font-weight: 600;
}

.spd-thread {
	display: grid;
	gap: 12px;
}

.spd-msg {
	padding: 18px 20px;
	border-radius: 20px;
	background: #fff;
}

.spd-msg--agent {
	background: var(--spd-navy);
	color: #e3e8ff;
}

.spd-msg-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.spd-msg--agent .spd-msg-head strong {
	color: #fff;
}

.spd-avatar {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 10px;
	background: var(--spd-sun);
	color: var(--spd-navy);
	font-weight: 800;
}

.spd-msg--customer .spd-avatar {
	background: #e4e9ff;
}

.spd-role {
	padding: 2px 8px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.14);
	font-size: 0.7rem;
	font-weight: 800;
}

.spd-msg-head time {
	margin-left: auto;
	color: var(--spd-muted);
	font-size: 0.8125rem;
}

.spd-msg--agent .spd-msg-head time {
	color: #aab6e6;
}

.spd-msg-body p {
	margin: 0 0 10px;
	line-height: 1.6;
}

.spd-msg-body p:last-child {
	margin-bottom: 0;
}

.spd-msg--agent a {
	color: var(--spd-sun);
}

.spd-files {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.spd-files a {
	display: inline-block;
	padding: 6px 12px;
	border-radius: 10px;
	background: var(--spd-soft);
	color: var(--spd-navy) !important;
	font-size: 0.875rem;
	font-weight: 700;
	text-decoration: none;
}

.spd-files span {
	color: var(--spd-muted);
	font-size: 0.75rem;
}

.spd-sys {
	text-align: center;
	color: var(--spd-muted);
	font-size: 0.875rem;
	font-weight: 600;
}

.spd-sys span {
	opacity: 0.7;
}

.spd-reply,
.spd-form {
	display: grid;
	gap: 14px;
	margin-top: 18px;
	padding: 22px;
	border-radius: 22px;
	background: #fff;
}

.spd-form-wrap .spd-form {
	margin-top: 0;
	background: var(--spd-soft);
}

.woocommerce-MyAccount-content .spd-form {
	background: #fff;
}

.spd-reply h3 {
	margin: 0;
}

.spd label {
	display: grid;
	gap: 6px;
	font-weight: 700;
	font-size: 0.9375rem;
}

.spd input[type="text"],
.spd input[type="email"],
.spd input[type="url"],
.spd select,
.spd textarea {
	width: 100%;
	padding: 13px 14px;
	border: 2px solid var(--spd-line);
	border-radius: 14px;
	background: #fff;
	color: var(--spd-navy);
	font: inherit;
	font-weight: 500;
}

.spd input:focus,
.spd select:focus,
.spd textarea:focus {
	border-color: var(--spd-blue);
	outline: none;
}

.spd-grid2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.spd-files-field {
	padding: 14px;
	border: 2px dashed var(--spd-line);
	border-radius: 14px;
	background: #fff;
}

.spd-files-field small {
	color: var(--spd-muted);
	font-weight: 500;
}

.spd-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
}

.spd-actions small {
	color: var(--spd-muted);
	font-weight: 600;
}

.spd-close {
	margin-top: 12px;
	text-align: right;
}

.spd-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.spd-form-title {
	margin: 0 0 14px;
}

@media (max-width: 640px) {
	.spd-grid2 {
		grid-template-columns: 1fr;
	}

	.spd-row {
		flex-wrap: wrap;
	}

	.spd-subj {
		flex-basis: 100%;
		order: 3;
	}

	.spd-ticket-head {
		flex-direction: column;
	}
}

/* On normal pages cards sit on white, so give them the soft tint. In My Account the panel is already tinted. */
.spd-msg--customer,
.spd-reply,
.spd-empty,
.spd-row {
	background: var(--spd-soft);
}

.woocommerce-MyAccount-content .spd-msg--customer,
.woocommerce-MyAccount-content .spd-reply,
.woocommerce-MyAccount-content .spd-empty,
.woocommerce-MyAccount-content .spd-row {
	background: #fff;
}
