﻿
/* Global Component Overrides */
.rz-sidebar-toggle.sidebarToggleBtn {
    background-color: var(--rz-sidebar-background-color) !important;
    color: var(--rz-sidebar-color) !important;
    border-inline-end: none !important;
}

.rz-dialog-mask {
    z-index: 999 !important;
}

.rz-dialog {
    z-index: 1001 !important;
}

.rz-dialog-side {
    z-index: 1000 !important;
}

.rz-splitbutton-menubutton {
    min-width: 2rem !important;
    padding: 0.625rem 0 !important;
}

.rz-header {
    padding: .5rem !important;
}

/*Dark Mode::Prevent the white background from being applied after selecting a suggestion.*/ 
.rz-textbox:-webkit-autofill,
.rz-textbox:-webkit-autofill:hover,
.rz-textbox:-webkit-autofill:focus,
.rz-textbox:-webkit-autofill:active,
.rz-textbox:autofill {
    -webkit-text-fill-color: var(--rz-text-color) !important;
    caret-color: var(--rz-text-color) !important;
    transition: background-color 5000s ease-in-out 0s !important;
    -webkit-transition: background-color 5000s ease-in-out 0s !important;
}

/* Material3 Theme Overrides - Light & Dark Mode */
.rz-material3,
.rz-material3-dark {
    /*--rz-link-color: #37A0D2;*/
    --rz-dialog-title-font-weight: 600;
    --rz-dialog-border-radius: 5px;
    --rz-dialog-title-padding-block: 0.75rem 0.5rem;
    --rz-fieldset-legend-margin-block: 0 0.5rem;
    --rz-button-border-radius: 5px;
    --rz-primary: #37A0D2;
    --rz-primary-dark: #1d7199;
    --rz-success: #16a34a;
    --rz-success-dark: #127336;
    --rz-success-light: #20dd66;
    --rz-dialog-title-font-size: 16px;
    --rz-grid-border-radius: 6px;
    --rz-upload-button-bar-border-radius: 6px;
    --rz-switch-checked-background-color: var(--rz-primary) !important;
    --rz-radio-circle-background-color: var(--rz-primary);
    --rz-dialog-background-color: var(--rz-layout-body-background-color);
    --rz-checkbox-checked-background-color: var(--rz-primary);
    --rz-slider-range-background-color: var(--rz-primary);
    --rz-slider-handle-hover-background-color: var(--rz-primary);
    /* Text-only Radzen tokens: the placeholder pair still needs the ink step because
       --rz-text-tertiary-color is 4.2:1. Borrow and Profile each re-declared exactly this
       pair on their container; it now lives here once. */
    --rz-input-placeholder-color: var(--tertiary-ink);
    --rz-input-disabled-color: var(--tertiary-ink);
    /* Same step, for everything else that reads it as text: the event tabs (.custom-tab, 4.25:1),
       the fieldset legends (4.43:1), the RoomBooking card greys (.grey-text) and the scheduler slot
       titles (#838282, 3.83:1) all resolve to --rz-text-tertiary-color, which fails AA in both
       skins. --tertiary-ink is the AA step this file already uses for placeholders. Radzen
       re-publishes the grey through component tokens at :root, so those consumers are re-declared
       here too - see the substitution note below. */
    --rz-text-tertiary-color: var(--tertiary-ink);
    --rz-scheduler-color: var(--tertiary-ink);
    --rz-scheduler-weekend-color: var(--tertiary-ink);
    --rz-pager-summary-color: var(--tertiary-ink);
    --rz-grid-filter-color: var(--tertiary-ink);
    --rz-fieldset-toggle-color: var(--tertiary-ink);
    --rz-steps-color: var(--tertiary-ink);
    --rz-datepicker-calendar-header-color: var(--tertiary-ink);
    --rz-link-color: var(--rz-primary);

    /* A custom property is substituted where it is DECLARED, not where it is used, so every
       Radzen token that :root writes as var(--rz-primary) keeps the SHIPPED accent
       (#3481e5 light, #94c1ff dark) no matter what this file sets on <body>: only rules that
       read --rz-primary directly follow us. That split is the "some borders, tabs and focus
       rings are a different blue" drift, and it is why the tab strip failed contrast on /MyBio
       after the accent was darkened. Re-declaring each chained token here moves the
       substitution onto <body>, so the whole theme resolves through the one accent in both
       skins. Verified in-browser: :root{--p:#37A0D2;--chain:var(--p)} body{--p:#1d7199} gives
       color:var(--chain) = rgb(55,160,210) but color:var(--p) = rgb(29,113,153).
       Tokens that chain through -light/-darker are left alone: they pair with their own
       --rz-on-primary-* label, so changing one half would break the other. */
    --rz-tabs-tab-selected-color: var(--rz-primary);
    --rz-tabs-tab-hover-color: var(--rz-primary);
    --rz-tabs-tab-focus-color: var(--rz-primary);
    --rz-outline-color: var(--rz-primary);
    --rz-border-focus: var(--rz-border-width) solid var(--rz-primary);
    --rz-border-primary: var(--rz-border-width) solid var(--rz-primary);
    --rz-outline-primary: var(--rz-outline-width) solid var(--rz-primary);
    --rz-input-focus-shadow: inset 0 0 0 1px var(--rz-primary);
    --rz-dropdown-open-border: 2px solid var(--rz-primary);
    --rz-form-field-label-focus-color: var(--rz-primary);
    --rz-button-base-background-color: var(--rz-primary);
    --rz-menu-item-selected-color: var(--rz-primary);
    --rz-menu-top-item-selected-color: var(--rz-primary);
    --rz-rating-selected-color: var(--rz-primary);
    --rz-progressbar-value-background-color: var(--rz-primary);
    --rz-datepicker-calendar-today-color: var(--rz-primary);
    --rz-datepicker-calendar-selected-background-color: var(--rz-primary);
    --rz-checkbox-checked-hover-background-color: var(--rz-primary);
    --rz-slider-handle-background-color: var(--rz-primary);
    --rz-splitbutton-background-color: var(--rz-primary);
    --rz-splitter-bar-background-color-active: var(--rz-primary);
    --rz-scheduler-event-background-color: var(--rz-primary);
    --rz-upload-button-background-color: var(--rz-primary);
    --rz-grid-apply-filter-button-color: var(--rz-primary);
    --rz-grid-header-filter-icon-active-color: var(--rz-primary);
    --rz-form-error-color: var(--rz-danger);
    --rz-validator-background-color: var(--rz-danger);
    --rz-notification-success-background-color: var(--rz-success);
    --rz-notification-error-background-color: var(--rz-danger);

    --rz-text-overline-font-size: 0.75rem;

    .rz-radiobutton-box.rz-state-active {
        border-color: var(--rz-primary) !important;
    }
}

/* Software Theme Overrides - Light & Dark Mode */
.rz-software,
.rz-software-dark {
--rz-header-min-height: 4.5rem;
}

/* The light theme's accent is used as a fill, as a label, as a link, as tab text and as every
   input/dropdown border and focus ring — all from the one token. At #37A0D2 it could not do any
   of those at AA: 2.95:1 under a white label, 2.72:1 as text on a light card, and 2.72:1 as a UI
   boundary (WCAG 1.4.11 wants 3:1). Darkening the token instead of the individual labels is what
   keeps a control's two halves together: an outlined button reads BOTH its border and its label
   from --rz-primary, so any rule that recoloured only the label left dark-teal text on a
   bright-blue border, and any rule that forced only a background left the scheduler navbar's own
   light surface dark under dark text. #1d7199 is the same hue at a deeper step, so the design is
   unchanged and every role passes: 5.42:1 white on the fill, 5.42:1 as text on white, 5.14:1 on
   a light card. Hover/active steps take --rz-primary-dark.
   Light theme only, and this block must stay AFTER the shared block above to win on document
   order. rz-material3-dark keeps #37A0D2, where it already passes both ways: dark navy on the
   fill is 5.26:1 and the fill as text on the dark surface is 5.80:1. --rz-primary-light,
   -lighter and -darker stay on Radzen's own scale, which pairs them with --rz-on-primary-light /
   -darker rather than with --rz-primary, so they are unaffected either way. */
.rz-material3 {
    --rz-primary: #1d7199;
    --rz-primary-dark: #155d7f;
    /* Same reasoning, same tokens: white on the old --rz-success (#16a34a) was 3.30:1 and white
       on the old --rz-danger (#d35153) 4.14:1. Both new steps clear 4.5:1. */
    --rz-success: #15803d;
    --rz-danger: #b3261e;
    /* Light only: --rz-primary-dark is #155d7f here (7.23:1 as text) but #1d7199 on the shared
       block, and 2.86:1 as text on the dark surface, so this one stays out of the shared list. */
    --rz-link-hover-color: var(--rz-primary-dark);
}

/* An outlined ButtonStyle.Light button takes BOTH its border and its label from --rz-base-200, and
   in the light theme that token is a surface grey (#e3eaf2) — 1.14:1 on a white card, so the label
   is effectively invisible (WAVE "Very low contrast" on the OnlineResources Hold segment, and on
   every other unselected outlined Light button). Dark keeps #8f9399 at 5.35:1, so this stays
   light-only, and only the label needs the step: the outline is decorative here, so it keeps its
   own weight. :not(.rz-state-disabled) keeps Radzen's own disabled ink, which this rule would
   otherwise outrank on specificity. */
.rz-material3 .rz-button.rz-variant-outlined.rz-light.rz-shade-default:not(.rz-state-disabled) {
    color: var(--rz-text-secondary-color);
}

/* The header language toggle is a .rz-toggle-button, which the theme does not skin through
   --rz-primary, so its active fill is set explicitly. */
.rz-material3 .translate-btn.rz-toggle-button.rz-state-active {
    background-color: var(--rz-primary-dark) !important;
}

/* Widgets, cards and page-level rules need a name for "this accent, as text or as a glyph".
   In the light theme that is now simply the theme accent itself, which is why these point at the
   tokens instead of repeating hex — the two cannot drift apart again. Only --tertiary-ink and
   --warning-ink are hand-picked, because they replace --rz-text-tertiary-color (4.2:1) and a
   warning step the theme does not ship at AA. In the dark theme the accent still has to be
   lightened for text use, so those values stay hand-picked there. */
.rz-material3 {
    --primary-ink: var(--rz-primary);
    --primary-ink-strong: var(--rz-primary-dark);
    --danger-ink: var(--rz-danger);
    --success-ink: var(--rz-success);
    --warning-ink: #b45309;
    --tertiary-ink: #5f6368;
}

.rz-material3-dark {
    --primary-ink: #7fcdf0;
    --primary-ink-strong: #a5dcf7;
    --danger-ink: #f0b7b4;
    --success-ink: #4ade80;
    --warning-ink: #fbbf24;
    --tertiary-ink: #b7bcc4;
}

/* Outlined and text buttons take BOTH their border and their label from the same accent token,
   so since the light theme's --rz-primary is itself an AA step those buttons need no rule here.
   The dark theme still does, for danger only: Radzen ships --rz-danger as #b3261e there, which is
   6.54:1 under a white label (filled buttons are fine) but only 2.61:1 when it is used AS the
   label. Text and outlined variants are the ones that do that, so they get the ink step and the
   fill keeps the theme's own value. */
.rz-material3-dark .rz-button.rz-variant-outlined.rz-danger.rz-shade-default,
.rz-material3-dark .rz-button.rz-variant-text.rz-danger.rz-shade-default {
    color: var(--danger-ink);
}
