.crm-shell {
	padding-top: 12px;
	padding-bottom: 12px;
}

.crm-page-title-wrap {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.crm-header-eyebrow {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #87631a;
}

.crm-page-subtitle {
	color: #6c757d;
	font-size: 12px;
}

.crm-customer-actions {
	gap: 12px;
	flex-wrap: wrap;
}

.crm-customer-meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 12px;
}

.crm-shell--customer {
	padding-top: 16px;
	padding-bottom: 16px;
}

.crm-sticky-summary {
	position: sticky;
	top: 0;
	z-index: 8;
	display: grid;
	grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.8fr) auto;
	gap: 12px;
	align-items: center;
	padding: 10px 14px;
	border-bottom: 1px solid #d8e0e8;
	background:
		linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(248, 250, 252, 0.98));
	backdrop-filter: blur(8px);
}

.crm-sticky-summary__primary,
.crm-sticky-summary__metrics {
	min-width: 0;
}

.crm-sticky-summary__title {
	font-size: 15px;
	font-weight: 600;
	color: #2d3640;
}

.crm-sticky-summary__subtitle {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 4px;
}

.crm-inline-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 9px;
	border-radius: 999px;
	background: #eef3f7;
	color: #415466;
	font-size: 11px;
}

.crm-sticky-summary__metrics {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 10px;
}

.crm-sticky-metric {
	min-width: 0;
}

.crm-sticky-metric__label {
	font-size: 11px;
	color: #6c757d;
	margin-bottom: 4px;
}

.crm-sticky-metric__value {
	font-size: 12px;
	color: #2d3640;
	font-weight: 600;
}

.crm-sticky-summary__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
}

.crm-panel-grid {
	display: grid;
	gap: 16px;
}

.crm-panel-grid--three {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	align-items: start;
}

.crm-link-stack {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.crm-definition-list {
	display: grid;
	gap: 12px;
}

.crm-definition-list > div {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.crm-definition-list strong {
	font-size: 12px;
	color: #6c757d;
	font-weight: 600;
}

.crm-definition-list span {
	font-size: 14px;
	color: #333;
}

.crm-panel,
.crm-stack,
.crm-summary-card {
	width: 100%;
}

.crm-stack {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.crm-section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 10px;
}

.crm-section-header h3,
.crm-section-title {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: #4d4d4d;
}

.crm-chip-card {
	height: 100%;
}

.crm-chip-meta,
.crm-subtle-meta {
	color: #6c757d;
	font-size: 12px;
}

.crm-summary-card--warning {
	background: #fffaf1;
}

.crm-summary-card--danger {
	background: #fff4f2;
}

.crm-summary-card--success {
	background: #f2faf4;
}

.crm-summary-card--muted {
	background: #f4f6f8;
}

.crm-overview-card {
	height: 100%;
}

.crm-filter-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	gap: 10px;
	margin-bottom: 14px;
	padding: 12px;
	border: 1px solid #dee2e6;
	background: #f8f9fa;
	border-radius: 0.375rem;
}

.crm-filter-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 160px;
	flex: 1 1 160px;
}

.crm-filter-field--wide {
	flex: 2 1 320px;
}

.crm-filter-field label,
.crm-filter-checks label {
	font-size: 12px;
	font-weight: 400;
	color: #4d4d4d;
}

.crm-filter-checks {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	padding-bottom: 8px;
}

.crm-filter-checks--inline {
	align-self: center;
	padding-bottom: 0;
}

.crm-toggle-check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border: 1px solid #d8e0e8;
	border-radius: 0.375rem;
	background: #fff;
}

.crm-manual-note {
	margin: 0 0 12px;
	padding: 8px 10px;
	border-left: 3px solid #d9a441;
	background: #faf6e8;
	color: #5d4920;
	border-radius: 0.375rem;
	font-size: 12px;
}

.crm-filter-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-left: auto;
}

.crm-inline-shortcuts {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.crm-shortcut-btn {
	border: 1px solid #d1d9e0;
	background: #fff;
	color: #415466;
	border-radius: 999px;
	padding: 4px 10px;
	font-size: 11px;
	line-height: 1.2;
}

.crm-shortcut-btn:hover,
.crm-shortcut-btn:focus {
	background: #f3f7fa;
	color: #24496e;
}

.crm-sort-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: inherit;
	text-decoration: none;
	white-space: nowrap;
}

.crm-sort-link:hover,
.crm-sort-link:focus {
	color: #87631a;
	text-decoration: none;
}

.crm-sort-link.is-active {
	color: #87631a;
	font-weight: 600;
}

.crm-sort-icon {
	font-size: 11px;
	color: #8a94a6;
}

.crm-sort-link.is-active .crm-sort-icon,
.crm-sort-link:hover .crm-sort-icon,
.crm-sort-link:focus .crm-sort-icon {
	color: currentColor;
}

.crm-shell .nav-buttons,
.crm-shell .nav-buttons:hover,
.crm-shell .nav-buttons:focus,
.crm-shell .nav-buttons:active {
	text-decoration: none;
	text-underline-offset: 0;
}

.crm-empty-state {
	padding: 14px;
	text-align: center;
	color: #6c757d;
	border: 1px dashed #cbd5df;
	border-radius: 0.375rem;
	background: #fbfcfd;
	font-size: 12px;
}

.crm-state-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.35;
	white-space: nowrap;
	border: 1px solid transparent;
}

.crm-tone--danger {
	color: #a1372b;
	background: #fff0ee;
	border-color: #f1c4bd;
}

.crm-tone--warning {
	color: #8a5a13;
	background: #fff7e5;
	border-color: #f0d49d;
}

.crm-tone--success {
	color: #256140;
	background: #edf8f0;
	border-color: #bfe1c7;
}

.crm-tone--muted {
	color: #5f6b78;
	background: #f2f5f7;
	border-color: #d6dde3;
}

.crm-tone--info {
	color: #2d5775;
	background: #eef5fb;
	border-color: #c9dbea;
}

.crm-table-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
}

.crm-timeline-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.crm-timeline-item {
	display: flex;
	gap: 12px;
	border: 1px solid #dee2e6;
	border-left: 4px solid #355d83;
	border-radius: 0.375rem;
	padding: 12px 14px;
	background: #fff;
}

.crm-timeline-group {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.crm-timeline-group__label {
	position: sticky;
	top: 52px;
	z-index: 1;
	align-self: flex-start;
	padding: 4px 10px;
	border-radius: 999px;
	background: #f3f7fa;
	color: #50606f;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.crm-timeline-group__items {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.crm-timeline-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 999px;
	flex-shrink: 0;
	font-size: 16px;
}

.crm-timeline-content {
	min-width: 0;
	flex: 1 1 auto;
}

.crm-timeline-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.crm-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	line-height: 1.35;
}

.crm-badge--source {
	background: #e6eef6;
	color: #24496e;
}

.crm-badge--activity {
	background: #edf4ea;
	color: #2f5d36;
}

.crm-badge--activity.crm-tone--danger {
	background: #fff0ee;
	color: #a1372b;
}

.crm-badge--activity.crm-tone--warning {
	background: #fff7e5;
	color: #8a5a13;
}

.crm-badge--activity.crm-tone--success {
	background: #edf8f0;
	color: #256140;
}

.crm-badge--activity.crm-tone--muted {
	background: #f2f5f7;
	color: #5f6b78;
}

.crm-badge--activity.crm-tone--info {
	background: #eef5fb;
	color: #2d5775;
}

.crm-timeline-date {
	margin-left: auto;
	font-size: 12px;
	color: #6c757d;
}

.crm-timeline-title {
	font-size: 14px;
	font-weight: 600;
	color: #333;
	margin: 0 0 6px;
}

.crm-timeline-text {
	color: #4d4d4d;
	font-size: 12px;
	margin-bottom: 6px;
}

.crm-timeline-item.crm-tone--danger {
	border-left-color: #c43d2c;
}

.crm-timeline-item.crm-tone--warning {
	border-left-color: #d4a13f;
}

.crm-timeline-item.crm-tone--success {
	border-left-color: #2f7c4f;
}

.crm-timeline-item.crm-tone--muted {
	border-left-color: #8c99a5;
}

.crm-timeline-item.crm-tone--info {
	border-left-color: #355d83;
}

.crm-followup-row.crm-tone--danger td {
	background: #fff7f5;
}

.crm-followup-row.crm-tone--warning td {
	background: #fffbf1;
}

.crm-summary-link {
	display: block;
	color: inherit;
	text-decoration: none;
	height: 100%;
}

.crm-summary-link:hover,
.crm-summary-link:focus {
	color: inherit;
	text-decoration: none;
	box-shadow: inset 0 0 0 1px rgba(36, 73, 110, 0.18);
}

.crm-panel--urgent {
	border: 1px solid #f0d0ca;
}

.crm-dashboard-split {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.crm-dashboard-split__title {
	font-size: 12px;
	font-weight: 600;
	color: #50606f;
	margin-bottom: 8px;
}

.crm-mini-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.crm-mini-list__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 12px;
	border: 1px solid #d8e0e8;
	border-radius: 0.375rem;
	background: #fff;
	color: inherit;
	text-decoration: none;
}

.crm-mini-list__item:hover,
.crm-mini-list__item:focus {
	color: inherit;
	background: #f8fafc;
	text-decoration: none;
}

.crm-pagination {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid #dee2e6;
}

.tabbed-page-body .crm-panel .main-card-header {
	font-size: 14px;
	font-weight: 400;
	background: #f6f4ef;
}

.tabbed-page-body .crm-panel .main-card-header .small {
	font-size: 12px;
	font-weight: 400;
}

@media (max-width: 991.98px) {
	.crm-shell {
		padding-left: 10px;
		padding-right: 10px;
	}

	.crm-panel-grid--three {
		grid-template-columns: 1fr;
	}

	.crm-sticky-summary {
		grid-template-columns: 1fr;
		align-items: stretch;
	}

	.crm-sticky-summary__metrics {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.crm-sticky-summary__actions {
		justify-content: flex-start;
	}

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

	.crm-timeline-date {
		margin-left: 0;
	}

	.crm-customer-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.crm-customer-meta {
		justify-content: flex-start;
	}

	.crm-dashboard-split {
		grid-template-columns: 1fr;
	}

	.crm-mini-list__item {
		align-items: flex-start;
		flex-direction: column;
	}
}

@media (max-width: 767.98px) {
	.crm-sticky-summary {
		padding: 10px;
	}

	.crm-sticky-summary__metrics {
		grid-template-columns: 1fr;
	}

	.crm-timeline-item {
		flex-direction: column;
	}

	.crm-timeline-icon {
		width: 32px;
		height: 32px;
	}

	.crm-timeline-group__label {
		top: 8px;
	}

	.crm-sticky-summary__actions .nav-buttons,
	.crm-customer-actions .nav-buttons,
	.crm-link-stack .nav-buttons {
		min-height: 42px;
	}
}
