/* =========================================================
   CARRY AFRICA — BACK OFFICE APPLICATION SHELL
   Laptop-first operational navigation and workspace.
   ========================================================= */

:root {
    --bo-shell-sidebar-width: 274px;
    --bo-shell-sidebar-collapsed: 84px;
    --bo-shell-topbar-height: 76px;
    --bo-shell-navy-1000: #03131f;
    --bo-shell-navy-950: #061827;
    --bo-shell-navy-900: #082236;
    --bo-shell-navy-850: #0b2a40;
    --bo-shell-green: #087451;
    --bo-shell-green-bright: #10b981;
    --bo-shell-gold: #ffbf00;
    --bo-shell-page: #eef3f7;
    --bo-shell-line: #dce5ec;
    --bo-shell-ink: #102033;
    --bo-shell-muted: #6b7b8f;
    --bo-shell-shadow: 0 16px 40px rgba(4, 22, 36, .10);
}

html,
body.bo-shell-body {
    min-height: 100%;
}

body.bo-shell-body {
    margin: 0;
    overflow-x: hidden;
    color: var(--bo-shell-ink);
    background: var(--bo-shell-page);
}

.bo-shell {
    min-height: 100vh;
}

/* ------------------------- SIDEBAR ------------------------- */

.bo-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1045;
    width: var(--bo-shell-sidebar-width);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 16% 10%, rgba(16, 185, 129, .16), transparent 26%),
        linear-gradient(180deg, var(--bo-shell-navy-950), var(--bo-shell-navy-1000));
    border-right: 1px solid rgba(255,255,255,.07);
    box-shadow: 18px 0 44px rgba(3, 19, 31, .10);
    transition: width .22s ease, transform .22s ease;
}

.bo-sidebar-brand-row {
    height: var(--bo-shell-topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.bo-sidebar-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.bo-sidebar-brand:hover {
    color: #fff;
}

.bo-brand-mark {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 9px 24px rgba(0,0,0,.18);
}

.bo-brand-mark img {
    width: 31px;
    height: 31px;
    object-fit: contain;
}

.bo-brand-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1;
    white-space: nowrap;
}

.bo-brand-copy strong {
    font-size: 1.05rem;
    font-weight: 950;
    letter-spacing: .12em;
}

.bo-brand-copy small {
    margin-top: 5px;
    color: var(--bo-shell-gold);
    font-size: .65rem;
    font-weight: 850;
    letter-spacing: .18em;
}

.bo-sidebar-close {
    display: none;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: rgba(255,255,255,.08);
}

.bo-sidebar-profile {
    margin: 18px 16px 8px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 11px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 16px;
    background: rgba(255,255,255,.055);
}

.bo-sidebar-avatar,
.bo-user-avatar {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #062033;
    background: var(--bo-shell-gold);
    font-weight: 950;
}

.bo-sidebar-avatar {
    width: 38px;
    height: 38px;
    font-size: .78rem;
}

.bo-sidebar-profile-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.bo-sidebar-profile-copy strong {
    overflow: hidden;
    color: #fff;
    font-size: .82rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bo-sidebar-profile-copy small {
    margin-top: 3px;
    overflow: hidden;
    color: rgba(255,255,255,.58);
    font-size: .68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bo-sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 13px 18px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.14) transparent;
}

.bo-nav-section {
    margin-top: 16px;
}

.bo-nav-section:first-child {
    margin-top: 4px;
}

.bo-nav-section-title {
    padding: 0 12px 8px;
    color: rgba(255,255,255,.38);
    font-size: .62rem;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
    white-space: nowrap;
}

.bo-nav-link {
    position: relative;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 3px 0;
    padding: 9px 12px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 12px;
    color: rgba(255,255,255,.70);
    font-size: .79rem;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
    transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.bo-nav-link i {
    flex: 0 0 24px;
    width: 24px;
    display: grid;
    place-items: center;
    color: rgba(255,255,255,.54);
    font-size: 1rem;
}

.bo-nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.07);
    transform: translateX(2px);
}

.bo-nav-link:hover i {
    color: var(--bo-shell-gold);
}

.bo-nav-link.active {
    color: #fff;
    border-color: rgba(255,191,0,.16);
    background: linear-gradient(90deg, rgba(255,191,0,.17), rgba(255,191,0,.07));
    box-shadow: inset 3px 0 0 var(--bo-shell-gold);
}

.bo-nav-link.active i {
    color: var(--bo-shell-gold);
}

.bo-sidebar-footer {
    flex: 0 0 auto;
    padding: 14px 14px 17px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.bo-sidebar-support {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 14px;
    color: #fff;
    background: rgba(255,255,255,.05);
    text-decoration: none;
}

.bo-sidebar-support:hover {
    color: #fff;
    background: rgba(255,255,255,.09);
}

.bo-support-icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--bo-shell-gold);
    background: rgba(255,191,0,.10);
}

.bo-sidebar-signout {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    border-radius: 11px;
    color: #ffaaa5;
    font-size: .76rem;
    font-weight: 800;
    text-decoration: none;
}

.bo-sidebar-signout:hover {
    color: #fff;
    background: rgba(220,38,38,.14);
}

.bo-sidebar-version {
    margin-top: 8px;
    color: rgba(255,255,255,.28);
    font-size: .61rem;
    text-align: center;
}

/* ------------------------- WORKSPACE ------------------------- */

.bo-workspace {
    min-width: 0;
    min-height: 100vh;
    margin-left: var(--bo-shell-sidebar-width);
    transition: margin-left .22s ease;
}

.bo-topbar {
    position: sticky;
    top: 0;
    z-index: 1035;
    min-height: var(--bo-shell-topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 11px 24px;
    border-bottom: 1px solid rgba(15, 36, 53, .09);
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(18px);
    box-shadow: 0 8px 26px rgba(4,22,36,.055);
}

.bo-topbar-left,
.bo-topbar-right {
    min-width: 0;
    display: flex;
    align-items: center;
}

.bo-topbar-left {
    gap: 12px;
}

.bo-topbar-right {
    gap: 10px;
}

.bo-icon-button {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--bo-shell-line);
    border-radius: 12px;
    color: #314357;
    background: #fff;
    box-shadow: 0 5px 16px rgba(4,22,36,.06);
}

.bo-icon-button:hover {
    color: var(--bo-shell-green);
    border-color: #b8ddcf;
    background: #f4fffb;
}

.bo-mobile-menu-button {
    display: none;
}

.bo-page-context {
    min-width: 0;
}

.bo-breadcrumb-line {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--bo-shell-muted);
    font-size: .66rem;
    font-weight: 700;
}

.bo-breadcrumb-line i {
    font-size: .55rem;
}

.bo-topbar-title {
    margin-top: 2px;
    overflow: hidden;
    color: var(--bo-shell-ink);
    font-size: 1.02rem;
    font-weight: 900;
    letter-spacing: -.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bo-topbar-link,
.bo-console-state {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--bo-shell-line);
    border-radius: 11px;
    color: #405166;
    background: #fff;
    font-size: .72rem;
    font-weight: 800;
    text-decoration: none;
}

.bo-topbar-link:hover {
    color: var(--bo-shell-green);
    border-color: #b8ddcf;
    background: #f4fffb;
}

.bo-console-state-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bo-shell-green-bright);
    box-shadow: 0 0 0 5px rgba(16,185,129,.10);
}

.bo-user-button {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 9px 5px 6px;
    border: 1px solid var(--bo-shell-line);
    border-radius: 14px;
    color: var(--bo-shell-ink);
    background: #fff;
    box-shadow: 0 6px 18px rgba(4,22,36,.055);
}

.bo-user-button::after {
    margin-left: 4px;
}

.bo-user-avatar {
    width: 34px;
    height: 34px;
    font-size: .72rem;
}

.bo-user-copy {
    min-width: 0;
    line-height: 1.1;
    text-align: left;
}

.bo-user-copy strong,
.bo-user-copy small {
    display: block;
    overflow: hidden;
    max-width: 150px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bo-user-copy strong {
    font-size: .73rem;
    font-weight: 850;
}

.bo-user-copy small {
    margin-top: 3px;
    color: var(--bo-shell-muted);
    font-size: .62rem;
}

.bo-user-menu {
    width: 260px;
    padding: 8px;
    border: 1px solid var(--bo-shell-line);
    border-radius: 15px;
}

.bo-user-menu .dropdown-item {
    padding: 9px 11px;
    border-radius: 9px;
    font-size: .78rem;
}

.bo-workspace-main {
    min-height: calc(100vh - var(--bo-shell-topbar-height));
    padding: 22px 24px 46px;
}

.bo-workspace-main > .container,
.bo-workspace-main > .container-fluid {
    max-width: none;
}

.bo-shell-overlay {
    position: fixed;
    inset: 0;
    z-index: 1040;
    display: none;
    background: rgba(2, 13, 22, .58);
    backdrop-filter: blur(3px);
}

/* ------------------------- COLLAPSED DESKTOP ------------------------- */

body.bo-sidebar-collapsed .bo-sidebar {
    width: var(--bo-shell-sidebar-collapsed);
}

body.bo-sidebar-collapsed .bo-workspace {
    margin-left: var(--bo-shell-sidebar-collapsed);
}

body.bo-sidebar-collapsed .bo-sidebar-brand-row {
    justify-content: center;
    padding-inline: 12px;
}

body.bo-sidebar-collapsed .bo-brand-copy,
body.bo-sidebar-collapsed .bo-sidebar-profile-copy,
body.bo-sidebar-collapsed .bo-nav-section-title,
body.bo-sidebar-collapsed .bo-nav-link span,
body.bo-sidebar-collapsed .bo-sidebar-version {
    display: none;
}

body.bo-sidebar-collapsed .bo-sidebar-profile {
    justify-content: center;
    margin-inline: 12px;
    padding-inline: 8px;
}

body.bo-sidebar-collapsed .bo-nav-link {
    justify-content: center;
    padding-inline: 8px;
}

body.bo-sidebar-collapsed .bo-nav-link i {
    font-size: 1.08rem;
}

body.bo-sidebar-collapsed .bo-sidebar-support {
    justify-content: center;
    padding-inline: 8px;
}

body.bo-sidebar-collapsed .bo-sidebar-signout span {
    display: none;
}

/* ------------------------- RESPONSIVE ------------------------- */

@media (max-width: 1199.98px) {
    :root {
        --bo-shell-sidebar-width: 244px;
    }

    .bo-workspace-main {
        padding-inline: 18px;
    }
}

@media (max-width: 991.98px) {
    .bo-sidebar {
        width: min(294px, 88vw);
        transform: translateX(-105%);
        box-shadow: 24px 0 70px rgba(3,19,31,.34);
    }

    .bo-sidebar-close {
        display: grid;
        place-items: center;
    }

    .bo-workspace,
    body.bo-sidebar-collapsed .bo-workspace {
        margin-left: 0;
    }

    .bo-mobile-menu-button {
        display: grid;
    }

    .bo-desktop-collapse-button {
        display: none;
    }

    body.bo-sidebar-open .bo-sidebar {
        transform: translateX(0);
    }

    body.bo-sidebar-open .bo-shell-overlay {
        display: block;
    }

    .bo-topbar {
        padding-inline: 16px;
    }

    .bo-workspace-main {
        padding: 18px 14px 38px;
    }
}

@media (max-width: 575.98px) {
    .bo-breadcrumb-line {
        display: none;
    }

    .bo-topbar-title {
        font-size: .9rem;
    }

    .bo-console-state,
    .bo-topbar-link {
        display: none !important;
    }

    .bo-user-button {
        border-color: transparent;
        box-shadow: none;
    }
}

@media print {
    .bo-sidebar,
    .bo-topbar,
    .bo-shell-overlay {
        display: none !important;
    }

    .bo-workspace {
        margin-left: 0 !important;
    }

    .bo-workspace-main {
        padding: 0 !important;
    }
}
