/* Shared file attachment row — admin + public */
.cv-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 6px;
}

.cv-file-item--bordered {
  margin-bottom: 8px;
  padding: 9px 13px;
  border: 1px solid #eae7e4;
  border-radius: 8px;
}

.cv-file-item--bordered:last-child {
  margin-bottom: 0;
}

.cv-file-item:last-child {
  margin-bottom: 0;
}

.cv-file-item__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
  background: #f1f3f5;
  color: #495057;
  font-size: 14px;
  position: relative;
}

.cv-file-item__icon .fa {
  line-height: 1;
}

.cv-file-item__ext {
  display: none;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

/* Opt-in extension label when Font Awesome is unavailable */
.cv-file-item--ext-fallback .cv-file-item__ext {
  display: inline;
}

.cv-file-item--ext-fallback .cv-file-item__icon .fa {
  display: none;
}

.cv-file-item__icon.is-pdf {
  background: rgba(193, 32, 0, 0.1);
  color: #c12000;
}

.cv-file-item__icon.is-doc {
  background: rgba(39, 99, 183, 0.1);
  color: #2763b7;
}

.cv-file-item__icon.is-xls {
  background: rgba(39, 135, 51, 0.1);
  color: #278733;
}

.cv-file-item__icon.is-img {
  background: rgba(213, 131, 0, 0.12);
  color: #d58300;
}

.cv-file-item__icon.is-video {
  background: rgba(111, 66, 193, 0.1);
  color: #6f42c1;
}

.cv-file-item__icon.is-audio {
  background: rgba(13, 110, 253, 0.1);
  color: #0d6efd;
}

.cv-file-item__icon.is-archive {
  background: rgba(108, 117, 125, 0.12);
  color: #6c757d;
}

.cv-file-item__icon.is-text {
  background: rgba(73, 80, 87, 0.1);
  color: #495057;
}

.cv-file-item__body {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
}

.cv-file-item__name {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.35;
  color: inherit;
}

.cv-file-item__badge {
  flex-shrink: 0;
  font-size: 11px;
  color: #6c757d;
}

.cv-file-item__badge::before {
  content: "(";
}

.cv-file-item__badge::after {
  content: ")";
}

.cv-file-item__badge--muted {
  color: #868e96;
}

.cv-file-item__meta {
  flex-shrink: 0;
  font-size: 11px;
  color: #868e96;
}

.cv-file-item__actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.cv-file-item__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #fff;
  color: #495057;
  text-decoration: none;
  cursor: pointer;
  line-height: 1;
  font-size: 12px;
}

.cv-file-item__btn:hover {
  background: #f8f9fa;
  color: #212529;
  text-decoration: none;
}

.cv-file-item__btn--preview {
  border-color: rgba(13, 110, 253, 0.35);
  color: #0d6efd;
}

.cv-file-item__btn--preview:hover {
  background: rgba(13, 110, 253, 0.08);
  color: #0d6efd;
}

.cv-file-item__btn--edit {
  border-color: rgba(108, 117, 125, 0.4);
}

.cv-file-item__btn--download {
  border-color: rgba(25, 135, 84, 0.35);
  color: #198754;
}

.cv-file-item__btn--download:hover {
  background: rgba(25, 135, 84, 0.08);
  color: #198754;
}

.cv-file-item__btn--danger {
  border-color: rgba(220, 53, 69, 0.35);
  color: #dc3545;
}

.cv-file-item__btn--danger:hover {
  background: rgba(220, 53, 69, 0.08);
  color: #dc3545;
}

.cv-file-item__btn-text {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

/* Text-label buttons (public / no Font Awesome) */
.cv-file-item--ext-fallback .cv-file-item__btn {
  width: auto;
  min-width: 36px;
  height: 28px;
  padding: 0 8px;
}

.cv-file-item--ext-fallback .cv-file-item__btn .fa {
  display: none;
}

/* Compact in tables */
.cv-file-item--compact .cv-file-item__icon {
  width: 24px;
  height: 24px;
  font-size: 12px;
}

.cv-file-item--compact .cv-file-item__btn {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.cv-file-item--compact.cv-file-item--ext-fallback .cv-file-item__btn {
  width: auto;
  min-width: 32px;
  height: 24px;
  padding: 0 6px;
}

/* Text actions (admin list style) — Xem / Tải xuống */
.cv-file-item--text-actions .cv-file-item__actions.cv-al-row-actions {
  flex-shrink: 0;
  gap: 6px;
}

.cv-file-item--compact .cv-file-item__name {
  font-size: 12px;
}

/* Collapsible file list — preview first N, then Xem thêm / Thu gọn */
.cv-file-list {
  min-width: 0;
  max-width: 100%;
}

.cv-file-list > .cv-file-item {
  margin-bottom: 6px;
}

.cv-file-list > .cv-file-item:last-of-type {
  margin-bottom: 0;
}

.cv-file-list.is-collapsed > .cv-file-item--overflow,
.cv-file-list.is-paged > .cv-file-item--overflow {
  display: none;
}

.cv-file-list.is-collapsed > .cv-file-item:not(.cv-file-item--overflow):last-of-type,
.cv-file-list.is-paged > .cv-file-item:not(.cv-file-item--overflow):last-of-type {
  margin-bottom: 0;
}

.cv-file-list__toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: #0d6efd;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
}

.cv-file-list__toggle:hover {
  color: #0a58ca;
}

.cv-file-list__pager {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

.cv-file-list__pager .pagination {
  margin: 0;
  gap: 4px;
}

.cv-file-list__pager .page-link {
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border: 1px solid #eae7e4;
  border-radius: 8px !important;
  background: #fff;
  color: #212529;
  font-size: 12px;
  font-weight: 600;
}

.cv-file-list__pager .page-item.active .page-link {
  background: #c12000;
  border-color: #c12000;
  color: #fff;
}

.cv-file-list__pager .page-item.disabled .page-link {
  opacity: 0.45;
  pointer-events: none;
}

.cv-file-list__pager .page-link:focus-visible {
  outline: 2px solid rgba(193, 32, 0, 0.35);
  outline-offset: 1px;
}

/* Compact icon remove — next to file rows (result / assignment) */
.cv-file-remove-btn {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0.3rem;
  background: transparent;
  color: #adb5bd;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.cv-file-remove-btn:hover,
.cv-file-remove-btn:focus-visible {
  background: rgba(193, 32, 0, 0.1);
  color: #c12000;
  outline: none;
}

