/* Trang vận hành: tổng quan, phiên, lịch, wizard tạo phiên, xác nhận phát, chi tiết phiên, giám sát */

/* wizard 3 bước */
.wizard-steps { list-style: none; margin: 0 0 14px; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; counter-reset: s; }
.wizard-steps li { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--text-2); font-weight: 600; font-size: 12px; }
.wizard-steps .ws-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-3); font-size: 11px; color: var(--text-2); }
.wizard-steps li.cur { border-color: var(--fb); color: var(--fb-text); background: var(--fb-tint); }
.wizard-steps li.cur .ws-n { background: var(--fb); color: #fff; }
.wizard-steps li.done .ws-n { background: var(--green); color: #fff; }
.pick { width: 100%; text-align: left; font: inherit; color: inherit; }
.pick.disabled { opacity: .62; cursor: default; }
.pick.disabled:hover { background: var(--panel-2); }
.pick .p-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

/* danh sách kiểm tra */
ul.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
ul.checklist li { display: flex; gap: 10px; align-items: flex-start; }
ul.checklist li.ok > svg { color: var(--green); flex: none; margin-top: 1px; }
ul.checklist li.bad > svg { color: var(--amber); flex: none; margin-top: 1px; }

/* chi tiết phiên */
.sd-head { margin-bottom: 10px; }
.sd-bar { gap: 8px; align-items: center; }
/* tiêu đề phiên (trái) + nút thao tác/tải báo cáo (phải) cùng một hàng; hẹp thì nút xuống dòng */
/* Khoảng cách giữa tiêu đề / cảnh báo / lưới thẻ = gap 12px của .view – không cộng thêm margin. */
.sd-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sd-alerts { display: flex; flex-direction: column; gap: 8px; }
.sd-alerts:empty { display: none; }
.sd-top > .sd-head { flex: 1 1 320px; min-width: 0; margin: 0; }
.sd-top > .sd-bar { margin-left: auto; justify-content: flex-end; }
.sd-bar > .row:empty { display: none; }
table.t td.td-actions { text-align: right; white-space: nowrap; }
.log-tail { margin: 0; max-height: 280px; overflow: auto; font-family: var(--mono); font-size: 11px; line-height: 1.5; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }
.audit-line { padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.audit-line:last-child { border-bottom: none; padding-bottom: 0; }
.pill.res-OK { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.pill.res-DENIED { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.pill.res-FAIL { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.pill.res-UNCERTAIN { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.big-key { font-size: 15px; font-weight: 700; letter-spacing: .04em; }

/* tổng quan */
.ov-live-list { display: flex; flex-direction: column; }
.ov-live { display: grid; grid-template-columns: minmax(180px, 1.3fr) 150px minmax(220px, 2fr) auto auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ov-live:last-child { border-bottom: none; }
.ov-live .ol-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ov-live .ol-mid { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ov-live .ol-nums { line-height: 1.35; }
.ov-live svg.spark { width: 160px; height: 34px; flex: none; }
@media (max-width: 1300px) { .ov-live { grid-template-columns: minmax(160px, 1fr) 140px minmax(200px, 1.6fr); } .ov-live > :nth-child(4), .ov-live > :nth-child(5) { grid-column: span 1; } }
.mini-list { display: flex; flex-direction: column; }
.ml-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.ml-row:last-child { border-bottom: none; }
.ml-row:hover .ellipsis:first-child { color: var(--fb-text); }
.alert-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel-2); }
.alert-row .b { font-weight: 600; }
.alert-row.lv-error { border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.alert-row.lv-error > svg { color: var(--red); }
.alert-row.lv-warn > svg { color: var(--amber); }
.alert-row.lv-info > svg { color: var(--fb-text); }
.pill.lv-error { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.pill.lv-warn { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.pill.lv-info { background: var(--fb-tint); color: var(--fb-text); }
.stat.tone-red .sv { color: var(--live); }
.stat.tone-amber .sv { color: var(--amber); }
.stat .sl { display: flex; align-items: center; gap: 6px; }
.grid-4 .stat { background: var(--panel); box-shadow: var(--shadow); border-radius: var(--r-xl); padding: 14px 16px; }

/* giám sát */
.ch-title { font-size: 11.5px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
ul.issues { margin: 6px 0 0; padding-left: 18px; }

/* sparkline bitrate (tổng quan) */
svg.spark .area { fill: color-mix(in srgb, var(--fb) 14%, transparent); stroke: none; }
svg.spark .ln { fill: none; stroke: var(--fb); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
/* hàng luồng đang phát: màn hình hẹp ⇒ tín hiệu + nút xuống hàng riêng, không chồng lên cột seller */
@media (max-width: 1300px) {
  .ov-live { grid-template-columns: minmax(0, 1fr) auto; }
  .ov-live > .ol-mid { grid-column: 1 / -1; }
  .ov-live > :nth-child(4) { grid-column: 1; }
  .ov-live > :nth-child(5) { grid-column: 2; }
}

/* ---------- Vùng cuộn: khối con giữ chiều cao tự nhiên ----------
   .view là flex dọc; thẻ .card có overflow:hidden nên (theo CSS) được phép co nhỏ bằng chiều cao màn hình ⇒ bị cắt và .view
   không còn gì để cuộn. flex-shrink:0 ⇒ nội dung dài làm .view cuộn dọc bình thường (mọi trang). */
.view > * { flex-shrink: 0; }

/* ---------- Bảng phiên phát (sessions.js) – co giãn theo bề rộng, không cuộn ngang ---------- */
table.t-sess .v-name { display: inline-block; max-width: 220px; vertical-align: middle; }
table.t-sess td.td-actions { white-space: normal; }
table.t-sess .c-time > div > div:first-child { white-space: nowrap; }
table.t-sess .sess-acts { gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
table.t-sess .sess-acts > * { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 1700px) {
  table.t-sess .v-name { max-width: 170px; }
  table.t-sess th, table.t-sess td { padding-left: 10px; padding-right: 10px; }
}
/* Vừa (laptop, cửa sổ thu nhỏ): mỗi phiên = 2 dòng – dòng 1 định danh, dòng 2 tiến độ + thao tác. */
@media (max-width: 1500px) {
  table.t-sess, table.t-sess tbody { display: block; }
  table.t-sess thead { display: none; }
  table.t-sess tr {
    display: grid; align-items: center; column-gap: 16px; row-gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line);
    grid-template-columns: 52px minmax(0, 1.4fr) minmax(0, 1fr) 132px minmax(0, 1.6fr);
    grid-template-areas: "id who video kind state" "id prog time sig act";
  }
  table.t-sess tbody tr:last-child { border-bottom: none; }
  table.t-sess td { display: block; padding: 0 !important; border: none; min-width: 0; }
  table.t-sess .c-id { grid-area: id; align-self: start; padding-top: 6px !important; }
  table.t-sess .c-who { grid-area: who; } table.t-sess .c-video { grid-area: video; } table.t-sess .c-kind { grid-area: kind; }
  table.t-sess .c-state { grid-area: state; } table.t-sess .c-prog { grid-area: prog; } table.t-sess .c-time { grid-area: time; }
  table.t-sess .c-sig { grid-area: sig; } table.t-sess .td-actions { grid-area: act; justify-self: stretch; }
  table.t-sess .v-name { max-width: 100%; }
  table.t-sess .prog-cell { min-width: 0; }
  table.t-sess .c-time > div { display: flex; flex-wrap: wrap; column-gap: 6px; }
}
/* Hẹp (tablet dọc, điện thoại): 1 thẻ nhiều dòng. */
@media (max-width: 760px) {
  table.t-sess tr {
    grid-template-columns: 44px minmax(0, 1fr) minmax(0, max-content);
    grid-template-areas: "id who state" "id video kind" "prog prog prog" "time time sig" "act act act";
  }
  table.t-sess .td-actions { justify-self: stretch; }
  table.t-sess .sess-acts { justify-content: flex-start; }
  .filters .search { max-width: none; flex-basis: 100%; }
  .filters-end { margin-left: 0; width: 100%; justify-content: flex-start; }
  .filters-end > * { flex: 1 1 140px; }
  .filters .dd-btn, .filters .dp-btn { min-width: 0; max-width: none; width: 100%; }
  .filters-range { flex-basis: 100%; }
  .filters-range .dp { flex: 1 1 0; }
}

/* ---- Bình luận Facebook (tab trong chi tiết phiên) ---- */
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.fbc-filters > .search { flex: 1 1 260px; min-width: 200px; }
.fbc-filters > select { width: auto; }
.fbc-list { display: flex; flex-direction: column; gap: 10px; }
.fbc { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.fbc.reply { border: none; border-left: 2px solid var(--line); border-radius: 0; padding: 6px 0 6px 12px; }
.fbc-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.fbc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fbc-name { font-size: 12.25px; }
.pill.fbc-page { background: var(--fb-tint); color: var(--fb-text); }
.fbc-msg { font-size: 14px; line-height: 1.45; }
.fbc-acts { gap: 6px; align-items: center; }
.fbc-acts > .small { display: inline-flex; align-items: center; gap: 4px; }
.fbc-compose { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: var(--r); background: var(--panel-3); }
.fbc-replies { display: flex; flex-direction: column; gap: 4px; }
.fbc-replies:empty { display: none; }
