/* MicroApps.Rad: the stylesheet of RadzenDataGridX and the AppKit parts. Link it once, after the Radzen theme. */

/* The columns without a Width never shrink below the grid's MinColumnWidth: below the sum RadzenDataGridX writes into
   --microapps-grid-min-width, the grid scrolls sideways inside itself. Off while Radzen drags a column edge, so the table
   follows the pointer. */
.microapps-data-grid > .rz-data-grid-data > .rz-grid-table:not(:has(.rz-column-resizer[style*="100%"])) {
	min-width: var(--microapps-grid-min-width);
}

/* Reset view and Compact rows, under a grid that keeps its view, on the pager's leading edge. */
.microapps-grid-reset {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 0.25rem 1rem;
	margin-block-start: 0.25rem;
}

.microapps-grid-density {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
}

/* Below 768 px an ungrouped grid's group bar holds the column picker only: a header cannot be dragged by touch, and the hint
   beside the picker wrapped to a word or two per line. A drop still lands anywhere on the bar. */
@media (max-width: 767.98px) {
	.microapps-data-grid > .rz-group-header > .rz-group-header-drop {
		display: none;
	}
}

/* AppKit's SiteLoader: a dim over the page, nothing at its centre. It fades in slowly after a short delay, so short waits stay
   faint and long ones become obvious, and goes at once when the work ends; an app changes it through the variables. */
.microapps-site-loader {
	position: fixed;
	inset: 0;
	z-index: var(--microapps-site-loader-z-index, 9999999);
	background: var(--microapps-site-loader-background, rgba(0, 0, 0, 0.5));
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--microapps-site-loader-fade, 1.5s);
	transition-delay: var(--microapps-site-loader-delay, 0.1s);
}

.microapps-site-loader-active {
	opacity: var(--microapps-site-loader-opacity, 0.75);
	visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
	.microapps-site-loader {
		transition: none;
	}
}

/* AppKit's RowMenu: a parent opens its children in place, inside the menu. Radzen gives a submenu the floating panel of a
   horizontal menu, which in this vertical menu would hang over the items below it; the :not() matches Radzen's own weight. */
.microapps-row-menu .rz-menu:not(.rz-profile-menu) .rz-navigation-menu {
	position: static;
	min-width: 0;
	padding-block: 0;
	padding-inline: 1.25rem 0;
	box-shadow: none;
	border: 0;
	border-radius: 0;
	background-color: transparent;
}

/* AppKit's UpdateBanner: sticky at the top of the scrolling body, so it stays in view. The default blue keeps white text
   above 4.5:1 in both appearances. */
.microapps-update-banner {
	position: sticky;
	top: 0.5rem;
	z-index: 5;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border-radius: 12px;
	background: var(--microapps-update-banner-background, #2563C9);
	color: var(--microapps-update-banner-color, #FFFFFF);
	box-shadow: var(--microapps-update-banner-shadow, 0 12px 40px rgba(6, 15, 46, 0.28));
}

.microapps-update-text {
	flex: 1 1 16rem;
	font-weight: 600;
}

.microapps-update-banner .rzi.microapps-update-icon {
	color: var(--microapps-update-banner-color, #FFFFFF);
}

.microapps-update-banner .rz-button.microapps-update-button {
	background: var(--microapps-update-button-background, #FFFFFF);
	color: var(--microapps-update-button-color, #0B1A4A);
}

/* AppKit's BuildStamp: the build's time on a line of its own, its label and value never split. */
.microapps-build-stamp {
	display: block;
	white-space: nowrap;
}

/* AppKit's TechInfoRow, in TechInfo and HistoryVersionView: a long value wraps anywhere rather than widen the dialog. */
.rz-label.microapps-techinfo-label {
	display: block;
	width: 100%;
}

.microapps-techinfo-value {
	overflow-wrap: anywhere;
}

.microapps-facts-json {
	margin-block-start: 1rem;
}

.microapps-facts-json > summary {
	cursor: pointer;
	font-weight: 600;
}

.microapps-facts-json > pre {
	max-height: 24rem;
	overflow: auto;
	margin: 0.5rem 0 0;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

/* AppKit's FiltersArea: a hairline frame around a list's filter rows, tinted while they narrow the list. The defaults follow the
   theme's warning family, so each app's palette tints it; an app picks its own through the variables. */
.microapps-filters-area {
	padding: var(--microapps-filters-area-padding, 10px 5px);
	border: var(--rz-grid-cell-border);
	border-radius: var(--rz-grid-border-radius);
}

.microapps-filters-area.microapps-filters-area-active {
	background-color: var(--microapps-filters-area-active-background, var(--rz-warning-lighter));
	border-color: var(--microapps-filters-area-active-border-color, var(--rz-warning));
}

/* AppKit's PasswordBox: the input fills the box, and its eye sits inside the field's end, centred, with room kept so the text
   never runs under it. The box takes the input's dir, so in a left-to-right password on a right-to-left page both sit right. */
.microapps-password-box {
	position: relative;
	display: block;
}

.microapps-password-box > .rz-textbox {
	width: 100%;
	padding-inline-end: var(--microapps-password-eye-room, 2.5rem);
}

.microapps-password-box > .microapps-password-eye {
	position: absolute;
	inset-block: 0;
	inset-inline-end: 0.25rem;
	margin-block: auto;
	height: fit-content;
}
