/* ============================================
   Conclusion Sidebar Layout
   Стили для sidebar-навигации заключений экспертизы.
   Тема портала «Бумага и линии»: светлая панель с рамкой, тёмный текст,
   акцент — цвет кнопок (--p-primary). Тёмно-синие заливки убраны.
   Токены (--hx-*, --p-*) — из site-chrome.css / portal-tokens.css,
   у каждого есть запасное значение.
   ============================================ */

.concl-layout {
    display: flex;
    gap: 0;
    min-height: 500px;
    border: 1px solid var(--hx-line-2, #C9D3E0);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

/* --- Sidebar --- */
.concl-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--hx-sheet-2, #F4F6FA);
    border-right: 1px solid var(--hx-line, #E1E6EE);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.concl-sidebar__title {
    padding: 16px 18px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--hx-ink, #101828);
    background: transparent;
    border-bottom: 1px solid var(--hx-line, #E1E6EE);
    margin: 0;
}

.concl-sidebar__list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    flex: 1;
    overflow-y: auto;
}

.concl-sidebar__item {
    border-bottom: 1px solid var(--hx-line, #E1E6EE);
}

.concl-sidebar__item:last-child {
    border-bottom: none;
}

.concl-sidebar__link {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    font-size: 13px;
    color: var(--hx-ink-2, #4A5568);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    line-height: 1.4;
    gap: 10px;
}

.concl-sidebar__link:hover {
    background: #fff;
    color: var(--hx-ink, #101828);
    text-decoration: none;
}

.concl-sidebar__link:focus-visible {
    outline: 2px solid var(--p-primary, #2563EB);
    outline-offset: -2px;
}

/* Активный раздел — белая «строка» с синей чертой слева, без тёмной заливки. */
.concl-sidebar__link.is-active {
    background: #fff;
    color: var(--p-primary, #2563EB);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--p-primary, #2563EB);
}

.concl-sidebar__link.is-active .concl-sidebar__dot {
    border-color: var(--p-primary, #2563EB);
}

/* Индикатор заполнения */
.concl-sidebar__dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 50%;
    border: 2px solid var(--hx-line-2, #C9D3E0);
    background: transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.concl-sidebar__dot.is-filled,
.concl-sidebar__link.is-active .concl-sidebar__dot.is-filled {
    background: var(--p-primary, #2563EB);
    border-color: var(--p-primary, #2563EB);
}

.concl-sidebar__num {
    font-weight: 700;
    min-width: 30px;
    color: inherit;
}

.concl-sidebar__text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Счетчик прогресса внизу sidebar */
.concl-sidebar__progress {
    padding: 14px 18px;
    border-top: 1px solid var(--hx-line, #E1E6EE);
    background: transparent;
    font-size: 12px;
    color: var(--hx-ink-2, #4A5568);
    text-align: center;
    font-weight: 600;
}

.concl-sidebar__progress-bar {
    height: 4px;
    background: var(--hx-line, #E1E6EE);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.concl-sidebar__progress-fill {
    height: 100%;
    background: var(--p-primary, #2563EB);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* --- Content Area --- */
.concl-content {
    flex: 1;
    min-width: 0;
    padding: 24px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

/* Секция контента */
.concl-section {
    display: none;
}

.concl-section.is-active {
    display: block;
}

/* Навигация Назад/Далее */
.concl-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--hx-line, #E1E6EE);
}

.concl-nav__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #fff;
    border: 1px solid var(--hx-line-2, #C9D3E0);
    border-radius: var(--p-r, 8px);
    font-size: 14px;
    font-weight: 600;
    color: var(--hx-ink, #101828);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    text-decoration: none;
}

.concl-nav__btn:hover {
    background: var(--hx-sheet-2, #F4F6FA);
    border-color: var(--hx-line-2, #C9D3E0);
    color: var(--hx-ink, #101828);
    text-decoration: none;
}

.concl-nav__btn.is-primary {
    background: var(--p-primary, #2563EB);
    border-color: var(--p-primary, #2563EB);
    color: #fff;
}

.concl-nav__btn.is-primary:hover {
    background: var(--p-primary-hover, #1D4ED8);
    border-color: var(--p-primary-hover, #1D4ED8);
    color: #fff;
}

.concl-nav__btn:disabled,
.concl-nav__btn.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.concl-nav__counter {
    font-size: 13px;
    color: var(--hx-ink-2, #4A5568);
}

/* --- Адаптив --- */
@media (max-width: 992px) {
    .concl-layout {
        flex-direction: column;
    }

    .concl-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: none;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--hx-line, #E1E6EE);
    }

    .concl-sidebar__list {
        display: flex;
        flex-wrap: wrap;
        padding: 8px;
        gap: 4px;
    }

    .concl-sidebar__item {
        border-bottom: none;
    }

    .concl-sidebar__link {
        padding: 8px 12px;
        border-radius: 999px;
        border: 1px solid var(--hx-line-2, #C9D3E0);
        background: #fff;
        font-size: 12px;
    }

    /* На телефоне разделы — таблетки: активная с синей рамкой и светлой заливкой. */
    .concl-sidebar__link.is-active {
        border-color: var(--p-primary, #2563EB);
        background: var(--p-primary-soft, #EAF1FD);
        box-shadow: none;
    }

    .concl-sidebar__dot {
        display: none;
    }

    .concl-content {
        max-height: none;
    }
}
