/* === Design System Tokens === */
:root {
    /* Colors - Sidebar */
    --sidebar-bg: rgba(255, 255, 255, 0.6);
    --sidebar-border: #e4e7ec;
    --sidebar-width: 320px;

    /* Colors - Nav */
    --nav-item-active-bg: #ece6ff;
    --nav-item-hover-bg: rgba(0, 0, 0, 0.04);
    --nav-item-radius: 6px;

    /* Colors - Brand */
    --brand-purple-900: #4918cf;
    --brand-purple-700: #6938ef;
    --brand-purple-500: #7a5af8;
    --brand-purple-50: #ece6ff;

    /* Colors - Text */
    --text-primary: #101828;
    --text-secondary: #344054;
    --text-secondary-hover: #182230;
    --text-tertiary: #475467;

    /* Colors - Border */
    --border-primary: #d0d5dd;
    --border-secondary: #e4e7ec;

    /* Colors - Background */
    --bg-primary: #ffffff;
    --bg-page: #f2f4f7;
    --bg-page-outer: #e4e7ec;
	--bg-filter-outer: #f8fafc;

    /* Header */
    --header-height: 72px;
    --header-btn-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);

    /* Typography */
    --font-display: 'Satoshi', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-body: 'Satoshi', 'Helvetica Neue', Helvetica, Arial, sans-serif;

    /* Spacing */
    --spacing-4: 4px;
    --spacing-8: 8px;
    --spacing-12: 12px;
    --spacing-16: 16px;
    --spacing-20: 20px;
    --spacing-24: 24px;
    --spacing-32: 32px;
}

body {
    height: 100%;
    margin: 0;
    data-enhance-nav: "false";
	--bs-body-font-size: 0.9rem !important;
}

html, body {
    font-family: var(--font-body);
    background-color: var(--bg-page);
    overflow: hidden;
}

.ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.container {
	/*
    margin-right: unset !important;
    margin-left: unset !important;
	*/
    width: 100% !important;
    max-width: 100% !important;
	padding-left: 0px !important;
	padding-right: 0px !important;
}

.row-padding {
    padding-bottom: 10px;
}

.row-margin-top {
    margin-top: 10px;
}

.col-no-grow {
    flex-grow: 0 !important;
}

.card {
    border-top-left-radius: 0px !important;
    border-top-right-radius: 0px !important;
}
.card-body {
    padding: 10px 10px 5px 10px;
}

.fit-width {
    min-width: fit-content !important;
}

.form-control {
	border-color: lightgray !important;
	padding: 0.3rem 2.25rem 0.25rem 0.25rem !important;
}

.no-focus-shadow:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: #c9c9c9 !important;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: var(--brand-purple-500, #7a5af8);
    border-color: var(--brand-purple-500, #7a5af8);
}

.btn-primary:hover {
    background-color: #6941c6;
    border-color: #6941c6;
}

/* NOTE: .header-agency-dropdown is fully styled in MainLayout.razor.css —
   that scoped CSS uses !important and is loaded after app.css, so any
   rules added here would be overridden. Update the scoped file instead. */
.header-agency-dropdown {
	align-items: center;
	border: 1px solid var(--border-primary, #d0d5dd);
	background-color: var(--bg-primary, #ffffff);
	box-shadow: var(--header-btn-shadow, 0px 1px 2px 0px rgba(16, 24, 40, 0.05));
	font-family: var(--font-body);
	color: var(--text-secondary, #344054);
	cursor: pointer;
}

.header-agency-dropdown:focus {
	outline: none;
	border-color: var(--brand-purple-500, #7a5af8);
	box-shadow: 0 0 0 2px rgba(122, 90, 248, 0.15);
}

.header-year-select {
	align-items: center;
	border: 1px solid var(--border-primary, #d0d5dd);
	border-radius: 4px;
	background-color: var(--bg-primary, #ffffff);
	box-shadow: var(--header-btn-shadow);
	font-family: var(--font-body);
	color: var(--text-secondary, #344054);
	cursor: pointer;
}

/* Purple toggle switches */
.form-check-input {
	border-color: var(--brand-purple-500, #7a5af8);
}
.form-check-input:checked {
    background-color: var(--brand-purple-500, #7a5af8);
    border-color: var(--brand-purple-500, #7a5af8);
}

.form-check-input:focus {
	box-shadow: none !important;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 0rem;
}

/* Force grey background on page content area (global override for scoped CSS issues) */
.page-content,
.page-content > .container,
.page-content > .container > .row,
.page-content > .container > .row > [class*="col-"] {
    background-color: #f2f4f7 !important;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* === Page Layout Styles === */
.crm-page {
    padding-top: var(--spacing-8);
    padding-bottom: var(--spacing-8);
    padding-left: var(--spacing-24);
    padding-right: var(--spacing-24);
}

.crm-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-12);
}

.crm-page-title {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 500;
    line-height: 38px;
    color: var(--text-primary);
    margin: 0;
}

.crm-page-header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-12);
}

/* Search bar */
.crm-search-bar {
    position: relative;
    margin-bottom: var(--spacing-16);
}

.crm-search-bar input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    outline: none;
}

.crm-search-bar input::placeholder {
    color: var(--text-tertiary);
}

.crm-search-bar input:focus {
    border-color: var(--brand-purple-500);
    box-shadow: 0 0 0 2px rgba(122, 90, 248, 0.15);
}

.crm-search-bar .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.crm-search-bar .search-icon svg {
    width: 18px;
    height: 18px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────
   Single source of truth for toolbar / page-action buttons. Pattern:

       <button class="crm-btn crm-btn-primary">Save</button>
       <a class="crm-btn crm-btn-secondary" href="...">Cancel</a>

   Update shape (radius, padding, font, height) on the base `.crm-btn` class
   and every variant follows. Variants override only color / border. */

.crm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 30px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.crm-btn:disabled,
.crm-btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary — purple solid (e.g. New, Apply, Filter) */
.crm-btn-primary {
    background-color: var(--brand-purple-500, #7a5af8);
    color: #ffffff;
    border-color: var(--brand-purple-500, #7a5af8);
}

.crm-btn-primary:hover {
    background-color: #6941c6;
    border-color: #6941c6;
    color: #ffffff;
    text-decoration: none;
}

/* Secondary — neutral white with subtle border (e.g. Cancel, Export, Edit) */
.crm-btn-secondary {
    background-color: #ffffff;
    color: var(--text-primary, #101828);
    border-color: lightgray;
}

.crm-btn-secondary:hover {
    background-color: #f0f0f0;
    color: var(--text-primary, #101828);
    text-decoration: none;
}

/* Tertiary — white bg with brand-purple text (e.g. Update / save-in-place) */
.crm-btn-tertiary {
    background-color: #ffffff;
    color: var(--brand-purple-500, #7a5af8);
    border-color: var(--border-secondary, #e4e7ec);
    font-weight: 700;
}

.crm-btn-tertiary:hover {
    background-color: #ebe7fe;
    color: #512be7;
    text-decoration: none;
}

/* Danger — red solid (e.g. Delete) */
.crm-btn-danger {
    background-color: #dc3545;
    color: #ffffff;
    border-color: #dc3545;
}

.crm-btn-danger:hover {
    background-color: #b02a37;
    border-color: #b02a37;
    color: #ffffff;
    text-decoration: none;
}

/* Year picker pill */
.crm-year-picker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background-color: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-primary, #d0d5dd);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #101828);
}

.crm-year-picker svg {
    width: 16px;
    height: 16px;
    color: var(--text-tertiary, #475467);
    flex-shrink: 0;
}

.crm-year-picker select {
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #101828);
    cursor: pointer;
    padding: 0;
}

.crm-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background-color: #ffffff;
    border: 1px solid var(--border-primary, #d0d5dd);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #101828);
    line-height: 1;
}

/* Date range display */
.crm-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    white-space: nowrap;
}

/* === Table Styles === */
.crm-table-wrapper {
    background-color: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-secondary, #e4e7ec);
    border-radius: 12px;
    overflow: hidden;
}

.crm-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: var(--font-body);
}

.crm-table thead th {
    color: var(--text-tertiary) !important;
    background-color: #e9edf3 !important;
    font-size: 12px;
    font-weight: bold;
    line-height: 18px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 10px 12px !important;
    border-bottom: 1px solid var(--border-secondary);
    vertical-align: middle;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.crm-table tbody tr {
    border-bottom: 1px solid var(--border-secondary);
}

.crm-table tbody tr:hover {
    background-color: var(--bg-page);
}

.crm-table tbody td {
    padding: 10px 12px !important;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-secondary);
    vertical-align: middle;
    background-color: transparent !important;
}

.crm-table tbody tr:last-child td {
    border-bottom: none;
}

/* Compact nested sub-table (e.g. contacts under an expanded engagement row) */
.crm-table.crm-table-compact thead th,
.crm-table.crm-table-compact tbody td {
    font-size: 12px;
    line-height: 14px;
    padding: 7px 9px !important;    
}

/* Edge spacing: extra padding on the first and last cells of every row so
   text never sits flush against the table border. Applied to both header
   and body rows for visual consistency. */
.crm-table thead th:first-child,
.crm-table tbody td:first-child {
    padding-left: 12px !important;
}

.crm-table thead th:last-child,
.crm-table tbody td:last-child {
    padding-right: 12px !important;
}

/* Department badge/pill */
.crm-dept-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.crm-dept-badge:hover {
    opacity: 0.85;
}

/* Table action buttons */
.crm-table-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.crm-table-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    background-color: var(--bg-primary);
    color: var(--text-tertiary);
    cursor: pointer;
    text-decoration: none;
    padding: 0;
}

.crm-table-action-btn:hover {
    background-color: var(--bg-page);
    color: var(--text-secondary);
}

.crm-table-action-btn svg {
    width: 16px;
    height: 16px;
}

.crm-table-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-secondary);
    border-radius: 50%;
    background-color: var(--bg-primary, #ffffff);
    color: var(--text-tertiary);
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
}

.crm-table-chevron svg {
    width: 16px;
    height: 16px;
}

.crm-table-chevron:hover {
    background-color: var(--bg-page, #f2f4f7);
    border-color: var(--border-primary, #d0d5dd);
    color: var(--text-primary);
}

/* Custom tooltip (replaces native title for position control) */
[data-tip] {
    position: relative;
}

	[data-tip]::before {
		content: attr(data-tip);
		position: absolute;
		bottom: calc(100% + 6px);
		right: calc(100% - 16px);
		background: #535393;
		color: #fff;
		font-size: 12px;
		font-weight: 400;
		white-space: nowrap;
		padding: 4px 8px;
		border-radius: 5px;
		pointer-events: none;
		opacity: 0;
		transition: opacity 0.15s ease;
		z-index: 9999;
	}

	[data-tip]::after {
		content: '';
		position: absolute;
		bottom: calc(100% + 1px);
		right: calc(100% - 20px);
		border: 5px solid transparent;
		border-top-color: #535393;
		pointer-events: none;
		opacity: 0;
		transition: opacity 0.15s ease;
		z-index: 9999;
	}

	[data-tip]:hover::before,
	[data-tip]:hover::after {
		opacity: 1;
	}

	/* Tooltip modifier: opens below-right instead of above-left. Use on
	   triggers near the left edge of a horizontally-scrolling container
	   (e.g. a table's early columns), where the default above-left placement
	   would render partly off-screen and get clipped by the container's
	   overflow. */
	[data-tip].crm-tip-below-right::before {
		bottom: auto;
		top: calc(100% + 6px);
		right: auto;
		left: 0;
	}

	[data-tip].crm-tip-below-right::after {
		bottom: auto;
		top: calc(100% + 1px);
		right: auto;
		left: 14px;
		border-top-color: transparent;
		border-bottom-color: #535393;
	}

/* Sort icon in table header */
.crm-sort-icon {
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
	margin-left: 4px;
	color: var(--text-tertiary);
	cursor: pointer;
}

.crm-sort-icon svg {
    width: 14px;
    height: 14px;
}

/* === Filter Container === */
.crm-filter-container {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 6px 6px;
	background-color: var(--bg-filter-outer, #f8fafc);
	border: 1px solid var(--border-secondary, #e4e7ec);
	border-radius: 10px;
}

.crm-filter-label {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary, #475467);
    white-space: nowrap;
}

/* === Slide-out Filter Panel === */
.crm-filter-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 21, 0.3);
    z-index: 1040;
}

.crm-filter-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    height: 100vh;
    background-color: var(--bg-primary, #ffffff);
    box-shadow: -4px 0 24px rgba(16, 24, 40, 0.12);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.25s ease;
}

.crm-filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-secondary, #e4e7ec);
    flex-shrink: 0;
}

.crm-filter-panel-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary, #101828);
}

.crm-filter-panel-reset {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary, #475467);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.crm-filter-panel-reset:hover {
    background-color: var(--bg-page, #f2f4f7);
}

.crm-filter-panel-reset svg {
    width: 16px;
    height: 16px;
}

.crm-filter-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.crm-sort-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-secondary, #e4e7ec);
    flex-shrink: 0;
}

.crm-sort-toggle-label {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary, #475467);
}

.crm-sort-toggle {
    display: inline-flex;
    background-color: var(--bg-page, #f2f4f7);
    border: 1px solid var(--border-secondary, #e4e7ec);
    border-radius: 8px;
    padding: 2px;
}

.crm-sort-segment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary, #475467);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.crm-sort-segment:hover:not(.active) {
    color: var(--text-primary, #101828);
}

.crm-sort-segment.active {
    background-color: var(--bg-primary, #ffffff);
    color: var(--brand-purple-500, #7a5af8);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.crm-sort-segment svg {
    width: 14px;
    height: 14px;
}

.crm-filter-panel-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-secondary, #e4e7ec);
}

.crm-filter-panel-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.crm-filter-section-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.crm-filter-section-title {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #101828);
}

.crm-filter-section-count {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary, #475467);
    background-color: var(--bg-page, #f2f4f7);
    padding: 2px 8px;
    border-radius: 10px;
}

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

.crm-filter-action-link {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    color: var(--brand-purple-500, #7a5af8);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.crm-filter-action-link:hover {
    text-decoration: underline;
}

.crm-filter-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--border-secondary, #e4e7ec);
    border-radius: 8px;
    margin-bottom: 8px;
    background-color: var(--bg-primary, #ffffff);
}

.crm-filter-search svg {
    width: 16px;
    height: 16px;
    color: var(--text-tertiary, #475467);
    flex-shrink: 0;
}

.crm-filter-search input {
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-primary, #101828);
    width: 100%;
    background: transparent;
}

.crm-filter-search input::placeholder {
    color: var(--text-tertiary, #475467);
}

.crm-filter-checklist {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--border-secondary, #e4e7ec);
    border-radius: 8px;
    background-color: var(--bg-primary, #ffffff);
}

.crm-filter-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-secondary, #344054);
    cursor: pointer;
    border-bottom: 1px solid var(--border-secondary, #e4e7ec);
    margin: 0;
}

.crm-filter-check-item:last-child {
    border-bottom: none;
}

.crm-filter-check-item:hover {
    background-color: var(--bg-page, #f2f4f7);
}

.crm-filter-check-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--brand-purple-500, #7a5af8);
}

.crm-filter-panel-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-secondary, #e4e7ec);
    flex-shrink: 0;
}

.crm-filter-panel-apply {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background-color: var(--brand-purple-500, #7a5af8);
    color: white;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.crm-filter-panel-apply:hover {
    background-color: #6941c6;
}

.crm-filter-panel-apply svg {
    width: 18px;
    height: 18px;
}

/* Filter panel — Level 1 nav rows */
.crm-filter-nav-body {
    padding: 8px 0;
}

.crm-filter-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 24px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-secondary, #e4e7ec);
    cursor: pointer;
    text-align: left;
}

.crm-filter-nav-row:hover {
    background-color: var(--bg-page, #f2f4f7);
}

.crm-filter-nav-selected {
    background-color: var(--brand-purple-50, #ece6ff);
}

.crm-filter-nav-selected:hover {
    background-color: var(--brand-purple-50, #ece6ff);
}

.crm-filter-nav-row:last-child {
    border-bottom: none;
}

.crm-filter-nav-row svg {
    width: 16px;
    height: 16px;
    color: var(--text-tertiary, #475467);
    flex-shrink: 0;
}

.crm-filter-nav-row-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.crm-filter-nav-row-title {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #101828);
}

.crm-filter-nav-row-count {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--text-tertiary, #475467);
}

/* Filter panel — Level 2 */
.crm-filter-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    color: var(--text-secondary, #344054);
    padding: 0;
    flex-shrink: 0;
}

.crm-filter-back-btn:hover {
    background-color: var(--bg-page, #f2f4f7);
}

.crm-filter-back-btn svg {
    width: 16px;
    height: 16px;
}

.crm-filter-level2-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-secondary, #e4e7ec);
}

.crm-filter-checklist-full {
    background-color: var(--bg-primary, #ffffff);
}

/* === Dashboard Styles === */
.crm-dashboard-section {
    background-color: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-secondary, #e4e7ec);
    border-radius: 30px;
    padding: 16px 20px;
    margin-bottom: 0px;
}

.crm-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #101828);
}

.crm-section-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-color: var(--brand-purple-50, #ece6ff);
    color: var(--brand-purple-500, #7a5af8);
    flex-shrink: 0;
}

.crm-section-header-icon svg {
    width: 18px;
    height: 18px;
}

.crm-kpi-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.crm-kpi-card {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    border: 1px solid var(--border-secondary, #e4e7ec);
    border-radius: 10px;
    background-color: var(--bg-primary, #ffffff);
    cursor: pointer;
    min-width: 140px;
    flex-shrink: 0;
    transition: box-shadow 0.15s;
}

.crm-kpi-card:hover {
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.08);
}

.crm-kpi-label {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary, #475467);
    margin-bottom: 4px;
}

.crm-kpi-value {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary, #101828);
    line-height: 1.2;
}

.crm-kpi-subvalue {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-tertiary, #475467);
    margin-top: 2px;
}

.crm-kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #067647;
    margin-left: 8px;
}

.crm-kpi-trend svg {
    width: 14px;
    height: 14px;
}

/* Inline KPI row — horizontal cards with dividers */
.crm-kpi-row-inline {
    display: flex;
    flex-direction: row;
    gap: 0;
    align-items: stretch;
    flex-wrap: nowrap;
}

.crm-kpi-card-inline {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px 24px;
    cursor: pointer;
    min-width: 0;
    flex: 1 1 0;
    border-right: 1px solid var(--border-secondary, #e4e7ec);
    transition: background-color 0.15s;
}

.crm-kpi-card-inline:last-child {
    border-right: none;
}

.crm-kpi-card-inline:hover {
    background-color: var(--bg-page, #f2f4f7);
}

.crm-kpi-card-inline-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
}

/* KPI card with chevron (used in SPED sidebar) */
.crm-kpi-card-with-chevron {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-secondary, #e4e7ec);
    cursor: pointer;
    transition: background-color 0.15s;
}

.crm-kpi-card-with-chevron > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.crm-kpi-card-with-chevron .crm-kpi-label {
    display: block;
}

.crm-kpi-card-with-chevron .crm-kpi-value {
    display: block;
    font-size: 20px;
}

.crm-kpi-card-with-chevron .crm-kpi-subvalue {
    display: block;
}

.crm-kpi-card-with-chevron:last-child {
    border-bottom: none;
}

.crm-kpi-card-with-chevron:hover {
    background-color: var(--bg-page, #f2f4f7);
}

.crm-kpi-card-selected {
    background-color: var(--brand-purple-50, #ece6ff) !important;
}

.crm-kpi-card-selected .crm-kpi-value {
    color: var(--brand-purple-700, #6938ef);
}

.crm-kpi-chevron {
    display: flex;
    align-items: center;
    color: var(--text-tertiary, #475467);
    flex-shrink: 0;
}

.crm-kpi-chevron svg {
    width: 20px;
    height: 20px;
}

.crm-dashboard-chart {
    background-color: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-secondary, #e4e7ec);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    min-width: 0;
    overflow: visible;
    max-width: 100%;
}

.crm-dashboard-chart .clickable-bar-chart {
    max-width: 100% !important;
    width: 100% !important;
}

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

.crm-dashboard-chart-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #101828);
}

.crm-dashboard-chart-title .chart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background-color: var(--brand-purple-50, #ece6ff);
    color: var(--brand-purple-500, #7a5af8);
}

.crm-dashboard-chart-title .chart-icon svg {
    width: 16px;
    height: 16px;
}

.crm-dashboard-chart-minimize {
    cursor: pointer;
    color: var(--text-tertiary, #475467);
    padding: 4px;
    border-radius: 4px;
}

.crm-dashboard-chart-minimize:hover {
    background-color: var(--nav-item-hover-bg, rgba(0, 0, 0, 0.04));
}

.crm-dashboard-chart-minimize svg {
    width: 18px;
    height: 18px;
}

.crm-dashboard-row {
    display: flex;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 16px;
    background-color: var(--border-secondary, #e4e7ec);
    border-radius: 12px;
    padding: 12px;
}

.crm-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: start;
}

.crm-dashboard-grid-main {
    min-width: 0;
}

.crm-dashboard-grid-side {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-shrink: 0;
}

/* === Login Page === */
.login-page {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-primary, #ffffff);
}

.login-left {
    flex: 0 0 50%;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 60px 80px;
}

.login-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 440px;
}

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

.login-logo {
    max-height: 40px;
}

.login-title {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary, #101828);
    line-height: 1.15;
    margin: 0;
    letter-spacing: -0.5px;
}

.login-headline {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    color: var(--brand-purple-500, #7a5af8);
    line-height: 1.3;
    margin: 0 0 8px 0;
}

.login-subtitle {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    color: var(--text-tertiary, #475467);
    line-height: 1.6;
    margin-bottom: 40px;
}

.login-trust {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 400;
    color: var(--text-tertiary, #475467);
    margin-top: 16px;
    opacity: 0.7;
}

.login-google-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 28px;
    background-color: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-primary, #d0d5dd);
    border-radius: 10px;
    box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary, #344054);
    cursor: pointer;
    transition: background-color 0.15s, box-shadow 0.2s, transform 0.1s;
    text-decoration: none;
}

.login-google-btn:hover {
    background-color: var(--bg-page, #f9fafb);
    box-shadow: 0px 3px 8px rgba(16, 24, 40, 0.1);
    transform: translateY(-1px);
}

.login-google-btn:active {
    transform: translateY(0);
}

.login-google-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 360px;
    margin: 24px 0;
    color: var(--text-tertiary, #475467);
    font-size: 13px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-secondary, #e4e7ec);
}

.login-footer {
    padding-top: 24px;
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--text-tertiary, #475467);
    opacity: 0.6;
}

.login-right {
    flex: 0 0 50%;
    max-width: 50%;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #f4f0ff 0%, #ebe4ff 35%, #ddd6fe 65%, #ece6ff 100%);
}

.login-right-pattern {
    position: absolute;
    inset: 0;
}

/* Soft ambient glow layers */
.login-right-pattern::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 25% 25%, rgba(122, 90, 248, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 70% 60%, rgba(105, 56, 239, 0.10) 0%, transparent 35%),
        radial-gradient(circle at 50% 85%, rgba(122, 90, 248, 0.08) 0%, transparent 30%),
        radial-gradient(circle at 80% 15%, rgba(122, 90, 248, 0.06) 0%, transparent 25%);
}

/* Network nodes and connections via SVG data URI */
.login-right-pattern::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.18;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='800' viewBox='0 0 800 800'%3E%3Cdefs%3E%3Cstyle%3Ecircle%7Bfill:%237a5af8%7Dline%7Bstroke:%237a5af8;stroke-width:1;opacity:0.5%7D%3C/style%3E%3C/defs%3E%3C!-- Nodes --%3E%3Ccircle cx='120' cy='140' r='4'/%3E%3Ccircle cx='280' cy='90' r='3'/%3E%3Ccircle cx='420' cy='160' r='5'/%3E%3Ccircle cx='580' cy='100' r='3.5'/%3E%3Ccircle cx='700' cy='180' r='4'/%3E%3Ccircle cx='80' cy='320' r='3'/%3E%3Ccircle cx='200' cy='280' r='5'/%3E%3Ccircle cx='350' cy='340' r='4'/%3E%3Ccircle cx='500' cy='290' r='3.5'/%3E%3Ccircle cx='650' cy='350' r='4.5'/%3E%3Ccircle cx='150' cy='480' r='4'/%3E%3Ccircle cx='300' cy='520' r='3'/%3E%3Ccircle cx='460' cy='460' r='5'/%3E%3Ccircle cx='600' cy='510' r='3.5'/%3E%3Ccircle cx='720' cy='440' r='4'/%3E%3Ccircle cx='100' cy='640' r='3.5'/%3E%3Ccircle cx='250' cy='680' r='4'/%3E%3Ccircle cx='400' cy='620' r='3'/%3E%3Ccircle cx='550' cy='680' r='4.5'/%3E%3Ccircle cx='680' cy='620' r='3'/%3E%3C!-- Connections --%3E%3Cline x1='120' y1='140' x2='280' y2='90'/%3E%3Cline x1='280' y1='90' x2='420' y2='160'/%3E%3Cline x1='420' y1='160' x2='580' y2='100'/%3E%3Cline x1='580' y1='100' x2='700' y2='180'/%3E%3Cline x1='120' y1='140' x2='200' y2='280'/%3E%3Cline x1='200' y1='280' x2='350' y2='340'/%3E%3Cline x1='350' y1='340' x2='500' y2='290'/%3E%3Cline x1='500' y1='290' x2='650' y2='350'/%3E%3Cline x1='420' y1='160' x2='350' y2='340'/%3E%3Cline x1='580' y1='100' x2='500' y2='290'/%3E%3Cline x1='700' y1='180' x2='650' y2='350'/%3E%3Cline x1='80' y1='320' x2='200' y2='280'/%3E%3Cline x1='80' y1='320' x2='150' y2='480'/%3E%3Cline x1='200' y1='280' x2='300' y2='520'/%3E%3Cline x1='350' y1='340' x2='460' y2='460'/%3E%3Cline x1='500' y1='290' x2='600' y2='510'/%3E%3Cline x1='650' y1='350' x2='720' y2='440'/%3E%3Cline x1='150' y1='480' x2='300' y2='520'/%3E%3Cline x1='300' y1='520' x2='460' y2='460'/%3E%3Cline x1='460' y1='460' x2='600' y2='510'/%3E%3Cline x1='600' y1='510' x2='720' y2='440'/%3E%3Cline x1='150' y1='480' x2='100' y2='640'/%3E%3Cline x1='300' y1='520' x2='250' y2='680'/%3E%3Cline x1='460' y1='460' x2='400' y2='620'/%3E%3Cline x1='600' y1='510' x2='550' y2='680'/%3E%3Cline x1='720' y1='440' x2='680' y2='620'/%3E%3Cline x1='100' y1='640' x2='250' y2='680'/%3E%3Cline x1='250' y1='680' x2='400' y2='620'/%3E%3Cline x1='400' y1='620' x2='550' y2='680'/%3E%3Cline x1='550' y1='680' x2='680' y2='620'/%3E%3Cline x1='280' y1='90' x2='200' y2='280'/%3E%3Cline x1='650' y1='350' x2='600' y2='510'/%3E%3C/svg%3E");
    background-size: 100% 100%;
}

.login-error {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    background-color: #fef3f2;
    border: 1px solid #fecdca;
    color: #b42318;
    font-size: 14px;
}

@media (max-width: 768px) {
    .login-page {
        flex-direction: column;
    }
    .login-left {
        flex: 1;
        max-width: 100%;
        padding: 40px 24px;
    }
    .login-right {
        display: none;
    }
    .login-title {
        font-size: 28px;
    }
    .login-headline {
        font-size: 18px;
    }
}

/* === Tab Bar === */
.crm-tab-bar {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
}

.crm-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary, #475467);
    background-color: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.crm-tab.active {
    background-color: var(--brand-purple-500, #7a5af8);
    color: white;
    font-weight: 600;
    border-radius: 30px;
    margin: 0 6px;
}

.crm-tab:hover:not(.active) {
    background-color: var(--bg-page, #f2f4f7);
    border-radius: 30px;
    margin: 0 6px;
}

.crm-tab.disabled {
    color: var(--border-primary, #d0d5dd);
    cursor: not-allowed;
}

/* CRM Setting Begin */
th {
    color: ivory !important;
    background-color: #5f5f5f !important;
    vertical-align: bottom;
}

.td-inactive {
	color: slategray !important;
	font-style: italic !important;
}

.crmCellPadding > :not(caption) > * > * {
    padding: 0.3rem .6rem 0.3rem 0.6rem !important;
    border: none;
    vertical-align: middle;
}

.form-select {
    line-height: 1.5 !important;
    font-size: 1rem !important;
    padding: 0.3rem 2.25rem 0.25rem 0.25rem !important;
}

.crmFormControl {
    padding: 0.3rem 0.25rem 0.25rem 0.25rem !important;
    line-height: 1;
    font-size: 1rem;
    display: inline-block !important;
}

.crmVerticalAlign {
    margin-left: 5px;
    margin-right: 5px;
    margin-top: auto;
    margin-bottom: auto;
}

.crmBox {
    display: flex;
    flex-flow: column;
    height: 100%;
    border-radius:5px 5px 5px 5px;
    background-color:white;
    padding:10px 10px 10px 10px;
}

    .crmBox .crmRow {
    }

        .crmBox .crmRow.crmHeader {
            flex: 0 1 auto;
        }

        .crmBox .crmRow.crmContent {
            flex: 1 0 auto;
        }

        .crmBox .crmRow.crmFooter {
            flex: 0 1 30px;
        }

.crmBoxRadiusTop{
    border-radius: 5px 5px 5px 5px !important;
}
.crmBoxRadiusBottom{
    border-radius: 0px 0px 5px 5px !important;
}

.crm-action-icons {
    padding-left: 0.20rem !important;
    padding-right: 0.20rem !important;
    padding-top: 0rem !important;
    padding-bottom: 0rem !important;
}

.crm-sort-seq {
    appearance: none; /* Removes default styles */
    -webkit-appearance: none; /* For WebKit browsers */
    -moz-appearance: none; /* For Firefox */
    display: inline-block;
    width: 20px !important;
    margin-left: 5px;
    font-size: smaller;
    text-align: center;
    border: none;
    outline: none;
    border-radius: 8px;
}

    .crm-sort-seq:hover {
        cursor: pointer;
    }

.crm-sort-up {
    position: relative;
    top: -2px;
    left: -14px;
    font-size: 18px;
}

.crm-sort-down {
    position: relative;
    top: 8px;
    left: 2px;
    font-size: 18px;
}

.crm-mouse-pointer {
    cursor: pointer;
}

.crm-sort-bold {
    color: cyan;
}

.crm-sort-normal {
    color: lightgray;
}

/* Arrow Styling */
.arrow-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 25px;
}
.arrow-container-lr {
	display: flex;
	align-items: center;
	width: 20px;
}

.arrow {
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    cursor: pointer;
    margin: 2px 0;
}
    .arrow.up {
        border-bottom: 7px solid;
    }
    .arrow.down {
        border-top: 7px solid;
    }
    .arrow:hover {
        filter: brightness(0.8);
    }

.arrow-lr {
	width: 0;
	height: 0;
	border-top: 7px solid transparent;
	border-bottom: 7px solid transparent;
	cursor: pointer;
	margin: 2px;
}
	.arrow-lr.left {
		border-right: 7px solid;
	}
	.arrow-lr.right {
		border-left: 7px solid;
	}
	.arrow-lr:hover {
		filter: brightness(0.8);
	}

.crm-arrowup-normal{
    border-bottom-color: var(--arrow-color, lightgray) !important;
}
.crm-arrowup-bold {
    border-bottom-color: var(--arrow-color, cyan) !important;
}
.crm-arrowdown-normal {
    border-top-color: var(--arrow-color, lightgray) !important;
}
.crm-arrowdown-bold {
    border-top-color: var(--arrow-color, cyan) !important;
}

.crm-arrowleft-normal {
	border-right-color: var(--arrow-color, lightgray) !important;
}
.crm-arrowleft-bold {
	border-right-color: var(--arrow-color, cyan) !important;
}
.crm-arrowright-normal {
	border-left-color: var(--arrow-color, lightgray) !important;
}
.crm-arrowright-bold {
	border-left-color: var(--arrow-color, cyan) !important;
}

.crm-color-square {
    width: 20px;
    height: 20px;
    border-radius: 5px;
}

.crm-sticky-hdr {
    position: sticky;
    top: 0;
    z-index: 1000;
}
.crm-thead-bottom {
    vertical-align: bottom !important;
}

thead tr th {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    vertical-align: bottom;
}
tbody tr td {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

#divEditForm table {
    margin-top: 15px;
}

    #divEditForm table tbody tr {
        height: 30px;
    }

        #divEditForm table tbody tr th {
            font-size: 0.875rem;
            padding: 0.5rem 0.5rem;
            color: inherit !important;
            background-color: inherit !important;
            vertical-align: middle;
            text-align: right;
        }

#divEditFormNew table {
    margin-top: 0px;
}

    #divEditFormNew table tbody tr {
        height: 30px;
    }

        #divEditFormNew table tbody tr th {
            font-size: 0.875rem;
            padding: 0.5rem 0.5rem;
            color: inherit !important;
            background-color: inherit !important;
            vertical-align: middle;
            text-align: right;
        }

.alert {
    padding: 0.25rem 0.5rem;
}

.crm-noborder-button {
    border: none !important;
    background: none !important;
    cursor: pointer;
}
.crm-noborder-button:focus, .crm-noborder-button:active {
    outline: none !important;
	box-shadow: none !important;
}

.crm-noborder-button-bk {
    border: none !important;
}

    .crm-noborder-button-bk:focus, .crm-noborder-button-bk:active {
        outline: none !important;
        box-shadow: none !important;
    }

.crm-td-stats {
    padding-top: 0.0rem;
    padding-bottom: 0.0rem;
    padding-left: 0rem;
    padding-right: 0.5rem;
    vertical-align: top;
}
/* CRM Setting End*/

/* Modal Settings for cards */
.modal-dialog {
	max-width: 1000px !important;
}


.modal-header {
	background-color: #f2f2f2;
	padding-top: 5px !important;
	padding-bottom: 5px !important;
}

.dashboard-card-title {
	display: flex;
	justify-content: space-between;
	align-items: center; /* Align items vertically */
	background-color: #f2f2f2;
	font-size: 0.9rem;
	width: 100%;
	--bs-card-cap-padding-y: 0.25rem !important;
}

.crm-left {
	text-align: left;
}

.crm-right {
	text-align: right;
}

/* Required-field label marker — historically tinted brown by Alex.
   We don't differentiate required labels by color anymore; validation
   messages on submit are the source of truth. Class kept as a no-op so
   markup using it isn't broken. */
.crm-required {
	/* no color override */
}

.clickable-bar-chart .apexcharts-yaxis text {
	cursor: pointer;
}
.clickable-bar-chart .apexcharts-bar-series .apexcharts-series path,
.clickable-bar-chart .apexcharts-bar-series .apexcharts-series rect {
	cursor: pointer;
}
/* ── Help Panel ─────────────────────────────────────────────────────────── */

.crm-help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1040;
}

.crm-help-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(75vw, 700px);
    height: 100vh;
    background: #fff;
    border-left: 1px solid var(--border-primary, #d0d5dd);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.10);
    z-index: 1050;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .crm-help-panel { width: 100vw; }
}

.crm-help-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-secondary, #e4e7ec);
    flex-shrink: 0;
}

.crm-help-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #101828);
}

.crm-help-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ── Help prose typography ──────────────────────────────────────────────── */

.help-prose {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #374151;
}

.help-prose h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary, #101828);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--brand-purple-200, #d9d6fe);
}

.help-prose h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #101828);
    margin-top: 1.5rem;
    margin-bottom: 0.4rem;
}

.help-prose h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary, #344054);
    margin-top: 1.25rem;
    margin-bottom: 0.35rem;
}

.help-prose p,
.help-prose ul,
.help-prose ol {
    margin-bottom: 0.75rem;
}

.help-prose ul,
.help-prose ol {
    padding-left: 1.4rem;
}

.help-prose li {
    margin-bottom: 0.25rem;
}

.help-prose strong {
    font-weight: 600;
    color: var(--text-primary, #101828);
}

.help-prose code {
    background: #f3f4f6;
    border-radius: 3px;
    padding: 0.1em 0.35em;
    font-size: 0.85em;
    color: var(--brand-purple-500, #7a5af8);
}

.help-prose blockquote {
    border-left: 3px solid var(--brand-purple-200, #d9d6fe);
    margin: 0 0 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--brand-purple-50, #ece6ff);
    color: var(--text-secondary, #344054);
    border-radius: 0 0.25rem 0.25rem 0;
}

.help-prose table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.help-prose th {
    background: #f3f4f6;
    padding: 0.4rem 0.6rem;
    text-align: left;
    border: 1px solid var(--border-secondary, #e4e7ec);
    font-weight: 600;
}

.help-prose td {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-secondary, #e4e7ec);
}

.help-prose a {
    color: var(--brand-purple-500, #7a5af8);
}

.help-prose a:hover {
    color: var(--brand-purple-700, #6938ef);
}

/* ── Slide-Out Panel ────────────────────────────────────────────────────── */
/* Generic right-side slide-out form panel (e.g. New Contact, Edit Engagement).
   Wider than the filter panel (600px vs 380px) to accommodate full forms. */

.crm-slideout-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 21, 0.3);
    z-index: 1040;
}

.crm-slideout-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 600px;
    max-width: 100vw;
    height: 100vh;
    /* Light gray panel bg per Figma — content (white inputs / picker triggers)
       provides contrast directly against the panel without needing inner
       section containers. */
    background-color: #f7f9fc;
    box-shadow: -4px 0 24px rgba(16, 24, 40, 0.12);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.crm-slideout-panel-wide {
    width: 760px;
}

@media (max-width: 768px) {
    .crm-slideout-panel,
    .crm-slideout-panel-wide {
        width: 100vw;
    }
}

.crm-slideout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-secondary, #e4e7ec);
    flex-shrink: 0;
    gap: 12px;
}

.crm-slideout-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.crm-slideout-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary, #101828);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-slideout-close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--text-tertiary, #475467);
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}

.crm-slideout-close:hover {
    background-color: var(--bg-page, #f2f4f7);
    color: var(--text-primary, #101828);
}

.crm-slideout-close svg {
    width: 20px;
    height: 20px;
}

.crm-slideout-undo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: none;
    border: none;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary, #475467);
    cursor: pointer;
    flex-shrink: 0;
}

.crm-slideout-undo:hover {
    background-color: var(--bg-page, #f2f4f7);
    color: var(--text-primary, #101828);
}

.crm-slideout-undo svg {
    width: 16px;
    height: 16px;
}

.crm-slideout-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.crm-slideout-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 24px;
}

.crm-slideout-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-secondary, #e4e7ec);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Primary save/apply button used inside slide-out footers */
.crm-slideout-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background-color: var(--brand-purple-500, #7a5af8);
    color: white;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.crm-slideout-btn-primary:hover {
    background-color: #6941c6;
}

.crm-slideout-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.crm-slideout-btn-primary svg {
    width: 18px;
    height: 18px;
}

/* Secondary button (Cancel) — same shape, neutral colors */
.crm-slideout-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background-color: var(--bg-primary, #ffffff);
    color: var(--text-secondary, #344054);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    border: 1px solid var(--border-primary, #d0d5dd);
    border-radius: 8px;
    cursor: pointer;
}

.crm-slideout-btn-secondary:hover {
    background-color: var(--bg-page, #f2f4f7);
}

/* ── Slide-Out form: vertical layout overrides ────────────────────────────
   When a Bootstrap-grid form is rendered inside a slide-out body, stack the
   label-and-field rows vertically and use full panel width. */

.crm-slideout-body .crm-page,
.crm-slideout-body .crm-slideout-content {
    padding: 0;
}

.crm-slideout-body .row.row-padding {
    flex-direction: column;
    align-items: stretch;
    margin: 0 0 12px 0;
}

.crm-slideout-body .row.row-padding > .fit-label,
.crm-slideout-body .row.row-padding > .fit-label-195 {
    width: 100% !important;
    margin-bottom: 4px;
    font-weight: 500;
    color: var(--text-secondary, #344054);
}

.crm-slideout-body .row.row-padding > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100% !important;
}

/* Compact alert row inside slide-outs */
.crm-slideout-body .alert {
    width: 100% !important;
    margin: 0 0 12px 0 !important;
}

/* ── Engagement view-mode field cards ──────────────────────────────────────
   Used inside gray (#f7f9fc) outer sections to give each labelled field a
   white-bg rounded card per the Figma view-engagement design. */

.crm-view-cell {
    padding: 12px 16px;
    border-right: 1px solid var(--border-secondary, #e4e7ec);
}

.crm-view-cell:last-child {
    border-right: none;
}

.crm-view-cell-label {
    color: var(--text-tertiary, #475467);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
}

.crm-view-cell-value {
    color: var(--text-primary, #101828);
    font-size: 22px;
    font-weight: 600;
}

.crm-view-field {
    background-color: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-secondary, #e4e7ec);
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 500;
    color: var(--text-primary, #101828);
    min-height: 44px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

/* ── Picker Panel ───────────────────────────────────────────────────────── */
/* Used inside SlideOutPanel-shaped picker; chips show currently selected
   items, link buttons for Select All / Clear, and a trigger button on the
   parent form opens the panel. */

.crm-picker-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.crm-picker-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 4px 4px 10px;
    background-color: var(--brand-purple-50, #ece6ff);
    color: var(--brand-purple-700, #6938ef);
    font-size: 13px;
    font-weight: 500;
    border-radius: 999px;
}

.crm-picker-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 999px;
    color: var(--brand-purple-700, #6938ef);
    cursor: pointer;
}

.crm-picker-chip-remove:hover {
    background-color: rgba(105, 56, 239, 0.12);
}

.crm-link-btn {
    background: none;
    border: none;
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--brand-purple-500, #7a5af8);
    cursor: pointer;
}

.crm-link-btn:hover {
    color: var(--brand-purple-700, #6938ef);
    text-decoration: underline;
}

/* Trigger button used in edit forms next to a labelled picker field.
   Looks like a button on the right edge of the field with a chevron. */
.crm-picker-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 5px 10px;
    background-color: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-primary, #d0d5dd);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary, #101828);
    cursor: pointer;
    text-align: left;
    gap: 8px;
}

.crm-picker-trigger:hover {
    border-color: var(--brand-purple-500, #7a5af8);
}

.crm-picker-trigger.is-empty {
    color: var(--text-tertiary, #475467);
}

.crm-picker-trigger svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--text-tertiary, #475467);
}

/* Row of currently-selected items shown beneath a picker trigger button. */
.crm-picker-selected-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 10px;
    background-color: var(--bg-page, #f2f4f7);
    border-radius: 8px;
}

/* Inline "remove this chip" button used on edit-mode chips. Purple ×, no
   border or background — pairs with .crm-chip-view chips. */
.crm-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    margin-left: 4px;
    background: transparent !important;
    border: none !important;
    color: var(--brand-purple-500, #7a5af8) !important;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
}

.crm-chip-remove:hover {
    background-color: rgba(122, 90, 248, 0.12) !important;
    color: var(--brand-purple-700, #6938ef) !important;
}

/* Inline "edit this related entity" button on chips that drill into a child
   record (e.g. edit a District Contact from inside the Contacts chip). */
.crm-chip-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    margin-right: 4px;
    background: transparent !important;
    border: none !important;
    color: var(--brand-purple-500, #7a5af8) !important;
    cursor: pointer;
    border-radius: 4px;
}

.crm-chip-edit:hover {
    background-color: rgba(122, 90, 248, 0.12) !important;
    color: var(--brand-purple-700, #6938ef) !important;
}

.crm-chip-edit svg {
    width: 14px;
    height: 14px;
}

/* Organizer Time: distinct purple-tinted affordance for the optional
   travel/prep-time entry attached to Duration. The badge (view mode) and
   panel (edit mode) share the purple accent so it reads as "organizer's own
   time", not the contact-facing Duration figure next to it. */
.crm-organizer-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background-color: var(--brand-purple-50, #ece6ff);
    border: 1px solid var(--brand-purple-200, #d9d6fe);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--brand-purple-700, #6938ef);
}

.crm-organizer-time-panel {
    margin-top: 8px;
    padding: 8px 10px;
    background-color: var(--brand-purple-50, #ece6ff);
    border: 1px solid var(--brand-purple-200, #d9d6fe);
    border-radius: 8px;
}

.crm-organizer-time-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--brand-purple-700, #6938ef);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.crm-organizer-time-panel-header span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Reserves real row height for the Organizer Time badge in a table cell.
   The badge itself is position:absolute (so it doesn't disturb the cell's
   own vertical centering), which means it visually overflows past the
   cell's box unless something else accounts for that space in normal flow.
   Without this, a table wrapper with overflow-y:auto gains a phantom
   scrollbar sized to the overflow even when every row already fits. */
.crm-table tbody td.crm-organizer-time-cell {
    padding-top: 28px !important;
    padding-bottom: 28px !important;
}

/* ── Engagement view-mode: section title + matched-height pairs ─────────── */

.crm-view-section-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #101828);
    margin-bottom: 16px;
}

/* Section header with title on the left and an action button floated right
   (used for the Actions section on the engagement view page). */
.crm-view-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

/* Wraps a label + crm-view-field pair so they stack vertically and the field
   can stretch to match its sibling's height when placed in a grid row. */
.crm-view-pair {
    display: flex;
    flex-direction: column;
}

/* Danger variant of the circular table action button (used for delete in the
   engagement actions table). Red bg, white icon. */
.crm-table-chevron-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #ffffff;
}

.crm-table-chevron-danger:hover {
    background-color: #b02a37;
    border-color: #b02a37;
    color: #ffffff;
}

/* Plain-text value display (no white-bg wrapper) for view-mode fields where
   the design shows the value directly on the gray section background.
   Works for single text values, chip rows, links, and multi-line text.
   Used for Type, Category, Primary/Secondary Driver, Contacts, Notes,
   Topics, and Doc Link. */
.crm-view-value-plain {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-primary, #101828);
    padding: 8px 0 4px 0;
    min-height: 36px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

/* View-mode chip variant: a soft gray bg (a step darker than the container
   bg #f7f9fc, so the chips read as data — not form inputs) plus a visible
   border. Apply alongside the existing tag-span styling. */
.crm-chip-view {
    background-color: #e9ecef !important;
    border: 1px solid var(--border-primary, #d0d5dd) !important;
}

/* ── Stat chips ────────────────────────────────────────────────────────────
   Compact info pills used to display running summary numbers next to a
   search bar (row count, primary metric, financial total). Semantic color
   variants — neutral for metadata, purple for primary metric, success for
   financial totals. Not interactive. */

.crm-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 16px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.4;
    border: 1px solid transparent;
}

.crm-stat-chip-neutral {
    background-color: var(--bg-page, #f2f4f7);
    border-color: var(--border-secondary, #e4e7ec);
    color: var(--text-tertiary, #475467);
}

.crm-stat-chip-purple {
    background-color: var(--brand-purple-50, #ece6ff);
    border-color: var(--brand-purple-200, #d9d6fe);
    color: var(--brand-purple-700, #6938ef);
}

.crm-stat-chip-success {
    background-color: #ecfdf3;
    border-color: #abefc6;
    color: #027a48;
}

/* ── Scope chip ─────────────────────────────────────────────────────────────
   Large, prominent purple pill placed next to a page title to communicate
   the current filter scope (e.g. ESD · District on the Executive Dashboard).
   Solid brand-purple bg with white text — reads at a glance so users always
   know which slice of data the page is showing. */

.crm-scope-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background-color: var(--brand-purple-500, #7a5af8);
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.crm-scope-chip svg {
    width: 16px;
    height: 16px;
    color: #ffffff;
}

.crm-scope-chip-sep {
    opacity: 0.7;
    font-weight: 400;
    margin: 0 -2px;
}

/* ── State toggle (In Person / Virtual) ────────────────────────────────────
   Pair of clickable labels flanking a switch — the active label is full
   weight/color, the unselected label is muted. Used in the engagement edit
   form. */

.crm-state-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0 4px 0;
    flex-wrap: wrap;
}

.crm-state-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #101828);
    cursor: pointer;
    user-select: none;
    margin: 0;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.crm-state-label.is-muted {
    color: var(--text-tertiary, #475467);
    font-weight: 500;
    opacity: 0.55;
}

/* ── Form-switch focus ring ──────────────────────────────────────────────
   Use the brand purple instead of Bootstrap blue for the focus shadow on
   all form-check inputs. Default unchecked / checked behavior stays as-is
   (white track + neutral knob unchecked, purple track + white knob checked
   from the .form-check-input:checked rule). */

.form-check-input:focus {
    box-shadow: 0 0 0 2px rgba(122, 90, 248, 0.18) !important;
    border-color: var(--brand-purple-500, #7a5af8) !important;
}

/* ── Inline-aligned switch wrapper ───────────────────────────────────────
   Used when a form-switch sits inside a flex row alongside text labels.
   Strips Bootstrap's vertical-baseline margin so the toggle vertically
   centers with adjacent text. Color behavior unchanged — toggles still
   show standard purple-on / neutral-off states. */

.crm-switch-inline {
    display: inline-flex !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: auto !important;
}

.crm-switch-inline .form-check-input {
    margin: 0 !important;
    float: none !important;
}

/* ── Number input without spinner arrows ────────────────────────────────
   For <InputNumber> fields that hold an id/code rather than a quantity
   (e.g. Ticket Id), where the browser's up/down arrows make no sense. */

.crm-no-spinner::-webkit-outer-spin-button,
.crm-no-spinner::-webkit-inner-spin-button {
    -webkit-appearance: none;   /* Chrome, Edge, Safari */
    margin: 0;
}

.crm-no-spinner {
    -moz-appearance: textfield; /* Firefox */
    appearance: textfield;
}

/* ── State toggle (In Person ⬤ Virtual) ──────────────────────────────────
   For paired-label controls where state is conveyed by the muted/active
   styling of the flanking labels, NOT by toggle color. The toggle stays
   solid purple in both checked and unchecked states; only knob position
   changes. Use only on those paired-label controls. */

.crm-state-switch {
    display: inline-flex !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: auto !important;
}

.crm-state-switch .form-check-input {
    margin: 0 !important;
    float: none !important;
    background-color: var(--brand-purple-500, #7a5af8) !important;
    border-color: var(--brand-purple-500, #7a5af8) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e") !important;
}

/* Read-only state switch (View mode): Bootstrap drops disabled inputs to
   opacity 0.5 which washes out the brand purple. Keep full color since this
   toggle is a status indicator, not an interactive control. */
.crm-state-switch .form-check-input:disabled {
    opacity: 1 !important;
    cursor: default;
}

/* Slide-outs: legacy Bootstrap container/row/card wrappers (left over in
   form components like ModalDistrictContact) come with their own white bg
   and border which fight the panel's gray bg. Neutralize them inside any
   slide-out body so content sits flat on the panel. */
.crm-slideout-body .card,
.crm-slideout-body .card-body {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.crm-slideout-body .container,
.crm-slideout-body .row,
.crm-slideout-body [class*="col-"] {
    background-color: transparent !important;
}

/* ── Filter chips (toggle-button style) ───────────────────────────────────
   Pill-shaped on/off filter buttons used in list-page filter rows
   (e.g. Users page: Active Users / Inactive Users / Admin / Service Admin / User).
   Match the 30px radius of `.crm-btn` so they look like a button family.
   Each chip wraps a checkbox + label; clicking toggles `.is-active`. */

.crm-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--border-secondary, #e4e7ec);
    border-radius: 30px;
    background-color: #ffffff;
    color: var(--text-primary, #101828);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    user-select: none;
}

.crm-filter-chip:hover {
    background-color: #f5f3ff;
}

.crm-filter-chip.is-active {
    background-color: #ebe7fe;
    border-color: #d9d6fe;
    color: #512be7;
}

.crm-filter-chip .form-check-input {
    margin: 0 !important;
    float: none !important;
    cursor: pointer;
}

.crm-filter-chip-count {
    font-weight: 500;
    color: var(--text-tertiary, #475467);
    margin-left: 4px;
}

/* ── Avatar circle (table cell) ───────────────────────────────────────────
   Light purple circle with dark purple border + initials. Used in user
   list and similar people-row tables. Provides a visual anchor for the
   name/email column. */

.crm-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--brand-purple-50, #ece6ff);
    border: 1.5px solid var(--brand-purple-500, #7a5af8);
    color: var(--brand-purple-700, #6938ef);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
    text-transform: uppercase;
}

.crm-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crm-user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.crm-user-cell-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.crm-user-cell-name {
    font-weight: 600;
    color: var(--text-primary, #101828);
    line-height: 1.3;
}

.crm-user-cell-email {
    font-size: 13px;
    color: var(--text-tertiary, #475467);
    line-height: 1.3;
}

/* ── Role / category badges ───────────────────────────────────────────────
   Small light-colored chips for showing a role or category in a table cell.
   Smaller radius (8px) than buttons — these are status indicators, not
   interactive controls. Variants pick a color family per role. */

.crm-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}

.crm-role-badge.is-admin {
    background-color: #fef7c3;
    color: #854708;
    border-color: #fedf89;
}

.crm-role-badge.is-super-admin {
    background-color: #fce4f6;
    color: #9e165f;
    border-color: #fac6e8;
}

.crm-role-badge.is-service-admin {
    background-color: #ece6ff;
    color: #6938ef;
    border-color: #d9d6fe;
}

.crm-role-badge.is-user {
    background-color: #dcfae6;
    color: #027a48;
    border-color: #abefc6;
}

.crm-role-badge.is-default {
    background-color: #f2f4f7;
    color: var(--text-secondary, #344054);
    border-color: var(--border-secondary, #e4e7ec);
}
