/* Core Variables */
:root {
	--primary-color: #0d6efd;
	--primary-hover: #0b5ed7;
	--secondary-color: #6c757d;
	--secondary-hover: #5c636a;
	--success-color: #198754;
	--danger-color: #dc3545;
	--danger-hover: #bb2d3b;
	--light-color: #f8f9fa;
	--dark-color: #212529;
	--border-color: #dee2e6;
	--border-radius: 0.375rem;
}

/* Reset and Base */
*,
*::before,
*::after {
	box-sizing: border-box;
}
body {
	margin: 0;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--dark-color);
	overflow-x: hidden;
}

/* Layout */
.container-fluid {
	width: 100%;
	padding-right: 0.75rem;
	padding-left: 0.75rem;
	margin-right: auto;
	margin-left: auto;
}
@media (max-width: 768px) {
	.container-fluid {
		padding-right: 0px;
		padding-left: 0px;
	}
}
.row {
	display: flex;
	flex-wrap: wrap;
	margin-right: -0.75rem;
	margin-left: -0.75rem;
}
.row.g-2 {
	gap: 0.5rem;
	margin-right: 0;
	margin-left: 0;
}
.row.g-2 > * {
	padding-right: 0;
	padding-left: 0;
}
.align-items-end {
	align-items: flex-end;
}
.col-12,
.col-md-6,
.col-lg-4,
.col-lg-8,
.col-lg-10,
.col-md-4,
.col-md-5,
.col-md-7,
.col-md-3,
.col-auto {
	position: relative;
	padding-right: 0.75rem;
	padding-left: 0.75rem;
}
.col-12 {
	flex: 0 0 auto;
	width: 100%;
}
.col-6 {
	flex: 0 0 auto;
	width: 50%;
}
.col-4 {
	flex: 0 0 auto;
	width: 33.33%;
}
.col-auto {
	flex: 0 0 auto;
	width: auto;
}

@media (min-width: 768px) {
	.col-md-3 {
		flex: 0 0 auto;
		width: 25%;
	}
	.col-md-4 {
		flex: 0 0 auto;
		width: 33.33333%;
	}
	.col-md-5 {
		flex: 0 0 auto;
		width: 41.66667%;
	}
	.col-md-6 {
		flex: 0 0 auto;
		width: 50%;
	}
	.col-md-7 {
		flex: 0 0 auto;
		width: 58.33333%;
	}
	.ms-sm-auto {
		margin-left: auto;
	}
	.px-md-4 {
		padding-left: 1.5rem;
		padding-right: 1.5rem;
	}
}
@media (min-width: 992px) {
	.col-lg-4 {
		flex: 0 0 auto;
		width: 33.33333%;
	}
	.col-lg-8 {
		flex: 0 0 auto;
		width: 66.66667%;
	}
	.col-lg-10 {
		flex: 0 0 auto;
		width: 83.33333%;
	}
}

/* Utility Classes */
.d-flex {
	display: flex;
}
.d-none {
	display: none !important;
}
.d-block {
	display: block !important;
}
.cursor-help {
	cursor: help;
}
.scree-plot-container {
	min-height: 400px;
}
.flex-column {
	flex-direction: column;
}
.flex-wrap {
	flex-wrap: wrap;
}
.justify-content-between {
	justify-content: space-between;
}
.justify-content-center {
	justify-content: center;
}
.justify-content-end {
	justify-content: flex-end;
}
.align-items-center {
	align-items: center;
}
.me-auto {
	margin-right: auto;
}
.me-1 {
	margin-right: 0.25rem;
}
.me-2 {
	margin-right: 0.5rem;
}
.me-3 {
	margin-right: 1rem;
}
.mb-4 {
	margin-bottom: 1.5rem;
}
.mb-3 {
	margin-bottom: 1rem;
}
.mb-2 {
	margin-bottom: 0.5rem;
}
.mb-1 {
	margin-bottom: 0.25rem;
}
.mb-0 {
	margin-bottom: 0;
}
.mt-4 {
	margin-top: 1.5rem;
}
.mt-3 {
	margin-top: 1rem;
}
.mt-2 {
	margin-top: 0.5rem;
}
.mt-1 {
	margin-top: 0.25rem;
}
.ms-1 {
	margin-left: 0.25rem;
}
.ms-2 {
	margin-left: 0.5rem;
}
.ms-4 {
	margin-left: 1.5rem;
}
.p-0 {
	padding: 0;
}
.p-1 {
	padding: 0.25rem;
}
.p-2 {
	padding: 0.5rem;
}
.p-3 {
	padding: 1rem;
}
.p-4 {
	padding: 1.5rem;
}
.py-2 {
	padding-top: 0.5rem;
	padding-bottom: 0.5rem;
}
.px-3 {
	padding-left: 1rem;
	padding-right: 1rem;
}
.text-center {
	text-align: center;
}
.text-end {
	text-align: right;
}
.text-muted {
	color: var(--secondary-color);
}
.text-primary {
	color: var(--primary-color);
}
.text-success {
	color: var(--success-color);
}
.text-danger {
	color: var(--danger-color);
}
.text-warning {
	color: #ffc107;
}
.bg-primary {
	background-color: var(--primary-color);
}
.bg-success {
	background-color: var(--success-color);
}
.bg-ordinal {
	background-color: #D4A017;
}
.bg-secondary {
	background-color: var(--secondary-color);
}
.bg-warning {
	background-color: #ffc107;
}
.bg-info {
	background-color: #0dcaf0;
}
.bg-light {
	background-color: var(--light-color);
}
.bg-white {
	background-color: #fff;
}
.text-right {
	text-align: right;
}
.fixed-top {
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 1030;
}
.sticky-top {
	position: sticky;
	top: 0;
	z-index: 1020;
}
.h-100 {
	height: 100%;
}
.fw-bold {
	font-weight: 700;
}
.border {
	border: 1px solid var(--border-color);
}
.rounded {
	border-radius: var(--border-radius);
}
.small {
	font-size: 0.875rem;
}
.font-monospace {
	font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.fade {
	opacity: 0;
	transition: opacity 0.15s linear;
}
.fade.show {
	opacity: 1;
}

/* Navbar */
.navbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	padding: 0.5rem 0.5rem;
	z-index: 1000;
}
.navbar-expand {
	flex-wrap: nowrap;
	justify-content: flex-start;
}
.navbar-dark {
	color: white;
}
.navbar-brand {
	display: inline-block;
	padding-top: 0.3125rem;
	padding-bottom: 0.3125rem;
	margin-right: 1rem;
	font-size: 1.25rem;
	text-decoration: none;
	color: white;
}
.navbar-nav {
	display: flex;
	flex-direction: row;
	padding-left: 0;
	margin-bottom: 0;
	list-style: none;
}
.navbar-nav:not(.mobile) .nav-item {
	margin-left: 0.5rem;
}
@media (min-width: 768px) {
	.desktop {
		display: initial;
	}
	.mobile {
		display: none;
	}
}
@media (max-width: 768px) {
	.desktop {
		display: none;
	}
	.mobile {
		display: initial;
	}
}

/* Buttons */
.btn {
	display: inline-block;
	font-weight: 400;
	text-align: center;
	vertical-align: middle;
	-webkit-user-select: none;
	user-select: none;
	border: 1px solid transparent;
	padding: 0.375rem 0.75rem;
	font-size: 1rem;
	line-height: 1.5;
	border-radius: var(--border-radius);
	transition: all 0.15s ease-in-out;
	cursor: pointer;
}
.nowrap {
	white-space: nowrap;
}
.btn:disabled {
	opacity: 0.65;
	pointer-events: none;
}
.btn-primary {
	color: #fff;
	background-color: var(--primary-color);
	border-color: var(--primary-color);
}
.btn-primary:hover {
	background-color: var(--primary-hover);
}
.btn-secondary {
	color: #fff;
	background-color: var(--secondary-color);
	border-color: var(--secondary-color);
}
.btn-light {
	color: var(--dark-color);
	background-color: var(--light-color);
	border-color: var(--light-color);
}
.btn-success {
	color: white;
	background-color: var(--success-color);
	border-color: var(--success-color);
}
.btn-success:hover {
	background-color: #157347;
}
.btn-danger {
	color: white;
	background-color: var(--danger-color);
	border-color: var(--danger-color);
}
.btn-outline-danger {
	color: var(--danger-color);
	background-color: transparent;
	border-color: var(--danger-color);
}
.btn-outline-primary {
	color: var(--primary-color);
	background-color: transparent;
	border-color: var(--primary-color);
}
.btn-outline-secondary {
	color: var(--secondary-color);
	background-color: transparent;
	border-color: var(--secondary-color);
}
.btn-sm {
	padding: 0.25rem 0.5rem;
	font-size: 0.875rem;
}

/* Floating action button (appears on hover) */
td:has(.floating-use-btn) {
	position: relative;
}
.floating-use-btn {
	position: absolute;
	right: 0.25rem;
	top: 50%;
	transform: translateY(-50%);
	opacity: 0;
	transition: opacity 0.15s ease-in-out;
	padding: 0.1rem 0.4rem;
	font-size: 0.75rem;
}
td:hover .floating-use-btn {
	opacity: 1;
}
@media print {
	.floating-use-btn {
		display: none;
	}
}

.btn-close {
	box-sizing: content-box;
	width: 1em;
	height: 1em;
	padding: 0.25em;
	background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
	border: 0;
	border-radius: 0.25rem;
	opacity: 0.5;
	cursor: pointer;
}

/* Dropdown */
.dropdown {
	position: relative;
}
.navbar-nav:not(.mobile) .dropdown-toggle::after {
	display: inline-block;
	margin-left: 0.255em;
	vertical-align: 0.255em;
	content: "";
	border-top: 0.3em solid;
	border-right: 0.3em solid transparent;
	border-bottom: 0;
	border-left: 0.3em solid transparent;
}
.dropdown-menu {
	position: absolute;
	display: none;
	min-width: 10rem;
	padding: 0.5rem 0;
	margin: 0;
	font-size: 1rem;
	color: var(--dark-color);
	text-align: left;
	list-style: none;
	background-color: #fff;
	background-clip: padding-box;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: var(--border-radius);
	z-index: 1000;
}
.dropdown-menu.show {
	display: block;
}
.mobile .dropdown-menu.show {
	right: 0px;
}
.dropdown-item {
	display: block;
	width: 100%;
	padding: 0.25rem 1rem;
	clear: both;
	font-weight: 400;
	color: var(--dark-color);
	text-align: inherit;
	text-decoration: none;
	white-space: nowrap;
	background-color: transparent;
	border: 0;
	cursor: pointer;
}
.dropdown-item:hover {
	background-color: #f8f9fa;
}
.dropdown-divider {
	height: 0;
	margin: 0.5rem 0;
	overflow: hidden;
	border-top: 1px solid rgba(0, 0, 0, 0.15);
}

/* Card */
.card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	word-wrap: break-word;
	background-color: #fff;
	background-clip: border-box;
	border: 1px solid rgba(0, 0, 0, 0.125);
	border-radius: var(--border-radius);
}
.card-body {
	flex: 1 1 auto;
	padding: 1rem;
}
.h5 {
	display: block;
	font-size: 0.83em;
	font-weight: bold;
}
.card-title {
	margin-bottom: 0.5rem;
	font-weight: 500;
}
.card-subtitle {
	margin-top: 1rem;
	margin-bottom: 0.5rem;
	font-weight: 500;
	color: var(--bs-secondary-color);
}
.card-text:last-child {
	margin-bottom: 0;
}
.card-header {
	padding: 0.5rem 1rem;
	margin-bottom: 0;
	background-color: rgba(0, 0, 0, 0.03);
	border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}
.card-footer {
	padding: 0.5rem 1rem;
	background-color: rgba(0, 0, 0, 0.03);
	border-top: 1px solid rgba(0, 0, 0, 0.125);
}

/* Forms */
.form-control {
	display: block;
	width: 100%;
	padding: 0.375rem 0.75rem;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--dark-color);
	background-color: #fff;
	background-clip: padding-box;
	border: 1px solid #ced4da;
	border-radius: var(--border-radius);
	transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.form-control-sm {
	padding: 0.25rem 0.5rem;
	font-size: 0.875rem;
}
.form-select {
	display: block;
	width: 100%;
	padding: 0.375rem 2.25rem 0.375rem 0.75rem;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--dark-color);
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	background-size: 16px 12px;
	border: 1px solid #ced4da;
	border-radius: var(--border-radius);
	appearance: none;
}
.form-select-sm {
	padding-top: 0.25rem;
	padding-bottom: 0.25rem;
	font-size: 0.875rem;
}
.form-label {
	margin-bottom: 0.5rem;
	display: inline-block;
}
.form-text {
	margin-top: 0.25rem;
	font-size: 0.875em;
	color: var(--secondary-color);
}
.form-check {
	display: block;
	min-height: 1.5rem;
	padding-left: 1.5em;
	margin-bottom: 0.125rem;
}
.form-check-input {
	width: 1em;
	height: 1em;
	margin-top: 0.25em;
	margin-left: -1.5em;
	vertical-align: top;
	background-color: #fff;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	border: 1px solid rgba(0, 0, 0, 0.25);
	appearance: none;
	-webkit-print-color-adjust: exact;
	print-color-adjust: exact;
}
.form-check-input[type="checkbox"] {
	border-radius: 0.25em;
}
.form-check-input[type="radio"] {
	border-radius: 50%;
}
.form-check-input:checked {
	background-color: var(--primary-color);
	border-color: var(--primary-color);
}
.form-check-input[type="checkbox"]:checked {
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}
.form-check-input[type="radio"]:checked {
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e");
}
.form-check-label {
	cursor: pointer;
}
.input-group {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	width: 100%;
}
.input-group > .form-control,
.input-group > .form-select {
	position: relative;
	flex: 1 1 auto;
	width: 1%;
	min-width: 0;
}
.input-group-sm > .form-control,
.input-group-sm > .form-select,
.input-group-sm > .input-group-text {
	padding: 0.25rem 0.5rem;
	font-size: 0.875rem;
	border-radius: var(--border-radius);
}
.input-group-text {
	display: flex;
	align-items: center;
	padding: 0.375rem 0.75rem;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.5;
	color: var(--dark-color);
	text-align: center;
	white-space: nowrap;
	background-color: #e9ecef;
	border: 1px solid #ced4da;
	border-radius: var(--border-radius);
}
.input-group > :not(:first-child):not(.dropdown-menu) {
	margin-left: -1px;
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}
.input-group > :not(:last-child):not(.dropdown-menu) {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}

/* Tables */
.table {
	width: 100%;
	margin-bottom: 1rem;
	color: var(--dark-color);
	vertical-align: top;
	border-color: var(--border-color);
	border-collapse: collapse;
}
.table > thead {
	vertical-align: bottom;
}
.table > :not(caption) > * > * {
	padding: 0.5rem;
	border-bottom-width: 1px;
}
.table-sm > :not(caption) > * > * {
	padding: 0.25rem;
}
@layer table-stripes {
	.table-striped > tbody > tr:nth-of-type(odd) > * {
		background-color: rgba(0, 0, 0, 0.05);
	}
}
.table-hover > tbody > tr:hover > * {
	background-color: rgba(0, 0, 0, 0.075);
}
.table-bordered {
	border: 1px solid var(--border-color);
}
.table-bordered > :not(caption) > * > * {
	border-width: 1px;
	border-style: solid;
	border-color: var(--border-color);
}
.table-responsive {
	overflow-x: auto;
}
.table-dark {
	color: white;
	background-color: var(--dark-color);
}
.table-secondary td,
.table-secondary th {
	background-color: rgba(108, 117, 125, 0.1);
}
.table-success td,
.table-success th,
td.table-success,
th.table-success {
	background-color: rgba(25, 135, 84, 0.1);
}
.table-danger td,
.table-danger th,
td.table-danger,
th.table-danger {
	background-color: rgba(220, 53, 69, 0.1);
}
.table-warning td,
.table-warning th,
td.table-warning,
th.table-warning {
	background-color: rgba(255, 193, 7, 0.15);
}
.table-info td,
.table-info th,
td.table-info,
th.table-info {
	background-color: rgba(13, 202, 240, 0.1);
}

/* Alerts */
.alert {
	position: relative;
	padding: 1rem;
	margin-bottom: 1rem;
	border: 1px solid transparent;
	border-radius: var(--border-radius);
}
.alert-info {
	color: #055160;
	background-color: #cff4fc;
	border-color: #b6effb;
}
.alert-warning {
	color: #664d03;
	background-color: #fff3cd;
	border-color: #ffecb5;
}
.alert-secondary {
	color: #41464b;
	background-color: #e2e3e5;
	border-color: #d3d6d8;
}

/* Badge */
.badge {
	display: inline-block;
	padding: 0.35em 0.65em;
	font-size: 0.75em;
	font-weight: 700;
	line-height: 1;
	color: #fff;
	text-align: center;
	white-space: nowrap;
	vertical-align: baseline;
	border-radius: 0.25rem;
}

/* Progress and Loading */
.spinner-border {
	display: inline-block;
	width: 2rem;
	height: 2rem;
	vertical-align: -0.125em;
	border: 0.25em solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: spinner-border 0.75s linear infinite;
}
@keyframes spinner-border {
	to {
		transform: rotate(360deg);
	}
}
.progress {
	display: flex;
	height: 1rem;
	overflow: hidden;
	font-size: 0.75rem;
	background-color: #e9ecef;
	border-radius: 0.25rem;
}
.progress-bar {
	display: flex;
	flex-direction: column;
	justify-content: center;
	overflow: hidden;
	color: #fff;
	text-align: center;
	white-space: nowrap;
	background-color: var(--primary-color);
	transition: width 0.6s ease;
}
.progress-bar-striped {
	background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
	background-size: 1rem 1rem;
}
.progress-bar-animated {
	animation: progress-bar-stripes 1s linear infinite;
}
@keyframes progress-bar-stripes {
	0% {
		background-position-x: 1rem;
	}
}
.visually-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Modal */
.modal {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 1050;
	display: none;
	width: 100%;
	height: 100%;
	overflow: hidden;
	outline: 0;
	background-color: rgba(0, 0, 0, 0.5);
}
.modal.show {
	display: flex;
	align-items: center;
	justify-content: center;
}
.modal-dialog {
	position: relative;
	width: auto;
	max-width: 500px;
	max-height: 90vh;
}
.modal-lg {
	max-width: 800px;
}
.modal-fullscreen {
	max-width: 90%;
	max-height: 90%;
	width: 90%;
}
.modal-content {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-height: 90vh;
	pointer-events: auto;
	background-color: #fff;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 0.3rem;
	outline: 0;
}
.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem;
	border-bottom: 1px solid #dee2e6;
}
.modal-title {
	margin-bottom: 0;
	margin-top: 0;
	line-height: 1.5;
}
.modal-body {
	overflow-y: auto;
	display: flex;
	flex: 1;
	flex-direction: column;
	position: relative;
	padding: 1rem;
}
#caseSelectionModal .modal-body {
	overflow-y: hidden;
}
#activeFiltersContainer {
	overflow-y: auto;
}
.modal-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	padding: 0.75rem;
	border-top: 1px solid #dee2e6;
}

/* Pagination */
.pagination {
	display: flex;
	padding-left: 0;
	list-style: none;
}
.page-item:not(:first-child) .page-link {
	margin-left: -1px;
}
.page-item.active .page-link {
	z-index: 3;
	color: #fff;
	background-color: var(--primary-color);
	border-color: var(--primary-color);
}
.page-item.disabled .page-link {
	color: var(--secondary-color);
	pointer-events: none;
	background-color: #fff;
	border-color: #dee2e6;
}
.page-link {
	position: relative;
	display: block;
	padding: 0.5rem 0.75rem;
	color: var(--primary-color);
	text-decoration: none;
	background-color: #fff;
	border: 1px solid #dee2e6;
}
.pagination-sm .page-link {
	padding: 0.25rem 0.5rem;
	font-size: 0.875rem;
}

/* Application-specific styles */
.main-content {
	margin-left: 0;
	padding-top: 56px;
	min-height: 100vh;
}
.view {
	display: none;
}
.dropdown-item.active {
	background-color: var(--primary-color);
	color: white;
}
.view.active {
	display: block;
}
.selection-list {
	height: 400px;
	overflow-y: auto;
	border: 1px solid #ced4da;
	padding: 0.5rem;
	-webkit-user-select: none;
	user-select: none;
}
.categorical-values-container .selection-list {
	max-height: 35svh;
}
.selection-item {
	padding: 3px 10px;
	cursor: pointer;
	border-radius: 3px;
	overflow-anchor: none;
}
@media (hover: hover) {
	.selection-item:hover {
		background-color: #f0f0f0;
	}
}
.selection-item.selected {
	background-color: #d1e7ff;
}
.scroll-to-top {
	position: fixed;
	top: 64px;
	right: 20px;
	z-index: 1040;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background-color: var(--bs-primary, #0d6efd);
	color: #fff;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s, visibility 0.25s;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.scroll-to-top.visible {
	opacity: 0.7;
	visibility: visible;
}
.scroll-to-top:hover {
	opacity: 1;
}
.output-container {
	margin-top: 30px;
	border-top: 1px solid #e0e0e0;
	padding-top: 20px;
}
.output-item {
	margin-bottom: 30px;
	border: 1px solid #e0e0e0;
	border-radius: 5px;
	padding: 15px;
	background-color: #f9f9f9;
}
.output-header {
	display: flex;
	justify-content: space-between;
	margin-bottom: 10px;
}
.loading-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(255, 255, 255, 0.8);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 2000;
	flex-direction: column;
}
.btn-link-muted {
	background: none;
	border: none;
	color: #6c757d;
	cursor: pointer;
	font-size: 0.875rem;
	padding: 0.25rem 0.5rem;
	text-decoration: underline;
}
.btn-link-muted:hover {
	color: #495057;
}
@media print {
	.no-copy {
		display: none !important;
	}
}
.file-upload-container {
	display: flex;
	align-items: center;
}

.file-upload-btn {
	background-color: var(--primary-color);
	color: white;
	border: none;
	border-radius: var(--border-radius);
	padding: 0.375rem 0.75rem;
	cursor: pointer;
	transition: background-color 0.15s ease-in-out;
}

.file-upload-btn:hover {
	background-color: var(--primary-hover);
}

.file-name-display {
	margin-left: 0.75rem;
	color: var(--secondary-color);
	font-size: 0.9rem;
}

/* Table of Contents */
.results-toc {
	position: fixed;
	left: 0;
	bottom: 0%;
	width: 250px;
	background-color: #f8f9fa;
	border-radius: 0 5px 0px 0;
	box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
	z-index: 100;
}

.toc-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 2px 10px;
	background-color: var(--primary-color);
	color: white;
	border-radius: 0 5px 0px 0;
}

.toc-title {
	font-weight: 500;
	margin-right: 10px;
}

.toc-toggle {
	background: transparent;
	border: none;
	color: white;
	cursor: pointer;
	padding: 0;
	width: 100%;
	height: 24px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.results-toc.collapsed .toggle-icon {
	transform: rotate(180deg);
}

.toc-body {
	max-height: 70vh;
	overflow-y: auto;
	padding: 10px;
}

.toc-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.toc-item {
	margin-bottom: 1px;
}

.toc-link {
	display: block;
	padding: 2px 4px;
	color: var(--dark-color);
	text-decoration: none;
	border-radius: 3px;
	transition: background-color 0.2s;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 0.7rem;
}

.toc-link:hover {
	background-color: #e9ecef;
}

.toc-link.active {
	background-color: #d1e7ff;
	color: var(--primary-color);
}

.toc-type {
	font-size: 0.8rem;
	color: var(--secondary-color);
	display: block;
}

/* Custom badge for result count */
.toc-count {
	background-color: var(--primary-color);
	color: white;
	border-radius: 50%;
	width: 20px;
	height: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
	margin-left: 5px;
}

/* On mobile, make ToC a bit narrower */
@media (max-width: 768px) {
	.results-toc {
		width: 200px;
	}
}

.copyright-badge {
	position: fixed;
	right: 0;
	bottom: 0;
	padding: 2px 10px;
	background-color: var(--light-color);
	font-size: 0.75rem;
	border-radius: 10px 0 0 0;
	z-index: 100;
	border-color: var(--primary-color);
	border-top-style: outset;
	border-left-style: outset;
}
.citation-box {
	margin-bottom: 15px;
	font-size: 0.9rem;
}

.citation-list li {
	margin-bottom: 0.5rem;
}

/* Styling for the transformation view */
.rule-list {
	max-height: 300px;
	overflow-y: auto;
	border: 1px solid #dee2e6;
	border-radius: 0.25rem;
	padding: 0.5rem;
}

.rule-item {
	padding: 0.75rem;
	border-bottom: 1px solid #dee2e6;
	cursor: pointer;
}

.rule-item:last-child {
	border-bottom: none;
}

.rule-item:hover {
	background-color: #f8f9fa;
}

.rule-item.active {
	background-color: #e9ecef;
}

.rule-description {
	margin-top: 0.5rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Drag-and-drop styling */
.rule-item.dragging {
	opacity: 0.7;
	box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
	background-color: #f1f1f1;
}

.rule-item.drop-above {
	border-top: 2px solid #0d6efd;
}

.rule-item.drop-below {
	border-bottom: 2px solid #0d6efd;
}

/* Toggle checkbox styling */
.rule-toggle-checkbox {
	cursor: pointer;
}

/* Style for variable selection list */
.selection-item.affected:not(.selected) {
	border-left: 3px solid #ffc107;
	padding-left: 7px;
}

.affected-marker {
	color: #ffc107;
	font-style: italic;
}

/* Formula editor styling */
#formulaExpression {
	font-family: monospace;
}

/* Reference table styling */
.variable-reference-table {
	font-size: 0.875rem;
}

.variable-reference-table th,
.variable-reference-table td {
	padding: 4px 8px;
	border-bottom: 1px solid #dee2e6;
}

.variable-reference-table th {
	background-color: rgba(0, 0, 0, 0.03);
}

/* Function buttons */
.function-list {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 0.5rem;
}

.function-btn,
.reference-btn {
	font-family: monospace;
}

/* Detected outputs list */
.detected-outputs-list {
	background-color: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 0.25rem;
	padding: 0.5rem;
}

.detected-output-item {
	margin-bottom: 0.25rem;
}

.reference-badge {
	background-color: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 0.25rem;
	padding: 0.1rem 0.3rem;
	font-size: 0.7rem;
	font-family: monospace;
	margin-left: 0.5rem;
}

/* Toast Component Styles */
.toast-container {
	position: fixed;
	z-index: 1050;
	max-width: 350px;
	padding: 10px;
}

/* Position classes */
.toast-container.top-right {
	top: 15px;
	right: 15px;
}

.toast-container.top-left {
	top: 15px;
	left: 15px;
}

.toast-container.bottom-right {
	bottom: 15px;
	right: 15px;
}

.toast-container.bottom-left {
	bottom: 15px;
	left: 15px;
}

.toast-container.top-center {
	top: 15px;
	left: 50%;
	transform: translateX(-50%);
}

.toast-container.bottom-center {
	bottom: 15px;
	left: 50%;
	transform: translateX(-50%);
}

.toast {
	position: relative;
	margin-bottom: 10px;
	padding: 15px;
	background-color: #fff;
	border-radius: var(--border-radius);
	box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
	max-width: 350px;
	overflow: hidden;
	opacity: 0;
	transform: translateY(-15px);
	transition: all 0.3s ease;
}

.toast.showing {
	opacity: 1;
	transform: translateY(0);
}

.toast.hiding {
	opacity: 0;
	transform: translateY(-15px);
}

.toast-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
	font-weight: 500;
}

.toast-body {
	padding-right: 10px;
}

.toast .btn-close {
	position: absolute;
	top: 10px;
	right: 10px;
}

/* Toast types */
.toast-info {
	border-left: 4px solid var(--primary-color);
	background-color: #e6f2ff;
	color: #0a58ca;
}

.toast-success {
	border-left: 4px solid var(--success-color);
	background-color: #e6fff0;
	color: #146c43;
}

.toast-warning {
	border-left: 4px solid #ffc107;
	background-color: #fff9e6;
	color: #997404;
}

.toast-error {
	border-left: 4px solid var(--danger-color);
	background-color: #ffe6e6;
	color: #b02a37;
}

.middle-ellipsis {
	position: relative;
	max-width: 200px; /* adjust as needed */
	overflow: hidden;
	white-space: nowrap;
}

.middle-ellipsis::before {
	content: attr(data-text);
	position: absolute;
	left: 0;
	right: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	direction: rtl;
}
/* Drag list selectors */
.touch-selecting {
	overflow-y: hidden;
}
.touch-selecting .selection-item {
	-webkit-user-select: none;
	user-select: none;
}
.touch-selecting .selection-item.selected {
	background-color: rgba(0, 123, 255, 0.3);
}

/* Correlation visualization styles */
.chart-container {
	position: relative;
	border: 1px solid #dee2e6;
	border-radius: 0.25rem;
	overflow: hidden;
}

.chart-container-sm {
	height: 300px;
}

.bicluster-heatmap-container {
	overflow-x: auto;
}

.resize-handle {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 10px;
	height: 10px;
	cursor: nwse-resize;
	border-right: 2px solid #aaa;
	border-bottom: 2px solid #aaa;
	z-index: 10;
}

.zoom-controls {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 10;
}

.correlation-legend {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 10px;
	margin-bottom: 10px;
}

.export-controls {
	margin-top: 10px;
	text-align: center;
}

/* Bootstrap Icons Base */
.bi {
	display: inline-block;
	vertical-align: -0.125em;
	fill: currentColor;
}
.bi-info-circle::before {
	content: "\f431";
}
.bi-exclamation-triangle::before {
	content: "\f33a";
}

/* Transformation View Classes */
.rule-form-section {
	margin-bottom: 1rem;
	padding: 1rem;
	background-color: #f8f9fa;
	border-radius: var(--border-radius);
}
.original-value {
	font-weight: 500;
	color: var(--dark-color);
}
.new-value {
	font-weight: 500;
	color: var(--primary-color);
}
.remove-mapping {
	cursor: pointer;
	color: var(--danger-color);
}
.min-value,
.max-value,
.output-value {
	display: inline-block;
	margin: 0 0.25rem;
}
.remove-range {
	cursor: pointer;
	color: var(--danger-color);
}
.output-section {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--border-color);
}
.condition-name-input {
	max-width: 300px;
}

/* Tabs */
.nav-tabs {
	display: flex;
	flex-wrap: wrap;
	padding-left: 0;
	margin-bottom: 0;
	list-style: none;
	border-bottom: 1px solid var(--border-color);
}
.nav-tabs .nav-link {
	display: block;
	padding: 0.5rem 1rem;
	color: var(--secondary-color);
	text-decoration: none;
	background: none;
	border: 1px solid transparent;
	border-top-left-radius: var(--border-radius);
	border-top-right-radius: var(--border-radius);
	cursor: pointer;
	margin-bottom: -1px;
}
.nav-tabs .nav-link:hover {
	border-color: #e9ecef #e9ecef var(--border-color);
	color: var(--dark-color);
}
.nav-tabs .nav-link.active {
	color: var(--dark-color);
	background-color: #fff;
	border-color: var(--border-color) var(--border-color) #fff;
}
.tab-content {
	padding-top: 1rem;
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
}
.tab-content > .tab-pane {
	display: none;
}
.tab-content > .tab-pane.active {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
}

/* Variable Types Table */
.variable-types-container {
	max-height: 400px;
	overflow-y: auto;
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
}
#variableTypesTable {
	-webkit-user-select: none;
	user-select: none;
	margin-bottom: 0;
}
#variableTypesTable th:not(:first-child),
#variableTypesTable td:not(:first-child) {
	width: 60px;
	text-align: center;
}
#variableTypesTable td:first-child {
	max-width: 200px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.type-cell {
	cursor: pointer;
	padding: 0.25rem;
	transition: background-color 0.1s;
	text-align: center;
}
.type-cell:hover {
	background-color: rgba(13, 110, 253, 0.1);
}
.type-cell .badge {
	display: none;
}
.type-cell.selected .badge {
	display: inline-block;
}
.type-cell.disabled {
	cursor: not-allowed;
	opacity: 0.4;
}
.type-cell.disabled:hover {
	background-color: transparent;
}

/* Rule Library Select Cells */
.select-cell {
	cursor: pointer;
	padding: 0.25rem;
	transition: background-color 0.1s;
	user-select: none;
}
.select-cell::before {
	content: "☐";
	font-size: 1.1em;
	color: var(--text-muted);
}
.select-cell:hover {
	background-color: rgba(13, 110, 253, 0.1);
}
.select-cell.selected::before {
	content: "☑";
	color: var(--primary);
}
.rule-table-container table {
	margin-bottom: 0;
}
.rule-table-container td {
	vertical-align: middle;
}

/* CFA Matrix */
#cfaModelMatrix {
	width: auto;
	table-layout: fixed;
}
#cfaModelMatrix th:first-child,
#cfaModelMatrix td:first-child {
	width: var(--cfa-var-col-width, 150px);
	min-width: 80px;
	max-width: 300px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.cfa-matrix-cell {
	cursor: pointer;
	text-align: center;
	width: 70px;
	min-width: 70px;
	max-width: 70px;
	transition: background-color 0.15s;
	user-select: none;
}
.cfa-matrix-cell:hover {
	background-color: rgba(13, 110, 253, 0.1);
}
.cfa-matrix-cell.selected {
	background-color: rgba(13, 110, 253, 0.15);
	color: var(--bs-primary);
	font-weight: 500;
}
.cfa-matrix-cell.fixed {
	background-color: rgba(108, 117, 125, 0.15);
	color: var(--bs-secondary);
	font-weight: 500;
}
.cfa-matrix-cell.constrained {
	background-color: rgba(25, 135, 84, 0.15);
	color: var(--bs-success);
	font-weight: 500;
}
.cfa-factor-header {
	width: 70px;
	min-width: 70px;
	max-width: 70px;
	padding: 0.25rem !important;
	vertical-align: middle;
}
.cfa-factor-header-content {
	display: flex;
	align-items: center;
	gap: 2px;
}
.cfa-factor-name {
	flex: 1;
	text-align: center;
	font-weight: 500;
	border: none;
	background: transparent;
	padding: 0.15rem 0.25rem;
	min-width: 0;
	width: 100%;
}
.cfa-factor-name:focus {
	outline: 1px solid var(--bs-primary);
	border-radius: 2px;
}
.cfa-header-btn {
	border: none;
	background: transparent;
	cursor: pointer;
	padding: 0;
	width: 16px;
	height: 16px;
	font-size: 12px;
	line-height: 1;
	color: var(--bs-secondary);
	opacity: 0.5;
	transition: opacity 0.15s;
	display: flex;
	align-items: center;
	justify-content: center;
}
.cfa-factor-header:hover .cfa-header-btn {
	opacity: 1;
}
.cfa-header-btn:hover {
	color: var(--bs-primary);
}
.cfa-header-btn.remove:hover {
	color: var(--bs-danger);
}
.cfa-var-col-header {
	position: relative;
}
.cfa-var-col-resizer {
	position: absolute;
	right: 0;
	top: 0;
	bottom: 0;
	width: 5px;
	cursor: col-resize;
	background: transparent;
}
.cfa-var-col-resizer:hover,
.cfa-var-col-resizer.dragging {
	background: var(--bs-primary);
	opacity: 0.3;
}

/* CFA Cell Popover */
.cfa-cell-popover {
	position: absolute;
	background: var(--bs-body-bg);
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	padding: 0.5rem;
	z-index: 1050;
	display: flex;
	gap: 0.25rem;
	align-items: center;
}
.cfa-cell-popover input {
	width: 50px;
	text-align: center;
	padding: 0.25rem;
	font-size: 0.875rem;
}
.cfa-cell-popover .btn {
	padding: 0.25rem 0.5rem;
	font-size: 0.75rem;
}
.path-diagram-container {
	width: 100%;
	overflow-x: auto;
}

/* R Console */
#console-output {
	white-space: pre-wrap;
	word-wrap: break-word;
}
.console-commands-tooltip {
	position: absolute;
	bottom: 100%;
	left: 0;
	right: 0;
	background-color: #fff;
	border: 1px solid var(--border-color);
	border-bottom: none;
	border-radius: var(--border-radius) var(--border-radius) 0 0;
	padding: 0.5rem;
	box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}
.console-command-item {
	padding: 0.25rem 0.5rem;
	cursor: pointer;
	border-radius: var(--border-radius);
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.console-command-item:hover,
.console-command-item.selected {
	background-color: #e9ecef;
}
.console-command-name {
	font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	font-weight: 500;
}
.console-command-desc {
	color: var(--secondary-color);
	font-size: 0.875rem;
}
#consoleModal .modal-footer {
	position: relative;
}
.console-input-group {
	align-items: flex-end;
}
.console-textarea {
	resize: none;
	field-sizing: content;
	min-height: calc(1.5em + 0.75rem + 2px);
	max-height: calc((90vh - 200px) * 0.4);
	line-height: 1.5;
	font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.console-input-group .input-group-text {
	align-self: flex-end;
	height: calc(1.5em + 0.75rem + 2px);
}
.console-input-group .btn {
	align-self: flex-end;
}

/* Accordion */
.accordion {
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
	overflow: hidden;
}
.accordion-item {
	border-bottom: 1px solid var(--border-color);
}
.accordion-item:last-child {
	border-bottom: none;
}
.accordion-header {
	margin: 0;
}
.accordion-button {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	padding: 1rem 1.25rem;
	font-size: 1rem;
	font-weight: 500;
	color: var(--dark-color);
	text-align: left;
	background-color: var(--light-color);
	border: none;
	cursor: pointer;
	transition: background-color 0.15s ease-in-out;
}
.accordion-button:hover {
	background-color: #e9ecef;
}
.accordion-button::after {
	flex-shrink: 0;
	width: 1.25rem;
	height: 1.25rem;
	margin-left: auto;
	content: "";
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-size: 1.25rem;
	transition: transform 0.2s ease-in-out;
}
.accordion-button:not(.collapsed)::after {
	transform: rotate(-180deg);
}
.accordion-button:not(.collapsed) {
	background-color: #e7f1ff;
	color: var(--primary-color);
}
.accordion-collapse {
	overflow: hidden;
	transition: height 0.3s ease;
}
.accordion-collapse.collapsing {
	height: 0;
}
.accordion-collapse.collapsed {
	display: none;
}
.accordion-body {
	padding: 1rem 1.25rem;
	background-color: #fff;
}

/* Button Group */
.btn-group {
	position: relative;
	display: inline-flex;
	vertical-align: middle;
}
.btn-group > .btn {
	position: relative;
	flex: 1 1 auto;
}
.btn-group > .btn:not(:first-child) {
	margin-left: -1px;
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}
.btn-group > .btn:not(:last-child) {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}
/* Fix for btn-check pattern: first/last visible buttons */
.btn-group > .btn-check:first-child + .btn {
	border-top-left-radius: var(--border-radius);
	border-bottom-left-radius: var(--border-radius);
}
.btn-group > .btn-check:last-of-type + .btn {
	border-top-right-radius: var(--border-radius);
	border-bottom-right-radius: var(--border-radius);
}
.btn-group-sm > .btn {
	padding: 0.25rem 0.5rem;
	font-size: 0.875rem;
}

/* Button Check (toggle buttons) */
.btn-check {
	position: absolute;
	clip: rect(0, 0, 0, 0);
	pointer-events: none;
}
.btn-check:checked + .btn {
	color: #fff;
	background-color: var(--primary-color);
	border-color: var(--primary-color);
}
.btn-check:focus + .btn {
	box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Utility: Width */
.w-100 {
	width: 100% !important;
}

/* Utility: Gap */
.gap-1 {
	gap: 0.25rem !important;
}
.gap-2 {
	gap: 0.5rem !important;
}
.gap-3 {
	gap: 1rem !important;
}

/* Utility: Margin Y */
.my-3 {
	margin-top: 1rem !important;
	margin-bottom: 1rem !important;
}
.my-4 {
	margin-top: 1.5rem !important;
	margin-bottom: 1.5rem !important;
}

/* Color preview swatch */
.color-preview {
	width: 24px;
	height: 24px;
	border: 1px solid #ccc;
}

/* SVG chart container */
.svg-container {
	width: 100%;
	height: 100%;
	position: relative;
}

/* Equal-width column */
.col {
	flex: 1 0 0%;
}

/* Align items */
.align-items-baseline {
	align-items: baseline !important;
}

/* Narrow select */
.select-narrow {
	width: 80px;
}

/* Scrollable list */
.scrollable-list {
	max-height: 200px;
	overflow-y: auto;
}

/* Rule Library table */
.rule-table-scroll {
	height: 50vh;
	overflow-y: auto;
}
.col-checkbox {
	width: 40px;
}
.col-type {
	width: 80px;
}
.col-action {
	width: 50px;
}

/* Background body */
.bg-body {
	background-color: var(--bs-body-bg, #fff);
}

/* Alert Warning */
.alert-warning {
	color: #664d03;
	background-color: #fff3cd;
	border-color: #ffecb5;
}

/* Button Warning */
.btn-warning {
	color: #000;
	background-color: #ffc107;
	border-color: #ffc107;
}
.btn-warning:hover {
	background-color: #ffca2c;
	border-color: #ffc720;
}

/* Alert Success */
.alert-success {
	color: #0f5132;
	background-color: #d1e7dd;
	border-color: #badbcc;
}