/*
 * css/knowledge-base.css — Trang "Kho tri thức".
 * Reuse cấu trúc grid/list của documents.css (.document-grid, .document-item...),
 * bổ sung: trạng thái file, tags chips, dòng progress khi trích xuất.
 */

.kb-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.kb-status-ready {
  background: #e7f4ea;
  color: #2e7d32;
}

.kb-status-extracting,
.kb-status-uploading {
  background: #fff8e6;
  color: #b26a00;
}

.kb-status-error {
  background: #fdecea;
  color: #b3261e;
}

.kb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.kb-tag-chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: #eef2f7;
  color: #4a5b70;
  border: 1px solid #dde4ec;
}

.kb-chars {
  font-size: 11px;
  color: #8a97a6;
  margin-top: 4px;
}

.kb-progress-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #4a5b70;
  padding: 6px 0;
}

.kb-progress-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #cfd8e3;
  border-top-color: #1d4ed8;
  border-radius: 50%;
  animation: kb-spin 0.8s linear infinite;
}

@keyframes kb-spin {
  to { transform: rotate(360deg); }
}

.kb-error-detail {
  font-size: 11px;
  color: #b3261e;
  margin-top: 4px;
  word-break: break-word;
}

.kb-preview-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.55;
  background: #f8fafc;
  border: 1px solid #dde4ec;
  border-radius: 8px;
  padding: 10px 12px;
  max-height: 420px;
  overflow: auto;
}

.kb-preview-meta {
  margin-bottom: 8px;
}

.kb-preview-meta p {
  margin: 2px 0;
}
