/*
 * GCDC Motos - Dashboard styles.
 * Scoped under .gcdc-survey-dashboard so it never leaks into the active
 * theme (the dashboard is embedded via shortcode inside a normal page).
 *
 * Palette: white / very light gray / near-black neutrals, accented only
 * with the two brand colors — navy (#00243C) and green (#37AE6C).
 */

.gcdc-survey-dashboard {
	--gcdc-sd-navy: #00243c;
	--gcdc-sd-navy-dark: #001728;
	--gcdc-sd-navy-tint: #e7edf1;
	--gcdc-sd-green: #37ae6c;
	--gcdc-sd-green-dark: #2c8f59;
	--gcdc-sd-green-tint: #e6f5ee;
	--gcdc-sd-ink: #14171a;
	--gcdc-sd-muted: #667085;
	--gcdc-sd-border: #e6e8eb;
	--gcdc-sd-bg: #ffffff;
	--gcdc-sd-bg-soft: #f5f6f7;
	--gcdc-sd-score-low: var(--gcdc-sd-navy);
	--gcdc-sd-score-mid: #98a2b3;
	--gcdc-sd-score-high: var(--gcdc-sd-green);
	--gcdc-sd-radius-lg: 18px;
	--gcdc-sd-radius-md: 12px;
	--gcdc-sd-shadow: 0 1px 2px rgba(16, 18, 25, 0.04), 0 4px 14px rgba(16, 18, 25, 0.05);

	all: initial;
	display: block;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
	color: var(--gcdc-sd-ink);
	max-width: 100%;
	box-sizing: border-box;
	line-height: 1.45;
	overflow-x: hidden;
}

.gcdc-survey-dashboard,
.gcdc-survey-dashboard * {
	box-sizing: border-box;
}

.gcdc-survey-dashboard *:not(input):not(textarea):not(select) {
	font-family: inherit;
}

.gcdc-sd-denied {
	color: var(--gcdc-sd-navy);
	font-weight: 700;
	background: var(--gcdc-sd-navy-tint);
	border: 1px solid var(--gcdc-sd-border);
	border-left: 4px solid var(--gcdc-sd-navy);
	padding: 14px 16px;
	border-radius: var(--gcdc-sd-radius-md);
	display: inline-block;
}

/* Filters */
.gcdc-sd-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: flex-end;
	background: var(--gcdc-sd-bg);
	border: 1px solid var(--gcdc-sd-border);
	border-radius: var(--gcdc-sd-radius-lg);
	padding: 18px 20px;
	margin-bottom: 22px;
	box-shadow: var(--gcdc-sd-shadow);
}

.gcdc-sd-filter {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 13px;
	min-width: 0;
}

.gcdc-sd-filter label {
	color: var(--gcdc-sd-muted);
	font-weight: 700;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.gcdc-sd-filter input,
.gcdc-sd-filter select {
	padding: 10px 12px;
	border: 1.5px solid var(--gcdc-sd-border);
	border-radius: 10px;
	font-size: 14px;
	min-width: 170px;
	max-width: 100%;
	background: var(--gcdc-sd-bg-soft);
	color: var(--gcdc-sd-ink);
	transition: border-color 0.15s ease, background 0.15s ease;
}

.gcdc-sd-filter input:focus,
.gcdc-sd-filter select:focus {
	outline: none;
	border-color: var(--gcdc-sd-green);
	background: #fff;
}

.gcdc-sd-filter--actions {
	flex-direction: row;
	gap: 10px;
	margin-left: auto;
}

.gcdc-sd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 18px;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--gcdc-sd-green), var(--gcdc-sd-green-dark));
	color: #fff !important;
	font-weight: 700;
	font-size: 14px;
	text-decoration: none !important;
	border: none;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(55, 174, 108, 0.26);
	transition: transform 0.12s ease, box-shadow 0.12s ease;
	white-space: nowrap;
}

.gcdc-sd-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 20px rgba(55, 174, 108, 0.32);
}

.gcdc-sd-btn--secondary {
	background: var(--gcdc-sd-bg);
	color: var(--gcdc-sd-ink) !important;
	border: 1.5px solid var(--gcdc-sd-border);
	box-shadow: none;
}

.gcdc-sd-btn--secondary:hover {
	border-color: #c9cdd3;
	box-shadow: none;
}

/* KPI cards */
.gcdc-sd-kpis {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
	margin-bottom: 24px;
}

.gcdc-sd-kpi {
	background: var(--gcdc-sd-bg);
	border: 1px solid var(--gcdc-sd-border);
	border-radius: var(--gcdc-sd-radius-lg);
	padding: 18px 20px;
	display: flex;
	align-items: center;
	gap: 14px;
	box-shadow: var(--gcdc-sd-shadow);
	min-width: 0;
}

.gcdc-sd-kpi--advisor,
.gcdc-sd-kpi--delivery {
	color: var(--gcdc-sd-green);
}

.gcdc-sd-kpi--total {
	color: var(--gcdc-sd-ink);
}

.gcdc-sd-kpi__icon {
	flex: none;
	width: 46px;
	height: 46px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: currentColor;
}

.gcdc-sd-kpi__icon svg {
	display: block;
}

.gcdc-sd-kpi__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.gcdc-sd-kpi__label {
	font-size: 12px;
	color: var(--gcdc-sd-muted);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	cursor: help;
	border-bottom: 1px dotted var(--gcdc-sd-muted);
	width: fit-content;
}

.gcdc-sd-kpi__value {
	font-size: 26px;
	font-weight: 800;
	color: var(--gcdc-sd-ink);
	letter-spacing: -0.01em;
}

/* Panels */
.gcdc-sd-panel {
	background: var(--gcdc-sd-bg);
	border: 1px solid var(--gcdc-sd-border);
	border-radius: var(--gcdc-sd-radius-lg);
	padding: 20px 22px 22px;
	margin-bottom: 22px;
	box-shadow: var(--gcdc-sd-shadow);
	max-width: 100%;
}

.gcdc-sd-panel__title {
	margin: 0 0 16px;
	font-size: 16px;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--gcdc-sd-navy);
}

/* Brand breakdown */
.gcdc-sd-brand-breakdown {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 14px;
}

.gcdc-sd-brand-item {
	border: 1px solid var(--gcdc-sd-border);
	border-radius: var(--gcdc-sd-radius-md);
	padding: 14px 16px;
	background: var(--gcdc-sd-bg-soft);
	min-width: 0;
}

.gcdc-sd-brand-item__name {
	font-weight: 700;
	font-size: 13.5px;
	margin-bottom: 6px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--gcdc-sd-navy);
}

.gcdc-sd-brand-item__score {
	font-size: 24px;
	font-weight: 800;
	line-height: 1;
	margin-bottom: 8px;
}

.gcdc-sd-score-bar {
	height: 6px;
	border-radius: 4px;
	background: var(--gcdc-sd-border);
	overflow: hidden;
	margin-bottom: 10px;
}

.gcdc-sd-score-bar__fill {
	height: 100%;
	border-radius: 4px;
	transition: width 0.4s ease;
}

.gcdc-sd-score-bar__fill--good {
	background: var(--gcdc-sd-score-high);
}

.gcdc-sd-score-bar__fill--ok {
	background: var(--gcdc-sd-score-mid);
}

.gcdc-sd-score-bar__fill--bad {
	background: var(--gcdc-sd-score-low);
}

.gcdc-sd-brand-item__meta {
	font-size: 12px;
	color: var(--gcdc-sd-muted);
	line-height: 1.5;
}

/* Table */
.gcdc-sd-table-wrap {
	overflow-x: auto;
	border-radius: var(--gcdc-sd-radius-md);
	border: 1px solid var(--gcdc-sd-border);
	max-width: 100%;
}

.gcdc-sd-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13.5px;
	min-width: 800px;
}

.gcdc-sd-table th,
.gcdc-sd-table td {
	text-align: left;
	padding: 12px 14px;
	border-bottom: 1px solid var(--gcdc-sd-border);
	vertical-align: top;
}

.gcdc-sd-table thead th {
	background: var(--gcdc-sd-bg-soft);
	font-weight: 700;
	white-space: nowrap;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--gcdc-sd-muted);
	position: sticky;
	top: 0;
	z-index: 1;
	cursor: help;
}

.gcdc-sd-table thead th.gcdc-sd-sortable {
	cursor: pointer;
	-webkit-user-select: none;
	user-select: none;
}

.gcdc-sd-table thead th.gcdc-sd-sortable:hover {
	color: var(--gcdc-sd-navy);
}

.gcdc-sd-sort-icon {
	display: inline-block;
	margin-left: 4px;
	width: 10px;
}

.gcdc-sd-sort-icon::after {
	content: '\2195';
	opacity: 0.35;
}

.gcdc-sd-sortable--asc .gcdc-sd-sort-icon::after {
	content: '\2191';
	opacity: 1;
	color: var(--gcdc-sd-green);
}

.gcdc-sd-sortable--desc .gcdc-sd-sort-icon::after {
	content: '\2193';
	opacity: 1;
	color: var(--gcdc-sd-green);
}

.gcdc-sd-table tbody tr:nth-child(even) {
	background: var(--gcdc-sd-bg-soft);
}

.gcdc-sd-table tbody tr:hover {
	background: var(--gcdc-sd-green-tint);
}

.gcdc-sd-table tbody tr:last-child td {
	border-bottom: none;
}

.gcdc-sd-table td.gcdc-sd-comments {
	max-width: 260px;
	white-space: pre-wrap;
	color: var(--gcdc-sd-muted);
}

.gcdc-sd-pagination {
	display: flex;
	gap: 8px;
	align-items: center;
	justify-content: flex-end;
	margin-top: 16px;
	font-size: 13.5px;
	flex-wrap: wrap;
}

.gcdc-sd-pagination button {
	padding: 8px 14px;
	border-radius: 8px;
	border: 1.5px solid var(--gcdc-sd-border);
	background: var(--gcdc-sd-bg);
	cursor: pointer;
	font-weight: 600;
	transition: border-color 0.12s ease, background 0.12s ease;
}

.gcdc-sd-pagination button:not(:disabled):hover {
	border-color: var(--gcdc-sd-green);
	background: var(--gcdc-sd-green-tint);
}

.gcdc-sd-pagination button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.gcdc-sd-pagination__info {
	color: var(--gcdc-sd-muted);
	margin-right: 6px;
}

/* Empty / loading / error states rendered by dashboard.js */
.gcdc-sd-empty-state {
	color: var(--gcdc-sd-muted);
	font-size: 13.5px;
	padding: 6px 2px;
	margin: 0;
}

.gcdc-sd-table td.gcdc-sd-state {
	text-align: center;
	color: var(--gcdc-sd-muted);
	font-style: italic;
	padding: 26px 14px;
}

/* Focus-visible states for keyboard navigation */
.gcdc-sd-btn:focus-visible,
.gcdc-sd-pagination button:focus-visible,
.gcdc-sd-table thead th.gcdc-sd-sortable:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px var(--gcdc-sd-green-tint), 0 0 0 1.5px var(--gcdc-sd-green);
}

.gcdc-sd-filter input:focus-visible,
.gcdc-sd-filter select:focus-visible {
	outline: none;
	border-color: var(--gcdc-sd-green);
	box-shadow: 0 0 0 3px var(--gcdc-sd-green-tint);
}

.gcdc-sd-table tbody tr {
	transition: background 0.12s ease;
}

@media (max-width: 640px) {
	.gcdc-sd-filter--actions {
		margin-left: 0;
		width: 100%;
	}

	.gcdc-sd-filter--actions .gcdc-sd-btn {
		flex: 1;
	}
}
