/* ============================================================================
   QUARTZ THEME — structure & treatments (rides on quartz-tokens.css)
   ----------------------------------------------------------------------------
   Scope: everything is keyed off body.kv (+ kv-has-side when the rail shows).
   The kv-* class names are shared machinery (views, tests, page CSS) — keep
   selectors intact when retuning treatments.

   §1  base                       §9  reports
   §2  side rail                  §10 dashboard
   §3  rail flyouts (mega menus)  §11 misc widgets (badges, pills)
   §4  user card + quick links    §12 legacy chrome class overrides
   §5  content offset / chrome    §13 inline-style neutralizers
   §6  buttons & links            §14 focus / motion / print
   §7  home cards                 §15 UserAdmin
   §8  login
   ============================================================================ */

/* ===================== §1 base ===================== */

body.kv {
    background: var(--kv-bg);
    background-image: none;                 /* legacy product-background.jpg */
    color: var(--kv-ink);
    font-family: var(--kv-font-ui) !important; /* legacy body rule is Arial !important */
    font-size: 14px;
    position: relative;
    min-height: 100vh;
}

/* Quartz ambience: soft indigo radials on the cool ground (mockup .quartz::before) */
body.kv::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 1200px 600px at 90% 0%, rgba(var(--kv-primary-rgb), .05) 0%, transparent 60%),
        radial-gradient(ellipse 1000px 800px at -10% 100%, rgba(var(--kv-primary-rgb), .04) 0%, transparent 55%);
}

body.kv h1, body.kv h2, body.kv h3, body.kv h4, body.kv h5, body.kv h6 {
    font-family: var(--kv-font-display);
    color: var(--kv-ink);
    letter-spacing: -.015em;
    text-decoration: none;     /* legacy generic.css underlines h2 */
    text-transform: none;      /* …and uppercases h4 */
}

body.kv label {
    font-family: var(--kv-font-ui) !important;
    color: var(--kv-ink-soft);
}

/* ===================== §2 side rail ===================== */

body.kv .kv-side {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--kv-side-w);
    background: var(--kv-card);
    border-right: 1px solid var(--kv-border);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem 1rem !important;  /* qz-side; !important: legacy JS pads it for the notification bar */
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--kv-border-strong) transparent;
}

/* brand row (qz-brand-row): home link + version + collapse chevron */
body.kv .kv-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .5rem 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--kv-border);
    text-decoration: none !important;
    order: 1;
    font-size: 1rem;
}

body.kv .kv-brand-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
    text-decoration: none !important;
    color: var(--kv-ink) !important;
    cursor: default;     /* display-only; the chevron button collapses the rail */
}

body.kv .kv-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;   /* float to the right edge so it doesn't crowd the wordmark */
    width: 28px;
    height: 28px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--kv-faint);
    cursor: pointer;
    flex-shrink: 0;
}

body.kv .kv-collapse-btn svg {
    width: 16px;
    height: 16px;
}

body.kv .kv-collapse-btn:hover {
    background: var(--kv-bg);
    color: var(--kv-primary);
}

body.kv .kv-brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--kv-grad-brand);
    color: var(--kv-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px -2px rgba(var(--kv-primary-rgb), .4);
}

body.kv .kv-brand-word {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--kv-ink);
    letter-spacing: -.01em;
    line-height: 1.05;
    white-space: nowrap;
}

body.kv .kv-brand-word sup {
    font-size: .55em;
    color: var(--kv-primary);
}

/* sub-brand line under the wordmark */
body.kv .kv-brand-evo {
    font-family: var(--kv-font-mono);
    font-size: .6rem;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: lowercase;
    color: var(--kv-primary);
    margin-top: 2px;
}

/* mono version after the wordmark (qz-brand-row .ver) */
body.kv .kv-brand-ver {
    margin-left: auto;
    font-family: var(--kv-font-mono);
    font-size: .65rem;
    color: var(--kv-faint);
    font-weight: 400;
    white-space: nowrap;
}

/* section labels (mono micro-caps, mockup .qz-side-lbl) */
body.kv .kv-side-lbl {
    font-family: var(--kv-font-mono);
    font-size: .65rem;
    letter-spacing: .1em;
    color: var(--kv-muted);
    text-transform: uppercase;
    padding: 0 .625rem;
    margin: 1rem 0 .5rem;
    font-weight: 500;
}

/* legacy banner pieces have no place in the rail */
body.kv .ltm-ProductNameContainerAdj,
body.kv .ltm-FullWidthLine,
body.kv .ltm-LogoContainerAdj,
body.kv #megaMenuChoiceDummy {
    display: none !important;
}

/* --- collapse / expand ---
   Desktop (>=1101px): collapsing shrinks the rail to an icon-only MINI RAIL — it
   stays visible, just narrower (see the min-width block below). Narrow (<=1100px):
   the rail is an off-canvas drawer (see that block). The old "slide the rail
   off-screen on desktop collapse" behavior is gone. */
body.kv .kv-side {
    transition: width .18s ease, left .2s ease;
}

body.kv .kv-side-expand {
    display: none;
    position: fixed;
    top: .75rem;
    left: .75rem;
    z-index: 1050;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    background: var(--kv-card);
    border: 1px solid var(--kv-border);
    border-radius: var(--kv-r-ctl);
    color: var(--kv-ink);
    cursor: pointer;
    box-shadow: var(--kv-shadow-card);
}

body.kv .kv-side-expand:hover {
    border-color: var(--kv-primary);
    color: var(--kv-primary);
}

body.kv.kv-side-collapsed .kv-side-expand {
    /* !important: Bootstrap ships [hidden] { display: none !important } and
       the button carries the hidden attribute for theme-off rollback */
    display: flex !important;
}

body.kv.kv-side-collapsed.kv-has-side > .container,
body.kv.kv-side-collapsed.kv-has-side > #ReadOnlyContent,
body.kv.kv-side-collapsed.kv-has-side > #notificationDiv,
body.kv.kv-side-collapsed.kv-has-side .footer,
body.kv.kv-side-collapsed.kv-has-side #infobarDiv {
    margin-left: 0 !important;
    left: 0 !important;
}

/* ===== desktop: collapsed rail becomes an icon-only MINI RAIL =====
   Everything the rail needs already carries an icon, so collapse just hides the
   text and shrinks the rail. Redefining --kv-side-w cascades to the content
   offset (margin-left) and the mega-menu flyout (left: calc(var(--kv-side-w) + 10px)),
   so both follow the narrower rail automatically. Scoped to desktop so the
   <=1100px off-canvas drawer below is untouched. */
@media (min-width: 1101px) {
    body.kv.kv-side-collapsed.kv-has-side {
        --kv-side-w: 64px;   /* mini rail: icon-only (the "L" mark is hidden when collapsed) */
    }

    /* hide text; keep icons, the "L" mark, the collapse chevron, and the avatar.
       Every rule here is scoped to .kv-has-side so the collapsed state (which the
       pre-paint script restores from localStorage on EVERY kv page) can't restyle
       the login/logout top rail, which has no side menu. */
    body.kv.kv-side-collapsed.kv-has-side .kv-brand-link,
    body.kv.kv-side-collapsed.kv-has-side .kv-brand-word,
    body.kv.kv-side-collapsed.kv-has-side .kv-brand-ver,
    body.kv.kv-side-collapsed.kv-has-side .kv-side-lbl,
    body.kv.kv-side-collapsed.kv-has-side a.kv-quick-link > span,
    body.kv.kv-side-collapsed.kv-has-side a.ltm-MegaNavbarHref > span,
    body.kv.kv-side-collapsed.kv-has-side .kv-menu-caret,
    body.kv.kv-side-collapsed.kv-has-side .kv-user-meta,
    body.kv.kv-side-collapsed.kv-has-side .kv-user-dot,
    body.kv.kv-side-collapsed.kv-has-side .kv-user-card .caret {
        display: none !important;
    }

    /* center the remaining icons in the narrow rail */
    body.kv.kv-side-collapsed.kv-has-side a.kv-quick-link,
    body.kv.kv-side-collapsed.kv-has-side a.ltm-MegaNavbarHref,
    body.kv.kv-side-collapsed.kv-has-side .kv-user-card .ltm-UserMenuDropDown {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    /* the "L" mark is hidden when collapsed (above), so the brand row holds just the
       collapse chevron — center it (its margin-left:auto is a full-rail push to the
       right edge, reset here) */
    body.kv.kv-side-collapsed.kv-has-side .kv-brand {
        justify-content: center;
        padding-left: .35rem;
        padding-right: .35rem;
    }
    body.kv.kv-side-collapsed.kv-has-side .kv-collapse-btn {
        margin-left: 0;
    }

    /* content/footer offsets follow the mini width instead of the collapse-to-0
       rule above (this block is later + desktop-only, so it wins here) */
    body.kv.kv-side-collapsed.kv-has-side > .container,
    body.kv.kv-side-collapsed.kv-has-side > #ReadOnlyContent,
    body.kv.kv-side-collapsed.kv-has-side > #notificationDiv {
        margin-left: var(--kv-side-w) !important;
    }
    body.kv.kv-side-collapsed.kv-has-side .footer,
    body.kv.kv-side-collapsed.kv-has-side #infobarDiv {
        left: var(--kv-side-w) !important;
    }

    /* breadcrumb bar tracks the mini rail (the old collapse rule zeroed it and padded
       4rem for the now-hidden floating expand control) */
    body.kv.kv-side-collapsed.kv-has-side .kv-top {
        margin-left: var(--kv-side-w);
        padding-left: 2.25rem;
    }

    /* no floating hamburger on desktop — the in-rail chevron toggles collapse/expand */
    body.kv.kv-side-collapsed.kv-has-side .kv-side-expand {
        display: none !important;
    }

    /* mirror the panel-collapse glyph so its chevron flips from "<" (collapse) to
       ">" (expand) while the rail is collapsed */
    body.kv.kv-side-collapsed.kv-has-side .kv-collapse-btn svg {
        transform: scaleX(-1);
    }

    /* user avatar: drop the card chrome (border/fill/shadow) so it reads as a clean
       icon like the others; just the round avatar, centered */
    body.kv.kv-side-collapsed.kv-has-side a.ltm-UserMenuDropDown {
        border: none !important;
        background: none !important;
        box-shadow: none !important;
        gap: 0 !important;
        padding: .4rem !important;
    }

    /* the user dropdown is absolutely positioned inside the rail, so at the mini
       width it is both too narrow AND clipped by the rail's overflow-x:hidden.
       Float it out as a FIXED flyout to the right of the rail (fixed escapes the
       clip); its top is aligned to the avatar in _Layout, with a sane fallback. */
    body.kv.kv-side-collapsed.kv-has-side .kv-user-card .dropdown-menu {
        position: fixed;
        left: calc(var(--kv-side-w) + 6px);
        right: auto;
        top: var(--kv-user-menu-top, 88px);
        width: 190px;
        min-width: 190px;
    }

    /* Recent History flyout: expanded, it opens just past the rail edge and the
       user dropdown sits INSIDE the rail — no collision. Collapsed, the dropdown
       above is floated out to the right of the mini rail (190px wide at
       --kv-side-w + 6px), landing in the panel's lane and getting buried. Push
       the panel past the floated dropdown so both are visible side by side.
       The 190px mirrors the .dropdown-menu width just above — keep them in sync. */
    body.kv.kv-side-collapsed.kv-has-side .kv-recent-panel {
        left: calc(var(--kv-side-w) + 204px);
        max-width: calc(100vw - var(--kv-side-w) - 220px);
    }
}

/* ===== narrow viewports: the rail becomes an off-canvas drawer =====
   Below this width the rail and the content can't sit side by side without
   overlapping, so the rail slides off-screen and opens OVER the content via the
   hamburger (#kvSideExpand → body.kv-side-open, wired in _Layout). Content stays
   full-width. Replaces the old "float over content" mode, which left the rail
   visible on top of the page (the overlap bug). */
@media (max-width: 1100px) {
    body.kv.kv-has-side > .container,
    body.kv.kv-has-side > #ReadOnlyContent,
    body.kv.kv-has-side > #notificationDiv,
    body.kv.kv-has-side .footer {
        margin-left: 0 !important;
    }

    body.kv.kv-has-side #infobarDiv {
        left: 0 !important;
    }

    /* drawer closed by default at this width — overrides the desktop collapse/
       expand state so the rail never starts on top of the content.
       Slide via `left`, NOT transform: a transformed ancestor becomes the
       containing block for the position:fixed mega-menu flyout and clips it to
       the rail's overflow, which would hide the flyout entirely. */
    body.kv.kv-has-side .kv-side {
        transform: none;
        left: calc(-1 * var(--kv-side-w));
        transition: left .2s ease;
        visibility: hidden;
        z-index: 1090;
        box-shadow: var(--kv-shadow-pop);
        /* opaque fill: as a drawer the rail sits OVER the page, so it must not
           let content show through (on desktop the bare page bg is behind it,
           so the base rule's transparent computed value never showed) */
        background: var(--kv-card, #fff);
    }

    /* drawer open */
    body.kv.kv-has-side.kv-side-open .kv-side {
        left: 0;
        visibility: visible;
    }

    /* the hamburger is always available here to open the drawer; hide it once open */
    body.kv.kv-has-side .kv-side-expand {
        display: flex !important;
    }
    body.kv.kv-has-side.kv-side-open .kv-side-expand {
        display: none !important;
    }

    /* dim backdrop behind the open drawer (a document click handler closes it) */
    body.kv.kv-has-side.kv-side-open::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .4);
        z-index: 1085;
    }

    /* the mega-menu flyout must clear the backdrop and fit the narrow viewport */
    body.kv.kv-has-side .ltm-MegaBigAreaContainerAdj {
        z-index: 1095 !important;
        width: min(760px, calc(100vw - var(--kv-side-w) - 24px)) !important;
    }
    body.kv.kv-has-side .kv-flyout-cols {
        columns: 2;
    }
}

/* ===================== §3 rail flyouts (mega menus) ===================== */

body.kv .kv-menus {
    order: 4;
    display: flex;
    flex-direction: column;
    width: auto !important;     /* defeats Bootstrap .container fixed widths */
    min-width: 0;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
}

body.kv .kv-menus .navbar {
    min-height: 0;
    margin: 0;
    border: none;
    background: none;
    border-radius: 0;
}

/* legacy .latsui-nav is position:absolute + z-index 500 (top-bar layout) —
   that takes the list out of flow inside the rail (it stops scrolling with
   it and paints over the user card): force it back into the flow */
body.kv .kv-menu-list {
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
    position: static !important;
    z-index: auto !important;
    width: 100%;
}

body.kv .kv-menu-list > li.ltm-MegaNavbarLi {
    position: relative;
    width: auto;
    height: auto;
    border: none !important;
    float: none;
    display: block;
}

body.kv a.ltm-MegaNavbarHref {
    display: flex !important;
    align-items: center;
    gap: .65rem;
    padding: .5rem .625rem !important;
    border: none !important;       /* legacy carries a right border */
    border-radius: 8px;
    color: var(--kv-ink-soft) !important;
    text-decoration: none !important;
    font-size: .875rem !important;
    font-weight: 500;
    margin-bottom: .125rem;
    background: none !important;
    background-image: none !important;
    line-height: 1.3 !important;
    position: static !important;   /* legacy sets relative + z-index */
    z-index: auto !important;
}

body.kv a.ltm-MegaNavbarHref svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--kv-muted);
}

body.kv a.ltm-MegaNavbarHref .kv-menu-caret {
    margin-left: auto;
    width: 13px;
    height: 13px;
    color: var(--kv-faint);
    transition: transform .15s;
}

body.kv .kv-menu-list > li:hover > a.ltm-MegaNavbarHref {
    background: var(--kv-bg) !important;
    color: var(--kv-ink) !important;
}

body.kv .kv-menu-list > li.open > a.ltm-MegaNavbarHref {
    background: var(--kv-tint) !important;
    color: var(--kv-primary) !important;
    box-shadow: inset 0 0 0 1px var(--kv-tint-strong);
}

body.kv .kv-menu-list > li.open > a.ltm-MegaNavbarHref svg {
    color: var(--kv-primary);
}

body.kv .kv-menu-list > li.open > a.ltm-MegaNavbarHref .kv-menu-caret {
    transform: rotate(90deg);
    color: var(--kv-primary);
}

/* the flyout panel: white popover card to the right of the rail.
   position: fixed — it must escape the rail's overflow clipping; the
   MutationObserver in _Layout sets --kv-flyout-shift to the opening item's
   viewport offset and clamps it to the viewport.
   On short monitors the panel caps to the viewport and scrolls VERTICALLY.
   The multicol lives on the inner .kv-flyout-cols (which grows to its natural
   height) — the height cap is on THIS panel, never on the multicol element,
   so capped height can't spawn extra horizontal columns (the multicol trap). */
body.kv .ltm-MegaBigAreaContainerAdj {
    position: fixed !important;
    left: calc(var(--kv-side-w) + 10px) !important;
    top: var(--kv-flyout-shift, 90px) !important;
    width: 760px !important;
    background: var(--kv-card) !important;
    border: 1px solid var(--kv-border) !important;
    border-radius: 14px !important;
    box-shadow: var(--kv-shadow-pop) !important;
    padding: 1.25rem 1.5rem 1.1rem !important;
    margin: 0 !important;
    float: none !important;
    min-width: 0 !important;
    max-height: calc(100vh - 1.5rem) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* the balanced multicol columns — natural height (NEVER height-capped), so the
   panel above can scroll them vertically without triggering horizontal overflow */
body.kv .kv-flyout-cols {
    columns: 3;
    column-gap: 2rem;
    column-rule: 1px solid var(--kv-border-faint);
}

/* panel head: menu name + icon. A direct block child of the panel (above the
   multicol .kv-flyout-cols), so it spans the full width without column-span. */
body.kv .kv-flyout-head {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-family: var(--kv-font-display);
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: -.015em;
    color: var(--kv-ink);
    padding: 0 .5rem .75rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--kv-border);
}

body.kv .kv-flyout-head svg {
    width: 16px;
    height: 16px;
    color: var(--kv-primary);
    flex-shrink: 0;
}

/* gradient hairline accent across the flyout top (qz-meta::before motif) */
body.kv .ltm-MegaBigAreaContainerAdj::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 20px;
    right: 20px;
    height: 1px;
    background: var(--kv-hairline-accent);
}

/* shrink-wrap small menus, widen big ones */
body.kv .ltm-MegaBigAreaContainerAdj:has(> .ltm-MegaMenuColumnDivAdjustments:nth-child(2):last-child) {
    columns: 1;
    width: 290px !important;
}

body.kv .ltm-MegaBigAreaContainerAdj:has(> .ltm-MegaMenuColumnDivAdjustments:nth-child(3):last-child) {
    columns: 2;
    width: 530px !important;
}

body.kv .ltm-MegaBigAreaContainerAdj:has(> .ltm-MegaMenuColumnDivAdjustments:nth-child(7)) {
    columns: 4;
    width: 960px !important;
}

body.kv .ltm-MegaMenuColumnDivAdjustments {
    display: block;
    float: none !important;
    width: auto !important;
    break-inside: avoid;
    /* reset the legacy `white-space: nowrap` (generic.css) so any long label
       wraps within its fixed multicol column instead of overflowing the panel */
    white-space: normal !important;
    border: none !important;
    padding: 0 0 1.1rem !important;
    margin: 0 !important;
}

body.kv .ltm-MegaMenuColumnUl {
    list-style: none;
    margin: 0;
    padding: 0;
}

body.kv .ltm-MegaMenuColumnLi {
    list-style: none;
}

body.kv .ltm-MegaMenuColumnH3 {
    margin: 0 0 .35rem;
    padding: 0;
}

/* group caption: mono micro-caps with an indigo eyebrow dash (qz-form-eyebrow motif) */
body.kv a.ltm-MegaMenuColumnH3Href {
    font-family: var(--kv-font-mono);
    font-size: .78rem !important;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--kv-primary) !important;
    font-weight: 700;
    text-decoration: none !important;
    cursor: default;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .2rem .5rem .4rem;
}

body.kv a.ltm-MegaMenuColumnH3Href::before {
    content: "";
    width: 18px;
    height: 2px;
    background: var(--kv-primary);
    opacity: 1;
    flex-shrink: 0;
}

body.kv a.ltm-MegaMenuColumnH3Href,
body.kv .ltm-MegaMenuColumnLi {
    text-indent: 0 !important;
}

body.kv a.ltm-MegaMenuColumnH3Href::after {
    display: none !important;   /* legacy light-blue underline bar */
}

body.kv .ltm-MegaMenuColumnRealLinkLi {
    list-style: none;
}

body.kv a.ltm-MegaMenuColumnRealLinkHref {
    display: block;
    padding: .4rem .55rem !important;
    border-radius: 7px;
    color: var(--kv-ink-soft) !important;
    font-size: .84rem !important;
    font-weight: 500;
    text-decoration: none !important;
    line-height: 1.35;
    overflow-wrap: anywhere;       /* safety net: break an ultra-long single token rather than overflow the column */
    background: none !important;
    text-indent: 0 !important;     /* legacy hanging indent (-1em) hangs the
                                      text out of the hover pill */
    transition: background .1s, color .1s;
}

body.kv a.ltm-MegaMenuColumnRealLinkHref:hover,
body.kv a.ltm-MegaMenuColumnRealLinkHref:focus-visible {
    background: var(--kv-tint) !important;
    color: var(--kv-primary) !important;
}

/* ===================== §4 user card + quick links ===================== */

/* user card sits right under the brand, ABOVE Workspace, contained within
   the rail (stakeholder direction). NO overflow:hidden here — it clips the
   dropdown menu that opens inside the card. */
body.kv .kv-user-card {
    order: 2;
    width: auto !important;
    min-width: 0;
    max-width: 100%;
    padding: 0 !important;
    margin: 0 0 .5rem !important;
    float: none !important;
}

body.kv .kv-user-card .nav.navbar {
    margin: 0;
    min-height: 0;
    border: none;
    float: none !important;
    background: none;
}

body.kv .kv-user-card ul.nav.navbar {
    display: block;
    list-style: none;
    padding: 0;
}

body.kv .kv-user-card li.dropdown {
    list-style: none;
    position: relative;
    display: block;
}

body.kv a.ltm-UserMenuDropDown {
    display: flex !important;
    align-items: center;
    gap: .625rem;
    padding: .625rem !important;
    background: var(--kv-card);
    border: 1px solid var(--kv-border);
    border-radius: 10px;
    color: var(--kv-ink) !important;
    text-decoration: none !important;
    box-shadow: var(--kv-shadow-card);
    line-height: 1.2 !important;
    font-variant: normal;      /* legacy generic.css small-caps */
}

body.kv a.ltm-UserMenuDropDown:hover,
body.kv a.ltm-UserMenuDropDown:focus {
    background: var(--kv-card);
    border-color: var(--kv-border-strong);
    color: var(--kv-ink) !important;
}

body.kv .kv-user-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

/* line 1 of the card: just "Welcome" (quiet/small). The name is its own
   line below now (.kv-user-name), so longer names get the full card width
   instead of being clipped. */
body.kv .kv-user-hello {
    display: flex;
    align-items: baseline;
    gap: .25rem;
    min-width: 0;
}

body.kv a.ltm-UserMenuDropDown strong {
    flex: none;
    font-size: .72rem;
    font-weight: 400;
    color: var(--kv-ink-soft);
    white-space: nowrap;
}

/* on its own line now — wrap long names instead of clipping with ellipsis */
body.kv .kv-user-name {
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--kv-ink);
    overflow-wrap: anywhere;
    min-width: 0;
}

/* signed-in dot breathes slowly — the site reads as alive */
body.kv .kv-user-dot {
    margin-left: auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--kv-ok-dot);
    box-shadow: 0 0 0 3px var(--kv-ok-wash);
    flex-shrink: 0;
    animation: kvBreathe 3.5s ease-in-out infinite;
}

@keyframes kvBreathe {
    0%, 100% { opacity: 1;  box-shadow: 0 0 0 3px var(--kv-ok-wash); }
    50%      { opacity: .45; box-shadow: 0 0 0 5px rgba(16, 185, 129, .05); }
}

body.kv a.ltm-UserMenuDropDown .caret {
    border-top-color: var(--kv-muted);
    flex-shrink: 0;
}

body.kv .kv-user-av {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--kv-grad-brand);
    color: var(--kv-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: .78rem;
    flex-shrink: 0;
}

body.kv .kv-user-card .dropdown-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    bottom: auto;
    z-index: 20;
    min-width: 0;
    background: var(--kv-card);
    border: 1px solid var(--kv-border);
    border-radius: var(--kv-r-panel);
    box-shadow: var(--kv-shadow-pop);
    padding: .35rem;
    margin: 0;
}

/* Expanded: CSS owns the dropdown's top. When collapsed, _Layout.cshtml writes
   an inline style.top onto the menu to align the FIXED mini-rail flyout to the
   avatar; that inline value is never cleared, and (inline beats plain CSS) it
   drops the menu ~half a card-height after you expand again — dragging the
   Recent History flyout, which aligns to a row, down with it. !important
   reclaims the top in the expanded state; the collapsed rule below is untouched. */
body.kv:not(.kv-side-collapsed) .kv-user-card .dropdown-menu {
    top: calc(100% + 4px) !important;
}

body.kv a.ltm-UserMenuHref {
    display: block;
    padding: .45rem .625rem !important;
    border-radius: 6px;
    color: var(--kv-ink-soft) !important;
    font-size: .83rem !important;
    font-weight: 500;
    text-decoration: none !important;
}

body.kv a.ltm-UserMenuHref:hover,
body.kv a.ltm-UserMenuHref:focus-visible {
    background: var(--kv-tint) !important;
    color: var(--kv-primary) !important;
}

body.kv .kv-user-card .divider {
    height: 1px;
    margin: .3rem .25rem;
    background: var(--kv-border);
    border: none;
}

/* quick links (Workspace) — accessible names are "Go to …" by design:
   keeps them out of page-wide exact-name role queries used by E2E tests */
body.kv .kv-quick {
    order: 3;
    display: flex;
    flex-direction: column;
}

body.kv a.kv-quick-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .5rem .625rem;
    border-radius: 8px;
    color: var(--kv-ink-soft) !important;
    text-decoration: none !important;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: .125rem;
}

body.kv a.kv-quick-link svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--kv-muted);
}

body.kv a.kv-quick-link:hover {
    background: var(--kv-bg);
    color: var(--kv-ink) !important;
}

body.kv a.kv-quick-link:hover svg {
    color: var(--kv-primary);
}

body.kv a.kv-quick-link.kv-active {
    background: var(--kv-tint);
    color: var(--kv-primary) !important;
    box-shadow: inset 0 0 0 1px var(--kv-tint-strong);
}

body.kv a.kv-quick-link.kv-active svg {
    color: var(--kv-primary);
}

/* ===================== §5 content offset / page chrome ===================== */

/* NOTE on structure: the legacy layout markup closes the outer .container
   early (stray </div> in the pageTitle fragment) — #ReadOnlyContent is a
   DIRECT CHILD OF BODY and is the real content root; the outer .container
   only holds the page title strip. */
body.kv.kv-has-side > .container {
    margin-left: var(--kv-side-w);
    margin-right: 0;
    width: auto;
    min-width: 0;
    max-width: 1320px;         /* qz-content */
    /* tight top: the breadcrumb already names the page, so this title strip
       shouldn't add a big gap above the content (was 2rem) */
    padding: .5rem 2.25rem .25rem;
    position: relative;
    z-index: 1;
}

/* the legacy title-strip markup leaves empty <p> wrappers whose default
   margins pad out the gap between breadcrumb and content — flatten them */
body.kv.kv-has-side > .container > p {
    margin: 0;
}

body.kv.kv-has-side > #ReadOnlyContent {
    margin-left: var(--kv-side-w);
    max-width: 1320px;         /* qz-content; wide pages override per-page */
    padding: 0 2.25rem 4.5rem;
    position: relative;
    z-index: 1;
    /* Contain over-wide page content (wide grids, flex-container two-column edit
       forms, fixed-width tables) so it scrolls WITHIN the content region instead of
       overflowing the <body> and dragging content over the fixed left rail. Kendo
       popups (dropdowns/calendars/windows) render appended to <body>, so they are
       not clipped by this. */
    overflow-x: auto;
}

/* opt-in wider content column. Replaces the duplicated per-page <style>
   blocks that hand-rolled this same override: .kv-wide for Scheduled
   Reports' six-column parameters grid, .kv-wide-xl for the pivot timesheet's
   meta card + 14-day grid. A view opts in with ViewData["KvBodyClass"]
   ("kv-wide" | "kv-wide-xl"), which _Layout appends to the body. The extra
   class lifts specificity over the 1320px base rule above. */
body.kv.kv-has-side.kv-wide > .container,
body.kv.kv-has-side.kv-wide > #ReadOnlyContent,
body.kv.kv-has-side.kv-wide > #notificationDiv {
    max-width: 1480px;
}

body.kv.kv-has-side.kv-wide-xl > .container,
body.kv.kv-has-side.kv-wide-xl > #ReadOnlyContent,
body.kv.kv-has-side.kv-wide-xl > #notificationDiv {
    max-width: 1620px;
}

/* menu-less pages (login): Bootstrap pins .container to 1170px — the Quartz
   login spreads across the full viewport (qz-main), so lift the cap */
body.kv:not(.kv-has-side) > .container,
body.kv:not(.kv-has-side) > #ReadOnlyContent {
    min-width: 0;
    width: auto !important;
    max-width: none !important;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 1;
}

/* page views nest their own Bootstrap .container divs — under the rail
   layout they are neutral wrappers, not fixed-width centered columns
   (Bootstrap's 1170px would center content UNDER the rail on small
   monitors) */
body.kv #ReadOnlyContent .container,
body.kv .container .container {
    width: auto !important;
    max-width: none !important;
    min-width: 0;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
}

/* slim top bar with breadcrumb (qz-top / qz-crumb) — rendered by _Layout */
body.kv .kv-top {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 2.25rem;
    border-bottom: 1px solid var(--kv-border);
    background: rgba(255, 255, 255, .7);
}

body.kv.kv-has-side .kv-top {
    margin-left: var(--kv-side-w);
}
/* NOTE: the desktop mini-rail keeps .kv-top tracking var(--kv-side-w) (see the
   min-width block in the collapse section); the narrow-viewport block below zeroes
   it and pads for the floating hamburger. */

@media (max-width: 1100px) {
    body.kv.kv-has-side .kv-top {
        margin-left: 0;
        padding-left: 4rem;   /* float the breadcrumb right of the floating hamburger (drawer toggle) */
    }
}

body.kv .kv-crumb {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-family: var(--kv-font-mono);
    font-size: .78rem;
    color: var(--kv-muted);
    min-width: 0;
}

body.kv .kv-crumb .sep {
    color: var(--kv-border-strong);
}

body.kv .kv-crumb b {
    color: var(--kv-ink);
    font-weight: 500;
    font-family: var(--kv-font-ui);
    font-size: .85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Recent pages — last-10 navigation history, rendered by recentNav.js. The
   "Recent History" row sits in the welcome dropdown like Change Password /
   Logout; hovering it (or click/Enter) pops the panel out beside the rail. */
body.kv .dropdown-menu #kvRecentSection {
    display: block;
    position: relative;
}

/* the menu row — same geometry as its .ltm-UserMenuHref siblings, plus a
   pop-out caret pushed to the right edge */
body.kv .kv-recent-item {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

body.kv .kv-recent-item-lbl {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
}

/* the history-clock icon from the control's first (top-bar) incarnation */
body.kv .kv-recent-item-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--kv-muted);
}

body.kv .kv-recent-item:hover .kv-recent-item-icon,
body.kv .kv-recent-item[aria-expanded="true"] .kv-recent-item-icon {
    color: var(--kv-primary);
}

body.kv .kv-recent-item-caret {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    color: var(--kv-faint);
}

body.kv .kv-recent-item:hover .kv-recent-item-caret,
body.kv .kv-recent-item[aria-expanded="true"] .kv-recent-item-caret {
    color: var(--kv-primary);
}

/* the pop-out panel — fixed so it escapes the rail's overflow clipping (same
   trick as the mega-menu flyouts); the closed state keeps the hidden
   attribute (Bootstrap ships [hidden]{display:none!important}) */
body.kv .kv-recent-panel {
    position: fixed;
    left: calc(var(--kv-side-w) + 8px);
    /* top is set by recentNav.js on open: aligned with the Recent History
       row, clamped into the viewport */
    top: 100px;
    z-index: 1100;              /* above the rail (1040) and the narrow-screen drawer (1090) */
    /* wide enough for the meta line's longest real value — the area path plus
       the timestamp ("Workforce Management / Administration · just now", ~306px
       of mono at .68rem) — after the list/link padding and the remove button
       take their ~53px. Narrower and the timestamp is what gets ellipsed, which
       reads as a broken row rather than a truncated one. */
    width: 440px;
    max-width: calc(100vw - var(--kv-side-w) - 24px);
    background: var(--kv-card);
    border: 1px solid var(--kv-border);
    border-radius: var(--kv-r-panel);
    box-shadow: var(--kv-shadow-pop);
    overflow: hidden;
}

body.kv .kv-recent-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .55rem .9rem;
    border-bottom: 1px solid var(--kv-border);
    background: var(--kv-field);
    font-family: var(--kv-font-mono);
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--kv-muted);
}

/* left side of the head: label + optional instance chip, ellipsized as one */
body.kv .kv-recent-head-lbl {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* which instance's trail this is (dashboard users on a non-home site) */
body.kv .kv-recent-inst {
    margin-left: .45rem;
    color: var(--kv-primary);
    font-weight: 600;
}

body.kv .kv-recent-inst::before {
    content: "·";
    margin-right: .45rem;
    color: var(--kv-border-strong);
    font-weight: 400;
}

body.kv .kv-recent-clear {
    flex-shrink: 0;
    margin-left: .5rem;
    border: 0;
    background: none;
    padding: 0;
    font-family: var(--kv-font-ui);
    font-size: .72rem;
    color: var(--kv-primary);
    cursor: pointer;
}

body.kv .kv-recent-clear:hover {
    text-decoration: underline;
}

body.kv .kv-recent-list {
    list-style: none;
    margin: 0;
    padding: .3rem;
    max-height: 60vh;
    overflow-y: auto;
}

/* each row: the nav link grows, the per-entry remove button sits at the end */
body.kv .kv-recent-list li {
    display: flex;
    align-items: center;
    gap: .15rem;
}

body.kv .kv-recent-list a.kv-recent-link {
    display: block;
    flex: 1;
    min-width: 0;
    padding: .45rem .6rem;
    border-radius: var(--kv-r-ctl);
    text-decoration: none;
}

body.kv .kv-recent-list a.kv-recent-link:hover,
body.kv .kv-recent-list a.kv-recent-link:focus {
    background: var(--kv-tint);
}

/* per-entry remove (×) — quiet until the pointer is in the row */
body.kv .kv-recent-del {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--kv-faint);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
}

body.kv .kv-recent-list li:hover .kv-recent-del,
body.kv .kv-recent-del:focus-visible {
    opacity: 1;
}

body.kv .kv-recent-del:hover {
    background: var(--kv-danger-wash);
    color: var(--kv-danger);
}

body.kv .kv-recent-title {
    display: block;
    font-family: var(--kv-font-ui);
    font-size: .82rem;
    font-weight: 500;
    color: var(--kv-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.kv .kv-recent-link:hover .kv-recent-title {
    color: var(--kv-primary);
}

/* page context under the title — whose timesheet, what search */
body.kv .kv-recent-detail {
    display: block;
    margin-top: .1rem;
    font-family: var(--kv-font-ui);
    font-size: .74rem;
    color: var(--kv-ink-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.kv .kv-recent-meta {
    display: block;
    margin-top: .1rem;
    font-family: var(--kv-font-mono);
    font-size: .68rem;
    color: var(--kv-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.kv .kv-recent-list li.kv-recent-empty {
    display: block;
    padding: .9rem .6rem;
    font-family: var(--kv-font-ui);
    font-size: .78rem;
    color: var(--kv-muted);
    text-align: center;
}

/* In-content page title: hidden under the theme — the breadcrumb (kv-crumb)
   now carries the page name (Area / Sub-area / Page), so the heading was
   redundant. Left in the DOM (not removed) so the legacy/theme-off rollback,
   which has no breadcrumb, still shows the page title. */
body.kv .pageTitle {
    display: none;
}

body.kv .footer {
    background: var(--kv-card);
    border-top: 1px solid var(--kv-border);
    left: var(--kv-side-w);
    width: auto;
    right: 0;
    height: auto;
    padding: 8px 10px;
    z-index: 5;
}

body.kv:not(.kv-has-side) .footer {
    left: 0;
}

body.kv .footer span {
    color: var(--kv-muted);
    font-size: 10px;
    font-family: var(--kv-font-ui);   /* was mono — footer should read as fine print, not code */
}

/* ── typography consolidation ──────────────────────────────────────────────
   Legacy lats.css declares `A { font-family: Arial, Tahoma }` plus assorted
   Arial leftovers, which bleed into the brand wordmark, the side menu, and the
   user card. Pull all real UI text onto the Quartz UI font (DM Sans) so the
   chrome matches the page content. The monospace accent (version badge, section
   captions, count chips, "Signed in") is set explicitly on its own classes and
   is intentionally left untouched. */
body.kv .kv-brand-word,
body.kv .kv-user-hello,
body.kv .kv-user-hello strong,
body.kv .kv-user-name,
body.kv .kv-quick-link,
body.kv a.ltm-MegaNavbarHref,
body.kv a.ltm-MegaMenuColumnRealLinkHref {
    font-family: var(--kv-font-ui) !important;
}

/* notification banner: clear the rail (legacy pins it absolute top-left).
   !important on position/left: when the banner is shown, the InfoBar plugin adds
   the .InfoBar class to #infobarDiv, and `body.kv .InfoBar { position:static;
   left:auto !important }` (a rule meant for the instance-switch #notificationDiv)
   would otherwise clobber this fixed positioning — collapsing the bar into the
   flow behind the content and nullifying the z-index (static ignores z-index),
   so the notification banner never appeared.

   margin-top:0 !important neutralizes infobar.js's legacy scroll handler, which
   fakes "stay on screen" the pre-position:fixed way by setting inline
   margin-top = window.scrollTop on every scroll. Against our real position:fixed
   that margin is added on top of top:0, pushing the bar DOWN the page as you
   scroll (the "drifts toward the middle" bug). The stylesheet !important wins over
   the plugin's inline .css() (no !important), so fixed positioning holds. */
body.kv.kv-has-side #infobarDiv {
    left: var(--kv-side-w) !important;
    width: auto !important;
    right: 0;
    position: fixed !important;
    top: 0;
    margin-top: 0 !important;
}

body.kv .InfoBar {
    background-color: var(--kv-primary) !important;
    color: var(--kv-on-primary) !important;
    font-family: var(--kv-font-ui);
    left: auto !important;
    width: auto !important;
    position: static !important;
}

/* Un-dismissed-notifications banner. #infobarDiv is pinned to the top of the
   content column (fixed; positioned by the rule above). The InfoBar plugin adds
   .InfoBar to it, and its #infoMessage/#infoMessageAll children carry .InfoBar in
   markup, so `body.kv .InfoBar` would paint all three solid indigo. We override
   that to the SAME light, outlined notice card the instance-switch bar
   (#notificationDiv) uses, so both notification surfaces read as one design. */

/* the bar is a tray with an opaque page-bg backdrop (it's fixed over the top of the
   content, so an opaque fill cleanly covers the breadcrumb it overlaps) and padding
   that insets the card. #infobarDiv also gets .InfoBar at runtime, whose indigo
   !important fill we override here. */
body.kv #infobarDiv,
body.kv #infobarDiv.InfoBar {
    background: var(--kv-bg) !important;
    color: var(--kv-ink) !important;
    border: none;
    box-shadow: none;
    padding: .8rem 2.25rem;
    /* position:fixed with no stacking of its own let the content column
       (position:relative; z-index:1) paint over it; lift it above the content
       (still below the rail:1040 and the mega-menu flyout:1090). */
    z-index: 1030;
}

/* the markup <table> becomes the card: message on the left, buttons on the right,
   capped to the content width (mirrors #ReadOnlyContent) so it aligns with the
   widgets below. */
body.kv #infobarDiv > table {
    width: 100% !important;
    max-width: 1320px;
    background: var(--kv-card);
    border: 1px solid rgba(var(--kv-primary-rgb), .4);
    border-radius: 12px;
    box-shadow: 0 6px 18px -12px rgba(var(--kv-ink-rgb), .3);
    border-collapse: separate;
}

body.kv.kv-has-side.kv-wide #infobarDiv > table {
    max-width: 1480px;
}

body.kv.kv-has-side.kv-wide-xl #infobarDiv > table {
    max-width: 1620px;
}

body.kv #infobarDiv > table > tbody > tr > td {
    padding: .7rem 1.1rem !important;
    vertical-align: middle;
}

/* message text: kill the indigo .InfoBar paint and show ink on the card, left-aligned */
body.kv #infobarDiv #infoMessage.InfoBar,
body.kv #infobarDiv #infoMessageAll.InfoBar {
    background: transparent !important;
    color: var(--kv-ink) !important;
    text-align: left !important;
    font-family: var(--kv-font-ui);
    font-size: .9rem;
    font-weight: 500;
    padding: 2px 0 !important;
}

/* section title (e.g. "Un-dismissed Notifications") — a compact indigo eyebrow that
   sits above the message. The "-- ... --" dashes were dropped from the message HTML
   in IndexPivot; this <span class="kv-notif-title"> replaces them. */
body.kv #infobarDiv .kv-notif-title {
    font-family: var(--kv-font-mono);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--kv-primary);
}

/* swap the dated warning.gif raster for a crisp warning glyph in the indigo scheme
   (mirrors the home.png swap on #notificationDiv and the info-circle on the instance
   card; the SVG stroke is hardcoded because a data: URI can't read a CSS var —
   %234338ca mirrors --kv-primary). The <img alt> stays, so the accessible name is
   preserved. */
body.kv #infobarDiv img[src*="warning.gif" i] {
    content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234338ca' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z'/><line x1='12' y1='9' x2='12' y2='13'/><line x1='12' y1='17' x2='12.01' y2='17'/></svg>");
    width: 16px;
    height: 16px;
    vertical-align: -3px;
}

/* actions: primary (Dismiss) reads as the card's solid indigo action, like the
   instance card's home pill; Close is a quiet outline. Scoped by id — no identity
   change, so the Playwright locators still find them. */
body.kv #infobarDiv #btnNotificationDismiss.k-button {
    background: var(--kv-primary) !important;
    color: var(--kv-on-primary) !important;
    border: 1px solid var(--kv-primary) !important;
    box-shadow: var(--kv-shadow-primary);
}

body.kv #infobarDiv #btnNotificationDismiss.k-button:hover {
    background: var(--kv-primary-hover) !important;
    border-color: var(--kv-primary-hover) !important;
}

body.kv #infobarDiv #btnNotificationClose.k-button {
    background: var(--kv-card) !important;
    color: var(--kv-primary) !important;
    border: 1px solid rgba(var(--kv-primary-rgb), .4) !important;
}

body.kv #infobarDiv #btnNotificationClose.k-button:hover {
    background: var(--kv-wash) !important;
}

/* Instance-switch notice bar. #notificationDiv (a <body> child, sticky) carries
   .InfoBar; notification.js injects a <table> with the message + a home.png link.
   Restyled as a LIGHT, outlined notice card that clears the rail and lines up with
   the content column (CSS-only; theme-off keeps the legacy bar + raster icon). */

/* wrapper: transparent shell, inset from the edges, offset past the rail and
   capped to the content width so the card aligns with the widgets below */
body.kv #notificationDiv {
    background: transparent !important;
    border: none;
    box-shadow: none;
    /* 15px (not 2.25rem) so the card's inset matches the .container content box,
       i.e. it lines up with the report/page body width rather than sitting narrower. */
    padding: .8rem 15px;
    /* #notificationDiv gets the .InfoBar class at runtime; body.kv .InfoBar forces
       position:static !important, which clobbers the generic #notificationDiv sticky
       (its sibling #infobarDiv fights back with position:fixed, but this bar never
       did). Restore sticky here -- higher specificity + !important beats .InfoBar --
       so the instance banner follows the scroll (e.g. the canned-report auto-scroll). */
    position: sticky !important;
    top: 0 !important;
    z-index: 900;
}

body.kv.kv-has-side > #notificationDiv {
    margin-left: var(--kv-side-w);
    max-width: 1320px;
}

/* the injected <table> collapses to a block; its single cell becomes the card */
body.kv #notificationDiv table,
body.kv #notificationDiv tbody,
body.kv #notificationDiv tr {
    display: block;
    width: 100% !important;
    border: 0 !important;
}

body.kv #notificationDiv td {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100% !important;
    /* size to content — timesheet.css sets a global `td { height: 20px }` that
       would otherwise crush the card (and the home pill) on the timesheet page */
    height: auto !important;
    padding: .7rem 1.1rem !important;
    background: var(--kv-primary);
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 12px;
    box-shadow: 0 6px 18px -12px rgba(var(--kv-ink-rgb), .3);
    font-size: .9rem;
    font-weight: 500;
    text-align: left !important;
}

/* indigo info glyph before the message */
body.kv #notificationDiv td::before {
    content: "";
    flex: none;
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><line x1='12' y1='16' x2='12' y2='12'/><line x1='12' y1='8' x2='12.01' y2='8'/></svg>") center / 18px no-repeat;
}

/* "return to home instance" = a solid indigo pill button, pushed to the right */
body.kv #notificationDiv td a {
    margin-left: auto;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--kv-r-pill);
    background: rgba(255,255,255,.2);
    box-shadow: none;
    transition: background .15s, transform .15s;
}

body.kv #notificationDiv td a:hover {
    background: rgba(255,255,255,.35);
    transform: translateY(-1px);
}

/* swap the legacy raster home.png for a crisp white home icon (mirrors the
   help2.gif swap below; gated to body.kv so theme-off keeps the original png) */
body.kv #notificationDiv img[src*="home.png" i] {
    content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 9.5 12 3l9 6.5'/><path d='M5 10v10h14V10'/></svg>");
    width: 15px;
    height: 15px;
    vertical-align: middle;
}

/* ===================== §6 buttons & links (non-Kendo) ===================== */

body.kv a {
    color: var(--kv-primary);
}

body.kv a:hover,
body.kv a:focus {
    color: var(--kv-primary-hover);
}

body.kv a.boldsearch {
    color: var(--kv-primary) !important;
    border-radius: var(--kv-r-chip);
}

body.kv a.boldsearch:hover {
    color: var(--kv-on-primary) !important;
    background-color: var(--kv-primary) !important;
}

body.kv .required,
body.kv .error,
body.kv .warning {
    color: var(--kv-danger);
}

/* --- shared notice banner (opt-in) ------------------------------------------
   Drop `kv-notice kv-notice--{info|warn|danger}` on any status/message element
   to render it as a themed banner. Placed AFTER the `.error` color rule above so
   the color modifiers win by source order on elements that also carry `.error`.
   The :empty guard auto-hides a blank message — but the source MUST write the
   message flush against the tags (a whitespace-only child defeats :empty and
   paints an empty bar). Margin is a neutral default; it reads fine both as a
   full-width page banner and nested inside a card. */
body.kv .kv-notice {
    display: block;
    margin: .75rem 0;
    padding: .7rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--kv-r-panel);
    font-size: .9rem;
    font-weight: 600;
}

body.kv .kv-notice:empty {
    display: none;
}

body.kv ul.kv-notice {
    padding-left: 2.25rem;
    list-style: disc;
}

body.kv .kv-notice--info {
    background: var(--kv-tint);
    border-color: var(--kv-tint-border);
    color: var(--kv-primary-hover);
}

body.kv .kv-notice--warn {
    background: var(--kv-warn-wash);
    border-color: var(--kv-warn-border);
    color: var(--kv-warn-text);
}

body.kv .kv-notice--danger {
    background: var(--kv-danger-wash);
    border-color: var(--kv-danger-border);
    color: var(--kv-danger);
}

body.kv input.normalButton,
body.kv .normalButton {
    background: var(--kv-grad-btn) !important;
    color: var(--kv-on-primary) !important;
    border: none;
    border-radius: var(--kv-r-ctl);
    box-shadow: var(--kv-shadow-primary);
    font-family: var(--kv-font-ui);
    font-weight: 600;
}

/* ===================== §7 home cards ===================== */

/* page greeting row (qz-hello, default.html) */
body.kv .kv-hello {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin: 0 0 1.75rem;
    flex-wrap: wrap;
}

body.kv .kv-hello h1 {
    font-family: var(--kv-font-display);
    font-weight: 600;
    font-size: clamp(1.875rem, 3.5vw, 2.5rem);
    color: var(--kv-ink);
    margin: 0 0 .375rem;
    letter-spacing: -.03em;
    line-height: 1.05;
}

body.kv .kv-hello h1 .accent {
    color: var(--kv-primary);
}

body.kv .kv-hello p {
    font-size: .95rem;
    color: var(--kv-muted);
    margin: 0;
    font-weight: 500;
}

/* announcement box (qz-alert: amber wash + mono head) */
body.kv .kv-alert {
    padding: 1rem 1.125rem;
    background: rgba(245, 158, 11, .06);
    border: 1px solid rgba(245, 158, 11, .22);
    border-radius: var(--kv-r-panel);
    margin-bottom: 1rem;
}

body.kv .kv-alert-head {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-family: var(--kv-font-mono);
    font-size: .68rem;
    letter-spacing: .1em;
    color: var(--kv-warn-text);
    text-transform: uppercase;
    margin-bottom: .55rem;
    font-weight: 600;
}

body.kv .kv-alert-head::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--kv-warn-dot);
}

/* tip box (qz-tip: indigo wash + mono tag) */
body.kv .kv-tip {
    padding: 1rem 1.125rem;
    background: rgba(var(--kv-primary-rgb), .06);
    border: 1px solid rgba(var(--kv-primary-rgb), .22);
    border-radius: var(--kv-r-panel);
}

body.kv .kv-tip-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .45rem;
}

body.kv .kv-tip-tag {
    font-family: var(--kv-font-mono);
    font-size: .65rem;
    letter-spacing: .12em;
    color: var(--kv-primary);
    text-transform: uppercase;
    font-weight: 600;
}

body.kv .kv-tip-date {
    font-family: var(--kv-font-mono);
    font-size: .65rem;
    color: var(--kv-muted);
}

/* the announcements panel stacks the alert + tip boxes */
body.kv .kv-card-body .kv-tip {
    margin-top: 1rem;
}

/* KPI band (qz-kpis, default.html) — first tile featured gradient */
body.kv .kv-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .85rem;
    margin-bottom: 1.75rem;
}

@media (max-width: 1250px) {
    body.kv .kv-kpis {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Opt-in variant for a band whose tile count varies at render time (the Dashboard home
   band renders only the tiles whose widget is enabled). A fixed 4-column track would
   leave empty columns at 1-3 tiles. Scoped to this class so the shared band on the
   regular home page keeps the fixed track and its 1250px breakpoint unchanged.
   The extra class outranks the rule inside the media query, so this wins at every width;
   min() stops a single tile overflowing a narrow viewport. */
body.kv .kv-kpis.kv-kpis-fit {
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
}

body.kv a.kv-kpi {
    display: block;
    padding: 1.125rem 1.25rem;
    background: var(--kv-card);
    border: 1px solid var(--kv-border);
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    text-decoration: none !important;
    transition: border-color .15s, transform .15s, box-shadow .15s;
}

body.kv a.kv-kpi:hover {
    border-color: var(--kv-border-strong);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -8px rgba(var(--kv-ink-rgb), .08);
}

body.kv a.kv-kpi.featured {
    background: var(--kv-grad-brand);
    border: none;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 8px 24px -8px rgba(var(--kv-primary-rgb), .4);
}

body.kv a.kv-kpi.featured::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -30%;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .15) 0%, transparent 60%);
    pointer-events: none;
}

body.kv .kv-kpi-lbl {
    font-family: var(--kv-font-mono);
    font-size: .66rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--kv-muted);
    margin-bottom: .45rem;
    font-weight: 500;
}

body.kv .kv-kpi.featured .kv-kpi-lbl {
    color: rgba(255, 255, 255, .85);
}

body.kv .kv-kpi-val {
    font-family: var(--kv-font-display);
    font-weight: 600;
    font-size: 1.75rem;
    color: var(--kv-ink);
    line-height: 1;
    letter-spacing: -.025em;
}

body.kv .kv-kpi.featured .kv-kpi-val {
    color: #fff;
}

body.kv .kv-kpi-sub {
    font-size: .78rem;
    color: var(--kv-muted);
    margin-top: .5rem;
    line-height: 1.45;
}

body.kv .kv-kpi.featured .kv-kpi-sub {
    color: rgba(255, 255, 255, .85);
}

/* weighted panel grid (qz-grid): announcements 1.5fr | tasks 1fr */
body.kv .kv-home {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 1100px) {
    body.kv .kv-home {
        grid-template-columns: 1fr;
    }
}

body.kv .kv-card {
    background: var(--kv-card);
    border: 1px solid var(--kv-border);
    border-radius: 14px;
    box-shadow: var(--kv-shadow-card);
    position: relative;
    overflow: hidden;
}

body.kv .kv-card-head {
    padding: .875rem 1.125rem;
    border-bottom: 1px solid var(--kv-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

body.kv .kv-card-head h2 {
    font-family: var(--kv-font-display);
    font-weight: 600;
    font-size: .95rem;
    color: var(--kv-ink);
    margin: 0;
    letter-spacing: -.015em;
    display: flex;
    align-items: center;
    gap: .5rem;
}

body.kv .kv-card-head h2 svg {
    width: 15px;
    height: 15px;
    color: var(--kv-primary);
}

/* count chip in a panel head (qz-panel__head .ct) */
body.kv .kv-card-head h2 .kv-ct {
    font-family: var(--kv-font-mono);
    font-size: .66rem;
    padding: .1rem .4rem;
    background: var(--kv-bg);
    border-radius: var(--kv-r-pill);
    color: var(--kv-muted);
    font-weight: 500;
}

body.kv .kv-card-body {
    padding: 1rem 1.125rem;
    font-size: .875rem;
    color: var(--kv-ink-soft);
    line-height: 1.55;
}

body.kv .kv-card-body strong {
    color: var(--kv-ink);
}

/* gradient hairline accent on cards (qz-kpi::before motif) */
body.kv .kv-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--kv-hairline-accent);
    pointer-events: none;
}

/* task list rows: icon + name + right-aligned count badge */
body.kv a.kv-task-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .45rem;
    border-radius: var(--kv-r-ctl);
    color: var(--kv-ink) !important;
    text-decoration: none !important;
    font-size: .875rem;
    font-weight: 500;
    border-bottom: 1px solid var(--kv-border-faint);
}

body.kv a.kv-task-link:last-child {
    border-bottom: none;
}

body.kv a.kv-task-link:hover {
    background: var(--kv-bg);
}

body.kv .kv-task-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--kv-r-ctl);
    background: var(--kv-tint);
    color: var(--kv-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

body.kv .kv-task-icon svg {
    width: 14px;
    height: 14px;
}

body.kv .kv-task-name {
    flex: 1;
    min-width: 0;
}

/* count badge — global: timesheet overdue + home task list share it.
   Quartz pill anatomy (qz-task-pill.urgent): red tint wash, dark red text. */
body.kv .kv-overdue-no {
    margin-left: auto;
    background: rgba(220, 38, 38, .13);
    color: var(--kv-danger-strong);
    border: 1px solid rgba(220, 38, 38, .2);
    padding: .2rem .5rem;
    border-radius: var(--kv-r-chip);
    font-family: var(--kv-font-mono);
    font-size: .66rem;
    font-weight: 600;
    letter-spacing: .04em;
    flex-shrink: 0;
    line-height: 1;
}

/* Overdue / outstanding-timesheets indicator (Time/OutstandingTimesheets): a cohesive
   Quartz danger pill — soft red wash, dark-red label, solid-red count chip — so it
   draws attention like the theme's other pills instead of the harsh bootstrap-red
   badge + red text it replaced. Keyed on the ids so both the <a> and <label> variants
   pick it up; the page JS only rewrites the inner html, so the pill styling persists. */
body.kv #lnkOutstandingTimesheets,
body.kv #lnkOutstandingTDSTimesheets {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: var(--kv-danger-wash);
    border: 1px solid var(--kv-danger-border);
    color: var(--kv-danger-strong);
    border-radius: var(--kv-r-pill);
    padding: .3rem .8rem .3rem .45rem;
    font-family: var(--kv-font-ui);
    font-size: .8rem;
    font-weight: 600;
    text-transform: none;
    text-decoration: none;
    line-height: 1.2;
}

body.kv a#lnkOutstandingTimesheets:hover,
body.kv a#lnkOutstandingTDSTimesheets:hover {
    background: var(--kv-danger-border);
    border-color: var(--kv-danger);
    text-decoration: none;
}

/* the count rides as a solid-red chip so the number pops inside the soft pill */
body.kv #lnkOutstandingTimesheets .kv-overdue-no,
body.kv #lnkOutstandingTDSTimesheets .kv-overdue-no {
    margin-left: 0;
    background: var(--kv-danger-dot);
    color: var(--kv-on-primary);
    border: none;
    padding: .12rem .45rem;
}

/* ===================== §8 login ===================== */
/* Quartz login (login.html design 03): top brand rail, hero on the open
   ground (chip → headline → copy → bento tiles, one featured gradient
   tile), white form card right with icon fields. No split card. */

body.kv .kv-toprail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 2.5rem;
    position: relative;
    z-index: 1;
    background: none;
}

body.kv .kv-toprail .kv-brand {
    border: none;
    padding: 0;
    margin: 0;
    cursor: default;
    order: 0;
}

body.kv .kv-toprail .kv-pill .pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--kv-ok-dot);
    box-shadow: 0 0 0 3px var(--kv-ok-wash);
    /* breathe like the signed-in dot in the menu user card (.kv-user-dot) */
    animation: kvBreathe 3.5s ease-in-out infinite;
}

/* full-bleed like qz-main: the grid spans the viewport, padding 3rem */
body.kv .kv-login {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 3.5rem;
    align-items: center;
    padding: 0 3rem 3rem;
    min-height: calc(100vh - 180px);
    position: relative;
    z-index: 1;
}

@media (max-width: 1000px) {
    body.kv .kv-login {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    body.kv .kv-login-card {
        justify-self: center !important;
    }
}

/* --- hero --- */
body.kv .kv-login-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

body.kv .kv-login-chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    align-self: flex-start;
    padding: .4rem .8rem;
    background: var(--kv-card);
    border: 1px solid var(--kv-border);
    border-radius: var(--kv-r-pill);
    font-family: var(--kv-font-mono);
    font-size: .72rem;
    color: var(--kv-primary);
    margin-bottom: 1.5rem;
    font-weight: 500;
    letter-spacing: .02em;
    box-shadow: 0 1px 2px rgba(var(--kv-ink-rgb), .04);
}

body.kv .kv-login-chip svg {
    width: 13px;
    height: 13px;
}

body.kv .kv-login-hero h1 {
    font-family: var(--kv-font-display);
    font-weight: 600;
    font-size: clamp(2.75rem, 5vw, 4.25rem);   /* qz-hero h1 */
    line-height: 1.02;
    color: var(--kv-ink);
    margin: 0 0 1.25rem;
    letter-spacing: -.035em;
}

body.kv .kv-login-hero h1 .ink {
    color: var(--kv-primary);
}

body.kv .kv-login-hero h1 .light {
    color: var(--kv-muted);
    font-weight: 400;
}

body.kv .kv-login-hero > p {
    font-size: 1.125rem;
    color: var(--kv-muted);
    line-height: 1.55;
    margin: 0 0 2.5rem;
    max-width: 46ch;
    font-weight: 400;
}

body.kv .kv-login-hero > p b {
    color: var(--kv-ink);
    font-weight: 600;
}

/* --- bento tiles --- */
body.kv .kv-bento {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    max-width: 520px;
}

body.kv .kv-bento-tile {
    padding: 1.125rem 1.25rem;
    background: var(--kv-card);
    border: 1px solid var(--kv-border);
    border-radius: 14px;
    position: relative;
    overflow: hidden;
}

body.kv .kv-bento-tile.featured {
    grid-column: span 2;
    background: var(--kv-grad-brand);
    color: #fff;
    border: none;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 8px 24px -8px rgba(var(--kv-primary-rgb), .4);
}

body.kv .kv-bento-tile.featured::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .15) 0%, transparent 60%);
    pointer-events: none;
}

body.kv .kv-bento-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--kv-tint);
    color: var(--kv-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .75rem;
}

body.kv .kv-bento-icon svg {
    width: 16px;
    height: 16px;
}

body.kv .kv-bento-tile.featured .kv-bento-icon {
    background: rgba(255, 255, 255, .15);
    color: #fff;
}

body.kv .kv-bento-lbl {
    font-family: var(--kv-font-mono);
    font-size: .68rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--kv-muted);
    margin-bottom: .4rem;
    font-weight: 500;
}

body.kv .kv-bento-tile.featured .kv-bento-lbl {
    color: rgba(255, 255, 255, .75);
}

body.kv .kv-bento-val {
    font-family: var(--kv-font-display);
    font-weight: 600;
    font-size: 1.75rem;
    color: var(--kv-ink);
    line-height: 1.1;
    letter-spacing: -.025em;
}

body.kv .kv-bento-tile.featured .kv-bento-val {
    color: #fff;
    font-size: 2rem;
}

body.kv .kv-bento-sub {
    font-size: .78rem;
    color: var(--kv-muted);
    margin-top: .5rem;
    line-height: 1.45;
}

body.kv .kv-bento-tile.featured .kv-bento-sub {
    color: rgba(255, 255, 255, .78);
}

/* --- form card (qz-form-card) --- */
body.kv .kv-login-card {
    position: relative;
    background: var(--kv-card);
    border: 1px solid var(--kv-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--kv-shadow-pop);
    max-width: 460px;
    width: 100%;
    justify-self: end;
}

body.kv .kv-login-card::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 24px;
    right: 24px;
    height: 1px;
    background: var(--kv-hairline-accent);
}

body.kv .kv-login-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-family: var(--kv-font-mono);
    font-size: .7rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--kv-primary);
    margin-bottom: .875rem;
    font-weight: 500;
}

body.kv .kv-login-eyebrow::before {
    content: "";
    width: 24px;
    height: 1.5px;
    background: var(--kv-primary);
}

body.kv .kv-login-card h2 {
    font-family: var(--kv-font-display);
    font-weight: 600;
    font-size: 1.875rem;
    color: var(--kv-ink);
    margin: 0 0 .375rem;
    letter-spacing: -.025em;
    line-height: 1.1;
}

body.kv .kv-login-card .kv-login-sub {
    font-size: .95rem;
    color: var(--kv-muted);
    margin: 0 0 1.75rem;
    line-height: 1.5;
}

body.kv .kv-field {
    margin-bottom: 1rem;
    text-align: left;
}

body.kv .kv-field > label {
    display: block;
    font-size: .82rem;
    font-weight: 600 !important;
    color: var(--kv-ink) !important;
    margin-bottom: .5rem;
    letter-spacing: -.005em;
}

body.kv .kv-field-wrap {
    display: flex;
    align-items: center;
    background: var(--kv-field);
    border: 1.5px solid var(--kv-border);
    border-radius: 10px;
    transition: border-color .15s, box-shadow .15s, background .15s;
    position: relative;
}

body.kv .kv-field-wrap:focus-within {
    border-color: var(--kv-primary);
    background: var(--kv-card);
    box-shadow: 0 0 0 4px var(--kv-tint);
}

body.kv .kv-field-wrap > svg {
    width: 18px;
    height: 18px;
    color: var(--kv-faint);
    margin-left: .875rem;
    flex-shrink: 0;
    transition: color .15s;
}

body.kv .kv-field-wrap:focus-within > svg {
    color: var(--kv-primary);
}

body.kv .kv-field-wrap input {
    flex: 1;
    width: 100%;
    padding: .85rem 1rem;
    border: none !important;
    background: transparent !important;
    font-family: var(--kv-font-ui);
    font-size: .95rem;
    color: var(--kv-ink) !important;
    outline: none !important;
    box-shadow: none !important;
    font-weight: 500;
    height: auto !important;
}

body.kv .kv-field-wrap.error,
body.kv .kv-field-wrap:has(input.input-error) {
    border-color: var(--kv-danger-dot);
}

body.kv .kv-field-wrap input.input-error {
    border: none !important;   /* the wrap carries the error border */
}

body.kv .kv-login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.25rem 0 1.5rem;
}

body.kv a.kv-forgot {
    color: var(--kv-primary) !important;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none !important;
}

body.kv a.kv-forgot:hover {
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

body.kv .kv-login-card .k-button,
body.kv .kv-login-card button[type="submit"]:not(.sso-button) {
    width: 100%;
    padding: .95rem 1.5rem;
    background: var(--kv-grad-btn) !important;
    color: var(--kv-on-primary) !important;
    border: none !important;
    border-radius: 10px !important;
    font-family: var(--kv-font-ui);
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: -.005em;
    box-shadow: var(--kv-shadow-primary);
    transition: transform .15s, box-shadow .15s;
}

body.kv .kv-login-card .k-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 8px 20px -2px rgba(var(--kv-primary-rgb), .45);
}

body.kv .kv-login-card .sso-divider {
    display: flex;
    align-items: center;
    gap: .875rem;
    margin: 1.25rem 0;
    font-family: var(--kv-font-mono);
    font-size: .7rem;
    color: var(--kv-faint);
    text-transform: uppercase;
    letter-spacing: .08em;
}

body.kv .kv-login-card .sso-divider::before,
body.kv .kv-login-card .sso-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--kv-border);
    border: none;
    position: static;
}

body.kv .kv-login-card .sso-section {
    width: auto;
    margin: 0;
}

body.kv .kv-login-card .sso-button {
    width: 100%;
    padding: .85rem 1.25rem;
    background: var(--kv-card) !important;
    border: 1.5px solid var(--kv-border) !important;
    color: var(--kv-ink) !important;
    border-radius: 10px;
    font-family: var(--kv-font-ui);
    font-size: .9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    transition: all .15s;
}

body.kv .kv-login-card .sso-button:hover {
    border-color: var(--kv-border-strong) !important;
    background: var(--kv-field) !important;
    box-shadow: none;
}

body.kv .kv-login-card .sso-button .sso-button-icon {
    color: var(--kv-primary);
}

body.kv .kv-login-foot {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--kv-border);
    font-size: .78rem;
    color: var(--kv-muted);
    text-align: center;
    line-height: 1.55;
    font-weight: 400 !important;
    background: none !important;
}

body.kv .kv-login .error,
body.kv .kv-login .error-text {
    color: var(--kv-danger);
}

/* ===================== §9 reports ===================== */

/* canned-report library: full-width multicol card + filter (no accordion,
   no scrolling side list — both explicitly rejected by stakeholders) */
body.kv .kv-report-lib {
    background: var(--kv-card);
    border: 1px solid var(--kv-border);
    border-radius: 14px;
    box-shadow: var(--kv-shadow-card);
    padding: 1.1rem 1.25rem 1.25rem;
    margin-bottom: 1.25rem;
    position: relative;
}

body.kv .kv-report-lib::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 20px;
    right: 20px;
    height: 1px;
    background: var(--kv-hairline-accent);
}

body.kv .kv-report-filter {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .75rem;
    background: var(--kv-field);
    border: 1.5px solid var(--kv-border);
    border-radius: var(--kv-r-panel);
    margin-bottom: 1rem;
    max-width: 420px;
}

body.kv .kv-report-filter:focus-within {
    border-color: var(--kv-primary);
    background: var(--kv-card);
    box-shadow: 0 0 0 4px var(--kv-tint);
}

body.kv .kv-report-filter svg {
    width: 15px;
    height: 15px;
    color: var(--kv-muted);
    flex-shrink: 0;
}

body.kv .kv-report-filter input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    outline: none;
    font-family: var(--kv-font-ui);
    font-size: .9rem !important;
    color: var(--kv-ink);
    padding: 0;
}

body.kv .kv-report-cols {
    columns: 3;
    column-gap: 2rem;
}

@media (max-width: 1250px) {
    body.kv .kv-report-cols {
        columns: 2;
    }
}

body.kv .kv-report-group {
    break-inside: avoid;
    margin-bottom: 1rem;
}

/* category heads read like the flyout panel heads: display face + icon */
body.kv .kv-report-group-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-family: var(--kv-font-display);
    font-size: .92rem;
    font-weight: 600;
    letter-spacing: -.015em;
    color: var(--kv-ink);
    padding: .15rem .5rem .45rem;
    margin-bottom: .3rem;
    border-bottom: 1px solid var(--kv-border-faint);
}

body.kv .kv-report-group-title svg {
    width: 15px;
    height: 15px;
    color: var(--kv-primary);
    flex-shrink: 0;
}

body.kv a.kv-report-link {
    display: block;
    padding: .32rem .5rem;
    border-radius: 6px;
    color: var(--kv-ink-soft) !important;
    font-size: .84rem;
    font-weight: 500;
    text-decoration: none !important;
    line-height: 1.35;
    cursor: pointer;
}

body.kv a.kv-report-link:hover {
    background: var(--kv-tint);
    color: var(--kv-primary) !important;
}

body.kv a.kv-report-link.kv-active {
    background: var(--kv-tint);
    color: var(--kv-primary) !important;
    box-shadow: inset 0 0 0 1px var(--kv-tint-strong);
}

/* params pin to viewport top on selection (selectReport smooth-scrolls here) */
body.kv #reportInfo {
    min-height: calc(100vh - 70px);
    scroll-margin-top: .75rem;
}

/* Canned Reports param dividers: one rule replaces the legacy hardcoded
   <hr color="#39abff" size="1"> blue divider in every ReportViewer/Reports/*.cshtml
   with a themed hairline. CSS outranks the obsolete presentational color/size attrs,
   so this themes all report params even before those attrs are stripped. */
body.kv #reportInfo hr {
    border: 0;
    border-top: 1px solid var(--kv-border);
    height: 0;
    color: transparent;
}

/* "Canned Reports > <title>" breadcrumb, prepended to #reportName by Index.cshtml JS.
   Sits inline before the floated title; the crumb link hops back to the library. */
body.kv #reportInfo .kv-report-crumb {
    float: left;
    font-size: 18px;
    color: var(--kv-primary);
    text-decoration: none;
    cursor: pointer;
}
body.kv #reportInfo .kv-report-crumb:hover {
    text-decoration: underline;
}
body.kv #reportInfo .kv-report-crumb-sep {
    float: left;
    font-size: 18px;
    color: var(--kv-muted);
    margin: 0 .45rem;
}

/* Empty-state in the report region until a report is run (Index.cshtml kvReportEmptyHtml).
   Fills the reserved pin space below the criteria so it doesn't look vacant. */
body.kv #reportView .kv-report-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    text-align: center;
    color: var(--kv-muted);
    font-family: var(--kv-font-ui);
    font-size: .9rem;
}
body.kv #reportView .kv-report-empty svg {
    width: 48px;
    height: 48px;
    color: var(--kv-faint);
    margin-bottom: .9rem;
}
body.kv #reportView .kv-report-empty b {
    color: var(--kv-ink-soft);
    font-weight: 600;
}

/* Quartz decorative orb, bottom-right of every themed page — born on the
   report pages, promoted site-wide by stakeholder request (June 2026) */
body.kv::after {
    content: "";
    position: fixed;
    right: -120px;
    bottom: -120px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(circle, rgba(var(--kv-primary-rgb), .07) 0%, transparent 65%);
}

/* ===================== §10 dashboard ===================== */

body.kv #left,
body.kv #right {
    background: transparent;
}

body.kv .dashboardTop div {
    background: transparent;
}

/* ===================== §11 misc widgets ===================== */

body.kv .kv-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .7rem;
    background: var(--kv-tint);
    color: var(--kv-primary);
    border: 1px solid var(--kv-tint-border);
    border-radius: var(--kv-r-pill);
    font-family: var(--kv-font-mono);
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .04em;
}

/* "Checking Notifications" status pill — keyed on the kv-checking wrapper
   class (the Kendo Loader can't carry this UI; it is hidden by §12).
   The radar ping is intentionally NOT gated behind prefers-reduced-motion:
   it is a required working-indicator. */
body.kv .kv-checking {
    display: inline-flex !important;
    align-items: center;
    gap: .45rem;
    padding: .3rem .75rem;
    background: var(--kv-tint);
    color: var(--kv-primary);
    border: 1px solid var(--kv-tint-border);
    border-radius: var(--kv-r-pill);
    font-family: var(--kv-font-mono);
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .04em;
    vertical-align: middle;
}

body.kv .kv-checking::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--kv-primary);
    animation: kvPing 1.6s ease-in-out infinite;
}

body.kv .kv-checking .k-loader {
    display: none !important;
}

@keyframes kvPing {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--kv-primary-rgb), .35); opacity: 1; }
    50%      { box-shadow: 0 0 0 5px rgba(var(--kv-primary-rgb), 0);  opacity: .55; }
}

/* ===================== §12 legacy chrome class overrides =====================
   The legacy stylesheets stay loaded (rollback story); this layer re-maps the
   blue-era chrome onto tokens. Retune values here, never delete selectors. */

body.kv .wholeTopMenuContainer {
    background: none;
}

/* legacy ASP.NET menu strips (still emitted on a few admin pages) */
body.kv .menuWrapper,
body.kv .staticMenu {
    background-color: var(--kv-wash);
    font-family: var(--kv-font-ui);
}

body.kv .staticMenuItem {
    color: var(--kv-ink) !important;
    border-right: 1px solid var(--kv-card);
}

body.kv .staticHover,
body.kv .dynamicHover,
body.kv .dynamicSelected {
    background-color: var(--kv-tint) !important;
    color: var(--kv-primary) !important;
}

body.kv .dynamicMenuItem {
    background-color: var(--kv-card);
    border-color: var(--kv-border);
}

/* tables */
body.kv table.normalTable {
    border: 1px solid var(--kv-border);
}

body.kv tr.listTableHeader {
    background-color: var(--kv-wash) !important;
    color: var(--kv-ink);
}

body.kv tr.listTableHeader td,
body.kv tr.listTableHeader th,
body.kv tr.listTableHeader a {
    color: var(--kv-ink) !important;
}

body.kv table.resultTable {
    background-color: var(--kv-card);
    border: 1px solid var(--kv-border);
}

body.kv tr.resultTableHeader td,
body.kv tr.resultTableHeader th,
body.kv tr.resultTableHeader * {
    background: var(--kv-wash) !important;
    color: var(--kv-ink) !important;
}

body.kv tr.resultTableRowSelectableAlternate,
body.kv tr.AlterRow {
    background-color: var(--kv-field) !important;
}

body.kv .alternateRows tr:nth-child(even),
body.kv .alternateRows tr:nth-child(odd) {
    border-color: var(--kv-border);
}

body.kv .gridViewHover,
body.kv .gridViewHoverAlt {
    background-color: var(--kv-wash) !important;
}

body.kv .gridViewHoverSelect {
    background-color: var(--kv-tint) !important;
}

body.kv .detailHeader {
    background-color: var(--kv-wash);
    color: var(--kv-ink);
}

/* the actions strip appears on non-timesheet pages too (Leave Request…):
   the legacy #d9ecf5 band becomes a white toolbar card. The timesheet page
   re-flattens it inside its own header card (id-scoped rule wins). */
body.kv .TimesheetSubTab {
    background-color: var(--kv-card);
    border: 1px solid var(--kv-border);
    border-radius: var(--kv-r-panel);
    padding: .4rem .6rem;
    box-shadow: var(--kv-shadow-card);
}

body.kv .TimesheetSubTabItem a.boldsearch {
    border-radius: 6px;
}

/* legacy tab graphics */
body.kv .tabOn {
    background-color: var(--kv-primary) !important;
    background-image: none !important;
}

body.kv .tabOff {
    background-color: var(--kv-muted);
    background-image: none !important;
}

body.kv .tabOn a, body.kv .tabOff a {
    color: var(--kv-on-primary);
}

/* bootstrap nav-tabs (custom LATS pattern) → Quartz underline tabs */
body.kv .nav-tabs {
    font-family: var(--kv-font-ui) !important;
    border-bottom: 1px solid var(--kv-border);
}

body.kv .nav-tabs > li > a {
    border: none !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0;
    margin-bottom: -1px;
    padding: 8px 14px;
    color: var(--kv-muted);
    font-size: .86rem;
    font-weight: 500;
    background: none;
}

body.kv .nav-tabs > li > a:hover {
    background-color: transparent !important;
    color: var(--kv-ink) !important;
    border-bottom-color: var(--kv-border-strong) !important;
}

body.kv .nav-tabs > li.active > a,
body.kv .nav-tabs > li.active > a:hover,
body.kv .nav-tabs > li.active > a:focus {
    color: var(--kv-primary) !important;
    background: none !important;
    border: none !important;
    border-bottom: 2px solid var(--kv-primary) !important;
    font-weight: 600;
}

body.kv .tabContent,
body.kv .contentBox {
    border-color: var(--kv-border);
    border-left-width: 1px;
    background: var(--kv-card);
    border-radius: 0 0 var(--kv-r-panel) var(--kv-r-panel);
}

/* Code-maintenance pages (Search / Add / Modify tabs): the tab panel and the
   inner form/search wrapper draw borders that read as redundant nested boxes on
   top of the controls' own chrome. Drop them on these pages only — anchored on
   #SearchTabItem, which the _TabMenu* strips render on every tab of this page
   family, so other tabbed pages (e.g. timesheet) keep their panel. Grids keep
   their border (:not(.k-grid)). Mirrors the existing timesheet :has() opt-out. */
body.kv .container:has(#SearchTabItem) .tabContent {
    border: none;
}

/* On the SEARCH tab the .k-widget wraps the search box + grid (which carry their
   own chrome), so keep it borderless. The shared search component renders #SearchRow. */
body.kv .container:has(#SearchTabItem):has(#SearchRow) table.k-widget {
    border: none;
}

/* On the ADD / MODIFY tabs (no #SearchRow) the .k-widget wraps the edit fields:
   give it a consistent white field fill across every code-maintenance form. No
   border — the fields sit on the white panel without a nested grey box (stakeholder
   direction). Applied globally to the wrapper tables; the EditForm wrapper DIVs are
   targeted by id (a bare div.k-widget would also hit Kendo widgets). */
body.kv .container:has(#SearchTabItem):not(:has(#SearchRow)) table.k-widget,
body.kv #EditCostCenter > div.k-widget,
body.kv #EditObjectCode > div.k-widget,
body.kv #EditAutoHolidayPaymentCodeForm > div.k-widget {
    border: none;
    border-radius: var(--kv-r-panel, 10px);
    background: var(--kv-card, #fff);
}

body.kv .searchRow {
    border: none;
    background: var(--kv-card);
}

body.kv .corners {
    border-color: var(--kv-border);
    border-radius: var(--kv-r-panel);
    background: var(--kv-card);
}

/* modals & misc panels */
body.kv .modalPopup,
body.kv .modalPopupBalance {
    border-color: var(--kv-border);
    border-radius: var(--kv-r-card);
    background: var(--kv-card);
    box-shadow: var(--kv-shadow-pop);
}

body.kv .modalPopupHeader {
    background-color: var(--kv-wash);
    color: var(--kv-ink);
}

body.kv .wizardStepDescription {
    border: 1px solid var(--kv-border);
    background-color: var(--kv-field);
    border-radius: var(--kv-r-panel);
}

body.kv .LatsLightBlueBackground {
    background-color: var(--kv-wash);
}

body.kv .LatsBorderWithRoundedCorners {
    border: 1px solid var(--kv-border);
    border-radius: var(--kv-r-panel);
}

body.kv .dynamicTable {
    background: var(--kv-wash);
}

body.kv .rowOn {
    color: var(--kv-on-primary);
    background-color: var(--kv-primary);
}

body.kv .rowOff {
    background-color: var(--kv-wash);
}

/* homepage legacy bits (some admin pages still emit them) */
body.kv td.homepageTableHeader {
    border-color: var(--kv-border);
    background-image: none;
    background-color: var(--kv-wash);
    color: var(--kv-ink);
}

body.kv td.homepageTableContent {
    background-color: var(--kv-card);
}

body.kv a.homepageLink:hover,
body.kv a.homepageContentLink:hover {
    color: var(--kv-primary);
}

body.kv .scheduleByDayHeader {
    background-color: var(--kv-wash);
    color: var(--kv-ink);
}

body.kv .scheduleByDayNameAlt {
    background-color: var(--kv-wash);
}

body.kv .scheduleByDayOff {
    background-color: var(--kv-field);
}

/* form field states */
body.kv .disabledField {
    background-color: var(--kv-wash);
}

body.kv .enabledField {
    background-color: var(--kv-card);
}

body.kv .readonlyField {
    color: var(--kv-muted);
}

body.kv .input-field-label {
    color: var(--kv-ink-soft) !important;
}

body.kv .input-field {
    border: 1px solid var(--kv-border-strong);
    border-radius: var(--kv-r-ctl);
    color: var(--kv-ink) !important;
}

body.kv .has-error {
    border-color: var(--kv-danger-dot) !important;
}

/* ===================== §13 inline-style neutralizers =====================
   Legacy views carry inline colors at 4+ render sites. Attribute selectors
   re-map them without touching ~98 views. Keep under @media screen so print
   and email rendering stay legacy. */
@media screen {
    body.kv [style*="#d9ecf5" i],
    body.kv [style*="#bbdceb" i],
    body.kv [style*="#c6e2ee" i] {
        background-color: var(--kv-wash) !important;
        border-color: var(--kv-border) !important;
    }

    body.kv [style*="background-color: #f9f9f9" i],
    body.kv [style*="background: #f9f9f9" i] {
        background-color: var(--kv-field) !important;
    }

    body.kv input[style*="lightgray" i],
    body.kv input[style*="background-color: lightgrey" i] {
        background-color: var(--kv-wash) !important;
        color: var(--kv-ink-soft) !important;
    }

    body.kv [style*="color:#00435e" i],
    body.kv [style*="color: #00435e" i] {
        color: var(--kv-primary) !important;
    }

    body.kv [style*="color:#555555" i],
    body.kv [style*="color: #555555" i] {
        color: var(--kv-ink-soft) !important;
    }

    body.kv [style*="color:#0066b3" i],
    body.kv [style*="color: #0066b3" i] {
        color: var(--kv-primary) !important;
    }

    /* timesheet totals carry inline white borders */
    body.kv td[id^="totalRow"] {
        border-color: var(--kv-border) !important;
    }

    /* numeric cells outside the punch grid (Work Totals, Balances & Earnings)
       share the grid's numeric font (--kv-font-num) so every hours/accrual value
       on the timesheet reads as one consistent set. Column labels/headers are
       left untagged and stay in the UI font. */
    body.kv .kv-num {
        font-family: var(--kv-font-num);
        font-variant-numeric: tabular-nums;
    }
}

/* Legacy help / info icons (Images/help2.gif AND about.gif, used as <img> across
   the app): replace both blue-gradient gifs with ONE clean themed help-circle so
   every help/info affordance looks identical, app-wide, without touching markup.
   The indigo literal is fine here — the rule is gated to body.kv, so theme-off
   falls back to the original gifs (rollback intact); a data-URI SVG can't read
   CSS vars. */
body.kv img[src*="help2.gif" i],
body.kv img[src*="about.gif" i] {
    content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234338ca' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M9.09 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3'/><line x1='12' y1='17' x2='12.01' y2='17'/></svg>");
    width: 16px;
    height: 16px;
    vertical-align: middle;
    cursor: pointer;
}

/* ===================== §14 focus / motion ===================== */

/* visually hidden, still in the DOM and the accessibility tree's text */
body.kv .kv-vh {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.kv :focus-visible {
    outline: 2px solid var(--kv-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Selection tint. NOTE the deliberately missing space: `body.kv::selection` puts the
   highlight pseudo ON body, and ::selection styles reach every descendant through
   highlight inheritance — same visual, zero per-node cost. The original
   `body.kv ::selection` (universal descendant subject) forced highlight style
   resolution on all ~7.5k timesheet nodes during EVERY style recalculation —
   measured at +3ms per relayout pass, ~29% of the grid's total (axod:21352).
   Do not put the space back. */
body.kv::selection {
    background: var(--kv-tint-strong);
}

@media (prefers-reduced-motion: reduce) {
    body.kv .kv-side,
    body.kv .kv-login-form .k-button {
        transition: none;
    }
    /* kvPing stays on: required working-indicator (see §11) */
}

/* ===================== §15 UserAdmin ===================== */

/* Employee name context banner shown above the tab strip on every UserAdmin tab. */
body.kv .kv-useradmin-name {
    color: var(--kv-primary);
    font-size: 18px;
    font-weight: bold;
}


/* Sticky mirror of a horizontal scrollbar that is below the fold -- see
   wwwroot/Scripts/stickyHScroll.js. The bars this stands in for belong to elements
   taller than the viewport (every .k-grid above, #ReadOnlyContent, #timesheetContainer,
   #tdsGridZone, .sched-scroll), so the real one is only reachable after scrolling to the
   bottom of the page. The script positions and shows this; it is hidden until then. */
body.kv .kv-hscroll {
    position: fixed;
    bottom: 0;
    z-index: 900;              /* over content, under Kendo windows/popups */
    height: 15px;
    overflow-x: auto;
    overflow-y: hidden;
    display: none;
    background: var(--kv-card, #fff);
    border-top: 1px solid var(--kv-border, #bbdceb);
}

body.kv .kv-hscroll.is-on {
    display: block;
}

body.kv .kv-hscroll > div {
    height: 1px;               /* only there to give the strip something to scroll */
}

/* Keep the strip entirely below the footer. The footer is itself fixed to bottom: 0
   (BodyAndFooterMvc.css), so a strip at bottom: 0 would sit ON it -- lift the footer by
   exactly the strip's height instead, and reserve the same at the foot of the document
   so the last row still clears both. Toggled by the script, not always-on, so pages with
   nothing to scroll keep every pixel. */
body.kv.kv-has-hscroll .footer {
    bottom: 16px;              /* 15px strip + its 1px top border */
}

body.kv.kv-has-hscroll {
    padding-bottom: 16px;
}

@media print {
    body.kv .kv-hscroll { display: none !important; }
}
