/* CRM — Webinário recorrente (aba Webinários em Automações). Carregado depois de automations.css. */

/* fases: cores fixas (mesma paleta categórica do resto da tela) */
.ph-captacao { --ph: var(--s1); }
.ph-aula { --ph: var(--s2); }
.ph-replay { --ph: var(--s3); }
.ph-fechamento { --ph: var(--s5); }
.ph-nutricao { --ph: var(--s4); }
.ph-reabertura { --ph: #7c5cd6; }
.wb-phase { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; line-height: 18px; padding: 0 7px; border-radius: 4px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.wb-phase::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ph, var(--text-3)); }

.wb-grow { flex: 1; }
.wb-bad-t { color: var(--danger); }
.wb-warn-t { color: var(--warning); }
.wb-ph { font-family: var(--mono); font-size: .92em; background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 2px; }
.wa-chat .wb-ph { background: rgba(0,0,0,.08); color: inherit; }

/* ---------- lista ---------- */
.wb-srow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px) auto; gap: 12px 18px; align-items: start; }
.wb-srow + .wb-srow { margin-top: 10px; }
.wb-srow-facts { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 13px; color: var(--text-2); }
.wb-srow-facts span { display: inline-flex; align-items: center; gap: 5px; }
.wb-srow-facts .svg-icon { color: var(--text-3); width: 14px; height: 14px; }
.wb-srow-cycles { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wb-cchip { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 5px 8px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-size: 13px; }
.wb-cchip:hover { text-decoration: none; background: var(--surface-hover); box-shadow: inset 0 0 0 1px var(--border-strong); }
.wb-srow-act { display: flex; gap: 6px; }
@media (max-width: 900px) {
  .wb-srow { grid-template-columns: 1fr; }
  .wb-srow-act .btn { flex: 1; justify-content: center; }
}

/* ---------- cabeçalho da série/turma ---------- */
.wb-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wb-title h1 { font-size: 20px; }
.au-head-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.au-head-meta .svg-icon { width: 14px; height: 14px; color: var(--text-3); }
.wb-invite { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.wb-invite code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 4px 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-tab-c { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.au-tab-n.wb-n-warn { background: var(--warning); }

/* ---------- visão geral ---------- */
.wb-problems { margin-bottom: 16px; font-size: 13.5px; }
.wb-ov { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.wb-ov-main > .card + .card, .wb-ov-side > .card + .card { margin-top: 16px; }
@media (max-width: 1000px) { .wb-ov { grid-template-columns: minmax(0, 1fr); } }
.wb-state { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.wb-state > .svg-icon { width: 20px; height: 20px; color: var(--text-3); margin-top: 1px; }
.wb-state-on > .svg-icon { color: var(--success); }
.wb-state-pause > .svg-icon { color: var(--warning); }
.wb-auto { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.wb-auto li { display: flex; gap: 12px; align-items: flex-start; }
.wb-auto li .small { color: var(--text-2); margin-top: 2px; line-height: 1.45; }
.wb-auto-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wb-next { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.wb-next:last-child { border-bottom: 0; }
.wb-next-d { width: 40px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; background: var(--surface-2); border-radius: 6px; padding: 3px 0; line-height: 1.15; }
.wb-next-d b { font-size: 16px; }
.wb-next-d span { font-size: 11px; color: var(--text-3); }
.wb-next-main { flex: 1; min-width: 0; font-size: 13px; }
.wb-next-main .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-next-st { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; max-width: 45%; }
.wb-mini { display: block; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); color: var(--text); }
.wb-mini + .wb-mini { margin-top: 8px; }
.wb-mini:hover { text-decoration: none; border-color: var(--border-strong); }
.wb-prog { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); margin: 5px 0 3px; min-width: 60px; }
.wb-prog > div { height: 100%; background: var(--success); }

/* ---------- régua ---------- */
.wb-rtool { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.wb-phase-sel { width: auto; min-width: 180px; }
.wb-legend { margin-bottom: 10px; }
.wb-day { margin-bottom: 18px; }
.wb-day-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0 8px; position: sticky; top: 0; background: var(--bg); z-index: 2; }
.wb-off { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; padding: 1px 8px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wb-off-t { background: var(--s2); color: #fff; }
.wb-day-list { display: flex; flex-direction: column; gap: 8px; border-left: 2px solid var(--border-strong); margin-left: 20px; padding-left: 14px; }
.wb-msg, .wb-cmsg { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; position: relative; }
.wb-msg { cursor: default; }
.wb-msg::before { content: ""; position: absolute; left: -21px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.wb-msg.wb-off-msg, .wb-msg.wb-off { opacity: .6; }
.wb-msg.wb-bad, .wb-pv-item.wb-bad { border-color: var(--warning); }
.wb-msg-time { width: 46px; flex-shrink: 0; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.wb-msg-time b { font-size: 14px; }
.wb-msg-time span { font-size: 11px; color: var(--text-3); }
.wb-msg-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.wb-msg-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wb-kind { display: inline-flex; width: 24px; height: 24px; border-radius: 6px; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-2); flex-shrink: 0; }
.wb-kind .svg-icon { width: 14px; height: 14px; }
.wb-msg-title { font-weight: 600; font-size: 13.5px; min-width: 0; }
.wb-tags { display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.wb-tags .badge .svg-icon { width: 11px; height: 11px; }
.wb-msg-more { margin-left: auto; width: 28px; height: 28px; padding: 5px; }
.wb-text { white-space: pre-wrap; word-break: break-word; font-size: 13px; color: var(--text-2); background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; line-height: 1.45; }
.wb-text.wb-clamp { max-height: 8.6em; overflow: hidden; position: relative; }
.wb-text.wb-clamp::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.4em; background: linear-gradient(transparent, var(--surface-2)); }
.wb-text.wb-clamp.wb-open { max-height: none; }
.wb-text.wb-clamp.wb-open::after { content: none; }
.wb-text.wb-after-audio::before { content: "Texto logo depois do áudio:"; display: block; font-size: 11px; font-weight: 600; color: var(--text-3); margin-bottom: 2px; }
.wb-more-btn { align-self: flex-start; border: 0; background: transparent; color: var(--accent); cursor: pointer; padding: 0; font-size: 12px; font-weight: 500; margin-top: -2px; }
.wb-audio { width: 100%; max-width: 360px; height: 36px; }
.wb-video { width: 100%; max-width: 280px; max-height: 260px; border-radius: 6px; background: #000; display: block; }
.wb-img-btn { border: 0; padding: 0; background: transparent; cursor: zoom-in; align-self: flex-start; }
.wb-img { display: block; max-width: 220px; max-height: 180px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); }
.wb-zoom { display: block; max-width: 100%; margin: 0 auto; border-radius: 6px; }
.wb-file { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.wb-media-miss { display: inline-flex; gap: 5px; align-items: center; color: var(--danger); font-size: 12px; font-weight: 500; }
.wb-poll { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; max-width: 420px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); color: var(--text); }
.wb-poll-q { font-weight: 600; font-size: 13px; display: flex; gap: 6px; align-items: flex-start; }
.wb-poll-q .svg-icon { margin-top: 2px; color: var(--text-3); }
.wb-poll-o { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.wb-poll-o i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex-shrink: 0; }
.wb-note { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--text-3); font-style: italic; }
.wb-note .svg-icon { width: 13px; height: 13px; margin-top: 2px; }
.wb-msg-prob { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; font-weight: 500; color: var(--warning); background: var(--warning-soft); border-radius: var(--radius-sm); padding: 5px 8px; }
.wb-msg-prob .svg-icon { width: 13px; height: 13px; margin-top: 2px; flex-shrink: 0; }
.wb-msg-prob.wb-msg-info { color: var(--text-2); background: var(--surface-2); font-weight: 400; }

/* ---------- prévia ---------- */
.wb-pv-bar { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.wb-pv-bar .field { margin-bottom: 0; }
.wb-pv-bar input[type="date"] { width: auto; }
.wb-pv-hint { margin: 8px 0 14px; }
.wb-pv-day { display: flex; align-items: center; gap: 8px; margin: 16px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.wb-pv-item { display: flex; gap: 10px; padding: 6px 8px; border: 1px solid transparent; border-radius: var(--radius); }
.wb-pv-time { width: 44px; flex-shrink: 0; font-weight: 600; font-variant-numeric: tabular-nums; padding-top: 3px; }
.wb-pv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.wb-pv-chat { margin-bottom: 0; padding: 10px; }
.wb-pv-chat .bubble { max-width: 100%; min-width: 0; }
.wb-pv-chat .wb-video, .wb-pv-chat .wb-img { margin-bottom: 4px; }
.wb-pv-chat .wb-poll { background: transparent; border-color: rgba(0,0,0,.12); }

/* ---------- turmas ---------- */
.wb-link { display: inline-flex; align-items: center; gap: 2px; max-width: 260px; }
.wb-link a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.wb-cnt { font-size: 13px; white-space: nowrap; }
.wb-cnt .badge { margin-left: 4px; }
.wb-cnt .badge .svg-icon { width: 11px; height: 11px; }
@media (max-width: 760px) {
  .wb-ctable thead { display: none; }
  .wb-ctable, .wb-ctable tbody, .wb-ctable tr, .wb-ctable td { display: block; width: 100%; }
  .wb-ctable tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
  .wb-ctable tr:last-child { border-bottom: 0; }
  .wb-ctable td { border: 0; padding: 3px 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between; text-align: right; }
  .wb-ctable td::before { content: attr(data-label); color: var(--text-3); font-size: 12px; text-align: left; flex-shrink: 0; }
  .wb-ctable td[data-label="Mensagens"] { flex-wrap: wrap; }
  .wb-ctable td[data-label="Mensagens"] .wb-prog { flex-basis: 100%; }
  .wb-ctable td.ob-act { justify-content: flex-end; }
  .wb-ctable td.ob-act::before { content: none; }
}

/* ---------- detalhe da turma ---------- */
.wb-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.wb-stats .card + .card { margin-top: 0; }
.wb-stats > .loading, .wb-stats > .alert { grid-column: 1 / -1; }
.wb-stat { padding: 12px 14px; }
.wb-stat-l { font-size: 12px; color: var(--text-3); font-weight: 500; }
.wb-stat-v { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.wb-stat-s { font-size: 12px; color: var(--text-2); display: flex; flex-direction: column; gap: 1px; }
.wb-utm { display: flex; justify-content: space-between; gap: 8px; }
.wb-utm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) { .wb-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .wb-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .wb-stat-sales { grid-column: 1 / -1; } .wb-stat-v { font-size: 22px; } }
.wb-cyc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.wb-cyc-side > .card + .card { margin-top: 16px; }
@media (max-width: 1000px) { .wb-cyc-grid { grid-template-columns: minmax(0, 1fr); } }
.wb-cprog { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.wb-cprog .wb-prog { flex: 1; margin: 0; }
.wb-cfilter { margin-bottom: 6px; }
.wb-cmsg { margin-bottom: 8px; }
.wb-cmsg.st-sent { background: var(--surface-2); border-color: transparent; }
.wb-cmsg.st-canceled, .wb-cmsg.st-skipped { opacity: .7; }
.wb-cmsg.st-blocked, .wb-cmsg.st-failed { border-color: var(--danger); }
.wb-cmsg.wb-next-msg { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.wb-cmsg-act { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 2px; }
.wb-runs { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.wb-run { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 13px; }
.wb-run span:first-child { display: inline-flex; gap: 6px; align-items: center; }
.wb-run .svg-icon { width: 14px; height: 14px; color: var(--text-3); }
.wb-rm-act { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.wb-hist { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 8px; }
.wb-hist-t { font-size: 12px; font-weight: 600; color: var(--text-3); margin-bottom: 4px; }
.wb-hrun { font-size: 13px; padding: 4px 0; }
.wb-hrun summary { cursor: pointer; }
.wb-hp { display: flex; gap: 8px; justify-content: space-between; align-items: center; font-size: 12.5px; padding: 2px 0 2px 14px; }
.wb-lk + .wb-lk { margin-top: 8px; }
.wb-lk .wb-link { max-width: 100%; }
.wb-rm-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 8px 0; }
.wb-rm-list .wb-hp { padding: 6px 10px; border-bottom: 1px solid var(--border); }
.wb-rm-list .wb-hp:last-child { border-bottom: 0; }

@media (max-width: 640px) {
  .wb-day-list { margin-left: 4px; padding-left: 10px; }
  .wb-msg::before { left: -17px; }
  .wb-msg, .wb-cmsg { flex-direction: column; gap: 6px; padding: 10px; }
  .wb-msg-time { flex-direction: row; gap: 6px; width: auto; align-items: baseline; }
  .wb-rtool .btn { flex: 1 1 auto; justify-content: center; }
  .wb-phase-sel { flex: 1 1 100%; }
  .wb-img { max-width: 100%; }
  .wb-video { max-width: 100%; }
  .wb-next-st { max-width: 40%; }
  .au-head-actions { width: 100%; }
  .au-head-actions .btn { flex: 1 1 auto; justify-content: center; }
}
.wb-ctable td[data-label="Aula"], .wb-ctable td[data-label="Próxima"] { white-space: nowrap; }
.wb-ov-main, .wb-ov-side, .wb-cyc-main, .wb-cyc-side { min-width: 0; }
