#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 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;
    right: 0.75rem;
    top: 0.5rem;
}



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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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");
}


:root {
    --rz-white: #ffffff;
    --rz-black: #000000;
    --rz-base-50: #fafafa;
    --rz-base-100: #f5f5f5;
    --rz-base-200: #eeeeee;
    --rz-base-300: #e0e0e0;
    --rz-base-400: #bdbdbd;
    --rz-base-500: #9e9e9e;
    --rz-base-600: #757575;
    --rz-base-700: #616161;
    --rz-base-800: #424242;
    --rz-base-900: #212121;
    --rz-primary: #003399;
    --rz-primary-light: rgba(0, 51, 153, 0.8);
    --rz-primary-lighter: rgba(0, 51, 153, 0.12);
    --rz-primary-dark: #3633a8;
    --rz-primary-darker: #2e2c8f;
    --rz-secondary: #9f0202;
    --rz-secondary-light: rgba(159, 2, 2, 0.5);
    --rz-secondary-lighter: rgba(159, 2, 2, 0.12);
    --rz-secondary-dark: #9f0202;
    --rz-secondary-darker: #9f0202;
    --rz-info: #2196f3;
    --rz-info-light: #4dabf5;
    --rz-info-lighter: rgba(33, 150, 243, 0.2);
    --rz-info-dark: #1a78c2;
    --rz-info-darker: #1666a5;
    --rz-success: #4caf50;
    --rz-success-light: #70bf73;
    --rz-success-lighter: rgba(76, 175, 80, 0.16);
    --rz-success-dark: #3d8c40;
    --rz-success-darker: #347736;
    --rz-warning: #ff9800;
    --rz-warning-light: #ffad33;
    --rz-warning-lighter: rgba(255, 152, 0, 0.2);
    --rz-warning-dark: #cc7a00;
    --rz-warning-darker: #ad6700;
    --rz-danger: #f44336;
    --rz-danger-light: #f6695e;
    --rz-danger-lighter: rgba(244, 67, 54, 0.2);
    --rz-danger-dark: #c3362b;
    --rz-danger-darker: #a62e25;
    --rz-link-color: var(--rz-primary);
    --rz-text-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
    --rz-header-background-color: var(--rz-primary-lighter);
    --rz-on-secondary-lighter: var(--rz-primary);
    --rz-menu-top-item-background-color: transparent;
    --rz-menu-top-item-icon-color: var(--rz-primary);
    --rz-menu-top-item-icon-hover-color: var(--rz-secondary);
    --rz-menu-top-item-selected-color: var(--rz-secondary);
    --rz-menu-item-icon-color: var(--rz-primary);
    --rz-menu-item-icon-hover-color: var(--rz-secondary);
    --rz-menu-item-selected-color: var(--rz-secondary);
    --rz-selectbar-selected-color: #fff;
    --rz-selectbar-selected-background-color: var(--rz-primary-light);
    --rz-header-background-color: var(--rz-primary-lighter);
    --rz-dialog-background-color: var(--rz-base-50);
    --rz-dialog-title-background-color: var(--rz-primary-lighter);
    --rz-dialog-content-padding: 0.5rem;
    /*
    --rz-layout-body-margin: 0 0.25rem 0.25rem;
    --rz-layout-body-padding: 0.25rem;
    --rz-gap: 0.5rem;
    --rz-row-gap: 0.5rem;
    --rz-grid-header-font-weight: bold;
    --rz-footer-padding: 3px !important;
    --rz-header-background-color: var(--rz-primary-lighter);

    --rz-dialog-background-color: var(--rz-base-50);
    --rz-dialog-title-background-color: var(--rz-primary-lighter);
    --rz-grid-header-filter-icon-active-color: var(--rz-success);
    
    --rz-tabs-tab-padding: 0.7rem 0.7rem;
    
    --bs-primary-rgb: 0, 51, 153;
    --rz-text-h2-margin-block-end: 1px;
    --rz-card-flat-background-color: var(--rz-primary-lighter) !important;*/
}

.rz-link .rz-card {
    transition: var(--rz-transition-all);
}

.rz-link:hover .rz-card {
    box-shadow: var(--rz-shadow-4);
}
/* Inter (self-hosted variable font, all weights 100–900 in one file).
   Referenced first in --rz-text-font-family; without these @font-face rules
   the app silently fell back to Segoe UI / San Francisco / Roboto per-OS.
   font-display: swap — text renders immediately in the fallback, then swaps. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/InterVariable.woff2") format("woff2");
}

@font-face {
    font-family: 'Inter';
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/InterVariable-Italic.woff2") format("woff2");
}

@font-face {
    font-family: 'MeditalkFaSolid';
    font-display: block;
    font-weight: 400;
    src: url("../fontawesome/webfonts/fa-solid-900.woff2") format("woff2"), url("../fontawesome/webfonts/fa-solid-900.ttf") format("truetype");
}

@font-face {
    font-family: 'MeditalkFaDuo';
    font-style: normal;
    font-weight: 900;
    font-display: block;
    src: url("../fontawesome/webfonts/fa-duotone-900.woff2") format("woff2"), url("../fontawesome/webfonts/fa-duotone-900.ttf") format("truetype");
    /*src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/webfonts/fa-solid-900.woff2') format('woff2');*/
}
.fa {
    --rz-icon-font-family: "MeditalkFaSolid";
}

.fa-small {
    --rz-icon-font-family: "MeditalkFaSolid";
    font-size: 0.875em;
}

.fad {
    --rz-icon-font-family: "MeditalkFaDuo";
}
    /* Radzen's busy/loading spinner is a Material Symbols LIGATURE (e.g. "refresh"),
   rendered on a `.rzi` element that inherits --rz-icon-font-family from its button.
   Where one of the FA helper classes above is in scope, that resolves to a Font
   Awesome family, which can't shape the ligature — it paints the raw letters on top
   of each other (the same failure the split-button rule below fixes).

   Our own button components drop the FA class while IsBusy, which covers a button's
   own class — but the FA variable also arrives from ANCESTOR elements (a panel or
   stack with fa/fa-small), which no component can strip. These rules are the real
   fix: every spinner shape Radzen has shipped is forced back to Material Symbols.
   Radzen 8.7.x renders the button's busy icon as
   `<i class="notranslate rz-button-icon-left rzi" style="animation: rotation ...">refresh</i>`
   — no dedicated class, so it's matched by its inline rotation animation. */
    .rzi-circle-o-notch,
    [style*="button-icon-spin"],
    .rz-button .rzi[style*="rotation"] {
        --rz-icon-font-family: "Material Symbols" !important;
        font-family: "Material Symbols" !important;
    }

    /* Same problem on RadzenSplitButton: its dropdown-toggle half renders a
   Material Symbols ligature (arrow) icon internally. When the split button
   carries one of the FA helper classes, the toggle icon inherits the FA
   font, which can't shape the ligature and renders it as raw letters
   ("DRC..."). Force just the toggle icon back to Material Symbols — the
   main button's FA icon is unaffected. */
    .fa .rz-splitbutton-menubutton .rzi,
    .fa-small .rz-splitbutton-menubutton .rzi,
    .fad .rz-splitbutton-menubutton .rzi {
        --rz-icon-font-family: "Material Symbols";
        font-family: "Material Symbols";
    }

/* ================================================================
   Panel-scoped loading overlay
   ================================================================
   Reusable overlay for cards/panels whose content is being re-fetched
   in response to a filter, dropdown, or chart-click change. Sits on
   top of the existing content (white-tinted) so users keep visual
   continuity instead of seeing the panel flash empty.

   Usage:
     <div class="panel-loading-overlay-host">  (gets position: relative)
       @if (IsPanelLoading) {
         <div class="panel-loading-overlay">
           <RadzenProgressBarCircular ... />
           <RadzenText>Loading…</RadzenText>
         </div>
       }
       ... actual content ...
     </div>
*/
.panel-loading-overlay-host {
    position: relative;
}

.panel-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    border-radius: inherit;
}
.rz-selectbar {
    --rz-icon-font-family: "MeditalkFaSolid";
}
.rz-navigation-item-icon {
    --rz-icon-font-family: "MeditalkFaSolid";
}

.rz-tabview-nav {
    --rz-icon-font-family: "MeditalkFaSolid";
}
.material-symbols {
    --rz-icon-font-family: 'Material Symbols Outlined';
}
/* ================================================================
   Card-view cards (rc-card)
   ================================================================
   Shared styling for the RadzenDataList "Card View" tabs (Patient
   Insurances, Relationships, etc.). Replaces the old solid-navy
   header bar (negative-margin bleed inside RadzenCard) and the
   all-bold-blue values with a white card, hairline border, and a
   label/value grid where only the value carries weight.

   Usage:
     <div class="rc-card">
       <div class="rc-card-head">
         <span class="rc-chip rc-chip-primary">Primary</span>
         <span class="rc-card-title">Texas Medicare</span>
         <div class="rc-card-actions"> edit/delete buttons </div>
       </div>
       <div class="rc-card-body">
         <div class="rc-card-row">
           <span class="rc-card-label">Type</span>
           <span class="rc-card-value">Texas Medicare</span>
         </div>
       </div>
     </div>
*/
.rc-card {
    background: #fff;
    border: 1px solid #dfe5f0;
    border-radius: 12px;
    padding: 12px 16px;
    width: 355px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-family: var(--rz-text-font-family);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

    .rc-card:hover {
        border-color: #c4ccdb;
        box-shadow: 0 4px 14px rgba(23, 35, 63, 0.08);
    }

.rc-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #eef1f7;
    padding-bottom: 8px;
}

.rc-card-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: #17233f;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rc-card-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.rc-card-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rc-card-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 0.82rem;
}

.rc-card-label {
    flex: 0 0 110px;
    color: #8b97ad;
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rc-card-value {
    color: #17233f;
    font-weight: 600;
    min-width: 0;
    overflow-wrap: anywhere;
}

    .rc-card-value.rc-muted {
        color: #8b97ad;
        font-weight: 500;
    }

/* Secondary detail text next to a badge or value (eligibility month, check date). */
.rc-muted {
    color: #8b97ad;
}

.rc-chip {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2.5px 10px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.rc-chip-primary { background: #003399; color: #fff; }
.rc-chip-neutral { background: #e9eefa; color: #003399; }
.rc-chip-good { background: #e6f4ea; color: #15803d; }
.rc-chip-warn { background: #fdf0e0; color: #b45309; }
.rc-chip-danger { background: #fbe9e9; color: #c02626; }

.rc-card-note {
    font-size: 0.78rem;
    color: #5e6c88;
    font-style: italic;
    border-top: 1px solid #eef1f7;
    padding-top: 7px;
    overflow-wrap: anywhere;
}

/* Media row: thumbnail (e.g. device photo) beside the fact rows. */
.rc-card-media {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

    .rc-card-media .rc-card-body { flex: 1; min-width: 0; }

.rc-card-photo {
    width: 72px !important;
    height: 72px !important;
    border-radius: 10px !important;
    object-fit: cover;
    border: 1px solid #dfe5f0;
    flex-shrink: 0;
}

/* --- rc-card polish: accent edge, icon medallion, ghost actions --- */
.rc-card {
    --rc-accent: #003399;
    border-left: 3px solid var(--rc-accent);
    box-shadow: 0 1px 2px rgba(23, 35, 63, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

    .rc-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(23, 35, 63, 0.10);
        border-color: #dfe5f0;
        border-left-color: var(--rc-accent);
    }

.rc-accent-primary { --rc-accent: #003399; }
.rc-accent-neutral { --rc-accent: #5e6c88; }
.rc-accent-good { --rc-accent: #15803d; }
.rc-accent-warn { --rc-accent: #d97706; }
.rc-accent-danger { --rc-accent: #dc2626; }

/* Entity icon medallion, tinted from the card accent. */
.rc-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    flex-shrink: 0;
    order: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--rc-accent) 11%, #fff);
}

    .rc-card-icon .rzi {
        color: var(--rc-accent) !important;
        font-size: 0.95rem !important;
    }

/* Visual order: icon · title · chips · actions. Flex `order` handles it so
   templates keep their chip-first DOM order. */
.rc-card-head > .rc-card-title { order: 1; flex: 1; }
.rc-card-head > .rc-chip { order: 2; }
.rc-card-head > .rc-card-actions { order: 3; margin-left: 0; }

.rc-card-value { font-variant-numeric: tabular-nums; }

/* Click-to-copy values (insurance number, ...): same affordance as the patient card's chart number. */
.rc-copyable { cursor: copy; }
.rc-copyable:hover { text-decoration: underline dotted; text-underline-offset: 3px; }
.rc-copyable .rc-copy-icon { margin-left: 0.35rem; font-size: 0.75em; opacity: 0.45; vertical-align: middle; }
.rc-copyable:hover .rc-copy-icon { opacity: 1; }

/* Action buttons read as quiet ghosts until hovered. */
.rc-card-actions .rz-button {
    background: var(--rc-primary-lighter) !important;
    /*background: #e9eefa !important;*/
    color: var(--rc-accent) !important;
    border: none !important;
    box-shadow: none !important;
}

    .rc-card-actions .rz-button .rz-button-icon,
    .rc-card-actions .rz-button .rz-button-icon-only { color: #8b97ad !important; }

    .rc-card-actions .rz-button:hover { background: #eef1f7 !important; }

        .rc-card-actions .rz-button:hover .rz-button-icon,
        .rc-card-actions .rz-button:hover .rz-button-icon-only { color: #003399 !important; }

    .rc-card-actions .rz-button.rz-danger:hover { background: #fbe9e9 !important; }

        .rc-card-actions .rz-button.rz-danger:hover .rz-button-icon,
        .rc-card-actions .rz-button.rz-danger:hover .rz-button-icon-only { color: #c02626 !important; }

/* rc-card refinements: RadzenDataList's item wrapper forces width:100% (which
   stretched a lone card across the whole row) — cap with max-width instead.
   Surface uses the theme header tint rather than plain white. */
.rc-card {
    max-width: 355px;
    background: var(--rz-header-background-color, #fff) !important;
}

.rc-card-icon {
    background: color-mix(in srgb, var(--rc-accent) 11%, transparent);
}

/* Chips move to a second header row so the title keeps the full first line:
   row 1 = icon · title · actions, row 2 = status chips. The ::after element
   is a zero-height flex line-break, inserted only when chips exist. */
.rc-card-head {
    flex-wrap: wrap;
    row-gap: 6px;
}

    .rc-card-head > .rc-card-actions { order: 2; }

    .rc-card-head:has(.rc-chip)::after {
        content: '';
        flex-basis: 100%;
        height: 0;
        order: 3;
    }

    .rc-card-head > .rc-chip { order: 4; }


.rz-form-field-label {
    font-size: 0.6rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
}
.rz-fieldset-legend-text {
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
}
.rz-dialog-title {
    font-size: 1.2rem !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
}
.rz-column-title {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
}
/* ---------------------------------------------------------------------------
   Applied-filter summary (MeditalkDataGrid.FilterSummaryTemplate).
   Renders in the grid's HeaderTemplate whenever any column filter is active,
   so a filter restored from localStorage cannot silently hide rows.
   --------------------------------------------------------------------------- */
.rc-filter-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    margin-bottom: 0.25rem;
    background: var(--rz-info-lighter, #eef4fd);
    border: 1px solid var(--rz-info-light, #cfe0f7);
    border-radius: 4px;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.rc-filter-summary-label {
    font-weight: 600;
    margin-right: 0.15rem;
    white-space: nowrap;
}

.rc-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.1rem 0.45rem;
    background: var(--rz-base-background-color, #fff);
    border: 1px solid var(--rz-info-light, #cfe0f7);
    border-radius: 12px;
    max-width: 22rem;
}

.rc-filter-chip > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rc-filter-chip-clear,
.rc-filter-clear-all,
.rc-filter-query-toggle {
    background: none;
    border: none;
    padding: 0 0.15rem;
    cursor: pointer;
    color: var(--rz-text-secondary-color, #52525b);
    font: inherit;
}

.rc-filter-chip-clear {
    font-size: 1rem;
    line-height: 1;
}

.rc-filter-chip-clear:hover,
.rc-filter-clear-all:hover,
.rc-filter-query-toggle:hover {
    color: var(--rz-danger, #c2185b);
    text-decoration: underline;
}

.rc-filter-clear-all {
    margin-left: auto;
    white-space: nowrap;
}

.rc-filter-query-toggle {
    font-family: monospace;
}

/* The raw OData sits on its own row and scrolls rather than stretching the bar. */
.rc-filter-query {
    flex-basis: 100%;
    display: block;
    margin-top: 0.25rem;
    padding: 0.35rem 0.5rem;
    background: var(--rz-base-200, #f4f4f5);
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.75rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Multi-line cell text inside a Radzen grid.
   .rz-cell-data is `white-space: nowrap; overflow: hidden; text-overflow: ellipsis`, so a long
   chart note rendered as one clipped line with no way to read the rest. The class was already
   applied in PatientNotes.razor but had never been DEFINED anywhere, which is why it did nothing.
   -webkit-line-clamp keeps a very long note from turning one row into a page: it shows the first
   few lines and the row action opens the whole thing. */
.wrap-text {
    white-space: pre-wrap;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
}

/* A claim's hold reasons, one per line and never clipped: a biller acts on the whole list
   (Tax ID, address, authorization…), and a claim can carry more than four. */
.claim-reasons {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    line-height: 1.35;
}

/* Column chooser (GridColumnChooser). Two Radzen behaviours shape this:
   - it writes an inline width on a dropdown's panel to match the input, which squeezed a
     25-column checklist into the 140px trigger; only !important beats an inline style;
   - it moves the OPEN panel out to <body>, so the panel cannot be reached as a descendant of the
     chooser. It is matched by id instead: Radzen names it "popup-" + the dropdown's id.
   The trigger sits at the right end of the title bar, so the wider panel is hung from the
   trigger's RIGHT edge (shifted left by its own width minus the trigger's). */
.grid-column-chooser {
    width: 140px;
}

[id^="popup-grid-column-chooser"].rz-multiselect-panel {
    width: max-content !important;
    min-width: 260px !important;
    max-width: min(420px, 90vw) !important;
    transform: translateX(calc(140px - 100%));
}

[id^="popup-grid-column-chooser"] .rz-multiselect-items-wrapper {
    max-height: 60vh !important;
}

[id^="popup-grid-column-chooser"] .rz-multiselect-item {
    white-space: nowrap;
}

/* A field that is not one of the page's own columns carries a small tag, so it is clear that
   ticking it ADDS a column rather than un-hiding one. */
.column-chooser-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.column-chooser-tag {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    color: var(--rz-info-darker, var(--rz-info));
    background: var(--rz-info-lighter, var(--rz-base-200));
}

/* Grid column auto-fit (MeditalkDataGrid.AutoFitColumnsAsync): while the table is being measured
   nothing may wrap or clip, or the measurement is the clipped width, not the content's. */
.rc-autofit-measuring tr.rz-expanded-row-content {
    /* A detail row spans every column; nowrap text in it would widen them all. */
    display: none !important;
}

/* Fit to the content, not the header: a long title ("HOMEHEALTHLOCATION") over short values
   ("El Paso") would otherwise set the width. Only the title text is taken out, so the header's
   sort, filter and menu icons still count and the column never gets too narrow to filter. The
   title shows with an ellipsis when it is wider than the content. */
.rc-autofit-measuring thead .rz-column-title-content {
    display: none !important;
}

/* Every descendant, not a list of known classes: white-space is inherited, so any element inside a
   cell that sets its own (a .reading-context with white-space: normal did) quietly opts back into
   wrapping and its column is measured at the width of its longest word. overflow-wrap: anywhere
   is reset for the same reason: it lets the browser count a single character as the minimum. */
.rc-autofit-measuring th,
.rc-autofit-measuring td,
.rc-autofit-measuring th *,
.rc-autofit-measuring td * {
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
}

/* Vital Signs: the note as a full-width second row under its reading. */
.vital-note-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem 0.5rem 2.5rem;
    font-weight: normal;
}

.vital-note-row .vital-note-icon {
    font-size: 0.9rem;
    color: var(--rz-text-disabled-color);
    margin-top: 0.15rem;
}

.vital-note-row .vital-note-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.45;
    color: var(--rz-text-secondary-color);
}

/* Patient Notes: two-column chart layout. The left cell says what the note is about (when, who,
   the reading or medication); the right cell is the whole note, wrapped, never clipped. */
.reading-summary,
.reading-notes {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

.reading-summary {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.reading-summary .reading-when {
    font-weight: 600;
    color: var(--rz-text-color);
}

.reading-summary .reading-patient,
.reading-summary .reading-by,
.reading-summary .reading-meta,
.reading-summary .reading-label {
    font-size: 0.8rem;
    color: var(--rz-text-secondary-color);
}

.reading-summary .reading-context {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.reading-summary .reading-value {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.05rem;
}

/* EditMedication opens as a two-step wizard: pick a drug from RxTerms, then fill the form.
   Editing an existing medication starts on step 2 with the drug already chosen, so the step
   header and the Previous/Next pair are chrome around the only panel there is. The markup is
   one form shared by both modes, so the chrome is hidden rather than the form duplicated.
   .rz-steps is the RadzenSteps root (display:flex, column); its direct <ul> is the header. */
.rc-steps-headless > .rz-steps > ul,
.rc-steps-headless .rz-steps-buttons {
    display: none;
}

/* The scheduler board columns navigate through the BOARD's day controls; Radzen's built-in
   nav bar inside each column was a second, disagreeing navigation (its date moved while the
   board header stayed), so it is hidden. */
.board-scheduler .rz-scheduler-nav {
    display: none;
}

/* ---- Care plan: who does the activity (patient / staff / provider) ---- */
.participant-icon { font-size: 0.85rem; width: 1.1rem; text-align: center; flex: 0 0 auto; margin-right: 0.15rem; }
.participant-icon.participant-patient { color: var(--rz-primary); }
.participant-icon.participant-staff { color: var(--rz-text-secondary-color); }
.participant-icon.participant-unknown { color: var(--rz-warning-dark, var(--rz-warning)); }

/* Payers → Merge Duplicates: one table per suggested group. */
.payer-merge-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.payer-merge-table th, .payer-merge-table td { padding: .35rem .6rem; border-bottom: 1px solid var(--rz-border); text-align: left; }
.payer-merge-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--rz-text-secondary-color); font-weight: 600; }
.payer-merge-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.payer-merge-table tr.is-survivor td { font-weight: 600; background: var(--rz-primary-lighter, rgba(0, 0, 0, .03)); }

/* ==== Care plan (APCM UI design, index.html) — page, overview and comprehensive review ==== */
.cp-page { --cp-ink:#182c43; --cp-muted:#5d6e80; --cp-line:#dae3ea; --cp-blue:#164c9e; --cp-teal:#087f78; color: var(--cp-ink); }
.cp-page-header { display:flex; align-items:center; justify-content:space-between; gap:12px 20px; margin: 0 0 2px; flex-wrap:wrap; }
.cp-page-heading { display:flex; align-items:baseline; gap:6px 14px; flex-wrap:wrap; min-width:0; }
/* The patient tab around the care plan and the plan's own tabs add no padding of their own; the page sets its spacing. */
.rz-tabview-panel:has(> .cp-page) { padding-top: 8px; }
.cp-tabs { --rz-tabs-padding: 12px 0 0; }
.cpr-eyebrow { text-transform:uppercase; letter-spacing:1.3px; font-weight:700; font-size:10px; color: var(--cp-teal, #087f78); }
.cp-page-title { font-size:24px; letter-spacing:-.6px; margin:0; font-weight:700; line-height:1.2; }
.cp-page-status { font-size:12px; color: var(--cp-muted, #5d6e80); }
.cp-page-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.cp-tab-body { padding-top: 0; }
.cp-page-note { font-size:11px; color: var(--cp-muted, #5d6e80); margin-top: 18px; }
.cp-tabs .rz-tabview-nav { border-bottom: 1px solid #dae3ea; }

.cpr-btn { border:1px solid #dae3ea; border-radius:7px; background:#fff; padding:9px 13px; color:#182c43; font-weight:600; font-size:14px; cursor:pointer; line-height:1.2; }
.cpr-btn:hover { border-color:#8daec9; background:#f5f9fe; }
.cpr-btn:disabled { opacity:.5; cursor:not-allowed; }
.cpr-btn:focus-visible, .cpr-link:focus-visible, .cp-stat:focus-visible { outline:3px solid #63b6e8; outline-offset:3px; }
.cpr-primary { background:#164c9e; border-color:#164c9e; color:#fff; }
.cpr-primary:hover { background:#103e83; color:#fff; }
.cpr-quiet { background:transparent; border-color:transparent; color:#164c9e; }
.cpr-small { font-size:12px; padding:5px 9px; }
.cpr-link { background:none; border:0; padding:0; color:#164c9e; font-weight:600; cursor:pointer; text-align:left; font-size:inherit; }
.cpr-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.cpr-caption { font-size:12px; color:#5d6e80; }
.cpr-danger { color:#b83942; }
.cpr-grow { flex:1; min-width:0; }

.cpr-card { border:1px solid #dae3ea; border-radius:10px; background:#fff; padding:20px; min-width:0; box-shadow:0 2px 3px #1b3b5410; }
.cpr-card-top { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; flex-wrap:wrap; }
.cpr-h2 { font-size:18px; letter-spacing:-.3px; margin:0 0 5px; font-weight:700; }
.cpr-h3 { font-size:14px; margin:0; font-weight:700; }
.cpr-sub { font-size:12px; color:#5d6e80; margin:5px 0 14px; }
.cpr-badge { display:inline-block; background:#eef1f5; color:#4e6274; border-radius:5px; padding:3px 7px; font-size:11px; font-weight:700; white-space:nowrap; }
.cpr-badge.good { background:#e5f5ed; color:#226441; } .cpr-badge.warn { background:#fff1d6; color:#82530b; }
.cpr-badge.info { background:#eaf1fd; color:#24579d; } .cpr-badge.bad { background:#fbe9e9; color:#9a3037; }
.cpr-callout { background:#eef4fe; color:#294d7b; border-left:3px solid #7396ca; border-radius:5px; padding:12px 14px; font-size:12px; margin-bottom:18px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.cpr-callout.cpr-warning { background:#fff7e6; border-color:#d7a041; color:#765116; }
/* A stop, not a nudge: no care manager means the plan has no accountable person yet. */
.cpr-callout.cpr-danger-callout { background:#fdecec; border-color:#c93b3b; color:#7a1f1f; align-items:flex-start; }
.cpr-callout.cpr-danger-callout strong { color:#a11d1d; font-size:13px; }
.cp-stop-text { margin-top:4px; }
.cp-stop-actions { display:flex; gap:8px; flex-wrap:wrap; flex:0 0 auto; }
.cpr-empty { padding:24px; text-align:center; color:#5d6e80; border:1px dashed #dae3ea; border-radius:8px; font-size:13px; }
.cpr-separator { border-top:1px solid #dae3ea; margin:23px 0 18px; }

.cpr-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.cpr-field { display:block; min-width:0; margin-bottom:0; }
.cpr-field.cpr-full { grid-column:1/-1; }
/* Review descriptions in balanced columns (design: section-review-actions.css, review-description-grid):
   two columns, three on wide screens, one on narrow; a lone field spans; text areas grow, never clamp. */
.cpr-desc-grid { grid-template-columns:repeat(2, minmax(0,1fr)); align-items:stretch; }
.cpr-desc-grid > .cpr-field { display:flex; flex-direction:column; min-width:0; }
.cpr-desc-grid textarea { min-height:112px; flex:1; resize:vertical; }
.cpr-desc-grid:has(> .cpr-field:only-child) { grid-template-columns:1fr; }
@media (min-width:1600px) { .cpr-desc-grid { grid-template-columns:repeat(3, minmax(0,1fr)); } }
@media (max-width:900px) { .cpr-desc-grid { grid-template-columns:1fr; } }
.cpr-label-row { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px; }
.cpr-label-row > span { font-size:12px; font-weight:650; }

/* Description builder: a quiet Build button by the label, and a centred popup. */
.cpb-open { border:0; background:none; color:#164c9e; font:inherit; font-size:12px; font-weight:600; padding:2px 6px; border-radius:5px; cursor:pointer; white-space:nowrap; display:inline-flex; align-items:center; gap:5px; }
.cpb-open .cpb-open-icon { font-size:11px; width:auto; height:auto; line-height:1; color:inherit; }
.cpb-open:hover:not(:disabled), .cpb-open:focus-visible { background:#eef4fc; }
.cpb-open:disabled { color:#9aa8b6; cursor:default; }
/* The builder popup opens through the DialogService (DescriptionBuilder InDialog); its panel fills the dialog. */
.cpb-rz-dialog .rz-dialog-content { padding:0; overflow:hidden; }
.cpb-rz-dialog.rz-dialog { border-radius:12px; overflow:hidden; box-shadow:0 18px 50px rgba(24,44,67,.28); }
.cpb-panel { display:flex; flex-direction:column; max-height:min(86vh, 780px); background:#fff; color:#182c43; }
@media (max-width:700px) { .cpb-rz-dialog.rz-dialog { width:calc(100vw - 16px) !important; border-radius:10px; } .cpb-panel { max-height:calc(100vh - 16px); } }
.cpb-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; padding:18px 20px 12px; border-bottom:1px solid #dae3ea; }
.cpb-body { flex:1; overflow-y:auto; padding:14px 20px; display:grid; gap:18px; align-content:start; }
.cpb-group { display:grid; gap:8px; }
.cpb-group-top { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.cpb-chips { display:flex; flex-wrap:wrap; gap:6px; }
.cpb-chip { border:1px solid #c9d5df; background:#fff; color:#182c43; border-radius:16px; padding:6px 11px; font:inherit; font-size:13px; text-align:left; cursor:pointer; max-width:100%; }
.cpb-chip:hover, .cpb-chip:focus-visible { border-color:#164c9e; background:#f4f8fd; }
.cpb-chip.is-chart { border-style:dashed; }
.cpb-chip.is-gap { border-color:#d8a64a; color:#82530b; }
.cpb-chip.is-match { border-color:#087f78; }
/* A care plan template's paragraph: a whole-width card so the paragraph reads, named after its template. */
.cpb-chip.is-template { display:block; width:100%; border-color:#8a74d6; background:#f7f4fd; white-space:normal; line-height:1.4; }
.cpb-chip.is-template:hover, .cpb-chip.is-template:focus-visible { border-color:#5b3fc4; background:#efe9fb; }
.cpb-template-name { display:block; margin-bottom:2px; font-size:11px; font-weight:600; letter-spacing:.02em; text-transform:uppercase; color:#5b3fc4; }
.cpb-match { color:#087f78; margin-right:3px; }
.cpb-draft { border-top:1px solid #dae3ea; padding-top:14px; }
.cpb-part { display:flex; align-items:flex-start; gap:8px; background:#f6f9fb; border-radius:7px; padding:8px 10px; }
.cpb-part-text { flex:1; line-height:2; font-size:14px; }
.cpb-fill { border:0; border-bottom:2px solid #164c9e; background:#fff; font:inherit; font-size:14px; padding:0 4px; margin:0 3px; width:9em; max-width:100%; color:#182c43; }
.cpb-fill[type=number] { width:5em; }
.cpb-preview { border:1px solid #dae3ea; border-radius:7px; padding:9px 11px; }
.cpb-preview p { margin:4px 0 0; }
.cpb-warn { color:#82530b; }
.cpb-foot { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; padding:13px 20px; border-top:1px solid #dae3ea; background:#f8fafc; }
.cpr-field > span { display:block; font-size:12px; font-weight:650; margin-bottom:6px; }
.cpr-field .cpr-help { font-size:11px; color:#5d6e80; font-weight:400; margin-top:4px; }
.cpr-field input[type=text], .cpr-field select { width:100%; border:1px solid #c9d5df; border-radius:6px; background:#fff; padding:10px 11px; color:#182c43; font:inherit; }
.cpr-field input[readonly] { background:#f4f7fa; color:#5d6e80; }
.cpr-source-row { background:#f6f9fb; border-radius:7px; padding:13px; display:flex; align-items:center; gap:10px; margin:17px 0; }
.cpr-source-list { border:1px solid #dae3ea; border-radius:8px; padding:10px 14px; margin:-6px 0 17px; display:grid; gap:6px; font-size:13px; }
.cpr-source-line.is-gap { color:#82530b; }
.cpr-record { border:1px solid #dae3ea; border-radius:8px; margin-top:14px; padding:16px; }
.cpr-record-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px; margin-top:12px; align-items:stretch; }
.cpr-record-grid > .cpr-record { margin-top:0; padding:12px 14px; display:flex; flex-direction:column; min-width:0; }
.cpr-record-grid .cpr-record-head { align-items:flex-start; }
.cpr-record-grid .cpr-record-head .cpr-btn { white-space:nowrap; }
.cpr-record-grid .cpr-form-grid { grid-template-columns:1fr !important; }
@media (max-width:1300px) { .cpr-record-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
@media (max-width:760px) { .cpr-record-grid { grid-template-columns:1fr; } }
.cpr-record.is-gap { border-left:3px solid #d7a041; }
.cpr-record.is-good { border-left:3px solid #2f9a64; }
.cpr-record.is-bad { border-left:3px solid #c2434c; }
.cpr-person-link { border:0; background:none; padding:0; font:inherit; color:#164c9e; font-weight:600; text-decoration:underline; text-underline-offset:2px; cursor:pointer; }
.cpr-person-link:hover, .cpr-person-link:focus-visible { color:#0d3570; }
.cpr-unassigned { display:inline-block; padding:1px 8px; border-radius:999px; background:#fbe9e9; color:#9a3037; font-weight:700; font-size:12px; }
.ctc-dialog { display:grid; gap:14px; color:#182c43; }
.ctc-head { display:flex; align-items:center; gap:12px; }
.ctc-avatar { width:44px; height:44px; border-radius:50%; background:#eaf1fd; color:#24579d; display:flex; align-items:center; justify-content:center; font-weight:700; flex:none; }
.ctc-name { font-size:17px; font-weight:700; }
.ctc-list { display:grid; grid-template-columns:max-content 1fr; gap:6px 16px; margin:0; font-size:14px; }
.ctc-list dt { color:#5d6e80; font-weight:600; font-size:12px; align-self:center; }
.ctc-list dd { margin:0; }
.cpr-record-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; gap:10px; }
.cpr-record-title { display:flex; align-items:center; flex-wrap:wrap; gap:4px 8px; min-width:0; }
.cp-goal-activities li .cpr-badge { flex:none; }
.cpr-record-text { font-size:14px; }
.cpr-footerbar { display:flex; justify-content:space-between; gap:15px; align-items:center; border-top:1px solid #dae3ea; margin:22px -20px -20px; padding:15px 20px; background:#fbfcfe; border-radius:0 0 10px 10px; flex-wrap:wrap; }
.cpr-summary-list { display:grid; }
.cpr-summary-row { display:flex; gap:12px; align-items:center; padding:13px 0; border-bottom:1px solid #eaf0f4; }
.cpr-summary-row:last-child { border-bottom:0; }

.careplan-review-panel .cpr-layout { display:grid; grid-template-columns:235px minmax(0,1fr); gap:20px; align-items:start; }
.careplan-review-panel .cpr-nav { padding:10px; border:1px solid #dae3ea; border-radius:10px; background:#fff; box-shadow:0 2px 3px #1b3b5410; position:sticky; top:8px; display:flex; flex-direction:column; }
.careplan-review-panel .cpr-nav-item { display:flex; align-items:center; text-align:left; width:100%; gap:9px; background:transparent; border:0; border-radius:7px; padding:12px 10px; font-size:12px; font-weight:500; color:#182c43; cursor:pointer; }
.careplan-review-panel .cpr-nav-item:hover { background:#f5f9fe; }
.careplan-review-panel .cpr-nav-item.is-selected { background:#eaf1fd; color:#164c9e; font-weight:700; }
.careplan-review-panel .cpr-nav-num { border-radius:50%; width:22px; height:22px; display:grid; place-items:center; flex-shrink:0; background:#edf2f5; font-size:11px; font-weight:700; }
.careplan-review-panel .cpr-nav-item.is-selected .cpr-nav-num { background:#164c9e; color:#fff; }
.careplan-review-panel .cpr-nav-title { flex:1; }
.careplan-review-panel .cpr-nav-dot { width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.careplan-review-panel .cpr-nav-dot.is-done { background:#409474; }
.careplan-review-panel .cpr-nav-dot.is-attention { background:#d09b39; }
.careplan-review-panel .cpr-nav-dot.is-empty { background:transparent; border:1.5px solid #b7c4cf; }
.careplan-review-panel .cpr-nav-footer { border-top:1px solid #dae3ea; margin-top:8px; padding:12px 10px 4px; font-size:12px; color:#5d6e80; line-height:1.6; }
.careplan-review-panel .cpr-mobile-select { display:none; margin-bottom:12px; }
.careplan-review-panel .cpr-pane { min-width:0; display:grid; gap:18px; }

.cp-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:14px; }
.cp-stat { background:#fff; border:1px solid #dae3ea; border-radius:8px; padding:10px 14px; text-align:left; cursor:pointer; display:flex; flex-direction:column; font:inherit; color:#182c43; }
.cp-stat:hover { border-color:#8daec9; }
.cp-stat.is-danger { border-left:3px solid #b83942; }
.cp-stat strong { font-size:20px; display:block; letter-spacing:-.5px; margin:2px 0; line-height:1.2; }
.cp-stat strong.cp-stat-word { font-size:17px; }
.cp-stat-hint { color:#182c43; }
.cp-attention-list { margin:6px 0 0; padding-left:18px; }
.cp-attention-list li { margin:2px 0; }
.cp-goal-list { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:12px; align-items:stretch; }
@media (max-width:1100px) { .cp-goal-list { grid-template-columns:1fr; } }
.cp-goals-tools { display:flex; align-items:center; gap:14px; flex-wrap:wrap; justify-content:flex-end; }
.cp-goals-filter { display:inline-flex; align-items:center; gap:8px; font-size:12.5px; color:#5d6e80; cursor:pointer; }
.cp-icon-btn { width:34px; height:34px; padding:0; display:inline-flex; align-items:center; justify-content:center; }
.cp-goal-activity.cpr-person-link { text-align:left; font-weight:500; }
.cp-goal { border:1px solid #dae3ea; border-radius:9px; padding:14px 16px; display:flex; flex-direction:column; gap:6px; min-width:0; }
.cp-goal-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.cp-goal-title { font-size:15px; }
.cp-goal-progress { height:7px; border-radius:99px; background:#e3e9ef; overflow:hidden; margin-top:4px; }
.cp-goal-progress > span { display:block; height:100%; background:#087f78; border-radius:99px; }
.cp-goal-activities { list-style:none; margin:4px 0 0; padding:0; display:grid; gap:6px; }
.cp-goal-activities li { display:flex; align-items:baseline; gap:8px; font-size:13.5px; }
.cp-goal-activity { flex:1; min-width:0; }
.cp-goal-dot { width:8px; height:8px; border-radius:50%; background:#a9b7c5; flex:none; transform:translateY(-1px); }
.cp-goal-activities li.is-good .cp-goal-dot { background:#2f9a64; }
.cp-goal-activities li.is-warn .cp-goal-dot { background:#d7a041; }
.cp-goal-activities li.is-active .cp-goal-dot { background:#2f6fd1; }
.cp-goal-noactivity { margin-top:2px; }
.cp-goal-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:auto; padding-top:10px; border-top:1px solid #e9eef3; }
.cp-goals-gaps { margin-top:18px; padding-top:14px; border-top:1px solid #e3e9ef; }
.cp-goals-gaps .cpr-h3 { margin:0; }
.cp-overview-cols { display:grid; grid-template-columns:minmax(0,1.8fr) minmax(270px,1fr); gap:18px; align-items:start; }
.cp-overview-main, .cp-overview-side { display:grid; gap:18px; min-width:0; }
.cp-change { padding:10px 0; border-bottom:1px solid #eaf0f4; } .cp-change:last-child { border-bottom:0; }
.cp-change-text, .cp-copy-text { font-size:12px; margin:4px 0; }
.cp-checklist-row { display:flex; gap:10px; align-items:center; padding:6px 0; border-bottom:1px solid #eaf0f4; }
.cp-checklist-row .cpr-btn { padding:3px 8px; }
.cp-checklist-row:last-child { border-bottom:0; }
.cp-checklist-mark { width:22px; height:22px; border-radius:50%; display:grid; place-items:center; font-size:12px; flex-shrink:0; background:#fff4df; color:#95610e; }
.cp-checklist-mark.is-done { background:#eaf5ef; color:#27815b; }
.cp-checklist-mark.is-empty { background:#edf2f5; color:#5d6e80; }
.cp-checklist-text { flex:1; min-width:0; }
.cp-checklist-title { font-weight:700; font-size:12px; }
.cp-checklist-sub { font-size:11px; color:#5d6e80; line-height:1.3; }

@media (min-width:1600px) { .cp-overview-cols { grid-template-columns:minmax(0,2fr) minmax(300px,1fr); } }
@media (max-width:1100px) { .cp-overview-cols { grid-template-columns:1fr; } .cp-stats { grid-template-columns:repeat(2,1fr); } .careplan-review-panel .cpr-layout { grid-template-columns:205px minmax(0,1fr); } }
/* Section status and review actions (design SECTION_REVIEW_ACTIONS): a status badge, not a dropdown. */
.cpr-state-block { text-align:right; display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:6px 12px; max-width:72%; }
/* A section's header: title at the top left, its status, provenance and actions on one line at the right. */
.cpr-card-top:has(> .cpr-state-block) { align-items:flex-start; flex-wrap:nowrap; }
.cpr-state-block .cpr-review-buttons { max-width:none; align-items:center; }
.cpr-state-block .cpr-review-secondary { width:auto; }
.cpr-state-block .cpr-review-buttons > .cpr-primary { min-width:0; }
.cpr-state-block .cpr-badge { padding:5px 9px; }
.cpr-state-block .cpr-caption { font-size:11px; }
.cpr-review-footer { align-items:flex-start; gap:18px; }
.cpr-review-buttons { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:8px; max-width:540px; }
.cpr-review-top { margin-top:0; }
.cpr-records { margin:14px 0 16px; }
.cpr-link-dialog { display:grid; gap:12px; }
.cpr-link-list { display:grid; gap:6px; max-height:50vh; overflow:auto; }
.cpr-link-option { display:flex; align-items:flex-start; gap:10px; padding:8px 10px; border:1px solid #dae3ea; border-radius:7px; cursor:pointer; }
.cpr-link-option:hover { border-color:#8daec9; }
.cpr-callout-action { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.cpr-review-buttons > .cpr-primary { min-width:200px; }
.cpr-review-secondary { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:6px 16px; width:100%; }
.cpr-review-secondary .cpr-link { font-weight:500; font-size:13px; }
.cpr-link:disabled { color:#8ea3bd; cursor:not-allowed; }
.cpr-visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.cpr-reason-dialog { display:grid; gap:12px; }
.cpr-reason-dialog .cpr-callout { margin-bottom:0; }
.cpr-reason-dialog textarea { width:100%; border:1px solid #c9d5df; border-radius:6px; padding:8px 10px; font:inherit; resize:vertical; }
.cpr-reason-choices { display:flex; flex-wrap:wrap; gap:6px; }
.cpr-reason-actions { display:flex; justify-content:flex-end; gap:8px; }
.cpr-intervention-dialog { display:grid; gap:14px; }
.cpr-intervention-dialog .cpr-callout { margin-bottom:0; }
.cpr-intervention-dialog textarea { width:100%; border:1px solid #c9d5df; border-radius:6px; padding:8px 10px; font:inherit; resize:vertical; }
.cpr-readonly { min-height:38px; display:flex; align-items:center; padding:7px 10px; border:1px dashed #d3dde6; border-radius:6px; background:#f8fafc; color:#3d5168; font-size:13px; }
.cpr-intervention-history { border-top:1px solid #dae3ea; padding-top:12px; display:grid; gap:6px; }
.cpr-history-row { display:flex; flex-wrap:wrap; gap:4px 14px; align-items:baseline; padding:6px 0; border-bottom:1px solid #eef2f6; font-size:13px; }

@media (max-width:700px) {
  .cp-page-header { align-items:flex-start; flex-direction:column; gap:10px; } .cp-page-title { font-size:24px; }
  .cp-stats { gap:8px; } .cp-stat { padding:11px; } .cp-stat strong { font-size:20px; }
  .careplan-review-panel .cpr-layout { grid-template-columns:1fr; } .careplan-review-panel .cpr-nav { display:none; }
  .careplan-review-panel .cpr-mobile-select { display:block; }
  .cpr-form-grid, .cpr-desc-grid { grid-template-columns:1fr; } .cpr-field.cpr-full { grid-column:auto; }
  .cpr-card { padding:16px; } .cpr-footerbar { margin:20px -16px -16px; padding:13px 16px; }
  .cpr-state-block { text-align:left; justify-content:flex-start; max-width:none; }
  .cpr-card-top:has(> .cpr-state-block) { flex-wrap:wrap; }
  .cpr-review-footer { display:grid; grid-template-columns:1fr; }
  .cpr-review-buttons { justify-content:flex-start; max-width:none; width:100%; }
  .cpr-review-buttons > .cpr-primary { flex:1; min-width:0; }
  .cpr-review-secondary { justify-content:flex-start; }
}

/* ================================================================
   Consent editors (EditProgramEnrollmentConsent, EditSmsConsent)
   ================================================================
   The form in a narrow column beside a preview of the consent document; stacks on small screens. */
.consent-dialog .rz-dialog-content { padding: 12px 16px 16px; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.consent-editor { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 18px; flex: 1; min-height: 0; color: #182c43; }
.consent-editor-form { overflow: auto; min-height: 0; padding-right: 4px; }
.consent-editor-preview { min-height: 0; display: flex; }
.consent-editor-preview > .dv-root { flex: 1; min-height: 0; }
.consent-editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 12px; }
.consent-editor-actions-bottom { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid #e3e9ef; }
.consent-editor-head { padding: 12px 14px; border: 1px solid #dae3ea; border-radius: 10px; background: #f7fafc; margin-bottom: 14px; }
.consent-editor-eyebrow { text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; font-size: 10px; color: #087f78; }
.consent-editor-title { font-size: 18px; font-weight: 700; letter-spacing: -.3px; margin: 2px 0 6px; }
.consent-editor-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; color: #5d6e80; }
.consent-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.consent-badge.is-good { background: #e3f4ec; color: #17694a; }
.consent-badge.is-pending { background: #fff4dd; color: #8a5a00; }
.consent-badge.is-bad { background: #fde8ea; color: #a1323b; }
.consent-editor-fields { display: grid; gap: 4px; }
.consent-editor-block { margin-top: 10px; }
.consent-editor-label { font-size: 12px; font-weight: 650; margin-bottom: 6px; }
.consent-editor-signature { border: 1px dashed #a9bccd; border-radius: 8px; background: #fff; overflow: hidden; }
.consent-editor-hint { font-size: 12px; color: #5d6e80; margin-top: 6px; line-height: 1.4; }
.consent-editor-done { padding: 9px 12px; border-radius: 8px; background: #e3f4ec; color: #17694a; font-weight: 600; font-size: 13px; }
.consent-editor-nopreview { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px;
    border: 1px dashed #c5d3df; border-radius: 10px; color: #5d6e80; font-size: 13px; background: #f9fbfd; }
@media (max-width: 900px) {
    .consent-dialog .rz-dialog-content { overflow: auto; display: block; }
    .consent-editor { grid-template-columns: 1fr; }
    .consent-editor-form { overflow: visible; }
    .consent-editor-preview { height: 60vh; }
}

/* ---- Save / Cancel: one look app-wide (MeditalkSaveButton / MeditalkCancelButton add these classes; hand-rolled
   Save/Cancel buttons carry them too). Save is the filled primary pill, Cancel the white outlined button. ---- */
.rz-button.rc-btn-save, .rz-button.rc-btn-save.rz-variant-flat {
    background:#003399 !important; color:#fff !important; border:1px solid #003399 !important; border-radius:999px !important;
    padding-inline:20px !important; font-weight:600 !important; text-transform:none !important; letter-spacing:normal !important;
    box-shadow:0 1px 3px rgba(0,51,153,.28) !important;
}
.rz-button.rc-btn-save:not(:disabled):hover { background:#002a80 !important; border-color:#002a80 !important; box-shadow:0 2px 6px rgba(0,51,153,.32) !important; }
.rz-button.rc-btn-save .rz-button-icon-left, .rz-button.rc-btn-save .rz-button-text { color:#fff !important; }
.rc-btn-cancel, .rz-button.rc-btn-cancel, .rz-button.rc-btn-cancel.rz-variant-flat, .rz-button.rc-btn-cancel.rz-variant-outlined {
    background:#fff !important; color:#182c43 !important; border:1px solid #dae3ea !important; border-radius:7px !important;
    font-weight:600 !important; text-transform:none !important; letter-spacing:normal !important; box-shadow:none !important;
}
.rz-button.rc-btn-cancel { padding-inline:16px !important; }
.rc-btn-cancel:not(:disabled):hover { background:#f5f9fe !important; border-color:#8daec9 !important; }
.rz-button.rc-btn-cancel .rz-button-icon-left, .rz-button.rc-btn-cancel .rz-button-text { color:#182c43 !important; }
.rz-button.rc-btn-save:disabled, .rz-button.rc-btn-cancel:disabled, .rc-btn-cancel:disabled { opacity:.55; cursor:not-allowed; }

/* ---- Review records: grid / card toggle and the grid view ---- */
.cpr-records-heading { display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.cpr-view-toggle { display:inline-flex; border:1px solid #dae3ea; border-radius:7px; overflow:hidden; background:#fff; }
.cpr-view-toggle button { border:0; background:transparent; padding:5px 11px; font-size:12.5px; font-weight:600; color:#5d6e80; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
.cpr-view-toggle button + button { border-left:1px solid #dae3ea; }
.cpr-view-toggle button.is-on { background:#eaf1fd; color:#24579d; }
.cpr-view-toggle button:focus-visible { outline:3px solid #63b6e8; outline-offset:-3px; }
.cpr-table-wrap { overflow-x:auto; border:1px solid #dae3ea; border-radius:8px; background:#fff; }
.cpr-record-table { width:100%; border-collapse:collapse; font-size:13.5px; }
.cpr-record-table th { text-align:left; font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:#5d6e80; background:#f6f8fb; padding:8px 10px; border-bottom:1px solid #dae3ea; }
.cpr-record-table td { padding:8px 10px; border-bottom:1px solid #edf1f5; vertical-align:top; }
.cpr-record-table tr:last-child td { border-bottom:0; }
.cpr-record-table tr.cpr-record { display:table-row; border:0; padding:0; background:transparent; box-shadow:none; }
.cpr-record-table tr.is-good td:first-child { box-shadow:inset 3px 0 0 #2f9a64; }
.cpr-record-table tr.is-bad td:first-child { box-shadow:inset 3px 0 0 #c4424d; }
.cpr-record-table tr.is-gap td:first-child { box-shadow:inset 3px 0 0 #d7a041; }
.cpr-record-table .cpr-num { width:36px; color:#5d6e80; }
.cpr-record-table .cpr-nowrap { white-space:nowrap; }
.cpr-record-table .cpr-actions-cell { text-align:right; }

/* ---------------------------------------------------------------------------------------------
   Read-only fields. A value the user cannot change reads as a note, not a locked input: dashed
   border, pale tint, muted ink — the look of the intervention editor's Role and Contact fields
   (.cpr-readonly), applied to every RadzenFormField / MeditalkFormField whose input is read-only
   or disabled. Driven by :has(), so no page needs a class. A date picker that is merely
   non-typable (AllowInput=false, Radzen marks the input rz-readonly) still opens its calendar
   and is left alone; a disabled button in a field's End slot does not count either.
   A read-only value that is not an input (a badge, a composed line) gets the same look by putting
   class "ro-value" on the element directly inside the field's content.
   --------------------------------------------------------------------------------------------- */
:root {
    --ro-border: #d3dde6;
    --ro-bg: #f8fafc;
    --ro-ink: #3d5168;
    --ro-label: #5d6e80;
}

.rz-form-field:has(> .rz-form-field-content > .ro-value),
.rz-form-field:has(> .rz-form-field-content > input[readonly]:not(.rz-readonly)),
.rz-form-field:has(> .rz-form-field-content > textarea[readonly]),
.rz-form-field:has(> .rz-form-field-content > input:disabled),
.rz-form-field:has(> .rz-form-field-content > textarea:disabled),
.rz-form-field:has(> .rz-form-field-content > .rz-state-disabled),
.rz-form-field:has(> .rz-form-field-content > .rz-numeric > input[readonly]),
.rz-form-field:has(> .rz-form-field-content > .rz-numeric > input:disabled),
.rz-form-field:has(> .rz-form-field-content > .rz-datepicker > input[readonly]:not(.rz-readonly)),
.rz-form-field:has(> .rz-form-field-content > .rz-datepicker > input:disabled) {
    --rz-input-border: 1px dashed var(--ro-border);
    --rz-input-hover-border: 1px dashed var(--ro-border);
    --rz-input-focus-border: 1px dashed var(--ro-border);
    --rz-input-focus-shadow: none;
    --rz-input-focus-outline: none;
    --rz-input-disabled-opacity: 1;
}

.rz-form-field:has(> .rz-form-field-content > .ro-value) > .rz-form-field-content,
.rz-form-field:has(> .rz-form-field-content > input[readonly]:not(.rz-readonly)) > .rz-form-field-content,
.rz-form-field:has(> .rz-form-field-content > textarea[readonly]) > .rz-form-field-content,
.rz-form-field:has(> .rz-form-field-content > input:disabled) > .rz-form-field-content,
.rz-form-field:has(> .rz-form-field-content > textarea:disabled) > .rz-form-field-content,
.rz-form-field:has(> .rz-form-field-content > .rz-state-disabled) > .rz-form-field-content,
.rz-form-field:has(> .rz-form-field-content > .rz-numeric > input[readonly]) > .rz-form-field-content,
.rz-form-field:has(> .rz-form-field-content > .rz-numeric > input:disabled) > .rz-form-field-content,
.rz-form-field:has(> .rz-form-field-content > .rz-datepicker > input[readonly]:not(.rz-readonly)) > .rz-form-field-content,
.rz-form-field:has(> .rz-form-field-content > .rz-datepicker > input:disabled) > .rz-form-field-content {
    border: 1px dashed var(--ro-border) !important;
    border-radius: 6px;
    background-color: var(--ro-bg) !important;
    box-shadow: none !important;
}

/* The value and the label in the muted ink, at full opacity: dimmed text looks broken, not read-only. */
.rz-form-field:has(> .rz-form-field-content > input[readonly]:not(.rz-readonly)) .rz-form-field-content :is(input, textarea, .rz-inputtext, .rz-dropdown-label),
.rz-form-field:has(> .rz-form-field-content > textarea[readonly]) .rz-form-field-content :is(input, textarea, .rz-inputtext, .rz-dropdown-label),
.rz-form-field:has(> .rz-form-field-content > input:disabled) .rz-form-field-content :is(input, textarea, .rz-inputtext, .rz-dropdown-label),
.rz-form-field:has(> .rz-form-field-content > textarea:disabled) .rz-form-field-content :is(input, textarea, .rz-inputtext, .rz-dropdown-label),
.rz-form-field:has(> .rz-form-field-content > .rz-state-disabled) .rz-form-field-content :is(input, textarea, .rz-inputtext, .rz-dropdown-label),
.rz-form-field:has(> .rz-form-field-content > .rz-numeric > :is(input[readonly], input:disabled)) .rz-form-field-content :is(input, .rz-inputtext),
.rz-form-field:has(> .rz-form-field-content > .rz-datepicker > :is(input[readonly]:not(.rz-readonly), input:disabled)) .rz-form-field-content :is(input, .rz-inputtext) {
    color: var(--ro-ink) !important;
    -webkit-text-fill-color: var(--ro-ink);
    opacity: 1 !important;
    background-color: transparent !important;
    cursor: default;
}

.rz-form-field:has(> .rz-form-field-content > .ro-value) .rz-form-field-label,
.rz-form-field:has(> .rz-form-field-content > input[readonly]:not(.rz-readonly)) .rz-form-field-label,
.rz-form-field:has(> .rz-form-field-content > textarea[readonly]) .rz-form-field-label,
.rz-form-field:has(> .rz-form-field-content > :is(input, textarea):disabled) .rz-form-field-label,
.rz-form-field:has(> .rz-form-field-content > .rz-state-disabled) .rz-form-field-label,
.rz-form-field:has(> .rz-form-field-content > :is(.rz-numeric, .rz-datepicker) > :is(input[readonly]:not(.rz-readonly), input:disabled)) .rz-form-field-label {
    color: var(--ro-label) !important;
}

/* The same inputs on their own, outside a form field (the few pages that place a bare RadzenTextBox). */
input.rz-textbox[readonly]:not(.rz-form-field-content *),
textarea.rz-textarea[readonly]:not(.rz-form-field-content *),
input.rz-textbox:disabled:not(.rz-form-field-content *),
textarea.rz-textarea:disabled:not(.rz-form-field-content *),
.rz-numeric:has(> input[readonly]):not(.rz-form-field-content *),
.rz-numeric.rz-state-disabled:not(.rz-form-field-content *),
.rz-datepicker:has(> input[readonly]:not(.rz-readonly)):not(.rz-form-field-content *),
.rz-dropdown.rz-state-disabled:not(.rz-form-field-content *) {
    border: 1px dashed var(--ro-border) !important;
    border-radius: 6px;
    background-color: var(--ro-bg) !important;
    color: var(--ro-ink) !important;
    box-shadow: none !important;
    opacity: 1 !important;
}

/* The intervention dialog's grid holds MeditalkFormFields now; a .cpr-full cell still spans both columns. */
.cpr-form-grid > .cpr-full { grid-column:1/-1; min-width:0; }
.cpr-form-grid > .rz-form-field, .cpr-form-grid > .cpr-full > .rz-form-field { width:100%; }
.cpr-form-grid .rz-form-field-content .cpb-open { white-space:nowrap; }

/* Dialog title-bar close: one solid round button on every popup (and side dialog), the patient card's
   close (.pcv2-close) made solid: a light disc with a bold red Font Awesome xmark — the same glyph as the
   Cancel buttons — instead of Radzen's thin Material "close" ligature. Hover: soft red disc. Keyboard focus:
   a ring, not a fill, so the button never opens already highlighted when Radzen focuses it. The glyph span
   fills the disc as a flex box so the xmark sits dead centre whatever the icon font's metrics. */
.rz-dialog .rz-dialog-titlebar-close,
.rz-dialog .rz-dialog-side-titlebar-close {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; flex: 0 0 32px;
    border-radius: 50%;
    background: var(--rz-base-200, #e8edf3);
    color: #c02626;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease, transform .1s ease;
}
.rz-dialog .rz-dialog-titlebar-close .rzi-times,
.rz-dialog .rz-dialog-side-titlebar-close .rzi-times {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; line-height: 1; vertical-align: top;
    color: inherit; font-size: 0.9rem;
    /* MeditalkFaSolid is the solid face registered at weight 400 (see @font-face above): ask for 400 so the
       browser never synthesises a bold on top of an already-solid glyph. */
    font-family: "MeditalkFaSolid"; font-weight: 400;
    font-variation-settings: normal; font-feature-settings: normal;
}
.rz-dialog .rz-dialog-titlebar-close .rzi-times:before,
.rz-dialog .rz-dialog-side-titlebar-close .rzi-times:before { content: "\f00d"; }
.rz-dialog .rz-dialog-titlebar-close:hover,
.rz-dialog .rz-dialog-side-titlebar-close:hover { background: #fbe9e9; color: #a11d1d; }
.rz-dialog .rz-dialog-titlebar-close:hover .rzi-times,
.rz-dialog .rz-dialog-side-titlebar-close:hover .rzi-times { color: inherit; }
.rz-dialog .rz-dialog-titlebar-close:active,
.rz-dialog .rz-dialog-side-titlebar-close:active { transform: scale(.94); }
.rz-dialog .rz-dialog-titlebar-close:focus { outline: none; }
.rz-dialog .rz-dialog-titlebar-close:focus-visible,
.rz-dialog .rz-dialog-side-titlebar-close:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(26, 86, 219, .35); }

/* Care-plan dialog grids: two equal columns whatever the content's natural width (a long goal name in a
   dropdown used to widen its column and squeeze the other), fields top-aligned so a hint under one field
   does not float its neighbour. */
.cpr-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.cpr-form-grid .rz-form-field-helper, .cpr-form-grid .rz-form-field-helper .rz-text-caption { line-height: 1.3; }

/* Program tab (patient > Programs): the "?" rides the tab strip's right edge instead of a row of its own. */
.pet-tabs { position: relative; }
.pet-tabs > .pet-help { position: absolute; right: 0.25rem; top: 0.35rem; z-index: 2; }

/* Patient summary card: this month's reading-day strip on the first line, the seven-day sentence on the
   second. The strip may shrink (its halves wrap) but never below one half. */
.psc-body-row { display: flex; flex-direction: column; align-items: stretch; gap: 0.45rem; }
.psc-body-row > .rrm { flex: 0 1 auto; max-width: 100%; }
.psc-body-row > .psc-text { min-width: 0; }

/* Reading-day month grid (RpmReadingMonthGrid): label, squares and count flow on ONE line when the card is
   wide enough. The squares are two halves the markup builds (days 1-15, then 16 to the month's end): side by
   side on a wide screen, one under the other when the width runs out, so a small screen gets the 16th under
   the 1st and a 31-day month never spills a third row. Same colours as the RPM Reading Analysis squares:
   teal = reading, red outline = missed, pale = nothing, hollow = still to come. */
.rrm {
    --rrm-reading: #0f6b5c;
    --rrm-empty: #efebe6;
    --rrm-empty-text: #a8a29a;
    --rrm-missed: #fdecea;
    --rrm-missed-border: var(--rz-danger);
    --rrm-future-border: #d9d4cc;
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem;
    font-family: var(--rz-text-font-family);
}
@media (prefers-color-scheme: dark) {
    .rrm {
        --rrm-reading: #1a9982;
        --rrm-empty: #2f3134;
        --rrm-empty-text: #7d7f83;
        --rrm-missed: #3d2323;
        --rrm-future-border: #45484d;
    }
}
.rrm-head { display: flex; align-items: baseline; gap: 0.5rem; white-space: nowrap; }
.rrm-title { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #8b97ad; }
.rrm-month { font-size: 0.72rem; color: #8b97ad; }
.rrm-loading { display: flex; align-items: center; min-height: 3rem; }
.rrm-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.rrm-row { display: flex; gap: 4px; flex: 0 0 auto; }
.rrm-day {
    display: flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 6px; box-sizing: border-box;
    font-size: 0.72rem; line-height: 1; cursor: default;
}
.rrm-reading { background: var(--rrm-reading); color: #fff; font-weight: 700; }
.rrm-missed { background: var(--rrm-missed); border: 1.5px solid var(--rrm-missed-border); color: var(--rz-danger); font-weight: 600; }
.rrm-empty { background: var(--rrm-empty); color: var(--rrm-empty-text); }
.rrm-future { background: transparent; border: 1px dashed var(--rrm-future-border); color: var(--rrm-empty-text); }
.rrm-today { outline: 2px solid var(--rz-primary); outline-offset: 1px; }
.rrm-foot { display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.rrm-count { font-size: 1.35rem; font-weight: 800; line-height: 1; color: var(--rz-text-title-color, var(--rz-text-color)); }
.rrm-count-label, .rrm-note { font-size: 0.72rem; color: var(--rz-text-secondary-color); }
.rrm .rrm-arrow { color: #b8c0cf; font-size: 0.8rem !important; margin: 0 0.2rem; }
.rrm-mod { display: inline-block; min-width: 2.2rem; padding: 0.15rem 0.4rem; border-radius: 6px; font-weight: 700; font-size: 0.8rem; text-align: center; }
.rrm-mod-none { background: var(--rrm-empty); color: var(--rrm-empty-text); }
.rrm-mod-u2 { background: #d5ece7; color: #0f5247; }
.rrm-mod-u3 { background: #a7d8cd; color: #0b4a40; }
.rrm-mod-u4 { background: #6dbfae; color: #06332c; }
.rrm-mod-u7 { background: #2f9c86; color: #fff; }
.rrm-mod-u8 { background: #0f6b5c; color: #fff; }
.rrm-mod-u9 { background: #07443a; color: #fff; }
.rrm-error { font-size: 0.78rem; color: #b45309; }
/* Phone: smaller squares so a 15-day half (the strip's narrowest shape) still fits a 360px viewport. */
@media (max-width: 480px) {
    .rrm-grid, .rrm-row { gap: 3px; }
    .rrm-day { width: 20px; height: 20px; border-radius: 5px; font-size: 0.62rem; }
}

/* SmartMeter environment badge on the device order (SmartMeterEnvironmentBadge): sits where an input would. */
.sme-badge { display: flex; align-items: center; gap: 0.4rem; min-height: 38px; padding: 0 0.75rem; flex-wrap: wrap; color: var(--ro-ink); }
.sme-host { font-size: 0.72rem; color: var(--rz-text-secondary-color); }

/* ---------------------------------------------------------------------------------------------
   Device order lines (DeviceOrderLinesEditor): a catalog of tiles to click, then a cart of lines
   with a stepper, a note and a remove button. Read-only orders show the cart alone.
   --------------------------------------------------------------------------------------------- */
.dol { display: flex; flex-direction: column; gap: 0.9rem; }
.dol-catalog-head { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.dol-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rz-text-secondary-color); }
.dol-hint { font-size: 0.78rem; color: var(--rz-text-secondary-color); }
.dol-empty { margin: 0; padding: 0.9rem 1rem; border: 1px dashed var(--ro-border, #d3dde6); border-radius: 8px; color: var(--ro-label, #5d6e80); font-size: 0.85rem; text-align: center; }
.dol-loading { display: flex; justify-content: center; padding: 0.75rem; }

.dol-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.6rem; }
.dol-tile {
    position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem;
    padding: 0.7rem 0.8rem 0.6rem; min-height: 96px; text-align: left; cursor: pointer;
    background: var(--rz-base-background-color, #fff); color: var(--rz-text-color);
    border: 1px solid var(--rz-border-color, #dfe5f0); border-radius: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease; font: inherit;
}
.dol-tile:hover { border-color: var(--rz-primary); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08); transform: translateY(-1px); }
.dol-tile:focus-visible { outline: 2px solid var(--rz-primary); outline-offset: 2px; }
.dol-tile.is-added { border-color: var(--rz-primary); background: color-mix(in srgb, var(--rz-primary) 6%, var(--rz-base-background-color, #fff)); }
.dol-tile-img { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; }
.dol-tile .dol-tile-icon { font-size: 1.3rem !important; color: var(--rz-primary); }
.dol-tile-name { font-size: 0.85rem; font-weight: 600; line-height: 1.25; }
.dol-tile-sku { font-size: 0.7rem; color: var(--rz-text-secondary-color); font-family: var(--rz-text-font-family); letter-spacing: 0.02em; }
.dol-tile-add { margin-top: auto; display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; font-weight: 600; color: var(--rz-primary); }
.dol-tile-add .fa { font-size: 0.7rem !important; }
.dol-tile-count {
    position: absolute; top: 8px; right: 8px; min-width: 1.5rem; height: 1.5rem; padding: 0 0.4rem;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--rz-primary); color: #fff; border-radius: 999px; font-size: 0.75rem; font-weight: 700;
}

.dol-cart { display: flex; flex-direction: column; gap: 0.45rem; }
.dol-line {
    display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
    padding: 0.55rem 0.75rem; border: 1px solid var(--rz-border-color, #dfe5f0); border-radius: 10px;
    background: var(--rz-base-background-color, #fff);
}
.dol-line-main { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; }
.dol-line-name { font-size: 0.88rem; font-weight: 600; }
.dol-line-sku, .dol-line-note { font-size: 0.72rem; color: var(--rz-text-secondary-color); }
.dol-line-qty { font-size: 0.95rem; font-weight: 700; }

.dol-stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--rz-border-color, #dfe5f0); border-radius: 8px; overflow: hidden; flex: 0 0 auto; }
.dol-step {
    width: 2rem; border: none; background: var(--rz-base-200, #f1f4f8); color: var(--rz-text-color);
    font-size: 1.05rem; font-weight: 600; cursor: pointer; line-height: 1;
}
.dol-step:hover:not(:disabled) { background: var(--rz-primary-lighter, #e3edfb); color: var(--rz-primary); }
.dol-step:disabled { opacity: 0.4; cursor: default; }
.dol-stepper .dol-qty { width: 3.4rem; }
.dol-stepper .dol-qty .rz-inputtext,
.dol-stepper .dol-qty input { text-align: center; border: none !important; border-radius: 0 !important; box-shadow: none !important; }
.dol-line .dol-note { flex: 1 1 200px; min-width: 0; }
.dol-remove {
    width: 2rem; height: 2rem; border: none; border-radius: 8px; background: transparent;
    color: var(--rz-text-secondary-color); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.dol-remove:hover { background: color-mix(in srgb, var(--rz-danger) 10%, transparent); color: var(--rz-danger); }
.dol-remove .fa { font-size: 0.9rem !important; }
.dol-summary { align-self: flex-end; font-size: 0.78rem; color: var(--rz-text-secondary-color); padding-right: 0.25rem; }

/* Care Plan Phrases: the section tabs are a selector over one grid (no tab panels), and the
   group-by bar sits in the title row. Group rows show the caption and a count pill. */
.cpp-tabs .rz-tabview-panels { display: none; }
/* Grouping is driven by the Group by bar only: no drag-a-header-here panel. */
.cpp-grid .rz-group-header { display: none; }
.cpp-tabs .rz-tabview-nav { flex-wrap: wrap; }
.cpp-groupby-label { font-size: .8rem; font-weight: 600; color: var(--rz-text-secondary-color, #5f6b7a); white-space: nowrap; }
.cpp-group-title { font-weight: 600; }
.cpp-group-count { display: inline-block; min-width: 1.5rem; margin-left: .5rem; padding: 0 .45rem;
    border-radius: 999px; background: var(--rz-base-200, #e8edf3); color: var(--rz-text-secondary-color, #5f6b7a);
    font-size: .75rem; font-weight: 600; line-height: 1.4; text-align: center; }

/* Care plan template: the review-text editor (one slot per card). */
.cptr-slot { border:1px solid var(--rz-base-300, #d5dde6); border-radius:8px; padding:.6rem .8rem; background:#fff; }
.cptr-slot-title { font-weight:600; font-size:.9rem; margin-bottom:.35rem; color:#182c43; }
.cptr-error { margin-top:.25rem; font-size:.8rem; color:#a11d1d; }

/* Tooltips are read, not used: none of ours holds a link or a button. Letting the pointer pass through
   them means a tooltip opened above a grid's action button can never block the button in the row above
   (Radzen 12 keeps a hovered tooltip open, so a pointer moving up a column used to get stuck in it). */
.rz-tooltip, .rz-tooltip .rz-tooltip-content { pointer-events: none; }
/* ...but Radzen 12 opens context menus (the grid rows' ⋯ "More actions") in the same rz-tooltip popup
   host, so the rule above made the menu click-through: the rows under it got the hover and the click. */
.rz-tooltip:has(.rz-context-menu), .rz-context-menu { pointer-events: auto; }

/* A patient's name with a status badge beside it, on one line, in any grid. */
.patient-cell { display: flex; align-items: center; gap: 0.3rem; min-width: 0; }
.patient-cell > span:first-child { min-width: 0; }

/* Row action buttons are one size in every grid. Pages ask for Small, Medium or ExtraSmall buttons,
   and the fa-small helper shrinks some again, so Open, Delete, View and the rest came out at three
   heights in one row. Inside a data row every button is the same height, icon-only ones the same
   width, and every icon the same size, whatever the page requested. */
.rz-data-row .rz-button {
    height: 1.9rem;
    min-height: 1.9rem;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 1;
    box-sizing: border-box;
    vertical-align: middle;
}

.rz-data-row .rz-button.rz-button-icon-only {
    width: 1.9rem;
    min-width: 1.9rem;
    padding-left: 0;
    padding-right: 0;
}

.rz-data-row .rz-button .rz-button-icon-left,
.rz-data-row .rz-button .rz-button-icon-right,
.rz-data-row .rz-button > .rzi {
    font-size: 1rem;
    line-height: 1;
    margin: 0;
}

.rz-data-row .rz-button:not(.rz-button-icon-only) .rz-button-icon-left { margin-inline-end: 0.35rem; }
.rz-data-row .rz-button .rz-button-text { font-size: 0.8rem; line-height: 1; }

/* Row "More actions" menus (RowActionsMenu) and every other context menu: the theme's hover
   tint is near-white, so the item under the mouse did not look hovered. */
.rz-context-menu .rz-menu:not(.rz-profile-menu) .rz-navigation-item-wrapper:hover {
    background-color: var(--rz-primary-lighter);
}
.rz-context-menu .rz-menu:not(.rz-profile-menu) .rz-navigation-item-wrapper:hover .rz-navigation-item-link {
    color: var(--rz-primary-darker);
}
.rz-context-menu .rz-navigation-item-link { cursor: pointer; }

/* Month/year picker (RadzenDatePicker ShowDays="false"). The local material3-base.css predates
   Radzen 12's month grid, so these cells rendered as bare buttons. Rules copied from Radzen 12.1.8. */
.rz-calendar-month-title.rz-calendar-title-button{display:flex}
.rz-calendar-title-button{display:inline-flex;align-items:center;justify-content:center;border:none;background-color:rgba(0,0,0,0);color:var(--rz-datepicker-header-color);font-size:var(--rz-datepicker-calendar-font-size);line-height:2.25rem;padding-block:0;padding-inline:.75rem;border-radius:var(--rz-border-radius);cursor:pointer;transition:var(--rz-datepicker-calendar-transition)}
.rz-calendar-title-button:hover:not(:disabled){color:var(--rz-datepicker-calendar-hover-color);background-color:var(--rz-datepicker-calendar-hover-background-color)}
.rz-calendar-title-button:focus-visible{outline:var(--rz-datepicker-focus-outline)}
.rz-calendar-title-button:disabled{cursor:default}
.rz-calendar-title-button.rz-calendar-title-static{cursor:default}
.rz-calendar-title-button.rz-calendar-title-static:hover:not(:disabled){color:var(--rz-datepicker-header-color);background-color:rgba(0,0,0,0)}
.rz-calendar-title-button .rz-calendar-title-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rz-calendar-title-button .rz-calendar-title-icon{font-size:1.125rem;line-height:1;vertical-align:middle;margin-inline-start:.125rem;margin-inline-end:-0.25rem}
.rz-calendar-months,.rz-calendar-years{display:grid;grid-template-columns:repeat(3, 1fr);grid-auto-rows:1fr;gap:.25rem;padding:.5rem;min-height:16rem;max-width:26rem;margin-inline:auto}
.rz-calendar-month-cell,.rz-calendar-year-cell{border:none;background-color:rgba(0,0,0,0);color:var(--rz-datepicker-calendar-color);font-size:var(--rz-datepicker-calendar-font-size);padding:var(--rz-datepicker-calendar-item-padding);padding-inline:.25rem;border-radius:var(--rz-border-radius);cursor:pointer;transition:var(--rz-datepicker-calendar-transition);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rz-calendar-month-cell:hover:not(:disabled),.rz-calendar-year-cell:hover:not(:disabled){color:var(--rz-datepicker-calendar-hover-color);background-color:var(--rz-datepicker-calendar-hover-background-color)}
.rz-calendar-month-cell.rz-state-active,.rz-calendar-year-cell.rz-state-active{color:var(--rz-datepicker-calendar-selected-color);background-color:var(--rz-datepicker-calendar-selected-background-color)}
.rz-calendar-month-cell.rz-state-active:hover:not(:disabled),.rz-calendar-year-cell.rz-state-active:hover:not(:disabled){color:var(--rz-datepicker-calendar-selected-hover-color);background-color:var(--rz-datepicker-calendar-selected-hover-background-color)}
.rz-calendar-month-cell:disabled,.rz-calendar-year-cell:disabled{opacity:.5;cursor:default}
.rz-calendar-month-cell:focus-visible,.rz-calendar-year-cell:focus-visible{outline:var(--rz-datepicker-focus-outline);outline-offset:calc(-1*var(--rz-outline-width))}

/* Status badges in grid cells (Patients, Authorizations, program summaries, RTM analysis): small enough that
   "Discharged" or "Provider to Review" fits a normal column; a longer one ends in an ellipsis. */
.rz-badge.grid-status-badge { font-size: 0.75rem !important; font-weight: 600; line-height: 1.35; padding: 2px 8px !important;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }

/* Buttons: no red. ButtonStyle.Secondary buttons (and split buttons using it) take the primary blue, filled, outlined
   and text alike. The secondary colour itself stays for the menu highlights and badges that use it; Danger stays red. */
.rz-button.rz-secondary,
.rz-splitbutton.rz-secondary,
.rz-splitbutton.rz-secondary .rz-button {
    --rz-secondary: var(--rz-primary);
    --rz-secondary-light: var(--rz-primary-light);
    --rz-secondary-lighter: var(--rz-primary-lighter);
    --rz-secondary-dark: var(--rz-primary-dark);
    --rz-secondary-darker: var(--rz-primary-darker);
    --rz-on-secondary: var(--rz-on-primary);
    --rz-on-secondary-light: var(--rz-on-primary-light);
    --rz-on-secondary-lighter: var(--rz-primary);
    --rz-on-secondary-dark: var(--rz-on-primary-dark);
    --rz-on-secondary-darker: var(--rz-on-primary-darker);
}
