/* Module Agency + Supplier — chỉ 2 module này dùng. Token dùng var(--...), không hard-code màu. */

/* ---- lọc theo agency ở thanh hành động ---- */
.ag-filter { width: auto; padding: 5px 12px; font-size: 12px; border-radius: 100px; }

/* ---- lưới thẻ phiên ---- */
.ag-job-grid { display: grid; gap: 13px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.ag-job-card {
  display: flex; flex-direction: column; gap: 7px; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 13px 15px; box-shadow: var(--shadow-card); font: inherit; color: var(--ink);
  transition: box-shadow .18s ease, transform .18s ease;
}
.ag-job-card:hover { box-shadow: var(--shadow-soft); transform: translateY(-1px); }
.ag-job-card.is-late { border-color: var(--red); }

.ag-job-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.ag-job-title { font-size: 13.5px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-job-card.is-late .ag-job-title { color: var(--red); }
.ag-job-meta { font-size: 12px; color: var(--ink-muted); }
.ag-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.ag-job-card .progress-track { margin-top: 4px; }

.ag-late-title { color: var(--red); }

/* ---- khối gấp: phiên đã xong / danh bạ agency ---- */
.ag-closed, .ag-agency-block { margin-top: 16px; }
.ag-closed > summary, .ag-agency-block > summary {
  cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-muted); padding: 6px 0;
}
.ag-closed > summary:hover, .ag-agency-block > summary:hover { color: var(--accent); }
.ag-closed > div { margin-top: 10px; }

/* ---- một khâu trong workflow ---- */
/*
  flex-wrap ở mọi bề rộng: khi hết chỗ, ô ghi chú/người phụ trách xuống dòng —
  thà xuống dòng còn hơn bóp tên khâu thành cột chữ 1 ký tự.
*/
.ag-stage {
  display: flex; align-items: center; gap: 10px; padding: 8px 0 8px 10px;
  border-bottom: 1px solid var(--line); position: relative; flex-wrap: wrap;
}
.ag-stage:last-child { border-bottom: none; }
.ag-stage::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 100px;
  background: var(--line);
}
.ag-stage.is-done::before { background: var(--sage); }
.ag-stage.is-next::before { background: var(--accent); }
.ag-stage.is-skipped::before { background: var(--violet); }

.ag-tick {
  flex: none; width: 24px; height: 24px; border-radius: 100px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-muted);
  font-size: 13px; line-height: 1; font-weight: 700;
}
.ag-tick:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.ag-tick:disabled { cursor: not-allowed; opacity: .45; }
.ag-stage.is-done .ag-tick { background: var(--sage-soft); border-color: var(--sage); color: var(--sage); }
.ag-stage.is-skipped .ag-tick { background: var(--violet-soft); border-color: var(--violet); color: var(--violet); }

.ag-stage-body { flex: 1 1 190px; min-width: 170px; }
.ag-stage-label { margin: 0; font-size: 13px; font-weight: 600; }
.ag-stage.is-skipped .ag-stage-label { text-decoration: line-through; color: var(--ink-muted); }
.ag-stage-pin { font-size: 10px; }

input.ag-stage-note { flex: 1 1 130px; min-width: 110px; width: auto; padding: 4px 10px; font-size: 12px; }
.ag-assignee { flex: 0 1 170px; width: auto; padding: 4px 10px; font-size: 12px; border-radius: 100px; }
.ag-skip { flex: none; }

/* ---- đường dẫn / link tài liệu ---- */
.ag-path { word-break: break-all; font-size: 11.5px; }

/* ---- màn hình thiết lập quy trình ---- */
.ag-flow-no {
  flex: none; width: 22px; height: 22px; border-radius: 100px; background: var(--surface-muted);
  color: var(--ink-muted); font-size: 11px; font-weight: 700; display: flex;
  align-items: center; justify-content: center;
}
input.ag-flow-name { padding: 4px 10px; font-size: 13px; font-weight: 600; }
input.ag-flow-new { flex: none; width: 210px; padding: 5px 12px; font-size: 12px; border-radius: 100px; }

/* ---- supplier: 2 ô tick ---- */
.sup-row { flex-wrap: wrap; }
.sup-check {
  flex: none; display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  color: var(--ink-muted); cursor: pointer; white-space: nowrap;
}
.sup-check input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--accent); }

@media (max-width: 900px) {
  .ag-stage-note, .ag-assignee { flex-basis: 100%; }
}

/* ---- supplier: ô link folder sửa ngay trên dòng ---- */
.sup-folder { display: flex; align-items: center; gap: 7px; margin-top: 5px; }
input.sup-folder-input { flex: 1 1 auto; min-width: 0; padding: 4px 10px; font-size: 11.5px; }
.sup-folder .btn { flex: none; white-space: nowrap; }

/* ---- giá trị phiên ---- */
.ag-money { font-weight: 700; color: var(--ink); }
.ag-money-line { margin: 4px 0 0; font-size: 12.5px; font-weight: 600; color: var(--accent-ink); }
