/* Workspace dashboard — Microsoft Clarity–inspired layout (presentation only) */

body.ws-stitch-page .app-stage:has(#view-dashboard.clarity-dash.active) {
	background: #f0f0f0;
}

body.ws-stitch-page .app-main:has(#view-dashboard.clarity-dash.active) {
	background: #f0f0f0;
}

#view-dashboard.clarity-dash {
	--clarity-bg: #f0f0f0;
	--clarity-surface: #ffffff;
	--clarity-border: #e1dfdd;
	--clarity-border-soft: #edebe9;
	--clarity-text: #242424;
	--clarity-muted: #605e5c;
	--clarity-purple: #742774;
	--clarity-purple-soft: rgba(116, 39, 116, 0.12);
	--clarity-blue: #0078d4;
	--clarity-blue-soft: rgba(0, 120, 212, 0.12);
	--clarity-orange: #ca5010;
	--clarity-orange-soft: rgba(202, 80, 16, 0.12);
	--clarity-shadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.132), 0 0.3px 0.9px 0 rgba(0, 0, 0, 0.108);
	--clarity-shadow-hover: 0 3.2px 7.2px 0 rgba(0, 0, 0, 0.132), 0 0.6px 1.8px 0 rgba(0, 0, 0, 0.108);
	font-family: "Segoe UI", "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
	color: var(--clarity-text);
	padding-bottom: 8px;
}

#view-dashboard.clarity-dash .cdash-welcome-strip {
	background: var(--clarity-surface);
	border: 1px solid var(--clarity-border);
	border-radius: 4px;
	box-shadow: var(--clarity-shadow);
	padding: 14px 20px 16px;
	margin-bottom: 12px;
}

#view-dashboard.clarity-dash .cdash-welcome-status {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--clarity-muted);
	margin-bottom: 4px;
}

#view-dashboard.clarity-dash .cdash-status-live {
	color: var(--clarity-blue);
	font-weight: 700;
}

#view-dashboard.clarity-dash .cdash-welcome-title {
	margin: 0;
	font-size: 22px;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.02em;
	color: var(--clarity-text);
}

#view-dashboard.clarity-dash .cdash-kpi-band {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 12px;
}

#view-dashboard.clarity-dash .cdash-kpi-band--four {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

#view-dashboard.clarity-dash .cdash-kpi {
	background: var(--clarity-surface);
	border: 1px solid var(--clarity-border);
	border-radius: 4px;
	padding: 14px 16px;
	box-shadow: var(--clarity-shadow);
	min-height: 96px;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	transition: box-shadow 0.15s ease;
}

#view-dashboard.clarity-dash .cdash-kpi:hover {
	box-shadow: var(--clarity-shadow-hover);
}

#view-dashboard.clarity-dash .cdash-kpi-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--clarity-muted);
	line-height: 1.35;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
}

#view-dashboard.clarity-dash .cdash-kpi-label .cdash-kpi-ico {
	opacity: 0.7;
	font-size: 14px;
	line-height: 1;
	flex-shrink: 0;
}

#view-dashboard.clarity-dash .cdash-kpi-val {
	margin-top: 6px;
	font-size: 1.75rem;
	font-weight: 600;
	color: var(--clarity-text);
	font-variant-numeric: tabular-nums;
	line-height: 1.1;
	letter-spacing: -0.02em;
}

#view-dashboard.clarity-dash .cdash-kpi-val.cdash-kpi-val--plan {
	font-size: 1.15rem;
	font-weight: 700;
	text-transform: uppercase;
}

#view-dashboard.clarity-dash .cdash-kpi-hint {
	margin-top: 6px;
	font-size: 11px;
	color: var(--clarity-muted);
	line-height: 1.45;
}

#view-dashboard.clarity-dash .cdash-widget-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	align-items: start;
}

#view-dashboard.clarity-dash .cdash-widget {
	background: var(--clarity-surface);
	border: 1px solid var(--clarity-border);
	border-radius: 4px;
	box-shadow: var(--clarity-shadow);
	overflow: hidden;
	min-height: 0;
}

#view-dashboard.clarity-dash .cdash-widget-head {
	margin: 0;
	padding: 14px 20px;
	font-size: 16px;
	font-weight: 600;
	color: var(--clarity-text);
	border-bottom: 1px solid var(--clarity-border-soft);
	background: linear-gradient(180deg, #faf9f8 0%, var(--clarity-surface) 100%);
}

#view-dashboard.clarity-dash .cdash-widget-body {
	padding: 14px 20px 18px;
}

#view-dashboard.clarity-dash .cdash-widget--span-2 {
	grid-column: span 2;
}

#view-dashboard.clarity-dash .cdash-ratio-row {
	margin-bottom: 16px;
}

#view-dashboard.clarity-dash .cdash-ratio-row:last-child {
	margin-bottom: 0;
}

#view-dashboard.clarity-dash .cdash-ratio-meta {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 8px;
}

#view-dashboard.clarity-dash .cdash-ratio-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--clarity-text);
}

#view-dashboard.clarity-dash .cdash-ratio-val {
	font-size: 13px;
	font-weight: 600;
	color: var(--clarity-blue);
	font-variant-numeric: tabular-nums;
}

#view-dashboard.clarity-dash .cdash-bar-track {
	height: 8px;
	border-radius: 4px;
	background: #edebe9;
	overflow: hidden;
	display: flex;
}

#view-dashboard.clarity-dash .cdash-bar-seg {
	height: 100%;
	min-width: 0;
	transition: width 0.35s ease;
}

#view-dashboard.clarity-dash .cdash-bar-seg--blue {
	background: var(--clarity-blue);
}

#view-dashboard.clarity-dash .cdash-bar-seg--purple {
	background: var(--clarity-purple);
}

#view-dashboard.clarity-dash .cdash-bar-seg--orange {
	background: var(--clarity-orange);
}

#view-dashboard.clarity-dash .cdash-bar-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 16px;
	margin-top: 8px;
	font-size: 11px;
	color: var(--clarity-muted);
}

#view-dashboard.clarity-dash .cdash-bar-legend span::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 2px;
	margin-right: 6px;
	vertical-align: middle;
}

#view-dashboard.clarity-dash .cdash-bar-legend .leg-blue::before {
	background: var(--clarity-blue);
}

#view-dashboard.clarity-dash .cdash-bar-legend .leg-purple::before {
	background: var(--clarity-purple);
}

#view-dashboard.clarity-dash .cdash-bar-legend .leg-orange::before {
	background: var(--clarity-orange);
}

#view-dashboard.clarity-dash .cdash-kv-list {
	display: flex;
	flex-direction: column;
	gap: 0;
}

#view-dashboard.clarity-dash .cdash-kv-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--clarity-border-soft);
	font-size: 13px;
}

#view-dashboard.clarity-dash .cdash-kv-row:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

#view-dashboard.clarity-dash .cdash-kv-k {
	color: var(--clarity-muted);
	font-weight: 600;
}

#view-dashboard.clarity-dash .cdash-kv-v {
	color: var(--clarity-text);
	font-weight: 600;
	text-align: right;
}

#view-dashboard.clarity-dash .cdash-plan-pill {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--clarity-purple-soft);
	color: var(--clarity-purple);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	margin-bottom: 8px;
}

#view-dashboard.clarity-dash .cdash-plan-title {
	margin: 0 0 12px;
	font-size: 1.35rem;
	font-weight: 600;
	color: var(--clarity-text);
	letter-spacing: -0.02em;
}

#view-dashboard.clarity-dash #dashUsageSummary {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--clarity-border-soft);
	color: var(--clarity-muted) !important;
	font-size: 12px;
	line-height: 1.65 !important;
}

#view-dashboard.clarity-dash #dashUsageSummary div {
	color: inherit;
}

#view-dashboard.clarity-dash .cdash-manage-btn {
	margin-top: 14px;
}

#view-dashboard.clarity-dash .cdash-manage-btn a {
	display: block;
	text-align: center;
	text-decoration: none;
	padding: 9px 14px;
	border-radius: 4px;
	border: 1px solid var(--clarity-border);
	background: var(--clarity-surface);
	color: var(--clarity-text);
	font-size: 13px;
	font-weight: 600;
	transition: border-color 0.15s, color 0.15s, background 0.15s;
}

#view-dashboard.clarity-dash .cdash-manage-btn a:hover {
	border-color: var(--clarity-blue);
	color: var(--clarity-blue);
	background: var(--clarity-blue-soft);
}

#view-dashboard.clarity-dash .cdash-quick-tiles {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

#view-dashboard.clarity-dash .cdash-quick-tile {
	border: 1px solid var(--clarity-border);
	border-radius: 4px;
	padding: 14px 12px;
	background: #faf9f8;
	cursor: pointer;
	text-align: left;
	transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
	min-height: 78px;
}

#view-dashboard.clarity-dash .cdash-quick-tile:hover {
	border-color: var(--clarity-blue);
	box-shadow: var(--clarity-shadow-hover);
	background: var(--clarity-blue-soft);
}

#view-dashboard.clarity-dash .cdash-quick-tile .cdash-quick-main {
	font-size: 13px;
	font-weight: 600;
	color: var(--clarity-text);
	line-height: 1.35;
}

#view-dashboard.clarity-dash .cdash-quick-tile .cdash-quick-sub {
	display: block;
	margin-top: 4px;
	font-size: 11px;
	color: var(--clarity-muted);
	font-weight: 500;
}

#view-dashboard.clarity-dash .cdash-visitors-highlight {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

#view-dashboard.clarity-dash .cdash-visitors-num {
	font-size: 2rem;
	font-weight: 600;
	color: var(--clarity-text);
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

#view-dashboard.clarity-dash .cdash-visitors-badge {
	font-size: 11px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--clarity-blue-soft);
	color: var(--clarity-blue);
	white-space: nowrap;
}

#view-dashboard.clarity-dash .cdash-filter-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px 16px;
	background: var(--clarity-surface);
	border: 1px solid var(--clarity-border);
	border-radius: 4px;
	padding: 14px 16px;
	margin-bottom: 12px;
	box-shadow: var(--clarity-shadow);
}

#view-dashboard.clarity-dash .cdash-filter-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

#view-dashboard.clarity-dash .cdash-filter-group label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--clarity-muted);
}

#view-dashboard.clarity-dash .cdash-filter-select,
#view-dashboard.clarity-dash .cdash-filter-input {
	padding: 8px 10px;
	border: 1px solid var(--clarity-border);
	border-radius: 4px;
	font: inherit;
	font-size: 13px;
	background: #fff;
	min-height: 36px;
}

#view-dashboard.clarity-dash .cdash-filter-custom {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 8px;
}

#view-dashboard.clarity-dash .cdash-filter-dropdown {
	position: relative;
}

#view-dashboard.clarity-dash .cdash-filter-dropdown-btn {
	padding: 8px 12px;
	border: 1px solid var(--clarity-border);
	border-radius: 4px;
	background: #fff;
	font: inherit;
	font-size: 13px;
	cursor: pointer;
	min-width: 180px;
	text-align: left;
}

#view-dashboard.clarity-dash .cdash-filter-dropdown-panel {
	display: none;
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	z-index: 40;
	min-width: 240px;
	max-width: 320px;
	max-height: 280px;
	overflow: auto;
	background: #fff;
	border: 1px solid var(--clarity-border);
	border-radius: 4px;
	box-shadow: var(--clarity-shadow-hover);
	padding: 10px;
}

#view-dashboard.clarity-dash .cdash-filter-dropdown-panel.is-open {
	display: block;
}

#view-dashboard.clarity-dash .cdash-filter-check {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	padding: 6px 4px;
	cursor: pointer;
}

#view-dashboard.clarity-dash .cdash-report-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 12px;
}

#view-dashboard.clarity-dash .cdash-report-card {
	background: var(--clarity-surface);
	border: 1px solid var(--clarity-border);
	border-radius: 4px;
	box-shadow: var(--clarity-shadow);
	padding: 16px 18px;
	min-height: 280px;
}

#view-dashboard.clarity-dash .cdash-report-card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

#view-dashboard.clarity-dash .cdash-report-card-head h3 {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
}

#view-dashboard.clarity-dash .cdash-report-range {
	font-size: 11px;
	color: var(--clarity-muted);
}

#view-dashboard.clarity-dash .cdash-report-metrics {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 10px;
	margin-bottom: 14px;
}

#view-dashboard.clarity-dash .cdash-report-metric-label {
	font-size: 11px;
	font-weight: 600;
	color: var(--clarity-muted);
	margin-bottom: 4px;
}

#view-dashboard.clarity-dash .cdash-report-metric-val {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--clarity-text);
}

#view-dashboard.clarity-dash .cdash-report-metric-sub {
	font-size: 10px;
	color: var(--clarity-muted);
	margin-top: 2px;
}

#view-dashboard.clarity-dash .cdash-report-chart-wrap {
	height: 120px;
	position: relative;
}

#view-dashboard.clarity-dash .cdash-report-chart-head {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 6px;
}

#view-dashboard.clarity-dash .cdash-report-metric-select {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	color: var(--clarity-muted);
}

#view-dashboard.clarity-dash .cdash-report-metric-select-el {
	font-size: 11px;
	padding: 3px 6px;
	border: 1px solid var(--clarity-border);
	border-radius: 4px;
	background: var(--clarity-surface);
	color: var(--clarity-text);
	max-width: 160px;
}

#view-dashboard.clarity-dash .cdash-report-loading {
	color: var(--clarity-muted);
	font-size: 13px;
	padding: 24px 0;
}

#view-dashboard.clarity-dash .cdash-usage-panel {
	background: var(--clarity-surface);
	border: 1px solid var(--clarity-border);
	border-radius: 4px;
	box-shadow: var(--clarity-shadow);
	margin-bottom: 12px;
}

#view-dashboard.clarity-dash .cdash-usage-panel .cdash-widget-head {
	margin: 0;
	padding: 14px 18px;
	border-bottom: 1px solid var(--clarity-border-soft);
	font-size: 14px;
	font-weight: 600;
}

#view-dashboard.clarity-dash .cdash-usage-panel .cdash-widget-body {
	padding: 16px 18px 18px;
}

#view-dashboard.clarity-dash .data-table tr.usage-limit-exhausted td,
#view-subscription .data-table tr.usage-limit-exhausted td {
	color: #dc2626;
	font-weight: 600;
}

@media (max-width: 1280px) {
	#view-dashboard.clarity-dash .cdash-kpi-band {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	#view-dashboard.clarity-dash .cdash-report-grid {
		grid-template-columns: 1fr;
	}
	#view-dashboard.clarity-dash .cdash-report-metrics {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
	#view-dashboard.clarity-dash .cdash-widget-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	#view-dashboard.clarity-dash .cdash-widget--span-2 {
		grid-column: span 2;
	}
}

@media (max-width: 860px) {
	#view-dashboard.clarity-dash .cdash-kpi-band {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	#view-dashboard.clarity-dash .cdash-report-metrics {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	#view-dashboard.clarity-dash .cdash-widget-grid {
		grid-template-columns: 1fr;
	}
	#view-dashboard.clarity-dash .cdash-widget--span-2 {
		grid-column: span 1;
	}
}
