/* Essência Chat — receita real, recompra e funil. Segue o tema claro do painel. */
.ec-view.active { padding-bottom: 0; }
.ec-view + .view.active { padding-top: 8px; }
.ec-card { padding: 22px; margin-bottom: 26px; }
.ec-field { display: grid; gap: 6px; min-width: 0; }
.ec-field > span { color: #516277; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ec-field > span em { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 500; color: #7d8895; }
.ec-field input, .ec-field select, .ec-field textarea { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #ccdae5; border-radius: 9px; background: #fff; color: #182c45; font: inherit; font-size: 15px; }
.ec-field textarea { resize: vertical; line-height: 1.45; }
.ec-field input:focus, .ec-field select:focus, .ec-field textarea:focus { outline: none; border-color: #1d6fe8; box-shadow: 0 0 0 3px rgba(29,111,232,.15); }
.ec-field input:disabled { background: #f4f7fa; color: #516277; }
.ec-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.ec-note { margin: 0; color: #7d8895; font-size: 12.5px; line-height: 1.5; }
.ec-big { min-height: 50px; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.ec-spin { width: 16px; height: 16px; border: 2px solid rgba(14,32,52,.25); border-top-color: #0e2034; border-radius: 50%; animation: ec-spin .8s linear infinite; }
@keyframes ec-spin { to { transform: rotate(360deg); } }

.ec-steps { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 0 0 20px; padding: 0 0 16px; border-bottom: 1px solid #e6edf2; }
.ec-steps li { display: flex; align-items: center; gap: 9px; color: #8793a0; font-size: 14px; font-weight: 600; }
.ec-steps b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #eef3f8; color: #7d8895; font-size: 12px; }
.ec-steps li.active { color: #182c45; }
.ec-steps li.active b { background: #1d6fe8; color: #fff; }
.ec-steps li.done b { background: #d8f3e4; color: #13804a; }

.ec-upload-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 22px; }
.ec-client { display: grid; gap: 14px; align-content: start; }
.ec-drop { position: relative; min-height: 290px; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 20px; text-align: center; border: 2px dashed #b9cde0; border-radius: 14px; background: #f6fafd; cursor: pointer; transition: .18s ease; overflow: hidden; }
.ec-drop:hover, .ec-drop.over { border-color: #1d6fe8; background: #eef5fe; }
.ec-drop-icon { font-size: 42px; }
.ec-drop strong { color: #182c45; font-size: 17px; }
.ec-drop small { color: #7d8895; font-size: 13px; }
.ec-drop.has-photo { padding: 0; place-content: stretch; border-style: solid; }
.ec-drop.has-photo img { width: 100%; height: 100%; max-height: 420px; object-fit: contain; background: #eef3f8; }
.ec-drop-change { position: absolute; right: 12px; bottom: 12px; padding: 8px 12px; border-radius: 8px; background: rgba(24,44,69,.85); color: #fff; font-size: 13px; font-weight: 600; }

.ec-review { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 22px; align-items: start; }
.ec-photo { margin: 0; position: sticky; top: 100px; border: 1px solid #dce6ee; border-radius: 12px; overflow: hidden; background: #eef3f8; }
.ec-photo img { display: block; width: 100%; max-height: 70vh; object-fit: contain; }
.ec-photo p { padding: 40px 16px; text-align: center; color: #7d8895; }
.ec-photo figcaption { padding: 10px 12px; background: #fff; color: #516277; font-size: 12.5px; border-top: 1px solid #e6edf2; }
.ec-reading { display: grid; gap: 14px; min-width: 0; }
.ec-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.ec-meta span { padding: 10px 12px; border-radius: 10px; background: #f6fafd; border: 1px solid #e3ecf3; min-width: 0; }
.ec-meta small { display: block; color: #7d8895; font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.ec-meta strong { display: block; margin-top: 3px; color: #182c45; font-size: 14px; overflow-wrap: anywhere; }
.ec-meta em { display: block; font-style: normal; color: #516277; font-size: 12px; }
.ec-warnings { margin: 0; padding: 12px 14px 12px 32px; border-radius: 10px; background: #fff6e5; border: 1px solid #f5d79c; color: #7a4a00; font-size: 14px; line-height: 1.5; }
.ec-ok { margin: 0; padding: 11px 14px; border-radius: 10px; background: #e8f7ef; border: 1px solid #bfe6cf; color: #13804a; font-size: 14px; font-weight: 600; }
.ec-items { display: grid; gap: 10px; }
.ec-item { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 10px 12px; padding: 14px; border: 1px solid #dce6ee; border-radius: 12px; background: #fff; }
.ec-item header { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ec-item header b { width: 24px; height: 24px; flex-shrink: 0; border-radius: 7px; display: grid; place-items: center; background: #e3eefb; color: #1d4ed8; font-size: 12px; }
.ec-item header strong { color: #182c45; font-size: 15px; }
.ec-item header span { margin-left: auto; color: #516277; font-size: 13px; font-weight: 600; }
.ec-check { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 10px; background: #f6fafd; border: 1px solid #dce6ee; color: #182c45; font-size: 15px; font-weight: 600; cursor: pointer; }
.ec-check input { width: 20px; height: 20px; accent-color: #1d6fe8; }
.ec-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.ec-actions .ec-big { flex: 1 1 240px; }
.ec-actions .secondary-button { min-height: 50px; }
.ec-sale { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; align-items: end; padding: 14px; border-radius: 12px; background: #f6fafd; border: 1px solid #dce6ee; }
.ec-sale p { margin: 0 0 10px; color: #516277; font-size: 13.5px; }
.ec-done { padding: 16px; border-radius: 12px; background: #e8f7ef; border: 1px solid #bfe6cf; }
.ec-done strong { color: #13804a; font-size: 16px; }
.ec-done p { margin: 8px 0 0; color: #1d4a33; font-size: 14px; line-height: 1.7; }

.ec-rp-group { margin-top: 22px; }
.ec-rp-filters { display: grid; grid-template-columns: minmax(220px, 1.4fr) minmax(160px, .9fr) minmax(145px, .75fr) minmax(145px, .75fr) auto; gap: 10px; align-items: end; margin: 16px 0 20px; padding: 15px; border: 1px solid #dce6ee; border-radius: 12px; background: #fff; }
.ec-rp-filters .secondary-button { min-height: 44px; white-space: nowrap; }
.ec-rp-group > h3, .ec-rp-group > summary { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: #182c45; font-size: 17px; font-weight: 700; cursor: default; }
.ec-rp-group > summary { cursor: pointer; font-size: 15px; color: #516277; }
.ec-rp-group > h3 b { padding: 2px 9px; border-radius: 99px; background: #dce9f5; color: #153e70; font-size: 12px; }
.ec-rp { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.3fr) minmax(120px, .7fr) auto; gap: 10px 16px; align-items: center; padding: 14px 16px; margin-bottom: 8px; border: 1px solid #dce6ee; border-left: 4px solid #1d6fe8; border-radius: 12px; background: #fff; }
.ec-rp.late { border-left-color: #e5484d; }
.ec-rp strong { display: block; color: #182c45; font-size: 15px; }
.ec-rp small { display: block; margin-top: 2px; color: #7d8895; font-size: 12.5px; }
.ec-rp-when b { color: #1d4ed8; font-size: 14px; }
.ec-rp.late .ec-rp-when b { color: #c62a2f; }
.ec-rp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: flex-end; }
.ec-wa { display: inline-flex; align-items: center; text-decoration: none; background: #25d366 !important; border-color: #25d366 !important; color: #06351a !important; }
.ec-rp-actions .text-button { color: #7d8895; font-size: 13px; }
.ec-settings { margin-top: 28px; padding: 20px; display: grid; gap: 14px; }
.ec-settings h3 { margin: 0; color: #182c45; font-size: 17px; }
.ec-settings p { margin: 0; color: #516277; font-size: 14px; line-height: 1.55; }
.ec-settings .primary-button { justify-self: start; }

.ec-funnel { margin-bottom: 20px; }
.ec-funnel table { min-width: 980px; }
.ec-invest { width: 110px; min-height: 36px; padding: 6px 8px; border: 1px solid #ccdae5; border-radius: 8px; font: inherit; font-size: 13px; }
.ec-good { color: #13804a !important; font-weight: 800; }
.ec-bad { color: #c62a2f !important; font-weight: 800; }
.ec-meta-card { padding: 20px; margin-bottom: 30px; display: grid; gap: 16px; }
.ec-meta-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.ec-meta-head small { color: #7d8895; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.ec-meta-head h3 { margin: 4px 0 6px; color: #182c45; font-size: 18px; }
.ec-meta-head p { margin: 0; max-width: 720px; color: #516277; font-size: 14px; line-height: 1.55; }
.ec-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ec-events li { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 9px; background: #f6fafd; border: 1px solid #e3ecf3; font-size: 13.5px; color: #43556a; }
.ec-events small { color: #7d8895; }
.ec-ev { justify-self: start; padding: 3px 8px; border-radius: 6px; font-size: 11px; letter-spacing: .04em; }
.ec-ev.lead { background: #e3eefb; color: #1d4ed8; }
.ec-ev.purchase { background: #d8f3e4; color: #13804a; }
.real-lead footer span { background: #1d6fe8 !important; color: #fff !important; }

@media (max-width: 900px) {
  .ec-upload-grid, .ec-review { grid-template-columns: 1fr; }
  .ec-photo { position: static; }
  .ec-photo img { max-height: 340px; }
  .ec-rp { grid-template-columns: 1fr; }
  .ec-rp-actions { justify-content: stretch; }
  .ec-rp-actions > * { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 520px) {
  .ec-card { padding: 16px; }
  .ec-item { grid-template-columns: 1fr; }
  .ec-item header span { margin-left: 0; width: 100%; }
  .ec-sale { grid-template-columns: 1fr; }
  .ec-drop { min-height: 200px; }
  .ec-events li { grid-template-columns: 1fr auto; }
}
/* Cabeçalho com um único bloco: não herdar o flex do grupo de botões do protótipo. */
.ec-view .section-heading > div:only-child, #recompraView .section-heading > div:only-child { display: block; }

/* ---------- Acesso por perfil ---------- */
/* Vendedor não vê faturamento nem gestão. É só visual: a proteção real exige servidor. */
html[data-role="vendedor"] .admin-only,
html[data-role="vendedor"] .ec-money,
html[data-role="vendedor"] #crmView .crm-summary,
html[data-role="vendedor"] .demo-bar { display: none !important; }
.list-tabs { display: none !important; }

.ec-team { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 18px; align-items: start; }
.ec-team-form { padding: 20px; }
.ec-team-form h3 { margin: 0 0 14px; color: #182c45; font-size: 17px; }
.ec-team-form form { display: grid; gap: 12px; }
.ec-team-list table { min-width: 620px; }
.ec-team-actions { white-space: nowrap; text-align: right; }
.ec-team-actions .row-action { margin-left: 12px; font-size: 13px; }
.ec-danger { color: #c62a2f !important; }
.ec-off td { opacity: .55; }
.ec-you { font-style: normal; margin-left: 6px; padding: 1px 7px; border-radius: 99px; background: #e3eefb; color: #1d4ed8; font-size: 11px; }
.ec-role { padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #eef3f8; color: #43556a; }
.ec-role.admin { background: #e3eefb; color: #1d4ed8; }
.ec-reset { display: inline-flex; gap: 8px; align-items: center; }
.ec-reset input { width: 140px; min-height: 34px; padding: 4px 8px; border: 1px solid #ccdae5; border-radius: 7px; font: inherit; font-size: 13px; }

/* Etiquetas no modelo do Painel Comercial: verde fechado, vermelho perdido, amarelo aguardando, azul etapas quentes. */
.ec-tag { display: inline-block; padding: 2px 8px; border-radius: 99px; background: #eef3f8; color: #516277; font-size: 10.5px; font-weight: 750; white-space: nowrap; }
.ec-tag.a { background: #e3eefb; color: #1d4ed8; }
.ec-tag.g { background: #d8f3e4; color: #13804a; }
.ec-tag.w { background: #fdf0d5; color: #9a5b00; }
.ec-tag.r { background: #fde2e2; color: #c62a2f; }
.ec-row-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; }
.ec-owner { margin-left: auto; min-width: 24px; height: 20px; padding: 0 5px; border-radius: 99px; display: grid; place-items: center; background: #1d6fe8; color: #fff; font-size: 9.5px; font-weight: 800; }
.ec-owner.queue { background: #eef3f8; color: #7d8895; }
.ec-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 11px 10px; border-bottom: 1px solid #e6edf2; }
.ec-filters select:first-child { grid-column: 1 / -1; }
.ec-filters select { min-width: 0; min-height: 36px; padding: 5px 8px; border: 1px solid #ccdae5; border-radius: 8px; background: #fff; color: #25374c; font: inherit; font-size: 12.5px; }
.ec-tagbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 9px 14px; border-bottom: 1px solid #e6edf2; background: #fbfdff; flex-shrink: 0; }
.ec-inline { display: flex; align-items: center; gap: 7px; color: #7d8895; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ec-inline b { color: #182c45; text-transform: none; letter-spacing: 0; font-size: 13px; }
.ec-inline .text-button { text-transform: none; letter-spacing: 0; font-size: 12px; }
.ec-inline select { min-height: 32px; padding: 3px 8px; border: 1px solid #ccdae5; border-radius: 8px; background: #fff; color: #25374c; font: inherit; font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 600; }
.ec-status-select.a { background: #e3eefb; color: #1d4ed8; border-color: #bcd3f3; }
.ec-status-select.g { background: #d8f3e4; color: #13804a; border-color: #b4e2c6; }
.ec-status-select.w { background: #fdf0d5; color: #9a5b00; border-color: #f2d59b; }
.ec-status-select.r { background: #fde2e2; color: #c62a2f; border-color: #f5b9b9; }
.ec-take { min-height: 32px !important; padding: 0 12px !important; font-size: 13px !important; text-transform: none; letter-spacing: 0; }
.ec-quick { display: flex; flex-wrap: wrap; gap: 5px; }
.ec-tag-toggle { padding: 4px 10px; border: 1px solid #dce6ee; border-radius: 99px; background: #fff; color: #516277; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.ec-tag-toggle:hover { border-color: #9fb9d3; }
.ec-tag-toggle.on { background: #1d6fe8; border-color: #1d6fe8; color: #fff; }
.ec-locked { margin: 0; color: #516277; font-size: 13px; }

@media (max-width: 900px) {
  .ec-team { grid-template-columns: 1fr; }
  .ec-rp-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ec-rp-search { grid-column: 1 / -1; }
  .ec-rp-filters .secondary-button { width: 100%; }
}
@media (max-width: 560px) {
  .ec-rp-filters { grid-template-columns: 1fr; }
  .ec-rp-search { grid-column: auto; }
}
.ec-locked-chat .messages, .ec-locked-chat .composer, .ec-locked-chat .reply-mode, .ec-locked-chat .chat-context { visibility: hidden; }
#equipeView .section-heading > div:only-child { display: block; }
