/* =========================
   PAGE WRAPPER
========================= */
.body {
  background: #faf6f0;
  width: 100%;
  min-height: 100%;
  padding: 32px 0;
}

/* =========================
   BACK LINK
========================= */
.vb-detail-back { margin-bottom: 12px; }

.vb-back-link{
  display:inline-flex; align-items:center; gap:6px;
  font-family: Inter; font-weight:400;
  font-size:16px; line-height:160%;
  color:#303030; text-decoration:none;
}
.vb-back-link:hover{ text-decoration:underline; }

.vb-back-icon{
  width:32px; height:32px;
  display:flex; align-items:center; justify-content:center;
  border-radius:999px;
  border:1px solid rgba(217,217,217,1);
  font-size:18px;
}

/* =========================
   DETAIL CARD
========================= */
.vb-detail-card{
  background:#fff;
  border-radius:4px;
  border:1px solid rgba(48,48,48,0.08);
  padding:16px 24px;
  margin-bottom:24px;
}

.vb-detail-row{
  display:flex;
  gap:16px;
  padding:14px 0;
  border-bottom:1px solid rgba(48,48,48,0.06);
}
.vb-detail-row:last-child{ border-bottom:none; }

.vb-detail-label{
  width:160px;
  font-family:Inter;
  font-weight:700;
  font-size:14px;
  line-height:160%;
  color:#303030;
  flex: 0 0 160px;
}

.vb-detail-value{
  font-family:Inter;
  font-weight:400;
  font-size:14px;
  line-height:160%;
  color:#303030;
  flex: 1 1 auto;
  min-width: 0; /* quan trọng để clamp/ellipsis làm việc */
}

.vb-detail-value a{
  color:#303030;
  text-decoration:none;
}
.vb-detail-value a:hover,
.vb-detail-value a:focus{
  color:#0d47a1;
  text-decoration:underline;
}

/* file list trong card chi tiết */
.vb-detail-row-file .vb-detail-value{
  display:flex;
  flex-wrap:wrap;
  gap:8px 12px;
  align-items:center;
}

/* =========================
   SECTION TITLE
========================= */
.vb-section-title{
  margin:0 0 12px;
  font-family:Inter;
  font-weight:700;
  font-size:16px;
  line-height:160%;
  color:#303030;
}

/* =========================
   TABLE WRAPPER
========================= */
.vb-table-wrapper{
  background:#fff;
  border-radius:4px;
  border:1px solid #e5e7eb;
  overflow:hidden;
}

/* =========================
   TABLE (DESKTOP/TABLET)
========================= */
.vb-table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
  table-layout: fixed; /* ✅ chặn cột bị kéo vô hạn */
}

.vb-table thead{ background:#f5f5f5; }

.vb-table th,
.vb-table td{
  padding:12px 16px;
  border-bottom:1px solid #e5e7eb;
  text-align:left;
  vertical-align:top;
}

.vb-table th{
  font-family:Inter;
  font-weight:700;
  font-size:14px;
  line-height:160%;
  color:#303030;
}

/* zebra + hover */
.vb-table tbody tr:nth-child(even){ background:#fafafa; }
.vb-table tbody tr:hover{ background:#eef4ff; }

/* link */
.vb-table td a{
  color:#303030;
  text-decoration:none;
}
.vb-table td a:hover,
.vb-table td a:focus{
  color:#0d47a1;
  text-decoration:underline;
}

/* ✅ FIX: CỘT “Tài liệu đính kèm” KHÔNG BỊ DÀI
   - giới hạn chiều rộng
   - clamp 2 dòng cho mỗi link
*/
.vb-table th:nth-child(5),
.vb-table td:nth-child(5){
  text-align:left !important;
  width: 22%;
}

.vb-table td:nth-child(1){ width: 14%; }
.vb-table td:nth-child(2){ width: 34%; }
.vb-table td:nth-child(3){ width: 18%; }
.vb-table td:nth-child(4){ width: 12%; }

/* container ô file: nếu bạn render nhiều link, vẫn gọn */
.vb-table td:nth-child(5){
  white-space: normal;
}

.vb-table td:nth-child(5) a{
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;      /* ✅ 2 dòng thôi */
  overflow: hidden;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: anywhere;
  margin: 2px 0;
}

/* Nếu bạn có trường hợp text thuần có xuống dòng / <br> */
.vb-table td:nth-child(5) br{
  display:none; /* ✅ tránh cao dựng đứng vì <br> */
}

/* =========================
   DOWNLOAD BUTTON (nếu dùng)
========================= */
.vb-btn-download{
  border:none;
  background:#e5f0ff;
  border-radius:4px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  padding:6px 10px;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px){
  .body{ padding:16px 0; }

  /* card chi tiết */
  .vb-detail-card{ padding:12px 16px; }
  .vb-detail-row{ flex-direction:column; gap:4px; }
  .vb-detail-label{ width:100%; flex: 0 0 auto; }
}

/* ✅ MOBILE: TABLE -> CARD LIST (không scroll ngang) */
@media (max-width: 575.98px){
  .vb-table-wrapper{
    border: none;
    background: transparent;
    overflow: visible;
  }

  .vb-table, .vb-table thead, .vb-table tbody, .vb-table th, .vb-table td, .vb-table tr{
    display:block;
    width:100%;
  }

  .vb-table thead{ display:none; }

  .vb-table tbody tr{
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:8px;
    padding:10px 12px;
    margin-bottom:10px;
  }

  .vb-table td{
    border:none;
    padding:6px 0;
	width: 100% !important;
  }

  /* mỗi field có label dạng pseudo */
  .vb-table td:nth-child(1)::before{ content:"Số/Ký hiệu: "; font-weight:700; }
  .vb-table td:nth-child(2)::before{ content:"Trích yếu: "; font-weight:700; }
  .vb-table td:nth-child(3)::before{ content:"Đơn vị ban hành: "; font-weight:700; }
  .vb-table td:nth-child(4)::before{ content:"Ngày ban hành: "; font-weight:700; }
  .vb-table td:nth-child(5)::before{ content:"Tài liệu đính kèm: "; font-weight:700; }

  /* file link mobile: cho 3 dòng */
  .vb-table td:nth-child(5) a{
    -webkit-line-clamp: 3;
  }
}
