/* Основной контейнер */
.directories-layout {
    display: flex;
    flex-grow: 1;
    gap: 20px;
    padding: 20px;
    height: calc(100vh - 60px); /* Высота экрана минус хедер */
    overflow: hidden; /* Скрываем общий скролл страницы */
}

/* --- ЛЕВАЯ ПАНЕЛЬ --- */
.dir-sidebar {
    width: 350px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    background: #fff;
    border-radius: 0.375rem;
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
    overflow: hidden;
}
.dir-sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    flex-shrink: 0;
}
.dir-sidebar-list {
    flex-grow: 1;
    overflow-y: auto; /* Скролл только здесь */
    padding: 0;
}

/* Элементы списка */
.directory-item {
    cursor: pointer;
    padding: 12px 15px;
    border-bottom: 1px solid #f1f1f1;
    transition: background 0.2s;
}
.directory-item:hover {
    background-color: #f8f9fa;
}
.directory-item.active {
    background-color: #e9ecef;
    border-left: 4px solid #0d6efd;
}

/* --- ПРАВАЯ ПАНЕЛЬ --- */
.dir-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 0.375rem;
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
    overflow: hidden; /* Важно, чтобы контент не вылезал */
    min-width: 0;
}

/* Шапка (Фиксированная высота) */
.dir-content-header {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    background: #fff;
    flex-shrink: 0; /* Не сжиматься */
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px; /* Чуть выше для размещения бейджа */
}

/* Тело таблицы (Занимает всё оставшееся место) */
.dir-content-body {
    flex-grow: 1; 
    overflow-y: auto; /* Скролл только здесь */
    padding: 0;
    position: relative;
    min-height: 0; /* Fix для flexbox скролла */
}
.dir-content-body thead th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 5;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Поиск */
.search-box {
    max-width: 300px;
    position: relative;
}
.search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
}
.search-box input {
    padding-left: 32px;
}

/* Футер (Прибит к низу, фиксированная высота) */
.dir-content-footer {
    padding: 10px 15px;
    border-top: 1px solid #dee2e6;
    background: #fff;
    flex-shrink: 0; /* Не сжиматься и не исчезать */
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 55px; /* Фиксированная высота */
}
/* ... (предыдущие стили для layout, sidebar, body без изменений) ... */
.directories-layout {
    display: flex;
    flex-grow: 1;
    gap: 20px;
    padding: 20px;
    height: calc(100vh - 60px);
    overflow: hidden;
}
/* ... sidebar ... */
.dir-sidebar {
    width: 350px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    background: #fff;
    border-radius: 0.375rem;
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
    overflow: hidden;
}
.dir-sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    flex-shrink: 0;
}
.dir-sidebar-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0;
}
.directory-item {
    cursor: pointer;
    padding: 12px 15px;
    border-bottom: 1px solid #f1f1f1;
    transition: background 0.2s;
}
.directory-item:hover { background-color: #f8f9fa; }
.directory-item.active { background-color: #e9ecef; border-left: 4px solid #0d6efd; }

.dir-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 0.375rem;
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
    overflow: hidden;
    min-width: 0;
}

/* ШАПКА ТЕПЕРЬ СОДЕРЖИТ ПАГИНАЦИЮ */
.dir-content-header {
    padding: 10px 20px;
    border-bottom: 1px solid #dee2e6;
    background: #fff;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.dir-content-body {
    flex-grow: 1; 
    overflow-y: auto;
    padding: 0;
    position: relative;
    min-height: 0;
}
.dir-content-body thead th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 5;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.search-box { max-width: 300px; position: relative; }
.search-box i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #adb5bd; }
.search-box input { padding-left: 32px; }

/* Нижний тонкий футер только для инфо */
.dir-content-footer {
    flex-shrink: 0;
    font-size: 0.85rem;
}
