#appToastContainer {
	max-width: min(420px, calc(100vw - 1.5rem));
}

#appToastContainer .toast-dismiss {
	background: none;
	border: 0;
	color: inherit;
	font-size: 1.25rem;
	line-height: 1;
	opacity: 0.85;
}

body {
	font-family: "Montserrat", sans-serif;
	font-optical-sizing: auto;
	font-weight: 400;
	font-style: normal;
}

/* Global disabled button look: grey bg + black text */
button:disabled,
.btn:disabled,
.btn.disabled,
fieldset:disabled .btn,
[role="button"].disabled,
[role="button"][aria-disabled="true"] {
	background-color: rgba(192, 192, 192, 0.35) !important;
	border-color: rgba(192, 192, 192, 0.35) !important;
	color: rgba(0, 0, 0, 0.35) !important;
	opacity: 1 !important; /* don't dim entire button; use RGBA colors */
}

button:disabled:hover,
.btn:disabled:hover,
.btn.disabled:hover,
fieldset:disabled .btn:hover,
[role="button"].disabled:hover,
[role="button"][aria-disabled="true"]:hover,
button:disabled:focus,
.btn:disabled:focus,
.btn.disabled:focus,
fieldset:disabled .btn:focus,
[role="button"].disabled:focus,
[role="button"][aria-disabled="true"]:focus {
	background-color: rgba(192, 192, 192, 0.35) !important;
	border-color: rgba(192, 192, 192, 0.35) !important;
	color: rgba(0, 0, 0, 0.35) !important;
	box-shadow: none !important;
}

/* Sticky footer: short pages pin footer to viewport bottom; long pages scroll normally */
main {
	flex: 1 0 auto;
}

.site-footer {
	flex-shrink: 0;
}

.overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 2000;
}

.overlay-content {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: white;
}

/* Shared dim overlay */
.status-confirm-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 1070;
}

/* Add / edit moving history — above Edit Resident, below history dialog at 1065 */
.status-confirm-overlay.resident-history-submodal-overlay {
	z-index: 1060;
}

#residentAddHistoryModal,
#residentEditHistoryModal {
	--bs-modal-zindex: 1065;
}

#quarterStatusConfirmModal,
#residentStatusConfirmModal,
#residentMovingHistoryConfirmModal,
#suStatusConfirmModal,
#staffStatusConfirmModal {
	--bs-modal-zindex: 1075;
}

#residentHistoryBody tr.resident-history-row {
	cursor: pointer;
}

.no-hover-btn:hover,
.no-hover-btn:focus,
.no-hover-btn:active {
	background-color: transparent !important;
	color: inherit !important;
	box-shadow: none !important;
}

.menu-btn {
	height: 50px;
}

.table-scroll-y {
	overflow-y: auto;
}

/* Choices.js in Bootstrap input-group (Service Unit modal) */
#detailsModal .input-group > .choices {
	flex: 1 1 auto;
	width: 1%;
	min-width: 0;
	margin-bottom: 0;
}

#detailsModal .choices__list--dropdown {
	z-index: 1060;
}

.table-col-narrow {
	width: 60px;
}

.login-code-input {
	width: 27%;
}

/* Date/time placeholders – black text (search report + checklist report) */
#pickupDateFrom::placeholder,
#pickupDateTo::placeholder,
#pickupDate::placeholder {
	color: #000;
}

.login-code-button {
	width: 73%;
}

/* Allow long words to break if needed, but maintain natural column widths */
.table, .table th, .table td {
	word-break: break-word;
}

/* Prevent tables from shrinking to fit container - maintain natural column widths */
.table-responsive {
	overflow-x: auto;
}

/* Ensure table maintains its natural width and doesn't shrink */
.table-responsive table,
.table-responsive .table {
	width: max-content !important;
	min-width: 100%;
}

/* Prevent columns from being compressed - maintain minimum content width */
.table-responsive .table th,
.table-responsive .table td,
.table-responsive th,
.table-responsive td {
	min-width: fit-content;
}

/* DataTables: center Export to Excel when it wraps below the page-length control */
div.dt-container > div.row.mt-2.justify-content-between {
	container-type: inline-size;
}

@media screen and (max-width: 767px) {
	div.dt-container div.dt-layout-end:has([id*="Export"]) {
		width: 100%;
		margin-left: 0 !important;
		margin-right: 0 !important;
		display: flex;
		justify-content: center !important;
		text-align: center;
	}
}

@container (max-width: 32rem) {
	div.dt-container div.dt-layout-end:has([id*="Export"]) {
		flex: 0 0 100%;
		max-width: 100%;
		margin-left: 0 !important;
		margin-right: 0 !important;
		display: flex;
		justify-content: center !important;
		text-align: center;
	}
}

/* Responsive card header layout for narrow screens */
@media (max-width: 768px) {
	/* Stack card title and buttons vertically on mobile */
	.card-title.d-flex.justify-content-between {
		flex-direction: column !important;
		align-items: flex-start !important;
		gap: 1rem;
	}
	
	/* Make button container full width and stack buttons */
	.card-title.d-flex.justify-content-between > div {
		width: 100%;
		display: flex;
		flex-direction: column;
		gap: 0.5rem;
	}
	
	/* Make buttons full width on mobile and remove horizontal margins */
	.card-title.d-flex.justify-content-between > div .btn {
		width: 100%;
		margin-right: 0 !important;
		margin-left: 0 !important;
		margin-bottom: 0;
	}
	
	/* Remove margin between buttons when stacked */
	.card-title.d-flex.justify-content-between > div .btn:last-child {
		margin-bottom: 0;
	}
	
	/* Handle single button case (like home button) */
	.card-title.d-flex.justify-content-between > .btn {
		width: 100%;
		margin-top: 0;
	}
}

/* Quarters / residents: date range — from on line 1, to on line 2, right-aligned */
.lease-term-cell,
.lease-term-single {
	display: block;
	text-align: right;
	white-space: nowrap;
}

.lease-term-cell {
	line-height: 1.35;
}

.lease-term-cell .lease-term-from,
.lease-term-cell .lease-term-to {
	text-align: right;
}

.lease-term-cell .lease-term-to {
	padding-top: 0.15em;
}

/* Filter panel title toggle (expand / collapse) — matches home btn-light pill */
.filter-collapse-toggle {
	padding: 0.375rem 0.75rem !important;
}

.filter-collapse-toggle .card-title {
	line-height: 1.2;
}

/* Add-image tile inside an image group (checklist report edit) */
.image-group-add-tile {
	background-color: var(--bs-light, #f8f9fa);
	color: var(--bs-secondary, #6c757d);
	border-color: var(--bs-border-color, #dee2e6) !important;
}

.image-group-add-tile:hover,
.image-group-add-tile:focus {
	background-color: var(--bs-gray-200, #e9ecef);
	color: var(--bs-dark, #212529);
}

.image-group-add-tile .bi-plus-lg {
	font-size: 2rem;
	line-height: 1;
}

/* Full-screen image viewer (checklist report) */
#imageViewerModal .modal-content.image-viewer-content {
	height: 100%;
	min-height: 100vh;
	min-height: 100dvh;
	border: 0;
	border-radius: 0;
	background: rgba(0, 0, 0, 0.92);
}

#imageViewerModal .image-viewer-body {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	padding: 3rem 1rem 1rem;
	overflow: hidden;
}

#imageViewerModal .image-viewer-stage {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
}

#imageViewerModal #imageViewerImg {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

#imageViewerModal .image-viewer-caption {
	flex: 0 0 auto;
	width: 100%;
	max-width: 48rem;
	margin: 0;
	padding: 0.75rem 1rem 0.25rem;
	color: #f8f9fa;
	text-align: center;
	font-size: 0.95rem;
	line-height: 1.45;
	word-break: break-word;
}

#imageViewerModal .image-viewer-close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	z-index: 2;
}

#imageViewerModal .image-viewer-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	border: none;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	padding: 0;
	background: rgba(255, 255, 255, 0.85);
	color: #212529;
	font-size: 1.5rem;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

#imageViewerModal .image-viewer-nav-prev {
	left: 0.75rem;
}

#imageViewerModal .image-viewer-nav-next {
	right: 0.75rem;
}

#imageViewerModal .image-viewer-nav:disabled {
	opacity: 0.35;
	cursor: default;
}