/* =========================================================
   PÓDIO VAZIO — CONSULTOR
========================================================= */

.facilite-dashboard-podio-desafio {
    align-items: flex-end;
}

.facilite-podio-desafio-item {
    text-align: center;
}

.facilite-podio-desafio-item .facilite-podio-avatar {
    margin-bottom: 10px;
}

.facilite-podio-desafio-item .facilite-podio-avatar img {
    display: block;
    width: 140px;
    height: 140px;
    object-fit: contain;
}

.facilite-podio-desafio-item.facilite-podio-1 .facilite-podio-avatar img {
    width: 155px;
    height: 155px;
}

.facilite-podio-desafio-titulo {
    margin-top: 4px;
    font-size: 16px;
    font-weight: 700;
    color: #00205B;
}

.facilite-podio-desafio-texto {
    margin-top: 2px;
    font-size: 14px;
    font-weight: 600;
    color: #FF7A00;
}

/* Dashboard */

.facilite-dashboard {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 36px 14px 16px;
    box-sizing: border-box;
}

.facilite-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(5, 240px);
    gap: 18px;
    align-items: start;
    justify-content: start;
}

/* Ranking — 3 colunas */

.facilite-dashboard-ranking-page .facilite-dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.facilite-dashboard-card {
    background: #F5F7FA;
    border: 1px solid #DCE3EC;
    border-radius: 16px;
    padding: 12px;
    box-sizing: border-box;
}

.facilite-dashboard-card-header {
    margin-bottom: 8px;
}

.facilite-dashboard-card-header h2 {
    margin: 0;
    color: #00205B;
    font-size: 1.35rem;
    font-weight: 700;
}

.facilite-dashboard-card-header span {
    display: block;
    margin-top: 4px;
    color: #6B7280;
    font-size: 0.9rem;
}

.facilite-dashboard-subheader {
    margin: 20px 0 12px;
}

.facilite-dashboard-subheader h3 {
    margin: 0;
    color: #00205B;
    font-size: 1.05rem;
    font-weight: 700;
}

.facilite-dashboard-separator {
    height: 1px;
    margin: 22px 0;
    background: #E5E7EB;
}

.facilite-dashboard-ranking-head,
.facilite-dashboard-ranking-row {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 64px 64px;
    gap: 8px;
    align-items: center;
}

.facilite-dashboard-ranking-consultores > span:nth-child(n+3),
.facilite-dashboard-ranking-equipa > span:nth-child(n+3),
.facilite-dashboard-ranking-membros > span:nth-child(n+3) {
    text-align: center;
}

.facilite-dashboard-ranking-agencias-mensal,
.facilite-dashboard-ranking-agencias-estatisticas {
    grid-template-columns: 42px minmax(0, 1fr) 70px 70px 52px;
}
.facilite-dashboard-ranking-agencias-mensal > span:first-child,
.facilite-dashboard-ranking-agencias-estatisticas > span:first-child {
    text-align: center;
}

.facilite-dashboard-ranking-agencias-mensal > span:nth-child(2),
.facilite-dashboard-ranking-agencias-estatisticas > span:nth-child(2) {
    text-align: left;
}

.facilite-dashboard-ranking-agencias-mensal > span:nth-child(n+3),
.facilite-dashboard-ranking-agencias-estatisticas > span:nth-child(n+3) {
    text-align: center;
}

.facilite-dashboard-ranking-head {
    padding: 0 0 8px;
    color: #6B7280;
    font-size: 0.8rem;
    font-weight: 600;
}

.facilite-dashboard-ranking-row {
    padding: 2px 0;
    border-top: 1px solid #EEF1F5;
}

.facilite-ranking-nome {
    min-width: 0;
}

.facilite-ranking-nome strong,
.facilite-ranking-nome small {
    display: block;
}

.facilite-ranking-nome strong {
    color: #00205B;
}

.facilite-ranking-nome small {
    margin-top: 0px;
    color: #6B7280;
    font-size: 0.78rem;
}

.facilite-ranking-posicao,
.facilite-ranking-valor {
    text-align: center;
    font-weight: 600;
}

.facilite-dashboard-totais {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.facilite-dashboard-total-icon {
    color: #FF7A00;
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.facilite-dashboard-total {
    padding: 18px 12px;
    border-radius: 12px;
    background: #F5F7FA;
    text-align: center;
}

.facilite-dashboard-total-label,
.facilite-dashboard-total small {
    display: block;
}

.facilite-dashboard-total strong {
    display: block;
    margin: 4px 0;
    color: #00205B;
    font-size: 2rem;
}

.facilite-dashboard-total-label {
    color: #6B7280;
    font-size: 0.85rem;
    font-weight: 600;
}

.facilite-dashboard-total small {
    color: #6B7280;
    font-size: 0.78rem;
}

@media (max-width: 900px) {

    .facilite-dashboard {
        padding: 20px 16px 36px;
    }

    .facilite-dashboard-grid,
    .facilite-dashboard-ranking-page .facilite-dashboard-grid {
        grid-template-columns: 1fr;
    }

}

/* =========================================================
   DASHBOARD — TOP 3 CONSULTORES
========================================================= */
.facilite-top3-consultores-page {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.facilite-top3-consultores-page .facilite-dashboard-podio {
    width: 100%;
    margin-top: auto;
}

.facilite-dashboard-podio {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    gap: 28px;
    align-items: end;
    
    max-width: none;
    margin: 0 auto 0;
    padding: 0 6px 0;

    border-bottom: 1px solid #E5E7EB;
}

.facilite-top3-consultores-page,
.facilite-top3-equipas-page {
    padding-bottom: 0;
}

.facilite-podio-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;

    min-width: 0;
    text-align: center;
}

.facilite-podio-1 {
    order: 2;
}

.facilite-podio-2 {
    order: 1;
}

.facilite-podio-3 {
    order: 3;
}

/* A posição deixa de aparecer por cima da fotografia */
.facilite-podio-posicao {
    display: none;
}

/* Fotografias / avatar */
.facilite-podio-avatar {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 140px;
    height: 140px;

    margin: 0 auto 10px;

    overflow: hidden;

    border: 3px solid #D1D5DB;
    border-radius: 50%;

    background: #FFFFFF;
    color: #6B7280;

    font-size: 48px;
}

.facilite-podio-1 .facilite-podio-avatar {
    width: 155px;
    height: 155px;

    border: 4px solid #FF7A00;
}

.facilite-podio-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Nome */
.facilite-podio-nome {
    overflow: hidden;

    color: #00205B;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;

    text-overflow: ellipsis;
}

.facilite-podio-1 .facilite-podio-nome {
    font-size: 1.3rem;
}

/* Agência */
.facilite-podio-agencia {
    margin-top: 0px;
    margin-bottom: 8px;

    overflow: hidden;

    color: #6B7280;
    font-size: 0.85rem;
    line-height: 1.2;

    text-overflow: ellipsis;
}

/* Degraus */
.facilite-podio-item::after {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;

    background: #FF7A00;
    color: #FFFFFF;

    font-weight: 700;
    line-height: 1;
}

.facilite-podio-2::after {
    content: "2";
    height: 60px;
    font-size: 2rem;
}

.facilite-podio-1::after {
    content: "1";
    height: 100px;
    font-size: 2.5rem;
}

.facilite-podio-3::after {
    content: "3";
    height: 40px;
    font-size: 1.8rem;
}

/*
 * Mobile Consultores — mantém o comportamento anterior:
 * sem degraus e com a posição por cima.
 */
@media (max-width: 768px) {
.facilite-top3-consultores-page {
    min-height: 0;
    display: block;
}

.facilite-top3-consultores-page .facilite-dashboard-podio {
    width: 100%;
    margin-top: 0;
}

    .facilite-dashboard-podio {
        grid-template-columns: 1fr;
        gap: 18px;
        min-height: 0;
    }

    .facilite-podio-1 {
        order: 1;
    }

    .facilite-podio-2 {
        order: 2;
    }

    .facilite-podio-3 {
        order: 3;
    }

    .facilite-podio-posicao {
        display: block;

        margin-bottom: 4px;

        color: #FF7A00;
        font-weight: 700;
    }

    .facilite-podio-item::after {
        display: none;
    }
}

/* =========================================================
   DASHBOARD — TOP 3 EQUIPAS
========================================================= */
.facilite-top3-equipas-page {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.facilite-top3-equipas-page .facilite-dashboard-podio-equipas {
    width: 100%;
    margin-top: auto;
}

.facilite-podio-equipas-data {
    margin-top: 4px;
    color: #6B7280;
    font-size: 0.95rem;
}

/* Pódio + informação */
.facilite-dashboard-podio-equipas {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    gap: 28px;
    align-items: end;

    width: 100%;
    margin: 0 auto;
    padding: 0 6px 0;

    border-bottom: 1px solid #E5E7EB;
}

.facilite-dashboard-podio-equipas .facilite-podio-equipa-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;

    min-width: 0;
    text-align: center;
}

.facilite-podio-equipa-1 {
    order: 2;
}

.facilite-podio-equipa-2 {
    order: 1;
}

.facilite-podio-equipa-3 {
    order: 3;
}

.facilite-podio-equipa-posicao {
    display: none;
}

/* Avatar */
.facilite-podio-equipa-avatar {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 140px;
    height: 140px;

    margin: 0 auto 10px;

    overflow: hidden;

    border: 3px solid #D1D5DB;
    border-radius: 50%;

    color: #6B7280;
    font-size: 1.75rem;
}

.facilite-podio-equipa-1 .facilite-podio-equipa-avatar {
    width: 155px;
    height: 155px;

    border: 4px solid #FF7A00;

}

.facilite-podio-equipa-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.facilite-podio-equipa-nome {
    margin-bottom: 0px;

    color: #00205B;
    font-size: 1rem;
    font-weight: 700;
}

.facilite-podio-equipa-1 .facilite-podio-equipa-nome {
    font-size: 1.3rem;
}

.facilite-podio-equipa-agencia {
    margin-top: 0px;
    margin-bottom: 8px;

    overflow: hidden;

    color: #6B7280;
    font-size: 0.85rem;
    line-height: 1.2;

    text-overflow: ellipsis;
}

/* Degraus */
.facilite-podio-equipa-item::after {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;

    background: #FF7A00;
    color: #FFFFFF;

    font-weight: 700;
    line-height: 1;
}

.facilite-podio-equipa-2::after {
    content: "2";
    height: 60px;
    font-size: 2rem;
}

.facilite-podio-equipa-1::after {
    content: "1";
    height: 100px;
    font-size: 2.5rem;
}

.facilite-podio-equipa-3::after {
    content: "3";
    height: 40px;
    font-size: 1.8rem;
}

/* Caixa informativa */
.facilite-podio-equipas-info,
.facilite-podio-consultores-info {
    grid-column: 1;
    grid-row: 2;

    width: 100%;
    margin-top: 8px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;

    min-height: 0;
    padding: 16px 22px;
    box-sizing: border-box;

    background: #F5F7FA;
    border-radius: 12px;

    color: #00205B;
}

.facilite-podio-equipas-info-icon,
.facilite-podio-consultores-info-icon {
    flex: 0 0 auto;

    color: #FF7A00;
    font-size: 2.5rem;
    line-height: 1;
}

.facilite-podio-equipas-info-texto,
.facilite-podio-consultores-info-texto {
    font-size: 1rem;
    line-height: 1.55;
}

/*
 * Mobile Equipas — mantém o comportamento anterior:
 * sem degraus e com a posição por cima.
 */
@media (max-width: 768px) {
    .facilite-dashboard-podio-equipas {
        display: flex;
        flex-direction: column;
        gap: 18px;
        min-height: 0;
        padding-bottom: 0;
    }
    
    .facilite-podio-equipa-1 {
    order: 1;
    }
    
    .facilite-podio-equipa-2 {
        order: 2;
    }
    
    .facilite-podio-equipa-3 {
        order: 3;
    }

    .facilite-dashboard-podio-equipas .facilite-podio-equipa-item {
        width: 100%;
        min-height: auto;
    }

    .facilite-podio-equipa-posicao {
        display: block;
        margin-bottom: 4px;

        color: #FF7A00;
        font-weight: 700;
    }

    .facilite-podio-equipa-item::after {
        display: none;
    }

    .facilite-podio-equipas-info,
    .facilite-podio-consultores-info {
        width: 100%;
        min-height: auto;
        align-self: stretch;
    }
}
/* =========================================================
   DASHBOARD — TOOLTIPS
   ========================================================= */

.facilite-dashboard-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: help;
}

.facilite-dashboard-tooltip > i {
    color: #6B7280;
    font-size: 0.8rem;
}

.facilite-dashboard-tooltip-texto {
    position: absolute;
    z-index: 100;

    width: 280px;
    padding: 12px 14px;

    background: #00205B;
    color: #FFFFFF;
    border-radius: 8px;

    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;

    bottom: calc(100% + 8px);
    right: 0;

    visibility: hidden;
    opacity: 0;
    pointer-events: none;

    transition: opacity 0.15s ease;
}

.facilite-dashboard-tooltip:hover .facilite-dashboard-tooltip-texto {
    visibility: visible;
    opacity: 1;
}

/* =========================================================
   DESEMPENHO DO CONSULTOR
   ========================================================= */
/* Coluna Dif. */
.facilite-performance-table th:nth-child(4),
.facilite-performance-table td:nth-child(4) {
    background: #FFF3D6;
}

.facilite-performance-table thead th:nth-child(4) {
    color: #FF7A00;
}

.facilite-performance-dif.positiva {
    color: #15803D;
}

.facilite-performance-dif.neutra {
    color: #00205B;
}

.facilite-performance-dif.negativa {
    color: #D92D20;
}

.facilite-performance-total th,
.facilite-performance-total td {
    font-weight: 700;
    color: #FF7A00;
    background: #FFF3D6;
}

.facilite-performance-card {
    overflow-x: auto;
}

.facilite-performance h3 {
    margin: 0 0 22px;
}

.facilite-performance-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
}

.facilite-performance-table th,
.facilite-performance-table td {
    padding: 9px 8px;
    border: 1px solid #D7DEE8;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.facilite-performance-table thead th {
    background: #F5F7FA;
    color: #00205B;
    font-weight: 700;
}

.facilite-performance-table tbody th {
    background: #F5F7FA;
    color: #00205B;
    font-weight: 700;
    text-align: left;
}

.facilite-performance-table td {
    color: #00205B;
}

.facilite-performance-table .facilite-performance-dif {
    font-weight: 700;
}

.facilite-performance-table .facilite-performance-dif.negativa {
    color: #D92D20;
}

/* =========================================================
   TÍTULO DAS PÁGINAS DE B.I.
   ========================================================= */

.facilite-dashboard-page-header {
    margin: 24px 0 8px;
    text-align: center;
}

.facilite-dashboard-page-header h1 {
    margin: 0;
    color: #FF7A00;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

/* =========================================================
   DASHBOARD — MÓDULOS
   ========================================================= */

.facilite-dashboard-module {
    background: #F5F7FA;
    border-radius: 10px;
    padding: 20px;
    box-sizing: border-box;
}

.facilite-dashboard-module h2 {
    margin: 0 0 18px;
    color: #00205B;
    font-size: 20px;
    font-weight: 700;
}


/* =========================================================
   DASHBOARD — ESTE MÊS
   ========================================================= */

.facilite-dashboard-module-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.facilite-dashboard-metric {
    text-align: center;
}

.facilite-dashboard-metric strong {
    display: block;
    color: #FF7A00;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 6px;
}

/* Team Leader — resultado próprio + equipa */

.facilite-dashboard-metric-team-leader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.facilite-dashboard-metric-eu,
.facilite-dashboard-metric-equipa {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.facilite-dashboard-metric-eu strong {
    font-size: 36px;
    margin-bottom: 0;
}

.facilite-dashboard-metric-eu span {
    font-size: 18px;
}

.facilite-dashboard-metric-equipa strong {
    color: #6B7280;
    font-size: 18px;
    margin-bottom: 0;
}

.facilite-dashboard-metric-equipa span {
    font-size: 14px;
}
.facilite-dashboard-metric span {
    display: block;
    color: #6B7280;
    font-size: 14px;
    line-height: 1.3;
}

@media (max-width: 768px) {

    .facilite-dashboard-module-content {
        grid-template-columns: 1fr;
    }

}

/* =========================================================
   DASHBOARD — UTILIZADOR
   ========================================================= */

.facilite-dashboard-user {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.facilite-dashboard-user-photo {
    flex: 0 0 auto;
}

.facilite-dashboard-user-photo img {
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
}

.facilite-dashboard-user-info {
    min-width: 0;
}

.facilite-dashboard-user-name {
    display: block;
    margin-bottom: 5px;
    color: #00205B;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.facilite-dashboard-user-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    color: #6B7280;
    font-size: 18px;
}

.facilite-dashboard-user-meta > * + *::before {
    content: "·";
    margin: 0 10px;
    color: #6B7280;
    font-weight: 400;
}

/* =========================================================
   DASHBOARD — MÓDULO 2 × 2
   ========================================================= */

.facilite-dashboard-module {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    aspect-ratio: 1 / 1;

    width: 100%;
    max-width: 240px;

    padding: 0;
    overflow: hidden;

    background: #F5F7FA;
    border: 1px solid #DCE3EC;
    border-radius: 10px;
}

.facilite-dashboard-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-width: 0;
    min-height: 0;
    padding: 12px;
    box-sizing: border-box;

    text-align: center;
}

.facilite-dashboard-cell:nth-child(odd) {
    border-right: 1px solid #DCE3EC;
}

.facilite-dashboard-cell:nth-child(-n+2) {
    border-bottom: 1px solid #DCE3EC;
}

.facilite-dashboard-cell-title {
    color: #00205B;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.15;
}

.facilite-dashboard-cell-title span {
    display: block;
}

.facilite-dashboard-cell-metric strong {
    display: block;
    margin-bottom: 6px;

    color: #FF7A00;
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

.facilite-dashboard-cell-metric span {
    display: block;

    color: #6B7280;
    font-size: 14px;
    line-height: 1.3;
}

/* Ícone do módulo */

.facilite-dashboard-cell-icon {
    color: #FF7A00;
    font-size: 42px;
    line-height: 1;
}

/* Informação complementar do módulo */

.facilite-dashboard-cell-info strong {
    display: block;
    margin-bottom: 6px;

    color: #00205B;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.1;
}

.facilite-dashboard-cell-info span {
    display: block;

    color: #6B7280;
    font-size: 14px;
    line-height: 1.3;
}

/* =========================================================
   DASHBOARD — SECÇÕES
   ========================================================= */

.facilite-dashboard-section-title {
    margin: 24px 0 12px;

    color: #00205B;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.facilite-dashboard-no-data {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
}
