/**
 * OtoSGB app shell — Phase 3.
 * Scoped to .osgb-shell so page cards, tables, and .btn stay on their own rules.
 */
.osgb-shell .sidebar {
    background: var(--osgb-color-surface, var(--surface)) !important;
    border-right: 1px solid var(--osgb-color-border, var(--border)) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.osgb-shell.layout--sidebar-ready .sidebar {
    transition: transform 180ms ease;
}
@media (max-width: 1024px) {
    .osgb-shell .sidebar {
        width: min(86vw, 320px) !important;
        max-width: min(86vw, 320px) !important;
    }
}
@media (min-width: 1025px) {
    .osgb-shell .sidebar {
        width: var(--sidebar-w, 240px) !important;
        max-width: var(--sidebar-w, 240px) !important;
    }
}
.osgb-shell .sidebar-backdrop {
    background: rgba(15, 23, 42, 0.4);
}
[data-theme="dark"] .osgb-shell .sidebar-backdrop {
    background: rgba(0, 0, 0, 0.55);
}
.osgb-shell .sidebar-brand {
    background: var(--osgb-color-surface, var(--surface));
    border-bottom: 1px solid var(--osgb-color-border, var(--border)) !important;
    height: var(--topbar-h, 56px) !important;
    min-height: var(--topbar-h, 56px) !important;
    max-height: var(--topbar-h, 56px) !important;
    flex: 0 0 var(--topbar-h, 56px) !important;
    box-sizing: border-box !important;
    padding: 0 0.85rem !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
}
.osgb-shell .sidebar-brand .brand-lockup__mark {
    width: 32px !important;
    height: 32px !important;
    flex-basis: 32px !important;
}
.osgb-shell .sidebar-brand__logo {
    height: calc(var(--topbar-h, 56px) - 16px) !important;
    max-height: calc(var(--topbar-h, 56px) - 16px) !important;
    width: auto !important;
}
.osgb-shell .app-shell > .topbar:not(.topbar--guest) {
    height: var(--topbar-h, 56px) !important;
    min-height: var(--topbar-h, 56px) !important;
    max-height: var(--topbar-h, 56px) !important;
    box-sizing: border-box !important;
    background: var(--osgb-color-surface, var(--surface)) !important;
    border-bottom: 1px solid var(--osgb-color-border, var(--border)) !important;
    border-left: none !important;
    box-shadow: none !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    color: var(--osgb-color-text, var(--text));
}
@media (min-width: 1025px) {
    .osgb-shell.layout--sidebar-open .sidebar,
    html.sidebar-pref-open .osgb-shell .sidebar {
        transform: translateX(0) !important;
    }
}
.osgb-shell footer.app-footer,
.osgb-shell .app-footer {
    padding-bottom: calc(2.75rem + env(safe-area-inset-bottom, 0px)) !important;
}
.osgb-shell .sidebar-footer {
    background: var(--osgb-color-surface, var(--surface));
    border-top: 1px solid var(--osgb-color-border, var(--border));
}
.osgb-shell .sidebar .nav-group-title,
.osgb-shell .sidebar .nav-section-label {
    color: var(--osgb-color-muted, var(--muted)) !important;
    font-size: 11px !important;
    font-weight: 650 !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.osgb-shell .sidebar .acc-btn {
    border-radius: var(--osgb-radius-sm, 6px) !important;
    color: var(--osgb-color-text-secondary, var(--text-secondary)) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    min-height: 36px;
}
.osgb-shell .sidebar .acc-btn:hover {
    background: var(--osgb-color-surface-muted, var(--surface-muted)) !important;
    color: var(--osgb-color-text, var(--text)) !important;
}
.osgb-shell .sidebar button.acc-btn.is-open {
    background: transparent !important;
    color: var(--osgb-color-text, var(--text)) !important;
    box-shadow: none !important;
}
.osgb-shell .sidebar a.acc-btn.is-open {
    background: color-mix(in srgb, var(--osgb-color-primary, var(--primary)) 12%, var(--osgb-color-surface, var(--surface))) !important;
    color: var(--osgb-color-primary, var(--primary)) !important;
    box-shadow: none !important;
}
.osgb-shell .sidebar .sidebar-nav-icon {
    width: 18px !important;
    height: 18px !important;
    color: var(--osgb-color-muted, var(--muted));
}
.osgb-shell .sidebar .acc-btn.is-open .sidebar-nav-icon,
.osgb-shell .sidebar .nav a.active .sidebar-nav-icon {
    color: var(--osgb-color-primary, var(--primary));
}
.osgb-shell .sidebar .nav a,
.osgb-shell .sidebar .acc-list a {
    border-radius: var(--osgb-radius-sm, 6px) !important;
    color: var(--osgb-color-text-secondary, var(--text-secondary));
    font-size: 13px !important;
    min-height: 32px;
}
.osgb-shell .sidebar .nav a:hover,
.osgb-shell .sidebar .acc-list a:hover {
    background: var(--osgb-color-surface-muted, var(--surface-muted)) !important;
    color: var(--osgb-color-text, var(--text)) !important;
}
.osgb-shell .sidebar .nav a.active {
    background: color-mix(in srgb, var(--osgb-color-primary, var(--primary)) 12%, var(--osgb-color-surface, var(--surface))) !important;
    color: var(--osgb-color-primary, var(--primary)) !important;
    box-shadow: none !important;
    font-weight: 650 !important;
}
.osgb-shell .sidebar .acc-list {
    border-left-color: var(--osgb-color-border, var(--border));
}
.osgb-shell .sidebar a:focus:not(:focus-visible),
.osgb-shell .sidebar button:focus:not(:focus-visible),
.osgb-shell .topbar a:focus:not(:focus-visible),
.osgb-shell .topbar button:focus:not(:focus-visible) {
    outline: none;
}
.osgb-shell .sidebar a:focus-visible,
.osgb-shell .sidebar button:focus-visible,
.osgb-shell .topbar a:focus-visible,
.osgb-shell .topbar button:focus-visible {
    outline: 2px solid var(--osgb-color-primary, var(--primary));
    outline-offset: 2px;
}

.osgb-shell .topbar-crumb__current {
    font-size: 14px;
    font-weight: 650;
    color: var(--osgb-color-text, var(--text));
}
.osgb-shell .topbar-notif-btn,
.osgb-shell .profile-btn,
.osgb-shell .topbar-sidebar-toggle {
    min-width: 36px;
    min-height: 36px;
}
.osgb-shell .topbar-menu {
    max-width: min(18rem, calc(100vw - 1rem));
    background: var(--osgb-color-surface, var(--surface));
    border: 1px solid var(--osgb-color-border, var(--border));
    border-radius: var(--osgb-radius-md, 8px);
    box-shadow: var(--osgb-shadow-pop, 0 4px 16px rgba(15, 23, 42, 0.1));
}
.osgb-shell .topbar-menu a,
.osgb-shell .topbar-menu button {
    min-height: 36px;
    border-radius: var(--osgb-radius-sm, 6px);
    font-size: 13px;
}
.osgb-shell .topbar-menu a:hover,
.osgb-shell .topbar-menu button:hover {
    background: var(--osgb-color-surface-muted, var(--surface-muted));
}

.osgb-shell .app-shell > main.osgb-shell__main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: clip;
    padding: 16px !important;
}
@media (min-width: 768px) {
    .osgb-shell .app-shell > main.osgb-shell__main {
        padding: 20px !important;
    }
}
@media (min-width: 1025px) {
    .osgb-shell .app-shell > main.osgb-shell__main {
        padding: 24px !important;
    }
}

.osgb-shell footer.app-footer {
    background: var(--osgb-color-surface, var(--surface)) !important;
    border-top: 1px solid var(--osgb-color-border, var(--border)) !important;
    color: var(--osgb-color-muted, var(--muted));
    padding: 0.75rem 1rem !important;
}

.osgb-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin: 0 0 1rem;
    min-width: 0;
}
.osgb-page-header__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--osgb-color-text, var(--text));
    line-height: 1.25;
}
.osgb-page-header__desc {
    margin: 0.25rem 0 0;
    max-width: 42rem;
    font-size: 13px;
    color: var(--osgb-color-muted, var(--muted));
}
.osgb-page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

@media (prefers-reduced-motion: reduce) {
    .osgb-shell .sidebar,
    .osgb-shell .app-shell,
    .osgb-shell .acc-chevron-icon,
    .osgb-shell .topbar-menu {
        transition: none !important;
    }
}
