/* Smart PDF sheet-set rail — hides only SfSidebar, keeps ShellNavMenu header + footer.
   New file: do not edit frozen sidebar-overrides.css / layout.css nav blocks. */

#wrapper.layout.layout--smart-pdf-sheet-set > .sidebar-menu.e-sidebar {
    display: none !important;
}

#wrapper.layout.layout--smart-pdf-sheet-set > .main-panel {
    margin-left: var(--site-nav-expanded) !important;
}

/* Collapsed: do not also push .main-panel — the drawing/grid use a 50px pad
   (.smart-pdf-sheet-set-offset). A second 50px here would make a 100px gap. */
#wrapper.layout.layout--smart-pdf-sheet-set.is-sheet-set-collapsed > .main-panel {
    margin-left: 0 !important;
}

/* Collapsed rail is 50px and position:fixed. Push the drawing + grid even if
   #wrapper is-sheet-set-collapsed is late or overridden. */
.smart-pdf-sheet-set-offset,
.smart-pdf-sheet-set-rail.is-collapsed ~ .content-wrapper,
.smart-pdf-sheet-set-rail.is-collapsed ~ .smart-pdf-bom-viewer {
    padding-left: 50px !important;
    box-sizing: border-box;
}

.smart-pdf-sheet-set-rail {
    position: fixed;
    left: 0;
    top: calc(var(--topbar-h) + var(--sectionbar-h));
    bottom: var(--footer-h);
    width: var(--site-nav-expanded);
    /* Below Syncfusion popups/dialogs (~1000–2050) and sticky chrome (1990–2000)
       so Tag/Item filter popups and item details can sit above the rail. */
    z-index: 200;
    display: flex;
    flex-direction: column;
    background-color: var(--nav-bg, #111b2c);
    background-image: linear-gradient(var(--nav-tint-1, rgba(17, 27, 44, .90)), var(--nav-tint-2, rgba(17, 27, 44, .84))), var(--nav-img);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    color: var(--nav-text, #fff);
    border-right: 1px solid var(--nav-sep, rgba(255, 255, 255, .2));
}

.smart-pdf-sheet-set-rail.is-collapsed {
    width: var(--site-nav-collapsed);
}

.smart-pdf-sheet-set-rail__chrome {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 10px 10px;
    border-bottom: 1px solid var(--nav-sep, rgba(255, 255, 255, .2));
}

.smart-pdf-sheet-set-rail.is-collapsed .smart-pdf-sheet-set-rail__chrome {
    align-items: center;
    padding: 10px 6px;
}

.smart-pdf-sheet-set-rail__collapse,
.smart-pdf-sheet-set-rail__back-icon {
    width: 36px;
    height: 36px;
    color: var(--nav-text, #fff);
    background: rgba(255, 255, 255, 0.08);
}

.smart-pdf-sheet-set-rail__collapse i,
.smart-pdf-sheet-set-rail__collapse i::before,
.smart-pdf-sheet-set-rail__back-icon i,
.smart-pdf-sheet-set-rail__back-icon i::before {
    display: block;
    line-height: 1;
}

.smart-pdf-sheet-set-rail__eyebrow {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--nav-hover-fg, #0b97d4);
}

.smart-pdf-sheet-set-rail__count {
    display: block;
    font-size: 0.95rem;
}

.smart-pdf-sheet-set-rail__back {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    color: var(--nav-text, #fff);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.smart-pdf-sheet-set-rail__back i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.smart-pdf-sheet-set-rail__back i::before {
    display: block;
    line-height: 1;
}

.smart-pdf-sheet-set-rail__list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 8px 16px;
    overflow-y: auto;
    min-height: 0;
    flex: 1 1 auto;
}

.smart-pdf-sheet-set-rail__empty {
    margin: 0;
    padding: 8px;
    font-size: 0.8rem;
    color: rgba(244, 246, 250, 0.75);
}

.smart-pdf-sheet-set-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--nav-text, #fff);
    text-align: left;
    cursor: pointer;
}

.smart-pdf-sheet-set-item:hover {
    background: var(--nav-hover-bg, rgba(255, 255, 255, .08));
}

.smart-pdf-sheet-set-item.is-current {
    background: var(--nav-active-bg, rgba(255, 255, 255, .14));
}

.smart-pdf-sheet-set-item.is-current .smart-pdf-sheet-set-item__num {
    color: var(--nav-active-fg, #10C4FF);
}

.smart-pdf-sheet-set-item__num {
    font-weight: 700;
    font-size: 0.85rem;
}

.smart-pdf-sheet-set-item__name {
    font-size: 0.75rem;
    color: rgba(244, 246, 250, 0.72);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.smart-pdf-sheet-set-rail__thumbs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 5px 16px;
    overflow-y: auto;
    min-height: 0;
    flex: 1 1 auto;
}

.smart-pdf-sheet-set-thumb {
    box-sizing: border-box;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    overflow: hidden;
}

.smart-pdf-sheet-set-thumb.is-current {
    border-color: var(--nav-active-fg, #10C4FF);
    box-shadow: 0 0 0 1px var(--nav-active-fg, #10C4FF);
}

.smart-pdf-sheet-set-thumb__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.smart-pdf-sheet-set-thumb__fallback {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--nav-text, #fff);
}

.smart-pdf-sheet-set-thumb__fallback.is-visible {
    display: inline-flex;
}

.smart-pdf-sheet-set-thumb__fallback i,
.smart-pdf-sheet-set-thumb__fallback i::before {
    display: block;
    line-height: 1;
}

@media (max-width: 768px) {
    /* Expanded rail is an overlay drawer. Collapsed rail keeps the 50px body pad. */
    #wrapper.layout.layout--smart-pdf-sheet-set > .main-panel,
    #wrapper.layout.layout--smart-pdf-sheet-set.is-sheet-set-collapsed > .main-panel {
        margin-left: 0 !important;
    }

    .smart-pdf-sheet-set-rail:not(.is-collapsed) {
        width: min(var(--site-nav-expanded), 86vw);
        box-shadow: 8px 0 24px rgba(17, 27, 44, 0.28);
    }

    .smart-pdf-sheet-set-rail {
        top: calc(var(--topbar-h) + var(--sectionbar-h));
        max-height: calc(100dvh - var(--topbar-h) - var(--sectionbar-h) - var(--footer-h));
    }

    /* Excel / column filter popups: below sticky header so Close / OK stay tappable. */
    .e-excelfilter.e-popup,
    .e-filter-popup,
    .e-grid-popup.e-popup {
        top: calc(var(--topbar-h) + var(--sectionbar-h) + 8px) !important;
        max-height: calc(100dvh - var(--topbar-h) - var(--sectionbar-h) - var(--footer-h) - 16px) !important;
        z-index: 2100 !important;
        overflow-y: auto;
    }

    .e-dlg-container:has(.bomsync-item-details-dialog),
    .e-dlg-container:has(.smart-pdf-view-detail-dialog) {
        padding-top: calc(var(--topbar-h) + var(--sectionbar-h) + 8px);
        box-sizing: border-box;
        align-items: flex-start;
    }
}
