:root {
	/* ----- Color Palette ----- */

	/* Primary */
	--cynk-pink: #e26274;

	/* Secondary / Accent */
	--cynk-blue-link: #4682B4; /* Steel Blue for links */
	--cynk-dark-accent: #393F73; /* Used for file drop highlight, progress */

	/* Status Indicators (Backgrounds from PDF) */
	--cynk-status-green-bg: #A8D08D;
	--cynk-status-yellow-bg: #FFD966;
	--cynk-status-gray-bg: #D9D9D9;

	/* Grays */
	--cynk-gray-text-dark: #343a40;
	--cynk-gray-medium: #adb5bd; 	/* text-grayer */
	--cynk-gray-text-light: #aaa; 	/* file drop text */
	--cynk-gray-border: #ccc;		/* file drop border */

	/* Dark Mode Specific (Optional - can be defined within dark mode scope too) */
	--cynk-dm-text: #e8e8e8;
	--cynk-dm-nav-link: #cecece;
	--cynk-dm-nav-bg-active: #292c30;
}

.text-bold {
	font-weight: bold;
}

.block-title-icon {
	flex: 0 0 auto;
	display: inline-block;
	margin-right: 0.625rem;
	min-width: 1.25rem;
	font-size: 1rem;
	text-align: center;
}

.select2-dropdown {
	z-index: 1051; /* Bootstrap modals usually have z-index around 1050 */
}

.flatpickr-calendar {
	z-index: 1060 !important; /* Adjust this value based on your specific needs */
}

label {
	cursor: pointer;
}

/* Overlay CSS */
.overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.8); /* Black background with opacity */
	z-index: 1050; /* High z-index to cover everything */
	display: flex;
	justify-content: center;
	align-items: center;
}

.overlay-content {
	text-align: center;
	color: white;
	max-width: 500px;
	padding: 20px;
}

.inline-flex {
	display: inline-flex;
}

.dz-details {
	cursor: pointer !important;
}

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

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

.text-justify {
	text-align: justify;
}

.tnum {
	font-feature-settings: 'tnum';
}


.tooltip-inner {
	max-width: 300px; /* Adjust the width as needed */
}

.btn-xs, .btn-group-xs > .btn {
	--bs-btn-padding-y: 0.05rem;
	--bs-btn-padding-x: 0.3rem;
	--bs-btn-font-size: 0.75rem;
	--bs-btn-border-radius: var(--bs-border-radius-sm);
}

.cursor-default {
	cursor: default;
}

.cursor-pointer {
	cursor: pointer;
}

.cursor-move {
	cursor: move;
}

.img-responsive {
	max-height: 100%;
	max-width: 100%;
	width: auto;
	height: auto;
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.file-drop {
	border: 2px dashed var(--cynk-gray-border);
	border-radius: 0.25rem;
	height: 50px;
	line-height: 50px;
	cursor: pointer;
	text-align: center;
	color: var(--cynk-gray-text-light);
}

.file-drop.highlight {
	border-color: var(--cynk-dark-accent);
	color: var(--cynk-dark-accent);
}

.file-progress {
	position: relative;
	width: 100%;
	height: 20px;
	margin: 10px 0;
	display: none;
}

.file-progress .bar {
	position: absolute;
	background-color: var(--cynk-dark-accent);
	height: 20px;
	width: 0;
	-webkit-border-radius: 2px;
	-moz-border-radius: 2px;
	border-radius: 2px;
}

.file-progress .text {
	position: absolute;
	width: 100%;
	line-height: 20px;
	text-align: center;
	color: white;
}

.fa-fw {
	width: 1.5em;
}

.swedishSSN-warning { /* .invalid-feedback */
	width: 100%;
	margin-top: 0.375rem;
	font-size: 0.875rem;
	color: var(--bs-form-invalid-color);
}

.dark-mode .card-text {
	color: var(--cynk-dm-text);
}

.nav-tabs .nav-link {
	color: var(--cynk-gray-text-dark);
}

.nav-tabs .nav-link.active {
	color: var(--cynk-pink);
}

.dark-mode .nav-tabs .nav-link {
	color: var(--cynk-dm-nav-link);
}

.dark-mode .nav-tabs .nav-link.active {
	color: var(--cynk-pink);
	background-color: var(--cynk-dm-nav-bg-active);
}

.nav-main-link.active, .nav-main-link:hover {
	font-weight: 700;
}

.nav-main-submenu .nav-main-link.active, .nav-main-submenu .nav-main-link:hover {
	font-weight: 700;
}

.ai-data {
	font-size: 0.8rem;
	color: var(--cynk-pink);
}

.ai-data.aiData {
	cursor: pointer;
}

.ai-data:empty {
	display: none;
}

.ai-data::before {
	content: "AI";
	font-size: smaller;
	margin-right: 0.2rem;
	font-weight: bold;
	color: var(--cynk-gray-text-dark);
}

.text-grayer {
	color: var(--cynk-gray-medium) !important;
}

.text-light-gray {
    --bs-text-opacity: 1;
    color: rgba(108, 117, 125, 0.4) !important; /* Bootstrap secondary color with 40% opacity */
}

.bg-light-gray {
    --bs-bg-opacity: 1;
    background-color: rgba(248, 249, 250, 0.8) !important; /* Light gray background with good contrast */
}

/* Hide row-details by default */
.row-details {
	display: none;
	font-weight: 500;
	max-width: 400px;
	white-space: wrap;
	text-align:left;
}

/* When .show-details is added to the tr, show its .row-details elements */
.show-details .row-details {
	display: block;
}

/* Move the Select2 clear (x) button to the right side */
.select2-container--default .select2-selection--single .select2-selection__clear {
    right: 32px; /* or adjust as needed for your theme */
    left: auto;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    /* Optional: make it more visually aligned */
    padding: 0 6px;
}
.select2-container--default .select2-selection--single {
    position: relative;
    padding-right: 2.5em !important; /* Make room for the clear button */
}

/* Investigation Flex Layout System - Apply at all screen sizes */
/* === Simplified Investigation Column Layout === */
@media (min-width: 1024px) {
.investigation-flex-container {
	display: flex;
		flex-wrap: nowrap;
	gap: 1rem;
	width: 100%;
	}
	
	.investigation-flex-item.status {
		flex: 0 0 80px;
	}
	
	.investigation-flex-item.internal-note {
        flex: 1 1 0;
        max-width: 45%; /* Prevent it from swallowing all space */
    }

    .investigation-flex-item.note {
        flex: 1 1 0;
        min-width: 300px; /* Reserve more space */
    }

    .investigation-flex-item.documents {
        flex: 0 1 220px; /* flex-basis 220px */
        min-width: 150px;
        max-width: 220px; /* cap at 220px */
    }
}

/* Mobile / tablet */
@media (max-width: 1023.98px) {
	.investigation-flex-container {
		display: flex;
		flex-direction: column;
		gap: 0.5rem;
		width: 100%;
	}
	
	.investigation-flex-item {
		width: 100%;
	}
}

/* === Investigation Card Collapse Styles (re-added minimal) === */
.investigation-card {
	transition: all 0.3s ease;
	border-left: 4px solid transparent;
}

.investigation-card.collapsed {
	border-left-color: #6c757d;
	background-color: #f8f9fa;
	cursor: pointer;
}

.investigation-card:not(.collapsed) {
	border-left-color: #0d6efd;
}

/* Show/hide headers based on collapsed state */
.investigation-card.collapsed .collapsed-header { display: block !important; }
.investigation-card.collapsed .expanded-header { display: none !important; }
.investigation-card:not(.collapsed) .collapsed-header { display: none !important; }
.investigation-card:not(.collapsed) .expanded-header { display: block !important; }

/* Collapse / Expand button styling */
.collapse-btn, .expand-btn {
	border: none;
	background: transparent;
	cursor: pointer;
	transition: transform 0.2s ease;
}
.collapse-btn:hover, .expand-btn:hover { transform: scale(1.1); }

/* === Investigation Header Responsive (<1024px) === */
@media (max-width: 1023.98px) {
  /* Stack header rows */
  .investigation-card .card-header.expanded-header .d-flex {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem;
  }
  .investigation-card .card-header.expanded-header .flex-grow-1 {
    flex: none;
  }
  .investigation-card .card-header.expanded-header .flex-shrink-0 {
    flex: none;
    margin-left: 0 !important;
    margin-top: 0.5rem;
  }
  /* Wrap buttons */
  .investigation-card .card-header .flex-shrink-0 .d-flex {
    flex-wrap: wrap;
    gap: 0.5rem !important;
    justify-content: flex-start;
  }
  /* Hide less-important bits */
  .investigation-card .queue-status-display,
  .investigation-card .investigation-last-updated {
    display: none !important;
  }
  /* Smaller buttons */
  .investigation-card .card-header .btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
}

/* Sidebar company name truncation */
.sidebar-company-name {
    max-width: 200px;
}

/* Width utility classes for sticky header truncation */
.truncate-60 { max-width: 60px; }
.truncate-80 { max-width: 80px; }
.truncate-140 { max-width: 140px; }
.truncate-160 { max-width: 160px; }

/* Investigation count badge text color override */
.investigation-counts-badge .text-success,
.investigation-counts-badge .text-danger,
.investigation-counts-badge .text-default { color: #fff !important; }

/* Highlighted investigation card */
.investigation-card.investigation-highlighted {
    background-color: #e3f2fd !important;
    border: 2px solid #007bff !important;
    box-shadow: 0 4px 12px rgba(0,123,255,0.25) !important;
    transition: all 0.3s ease;
}

/* Investigations layout (sidebar + main) */
.investigations-layout { display:flex; gap:1rem; margin-bottom:1rem; }
.investigations-sidebar { flex:0 0 260px; min-width:260px; }
.investigations-main-content { flex:1 1 auto; min-width:0; }

@media (max-width: 991.98px) {
  .investigations-layout { flex-direction: column; }
  .investigations-sidebar { flex:none; min-width:auto; margin-bottom:1rem; }
}
@media (max-width:768px){
  .investigations-sidebar{ flex:0 0 240px; }
}


.copyText { cursor:pointer; }
.copyText:hover { text-decoration: underline; }

/* Sticky Client Header sizing & positioning */
#sticky-client-header{
    height:45px;
    background:#fff;
    border-bottom:1px solid #dee2e6;
    box-shadow:0 2px 4px rgba(0,0,0,.1);
}
@media(min-width:992px){
  #sticky-client-header{ left:250px!important; right:0!important; width:calc(100% - 250px)!important; }
}
@media(min-width:1920px){
  #sticky-client-header{ left:280px!important; width:calc(100% - 280px)!important; }
}
@media(min-width:2560px){
  #sticky-client-header{ left:300px!important; width:calc(100% - 300px)!important; }
}
@media(max-width:991px){
  #sticky-client-header{ left:0!important; right:0!important; width:100%!important; }
}
#sticky-client-header .bg-white{ width:100%; min-height:45px; }

/* spacer to avoid layout shift */
.sticky-header-spacer{ height:0; transition:height .2s ease; }
.sticky-header-spacer.active{ height:68px; }

.insurance-notes-popover {
	cursor: pointer;
}

/* Insurance notes popover styling */
.popover.info-tooltip {
	--bs-popover-max-width: 520px; /* wider popover */
	--bs-popover-bg: #f8f9fb; /* subtle light tint to stand out */
	--bs-popover-border-color: #dfe3e8; /* soft but visible border */
	--bs-popover-box-shadow: 0 12px 34px rgba(0,0,0,.14), 0 6px 14px rgba(0,0,0,.10);
	--bs-popover-arrow-color: #f8f9fb;
	--bs-popover-arrow-border: #dfe3e8;
	border: 1px solid var(--bs-popover-border-color);
	cursor: default; /* normal cursor inside */
	position: relative; /* for accent bar */
}
/* Left accent bar for better separation */
.popover.info-tooltip::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 4px;
	background: var(--cynk-pink);
	border-top-left-radius: .5rem;
	border-bottom-left-radius: .5rem;
	opacity: 0.9;
}
.popover.info-tooltip .popover-body {
	color: var(--cynk-gray-text-dark);
	font-size: 0.95rem;
	cursor: default; /* ensure default cursor over content */
}

/* === Softer badge variants (lighter without changing theme colors) === */
.badge-soft { border: 1px solid transparent; }
.badge-soft-info {
    --_rgb: var(--bs-info-rgb, 13,110,253);
    background-color: rgba(var(--_rgb), .15) !important;
    color: rgb(var(--_rgb)) !important;
    border-color: rgba(var(--_rgb), .30) !important;
}
.badge-soft-success {
    --_rgb: var(--bs-success-rgb, 25,135,84);
    background-color: rgba(var(--_rgb), .18) !important;
    color: rgb(var(--_rgb)) !important;
    border-color: rgba(var(--_rgb), .32) !important;
}
.badge-soft-danger {
    --_rgb: var(--bs-danger-rgb, 220,53,69);
    background-color: rgba(var(--_rgb), .18) !important;
    color: rgb(var(--_rgb)) !important;
    border-color: rgba(var(--_rgb), .32) !important;
}
.badge-soft-warning {
    --_rgb: var(--bs-warning-rgb, 255,193,7);
    background-color: rgba(var(--_rgb), .18) !important;
    color: rgb(var(--_rgb)) !important;
    border-color: rgba(var(--_rgb), .32) !important;
}

/* === Intake Errand Quick Actions Flexbox === */
.intake-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.quick-action-item {
    flex: 1 1 auto;
    min-width: 180px;
    max-width: 220px;
}

/* Desktop: Keep all on one line if space allows */
@media (min-width: 1200px) {
    .quick-action-item {
        flex: 1 1 0;
        min-width: 0;
    }
}

/* Tablet: Allow 2-3 per row */
@media (min-width: 768px) and (max-width: 1199px) {
    .quick-action-item {
        flex: 1 1 calc(33.333% - 1rem);
        min-width: 200px;
    }
}

/* Mobile: Stack vertically */
@media (max-width: 767px) {
    .quick-action-item {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* === Intake Errand Right Panel Styles === */
#intake-right-panel {
    transition: all 0.3s ease-in-out;
}

#intake-left-content {
    transition: all 0.3s ease-in-out;
}

.sticky-right-panel {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.right-panel-pdf-link {
    cursor: pointer;
    color: #0d6efd;
}

.right-panel-pdf-link:hover {
    text-decoration: underline;
}

/* Mobile: Hide right panel toggle on very small screens */
@media (max-width: 768px) {
    #toggle-right-panel {
        display: none !important;
    }
}

/* Tablet: Full width panel when open */
@media (min-width: 769px) and (max-width: 1199px) {
    #intake-right-panel:not(.d-none) ~ #intake-left-content {
        width: 50% !important;
    }
    #intake-right-panel:not(.d-none) {
        width: 50% !important;
    }
}