/*
 * xpay✦ Commerce — admin design system.
 * SPDX-License-Identifier: GPL-2.0-or-later
 *
 * Namespaced `xc-`. Shares tokens with the sibling plugins (Product Images,
 * LLMs.txt) so all three read as one suite. Enqueued only on our screens.
 *
 * ⛔ Every number rendered through .xc-stat MUST carry a qualifier chip. A
 *    revenue figure without a match rate beside it is a bug, not a style choice.
 * ⛔ Check every screen at ~340px — side-by-side cells collapse to one word per
 *    line, and that has slipped through desktop review before.
 */

:root {
	--xc-navy: #0f1c4d;
	--xc-teal: #0a6b5f;
	--xc-green: #00dc9c;
	--xc-green-ink: #053b2c;
	--xc-ink: #111827;
	--xc-muted: #6b7280;
	--xc-line: #e5e7eb;
	--xc-accent: #4f46e5;
	--xc-radius: 12px;
	--xc-radius-lg: 16px;
	--xc-shadow: 0 14px 30px -16px rgba(17, 24, 39, .32);
}

.xc-wrap { max-width: 1180px; }
.xc-wrap * { box-sizing: border-box; }

/* ── Hero ──────────────────────────────────────────────────────── */
.xc-hero {
	background: linear-gradient(120deg, #0f1c4d 0%, #0a6b5f 52%, #00dc9c 100%);
	color: #fff; border-radius: var(--xc-radius-lg); padding: 28px 32px;
	margin: 16px 0 24px; box-shadow: 0 10px 30px -12px rgba(15, 28, 77, .4);
	display: flex; gap: 28px; align-items: center; justify-content: space-between;
	flex-wrap: wrap;
}
.xc-hero-copy { min-width: 0; flex: 1 1 420px; }
.xc-eyebrow { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; margin: 0 0 8px; opacity: .82; }
.xc-hero h2 { color: #fff; font-size: 26px; line-height: 1.22; margin: 0 0 8px; font-weight: 700; }
.xc-hero-sub { color: rgba(255, 255, 255, .9); font-size: 14px; line-height: 1.6; margin: 0; max-width: 62ch; }
.xc-hero .button-primary { background: #fff; border-color: #fff; color: var(--xc-navy); }
.xc-hero .button-primary:hover { background: #eef2f1; border-color: #eef2f1; color: var(--xc-navy); }

/* The headline number lives in the hero. Qualifier is not optional. */
.xc-hero-figure { flex: 0 0 auto; text-align: right; }
.xc-hero-figure .xc-big { font-size: 40px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.xc-hero-figure .xc-big-label { font-size: 12px; opacity: .85; margin-top: 6px; display: block; }

/* ── Stat tiles ────────────────────────────────────────────────── */
.xc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 0 0 26px; }
.xc-stat {
	background: #fff; border: 1px solid var(--xc-line); border-radius: var(--xc-radius);
	padding: 16px 18px; min-width: 0;
}
.xc-stat-label { font-size: 12px; color: var(--xc-muted); margin: 0 0 6px; }
.xc-stat-value {
	font-size: 26px; font-weight: 750; color: var(--xc-ink); line-height: 1.1;
	font-variant-numeric: tabular-nums; word-break: break-word;
}
.xc-stat-value.is-empty { font-size: 15px; font-weight: 600; color: var(--xc-muted); }
.xc-stat-qual { margin-top: 8px; }

/* ── Chips ─────────────────────────────────────────────────────── */
.xc-chip {
	display: inline-block; font-size: 11px; font-weight: 600;
	padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.xc-chip.is-pass { background: #ecfdf5; color: #047857; }
.xc-chip.is-low  { background: #f3f4f6; color: #4b5563; }
.xc-chip.is-med  { background: #fffbeb; color: #b45309; }
.xc-chip.is-high { background: #fef2f2; color: #b91c1c; }
.xc-chip.is-info { background: #eef2ff; color: #4338ca; }

/* ── Cards & grid ──────────────────────────────────────────────── */
.xc-grid { display: grid; gap: 14px; }
.xc-grid-2 { grid-template-columns: repeat(2, 1fr); }
.xc-grid-3 { grid-template-columns: repeat(3, 1fr); }
.xc-card {
	background: #fff; border: 1px solid var(--xc-line); border-radius: var(--xc-radius);
	padding: 18px 20px; min-width: 0;
}
.xc-card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--xc-ink); }
.xc-card p { margin: 0; font-size: 13px; color: var(--xc-muted); line-height: 1.55; }

.xc-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px 24px; margin: 30px 0 14px; flex-wrap: wrap; }
.xc-section-head h2 { margin: 0 0 3px; font-size: 18px; }
.xc-section-sub { margin: 0; font-size: 13px; color: var(--xc-muted); line-height: 1.5; max-width: 68ch; }

/* ── Score ring ────────────────────────────────────────────────── */
.xc-ring { position: relative; flex: 0 0 132px; width: 132px; height: 132px; }
.xc-ring svg { width: 132px; height: 132px; }
.xc-ring circle { fill: none; stroke-width: 9; }
.xc-ring-bg { stroke: #e9e7f5; }
.xc-ring-fg { stroke: var(--xc-accent); transform: rotate(-90deg); transform-origin: 66px 66px; stroke-dasharray: 327; }
.xc-ring-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.xc-ring-num strong { font-size: 30px; font-weight: 800; color: var(--xc-ink); line-height: 1; }
.xc-ring-num small { font-size: 12px; color: #9ca3af; font-weight: 600; }

/* ── Checklist rows ────────────────────────────────────────────── */
.xc-checks { border: 1px solid var(--xc-line); border-radius: var(--xc-radius); background: #fff; overflow: hidden; }
.xc-check { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; border-top: 1px solid #f1f2f4; }
.xc-check:first-child { border-top: 0; }
.xc-check-dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; }
.xc-check-dot.is-pass { background: #10b981; }
.xc-check-dot.is-med  { background: #f59e0b; }
.xc-check-dot.is-high { background: #dc2626; }
.xc-check-dot.is-low  { background: #d1d5db; }
.xc-check-body { flex: 1; min-width: 0; }
.xc-check-body h4 { margin: 0 0 3px; font-size: 13.5px; font-weight: 650; color: var(--xc-ink); }
.xc-check-body p { margin: 0; font-size: 12.5px; color: var(--xc-muted); line-height: 1.5; }
.xc-check-action { flex: 0 0 auto; align-self: center; }

/* ── Tables ────────────────────────────────────────────────────── */
.xc-table-wrap { overflow-x: auto; border: 1px solid var(--xc-line); border-radius: var(--xc-radius); background: #fff; }
.xc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.xc-table th, .xc-table td { padding: 10px 14px; text-align: left; border-top: 1px solid #f1f2f4; white-space: nowrap; }
.xc-table thead th { border-top: 0; background: #fafbfc; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--xc-muted); font-weight: 700; position: sticky; top: 0; }
.xc-table td.xc-num, .xc-table th.xc-num { text-align: right; font-variant-numeric: tabular-nums; }
.xc-table tbody tr:hover { background: #fbfbfd; }

/* ── Explain panel ─────────────────────────────────────────────── */
.xc-why { margin-top: 12px; padding: 10px 13px; background: #faf9ff; border-left: 3px solid #7c3aed; border-radius: 0 8px 8px 0; }
.xc-why-label { display: inline-block; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; font-weight: 700; color: #6d28d9; margin-bottom: 4px; }
.xc-why p { margin: 0; font-size: 12.5px; color: #374151; line-height: 1.5; }

/* ── Empty states: always carry the reason ─────────────────────── */
.xc-empty { padding: 26px 20px; text-align: center; color: var(--xc-muted); font-size: 13.5px; line-height: 1.6; }
.xc-empty strong { display: block; color: var(--xc-ink); font-size: 15px; margin-bottom: 5px; }

/* ── Notices / callouts ────────────────────────────────────────── */
.xc-note { display: flex; gap: 10px; align-items: flex-start; border-radius: 10px; padding: 12px 15px; margin: 0 0 16px; font-size: 13px; line-height: 1.55; }
.xc-note.is-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.xc-note.is-info { background: #f0f6fc; border: 1px solid #c9dcf0; color: #1d3a5c; }
.xc-note.is-bad  { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ── Account shortcuts ─────────────────────────────────────────── */
.xc-shortcuts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.xc-shortcut {
	display: flex; align-items: flex-start; gap: 11px;
	padding: 13px 15px; background: #fff; border: 1px solid var(--xc-line);
	border-radius: 10px; text-decoration: none; transition: box-shadow .18s ease, transform .18s ease;
}
.xc-shortcut:hover { box-shadow: var(--xc-shadow); transform: translateY(-2px); }
/* Tinted square keeps the icon legible against the card and stops it reading
   as a bullet. Sized in px, not em, so an admin font-size change can't shift it. */
.xc-shortcut-icon {
	flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px;
	display: flex; align-items: center; justify-content: center;
	background: #eefaf6; color: #00a37a;
	font-size: 17px; line-height: 1;
}
.xc-shortcut-icon.dashicons { width: 30px; height: 30px; }
.xc-shortcut:hover .xc-shortcut-icon { background: #00b585; color: #fff; }
.xc-shortcut-text { min-width: 0; }
.xc-shortcut strong { display: block; font-size: 13px; color: var(--xc-ink); margin-bottom: 2px; }
.xc-shortcut-text span { font-size: 11.5px; color: var(--xc-muted); }
.xc-shortcut.is-locked { opacity: .62; pointer-events: none; }

/* ── Toggle status pill ────────────────────────────────────────── */
.xc-toggle { display: inline-flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 600; text-decoration: none; }
.xc-toggle-track { position: relative; width: 38px; height: 22px; border-radius: 999px; background: #d1d5db; flex: 0 0 auto; }
.xc-toggle-knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .15s ease; }
.xc-toggle.is-on .xc-toggle-track { background: var(--xc-green); }
.xc-toggle.is-on .xc-toggle-knob { left: 18px; }
.xc-toggle.is-on .xc-toggle-label { color: #047857; }
.xc-toggle.is-off .xc-toggle-label { color: #b45309; }

/* ── Footer byline (matches sibling plugins) ───────────────────── */
.xc-footer { margin-top: 34px; padding-top: 16px; border-top: 1px solid #ececec; color: #8a8f98; font-size: 12px; }
.xc-footer strong { color: #00b585; font-weight: 700; }
.xc-footer a { text-decoration: none; }

/* ── Responsive. 340px is the real floor, not 782. ─────────────── */
@media (max-width: 1100px) {
	.xc-stats, .xc-shortcuts { grid-template-columns: repeat(2, 1fr); }
	.xc-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 782px) {
	.xc-hero { padding: 22px; }
	.xc-hero h2 { font-size: 21px; }
	.xc-hero-figure { text-align: left; }
	.xc-grid-2, .xc-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
	.xc-stats, .xc-shortcuts { grid-template-columns: 1fr; }
	.xc-check { flex-wrap: wrap; }
	.xc-check-action { width: 100%; padding-left: 24px; }
	.xc-hero-figure .xc-big { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
	.xc-shortcut, .xc-toggle-knob { transition: none; }
	.xc-shortcut:hover { transform: none; }
}
