.content-area {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
}

.module-section {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.module-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eaeaea;
}

.module-title {
    font-size: 1.8rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
}

.module-icon-large {
    font-size: 2rem;
    margin-right: 15px;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    background-color: #3498db;
}

/* Карточки */
.card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    background-color: #3498db;
}

/* Кнопки */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #1abc9c 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

/* Стили для базы знаний */
.knowledge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border 0.3s;
}

.search-box input:focus {
    border-color: #3498db;
    outline: none;
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;
    font-size: 0.9rem;
}

.categories-sidebar {
    width: 250px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    padding: 20px;
    margin-right: 20px;
}

.knowledge-main {
    flex: 1;
}

.knowledge-layout {
    display: flex;
}

.category-list {
    list-style: none;
}

.category-item {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-item:hover {
    background-color: #f8f9fa;
}

.category-item.active {
    background-color: #e3f2fd;
    color: #3498db;
    font-weight: 600;
}

.category-count {
    background-color: #e9ecef;
    color: #6c757d;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.8rem;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.article-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
    border-top: 4px solid #3498db;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.article-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #2c3e50;
}

.article-meta {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 10px;
}

.article-excerpt {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.tag {
    background-color: #e3f2fd;
    color: #3498db;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
}

.article-views {
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Модальное окно просмотра статьи */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 30px auto;
    width: 90%;
    max-width: 900px;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    overflow: hidden;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
}

.modal-body {
    padding: 25px;
    max-height: 70vh;
    overflow-y: auto;
}

.article-content {
    line-height: 1.7;
}

.article-content h2 {
    margin: 20px 0 10px;
    color: #2c3e50;
}

.article-content p {
    margin-bottom: 15px;
}

.article-content ul, .article-content ol {
    margin-bottom: 15px;
    padding-left: 20px;
}

.article-content li {
    margin-bottom: 5px;
}

.article-content blockquote {
    border-left: 4px solid #3498db;
    padding-left: 15px;
    margin: 15px 0;
    font-style: italic;
    color: #555;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
}

.article-info {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: #6c757d;
}

/* Редактор статьи */
.editor-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 20px;
}

.editor-toolbar {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    background-color: #f8f9fa;
}

.editor-toolbar button {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s;
}

.editor-toolbar button:hover {
    background-color: #e9ecef;
}

.editor-area {
    padding: 20px;
    min-height: 400px;
}

.editor-area textarea {
    width: 100%;
    min-height: 350px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
}

.editor-area textarea:focus {
    border-color: #3498db;
    outline: none;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border 0.3s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: #3498db;
    outline: none;
}

/* Версионирование */
.versions-list {
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
}

.version-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.version-item:last-child {
    border-bottom: none;
}

.version-info {
    display: flex;
    flex-direction: column;
}

.version-meta {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 5px;
}
.pagination{
    display: flex; justify-content: space-between; align-items: center;
}
.pagination-buttons{
    display: flex; gap: 5px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
    }
    
    .knowledge-layout {
        flex-direction: column;
    }
    
    .categories-sidebar {
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }  }

.knowledge-main {
  transition: all 0.3s ease;
  overflow-y: auto; /* Добавляем скролл для knowledge-main */
  max-height: calc(100vh - 200px); /* Примерная высота, чтобы контент помещался с скроллом */
}

.knowledge-main.grid .articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.knowledge-main.list .articles-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.knowledge-main.list .article-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: white;
}

.knowledge-main.list .article-header {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.knowledge-main.list .article-excerpt {
  flex: 2;
  margin: 0 1.5rem;
  font-size: 0.95rem;
}

.knowledge-main.list .article-footer,
.knowledge-main.list .article-views {
  flex-shrink: 0;
}

.knowledge-main.tiles .articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 1.75rem;
}

.knowledge-main.tiles .article-card {
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.knowledge-main.tiles .article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

.view-switcher {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.view-switcher .view-btn {
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background: white;
  color: var(--gray-700);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.view-switcher .view-btn:hover {
  background: var(--gray-100);
}

.view-switcher .view-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary-dark);
}
.filter-date-range {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-date-range label {
  font-weight: 500;
  color: var(--gray-700);
  white-space: nowrap;
}

.date-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.date-inputs input[type="date"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.95rem;
  width: 140px;
}

.date-inputs span {
  color: var(--gray-500);
}

/* Фильтры — показ/скрытие */
.filters {
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}

.filters.open {
  max-height: 500px; /* Уменьшили до 500px, чтобы не скрывать весь контент */
  opacity: 1;
  margin-bottom: 20px;
}

.department-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px 0;
}

.department-item {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 4px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s;
}

.department-item:hover {
  background: #f0f7ff;
}

.department-item.active {
  background: #e3f2fd;
  color: #2563eb;
  font-weight: 600;
}

.count {
  background: #e5e7eb;
  color: #4b5563;
  font-size: 0.82rem;
  padding: 3px 9px;
  border-radius: 999px;
}


  /* 24.02 */
  /* Стили для древа */
  .tree-node {
    transition: background-color 0.2s;
  }
  .tree-node:hover {
    background-color: #f0f7ff;
  }
  .tree-node.level-1:hover {
    background-color: #f0f7ff;
  }
  .tree-node.level-2 {
    margin-left: 0.5rem;
    font-size: 0.9rem;
    color: #495057;
  }
  .tree-node.level-2 .category-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.5rem;
  }
  .tree-children {
    border-left: 1px dashed #dee2e6;
    padding-left: 0.5rem;
  }
  
  /* Активный узел дерева */
  .tree-node.active {
    background-color: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
  }
  .tree-node.active i {
    color: #1976d2;
  }
  
  /* Переключение видов */
  .view-toggle-btn.active {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    color: #3498db;
  }
  
  /* Вид списком */
  .articles-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  .articles-grid.list-view .article-card {
    display: flex;
    align-items: center;
    padding: 1rem;
  }
  .articles-grid.list-view .article-header {
    flex: 2;
  }
  .articles-grid.list-view .article-excerpt {
    flex: 3;
    margin: 0 1rem;
  }
  .articles-grid.list-view .article-footer {
    flex: 1;
    justify-content: flex-end;
  }
  
  /* Компактный вид */
  .articles-grid.compact-view {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  .articles-grid.compact-view .article-card {
    padding: 0.75rem 1rem;
  }
  .articles-grid.compact-view .article-excerpt {
    display: none;
  }
  .articles-grid.compact-view .article-meta {
    font-size: 0.8rem;
  }