.base--kb .kb-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.kb-layout__list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

body.kb-modal-open {
    overflow: hidden;
}

.base-table__tr_active .base-table__row {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.kb-filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
}

.kb-filter label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.kb-filter select {
    background-color: #0b1320;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 10px 14px;
    color: #fff;
    font-size: 14px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.kb-filter select option {
    background-color: #0b1320;
    color: #fff;
}

.kb-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.kb-detail-modal_active {
    opacity: 1;
    pointer-events: auto;
}

.kb-detail-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
}

.kb-detail {
    position: relative;
    width: min(960px, 96vw);
    max-height: calc(100vh - 80px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 12, 20, 0.95);
    backdrop-filter: blur(12px);
    padding: 56px 32px 32px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.kb-detail--empty .kb-detail__close {
    display: none;
}

.kb-detail--empty {
    min-height: 360px;
}

.kb-detail__scroll {
    overflow: auto;
    padding-right: 8px;
    margin-top: 16px;
    max-height: calc(100vh - 192px);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.kb-detail__scroll::-webkit-scrollbar {
    width: 6px;
}

.kb-detail__scroll::-webkit-scrollbar-track {
    background: transparent;
}

.kb-detail__scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 999px;
}

.kb-detail__scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.kb-detail__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    z-index: 5;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.kb-detail__close:hover {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.kb-detail__placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    padding: 40px 20px;
}

.kb-detail__header {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 18px;
    align-items: center;
}

.kb-detail__icon {
    width: 96px;
    height: 96px;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kb-detail__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.kb-detail__title {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
}

.kb-detail__subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.kb-detail__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.kb-pill {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    line-height: 1.3;
    margin: 2px;
}

.kb-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 18px;
    margin-top: 18px;
}

.kb-section:first-of-type {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.kb-section__title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.kb-section__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.kb-key-value {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 12px 16px;
    min-height: 92px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kb-key-value strong {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
    word-break: break-word;
}

.kb-key-value span {
    font-size: 15px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.kb-properties__toggle {
    margin-top: 12px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.kb-table {
    width: 100%;
    border-spacing: 0;
    border-collapse: collapse;
}

.kb-table th,
.kb-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.kb-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.6);
}

.kb-table td {
    font-size: 14px;
}

.kb-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kb-card {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 18px;
    padding: 14px 16px;
}

.kb-card__title {
    font-weight: 600;
    margin-bottom: 6px;
}

.kb-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
}

.kb-history {
    max-height: 240px;
    overflow: auto;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    padding: 12px 16px;
}

.kb-history__item + .kb-history__item {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.kb-history__title {
    font-weight: 600;
    margin-bottom: 4px;
}

.kb-history__timeline {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.kb-ingredients {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.kb-ingredients_compact {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

.kb-ingredient {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
}

.kb-ingredient_compact {
    padding: 6px 10px;
    gap: 8px;
}

.kb-ingredient__icon {
    flex-shrink: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
}

.kb-ingredient__info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.kb-ingredient__name {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kb-ingredient_compact .kb-ingredient__name {
    font-size: 13px;
}

.kb-ingredient__count {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .kb-detail {
        width: 100%;
        max-height: calc(100vh - 40px);
        border-radius: 16px;
        padding: 18px;
    }

    .kb-detail__close {
        top: 10px;
        right: 10px;
    }

    .kb-detail__header {
        grid-template-columns: 72px 1fr;
    }

    .kb-ingredients_compact {
        flex-direction: column;
    }
}
