@layer components {
  .documents-layout {
    display: flex;
    flex-direction: row;
    gap: 24px;
    width: 100%;
    align-items: flex-start;
  }

  .documents-main {
    flex: 1;
    min-width: 0;
  }

  .documents-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 22px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  }

  .category-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: 8px;
    color: #475569;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
    margin-bottom: 2px;
  }

  .category-nav-item:hover {
    background-color: #f1f5f9;
    color: #0f172a;
    text-decoration: none;
  }

  .category-nav-item.active {
    background-color: #eef2ff;
    color: #4338ca;
    font-weight: 600;
  }

  .category-nav-item .badge {
    background-color: #f1f5f9;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
  }

  .category-nav-item.active .badge {
    background-color: #c7d2fe;
    color: #3730a3;
  }

  .category-sub-tree {
    padding-left: 12px;
    margin-left: 6px;
    border-left: 2px solid #e2e8f0;
  }

  .document-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  }

  .document-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
  }

  .document-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
  }

  .document-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fee2e2;
    color: #dc2626;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .document-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .document-title {
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .document-title:hover {
    color: #4f46e5;
    text-decoration: none;
  }

  .document-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
  }

  .document-category-tag {
    background-color: #f1f5f9;
    color: #475569;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
  }

  .document-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: #475569;
    background: transparent;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    flex-shrink: 0;
    box-sizing: border-box;
  }

  .btn-icon svg {
    flex-shrink: 0;
  }

  .btn-icon:hover {
    background-color: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
  }

  .btn-icon-danger {
    color: #64748b;
  }

  .btn-icon-danger:hover {
    background-color: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
  }

  .pdf-preview-container {
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 280px);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
  }

  .search-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 16px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: border-color 0.15s, box-shadow 0.15s;
  }

  .search-box:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  }

  .search-box input {
    border: none;
    outline: none;
    width: 100%;
    padding: 4px 8px;
    font-size: 14px;
    color: #0f172a;
    background: transparent;
  }

  @media only screen and (max-width: 1024px) {
    .documents-layout {
      flex-direction: column;
    }
    .documents-sidebar {
      width: 100%;
    }
  }
}
