/*
 * DIAR-UI-2 Native Sidebar R4
 * Unified native-shell contract across every route and both directions.
 * The contract owns ONLY the two direct shell columns and the native sidebar.
 * It never adds body padding and never rewrites page/header/hero/card layouts.
 */
:root {
    --native-sidebar-width: 296px;
    --native-sidebar-mobile-width: min(88vw, 296px);
}

/* Root shell contract: one deterministic source of truth for all routes. */
@media (min-width: 761px) {
    html.native-sidebar-enhanced .elite-shell[data-native-shell-contract="R4"] {
        display: grid !important;
        grid-template-rows: minmax(100vh, auto) !important;
        align-items: start !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 0 !important;
        position: relative !important;
        overflow: visible !important;
        direction: ltr !important;
        box-sizing: border-box !important;
        isolation: isolate !important;
    }
    html[dir="ltr"].native-sidebar-enhanced .elite-shell[data-native-shell-contract="R4"] {
        grid-template-columns: var(--native-sidebar-width) minmax(0, 1fr) !important;
        grid-template-areas: "native-sidebar native-main" !important;
    }
    html[dir="rtl"].native-sidebar-enhanced .elite-shell[data-native-shell-contract="R4"] {
        grid-template-columns: minmax(0, 1fr) var(--native-sidebar-width) !important;
        grid-template-areas: "native-main native-sidebar" !important;
    }
    html.native-sidebar-enhanced .elite-shell[data-native-shell-contract="R4"] > .elite-sidebar[data-native-sidebar-contract="R4"] {
        grid-area: native-sidebar !important;
        position: sticky !important;
        inset: auto !important;
        inset-block-start: 0 !important;
        width: var(--native-sidebar-width) !important;
        min-width: var(--native-sidebar-width) !important;
        max-width: var(--native-sidebar-width) !important;
        flex: 0 0 var(--native-sidebar-width) !important;
        margin: 0 !important;
        transform: none !important;
        translate: none !important;
        clip-path: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 30 !important;
    }
    html.native-sidebar-enhanced .elite-shell[data-native-shell-contract="R4"] > .elite-main[data-native-main-contract="R4"] {
        grid-area: native-main !important;
        position: relative !important;
        inset: auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
        transform: none !important;
        translate: none !important;
        flex: none !important;
    }
    html[dir="ltr"].native-sidebar-enhanced .elite-shell[data-native-shell-contract="R4"] > .elite-main[data-native-main-contract="R4"] { direction: ltr !important; }
    html[dir="rtl"].native-sidebar-enhanced .elite-shell[data-native-shell-contract="R4"] > .elite-main[data-native-main-contract="R4"] { direction: rtl !important; }
}

/* Neutralize all historical collapsed states without touching page content. */
html.native-sidebar-enhanced .elite-sidebar[data-native-sidebar-contract="R4"],
html.native-sidebar-enhanced body.sidebar-collapsed .elite-sidebar[data-native-sidebar-contract="R4"],
html.native-sidebar-enhanced body.sidebar-mini .elite-sidebar[data-native-sidebar-contract="R4"],
html.native-sidebar-enhanced .elite-shell.sidebar-collapsed > .elite-sidebar[data-native-sidebar-contract="R4"],
html.native-sidebar-enhanced .elite-shell.sidebar-mini > .elite-sidebar[data-native-sidebar-contract="R4"] {
    display: flex !important;
}
html.native-sidebar-enhanced .elite-sidebar[data-native-sidebar-contract="R4"] .elite-brand > span,
html.native-sidebar-enhanced .elite-sidebar[data-native-sidebar-contract="R4"] .native-nav-group-toggle > *,
html.native-sidebar-enhanced .elite-sidebar[data-native-sidebar-contract="R4"] .native-nav-item > * {
    visibility: visible !important;
    opacity: 1 !important;
}
html.native-sidebar-enhanced .elite-sidebar[data-native-sidebar-contract="R4"] .native-nav-group.is-open > .native-nav-group-items { display: block !important; }
html.native-sidebar-enhanced .elite-sidebar[data-native-sidebar-contract="R4"] .native-nav-group:not(.is-open) > .native-nav-group-items { display: none !important; }

.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] {
    --native-nav-text: #17324a;
    --native-nav-muted: #667d91;
    --native-nav-border: #d9e5ee;
    --native-nav-surface: rgba(255, 255, 255, 0.96);
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 0 !important;
    overflow: hidden !important;
    scrollbar-width: none !important;
    overscroll-behavior: none !important;
    background:
        radial-gradient(circle at 12% 8%, rgba(23, 184, 176, 0.12), transparent 24%),
        radial-gradient(circle at 92% 72%, rgba(93, 93, 226, 0.10), transparent 28%),
        linear-gradient(180deg, #fbfdff 0%, #f3f8fc 54%, #edf5fa 100%) !important;
    color: var(--native-nav-text) !important;
    border: 0 !important;
    box-sizing: border-box !important;
}
html[dir="ltr"] .elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] {
    direction: ltr !important;
    text-align: left !important;
    border-inline-end: 1px solid rgba(143,171,191,.32) !important;
    box-shadow: 10px 0 32px rgba(20,56,82,.08) !important;
}
html[dir="rtl"] .elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] {
    direction: rtl !important;
    text-align: right !important;
    border-inline-start: 1px solid rgba(143,171,191,.32) !important;
    box-shadow: -10px 0 32px rgba(20,56,82,.08) !important;
}
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"]::-webkit-scrollbar,
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav::-webkit-scrollbar { display:none !important; width:0 !important; height:0 !important; }

.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .elite-brand {
    display:flex !important;
    flex:0 0 auto !important;
    margin:12px 12px 8px !important;
    padding:11px 11px 12px !important;
    min-height:90px !important;
    border-radius:20px !important;
    background:rgba(255,255,255,.82) !important;
    border:1px solid rgba(164,188,205,.36) !important;
    box-shadow:0 8px 24px rgba(24,67,96,.07) !important;
    color:var(--native-nav-text) !important;
}
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .elite-brand-mark { display:grid !important; background:linear-gradient(145deg,#fff,#edf8fb)!important; border:1px solid rgba(23,184,176,.28)!important; box-shadow:0 7px 18px rgba(37,115,145,.12)!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .elite-brand strong { display:block !important; color:#102b43!important; font-size:22px!important; letter-spacing:.01em; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .elite-brand small { display:block !important; color:#60768a!important; font-size:11.5px!important; line-height:1.4!important; font-weight:700!important; }

.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav {
    display:block !important;
    flex:1 1 auto !important;
    min-height:0 !important;
    overflow:hidden !important;
    padding:5px 10px 10px !important;
    margin:0 !important;
}
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-group { --group-accent:#11b8ae; --group-rgb:17,184,174; display:block!important; margin:0 0 6px!important; padding:0!important; border:0!important; background:transparent!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-group--leadership { --group-accent:#0bb9b0; --group-rgb:11,185,176; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-group--finance { --group-accent:#20ad62; --group-rgb:32,173,98; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-group--clinical { --group-accent:#347fec; --group-rgb:52,127,236; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-group--medication { --group-accent:#8155e8; --group-rgb:129,85,232; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-group--system { --group-accent:#607c91; --group-rgb:96,124,145; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-group-toggle {
    position:relative !important;
    display:grid !important;
    grid-template-columns:38px minmax(0,1fr) auto 16px !important;
    align-items:center !important;
    width:100% !important;
    min-width:0 !important;
    min-height:50px !important;
    gap:8px !important;
    padding:6px 10px 6px 8px !important;
    border:1px solid var(--native-nav-border) !important;
    border-radius:16px !important;
    background:var(--native-nav-surface) !important;
    color:var(--native-nav-text) !important;
    box-shadow:0 4px 13px rgba(30,71,99,.04) !important;
    cursor:pointer !important;
    text-align:start !important;
    font:inherit !important;
}
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-group-toggle::before { content:""; position:absolute; inset-block:9px; inset-inline-start:-1px; width:4px; border-radius:0 5px 5px 0; background:var(--group-accent); opacity:.65; }
html[dir="rtl"] .elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-group-toggle::before { border-radius:5px 0 0 5px; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-group-toggle:hover,
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-group-toggle:focus-visible,
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-group.is-open .native-nav-group-toggle { border-color:rgba(var(--group-rgb),.43)!important; background:linear-gradient(100deg,rgba(var(--group-rgb),.12),rgba(255,255,255,.97) 62%)!important; box-shadow:0 8px 20px rgba(var(--group-rgb),.10)!important; outline:none!important; }
html[dir="rtl"] .elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-group.is-open .native-nav-group-toggle { background:linear-gradient(260deg,rgba(var(--group-rgb),.12),rgba(255,255,255,.97) 62%)!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-group-icon { display:grid!important; place-items:center!important; width:36px!important; height:36px!important; border-radius:12px!important; color:var(--group-accent)!important; background:rgba(var(--group-rgb),.10)!important; border:1px solid rgba(var(--group-rgb),.22)!important; font-size:17px!important; font-weight:900!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-group-toggle b { display:block!important; min-width:0!important; color:#17324a!important; font-size:14.5px!important; line-height:1.24!important; font-weight:850!important; white-space:normal!important; overflow:visible!important; text-overflow:clip!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-count { display:inline-grid!important; place-items:center!important; min-width:25px!important; height:25px!important; padding-inline:6px!important; border-radius:999px!important; background:rgba(var(--group-rgb),.10)!important; border:1px solid rgba(var(--group-rgb),.22)!important; color:var(--group-accent)!important; font-size:11.5px!important; font-weight:900!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-chevron { display:inline-block!important; color:#70879a!important; font-size:14px!important; line-height:1!important; transform:rotate(0)!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-group.is-open .native-nav-chevron { transform:rotate(180deg)!important; }

.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-group-items { position:relative!important; margin:4px 4px 0 18px!important; padding:1px 0 1px 10px!important; border-inline-start:1px solid rgba(var(--group-rgb),.25)!important; }
html[dir="rtl"] .elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-group-items { margin:4px 18px 0 4px!important; padding:1px 10px 1px 0!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-item { position:relative!important; display:grid!important; grid-template-columns:31px minmax(0,1fr) auto!important; align-items:center!important; gap:7px!important; min-width:0!important; min-height:39px!important; margin:2px 0!important; padding:4px 8px!important; border-radius:12px!important; border:1px solid transparent!important; background:transparent!important; color:#456075!important; box-shadow:none!important; text-decoration:none!important; transform:none!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-item::before { content:""; position:absolute; top:50%; inset-inline-start:-11px; width:9px; height:1px; background:rgba(var(--group-rgb),.28); }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-item:hover,
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-item:focus-visible { color:#17324a!important; background:rgba(var(--group-rgb),.08)!important; border-color:rgba(var(--group-rgb),.15)!important; outline:none!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-item.active { color:#fff!important; background:linear-gradient(112deg,var(--group-accent),rgba(var(--group-rgb),.78))!important; border-color:rgba(var(--group-rgb),.32)!important; box-shadow:0 8px 18px rgba(var(--group-rgb),.20)!important; }
html[dir="rtl"] .elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-item.active { background:linear-gradient(248deg,var(--group-accent),rgba(var(--group-rgb),.78))!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-item-icon { display:grid!important; place-items:center!important; width:30px!important; height:30px!important; border-radius:10px!important; background:rgba(var(--group-rgb),.08)!important; border:1px solid rgba(var(--group-rgb),.16)!important; color:var(--group-accent)!important; font-size:14px!important; line-height:1!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-item.active .native-nav-item-icon { color:#fff!important; background:rgba(255,255,255,.16)!important; border-color:rgba(255,255,255,.28)!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-item b { display:block!important; min-width:0!important; color:inherit!important; font-size:13px!important; line-height:1.22!important; font-weight:750!important; white-space:normal!important; overflow:visible!important; text-overflow:clip!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-item i { display:block!important; width:7px!important; height:7px!important; border-radius:50%!important; background:#fff!important; box-shadow:0 0 0 3px rgba(255,255,255,.16)!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-item em { padding:2px 6px!important; border-radius:999px!important; background:#edf2f6!important; color:#8495a4!important; font-size:9px!important; font-style:normal!important; font-weight:800!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-item.disabled { opacity:.55!important; cursor:not-allowed!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] > .elite-sidebar-card,
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] > .elite-sidebar-footer { display:none!important; }

/* Three deterministic density levels; items are never silently cropped. */
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-compact .elite-brand { min-height:74px!important; margin:8px 9px 5px!important; padding:8px 9px!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-compact .elite-brand strong { font-size:20px!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-compact .elite-brand small { font-size:10.5px!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-compact .native-nav { padding:3px 8px 7px!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-compact .native-nav-group { margin-bottom:4px!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-compact .native-nav-group-toggle { min-height:43px!important; grid-template-columns:32px minmax(0,1fr) auto 13px!important; padding:4px 7px!important; gap:6px!important; border-radius:14px!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-compact .native-nav-group-icon { width:31px!important; height:31px!important; font-size:14px!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-compact .native-nav-group-toggle b { font-size:13px!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-compact .native-nav-count { min-width:22px!important; height:22px!important; font-size:10px!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-compact .native-nav-item { min-height:33px!important; grid-template-columns:26px minmax(0,1fr) auto!important; padding:3px 6px!important; margin:1px 0!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-compact .native-nav-item-icon { width:25px!important; height:25px!important; font-size:11px!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-compact .native-nav-item b { font-size:11.7px!important; }

.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-ultra .elite-brand { min-height:58px!important; margin:5px 8px 4px!important; padding:5px 8px!important; border-radius:16px!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-ultra .elite-brand-mark { width:44px!important; height:44px!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-ultra .elite-brand strong { font-size:18px!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-ultra .elite-brand small { font-size:9.5px!important; line-height:1.2!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-ultra .native-nav { padding:2px 7px 5px!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-ultra .native-nav-group { margin-bottom:3px!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-ultra .native-nav-group-toggle { min-height:37px!important; grid-template-columns:28px minmax(0,1fr) auto 11px!important; padding:3px 6px!important; gap:5px!important; border-radius:12px!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-ultra .native-nav-group-icon { width:27px!important; height:27px!important; border-radius:9px!important; font-size:12px!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-ultra .native-nav-group-toggle b { font-size:11.5px!important; line-height:1.15!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-ultra .native-nav-count { min-width:19px!important; height:19px!important; padding-inline:4px!important; font-size:9px!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-ultra .native-nav-item { min-height:28px!important; grid-template-columns:22px minmax(0,1fr) auto!important; padding:2px 5px!important; margin:0!important; border-radius:9px!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-ultra .native-nav-item-icon { width:21px!important; height:21px!important; border-radius:7px!important; font-size:10px!important; }
.elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"].native-sidebar-height-ultra .native-nav-item b { font-size:10.5px!important; line-height:1.12!important; }

@media (max-width: 760px) {
    html.native-sidebar-enhanced .elite-shell[data-native-shell-contract="R4"] { display:block!important; width:100%!important; min-width:0!important; margin:0!important; padding:0!important; }
    html.native-sidebar-enhanced .elite-shell[data-native-shell-contract="R4"] > .elite-main[data-native-main-contract="R4"] { width:100%!important; min-width:0!important; max-width:none!important; margin:0!important; transform:none!important; }
    html.native-sidebar-enhanced .elite-shell[data-native-shell-contract="R4"] > .elite-sidebar[data-native-sidebar-contract="R4"] {
        position:fixed!important;
        inset-block:0!important;
        width:var(--native-sidebar-mobile-width)!important;
        min-width:var(--native-sidebar-mobile-width)!important;
        max-width:var(--native-sidebar-mobile-width)!important;
        height:100dvh!important;
        max-height:100dvh!important;
        z-index:1200!important;
        transition:transform 180ms ease!important;
    }
    html[dir="ltr"].native-sidebar-enhanced .elite-shell[data-native-shell-contract="R4"] > .elite-sidebar[data-native-sidebar-contract="R4"] { inset-inline-start:0!important; inset-inline-end:auto!important; transform:translateX(-104%)!important; }
    html[dir="rtl"].native-sidebar-enhanced .elite-shell[data-native-shell-contract="R4"] > .elite-sidebar[data-native-sidebar-contract="R4"] { inset-inline-start:auto!important; inset-inline-end:0!important; transform:translateX(104%)!important; }
    html.native-sidebar-enhanced body.sidebar-open .elite-shell[data-native-shell-contract="R4"] > .elite-sidebar[data-native-sidebar-contract="R4"] { transform:translateX(0)!important; }
}

@media (prefers-reduced-motion: reduce) {
    .elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"],
    .elite-sidebar.native-sidebar-skin[data-native-sidebar-contract="R4"] .native-nav-chevron { transition:none!important; }
}
