/* Abas Follow-up e Callbox, marcações de WhatsApp e reunião não comparecida. */

/* ── Aba Follow-up ─────────────────────────────────────────────────── */

.fu-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.fu-chips {
  margin-right: auto;
}

.fu-chip.fu-agora .c-count {
  background: var(--warning-soft);
  color: var(--warning);
}

.fu-chip.fu-agora.active .c-count {
  background: var(--warning);
  color: #fff;
}

.crm-v2 #tabFollowup .c-table-wrap {
  max-height: calc(100vh - 242px);
}

.crm-v2 .dash.side-collapsed #tabFollowup .c-table-wrap {
  max-height: calc(100vh - 302px);
}

/* Botões FU 1 … FU N: um clique marca; o último feito pode ser desfeito. */
.fu-btns {
  display: flex;
  gap: 5px;
}

.fu-btn {
  appearance: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 58px;
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ghost);
  cursor: pointer;
}

.fu-btn small {
  font-size: 10.5px;
  font-weight: 600;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

.fu-btn:disabled {
  cursor: default;
  background: #faf8f4;
  border-style: dashed;
}

.fu-btn.next {
  border-color: var(--primary);
  color: var(--primary);
}

.fu-btn.next:hover {
  background: var(--primary-soft);
}

.fu-btn.next.quiet {
  border-color: var(--line-strong);
  color: var(--muted);
}

.fu-btn.next.quiet:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.fu-btn.next.due {
  border-color: var(--warning);
  background: var(--warning-soft);
  color: var(--warning);
}

.fu-btn.next.due:hover {
  background: var(--warning);
  color: #fff;
}

.fu-btn.on,
.fu-btn.on:disabled {
  border: 1px solid transparent;
  background: var(--success-soft);
  color: var(--success);
}

.fu-btn.on:not(:disabled):hover,
.fu-btn.on.confirm {
  background: var(--error-soft);
  color: var(--error);
}

.fu-btn.on.confirm small {
  display: none;
}

/* Situação do follow-up */
.fu-state {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(111, 108, 101, 0.1);
  color: var(--muted);
}

.fu-state.fu-agora {
  background: var(--warning-soft);
  color: var(--warning);
}

.fu-state.fu-aguardando {
  background: var(--primary-soft);
  color: var(--primary);
}

.fu-state.fu-esgotado {
  background: var(--error-soft);
  color: var(--error);
}

/* Follow-up no painel de detalhes */
.fu-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.fu-head .fu-situation {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fu-head .fu-situation .v2-sub {
  margin: 0;
  font-size: 12.5px;
}

.fu-head p {
  margin: 0;
}

.fu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
}

.fu-list li {
  padding: 9px 0 9px 20px;
  border-top: 1px solid var(--line);
  position: relative;
}

.fu-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 14px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid #c4bfb5;
  box-sizing: border-box;
  background: #fff;
}

.fu-list li.done::before {
  border-color: var(--success);
  background: var(--success);
}

.fu-list li.next::before {
  border-color: var(--primary);
}

.fu-list li.next.due::before {
  border-color: var(--warning);
}

.fu-list li.pending {
  color: var(--ghost);
}

.fu-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fu-line .meta {
  margin-top: 1px;
}

.fu-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}

.fu-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.fu-edit[hidden] {
  display: none;
}

.crm-v2 .detail-section .form-error {
  margin-top: 10px;
}

/* ── Callbox: ligações ─────────────────────────────────────────────── */

.cb-selects {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.crm-v2 #tabCallbox .c-table-wrap {
  max-height: calc(100vh - 286px);
}

.crm-v2 .dash.side-collapsed #tabCallbox .c-table-wrap {
  max-height: calc(100vh - 346px);
}

.cb-calls {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Telas estreitas mostram as 2 ligações mais recentes; as largas, 3. */
.cb-calls .cb-extra,
.cb-calls .cb-more.wide {
  display: none;
}

@media (min-width: 1700px) {
  .cb-calls .cb-extra {
    display: inline-flex;
  }

  .cb-calls .cb-more.wide {
    display: inline;
  }

  .cb-calls .cb-more.narrow {
    display: none;
  }
}

.cb-call {
  appearance: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 60px;
  height: 36px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: var(--r-ctl);
  background: #efece6;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink-2);
  white-space: nowrap;
}

.cb-call small {
  font-size: 10.5px;
  font-weight: 600;
  opacity: 0.8;
}

.cb-call.ok {
  background: var(--success-soft);
  color: var(--success);
}

.cb-call.bad {
  background: var(--error-soft);
  color: var(--error);
}

button.cb-call {
  cursor: pointer;
}

button.cb-call:hover,
button.cb-call.confirm {
  background: var(--error-soft);
  color: var(--error);
}

button.cb-call.confirm small {
  display: none;
}

.cb-more {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ghost);
}

.cb-last {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.cb-out {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.cb-out.ok {
  background: var(--success-soft);
  color: var(--success);
}

.cb-out.bad {
  background: var(--error-soft);
  color: var(--error);
}

.cb-add {
  appearance: none;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--primary);
  border-radius: var(--r-ctl);
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  cursor: pointer;
}

.cb-add:hover {
  background: var(--primary-soft);
}

.cb-add.quiet {
  border-color: var(--line-strong);
  color: var(--muted);
}

.cb-add.quiet:hover {
  border-color: var(--primary);
  background: #fff;
  color: var(--primary);
}

/* Seletor em etapas (mesma pílula do "Contato por"); acima do painel do lead */
.v2-wa-choice.cb-choice {
  z-index: 960;
}

.v2-wa-choice .back {
  width: 22px;
  padding: 0;
  border-color: transparent;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
}

/* Ligações no painel de detalhes */
.fu-head.cb-head {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.fu-state.cb-feito {
  background: var(--success-soft);
  color: var(--success);
}

.fu-list li.cb-miss::before {
  border-color: #c4bfb5;
  background: #c4bfb5;
}

.fu-list li.cb-bad::before {
  border-color: var(--error);
  background: var(--error);
}

/* CRM · Configurações › Follow-up */
.settings-form .c-field.fu-default-field {
  flex: 0 1 260px;
}

#fuAgentsArea {
  box-shadow: none;
  margin: 0;
}

#fuAgentsArea .c-select {
  min-width: 240px;
}

/* ── WhatsApp: horário do contato e da resposta sob cada marcador ──── */
.crm-v2 .wa-toggles {
  align-items: flex-start;
}

.wa-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.wa-time {
  min-height: 13px;
  font-size: 11px;
  line-height: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: center;
}

/* ── Formulário: a origem ocupa a mesma largura da data e hora ─────── */
.v2-received {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
}

.v2-received .v2-origin {
  display: block;
  margin-top: 4px;
  padding: 1px 8px;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

/* ── WhatsApp inválido: tentativa por outro número / por e-mail ────── */
.crm-v2 .wa-toggle.on[data-field="attemptContact"]:not([data-via="manual"]) {
  background: #f1dc9c;
  color: #6f5506;
}

.crm-v2 .wa-toggle.on[data-field="attemptContact"]:not([data-via="manual"])::before {
  background-color: #a07a0a;
}

/* Escolha do canal ao marcar "Contato" (e-mail ou outro número) */
.v2-wa-choice {
  position: fixed;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 7px 6px 11px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(20, 24, 29, 0.16);
  white-space: nowrap;
}

.v2-wa-choice .q {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 2px;
}

.v2-wa-choice button {
  appearance: none;
  height: 26px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}

.v2-wa-choice button:hover,
.v2-wa-choice button:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  outline: none;
}

/* ── Reunião: não compareceu ───────────────────────────────────────── */
.crm-v2 .meeting-btn.v2-meet.noshow {
  color: #b3418a;
}

.meeting-current.noshow {
  background: #f8e9f2;
}

.meeting-current .c-btn--link {
  font-size: inherit;
  padding: 0;
  margin-top: 2px;
}
