/*
 * Hosts shell visual bridge to /services/.
 * Loaded AFTER hosts.css so the developer's existing page/card/form/table CSS stays intact.
 * Only shell navigation/footer/mobile chrome is overridden here.
 */
:root {
    --bd-shell-navy: #071f3b;
    --bd-shell-green: #06c768;
    --bd-shell-green-dark: #00a957;
    --bd-shell-line: #dce7ec;
    --bd-shell-text: #0a2342;
    --bd-shell-muted: #58708a;
    --bd-shell-sidebar: 250px;
}

.bd-shell-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Desktop shell: exact /services/ sidebar geometry, while leaving page content styling alone. */
.sidebar {
    width: var(--bd-shell-sidebar);
    flex: 0 0 var(--bd-shell-sidebar);
    min-height: 100vh;
    height: 100vh;
    padding: 0;
    gap: 0;
    background: var(--bd-shell-navy);
    border-right: 1px solid rgba(220,231,236,.24);
    color: #d7e0e8;
}
.sidebar__top {
    min-height: 82px;
    padding: 0 22px;
    gap: 0;
    align-items: center;
    justify-content: flex-start;
}
.bd-shell-brand {
    display: inline-flex;
    align-items: center;
    width: auto;
    overflow: visible;
    line-height: 0;
}
.bd-shell-brand:hover { text-decoration: none; }
.bd-shell-brand img {
    display: block;
    width: 174px;
    height: auto;
    max-width: none;
}
/* /services/ has no desktop rail control. Keep the developer hook in the markup/JS but hide it visually. */
.collapse-btn { display: none !important; }

.menu.bd-shell-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 18px 22px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.menu.bd-shell-menu .menu__item {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 8px;
    border: 0;
    border-radius: 7px;
    color: #d7e0e8;
    background: transparent;
    text-decoration: none;
    text-align: left;
    font-weight: 550;
    font-size: 14px;
    line-height: 1.2;
    letter-spacing: 0;
    white-space: nowrap;
    transition: background-color .18s ease, color .18s ease;
}
.menu.bd-shell-menu .menu__item:hover,
.menu.bd-shell-menu .menu__item:focus-visible {
    color: var(--bd-shell-green);
    background: rgba(255,255,255,.06);
    text-decoration: none;
    outline: none;
}
.menu.bd-shell-menu .menu__item.is-active {
    color: var(--bd-shell-green);
    background: transparent;
    font-weight: 650;
}
.menu.bd-shell-menu .menu__item .icon,
.menu.bd-shell-menu .menu__item:hover .icon,
.menu.bd-shell-menu .menu__item.is-active .icon {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    color: currentColor;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.menu.bd-shell-menu .menu__label { overflow: visible; }
.menu.bd-shell-menu .menu__item--logout:hover,
.menu.bd-shell-menu .menu__item--logout:focus-visible,
.menu.bd-shell-menu .menu__item--logout:hover .icon {
    color: var(--bd-shell-green);
}

.bd-shell-nav-group { display: flex; flex-direction: column; gap: 0; }
.bd-shell-billing-row { position: relative; display: flex; align-items: stretch; }
.bd-shell-billing-link { padding-right: 38px !important; }
.bd-shell-nav-toggle {
    position: absolute;
    z-index: 2;
    top: 0;
    right: 0;
    width: 38px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0 8px 0 4px;
    border: 0;
    background: transparent;
    color: #d7e0e8;
    cursor: pointer;
}
.bd-shell-nav-toggle:hover,
.bd-shell-nav-toggle:focus-visible { color: var(--bd-shell-green); outline: none; }
.bd-shell-chevron {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .18s ease;
}
.bd-shell-nav-toggle[aria-expanded="true"] .bd-shell-chevron { transform: rotate(180deg); }
.bd-shell-submenu[hidden] { display: none !important; }
.bd-shell-subitem {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 34px;
    margin: 0 0 2px 38px;
    padding: 6px 10px 6px 14px;
    color: #c7d2db;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 550;
    text-decoration: none;
    border-radius: 6px;
    transition: color .18s ease, background-color .18s ease;
}
.bd-shell-subitem::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 9px;
    bottom: 9px;
    width: 2px;
    border-radius: 2px;
    background: rgba(6,199,104,.55);
}
.bd-shell-subitem:hover,
.bd-shell-subitem:focus-visible,
.bd-shell-subitem.is-active {
    color: var(--bd-shell-green);
    background: rgba(255,255,255,.06);
    text-decoration: none;
    outline: none;
}
.menu.bd-shell-menu .menu__sep.bd-shell-separator {
    height: 1px;
    width: auto;
    margin: 10px 8px 6px;
    padding: 0;
    border: 0;
    background: rgba(199,210,219,.28);
}

/* Neutralise any remembered developer rail state without deleting its code or localStorage behaviour. */
.app.is-collapsed .sidebar {
    width: var(--bd-shell-sidebar);
    flex-basis: var(--bd-shell-sidebar);
    padding: 0;
}
.app.is-collapsed .bd-shell-brand { opacity: 1; width: auto; }
.app.is-collapsed .sidebar__top { justify-content: flex-start; }
.app.is-collapsed .menu.bd-shell-menu .menu__item {
    justify-content: flex-start;
    padding: 8px;
    gap: 12px;
}
.app.is-collapsed .menu.bd-shell-menu .menu__label { display: inline; }

/* Footer: same white /services/ footer layout and dimensions. */
.bd-shell-footer {
    margin: 0;
    padding: 0;
    border: 0;
    border-top: 1px solid var(--bd-shell-line);
    background: #fff;
    color: var(--bd-shell-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.bd-shell-footer-inner {
    width: 80%;
    max-width: none;
    margin: 0 auto;
    padding: 18px 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
}
.bd-shell-footer-brand {
    display: block;
    margin: 0 0 5px;
    padding: 0;
    line-height: 0;
    text-decoration: none;
}
.bd-shell-footer-brand:hover { text-decoration: none; }
.bd-shell-footer-brand img {
    display: block;
    width: 155px;
    height: 31px;
    max-width: none;
    margin: 0;
    padding: 0;
    object-fit: contain;
}
.bd-shell-footer-socials {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 8px;
    padding: 0;
}
.bd-shell-footer-socials a {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(6,199,104,.55);
    border-radius: 8px;
    color: var(--bd-shell-green);
    text-decoration: none;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.bd-shell-footer-socials a:hover,
.bd-shell-footer-socials a:focus-visible {
    background: var(--bd-shell-green);
    border-color: var(--bd-shell-green);
    color: #fff;
    text-decoration: none;
    outline: none;
}
.bd-shell-footer-socials svg { width: 16px; height: 16px; fill: currentColor; }
.bd-shell-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 7px;
    margin: 0 0 7px;
    color: #173653;
    font-size: .84rem;
    font-weight: 650;
}
.bd-shell-footer-links a { color: inherit; text-decoration: none; }
.bd-shell-footer-links a:hover,
.bd-shell-footer-links a:focus-visible { color: var(--bd-shell-green); text-decoration: none; outline: none; }
.bd-shell-footer-links span,
.bd-shell-footer-divider { color: #9aa9b7; }
.bd-shell-footer-copy {
    margin: 0;
    color: var(--bd-shell-muted);
    font-size: .88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* The Hosts shell already uses a flex main column; keep the footer at the bottom on short pages. */
.main { min-height: 100vh; }
.content { flex: 1 1 auto; }

/* Match /services/ 900px mobile breakpoint while reusing the developer's existing drawer JS hooks. */
@media (min-width: 901px) and (max-width: 1024px) {
    .sidebar {
        position: sticky;
        top: 0;
        left: auto;
        height: 100vh;
        transform: none;
        box-shadow: none;
    }
    .app.drawer-open .sidebar { transform: none; }
    .hamburger { display: none; }
    .content { padding: 30px 34px 48px; }
    .scrim { display: none; }
}

@media (max-width: 900px) {
    .app { display: block; overflow-x: visible; }
    .sidebar,
    .app.is-collapsed .sidebar {
        position: fixed;
        inset: 0 0 auto 0;
        z-index: 60;
        width: 100%;
        height: 74px;
        min-height: 74px;
        padding: 0;
        transform: none;
        box-shadow: none;
        border-right: 0;
        border-bottom: 1px solid rgba(220,231,236,.24);
        overflow: visible;
    }
    .sidebar__top,
    .app.is-collapsed .sidebar__top {
        min-height: 74px;
        padding: 0 16px;
        justify-content: flex-start;
    }
    .bd-shell-brand img { width: 165px; }
    .menu.bd-shell-menu,
    .app.is-collapsed .menu.bd-shell-menu {
        position: absolute;
        top: 74px;
        left: 0;
        right: 0;
        display: none;
        padding: 12px 16px 18px;
        background: var(--bd-shell-navy);
        border-bottom: 1px solid rgba(220,231,236,.24);
        box-shadow: 0 16px 30px rgba(7,31,59,.12);
    }
    .app.drawer-open .menu.bd-shell-menu { display: flex; }
    .app.is-collapsed .menu.bd-shell-menu .menu__item {
        justify-content: flex-start;
        padding: 8px;
        gap: 12px;
    }
    .hamburger,
    .hamburger.hamburger--banner {
        display: grid;
        position: fixed;
        top: 17px;
        right: 16px;
        left: auto;
        z-index: 70;
        width: 40px;
        height: 40px;
        padding: 8px;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: #c7d2db;
        box-shadow: none;
    }
    .hamburger .icon { width: 24px; height: 24px; stroke-width: 1.7; }
    .main { width: 100%; min-height: 100vh; padding-top: 74px; }
    .content { padding: 30px 18px 40px; }
    .scrim { display: none; }
    body:has(.hamburger--banner) .sidebar { top: 37px; }
    body:has(.hamburger--banner) .hamburger--banner { top: 54px; }
    body:has(.hamburger--banner) .main { padding-top: 111px; }
}

@media (max-width: 600px) {
    .content { padding: 30px 14px 36px; }
    .bd-shell-footer-inner { width: calc(100% - 28px); padding: 18px 14px 14px; }
    .bd-shell-footer-links { flex-direction: column; gap: 8px; font-size: .9rem; }
    .bd-shell-footer-links span { display: none; }
    .bd-shell-footer-copy { gap: 6px; line-height: 1.45; }
}

@media (prefers-reduced-motion: reduce) {
    .menu.bd-shell-menu *,
    .bd-shell-footer * { transition: none !important; }
}

/* Full-height desktop sidebar: pin the existing developer shell to the viewport without changing its menu logic. */
@media (min-width: 901px) {
    .sidebar,
    .app.is-collapsed .sidebar {
        position: fixed !important;
        top: 0;
        right: auto;
        bottom: 0;
        left: 0;
        width: var(--bd-shell-sidebar);
        height: 100dvh;
        min-height: 100dvh;
        max-height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* Fixed sidebar leaves normal flex flow, so reserve exactly the same 250px column for it. */
    .app {
        padding-left: var(--bd-shell-sidebar);
    }

    /* Preserve the developer's admin-impersonation banner instead of covering it. */
    body:has(.hamburger--banner) .sidebar,
    body:has(.hamburger--banner) .app.is-collapsed .sidebar {
        top: 37px;
        height: calc(100dvh - 37px);
        min-height: calc(100dvh - 37px);
        max-height: calc(100dvh - 37px);
    }
}

/* Mobile remains the existing top-bar/drawer layout; remove the desktop column reservation. */
@media (max-width: 900px) {
    .app {
        padding-left: 0;
    }
    .sidebar,
    .app.is-collapsed .sidebar {
        max-height: none;
        overflow: visible;
    }
}

/* 20 Nov 2026: Remove excess blank space above the Host page titles on phones.
   Keep the fixed mobile header's full 74px clearance; only its content's
   internal top padding needs to be smaller. A real admin banner still keeps
   the additional header clearance defined in the existing rules above. */
@media (max-width: 900px) {
    body:has(> .app:first-child) .main { padding-top: 74px; }
    .app .content { padding-top: 12px; }
}
