body { min-width: 0; font-size: .875rem; }
:focus-visible { outline: 2px solid var(--info); outline-offset: 3px; }
.skip-link { position: fixed; top: .5rem; left: .5rem; z-index: 1060; padding: .7rem 1rem; background: var(--surface-raised); transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.app-shell { --sidebar-width: 250px; min-height: 100vh; }
.app-workspace { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.app-topbar {
    min-height: 63px;
    display: flex;
    align-items: center;
    gap: .875rem;
    padding: .65rem clamp(1rem, 3vw, 2.5rem);
    border-bottom: 1px solid var(--edge);
    background: var(--surface-sidebar);
}
.app-topbar .breadcrumb { --bs-breadcrumb-divider-color: var(--text-muted); --bs-breadcrumb-item-active-color: var(--text-main); font-size: .79rem; }
.app-topbar .breadcrumb a { color: var(--text-muted); text-decoration: none; }
.app-topbar .breadcrumb a:hover { color: var(--text-main); }
.topbar-avatar { margin-left: auto; }
.user-menu-toggle svg { width: 16px; height: 16px; }
.user-menu { --bs-dropdown-bg: var(--surface-raised); --bs-dropdown-border-color: var(--edge); max-width: min(18rem, 90vw); }
.user-menu .dropdown-header { white-space: normal; overflow-wrap: anywhere; }
.app-main { flex: 1; width: 100%; max-width: 1512px; padding: clamp(1rem, 3vw, 2.5rem); margin-inline: auto; }
.app-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .5rem 1rem;
    padding: .9rem clamp(1rem, 3vw, 2.5rem);
    border-top: 1px solid var(--edge);
    color: var(--text-muted);
    font-size: .73rem;
}
.app-sidebar.offcanvas-lg {
    --bs-offcanvas-width: min(300px, 90vw);
    --bs-offcanvas-bg: var(--surface-sidebar);
    --bs-offcanvas-color: var(--text-main);
    --bs-offcanvas-border-color: var(--edge);
    display: flex;
    flex-direction: column;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    min-height: 73px;
    padding: .75rem;
    border-bottom: 1px solid var(--edge);
}
.brand-link { display: flex; min-width: 0; gap: .65rem; align-items: center; color: var(--text-main); text-decoration: none; }
.brand-mark { flex: none; }
.brand-text, .profile-text { display: grid; min-width: 0; gap: .14rem; line-height: 1.25; }
.brand-text strong { font-size: .96rem; letter-spacing: -.025em; }
.brand-text small, .profile-text small { color: var(--text-muted); font-size: .67rem; }
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; padding: .75rem .65rem; }
.nav-group { margin-bottom: .75rem; }
.nav-group:last-child { margin-bottom: 0; }
.nav-group-title { margin: 0 0 .28rem; padding: 0 .55rem; color: var(--text-muted); font-size: .61rem; font-weight: 650; letter-spacing: .115em; text-transform: uppercase; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
    min-height: 34px;
    padding: .34rem .55rem;
    color: var(--text-muted);
    font-size: .715rem;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: .55rem;
    transition: background var(--motion), color var(--motion);
}
.sidebar-link svg { flex: none; width: 16px; height: 16px; }
.sidebar-link:hover { background: var(--surface-raised); color: var(--text-main); }
.sidebar-link:focus-visible { outline-offset: -2px; }
.sidebar-link.is-current { background: #8b5cf622; border-color: #8b5cf650; color: var(--accent-text); font-weight: 650; }
.sidebar-link.is-current:hover { background: #8b5cf635; color: var(--text-main); }
.sidebar-profile { display: flex; align-items: center; gap: .6rem; padding: .8rem .75rem; border-top: 1px solid var(--edge); }
.profile-text strong { font-size: .76rem; }
.profile-avatar {
    width: 34px;
    height: 34px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid #8b5cf668;
    background: #8b5cf62b;
    color: var(--accent-text);
    font-size: .69rem;
    font-weight: 700;
}
@media (min-width: 992px) {
    .app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); transition: grid-template-columns var(--motion); }
    .app-sidebar.offcanvas-lg {
        position: sticky;
        top: 0;
        height: 100vh;
        height: 100dvh;
        min-width: 0;
        background-color: var(--surface-sidebar) !important;
        border-right: 1px solid var(--edge);
    }
    .sidebar-collapsed .app-shell { --sidebar-width: 72px; }
    .sidebar-collapsed .brand-text, .sidebar-collapsed .nav-group-title,
    .sidebar-collapsed .nav-label, .sidebar-collapsed .profile-text { display: none; }
    .sidebar-collapsed .sidebar-brand, .sidebar-collapsed .sidebar-profile,
    .sidebar-collapsed .sidebar-link { justify-content: center; }
    .sidebar-collapsed .nav-group { padding-bottom: .45rem; border-bottom: 1px solid var(--edge); }
    .sidebar-collapsed .nav-group:last-child { border-bottom: 0; }
}
