* {
	box-sizing: border-box;
}

body.cfm-login-page,
body.cfm-app-page {
	background: #f4f6f8;
	color: #1d2327;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	line-height: 1.5;
	margin: 0;
	min-height: 100vh;
}

a {
	color: #135e96;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 3px solid #72aee6;
	outline-offset: 2px;
}

.screen-reader-text,
.cfm-skip-link {
	clip: rect(1px, 1px, 1px, 1px);
	height: 1px;
	overflow: hidden;
	position: absolute;
	width: 1px;
}

.cfm-skip-link:focus {
	background: #fff;
	clip: auto;
	height: auto;
	left: 16px;
	padding: 10px 14px;
	top: 16px;
	width: auto;
	z-index: 20;
}

.cfm-login-shell {
	align-items: center;
	display: flex;
	justify-content: center;
	min-height: 100vh;
	padding: 24px;
}

.cfm-login-panel {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	box-shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
	max-width: 440px;
	padding: 32px;
	width: 100%;
}

.cfm-brand {
	align-items: center;
	display: flex;
	gap: 12px;
	margin-bottom: 24px;
}

.cfm-brand-compact {
	margin-bottom: 0;
}

.cfm-brand img {
	height: 44px;
	object-fit: contain;
	width: 44px;
}

.cfm-brand-mark,
.cfm-nav-marker,
.cfm-area-marker {
	align-items: center;
	background: #135e96;
	border-radius: 6px;
	color: #fff;
	display: inline-flex;
	font-size: 12px;
	font-weight: 700;
	height: 32px;
	justify-content: center;
	min-width: 32px;
	padding: 0 5px;
}

.cfm-brand-name {
	font-size: 18px;
	font-weight: 700;
}

.cfm-login-panel h1 {
	font-size: 26px;
	margin: 0 0 24px;
}

.cfm-login-form {
	display: grid;
	gap: 12px;
}

.cfm-login-form input[type="text"],
.cfm-login-form input[type="password"] {
	border: 1px solid #8c8f94;
	border-radius: 6px;
	font-size: 16px;
	padding: 11px 12px;
	width: 100%;
}

.cfm-login-options {
	align-items: center;
	display: flex;
	justify-content: space-between;
	margin: 6px 0;
}

.cfm-checkbox {
	align-items: center;
	display: inline-flex;
	gap: 8px;
}

.cfm-primary-action {
	background: #135e96;
	border: 0;
	border-radius: 6px;
	color: #fff;
	cursor: pointer;
	font-size: 15px;
	font-weight: 700;
	padding: 12px 16px;
	text-align: center;
	text-decoration: none;
}

.cfm-primary-action:hover {
	background: #0a4b78;
	color: #fff;
}

.cfm-link-button {
	display: inline-block;
}

.cfm-login-errors,
.cfm-error-state {
	background: #fcf0f1;
	border-left: 4px solid #d63638;
	margin: 0 0 20px;
	padding: 12px 14px;
}

.cfm-login-errors p,
.cfm-error-state p {
	margin: 0;
}

.cfm-app-shell {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	min-height: 100vh;
}

.cfm-sidebar {
	background: #101517;
	color: #fff;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	padding: 20px 14px;
}

.cfm-sidebar-brand {
	align-items: center;
	display: flex;
	gap: 8px;
}

.cfm-sidebar-brand .cfm-brand {
	flex: 1;
	min-width: 0;
}

.cfm-sidebar-close,
.cfm-sidebar-overlay {
	display: none;
}

.cfm-sidebar .cfm-brand-name {
	color: #fff;
}

.cfm-sidebar .cfm-brand-mark {
	background: #72aee6;
	color: #101517;
}

.cfm-nav {
	display: grid;
	gap: 4px;
	margin-top: 18px;
}

.cfm-nav-link {
	align-items: center;
	border-radius: 6px;
	color: #dcdcde;
	display: flex;
	gap: 10px;
	min-height: 42px;
	padding: 8px 10px;
	text-decoration: none;
}

.cfm-nav-link:hover,
.cfm-nav-link.is-active {
	background: #1e2930;
	color: #fff;
}

.cfm-nav-link.is-active .cfm-nav-marker {
	background: #72aee6;
	color: #101517;
}

.cfm-app-main {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.cfm-topbar {
	align-items: center;
	background: #fff;
	border-bottom: 1px solid #dcdcde;
	display: flex;
	gap: 16px;
	justify-content: space-between;
	min-height: 64px;
	padding: 0 24px;
}

.cfm-breadcrumbs {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	min-width: 0;
}

.cfm-user-summary {
	align-items: center;
	display: flex;
	gap: 12px;
	white-space: nowrap;
}

.cfm-user-role {
	background: #eef6fc;
	border: 1px solid #72aee6;
	border-radius: 999px;
	color: #0a4b78;
	font-size: 12px;
	font-weight: 700;
	padding: 3px 8px;
}

.cfm-menu-toggle {
	background: #fff;
	border: 1px solid #8c8f94;
	border-radius: 6px;
	display: none;
	height: 40px;
	position: relative;
	width: 42px;
}

.cfm-menu-toggle-lines,
.cfm-menu-toggle-lines::before,
.cfm-menu-toggle-lines::after {
	background: #1d2327;
	content: "";
	display: block;
	height: 2px;
	left: 10px;
	position: absolute;
	width: 20px;
}

.cfm-menu-toggle-lines {
	top: 19px;
}

.cfm-menu-toggle-lines::before {
	left: 0;
	top: -7px;
}

.cfm-menu-toggle-lines::after {
	left: 0;
	top: 7px;
}

.cfm-loading-bar {
	background: #72aee6;
	height: 3px;
	opacity: 0;
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.cfm-loading-bar.is-loading {
	opacity: 1;
	transform: scaleX(1);
}

.cfm-content {
	padding: 24px;
}

.cfm-page-header,
.cfm-action-panel,
.cfm-empty-state {
	margin: 0 auto 20px;
	max-width: 1180px;
}

.cfm-page-header p {
	margin: 0;
}

.cfm-page-header h1 {
	font-size: 28px;
	margin: 0 0 6px;
}

.cfm-dashboard-grid {
	display: grid;
	gap: 14px;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	margin: 0 auto;
	max-width: 1180px;
}

.cfm-dashboard-alerts,
.cfm-metric-grid,
.cfm-dashboard-layout,
.cfm-accountant-actions {
	margin: 0 auto 20px;
	max-width: 1180px;
}

.cfm-accountant-actions {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

.cfm-accountant-action {
	align-items: center;
	background: #fff;
	border: 1px solid #8c8f94;
	border-radius: 8px;
	color: #1d2327;
	display: flex;
	gap: 10px;
	min-height: 76px;
	padding: 14px;
	text-decoration: none;
}

.cfm-accountant-action:hover {
	border-color: #135e96;
	box-shadow: 0 5px 12px rgba(0, 0, 0, 0.08);
	color: #0a4b78;
}

.cfm-accountant-action strong {
	font-size: 15px;
	overflow-wrap: anywhere;
}

.cfm-dashboard-alerts,
.cfm-dashboard-panel,
.cfm-metric-card {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 8px;
}

.cfm-dashboard-alerts {
	padding: 18px;
}

.cfm-dashboard-alerts h2,
.cfm-dashboard-panel h2,
.cfm-metric-card h2 {
	font-size: 15px;
	margin: 0;
}

.cfm-alert-list,
.cfm-dashboard-list,
.cfm-bar-list {
	display: grid;
	gap: 10px;
	list-style: none;
	margin: 14px 0 0;
	padding: 0;
}

.cfm-alert {
	align-items: center;
	border-left: 4px solid #dba617;
	display: grid;
	gap: 4px;
	grid-template-columns: minmax(0, 1fr) auto;
	padding: 10px 12px;
}

.cfm-alert strong,
.cfm-alert span {
	grid-column: 1;
}

.cfm-alert a {
	grid-column: 2;
	grid-row: 1 / span 2;
}

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

.cfm-metric-card {
	border-top: 4px solid #72aee6;
	display: grid;
	gap: 8px;
	min-height: 118px;
	padding: 16px;
}

.cfm-metric-card strong {
	font-size: 24px;
	line-height: 1.2;
	overflow-wrap: anywhere;
}

.cfm-metric-card span,
.cfm-muted,
.cfm-dashboard-list span,
.cfm-status-panel p,
.cfm-status-panel span {
	color: #646970;
	font-size: 13px;
}

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

.cfm-dashboard-panel {
	min-height: 220px;
	padding: 16px;
}

.cfm-accountant-transactions {
	grid-column: 1 / -1;
}

.cfm-dashboard-search {
	align-items: center;
	display: flex;
	gap: 10px;
	margin-top: 14px;
}

.cfm-dashboard-search input[type="search"] {
	border: 1px solid #8c8f94;
	border-radius: 6px;
	font-size: 16px;
	min-height: 44px;
	padding: 9px 11px;
	width: min(100%, 560px);
}

.cfm-dashboard-search .cfm-primary-action {
	min-height: 44px;
}

.cfm-dashboard-list li {
	align-items: start;
	border-top: 1px solid #f0f0f1;
	display: flex;
	gap: 12px;
	justify-content: space-between;
	padding-top: 10px;
}

.cfm-dashboard-list li:first-child {
	border-top: 0;
	padding-top: 0;
}

.cfm-dashboard-list div {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.cfm-list-meta {
	display: grid;
	gap: 4px;
	justify-items: end;
	text-align: right;
	white-space: nowrap;
}

.cfm-list-meta em {
	background: #f6f7f7;
	border-radius: 999px;
	color: #1d2327;
	font-size: 11px;
	font-style: normal;
	font-weight: 700;
	padding: 2px 7px;
}

.cfm-bar-list li {
	display: grid;
	gap: 6px;
}

.cfm-bar-row-text {
	align-items: baseline;
	display: flex;
	gap: 10px;
	justify-content: space-between;
}

.cfm-bar-row-text span,
.cfm-bar-row-text a {
	min-width: 0;
	overflow-wrap: anywhere;
}

.cfm-bar-track {
	background: #f0f0f1;
	border-radius: 999px;
	height: 9px;
	overflow: hidden;
}

.cfm-bar-track span {
	background: #135e96;
	display: block;
	height: 100%;
	min-width: 2px;
}

.cfm-status-panel {
	display: grid;
	gap: 8px;
	min-height: 150px;
}

.cfm-status-panel strong {
	font-size: 20px;
}

.cfm-severity-success {
	border-top-color: #00a32a;
}

.cfm-severity-warning {
	border-top-color: #dba617;
}

.cfm-severity-critical,
.cfm-severity-error {
	border-top-color: #d63638;
}

.cfm-alert.cfm-severity-critical,
.cfm-alert.cfm-severity-error {
	border-left-color: #d63638;
}

.cfm-alert.cfm-severity-success {
	border-left-color: #00a32a;
}

.cfm-area-card,
.cfm-action-panel,
.cfm-empty-state {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 8px;
}

.cfm-area-card {
	align-items: center;
	color: #1d2327;
	display: flex;
	gap: 12px;
	min-height: 80px;
	padding: 18px;
	text-decoration: none;
}

.cfm-area-card:hover {
	border-color: #72aee6;
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.cfm-area-label {
	font-size: 16px;
	font-weight: 700;
}

.cfm-action-panel,
.cfm-empty-state {
	padding: 20px;
}

.cfm-settings-summary {
	display: grid;
	gap: 6px;
	grid-template-columns: max-content 1fr;
	margin: 0;
}

.cfm-settings-summary dt {
	font-weight: 700;
}

@media (max-width: 860px) {
	.cfm-app-shell {
		grid-template-columns: 1fr;
	}

	.cfm-sidebar {
		bottom: 0;
		left: 0;
		max-width: 300px;
		position: fixed;
		top: 0;
		transform: translateX(-100%);
		transition: transform 0.2s ease;
		width: 82vw;
		z-index: 30;
	}

	body.cfm-sidebar-open {
		overflow: hidden;
	}

	body.cfm-sidebar-open .cfm-sidebar {
		transform: translateX(0);
	}

	.cfm-sidebar-close {
		align-items: center;
		background: transparent;
		border: 1px solid #646970;
		border-radius: 6px;
		color: #fff;
		display: inline-flex;
		font-size: 24px;
		height: 40px;
		justify-content: center;
		padding: 0;
		width: 40px;
	}

	.cfm-sidebar-overlay {
		background: rgba(0, 0, 0, 0.48);
		border: 0;
		bottom: 0;
		display: block;
		left: 0;
		opacity: 0;
		pointer-events: none;
		position: fixed;
		right: 0;
		top: 0;
		transition: opacity 0.2s ease;
		z-index: 20;
	}

	body.cfm-sidebar-open .cfm-sidebar-overlay {
		opacity: 1;
		pointer-events: auto;
	}

	.cfm-menu-toggle {
		display: inline-flex;
	}

	.cfm-topbar {
		align-items: flex-start;
		flex-direction: column;
		justify-content: center;
		padding: 12px 16px;
	}

	.cfm-user-summary {
		flex-wrap: wrap;
		white-space: normal;
	}

	.cfm-content {
		padding: 16px;
	}

	.cfm-dashboard-layout {
		grid-template-columns: 1fr;
	}

	.cfm-accountant-actions {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cfm-accountant-transactions {
		grid-column: auto;
	}

	.cfm-dashboard-list li,
	.cfm-bar-row-text,
	.cfm-alert {
		align-items: start;
		grid-template-columns: 1fr;
	}

	.cfm-alert a {
		grid-column: 1;
		grid-row: auto;
	}

	.cfm-list-meta {
		justify-items: start;
		text-align: left;
		white-space: normal;
	}

	.cfm-login-options {
		align-items: flex-start;
		flex-direction: column;
		gap: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cfm-sidebar,
	.cfm-sidebar-overlay,
	.cfm-loading-bar {
		transition: none;
	}
}

@media (max-width: 520px) {
	.cfm-accountant-actions {
		grid-template-columns: 1fr;
	}

	.cfm-accountant-action {
		min-height: 68px;
	}

	.cfm-dashboard-search {
		align-items: stretch;
		flex-direction: column;
	}
}
