/* shell.css — level-aware AppShell and navigation surfaces (TASK-NAV-030..036, 041, 043).
   Colours and sizes only through tokens.css variables (DR-51); logical properties for RTL (DR-60); targets per DR-53;
   focus ring per DR-55. Loaded after tokens.css; only affects elements under .hrms-shell, .hrms-cc and .hrms-quick-switch. */

/* ---------- Shell grid ---------- */
.hrms-shell {
    display: grid;
    min-height: 100vh;
    background: var(--hrms-color-bg-canvas);
    color: var(--hrms-color-text-primary);
    font-family: var(--hrms-font-family, 'Cairo', sans-serif);
    grid-template-columns: var(--hrms-nav-width-expanded) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas:
        "nav top"
        "nav banner"
        "nav main"
        "nav footer";
}

.hrms-shell[data-layout="rail"] {
    grid-template-columns: var(--hrms-nav-width-rail) minmax(0, 1fr);
}

.hrms-shell[data-layout="horizontal"] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "top"
        "banner"
        "main"
        "footer";
}

.hrms-shell__nav {
    grid-area: nav;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    background: var(--hrms-color-bg-surface);
    border-inline-end: 1px solid var(--hrms-color-border-subtle);
    z-index: 20;
}

.hrms-shell__top {
    grid-area: top;
    position: sticky;
    top: 0;
    z-index: 15;
    background: var(--hrms-color-bg-surface);
    border-block-end: 1px solid var(--hrms-color-border-subtle);
}

.hrms-shell__main {
    grid-area: main;
    padding: var(--hrms-section-gap) var(--hrms-content-gutter);
    min-width: 0;
    outline: none;
}

.hrms-shell[data-layout="sidebar"] .hrms-shell__main > *,
.hrms-shell[data-layout="rail"] .hrms-shell__main > * {
    max-width: 1092px;
    margin-inline: auto;
}

.hrms-shell[data-layout="horizontal"] .hrms-shell__main {
    padding-inline: 64px;
}

.hrms-shell__footer {
    grid-area: footer;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 12px var(--hrms-content-gutter);
    color: var(--hrms-color-text-muted);
    font-size: 13px;
    border-block-start: 1px solid var(--hrms-color-border-subtle);
}

.hrms-shell__footer-end {
    margin-inline-start: auto;
}

.hrms-skip-link {
    position: absolute;
    inset-inline-start: 8px;
    inset-block-start: -48px;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    min-block-size: 44px;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--hrms-color-bg-inverse);
    color: var(--hrms-color-text-inverse);
}

.hrms-skip-link:focus {
    inset-block-start: 8px;
}

/* ---------- Focus ring (DR-55) ---------- */
.hrms-shell a:focus-visible,
.hrms-shell button:focus-visible,
.hrms-shell input:focus-visible,
.hrms-cc a:focus-visible,
.hrms-cc button:focus-visible,
.hrms-cc input:focus-visible,
.hrms-quick-switch button:focus-visible {
    outline: 2px solid var(--hrms-color-border-focus);
    outline-offset: 2px;
}

.hrms-flip-rtl {
    display: inline-block;
}

[dir="rtl"] .hrms-flip-rtl,
.mud-application-layout-rtl .hrms-flip-rtl,
.rtl .hrms-flip-rtl {
    transform: scaleX(-1);
}

/* ---------- Sidebar ---------- */
.hrms-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.hrms-sidebar__brand,
.hrms-rail__brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 64px;
    padding: 12px 16px;
}

/* RW-07: the narrow rail stacks the emblem above the expand button. */
.hrms-rail__brand {
    flex-direction: column;
    justify-content: center;
    padding-inline: 0;
}

.hrms-sidebar__logo {
    max-height: 40px;
    max-width: 160px;
}

.hrms-sidebar__scroll {
    flex: 1;
    overflow-y: auto;
    padding: 4px 12px 24px;
    display: flex;
    flex-direction: column;
    gap: var(--hrms-nav-item-gap);
}

.hrms-band-label {
    padding: var(--hrms-nav-band-padding-top) 12px 6px;
    color: var(--hrms-color-text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hrms-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: max(var(--hrms-nav-item-height), var(--hrms-target-min));
    padding-inline: 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--hrms-color-text-primary);
    font: inherit;
    font-size: var(--hrms-type-body);
    text-align: start;
    text-decoration: none;
    cursor: pointer;
}

.hrms-nav-item--sub {
    min-height: max(var(--hrms-nav-sub-height), 36px);
    padding-inline-start: 44px;
    color: var(--hrms-color-text-secondary);
    font-size: calc(var(--hrms-type-body) - 2px);
}

.hrms-nav-item--depth-2 {
    padding-inline-start: 60px;
}

.hrms-nav-item:hover {
    background: var(--hrms-color-bg-subtle);
}

.hrms-nav-item--active {
    background: var(--hrms-color-bg-selected);
    color: var(--hrms-color-text-brand);
    font-weight: 600;
}

.hrms-nav-item--on-path {
    color: var(--hrms-color-text-brand);
    font-weight: 600;
}

.hrms-nav-item__label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hrms-nav-item__icon {
    flex: none;
    color: currentColor;
}

.hrms-nav-item__chevron {
    flex: none;
    color: var(--hrms-color-text-muted);
}

.hrms-count-pill {
    flex: none;
    box-sizing: border-box;
    min-width: 20px;
    height: 20px;
    white-space: nowrap;
    padding-inline: 6px;
    border-radius: 999px;
    background: var(--hrms-color-action-primary);
    color: var(--hrms-color-text-inverse);
    font-size: 11px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
}

.hrms-count-pill--overlay {
    position: absolute;
    inset-block-start: 2px;
    inset-inline-end: 0;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    font-size: 10px;
}

.hrms-workspace-switcher {
    display: flex;
    gap: 4px;
    margin: 0 12px 8px;
    padding: 4px;
    border-radius: 10px;
    background: var(--hrms-color-bg-subtle);
}

.hrms-workspace-switcher__tab {
    flex: 1;
    min-height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--hrms-color-text-secondary);
    cursor: pointer;
}

.hrms-workspace-switcher__tab.is-selected {
    background: var(--hrms-color-bg-surface);
    color: var(--hrms-color-text-brand);
    box-shadow: var(--hrms-shadow-card);
}

/* ---------- Rail and flyout ---------- */
.hrms-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.hrms-rail__list {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    overflow-y: auto;
}

.hrms-rail__entry {
    position: relative;
}

.hrms-rail__divider {
    width: 32px;
    height: 1px;
    margin: 6px 0;
    background: var(--hrms-color-border-subtle);
}

.hrms-rail__button,
.hrms-icon-button--rail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--hrms-color-text-primary);
    cursor: pointer;
}

.hrms-rail__button:hover {
    background: var(--hrms-color-bg-subtle);
}

.hrms-rail__button.is-active {
    background: var(--hrms-color-bg-selected);
    color: var(--hrms-color-text-brand);
}

.hrms-rail__tooltip {
    position: absolute;
    inset-inline-start: calc(100% + 8px);
    inset-block-start: 50%;
    transform: translateY(-50%);
    z-index: 40;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--hrms-color-bg-inverse);
    color: var(--hrms-color-text-inverse);
    font-size: 13px;
    white-space: nowrap;
    pointer-events: none;
}

.hrms-rail__footer {
    padding: 8px 0 16px;
}

.hrms-flyout {
    position: absolute;
    inset-inline-start: calc(100% + 8px);
    inset-block-start: 0;
    z-index: 40;
    min-width: 240px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--hrms-color-border-subtle);
    border-radius: 12px;
    background: var(--hrms-color-bg-surface);
    box-shadow: var(--hrms-shadow-overlay);
}

.hrms-flyout__title,
.hrms-flyout__group-title,
.hrms-mega-menu__title {
    padding: 8px 10px 4px;
    color: var(--hrms-color-text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hrms-flyout__link,
.hrms-dropdown__item,
.hrms-mega-menu__link {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--hrms-color-text-primary);
    font: inherit;
    font-size: 14px;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
    width: 100%;
}

.hrms-flyout__link:hover,
.hrms-dropdown__item:hover,
.hrms-mega-menu__link:hover {
    background: var(--hrms-color-bg-subtle);
}

.hrms-flyout__link.is-active,
.hrms-dropdown__item.is-active,
.hrms-mega-menu__link.is-active {
    background: var(--hrms-color-bg-selected);
    color: var(--hrms-color-text-brand);
    font-weight: 600;
}

/* ---------- Horizontal and mega menu ---------- */
.hrms-hnav {
    padding-inline: 64px;
    border-block-start: 1px solid var(--hrms-color-border-subtle);
}

.hrms-hnav__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-height: 48px;
}

.hrms-hnav__row--second {
    border-block-start: 1px solid var(--hrms-color-border-subtle);
    min-height: 44px;
}

.hrms-hnav__tab-wrap,
.hrms-hnav__workspace {
    position: relative;
}

.hrms-hnav__tab,
.hrms-hnav__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding-inline: 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--hrms-color-text-secondary);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.hrms-hnav__tab:hover,
.hrms-hnav__link:hover {
    background: var(--hrms-color-bg-subtle);
}

.hrms-hnav__tab.is-active,
.hrms-hnav__link.is-active {
    color: var(--hrms-color-text-brand);
    background: var(--hrms-color-bg-selected);
}

.hrms-hnav__link--setup {
    margin-inline-start: auto;
}

.hrms-dropdown {
    position: absolute;
    inset-inline-start: 0;
    inset-block-start: calc(100% + 4px);
    z-index: 40;
    min-width: 220px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--hrms-color-border-subtle);
    border-radius: 12px;
    background: var(--hrms-color-bg-surface);
    box-shadow: var(--hrms-shadow-overlay);
}

.hrms-mega-menu {
    position: absolute;
    inset-inline-start: 0;
    inset-block-start: calc(100% + 4px);
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 8px 16px;
    width: min(960px, 90vw);
    padding: 16px;
    border: 1px solid var(--hrms-color-border-subtle);
    border-radius: 14px;
    background: var(--hrms-color-bg-surface);
    box-shadow: var(--hrms-shadow-overlay);
}

.hrms-mega-menu__title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--hrms-color-text-brand);
}

.hrms-mega-menu__link--setup {
    color: var(--hrms-color-text-muted);
}

/* ---------- Top bar ---------- */
.hrms-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 64px;
    padding: 8px var(--hrms-content-gutter);
}

.hrms-shell[data-layout="horizontal"] .hrms-topbar {
    padding-inline: 64px;
}

.hrms-topbar__lead {
    flex: 1 1 9rem;
    min-width: 9rem;
}

/* RW-02/RW-04: the tools never push the bar past the viewport and the greeting keeps room; the search trigger gives way first. */
.hrms-topbar {
    min-inline-size: 0;
    max-inline-size: 100%;
}

.hrms-topbar .hrms-search-trigger {
    flex: 0 1 auto;
    min-inline-size: 44px;
    overflow: hidden;
}

.hrms-topbar .hrms-search-trigger__text {
    min-inline-size: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hrms-topbar__welcome-name {
    overflow-wrap: anywhere;
}

.hrms-topbar__welcome {
    display: flex;
    flex-direction: column;
}

.hrms-topbar__welcome-caption {
    color: var(--hrms-color-text-secondary);
    font-size: 13px;
}

.hrms-topbar__welcome-name {
    font-size: 18px;
    font-weight: 700;
}

.hrms-topbar__tools {
    display: flex;
    align-items: center;
    gap: 4px;
}

.hrms-search-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: min(420px, 40vw);
    min-height: max(44px, var(--hrms-control-height));
    padding-inline: 12px;
    border: 1px solid var(--hrms-color-border-strong);
    border-radius: 10px;
    background: var(--hrms-color-bg-surface);
    color: var(--hrms-color-text-muted);
    font: inherit;
    font-size: 14px;
    text-align: start;
    cursor: text;
}

.hrms-search-trigger__text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hrms-kbd {
    padding: 1px 6px;
    border: 1px solid var(--hrms-color-border-default);
    border-radius: 6px;
    background: var(--hrms-color-bg-subtle);
    color: var(--hrms-color-text-secondary);
    font-family: inherit;
    font-size: 11px;
}

.hrms-icon-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--hrms-color-text-primary);
    cursor: pointer;
}

.hrms-icon-button:hover {
    background: var(--hrms-color-bg-subtle);
}

.hrms-env-chip {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--hrms-color-status-info-bg);
    color: var(--hrms-color-status-info-text);
    font-size: 12px;
    font-weight: 600;
}

.hrms-avatar-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: var(--hrms-color-text-primary);
    cursor: pointer;
}

.hrms-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--hrms-color-bg-selected);
    color: var(--hrms-color-text-brand);
    font-weight: 700;
}

/* Initials avatar (UXA-032): six token pairs picked per person by PersonNames.AvatarTone. */
.hrms-avatar--tone-1 { background: var(--hrms-color-avatar-1-bg); color: var(--hrms-color-avatar-1-text); }
.hrms-avatar--tone-2 { background: var(--hrms-color-avatar-2-bg); color: var(--hrms-color-avatar-2-text); }
.hrms-avatar--tone-3 { background: var(--hrms-color-avatar-3-bg); color: var(--hrms-color-avatar-3-text); }
.hrms-avatar--tone-4 { background: var(--hrms-color-avatar-4-bg); color: var(--hrms-color-avatar-4-text); }
.hrms-avatar--tone-5 { background: var(--hrms-color-avatar-5-bg); color: var(--hrms-color-avatar-5-text); }
.hrms-avatar--tone-6 { background: var(--hrms-color-avatar-6-bg); color: var(--hrms-color-avatar-6-text); }

.hrms-avatar--large {
    width: 44px;
    height: 44px;
    font-size: 16px;
}

.hrms-avatar-menu__header {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 10px;
    padding: 12px 16px;
    min-width: 280px;
}

.hrms-avatar-menu__header .hrms-avatar {
    grid-row: span 2;
}

.hrms-avatar-menu__name {
    font-weight: 700;
}

.hrms-avatar-menu__level {
    color: var(--hrms-color-text-muted);
    font-size: 12px;
}

/* ---------- Breadcrumbs ---------- */
.hrms-breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
}

.hrms-breadcrumbs li {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--hrms-color-text-muted);
}

.hrms-breadcrumbs a {
    color: var(--hrms-color-text-secondary);
    text-decoration: none;
}

.hrms-breadcrumbs a:hover {
    color: var(--hrms-color-text-brand);
    text-decoration: underline;
}

.hrms-breadcrumbs__current {
    color: var(--hrms-color-text-primary);
    font-weight: 600;
}

/* TASK-UXA-185 (G21-03): in the top bar the trail never wraps over the search button or the mode switch. The lead may shrink below its 9 rem
   floor, the trail stays on one line and ellipsizes, and below 1100 px (rail and pill menus leave it little room) it shows only the current
   page; the page header names the same page. Scoped to the top bar, so the legacy in-page trail is unchanged. */
.hrms-topbar__lead {
    min-inline-size: 0;
}

.hrms-topbar__lead .hrms-breadcrumbs {
    min-inline-size: 0;
    max-inline-size: 100%;
}

.hrms-topbar__lead .hrms-breadcrumbs ol {
    flex-wrap: nowrap;
    min-inline-size: 0;
    overflow: hidden;
}

.hrms-topbar__lead .hrms-breadcrumbs li {
    flex: 0 1 auto;
    min-inline-size: 0;
    white-space: nowrap;
}

.hrms-topbar__lead .hrms-breadcrumbs li:last-child {
    flex-shrink: 1;
    overflow: hidden;
}

.hrms-topbar__lead .hrms-breadcrumbs li > :is(a, span):not(.hrms-breadcrumbs__separator) {
    min-inline-size: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 1099px) {
    .hrms-topbar__lead .hrms-breadcrumbs li:not(:last-child) {
        display: none;
    }

    .hrms-topbar__lead .hrms-breadcrumbs li:last-child .hrms-breadcrumbs__separator {
        display: none;
    }
}

/* ---------- Preview banner ---------- */
.hrms-preview-banner {
    grid-area: banner;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px var(--hrms-content-gutter);
    background: var(--hrms-color-bg-inverse);
    color: var(--hrms-color-text-inverse);
    font-size: 14px;
}

.hrms-preview-banner__text {
    flex: 1;
}

.hrms-preview-banner__level {
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid currentColor;
    font-size: 12px;
}

.hrms-button {
    min-height: 40px;
    padding-inline: 16px;
    border-radius: 10px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.hrms-button--inverse {
    border: 1px solid var(--hrms-color-text-inverse);
    background: transparent;
    color: var(--hrms-color-text-inverse);
}

/* ---------- Quick switch ---------- */
.hrms-quick-switch {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 16px 12px;
    min-width: 280px;
}

.hrms-quick-switch__title {
    font-weight: 700;
}

.hrms-quick-switch__label {
    margin-block-start: 4px;
    color: var(--hrms-color-text-muted);
    font-size: 12px;
}

.hrms-segmented {
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: 10px;
    background: var(--hrms-color-bg-subtle);
}

.hrms-segmented__option {
    flex: 1;
    min-height: 36px;
    padding-inline: 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--hrms-color-text-secondary);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.hrms-segmented__option.is-selected {
    background: var(--hrms-color-bg-surface);
    color: var(--hrms-color-text-brand);
    font-weight: 600;
    box-shadow: var(--hrms-shadow-card);
}

.hrms-segmented__option:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* ---------- Command center ---------- */
.hrms-cc-scrim {
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: rgba(15, 23, 42, 0.4);
}

.hrms-cc {
    position: fixed;
    inset-block-start: 12vh;
    inset-inline-start: 50%;
    z-index: 1301;
    display: flex;
    flex-direction: column;
    width: min(640px, calc(100vw - 32px));
    max-height: 70vh;
    transform: translateX(-50%);
    border: 1px solid var(--hrms-color-border-subtle);
    border-radius: 16px;
    background: var(--hrms-color-bg-surface);
    color: var(--hrms-color-text-primary);
    box-shadow: var(--hrms-shadow-overlay);
    font-family: var(--hrms-font-family, 'Cairo', sans-serif);
}

[dir="rtl"] .hrms-cc,
.rtl .hrms-cc {
    transform: translateX(50%);
}

.hrms-cc--classic {
    width: min(420px, calc(100vw - 32px));
}

.hrms-cc--enterprise {
    width: min(680px, calc(100vw - 32px));
}

.hrms-cc__search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-block-end: 1px solid var(--hrms-color-border-subtle);
}

.hrms-cc__input {
    flex: 1;
    min-height: 40px;
    border: 0;
    background: transparent;
    color: var(--hrms-color-text-primary);
    font: inherit;
    font-size: 16px;
    outline: none;
}

.hrms-cc__results {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.hrms-cc__state {
    padding: 24px 16px;
    color: var(--hrms-color-text-muted);
    text-align: center;
}

.hrms-cc__group-title {
    padding: 8px 10px 4px;
    color: var(--hrms-color-text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hrms-cc__option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
}

.hrms-cc__option.is-selected {
    background: var(--hrms-color-bg-selected);
}

.hrms-cc__option-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.hrms-cc__option-title {
    font-weight: 600;
}

.hrms-cc__option-subtitle {
    color: var(--hrms-color-text-muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hrms-cc__hints {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 8px 16px;
    border-block-start: 1px solid var(--hrms-color-border-subtle);
    color: var(--hrms-color-text-muted);
    font-size: 12px;
}

.hrms-badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--hrms-color-status-warning-bg);
    color: var(--hrms-color-status-warning-text);
    font-size: 11px;
    font-weight: 600;
}

/* ---------- Narrow screens: sidebar and rail become an overlay-free top layout ---------- */
@media (max-width: 960px) {
    .hrms-shell,
    .hrms-shell[data-layout="rail"] {
        grid-template-columns: var(--hrms-nav-width-rail) minmax(0, 1fr);
    }

    .hrms-shell[data-layout="sidebar"] .hrms-nav-item__label,
    .hrms-shell[data-layout="sidebar"] .hrms-band-label,
    .hrms-shell[data-layout="sidebar"] .hrms-nav-group__children,
    .hrms-shell[data-layout="sidebar"] .hrms-sidebar__logo {
        display: none;
    }

    .hrms-shell[data-layout="horizontal"] .hrms-shell__main,
    .hrms-hnav,
    .hrms-shell[data-layout="horizontal"] .hrms-topbar {
        padding-inline: 16px;
    }

    .hrms-search-trigger__text {
        display: none;
    }

    /* V90-02: the top bar wraps at phone width instead of scrolling the page sideways. */
    .hrms-topbar {
        flex-wrap: wrap;
        max-inline-size: 100%;
    }

    .hrms-topbar__lead {
        flex-basis: 0;
        min-width: 0;
    }

    .hrms-topbar__tools {
        flex-wrap: wrap;
        min-inline-size: 0;
    }

    .hrms-search-trigger {
        width: auto;
    }
}

/* Preset list in the quick switch (amendment A2): seven options wrap instead of overflowing. */
.hrms-segmented--wrap {
    flex-wrap: wrap;
}

/* ---------- Phones (< 768 px, round-2 R2-UX-02): one column, navigation in a drawer from the top-bar menu button ---------- */
.hrms-topbar__menu {
    display: none;
}

@media (max-width: 767px) {
    .hrms-shell,
    .hrms-shell[data-layout="rail"],
    .hrms-shell[data-layout="sidebar"] {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "top"
            "banner"
            "main"
            "footer";
    }

    .hrms-shell__nav,
    .hrms-shell[data-layout="horizontal"] .hrms-hnav {
        display: none;
    }

    .hrms-topbar__menu {
        display: inline-flex;
    }

    .hrms-shell__nav.is-open {
        display: block;
        position: fixed;
        inset-block: 0;
        inset-inline-start: 0;
        width: min(86vw, 320px);
        height: 100dvh;
        overflow-y: auto;
        z-index: 60;
        box-shadow: var(--hrms-shadow-overlay);
    }

    .hrms-shell__nav.is-open .hrms-nav-item__label,
    .hrms-shell__nav.is-open .hrms-band-label,
    .hrms-shell__nav.is-open .hrms-nav-group__children,
    .hrms-shell__nav.is-open .hrms-sidebar__logo {
        display: revert;
    }

    .hrms-shell__scrim {
        position: fixed;
        inset: 0;
        z-index: 55;
        background: color-mix(in srgb, var(--hrms-color-bg-inverse) 45%, transparent);
    }

    .hrms-shell__main {
        padding-inline: 16px;
    }
}

/* One trail only (round-2 R2-UX-09): from Professional the shell top bar shows the breadcrumbs, so the legacy page-header
   trails (MudBreadcrumbs in ~270 module pages) are hidden; Classic keeps them because its top bar shows none. */
.hrms-shell:not([data-shell-level="classic"]) .hrms-shell__main .mud-breadcrumbs {
    display: none;
}

/* R2-UX-25: below 1100 px the mega menu is pinned inside the viewport (both directions) and scrolls instead of overflowing. */
@media (max-width: 1100px) {
    .hrms-mega-menu {
        position: fixed;
        inset-inline: 16px;
        width: auto;
        max-height: 70vh;
        overflow-y: auto;
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* R2-UX-27: four tiles as a 2 x 2 grid at medium widths instead of 3 + 1. */
@media (max-width: 1100px) and (min-width: 600px) {
    .hrms-metric-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* R2-UX-34: the active workspace's name under the icon-only switcher. */
.hrms-workspace-switcher__name {
    padding: 4px 16px 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--hrms-color-text-secondary);
}

/* R2-UX-39: below 1200 px the Enterprise profile's section sidebar becomes a horizontal scroller above the content. */
@media (max-width: 1200px) {
    .hrms-section-nav {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 4px;
        max-height: none;
    }
}

/* ---------- Horizontal navigation revisit (owner, 2026-10-10) ---------- */
/* Icons in the new shell take the size they ask for; app.css forces every iconify-icon to 1em, so an 18 px icon in 11 px
   text overflowed its box and overlapped the label. */
.hrms-shell iconify-icon[width] {
    width: auto;
    height: auto;
}

/* Rows stay on one line; ui-shell.js moves what does not fit into "More" (hidden until it has measured). */
.hrms-hnav {
    position: relative;
}

.hrms-hnav__row {
    flex-wrap: nowrap;
}

.hrms-hnav:not(.is-measured) .hrms-hnav__row {
    overflow: hidden;
}

.hrms-hnav__tab-wrap,
.hrms-hnav__workspace,
.hrms-hnav__item,
.hrms-hnav__more {
    flex: 0 0 auto;
}

.hrms-hnav__tab,
.hrms-hnav__link {
    white-space: nowrap;
}

.hrms-hnav .is-overflow,
.hrms-hnav [hidden] {
    display: none !important;
}

.hrms-hnav__more {
    display: none;
    position: relative;
}

.hrms-hnav__more.is-needed {
    display: block;
}

.hrms-hnav__item--setup {
    margin-inline-start: auto;
}

/* Dropdowns: "More" opens towards the inline end; any menu that would leave the viewport flips. */
.hrms-dropdown--end,
.hrms-dropdown--flip {
    inset-inline-start: auto;
    inset-inline-end: 0;
}

.hrms-dropdown--end.hrms-dropdown--flip {
    inset-inline-start: 0;
    inset-inline-end: auto;
}

.hrms-dropdown__heading {
    padding: 10px 10px 4px;
    color: var(--hrms-color-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hrms-dropdown__item--nested {
    padding-inline-start: 18px;
}

/* The mega menu spans the navigation (inside the viewport at every width and in both directions). */
.hrms-hnav__tab-wrap--mega {
    position: static;
}

.hrms-hnav .hrms-mega-menu {
    inset-inline: 64px;
    width: auto;
    max-height: 70vh;
    overflow-y: auto;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

@media (max-width: 1100px) {
    .hrms-hnav .hrms-mega-menu {
        inset-inline: 16px;
    }
}

/* Horizontal layout: the product logo leads the top bar (the sidebar that carries it is not shown). */
.hrms-topbar__brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    min-block-size: 44px;
    min-inline-size: 44px;
    margin-inline-end: 16px;
}

.hrms-topbar__brand img {
    max-height: 32px;
    max-width: 140px;
}

/* ---------- Top bar page title and avatar name (TASK-DSC-020; shown by the expressive look, look.css) ---------- */
.hrms-topbar__page {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hrms-topbar__page-title {
    overflow: hidden;
    font: var(--hrms-font-headline);
    letter-spacing: var(--hrms-tracking-headline);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hrms-topbar__page-subtitle {
    overflow: hidden;
    color: var(--hrms-color-text-secondary);
    font: var(--hrms-font-caption);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hrms-avatar-button__name {
    display: none;
}

/* ---------- Me / Team / HR mode switch (TASK-DSC-021; shown by the expressive look) ---------- */
.hrms-mode-switch {
    display: inline-flex;
    flex: none;
    gap: 2px;
    padding: 4px;
    border: 1px solid var(--hrms-color-border-subtle);
    border-radius: 999px;
    background: var(--hrms-color-bg-surface);
}

.hrms-mode-switch__option {
    min-height: 44px;
    padding: 4px 16px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: var(--hrms-font-label);
    cursor: pointer;
}

.hrms-mode-switch__option.is-selected {
    background: var(--hrms-color-bg-selected);
    color: var(--hrms-color-text-brand);
}

.hrms-mode-switch__option:focus-visible {
    box-shadow: var(--hrms-focus-ring);
    outline: none;
}

@media (max-width: 767px) {
    .hrms-mode-switch {
        display: none;
    }
}

/* ---------- Menu pattern renderers A (TASK-UXP-031, HRMS-ADR-0059) ---------- */
.hrms-menu {
    min-inline-size: min(240px, 100%);
    inline-size: var(--hrms-menu-width, auto);
    max-inline-size: 100%;
    overflow: visible;
}

.hrms-menu__tree,
.hrms-menu__group {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hrms-menu__group[hidden] {
    display: none;
}

.hrms-menu__group {
    padding-inline-start: 24px;
}

.hrms-menu__link {
    display: flex;
    align-items: center;
    gap: 12px;
    inline-size: 100%;
    box-sizing: border-box;
    min-block-size: max(44px, var(--hrms-menu-target, 44px));
    padding-block: 8px;
    padding-inline: 12px;
    border: 0;
    border-radius: var(--hrms-radius-md, 8px);
    background: transparent;
    color: var(--hrms-color-text-primary);
    font: inherit;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
}

.hrms-menu__label {
    flex: 1 1 auto;
    min-inline-size: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.hrms-menu__icon,
.hrms-menu__chevron {
    flex: 0 0 auto;
}

.hrms-menu__link:hover {
    background: var(--hrms-color-bg-subtle);
}

.hrms-menu__link[aria-current],
.hrms-menu__link--group[aria-expanded="true"] {
    background: var(--hrms-color-bg-selected);
    color: var(--hrms-color-text-brand);
    font-weight: 600;
}

.hrms-menu__link--group[aria-expanded="true"] .hrms-menu__chevron {
    transform: rotate(180deg);
}

.hrms-menu__link--hub {
    color: var(--hrms-color-text-brand);
}

/* The ring is drawn inside the item so scrolling parents never clip it. */
.hrms-menu .hrms-menu__link:focus-visible {
    outline: 2px solid var(--hrms-color-border-focus);
    outline-offset: -2px;
    box-shadow: inset 0 0 0 4px var(--hrms-color-bg-surface);
}

.hrms-menu__separator {
    margin-block: 8px;
    border-block-start: 1px solid var(--hrms-color-border-subtle);
}

.hrms-menu--persona-bands > .hrms-menu__tree > .hrms-menu__item--group > .hrms-menu__link {
    text-transform: none;
    border-block-end: 1px solid var(--hrms-color-border-subtle);
    border-radius: 0;
    font-weight: 600;
}

.hrms-menu--workspaces > .hrms-menu__tree > .hrms-menu__item--group > .hrms-menu__link {
    font-weight: 600;
}

.hrms-menu--workspaces > .hrms-menu__tree > .hrms-menu__item--group > .hrms-menu__group {
    border-inline-start: 2px solid var(--hrms-color-border-default);
    margin-inline-start: 22px;
}

:root[data-contrast="high"] .hrms-menu__link {
    border: 1px solid var(--hrms-color-border-default);
}

:root[data-contrast="high"] .hrms-menu__link[aria-current="page"],
:root[data-contrast="high"] .hrms-menu__link--group[aria-expanded="true"] {
    border-width: 2px;
    text-decoration: underline;
}

[dir="rtl"] .hrms-menu__chevron,
.rtl .hrms-menu__chevron {
    margin-inline-start: auto;
}

@media (forced-colors: active) {
    .hrms-menu .hrms-menu__link:focus-visible {
        outline: 2px solid Highlight;
    }

    .hrms-menu__link[aria-current="page"] {
        border: 2px solid CanvasText;
    }
}

/* V90-01: every top-bar button is at least 44 x 44 px (WCAG 2.5.8 target size, MENU-7). */
.hrms-topbar :is(.hrms-icon-button, .hrms-avatar-button, .hrms-search-trigger, .hrms-mode-switch__option) {
    min-inline-size: 44px;
    min-block-size: 44px;
}
