/* Nguồn chứng từ, Nhật ký & chi phí AI, Nghiệm thu, trang chi tiết kiểu cũ. Dùng token trong styles.css (:root); không viết mã màu trực tiếp. */

/* Buttons with an icon in front of their text (the text stays the button's name). */
.btn.with-icon { display:inline-flex; align-items:center; gap:6px; }

/* Status card at the top of Nguồn chứng từ (N1): one state, one action, then the dataset figures. */
.source-overview { display:grid; gap:10px; margin:0 0 16px; padding:14px 16px; border-left:4px solid var(--teal); }
.source-overview-main { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.source-overview-copy { min-width:0; }
.source-overview-title { display:block; font-size:var(--fs-md); }
.source-overview-copy p { margin:4px 0 0; }
.source-overview-main > .btn { flex:none; }
.source-overview-no-drive, .source-overview-no-source, .source-overview-never { border-left-color:var(--amber); }
.source-overview-error, .source-overview-stopped { border-left-color:var(--red); }
.source-overview-scanning { border-left-color:var(--blue); }
.source-overview-done { border-left-color:var(--green); }
.source-overview-figures { display:flex; flex-wrap:wrap; align-items:center; gap:4px; color:var(--muted); font-size:var(--fs-xs); }
.source-overview .cohort-progress { grid-column:auto; }

/* Folder cards. */
.source-section-title { margin:4px 0 10px; font-size:var(--fs); font-weight:600; }
.source-config-head a { font-size:var(--fs-xs); color:var(--blue); }
.source-stopped { display:flex; align-items:center; gap:4px; margin-top:10px; }

/* "Nâng cao" (N2): collapsed, one section per tool the viewer may use. */
.source-advanced { margin-top:16px; padding:12px 16px; }
.source-advanced > summary { cursor:pointer; }
.source-advanced[open] > summary { margin-bottom:4px; }
.source-advanced-item { display:grid; gap:8px; padding:14px 0 4px; border-top:1px solid var(--line); margin-top:10px; }
.source-advanced-item > h3 { display:flex; align-items:center; margin:0; font-size:var(--fs); }
.source-advanced-item > p { margin:0; }
.source-advanced-item > .btn { justify-self:start; }
.statement-sync-field { display:grid; gap:4px; flex:1 1 260px; min-width:0; font-size:var(--fs-xs); color:var(--muted); }
.statement-sync-field > span { display:flex; align-items:center; }
.statement-sync-field input { box-sizing:border-box; width:100%; padding:7px 8px; border:1px solid var(--line); border-radius:var(--radius-sm); font:inherit; font-size:var(--fs); color:var(--ink); background:var(--card); }
.document-rules { margin:0; }

/* Nhật ký & chi phí AI (N4). */
.operations-technical { margin-top:8px; padding:12px 16px; }
.operations-technical > summary { cursor:pointer; font-weight:600; }
.operations-technical[open] > summary { margin-bottom:10px; }
.operations-toolbar h2 { display:flex; align-items:center; }

/* Nghiệm thu (N5, N6). */
.acceptance-tiles { grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); }
.acceptance-summary { margin:4px 0 14px; font-size:var(--fs-sm); }
.acceptance-code { white-space:nowrap; font-weight:600; }
.acceptance-open { padding:0; font-size:var(--fs); text-align:left; }
.acceptance-actions { display:flex; flex-wrap:wrap; gap:6px; }
.acceptance-row.pending { opacity:.6; }
.acceptance-comparison td { vertical-align:top; overflow-wrap:anywhere; }
.reference-technical > summary { cursor:pointer; color:var(--blue); font-size:var(--fs-xs); font-weight:600; }
.reference-technical textarea { width:100%; min-height:80px; margin-top:6px; }
.field-label { font-size:var(--fs-sm); font-weight:600; }

/* Older detail page (D13): raw records folded away. */
.legacy-technical { margin-top:10px; }
.legacy-technical > summary { cursor:pointer; color:var(--blue); font-size:var(--fs-xs); font-weight:600; }
.legacy-history, .suggestion-summary { margin:6px 0; padding-left:20px; }
.legacy-history li, .suggestion-summary li { margin:3px 0; }

@media (max-width: 640px) {
  .source-overview-main { align-items:flex-start; flex-direction:column; }
}

/* Files of the scanned folders not read, with name and reason, and duplicates (issue #4). */
.unread-files { margin-top:16px; }
.unread-file-list { display:grid; gap:0; margin:8px 0 0; padding:0; list-style:none; }
.unread-file { display:grid; gap:2px; padding:10px 0; border-top:1px solid var(--line); min-width:0; }
.unread-file-head { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 10px; }
.unread-file-name { overflow-wrap:anywhere; }
.unread-file-path { font-size:var(--fs-sm); overflow-wrap:anywhere; }
.unread-file .btn-link { justify-self:start; }
.unread-duplicates { margin-top:12px; }
.unread-duplicates > summary { cursor:pointer; font-weight:600; }
.source-skip-summary .btn-link { margin-left:2px; }
