.comments-section {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  margin-top: 16px;
}

.comments-header {
  margin-bottom: 12px;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

.comments-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.comments-count {
  color: #888;
  font-weight: 400;
  font-size: 14px;
}

.comments-list {
  margin-bottom: 16px;
}

.comments-loading,
.comments-empty,
.comments-error {
  color: #888;
  font-size: 14px;
  text-align: center;
  padding: 16px 0;
}

.comments-error {
  color: #e74c3c;
}

.comments-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.comments-item:last-child {
  border-bottom: none;
}

.comments-item-reply {
  padding-left: 0;
}

.comments-replies {
  margin-left: 48px;
  border-left: 2px solid #e8e8e8;
  padding-left: 12px;
}

.comments-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  user-select: none;
}

.comments-body {
  flex: 1;
  min-width: 0;
}

.comments-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.comments-author {
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

.comments-role-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 500;
  text-transform: capitalize;
}

.comments-role-admin {
  background: #fde8e8;
  color: #c0392b;
}

.comments-role-manager {
  background: #fef3e2;
  color: #e67e22;
}

.comments-role-supervisor {
  background: #e8f4fd;
  color: #2980b9;
}

.comments-role-user {
  background: #eee;
  color: #666;
}

.comments-time {
  font-size: 12px;
  color: #999;
}

.comments-delete-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.2s;
}

.comments-delete-btn:hover {
  color: #e74c3c;
}

.comments-content {
  font-size: 14px;
  color: #444;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.comments-actions {
  margin-top: 4px;
}

.comments-reply-btn {
  background: none;
  border: none;
  color: #4A90D9;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  font-weight: 500;
}

.comments-reply-btn:hover {
  text-decoration: underline;
}

.comments-form,
.comments-reply-form {
  margin-top: 8px;
}

.comments-textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.comments-textarea:focus {
  outline: none;
  border-color: #4A90D9;
}

.comments-reply-textarea {
  font-size: 13px;
  padding: 8px 10px;
}

.comments-submit-btn {
  margin-top: 8px;
  padding: 8px 20px;
  background: #4A90D9;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.comments-submit-btn:hover {
  background: #357ABD;
}

.comments-submit-btn:disabled {
  background: #a0c4e8;
  cursor: not-allowed;
}

.comments-reply-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.comments-reply-submit {
  padding: 6px 14px;
  font-size: 13px;
}

.comments-cancel-btn {
  padding: 6px 14px;
  background: #eee;
  color: #666;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.comments-cancel-btn:hover {
  background: #ddd;
}

@media (max-width: 768px) {
  .comments-section {
    padding: 12px;
  }

  .comments-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 12px;
  }

  .comments-replies {
    margin-left: 32px;
  }

  .comments-submit-btn {
    width: 100%;
  }
}

body.dark-mode .comments-section,
[data-theme="dark"] .comments-section {
  background: #1e1e1e;
  border-color: #333;
}

body.dark-mode .comments-title,
[data-theme="dark"] .comments-title {
  color: #eee;
}

body.dark-mode .comments-author,
[data-theme="dark"] .comments-author {
  color: #ddd;
}

body.dark-mode .comments-content,
[data-theme="dark"] .comments-content {
  color: #ccc;
}

body.dark-mode .comments-item,
[data-theme="dark"] .comments-item {
  border-bottom-color: #333;
}

body.dark-mode .comments-header,
[data-theme="dark"] .comments-header {
  border-bottom-color: #333;
}

body.dark-mode .comments-textarea,
[data-theme="dark"] .comments-textarea {
  background: #2a2a2a;
  border-color: #444;
  color: #ddd;
}

body.dark-mode .comments-replies,
[data-theme="dark"] .comments-replies {
  border-left-color: #444;
}
