/*
========================================================================
MASTER SUITE — ENTERPRISE TOPBAR
Sprint UI-004C

Canonical owner of topbar geometry, breadcrumb, global search,
action buttons, theme launcher and profile alignment.

Official symbols remain in the real HTML and are not replaced here.
========================================================================
*/

:root {
    --ms-topbar-height: 43px;
    --ms-topbar-gap: 9px;
    --ms-topbar-padding-x: 14px;
    --ms-topbar-control-size: 29px;
    --ms-topbar-search-width: 390px;
}

.topbar {
    position: relative;
    z-index: var(--ms-z-topbar, 20);
    min-width: 0;
    height: var(--ms-topbar-height);
    display: flex;
    align-items: center;
    gap: var(--ms-topbar-gap);
    padding: 0 var(--ms-topbar-padding-x);
    background: var(--navy);
    color: #fff;
}

/* Breadcrumb */
.topbar .breadcrumb {
    min-width: 0;
    max-width: min(360px, 28vw);
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    font-size: 10px;
}

.topbar .breadcrumb span {
    flex: 0 0 auto;
    padding: 0 6px;
    color: #8da2b7;
}

.topbar .breadcrumb strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Global search */
.topbar .global-search {
    min-width: 160px;
    width: min(var(--ms-topbar-search-width), 32vw);
    height: var(--ms-topbar-control-size);
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 9px;
    border: 1px solid #2f4d69;
    border-radius: 6px;
    background: #0a2a48;
}

.topbar .global-search > span {
    flex: 0 0 auto;
}

.topbar .global-search input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
}

.topbar .global-search input::placeholder {
    color: #b8c6d4;
}

.topbar .global-search kbd {
    flex: 0 0 auto;
    padding: 3px 5px;
    border: 1px solid #426079;
    border-radius: 4px;
    color: #cbd7e3;
    font-size: 8px;
}

/* Topbar actions */
.topbar .quick-create,
.topbar .top-icon {
    flex: 0 0 var(--ms-topbar-control-size);
    width: var(--ms-topbar-control-size);
    height: var(--ms-topbar-control-size);
    min-width: var(--ms-topbar-control-size);
    padding: 0;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #fff;
    line-height: 1;
}

.topbar .quick-create {
    background: var(--gold);
    color: #102238;
    font-size: 18px;
}

.topbar .top-icon:hover {
    background: #123654;
}

/* Theme launcher is visually governed by the topbar. */
.topbar #msThemeLauncher.foundation-theme-topbar {
    position: static !important;
    inset: auto !important;
    z-index: auto !important;
    flex: 0 0 var(--ms-topbar-control-size);
    width: var(--ms-topbar-control-size) !important;
    height: var(--ms-topbar-control-size) !important;
    min-width: var(--ms-topbar-control-size) !important;
    min-height: var(--ms-topbar-control-size) !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-grid !important;
    place-items: center !important;
    border: 1px solid rgba(244,189,43,.85) !important;
    border-radius: 999px !important;
    background: var(--gold) !important;
    color: #10243a !important;
    box-shadow: none !important;
    font-size: 15px !important;
}

.topbar #msThemeLauncher.foundation-theme-topbar:hover {
    transform: none !important;
    filter: brightness(1.04);
}

/* Profile */
.topbar .profile {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    margin-left: 3px;
}

.topbar .avatar {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--gold);
    color: #14283f;
    font-weight: 900;
}

.topbar .profile > div:nth-child(2) {
    min-width: 0;
}

.topbar .profile strong,
.topbar .profile small {
    display: block;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar .profile strong {
    font-size: 9px;
}

.topbar .profile small {
    font-size: 7px;
    color: #cbd7e3;
}

/* Responsive behavior without changing the approved desktop layout. */
@media (max-width: 1120px) {
    .topbar .breadcrumb {
        max-width: 210px;
    }

    .topbar .global-search {
        width: min(310px, 29vw);
    }

    .topbar .profile small {
        display: none;
    }
}

@media (max-width: 900px) {
    .topbar .breadcrumb {
        max-width: 170px;
    }

    .topbar .global-search {
        min-width: 130px;
        width: auto;
    }

    .topbar .global-search kbd,
    .topbar .profile > div:nth-child(2) {
        display: none;
    }
}

@media (max-width: 700px) {
    .topbar {
        gap: 6px;
        padding-left: 9px;
        padding-right: 9px;
    }

    .topbar .breadcrumb {
        display: none;
    }

    .topbar .global-search {
        margin-left: 0;
        flex: 1 1 auto;
    }

    .topbar .top-icon:nth-of-type(3),
    .topbar .top-icon:nth-of-type(4) {
        display: none;
    }
}
