/* ===========================================================================
   O mini app do CRM na home (_assets/js/miniapps/crm.js): as atividades do dia, o funil das minhas oportunidades e
   o resumo do bloco pequeno. O cartão do bloco, o topo e os pedaços comuns dos mini apps são do home.css.
   =========================================================================== */

.pg .hm-crm{
    display: flex;
    flex: 1;
    gap: 16px;
    min-height: 0;
}

.pg .hm-crm-dia{
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.pg .hm-crm-numeros{
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.pg .hm-crm-numeros .fx-etiqueta{
    padding: 2px 10px;
    font-size: 0.76rem;
}

.pg .hm-crm-hoje{
    --fx-cor: var(--fx-primary);
}

.pg .hm-crm-atraso{
    --fx-cor: var(--fx-error);
}

.pg .hm-crm-lista{
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
    scrollbar-width: thin;
}

.pg .hm-crm-item > a,
.pg .hm-crm-item > span{
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 5px 4px;
    border-radius: 10px;
    color: var(--fx-text);
    text-decoration: none;
}

.pg .hm-crm-item > a:hover{
    background: var(--fx-surface);
}

.pg .hm-crm-item > a:focus-visible{
    outline: 3px solid color-mix(in srgb, var(--fx-primary) 45%, transparent);
}

/* o tipo da atividade: o ícone num círculo, na cor do tipo (o texto vem na linha de baixo, nunca só a cor) */
.pg .hm-crm-tipo{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--hm-crm-cor) 14%, transparent);
    color: var(--hm-crm-cor);
    --hm-crm-cor: var(--fx-primary);
}

.pg .hm-crm-tipo-M{
    --hm-crm-cor: var(--fx-success);
}

.pg .hm-crm-tipo-V{
    --hm-crm-cor: var(--fx-warning);
}

.pg .hm-crm-texto{
    min-width: 0;
}

.pg .hm-crm-nome,
.pg .hm-crm-etapa{
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pg .hm-crm-nome{
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.25;
}

.pg .hm-crm-etapa{
    color: var(--fx-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.pg .hm-crm-hora{
    color: var(--fx-muted);
    font-size: 0.8rem;
    font-weight: 800;
    text-align: right;
}

.pg .hm-crm-hora small{
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
}

.pg .hm-crm-atrasada .hm-crm-hora{
    color: var(--fx-error);
}

.pg .hm-crm-passou .hm-crm-hora{
    color: var(--fx-warning);
}

.pg .hm-crm-mais{
    margin: 6px 0 0 0;
    color: var(--fx-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.pg .hm-crm-rodape{
    display: flex;
    gap: 8px;
    margin: 10px 0 0 0;
}

/* ---- o funil das minhas oportunidades (bloco grande) ---- */
.pg .hm-crm-funil-nome{
    margin: -2px 0 8px 0;
    overflow: hidden;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pg .hm-crm-funil{
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-height: 0;
    overflow-y: auto;
}

.pg .hm-crm-etapa-linha{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 8px;
    font-size: 0.8rem;
    font-weight: 700;
}

.pg .hm-crm-etapa-linha > span:first-child{
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pg .hm-crm-etapa-linha b{
    font-weight: 900;
}

.pg .hm-crm-barra{
    grid-column: 1 / -1;
    height: 8px;
    overflow: hidden;
    border-radius: 4px;
    background: var(--fx-surface-alto);
}

.pg .hm-crm-barra span{
    display: block;
    height: 100%;
    border-radius: 4px;
    background: var(--fx-primary);
}

.pg .hm-crm-total{
    margin: auto 0 0 0;
    padding-top: 8px;
    color: var(--fx-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

/* ---- o resumo (bloco pequeno) ---- */
.pg .hm-crm-curto{
    display: flex;
    flex: 1;
    align-items: center;
    gap: 12px;
    min-height: 0;
}

.pg .hm-crm-curto a{
    text-decoration: none;
}

.pg .hm-crm-curto strong{
    color: var(--fx-primary);
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1;
}

.pg .hm-crm-curto > span{
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.3;
}

.pg .hm-crm-curto b{
    display: block;
    color: var(--fx-error);
    font-weight: 800;
}
