/**
 * TrustLens Chargeback Monitor — dashboard card + dedicated page.
 *
 * @since 1.2.1
 */

/* =====================================================================
   Dashboard summary card (Free + Pro)
   ===================================================================== */

.wstl-card-chargeback-ratio .wstl-ratio-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin: 12px 0;
}

.wstl-card-chargeback-ratio .wstl-ratio-label {
	display: block;
	color: #666;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.wstl-card-chargeback-ratio .wstl-ratio-value {
	display: block;
	font-size: 24px;
	font-weight: 600;
	line-height: 1.2;
	margin-top: 2px;
}

.wstl-card-chargeback-ratio .wstl-ratio-sub {
	display: block;
	color: #777;
	font-size: 12px;
	margin-top: 2px;
}

.wstl-card-chargeback-ratio .wstl-ratio-value-small {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
}

.wstl-card-chargeback-ratio .wstl-ratio-status-healthy { color: #1E7A46; }
.wstl-card-chargeback-ratio .wstl-ratio-status-warning { color: #B88318; }
.wstl-card-chargeback-ratio .wstl-ratio-status-danger  { color: #B23A48; }

.wstl-card-chargeback-ratio .wstl-ratio-cta-note {
	display: block;
	color: #666;
	font-size: 12px;
	margin-top: 6px;
}

.wstl-dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	margin-left: 8px;
	vertical-align: middle;
}

.wstl-dot-healthy { background: #1E7A46; }
.wstl-dot-warning { background: #B88318; }
.wstl-dot-danger  { background: #B23A48; }

.wstl-card-chargeback-upsell {
	border-left: 4px solid #B23A48;
}

/* =====================================================================
   Dedicated Chargeback Monitor page — Executive Split (Stripe-like)
   ===================================================================== */

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

.wstl-cb-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-cb-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-cb-pill-good   { background: rgba(16,185,129,.12); color: #047857; border-color: rgba(16,185,129,.28); }
.wstl-cb-pill-warn   { background: rgba(245,158,11,.14); color: #92400e; border-color: rgba(245,158,11,.32); }
.wstl-cb-pill-danger { background: rgba(239,68,68,.14);  color: #991b1b; border-color: rgba(239,68,68,.32); }
.wstl-cb-pill-muted  { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }

/* --- Page layout: 60/40 split ---------------------------------------- */

.wstl-cb-split {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
	gap: 16px;
	align-items: start;
}

.wstl-cb-left,
.wstl-cb-right {
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-width: 0;
}

@media (max-width: 960px) {
	.wstl-cb-split {
		grid-template-columns: 1fr;
	}
}

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

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

/* --- Hero card: blended + trailing + win rate ------------------------ */

.wstl-cb-hero {
	display: flex;
	align-items: stretch;
	gap: 24px;
	padding-top: 28px;
	padding-bottom: 28px;
}

.wstl-cb-hero-left { flex: 1; min-width: 0; }

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

.wstl-cb-hero-sub {
	color: var(--cb-muted);
	font-size: 13px;
	margin-top: 8px;
}

.wstl-cb-hero-right {
	width: 200px;
	padding-left: 22px;
	border-left: 1px solid var(--cb-line);
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 14px;
}

.wstl-cb-hero-stat .v {
	font-size: 22px;
	font-weight: 700;
	color: var(--cb-text);
	letter-spacing: -0.02em;
	line-height: 1.1;
}

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

/* --- Network program progress rows ----------------------------------- */

.wstl-cb-prog-row {
	display: grid;
	grid-template-columns: minmax(140px, 1fr) minmax(0, 1.7fr) 72px 64px;
	gap: 14px;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px solid var(--cb-line);
}

.wstl-cb-prog-row:last-child { border-bottom: 0; }

.wstl-cb-prog-label {
	font-size: 13px;
	color: var(--cb-text);
	font-weight: 500;
	line-height: 1.3;
}

.wstl-cb-prog-label small {
	display: block;
	color: var(--cb-muted);
	font-weight: 400;
	font-size: 11px;
	margin-top: 2px;
}

.wstl-cb-prog-pct {
	font-size: 14px;
	font-weight: 600;
	color: var(--cb-text);
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.wstl-cb-prog-pct.is-danger { color: var(--cb-danger); }
.wstl-cb-prog-pct.is-warn   { color: #b45309; }

.wstl-cb-prog-tag { text-align: right; }

.wstl-cb-bar {
	height: 6px;
	background: var(--cb-line);
	border-radius: 3px;
	overflow: hidden;
	position: relative;
}

.wstl-cb-bar > span {
	position: absolute;
	top: 0; left: 0; bottom: 0;
	border-radius: 3px;
	background: var(--cb-accent);
}

.wstl-cb-bar-good   > span { background: var(--cb-good); }
.wstl-cb-bar-warn   > span { background: var(--cb-warn); }
.wstl-cb-bar-danger > span { background: var(--cb-danger); }
.wstl-cb-bar-muted  > span { background: #cbd5e1; }

/* --- Trend chart wrapper (fills card, fixed height) ------------------ */

.wstl-cb-chart-wrap {
	position: relative;
	height: 220px;
}

/* --- Outcomes grid --------------------------------------------------- */

.wstl-cb-outcomes {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 10px;
}

@media (max-width: 1120px) {
	.wstl-cb-outcomes { grid-template-columns: repeat(3, 1fr); }
}

.wstl-cb-outcome {
	text-align: center;
	padding: 14px 10px;
	background: var(--cb-surface-soft);
	border-radius: 10px;
}

.wstl-cb-outcome .v {
	font-size: 22px;
	font-weight: 700;
	color: var(--cb-text);
	letter-spacing: -0.01em;
	line-height: 1;
}

.wstl-cb-outcome .l {
	font-size: 11px;
	color: var(--cb-muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-top: 6px;
}

.wstl-cb-outcome.is-won     .v { color: var(--cb-good); }
.wstl-cb-outcome.is-lost    .v { color: var(--cb-danger); }
.wstl-cb-outcome.is-pending .v { color: #d97706; }

/* --- Activity feed --------------------------------------------------- */

.wstl-cb-dayhead {
	font-size: 11px;
	color: var(--cb-muted);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-weight: 600;
	margin: 16px 0 8px;
}

.wstl-cb-dayhead:first-child { margin-top: 0; }

.wstl-cb-event {
	padding: 12px 14px;
	border-radius: 10px;
	background: #fff;
	border: 1px solid var(--cb-line);
	border-left: 3px solid #cbd5e1;
	margin-bottom: 10px;
}

.wstl-cb-event.is-good    { border-left-color: var(--cb-good); }
.wstl-cb-event.is-warn    { border-left-color: var(--cb-warn); }
.wstl-cb-event.is-danger  { border-left-color: var(--cb-danger); }

.wstl-cb-event-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 4px;
	gap: 10px;
}

.wstl-cb-event-title {
	font-weight: 600;
	font-size: 13px;
	color: var(--cb-text);
}

.wstl-cb-event-time {
	color: #9ca3af;
	font-size: 11px;
	font-variant-numeric: tabular-nums;
}

.wstl-cb-event-body {
	color: #425466;
	font-size: 12.5px;
	line-height: 1.5;
}

.wstl-cb-event-body a {
	color: var(--cb-text);
	text-decoration: none;
	border-bottom: 1px dashed #cbd5e1;
}

.wstl-cb-event-body a:hover { color: var(--cb-accent); }

.wstl-cb-event-tags {
	margin-top: 6px;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.wstl-cb-tag {
	display: inline-block;
	background: #f3f4f6;
	color: #374151;
	font-size: 10.5px;
	padding: 2px 7px;
	border-radius: 4px;
	font-weight: 500;
	letter-spacing: 0.02em;
}

.wstl-cb-tag-muted {
	background: transparent;
	color: #9ca3af;
	border: 1px solid var(--cb-line);
}

/* --- Tables (right column: top disputed customers) ------------------- */

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

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

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

.wstl-cb-table-num    { text-align: right; width: 40px; }
.wstl-cb-table-action { text-align: right; white-space: nowrap; }

.wstl-cb-link {
	color: var(--cb-accent);
	text-decoration: none;
	font-weight: 500;
	font-size: 12.5px;
}

.wstl-cb-link:hover { text-decoration: underline; }

/* --- Alert threshold slider ----------------------------------------- */

.wstl-cb-slider-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 6px;
}

.wstl-cb-slider-row input[type="range"] {
	flex: 1;
	accent-color: var(--cb-accent);
}

.wstl-cb-slider-row input[type="number"] { width: 70px; }

/* --- Backfill footer ------------------------------------------------- */

.wstl-cb-footer { margin-top: 16px; }

.wstl-cb-backfill-progress {
	display: inline-block;
	margin-left: 12px;
	color: #555;
	font-style: italic;
	font-size: 13px;
}

/* Open Disputes worklist (Phase 1) */
.wstl-cb-worklist-empty { color: #1a7f37; font-weight: 600; margin: 4px 0 0; }
.wstl-cb-worklist-table { margin-top: 8px; }
.wstl-cb-worklist-note { color: #646970; font-size: 12px; margin-top: 8px; }
.wstl-cb-due { display: inline-block; padding: 2px 8px; border-radius: 999px; font-weight: 600; font-size: 12px; white-space: nowrap; }
.wstl-cb-due--overdue { background: #fcebea; color: #b32d2e; }
.wstl-cb-due--urgent  { background: #fcf0e6; color: #bd5b00; }
.wstl-cb-due--soon    { background: #fef8ee; color: #8a6d00; }
.wstl-cb-due--normal  { background: #eef6ff; color: #1d4ed8; }
.wstl-cb-due--none    { background: #f0f0f1; color: #646970; }
.wstl-att { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-weight: 600; font-size: 11px; white-space: nowrap; vertical-align: middle; }
.wstl-att--ok      { background: #edfaf2; color: #1a7f49; }
.wstl-att--pending { background: #fef8ee; color: #8a6d00; }

/* Chargeback Monitor — Pro settings card (auto-block, alert %, verification). */
.wstl-cb-settings .wstl-cb-setting { margin-bottom: 18px; }
.wstl-cb-settings .wstl-cb-setting > label { display: block; font-weight: 600; margin-bottom: 6px; }
.wstl-cb-settings .wstl-cb-setting-control { display: flex; align-items: center; gap: 8px; }
.wstl-cb-settings .wstl-cb-setting .description { margin-top: 6px; }
