/* مرکز اسناد — همان استایل کتابخانه اتوماسیون */

/* آواتار (پورتال automation.css را لود نمی‌کند) */
.user-avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #334155;
  color: #e2e8f0;
  font-weight: 700;
}
.user-avatar-sm { width: 24px; height: 24px; font-size: 0.7rem; }
.user-avatar-fallback { border: 1px solid rgba(255, 255, 255, 0.15); }
img.user-avatar { object-fit: cover; display: block; }
.user-with-avatar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.user-avatar-wrap {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}
.user-avatar-wrap > img.user-avatar:only-child {
  display: block;
}

.reg-panel-wrap { display: flex; flex-direction: column; gap: 0.75rem; }
.reg-controls { margin-bottom: 0.25rem; }
.reg-att-list { list-style: none; margin: 0.35rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.reg-att-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.35rem 0.5rem;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 6px;
}
.reg-att-item a { color: inherit; text-decoration: none; }
.reg-att-item a:hover { text-decoration: underline; }
.reg-att-size { color: #64748b; font-size: 0.85em; }
.reg-att-cell { min-width: 10rem; }
.reg-inline-att {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-inline-end: 0.5rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
}
.reg-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.reg-desc { margin-top: 0.35rem; white-space: pre-wrap; }
.reg-comment-cell { white-space: nowrap; text-align: center; }
.reg-comment-count-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}
.reg-commenters-cell { min-width: 6rem; }
.reg-commenter-stack {
  display: inline-flex;
  align-items: center;
  flex-direction: row-reverse;
  padding-inline-end: 0.25rem;
}
.reg-commenter-avatar {
  display: inline-flex;
  margin-inline-end: -0.4rem;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff;
}
.reg-commenter-avatar .user-avatar,
.reg-commenter-avatar .user-avatar-wrap {
  width: 28px;
  height: 28px;
}
.reg-commenter-avatar .user-avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 0.7rem;
}
.reg-commenter-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  margin-inline-end: -0.4rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 0 0 2px #fff;
  z-index: 1;
}
.reg-comments-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}
.reg-comments-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.reg-comment-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.8rem;
}
.reg-comment-compose-wrap { margin-bottom: 0.85rem; }
.reg-comment-compose {
  margin-top: 0.6rem;
  padding: 0.75rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
}
.reg-comment-compose textarea {
  width: 100%;
  margin: 0.35rem 0 0.6rem;
  resize: vertical;
}
.reg-comment-form-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.reg-comments-feed {
  list-style: none;
  margin: 0;
  padding: 0;
}
.reg-comment-item {
  padding: 0.65rem 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 0.55rem;
}
.reg-comment-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}
.reg-comment-head .user-avatar-sm,
.reg-comment-head .user-avatar-wrap {
  width: 32px;
  height: 32px;
}
.reg-comment-head .user-avatar-sm {
  font-size: 0.8rem;
}
.reg-comment-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.reg-comment-time {
  font-size: 0.8rem;
  color: #64748b;
}
.reg-comment-text {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.6;
}
.reg-comment-empty {
  padding: 0.5rem 0;
  color: #64748b;
}
.dc-table { width: 100%; }
.dc-panel-wrap .section-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}
.reg-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 640px) {
  .reg-form .form-row {
    grid-template-columns: 1fr;
  }
}
