/* ===== v7: CRM, Kanban, agendamentos, campanhas ===== */
.tag-chips { display: inline-flex; gap: 3px; flex-wrap: wrap; vertical-align: middle; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; line-height: 1.5; padding: 0 7px; border-radius: 10px; white-space: nowrap;
  background: color-mix(in srgb, var(--tc, #2563eb) 20%, transparent); color: color-mix(in srgb, var(--tc, #2563eb) 75%, var(--text));
  border: 1px solid color-mix(in srgb, var(--tc, #2563eb) 45%, transparent);
}
.tag-chip.more { --tc: #64748b; }
.tag-chip button { background: none; border: none; color: inherit; cursor: pointer; font-size: 13px; line-height: 1; padding: 0 0 0 2px; opacity: 0.7; }
.tag-chip button:hover { opacity: 1; }
.tag-edit { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tag-add { font-size: 11.5px; padding: 1px 6px; height: 22px; border-radius: 10px; width: auto; max-width: 150px; background: var(--surface-2); }
.link-btn { background: none; border: none; color: var(--blue); cursor: pointer; font: inherit; font-size: 12px; padding: 0 4px; }
.link-btn:hover { text-decoration: underline; }
.chat-tags-bar { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; padding: 5px 14px; border-bottom: 1px solid var(--border); background: var(--surface); font-size: 12px; }
.ctb-label { font-size: 12px; opacity: 0.8; }
#filterTag { max-width: 150px; }
.crm-dr-label { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-top: 6px; }
.cc-empty { color: var(--text-muted); font-size: 12.5px; }

/* contatos */
.crm-head-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.crm-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.crm-filters input { flex: 1; min-width: 240px; }
.crm-filters select { width: auto; min-width: 170px; }
.crm-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: var(--wa-green-soft); border: 1px solid var(--wa-green); font-size: 13px; }
.crm-bulk select { width: auto; height: 28px; font-size: 12.5px; }
.crm-table tr.crm-optout td { opacity: 0.7; }
.crm-table td { vertical-align: middle; }

/* ficha */
.cc-card { width: 760px; max-width: 96vw; max-height: 92vh; overflow-y: auto; }
.cc-head { display: flex; align-items: center; gap: 12px; }
.cc-head h3 { margin: 0; font-size: 17px; }
.cc-head small { color: var(--text-secondary); }
.cc-tab { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.cc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.cc-grid .field { margin-bottom: 8px; }
.cc-item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 9px; cursor: pointer; font-size: 13px; background: var(--surface-2); }
.cc-item:hover { border-color: var(--wa-green); }
.cc-item small { flex-basis: 100%; color: var(--text-secondary); font-size: 12px; }
.cc-item.small { padding: 5px 8px; font-size: 12.5px; margin-top: 4px; }
.cc-item.small small { flex-basis: auto; }
.cc-timeline { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.cc-act { display: flex; gap: 10px; font-size: 13px; }
.cc-act > span { width: 22px; text-align: center; }
.cc-act small { color: var(--text-muted); font-size: 11.5px; }
.ac-list { position: relative; }
.ac-list:not(:empty) { border: 1px solid var(--border-strong); border-radius: 8px; margin-top: 3px; max-height: 220px; overflow-y: auto; background: var(--surface); }
.ac-item { padding: 7px 10px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--border); }
.ac-item:hover { background: var(--wa-green-soft); }
.ac-item small { color: var(--text-muted); margin-left: 6px; }
.tg-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; max-height: 55vh; overflow-y: auto; }
.tg-row { display: grid; grid-template-columns: 42px 1fr auto auto; gap: 8px; align-items: center; }
.tg-row input[type="color"] { padding: 2px; height: 32px; }
.tg-row small { color: var(--text-muted); white-space: nowrap; }
.pl-stages { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.pl-row { display: grid; grid-template-columns: 42px 1fr 130px auto auto; gap: 6px; align-items: center; }
.pl-row input[type="color"] { padding: 2px; height: 32px; }
.cf-row { grid-template-columns: 1fr 150px 1fr auto; }

/* kanban */
#view-kanban { flex-direction: column; }
.kb-top { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border-strong); background: var(--header-bg); flex-wrap: wrap; }
.kb-top select, .kb-top input { width: auto; height: 32px; font-size: 13px; }
.kb-top input#kbSearch { width: 230px; }
.kb-totals { font-size: 13px; color: var(--text-secondary); }
.kb-board { flex: 1; display: flex; gap: 12px; padding: 14px; overflow-x: auto; overflow-y: hidden; min-height: 0; background: var(--page-bg); }
.kb-col { flex: 0 0 280px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-strong); border-top: 3px solid var(--sc); border-radius: 12px; min-height: 0; }
.kb-col.over { border-color: var(--wa-green); box-shadow: 0 0 0 2px var(--wa-green-soft); }
.kb-col-head { display: flex; align-items: center; gap: 7px; padding: 10px 12px 2px; font-size: 13.5px; }
.kb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sc); display: inline-block; flex-shrink: 0; }
.kb-count { margin-left: auto; font-size: 12px; background: var(--surface-3); padding: 0 7px; border-radius: 9px; }
.kb-col-total { font-size: 12px; color: var(--text-secondary); padding: 0 12px 8px; }
.kb-cards { flex: 1; overflow-y: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 7px; min-height: 60px; }
.kb-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 9px 10px; cursor: grab; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.kb-card:hover { border-color: var(--wa-green); }
.kb-card.dragging { opacity: 0.45; }
.kb-card-top { display: flex; justify-content: space-between; gap: 6px; }
.kb-card-top b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.kb-card-top span { white-space: nowrap; color: var(--wa-green); font-weight: 600; }
.kb-card-contact { color: var(--text-secondary); }
.kb-card-foot { display: flex; justify-content: space-between; color: var(--text-muted); font-size: 11.5px; }
.kb-add { background: none; border: 1px dashed var(--border-strong); color: var(--text-muted); border-radius: 8px; padding: 6px; cursor: pointer; font: inherit; font-size: 12px; }
.kb-add:hover { color: var(--text); border-color: var(--wa-green); }

/* agendamentos */
.sched-list { display: flex; flex-direction: column; gap: 8px; }
.sched-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; background: var(--card-bg); border: 1px solid var(--border-strong); border-radius: 12px; font-size: 13px; }
.sched-item.cancelled, .sched-item.sent { opacity: 0.75; }
.sched-item.failed { border-color: rgba(239, 68, 68, 0.5); }
.sched-when { display: flex; flex-direction: column; align-items: center; min-width: 78px; padding: 4px 6px; border-radius: 8px; background: var(--surface-2); }
.sched-when span { font-size: 15px; font-weight: 600; }
.sched-body { color: var(--text-secondary); white-space: pre-wrap; margin: 3px 0; word-break: break-word; }
.sched-btns { display: flex; flex-direction: column; gap: 4px; }
.reminder-pop { position: fixed; right: 18px; bottom: 18px; z-index: 300; width: 320px; background: var(--surface); border: 1px solid var(--wa-green); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.reminder-head { font-weight: 700; color: var(--wa-green); }
.reminder-btns { display: flex; gap: 6px; justify-content: flex-end; }

/* campanhas */
#view-campaigns { position: relative; }
.camp-risk { padding: 10px 14px; border-radius: 10px; background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.4); font-size: 13px; line-height: 1.5; }
.camp-note { color: var(--amber); font-size: 12.5px; }
.camp-bar { height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.camp-bar span { display: block; height: 100%; background: var(--wa-green); transition: width 0.4s; }
.ce-main { flex: 1; display: flex; min-height: 0; }
.ce-form { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.ce-form .card { margin: 0; }
.ce-preview { width: 340px; flex-shrink: 0; border-left: 1px solid var(--border-strong); background: var(--surface); padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.ce-prev-stats { font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.ce-prev-stats small { color: var(--text-muted); line-height: 1.45; }
.ce-big { font-size: 34px; font-weight: 700; color: var(--wa-green); line-height: 1; }
.ce-est { margin-top: 4px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); }
.ce-msg { display: flex; gap: 6px; align-items: flex-start; margin-bottom: 6px; }
.ce-msg > span { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: 11px; flex-shrink: 0; margin-top: 6px; }
.ce-msg textarea { flex: 1; resize: vertical; }
.ce-tags { display: flex; flex-wrap: wrap; gap: 2px 12px; max-height: 150px; overflow-y: auto; }
.ce-days { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ce-risk { padding: 8px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.45; }
.ce-risk.good { background: var(--wa-green-soft); color: var(--wa-green); }
.ce-risk.warn { background: rgba(245, 158, 11, 0.12); color: #fcd34d; }
.ce-risk.bad { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }
body.light-theme .ce-risk.warn { color: #92400e; }
body.light-theme .ce-risk.bad { color: #b91c1c; }
.ce-form input[type="time"], .ce-form input[type="number"] { width: auto; min-width: 90px; }

@media (max-width: 820px) {
  .cc-grid { grid-template-columns: 1fr; }
  .ce-main { flex-direction: column; overflow-y: auto; }
  .ce-preview { width: auto; border-left: none; border-top: 1px solid var(--border-strong); }
  .kb-col { flex-basis: 82vw; }
  .crm-table th:nth-child(5), .crm-table td:nth-child(5), .crm-table th:nth-child(6), .crm-table td:nth-child(6) { display: none; }
}
.fb-sim-msg { white-space: pre-wrap; }
.sched-item a, #delivBody a, .cc-tab a { color: var(--blue); text-decoration: none; }
.sched-item a:hover, #delivBody a:hover { text-decoration: underline; }
.kb-top select, .kb-top input { padding-top: 0; padding-bottom: 0; line-height: 30px; }

/* ===== marca e segurança ===== */
.brand-dot.has-img { padding: 0; overflow: hidden; background: transparent; }
.brand-dot.has-img img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.brand-edit { display: flex; flex-direction: column; gap: 8px; }
.color-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.color-row input[type="color"] { width: 54px; height: 36px; padding: 3px; }
.color-presets { display: flex; gap: 5px; flex-wrap: wrap; }
.color-presets button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); cursor: pointer; }
.color-presets button:hover { transform: scale(1.15); }
.brand-imgs { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.brand-img-box { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.brand-img-box label { color: var(--text-secondary); font-weight: 600; }
.brand-img-box input[type="file"] { font-size: 12px; }
.brand-prev { border: 1px dashed var(--border-strong); border-radius: 10px; display: grid; place-items: center; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface-3) 0 50%) 50% / 16px 16px; overflow: hidden; color: var(--text-muted); font-size: 12px; }
.brand-prev.wide { height: 70px; }
.brand-prev.square { width: 70px; height: 70px; font-weight: 700; font-size: 18px; }
.brand-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sec-ok, .sec-off, .sec-warn { font-size: 13px; padding: 8px 10px; border-radius: 8px; line-height: 1.45; margin-bottom: 6px; }
.sec-ok { background: var(--wa-green-soft); }
.sec-off { background: var(--surface-2); color: var(--text-secondary); }
.sec-warn { background: rgba(245, 158, 11, 0.14); }
.sec-sessions { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.sec-sess { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; }
.sec-sess small { color: var(--text-muted); }
.tfa-box { margin-top: 8px; padding: 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.tfa-box ol { padding-left: 18px; margin: 0; line-height: 1.6; }
.tfa-qr { width: 180px; height: 180px; background: #fff; padding: 6px; border-radius: 10px; }
.must2fa { position: fixed; left: 50%; transform: translateX(-50%); top: 10px; z-index: 250; background: var(--surface); border: 1px solid var(--amber); padding: 8px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13px; display: flex; gap: 10px; align-items: center; }
.btn-primary { color: var(--on-brand, #fff); }
@media (max-width: 820px) { .brand-imgs { grid-template-columns: 1fr; } }
.brand-img-box { min-width: 0; }
.brand-img-box input[type="file"] { width: 100%; }

/* filtros da lista: quebram em duas linhas quando há muitos (não cortam o texto) */
.wa-subfilters { flex-wrap: wrap; row-gap: 6px; }
.wa-subfilters select { flex: 1 1 120px; }
/* fila: bolinha colorida (em vez de borda que parecia um parêntese) */
.queue-tag { border-left: none !important; display: inline-flex; align-items: center; gap: 4px; }
.queue-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--qc, #2563eb); flex-shrink: 0; }

/* composer: quando a conversa fica estreita (painel do contato aberto / tela 1280px), os botões viram só ícone e o campo de texto ganha espaço */
.wa-composer-bar { container-type: inline-size; }
.wa-input-wrap { min-width: 120px; }
@container (max-width: 620px) {
  .wa-composer-pill-btn span { display: none; }
  .wa-composer-pill-btn { padding: 6px 8px; }
}
@container (max-width: 420px) {
  #btnEmoji { display: none; }
}

/* v7.8 — Minha conta: trocar senha, erro do 2FA e janela "Minha conta" */
.tfa-err { color: var(--danger, #ef4444); font-size: 13px; min-height: 16px; line-height: 1.4; }
.sec-pw { margin: 4px 0 6px; }
.sec-pw > summary { cursor: pointer; font-size: 13px; font-weight: 600; padding: 6px 0; }
.sec-pw-body { display: flex; flex-direction: column; gap: 6px; padding: 6px 0 4px; max-width: 360px; }
.sec-pw-body .field { margin: 0; }
.myacc-overlay { position: fixed; inset: 0; z-index: 9000; background: rgba(5, 10, 15, 0.72); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto; }
.myacc-box { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 8px; }
.myacc-head { display: flex; justify-content: space-between; align-items: center; background: var(--surface); padding: 10px 14px; border-radius: 10px; }
.myacc-box #accountSecCard { margin: 0; }
