/**
 * TrustLens Admin Dashboard Styles
 *
 * @package TrustLens
 */

/* ==========================================================================
   Dashboard Refresh (Professional UI Pass)
   ========================================================================== */

.wstl-wrap .wp-heading-inline {
	font-weight: 700;
	letter-spacing: -0.02em;
}

.wstl-dashboard {
	--wstl-bg-soft: #f4f7fb;
	--wstl-surface: #ffffff;
	--wstl-border: #d5e0eb;
	--wstl-text: #14283e;
	--wstl-muted: #5b6d80;
	--wstl-brand: var(--wstl-color-primary);
	--wstl-info: var(--wstl-segment-trusted);
	--wstl-success: var(--wstl-segment-vip);
	--wstl-warning: var(--wstl-segment-caution);
	--wstl-danger: var(--wstl-segment-critical);
	--wstl-neutral: var(--wstl-segment-normal);
	--wstl-shadow-sm: 0 8px 20px rgba(16, 42, 67, 0.06);
	--wstl-shadow-md: 0 14px 34px rgba(16, 42, 67, 0.08);
	padding: 0;
	border-radius: 16px;
}

.wstl-dashboard-lead {
	margin: 10px 0 14px;
	color: #4f6075;
	font-size: clamp(13px, 1.1vw, 15px);
	max-width: 960px;
}

.wstl-dashboard .wstl-dashboard-section {
	margin-bottom: 20px;
}

.wstl-dashboard .wstl-card,
.wstl-dashboard .wstl-header-bar,
.wstl-dashboard .wstl-roi-scorecard,
.wstl-dashboard .wstl-collapsible {
	border: 1px solid var(--wstl-border);
	border-radius: 14px;
	box-shadow: var(--wstl-shadow-sm);
}

.wstl-dashboard .wstl-card {
	padding: 22px;
}

.wstl-dashboard .wstl-card:hover,
.wstl-dashboard .wstl-kpi-card:hover {
	box-shadow: var(--wstl-shadow-md);
}

.wstl-dashboard .wstl-header-bar {
	background: linear-gradient(138deg, #ffffff 0%, #f2f8fd 55%, #f8f6f1 100%);
	padding: 22px 24px;
	gap: 24px;
}

.wstl-dashboard .wstl-health-ring {
	width: 88px;
	height: 88px;
}

.wstl-dashboard .wstl-health-value {
	font-size: 30px;
}

.wstl-dashboard .wstl-health-label {
	font-size: 10px;
}

.wstl-dashboard .wstl-header-greeting {
	font-size: clamp(21px, 2vw, 27px);
	color: var(--wstl-text);
}

.wstl-dashboard .wstl-header-subtitle {
	color: var(--wstl-muted);
	font-size: 14px;
	line-height: 1.45;
	margin: 0;
}

.wstl-dashboard .wstl-header-health-msg {
	margin: 2px 0 6px;
	line-height: 1.35;
}

.wstl-header-metrics {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 14px;
}

.wstl-header-chip {
	display: inline-flex;
	align-items: center;
	padding: 6px 11px;
	background: #ecf5fc;
	border: 1px solid #cfe2f2;
	border-radius: 999px;
	font-size: 10px;
	font-weight: 600;
	color: #254f71;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.wstl-section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px 16px;
	margin: 0 4px 12px;
}

.wstl-section-head h2 {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--wstl-text);
}

.wstl-section-head p {
	margin: 0;
	font-size: 13px;
	color: var(--wstl-muted);
}

.wstl-dashboard .wstl-kpi-card {
	border: 1px solid #dfe8f1;
	border-left-width: 4px;
	border-radius: 12px;
	background: linear-gradient(180deg, #fff 0%, #f8fbfd 100%);
	padding: 16px 14px;
}

.wstl-dashboard .wstl-kpi-value {
	font-size: clamp(26px, 2.2vw, 34px);
	line-height: 1.05;
}

.wstl-dashboard .wstl-kpi-label {
	font-size: 10px;
}

.wstl-chart-height-lg {
	height: 300px;
}

.wstl-chart-height-md {
	height: 240px;
}

.wstl-chart-height-sm {
	height: 270px;
}

.wstl-dashboard .wstl-chart-container {
	padding: 6px;
}

.wstl-dashboard .wstl-chart-empty-state {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	padding: 22px;
	border: 1px dashed #c7d7e6;
	border-radius: 12px;
	background:
		radial-gradient(circle at top right, rgba(31, 95, 139, 0.10), transparent 55%),
		linear-gradient(180deg, #fbfdff 0%, #f2f7fc 100%);
}

.wstl-dashboard .wstl-chart-empty-state .dashicons {
	font-size: 34px;
	width: 34px;
	height: 34px;
	color: #4a7ba3;
	margin-bottom: 10px;
}

.wstl-dashboard .wstl-chart-empty-state h3 {
	margin: 0 0 6px;
	font-size: 16px;
	font-weight: 700;
	color: #1e3852;
}

.wstl-dashboard .wstl-chart-empty-state p {
	margin: 0;
	max-width: 380px;
	font-size: 13px;
	line-height: 1.45;
	color: #5f7184;
}

.wstl-icon-title {
	margin-right: 6px;
	vertical-align: middle;
}

.wstl-icon-title-success {
	color: var(--wstl-success);
}

.wstl-icon-title-danger {
	color: var(--wstl-danger);
}

.wstl-icon-title-warn {
	color: var(--wstl-warning);
}

.wstl-icon-title-info {
	color: var(--wstl-info);
}

.wstl-inline-period {
	font-weight: 500;
	color: #7a8696;
	font-size: 12px;
	margin-left: 8px;
}

.wstl-subsection-title {
	font-size: 13px;
	color: #5b6778;
	border-bottom: 1px solid #ebf0f5;
	padding-bottom: 8px;
}

.wstl-subsection-icon {
	font-size: 16px;
	width: 16px;
	height: 16px;
	margin-right: 4px;
	vertical-align: middle;
	color: #6f7f93;
}

.wstl-detection-stats-spaced {
	margin-bottom: 20px;
}

.wstl-dashboard .wstl-detection-value {
	font-size: 24px;
}

.wstl-dashboard .wstl-roi-scorecard {
	padding: 24px;
}

.wstl-dashboard .wstl-roi-scorecard-stat {
	padding: 18px;
}

.wstl-dashboard .wstl-roi-scorecard-value {
	font-size: 26px;
}

.wstl-dashboard .wstl-roi-upsell-strip {
	background: linear-gradient(135deg, #f3f8fc 0%, #ecf3f9 100%);
	border-color: #c8dae8;
}

.wstl-dashboard .wstl-roi-upsell-strip .dashicons-superhero-alt,
.wstl-dashboard .wstl-roi-upsell-strip-link {
	color: var(--wstl-brand);
}

.wstl-dashboard .wstl-health-ring-vip,
.wstl-dashboard .wstl-health-ring-trusted {
	border-color: var(--wstl-segment-vip);
}

.wstl-dashboard .wstl-health-ring-normal {
	border-color: var(--wstl-segment-normal);
}

.wstl-dashboard .wstl-health-ring-caution {
	border-color: var(--wstl-segment-caution);
}

.wstl-dashboard .wstl-health-ring-risk,
.wstl-dashboard .wstl-health-ring-critical {
	border-color: var(--wstl-segment-critical);
}

.wstl-dashboard .wstl-kpi-card-green {
	border-left-color: var(--wstl-success);
}

.wstl-dashboard .wstl-kpi-card-red {
	border-left-color: var(--wstl-danger);
}

.wstl-dashboard .wstl-kpi-card-amber {
	border-left-color: var(--wstl-warning);
}

.wstl-dashboard .wstl-kpi-card-blue {
	border-left-color: var(--wstl-info);
}

.wstl-dashboard .wstl-kpi-card-purple {
	border-left-color: var(--wstl-brand);
}

.wstl-dashboard .wstl-kpi-card-green .wstl-kpi-icon,
.wstl-dashboard .wstl-kpi-card-green .wstl-kpi-value {
	color: var(--wstl-success);
}

.wstl-dashboard .wstl-kpi-card-red .wstl-kpi-icon,
.wstl-dashboard .wstl-kpi-card-red .wstl-kpi-value {
	color: var(--wstl-danger);
}

.wstl-dashboard .wstl-kpi-card-amber .wstl-kpi-icon {
	color: var(--wstl-warning);
}

.wstl-dashboard .wstl-kpi-card-blue .wstl-kpi-icon {
	color: var(--wstl-info);
}

.wstl-dashboard .wstl-kpi-card-purple .wstl-kpi-icon {
	color: var(--wstl-brand);
}

.wstl-dashboard .wstl-roi-scorecard-stat {
	background: #fff;
	border: 1px solid #d9e4ef;
	border-top: 3px solid transparent;
	border-radius: 10px;
	text-align: left;
	color: var(--wstl-text);
	box-shadow: 0 1px 0 rgba(15, 40, 65, 0.03);
}

.wstl-dashboard .wstl-roi-scorecard-stat-protected {
	border-top-color: var(--wstl-segment-vip);
}

.wstl-dashboard .wstl-roi-scorecard-stat-risk {
	border-top-color: var(--wstl-segment-critical);
}

.wstl-dashboard .wstl-roi-scorecard-stat-rate {
	border-top-color: var(--wstl-color-primary);
}

.wstl-dashboard .wstl-roi-scorecard-stat-actions {
	border-top-color: #3f556c;
}

.wstl-dashboard .wstl-roi-scorecard-stat .wstl-roi-scorecard-label {
	color: #6c7d8f;
	opacity: 0.95;
}

.wstl-dashboard .wstl-roi-scorecard-stat .wstl-roi-scorecard-value {
	color: var(--wstl-text);
}

.wstl-dashboard .wstl-roi-scorecard-stat-protected .wstl-roi-scorecard-value {
	color: var(--wstl-segment-vip);
}

.wstl-dashboard .wstl-roi-scorecard-stat-risk .wstl-roi-scorecard-value {
	color: var(--wstl-segment-critical);
}

.wstl-dashboard .wstl-roi-scorecard-stat-rate .wstl-roi-scorecard-value {
	color: var(--wstl-color-primary);
}

.wstl-dashboard .wstl-roi-scorecard-stat-actions .wstl-roi-scorecard-value {
	color: #3f556c;
}

.wstl-dashboard .wstl-returners-table th.wstl-num,
.wstl-dashboard .wstl-returners-table td.wstl-num {
	text-align: right;
}

.wstl-dashboard .wstl-returners-table th.wstl-rate-col,
.wstl-dashboard .wstl-returners-table td.wstl-rate-col {
	text-align: center;
}

.wstl-dashboard .wstl-returners-table .wstl-row-meta {
	margin-top: 3px;
	font-size: 11px;
	color: #7a8898;
}

.wstl-dashboard .wstl-returners-table tr.is-priority td {
	background: #fcf8f0;
}

.wstl-dashboard .wstl-returners-table .wstl-rate-chip {
	display: inline-flex;
	align-items: center;
	justify-content: flex-end;
	min-width: 58px;
	padding: 3px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.02em;
	font-variant-numeric: tabular-nums;
}

.wstl-dashboard .wstl-returners-table .wstl-rate-normal {
	background: #eef3f8;
	color: #5b6d80;
}

.wstl-dashboard .wstl-returners-table .wstl-rate-elevated {
	background: #f8ecd6;
	color: var(--wstl-segment-caution);
}

.wstl-dashboard .wstl-returners-table .wstl-rate-high {
	background: #f8e7da;
	color: var(--wstl-segment-risk);
}

.wstl-dashboard .wstl-returners-table .wstl-rate-critical {
	background: #f8e5e8;
	color: var(--wstl-segment-critical);
}

.wstl-dashboard .wstl-detection-stats {
	gap: 12px;
}

.wstl-dashboard .wstl-detection-stat {
	background: #fff;
	border: 1px solid #d9e4ef;
	border-top: 3px solid #c7d4e2;
	border-radius: 10px;
	padding: 14px 12px;
	text-align: left;
	box-shadow: 0 1px 0 rgba(15, 40, 65, 0.03);
}

.wstl-dashboard .wstl-detection-value {
	font-size: 26px;
	line-height: 1.08;
	margin-bottom: 4px;
	color: var(--wstl-text);
}

.wstl-dashboard .wstl-detection-label {
	font-size: 10px;
	letter-spacing: 0.05em;
	color: #6c7d8f;
}

.wstl-dashboard .wstl-detection-stat-success {
	border-top-color: var(--wstl-segment-vip);
}

.wstl-dashboard .wstl-detection-stat-warning {
	border-top-color: var(--wstl-segment-caution);
}

.wstl-dashboard .wstl-detection-stat-danger {
	border-top-color: var(--wstl-segment-critical);
}

.wstl-dashboard .wstl-detection-stat-success .wstl-detection-value {
	color: var(--wstl-segment-vip);
}

.wstl-dashboard .wstl-detection-stat-warning .wstl-detection-value {
	color: var(--wstl-segment-caution);
}

.wstl-dashboard .wstl-detection-stat-danger .wstl-detection-value {
	color: var(--wstl-segment-critical);
}

.wstl-dashboard .wstl-segment-badge.wstl-segment-vip {
	background: var(--wstl-segment-vip);
}

.wstl-dashboard .wstl-segment-badge.wstl-segment-trusted {
	background: var(--wstl-segment-trusted);
}

.wstl-dashboard .wstl-segment-badge.wstl-segment-normal {
	background: var(--wstl-segment-normal);
}

.wstl-dashboard .wstl-segment-badge.wstl-segment-caution {
	background: var(--wstl-segment-caution-soft);
	color: var(--wstl-segment-caution-ink);
}

.wstl-dashboard .wstl-segment-badge.wstl-segment-risk {
	background: var(--wstl-segment-risk);
}

.wstl-dashboard .wstl-segment-badge.wstl-segment-critical {
	background: var(--wstl-segment-critical);
}

.wstl-dashboard .wstl-score.wstl-score-vip {
	color: var(--wstl-segment-vip);
}

.wstl-dashboard .wstl-score.wstl-score-trusted {
	color: var(--wstl-segment-trusted);
}

.wstl-dashboard .wstl-score.wstl-score-normal {
	color: var(--wstl-segment-normal);
}

.wstl-dashboard .wstl-score.wstl-score-caution {
	color: var(--wstl-segment-caution);
}

.wstl-dashboard .wstl-score.wstl-score-risk,
.wstl-dashboard .wstl-score.wstl-score-critical {
	color: var(--wstl-segment-critical);
}

.wstl-dashboard .wstl-attention-card {
	border-left-color: var(--wstl-segment-critical);
}

.wstl-dashboard .wstl-attention-count {
	background: var(--wstl-segment-critical);
	min-width: 22px;
	height: 22px;
	font-size: 11px;
}

.wstl-dashboard .wstl-pulse-dot {
	background: var(--wstl-segment-critical);
}

.wstl-dashboard .wstl-header-health-msg.is-good {
	color: var(--wstl-segment-vip);
}

.wstl-dashboard .wstl-header-health-msg.is-caution {
	color: var(--wstl-segment-caution);
}

.wstl-dashboard .wstl-header-health-msg.is-danger {
	color: var(--wstl-segment-critical);
}

.wstl-dashboard .wstl-header-health-msg.is-setup {
	color: var(--wstl-segment-trusted);
}

@media (max-width: 782px) {
	.wstl-dashboard {
		padding: 0;
	}

	.wstl-dashboard .wstl-header-bar {
		padding: 18px;
		gap: 14px;
	}

	.wstl-dashboard .wstl-header-greeting {
		font-size: 20px;
	}

	.wstl-dashboard .wstl-card,
	.wstl-dashboard .wstl-roi-scorecard {
		padding: 16px;
	}

	.wstl-chart-height-lg,
	.wstl-chart-height-md,
	.wstl-chart-height-sm {
		height: 220px;
	}

	.wstl-dashboard .wstl-kpi-value {
		font-size: 24px;
	}
}

.wstl-empty-state-hint {
	font-size: 13px !important;
	color: var(--wstl-muted, #5b6d80) !important;
	margin-top: 6px !important;
}

.wstl-empty-state .button-primary {
	margin-top: 16px;
}

/* ==========================================================================
   Alert Band — operationally critical states at top of populated dashboard
   ========================================================================== */

.wstl-dashboard .wstl-alert-band {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.wstl-dashboard .wstl-alert {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 18px;
	border: 1px solid var(--wstl-border);
	border-left-width: 4px;
	border-radius: 12px;
	background: var(--wstl-surface);
	box-shadow: var(--wstl-shadow-sm);
}

.wstl-dashboard .wstl-alert .dashicons {
	flex: 0 0 auto;
	font-size: 22px;
	width: 22px;
	height: 22px;
}

.wstl-dashboard .wstl-alert-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
	line-height: 1.4;
}

.wstl-dashboard .wstl-alert-body strong {
	color: var(--wstl-text);
	font-size: 14px;
}

.wstl-dashboard .wstl-alert-body span {
	color: var(--wstl-muted);
	font-size: 13px;
}

.wstl-dashboard .wstl-alert-danger {
	border-left-color: var(--wstl-danger);
	background: linear-gradient(90deg, #fef2f4 0%, #fff 45%);
}

.wstl-dashboard .wstl-alert-danger .dashicons {
	color: var(--wstl-danger);
}

.wstl-dashboard .wstl-alert-warn {
	border-left-color: var(--wstl-warning);
	background: linear-gradient(90deg, #fffaf0 0%, #fff 45%);
}

.wstl-dashboard .wstl-alert-warn .dashicons {
	color: #b45309;
}

.wstl-dashboard .wstl-alert .button {
	flex: 0 0 auto;
}

/* ==========================================================================
   Module Status Pill Row — at-a-glance on/off + micro-stat
   ========================================================================== */

.wstl-dashboard .wstl-module-pills {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 12px;
}

@media (max-width: 1400px) {
	.wstl-dashboard .wstl-module-pills {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 782px) {
	.wstl-dashboard .wstl-module-pills {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 520px) {
	.wstl-dashboard .wstl-module-pills {
		grid-template-columns: 1fr;
	}
}

.wstl-dashboard .wstl-module-pill {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 14px 14px;
	background: var(--wstl-surface);
	border: 1px solid var(--wstl-border);
	border-radius: 12px;
	box-shadow: var(--wstl-shadow-sm);
	color: var(--wstl-text);
	text-decoration: none;
	transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
	min-width: 0;
}

.wstl-dashboard .wstl-module-pill:hover,
.wstl-dashboard .wstl-module-pill:focus {
	box-shadow: var(--wstl-shadow-md);
	transform: translateY(-1px);
	border-color: #c7d3e0;
	color: var(--wstl-text);
	text-decoration: none;
}

.wstl-dashboard .wstl-module-pill-icon {
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background: var(--wstl-bg-soft);
	color: var(--wstl-muted);
	font-size: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 2px;
}

.wstl-dashboard .wstl-module-pill-icon::before {
	width: auto;
	height: auto;
	font-size: 16px;
	line-height: 1;
}

.wstl-dashboard .wstl-module-pill-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.wstl-dashboard .wstl-module-pill-title {
	font-size: 13px;
	font-weight: 600;
	color: var(--wstl-text);
	letter-spacing: -0.005em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wstl-dashboard .wstl-module-pill-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.wstl-dashboard .wstl-module-state {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 1px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	background: #eef1f5;
	color: var(--wstl-muted);
	white-space: nowrap;
}

.wstl-dashboard .wstl-module-state::before {
	content: '';
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.85;
}

.wstl-dashboard .wstl-module-stat {
	font-size: 12px;
	color: var(--wstl-muted);
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}

/* State variants — pill chip color + left-border accent */

.wstl-dashboard .wstl-module-pill-good {
	border-left: 3px solid var(--wstl-success);
}
.wstl-dashboard .wstl-module-pill-good .wstl-module-state {
	background: #d1fae5;
	color: #065f46;
}
.wstl-dashboard .wstl-module-pill-good .wstl-module-pill-icon {
	background: #ecfdf5;
	color: var(--wstl-success);
}

.wstl-dashboard .wstl-module-pill-warn {
	border-left: 3px solid var(--wstl-warning);
}
.wstl-dashboard .wstl-module-pill-warn .wstl-module-state {
	background: #fef3c7;
	color: #92400e;
}
.wstl-dashboard .wstl-module-pill-warn .wstl-module-pill-icon {
	background: #fffaf0;
	color: #b45309;
}

.wstl-dashboard .wstl-module-pill-danger {
	border-left: 3px solid var(--wstl-danger);
}
.wstl-dashboard .wstl-module-pill-danger .wstl-module-state {
	background: #fee2e2;
	color: #991b1b;
}
.wstl-dashboard .wstl-module-pill-danger .wstl-module-pill-icon {
	background: #fef2f4;
	color: var(--wstl-danger);
}

.wstl-dashboard .wstl-module-pill-idle {
	border-left: 3px solid #cbd5e1;
}

.wstl-dashboard .wstl-module-pill-off {
	opacity: 0.78;
	border-left: 3px solid #cbd5e1;
}
.wstl-dashboard .wstl-module-pill-off .wstl-module-state {
	background: #f3f4f6;
	color: #9ca3af;
}

.wstl-dashboard .wstl-module-pill-pro {
	border-left: 3px solid #635bff;
	background: linear-gradient(180deg, #fff 0%, #faf8ff 100%);
}
.wstl-dashboard .wstl-module-pill-pro .wstl-module-state {
	background: #ede9fe;
	color: #5b21b6;
}
.wstl-dashboard .wstl-module-pill-pro .wstl-module-pill-icon {
	background: #f5f3ff;
	color: #5b21b6;
}
.wstl-dashboard .wstl-module-pill.is-upsell:hover {
	border-color: #635bff;
}
