/* =========================================================================
   ДОКУМЕНТЫ
   archive-documents.php, single-documents.php, [documents_list], content-member.php
   ========================================================================= */

/* ---------- Фильтр категорий ---------- */
.documents-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.documents-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--rs-line);
  border-radius: var(--rs-radius-pill);
  background: var(--rs-surface);
  color: var(--rs-text) !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background var(--rs-dur-fast) var(--rs-ease), border-color var(--rs-dur-fast) var(--rs-ease), color var(--rs-dur-fast) var(--rs-ease);
}

.documents-filter:hover {
  border-color: var(--rs-brand-200);
  background: var(--rs-brand-50);
  color: var(--rs-brand) !important;
}

.documents-filter.is-active {
  border-color: var(--rs-brand);
  background: var(--rs-brand);
  color: #fff !important;
}

.documents-filter__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--rs-radius-pill);
  background: var(--rs-surface-3);
  color: var(--rs-muted);
  font-size: 12px;
  font-weight: 700;
}

.documents-filter.is-active .documents-filter__count {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* ---------- Сетка карточек архива ---------- */
.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 16px;
}

.documents-card-link {
  display: block;
  color: inherit !important;
  text-decoration: none !important;
}

.documents-card-archive {
  height: 100%;
  min-height: 96px;
  overflow: hidden;
  border: 1px solid var(--rs-line);
  border-radius: var(--rs-radius-lg);
  background: var(--rs-surface);
  box-shadow: var(--rs-shadow-xs);
  transition: border-color var(--rs-dur) var(--rs-ease), box-shadow var(--rs-dur) var(--rs-ease), transform var(--rs-dur) var(--rs-ease);
}

.documents-card-link:hover .documents-card-archive {
  border-color: var(--rs-brand-100);
  box-shadow: var(--rs-shadow);
  transform: translateY(-2px);
}

.documents-card-archive .card-body {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  height: 100%;
  padding: 18px;
}

.documents-card-archive .doc-icon {
  display: flex;
  flex: 0 0 48px;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--rs-brand-50);
  color: var(--rs-brand);
}

.documents-card-archive .doc-content {
  flex: 1;
  min-width: 0;
}

.documents-card-archive .card-title {
  margin: 0 0 4px !important;
  color: var(--rs-ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.documents-card-archive .card-text {
  margin: 0;
  color: var(--rs-muted);
  font-size: 13px;
  line-height: 1.45;
}

.document-count-badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--rs-radius-pill);
  background: var(--rs-surface-2);
  color: var(--rs-muted);
  font-size: 12px;
  font-weight: 700;
}

.document-count-badge .count-number {
  color: var(--rs-ink);
}

.documents-card-archive .doc-arrow {
  display: flex;
  color: var(--rs-subtle);
  transition: transform var(--rs-dur-fast) var(--rs-ease), color var(--rs-dur-fast) var(--rs-ease);
}

.documents-card-link:hover .doc-arrow {
  color: var(--rs-brand);
  transform: translateX(3px);
}

.documents-pagination {
  margin-top: 32px;
}

/* ---------- Список файлов ---------- */
.documents-content {
  margin-bottom: 24px;
}

.documents-list-wrapper {
  margin-top: 8px;
}

.documents-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.documents-list .document-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px 14px 14px;
  border: 1px solid var(--rs-line);
  border-radius: var(--rs-radius-lg);
  background: var(--rs-surface);
  transition: border-color var(--rs-dur) var(--rs-ease), box-shadow var(--rs-dur) var(--rs-ease);
}

.documents-list .document-item:hover {
  border-color: var(--rs-brand-100);
  box-shadow: var(--rs-shadow-sm);
}

.documents-list .doc-icon-wrapper {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--rs-surface-2);
}

.documents-list .doc-icon-wrapper svg {
  display: block;
  width: 44px;
  height: 44px;
}

.documents-list .doc-info {
  flex: 1;
  min-width: 0;
}

.documents-list .doc-title {
  display: block;
  margin-bottom: 6px;
  color: var(--rs-ink) !important;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none !important;
  word-break: break-word;
}

.documents-list .doc-title:hover {
  color: var(--rs-brand) !important;
}

.documents-list .doc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--rs-muted);
  font-size: 13px;
}

.documents-list .doc-type {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--rs-surface-3);
  color: var(--rs-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.documents-list .btn-download {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--rs-brand-100);
  border-radius: 12px;
  background: var(--rs-brand-50);
  color: var(--rs-brand) !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background var(--rs-dur-fast) var(--rs-ease), border-color var(--rs-dur-fast) var(--rs-ease), color var(--rs-dur-fast) var(--rs-ease);
}

.documents-list .btn-download:hover {
  border-color: var(--rs-brand);
  background: var(--rs-brand);
  color: #fff !important;
}

/* ---------- [documents_list] ---------- */
.intelligence-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.intelligence-list li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.intelligence-icon {
  display: inline-flex;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--rs-brand-50);
  color: var(--rs-brand);
  font-weight: 700;
}

.intelligence-list a {
  color: var(--rs-ink);
  font-weight: 500;
}

.intelligence-list a:hover {
  color: var(--rs-brand);
}

/* ---------- Документы сотрудника / старые классы ---------- */
.member-documents {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.member-documents__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--rs-line);
  border-radius: var(--rs-radius);
}

.member-documents__icon img,
.member-documents__icon svg {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.member-documents__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.member-documents__title {
  color: var(--rs-ink);
  font-weight: 600;
}

.member-documents__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 13px;
}

.document__download {
  margin-right: 16px;
  font-weight: 500;
  line-height: 24px;
}

.member-documents .document__download {
  margin: 0;
}

.document__download_golden {
  color: var(--color-golden);
}

.parsercode {
  margin-bottom: 2em;
  padding: 2em;
  border: 1px solid var(--rs-line);
  border-radius: var(--rs-radius);
}

@media (max-width: 575px) {
  .documents-grid {
    grid-template-columns: 1fr;
  }

  .documents-list .document-item {
    flex-wrap: wrap;
  }

  .documents-list .btn-download {
    justify-content: center;
    width: 100%;
  }
}
