:root {
	color-scheme: light;
	font-family:
		Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
		"Segoe UI", sans-serif;
	background: #f6f4ef;
	color: #1f2723;
	--ink: #1f2723;
	--muted: #66706b;
	--line: #d8d5cb;
	--panel: #ffffff;
	--panel-soft: #faf9f4;
	--green: #28493c;
	--green-2: #3e6d5b;
	--copper: #a45f3c;
	--steel: #526675;
	--amber: #c79a39;
	--shadow: 0 18px 50px rgba(31, 39, 35, 0.09);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-width: 320px;
	background:
		linear-gradient(180deg, rgba(40, 73, 60, 0.08), rgba(40, 73, 60, 0) 360px),
		#f6f4ef;
}

body.crm-body {
	overflow: hidden;
	background: var(--panel-soft);
}

a {
	color: inherit;
	text-decoration: none;
}

button,
input {
	font: inherit;
}

.app-shell {
	width: min(1440px, 100%);
	margin: 0 auto;
	padding: 20px;
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	min-height: 64px;
	padding: 10px 0 24px;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-width: 220px;
}

.brand-mark {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 8px;
	background: var(--green);
	box-shadow: 0 8px 22px rgba(40, 73, 60, 0.22);
}

.brand-mark img {
	width: 29px;
	height: 29px;
}

.brand-name,
.brand-subtitle {
	display: block;
}

.brand-name {
	font-size: 16px;
	font-weight: 720;
	letter-spacing: 0;
}

.brand-subtitle {
	margin-top: 2px;
	color: var(--muted);
	font-size: 12px;
}

.nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 6px;
}

.nav-links a,
.segmented button,
.agent-links a,
.item-link {
	min-height: 34px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.66);
	color: var(--ink);
	padding: 7px 11px;
	font-size: 13px;
	font-weight: 650;
}

.nav-links a:hover,
.segmented button:hover,
.agent-links a:hover,
.item-link:hover {
	border-color: rgba(40, 73, 60, 0.42);
	background: #fff;
}

.crm-shell {
	display: grid;
	grid-template-rows: 58px minmax(0, 1fr);
	height: 100vh;
	background: var(--panel-soft);
}

.crm-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 0 18px;
	border-bottom: 1px solid var(--line);
	background: rgba(250, 249, 244, 0.96);
}

.crm-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

.crm-actions a {
	min-height: 34px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.78);
	color: var(--ink);
	padding: 7px 11px;
	font-size: 13px;
	font-weight: 650;
}

.crm-actions a:hover {
	border-color: rgba(40, 73, 60, 0.42);
	background: #fff;
}

.crm-frame {
	width: 100%;
	height: 100%;
	border: 0;
	background: #f1f1f1;
}

.command-band {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
	gap: 24px;
	align-items: end;
	padding: 28px;
	border: 1px solid rgba(40, 73, 60, 0.14);
	border-radius: 8px;
	background: linear-gradient(135deg, #ffffff 0%, #f9f4ec 58%, #eef4f0 100%);
	box-shadow: var(--shadow);
}

.eyebrow {
	margin: 0 0 7px;
	color: var(--copper);
	font-size: 11px;
	font-weight: 760;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

h1,
h2 {
	margin: 0;
	letter-spacing: 0;
}

h1 {
	max-width: 780px;
	font-size: clamp(30px, 4vw, 52px);
	line-height: 1.02;
}

h2 {
	font-size: 17px;
	line-height: 1.25;
}

.search-wrap {
	display: grid;
	gap: 8px;
}

.search-wrap label {
	color: var(--muted);
	font-size: 12px;
	font-weight: 700;
}

.search-wrap input {
	width: 100%;
	min-height: 46px;
	border: 1px solid rgba(40, 73, 60, 0.24);
	border-radius: 8px;
	background: #fff;
	color: var(--ink);
	padding: 0 14px;
	outline: none;
}

.search-wrap input:focus {
	border-color: var(--green-2);
	box-shadow: 0 0 0 3px rgba(62, 109, 91, 0.14);
}

.metrics-grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 10px;
	margin-top: 12px;
}

.metric,
.panel,
.module-card {
	border: 1px solid var(--line);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.86);
}

.metric {
	min-height: 76px;
	padding: 14px;
}

.metric span {
	display: block;
	color: var(--green);
	font-size: 26px;
	font-weight: 760;
	line-height: 1;
}

.metric small {
	display: block;
	margin-top: 8px;
	color: var(--muted);
	font-size: 12px;
}

.module-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin-top: 12px;
}

.module-card {
	display: grid;
	align-content: start;
	gap: 8px;
	min-height: 146px;
	padding: 16px;
	transition:
		transform 140ms ease,
		border-color 140ms ease,
		box-shadow 140ms ease;
}

.module-card:hover {
	transform: translateY(-1px);
	border-color: rgba(40, 73, 60, 0.34);
	box-shadow: 0 12px 28px rgba(31, 39, 35, 0.08);
}

.module-card.primary {
	background: #243f35;
	color: #fff;
	border-color: #243f35;
}

.module-kicker {
	width: fit-content;
	border-radius: 999px;
	background: rgba(164, 95, 60, 0.11);
	color: var(--copper);
	padding: 4px 8px;
	font-size: 11px;
	font-weight: 760;
	text-transform: uppercase;
}

.primary .module-kicker {
	background: rgba(255, 255, 255, 0.14);
	color: #f5d9c9;
}

.module-card strong {
	font-size: 17px;
}

.module-card span:last-child {
	color: var(--muted);
	font-size: 13px;
	line-height: 1.42;
}

.primary span:last-child {
	color: rgba(255, 255, 255, 0.76);
}

.content-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
	gap: 12px;
	margin-top: 12px;
	align-items: start;
}

.panel {
	padding: 16px;
	box-shadow: 0 8px 24px rgba(31, 39, 35, 0.05);
}

.panel.large {
	min-height: 620px;
}

.panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--line);
}

.panel-header.compact {
	padding-bottom: 10px;
}

.segmented {
	display: inline-flex;
	gap: 4px;
	padding: 3px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--panel-soft);
}

.segmented button {
	border-color: transparent;
	background: transparent;
	cursor: pointer;
}

.segmented button.active {
	background: var(--green);
	color: #fff;
}

.result-list,
.compact-list {
	display: grid;
	gap: 9px;
	margin-top: 12px;
}

.result-item,
.compact-item {
	display: grid;
	gap: 8px;
	border: 1px solid #e3e0d6;
	border-radius: 8px;
	background: #fff;
	padding: 13px;
}

.result-item header,
.compact-item header {
	display: flex;
	align-items: start;
	justify-content: space-between;
	gap: 12px;
}

.result-title,
.compact-title {
	font-weight: 720;
	line-height: 1.25;
}

.result-summary,
.compact-summary,
.meta-row {
	color: var(--muted);
	font-size: 13px;
	line-height: 1.42;
}

.meta-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.pill {
	display: inline-flex;
	align-items: center;
	min-height: 22px;
	border-radius: 999px;
	background: #f0eee7;
	color: #4e5853;
	padding: 3px 7px;
	font-size: 11px;
	font-weight: 720;
	text-transform: uppercase;
}

.pill.needs-review {
	background: #fff2d7;
	color: #7b5512;
}

.pill.planned {
	background: #e9eef1;
	color: #415767;
}

.item-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.side-stack {
	display: grid;
	gap: 12px;
}

.agent-links {
	display: grid;
	grid-template-columns: 1fr;
	gap: 7px;
	margin-top: 12px;
}

.empty {
	padding: 22px;
	border: 1px dashed var(--line);
	border-radius: 8px;
	color: var(--muted);
	text-align: center;
}

@media (max-width: 980px) {
	.command-band,
	.content-layout {
		grid-template-columns: 1fr;
	}

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

	.panel-header {
		align-items: stretch;
		flex-direction: column;
	}
}

@media (max-width: 640px) {
	.app-shell {
		padding: 12px;
	}

	.crm-shell {
		grid-template-rows: 96px minmax(0, 1fr);
	}

	.crm-topbar {
		align-items: flex-start;
		flex-direction: column;
		padding: 10px 12px;
	}

	.crm-actions {
		width: 100%;
		justify-content: flex-start;
	}

	.topbar {
		align-items: flex-start;
		flex-direction: column;
	}

	.nav-links {
		justify-content: flex-start;
	}

	.command-band {
		padding: 18px;
	}

	.metrics-grid,
	.module-grid {
		grid-template-columns: 1fr;
	}

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