:root {
    --system-header-height: 62px;
    --system-header-control-h: 38px;
    --system-header-radius: 11px;
    --system-header-gap: 8px;
}

.app-topbar.system-header-shell {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: var(--system-header-height);
    padding: 10px 18px;
    background:
        radial-gradient(circle at 0% 0%, rgba(var(--ui-brand-accent-rgb, 240, 154, 26), 0.16), transparent 34%),
        linear-gradient(118deg, var(--ui-brand-primary, #004b87) 0%, var(--ui-brand-primary-strong, #003063) 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 28px rgba(0, 24, 50, 0.22) !important;
    backdrop-filter: blur(14px);
    overflow: visible;
}

.app-topbar.system-header-shell::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.26), transparent);
    pointer-events: none;
}

.app-topbar.system-header-shell .app-topbar__panel {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 420px) minmax(0, auto);
    grid-template-areas: 'primary search actions';
    gap: 10px 14px;
    align-items: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.app-topbar.system-header-shell .app-topbar__primary {
    grid-area: primary;
    display: flex;
    align-items: center;
    gap: var(--system-header-gap);
    min-width: 0;
    flex-wrap: nowrap;
}

.app-topbar.system-header-shell .app-topbar__search {
    grid-area: search;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.app-topbar.system-header-shell .app-topbar__actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    flex-wrap: nowrap;
}

.app-topbar.system-header-shell .app-topbar__cluster {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

/* Work context: Page title & concise breadcrumb */
.app-topbar.system-header-shell .app-header-context {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
    padding-inline: 4px;
}

.app-topbar.system-header-shell .app-header-context__trail {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
}

.app-topbar.system-header-shell .app-header-context__parent {
    color: rgba(226, 238, 250, 0.8);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    flex: 0 0 auto;
}

.app-topbar.system-header-shell .app-header-context__sep {
    width: 14px;
    height: 14px;
    color: rgba(240, 154, 26, 0.9);
    flex: 0 0 auto;
}

.app-topbar.system-header-shell .app-header-context__title {
    color: #ffffff;
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Directional icon mirroring in RTL */
[dir='rtl'] .app-topbar.system-header-shell .app-icon-directional {
    transform: scaleX(-1);
}

/* Unified header controls */
.app-topbar.system-header-shell .app-topbar-button,
.app-topbar.system-header-shell .app-topbar-pill,
.app-topbar.system-header-shell .app-topbar-cta,
.app-topbar.system-header-shell .app-topbar-user,
.app-topbar.system-header-shell .app-company-switch__summary,
.app-topbar.system-header-shell .app-topbar-status,
.app-topbar.system-header-shell .app-topbar-live,
.app-topbar.system-header-shell .clock_in_btn {
    min-height: var(--system-header-control-h);
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    box-shadow: none;
    backdrop-filter: blur(10px);
    border-radius: var(--system-header-radius);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}

.app-topbar.system-header-shell .app-topbar-button:hover,
.app-topbar.system-header-shell .app-topbar-button:focus-visible,
.app-topbar.system-header-shell .app-topbar-user:hover,
.app-topbar.system-header-shell .app-topbar-user:focus-visible,
.app-topbar.system-header-shell .app-company-switch__summary:hover,
.app-topbar.system-header-shell .app-company-switch__summary:focus-visible,
.app-topbar.system-header-shell .app-topbar-status:hover,
.app-topbar.system-header-shell .app-topbar-status:focus-visible,
.app-topbar.system-header-shell details[open] > summary.app-topbar-button,
.app-topbar.system-header-shell details[open] > summary.app-company-switch__summary,
.app-topbar.system-header-shell details[open] > summary.app-topbar-user,
.app-topbar.system-header-shell .clock_in_btn:hover,
.app-topbar.system-header-shell .clock_in_btn:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
    transform: none;
    box-shadow: none;
}

.app-topbar.system-header-shell .app-topbar-button:focus-visible,
.app-topbar.system-header-shell .app-topbar-cta:focus-visible,
.app-topbar.system-header-shell .app-topbar-user:focus-visible,
.app-topbar.system-header-shell .app-company-switch__summary:focus-visible,
.app-topbar.system-header-shell .app-topbar-status:focus-visible,
.app-topbar.system-header-shell .app-quick-search:focus-within,
.app-topbar.system-header-shell .app-topbar-live__now:focus-visible,
.app-topbar.system-header-shell .app-menu-link:focus-visible,
.app-topbar.system-header-shell .app-user-link:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

.app-topbar.system-header-shell .app-topbar-button svg,
.app-topbar.system-header-shell .app-topbar-cta svg,
.app-topbar.system-header-shell .app-topbar-user svg,
.app-topbar.system-header-shell .app-company-switch__summary svg,
.app-topbar.system-header-shell .clock_in_btn svg {
    width: 16px;
    height: 16px;
    color: inherit;
    flex: 0 0 auto;
}

.app-topbar.system-header-shell .app-topbar-chevron {
    width: 14px !important;
    height: 14px !important;
    opacity: 0.78;
    transition: transform 0.16s ease;
}

.app-topbar.system-header-shell details[open] > summary .app-topbar-chevron {
    transform: rotate(180deg);
}

.app-topbar.system-header-shell .app-topbar-button--icon-only {
    width: var(--system-header-control-h);
    min-width: var(--system-header-control-h);
    padding: 0;
    justify-content: center;
}

/* Single Primary CTA — AFM brand accent */
.app-topbar.system-header-shell .app-topbar-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px;
    background: linear-gradient(135deg, var(--ui-brand-accent, #f09a1a) 0%, #f5b041 100%);
    border-color: rgba(255, 255, 255, 0.28);
    color: #0e233d;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(0, 18, 40, 0.22);
    cursor: pointer;
}

.app-topbar.system-header-shell .app-topbar-cta .app-topbar-cta__label {
    display: inline;
}

.app-topbar.system-header-shell .app-topbar-cta:hover,
.app-topbar.system-header-shell .app-topbar-cta:focus-visible {
    background: linear-gradient(135deg, #f5ad38 0%, #f8bf60 100%);
    border-color: rgba(255, 255, 255, 0.44);
    color: #091a30;
    box-shadow: 0 8px 20px rgba(0, 18, 40, 0.28);
}

/* Quick Actions trigger */
.app-topbar.system-header-shell .app-quick-actions__trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 11px;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
}

/* Company & Branch context switcher */
.app-topbar.system-header-shell .app-company-switch {
    flex: 0 1 auto;
    max-width: 240px;
}

.app-topbar.system-header-shell .app-company-switch__summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px;
    padding-inline-end: 10px;
    max-width: 100%;
}

.app-topbar.system-header-shell .app-company-switch__avatar {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    flex: 0 0 auto;
}

.app-topbar.system-header-shell .app-company-switch__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
    text-align: start;
}

.app-topbar.system-header-shell .app-company-switch__text strong {
    color: #ffffff;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-topbar.system-header-shell .app-company-switch__branch {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 2px;
    color: #fde68a;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-topbar.system-header-shell .app-company-switch__branch-icon {
    width: 11px !important;
    height: 11px !important;
    color: #fbbf24 !important;
}

.app-topbar.system-header-shell .app-company-switch__branch-card {
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    border: 1px solid rgba(var(--ui-brand-primary-rgb, 0, 75, 135), 0.14);
    background: #f5f9fe;
    text-align: start;
}

.app-topbar.system-header-shell .app-company-switch__branch-label {
    display: block;
    color: #64748b;
    font-size: 10.5px;
    font-weight: 800;
    margin-bottom: 4px;
}

.app-topbar.system-header-shell .app-company-switch__branch-value {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ui-brand-primary-strong, #003063);
    font-size: 13px;
    font-weight: 800;
}

.app-topbar.system-header-shell .app-company-switch__branch-value svg {
    width: 15px;
    height: 15px;
    color: var(--ui-brand-accent-strong, #cf7d00);
    flex: 0 0 auto;
}

.app-topbar.system-header-shell .app-company-switch__branch-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}

.app-topbar.system-header-shell .app-company-switch__branch-list li {
    padding: 2px 8px;
    border-radius: 999px;
    background: #e7f1fb;
    color: #003063;
    font-size: 11px;
    font-weight: 700;
}

/* Logical RTL/LTR dropdown menu positioning (prevents viewport overflow in RTL) */
.app-topbar.system-header-shell .app-company-switch__menu,
.app-topbar.system-header-shell .app-topbar-dropdown__menu,
.app-topbar.system-header-shell .app-topbar-user-menu__menu,
.app-topbar.system-header-shell .app-topbar-notifications .dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    min-width: 264px;
    max-width: min(340px, calc(100vw - 24px));
    padding: 10px;
    border: 1px solid rgba(191, 209, 226, 0.85);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(0, 24, 50, 0.22);
    backdrop-filter: none;
    text-align: start;
    z-index: 1200;
}

.app-topbar.system-header-shell .app-company-switch__menu {
    inset-inline-start: 0;
    inset-inline-end: auto;
}

[dir='rtl'] .app-topbar.system-header-shell .app-company-switch__menu {
    right: 0;
    left: auto;
}

.app-topbar.system-header-shell .app-topbar-dropdown__menu,
.app-topbar.system-header-shell .app-topbar-user-menu__menu,
.app-topbar.system-header-shell .app-topbar-notifications__menu {
    inset-inline-start: auto;
    inset-inline-end: 0;
    left: auto !important;
    right: 0 !important;
}

[dir='rtl'] .app-topbar.system-header-shell .app-topbar-dropdown__menu,
[dir='rtl'] .app-topbar.system-header-shell .app-topbar-user-menu__menu,
[dir='rtl'] .app-topbar.system-header-shell .app-topbar-notifications__menu {
    right: auto !important;
    left: 0 !important;
}

.app-topbar.system-header-shell .app-menu-group-label {
    padding: 4px 10px 6px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    text-align: start;
}

.app-topbar.system-header-shell .app-menu-divider {
    height: 1px;
    margin: 6px 4px 8px;
    background: #e2e8f0;
}

.app-topbar.system-header-shell .app-menu-link,
.app-topbar.system-header-shell .app-user-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #1e293b;
    font-size: 13px;
    font-weight: 700;
    text-align: start;
    cursor: pointer;
    text-decoration: none;
}

.app-topbar.system-header-shell .app-menu-link:hover,
.app-topbar.system-header-shell .app-menu-link:focus-visible,
.app-topbar.system-header-shell .app-user-link:hover,
.app-topbar.system-header-shell .app-user-link:focus-visible {
    background: rgba(var(--ui-brand-primary-rgb, 0, 75, 135), 0.08);
    color: var(--ui-brand-primary-strong, #003063);
}

.app-topbar.system-header-shell .app-menu-link svg,
.app-topbar.system-header-shell .app-user-link svg {
    width: 16px;
    height: 16px;
    color: var(--ui-brand-primary, #004b87);
    flex: 0 0 auto;
}

/* Quick search bar */
.app-topbar.system-header-shell .app-quick-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-height: var(--system-header-control-h);
    height: var(--system-header-control-h);
    gap: 8px;
    padding-inline-start: 12px;
    padding-inline-end: 8px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 18, 40, 0.16);
}

.app-topbar.system-header-shell .app-quick-search.is-active,
.app-topbar.system-header-shell .app-quick-search:focus-within {
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(240, 154, 26, 0.28), 0 10px 24px rgba(0, 18, 40, 0.18);
}

.app-topbar.system-header-shell .app-quick-search__icon {
    width: 16px;
    height: 16px;
    color: var(--ui-brand-primary, #004b87);
    flex: 0 0 auto;
}

.app-topbar.system-header-shell .app-quick-search input {
    flex: 1 1 auto;
    min-width: 0;
    height: calc(var(--system-header-control-h) - 2px);
    padding: 0;
    border: 0;
    background: transparent !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    caret-color: #0f172a !important;
    font-size: 13px;
    font-weight: 600;
    outline: none;
}

.app-topbar.system-header-shell .app-quick-search input::placeholder {
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
    opacity: 1 !important;
    font-weight: 550;
}

.app-topbar.system-header-shell .app-quick-search__clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 15px;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
    flex: 0 0 auto;
    cursor: pointer;
}

.app-topbar.system-header-shell .app-quick-search__clear.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.app-topbar.system-header-shell .app-quick-search__clear:hover,
.app-topbar.system-header-shell .app-quick-search__clear:focus-visible {
    background: #cbd5e1;
    color: #0f172a;
}

.app-topbar.system-header-shell .app-quick-search__close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #eef2f7;
    color: #334155;
    flex: 0 0 auto;
    cursor: pointer;
}

.app-topbar.system-header-shell .app-quick-search__close svg {
    width: 14px;
    height: 14px;
}

.app-topbar.system-header-shell .app-quick-search__hint {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
    padding: 0;
    background: transparent;
    color: #64748b;
    flex: 0 0 auto;
}

.app-topbar.system-header-shell .app-quick-search__hint span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 21px;
    padding: 0 5px;
    border: 1px solid #d7e2ee;
    border-bottom-width: 2px;
    border-radius: 6px;
    background: #f8fafc;
    color: #475569;
    font-family: inherit;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Quick search dropdown & entity badges */
.app-topbar.system-header-shell .app-quick-search__results {
    position: absolute;
    top: calc(100% + 10px);
    inset-inline: 0;
    max-height: min(65vh, 460px);
    overflow-y: auto;
    display: grid;
    gap: 4px;
    padding: 8px;
    border: 1px solid rgba(191, 209, 226, 0.9);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 20px 48px rgba(0, 24, 50, 0.22);
    text-align: start;
    z-index: 1250;
}

.app-topbar.system-header-shell .app-quick-search__results[hidden] {
    display: none !important;
}

.app-topbar.system-header-shell .app-quick-search__group-label {
    padding: 6px 10px 2px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}

.app-topbar.system-header-shell .app-quick-search__result,
.app-topbar.system-header-shell .app-quick-search__empty,
.app-topbar.system-header-shell .app-quick-search__status {
    display: grid;
    gap: 3px;
    padding: 9px 11px;
    border-radius: 11px;
    text-decoration: none;
}

.app-topbar.system-header-shell .app-quick-search__result {
    color: #0f172a;
    border: 1px solid transparent;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}

.app-topbar.system-header-shell .app-quick-search__result:hover,
.app-topbar.system-header-shell .app-quick-search__result.is-focused {
    background: #eef5fc;
    border-color: rgba(var(--ui-brand-primary-rgb, 0, 75, 135), 0.22);
    color: #003063;
}

.app-topbar.system-header-shell .app-quick-search__result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.app-topbar.system-header-shell .app-quick-search__result-title {
    font-size: 13px;
    font-weight: 750;
    color: inherit;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-topbar.system-header-shell .app-quick-search__result-meta,
.app-topbar.system-header-shell .app-quick-search__empty,
.app-topbar.system-header-shell .app-quick-search__status {
    color: #57697d;
    font-size: 11.5px;
    font-weight: 600;
}

.app-topbar.system-header-shell .app-quick-search__status--error {
    color: #b91c1c;
}

.app-topbar.system-header-shell .app-quick-search__badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 800;
    white-space: nowrap;
    flex: 0 0 auto;
}

.app-topbar.system-header-shell .app-quick-search__badge--job_sheet {
    background: #e7f1fb;
    color: #004b87;
}

.app-topbar.system-header-shell .app-quick-search__badge--customer {
    background: #dcfce7;
    color: #166534;
}

.app-topbar.system-header-shell .app-quick-search__badge--piece {
    background: #fff1dc;
    color: #9a5400;
}

.app-topbar.system-header-shell .app-quick-search__badge--product {
    background: #eef2ff;
    color: #3730a3;
}

.app-topbar.system-header-shell .app-quick-search__badge--navigation {
    background: #f1f5f9;
    color: #475569;
}

/* Status, live refresh, impersonation */
.app-topbar.system-header-shell .app-topbar-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 11px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.app-topbar.system-header-shell .app-topbar-status--impersonating {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(252, 165, 165, 0.45);
    color: #fee2e2;
}

.app-topbar.system-header-shell .app-topbar-live {
    padding-inline-start: 10px;
    padding-inline-end: 4px;
    gap: 6px;
}

.app-topbar.system-header-shell .app-topbar-live__dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.app-topbar.system-header-shell .app-topbar-live__label {
    font-size: 11.5px;
    font-weight: 700;
    color: rgba(241, 245, 249, 0.92);
}

.app-topbar.system-header-shell .app-topbar-live__now {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: rgba(241, 245, 249, 0.92);
    cursor: pointer;
}

.app-topbar.system-header-shell .app-topbar-live__now:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.app-topbar.system-header-shell .app-topbar-live__now svg {
    width: 14px;
    height: 14px;
}

/* Multi-currency selector slot */
.app-topbar.system-header-shell .app-topbar-currency-slot {
    min-width: 136px;
    max-width: 184px;
}

.app-topbar.system-header-shell .app-topbar-currency-slot .select2-container .select2-selection--single,
.app-topbar.system-header-shell .app-topbar-currency-slot .form-control {
    min-height: var(--system-header-control-h);
    border-radius: var(--system-header-radius);
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    box-shadow: none;
}

.app-topbar.system-header-shell .app-topbar-currency-slot .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #ffffff;
    line-height: 28px;
}

/* Notifications badge (logical edge) */
.app-topbar.system-header-shell .app-topbar-notifications .notifications_count {
    top: -4px;
    inset-inline-end: -4px;
    inset-inline-start: auto;
    right: -4px;
    left: auto;
    min-width: 18px;
    min-height: 18px;
    border: 2px solid var(--ui-brand-primary-strong, #003063);
    background: var(--ui-brand-accent, #f09a1a) !important;
    color: #0e233d !important;
    font-size: 10px;
    font-weight: 800;
}

[dir='rtl'] .app-topbar.system-header-shell .app-topbar-notifications .notifications_count {
    right: auto;
    left: -4px;
}

/* User account trigger */
.app-topbar.system-header-shell .app-topbar-user {
    display: inline-flex;
    align-items: center;
    max-width: 196px;
    gap: 7px;
    padding: 3px;
    padding-inline-end: 9px;
}

.app-topbar.system-header-shell .app-topbar-user__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    flex: 0 0 auto;
}

.app-topbar.system-header-shell .app-topbar-user__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
    font-weight: 700;
}

/* Desktop vs Mobile sidebar & search toggle defaults */
.app-topbar.system-header-shell .small-view-button {
    display: inline-flex;
}

.app-topbar.system-header-shell .side-bar-collapse {
    display: none;
}

.app-topbar.system-header-shell .app-topbar-search-toggle {
    display: none;
}

@media (min-width: 992px) {
    .app-topbar.system-header-shell .small-view-button {
        display: none !important;
    }

    .app-topbar.system-header-shell .side-bar-collapse {
        display: inline-flex !important;
    }
}

.module-nav-shell {
    top: var(--system-header-height);
}

/* Medium desktop: keep single row spacious */
@media (max-width: 1399px) {
    .app-topbar.system-header-shell .app-topbar__panel {
        grid-template-columns: minmax(0, 1fr) minmax(200px, 310px) minmax(0, auto);
    }

    .app-topbar.system-header-shell .app-topbar-user__name {
        display: none;
    }

    .app-topbar.system-header-shell .app-topbar-user {
        padding-inline-end: 6px;
    }

    .app-topbar.system-header-shell .app-company-switch {
        max-width: 196px;
    }
}

@media (max-width: 1279px) {
    .app-topbar.system-header-shell .app-quick-actions__label,
    .app-topbar.system-header-shell .app-quick-actions__chevron {
        display: none;
    }

    .app-topbar.system-header-shell .app-quick-actions__trigger {
        width: var(--system-header-control-h);
        padding: 0;
        justify-content: center;
    }
}

/* Narrow screens (<= 1023px): collapse search to toggle button, keep single clean row */
@media (max-width: 1023px) {
    .app-topbar.system-header-shell {
        padding: 8px 12px;
    }

    .app-topbar.system-header-shell .app-topbar__panel {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: 'primary actions';
        gap: 8px;
    }

    .app-topbar.system-header-shell .app-topbar-search-toggle {
        display: inline-flex;
    }

    .app-topbar.system-header-shell .app-topbar__search {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
        padding-top: 8px;
    }

    .app-topbar.system-header-shell.is-search-open .app-topbar__panel {
        grid-template-areas:
            'primary actions'
            'search search';
    }

    .app-topbar.system-header-shell.is-search-open .app-topbar__search {
        display: flex;
    }

    .app-topbar.system-header-shell.is-search-open .app-quick-search__close {
        display: inline-flex;
    }

    .app-topbar.system-header-shell .app-quick-search__hint {
        display: none;
    }

    .app-topbar.system-header-shell .app-topbar__cluster--status {
        display: none;
    }

    .app-topbar.system-header-shell .app-company-switch {
        max-width: 160px;
    }

    .module-nav-shell {
        position: relative;
        top: 0;
    }
}

/* Mobile (<= 767px): keep page title, primary CTA, search button, and notifications accessible */
@media (max-width: 767px) {
    .app-topbar.system-header-shell .app-topbar__actions {
        gap: 6px;
    }

    .app-topbar.system-header-shell .app-header-context__parent,
    .app-topbar.system-header-shell .app-header-context__sep {
        display: none;
    }

    .app-topbar.system-header-shell .app-header-context__title {
        font-size: 13.5px;
    }

    .app-topbar.system-header-shell .app-company-switch__text,
    .app-topbar.system-header-shell .app-company-switch .app-topbar-chevron {
        display: none;
    }

    .app-topbar.system-header-shell .app-company-switch__summary {
        padding: 3px;
        width: var(--system-header-control-h);
        justify-content: center;
    }

    .app-topbar.system-header-shell .app-topbar-user .app-topbar-chevron {
        display: none;
    }

    .app-topbar.system-header-shell .app-topbar-user {
        padding: 3px;
        width: var(--system-header-control-h);
        justify-content: center;
    }

    .app-topbar.system-header-shell .app-topbar-cta {
        padding: 0 10px;
        font-size: 12px;
        gap: 5px;
    }
}

/* Extra narrow mobile (<= 479px): compact icon-only CTA while preserving full accessible title/label */
@media (max-width: 479px) {
    .app-topbar.system-header-shell {
        padding: 8px 10px;
    }

    .app-topbar.system-header-shell .app-topbar__primary {
        gap: 6px;
    }

    .app-topbar.system-header-shell .app-topbar-cta__label {
        display: none;
    }

    .app-topbar.system-header-shell .app-topbar-cta {
        width: var(--system-header-control-h);
        padding: 0;
    }
}
