﻿:root {
    --es-action-button-radius: var(--es-company-radius, 12px);
    --es-visual-viewport-width: 100vw;
    --es-visual-viewport-offset-top: 0px;
    --es-visual-viewport-offset-left: 0px;
    --es-platform-card-hover-lift: -2px;
    --es-platform-card-hover-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
    --es-platform-card-hover-shadow-soft: 0 10px 22px rgba(15, 23, 42, 0.06);
}

/* Action corners follow the published branding, including live changes.
   Navigation rows, tabs and clickable cards keep their structural shape.
   The important layer also wins over older extension-specific radius rules. */
@layer es-action-shape {
html body :is(
    .mud-button-root,
    .btn,
    .es-action-button,
    .es-home-tile-action,
    .es-home-agent-tile__split-button,
    .es-capabilities-row-open,
    .es-admin-page-header-actions > button,
    [class$="-actions"] > button,
    button[class$="-action"],
    a[role="button"],
    input[type="button"],
    input[type="submit"],
    input[type="reset"]
) {
    border-radius: var(--es-action-button-radius) !important;
}

/* A joined button group has one rounded outside edge, without gaps inside. */
html body .mud-button-group-root {
    border-radius: var(--es-action-button-radius) !important;
    overflow: hidden;
}

html body .mud-button-group-root .mud-button-root {
    border-radius: 0 !important;
}
}

html, body {
    font-family: var(--es-company-font, 'Roboto', 'Segoe UI', sans-serif);
}

/* Shared dimensions and page surface for the four main workspaces. */
.es-box-page {
    --es-box-workspace-max-width: 1380px;
    --es-box-surface-border: color-mix(in srgb, var(--es-company-accent, var(--mud-palette-secondary)) 17%, var(--mud-palette-lines-default));
    --es-box-workspace-background:
        radial-gradient(circle at 15% 0%, color-mix(in srgb, var(--es-company-accent, var(--mud-palette-secondary)) 9%, transparent), transparent 30%),
        var(--mud-palette-background);
}

/* Reserve the scrollbar even on short pages, so navigation cannot move the
   header or change the available content width. Chat keeps its own scroller. */
html:has(.es-box-page:is(.es-home-page, .es-store-page, .es-settings-shell, .es-activities-page)) {
    scrollbar-gutter: stable;
}

@supports not (scrollbar-gutter: stable) {
    html:has(.es-box-page:is(.es-home-page, .es-store-page, .es-settings-shell, .es-activities-page)) {
        overflow-y: scroll;
    }
}

/* A viewport-sized gradient looks identical on short and long pages. Keep
   the solid branding background below it instead of stretching the glow. */
.es-box-page:is(.es-home-page, .es-store-page, .es-settings-shell, .es-activities-page):not(.es-admin-shell-embedded) {
    background: var(--es-box-workspace-background) !important;
    background-size: 100% 100vh !important;
    background-size: 100% 100svh !important;
    background-repeat: no-repeat !important;
}

.es-box-page > :is(.es-home-workspace, .es-store-content, .es-activities-main),
.es-box-page.es-settings-shell:not(.es-admin-shell-embedded) > :is(.es-admin-shell-grid, .es-settings-page-introduction) {
    width: min(100%, var(--es-box-workspace-max-width));
    max-width: var(--es-box-workspace-max-width);
    min-width: 0;
    box-sizing: border-box;
    margin-inline: auto;
}

.mud-icon-root.mud-svg-icon,
.mud-icon-root > svg {
    width: 1em !important;
    height: 1em !important;
    max-width: 1em !important;
    max-height: 1em !important;
    display: inline-block;
    flex-shrink: 0;
    fill: currentColor;
}

/* Global app background that covers full viewport and scrolls with content */
html, body, #app, .app, .page, main {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    min-height: 100vh;  /* fallback */
    min-height: 100dvh; /* preferred */
    min-height: var(--es-visual-viewport-height, 100dvh);
}

/* Make the main page wrapper stretch so component children can grow and allow scrolling */
.page {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    align-self: stretch;
    /* subtle vertical gradient matching existing UI look */
    background: linear-gradient(180deg, rgba(248,251,255,1) 0%, rgba(255,255,255,1) 100%);
}

/* Ensure the app root takes full height and lets children control scrolling */
#app {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.mud-snackbar-location-top-left,
.mud-snackbar-location-top-center,
.mud-snackbar-location-top-right {
    top: calc(118px + env(safe-area-inset-top, 0px)) !important;
    z-index: 100050 !important;
}

.mud-snackbar {
    max-width: min(640px, calc(100vw - 32px)) !important;
}

.mud-snackbar-content-message {
    white-space: normal !important;
    line-height: 1.35;
}

@media (max-width: 780px) {
    .mud-snackbar-location-top-left,
    .mud-snackbar-location-top-center,
    .mud-snackbar-location-top-right {
        top: calc(150px + env(safe-area-inset-top, 0px)) !important;
        left: 12px !important;
        right: 12px !important;
    }
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* The delegation diagram uses the surrounding page surface without a second frame. */
.es-agents-overview-page {
	display: flex !important;
	flex-direction: column !important;
	min-height: 100dvh !important;
}

.es-agents-overview-page.es-admin-shell-embedded {
	display: block !important;
	height: auto !important;
	min-height: auto !important;
}

.es-agents-overview-page > .es-admin-shell-grid {
	flex: 1 1 auto !important;
	min-height: 0 !important;
	align-items: stretch !important;
}

.es-agents-overview-page > .es-admin-shell-grid > .es-admin-shell-content,
.es-agents-overview-main {
	height: 100% !important;
	min-height: 0 !important;
	display: flex !important;
	flex-direction: column !important;
}

.es-agents-overview-main > .es-agents-overview-desktop {
	flex: 1 1 auto !important;
	min-height: 0 !important;
}

.es-agent-org-chart {
	border: 0 !important;
	border-radius: 0 !important;
	padding: 0 !important;
	display: flex !important;
	flex: 1 1 auto !important;
	min-height: 0 !important;
	max-height: 760px !important;
	flex-direction: column !important;
}

.es-agent-org-chart-scroll {
	flex: 1 1 auto !important;
	min-height: 0 !important;
	padding: 0 !important;
	margin: 10px -28px 0 !important;
	overflow-y: auto !important;
}

@media (max-width: 1100px) {
	.es-agent-org-chart-scroll {
		margin: 10px -22px 0 !important;
	}
}

@media (max-width: 760px) {

	.es-agents-overview-mobile-list {
		gap: 10px !important;
		margin-top: 10px !important;
		border: 0 !important;
		overflow: visible !important;
		background: transparent !important;
		box-shadow: none !important;
	}

	.es-agents-overview-mobile-row {
		border: 1px solid var(--mud-palette-lines-default) !important;
		border-radius: 12px !important;
	}

	.es-agents-overview-mobile-row:last-child {
		border-bottom: 1px solid var(--mud-palette-lines-default) !important;
	}

	.es-agent-org-chart-scroll {
		margin: 10px -16px 0 !important;
	}
}

/* Agent overview: filtering controls are intentionally omitted. */
.es-agents-overview-tools,
.es-agents-overview-mobile-tools,
.es-agents-overview-mobile-filters {
    display: none !important;
}

/* The administration frame fills the remaining viewport without overflowing it. */
.es-verwaltung-page:has(.es-agents-overview-page) {
	display: flex !important;
	flex-direction: column !important;
	padding-bottom: 10px !important;
}

.es-verwaltung-page:has(.es-agents-overview-page) > .es-admin-shell-grid {
	flex: 1 1 auto !important;
	min-height: 0 !important;
	align-items: stretch !important;
}

.es-verwaltung-page:has(.es-agents-overview-page) > .es-admin-shell-grid > .es-admin-sidebar {
	align-self: start !important;
	height: auto !important;
	min-height: auto !important;
}

.es-verwaltung-page:has(.es-agents-overview-page) > .es-admin-shell-grid > .es-verwaltung-content {
	height: 100% !important;
	min-height: 0 !important;
	display: flex !important;
	flex-direction: column !important;
	padding-bottom: 0 !important;
}

.es-verwaltung-page:has(.es-agents-overview-page) .es-agents-overview-page.es-admin-shell-embedded {
	display: flex !important;
	flex: 1 1 auto !important;
	height: auto !important;
	min-height: 0 !important;
}

.es-verwaltung-page:has(.es-agents-overview-page) .es-agents-overview-page.es-admin-shell-embedded > .es-admin-shell-embedded-content {
	display: flex !important;
	flex: 1 1 auto !important;
	flex-direction: column !important;
	height: auto !important;
	min-height: 0 !important;
}

.es-verwaltung-page:has(.es-agents-overview-page) .es-agent-org-chart {
	max-height: none !important;
}

/* Keep the agent tree centered inside the available chart viewport. */
.es-verwaltung-page:has(.es-agents-overview-page) .es-agent-org-chart-scroll {
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
}

.es-verwaltung-page:has(.es-agents-overview-page) .es-agent-org-chart-roots {
	flex: 0 0 auto !important;
	margin-block: auto !important;
}

/* Introduction owns the spacing before every main workspace. */
.es-box-page .es-page-content-stack { display: flex; flex-direction: column; gap: 0; }

/* Local navigation feedback appears in the same click that opens a destination. */
.es-navigation-pending[hidden] { display: none !important; }
.es-navigation-pending {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    background: var(--mud-palette-background, #fff);
    color: var(--mud-palette-text-primary, #222);
    text-align: center;
}
.es-navigation-pending h1 { margin: 0; font-size: 1.35rem; overflow-wrap: anywhere; }
.es-navigation-pending p { margin: 0; color: var(--mud-palette-text-secondary); }
.es-navigation-pending-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid color-mix(in srgb, currentColor 16%, transparent);
    border-top-color: var(--es-company-accent, var(--mud-palette-secondary, currentColor));
    border-radius: 50%;
    animation: es-navigation-spin 900ms linear infinite;
}
@keyframes es-navigation-spin { to { transform: rotate(360deg); } }
.es-home-page a.es-home-tile-action,
.es-home-page a.es-home-agent-tile__split-main { text-decoration: none; }
.es-home-page a[aria-disabled="true"] { opacity: .45; cursor: default; }
