/* PS Sport Returns Manager — Liquid Glass design system
   Stesso linguaggio visivo della console ordini. */

.pssg-app {
	--pssg-ink: #111114;
	--pssg-ink-2: #3c3c46;
	--pssg-ink-3: #86868f;
	--pssg-ink-4: #b4b4bd;
	--pssg-line: rgba(17, 17, 20, 0.08);
	--pssg-line-soft: rgba(17, 17, 20, 0.05);
	--pssg-glass: rgba(255, 255, 255, 0.72);
	--pssg-glass-strong: rgba(255, 255, 255, 0.9);
	--pssg-canvas: #f2f2f5;
	--pssg-shadow-s: 0 1px 2px rgba(16, 17, 25, 0.05);
	--pssg-shadow-m: 0 2px 6px rgba(16, 17, 25, 0.05), 0 14px 32px -18px rgba(16, 17, 25, 0.28);
	--pssg-shadow-l: 0 40px 90px -30px rgba(16, 17, 25, 0.35), 0 2px 8px rgba(16, 17, 25, 0.06);
	--pssg-r-xl: 30px;
	--pssg-r-l: 22px;
	--pssg-r-m: 16px;
	--pssg-blur: saturate(180%) blur(28px);
	--pssg-accent: #111114;
	--pssg-danger: #c8372d;
	--pssg-danger-soft: rgba(200, 55, 45, 0.1);

	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--pssg-ink);
	-webkit-font-smoothing: antialiased;
	max-width: 1440px;
	padding: 8px 32px 80px 8px;
}

#wpcontent:has(.pssg-app),
body.toplevel_page_pssom-orders #wpcontent,
body.ps-sport-ordini_page_pssom-settings #wpcontent {
	background: var(--pssg-canvas);
}

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

/* ---------- Intestazione ---------- */

.pssg-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	padding: 22px 4px 26px;
}

.pssg-eyebrow {
	font-size: 11px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--pssg-ink-3);
	font-weight: 600;
	margin: 0 0 6px;
}

.pssg-title {
	font-size: 42px;
	line-height: 1.05;
	letter-spacing: -0.03em;
	font-weight: 700;
	margin: 0;
	color: var(--pssg-ink);
}

.pssg-sub {
	margin: 8px 0 0;
	font-size: 15px;
	color: var(--pssg-ink-3);
}

.pssg-chip {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	background: var(--pssg-glass);
	backdrop-filter: var(--pssg-blur);
	-webkit-backdrop-filter: var(--pssg-blur);
	border: 1px solid var(--pssg-line);
	box-shadow: var(--pssg-shadow-s);
	border-radius: 999px;
	padding: 11px 20px;
	font-size: 13.5px;
	color: var(--pssg-ink-2);
	white-space: nowrap;
}

.pssg-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #34c759;
	box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.14);
}

/* ---------- Barra ricerca + filtri ---------- */

.pssg-panel {
	background: var(--pssg-glass);
	backdrop-filter: var(--pssg-blur);
	-webkit-backdrop-filter: var(--pssg-blur);
	border: 1px solid var(--pssg-line);
	border-radius: var(--pssg-r-xl);
	box-shadow: var(--pssg-shadow-m);
	padding: 14px;
	margin-bottom: 26px;
}

.pssg-search {
	display: flex;
	align-items: center;
	gap: 14px;
	background: #fff;
	border: 1px solid var(--pssg-line-soft);
	border-radius: var(--pssg-r-l);
	padding: 6px 20px;
	box-shadow: var(--pssg-shadow-s);
}

.pssg-search svg {
	flex: none;
	color: var(--pssg-ink-4);
}

.pssg-search input {
	flex: 1;
	border: 0;
	outline: 0;
	background: transparent;
	font-size: 17px;
	color: var(--pssg-ink);
	padding: 14px 0;
	box-shadow: none;
	font-family: inherit;
}

.pssg-search input::placeholder {
	color: var(--pssg-ink-4);
}

.pssg-search input:focus {
	box-shadow: none;
	outline: 0;
}

.pssg-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 14px 6px 4px;
}

.pssg-pill {
	appearance: none;
	border: 1px solid transparent;
	background: transparent;
	color: var(--pssg-ink-2);
	font-size: 13.5px;
	font-weight: 500;
	font-family: inherit;
	padding: 10px 18px;
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.pssg-pill:hover {
	background: rgba(17, 17, 20, 0.05);
}

.pssg-pill[aria-pressed="true"] {
	background: var(--pssg-accent);
	color: #fff;
	box-shadow: var(--pssg-shadow-s);
}

.pssg-pill:focus-visible,
.pssg-btn:focus-visible,
.pssg-card:focus-visible,
.pssg-icon-btn:focus-visible {
	outline: 2px solid #0071e3;
	outline-offset: 2px;
}

/* ---------- Griglia ordini ---------- */

.pssg-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
	gap: 18px;
}

.pssg-card {
	position: relative;
	text-align: left;
	width: 100%;
	background: var(--pssg-glass-strong);
	backdrop-filter: var(--pssg-blur);
	-webkit-backdrop-filter: var(--pssg-blur);
	border: 1px solid var(--pssg-line);
	border-radius: var(--pssg-r-xl);
	box-shadow: var(--pssg-shadow-m);
	padding: 22px 24px 20px;
	cursor: pointer;
	font-family: inherit;
	transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
}

.pssg-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 10px rgba(16, 17, 25, 0.06), 0 26px 50px -24px rgba(16, 17, 25, 0.4);
}

.pssg-card-top {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	font-size: 13px;
	color: var(--pssg-ink-3);
	margin-bottom: 12px;
}

.pssg-card-name {
	font-size: 21px;
	font-weight: 650;
	letter-spacing: -0.01em;
	margin: 0 0 8px;
	color: var(--pssg-ink);
}

.pssg-card-meta {
	font-size: 13.5px;
	color: var(--pssg-ink-3);
	line-height: 1.65;
	word-break: break-word;
}

.pssg-card-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--pssg-line-soft);
}

.pssg-total {
	font-size: 17px;
	font-weight: 680;
	letter-spacing: -0.01em;
}

.pssg-badge {
	display: inline-flex;
	align-items: center;
	border-radius: 999px;
	padding: 6px 13px;
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0.01em;
	white-space: nowrap;
}

.pssg-badge[data-tone="amber"] { background: rgba(255, 179, 0, 0.16); color: #8a5a00; }
.pssg-badge[data-tone="green"] { background: rgba(52, 199, 89, 0.16); color: #1c6b34; }
.pssg-badge[data-tone="blue"]  { background: rgba(0, 113, 227, 0.14); color: #0a4d99; }
.pssg-badge[data-tone="violet"]{ background: rgba(122, 92, 255, 0.16); color: #4b34a8; }
.pssg-badge[data-tone="red"]   { background: var(--pssg-danger-soft); color: var(--pssg-danger); }
.pssg-badge[data-tone="slate"] { background: rgba(17, 17, 20, 0.07); color: var(--pssg-ink-2); }

.pssg-flag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 12px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--pssg-danger);
	background: var(--pssg-danger-soft);
	padding: 6px 12px;
	border-radius: 999px;
}

/* ---------- Stati lista ---------- */

.pssg-state {
	text-align: center;
	padding: 90px 24px;
	color: var(--pssg-ink-3);
}

.pssg-state h3 {
	font-size: 22px;
	color: var(--pssg-ink);
	margin: 0 0 8px;
	font-weight: 650;
	letter-spacing: -0.01em;
}

.pssg-state p {
	margin: 0 0 20px;
	font-size: 15px;
}

.pssg-skeleton {
	height: 168px;
	border-radius: var(--pssg-r-xl);
	background: linear-gradient(100deg, rgba(255, 255, 255, 0.5) 20%, rgba(255, 255, 255, 0.95) 40%, rgba(255, 255, 255, 0.5) 60%);
	background-size: 220% 100%;
	border: 1px solid var(--pssg-line-soft);
	animation: pssg-shimmer 1.4s linear infinite;
}

@keyframes pssg-shimmer {
	to { background-position: -220% 0; }
}

/* ---------- Pulsanti ---------- */

.pssg-btn {
	appearance: none;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	border-radius: 999px;
	padding: 13px 22px;
	border: 1px solid transparent;
	background: var(--pssg-accent);
	color: #fff;
	cursor: pointer;
	transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
	white-space: nowrap;
}

.pssg-btn:hover { opacity: 0.88; }
.pssg-btn:active { transform: scale(0.98); }

.pssg-btn[disabled] {
	opacity: 0.45;
	cursor: not-allowed;
}

.pssg-btn--ghost {
	background: rgba(17, 17, 20, 0.05);
	color: var(--pssg-ink);
}

.pssg-btn--quiet {
	background: #fff;
	color: var(--pssg-ink-2);
	border-color: var(--pssg-line);
	box-shadow: var(--pssg-shadow-s);
}

.pssg-btn--danger {
	background: var(--pssg-danger);
	color: #fff;
}

.pssg-icon-btn {
	appearance: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid var(--pssg-line);
	background: rgba(255, 255, 255, 0.8);
	color: var(--pssg-ink-2);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
}

.pssg-icon-btn:hover { background: rgba(17, 17, 20, 0.06); }

/* ---------- Paginazione ---------- */

.pssg-pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 34px 0 10px;
	color: var(--pssg-ink-3);
	font-size: 14px;
}

/* ---------- Modal ---------- */

.pssg-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(20, 20, 26, 0.32);
	backdrop-filter: blur(18px) saturate(140%);
	-webkit-backdrop-filter: blur(18px) saturate(140%);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 40px 20px;
	overflow-y: auto;
	animation: pssg-fade 0.22s ease;
}

@keyframes pssg-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

.pssg-modal {
	position: relative;
	width: min(1120px, 100%);
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: var(--pssg-blur);
	-webkit-backdrop-filter: var(--pssg-blur);
	border: 1px solid rgba(255, 255, 255, 0.7);
	border-radius: 34px;
	box-shadow: var(--pssg-shadow-l);
	overflow: hidden;
	animation: pssg-rise 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes pssg-rise {
	from { opacity: 0; transform: translateY(14px) scale(0.985); }
	to { opacity: 1; transform: none; }
}

.pssg-modal-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	padding: 34px 38px 26px;
	border-bottom: 1px solid var(--pssg-line-soft);
}

.pssg-modal-status {
	font-size: 12px;
	letter-spacing: 1.4px;
	text-transform: uppercase;
	color: var(--pssg-ink-3);
	font-weight: 600;
	margin-bottom: 6px;
}

.pssg-modal-number {
	font-size: 40px;
	font-weight: 700;
	letter-spacing: -0.035em;
	line-height: 1;
	margin: 0 0 10px;
}

.pssg-modal-person {
	font-size: 15px;
	color: var(--pssg-ink-2);
}

.pssg-modal-body {
	padding: 26px 38px 38px;
}

.pssg-cols {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin-bottom: 20px;
}

.pssg-box {
	background: #fff;
	border: 1px solid var(--pssg-line-soft);
	border-radius: var(--pssg-r-l);
	box-shadow: var(--pssg-shadow-s);
	padding: 22px 24px;
}

.pssg-box h4 {
	font-size: 11px;
	letter-spacing: 1.6px;
	text-transform: uppercase;
	color: var(--pssg-ink-3);
	margin: 0 0 14px;
	font-weight: 600;
}

.pssg-box p {
	margin: 0;
	font-size: 14.5px;
	line-height: 1.75;
	color: var(--pssg-ink-2);
	word-break: break-word;
}

.pssg-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	background: rgba(17, 17, 20, 0.035);
	border-radius: var(--pssg-r-l);
	padding: 14px;
	margin-bottom: 20px;
}

.pssg-item {
	display: grid;
	grid-template-columns: 64px 1fr auto;
	gap: 18px;
	align-items: flex-start;
	padding: 18px 0;
	border-bottom: 1px solid var(--pssg-line-soft);
}

.pssg-item:last-child { border-bottom: 0; }

.pssg-thumb {
	width: 64px;
	height: 64px;
	border-radius: 14px;
	object-fit: cover;
	background: rgba(17, 17, 20, 0.04);
	border: 1px solid var(--pssg-line-soft);
}

.pssg-item-name {
	font-size: 16px;
	font-weight: 640;
	margin: 0 0 4px;
	letter-spacing: -0.01em;
}

.pssg-item-meta {
	font-size: 13px;
	color: var(--pssg-ink-3);
	line-height: 1.6;
}

.pssg-item-right {
	text-align: right;
	font-size: 15px;
	font-weight: 640;
	white-space: nowrap;
}

.pssg-edit {
	margin-top: 14px;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 10px;
}

.pssg-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.pssg-field label {
	font-size: 11px;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--pssg-ink-3);
	font-weight: 600;
}

.pssg-app input[type="text"],
.pssg-app input[type="number"],
.pssg-app input[type="email"],
.pssg-app input[type="url"],
.pssg-app select,
.pssg-app textarea {
	width: 100%;
	font-family: inherit;
	font-size: 14.5px;
	color: var(--pssg-ink);
	background: #fff;
	border: 1px solid var(--pssg-line);
	border-radius: 14px;
	padding: 12px 16px;
	box-shadow: none;
	min-height: 46px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pssg-app textarea {
	min-height: 96px;
	line-height: 1.6;
	resize: vertical;
}

.pssg-app input:focus,
.pssg-app select:focus,
.pssg-app textarea:focus {
	border-color: rgba(0, 113, 227, 0.55);
	box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
	outline: 0;
}

.pssg-hist {
	margin-top: 26px;
	border-top: 1px solid var(--pssg-line-soft);
	padding-top: 20px;
}

.pssg-hist-row {
	display: flex;
	gap: 14px;
	font-size: 13px;
	color: var(--pssg-ink-3);
	padding: 8px 0;
	border-bottom: 1px dashed var(--pssg-line-soft);
}

.pssg-hist-row strong {
	color: var(--pssg-ink-2);
	font-weight: 600;
}

/* ---------- Dialog piccolo ---------- */

.pssg-dialog {
	width: min(520px, 100%);
	background: rgba(255, 255, 255, 0.97);
	border-radius: 28px;
	border: 1px solid rgba(255, 255, 255, 0.7);
	box-shadow: var(--pssg-shadow-l);
	padding: 32px 34px 28px;
	margin: auto;
	animation: pssg-rise 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.pssg-dialog h3 {
	margin: 0 0 6px;
	font-size: 23px;
	font-weight: 680;
	letter-spacing: -0.02em;
}

.pssg-dialog p {
	margin: 0 0 20px;
	color: var(--pssg-ink-3);
	font-size: 14.5px;
	line-height: 1.6;
}

.pssg-dialog-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 22px;
}

.pssg-choices {
	display: grid;
	gap: 10px;
}

.pssg-choice {
	display: block;
	width: 100%;
	text-align: left;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	color: var(--pssg-ink);
	background: #fff;
	border: 1px solid var(--pssg-line);
	border-radius: 18px;
	padding: 18px 20px;
	cursor: pointer;
	box-shadow: var(--pssg-shadow-s);
	transition: transform 0.15s ease, border-color 0.15s ease;
}

.pssg-choice:hover {
	transform: translateY(-1px);
	border-color: rgba(17, 17, 20, 0.22);
}

.pssg-choice span {
	display: block;
	font-size: 13px;
	font-weight: 400;
	color: var(--pssg-ink-3);
	margin-top: 4px;
	line-height: 1.5;
}

/* ---------- Toast ---------- */

.pssg-toasts {
	position: fixed;
	right: 26px;
	bottom: 26px;
	z-index: 100001;
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: 380px;
}

.pssg-toast {
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: var(--pssg-blur);
	-webkit-backdrop-filter: var(--pssg-blur);
	border: 1px solid var(--pssg-line);
	box-shadow: var(--pssg-shadow-l);
	border-radius: 20px;
	padding: 16px 20px;
	font-size: 14px;
	color: var(--pssg-ink-2);
	animation: pssg-rise 0.24s ease;
}

.pssg-toast[data-type="error"] {
	background: var(--pssg-danger);
	color: #fff;
	border-color: transparent;
}

/* ---------- Impostazioni ---------- */

.pssg-form-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 18px;
}

.pssg-section {
	background: var(--pssg-glass-strong);
	border: 1px solid var(--pssg-line);
	border-radius: var(--pssg-r-xl);
	box-shadow: var(--pssg-shadow-m);
	padding: 28px 30px;
	margin-bottom: 20px;
}

.pssg-section h2 {
	font-size: 19px;
	font-weight: 680;
	letter-spacing: -0.015em;
	margin: 0 0 4px;
	color: var(--pssg-ink);
	padding: 0;
}

.pssg-section .pssg-hint {
	font-size: 13.5px;
	color: var(--pssg-ink-3);
	margin: 0 0 22px;
	line-height: 1.6;
}

.pssg-logo-preview {
	max-height: 64px;
	width: auto;
	border-radius: 12px;
	border: 1px solid var(--pssg-line-soft);
	background: #fff;
	padding: 8px;
	margin-bottom: 12px;
	display: block;
}

.pssg-switch {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 14.5px;
	color: var(--pssg-ink-2);
	padding: 12px 0;
}

.pssg-sticky-save {
	position: sticky;
	bottom: 20px;
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	padding: 14px;
	background: var(--pssg-glass);
	backdrop-filter: var(--pssg-blur);
	-webkit-backdrop-filter: var(--pssg-blur);
	border: 1px solid var(--pssg-line);
	border-radius: var(--pssg-r-xl);
	box-shadow: var(--pssg-shadow-m);
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
	.pssg-cols { grid-template-columns: 1fr; }
}

@media (max-width: 782px) {
	.pssg-app { padding: 4px 12px 90px 0; }
	.pssg-title { font-size: 32px; }
	.pssg-head { flex-direction: column; gap: 14px; padding-bottom: 18px; }
	.pssg-grid { grid-template-columns: 1fr; }
	.pssg-overlay { padding: 0; }
	.pssg-modal {
		width: 100%;
		min-height: 100vh;
		border-radius: 0;
		border: 0;
	}
	.pssg-modal-head { padding: 22px 20px 18px; }
	.pssg-modal-body { padding: 18px 20px 60px; }
	.pssg-modal-number { font-size: 32px; }
	.pssg-item { grid-template-columns: 52px 1fr; }
	.pssg-item-right { grid-column: 2; text-align: left; }
	.pssg-thumb { width: 52px; height: 52px; }
	.pssg-btn { padding: 14px 20px; font-size: 15px; }
	.pssg-actions .pssg-btn { flex: 1 1 46%; }
	.pssg-dialog { border-radius: 28px 28px 0 0; margin: auto 0 0; padding: 26px 22px 24px; }
	.pssg-toasts { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
	.pssg-app *,
	.pssg-overlay,
	.pssg-modal,
	.pssg-dialog,
	.pssg-toast {
		animation: none !important;
		transition: none !important;
	}
}

/* ---------- Area cliente ---------- */

.pssg-front {
	padding: 0 0 40px;
	max-width: 100%;
}

.pssg-front .pssg-section {
	padding: 26px 26px 28px;
}

.pssg-notice {
	border-radius: var(--pssg-r-l);
	padding: 18px 22px;
	margin-bottom: 18px;
	font-size: 15px;
	line-height: 1.6;
	border: 1px solid var(--pssg-line);
	background: #fff;
	box-shadow: var(--pssg-shadow-s);
}

.pssg-notice--ok { border-color: rgba(52, 199, 89, 0.4); }
.pssg-notice--error { border-color: rgba(200, 55, 45, 0.4); color: var(--pssg-danger); }

.pssg-form {
	display: grid;
	gap: 16px;
	max-width: 640px;
}

.pssg-form .pssg-btn { justify-self: start; }

.pssg-front input[type="file"] {
	font-size: 14px;
	padding: 12px 16px;
	border: 1px dashed var(--pssg-line);
	border-radius: 14px;
	background: #fff;
	width: 100%;
}

.pssg-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 0;
	border-bottom: 1px solid var(--pssg-line-soft);
}

.pssg-row:last-child { border-bottom: 0; }

.pssg-row-title {
	margin: 0 0 4px;
	font-size: 16px;
	font-weight: 640;
	letter-spacing: -0.01em;
}

.pssg-row-meta {
	font-size: 13.5px;
	color: var(--pssg-ink-3);
	line-height: 1.6;
}

.pssg-photos {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 12px;
}

.pssg-photos img {
	width: 92px;
	height: 92px;
	object-fit: cover;
	border-radius: 14px;
	border: 1px solid var(--pssg-line-soft);
}

@media (max-width: 782px) {
	.pssg-row { flex-direction: column; align-items: flex-start; }
}
