/* ===========================================================================
   Marcadores de conversa + respostas rápidas do CRM.
   =========================================================================== */

/* ------------------------------------------------------------- Marcadores */

.marcador-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: .74rem;
    font-weight: 600;
    /* A paleta do WhatsApp é clara; texto escuro lê melhor que branco. */
    color: #2b3a42;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.marcador-chip-sm {
    font-size: .66rem;
    padding: 1px 7px;
    max-width: 110px;
}

.marcador-chip-mais {
    background: #dfe5e7 !important;
    color: #54656f;
}

.marcador-chip .fa-exclamation-triangle {
    font-size: .62rem;
    color: #8a6d3b;
}

/* Chips no cabeçalho do chat */
.chat-cab-marcadores {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 4px 0;
}

/* Paleta do modal de cadastro */
.marcador-paleta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.marcador-cor {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    padding: 0;
    color: #2b3a42;
    font-size: .75rem;
    line-height: 1;
}

.marcador-cor.selecionada {
    border-color: #3b4a54;
    box-shadow: 0 0 0 2px rgba(59, 74, 84, .2);
}

/* Popover de etiquetar */
.marcador-lista {
    max-height: 320px;
    overflow-y: auto;
}

.marcador-lista-item {
    display: flex;
    align-items: center;
    width: 100%;
    border: none;
    background: transparent;
    padding: 6px 4px;
    border-radius: 6px;
    text-align: left;
}

.marcador-lista-item:hover {
    background: #f0f2f5;
}

/* -------------------------------------------------------- Respostas rápidas */

/* Sugestões do atalho "/" */
.rr-sugestoes {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
    margin-bottom: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.rr-sugestao {
    display: flex;
    align-items: center;
    width: 100%;
    border: none;
    background: transparent;
    padding: 8px 12px;
    border-bottom: 1px solid #f2f2f2;
}

.rr-sugestao:last-child { border-bottom: none; }
.rr-sugestao:hover,
.rr-sugestao.ativa { background: #f0f2f5; }

/* Cadastro: cards dos itens */
.rr-item-card {
    border: 1px solid #e4e6e9;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 8px;
    background: #fafbfc;
}

.rr-item-cab {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.rr-item-ordem {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #54656f;
    color: #fff;
    font-size: .7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.rr-item-tipo { width: auto; min-width: 120px; }

.rr-item-midia {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 6px;
    margin-bottom: 6px;
}

.rr-item-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 8px;
}

.rr-variaveis {
    max-height: 320px;
    overflow-y: auto;
    min-width: 320px;
}

/* Seletor no chat */
.rr-seletor-lista {
    border-right: 1px solid #e9ecef;
    padding-right: 10px;
    max-height: 420px;
    overflow-y: auto;
}

.rr-seletor-item {
    display: block;
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 4px;
}

.rr-seletor-item:hover { background: #f0f2f5; }
.rr-seletor-item.ativa { background: #e7f3ff; border-color: #b6d9ff; }

.rr-seletor-previa {
    padding-left: 12px;
    max-height: 420px;
    overflow-y: auto;
}

.rr-previa-item {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f2f2f2;
}

.rr-previa-item:last-child { border-bottom: none; }

.rr-previa-tipo {
    flex: 0 0 auto;
    width: 44px;
    font-size: .7rem;
    color: #667781;
    text-align: center;
}

.rr-previa-img {
    max-width: 140px;
    border-radius: 6px;
    margin-bottom: 4px;
    display: block;
}

/* Telas estreitas: o seletor vira uma coluna só */
@media (max-width: 767.98px) {
    .rr-seletor-lista {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        padding-right: 0;
        margin-bottom: 10px;
        max-height: 200px;
    }
    .rr-seletor-previa { padding-left: 0; }
}
