/* ============================================================
   Agenda de visitas
   ============================================================ */

.agd-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.agd-toggle {
  display: inline-flex;
  gap: 2px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 3px;
}
.agd-toggle-btn, .agd-tab {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: transparent;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.agd-toggle-btn:hover:not(.active), .agd-tab:hover:not(.active) {
  color: var(--text); background: var(--surface-hover);
}
.agd-toggle-btn.active, .agd-tab.active {
  color: #0a0a0a;
  background: var(--gold-gradient);
}

/* ─── Grupos por dia ──────────────────────────────────────── */
.agd-group { margin-bottom: 18px; }
.agd-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  padding-left: 2px;
  color: var(--text-2);
}
.agd-group-head.agd-overdue  { color: #e8897d; }
.agd-group-head.agd-today    { color: var(--gold-light); }
.agd-group-count {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-3);
  border-radius: 9px;
  padding: 1px 7px;
  color: var(--text-2);
}

/* ─── Linha de visita ─────────────────────────────────────── */
.agd-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.12s;
}
.agd-row:first-child { border-top: none; }
.agd-row:hover { background: var(--surface-hover); }
.agd-row.done { opacity: 0.6; }

.agd-time {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--gold-light);
  min-width: 52px;
  text-align: center;
  flex-shrink: 0;
}
.agd-row.done .agd-time { color: var(--mute); }

.agd-body { flex: 1; min-width: 0; }
.agd-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agd-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--mute);
  flex-wrap: wrap;
}
.agd-emp { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); }
.agd-emp .lg-icon { width: 12px; height: 12px; }
.agd-phone { font-family: var(--font-mono); }
.agd-who {
  background: var(--gold-soft);
  color: var(--gold-light);
  border-radius: 4px;
  padding: 1px 7px;
  font-weight: 600;
}

.agd-actions { flex-shrink: 0; }
.agd-done-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ok);
}
.agd-done-badge .lg-icon { width: 13px; height: 13px; }

/* ─── formulário de visita, cancelamento e busca de lead ─── */
.agd-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 900; }
.agd-modal { position: fixed; inset: 0; z-index: 901; display: flex;
  align-items: flex-start; justify-content: center; padding: 56px 16px; overflow-y: auto; }
.agd-modal-card { width: 460px; max-width: 100%; }
.agd-modal-title { margin: 0 0 14px; font-size: 17px; }
.agd-modal .lg-label { display: block; margin: 14px 0 6px; }
.agd-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

.agd-lead-fixo { padding: 10px 12px; border: 1px solid var(--lg-border, #2a2a2a);
  border-radius: 8px; opacity: .8; }
.agd-resultados { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.agd-resultado { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  width: 100%; text-align: left; padding: 10px 12px; border: 0; cursor: pointer;
  background: var(--lg-surface-2, rgba(255,255,255,.04)); color: inherit; border-radius: 8px; }
.agd-resultado:hover { background: var(--lg-surface-3, rgba(255,255,255,.09)); }
.agd-resultado small { opacity: .6; }
.agd-vazio { padding: 10px 12px; opacity: .6; font-size: 13px; }

/* visita cancelada: fica no histórico, mas sem chamar atenção */
.agd-row.cancelled { opacity: .55; }
.agd-row.cancelled .agd-name { text-decoration: line-through; }
.agd-motivo { font-style: italic; opacity: .75; }

/* ─── visita avulsa ─── */
.agd-tipo { display: flex; gap: 6px; margin-bottom: 4px; }
.agd-tipo-btn { flex: 1; padding: 9px 10px; border: 1px solid var(--lg-border, #2a2a2a);
  background: transparent; color: inherit; border-radius: 8px; cursor: pointer; font-size: 13px; }
.agd-tipo-btn.active { background: var(--lg-surface-3, rgba(255,255,255,.1)); font-weight: 600; }
.agd-ajuda { margin: 8px 0 0; font-size: 12px; opacity: .6; }
.agd-avulsa { margin-left: 8px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  opacity: .55; border: 1px solid currentColor; border-radius: 999px; padding: 1px 7px; }

/* Tela estreita: os botões descem pra linha de baixo em vez de espremer o
   nome e o telefone da visita. */
@media (max-width: 640px) {
  .agd-row { flex-wrap: wrap; }
  .agd-body { flex: 1 1 0; }
  .agd-actions { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; }
  .agd-actions .lg-btn { flex: 1 1 auto; }
}
