/* =============================================================
   EQUIPE
   -------------------------------------------------------------
   Outro lugar, e o olho tem que saber disso na hora. O chat do
   cliente é verde e sem lateral; aqui o balão é frio e a lateral
   existe. Confundir os dois — mandar para o cliente o que era para
   o colega — é o erro mais caro do painel, então a diferença é
   grande de propósito, não sutil.
============================================================= */

.eq-tela {
    display: grid; grid-template-columns: 264px 1fr;
    height: calc(100vh - 190px); min-height: 420px;
    border: 1px solid var(--border-soft); border-radius: 12px;
    overflow: hidden; background: var(--bg-elev);
}

/* ---------- A lateral ---------- */
.eq-lado {
    border-right: 1px solid var(--border-soft);
    overflow-y: auto; padding: 12px 10px;
    background: rgba(0, 0, 0, .18);
}

.eq-lado-topo {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 6px 6px;
    font-size: 11px; font-weight: 700; letter-spacing: .09em;
    text-transform: uppercase; color: var(--text-faint);
}
.eq-lado-topo .btn-icon { width: 24px; height: 24px; font-size: 11px; }

.eq-grupo { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }

.eq-canal {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 8px 9px; border-radius: 8px;
    border: 0; background: none; cursor: pointer; text-align: left;
    transition: background .14s ease;
}
.eq-canal:hover { background: rgba(255, 255, 255, .04); }
.eq-canal.ativo { background: rgba(255, 255, 255, .07); }

.eq-canal-icone {
    flex-shrink: 0;
    width: 28px; height: 28px; border-radius: 8px;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, .07);
    font-size: 12.5px; font-weight: 700; color: var(--text-dim);
}
.eq-canal-icone.grande { width: 34px; height: 34px; font-size: 14px; }

.eq-canal-txt { flex: 1; min-width: 0; }
.eq-canal-txt b {
    display: block; font-size: 12.5px; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.eq-canal-txt small {
    display: block; margin-top: 1px; font-size: 11px; color: var(--text-faint);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.eq-canal.ativo .eq-canal-txt b { color: var(--text-strong); }

.eq-conta {
    flex-shrink: 0;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; display: grid; place-items: center;
    background: var(--danger); color: #fff;
    font-size: 11px; font-weight: 700;
}

.eq-vazio { padding: 8px 9px; font-size: 11px; color: var(--text-faint); }

.eq-metas-botao {
    display: flex; align-items: center; gap: 8px; width: 100%;
    margin-top: 6px; padding: 10px; border-radius: 8px;
    border: 1px solid var(--border-soft); background: none;
    color: var(--text-dim); font-size: 11px; cursor: pointer;
}
.eq-metas-botao:hover { color: var(--text); border-color: var(--border-strong); }
.eq-metas-botao i { color: var(--accent); }

/* ---------- A conversa ---------- */
.eq-conversa { display: flex; flex-direction: column; min-width: 0; }

.eq-topo {
    display: flex; align-items: center; gap: 11px;
    padding: 12px 15px; border-bottom: 1px solid var(--border-soft);
}
.eq-topo-txt { flex: 1; min-width: 0; }
.eq-topo-txt b { display: block; font-size: 14px; color: var(--text-strong); }
.eq-topo-txt small { display: block; font-size: 11px; color: var(--text-faint); }
.eq-voltar { display: none; }

.eq-msgs {
    flex: 1; min-height: 0; overflow-y: auto;
    padding: 16px 15px; display: flex; flex-direction: column; gap: 3px;
}

.eq-dia { text-align: center; margin: 14px 0 10px; }
.eq-dia span {
    padding: 3px 11px; border-radius: 999px;
    background: rgba(255, 255, 255, .05);
    font-size: 11px; color: var(--text-faint);
}

.eq-linha { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 3px; }
.eq-linha.minha { flex-direction: row-reverse; }

.eq-avatar {
    flex-shrink: 0;
    width: 26px; height: 26px; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, .08);
    font-size: 11px; font-weight: 700; color: var(--text-dim);
}

.eq-balao {
    max-width: 74%;
    padding: 9px 12px; border-radius: 12px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--border-soft);
}
.eq-linha.minha .eq-balao {
    background: rgba(233, 192, 122, .12);
    border-color: rgba(233, 192, 122, .22);
}
.eq-balao.fixada { border-color: rgba(var(--warn-rgb), .4); }

.eq-autor {
    font-size: 11px; font-weight: 700; color: var(--accent); margin-bottom: 3px;
}
.eq-corpo {
    font-size: 12.5px; line-height: 1.5; color: var(--text);
    white-space: pre-wrap; word-break: break-word;
}
.eq-mencao { color: var(--accent); font-weight: 600; }
.eq-hora {
    margin-top: 3px; text-align: right;
    font-size: 11px; color: var(--text-faint);
}

/* O anexo do cliente: é isto que um grupo de WhatsApp não faz. */
.eq-anexo {
    display: flex; align-items: center; gap: 8px; width: 100%;
    margin-top: 7px; padding: 8px 10px; border-radius: 8px;
    border: 1px solid rgba(95, 224, 160, .25);
    background: rgba(95, 224, 160, .08);
    color: var(--success); font-size: 11px; font-weight: 600;
    cursor: pointer; text-align: left;
}
.eq-anexo span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eq-anexo:hover { background: rgba(95, 224, 160, .14); }
.eq-anexo i:last-child { font-size: 11px; }

/* ---------- Escrever ---------- */
.eq-escrever {
    display: flex; align-items: flex-end; gap: 8px;
    padding: 11px 13px calc(11px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border-soft);
}
.eq-escrever textarea {
    flex: 1; min-width: 0; resize: none;
    padding: 10px 13px; border-radius: 20px;
    border: 1px solid var(--border); background: var(--bg); color: var(--text);
    font-size: 12.5px; line-height: 1.4; font-family: inherit;
    max-height: 120px;
}
.eq-enviar {
    flex-shrink: 0;
    width: 38px; height: 38px; border-radius: 50%;
    border: 0; background: var(--accent); color: #101016;
    cursor: pointer; font-size: 12.5px;
}
.eq-enviar:active { transform: scale(.93); }

.eq-anexo-marca {
    display: flex; align-items: center; gap: 8px;
    margin: 0 13px; padding: 8px 11px;
    border-radius: 10px 10px 0 0;
    background: rgba(95, 224, 160, .1);
    font-size: 11px; color: var(--success);
}
.eq-anexo-marca button {
    margin-left: auto; background: none; border: 0;
    color: var(--text-faint); cursor: pointer; font-size: 11px;
}

.eq-vazio-grande {
    flex: 1; display: grid; place-content: center; text-align: center;
    gap: 6px; color: var(--text-faint); padding: 30px;
}
.eq-vazio-grande i { font-size: 30px; opacity: .35; }
.eq-vazio-grande b { font-size: 14px; color: var(--text-dim); }
.eq-vazio-grande p { font-size: 11px; margin: 0; }

/* ---------- Escolher cliente e metas ---------- */
.eq-escolher-card, .eq-metas-card {
    width: min(440px, 100%); max-height: 84vh; padding: 18px; overflow-y: auto;
}
.eq-escolher-topo {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
}
.eq-escolher-topo b { font-size: 14px; color: var(--text-strong); }
.eq-escolher-card p, .eq-metas-card > p {
    margin: 0 0 14px; font-size: 11px; line-height: 1.55; color: var(--text-faint);
}
.eq-escolher-lista { display: flex; flex-direction: column; gap: 5px; }
.eq-escolher {
    text-align: left; padding: 10px 12px; border-radius: 8px;
    border: 1px solid var(--border-soft); background: var(--bg-elev);
    cursor: pointer;
}
.eq-escolher b { display: block; font-size: 12.5px; color: var(--text); }
.eq-escolher small { display: block; font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); }
.eq-escolher:hover { border-color: var(--border-strong); }

.eq-metas-lista { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.eq-meta {
    position: relative;
    padding: 12px 13px; border-radius: 12px;
    border: 1px solid var(--border-soft); background: var(--bg-elev);
}
.eq-meta-topo {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 10px; margin-bottom: 8px;
}
.eq-meta-topo b { font-size: 12.5px; color: var(--text); }
.eq-meta-topo span { font-size: 11px; color: var(--text-faint); }
.eq-meta-barra {
    height: 6px; border-radius: 999px; overflow: hidden;
    background: rgba(255, 255, 255, .07);
}
.eq-meta-barra div {
    height: 100%; border-radius: 999px; background: var(--accent);
    transition: width .5s cubic-bezier(.3, 1, .4, 1);
}
.eq-meta-num {
    margin-top: 6px; font-size: 11px; color: var(--text-faint);
    font-variant-numeric: tabular-nums;
}
.eq-meta-num b { color: var(--text); }
.eq-meta-num span { float: right; }
.eq-meta-num span.bateu { color: var(--success); font-weight: 700; }
.eq-meta-x {
    position: absolute; top: 8px; right: 8px;
    background: none; border: 0; color: var(--text-faint);
    cursor: pointer; font-size: 11px; opacity: 0;
    transition: opacity .16s ease;
}
.eq-meta:hover .eq-meta-x { opacity: 1; }

.eq-meta-nova { display: flex; flex-direction: column; gap: 9px; }
.eq-meta-nova input, .eq-meta-nova select {
    padding: 9px 11px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--bg); color: var(--text);
    font-size: 12.5px;
}
.eq-meta-grade { display: grid; grid-template-columns: 1fr 90px 1fr; gap: 8px; }

/* ---------- Celular ---------- */
@media (max-width: 900px) {
    .eq-tela { grid-template-columns: 1fr; height: calc(100vh - 210px); }
    .eq-lado { border-right: 0; }
    .eq-lado.escondido { display: none; }
    .eq-lado.escondido + .eq-conversa { display: flex; }
    .eq-lado:not(.escondido) + .eq-conversa { display: none; }
    .eq-voltar { display: inline-flex; }
    .eq-balao { max-width: 84%; }
    .eq-meta-grade { grid-template-columns: 1fr; }
}
