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

.app-topbar.system-header-shell {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: var(--system-header-height);
    padding: 10px 20px;
    background:
        radial-gradient(circle at 0 0, rgba(59, 130, 246, 0.18), transparent 34%),
        linear-gradient(180deg, #0b1220 0%, #111827 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 32px rgba(2, 8, 23, 0.28);
    backdrop-filter: blur(16px);
    overflow: visible;
}

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

.app-topbar.system-header-shell .app-topbar__panel {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, max-content) minmax(220px, 1fr) minmax(0, max-content);
    grid-template-areas: 'primary search actions';
    gap: 10px 16px;
    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: 10px;
    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;
}

.app-topbar.system-header-shell .app-topbar__sep {
    width: 1px;
    height: 22px;
    background: rgba(148, 163, 184, 0.28);
    flex: 0 0 auto;
}

.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.1);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(248, 250, 252, 0.94);
    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;
}

.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-cta:hover,
.app-topbar.system-header-shell .app-topbar-cta: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 .clock_in_btn:hover,
.app-topbar.system-header-shell .clock_in_btn:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
    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 {
    outline: 2px solid rgba(147, 197, 253, 0.85);
    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;
}

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

.app-topbar.system-header-shell .app-topbar-cta {
    gap: 8px;
    padding: 0 14px;
    background: #2563eb;
    border-color: #1d4ed8;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.app-topbar.system-header-shell .app-topbar-cta:hover,
.app-topbar.system-header-shell .app-topbar-cta:focus-visible {
    background: #1d4ed8;
    border-color: #1e40af;
    color: #fff;
}

.app-topbar.system-header-shell .app-topbar-pill {
    gap: 8px;
    padding: 0 12px;
    color: rgba(226, 232, 240, 0.88);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.01em;
}

.app-topbar.system-header-shell .app-company-switch {
    max-width: min(34vw, 360px);
}

.app-topbar.system-header-shell .app-company-switch__summary {
    gap: 10px;
    padding: 3px 12px 3px 3px;
    max-width: 100%;
}

.app-topbar.system-header-shell .app-company-switch__avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 11px;
}

.app-topbar.system-header-shell .app-company-switch__text {
    display: grid;
    min-width: 0;
    line-height: 1.15;
}

.app-topbar.system-header-shell .app-company-switch__text strong {
    color: #fff;
    font-size: 13px;
    font-weight: 750;
    letter-spacing: -0.01em;
}

.app-topbar.system-header-shell .app-company-switch__text span {
    color: rgba(203, 213, 225, 0.78);
    font-size: 11px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.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 {
    border: 1px solid rgba(203, 213, 225, 0.28);
    background: #fff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    backdrop-filter: none;
}

.app-topbar.system-header-shell .app-quick-search {
    position: relative;
    width: 100%;
    max-width: 36rem;
    min-height: var(--system-header-control-h);
    height: var(--system-header-control-h);
    gap: 10px;
    padding: 0 8px 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(2, 8, 23, 0.12);
}

.app-topbar.system-header-shell .app-quick-search.is-active,
.app-topbar.system-header-shell .app-quick-search:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22), 0 10px 24px rgba(2, 8, 23, 0.14);
}

.app-topbar.system-header-shell .app-quick-search__icon {
    width: 16px;
    height: 16px;
    color: #2563eb;
}

.app-topbar.system-header-shell .app-quick-search input {
    height: calc(var(--system-header-control-h) - 2px);
    color: #0f172a;
    -webkit-text-fill-color: #0f172a;
    caret-color: #0f172a;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
}

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

.app-topbar.system-header-shell .app-quick-search input:-webkit-autofill,
.app-topbar.system-header-shell .app-quick-search input:-webkit-autofill:hover,
.app-topbar.system-header-shell .app-quick-search input:-webkit-autofill:focus {
    -webkit-text-fill-color: #0f172a;
    caret-color: #0f172a;
    box-shadow: 0 0 0 1000px #ffffff inset;
    transition: background-color 9999s ease-out;
}

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

.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__hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    padding: 0;
    background: transparent;
    color: #64748b;
    letter-spacing: 0;
}

.app-topbar.system-header-shell .app-quick-search__hint kbd,
.app-topbar.system-header-shell .app-quick-search__hint span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border: 1px solid #e2e8f0;
    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;
}

.app-topbar.system-header-shell .app-quick-search__results {
    top: calc(100% + 10px);
    padding: 8px;
    border: 1px solid rgba(203, 213, 225, 0.5);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
}

.app-topbar.system-header-shell .app-quick-search__result,
.app-topbar.system-header-shell .app-quick-search__empty {
    padding: 10px 12px;
    border-radius: 12px;
}

.app-topbar.system-header-shell .app-quick-search__result:hover {
    background: rgba(37, 99, 235, 0.08);
}

.app-topbar.system-header-shell .app-quick-search__result-title {
    font-size: 13px;
    font-weight: 750;
}

.app-topbar.system-header-shell .app-quick-search__result-meta,
.app-topbar.system-header-shell .app-quick-search__empty {
    font-size: 12px;
    font-weight: 600;
}

.app-topbar.system-header-shell .app-topbar-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.app-topbar.system-header-shell .app-topbar-status__dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
    flex: 0 0 auto;
}

.app-topbar.system-header-shell .app-topbar-status[data-tone='warn'] .app-topbar-status__dot {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.app-topbar.system-header-shell .app-topbar-status[data-tone='danger'] .app-topbar-status__dot {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.app-topbar.system-header-shell .app-topbar-status--impersonating {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

.app-topbar.system-header-shell .app-topbar-status__badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.35);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

.app-topbar.system-header-shell .app-topbar-live {
    padding: 0 4px 0 10px;
    gap: 8px;
}

.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: 12px;
    font-weight: 700;
    color: rgba(226, 232, 240, 0.9);
}

.app-topbar.system-header-shell .app-topbar-live__now {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(226, 232, 240, 0.92);
}

.app-topbar.system-header-shell .app-topbar-live__now:hover,
.app-topbar.system-header-shell .app-topbar-live__now:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

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

.app-topbar.system-header-shell .app-topbar-currency-slot {
    min-width: 148px;
    max-width: 196px;
}

.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.1);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    box-shadow: none;
}

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

.app-topbar.system-header-shell .app-topbar-notifications .notifications_count {
    top: -4px;
    right: -4px;
    min-width: 18px;
    min-height: 18px;
    border: 2px solid #0b1220;
    background: #f59e0b !important;
    color: #fff !important;
    font-size: 10px;
}

.app-topbar.system-header-shell .app-topbar-user {
    max-width: 220px;
    gap: 8px;
    padding: 3px 10px 3px 3px;
}

.app-topbar.system-header-shell .app-topbar-user__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.02em;
    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: 13px;
    font-weight: 700;
}

.app-topbar.system-header-shell .app-topbar-user > svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.app-topbar.system-header-shell .small-view-button {
    display: inline-flex;
}

.app-topbar.system-header-shell .side-bar-collapse {
    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);
}

@media (max-width: 1535px) {
    .app-topbar.system-header-shell .app-company-switch {
        max-width: min(28vw, 280px);
    }

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

@media (max-width: 1279px) {
    :root {
        --system-header-height: auto;
    }

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

    .app-topbar.system-header-shell .app-topbar__actions {
        flex-wrap: wrap;
        justify-content: flex-end;
        row-gap: 8px;
    }

    .app-topbar.system-header-shell .app-quick-search {
        max-width: none;
    }

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

@media (max-width: 991px) {
    .app-topbar.system-header-shell {
        padding: 10px 14px;
    }

    .app-topbar.system-header-shell .app-topbar__primary {
        flex-wrap: wrap;
    }

    .app-topbar.system-header-shell .app-company-switch {
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    .app-topbar.system-header-shell .app-topbar__panel {
        grid-template-columns: 1fr;
        grid-template-areas:
            'primary'
            'search'
            'actions';
        gap: 10px;
    }

    .app-topbar.system-header-shell .app-topbar__actions {
        justify-content: flex-start;
    }

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

    .app-topbar.system-header-shell .app-company-switch__summary,
    .app-topbar.system-header-shell .app-topbar-user {
        width: auto;
    }

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

[dir='rtl'] .app-topbar.system-header-shell .app-company-switch__summary {
    padding: 3px 3px 3px 12px;
}

[dir='rtl'] .app-topbar.system-header-shell .app-topbar-user {
    padding: 3px 3px 3px 10px;
}

[dir='rtl'] .app-topbar.system-header-shell .app-quick-search {
    padding: 0 12px 0 8px;
}

[dir='rtl'] .app-topbar.system-header-shell .app-topbar-live {
    padding: 0 10px 0 4px;
}

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