/* Hórus Barbearia · CRM de retorno · view Retorno
   Kanban de 3 colunas no desktop (abas no mobile), cards com a mensagem pronta,
   fila de envio (modal) e régua automática (linha do tempo). Todo seletor prefixado com .v-retorno. */

.v-retorno { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.v-retorno__sep { color: var(--text-3); }

/* ---------- faixa explicativa ---------- */
.v-retorno__intro { flex-wrap: wrap;
  flex-direction: row; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px;
  background: linear-gradient(90deg, rgba(25,197,50,.10), rgba(25,197,50,0) 55%), var(--surface-1);
}
.v-retorno__intro-body { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.v-retorno__intro-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--green-tint); color: var(--green-400); display: flex; align-items: center; justify-content: center; flex: none; }
.v-retorno__intro-text { min-width: 0; }
.v-retorno__intro-title { font-size: 16px; font-weight: 700; line-height: 1.2; }
.v-retorno__intro-sub { color: var(--text-2); margin-top: 3px; max-width: 64ch; }
.v-retorno__intro-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 8px; font-size: 13px; color: var(--text-3); }
.v-retorno__intro-stats strong { color: var(--text); font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.v-retorno__snoozed-link { font-size: 13px; }
.v-retorno__intro-actions { flex: none; }
.v-retorno__intro-note { flex: 1 0 100%; }
.v-retorno__intro-note .demo-note { margin: 0; }

/* ---------- abas (só mobile, sticky abaixo do topbar) ---------- */
.v-retorno__tabs { position: sticky; top: var(--topbar); z-index: 5; background: var(--bg); margin: -8px 0 -8px; padding-top: 8px; }
.v-retorno__tabbar { margin-bottom: 0; gap: 0; }
.v-retorno__tabbar .tab { flex: 1 1 auto; justify-content: center; padding: 0 6px; gap: 5px; font-size: 13px; }
.v-retorno__tabbar .tab__count { padding: 1px 6px; }
.v-retorno__radar { min-width: 0; }
.v-retorno__caption { font-size: 12px; color: var(--text-3); padding: 8px 2px; }

/* ---------- quadro (3 colunas) ---------- */
.v-retorno__board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; min-width: 0; }
.v-retorno__col { min-width: 0; display: flex; flex-direction: column; gap: 10px; --st: var(--st-novo); }
.v-retorno__col--hora { --st: var(--st-hora); }
.v-retorno__col--risco { --st: var(--st-risco); }
.v-retorno__col--sumido { --st: var(--st-sumido); }
.v-retorno__col-head { position: sticky; top: var(--topbar); z-index: 4; display: flex; align-items: center; gap: 8px; padding: 8px 2px 10px; background: var(--bg); border-bottom: 1px solid var(--line); min-width: 0; }
.v-retorno__col-head .dot { background: var(--st); }
.v-retorno__col-title { font-size: 14px; font-weight: 700; white-space: nowrap; }
.v-retorno__count { font-family: var(--mono); font-size: 12px; color: var(--text-2); background: var(--surface-3); padding: 1px 8px; border-radius: var(--radius-pill); }
.v-retorno__col-sub { margin-left: auto; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-retorno__cards { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.v-retorno__empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.v-retorno__empty .empty { padding: 28px 16px; }

/* ---------- card do cliente ---------- */
.v-retorno__card { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; transition: border-color var(--t) var(--ease); }
.v-retorno__card:hover { border-color: var(--line-strong); }
.v-retorno__card-head { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.v-retorno__who { flex: 1 1 auto; min-width: 0; }
/* nome cresce e empurra o badge para a direita; em coluna estreita o badge desce de linha em vez de truncar o nome */
.v-retorno__name-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.v-retorno__name-row .badge { flex: none; }
.v-retorno__name { cursor: pointer; flex: 1 1 auto; font-weight: 600; font-size: 14px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; transition: color var(--t) var(--ease); }
.v-retorno__name:hover { color: var(--green-400); }
.v-retorno__meta { font-size: 12px; color: var(--text-2); margin-top: 2px; line-height: 1.4; }
.v-retorno__late { color: var(--st); font-weight: 600; }
.v-retorno__facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; font-size: 12px; color: var(--text-3); min-width: 0; }
.v-retorno__fact { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
/* separador antes de cada item (menos o primeiro): como o item inteiro é nowrap, o ponto
   quebra junto com ele e nunca sobra pendurado no fim da linha de cima */
.v-retorno__fact:not(:first-child)::before { content: '·'; margin: 0 8px; color: var(--text-3); }
.v-retorno__fact .mono { color: var(--text-2); }
.v-retorno__fact .barber-chip { font-size: 12px; }
.v-retorno__fact--contact { color: var(--text-2); }
.v-retorno__fact--next { color: var(--st-hora); }
.v-retorno__msg { background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 8px; padding: 9px 12px 10px; min-width: 0; }
.v-retorno__msg-head { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--green-400); margin-bottom: 4px; }
.v-retorno__msg p { font-size: 13px; color: var(--text-2); line-height: 1.45; overflow-wrap: anywhere; }
.v-retorno__msg--none { border-left-color: var(--line-strong); }
.v-retorno__msg--none p { color: var(--text-3); }
.v-retorno__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.v-retorno__actions .btn--primary { flex: 1 1 auto; }
.v-retorno__actions .btn--ghost:not(.btn--icon) { flex: 0 1 auto; }

/* ---------- régua automática (linha do tempo) ---------- */
.v-retorno__regua .card__head { flex-wrap: wrap; }
.v-retorno__timeline { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; padding-top: 4px; min-width: 0; }
.v-retorno__timeline::before { content: ''; position: absolute; left: 0; right: 0; top: 18px; height: 2px; background: var(--line-strong); }
.v-retorno__rule { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.v-retorno__rule-mark { position: relative; z-index: 1; align-self: flex-start; display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: var(--radius-pill); border: 1px solid var(--green); background: var(--surface-1); color: var(--green-400); font-size: 12px; font-weight: 500; white-space: nowrap; }
.v-retorno__rule:not(.is-on) .v-retorno__rule-mark { border-color: var(--line-strong); border-style: dashed; color: var(--text-3); }
.v-retorno__rule-body { flex: 1 1 auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.v-retorno__rule.is-on .v-retorno__rule-body { border-color: var(--line-strong); }
.v-retorno__rule-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.v-retorno__rule-icon { display: flex; color: var(--green-400); flex: none; }
.v-retorno__rule:not(.is-on) .v-retorno__rule-icon { color: var(--text-3); }
.v-retorno__rule-name { font-weight: 600; font-size: 14px; line-height: 1.25; min-width: 0; overflow-wrap: anywhere; }
.v-retorno__rule-when { font-size: 12px; color: var(--text-3); }
.v-retorno__rule-tpl { font-size: 13px; color: var(--text-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.v-retorno__rule:not(.is-on) .v-retorno__rule-tpl { color: var(--text-3); }
.v-retorno__var { color: var(--green-400); font-family: var(--mono); font-size: 12px; }
.v-retorno__rule:not(.is-on) .v-retorno__var { color: var(--text-2); }
.v-retorno__rule-foot { margin-top: auto; padding-top: 6px; display: flex; align-items: center; gap: 8px; }
.v-retorno__rule-foot .btn { margin-left: auto; }
.v-retorno__rule-state { font-size: 12px; font-weight: 600; color: var(--green-400); }
.v-retorno__rule:not(.is-on) .v-retorno__rule-state { color: var(--text-3); }
.v-retorno__regua-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- editor de regra (modal) ---------- */
.v-retorno__editor-when { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.v-retorno__editor-when .v-retorno__rule-mark { align-self: auto; }
.v-retorno__varchip { padding: 0 10px; }
.v-retorno__varchip .mono { font-size: 12px; }
.v-retorno__preview { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.v-retorno__preview-who { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.v-retorno__bubble { align-self: flex-end; max-width: 92%; background: var(--green-tint); border: 1px solid rgba(25,197,50,.3); border-radius: 12px 12px 2px 12px; padding: 8px 12px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.v-retorno__bubble-time { display: block; text-align: right; font-family: var(--mono); font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ---------- fila de envio (modal) ---------- */
.v-retorno__queue { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.v-retorno__queue-intro { font-size: 13px; color: var(--text-2); }
.v-retorno__queue-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-2); }
.v-retorno__queue-top strong { color: var(--text); font-weight: 500; }
.v-retorno__queue-state { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--st-hora); }
.v-retorno__queue-state.is-done { color: var(--green-400); }
.v-retorno__queue-list { max-height: 40vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.v-retorno__queue-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); min-width: 0; }
.v-retorno__queue-item:last-child { border-bottom: 0; }
.v-retorno__queue-main { flex: 1 1 auto; min-width: 0; }
.v-retorno__queue-name { font-size: 13px; font-weight: 600; }
.v-retorno__queue-msg { font-size: 12px; color: var(--text-3); }
.v-retorno__queue-status { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); min-width: 72px; justify-content: flex-end; }
.v-retorno__queue-item.is-sending .v-retorno__queue-status { color: var(--st-hora); }
.v-retorno__queue-item.is-sent .v-retorno__queue-status { color: var(--green-400); }
.v-retorno__queue-item.is-sent .v-retorno__queue-name { color: var(--text-2); }

/* ---------- adiados (modal) ---------- */
.v-retorno__snoozed-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ---------- telas menores ---------- */
/* até 1320 as 3 colunas ficam estreitas: o botão principal ocupa a linha toda e os outros dois vão para baixo */
@media (max-width: 1320px) {
  .v-retorno__actions .btn--primary { flex-basis: 100%; }
  .v-retorno__actions .btn--ghost:not(.btn--icon) { flex: 1 1 auto; }
}
/* tablet: a régua vira lista vertical com a linha à esquerda */
@media (max-width: 1100px) {
  .v-retorno__timeline { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 0; }
  .v-retorno__timeline::before { left: 44px; right: auto; top: 14px; bottom: 14px; width: 2px; height: auto; }
  .v-retorno__rule { flex-direction: row; align-items: flex-start; gap: 14px; }
  .v-retorno__rule-mark { width: 88px; justify-content: center; flex: none; }
  .v-retorno__col-sub { display: none; }
}
@media (max-width: 768px) {
  .v-retorno { gap: 16px; }
  .v-retorno__intro { flex-direction: column; align-items: stretch; gap: 14px; padding: 16px; }
  .v-retorno__intro-actions .btn { width: 100%; }
  .v-retorno__intro-stats { flex-direction: column; align-items: flex-start; gap: 2px; }
  .v-retorno__sep { display: none; }
  .v-retorno__board { display: block; }
  .v-retorno__col:not(.is-active) { display: none; }
  .v-retorno__card { padding: 14px; }
  .v-retorno__timeline::before { left: 36px; }
  .v-retorno__rule { gap: 10px; }
  .v-retorno__rule-mark { width: 72px; padding: 0 6px; }
  .v-retorno__rule-body { padding: 12px; }
  .v-retorno__queue-list { max-height: 36vh; }
  .v-retorno__queue-status { min-width: 0; }
  .v-retorno__queue-status span { display: none; }
}
@media (max-width: 380px) {
  .v-retorno__tabbar .tab { padding: 0 4px; font-size: 12px; gap: 4px; }
}
