:root {
	--nav-width: 270px;
	/* --calendar-sidepanel-width is set at runtime from the user's saved width (js/calendarSidePanelResize.js) */
	--calendar-settings-width: var(--calendar-sidepanel-width, 350px);
	--calendar-adjustment-width: 10px;
}

@media (max-width: 1368px) {
	app {
		--nav-width: 0px;
	}

		app .header-left-side .header-logo {
			display: flex !important;
		}

		app .sidebar {
			display: none !important;
		}

		app .collapse-toggle .sidebar {
			display: flex !important;
		}

		app .collapse-toggle .header-left-side {
			min-width: var(--nav-width);
		}
}

.app.collapse-toggle {
	--nav-width: 0px;
}

/* Indent sub groups of accordion */
.dxbl-accordion .dxbl-accordion-group > .dxbl-accordion-group-body > .dxbl-accordion-items-container {
	margin-left: 15px;
}

/* Disable wrapping on grid columns */
.grid-nowrap {
	background-color: inherit;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
/* Enable wrapping on grid columns */
.grid-wrap {
	background-color: inherit;
	overflow: auto;
	text-overflow: inherit;
	white-space: normal;
}
/* pre-line only on body cells (keeps line breaks in memo text). On the grid root it is inherited by the header and
   footer, where the newlines between their inline elements render as blank lines and double the row height. */
.grid-wrap .dxbl-grid-table > tbody > tr > td,
.grid-wrap .dxbl-treelist-table > tbody > tr > td {
	white-space: pre-line;
}

/* Hide all disabled buttons inside DevExpress Blazor text edit controls */
.dxbl-text-edit .dxbl-btn:disabled,
.dxbl-text-edit .dxbl-btn.dxbl-disabled {
	display: none;
}

/* Tighten up spacing between layout groups and items */
.dxbl-fl {
	--dxbl-fl-group-spacing-y: 0.2rem;
	--dxbl-fl-item-spacing-y: 0.2rem;
}

	.dxbl-fl.dxbl-sm {
		--dxbl-fl-group-spacing-y: 0.2rem;
		--dxbl-fl-item-spacing-y: 0.2rem;
	}

/* Email To, Cc and Bcc buttons */
.email-to-cc-bcc-button {
	width: 90px !important;
	max-width: 90px !important;
	min-width: 90px !important;
	display: block;
}

.email-to-cc-bcc-button-group {
	min-width: 120px !important;
	max-width: 120px !important;
	display: block;
}

/* Calendar date selection width */
.calendar-selectdate {
	width: 100%;
	min-width: 80px !important;
	display: block;
}

/* Calendar view selection */
.calendar-viewselect {
	width: 100%;
	min-width: 80px !important;
	display: block;
}

/* Calendar settings selection */
.calendar-settingsselect {
	width: 100%;
	min-width: 80px !important;
	display: block;
}

/* Calendar filter selection */
.calendar-filterselect {
	width: 100%;
	min-width: 80px !important;
	display: block;
}

/* Remove calendar dashboard view outer border and internal coloring */
.dxbl-theme-fluent .main-ribbon-template.app .detail-view-content > .dxbl-fl:has(dxbl-form-layout-item:not(.dxbl-group *):not(.dxbl-fl-tab-content *)):not(:has(.xaf-single-layout-item)) {
	background-color: unset !important;
	border: none !important;
	border-radius: unset !important;
	padding: 0px !important;
}

/* Calendar layout */
.calendar-layout {
	flex-wrap: nowrap !important;
}

/* Calendar main panel */
.calendar-mainpanel {
	min-width: 0;
	max-width: calc(100vw - var(--nav-width) - var(--calendar-adjustment-width) - var(--calendar-settings-width));
	/* Zero basis so a wider side panel shrinks the main panel instead of wrapping below it */
	flex: 1 1 0%;
	transition: max-width 0.2s ease;
}

/* Calendar side panel */
.calendar-sidepanel {
	width: var(--calendar-settings-width);
	max-width: var(--calendar-settings-width);
	overflow: hidden;
	transition: max-width 0.2s ease;
}

/* Calendar side panel resize grip (left edge), added by LibBlazorCalendarViewController when AllowSidePanelResize is true;
	 drag handling is in js/calendarSidePanelResize.js */
.calendar-sidepanel-resizable {
	position: relative;
}

.calendar-sidepanel-resizable::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 6px;
	z-index: 10;
	cursor: col-resize;
}

.calendar-sidepanel-resizable:hover::before,
body.calendar-sidepanel-resizing .calendar-sidepanel-resizable::before {
	background-color: var(--dxbl-primary, #0d6efd);
	opacity: 0.25;
}

body.calendar-sidepanel-resizing {
	cursor: col-resize;
	user-select: none;
}

/* Don't animate while dragging or the panels lag behind the pointer */
body.calendar-sidepanel-resizing .calendar-mainpanel,
body.calendar-sidepanel-resizing .calendar-sidepanel {
	transition: none;
}

/* Master detail grid - allows master detail view to be displayed immediately under the list view */
.xaf-masterdetail-container.direction-vertical {
	height: unset;
}

.xaf-masterdetail-listview {
	min-height: 150px;
}

	.xaf-masterdetail-listview > .grid-content {
		min-height: 150px;
	}

/* Pdf Viewer */
.welcome-pdf-viewer {
	width: 100%;
	height: 500px;
}

.welcome-pdf-viewer .dxbrv-toolbar {
	height: 2rem;
}

.pe-pdf-viewer .dxbrv-toolbar {
	height: 2rem;
}

.pe-pdf-viewer {
	width: 100%;
	height: 85vh;
}

/* Email/Calendar Auth */
.auth-area {
	width: 100%;
	text-align: center;
	padding: 30px 0px 30px 0px;
}

.auth-header {
	margin-bottom: 30px;
}

.auth-message {
	margin-bottom: 30px;
}

/* Cloud Storage Picker */
.modal {
	z-index: 99999 !important;
}

.modal-backdrop {
	z-index: 99998 !important;
}

.modal.show {
	display: block !important;
}

.border-primary {
	border-width: 2px !important;
}

/* Richedit */
.xaf-richedit-height-default {
	height: 600px !important;
}

.xaf-richedit-height-very-large {
	height: 520px !important;
}

.xaf-richedit-height-large {
	height: 400px !important;
}

.xaf-richedit-height-medium {
	height: 300px !important;
}

.xaf-richedit-height-small {
	height: 140px !important;
}

.xaf-richedit-height-very-small {
	height: 100px !important;
}

.dropdown-hidden {
	display: none;
}

/* Center the toast validation warnings container vertically and horizontally */
.xaf-alerts-stack-inner {
	justify-content: center;
	align-items: center;
	bottom: 50% !important;
	left: 50% !important;
	transform: translate(-50%, 50%);
	position: fixed;
}

/* Remove the XAF slide up/down animations on the alerts. XAF's main.js waits for animationend before it
   finishes showing or hiding an alert (hiding has no fallback timeout), so animation: none would leave
   closed alerts on screen. Use a no-op animation that ends almost immediately instead. */
@keyframes psi-alert-no-motion {
	from { opacity: 1; }
	to { opacity: 1; }
}

.xaf-alerts-stack .xaf-alert.showing,
.xaf-alerts-stack .xaf-alert.hiding,
.xaf-alerts-stack .xaf-alert.moving-down {
	animation: psi-alert-no-motion 1ms linear !important;
}

/* BlazorFontFamilyPropertyEditor: the edit box template wrapper carries the selected font-family inline;
   make the DxInputBox input inherit it (DX theme styles otherwise set the input font). */
.psi-font-family-edit-box {
	display: flex;
	align-items: center;
	width: 100%;
	min-width: 0;
}

.psi-font-family-edit-box input {
	font-family: inherit !important;
}
