/* Đồng bộ dữ liệu — Tổng quan vận hành + Luồng dữ liệu (public/sync-overview.js). Tiền tố sy-ov- / sy-lin-.
   Data sync — Operations overview + Data lineage (public/sync-overview.js). Prefix sy-ov- / sy-lin-. */

.sy-mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; }

/* ---------- Tổng quan / overview ---------- */
/* OVW-05: tiêu đề từng phần (Offer / Đồng bộ dữ liệu) + lưới khung phần Offer / part headings (Offer / Data sync) + Offer panel grid */
.sy-ov-section { margin: 22px 0 12px; font-size: 1.1rem; }
.sy-ov-section:first-of-type { margin-top: 4px; }
/* 2 cột: trái = Offer theo loại (trên) + Lịch bật / tắt (dưới); phải = Lỗi ghi ERP, cao hết hàng / 2 columns: left = offers by type (top) + schedules (below); right = ERP errors, full row height */
/* OVW-05: cùng khoảng cách 12px với hàng ô số liệu (.sy-stats) để mép khung thẳng hàng với lưới 4 cột / same 12px gap as the stat rows so panel edges line up with the 4-column grid */
.sy-ov-panels { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: stretch; margin-bottom: 18px; }
.sy-ov-panels.sy-ov-2col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.sy-ov-stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sy-ov-panels .panel { margin-bottom: 0; min-width: 0; }
.sy-ov-note { margin: 10px 0 0; }
/* lưới 4 cột như hàng ô số liệu: biểu đồ 3 cột, "lỗi nhiều nhất" 1 cột / 4-column grid like the stat rows: chart 3 columns, "most failures" 1 column */
.sy-ov-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: stretch; margin-bottom: 12px; }
.sy-ov-row > .panel { margin-bottom: 0; min-width: 0; }
.sy-ov-row > .sy-ov-chart { grid-column: span 3; }
.sy-ov-fresh { margin-bottom: 12px; }
.sy-ov-chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sy-ov-chart-head h2 { margin-bottom: 2px; }
.sy-ov-chart-head p { margin: 0; }
.sy-ov-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--ink-2); }
.sy-ov-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sy-ov-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.sy-ov-sw.ok { background: var(--teal); }
.sy-ov-sw.fail { background: var(--red); }

/* SUI-21: biểu đồ SVG co giãn theo bề rộng; màu theo biến portal / SVG chart scales with width; portal colour variables */
.sy-ov-svg { display: block; width: 100%; height: auto; overflow: visible; }
.sy-ov-grid { stroke: var(--line); stroke-width: 1; }
.sy-ov-axis { fill: var(--ink-3); font-size: 10px; font-family: var(--font); }
.sy-ov-hit { fill: transparent; }
.sy-ov-bar.ok { fill: var(--teal); }
.sy-ov-bar.fail { fill: var(--red); }
.sy-ov-col { transition: opacity .12s; }
.sy-ov-svg:hover .sy-ov-col { opacity: .55; }
.sy-ov-svg:hover .sy-ov-col:hover { opacity: 1; }
.sy-ov-col:hover .sy-ov-hit { fill: var(--teal-bg); fill-opacity: .5; }

.sy-ov-toplist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sy-ov-toplist li { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; font-size: .93rem; }
.sy-ov-toplist a, .sy-ov-link { min-width: 0; text-decoration: none; color: var(--ink); display: block; }
.sy-ov-toplist a:hover .sy-ov-name, .sy-ov-link:hover .sy-ov-name { color: var(--teal); }
.sy-ov-name { display: block; font-weight: 500; overflow-wrap: anywhere; }
.sy-ov-sub { display: block; overflow-wrap: anywhere; }
.sy-ov-stale td { background: var(--amber-bg); }
.sy-ov-warn { color: var(--amber-ink); font-weight: 600; }
.sy-ov-strong { font-weight: 600; }
.sy-ov-cap { text-transform: capitalize; }

/* ---------- Luồng dữ liệu / lineage ---------- */
.sy-lin-search { margin-bottom: 18px; max-width: 480px; }
.sy-lin-group h2 { margin-bottom: 8px; }
.sy-lin-rows { list-style: none; margin: 0; padding: 0; }
.sy-lin-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px 14px; align-items: center; padding: 10px 0; border-top: 1px solid #edf0ee; }
.sy-lin-row:first-child { border-top: 0; }
.sy-lin-off .sy-lin-job { color: var(--ink-3); }
.sy-lin-cell { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sy-lin-target .badge { align-self: flex-start; }
.sy-lin-res { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.sy-lin-target .sy-lin-res { color: var(--ink); }
.sy-lin-job { font-weight: 500; overflow-wrap: anywhere; }
.sy-lin-arrow { width: 16px; height: 16px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 1100px) {
  .sy-ov-row { grid-template-columns: minmax(0, 1fr); }
  .sy-ov-row > .sy-ov-chart { grid-column: auto; }
  .sy-ov-panels.sy-ov-2col { grid-template-columns: minmax(0, 1fr); }
}
/* OPS-06: điện thoại — luồng thành cột dọc, mũi tên xoay xuống; chữ trục lớn hơn khi SVG thu nhỏ
   OPS-06: phones — lineage stacks vertically, arrows point down; larger axis text as the SVG shrinks */
@media (max-width: 860px) {
  .sy-lin-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .sy-lin-arrow { transform: rotate(90deg); margin-left: 4px; }
  .sy-lin-res { white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 640px) {
  .sy-ov-axis { font-size: 15px; }
}
/* OVW-05: trong trang Tổng quan mọi khoảng cách dọc / ngang đều 12px / on the Overview page every vertical / horizontal gap is 12px */
.sy-ov-part .sy-stats { margin-bottom: 12px; }
