/*
 * Prioriti AI — shared sidebar style (matches commandcenter.html)
 * Loaded after each page's own CSS. Selectors are scoped to `html body .sidebar.pai-sb`
 * (class added by pai-sidebar.js) so they win over legacy per-page styles.
 */
html body .sidebar.pai-sb {
    width: 264px !important; min-width: 264px !important; max-width: 264px !important; flex: 0 0 264px !important;
    background: rgba(255,255,255,0.05) !important; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255,255,255,0.1) !important; border-left: 0 !important; border-radius: 0 !important;
    color: #fff !important; padding: 22px 0 !important; margin: 0 !important;
    box-shadow: 2px 0 25px rgba(0,0,0,0.3) !important; transition: width .3s ease, min-width .3s ease, max-width .3s ease, flex-basis .3s ease !important;
    overflow-x: hidden !important; overflow-y: auto !important; font-size: 14px; line-height: 1.4;
    font-family: 'Inter', 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
    display: flex !important; flex-direction: column; align-items: stretch; transform: none !important; left: 0;
}
html body .sidebar.pai-sb::-webkit-scrollbar { width: 6px; }
html body .sidebar.pai-sb::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
html body .sidebar.pai-sb.collapsed { width: 76px !important; min-width: 76px !important; max-width: 76px !important; flex-basis: 76px !important; }

/* Header: logo + page title + sub, like Command Center */
html body .sidebar.pai-sb .sidebar-header {
    display: block !important; padding: 0 22px 18px !important; margin: 0 0 14px !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important; background: none !important; height: auto !important; min-height: 0 !important;
}
html body .sidebar.pai-sb .sidebar-header .logo,
html body .sidebar.pai-sb .sidebar-header .logo-area,
html body .sidebar.pai-sb .pai-sb-logo {
    display: flex !important; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; color: #fff; text-decoration: none;
    position: static !important; margin: 0 !important; padding: 0 !important;
}
html body .sidebar.pai-sb .sidebar-header .logo-area img,
html body .sidebar.pai-sb .sidebar-header .logo img { height: 24px !important; width: auto !important; flex-shrink: 0; }
html body .sidebar.pai-sb .pai-sb-title { min-width: 0; flex: 1; line-height: 1.25; }
html body .sidebar.pai-sb .pai-sb-title > div { background: none !important; -webkit-text-fill-color: currentColor !important; text-transform: none !important; letter-spacing: normal !important; }
html body .sidebar.pai-sb .pai-sb-title > div:first-child { font-size: 14px !important; font-weight: 600 !important; color: #fff !important; line-height: 1.25 !important; max-height: 2.5em; overflow: hidden; display: block !important; }
html body .sidebar.pai-sb .pai-sb-title .sub { font-size: 10px !important; color: #8f9aa9 !important; font-weight: 400 !important; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html body .sidebar.pai-sb .header-buttons { display: none !important; }
html body .sidebar.pai-sb.collapsed .sidebar-header { padding: 0 0 18px !important; }
html body .sidebar.pai-sb.collapsed .sidebar-header .logo,
html body .sidebar.pai-sb.collapsed .pai-sb-logo { justify-content: center; }
html body .sidebar.pai-sb.collapsed .sidebar-header .logo img { height: 24px !important; width: 26px !important; max-width: 26px; object-fit: cover; object-position: left center; }
html body .sidebar.pai-sb.collapsed .pai-sb-title { display: none; }

/* Group labels */
html body .sidebar.pai-sb .nav-group,
html body .sidebar.pai-sb .nav-section-title,
html body .sidebar.pai-sb .sidebar-label,
html body .sidebar.pai-sb .pai-sb-group,
html body .sidebar.pai-sb .nav-group-label,
html body .sidebar.pai-sb .nav-label,
html body .sidebar.pai-sb .sidebar-section-title,
html body .sidebar.pai-sb .nav-section > h3,
html body .sidebar.pai-sb .nav-section > h4 {
    font-size: 9.5px !important; font-weight: 600 !important; text-transform: uppercase !important; letter-spacing: .12em !important;
    color: #8b96a6 !important; padding: 14px 24px 6px !important; margin: 0 !important; background: none !important; border: 0 !important;
}
html body .sidebar.pai-sb.collapsed .nav-group,
html body .sidebar.pai-sb.collapsed .nav-section-title,
html body .sidebar.pai-sb.collapsed .sidebar-label,
html body .sidebar.pai-sb.collapsed .pai-sb-group,
html body .sidebar.pai-sb.collapsed .nav-group-label,
html body .sidebar.pai-sb.collapsed .nav-label,
html body .sidebar.pai-sb.collapsed .sidebar-section-title,
html body .sidebar.pai-sb.collapsed .nav-section > h3,
html body .sidebar.pai-sb.collapsed .nav-section > h4 { text-align: center; padding: 14px 0 6px !important; font-size: 0 !important; }
html body .sidebar.pai-sb.collapsed .nav-group::after,
html body .sidebar.pai-sb.collapsed .nav-section-title::after,
html body .sidebar.pai-sb.collapsed .sidebar-label::after,
html body .sidebar.pai-sb.collapsed .pai-sb-group::after,
html body .sidebar.pai-sb.collapsed .nav-group-label::after,
html body .sidebar.pai-sb.collapsed .nav-label::after,
html body .sidebar.pai-sb.collapsed .sidebar-section-title::after,
html body .sidebar.pai-sb.collapsed .nav-section > h3::after,
html body .sidebar.pai-sb.collapsed .nav-section > h4::after { content: '•'; font-size: 12px; }
html body .sidebar.pai-sb nav,
html body .sidebar.pai-sb .nav-section,
html body .sidebar.pai-sb .sidebar-section,
html body .sidebar.pai-sb .sidebar-nav,
html body .sidebar.pai-sb .nav-menu { padding: 0 !important; margin: 0 !important; background: none !important; border: 0 !important; }

/* Items */
html body .sidebar.pai-sb .nav-item {
    display: flex !important; align-items: center !important; gap: 0 !important;
    padding: 10px 22px !important; margin: 2px 0 !important; width: calc(100% - 12px) !important; min-height: 0 !important; height: auto !important;
    cursor: pointer; border: none !important; border-left: 4px solid transparent !important; background: none !important;
    color: #cae1f9 !important; text-align: left; position: relative; text-decoration: none !important;
    border-radius: 0 22px 22px 0 !important; font-size: 13.5px !important; font-weight: 400 !important; font-family: inherit !important;
    box-shadow: none !important; transform: none; transition: all .25s ease !important; letter-spacing: normal !important; opacity: 1 !important;
}
html body .sidebar.pai-sb .nav-item:hover { background: rgba(255,255,255,0.1) !important; transform: translateX(4px); color: #fff !important; }
html body .sidebar.pai-sb .nav-item.active,
html body .sidebar.pai-sb .nav-item.active-page,
html body .sidebar.pai-sb .nav-item.pai-current {
    background: linear-gradient(135deg, rgba(43,139,230,0.32), rgba(84,104,242,0.32)) !important;
    border-left: 4px solid #5468f2 !important; color: #fff !important; font-weight: 500 !important;
    box-shadow: 0 4px 18px rgba(84,104,242,0.28) !important;
}
html body .sidebar.pai-sb .nav-item::before,
html body .sidebar.pai-sb .nav-item::after { display: none !important; }
html body .sidebar.pai-sb .nav-item > .material-icons,
html body .sidebar.pai-sb .nav-item > .material-icons-outlined,
html body .sidebar.pai-sb .nav-item > .material-symbols-outlined,
html body .sidebar.pai-sb .nav-item > .nav-item-icon {
    margin: 0 12px 0 0 !important; font-size: 19px !important; flex-shrink: 0; color: inherit !important; width: auto !important; opacity: 1 !important;
}
html body .sidebar.pai-sb .nav-item .nav-text,
html body .sidebar.pai-sb .nav-item > span:not([class]) {
    flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: inherit !important; color: inherit !important; margin: 0 !important;
}
html body .sidebar.pai-sb .nav-item .step,
html body .sidebar.pai-sb .nav-item .nav-badge,
html body .sidebar.pai-sb .nav-item .step-num {
    margin-left: auto; font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 10px !important; color: #8b96a6 !important;
    background: none !important; padding: 0 !important; border: 0 !important; min-width: 0 !important;
}
html body .sidebar.pai-sb .nav-item.active .step,
html body .sidebar.pai-sb .nav-item.active-page .step,
html body .sidebar.pai-sb .nav-item.pai-current .step { color: #bdc5fa !important; }

/* Accordion sections (pages with nested menus) */
html body .sidebar.pai-sb .nav-item.section-header { font-weight: 500 !important; }
html body .sidebar.pai-sb .nav-item .expand-icon,
html body .sidebar.pai-sb .nav-item .section-arrow {
    margin: 0 0 0 auto !important; font-size: 18px !important; color: #8f9aa9 !important; transition: transform .3s ease !important;
}
html body .sidebar.pai-sb .nav-item.section-header.expanded .expand-icon { transform: rotate(90deg); }
html body .sidebar.pai-sb .nav-subitems { background: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; border: 0 !important; }
html body .sidebar.pai-sb .nav-subitems .nav-item { padding-left: 34px !important; font-size: 13px !important; }
html body .sidebar.pai-sb .nav-subitems .nav-subitems .nav-item { padding-left: 46px !important; font-size: 12.5px !important; }
html body .sidebar.pai-sb .nav-subitems .nav-item > .material-icons,
html body .sidebar.pai-sb .nav-subitems .nav-item > .material-icons-outlined { font-size: 17px !important; }

/* Collapsed rail */
html body .sidebar.pai-sb.collapsed .nav-item { padding: 10px 0 !important; justify-content: center !important; width: calc(100% - 8px) !important; }
html body .sidebar.pai-sb.collapsed .nav-item > .material-icons,
html body .sidebar.pai-sb.collapsed .nav-item > .material-icons-outlined,
html body .sidebar.pai-sb.collapsed .nav-item > .nav-item-icon { margin: 0 !important; }
html body .sidebar.pai-sb.collapsed .nav-text,
html body .sidebar.pai-sb.collapsed .nav-item > span:not([class]),
html body .sidebar.pai-sb.collapsed .step,
html body .sidebar.pai-sb.collapsed .nav-badge,
html body .sidebar.pai-sb.collapsed .expand-icon,
html body .sidebar.pai-sb.collapsed .section-arrow { display: none !important; }
html body .sidebar.pai-sb.collapsed .nav-subitems .nav-item { padding-left: 0 !important; }
html body .sidebar.pai-sb.collapsed .nav-item:hover { transform: none; }

/* Collapse toggle injected on pages that had none */
html body .sidebar.pai-sb .pai-sb-toggle {
    display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-left: auto; flex-shrink: 0;
    background: none; border: 0; border-radius: 8px; color: #f2f5f9; cursor: pointer; transition: background .2s;
}
html body .sidebar.pai-sb .pai-sb-toggle:hover { background: rgba(255,255,255,.1); }
html body .sidebar.pai-sb .pai-sb-toggle .material-icons-outlined { font-size: 20px; color: #fff; }
html body .sidebar.pai-sb.collapsed .pai-sb-toggle { margin: 12px auto 0; }
html body .sidebar.pai-sb.collapsed .sidebar-header .logo,
html body .sidebar.pai-sb.collapsed .pai-sb-logo { flex-direction: column; }

@media (max-width: 768px) {
    html body .sidebar.pai-sb:not(.pai-sb-open) { width: 76px !important; min-width: 76px !important; max-width: 76px !important; flex-basis: 76px !important; }
    html body .sidebar.pai-sb:not(.pai-sb-open) .nav-text,
    html body .sidebar.pai-sb:not(.pai-sb-open) .step,
    html body .sidebar.pai-sb:not(.pai-sb-open) .expand-icon,
    html body .sidebar.pai-sb:not(.pai-sb-open) .pai-sb-title { display: none !important; }
    html body .sidebar.pai-sb:not(.pai-sb-open) .nav-item { padding: 10px 0 !important; justify-content: center !important; }
    html body .sidebar.pai-sb:not(.pai-sb-open) .nav-item > .material-icons,
    html body .sidebar.pai-sb:not(.pai-sb-open) .nav-item > .material-icons-outlined { margin: 0 !important; }
}

html body .sidebar.pai-sb *:not(.material-icons):not(.material-icons-outlined):not(.material-icons-round):not(.material-symbols-outlined):not([class*="icon"]):not(.step) { font-family: inherit !important; }
html body .sidebar.pai-sb .sidebar-header { position: relative !important; }
html body .sidebar.pai-sb .pai-sb-toggle {
    position: absolute !important; top: -6px !important; right: 10px !important; margin: 0 !important; padding: 0 !important;
    width: 28px !important; height: 28px !important; background: none !important; border: 0 !important; box-shadow: none !important; color: #fff !important;
}
html body .sidebar.pai-sb .pai-sb-toggle:hover { background: rgba(255,255,255,.1) !important; }
html body .sidebar.pai-sb.pai-has-toggle .pai-sb-title { padding-right: 18px; }
html body .sidebar.pai-sb.collapsed .pai-sb-toggle { position: static !important; margin: 10px auto 0 !important; }
html body .sidebar.pai-sb.pai-sb-fixed { background: linear-gradient(rgba(255,255,255,.05), rgba(255,255,255,.05)), #10151d !important; z-index: 50; }
html body .sidebar.pai-sb .pai-sb-title > div:first-child { overflow-wrap: normal; word-break: normal; }

html body .sidebar.pai-sb .sidebar-header .logo a { display: flex; align-items: center; flex-shrink: 0; }
html body .sidebar.pai-sb .sidebar-header :is(.logo, .logo-area) { color: #fff !important; }

/* ===== Tool Factory menu (pai-toolmenu.js) ===== */
html body .sidebar .pai-tm-legacy { display: none !important; }
html body .sidebar .pai-tm { display: block; }
html body .sidebar .pai-tm .pai-tm-sub,
html body .sidebar .pai-tm .pai-tm-kids { display: none !important; max-height: none !important; overflow: visible !important; opacity: 1 !important; }
html body .sidebar .pai-tm .pai-tm-sub.pai-tm-open,
html body .sidebar .pai-tm .pai-tm-kids.pai-tm-open { display: block !important; }
html body .sidebar.collapsed .pai-tm .pai-tm-sub.pai-tm-open,
html body .sidebar.collapsed .pai-tm .pai-tm-kids.pai-tm-open { display: none !important; }
html body .sidebar.pai-sb .pai-tm .pai-tm-kids { margin: 2px 0 6px !important; border-left: 1px solid rgba(84,104,242,0.35) !important; margin-left: 40px !important; }
html body .sidebar.pai-sb .pai-tm .pai-tm-kids .nav-item { padding-left: 14px !important; font-size: 12.5px !important; width: calc(100% - 4px) !important; }
html body .sidebar.pai-sb .pai-tm .pai-tm-kids .nav-item > .material-icons { font-size: 16px !important; }
html body .sidebar.pai-sb .pai-tm .nav-item.active.pai-tm-has-kids { margin-bottom: 0 !important; }
html body .sidebar.pai-sb .pai-tm .pai-tm-head { font-weight: 500 !important; }
html body .sidebar.pai-sb .pai-tm .pai-tm-head.pai-tm-on { color: #fff !important; }
html body .sidebar.pai-sb .pai-tm .pai-tm-chev { margin: 0 0 0 auto !important; font-size: 18px !important; color: #8f9aa9 !important; transition: transform .3s ease; }
html body .sidebar.pai-sb .pai-tm .pai-tm-head.pai-tm-on .pai-tm-chev { transform: rotate(90deg); color: #bdc5fa !important; }
html body .sidebar.pai-sb.collapsed .pai-tm .pai-tm-chev { display: none !important; }
