:root {
	--wf-navy-950: #001a35;
	--wf-navy-900: #01284f;
	--wf-navy-800: #063a70;
	--wf-blue-700: #0752d3;
	--wf-blue-600: #1769e8;
	--wf-blue-100: #dce9ff;
	--wf-blue-50: #f0f6ff;
	--wf-surface: #ffffff;
	--wf-surface-subtle: #f7f9fc;
	--wf-surface-muted: #eef2f7;
	--wf-border: #dfe5ed;
	--wf-border-strong: #c8d1dc;
	--wf-text: #1f2937;
	--wf-text-muted: #5f6b7a;
	--wf-success: #137333;
	--wf-warning: #a15c00;
	--wf-danger: #b3261e;
	--wf-sidebar-width: 252px;
	--wf-topbar-height: 68px;
	--wf-radius-sm: 10px;
	--wf-radius-md: 14px;
	--wf-radius-lg: 20px;
	--wf-shadow-1: 0 1px 2px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(15, 23, 42, 0.04);
	--wf-shadow-2: 0 12px 32px rgba(1, 40, 79, 0.12);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	min-width: 320px;
	background: var(--wf-surface-subtle);
}

body {
	min-height: 100vh;
	margin: 0;
	background: var(--wf-surface-subtle);
	color: var(--wf-text);
	font-family: Inter, Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
	font-size: 0.925rem;
	-webkit-font-smoothing: antialiased;
}

a {
	text-underline-offset: 0.18em;
}

.text-woo {
	color: var(--wf-blue-700) !important;
}

.bg-woo-soft {
	background: var(--wf-blue-50) !important;
}

.nowrap {
	white-space: nowrap;
}

.min-w-0 {
	min-width: 0;
}

:focus-visible {
	outline: 3px solid rgba(7, 82, 211, 0.32);
	outline-offset: 2px;
}

.skip-link {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 2000;
	transform: translateY(-160%);
	border-radius: 8px;
	background: var(--wf-surface);
	color: var(--wf-navy-900);
	font-weight: 700;
	padding: 10px 14px;
	transition: transform 0.16s ease;
}

.skip-link:focus {
	transform: translateY(0);
}

.crm-sidebar {
	position: fixed;
	inset: 0 auto 0 0;
	z-index: 1040;
	display: flex;
	width: var(--wf-sidebar-width);
	flex-direction: column;
	background: linear-gradient(180deg, var(--wf-navy-950), var(--wf-navy-900) 68%, #06345f);
	box-shadow: 8px 0 28px rgba(0, 26, 53, 0.1);
	color: #ffffff;
	overflow: hidden;
}

.crm-brand {
	display: flex;
	min-height: 78px;
	align-items: center;
	gap: 12px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	color: #ffffff;
	padding: 14px 18px;
	text-decoration: none;
}

.crm-brand:hover {
	color: #ffffff;
}

.crm-brand__mark {
	display: block;
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	border: 2px solid rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	background: #ffffff;
	object-fit: contain;
}

.crm-brand__name {
	display: block;
	font-size: 1.06rem;
	font-weight: 800;
	letter-spacing: -0.01em;
}

.crm-brand__descriptor {
	display: block;
	margin-top: 1px;
	color: #b9cee2;
	font-size: 0.74rem;
	font-weight: 500;
}

.crm-sidebar__scroll {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 14px 12px 24px;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.crm-nav-label {
	margin: 17px 12px 7px;
	color: #9fb8d0;
	font-size: 0.67rem;
	font-weight: 700;
	letter-spacing: 0.11em;
	text-transform: uppercase;
}

.crm-nav-link,
.crm-nav-summary {
	display: flex;
	min-height: 42px;
	align-items: center;
	gap: 11px;
	margin: 3px 0;
	border: 0;
	border-radius: 11px;
	background: transparent;
	color: #dce8f4;
	cursor: pointer;
	font-weight: 600;
	padding: 9px 12px;
	text-decoration: none;
	transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.crm-nav-link:hover,
.crm-nav-summary:hover,
.crm-nav-link.is-active {
	background: rgba(255, 255, 255, 0.11);
	color: #ffffff;
}

.crm-nav-link.is-active {
	box-shadow: inset 3px 0 0 #72a7ff;
}

.crm-nav-link i,
.crm-nav-summary i {
	width: 22px;
	flex: 0 0 22px;
	font-size: 1.08rem;
	text-align: center;
}

.crm-nav-link__text {
	min-width: 0;
	flex: 1;
}

.crm-nav-group {
	margin-top: 12px;
}

.crm-nav-group > summary {
	list-style: none;
}

.crm-nav-group > summary::-webkit-details-marker {
	display: none;
}

.crm-nav-summary::after {
	content: "\F282";
	font-family: "bootstrap-icons";
	font-size: 0.72rem;
	transition: transform 0.18s ease;
}

.crm-nav-group[open] > .crm-nav-summary::after {
	transform: rotate(90deg);
}

.crm-nav-children {
	padding-left: 10px;
}

.crm-sidebar__footer {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	color: #a9bfd4;
	font-size: 0.68rem;
	padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
}

.crm-sidebar-backdrop {
	position: fixed;
	inset: 0;
	z-index: 1035;
	display: none;
	border: 0;
	background: rgba(0, 20, 40, 0.48);
	backdrop-filter: blur(2px);
}

.crm-main {
	min-height: 100vh;
	margin-left: var(--wf-sidebar-width);
}

.crm-topbar {
	position: sticky;
	top: 0;
	z-index: 1020;
	display: flex;
	min-height: var(--wf-topbar-height);
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	border-bottom: 1px solid var(--wf-border);
	background: rgba(255, 255, 255, 0.96);
	padding: 10px 26px;
	backdrop-filter: blur(14px);
}

.crm-topbar__heading {
	min-width: 0;
}

.crm-page-title {
	margin: 0;
	color: var(--wf-text);
	font-size: clamp(1.15rem, 1.8vw, 1.4rem);
	font-weight: 750;
	letter-spacing: -0.018em;
	line-height: 1.2;
}

.crm-page-subtitle {
	margin-top: 3px;
	color: var(--wf-text-muted);
	font-size: 0.78rem;
	line-height: 1.3;
}

.crm-topbar__actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.crm-icon-button {
	display: inline-grid;
	width: 42px;
	height: 42px;
	place-items: center;
	border: 1px solid transparent;
	border-radius: 50%;
	background: var(--wf-surface-muted);
	color: var(--wf-text);
	text-decoration: none;
}

.crm-icon-button:hover {
	border-color: var(--wf-border);
	background: var(--wf-blue-50);
	color: var(--wf-blue-700);
}

.crm-avatar {
	display: inline-grid;
	width: 40px;
	height: 40px;
	place-items: center;
	border: 1px solid #bfd1e4;
	border-radius: 50%;
	background: #e8f1fb;
	color: var(--wf-navy-900);
	font-weight: 800;
}

.crm-user-meta {
	line-height: 1.2;
	text-align: right;
}

.crm-user-role {
	display: block;
	margin-top: 3px;
	color: var(--wf-text-muted);
	font-size: 0.72rem;
}

.crm-content {
	width: 100%;
	max-width: 1720px;
	margin: 0 auto;
	padding: 24px 26px 52px;
}

.crm-page-heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
}

.crm-page-heading__title {
	margin: 0;
	font-size: 1.14rem;
	font-weight: 750;
}

.crm-page-heading__description {
	margin-top: 4px;
	color: var(--wf-text-muted);
}

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

.card {
	border: 1px solid var(--wf-border);
	border-radius: var(--wf-radius-md);
	box-shadow: var(--wf-shadow-1);
}

.card-header {
	border-bottom: 1px solid var(--wf-border);
	background: var(--wf-surface);
}

.dropdown-menu {
	border: 1px solid var(--wf-border);
	border-radius: 12px;
	box-shadow: var(--wf-shadow-2);
	padding: 7px;
}

.dropdown-item {
	min-height: 39px;
	border-radius: 8px;
	padding: 8px 10px;
}

.btn {
	min-height: 40px;
	border-radius: 9px;
	font-weight: 600;
}

.btn-sm {
	min-height: 34px;
}

.btn-primary {
	border-color: var(--wf-blue-700);
	background: var(--wf-blue-700);
}

.btn-primary:hover,
.btn-primary:focus {
	border-color: var(--wf-navy-800);
	background: var(--wf-navy-800);
}

.btn-light {
	border-color: var(--wf-border);
	background: var(--wf-surface);
}

.form-control,
.form-select,
.input-group-text {
	min-height: 40px;
	border-color: var(--wf-border-strong);
	border-radius: 9px;
}

.form-control:focus,
.form-select:focus {
	border-color: var(--wf-blue-600);
	box-shadow: 0 0 0 0.2rem rgba(7, 82, 211, 0.14);
}

.form-label {
	color: #344054;
	font-size: 0.82rem;
	font-weight: 650;
}

.form-text,
.text-muted {
	color: var(--wf-text-muted) !important;
}

.alert {
	border-radius: 12px;
	box-shadow: var(--wf-shadow-1);
}

.table-responsive {
	scrollbar-width: thin;
}

.table {
	--bs-table-color: var(--wf-text);
	margin-bottom: 0;
}

.table > :not(caption) > * > * {
	padding: 0.78rem 0.75rem;
	vertical-align: middle;
}

.table thead th {
	border-bottom-color: var(--wf-border-strong);
	background: #f8fafc;
	color: #526170;
	font-size: 0.7rem;
	font-weight: 750;
	letter-spacing: 0.045em;
	text-transform: uppercase;
	white-space: nowrap;
}

.table tbody tr:hover > * {
	background: #f8fbff;
}

.stat-card .stat-icon {
	display: grid;
	width: 44px;
	height: 44px;
	flex: 0 0 44px;
	place-items: center;
	border-radius: 13px;
	background: var(--wf-blue-50);
	color: var(--wf-blue-700);
	font-size: 1.2rem;
}

.stat-number {
	font-size: clamp(1.4rem, 2vw, 1.68rem);
	font-weight: 800;
	letter-spacing: -0.03em;
}

.badge-soft,
.crm-status-chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	border: 1px solid #c9dcff;
	border-radius: 999px;
	background: var(--wf-blue-50);
	color: #174ea6;
	font-size: 0.72rem;
	font-weight: 700;
	padding: 5px 9px;
}

.empty,
.crm-empty-state {
	padding: 42px 22px;
	color: var(--wf-text-muted);
	text-align: center;
}

.crm-empty-state i {
	display: block;
	margin-bottom: 9px;
	color: #8193a6;
	font-size: 2rem;
}

.select2-container {
	width: 100% !important;
}

.select2-container .select2-selection--single {
	height: 40px;
	border: 1px solid var(--wf-border-strong);
	border-radius: 9px;
}

.select2-container .select2-selection--single .select2-selection__rendered {
	line-height: 38px;
	padding-left: 12px;
}

.select2-container .select2-selection--single .select2-selection__arrow {
	height: 38px;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
	border-color: var(--wf-blue-600);
	box-shadow: 0 0 0 0.2rem rgba(7, 82, 211, 0.14);
}

.select2-dropdown {
	border-color: var(--wf-border-strong);
	border-radius: 9px;
	box-shadow: var(--wf-shadow-2);
	overflow: hidden;
}

.select2-results__option {
	padding: 9px 12px;
}

.crm-mobile-menu,
.crm-mobile-bottom-nav {
	display: none;
}

.auth-shell {
	display: grid;
	min-height: 100vh;
	grid-template-columns: minmax(320px, 0.88fr) minmax(430px, 1.12fr);
	background: var(--wf-surface-subtle);
}

.auth-brand-panel {
	position: relative;
	display: flex;
	min-height: 100vh;
	align-items: center;
	justify-content: center;
	background: radial-gradient(circle at 30% 18%, #0d5ca5 0, transparent 33%), linear-gradient(145deg, var(--wf-navy-950), var(--wf-navy-900));
	color: #ffffff;
	overflow: hidden;
	padding: 48px;
}

.auth-brand-panel::after {
	position: absolute;
	right: -130px;
	bottom: -180px;
	width: 420px;
	height: 420px;
	border: 1px solid rgba(255, 255, 255, 0.13);
	border-radius: 50%;
	box-shadow: 0 0 0 70px rgba(255, 255, 255, 0.035), 0 0 0 145px rgba(255, 255, 255, 0.025);
	content: "";
}

.auth-brand-content {
	position: relative;
	z-index: 1;
	width: min(430px, 100%);
}

.auth-brand-logo {
	width: 78px;
	height: 78px;
	border: 3px solid rgba(255, 255, 255, 0.24);
	border-radius: 50%;
	background: #ffffff;
}

.auth-brand-title {
	margin: 26px 0 10px;
	font-size: clamp(2rem, 4vw, 3.25rem);
	font-weight: 800;
	letter-spacing: -0.045em;
}

.auth-brand-copy {
	max-width: 410px;
	margin: 0;
	color: #ceddec;
	font-size: 1.02rem;
	line-height: 1.65;
}

.auth-form-panel {
	display: grid;
	place-items: center;
	padding: 32px;
}

.auth-card {
	width: min(440px, 100%);
	border: 1px solid var(--wf-border);
	border-radius: var(--wf-radius-lg);
	background: var(--wf-surface);
	box-shadow: 0 22px 65px rgba(1, 40, 79, 0.12);
}

.auth-mobile-logo {
	display: none;
	width: 58px;
	height: 58px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: #ffffff;
}

.auth-footer {
	margin-top: 24px;
	color: var(--wf-text-muted);
	font-size: 0.75rem;
	text-align: center;
}

@media (max-width: 1199.98px) {
	.crm-sidebar {
		transform: translateX(-102%);
		transition: transform 0.2s ease;
	}

	.crm-sidebar.is-open {
		transform: translateX(0);
	}

	.crm-sidebar-backdrop.is-visible {
		display: block;
	}

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

	.crm-main {
		margin-left: 0;
	}

	.crm-mobile-menu {
		display: inline-grid;
	}
}

@media (max-width: 767.98px) {
	:root {
		--wf-topbar-height: 60px;
	}

	.crm-topbar {
		gap: 8px;
		padding: 8px 12px;
	}

	.crm-page-subtitle,
	.crm-user-meta,
	.crm-quick-create__label {
		display: none;
	}

	.crm-topbar__actions {
		gap: 4px;
	}

	.crm-content {
		padding: 16px 12px calc(88px + env(safe-area-inset-bottom));
	}

	.crm-page-heading {
		align-items: stretch;
		flex-direction: column;
		margin-bottom: 16px;
	}

	.crm-page-actions {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		justify-content: stretch;
	}

	.crm-page-actions > .btn,
	.crm-page-actions > form,
	.crm-page-actions > form .btn {
		width: 100%;
	}

	.card {
		border-radius: 12px;
	}

	.card-body {
		padding: 16px;
	}

	.table-responsive {
		margin-inline: -1px;
	}

	.table > :not(caption) > * > * {
		padding: 0.7rem 0.62rem;
	}

	.crm-mobile-bottom-nav {
		position: fixed;
		inset: auto 0 0;
		z-index: 1030;
		display: grid;
		grid-template-columns: repeat(5, 1fr);
		border-top: 1px solid var(--wf-border);
		background: rgba(255, 255, 255, 0.98);
		box-shadow: 0 -6px 24px rgba(1, 40, 79, 0.1);
		padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
		backdrop-filter: blur(14px);
	}

	.crm-mobile-bottom-nav a,
	.crm-mobile-bottom-nav button {
		display: flex;
		min-width: 0;
		min-height: 48px;
		align-items: center;
		justify-content: center;
		gap: 2px;
		border: 0;
		background: transparent;
		color: #657485;
		flex-direction: column;
		font-size: 0.64rem;
		line-height: 1.1;
		padding: 4px 2px;
		text-decoration: none;
	}

	.crm-mobile-bottom-nav a.is-active {
		color: var(--wf-blue-700);
		font-weight: 750;
	}

	.crm-mobile-bottom-nav i {
		font-size: 1.12rem;
	}

	.auth-shell {
		display: block;
		background: linear-gradient(180deg, var(--wf-navy-900) 0, var(--wf-navy-900) 180px, var(--wf-surface-subtle) 180px);
	}

	.auth-brand-panel {
		display: none;
	}

	.auth-form-panel {
		min-height: 100vh;
		align-items: start;
		padding: 34px 14px;
	}

	.auth-card {
		margin-top: 42px;
	}

	.auth-mobile-logo {
		display: block;
	}
}

@media (max-width: 419.98px) {
	.crm-page-actions {
		grid-template-columns: 1fr;
	}

	.crm-page-title {
		max-width: 48vw;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
}

@media (min-width: 1200px) and (max-height: 820px) {
	.crm-brand {
		min-height: 68px;
		padding-block: 10px;
	}

	.crm-sidebar__scroll {
		padding-top: 9px;
	}

	.crm-nav-label {
		margin-top: 12px;
	}

	.crm-nav-link,
	.crm-nav-summary {
		min-height: 38px;
		padding-block: 7px;
	}

	.crm-content {
		padding-top: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}

@media print {
	.crm-sidebar,
	.crm-sidebar-backdrop,
	.crm-topbar,
	.crm-mobile-bottom-nav,
	.no-print {
		display: none !important;
	}

	body,
	.crm-main,
	.crm-content {
		min-height: auto;
		margin: 0;
		background: #ffffff;
		padding: 0;
	}

	.card {
		box-shadow: none;
	}
}
