#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    inset-inline-start: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    inset-inline-end: 0.75rem;
    top: 0.5rem;
}

/* Arabic: the theme's Roboto has no Arabic glyphs, so the Radzen font variable points at system fonts with full Arabic coverage
   until the owner picks a brand font (DESIGN.md, Typography); Arabic script needs more line height than Latin. */
html[lang="ar"] {
    --rz-text-font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", Arial, sans-serif;
    --rz-body-line-height: 1.7;
}

/* The start-up screen in App.razor. Prerendering is off, so the page is empty until WebAssembly starts; once the app has rendered
   its first layout the screen goes (DESIGN.md, Empty, loading and error states). */
.app-starting {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background-color: var(--rz-body-background-color);
    color: var(--rz-text-secondary-color);
}

.app-starting img {
    height: 4rem;
    width: auto;
}

/* The browser check's message (App.razor, D-097) is a sentence where "Loading" is a word: centred lines off the screen's edges. */
.app-starting span {
    max-width: 32rem;
    padding-inline: 1rem;
    text-align: center;
}

body:has(.rz-layout) .app-starting,
body:has(.crm-report) .app-starting {
    display: none;
}

/* The staff shell (DESIGN.md, Staff shell): ProjectFlow's canvas (D-078), a rounded panel inset 1rem in a frame of the sidebar's colour,
   with a soft band of the primary colour across its top; the page's gutters within 1440px, 16px on phones, 24px on tablets and 32px
   from 1024px; and below 960px the sidebar as a drawer under the header (MainLayout opens it with .crm-drawer-open). */
.rz-layout {
    --rz-layout-body-padding: 0;
}

/* The staff shell's layout alone: the sign-in page's has no sidebar, and keeps its brand backdrop edge to edge. */
.rz-layout:has(> .rz-sidebar) {
    background-color: var(--rz-sidebar-background-color);
}

.rz-layout:has(> .rz-sidebar) > .rz-body {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
    border-radius: 22px;
    background-color: var(--rz-layout-body-background-color);
    background-image: linear-gradient(180deg, color-mix(in srgb, var(--rz-primary) 10%, transparent), transparent 16rem);
    background-repeat: no-repeat;
}

.rz-layout > .rz-sidebar {
    display: flex;
    flex-direction: column;
}

.crm-page {
    margin-inline: auto;
    padding: 1.5rem 2rem 3.5rem;
}

@media (max-width: 1023px) {
    .crm-page {
        padding-inline: 1.5rem;
    }
}

@media (max-width: 767px) {
    .crm-page {
        padding: 1rem 1rem 2.5rem;
    }
}

@media (max-width: 960px) {

    .rz-layout > .rz-sidebar {
        position: fixed;
        z-index: 4;
        inset-block: var(--rz-header-min-height) 0;
        inset-inline-start: 0;
        width: var(--rz-sidebar-width) !important;
        max-inline-size: calc(100vw - 3rem);
        opacity: 1;
        box-shadow: var(--rz-shadow-3);
        visibility: hidden;
        transform: translateX(-100%);
        transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 320ms;
    }

    html[dir="rtl"] .rz-layout > .rz-sidebar {
        transform: translateX(100%);
    }

    html[dir] .rz-layout.crm-drawer-open > .rz-sidebar {
        visibility: visible;
        transform: none;
        transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
    }
}

@media (max-width: 960px) and (prefers-reduced-motion: reduce) {
    html[dir] .rz-layout > .rz-sidebar,
    html[dir] .rz-layout.crm-drawer-open > .rz-sidebar {
        transition: none;
    }
}

/* The header's tour, feedback, language and Refresh buttons: on a phone the account menu's items stand in for them, so the header
   keeps room for the user chip. */
.crm-phone-menu-item {
    display: none !important;
}

@media (max-width: 576px) {
    .rz-header .crm-tour-button,
    .rz-header .crm-feedback-button,
    .rz-header .crm-help-link,
    .rz-header .crm-refresh-button,
    .rz-header .crm-lang-toggle {
        display: none !important;
    }

    .crm-phone-menu-item {
        display: flex !important;
    }
}

/* The CRM's theme settings (DESIGN.md, Radzen mapping): sentence case everywhere, since Arabic has no case; resting cards flat on the
   theme's hairline with 24px inside, as ProjectFlow's (D-078; a clickable card still rises on hover); the filters' frame tinted with
   primary lighter under a primary hairline while it narrows a list; and the guided tours' popover, the theme's dialog surface in both
   appearances, raised to a popover's shadow. */
:root {
    --rz-text-button-text-transform: none;
    --rz-text-overline-text-transform: none;
    --rz-card-shadow: none;
    --rz-card-padding: 1.5rem;
    --microapps-filters-area-active-background: var(--rz-primary-lighter);
    --microapps-filters-area-active-border-color: var(--rz-primary);
    --microapps-tour-shadow: var(--rz-shadow-3);
}

/* Dialogs in the light appearance (DESIGN.md, Forms and dialogs; the owner's rule for every Radzen project): a white surface under a
   slightly dimmer title bar. The dark appearance keeps the theme's own surfaces. */
:root:not(:has(#radzen-theme-link[href*="dark"])) {
    --rz-dialog-background-color: #ffffff;
    --rz-dialog-title-background-color: #e3eaf2;
}

/* The brand palette (DESIGN.md, Colors; D-086). branding/brand.css holds the installation's colours and is read as it is, so a site
   changes them without a rebuild; this hands them to Radzen in place of the theme's house blue and works out every shade from them.
   Each fixed value is that shade of the shipped colours, kept for a browser without CSS relative colours. Never add a shade to
   brand.css: derive it here, in both appearances. */
:root {
    --rz-primary: var(--brand-primary, #2d7b61);
    --rz-primary-light: #ade1d0;
    --rz-primary-lighter: rgba(83, 183, 149, 0.16);
    --rz-primary-dark: #215a47;
    --rz-primary-darker: #102d23;
    --rz-on-primary: var(--brand-on-primary, #ffffff);
    --rz-on-primary-light: var(--rz-primary-darker);
    --rz-on-primary-lighter: var(--rz-primary-darker);
    --rz-on-primary-dark: var(--brand-on-primary, #ffffff);
    --rz-on-primary-darker: var(--rz-primary-light);
}

@supports (color: hsl(from red h s calc(l + 1))) {
    :root {
        --rz-primary-light: hsl(from var(--brand-primary, #2d7b61) h s calc(l + 45));
        --rz-primary-lighter: hsl(from var(--brand-accent, #53b795) h s l / 0.16);
        --rz-primary-dark: hsl(from var(--brand-primary, #2d7b61) h s calc(l - 9));
        --rz-primary-darker: hsl(from var(--brand-primary, #2d7b61) h s calc(l - 21));
    }
}

/* The dark appearance, marked only by the theme link's href (ProjectFlow's and the CMS's selector; at (1,2,0) it outranks every :root
   rule): the main colour lightened to read on the dark surfaces, dark text on it, and the brand's own colour as primary dark, which
   keeps the brand's text colour (white on primary dark is 5.1:1, where the theme's light tint would be 3.5:1). */
:root:has(#radzen-theme-link[href*="dark"]) {
    --rz-primary: #71cbad;
    --rz-primary-light: #ade1d0;
    --rz-primary-lighter: rgba(113, 203, 173, 0.24);
    --rz-primary-dark: var(--brand-primary, #2d7b61);
    --rz-primary-darker: #102d23;
    --rz-on-primary: #102d23;
    --rz-on-primary-light: #102d23;
    --rz-on-primary-lighter: #ade1d0;
    --rz-on-primary-dark: var(--brand-on-primary, #ffffff);
    --rz-on-primary-darker: #ade1d0;
}

@supports (color: hsl(from red h s calc(l + 1))) {
    :root:has(#radzen-theme-link[href*="dark"]) {
        --rz-primary: hsl(from var(--brand-primary, #2d7b61) h s calc(l + 29));
        --rz-primary-light: hsl(from var(--brand-primary, #2d7b61) h s calc(l + 45));
        --rz-primary-lighter: hsl(from var(--brand-primary, #2d7b61) h s calc(l + 29) / 0.24);
        --rz-primary-darker: hsl(from var(--brand-primary, #2d7b61) h s calc(l - 21));
        --rz-on-primary: var(--rz-primary-darker);
        --rz-on-primary-light: var(--rz-primary-darker);
        --rz-on-primary-lighter: var(--rz-primary-light);
        --rz-on-primary-darker: var(--rz-primary-light);
    }
}

/* The selection tint (DESIGN.md, The One-Primary Rule). The house palette draws the current place and every selection from secondary
   lighter, its blue: these take the brand's tint instead, in both appearances, and secondary lighter turns a neutral tint of the
   theme's own secondary for what is left on it (secondary badges and alerts, such as a declined report). */
:root {
    --rz-secondary-lighter: color-mix(in srgb, var(--rz-secondary) 13%, transparent);
    --rz-panel-menu-item-active-background-color: var(--rz-primary-lighter);
    --rz-panel-menu-item-2nd-level-active-background-color: var(--rz-primary-lighter);
    --rz-panel-menu-item-3rd-level-active-background-color: var(--rz-primary-lighter);
    --rz-pager-numeric-button-selected-background-color: var(--rz-primary-lighter);
    --rz-grid-selected-background-color: var(--rz-primary-lighter);
    --rz-dropdown-item-selected-background-color: var(--rz-primary-lighter);
    --rz-tree-node-selected-background-color: var(--rz-primary-lighter);
    --rz-scheduler-view-selected-background-color: var(--rz-primary-lighter);
    --rz-datepicker-calendar-range-background-color: var(--rz-primary-lighter);
}

/* The logo for the appearance: branding/logo.png on light grounds, logo-dark.png on dark ones. */
.crm-logo-dark {
    display: none;
}

:root:has(#radzen-theme-link[href*="dark"]) .crm-logo-light {
    display: none;
}

:root:has(#radzen-theme-link[href*="dark"]) .crm-logo-dark {
    display: inline-block;
}

/* The sign-in page (DESIGN.md, Sign-in page): the canvas washed with the brand's two colours; the card's panel in the brand's main
   colour in both appearances, so its text keeps the brand's contrast; the logo on a white plate, its own ground. */
.crm-login-backdrop {
    background-color: var(--rz-body-background-color);
    background-image:
        radial-gradient(48rem 32rem at 0% 0%, color-mix(in srgb, var(--brand-accent, #53b795) 24%, transparent), transparent 70%),
        radial-gradient(48rem 32rem at 100% 100%, color-mix(in srgb, var(--brand-primary, #2d7b61) 18%, transparent), transparent 70%);
}

.crm-login-panel {
    background-color: var(--brand-primary, #2d7b61);
    background-image: radial-gradient(circle at 4rem 4rem, var(--brand-primary, #2d7b61) 0%, color-mix(in srgb, var(--brand-primary, #2d7b61) 45%, black) 85%);
}

.crm-login-panel :is(h1, h2, h3, p) {
    color: var(--brand-on-primary, #ffffff);
}

.crm-login-logo {
    display: inline-block;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    background-color: #ffffff;
    line-height: 0;
}

.crm-login-logo img {
    height: 4.5rem;
    width: auto;
}

/* A required field's label (DESIGN.md, Forms and dialogs): the asterisk is decoration, so its alternative text is empty and screen
   readers rely on the input's aria-required. No single danger token reads in both appearances (danger dark is near black in dark),
   so the theme's danger is mixed with its text colour: about 7.5:1 on white and 4.8:1 on the dark surface. */
.crm-required::after {
    content: " *";
    content: " *" / "";
    color: color-mix(in srgb, var(--rz-danger) 60%, var(--rz-text-color));
    font-weight: 700;
}

/* An add/edit dialog's Save and Cancel stay at the dialog's lower edge while a long form scrolls under them (the merge skill's
   rule). Pinned, the row stops at the dialog's inner padding: the shadow fills that band, so nothing shows under the buttons. */
.app-dialog-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background-color: var(--rz-dialog-background-color, var(--rz-base-background-color));
    box-shadow: 0 var(--rz-dialog-content-padding, 1.5rem) 0 0 var(--rz-dialog-background-color, var(--rz-base-background-color));
}

/* A record shown read-only to a role without the Edit tick. A disabled fieldset disables only native inputs, so Radzen's own widgets
   lose their clicks here; dialogs put it inside each tab, since Radzen's tab headers are buttons it would disable. */
.crm-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.crm-fieldset:disabled :is(.rz-dropdown, .rz-switch, .rz-chkbox, .rz-datepicker, .rz-numeric, .rz-radio-button-list, .rz-selectbutton) {
    pointer-events: none;
}

/* A dialog's save error prints the server's reason in a <pre>, so its line breaks survive. It takes the page's font, since a
   monospace one breaks Arabic letters apart, and long lines wrap inside the alert instead of widening it. */
.rz-alert pre {
    white-space: pre-wrap;
    margin: 0.5rem 0 0;
    font-family: inherit;
}

/* Tabular lining figures in every grid cell and wherever .crm-tnum marks a number, so amounts, codes and times hold still (DESIGN.md,
   The Tabular-Figures Rule). */
.rz-grid-table td,
.crm-tnum {
    font-feature-settings: "tnum" 1, "lnum" 1;
}

/* A date past due on an open record (DESIGN.md, The Colour-Plus-Words Rule): the danger colour, a clock and a title that says why. */
.crm-overdue {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--rz-danger);
}

.crm-overdue .rzi {
    font-size: 1.1em;
}

/* An activity's type: its icon beside its word (DESIGN.md, The Colour-Plus-Words Rule), in the lists, the panels and the dialog's picker. */
.crm-activity-type {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.crm-activity-type .rzi {
    font-size: 1.15em;
}

.crm-muted {
    color: var(--rz-text-secondary-color);
}

/* The charts' word legend and empty state (DESIGN.md, Charts): Radzen's legend is off, so each series' word sits under the chart beside its
   swatch, and a chart with nothing to draw says so in words. Shared by the Home and the reports. */
.crm-chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 20px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: var(--rz-text-secondary-color);
}

.crm-chart-legend li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.crm-chart-swatch {
    flex: none;
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.crm-chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    margin: 0;
    text-align: center;
}

/* A record page (DESIGN.md, Record pages): the head with its chips and actions, the summary band, and a tab's facts card. Shared by the
   account and opportunity files, so they live here rather than in one page's scoped styles. */
.crm-file-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 16px 20px;
    border: 1px solid var(--rz-base-200);
    border-radius: 14px;
    background: var(--rz-base-background-color);
}

.crm-file-name {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.crm-file-card {
    padding: 14px 16px;
    border: 1px solid var(--rz-base-200);
    border-radius: 14px;
    background: var(--rz-base-background-color);
}

.crm-file-card dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    margin: 0;
    font-size: 14px;
}

.crm-file-card dt {
    color: var(--rz-text-secondary-color);
}

.crm-file-card dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.crm-file-note {
    margin: 12px 0 0;
    font-size: 14px;
    white-space: pre-wrap;
}

.crm-file-band {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 40px;
}

.crm-file-band .crm-file-figure {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.crm-file-band .crm-file-figure span:first-child {
    font-size: 0.75rem;
    color: var(--rz-text-secondary-color);
}

.crm-file-band .crm-file-figure span:last-child {
    font-size: 1.125rem;
    font-weight: 600;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

/* The one-click language toggle (CulturePicker); the two glyphs are different scripts, so a shared line height and weight keep the
   button from jumping. */
.crm-lang-toggle {
    min-width: 2.5rem;
    padding-inline: 0.5rem;
}

.crm-lang-glyph {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.5rem;
}

:root {
    font-size: var(--rz-root-font-size);
}

body {
    font-family: var(--rz-text-font-family);
    color: var(--rz-text-color);
    font-size: var(--rz-body-font-size);
    line-height: var(--rz-body-line-height);
    background-color: var(--rz-body-background-color);
}

.rz-body {
    --rz-body-padding: 0;
}

a {
    color: var(--rz-link-color);
}

a:hover,
a:focus {
    color: var(--rz-link-hover-color);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4O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blazor-error-boundary::after {
    content: "An error has occurred."
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #1b6ec2;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}