/* ==========================================================================
   Brand theming — map the Zennette design tokens (zennette-brand.css) onto
   the Radzen theme variables so the whole app chrome adopts the sage and rose
   palette. Loaded after standard.css so these win.
   ========================================================================== */
:root {
    /* Use the design package font throughout Radzen. */
    --rz-text-font-family: var(--znt-font);

    /* Primary = brand sage (primary buttons, switches, links, selection, avatar) */
    --rz-primary:         var(--znt-sage);
    --rz-primary-light:   #7A877E;
    --rz-primary-lighter: rgba(88, 103, 93, 0.12);
    --rz-primary-dark:    var(--znt-sage-dark);
    --rz-primary-darker:  #3C473F;
    --rz-on-primary:      var(--znt-white);
    --rz-series-1:        var(--znt-ink);

    /* Selected select-bar option (e.g. Drug Book Scan Label): brand sage text instead of
       Radzen's default --rz-on-primary-lighter blue. Appointments Day/Week overrides to jade. */
    --rz-selectbar-selected-color: var(--znt-sage);

    /* Alternate table rows: a faint soft-sage tint (from #A7B89F) instead of Radzen's pale blue. */
    --rz-grid-stripe-background-color: var(--znt-sage-wash);

    /* Selected and hovered table rows: soft-sage tint with deep-sage text instead of Radzen's
       lavender/blue (--rz-on-primary-lighter) defaults. */
    --rz-grid-selected-background-color: rgba(167, 184, 159, 0.28);
    --rz-grid-selected-color: var(--znt-sage-dark);
    --rz-grid-hover-color: var(--znt-sage-dark);

    /* Links: brand sage (deep sage on hover), for both Radzen links (which default to
       --rz-secondary, now rose) and plain <a> elements (Bootstrap's #0d6efd blue). Bootstrap
       reads the -rgb forms, so they must match --znt-sage / --znt-sage-dark. */
    --rz-link-color: var(--znt-sage);
    --rz-link-hover-color: var(--znt-sage-dark);
    --bs-link-color: var(--znt-sage);
    --bs-link-color-rgb: 88, 103, 93;
    --bs-link-hover-color: var(--znt-sage-dark);
    --bs-link-hover-color-rgb: 74, 87, 79;

    /* Focus ring on Radzen inputs outside .znt-form: sage glow instead of the default blue. */
    --rz-input-focus-shadow: 0 0 0 1px var(--znt-white), 0 0 0 3px rgba(88, 103, 93, 0.2);

    /* Info = brand jade. Radzen's default info palette is cyan/aqua, which
       clashes with the Zennette ink-and-jade theme and makes info alert text too bright. */
    --rz-info:         var(--znt-jade);
    --rz-info-light:   var(--znt-jade-soft);
    --rz-info-lighter: var(--znt-info-bg);
    --rz-info-dark:    #336657;
    --rz-info-darker:  #294f44;
    --rz-on-info:         var(--znt-white);
    --rz-on-info-light:   var(--znt-white);
    --rz-on-info-lighter: var(--znt-info-fg);
    --rz-on-info-dark:    var(--znt-white);
    --rz-on-info-darker:  var(--znt-white);

    /* Secondary = brand dusty rose with white text (accents / CTAs); the pale rose tints
       keep charcoal text. */
    --rz-secondary:         var(--znt-rose);
    --rz-secondary-light:   #DDAFB3;
    --rz-secondary-lighter: rgba(201, 130, 136, 0.2);
    --rz-secondary-dark:    var(--znt-rose-dark);
    --rz-secondary-darker:  #9A5259;
    --rz-on-secondary:      var(--znt-white);
    --rz-on-secondary-light: var(--znt-charcoal);
    --rz-on-secondary-lighter: var(--znt-charcoal);
    --rz-on-secondary-dark:  var(--znt-white);
    --rz-on-secondary-darker: var(--znt-white);

    /* "Lighter" shades (status badges, soft alerts, pale status fills) use the Zennette status
       tints from zennette-brand.css instead of Radzen's vivid defaults. */
    --rz-success-lighter:    var(--znt-success-bg);
    --rz-on-success-lighter: var(--znt-success-fg);
    --rz-danger-lighter:     var(--znt-danger-bg);
    --rz-on-danger-lighter:  var(--znt-danger-fg);
    --rz-warning-lighter:    var(--znt-warning-bg);
    --rz-on-warning-lighter: var(--znt-warning-fg);

    /* Toasts: status tint with body copy in status-text; the title, icon and close control
       carry the deep status colour (see .rz-notification rules below). */
    --rz-notification-success-background-color: var(--znt-success-bg);
    --rz-notification-success-color:            var(--znt-status-text);
    --rz-notification-success-icon-color:       var(--znt-success-fg);
    --rz-notification-error-background-color:   var(--znt-danger-bg);
    --rz-notification-error-color:              var(--znt-status-text);
    --rz-notification-error-icon-color:         var(--znt-danger-fg);
    --rz-notification-warning-background-color: var(--znt-warning-bg);
    --rz-notification-warning-color:            var(--znt-status-text);
    --rz-notification-warning-icon-color:       var(--znt-warning-fg);
    --rz-notification-info-background-color:    var(--znt-info-bg);
    --rz-notification-info-color:               var(--znt-status-text);
    --rz-notification-info-icon-color:          var(--znt-info-fg);

    /* Surfaces & text */
    --rz-body-background-color: var(--znt-surface);
    --rz-text-color:            var(--znt-ink);
    --rz-header-color:          var(--znt-ink);
    /* Radzen's default header shadow is a heavy 3-layer drop shadow (16px blur at 10% opacity);
       the header reuses the app's quiet workspace elevation instead. Cards use the app's own card
       standard - rounded corners and one soft single-layer shadow (--znt-card-radius/-shadow,
       below) - in place of Radzen's heavy 3-layer default. Overriding the tokens rather than
       .rz-card's own box-shadow/border-radius: Radzen's .rz-card.rz-variant-filled selector is
       more specific than a bare .rz-card rule and would otherwise win regardless of source order. */
    --rz-header-shadow:         var(--znt-workspace-shadow);
    --rz-card-shadow:           var(--znt-card-shadow);
    --rz-card-border-radius:    var(--znt-card-radius);

    /* Shared clinical-workspace surfaces. These keep record and Settings screens quiet by
       default, leaving ink and jade available for navigation, focus, and real actions. */
    --znt-workspace-border: rgba(23, 32, 29, 0.14);
    --znt-workspace-shadow: none;
    --znt-workspace-shadow-hover: none;
    --znt-workspace-radius: var(--znt-radius-lg);
    --znt-workspace-surface: var(--znt-white);

    /* Card standard: every content card (RadzenCard, plus card-like feature blocks and tiles)
       uses this radius and shadow rather than its own. */
    --znt-card-radius: 1rem;
    --znt-card-shadow: 0 2px 10px rgba(23, 32, 29, 0.08);

    /* Dropdown popups: Radzen's standard theme gives them no shadow and the same pale border as
       the inputs, so an open list blends into the fields behind it. A firmer border and a lifted
       shadow make the open list read as a layer above the form. */
    --rz-dropdown-panel-border: 1px solid rgba(23, 32, 29, 0.28);
    --rz-dropdown-panel-shadow: 0 2px 4px rgba(23, 32, 29, 0.08), 0 12px 28px rgba(23, 32, 29, 0.18);

    /* Sidebar = brand nav surface */
    --rz-sidebar-background-color: var(--znt-nav);
    /* Radzen's default border-inline-end is a light-theme grey that reads as a harsh black
       line against the dark nav sidebar; drop it since the sidebar already has a solid fill
       and no light body panel abuts it directly. */
    --rz-sidebar-border-inline-end: none;

    /* Expanded sidebar width: 30% narrower than Radzen's 250px default. */
    --rz-sidebar-width: 175px;

    /* Sidebar menu items: blend into the nav sidebar (Radzen's defaults are
       dark greys that read as a clashing band). Hover/active use light white
       tints; the active row gets a rose indicator. */
    --rz-panel-menu-item-background-color: transparent;
    --rz-panel-menu-item-border: none;
    --rz-panel-menu-item-color: var(--znt-white);
    --rz-panel-menu-icon-color: var(--znt-white);
    --rz-panel-menu-item-hover-background-color: rgba(255, 255, 255, 0.1);
    --rz-panel-menu-item-active-background-color: rgba(255, 255, 255, 0.16);
    --rz-panel-menu-item-active-indicator: var(--znt-nav-accent);
    /* Radzen's default (600) reads heavier/bolder than the rest of the app's text; the icon
       weight inherits from this too (--rz-icon-weight defaults to inherit). */
    --rz-panel-menu-font-weight: 400;

    /* Current width of the app sidebar. Defaults to the collapsed rail width; the
       :root:has() rule below swaps to the expanded width whenever the sidebar is open.
       Content-area overlays (e.g. the full-width edit drawer) subtract this so they span
       exactly up to the sidebar edge in either state. */
    --znt-sidebar-width: 3.25rem;
    --znt-content-drawer-width: calc(100vw - var(--znt-sidebar-width));
}

/* When the sidebar is expanded it carries .rz-sidebar-expanded; track its real width so
   --znt-content-drawer-width follows the sidebar as it expands/collapses (document-wide
   :has, so it applies regardless of where the drawer overlay is mounted). */
:root:has(.rz-sidebar.sidebar.rz-sidebar-expanded) {
    --znt-sidebar-width: var(--rz-sidebar-width, 250px);
}

/* Remembered menu pages allow navigation while a side panel is open. Keep its backdrop
   over the content area; ordinary modal dialogs and Settings retain their full backdrop. */
body:has(.znt-page-state-marker) .rz-dialog-side.rz-open + .rz-dialog-mask {
    inset-inline-start: var(--znt-sidebar-width);
    width: calc(100vw - var(--znt-sidebar-width));
}

/* Side-nav areas (Settings, Reports) own their flush layout (nav/content boundary line reaching the
   very edges) - drop .rz-body's own padding rather than fighting it with a negative margin on
   .side-nav-layout. It only renders inside SideNavPageContainer, so this only applies there. */
.rz-body:has(.side-nav-layout) {
    padding: 0;
}

/* Side-nav areas only: the white nav panel runs straight up into the white header, so give the
   header a soft shadow to separate them. Every other page keeps the default flat header. */
.rz-layout:has(.side-nav-layout) {
    --rz-header-shadow: 0 1px 4px rgba(23, 32, 29, 0.12);
}

/* The active nav item's icon and label stand out from the regular-weight (400) items around
   it. Radzen only wires a font-weight variable for 2nd/3rd-level active items, not the top
   level this app uses, so set it directly; the icon inherits it the same way the base 400 does. */
.rz-navigation-item-wrapper-active {
    font-weight: 600;
}

/* Profile menu is host chrome: keep its styling independent of Razor CSS scope IDs. */
/* Stretch the menu to the full header height so the dropdown drops exactly from the
   topbar base instead of from the centred avatar. */
.profile-menu-host {
    display: flex;
    align-items: center;
    height: 100%;
}

.profile-menu {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.profile-menu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

/* Invisible click-catcher covering the viewport while the menu is open; sits just below the
   dropdown so clicks inside the panel still reach it, and over the trigger so clicking the
   avatar again also dismisses. */
.profile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: transparent;
}

/* Pin the panel flush to the topbar base and to the right edge of the header. */
.profile-dropdown {
    position: absolute;
    inset-block-start: calc(100% + var(--rz-border-width, 1px));
    inset-inline-end: -0.75rem;
    z-index: 1000;
    display: none;
    width: min(20rem, calc(100vw - 1rem));
    min-width: 0;
    overflow: hidden;
    background: var(--znt-white);
    border: 1px solid var(--znt-mist);
    border-radius: var(--znt-radius-lg);
    box-shadow: none;
}

.profile-menu--open .profile-dropdown {
    display: block;
}

/* The avatar toggle is the menu's clickable handle. */
.profile-avatar-img {
    display: inline-flex;
    cursor: pointer;
    user-select: none;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    min-width: 14rem;
}

.profile-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.profile-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.profile-pin-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--rz-link-color, var(--rz-primary));
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.profile-pin-link:hover {
    color: var(--rz-link-hover-color, var(--rz-primary-dark));
}

.profile-pin-link:focus-visible {
    outline: 2px solid var(--rz-primary);
    outline-offset: 2px;
}

.profile-divider {
    margin: 0;
    border: none;
    border-top: 1px solid var(--rz-border-color, #e0e0e0);
}

.profile-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    text-align: left;
    font: inherit;
    color: var(--rz-text-color, #2b2b2b);
    text-decoration: none;
    cursor: pointer;
}

.profile-logout-btn:hover {
    background: var(--rz-base-200, rgba(0, 0, 0, 0.05));
}

/* ==========================================================================
   Shared form layout + field appearance. Use these generic classes on edit
   forms (drawers, detail pages) instead of redeclaring per-component widths,
   label styles, field grids, or the outlined+rounded field look. Opt in by adding
   .znt-form to the form wrapper and .znt-form-field to each RadzenFormField.
   ========================================================================== */

/* Full-width field — replaces repeating Style="width: 100%;" on every RadzenFormField. */
.znt-form-field {
    width: 100%;
}

/* Responsive field grid: two columns, collapsing to one on narrow drawers/screens. */
.znt-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

/* Shared form action row: separates actions from the final field, keeps buttons
   consistently spaced and right aligned, and allows them to wrap on narrow screens. */
.znt-form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* Standalone label above a control that is not itself a RadzenFormField (e.g. an image
   upload or a composite input). */
.znt-field-label {
    font-size: 0.8125rem;
    color: var(--rz-text-secondary-color, #6c757d);
}

/* Shared inline notice, for a short explanation or limit that belongs beside the control it
   applies to rather than in a dialog or a notification. */
.znt-notice {
    display: block;
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: var(--rz-base-200, #f1f3f5);
    color: var(--rz-text-secondary-color, #6c757d);
}

.znt-notice-error {
    background: #faeaea;
    color: #b32121;
}

/* Clear (x) inside a search field's End slot: matches Radzen's dropdown clear icon (20px, 0.4 opacity). */
.znt-search-clear .znt-close-button-hover .rz-button.znt-close-button {
    padding: 0.25rem;
}

.znt-search-clear .znt-close-button-hover .rz-button.znt-close-button .rz-button-box .rzi {
    font-size: 1.25rem;
    opacity: 0.4;
}

.znt-search-clear .znt-close-button-hover:hover .rz-button.znt-close-button .rz-button-box .rzi {
    opacity: 1;
}

/* Shared status chip treatment. Apply this opt-in class to RadzenBadge status labels so
   informational, warning, success, and danger chips retain their semantic theme colour. */
.znt-status-chip {
    flex: 0 0 auto;
    padding: 0.3rem 0.8rem 0.2rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-weight: 600;
}

/* Outlined + rounded field look, applied once for any field inside an .znt-form. Replaces the
   per-component ::deep rounding rules previously copied into each form's scoped CSS. */
.znt-form .rz-form-field-content {
    border: 1.5px solid rgba(88, 103, 93, 0.8);
    border-radius: 4px;
    background: #ffffff;
    min-height: 42px;
}

/* Focus treatment for both interactive forms (Radzen applies rz-state-focused via JS)
   and static-SSR forms like the login page (no interactivity, so drive it from
   :focus-within instead). */
.znt-form .znt-form-field.rz-form-field.rz-state-focused .rz-form-field-content,
.znt-form .znt-form-field:focus-within .rz-form-field-content {
    border-color: var(--znt-sage);
    box-shadow: 0 0 0 2px rgba(88, 103, 93, 0.2);
}

.app-update-fallback {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(28, 42, 58, 0.72);
}

.app-update-fallback__panel {
    width: min(100%, 30rem);
    padding: 1.5rem;
    border-radius: 8px;
    background: var(--znt-white);
    color: var(--znt-ink);
    box-shadow: 0 1rem 3rem rgba(28, 42, 58, 0.24);
    text-align: center;
}

.app-update-fallback__panel strong {
    display: block;
    color: var(--znt-ink);
    font-size: 1.25rem;
}

.app-update-fallback__panel p {
    margin: 0.75rem 0 1rem;
}

.app-update-fallback__panel button {
    min-width: 7rem;
    border: 0;
    border-radius: 8px;
    padding: 0.625rem 1rem;
    background: var(--znt-ink);
    color: var(--znt-white);
    font-weight: 700;
}

.znt-form .rz-form-field-content::before,
.znt-form .rz-form-field-content::after {
    display: none;
}

/* Shared light navigation panel used by Settings and drawer-internal sidebars. */
.znt-nav-sidebar {
    flex: 0 0 14rem;
    border: 1px solid var(--rz-border-color, #dee2e6);
    border-radius: var(--rz-border-radius, 4px);
    background-color: var(--rz-base-background-color, #fff);
    overflow: hidden;

    --rz-panel-menu-item-background-color: transparent;
    --rz-panel-menu-item-color: var(--znt-ink);
    --rz-panel-menu-icon-color: var(--znt-jade);
    --rz-panel-menu-item-hover-background-color: var(--rz-primary-lighter);
    --rz-panel-menu-item-active-background-color: var(--rz-primary-lighter);
    --rz-panel-menu-item-active-indicator: var(--znt-nav-accent);
}

/* Shared minimal tab presentation. Keep tabs as flat text with an underline indicator instead
   of Radzen's boxed tab and panel chrome. Apply .znt-tabs to each RadzenTabs instance. */
.znt-tabs .rz-tabview-nav {
    gap: 1.5rem;
    border-bottom: 1px solid var(--rz-base-300);
    background: var(--znt-workspace-surface);
}

.znt-tabs .rz-tabview-nav li {
    background: transparent;
    border: none;
    border-radius: 0;
}

.znt-tabs .rz-tabview-nav li a,
.znt-tabs .rz-tabview-nav li button {
    padding: 0.75rem 0.1rem;
    color: var(--rz-text-secondary-color);
    font-weight: 500;
}

.znt-tabs .rz-tabview-nav .rz-tabview-selected {
    background: transparent;
    box-shadow: inset 0 -2px 0 0 var(--rz-primary);
}

.znt-tabs .rz-tabview-nav .rz-tabview-selected a,
.znt-tabs .rz-tabview-nav .rz-tabview-selected button {
    color: var(--rz-primary);
}

.znt-tabs .rz-tabview-panels {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.znt-tabs .rz-tabview-panel {
    padding: 1.5rem 0 0;
}

/* The phone country-code dropdown (PhoneInput) opens a narrow popup because Radzen sizes the
   panel to match the closed trigger's width via inline style, which is too narrow for names
   like "United Kingdom (+44)". Radzen portals dropdown popups to <body>, outside any component's
   scoped CSS, so this override has to be global; it's scoped to just this popup — not every
   dropdown app-wide — by matching on the flag image unique to PhoneInput's item template, and
   needs !important to beat Radzen's inline width. */
.rz-dropdown-panel:has(.znt-phone-input-flag) {
    width: 16rem !important;
    min-width: 16rem !important;
}

/* Radzen gives dropdown list rows the arrow cursor even though clicking one selects it. Global
   because Radzen portals dropdown popups to <body>. */
.rz-dropdown-items li:not(.rz-state-disabled),
.rz-multiselect-items li:not(.rz-state-disabled) {
    cursor: pointer;
}

/* Multi-line tooltips (TooltipText MultiLine="true"). Radzen portals the tooltip popup to <body>,
   so this is global; it's scoped to the opt-in CssClass and just makes newlines in the text render
   as line breaks, left-aligned. */
.rz-tooltip.znt-tooltip-multiline .rz-tooltip-content {
    white-space: pre-line;
    text-align: left;
}

/* Radzen's tooltip popup can end up overlapping its own trigger element when there isn't room to
   place it clear of the trigger (e.g. a button near the bottom of the viewport, like the sidebar
   collapse toggle) - the popup then sits on top of the trigger with pointer-events:auto and
   silently swallows the very click it's describing. Tooltips are informational only, so they
   should never intercept pointer input; global because Radzen portals the popup to <body>. */
.rz-tooltip {
    pointer-events: none;
}

/* RadzenAutoComplete has no built-in trigger affordance, so select-style autocompletes read as
   plain text boxes. Draw the same down-chevron RadzenDropDown shows, on the right inside the field,
   so every dropdown-style control looks consistent. The leading-input padding keeps long values
   clear of the chevron. */
.znt-form .rz-autocomplete {
    position: relative;
}

.znt-form .rz-autocomplete::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0.85rem;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid var(--rz-text-secondary-color, #6c757d);
    border-bottom: 2px solid var(--rz-text-secondary-color, #6c757d);
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}

.znt-form .rz-autocomplete .rz-inputtext {
    padding-right: 2rem;
}

/* Soft (flat, lighter) alerts and toasts: body copy stays in status-text for readability, while the
   icon, title and close control carry the deep status colour. The tint comes from the
   --rz-*-lighter / --rz-notification-* tokens in :root. */
.rz-alert.rz-variant-flat.rz-shade-lighter {
    color: var(--znt-status-text);
}

.rz-alert.rz-variant-flat.rz-success.rz-shade-lighter { --znt-status-accent: var(--znt-success-fg); }
.rz-alert.rz-variant-flat.rz-danger.rz-shade-lighter  { --znt-status-accent: var(--znt-danger-fg); }
.rz-alert.rz-variant-flat.rz-warning.rz-shade-lighter { --znt-status-accent: var(--znt-warning-fg); }
.rz-alert.rz-variant-flat.rz-info.rz-shade-lighter    { --znt-status-accent: var(--znt-info-fg); }

.rz-alert.rz-variant-flat.rz-shade-lighter .rz-alert-icon,
.rz-alert.rz-variant-flat.rz-shade-lighter .rz-alert-title,
.rz-alert.rz-variant-flat.rz-shade-lighter .rz-alert-close {
    color: var(--znt-status-accent, inherit);
}

.rz-notification-success { --znt-status-accent: var(--znt-success-fg); }
.rz-notification-error   { --znt-status-accent: var(--znt-danger-fg); }
.rz-notification-warning { --znt-status-accent: var(--znt-warning-fg); }
.rz-notification-info    { --znt-status-accent: var(--znt-info-fg); }

.rz-notification-title,
.rz-notification-close {
    color: var(--znt-status-accent, inherit);
}

/* A 1px border in the status colour tells a toast apart from a same-tint alert banner beneath it. */
.rz-notification-item {
    border: 1px solid var(--znt-status-accent, transparent);
}

.rz-notification-close {
    opacity: 1;
}

@media (max-width: 900px) {
    .znt-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ==========================================================================
   Side-drawer chrome. Owned here (rather than in Drawer.razor.css) so both the
   shared Drawer component and hand-rolled read-only drawers — which can't use
   Drawer because it forces a Cancel/Save action row — share one consistent
   header/body look. Scoped CSS could not do this: a hand-rolled drawer's
   elements don't carry the Drawer component's scope id.
   ========================================================================== */
.znt-drawer {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
    background: var(--rz-base-background-color);
}

/* Drawer.razor programmatically focuses its own root on open so a bubbled Escape keydown has
   somewhere to start from (Radzen does not autofocus anything inside the side dialog itself) -
   this isn't an interactive control, so suppress the focus ring that would otherwise draw. */
.znt-drawer:focus {
    outline: none;
}

.rz-dialog-side.rz-dialog-side-position-right.rz-open {
    transform: translateX(0) !important;
}

.rz-dialog-side {
    top: 0;
    max-height: 100%;
}

.rz-dialog-side.rz-dialog-side-position-right,
.rz-dialog-side.rz-dialog-side-position-left {
    height: 100%;
}

/* A transformed .rz-body traps fixed descendants below side dialogs. Remove the transform
   only while a full-screen overlay (the common consent preview, or the drug book sign-in
   dialog) is open so its overlay can reach the app root. */
body:has(.cf-render-dialog-backdrop, .drug-book-signin-backdrop) .rz-body {
    transform: none !important;
}

body:has(.patient-photo-compare-backdrop) .rz-dialog-side.rz-dialog-side-position-right.rz-open {
    width: 100vw !important;
    max-width: 100vw !important;
}

.rz-dialog-side.rz-dialog-side-position-right .rz-dialog-side-content {
    height: 100%;
    overflow: hidden;
    padding: 0;
}

body:has(.patient-photo-compare-backdrop) .rz-dialog-side.rz-dialog-side-position-right .rz-dialog-side-content {
    overflow: visible;
}

/* EditForm renders its own <form> internally, so Blazor's CSS isolation never stamps a scope
   attribute onto it and BookingDrawer.razor.css can't target it directly. .booking-drawer-layout
   (scoped, inside that form) needs a definite-height flex ancestor so its two columns
   (.booking-side-panel/.booking-details-column and .booking-main-panel) can each bound their own
   height and scroll independently - :has() keeps this scoped to just that one drawer's form, not
   every .znt-form. */
.znt-drawer-body:has(.booking-drawer-layout) form.znt-form {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* BookingDrawer's own two columns scroll independently instead of the whole body scrolling as
   one unit, unlike every other Drawer.razor consumer - :has() keeps this scoped to just this
   drawer. Padding moves off the shared body and onto each column (see BookingDrawer.razor.css)
   so each keeps its own top/bottom breathing room regardless of the other column's scroll
   position. */
.znt-drawer-body:has(.booking-drawer-layout) {
    overflow: hidden;
    padding: 0;
}

@media (max-width: 991.98px) {
    /* Below the split-view breakpoint Bootstrap stacks the columns, where two independent
       scrollboxes would read as broken rather than useful - revert to the body scrolling as a
       whole, same as every other drawer. */
    .znt-drawer-body:has(.booking-drawer-layout) {
        overflow-y: auto;
        padding: 1.5rem;
    }
}

.znt-drawer-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--rz-base-300);
    background: var(--znt-workspace-surface);
}

.znt-drawer-header h3 {
    margin: 0;
    color: var(--znt-ink);
    font-size: 1.15rem;
    font-weight: 700;
}

/* The shared Drawer's own title stays on one line and shows the full text as a tooltip; custom headers wrap. */
.znt-drawer-header .znt-drawer-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.znt-drawer-header > .znt-close-button-hover:last-child {
    margin-left: auto;
}

.znt-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.znt-drawer-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Fixed footer holding Close/Save: a flex sibling of the scrollable .znt-drawer-body (not a
   child), so it stays reachable without scrolling on long forms, mirroring the header. */
.znt-drawer-footer {
    flex-shrink: 0;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--rz-base-300);
    background: var(--znt-workspace-surface);
}

.znt-drawer-loading-content {
    height: 100%;
    min-height: 0;
}

.znt-drawer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.znt-drawer-actions-leading,
.znt-drawer-actions-primary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.znt-drawer-actions-primary {
    justify-content: flex-end;
    margin-left: auto;
}

.znt-drawer-actions-busy {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    white-space: nowrap;
}

/* Form-content helpers used inside drawer bodies: .znt-drawer-row for an inline row (e.g. a
   toggle plus its label) and .znt-drawer-row-list to stack such rows. */
.znt-drawer-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.znt-drawer-row-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.znt-drawer-heading {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.znt-drawer-empty {
    color: var(--rz-text-secondary-color);
}

.znt-over-drawer-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: auto;
    z-index: 1200;
    display: flex;
    justify-content: flex-end;
    width: var(--znt-content-drawer-width);
    height: 100dvh;
    background: rgba(15, 23, 42, 0.28);
}

.znt-over-drawer-panel {
    width: 50%;
    min-width: min(100%, 30rem);
    height: 100%;
    overflow: hidden;
    background: var(--rz-base-background-color);
    border-left: 1px solid var(--rz-base-300);
    box-shadow: -1rem 0 2.5rem rgba(15, 23, 42, 0.18);
}

/* MedicalNoteEditorDrawer focuses the panel on open so a bubbled Escape keydown
   has somewhere to start from - not an interactive control, so suppress the focus ring. */
.znt-over-drawer-panel:focus {
    outline: none;
}

.znt-over-drawer-body {
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
    padding: 1.5rem;
}

.znt-over-drawer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.znt-over-drawer-action-spacer {
    flex: 1 1 auto;
}

@media (max-width: 760px) {
    .znt-over-drawer-backdrop {
        width: 100vw;
    }

    .znt-over-drawer-panel {
        width: 100%;
    }
}

/* Opt-in modifier: pins an over-drawer's Save/Cancel row in a fixed footer, mirroring
   Drawer.razor's footer-as-flex-sibling pattern. Scoped to consumers that add this class so
   other .znt-over-drawer-panel consumers (which still keep their actions inside the scrollable
   body) are unaffected. */
.znt-over-drawer-fixed-footer {
    display: flex;
    flex-direction: column;
}

.znt-over-drawer-fixed-footer form {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.znt-over-drawer-fixed-footer .znt-over-drawer-body {
    flex: 1;
    max-height: none;
}

/* Radzen styles its own components, but the bare body (and the anonymous auth
   pages that hang off it) need the brand font set explicitly. The standard theme also paints a
   decorative blue/orange SVG wash on the body; drop it so the page is the plain brand surface. */
body {
    font-family: var(--znt-font);
    background-image: none;
}

/* Give content cards quiet definition against the pale app surface. Selected and focused
   controls carry the stronger brand colour; every passive card should not compete for it.
   Shadow and radius are set via the --rz-card-shadow/--rz-card-border-radius tokens instead
   (see :root) - Radzen's own variant selectors are specific enough to beat a border-radius/
   box-shadow declared directly here. */
.rz-card {
    border: 1px solid var(--znt-workspace-border);
    background: var(--znt-workspace-surface);
}

.rz-button {
    border-radius: 999px;
}

/* Split buttons (Send invoice, Bulk send) render tighter than the rest of the button set:
   give the main action, the dropdown toggle, and the popup options more breathing room. The
   popup renders outside the owning component, so these rules stay global rather than scoped. */
.rz-splitbutton .rz-button {
    padding-inline: 1.25rem;
}

.rz-splitbutton .rz-splitbutton-menubutton {
    padding-inline: 0.75rem;
}

/* Grid overflow menus are quiet icon actions, not outlined form buttons: borderless at rest,
   with a light outline and shading on hover and while pressed. Focus keeps the theme's outline. */
.znt-grid-row-actions {
    display: flex;
    justify-content: flex-end;
}

.znt-grid-row-actions .rz-splitbutton .rz-button,
.znt-grid-row-actions .rz-splitbutton .rz-button:focus {
    border: 1px solid transparent;
    box-shadow: none;
    padding-inline: 0.75rem;
}

/* Qualified to outrank Radzen's text-variant hover shading. */
.znt-grid-row-actions .rz-splitbutton .rz-button:not(.rz-state-disabled):not(:disabled):hover,
.znt-grid-row-actions .rz-splitbutton .rz-button:not(.rz-state-disabled):not(:disabled):active {
    border: 1px solid var(--rz-base-400);
    border-radius: 999px;
    background: var(--rz-base-200);
    box-shadow: none;
    padding-inline: 0.75rem;
}

.znt-grid-row-actions .rz-splitbutton-menubutton {
    display: none;
}

.rz-splitbutton-menu .rz-menuitem-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    cursor: pointer;
}

.rz-splitbutton-menu .rz-menuitem.rz-state-disabled .rz-menuitem-link {
    cursor: default;
}

/* Outlined primary buttons (Edit, Add treatment plan/form/product, Request script, Scan product,
   Camera, Upload, etc.) use the brand primary (sage) for their border, text, and icon. */
.rz-button.rz-primary.rz-variant-outlined {
    border-color: var(--rz-primary);
    color: var(--rz-primary);
}

.rz-button.rz-primary.rz-variant-outlined .rz-button-icon,
.rz-button.rz-primary.rz-variant-outlined i {
    color: var(--rz-primary);
}

.rz-button.rz-primary.rz-variant-outlined .rz-button-text {
    color: var(--rz-primary);
}

.rz-button.rz-light {
    border: 1.5px solid rgba(62, 122, 104, 0.8);
    color: var(--znt-ink);
}

.rz-button.rz-light .rz-button-icon,
.rz-button.rz-light i {
    color: var(--znt-ink);
}

.rz-button.rz-light.rz-variant-filled.rz-shade-default,
.rz-button.rz-light.rz-variant-flat.rz-shade-default,
.rz-button.rz-light.rz-variant-outlined.rz-shade-default,
.rz-button.rz-light.rz-variant-text.rz-shade-default {
    color: var(--znt-ink);
}

.rz-button.rz-light.rz-variant-filled.rz-shade-default .rz-button-icon,
.rz-button.rz-light.rz-variant-filled.rz-shade-default i,
.rz-button.rz-light.rz-variant-flat.rz-shade-default .rz-button-icon,
.rz-button.rz-light.rz-variant-flat.rz-shade-default i,
.rz-button.rz-light.rz-variant-outlined.rz-shade-default .rz-button-icon,
.rz-button.rz-light.rz-variant-outlined.rz-shade-default i,
.rz-button.rz-light.rz-variant-text.rz-shade-default .rz-button-icon,
.rz-button.rz-light.rz-variant-text.rz-shade-default i {
    color: var(--znt-ink);
}

h1:focus {
    outline: none;
}

/* Keep anonymous auth pages full-bleed even before scoped CSS finishes loading.
   Calm backdrop for the unauthenticated card: soft jade, sage and rose washes over paper, with two
   slow-drifting sweeps (::before ring arcs, ::after a blurred glow) fixed behind the content. */
.auth-shell {
    position: fixed;
    inset: 0;
    z-index: 0;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
    overflow-y: auto;
    color: var(--znt-ink);
    background:
        radial-gradient(120% 85% at 0% 0%, rgba(155, 189, 177, 0.55) 0%, rgba(155, 189, 177, 0) 62%),
        radial-gradient(95% 75% at 100% 100%, rgba(201, 130, 136, 0.34) 0%, rgba(201, 130, 136, 0) 60%),
        radial-gradient(70% 60% at 100% 0%, rgba(88, 103, 93, 0.2) 0%, rgba(88, 103, 93, 0) 70%),
        radial-gradient(60% 55% at 0% 100%, rgba(62, 122, 104, 0.16) 0%, rgba(62, 122, 104, 0) 70%),
        linear-gradient(160deg, #EAF1EC 0%, var(--znt-paper) 48%, #F6ECEA 100%);
}

/* The sign-in split screen fills the shell edge to edge instead of floating a centred card. */
.auth-shell:has(.login-split) {
    align-items: stretch;
    padding: 0;
}

.auth-shell::before,
.auth-shell::after {
    content: "";
    position: fixed;
    z-index: -1;
    pointer-events: none;
}

/* Two concentric ring arcs, mostly off-canvas, read as broad sweeping curves. */
.auth-shell::before {
    top: -55vmax;
    left: -40vmax;
    width: 140vmax;
    height: 120vmax;
    border-radius: 50%;
    background:
        radial-gradient(closest-side, rgba(255, 255, 255, 0) 70%, rgba(62, 122, 104, 0.2) 79%, rgba(255, 255, 255, 0) 88%),
        radial-gradient(closest-side, rgba(255, 255, 255, 0) 84%, rgba(201, 130, 136, 0.22) 92%, rgba(255, 255, 255, 0) 99%);
    animation: znt-auth-sweep 48s ease-in-out infinite alternate;
}

/* A soft rose-to-jade glow that drifts behind the card. */
.auth-shell::after {
    right: -20vmax;
    bottom: -25vmax;
    width: 75vmax;
    height: 60vmax;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(201, 130, 136, 0.32), rgba(155, 189, 177, 0.3));
    filter: blur(70px);
    animation: znt-auth-drift 36s ease-in-out infinite alternate;
}

@keyframes znt-auth-sweep {
    from { transform: rotate(-6deg) translate3d(0, 0, 0); }
    to   { transform: rotate(8deg) translate3d(4vmax, 3vmax, 0); }
}

@keyframes znt-auth-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(-12vmax, -8vmax, 0) scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-shell::before,
    .auth-shell::after {
        animation: none;
    }
}

/* Frosted card so the backdrop colours glow through softly. */
.znt-auth-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2.25rem;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: var(--znt-radius-lg);
    background: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
    backdrop-filter: blur(18px) saturate(1.15);
    box-shadow: 0 30px 70px -36px rgba(23, 32, 29, 0.35);
    color: var(--znt-ink);
    box-sizing: border-box;
}

.znt-auth-card--wide {
    max-width: 680px;
}

.znt-auth-header {
    margin-bottom: 1.75rem;
    text-align: center;
}

/* Mark + serif wordmark lockup on the anonymous pages (login, sign-up, support, initialising). */
/* Stacked brand logo centred above the sign-in and onboarding card titles. */
.znt-auth-lockup {
    display: block;
    height: auto;
    margin: 0 auto 1.25rem;
}

.znt-auth-title {
    margin: 0 0 0.4rem;
    font-family: var(--znt-font-display);
    color: var(--znt-ink);
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: 0;
}

.znt-auth-field {
    margin-bottom: 1rem;
}

.znt-auth-password-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    color: var(--znt-muted);
    background: transparent;
    border: 0;
    border-radius: var(--znt-radius-sm);
    cursor: pointer;
}

.znt-auth-password-toggle:hover {
    color: var(--znt-slate-deep);
    background: rgba(43, 58, 72, 0.06);
}

.znt-auth-password-toggle:focus-visible {
    outline: 2px solid var(--znt-slate);
    outline-offset: 1px;
}

.znt-password-strength {
    margin: -0.35rem 0 1rem;
    color: var(--znt-muted);
    font-size: 0.85rem;
}

.znt-password-strength meter {
    display: block;
    width: 100%;
    height: 0.75rem;
    margin-top: 0.35rem;
}

.znt-password-match {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.85rem;
}

.znt-password-match--error {
    color: #a32626;
}

.znt-auth-field .rz-textbox,
.znt-auth-field input {
    color: var(--znt-ink);
    font-family: inherit;
    background: #ffffff;
}

.znt-auth-field .rz-textbox::placeholder,
.znt-auth-field input::placeholder {
    color: var(--znt-muted);
}

/* Keep the white fill through autofill, submission and disabled states. Applying the
   inset shadow to every auth input also covers browser autofill state changes on submit.
   The content selector out-ranks Radzen's hover/focus rules that reset box-shadow. */
.znt-auth-field .rz-form-field .rz-form-field-content input,
.znt-auth-field .rz-form-field .rz-form-field-content input:is(:hover, :focus, :active, :disabled) {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
    box-shadow: 0 0 0 1000px #ffffff inset;
}

.znt-auth-field .rz-form-field-content input:-webkit-autofill {
    -webkit-text-fill-color: var(--znt-ink);
    caret-color: var(--znt-ink);
}

.znt-auth-error {
    margin-bottom: 1rem;
    padding: 0.6rem 0.8rem;
    color: #5a0a0a;
    background: rgba(255, 220, 220, 0.7);
    border: 1px solid rgba(220, 80, 80, 0.4);
    border-radius: 10px;
    font-size: 0.85rem;
}

.znt-auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.85rem 1rem;
    color: var(--znt-white);
    background: var(--znt-rose);
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 120ms ease, transform 120ms ease;
}

.znt-auth-submit:disabled {
    cursor: wait;
    opacity: 0.82;
}

.znt-auth-submit--busy {
    pointer-events: none;
}

.znt-auth-submit--busy .znt-auth-submit-icon {
    display: none;
}

.znt-auth-submit-spinner {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: var(--znt-white);
    border-radius: 50%;
    box-sizing: border-box;
    animation: znt-auth-submit-spin 800ms linear infinite;
}

.znt-auth-submit--busy .znt-auth-submit-spinner {
    display: inline-block;
}

@keyframes znt-auth-submit-spin {
    to {
        transform: rotate(360deg);
    }
}

.znt-auth-submit:hover {
    background: var(--znt-rose-dark);
}

.znt-auth-submit:active {
    transform: translateY(1px);
}

.znt-auth-submit:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

.znt-auth-footer {
    margin: 1.5rem 0 0;
    color: var(--znt-muted);
    font-size: 0.85rem;
    text-align: center;
}

.znt-auth-link {
    color: var(--znt-ink);
    font-weight: 500;
    text-decoration: none;
}

.znt-auth-link:not(.znt-auth-link--disabled):hover {
    text-decoration: underline;
}

.znt-auth-link--disabled {
    opacity: 0.55;
    cursor: default;
}

@media (max-width: 480px) {
    .znt-auth-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .znt-auth-title {
        font-size: 1.45rem;
    }
}

/* Lay the sidebar out as a column so the controls in .sidebar-footer
   can sit pinned to the bottom via margin-top: auto. */
.rz-sidebar.sidebar {
    display: flex;
    flex-direction: column;
}

/* When collapsed, keep a narrow rail visible (icons + the expand toggle) instead of
   Radzen's default of fully hiding the sidebar, which would make the toggle unreachable. */
.rz-sidebar.sidebar:not(.rz-sidebar-expanded) {
    width: 3.25rem;
    min-width: 3.25rem;
    overflow: hidden;
    opacity: 1;
}

/* In the collapsed rail, hide menu item labels and show only the icon. */
.rz-sidebar.sidebar:not(.rz-sidebar-expanded) .rz-navigation-item-text {
    display: none;
}

/* Pins administrative navigation and the collapse/expand toggle to the bottom. Expanded:
   one row — Settings on the left, toggle at the right edge. Collapsed rail: stacked
   (gear above, expand toggle below). */
.rz-sidebar.sidebar .sidebar-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* Let the Settings menu take the row; the toggle keeps to the right edge even when the
   Settings item is absent (non-administrators). */
.rz-sidebar.sidebar .sidebar-footer .rz-panel-menu {
    flex: 1 1 auto;
    min-width: 0;
}

.rz-sidebar.sidebar .sidebar-toggle {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem;
    margin-inline-start: auto;
}

.rz-sidebar.sidebar:not(.rz-sidebar-expanded) .sidebar-footer {
    flex-direction: column;
    align-items: stretch;
}

.rz-sidebar.sidebar:not(.rz-sidebar-expanded) .sidebar-toggle {
    margin-inline-start: 0;
    justify-content: center;
}

/* Bare chevron glyph: drop the global Light-button pill outline inside the sidebar. */
.rz-sidebar.sidebar .sidebar-toggle .rz-button.rz-light {
    border: none;
}

.rz-sidebar.sidebar .sidebar-toggle .rz-button.rz-light.rz-variant-text.rz-shade-default,
.rz-sidebar.sidebar .sidebar-toggle .rz-button.rz-light.rz-variant-text.rz-shade-default .rz-button-icon,
.rz-sidebar.sidebar .sidebar-toggle .rz-button.rz-light.rz-variant-text.rz-shade-default i {
    color: var(--rz-panel-menu-item-color);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

/* These forms surface validation through <ValidationMessage> text (and RadzenAlert), not the
   Blazor template's default green/red input outlines. Those outlines are rectangular and sit on
   the inner input, so they don't follow the rounded .rz-form-field-content border and read as a
   misaligned second border. Suppress them inside znt-form. */
.znt-form .valid.modified:not([type=checkbox]),
.znt-form .invalid {
    outline: none;
}

.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;
}
/* ==========================================================================
   Loader animations â€” global so the RadzenDataGrid internal loader override
   below can reuse the same keyframe by name. The LoadingDots component's
   scoped CSS handles sizing and colour, but the animation property would be
   re-keyed by Blazor's CSS scoping, so it lives here instead.
   ========================================================================== */
.znt-loading-dots__dot {
    animation: znt-loading-dots-bounce 1.2s ease-in-out infinite;
}

/* Stagger so the dots ripple rather than blink in lockstep. 0.15s offsets
   look natural against the 1.2s cycle. */
.znt-loading-dots__dot:nth-child(2) {
    animation-delay: 0.15s;
}

.znt-loading-dots__dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes znt-loading-dots-bounce {
    0%, 60%, 100% {
        opacity: 0.25;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-0.25em);
    }
}

@media (prefers-reduced-motion: reduce) {
    .znt-loading-dots__dot {
        animation-duration: 1.8s;
    }
}

.znt-skeleton-shimmer {
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--znt-workspace-border) 72%, #fff) 0%,
        color-mix(in srgb, var(--znt-workspace-border) 36%, #fff) 42%,
        color-mix(in srgb, var(--znt-workspace-border) 72%, #fff) 84%
    );
    background-size: 220% 100%;
    animation: znt-skeleton-shimmer 1.35s ease-in-out infinite;
}

@keyframes znt-skeleton-shimmer {
    0% {
        background-position: 120% 0;
    }

    100% {
        background-position: -120% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .znt-skeleton-shimmer {
        animation: none;
    }
}

.rz-button.rz-light:hover {
    background-color: var(--rz-base-400);
}

.help-toolbar .rz-button.rz-variant-outlined.rz-light:not(.rz-state-disabled):hover {
    background-color: var(--rz-base-300);
}

.znt-dialog-over-side-drawer {
    z-index: 1300;
}

/* Radzen's Confirm dialog renders OK before Cancel and has no per-button ButtonStyle option.
   For destructive Cancel/Remove/Delete actions, show the safe option first and recolour OK to
   match the red used by RadzenButton ButtonStyle="ButtonStyle.Danger" throughout the app. */
.znt-dialog-confirm-danger .rz-dialog-confirm-buttons {
    flex-direction: row-reverse;
}

.znt-dialog-confirm-danger .rz-dialog-confirm-buttons .rz-button.rz-primary {
    background-color: var(--rz-danger);
    border-color: var(--rz-danger);
}

.znt-dialog-confirm-danger .rz-dialog-confirm-buttons .rz-button.rz-primary:not(.rz-state-disabled):hover {
    background-color: var(--rz-danger-dark);
    border-color: var(--rz-danger-dark);
}

/* Radzen HTML editor prompts use the default dialog layer, which is the same layer as a side
   drawer and is therefore covered when the editor is inside one. Keep the prompt wrapper (which
   also contains its mask) on the established over-drawer layer. */
.rz-dialog-wrapper:has(.rz-html-editor-dialog-item) {
    z-index: 1300;
}

/* Header help button: dark icon (the Light button variant renders it white by
   default) and no pill outline (a bare question-mark glyph). The header layout
   owns spacing between all actions. */
.rz-button.rz-light.znt-help-button {
    border: none;
    color: var(--znt-ink);
}

.znt-help-button .rz-button-icon,
.znt-help-button i {
    color: var(--znt-ink);
}

/* ==========================================================================
   Contextual help panel (HelpPanel.razor). The panel reuses the .znt-drawer
   header/body chrome; the rules below style the Back / Help-home toolbar and
   the rendered Markdown content served by the help endpoints.
   ========================================================================== */
.help-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.help-toolbar-home {
    margin-left: auto;
}


.help-content {
    color: var(--rz-text-color);
    line-height: 1.55;
}

.help-content h1,
.help-content h2,
.help-content h3 {
    color: var(--rz-text-color);
    font-weight: 700;
    margin: 1.25rem 0 0.5rem;
}

.help-content h1 {
    font-size: 1.5rem;
    margin-top: 0;
}

.help-content h2 {
    font-size: 1.2rem;
}

.help-content h3 {
    font-size: 1.02rem;
}

.help-content p,
.help-content ul,
.help-content ol {
    margin-bottom: 0.75rem;
}

.help-content ul,
.help-content ol {
    padding-left: 1.4rem;
}

.help-content li {
    margin-bottom: 0.25rem;
}

.help-content a {
    color: var(--znt-coral, var(--rz-primary));
    font-weight: 600;
}

.help-content code {
    background: var(--rz-base-200);
    border: 1px solid var(--rz-base-300);
    border-radius: 4px;
    padding: 0.05rem 0.3rem;
    font-size: 0.9em;
}

.help-content blockquote {
    border-left: 3px solid var(--rz-base-300);
    margin: 0.75rem 0;
    padding: 0.25rem 0 0.25rem 1rem;
    color: var(--rz-text-secondary-color);
}

.help-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    display: block;
    overflow-x: auto;
}

.help-content img {
    max-width: 100%;
    height: auto;
}

.help-content th,
.help-content td {
    border: 1px solid var(--rz-base-300);
    padding: 0.5rem;
    vertical-align: top;
    text-align: left;
}

.help-content th {
    background: var(--rz-base-200);
}

/* Appointments page busy overlay. Kept global because module isolated CSS is not
   currently included by the host shell. */
.appointments-board-panel {
    min-height: calc(100vh - 11rem);
}

.appointments-loading-panel {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(248, 250, 252, 0.72);
}

.appointments-loading-card {
    display: grid;
    justify-items: center;
    gap: 0.75rem;
    min-width: min(24rem, 100%);
    padding: 1.5rem;
}

.appointments-loading-text {
    color: var(--rz-text-color);
    font-weight: 600;
    text-align: center;
}

/* ==========================================================================
   Appointments board chrome (day board + hourly week board). Shared here — not
   in a component's scoped CSS — so both AppointmentBoardDayView (columns = days'
   practitioners) and AppointmentBoardWeekView (columns = a practitioner's days)
   render the same gutter/columns/blocks. The create-drag band is styled inline
   by appointments-board.js (created outside Blazor's render tree).
   ========================================================================== */
.appt-board {
    display: flex;
    min-width: 720px;
    max-height: 100%;
    overflow: auto;
    background: var(--rz-base-background-color, #fff);
    border: 1px solid var(--rz-border-color, #dfe6ee);
    border-radius: var(--znt-radius-md, 14px);
}

.appt-gutter { width: 56px; flex: none; }

.appt-gutter-head {
    height: 64px;
    border-bottom: 1px solid var(--rz-border-color, #dfe6ee);
    position: sticky;
    top: 0;
    background: var(--rz-base-background-color, #fff);
    z-index: 5;
}

.appt-hour {
    position: relative;
    font-size: 0.7rem;
    color: var(--rz-text-secondary-color, #5c6b7d);
    font-variant-numeric: tabular-nums;
}

.appt-hour span {
    position: absolute;
    top: -0.5rem;
    right: 0.6rem;
    background: var(--rz-base-background-color, #fff);
    padding: 0 0.15rem;
}

.appt-col {
    flex: 1;
    min-width: 300px;
    border-left: 1px solid var(--rz-border-color, #dfe6ee);
    display: flex;
    flex-direction: column;
}

.appt-col-head {
    height: 64px;
    border-bottom: 1px solid var(--rz-border-color, #dfe6ee);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 0.75rem;
    background: var(--rz-base-background-color, #fff);
    position: sticky;
    top: 0;
    z-index: 5;
}

.appt-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex: none;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Practitioner avatars on the day board, week summary and practitioner picker: primary sage,
   matching the search button and switches. Set through ProfileImage's own variable, since its
   isolated background rule outranks a plain class here. */
.appt-avatar,
.wk-avatar,
.appt-practitioner-option-image {
    --znt-profile-image-background: var(--rz-primary);
}

.appt-col-who { line-height: 1.25; min-width: 0; display: flex; flex-direction: column; }
.appt-col-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-col-shift { font-size: 0.7rem; color: var(--rz-text-secondary-color, #5c6b7d); font-variant-numeric: tabular-nums; }

.appt-col-load {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--znt-slate-deep, #17201D);
    background: #eef4fb;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.appt-col-body {
    position: relative;
    flex: none;
    cursor: cell;
    /* Gridline spacing tracks --appt-px-per-min (set on the ancestor .appt-board) so it stays in
       sync with the board's zoom/density level instead of the old fixed 72px/hour scale. */
    background:
        repeating-linear-gradient(to bottom,
            transparent 0, transparent calc(60px * var(--appt-px-per-min) - 1px),
            var(--rz-border-color, #dfe6ee) calc(60px * var(--appt-px-per-min) - 1px), var(--rz-border-color, #dfe6ee) calc(60px * var(--appt-px-per-min))),
        repeating-linear-gradient(to bottom,
            transparent 0, transparent calc(15px * var(--appt-px-per-min) - 1px),
            #eef1f6 calc(15px * var(--appt-px-per-min) - 1px), #eef1f6 calc(15px * var(--appt-px-per-min)));
    background-color: var(--rz-base-background-color, #fff);
}

.appt-gutter-body {
    position: relative;
}

.appt-current-time-marker {
    position: absolute;
    left: 2px;
    right: 2px;
    transform: translateY(-50%);
    padding: 3px 1px;
    border-radius: 4px;
    background: #b42318;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: center;
    line-height: 1.3;
    z-index: 4;
    pointer-events: none;
}

.appt-current-time-marker span,
.appt-current-time-marker time {
    display: block;
}

.appt-current-time-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #b42318;
    z-index: 4;
    pointer-events: none;
}

.appt-current-time-line::before {
    content: "";
    position: absolute;
    left: -4px;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: inherit;
}

.appt-offroster {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1;
    pointer-events: none;
    background: repeating-linear-gradient(-45deg,
        var(--znt-sage-wash, #F6F8F5) 0 6px,
        color-mix(in srgb, var(--znt-sage, #58675D) 12%, var(--znt-sage-wash, #F6F8F5)) 6px 12px);
}

.appt-block {
    position: absolute;
    z-index: 3;
    border-radius: var(--znt-radius-sm, 8px);
    padding: 0.3rem 0.55rem;
    box-sizing: border-box;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    user-select: none;
    border-left: 3px solid var(--appt-edge, #8ca6c4);
    background: var(--appt-bg, #eef2f6);
    box-shadow: 0 1px 2px rgba(38, 50, 65, 0.08);
}

.appt-block--dragging {
    cursor: grabbing;
    z-index: 10;
    box-shadow: 0 6px 18px rgba(38, 50, 65, 0.25);
    opacity: 0.95;
}

.appt-resize-handle {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 8px;
    cursor: ns-resize;
    touch-action: none;
}

.appt-resize-handle::after {
    content: "";
    display: block;
    width: 28px;
    height: 3px;
    margin: 3px auto 0;
    border-radius: 2px;
    background: var(--appt-edge, #8ca6c4);
    opacity: 0;
}

.appt-block:hover .appt-resize-handle::after,
.appt-block--selected .appt-resize-handle::after { opacity: 0.55; }

@media (prefers-reduced-motion: no-preference) {
    .appt-block { transition: box-shadow 0.12s ease; }
}

.appt-block:hover { box-shadow: 0 2px 6px rgba(38, 50, 65, 0.18); }

.appt-block:focus-visible,
.appt-block--selected {
    outline: 2px solid var(--znt-slate, #3E7A68);
    outline-offset: 1px;
}

.appt-block--blocked {
    --appt-edge: #b7c1cc;
    --appt-bg: #e9edf1;
    color: var(--rz-text-secondary-color, #5c6b7d);
}

.appt-block--no-show {
    --appt-edge: var(--rz-danger, #d9534f) !important;
    --appt-bg: #edf0f3 !important;
    color: var(--rz-text-secondary-color, #5c6b7d);
    opacity: 0.68;
}

.appt-block--arrived {
    --appt-edge: var(--rz-success, #3aa76d) !important;
}

.appt-block-row1 {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
    font-size: 0.75rem;
    line-height: 1.1;
    min-width: 0;
}

.appt-block-name {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appt-block-time {
    margin-left: auto;
    font-weight: 400;
    font-size: 0.7rem;
    color: var(--rz-text-secondary-color, #5c6b7d);
    font-variant-numeric: tabular-nums;
}

.appt-arrived-indicator,
.appt-no-show-indicator,
.appt-blocked-indicator,
.appt-notes-indicator,
.appt-billed-indicator {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    color: #fff;
}

.appt-notes-indicator {
    /* Fixed colour, not var(--appt-edge, ...) - that variable is overridden per-status
       (arrived/no-show) on the enclosing block and would inherit into this icon too. */
    background: var(--znt-info-bg);
    color: var(--znt-info-fg);
    cursor: help;
}

/* Washed soft sage (#A7B89F) at the same strength as the info and no-show tints. --znt-sage-wash
   is too faint to show against the pale booking backgrounds. */
.appt-arrived-indicator {
    background: color-mix(in srgb, #A7B89F 60%, white);
    color: var(--znt-sage);
}

.appt-no-show-indicator {
    background: var(--znt-danger-bg);
    color: var(--znt-danger-fg);
}

.appt-blocked-indicator {
    background: var(--rz-text-secondary-color, #5c6b7d);
}

.appt-billed-indicator {
    background: var(--znt-sage);
    color: var(--znt-success-bg);
}

.appt-arrived-indicator .rzi,
.appt-no-show-indicator .rzi,
.appt-blocked-indicator .rzi,
.appt-notes-indicator .rzi,
.appt-billed-indicator .rzi {
    font-size: 13px;
    line-height: 1;
}

.appt-block-treatment,
.appt-block-services {
    min-width: 0;
    font-size: 0.72rem;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appt-block-note {
    font-size: 0.68rem;
    color: var(--rz-text-secondary-color, #5c6b7d);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appt-block-medical {
    font-size: 0.68rem;
    line-height: 1.15;
    color: var(--rz-text-secondary-color, #5c6b7d);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appt-block-medical-label {
    font-weight: 600;
}

.appt-empty {
    flex: 1;
    display: grid;
    place-items: center;
    color: var(--rz-text-secondary-color, #5c6b7d);
    min-height: 12rem;
}
