/* ─── Drawer overlay & modal centrado ─── */
.drawer-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 150;
  align-items: center; justify-content: center;
  padding: 20px;
}
.drawer-overlay.open { display: flex; }

.drawer {
  background: var(--surface);
  width: 100%; max-width: 1100px; max-height: 88vh; min-width: 700px;
  display: flex; flex-direction: column;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  animation: drawer-in .2s ease;
  overflow: hidden;
}
@keyframes drawer-in {
  from { transform: scale(.96) translateY(12px); opacity: 0; }
  to   { transform: scale(1)   translateY(0);    opacity: 1; }
}

/* Cabeçalho */
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border); gap: 12px;
  flex-shrink: 0;
}
.drawer-titulo { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }

.drawer-negocio-badge {
  display: inline-block; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 4px 12px; border-radius: 999px; color: #fff;
  white-space: nowrap; flex-shrink: 0;
}
.drawer-negocio-badge.negocio-carbono_zero { background: var(--cz); color: var(--cz-fg); }
.drawer-negocio-badge.negocio-tarmac       { background: var(--tm); color: var(--tm-fg); }
.drawer-negocio-badge.negocio-elevator     { background: var(--el); color: var(--el-fg); }

.drawer-empresa {
  font-size: 1.05rem; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.drawer-nome { font-size: .82rem; color: var(--text-muted); margin-top: 1px; }

/* Corpo: 2 colunas */
.drawer-body {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 360px 1fr;
}

/* Coluna esquerda */
.drawer-col-left {
  border-right: 1px solid var(--border);
  overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 20px;
}
.drawer-left-section {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.drawer-left-section:last-child { border-bottom: none; padding-bottom: 0; }

/* Coluna direita */
.drawer-col-right {
  display: flex; flex-direction: column;
  overflow: hidden;
}
.drawer-right-acoes { display: none; }
.drawer-right-panel {
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.drawer-right-scroll {
  flex: 1; min-height: 0; overflow-y: auto;
}
#emailSection.drawer-right-panel {
  border-bottom: none;
}
.drawer-right-historico {
  padding: 16px 20px;
  display: flex; flex-direction: column;
}
.drawer-right-historico .historico-feed { flex: 1; }

/* Seções genéricas */
.drawer-section { padding: 16px 0; border-bottom: 1px solid var(--border); }
.drawer-section-title {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); margin-bottom: 8px;
}
.drawer-section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}

.drawer-meta { display: flex; flex-direction: column; gap: 6px; }
.meta-link { font-size: .875rem; color: var(--primary); text-decoration: none; }
.meta-link:hover { text-decoration: underline; }
.meta-tag { font-size: .875rem; color: var(--text-muted); }

.drawer-obs {
  font-size: .875rem; color: var(--text); line-height: 1.6; white-space: pre-wrap;
  max-height: calc(1.6em * 4);
  overflow: hidden;
  transition: max-height .25s ease;
}
.drawer-obs.expandido { max-height: 1000px; }
.drawer-obs-toggle {
  background: none; border: none; cursor: pointer;
  font-size: .75rem; color: var(--accent); padding: 0;
  font-weight: 500; flex: none;
}
.drawer-obs-toggle:hover { text-decoration: underline; }

/* Materiais */
.drawer-materiais { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-material {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius);
  font-size: .82rem; font-weight: 600;
  text-decoration: none; transition: opacity .15s;
}
.btn-material:hover { opacity: .85; }
.btn-apres    { background: var(--fill-gold,var(--bg)); color: var(--text-gold,var(--text)); border: 1px solid var(--border-gold,var(--border)); }
.btn-proposta { background: var(--surface-raised,var(--bg)); color: var(--text); border: 1px solid var(--border); }
.btn-enriquecer {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius);
  font-size: .82rem; font-weight: 600; cursor: pointer; transition: opacity .15s;
  background: var(--bg); color: var(--text-muted); border: 1px solid var(--border);
}
.btn-enriquecer:hover:not(:disabled) { color: var(--text); border-color: var(--text-muted); }
.btn-enriquecer:disabled { opacity: .5; cursor: default; }

/* ─── Property grid (Dados da Empresa) ─── */
.drawer-props { display: flex; flex-direction: column; }
.prop-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--border);
  min-width: 0;
}
.prop-row:last-child { border-bottom: none; }
.prop-icon { color: var(--text-muted); line-height: 0; flex-shrink: 0; }
.prop-icon svg { width: 13px; height: 13px; }
.prop-label {
  font-size: .75rem; color: var(--text-muted); width: 62px; flex-shrink: 0;
}
.prop-value {
  flex: 1; font-size: .82rem; color: var(--text); min-width: 0;
}
.prop-link { color: var(--primary); text-decoration: none; }
.prop-link:hover { text-decoration: underline; }
.prop-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-copy-prop {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  padding: 2px 4px; border-radius: 4px; line-height: 0; flex-shrink: 0;
  transition: color .12s, background .12s;
}
.btn-copy-prop:hover { color: var(--primary); background: var(--bg); }
.btn-copy-prop svg { width: 12px; height: 12px; }

/* Ações gerais */
.drawer-acoes { display: flex; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.drawer-historico-section { border-bottom: none; }

/* ─── Histórico ─── */
.registrar-form { margin-bottom: 12px; }
.registrar-form textarea {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .875rem; font-family: inherit; resize: vertical;
  background: var(--bg); color: var(--text); outline: none; transition: border-color .15s;
}
.registrar-form textarea:focus { border-color: var(--primary); }
.registrar-tipo-pills {
  display: flex; gap: 5px; flex-wrap: wrap; margin: 8px 0 6px;
}
.tipo-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-muted);
  transition: all .12s;
}
.tipo-pill svg { width: 12px; height: 12px; }
.tipo-pill:hover { border-color: var(--text-muted); color: var(--text); }
.tipo-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.registrar-acoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

.historico-feed { display: flex; flex-direction: column; gap: 10px; }
.historico-vazio { font-size: .85rem; color: var(--text-muted); padding: 12px 0; }

.historico-item {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
}
.historico-data { font-size: .75rem; color: var(--text-muted); margin-bottom: 4px; }
.historico-nota { font-size: .875rem; color: var(--text); line-height: 1.5; }

.historico-tipo {
  display: inline-block; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 1px 6px; border-radius: 999px;
  margin-left: 6px; vertical-align: middle;
}
.tipo-nota    { background: var(--warm-raised); color: var(--ink-500); }
.tipo-email   { background: var(--gold-100); color: var(--gold-700); }
.tipo-reuniao { background: var(--fill-success); color: var(--text-success); }
.tipo-ligacao { background: var(--fill-gold);    color: var(--text-gold); }
.tipo-email_recebido { background: var(--warm-raised); color: var(--text); }
.tipo-whatsapp { background: #dcfce7; color: #15803d; }
.tipo-ligacao  { background: var(--fill-gold); color: var(--text-gold); }

.historico-contato-ref {
  font-size: .75rem; color: var(--text-muted); margin-bottom: 4px;
  display: flex; align-items: center; gap: 4px;
}

.historico-recebido {
  border-left: 3px solid var(--accent); background: var(--warm-raised);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 10px 12px; margin: -4px 0;
}
.historico-recebido .historico-nota { font-size: .82rem; white-space: pre-wrap; }

/* Colapso de e-mails longos no histórico */
.historico-email-wrap { display: flex; flex-direction: column; gap: 4px; }
.historico-email-corpo { display: block; }
.historico-email-corpo.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal !important;
}
.historico-ver-mais {
  background: none; border: none; cursor: pointer;
  color: var(--accent); font-size: .78rem; font-weight: 600;
  padding: 0; text-align: left; align-self: flex-start;
}
.historico-ver-mais:hover { text-decoration: underline; }

.btn-responder {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 8px; background: var(--btn-primary-bg); color: var(--btn-primary-text);
  border: none; border-radius: var(--radius);
  padding: 5px 12px; font-size: .78rem; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.btn-responder:hover { background: color-mix(in srgb, var(--btn-primary-bg) 88%, var(--text)); }

/* Links Meet / Calendar inline no histórico */
.meet-link-inline {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--btn-primary-bg); color: var(--btn-primary-text); border-radius: 6px;
  padding: 4px 10px; font-size: .8rem; font-weight: 600;
  text-decoration: none; margin: 2px 0; transition: background .15s;
}
.meet-link-inline:hover { background: color-mix(in srgb, var(--btn-primary-bg) 88%, var(--text)); }
.cal-link-inline {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--ink-600); font-size: .8rem; text-decoration: none; font-weight: 500;
}
.cal-link-inline:hover { text-decoration: underline; }

/* Status de convidados */
.attendees-wrap { margin-top: 8px; }
.btn-ver-status {
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 4px 10px; font-size: .78rem; cursor: pointer;
  color: var(--text-muted); transition: all .15s;
}
.btn-ver-status:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-ver-status:disabled { opacity: .6; cursor: default; }
.attendees-list { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.att-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .8rem; }
.att-email { color: var(--text-muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-badge { flex-shrink: 0; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.att-accepted  { background: var(--fill-success); color: var(--text-success); }
.att-declined  { background: var(--fill-danger);  color: var(--text-danger); }
.att-tentative { background: var(--fill-gold);    color: var(--text-gold); }
.att-pending   { background: var(--warm-raised); color: var(--ink-500); }
.att-empty, .att-error { font-size: .8rem; color: var(--text-muted); }
.att-error { color: var(--danger); }

/* ─── E-mail com IA ─── */
.btn-email-gerar {
  background: var(--gold-600); color: #fff; border: none; border-radius: var(--radius);
  padding: 7px 14px; font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: background .15s; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
}
.btn-email-gerar:hover:not(:disabled) { background: var(--gold-700); }
.btn-email-gerar:disabled { opacity: .6; cursor: default; }

.btn-enviar {
  background: var(--success); color: #fff; border: none; border-radius: var(--radius);
  padding: 7px 16px; font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: background .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-enviar:hover:not(:disabled) { background: var(--success); }
.btn-enviar:disabled { opacity: .6; cursor: default; }

.btn-enviar-agora {
  background: #2FA36B !important; color: #fff !important; border: none; border-radius: var(--radius);
  padding: 7px 16px; font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: filter .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-enviar-agora:hover:not(:disabled) { filter: brightness(.88); }
.btn-enviar-agora:disabled { opacity: .6; cursor: default; }

/* Linha instrução + gerar */
.email-ia-row {
  display: flex; gap: 8px; align-items: flex-start; margin-bottom: 10px;
}
.email-instrucao-input {
  flex: 1; padding: 7px 10px; resize: none; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .83rem; font-family: inherit; background: var(--bg); color: var(--text);
  outline: none; transition: border-color .15s; line-height: 1.5;
  field-sizing: content; min-height: 34px;
}
.email-instrucao-input:focus { border-color: var(--gold-600); }

/* Compose box */
.email-compose {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); overflow: hidden;
}
.email-compose-field {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid var(--border);
}
.email-compose-label {
  font-size: .75rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
  flex-shrink: 0; width: 58px;
  padding-right: 10px; border-right: 1px solid var(--border);
}
.email-assunto-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: .9rem; font-family: inherit; color: var(--text);
  font-weight: 600;
}
.email-assunto-input::placeholder { color: var(--text-muted); font-weight: 400; }

/* Chips de destinatário */
.email-para-chips {
  display: flex; flex-wrap: wrap; gap: 5px; flex: 1; min-height: 24px; align-items: center;
}
.email-para-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--gold-100); color: var(--gold-700); border: 1px solid var(--gold-300);
  border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 600;
}
.email-para-vazio { font-size: .82rem; color: var(--text-muted); font-style: italic; }
.email-para-chip--manual {
  background: var(--fill-success); color: var(--text-success); border-color: var(--border-success);
}
.email-para-chip--manual .chip-remove,
.email-para-chip .chip-remove {
  background: none; border: none; cursor: pointer; padding: 0 0 0 4px;
  font-size: .85rem; line-height: 1; color: inherit; opacity: .6;
}
.email-para-chip--manual .chip-remove:hover,
.email-para-chip .chip-remove:hover { opacity: 1; }
.email-para-input {
  border: none; outline: none; background: transparent;
  font-size: .82rem; color: var(--text); flex: 1; min-width: 200px;
  padding: 2px 4px;
}
.email-para-input::placeholder { color: var(--text-muted); }

/* ── E-mails genéricos: sugestões no composer ── */
.email-gen-sugestoes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 7px;
  border-bottom: 1px solid var(--border);
}
.email-gen-prefix {
  font-size: .72rem;
  color: var(--text-muted);
  flex: none;
}
.email-gen-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: none;
  font-size: .75rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}
.email-gen-btn:hover { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.email-gen-btn-label { font-weight: 600; color: var(--text); }

/* ── E-mails genéricos: campo no modal ── */
.emails-gen-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.emails-gen-lista {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.emails-gen-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: var(--surface-raised);
  border-radius: var(--radius);
  font-size: .8rem;
}
.emails-gen-label { font-weight: 600; color: var(--text); flex: none; }
.emails-gen-email { color: var(--text-muted); flex: 1; }
.emails-gen-del {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1rem; line-height: 1; padding: 0 2px;
  transition: color .1s;
}
.emails-gen-del:hover { color: #ef4444; }
.emails-gen-add {
  display: flex;
  gap: 6px;
  align-items: center;
}
.emails-gen-add input {
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: .82rem;
}

/* Toolbar do drawer — usa embox-toolbar com ajustes de encaixe */
#emailToolbarSlot .embox-toolbar {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: 1px solid var(--border);
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
}
#emailToolbarSlot .embox-toolbar::-webkit-scrollbar { display: none; }

/* Rich editor */
.email-corpo-editor {
  width: 100%; min-height: 200px;
  padding: 14px 16px; box-sizing: border-box;
  font-size: .9rem; font-family: 'Segoe UI', Arial, sans-serif; line-height: 1.7;
  background: var(--surface); color: var(--text);
  outline: none;
}
.email-corpo-editor:empty:before {
  content: attr(data-placeholder); color: var(--warm-muted); pointer-events: none;
}
.email-corpo-editor p      { margin: 0; }
.email-corpo-editor div    { margin: 0; min-height: 1.4em; }
.email-corpo-editor br     { display: block; }
.email-corpo-editor ul, .email-corpo-editor ol { margin: 0 0 4px; padding-left: 20px; }
.email-corpo-editor li     { margin-bottom: 2px; }
.email-corpo-editor hr     { border: none; border-top: 1px solid var(--warm-border); margin: 16px 0; }
.email-corpo-editor strong { font-weight: 700; }
.email-corpo-editor em     { font-style: italic; }

.email-acoes {
  display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  flex-shrink: 0;
}

.btn-refinar {
  background: var(--surface); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 7px 14px; font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: all .15s;
  display: inline-flex; align-items: center; gap: 5px;
  margin-right: auto;
}
.btn-refinar:hover { background: var(--surface-raised); color: var(--text); border-color: var(--gold-400); }

.btn-aprovar {
  background: var(--fill-success); color: var(--text-success); border: 1px solid var(--border-success);
  border-radius: var(--radius); padding: 7px 14px; font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: background .15s; display: inline-flex; align-items: center; gap: 5px;
}
.btn-aprovar:hover { background: var(--fill-success); filter: brightness(.95); }

.email-msg-ok {
  padding: 8px 12px; border-radius: 8px;
  background: var(--fill-success); color: var(--text-success); border: 1px solid var(--border-success); font-size: .82rem;
}
.email-msg-erro {
  padding: 8px 12px; border-radius: 8px;
  background: var(--fill-danger); color: var(--danger); border: 1px solid var(--border-danger); font-size: .82rem;
}

/* ─── Agenda (reunião) ─── */
.agenda-form {
  background: var(--warm-raised); border: 1px solid var(--warm-border);
  border-radius: var(--radius); padding: 14px; margin: 12px 0;
  display: flex; flex-direction: column; gap: 10px;
}
.agenda-form-header { display: flex; align-items: center; justify-content: space-between; }
.agenda-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.agenda-form .form-group label {
  font-size: .72rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.agenda-form input, .agenda-form select, .agenda-form textarea {
  width: 100%; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .85rem; font-family: inherit;
  background: var(--surface); color: var(--text);
  outline: none; transition: border-color .15s;
}
.agenda-form input:focus, .agenda-form select:focus, .agenda-form textarea:focus { border-color: var(--ink-800); }
.agenda-form textarea { resize: vertical; }
.agenda-no-email-warn {
  padding: 8px 10px; background: var(--fill-warn); border: 1px solid var(--border-warn);
  border-radius: var(--radius); font-size: .82rem; color: var(--text-warn);
}
.convidados-input-row { display: flex; gap: 6px; margin-bottom: 6px; }
.convidados-input-row input { flex: 1; }
.convidados-list { display: flex; flex-wrap: wrap; gap: 5px; min-height: 4px; }
.convidado-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--gold-100); color: var(--gold-700); border: 1px solid var(--gold-300);
  border-radius: 999px; padding: 3px 8px; font-size: .78rem; font-weight: 500;
}
.chip-remove {
  background: none; border: none; cursor: pointer;
  color: var(--gold-600); font-size: .9rem; line-height: 1; padding: 0;
}
.chip-remove:hover { color: var(--danger); }
.agenda-acoes { display: flex; justify-content: flex-end; gap: 8px; }
.agenda-meet-result {
  padding: 8px 12px; border-radius: var(--radius);
  background: var(--fill-success); border: 1px solid var(--border-success);
}
.meet-success {
  display: flex; flex-direction: column; gap: 6px;
  font-size: .85rem; color: var(--text-success); font-weight: 600;
}
.meet-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; background: var(--btn-primary-bg); color: var(--btn-primary-text);
  border-radius: var(--radius); text-decoration: none;
  font-size: .82rem; font-weight: 600; transition: background .15s; width: fit-content;
}
.meet-link:hover { background: color-mix(in srgb, var(--btn-primary-bg) 88%, var(--text)); }

/* ─── Contatos (pessoas) no Drawer ─── */
.contatos-lista { display: flex; flex-direction: column; gap: 8px; }
.contato-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
  display: flex; align-items: flex-start; gap: 10px;
}
.contato-card.decisor  { border-left: 3px solid var(--primary); }
.contato-card.email-geral { border-left: 3px solid var(--warn); background: var(--fill-warn); }
.contato-check { margin-top: 3px; flex-shrink: 0; cursor: pointer; }
.contato-info  { flex: 1; min-width: 0; }
.contato-nome  { font-size: .875rem; font-weight: 700; color: var(--text); }
.contato-cargo { font-size: .78rem; color: var(--text-muted); }
.contato-campos { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.contato-campo { font-size: .75rem; color: var(--text-muted); display: flex; align-items: center; gap: 3px; min-width: 0; max-width: 100%; }
.contato-campo-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.contato-sem-email { font-size: .75rem; color: var(--warn); margin-top: 2px; }
.contato-actions { display: flex; gap: 4px; flex-shrink: 0; }
.btn-contato-edit, .btn-contato-del {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  padding: 2px 7px; font-size: .75rem; cursor: pointer;
  color: var(--text-muted); transition: all .15s;
}
.btn-contato-del:hover  { border-color: var(--danger); color: var(--danger); }
.btn-contato-edit:hover { border-color: var(--primary); color: var(--primary); }
.contatos-selecao-hint {
  font-size: .75rem; color: var(--text-muted);
  margin-bottom: 6px; font-style: italic;
}

.badge-email-geral {
  display: inline-block; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  background: var(--fill-gold); color: var(--text-gold); border: 1px solid var(--border-gold);
  border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: middle;
}
.btn-pedir-indicacao {
  background: var(--warning); color: #fff; border: none; border-radius: var(--radius);
  padding: 4px 10px; font-size: .75rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background .15s;
}
.btn-pedir-indicacao:hover:not(:disabled) { background: color-mix(in srgb, var(--warning) 80%, black); }
.btn-pedir-indicacao:disabled { opacity: .6; cursor: default; }

.email-geral-result {
  background: var(--fill-warn); border: 1px solid var(--border-warn); border-left: 3px solid var(--warn);
  border-radius: var(--radius); padding: 10px 12px;
  display: flex; align-items: center; gap: 10px; margin-top: 6px;
}
.email-geral-result-info { flex: 1; min-width: 0; }
.email-geral-result-label { font-size: .78rem; font-weight: 700; color: var(--text-warn); }
.email-geral-result-email { font-size: .82rem; color: var(--text); }

/* Busca IA inline no drawer */
.busca-contatos-drawer { margin-top: 8px; }
.busca-contato-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px;
}
.busca-contato-info  { flex: 1; min-width: 0; }
.busca-contato-nome  { font-size: .875rem; font-weight: 700; color: var(--text); }
.busca-contato-cargo { font-size: .78rem; color: var(--text-muted); }
.busca-contato-just  { font-size: .75rem; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }

/* ─── Drag handle mobile ─── */
.drawer-drag-handle {
  display: none;
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--border); margin: 10px auto 0; flex-shrink: 0;
}

.btn-icon--danger { color: var(--danger); }
.btn-icon--danger:hover { background: var(--fill-danger); }

/* ─── Status select ─── */
.drawer-status-select {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .875rem; background: var(--bg); color: var(--text);
  outline: none; margin-top: 4px; min-height: 44px;
}
.drawer-status-select:focus { border-color: var(--primary); }

/* ─── Próximo contato CTA (quando vazio) ─── */
.proximo-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius);
  background: var(--fill-warn); color: var(--text-warn);
  border: 1.5px dashed var(--warning);
  font-size: .82rem; font-weight: 600; cursor: pointer;
  transition: all .15s; width: 100%;
}
.proximo-cta:hover { background: var(--fill-warn); filter: brightness(.95); border-color: var(--text-warn); }
.proximo-cta svg  { width: 14px; height: 14px; flex-shrink: 0; }

/* ─── Toolbar de ação compacta ─── */
.drawer-acao-tabs {
  display: flex; gap: 0; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.drawer-acao-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 8px; background: none; border: none; border-bottom: 2px solid transparent;
  font-size: .82rem; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: all .15s; margin-bottom: -1px;
}
.drawer-acao-tab svg { width: 15px; height: 15px; flex-shrink: 0; }
.drawer-acao-tab:hover  { color: var(--primary); background: var(--warm-raised); }
.drawer-acao-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--warm-raised); }

/* ─── Copy button nos contatos ─── */
.btn-copy {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 2px 4px; border-radius: 4px;
  font-size: .75rem; line-height: 1; transition: all .15s; display: inline-flex;
}
.btn-copy:hover { color: var(--primary); background: var(--warm-raised); }
.btn-copy svg { width: 12px; height: 12px; }

.drawer-accordion { padding-top: 12px; }
.drawer-accordion-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
  cursor: pointer; transition: all .15s;
}
.drawer-accordion-toggle:hover { background: var(--bg); border-color: var(--warm-muted); }
.drawer-accordion-arrow { transition: transform .2s; }
.drawer-accordion-arrow.open { transform: rotate(180deg); }
.drawer-accordion-body { padding: 12px 4px 0; }

.drawer-detalhe-acoes { display: flex; gap: 8px; margin-top: 4px; }
.drawer-detalhe-acoes .btn-secondary { flex: 1; min-height: 40px; }

/* ─── Fechar buttons ─── */
.btn-fechar {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 6px; flex-shrink: 0; transition: all .15s;
}
.btn-fechar:hover { color: var(--text); background: var(--bg); }

.btn-fechar-sm {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 4px; flex-shrink: 0; transition: all .15s;
}
.btn-fechar-sm:hover { color: var(--text); background: var(--bg); }

/* ─── Botão "Enviar mais tarde" ─── */
.btn-agendar-email {
  background: var(--fill-success); color: var(--text-success); border: 1px solid var(--border-success);
  border-radius: var(--radius); padding: 7px 14px; font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: background .15s; display: inline-flex; align-items: center; gap: 5px;
}
.btn-agendar-email:hover { background: var(--fill-success); filter: brightness(.95); }

/* ─── Painel Send Later ─── */
.send-later-panel {
  margin-top: 10px; padding: 14px; border-radius: var(--radius);
  background: var(--warm-raised); border: 1.5px solid var(--warm-border);
  display: flex; flex-direction: column; gap: 10px;
}
.send-later-titulo {
  font-size: .82rem; font-weight: 700; color: var(--primary);
  display: flex; align-items: center; gap: 6px;
}
.send-later-titulo svg { width: 14px; height: 14px; }
.send-later-atalho {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius);
  background: var(--warm-raised); color: var(--primary); border: 1.5px solid var(--warm-border);
  font-size: .82rem; font-weight: 600; cursor: pointer; transition: background .15s; width: fit-content;
}
.send-later-atalho:hover { background: var(--warm-raised); }
.send-later-atalho svg { width: 14px; height: 14px; }
.send-later-custom {
  display: flex; gap: 8px;
}
.send-later-custom input {
  flex: 1; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .85rem; font-family: inherit;
  background: var(--surface); color: var(--text); outline: none;
}
.send-later-custom input:focus { border-color: var(--primary); }
.send-later-acoes { display: flex; justify-content: flex-end; gap: 8px; }

/* ─── Tarefas Pendentes no Drawer ─── */
#drawerTarefasList {
  max-height: 260px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.drawer-tarefa-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 5px;
  cursor: pointer; transition: border-color .15s, background .15s;
  background: var(--bg);
}
.drawer-tarefa-item:hover { border-color: var(--primary); background: var(--surface); }
.drawer-tarefa-icon {
  color: var(--text-muted); line-height: 0; flex-shrink: 0;
}
.drawer-tarefa-icon svg { width: 13px; height: 13px; }
.drawer-tarefa-titulo {
  flex: 1; font-size: .82rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.drawer-tarefa-data {
  font-size: .72rem; color: var(--text-muted); flex-shrink: 0;
}
.drawer-tarefa-data.hoje    { color: var(--warn);   font-weight: 600; }
.drawer-tarefa-data.urgente { color: var(--danger); font-weight: 600; }
.drawer-tarefa-mais {
  background: none; border: none; color: var(--primary);
  font-size: .78rem; cursor: pointer; padding: 4px 0;
  text-decoration: underline; display: block;
}
.drawer-tarefa-mais:hover { opacity: .75; }

/* ─── E-mail form (migrado de style.css) ─── */
.email-form { display: flex; flex-direction: column; gap: 10px; }
.email-form .form-group label {
  font-size: .72rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.email-form input,
.email-form textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .85rem; font-family: inherit;
  background: var(--bg); color: var(--text); outline: none; transition: border-color .15s;
}
.email-form input:focus,
.email-form textarea:focus { border-color: var(--gold-600); }
.email-form textarea { resize: vertical; line-height: 1.55; }

.email-status { padding: 8px 12px; border-radius: var(--radius); font-size: .82rem; font-weight: 500; }
.email-status-info { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.email-status-ok   { background: var(--fill-success); color: var(--text-success); border: 1px solid var(--border-success); }
.email-status-erro { background: var(--fill-danger);  color: var(--text-danger);  border: 1px solid var(--border-danger); }

.agenda-status { padding: 7px 10px; border-radius: var(--radius); font-size: .82rem; font-weight: 500; }
.agenda-status-info { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.agenda-status-ok   { background: var(--fill-success); color: var(--text-success); border: 1px solid var(--border-success); }
.agenda-status-erro { background: var(--fill-danger);  color: var(--text-danger);  border: 1px solid var(--border-danger); }

/* ─── WhatsApp com IA ─── */
.wa-modo-toggle {
  display: flex; gap: 0; margin-bottom: 14px;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.wa-modo-btn {
  flex: 1; padding: 7px 12px; background: none; border: none;
  font-size: .78rem; font-weight: 600; cursor: pointer;
  color: var(--text-muted); transition: all .15s;
}
.wa-modo-btn.active { background: var(--text); color: var(--bg); }
.wa-modo-btn:not(.active):hover { background: var(--bg); color: var(--text); }

.wa-contato-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.wa-contato-label { font-size: .75rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.wa-contato-select {
  flex: 1; padding: 6px 10px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-size: .82rem; font-family: inherit; outline: none;
}
.wa-contato-select:focus { border-color: var(--primary); }

.btn-wa-gerar {
  width: 100%; padding: 9px; border-radius: var(--radius);
  border: none; background: var(--text); color: var(--bg);
  font-size: .82rem; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: opacity .15s; margin-bottom: 14px;
}
.btn-wa-gerar:hover:not(:disabled) { opacity: .85; }
.btn-wa-gerar:disabled { opacity: .5; cursor: not-allowed; }
.btn-wa-gerar svg { width: 14px; height: 14px; }

.wa-preview {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; margin-bottom: 10px;
}
.wa-bolha {
  display: inline-block; align-self: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px 12px 12px 2px;
  padding: 8px 12px; font-size: .85rem; line-height: 1.45;
  color: var(--text); max-width: 92%;
}

.wa-acoes { display: flex; gap: 8px; }
.btn-wa-copiar, .btn-wa-registrar {
  flex: 1; padding: 8px; border-radius: var(--radius);
  font-size: .78rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  transition: all .15s;
}
.btn-wa-copiar { background: var(--bg); border: 1px solid var(--border); color: var(--text); }
.btn-wa-copiar:hover { border-color: var(--primary); color: var(--primary); }
.btn-wa-registrar { background: none; border: 1px solid var(--border); color: var(--text-muted); }
.btn-wa-registrar:hover { border-color: var(--text); color: var(--text); }
.btn-wa-copiar svg, .btn-wa-registrar svg { width: 13px; height: 13px; }

/* ─── Email Anexos ─── */
.email-anexos-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0 2px; }
.email-btn-anexar { display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  font-size: .75rem; color: var(--text-muted); padding: 4px 8px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg); transition: all .15s; }
.email-btn-anexar:hover { color: var(--text); border-color: var(--text-muted); }
.email-btn-anexar svg { width: 13px; height: 13px; }
.email-anexo-chip { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem;
  background: var(--surface-raised); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 8px; color: var(--text-secondary); }
.email-anexo-rm { background: none; border: none; cursor: pointer; color: var(--text-muted);
  font-size: .9rem; line-height: 1; padding: 0 1px; }
.email-anexo-rm:hover { color: var(--danger); }
