/* Mini CRM — modern polished theme on top of Bootstrap 5.3.
   Loaded after bootstrap.min.css. */

:root {
	/* Fresh indigo accent (replaces Bootstrap default blue). */
	--bs-primary: #4f46e5;
	--bs-primary-rgb: 79, 70, 229;
	--bs-primary-bg-subtle: #eef2ff;
	--bs-primary-border-subtle: #c7d2fe;
	--bs-primary-text-emphasis: #3730a3;
	--bs-link-color: #4f46e5;
	--bs-link-color-rgb: 79, 70, 229;
	--bs-link-hover-color: #3730a3;
	/* --bs-link-hover-color-rgb */
	--crm-bg: #f4f5fb;
	--crm-ink: #1f2330;
	--crm-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .09);
	--crm-shadow-lg: 0 8px 20px -6px rgba(16, 24, 40, .14), 0 3px 6px -3px rgba(16, 24, 40, .08);
	--crm-radius: .875rem;
}

body {
	min-height: 100vh;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		"Helvetica Neue", Arial, sans-serif;
	color: var(--crm-ink);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	background-color: var(--crm-bg);
	background-image: radial-gradient(1100px 520px at 8% -12%, rgba(99, 102, 241, .10), transparent 60%),
		radial-gradient(900px 480px at 108% 112%, rgba(99, 102, 241, .08), transparent 60%);
	background-attachment: fixed;
}

.crm-container {
	max-width: 1220px;
	margin: 0 auto;
}

/* ---- brand mark ---- */

.crm-logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	flex: none;
	border-radius: .6rem;
	background: linear-gradient(135deg, #6366f1, #4f46e5 55%, #4338ca);
	color: #fff;
	font-size: 1.05rem;
	font-weight: 700;
	box-shadow: 0 3px 10px rgba(79, 70, 229, .35);
	user-select: none;
}

.crm-logo-lg {
	width: 46px;
	height: 46px;
	border-radius: .85rem;
	font-size: 1.35rem;
}

.crm-logo-image {
	display: inline-block;
	width: 34px;
	height: 34px;
	flex: none;
	object-fit: contain;
	border-radius: .6rem;
	background: #fff;
	box-shadow: 0 3px 10px rgba(79, 70, 229, .18);
}

.crm-logo-image.crm-logo-lg {
	width: 46px;
	height: 46px;
	border-radius: .85rem;
}

.settings-logo-preview {
	width: 64px;
	height: 64px;
	object-fit: contain;
	border-radius: .75rem;
	background: #fff;
	border: 1px solid rgba(16, 24, 40, .08);
	padding: .35rem;
}

.crm-navbar {
	background: rgba(255, 255, 255, .92) !important;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid rgba(16, 24, 40, .06);
}

.crm-global-search {
	max-width: 34rem;
}

.empty-state-icon {
	align-items: center;
	background: var(--bs-primary-bg-subtle);
	border-radius: 50%;
	color: var(--bs-primary);
	display: inline-flex;
	font-size: 1.5rem;
	height: 3rem;
	justify-content: center;
	width: 3rem;
}

.crm-sidebar {
	background: rgba(255, 255, 255, .94) !important;
}

.crm-sidebar .offcanvas-body {
	overflow-y: auto;
}

/* ---- buttons ---- */

.btn {
	border-radius: .55rem;
	transition: all .15s ease;
}

.btn-primary {
	--bs-btn-color: #fff;
	--bs-btn-hover-color: #fff;
	--bs-btn-active-color: #fff;
	--bs-btn-disabled-color: #fff;
	--bs-btn-bg: #4f46e5;
	--bs-btn-border-color: #4f46e5;
	--bs-btn-hover-bg: #4338ca;
	--bs-btn-hover-border-color: #4338ca;
	--bs-btn-active-bg: #4338ca;
	--bs-btn-active-border-color: #4338ca;
	--bs-btn-disabled-bg: #6d6df0;
	--bs-btn-disabled-border-color: #6d6df0;
	box-shadow: 0 1px 2px rgba(79, 70, 229, .35);
}

.btn-outline-primary {
	--bs-btn-color: #4f46e5;
	--bs-btn-border-color: #4f46e5;
	--bs-btn-hover-color: #fff;
	--bs-btn-hover-bg: #4f46e5;
	--bs-btn-hover-border-color: #4f46e5;
	--bs-btn-active-color: #fff;
	--bs-btn-active-bg: #4f46e5;
	--bs-btn-active-border-color: #4f46e5;
	--bs-btn-focus-shadow-rgb: 79, 70, 229;
}

/* ---- cards ---- */

.card {
	border: 1px solid rgba(16, 24, 40, .06);
	border-radius: var(--crm-radius);
	box-shadow: var(--crm-shadow);
}

.card-header {
	background: transparent;
	border-bottom: 1px solid rgba(16, 24, 40, .06);
	font-weight: 600;
	padding: .9rem 1.25rem;
}

.card-footer {
	background: rgba(248, 250, 252, .6);
	border-top: 1px solid rgba(16, 24, 40, .06);
}

.card-hover {
	transition: transform .15s ease, box-shadow .15s ease;
}

.card-hover:hover {
	transform: translateY(-2px);
	box-shadow: var(--crm-shadow-lg);
}

.crm-stat {
	font-weight: 650;
	letter-spacing: -.02em;
}

/* ---- tables ---- */

.table {
	--bs-table-border-color: rgba(16, 24, 40, .07);
}

.table thead th {
	font-size: .72rem;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: #64748b;
	font-weight: 600;
	border-bottom-width: 1px;
}

.table-light {
	--bs-table-bg: #f8fafc;
	--bs-table-border-color: rgba(16, 24, 40, .08);
}

.table-hover tbody tr {
	transition: background-color .12s ease;
}

.table-hover tbody tr:hover {
	--bs-table-hover-bg: #f8faff;
}

/* ---- badges ---- */

.badge {
	font-weight: 600;
	font-size: .7rem;
	line-height: 1;
	padding: .45em .72em;
	border-radius: .5rem;
}

.badge.text-bg-light {
	background: #eef0f4 !important;
	color: #64748b !important;
	border: 1px solid rgba(16, 24, 40, .08);
}

/* ---- forms ---- */

.form-control,
.form-select {
	border-radius: .55rem;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
	border-color: rgba(79, 70, 229, .5);
	box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .16);
}

.form-control::placeholder {
	color: #9aa3b2;
}

/* ---- sidebar ---- */

.nav .nav-link {
	border-radius: .6rem;
	color: #475569;
	font-weight: 500;
	padding: .55rem .85rem;
}

.nav .nav-link:hover {
	background: rgba(79, 70, 229, .07);
	color: #3730a3;
}

.nav .nav-link.active {
	background: var(--bs-primary-bg-subtle);
	color: var(--bs-primary);
	font-weight: 600;
}

.nav-section {
	display: block;
	padding: .4rem .85rem .25rem;
	font-size: .72rem;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: #a0a7b5;
	margin-top: .6rem;
}

.nav-section:first-child {
	margin-top: 0;
}

/* ---- list groups & dropdowns ---- */

.list-group-item {
	border-color: rgba(16, 24, 40, .06);
	transition: background-color .12s ease;
}

.list-group-item:hover {
	background: #f8faff;
}

.dropdown-menu {
	border: 1px solid rgba(16, 24, 40, .08);
	border-radius: .75rem;
	box-shadow: var(--crm-shadow-lg);
}

.dropdown-item {
	border-radius: .45rem;
}

.dropdown-item:active {
	background-color: var(--bs-primary);
}

/* ---- pagination & alerts ---- */

.page-link {
	color: #4f46e5;
	font-weight: 500;
	border-color: rgba(16, 24, 40, .08);
}

.page-link:hover {
	color: #3730a3;
	background-color: #f4f5fb;
}

.page-item.active .page-link {
	background-color: #4f46e5;
	border-color: #4f46e5;
}

.alert {
	border-radius: .75rem;
	border: 1px solid transparent;
}

.alert-success {
	border-color: #d1fae5;
}

.alert-danger {
	border-color: #fecaca;
}

.timeline .rounded-circle {
	min-width: 52px;
}

.table td,
.table th {
	vertical-align: middle;
}

.pipeline-scroll {
	overflow-x: auto;
	margin-right: -.25rem;
	padding-right: .25rem;
}

.pipeline-board {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	min-width: max-content;
}

.pipeline-column {
	width: 280px;
	min-height: 250px;
	padding: .75rem;
	border-radius: var(--crm-radius);
	background: rgba(241, 245, 249, .78);
	border: 1px solid rgba(16, 24, 40, .07);
}

.pipeline-column-header {
	min-height: 32px;
}

.pipeline-card {
	border-color: rgba(16, 24, 40, .08);
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.pipeline-card:hover {
	transform: translateY(-2px);
	border-color: rgba(79, 70, 229, .35);
	box-shadow: var(--crm-shadow-lg);
}

.pipeline-empty {
	padding: 2rem 1rem;
	border: 1px dashed rgba(100, 116, 139, .35);
	border-radius: .65rem;
	text-align: center;
	font-size: .85rem;
	color: #94a3b8;
}

@media (prefers-reduced-motion: reduce) {
	.card-hover,
	.btn,
	.table-hover tbody tr,
	.list-group-item {
		transition: none;
	}
}

@media (min-width: 768px) {
	.vh-100-md {
		min-height: calc(100vh - 57px);
	}
}

@media (max-width: 767.98px) {
	.crm-sidebar {
		--bs-offcanvas-width: min(82vw, 290px);
	}

	.crm-sidebar .offcanvas-body {
		padding-bottom: 1rem !important;
	}

	.crm-container {
		width: 100%;
	}
}
