/* Smart PDF BOM Viewer — QA / AI / Tool Chest flyouts.
   These are fixed <aside class="smart-pdf-flyout …"> panels (NOT SfSidebar Type=Over).
   Syncfusion Over sidebars rewrite top/height:100% and cannot stay inset; fixed asides own geometry.

   Product geometry (desktop): top 200px from page top, bottom 100px from page bottom. */

/* Available Views flyout — long titles wrap without stacking rows on top of each other. */
.e-sidebar.smart-pdf-views-sidebar .smart-pdf-views-flyout .e-listbox-wrapper .e-list-item,
.e-sidebar.smart-pdf-views-sidebar .smart-pdf-views-listbox .e-list-item,
.e-sidebar.smart-pdf-views-sidebar .e-list-parent .e-list-item {
    height: auto !important;
    min-height: 2.75rem;
    padding: 0.65rem 0.75rem !important;
    margin: 0 0 0.4rem 0 !important;
    line-height: 1.4 !important;
    white-space: normal !important;
    border: 1px solid var(--bomsync-border-muted, var(--bs-border-color, #e2e6ee));
    border-radius: 6px;
    box-sizing: border-box;
}

.e-sidebar.smart-pdf-views-sidebar .e-list-item .e-list-text,
.e-sidebar.smart-pdf-views-sidebar .e-list-item .e-text-content,
.e-sidebar.smart-pdf-views-sidebar .e-list-item .e-list-item-content {
    height: auto !important;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.4 !important;
}

.e-sidebar.smart-pdf-views-sidebar .e-listbox-wrapper .e-list-parent {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.15rem 0;
}

/* Shared inset chrome for QA / AI / Tool Chest (desktop defaults). */
.smart-pdf-flyout.smart-pdf-qa-sidebar,
.smart-pdf-flyout.smart-pdf-ai-sidebar,
.smart-pdf-flyout.smart-pdf-toolchest-sidebar {
    position: fixed !important;
    top: 200px !important;
    bottom: 100px !important;
    right: 0 !important;
    left: auto !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
    background: var(--bomsync-elevated-surface, var(--bs-body-bg, #fff));
    border-left: 1px solid var(--bomsync-border-strong, var(--bs-border-color, #dee2e6));
    border-radius: 10px 0 0 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
    overflow: hidden;
    box-sizing: border-box;
}

.smart-pdf-flyout.smart-pdf-qa-sidebar {
    width: min(860px, 92vw);
    z-index: 1258;
}

.smart-pdf-flyout.smart-pdf-toolchest-sidebar {
    width: min(420px, 92vw);
    z-index: 1259;
}

.smart-pdf-flyout.smart-pdf-ai-sidebar {
    width: min(440px, 92vw);
    z-index: 1260;
}

.smart-pdf-flyout .smart-pdf-qa-panel,
.smart-pdf-flyout .smart-pdf-ai-panel,
.smart-pdf-flyout .smart-pdf-toolchest-panel {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.smart-pdf-flyout .smart-pdf-qa-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Tablet: clear sticky chrome + footer without eating the viewport. */
@media (max-width: 991.98px) {
    .smart-pdf-flyout.smart-pdf-qa-sidebar,
    .smart-pdf-flyout.smart-pdf-ai-sidebar,
    .smart-pdf-flyout.smart-pdf-toolchest-sidebar {
        top: 140px !important;
        bottom: 72px !important;
        width: min(92vw, 860px) !important;
        max-width: 92vw !important;
    }
}

/* Phone: nearly full width; smaller insets so checklist remains usable. */
@media (max-width: 575.98px) {
    .smart-pdf-flyout.smart-pdf-qa-sidebar,
    .smart-pdf-flyout.smart-pdf-ai-sidebar,
    .smart-pdf-flyout.smart-pdf-toolchest-sidebar {
        top: 88px !important;
        bottom: 48px !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        border-radius: 0;
        border-left: none;
    }
}

/* Toolbar toggle open — navy fill + temperature white label (avoid Syncfusion e-outline/e-active black text). */
.smart-pdf-toolbar .e-btn.smart-pdf-flyout-toggle-on,
.smart-pdf-toolbar .e-control.e-btn.smart-pdf-flyout-toggle-on,
.smart-pdf-toolbar button.e-btn.smart-pdf-flyout-toggle-on {
    background: var(--brand-blue, #111B2C) !important;
    border-color: var(--brand-blue, #111B2C) !important;
    color: var(--bomsync-on-dark-text, #e8edf5) !important;
}

.smart-pdf-toolbar .e-btn.smart-pdf-flyout-toggle-on:hover,
.smart-pdf-toolbar .e-btn.smart-pdf-flyout-toggle-on:focus,
.smart-pdf-toolbar .e-btn.smart-pdf-flyout-toggle-on:focus-visible,
.smart-pdf-toolbar .e-btn.smart-pdf-flyout-toggle-on:active,
.smart-pdf-toolbar .e-control.e-btn.smart-pdf-flyout-toggle-on:hover,
.smart-pdf-toolbar .e-control.e-btn.smart-pdf-flyout-toggle-on:focus {
    background: color-mix(in srgb, var(--brand-blue, #111B2C) 88%, #fff) !important;
    border-color: color-mix(in srgb, var(--brand-blue, #111B2C) 88%, #fff) !important;
    color: var(--bomsync-on-dark-text, #e8edf5) !important;
}

.smart-pdf-toolbar .e-btn.smart-pdf-flyout-toggle-on .e-btn-content,
.smart-pdf-toolbar .e-btn.smart-pdf-flyout-toggle-on span,
.smart-pdf-toolbar .e-btn.smart-pdf-flyout-toggle-on .e-icons,
.smart-pdf-toolbar .e-control.e-btn.smart-pdf-flyout-toggle-on .e-btn-content,
.smart-pdf-toolbar .e-control.e-btn.smart-pdf-flyout-toggle-on span {
    color: var(--bomsync-on-dark-text, #e8edf5) !important;
}

/* Smart PDF Modern Panel custom nav icons (Tool Chest / Properties).
   IconCss uses Bootstrap Icons: "bi bi-briefcase" / "bi bi-sliders".
   Syncfusion wraps IconCss on a span inside .e-pv-* chrome — force BI font and kill e-icons override. */
.e-pv-sidebar .bi,
.e-pv-navigationpanel .bi,
.e-pv-sidebar-toolbar .bi,
[class*="e-pv"] .bi.bi-briefcase,
[class*="e-pv"] .bi.bi-sliders {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-family: bootstrap-icons !important;
    font-style: normal !important;
    font-weight: normal !important;
    font-size: 1.05rem;
    line-height: 1;
    width: 1.25rem;
    height: 1.25rem;
    color: inherit;
}

.e-pv-sidebar .bi::before,
.e-pv-navigationpanel .bi::before,
.e-pv-sidebar-toolbar .bi::before,
[class*="e-pv"] .bi.bi-briefcase::before,
[class*="e-pv"] .bi.bi-sliders::before {
    font-family: bootstrap-icons !important;
    font-style: normal !important;
    font-weight: normal !important;
    display: block;
    line-height: 1;
}

/* Legacy helper classes (kept for older markup). */
.smart-pdf-nav-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.smart-pdf-nav-icon--toolchest::before {
    content: "\F1CC"; /* bi-briefcase */
    font-family: bootstrap-icons !important;
    font-style: normal;
    font-weight: normal !important;
    font-size: 1rem;
    line-height: 1;
}

.smart-pdf-nav-icon--properties::before {
    content: "\F56B"; /* bi-sliders */
    font-family: bootstrap-icons !important;
    font-style: normal;
    font-weight: normal !important;
    font-size: 1rem;
    line-height: 1;
}

/* Modern Panel Tool Chest + Properties content (templates render outside page-scoped CSS). */
.pdf-nav-panel-host {
    min-height: 160px;
    width: 100%;
    box-sizing: border-box;
}

.pdf-nav-toolchest,
.pdf-nav-properties {
    padding: 0.65rem 0.75rem 0.85rem;
    color: var(--bomsync-text-primary, #1a1f2b);
}

.pdf-nav-toolchest__lead,
.pdf-nav-properties__empty {
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--bomsync-text-secondary, #5d687d);
}

.pdf-nav-toolchest__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 0.45rem;
}

.pdf-nav-toolchest__glyph {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.25rem;
    min-height: 72px;
    padding: 0.35rem 0.25rem;
    border: 1px solid var(--bomsync-border-strong, #d6dce6);
    border-radius: 8px;
    background: var(--bomsync-elevated-surface, #fff);
    cursor: grab;
    box-shadow: 0 1px 3px rgb(var(--bomsync-shadow-rgb, 17 27 44) / 0.08);
}

.pdf-nav-toolchest__glyph:hover,
.pdf-nav-toolchest__glyph:focus-visible {
    border-color: var(--brand-blue, #1b2a44);
    outline: none;
}

.pdf-nav-toolchest__glyph.is-dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.pdf-nav-toolchest__img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    pointer-events: none;
}

.pdf-nav-toolchest__swatch {
    width: 36px;
    height: 24px;
    border: 2px solid #C41E3A;
    border-radius: 3px;
    background: transparent;
    pointer-events: none;
}

.pdf-nav-toolchest__fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 0.75rem;
    font-weight: 700;
}

.pdf-nav-toolchest__name {
    font-size: 0.68rem;
    line-height: 1.2;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-nav-toolchest__footer {
    border-top: 1px solid var(--bomsync-border-muted, #d6dce6);
    padding-top: 0.65rem;
}

.pdf-nav-properties__subject {
    margin-bottom: 0.65rem;
}

.pdf-nav-properties__subject-input {
    margin-top: 0.2rem;
}

.pdf-nav-properties__section {
    border: 1px solid var(--bomsync-border-muted, #d6dce6);
    border-radius: 8px;
    margin-bottom: 0.55rem;
    background: var(--bomsync-elevated-surface, #fff);
    overflow: hidden;
}

.pdf-nav-properties__section-title {
    list-style: none;
    cursor: pointer;
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bomsync-on-dark-text, #f3f6fb);
    background: var(--brand-blue, #1b2a44);
}

.pdf-nav-properties__section-title::-webkit-details-marker {
    display: none;
}

.pdf-nav-properties__section-body {
    padding: 0.55rem 0.65rem 0.7rem;
}

.pdf-nav-properties__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}

.pdf-nav-properties__row .pdf-nav-properties__line-width,
.pdf-nav-properties__row .pdf-nav-properties__line-width.e-numerictextbox,
.pdf-nav-properties__row .e-input-group.pdf-nav-properties__line-width,
.pdf-nav-properties__row .e-control-wrapper.pdf-nav-properties__line-width {
    min-width: 132px !important;
    width: 132px !important;
    flex: 0 0 132px;
}

.pdf-nav-properties__row .pdf-nav-properties__line-width input.e-input {
    min-width: 2.5rem;
    text-align: right;
}

.pdf-nav-properties__row--actions {
    justify-content: flex-end;
    margin-top: 0.35rem;
    margin-bottom: 0;
}

.pdf-nav-properties__label {
    font-size: 0.85rem;
    color: var(--bomsync-text-secondary, #5d687d);
    margin: 0;
}

.pdf-nav-properties__swatch-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid var(--bomsync-border-strong, #d6dce6);
    overflow: hidden;
}

.pdf-nav-properties__color {
    width: 34px;
    height: 34px;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}


/* Work items picker (Smart PDF). */
.smart-pdf-work-items-list .e-list-item {
    cursor: pointer;
    padding: 0.45rem 0.65rem;
}

.smart-pdf-work-item-row .badge {
    font-size: 0.7rem;
}

/* Revision Cloud on Syncfusion Edit Annotations (annotation) toolbar — injected via bomsyncPdfViewer.installRevisionCloudAnnotationToolbar. */
.e-pv-annotation-toolbar .smart-pdf-revision-cloud-tbar .bi,
.e-pv-annotation-toolbar-container .smart-pdf-revision-cloud-tbar .bi,
.e-pv-viewer-container .smart-pdf-revision-cloud-tbar .bi,
.e-pv-toolbar .smart-pdf-revision-cloud-tbar .bi,
.smart-pdf-revision-cloud-tbar .bi {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-family: bootstrap-icons !important;
}

.e-pv-annotation-toolbar .smart-pdf-revision-cloud-tbar.e-active,
.e-pv-annotation-toolbar-container .smart-pdf-revision-cloud-tbar.e-active,
.e-pv-toolbar .smart-pdf-revision-cloud-tbar.e-active,
.smart-pdf-revision-cloud-tbar.e-active {
    background: rgb(var(--bomsync-shadow-rgb, 17 27 44) / 0.12) !important;
}

.smart-pdf-revision-cloud-annot-wrap {
    display: inline-flex;
    align-items: center;
}
