:root {
	--bg: #f7f4ee;
	--surface: #fffdfa;
	--ink: #19222d;
	--muted: #5d6a79;
	--line: #e4dccf;
	--accent: #0f766e;
	--accent-2: #d97706;
	--accent-3: #334155;
	--shadow: 0 18px 48px rgba(19, 28, 39, 0.08);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: 'IBM Plex Sans', sans-serif;
	color: var(--ink);
	background:
		radial-gradient(1200px 600px at 20% -20%, #f2d3aa 0%, transparent 60%),
		radial-gradient(900px 500px at 85% -10%, #b6e3de 0%, transparent 65%), var(--bg);
	min-height: 100vh;
}

.bg-shape {
	position: fixed;
	pointer-events: none;
	z-index: -1;
	border-radius: 999px;
	filter: blur(80px);
	opacity: 0.35;
}

.bg-shape-a {
	width: 260px;
	height: 260px;
	background: #f59e0b;
	top: 10vh;
	right: -60px;
}

.bg-shape-b {
	width: 320px;
	height: 320px;
	background: #14b8a6;
	bottom: -80px;
	left: -70px;
}

.page-header {
	max-width: 1200px;
	margin: 0 auto;
	padding: 32px 20px 20px;
	display: flex;
	gap: 20px;
	justify-content: space-between;
	align-items: flex-start;
	animation: riseIn 500ms ease;
}

.eyebrow {
	margin: 0;
	color: var(--accent);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-size: 12px;
}

h1 {
	margin: 6px 0;
	font-family: 'Space Grotesk', sans-serif;
	font-size: clamp(1.7rem, 3.2vw, 2.6rem);
}

.subtitle {
	margin: 0;
	color: var(--muted);
}

.controls {
	min-width: 260px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 14px;
	box-shadow: var(--shadow);
}

.controls label {
	display: block;
	font-size: 12px;
	color: var(--muted);
	margin-bottom: 6px;
}

.controls select,
.controls input[type='range'] {
	width: 100%;
	margin-bottom: 12px;
}

main {
	max-width: 1200px;
	margin: 0 auto;
	padding: 12px 20px 36px;
	display: grid;
	gap: 16px;
}

.kpi-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 14px;
}

.kpi {
	border: 1px solid var(--line);
	border-radius: 14px;
	background: var(--surface);
	box-shadow: var(--shadow);
	padding: 14px;
	animation: riseIn 450ms ease;
}

.kpi .label {
	color: var(--muted);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.kpi .value {
	margin-top: 8px;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 1.7rem;
}

.chart-grid {
	display: grid;
	gap: 14px;
}

.two-col {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
	border: 1px solid var(--line);
	border-radius: 16px;
	background: var(--surface);
	box-shadow: var(--shadow);
	padding: 14px;
	animation: riseIn 550ms ease;
}

.card h2 {
	margin: 0 0 12px;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 1.15rem;
}

.card canvas {
	width: 100%;
	max-height: 340px;
}

.muted {
	color: var(--muted);
	margin: 0 0 10px;
}

.table-wrap {
	width: 100%;
	overflow-x: auto;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92rem;
}

th,
td {
	padding: 9px 8px;
	border-bottom: 1px solid var(--line);
	white-space: nowrap;
}

th {
	text-align: left;
	color: var(--muted);
	font-size: 12px;
	text-transform: uppercase;
}

.insight-card ul {
	margin: 0;
	padding-left: 18px;
	color: var(--ink);
}

.explain-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.explain-grid article {
	border: 1px dashed var(--line);
	border-radius: 12px;
	padding: 10px;
	background: #fffefc;
}

.explain-grid h3 {
	margin: 0 0 6px;
	font-size: 0.98rem;
	font-family: 'Space Grotesk', sans-serif;
}

.explain-grid p {
	margin: 0;
	color: var(--muted);
	font-size: 0.93rem;
}

.drilldown-entry {
	display: grid;
	grid-template-columns: 1fr;
	gap: 8px;
	max-width: 420px;
}

.drilldown-entry input {
	padding: 10px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: #fff;
}

.drilldown-entry button {
	padding: 10px 12px;
	border: none;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--accent), #14b8a6);
	color: white;
	font-weight: 700;
	cursor: pointer;
}

.drilldown-entry button:hover {
	filter: brightness(1.05);
}

.table-wrap a {
	color: var(--accent);
	text-decoration: none;
	font-weight: 700;
}

.table-wrap a:hover {
	text-decoration: underline;
}

@keyframes riseIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 900px) {
	.page-header {
		flex-direction: column;
	}

	.controls {
		width: 100%;
	}

	.two-col {
		grid-template-columns: 1fr;
	}

	.explain-grid {
		grid-template-columns: 1fr;
	}

	.card canvas {
		max-height: 300px;
	}
}
