/* Navegação administrativa: cabeçalho e sessão ficam fixos; só a lista rola. */
.shell { --sidebar-width: 278px; }

.shell .sidebar {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border-right: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    color: hsl(var(--card-foreground));
}

.shell .brand,
.shell .drawer-content > .brand {
    flex: none;
    gap: 12px;
    margin: 0;
    padding: 24px 20px 20px;
    border-bottom: 1px solid hsl(var(--border));
}
.shell .brand-mark {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border: 1px solid hsl(var(--primary) / .35);
    border-radius: 12px;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    box-shadow: 0 4px 14px hsl(var(--primary) / .16);
    font-size: 13px;
    letter-spacing: .02em;
}
.shell .brand span {
    color: hsl(var(--muted-foreground));
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.shell .brand strong {
    color: hsl(var(--foreground));
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.025em;
}

.shell .sidebar-nav-region {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    padding: 10px 8px 4px 12px;
    overflow: hidden;
}
.shell .sidebar-nav-region::after {
    position: absolute;
    right: 16px;
    bottom: 4px;
    left: 12px;
    height: 17px;
    background: linear-gradient(transparent, hsl(var(--card)));
    content: "";
    pointer-events: none;
}
.shell .section-nav {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    padding: 0 4px 24px 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: hsl(var(--muted-foreground) / .45) transparent;
}
.shell .section-nav::-webkit-scrollbar { width: 9px; }
.shell .section-nav::-webkit-scrollbar-track { background: transparent; }
.shell .section-nav::-webkit-scrollbar-thumb {
    border: 2px solid hsl(var(--card));
    border-radius: 999px;
    background: hsl(var(--muted-foreground) / .4);
}
.shell .section-nav::-webkit-scrollbar-thumb:hover { background: hsl(var(--primary) / .7); }
.shell .nav-group { gap: 3px; padding: 12px 0 14px; }
.shell .nav-group + .nav-group { border-top: 1px solid hsl(var(--border) / .65); }
.shell .nav-group-label {
    padding: 0 11px 8px;
    color: hsl(var(--muted-foreground));
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .11em;
    text-transform: uppercase;
}
.shell .section-nav a {
    gap: 10px;
    min-height: 43px;
    margin-right: 2px;
    padding: 6px 9px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: hsl(var(--muted-foreground));
    font-size: 13px;
    font-weight: 550;
    line-height: 1.2;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.shell .section-nav a > span:not(.nav-badge) { min-width: 0; white-space: normal; }
.shell .section-nav a .nav-icon {
    flex: 0 0 29px;
    width: 29px;
    height: 29px;
    padding: 6px;
    border-radius: 8px;
    background: hsl(var(--muted) / .65);
    color: hsl(var(--muted-foreground));
    opacity: 1;
}
.shell .section-nav a:hover {
    border-color: hsl(var(--border));
    background: hsl(var(--accent) / .65);
    color: hsl(var(--foreground));
}
.shell .section-nav a.active {
    border-color: hsl(var(--primary) / .2);
    background: hsl(var(--primary) / .1);
    color: hsl(var(--foreground));
    box-shadow: none;
    font-weight: 700;
}
.shell .section-nav a.active::before {
    display: block;
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: 0;
    width: 3px;
    height: auto;
    border-radius: 999px;
    background: hsl(var(--primary));
    content: "";
}
.shell .section-nav a.active .nav-icon {
    background: hsl(var(--primary) / .16);
    color: hsl(var(--primary));
}
.shell .section-nav a:focus-visible,
.shell .sidebar-footer :is(button, a):focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}
.shell .nav-badge {
    border: 1px solid hsl(var(--border));
    border-radius: 999px;
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.shell .sidebar-footer,
.shell .drawer-content > .sidebar-footer {
    flex: none;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin: 0;
    padding: 16px 20px 18px;
    border: 0;
    border-top: 1px solid hsl(var(--border));
    border-radius: 0;
    background: hsl(var(--muted) / .25);
}
.shell .sidebar-footer .secure { color: hsl(var(--muted-foreground)); font-size: 11px; }
.shell .sidebar-footer .secure i { background: #16a34a; }
.shell .sidebar-footer button.theme-toggle {
    min-height: 38px;
    border-radius: 8px !important;
    background: hsl(var(--card)) !important;
}
.shell.shell .sidebar-footer button.ghost {
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid hsl(var(--border));
    border-radius: 7px;
    background: hsl(var(--card));
    color: hsl(var(--foreground));
}

/* A gaveta móvel usa a mesma lista e o mesmo scroll independente. */
.shell .navigation-drawer {
    width: min(340px, calc(100vw - 16px));
    padding: 0;
    overflow: hidden;
    border-right: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    color: hsl(var(--foreground));
}
.shell .navigation-drawer[open] { gap: 0; }
.shell .navigation-drawer > header {
    flex: none;
    min-height: 56px;
    padding: 8px 16px 8px 20px;
    border-bottom: 1px solid hsl(var(--border));
}
.shell .navigation-drawer > header h2 { color: hsl(var(--foreground)); font-size: 13px; }
.shell .navigation-drawer > header button { color: hsl(var(--foreground)); }
.shell .drawer-content { flex: 1 1 auto; gap: 0; min-height: 0; overflow: hidden; }
.shell .drawer-content > .brand { padding: 16px 20px; }
.shell .drawer-content .sidebar-nav-region { min-height: 0; }

@media (max-width: 959.98px) {
    .shell .sidebar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .shell .section-nav a { transition: none; }
}
