/* Đồng bộ dữ liệu — CSS trang Job / Map cột / Lịch chạy / Nhật ký (tiền tố sy-j-, theo biến màu của portal).
   Data sync — CSS for the Jobs / Column mapping / Schedules / Logs pages (sy-j- prefix, portal colour variables). */

.sy-j-mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: .86rem; }
.sy-j-lbl { display: block; font-size: .87rem; color: var(--ink-2); margin-bottom: 4px; }
.sy-j-note { color: var(--teal-2); }
.sy-j-trunc { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sy-j-end { justify-content: flex-end; }
.sy-j-between { justify-content: space-between; }
.sy-j-nowrap { flex-wrap: nowrap; }
.sy-j-center { text-align: center; }
.sy-j-ok { color: var(--green); }
.sy-j-warn { color: var(--amber-ink); }
.sy-j-info { color: var(--teal-2); }
.sy-j-pre { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: .85rem; }
.sy-j-check { gap: 6px; font-size: .93rem; color: var(--ink-2); }
.sy-j-boxline { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.sy-j-toolbar { margin-bottom: 10px; }
.sy-j-mini { margin: 0; }
.sy-j-mini a { padding: 4px 10px; font-size: .85rem; }

/* ---- form job: 2 khung nguồn / đích / job form: source / target boxes ---- */
.sy-j-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.sy-j-box { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.sy-j-box legend { padding: 0 6px; font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.sy-j-field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sy-j-field > input { width: 100%; }
.sy-j-span2 { grid-column: span 2; }
.sy-j-ops summary { cursor: pointer; font-weight: 600; color: var(--teal-2); }
.sy-j-ops { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; background: var(--bg); }

/* ---- chọn cột nguồn / source column selector ---- */
.sy-j-cols { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sy-j-cols-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
.sy-j-cols-list { max-height: 240px; overflow-y: auto; }
.sy-j-col { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); cursor: pointer; min-width: 0; }
.sy-j-col:last-child { border-bottom: 0; }
.sy-j-col.off { opacity: .5; }
.sy-j-col .grow { min-width: 0; overflow-wrap: anywhere; }
.sy-j-col input:disabled { cursor: not-allowed; }
.sy-j-colprev { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; }
.sy-j-colprev p { margin: 0 0 6px; }
.sy-j-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sy-j-chips code { background: var(--teal-bg); color: var(--teal-2); border-radius: 4px; padding: 1px 6px; font-size: .78rem; }

/* ---- chip chọn (radio / checkbox) cho lịch / choice chips (radio / checkbox) for schedules ---- */
.sy-j-chip { position: relative; display: inline-flex; cursor: pointer; }
.sy-j-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sy-j-chip span { display: inline-block; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; color: var(--ink-2); background: var(--surface); }
.sy-j-chip:hover span { border-color: var(--teal); }
.sy-j-chip input:checked + span { background: var(--teal); border-color: var(--teal); color: #fff; }
.sy-j-chip input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ---- danh sách bảng của job / job table list ---- */
.sy-j-tablist { display: flex; flex-wrap: wrap; gap: 8px; }
.sy-j-tab { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; max-width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: left; cursor: pointer; }
.sy-j-tab:hover { border-color: var(--teal); }
.sy-j-tab.on { border-color: var(--teal); background: var(--teal-bg); }
.sy-j-tab .sy-j-mono { overflow-wrap: anywhere; }
.sy-j-tab.on .sy-j-mono { color: var(--teal-2); }

/* ---- đồ thị phụ thuộc (SVG, màu qua class) / dependency graph (SVG, colours via classes) ---- */
.sy-j-graph { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.sy-j-graph .notice { margin: 0; border-radius: 0; }
.sy-j-graph-scroll { overflow: auto; max-width: 100%; }
.sy-j-dag { display: block; }
.sy-j-edge { stroke: var(--teal); stroke-width: 1.5; stroke-opacity: .6; }
.sy-j-arrow { fill: var(--teal); }
.sy-j-node { cursor: pointer; outline: none; }
.sy-j-node .sy-j-nbox { fill: var(--surface); stroke: var(--line); stroke-width: 1; }
.sy-j-node:hover .sy-j-nbox, .sy-j-node:focus-visible .sy-j-nbox { stroke: var(--teal); }
.sy-j-node.sel .sy-j-nbox { fill: var(--teal-bg); stroke: var(--teal); stroke-width: 1.5; }
.sy-j-lvl { fill: #edf0f2; }
.sy-j-node.root .sy-j-lvl { fill: var(--green-bg); }
.sy-j-lvl-t { font-size: 9px; font-family: ui-monospace, Consolas, monospace; fill: var(--ink-2); }
.sy-j-node.root .sy-j-lvl-t { fill: var(--green); }
.sy-j-src-t { font-size: 11px; font-family: ui-monospace, Consolas, monospace; font-weight: 600; fill: var(--ink); }
.sy-j-tgt-t { font-size: 11px; font-family: ui-monospace, Consolas, monospace; fill: var(--ink-3); }
.sy-j-nomap { fill: var(--amber-ink); }
.sy-j-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; padding: 8px 12px; border-top: 1px solid var(--line); }
.sy-j-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.sy-j-dot.root { background: var(--green); }
.sy-j-dot.warn { background: var(--amber-ink); }

/* ---- bảng map cột (rộng: cuộn ngang trong khung) / column mapping table (wide: scrolls inside its frame) ---- */
.table-wrap.sy-j-wide { overflow-x: auto; max-width: 100%; }
.sy-j-maptable { min-width: 980px; }
.sy-j-maptable td { padding: 6px 8px; vertical-align: top; }
.sy-j-maptable tr.sy-j-skip td { opacity: .5; }
.sy-j-cell { width: 100%; min-width: 120px; height: 32px; padding: 3px 8px; }
select.sy-j-cell { min-width: 150px; }
.sy-j-exprin { margin-top: 4px; min-width: 220px; }
tr.sy-j-skip td { color: var(--ink-3); }

/* ---- luật chất lượng / quality rules ---- */
.sy-j-dq-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 14px; align-items: end; }
.sy-j-dq-form .row input { flex: 1; min-width: 0; }

/* ---- nhật ký / logs ---- */
tr.sy-j-detail > td { background: var(--bg); }
tr.sy-j-detail .notice { margin-bottom: 8px; }

/* ---- điện thoại (≤ 640px): bảng map cột giữ dạng bảng, cuộn ngang trong khung (không thành thẻ) ----
   ---- phones (≤ 640px): the mapping table stays a table and scrolls inside its frame (no cards) ---- */
@media (max-width: 640px) {
  .sy-j-span2 { grid-column: auto; }
  .sy-j-two { grid-template-columns: 1fr; }
  .sy-j-trunc { max-width: 100%; white-space: normal; }
  .table-wrap.sy-j-wide:has(> table.cardify) { overflow-x: auto; border: 1px solid var(--line); background: var(--surface); }
  .table-wrap.sy-j-wide table.cardify { display: table; width: 100%; }
  .table-wrap.sy-j-wide table.cardify thead { display: table-header-group; }
  .table-wrap.sy-j-wide table.cardify tbody { display: table-row-group; }
  .table-wrap.sy-j-wide table.cardify tr { display: table-row; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; }
  .table-wrap.sy-j-wide table.cardify td,
  .table-wrap.sy-j-wide table.cardify td:first-child { display: table-cell; position: static; width: auto; min-height: 0; margin: 0; padding: 6px 8px; font-size: inherit; font-weight: 400;
    border: 0; border-bottom: 1px solid var(--line); white-space: nowrap; overflow-wrap: normal; }
  .table-wrap.sy-j-wide table.cardify td::before { display: none; }
  .table-wrap.sy-j-wide table.cardify td.blank { display: table-cell; }
  .table-wrap.sy-j-wide table.cardify td.num { text-align: right; }
  .sy-j-graph-scroll { max-height: 70vh; }
  .sy-j-dq-form { grid-template-columns: 1fr; }
}
