/* #blazor-error-ui is now a self-contained overlay styled INLINE in App.razor (it must render
   with no external CSS/fonts — the failure state it covers is exactly "assets didn't load").
   Only the hidden default lives here as a belt-and-braces fallback. */
#blazor-error-ui {
    display: none;
}

:root {
    --rz-primary: #1862F8;
    font-size: var(--rz-root-font-size);
    /* Filled form-field tint derived from primary + the THEME's surface colour, not a hard-coded
       light blue: the old #D7E4FE persisted into dark mode (this file loads after the theme css),
       leaving light text on a light fill — unreadable inputs. Light theme renders ~the same
       #D7E4FE; dark theme gets a dark navy tint. Also follows tenant brand primaries. */
    --rz-form-field-filled-background-color: color-mix(in srgb, var(--rz-primary) 16%, var(--rz-base-background-color, #ffffff));
    /* Theme-adaptive brand accent for icons/labels: the tenant primary pulled toward the theme's
       text colour, so a dark brand (e.g. SEC navy) stays visible on the dark theme and a light
       brand deepens on the light theme. Use instead of raw var(--rz-primary) for foreground
       accents on cards. */
    --eqp-brand-icon-color: color-mix(in srgb, var(--rz-primary) 50%, var(--rz-text-color, #4f4f50));
    --equiprove-dark-blue-color: #0C2A52;
    --equiprove-light-blue-color: #1862F8;
    --rz-on-warning: #000000;
    /* Radzen ships --rz-on-warning-lighter as raw amber (#ffae11) in BOTH themes — 1.7:1 on the
       lighter warning wash (booking-wizard "non-refundable" alert, warning badges). Pull it toward
       the theme's text colour: 4.6:1 light / 6.5:1 dark, wash + icon keep the warning semantics. */
    --rz-on-warning-lighter: color-mix(in srgb, var(--rz-warning, #ffae11) 30%, var(--rz-text-color, #4f4f50));
    /* Text selection (::selection uses this var, defaulting to --rz-primary-lighter) must stay
       visible for EVERY tenant brand: a white/near-white PrimaryColour renders a 20% white wash —
       invisible on the white editor surface (SEC CMS editor incident 260720). Mix the brand into
       the theme's neutral base tone instead of transparent so a light brand still darkens the
       selection and a dark brand still lightens it, on both themes. */
    --rz-text-selection-background-color: color-mix(in srgb, var(--rz-primary, #1862f8) 25%, var(--rz-base-300, #dbe4f1));
    --rz-tabs-tab-padding-inline: 0.8rem;
/*    --rz-text-font-family: 'Open Sans', sans-serif;
    --rz-root-font-size: 16px;*/
}

.rz-heading {
    font-family: 'Montserrat', sans-serif;
}

/* Filled primary buttons: a faint inner edge derived from the button's own text colour. Tenant
   primaries can be near-black (e.g. SEC), so filled buttons melt into dark-theme surfaces
   (booking wizard Add/Next, login Sign in, dashboard CTAs). Inset shadow, not border — no layout
   shift; Radzen's focus ring is outline-based so this doesn't fight it. In the light theme a 30%
   on-primary wash over a saturated fill is barely perceptible. Flat/outlined/text variants keep
   their transparent backgrounds untouched. */
.rz-button.rz-primary:not(.rz-variant-flat):not(.rz-variant-outlined):not(.rz-variant-text) {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rz-on-primary, #ffffff) 30%, transparent);
}

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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTI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jY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.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");
}

/* Font Awesome 6 Free font CSS */

@font-face {
    font-family: 'Font Awesome 6 Free';
    font-style: normal;
    font-weight: 900;
    src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/webfonts/fa-solid-900.woff2') format('woff2');
}

.font-awesome {
    --rz-icon-font-family: 'Font Awesome 6 Free'
}

/* Font Awesome 6 Free font CSS */

.equiprove-blue-gradient-background {
    background-color: transparent;
    /* Tenant-branded page-header gradient: a dark→brand sweep derived from the tenant's primary
       (--tenant-brand-colour, emitted by TenantThemeProvider). The Equiprove blue remains the
       fallback on the master / unbranded tenancies. Both stops mix toward a near-black anchor so
       the white header text keeps contrast even on lighter brand colours. */
    background-image: linear-gradient(100deg,
        color-mix(in srgb, var(--tenant-brand-colour, var(--equiprove-light-blue-color)) 45%, #0a1220) 0%,
        color-mix(in srgb, var(--tenant-brand-colour, var(--equiprove-light-blue-color)) 85%, #0a1220) 100%);
}

/* wrapper that ensures the grid can grow to full available width */
.eqp-grid-fullwidth .rz-grid-table {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
}

/* Size the table to the sum of its column widths instead of stretching to 100%.
   Stops the widest column ballooning to absorb leftover space (and the rest
   getting crushed) — used by the People / Organisation list grids, which set an
   explicit width on every column. Cells wrap rather than truncate. */
.eqp-grid-autowidth .rz-grid-table {
    width: 100% !important;
    table-layout: fixed;
}
.eqp-grid-autowidth .rz-grid-table td,
.eqp-grid-autowidth .rz-grid-table th {
    white-space: normal;
    word-break: break-word;
    vertical-align: top;
}

/* Wrap cell text instead of Radzen's default single-line ellipsis — for full-width grids whose
   flexible column must show whole names (event Classes / Sub-events lists, user-reported 260808). */
.eqp-grid-wrap-cells .rz-grid-table td,
.eqp-grid-wrap-cells .rz-grid-table td .rz-cell-data {
    white-space: normal;
    overflow-wrap: anywhere;
}

.highlight-text {
    width: fit-content;
    padding: 6px 12px;
    position: relative;
    font-size: 32px;
    font-weight: 600;
    user-select: none;
    text-align: center;
    white-space: nowrap;

    &:before {
        content: '';
        position: absolute;
        inset: 0;
        z-index: -1;
        border-radius: 3px 5px 3px 5px;
        background: conic-gradient(at 0 100%, rgb(var(--mark-color) / 100%) 1%, #fff0 3%) no-repeat 0 0 / auto 120%, conic-gradient(from 180deg at 100% 0, #fff0, rgb(var(--mark-color) / 100%) 1%, #fff0 4%) no-repeat 100% 100% / auto 120%, linear-gradient(var(--mark-bg-angle), rgb(var(--mark-color) / 60%), rgb(var(--mark-color) / 20%) 75%, rgb(var(--mark-color) / 55%)) no-repeat center / auto;
    }

    &.yellow-mark:before {
        rotate: 1deg;
        scale: 1.1;
        transform: skew(-5deg);
        --mark-color: 255 232 62;
        --mark-bg-angle: 50deg;
    }

    &.green-mark:before {
        scale: 0.92;
        transform: skew(7deg);
        --mark-color: 91 233 92;
        --mark-bg-angle: 30deg;
    }

    &.red-mark:before {
        rotate: 0.5deg;
        transform: skew(5deg);
        --mark-color: 255 100 185;
        --mark-bg-angle: 150deg;
    }
}

/* ==== Calendar appointment bars + hover cards (CalendarItemBar) ====
   Global because the hover card renders in Radzen's tooltip portal, outside
   any component's markup, and the bar is used by multiple scheduler surfaces. */
.cal-bar { display: flex; align-items: center; gap: 0.25rem; min-width: 0; height: 100%; }
.cal-bar__logo { width: 1rem; height: 1rem; border-radius: 2px; object-fit: cover; flex: 0 0 auto; background: #fff; margin-right: 0.3rem; }
.cal-bar__icon { flex: 0 0 auto; display: inline-flex; align-items: center; line-height: 1; margin-right: 0.3rem; }
.cal-bar__icon .rzi { font-size: 0.85rem; }
.cal-bar__icon .fa-solid { font-size: 0.7rem; }
/* Scheduler (day/week/multi-day) bars are TALL — wrap the title instead of truncating it
   (user-requested 260806: "Alexandria Geeves · EB-202…" told nobody anything). Month-view
   bars are one line high, so wrapping there would clip mid-line — they keep the ellipsis. */
.cal-bar__text { overflow: hidden; overflow-wrap: anywhere; white-space: normal; }
.rz-month-view .cal-bar__text { white-space: nowrap; text-overflow: ellipsis; }
.cal-hover { max-width: 320px; display: flex; flex-direction: column; gap: 0.4rem; }
/* The hover card must never capture the pointer: it opens UNDER the cursor, which fired
   mouseleave on the bar -> close -> mouseenter -> open in a rapid flicker loop. */
.rz-tooltip:has(.cal-hover) { pointer-events: none; }
.cal-hover__head { display: flex; align-items: flex-start; gap: 0.5rem; }
.cal-hover__logo { width: 2.25rem; height: 2.25rem; border-radius: 4px; object-fit: contain; background: #fff; flex: 0 0 auto; }
.cal-hover__icon { width: 2rem; height: 2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: 0 0 auto; }
.cal-hover__titles { flex: 1; min-width: 0; }
.cal-hover__title { font-weight: 600; font-size: 0.9rem; }
.cal-hover__subtitle { font-size: 0.78rem; opacity: 0.85; }
.cal-hover__row { font-size: 0.8rem; display: flex; align-items: center; gap: 0.3rem; }
.cal-hover__row .rzi { font-size: 0.9rem; }
.cal-hover__desc { font-size: 0.78rem; white-space: pre-line; opacity: 0.9; max-height: 7rem; overflow: hidden; }
.cal-hover__hint { opacity: 0.6; font-size: 0.72rem; }

/* ==== Sidebar tenant branding on short viewports (MainLayout) ====
   The tenant logo (up to 200px) sits between the nav menu and the footer in a
   fixed-height flex column — on short screens it squeezes the menu until no
   items are visible. Shrink it first, then hide it entirely; the tenant name
   text below it stays as the branding. */
@media (max-height: 850px) {
    .sidebar-tenant-logo img {
        max-width: 120px !important;
        max-height: 120px !important;
    }
}
@media (max-height: 720px) {
    .sidebar-tenant-logo {
        display: none;
    }
}
/* Last resort on very short screens / long menus: scroll the sidebar content
   instead of clipping the menu out of reach. */
.sidebar-content {
    overflow-y: auto;
}

/* ==== Header action buttons on phones (MainLayout .header-actions) ====
   Five controls (Help, Feedback/Support, culture picker, theme toggle, account
   name) overflow the header row on phones. Below 768px: buttons drop to icon
   only (title tooltips remain), the culture picker (currently disabled anyway)
   hides, and the account menu shows just the avatar + chevron. */
@media (max-width: 768px) {
    .header-actions .rz-button .rz-button-text {
        display: none;
    }
    /* Help / Feedback set an inline min-width (5rem / 10rem) so their labels don't
       truncate at mid widths. Once the label is hidden the button must shrink back to
       icon size, otherwise it stays a wide button around a lone icon. The reset has to
       sit on the BUTTON (the old min-width:auto above was on the hidden text span, so it
       did nothing), and needs !important — an inline style beats any selector without it. */
    .header-actions .rz-button {
        min-width: auto !important;
    }
    .header-culture {
        display: none;
    }
    .bar-account-name {
        display: none;
    }
}

/* ==== Dialogs whose body is a list or grid (People > Equids / Registrations) ====
   .rz-dialog is a flex column sized to DialogOptions.Height, but .rz-dialog-content is
   flex:0 1 auto with overflow:auto — so a body taller than the dialog grows the content
   box and scrolls INSIDE it, giving two scrollbars side by side (and pushing the dialog
   buttons out of reach). Opt a dialog in with DialogOptions.CssClass="eqp-dialog-grid":
   the content box then takes exactly the leftover height, never scrolls itself, and the
   inner list is the only thing that scrolls. */
.eqp-dialog-grid .rz-dialog-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

    /* The component the dialog hosts — one child, filling the content box. */
    .eqp-dialog-grid .rz-dialog-content > * {
        flex: 1 1 auto;
        min-height: 0;
    }

/* Body of a "related records" dialog: heading above, buttons below, this in between.
   min-height:0 is what actually lets it shrink — a flex item defaults to min-height:auto
   and would refuse to go below its content, which is the whole bug. */
.eqp-related-dialog {
    height: 100%;
}

.eqp-related-body {
    flex: 1 1 auto;
    min-height: 0;
}

    /* The host scrolls (card/grid list with no scroller of its own). */
    .eqp-related-body-scroll {
        overflow: auto;
    }

    /* The GRID scrolls (RadzenDataGrid given height:100%) — the host must not. The list
       component renders siblings above the grid (FusionError, PageHeader), so only the grid
       itself may flex; stretching every child would stretch those too. .rz-data-grid is
       already display:flex/column with a scrolling body, so it just needs the height. */
    .eqp-related-body-fill {
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

        .eqp-related-body-fill > .eqp-grid-fullwidth {
            flex: 1 1 auto;
            min-height: 0;
        }

/* Fee-disclosure captions ("Prices include GST. Includes <fee label> of ..." on the booking
   wizard, registration wizard and booking details) — user-reported 260826: people were not
   seeing them in the muted caption grey. Bold + the tenant's SECONDARY brand colour, blended
   with the theme text colour so it stays readable on any surface: a pale brand secondary gains
   ~30% of near-black on light themes, and the same rule lightens toward near-white on dark
   themes. Tenant branding only overrides --rz-secondary itself (TenantThemeProvider), so the
   -dark/-darker theme variants would lose the brand hue — the blend keeps it. */
/* The doubled selector out-specifies Radzen's own .rz-text-caption font-size (the theme
   stylesheet loads after this one, so a single-class selector lost the tie — verified 260826:
   captions stayed 12px). All five call sites render as TextStyle.Caption. */
.fee-disclosure,
.rz-text-caption.fee-disclosure {
    font-weight: 600;
    /* Up from the Caption default (0.75rem) — part of the same not-being-seen fix. */
    font-size: 0.875rem;
    color: color-mix(in srgb, var(--rz-secondary) 72%, var(--rz-text-color) 28%);
}

/* Page header (shared PageHeader component's gradient card) on SMALL screens — the desktop
   sizing (DisplayH6 heading + a 0.75rem-padded enlarged badge inside a default-padded card)
   ate a third of a phone viewport and wrapped titles over three lines (user-reported 260826,
   booking wizard). Type + padding step down under the md breakpoint. The badge's enlarged
   size is set INLINE in PageHeader.razor (kept for desktop), so the mobile override needs
   !important to beat it. */
@media (max-width: 767.98px) {
    .page-header-card {
        padding: 0.6rem 0.75rem;
    }

        /* Heading: RadzenHeading/RadzenText DisplayH6 in either rendering (rz-text-display-h6
           class or a bare h1–h6 tag). */
        .page-header-card .rz-text-display-h6,
        .page-header-card .rz-heading,
        .page-header-card h1,
        .page-header-card h2,
        .page-header-card h3,
        .page-header-card h4,
        .page-header-card h5,
        .page-header-card h6 {
            font-size: 1.25rem;
            line-height: 1.25;
            margin-bottom: 0;
        }

        /* Context badge ("EVENT BOOKING", "SYSADMIN", ...). */
        .page-header-card .rz-badge {
            padding: 0.35rem 0.5rem !important;
            font-size: 0.75rem !important;
        }
}

/* Layout content gutters on SMALL screens (app-wide) — .rz-body's 16px each side plus page
   padding cost ~15% of a phone's width (user-reported 260826, booking wizard). The doubled
   selector out-specifies the Radzen layout stylesheet, which loads after this one. */
@media (max-width: 767.98px) {
    .rz-layout .rz-body,
    .rz-body.rz-body {
        padding: 0.4rem 0.35rem;
    }
}
