/* ============================================================================
   PR 7 - sidebar
   Per DOCS/ci3-theme-migration/LAYOUT_RECONSTRUCTION_GUIDE.md § 4.2.
   Scoped under body.theme-new so the legacy admin (flag off) is untouched.
   ============================================================================ */

body.theme-new .app-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    overflow-x: hidden;
    /* Smooth scroll for programmatic scrollTo() — layout.js anchors the
       clicked parent near the top when a submenu opens so the user keeps
       visual context. Honours prefers-reduced-motion via the @media block
       below. */
    scroll-behavior: smooth;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-soft);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.25);
    z-index: 1020;
    transition: width var(--transition-speed) ease,
                transform var(--transition-speed) ease;
}
@media (prefers-reduced-motion: reduce) {
    body.theme-new .app-sidebar { scroll-behavior: auto; }
    body.theme-new .app-sidebar__submenu.collapsing { transition-duration: 0s !important; }
    body.theme-new .app-sidebar__chevron { transition-duration: 0s; }
}

body.theme-new .app-sidebar__inner {
    padding: 12px 0 24px;
}

/* ----- Search ----- */
body.theme-new .app-sidebar__search {
    position: relative;
    margin: 4px 12px 12px;
}
body.theme-new .app-sidebar__search i {
    position: absolute;
    left: 10px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
}
body.theme-new .app-sidebar__search input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    padding: 7px 10px 7px 32px;
    font-size: 13px;
    outline: 0;
    transition: border-color var(--transition-speed) ease,
                box-shadow var(--transition-speed) ease;
}
body.theme-new .app-sidebar__search input::placeholder {
    color: var(--input-placeholder);
}
body.theme-new .app-sidebar__search input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-focus);
}

/* ----- Section title ----- */
body.theme-new .app-sidebar__section-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 14px 20px 6px;
}

/* ----- Lists ----- */
body.theme-new .app-sidebar__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ----- Items ----- */
body.theme-new .app-sidebar__item {
    position: relative;
}

/* ----- Section dividers (Main Menu configurator) -----
   Admin-created visual separators between top-level items. Not a
   link, not collapsible — just a small uppercase label with an
   optional leading icon and a thin top border. */
body.theme-new .app-sidebar__section {
    list-style: none;
    margin: 14px 12px 4px;
    padding: 8px 6px 4px;
    border-top: 1px solid var(--border-color, rgba(127,127,127,0.18));
    pointer-events: none;
}
body.theme-new .app-sidebar__section:first-child {
    border-top: 0;
    margin-top: 4px;
}
body.theme-new .app-sidebar__section .app-sidebar__section-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted, #8a8f9b);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.4;
}
body.theme-new .app-sidebar__section .app-sidebar__section-icon {
    font-size: 12px;
    opacity: 0.8;
}

/* ----- Per-staff pinned section accent -----
   The "PINNED" divider populated by app_admin_sidebar_inject_pins().
   Slightly tinted background + primary-colored icon so it reads as
   a personal area, not just another admin-created divider. */
body.theme-new .app-sidebar__section[data-section="__section_pinned"] {
    border-top-color: var(--primary, #2980b9);
    border-top-width: 2px;
}
body.theme-new .app-sidebar__section[data-section="__section_pinned"] .app-sidebar__section-icon {
    color: var(--primary, #2980b9);
    opacity: 1;
}

/* ----- Right-click context menu for per-staff pin / unpin -----
   Spawned by sidebar_pins.js when the user right-clicks any
   sidebar item. Appended to <body> at the cursor position. */
.sidebar-pin-menu {
    position: fixed;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
    min-width: 160px;
    padding: 4px 0;
    z-index: 99999;
    font-size: 13px;
    user-select: none;
}
.sidebar-pin-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 16px;
    background: transparent;
    border: 0;
    text-align: left;
    color: #2c3e50;
    cursor: pointer;
    font-weight: 500;
}
.sidebar-pin-menu__item:hover {
    background: #f3f6fa;
    color: var(--primary, #2980b9);
}
.sidebar-pin-menu__item i {
    font-size: 12px;
    color: var(--primary, #2980b9);
    width: 14px;
    text-align: center;
}

body.theme-new .app-sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin: 2px 8px;
    color: var(--text-main);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--transition-speed) ease,
                color var(--transition-speed) ease;
    white-space: nowrap;
}
body.theme-new .app-sidebar__link:hover,
body.theme-new .app-sidebar__link:focus {
    background: var(--primary-tint);
    color: var(--primary-color);
    text-decoration: none;
}

body.theme-new .app-sidebar__icon {
    font-size: 16px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

body.theme-new .app-sidebar__icon-img,
body.theme-new .app-sidebar__icon-lord {
    width: 22px !important;
    height: 22px !important;
    flex-shrink: 0;
    object-fit: contain;
}

body.theme-new .app-sidebar__label {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Right-side badge */
body.theme-new .app-sidebar__badge {
    margin-left: auto;
    font-size: 10px !important;
    font-weight: 600;
    padding: 2px 7px !important;
    border-radius: 999px;
}

/* Chevron rotates when expanded (BS3 sets aria-expanded automatically).
   Synced with the submenu's expand duration for a unified feel. */
body.theme-new .app-sidebar__chevron {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: 6px;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
body.theme-new .app-sidebar__link[aria-expanded="true"] .app-sidebar__chevron {
    transform: rotate(180deg);
    color: var(--primary-color);
}

/* ----- Focus on the open branch -----
   When a parent submenu is open, dim every top-level sibling so the eye
   locks onto the open path through pure contrast (no extra chrome). The
   parent link keeps a small primary-tint background + left rail as a
   subtle identity marker. Requires :has() (Chrome 105+, Safari 15.4+,
   Firefox 121+). Suppressed in collapsed-icon-rail mode. */

body.theme-new .app-sidebar__link[aria-expanded="true"]:not(.app-sidebar__link--sub) {
    background: var(--primary-tint);
    color: var(--text-heading);
    box-shadow: inset 3px 0 0 var(--primary-color);
}
body.theme-new .app-sidebar__link[aria-expanded="true"]:not(.app-sidebar__link--sub) .app-sidebar__icon {
    color: var(--primary-color);
}

body.theme-new:not(.sidebar-collapsed)
    .app-sidebar__nav
    .app-sidebar__list:not(.app-sidebar__list--sub):has(.app-sidebar__link[aria-expanded="true"])
    > .app-sidebar__item:not(:has(> .app-sidebar__link[aria-expanded="true"])) {
    opacity: 0.55;
    transition: opacity 0.3s var(--ease-standard);
}
body.theme-new:not(.sidebar-collapsed)
    .app-sidebar__nav
    .app-sidebar__list:not(.app-sidebar__list--sub):has(.app-sidebar__link[aria-expanded="true"])
    > .app-sidebar__item:not(:has(> .app-sidebar__link[aria-expanded="true"])):hover {
    opacity: 1;
}

/* ----- Active state ----- */
body.theme-new .app-sidebar__item.is-active > .app-sidebar__link,
body.theme-new .app-sidebar__item.active > .app-sidebar__link {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-focus);
}
body.theme-new .app-sidebar__item.is-active > .app-sidebar__link .app-sidebar__icon,
body.theme-new .app-sidebar__item.is-active > .app-sidebar__link .app-sidebar__chevron,
body.theme-new .app-sidebar__item.active > .app-sidebar__link .app-sidebar__icon,
body.theme-new .app-sidebar__item.active > .app-sidebar__link .app-sidebar__chevron {
    color: #fff;
}

body.theme-new .app-sidebar__list--sub .app-sidebar__item.is-active > .app-sidebar__link,
body.theme-new .app-sidebar__list--sub .app-sidebar__item.active > .app-sidebar__link {
    background: var(--primary-700);
    color: #fff;
}

/* ----- Submenu (BS3 .collapse) -----
   Override BS3's default `.collapsing { transition: height .35s ease }`
   with a softer ease-out so the menu unfurls instead of snapping. */
body.theme-new .app-sidebar__submenu {
    position: relative;
    margin: 2px 16px 6px 28px;
}

body.theme-new .app-sidebar__submenu.collapsing {
    /* Slower + smoother than BS3's default (0.35s ease) so a long submenu
       (e.g. OmniU with 25+ entries) unfurls deliberately instead of snapping
       open. Matches the chevron + scroll-anchor in layout.js. */
    transition: height 0.7s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

body.theme-new .app-sidebar__submenu::before {
    content: '';
    position: absolute;
    left: -8px; top: 4px; bottom: 4px;
    width: 2px;
    background: var(--primary-color);
    opacity: 0.35;
    border-radius: 2px;
    transform-origin: top;
    transform: scaleY(0);
    transition: transform 0.6s var(--ease-out-soft);
}
body.theme-new .app-sidebar__submenu.in::before,
body.theme-new .app-sidebar__submenu.collapsing::before {
    transform: scaleY(1);
}

/* Items inside the submenu fade + slide in once expanded.
   Use BS3's `.in` class as the trigger. Longer duration + bigger
   nth-child step so the cascade is visible instead of a quick blur. */
body.theme-new .app-sidebar__submenu .app-sidebar__item {
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.4s var(--ease-out-soft),
                transform 0.4s var(--ease-out-soft);
}
body.theme-new .app-sidebar__submenu.in .app-sidebar__item {
    opacity: 1;
    transform: translateX(0);
}
/* Smaller stagger steps + a single delay for items past the 5th — long
   submenus (OmniU has 25+) previously animated for nearly a second after
   the height settled, which made the menu feel laggy. */
body.theme-new .app-sidebar__submenu.in .app-sidebar__item:nth-child(1)  { transition-delay: 0.04s; }
body.theme-new .app-sidebar__submenu.in .app-sidebar__item:nth-child(2)  { transition-delay: 0.07s; }
body.theme-new .app-sidebar__submenu.in .app-sidebar__item:nth-child(3)  { transition-delay: 0.10s; }
body.theme-new .app-sidebar__submenu.in .app-sidebar__item:nth-child(4)  { transition-delay: 0.13s; }
body.theme-new .app-sidebar__submenu.in .app-sidebar__item:nth-child(5)  { transition-delay: 0.16s; }
body.theme-new .app-sidebar__submenu.in .app-sidebar__item:nth-child(n+6) { transition-delay: 0.18s; }

body.theme-new .app-sidebar__link--sub {
    padding: 7px 10px;
    margin: 1px 0;
    font-size: 13.5px;
    color: var(--text-muted);
}
body.theme-new .app-sidebar__link--sub:hover {
    color: var(--primary-color);
    background: transparent;
}

/* ----- Collapsed (desktop icon-rail) ----- */
body.theme-new.sidebar-collapsed .app-sidebar { width: var(--sidebar-collapsed-width); }
body.theme-new.sidebar-collapsed .app-sidebar:hover { width: var(--sidebar-width); }

body.theme-new.sidebar-collapsed .app-sidebar:not(:hover) .app-sidebar__label,
body.theme-new.sidebar-collapsed .app-sidebar:not(:hover) .app-sidebar__badge,
body.theme-new.sidebar-collapsed .app-sidebar:not(:hover) .app-sidebar__chevron,
body.theme-new.sidebar-collapsed .app-sidebar:not(:hover) .app-sidebar__section-title,
body.theme-new.sidebar-collapsed .app-sidebar:not(:hover) .app-sidebar__search,
body.theme-new.sidebar-collapsed .app-sidebar:not(:hover) .app-sidebar__submenu { display: none; }


body.theme-new.sidebar-collapsed .app-sidebar:not(:hover) .app-sidebar__link {
    justify-content: center;
    padding: 12px 10px;
    margin: 2px 8px;
}

/* Hover-fly-out tooltip when collapsed (label appears on hover) */
body.theme-new.sidebar-collapsed .app-sidebar__link {
    position: relative;
}
body.theme-new.sidebar-collapsed .app-sidebar:not(:hover) .app-sidebar__link[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: var(--shadow-soft);
    z-index: 1050;
    pointer-events: none;
}

/* ----- Mobile drawer ----- */
@media (max-width: 991.98px) {
    body.theme-new .app-sidebar {
        left: -100% !important;
        width: 100% !important;
        top: var(--header-height-mobile) !important;
        height: calc(100vh - var(--header-height-mobile)) !important;
        transform: none !important;
        transition: left var(--transition-speed) ease !important;
    }
    body.theme-new.sidebar-open .app-sidebar {
        left: 0 !important;
    }
}

/* Mobile overlay */
body.theme-new .app-sidebar__overlay {
    position: fixed;
    inset: 0;
    top: var(--header-height);
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed) ease,
                visibility var(--transition-speed) ease;
    z-index: 1019;
}
@media (max-width: 991.98px) {
    body.theme-new .app-sidebar__overlay { top: var(--header-height-mobile); }
    body.theme-new.sidebar-open .app-sidebar__overlay {
        opacity: 1;
        visibility: visible;
    }
}

/* Custom scrollbar */
body.theme-new .app-sidebar::-webkit-scrollbar { width: 6px; }
body.theme-new .app-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
    body.theme-new .app-sidebar,
    body.theme-new .app-sidebar__link,
    body.theme-new .app-sidebar__chevron,
    body.theme-new .app-sidebar__overlay,
    body.theme-new .app-sidebar__submenu.collapsing,
    body.theme-new .app-sidebar__submenu::before,
    body.theme-new .app-sidebar__submenu .app-sidebar__item {
        transition: none !important;
    }
    body.theme-new .app-sidebar__submenu .app-sidebar__item {
        opacity: 1 !important;
        transform: none !important;
    }
    body.theme-new .app-sidebar__submenu::before {
        transform: scaleY(1) !important;
    }
}

/* ============================================================================
   PR 7 D.6 - enhanced sidebar search
   Per DOCS/SIDEBAR_SEARCH_HOWTO.md. Adds:
   - clear button (X) inside the input
   - yellow highlight pill on matched substrings
   - "no results" row
   - inline injection of Setup-customizer matches with a green divider
   ============================================================================ */

/* Make the search wrapper positioned so the clear button can absolute */
body.theme-new .app-sidebar__search {
    position: relative;
}

/* Clear button (X) - shown only when input has a value (toggled by layout.js
   via the .is-visible class) */
body.theme-new .app-sidebar__search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    font-size: 12px;
    line-height: 1;
    border-radius: 4px;
    display: none;
}
body.theme-new .app-sidebar__search-clear.is-visible {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
body.theme-new .app-sidebar__search-clear:hover {
    color: var(--primary-color);
    background: var(--primary-tint);
}

/* Reserve room on the right of the input so it doesn't overlap the X */
body.theme-new .app-sidebar__search input.is-cleanable,
body.theme-new .app-sidebar__search-clear.is-visible ~ input {
    padding-right: 32px !important;
}
body.theme-new .app-sidebar__search input {
    padding-right: 10px;
}

/* Hidden-by-search swap (replaces the previous style.display = 'none') */
body.theme-new .app-sidebar__item.hidden-by-search,
body.theme-new #setup-menu li.hidden-by-search {
    display: none !important;
}

/* Yellow highlight pill on matched substrings */
body.theme-new mark.sidebar-search-highlight {
    background: #facc15;
    color: #1e293b;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
    font-style: normal;
    text-decoration: none;
    line-height: 1;
}

/* "No results found" row at the bottom of the menu list */
body.theme-new .app-sidebar__no-results {
    padding: 16px 14px;
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
    text-align: center;
}

/* Inline Setup search results - divider header */
body.theme-new .setup-search-divider {
    padding: 10px 15px 4px;
    margin: 10px 8px 0;
    border-top: 1px solid var(--border-soft);
    pointer-events: none;
    list-style: none;
}
body.theme-new .setup-search-divider-text {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--primary-color);
    opacity: 0.85;
}
body.theme-new .setup-search-divider-text i {
    margin-right: 6px;
    font-size: 11px;
    color: var(--primary-color);
}

/* Inline Setup search results - result rows */
body.theme-new .setup-search-result > a {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 7px 14px !important;
    margin: 1px 8px !important;
    color: var(--text-muted) !important;
    font-size: 13px;
    text-decoration: none;
    border-radius: 6px;
    background: transparent !important;
    height: auto !important;
    width: auto !important;
    justify-content: flex-start !important;
    border-radius: 6px !important;
}
body.theme-new .setup-search-result > a:hover,
body.theme-new .setup-search-result > a:focus {
    background: var(--primary-tint) !important;
    color: var(--primary-color) !important;
}
body.theme-new .setup-search-result .app-sidebar__label {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================================
   PR 7 PHASE F - sidebar polish
   - F.4 sidebar item cascade entrance on body.pp-mounted
   - F.6 gentle pulse on the active sidebar item
   ============================================================================ */

/* F.4 — Sidebar item cascade ------------------------------------------------
   Each top-level sidebar item slides in from the left with a 40 ms stagger
   once body.pp-mounted lands. The search row, no-results row, and setup
   item are excluded so they don't visually compete. */
body.theme-new .app-sidebar__list > .app-sidebar__item {
    opacity: 0;
    transform: translateX(-14px);
    transition:
        opacity 0.4s var(--ease-out-soft),
        transform 0.4s var(--ease-out-soft);
}
body.theme-new.pp-mounted .app-sidebar__list > .app-sidebar__item {
    opacity: 1;
    transform: translateX(0);
}

body.theme-new.pp-mounted .app-sidebar__list > .app-sidebar__item:nth-child(1)  { transition-delay: 180ms; }
body.theme-new.pp-mounted .app-sidebar__list > .app-sidebar__item:nth-child(2)  { transition-delay: 220ms; }
body.theme-new.pp-mounted .app-sidebar__list > .app-sidebar__item:nth-child(3)  { transition-delay: 260ms; }
body.theme-new.pp-mounted .app-sidebar__list > .app-sidebar__item:nth-child(4)  { transition-delay: 300ms; }
body.theme-new.pp-mounted .app-sidebar__list > .app-sidebar__item:nth-child(5)  { transition-delay: 340ms; }
body.theme-new.pp-mounted .app-sidebar__list > .app-sidebar__item:nth-child(6)  { transition-delay: 380ms; }
body.theme-new.pp-mounted .app-sidebar__list > .app-sidebar__item:nth-child(7)  { transition-delay: 420ms; }
body.theme-new.pp-mounted .app-sidebar__list > .app-sidebar__item:nth-child(8)  { transition-delay: 460ms; }
body.theme-new.pp-mounted .app-sidebar__list > .app-sidebar__item:nth-child(9)  { transition-delay: 500ms; }
body.theme-new.pp-mounted .app-sidebar__list > .app-sidebar__item:nth-child(10) { transition-delay: 540ms; }
body.theme-new.pp-mounted .app-sidebar__list > .app-sidebar__item:nth-child(11) { transition-delay: 580ms; }
body.theme-new.pp-mounted .app-sidebar__list > .app-sidebar__item:nth-child(12) { transition-delay: 620ms; }
body.theme-new.pp-mounted .app-sidebar__list > .app-sidebar__item:nth-child(13) { transition-delay: 660ms; }
body.theme-new.pp-mounted .app-sidebar__list > .app-sidebar__item:nth-child(14) { transition-delay: 700ms; }
body.theme-new.pp-mounted .app-sidebar__list > .app-sidebar__item:nth-child(15) { transition-delay: 740ms; }
body.theme-new.pp-mounted .app-sidebar__list > .app-sidebar__item:nth-child(n+16) { transition-delay: 780ms; }

/* The no-results row never cascades — keep it ready to fire on search */
body.theme-new .app-sidebar__list > #top-search-no-results {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

/* F.6 — Active item gentle pulse -------------------------------------------
   The active green pill gets a slow shadow pulse every 5s so the
   current location stays visible even as the user scans the menu.
   Starts only after .pp-mounted to avoid competing with the cascade. */
@keyframes ppActivePulse {
    0%, 100% { box-shadow: 0 4px 12px var(--primary-focus); }
    50%      { box-shadow: 0 4px 22px var(--primary-glow); }
}

body.theme-new.pp-mounted .app-sidebar__item.is-active > .app-sidebar__link,
body.theme-new.pp-mounted .app-sidebar__item.active > .app-sidebar__link {
    animation: ppActivePulse 5s var(--ease-out-soft) infinite;
    animation-delay: 1.2s; /* let the cascade settle before the pulse starts */
}

@media (prefers-reduced-motion: reduce) {
    body.theme-new .app-sidebar__list > .app-sidebar__item {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    body.theme-new .app-sidebar__item.is-active > .app-sidebar__link,
    body.theme-new .app-sidebar__item.active > .app-sidebar__link {
        animation: none !important;
    }
}

/* ───────────── Pinned projects (admin sidebar) ─────────────
   Markup emitted by application/views/admin/projects/pinned.php
   and pulled in by _app_sidebar.php below the main <nav>. The block
   is a dedicated section (heading + ul) styled to feel like part of
   the app-sidebar chrome — same padding rhythm, same token palette,
   same hover/active states — while staying visually distinct as a
   "pinned" zone via the leading divider + tilted pushpin + thin
   progress bar under each row. */
body.theme-new .app-sidebar__pinned {
    margin: 16px 8px 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-soft);
}
body.theme-new .app-sidebar__pinned-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}
body.theme-new .app-sidebar__pinned-head i {
    font-size: 11px;
    opacity: 0.85;
}

body.theme-new .app-sidebar__list--pinned {
    list-style: none;
    margin: 0;
    padding: 0;
}
body.theme-new .app-sidebar__item--pinned {
    display: flex;
    flex-direction: column;
    margin-bottom: 4px;
}
body.theme-new .app-sidebar__link--pinned {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin: 0;
    border-radius: 8px;
    color: var(--text-main);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
body.theme-new .app-sidebar__link--pinned:hover,
body.theme-new .app-sidebar__link--pinned:focus {
    background: var(--primary-tint);
    color: var(--primary-color);
    text-decoration: none;
}
body.theme-new .app-sidebar__icon--pinned {
    font-size: 12px;
    opacity: 0.85;
    transform: rotate(-25deg);
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}
body.theme-new .app-sidebar__pinned-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
body.theme-new .app-sidebar__pinned-text .app-sidebar__label {
    font-size: 13px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.theme-new .app-sidebar__sublabel {
    font-size: 10.5px;
    color: var(--text-muted);
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.theme-new .app-sidebar__pinned-pct {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    margin-left: 4px;
}

body.theme-new .app-sidebar__pinned-progress {
    height: 3px;
    margin: 0 12px 4px;
    border-radius: 999px;
    background: var(--border-soft);
    overflow: hidden;
}
body.theme-new .app-sidebar__pinned-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-300));
    transition: width 0.35s ease;
}

body.theme-new .app-sidebar__item--pinned.is-active > .app-sidebar__link--pinned,
body.theme-new .app-sidebar__item--pinned.active > .app-sidebar__link--pinned {
    background: var(--primary-color);
    color: #fff;
}
body.theme-new .app-sidebar__item--pinned.is-active .app-sidebar__sublabel,
body.theme-new .app-sidebar__item--pinned.is-active .app-sidebar__pinned-pct,
body.theme-new .app-sidebar__item--pinned.active .app-sidebar__sublabel,
body.theme-new .app-sidebar__item--pinned.active .app-sidebar__pinned-pct {
    color: rgba(255, 255, 255, 0.85);
}
