/**
 * TrustLens Card-Testing Defense — consolidated admin page.
 *
 * Mirrors the visual system used by admin/css/chargeback-monitor.css so the
 * two Pro pages feel like siblings: Stripe-like tokens, 14px-radius cards,
 * ring-shadow elevation, pill badges with leading dot, soft surfaces.
 *
 * @since 1.2.2
 */

.wstl-ct-page {
	/* Tokens aligned to the unified admin system (admin/css). */
	--ct-accent: #635bff;
	--ct-text: #1a2433;
	--ct-muted: #6b7a8d;
	--ct-line: #e7ecf3;
	--ct-surface-soft: #f6f9fc;
	--ct-good: #1E7A46;
	--ct-warn: #B88318;
	--ct-danger: #B23A48;
	color: var(--ct-text);
}

/* --- Pills (identical to .wstl-cb-pill) ------------------------------- */

.wstl-ct-page .ct-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	white-space: nowrap;
	border: 1px solid transparent;
}

.wstl-ct-page .ct-pill::before {
	content: '';
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.85;
}

/* Match the page-meta pill palette so status reads identically across pages. */
.wstl-ct-page .ct-pill-good   { background: rgba(16,185,129,.12); color: #047857; border-color: rgba(16,185,129,.28); }
.wstl-ct-page .ct-pill-warn   { background: rgba(245,158,11,.14); color: #92400e; border-color: rgba(245,158,11,.32); }
.wstl-ct-page .ct-pill-danger { background: rgba(239,68,68,.14);  color: #991b1b; border-color: rgba(239,68,68,.32); }
.wstl-ct-page .ct-pill-muted  { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }

/* --- Cards (identical to .wstl-cb-card) ------------------------------- */

.wstl-ct-page .ct-card {
	background: #fff;
	border: 1px solid var(--ct-line);
	border-radius: 12px;
	padding: 22px 24px;
	box-shadow: 0 1px 2px rgba(20,40,67,0.04);
	margin-bottom: 16px;
}

.wstl-ct-page .ct-card:last-child { margin-bottom: 0; }

.wstl-ct-page .ct-card h3 {
	margin: 0 0 14px;
	font-size: 12px;
	color: #425466;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.07em;
}

.wstl-ct-page .ct-pro-tag {
	display: inline-block;
	background: #ede9fe;
	color: #5b21b6;
	font-size: 10px;
	padding: 1px 6px;
	border-radius: 4px;
	margin-left: 8px;
	letter-spacing: 0.04em;
	vertical-align: 1px;
}

.wstl-ct-page .ct-link-right {
	float: right;
	font-weight: 500;
	color: var(--ct-accent);
	text-decoration: none;
	font-size: 12px;
	text-transform: none;
	letter-spacing: 0;
}

.wstl-ct-page .ct-link-right:hover { text-decoration: underline; }

/* --- Hero: state + panic + targeted feed ------------------------------ */

.wstl-ct-page .ct-hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 260px 260px;
	gap: 24px;
	padding-top: 26px;
	padding-bottom: 26px;
}

@media (max-width: 1100px) {
	.wstl-ct-page .ct-hero { grid-template-columns: 1fr; }
}

.wstl-ct-page .ct-hero-l { min-width: 0; }

.wstl-ct-page .ct-hero-state {
	font-size: 44px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.03em;
	color: var(--ct-text);
}

.wstl-ct-page .ct-state-targeted { color: #b45309; }
.wstl-ct-page .ct-state-panic    { color: var(--ct-danger); }
.wstl-ct-page .ct-state-idle     { color: var(--ct-good); }

.wstl-ct-page .ct-hero-sub {
	color: var(--ct-muted);
	font-size: 13px;
	margin-top: 8px;
	max-width: 520px;
	line-height: 1.5;
}

.wstl-ct-page .ct-hero-metrics {
	display: flex;
	gap: 20px;
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid var(--ct-line);
	flex-wrap: wrap;
}

.wstl-ct-page .ct-hero-metrics .m { min-width: 70px; }

.wstl-ct-page .ct-hero-metrics .v {
	font-size: 22px;
	font-weight: 700;
	color: var(--ct-text);
	letter-spacing: -0.01em;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.wstl-ct-page .ct-hero-metrics .l {
	font-size: 11px;
	color: var(--ct-muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-weight: 600;
	margin-top: 4px;
}

.wstl-ct-page .ct-hero-r {
	border-left: 1px solid var(--ct-line);
	padding-left: 22px;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	gap: 10px;
}

@media (max-width: 1100px) {
	.wstl-ct-page .ct-hero-r {
		border-left: 0;
		padding-left: 0;
		border-top: 1px solid var(--ct-line);
		padding-top: 18px;
	}
}

.wstl-ct-page .ct-hero-r h4 {
	margin: 0;
	font-size: 11px;
	color: var(--ct-muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-weight: 600;
}

.wstl-ct-page .ct-hero-r p {
	margin: 0;
	color: var(--ct-muted);
	font-size: 12px;
	line-height: 1.4;
}

.wstl-ct-page .ct-panic-row {
	display: flex;
	gap: 6px;
	margin-top: auto;
	padding-top: 8px;
}

.wstl-ct-page .ct-panic-row select { flex: 1; min-width: 0; }

.wstl-ct-page .ct-hero-feed .ct-feed {
	list-style: none;
	margin: 4px 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.wstl-ct-page .ct-feed li {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	background: #fff;
	border: 1px solid var(--ct-line);
	border-left: 3px solid var(--ct-danger);
	border-radius: 8px;
	font-size: 12px;
}

.wstl-ct-page .ct-feed .hash {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 12px;
	color: var(--ct-text);
	font-weight: 500;
	/* 64-char fingerprint hashes must shrink + ellipsis, not overflow the feed. */
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wstl-ct-page .ct-feed .ttl {
	flex: none;
	color: var(--ct-muted);
	font-size: 11px;
	font-variant-numeric: tabular-nums;
}

/* --- Two-column row (settings + allowlists / intel tables) ---------- */

.wstl-ct-page .ct-two {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	align-items: start;
	margin-bottom: 16px;
}

.wstl-ct-page .ct-two > .ct-card { margin-bottom: 0; }

@media (max-width: 900px) {
	.wstl-ct-page .ct-two { grid-template-columns: 1fr; }
}

.wstl-ct-page .ct-two-tables {
	margin-top: 18px;
	margin-bottom: 0;
	gap: 28px;
}

/* --- Settings form (uses WP .form-table inside card) ---------------- */

.wstl-ct-page .ct-form th {
	padding: 12px 10px 12px 0;
	width: 180px;
	font-weight: 500;
	color: var(--ct-text);
	font-size: 13px;
}

.wstl-ct-page .ct-form td { padding: 12px 0; }

.wstl-ct-page .ct-form tr + tr th,
.wstl-ct-page .ct-form tr + tr td { border-top: 1px solid var(--ct-line); }

.wstl-ct-page .ct-form .description {
	color: var(--ct-muted);
	font-size: 12px;
	margin: 4px 0 0;
}

.wstl-ct-page .ct-unit {
	color: var(--ct-muted);
	font-size: 12px;
	margin-left: 6px;
}

.wstl-ct-page .ct-sub-label {
	font-size: 11px;
	color: var(--ct-muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-weight: 600;
	margin-bottom: 8px;
}

/* --- Allowlist chips ------------------------------------------------- */

.wstl-ct-page .ct-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 10px;
}

.wstl-ct-page .ct-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 4px 5px 10px;
	background: var(--ct-surface-soft);
	border: 1px solid var(--ct-line);
	border-radius: 6px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 12px;
	color: var(--ct-text);
	margin: 0;
}

.wstl-ct-page .ct-chip button {
	width: 18px;
	height: 18px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #9ca3af;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.wstl-ct-page .ct-chip button:hover { background: #fee2e2; color: #991b1b; }

.wstl-ct-page .ct-allow-add {
	display: flex;
	gap: 8px;
	align-items: center;
}

.wstl-ct-page .ct-allow-add input[type="text"] {
	flex: 1;
	min-width: 0;
}

/* --- Pro upsell card (base tier) ------------------------------------ */

.wstl-ct-page .ct-upsell { background: #faf9ff; }

.wstl-ct-page .ct-upsell p {
	color: var(--ct-muted);
	font-size: 13px;
	line-height: 1.55;
	margin: 0 0 14px;
}

/* Shared upgrade-CTA identity — brand blue→purple gradient. */
.wstl-ct-page .ct-upsell .button-primary {
	background: linear-gradient(135deg, #3377EE, #635bff);
	border: 0;
	border-radius: 9px;
	box-shadow: 0 6px 16px rgba(51, 119, 238, 0.22);
	text-shadow: none;
	transition: filter 0.16s ease, box-shadow 0.16s ease;
}

.wstl-ct-page .ct-upsell .button-primary:hover,
.wstl-ct-page .ct-upsell .button-primary:focus {
	filter: brightness(1.05);
	box-shadow: 0 8px 22px rgba(51, 119, 238, 0.30);
	color: #fff;
}

/* --- Intelligence: chart wrapper + tables -------------------------- */

.wstl-ct-page .ct-chart-wrap {
	position: relative;
	height: 220px;
	margin-bottom: 8px;
}

.wstl-ct-page .ct-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	font-size: 13px;
}

.wstl-ct-page .ct-table td {
	padding: 10px 6px;
	border-bottom: 1px solid var(--ct-line);
	vertical-align: middle;
}

.wstl-ct-page .ct-table tr:last-child td { border-bottom: 0; }

.wstl-ct-page .ct-table .hash {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 12.5px;
	color: var(--ct-text);
}

.wstl-ct-page .ct-table .num {
	text-align: right;
	font-variant-numeric: tabular-nums;
	color: var(--ct-danger);
	font-weight: 600;
	width: 80px;
}
