/* =============================================================================
   WIDGET TABLEAU DE BORD COMMERCIAL
   =============================================================================
   - Salutation à gauche ("Bonjour" + prénom en gras dessous)
   - Funnel horizontal compact, fond blanc, sans bordures verticales
   - Variation +5,1 % à droite du CA (sur la même ligne)
   - Ligne 2 : actions en cours (compact horizontal)
   - Tout cliquable, mais SANS effet hover (sobre)
   - Police minimale : 14px partout
   ============================================================================= */


/* -----------------------------------------------------------------------------
   LIGNE 1 — FUNNEL HORIZONTAL
   ----------------------------------------------------------------------------- */

.commerce-funnel {
    display: grid;
    grid-template-columns:
        minmax(120px, 0.8fr)             /* salutation */
        minmax(110px, 1fr)               /* pipeline */
        repeat(5, minmax(85px, 1fr))     /* 5 étapes */
        minmax(180px, 1.6fr);            /* CA */
    gap: 0;
    align-items: stretch;
    padding: 14px 4px;
    background: #fff;
}

.commerce-funnel-cell {
    padding: 6px 18px;
    text-align: left;
    position: relative;
    display: block;
    color: inherit;
    text-decoration: none;
    /* Pas d'effet hover — délibérément sobre */
}

/* On retire toutes les bordures verticales pour un rendu plus aéré */


/* SALUTATION ----------------------------------------------------------------- */

.commerce-funnel-cell.is-greeting {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

.commerce-greeting-hello {
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text-secondary, #4b5563);
    line-height: 1.2;
}

.commerce-greeting-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text, #1a1a1a);
    line-height: 1.2;
    margin-top: 2px;
}


/* LABELS ÉTAGES ------------------------------------------------------------- */

.commerce-funnel-label {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-light, #9ca3af);
    margin-bottom: 4px;
}

.commerce-funnel-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-text, #111);
}

.commerce-funnel-cell.is-stage .commerce-funnel-value {
    font-size: 22px;
}

/* Sortie du tunnel : CA + variation alignés sur la même ligne */
.commerce-funnel-cell.is-output .commerce-funnel-value {
    font-size: 22px;
    white-space: nowrap;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.commerce-funnel-variation {
    /* Conteneur pour la pilule de variation à droite du montant */
    display: inline-flex;
    align-items: center;
}


.commerce-funnel-sub {
    font-size: 14px;
    color: var(--color-text-muted, #6b7280);
    margin-top: 4px;
    line-height: 1.3;
}

.commerce-funnel-vs {
    color: var(--color-text-light, #9ca3af);
    font-size: 14px;
}

/* Couleurs des stages */
.commerce-funnel-cell.is-prospect  .commerce-funnel-value { color: #5F5E5A; }
.commerce-funnel-cell.is-qualified .commerce-funnel-value { color: #185FA5; }
.commerce-funnel-cell.is-hot       .commerce-funnel-value { color: #BA7517; }
.commerce-funnel-cell.is-won       .commerce-funnel-value { color: #0F6E56; }
.commerce-funnel-cell.is-lost      .commerce-funnel-value { color: #A32D2D; }


/* MONTANTS — "HT" en petit après le € -------------------------------------- */

.amount-unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted, #9ca3af);
    letter-spacing: 0.02em;
    margin-left: 3px;
}


/* TREND PILL ---------------------------------------------------------------- */

.trend-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 14px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 10px;
    line-height: 1.2;
    white-space: nowrap;
}

.trend-pill.is-up   { color: #0F6E56; background: rgba(15, 110, 86, 0.10); }
.trend-pill.is-down { color: #A32D2D; background: rgba(163, 45, 45, 0.10); }


/* -----------------------------------------------------------------------------
   LIGNE 2 — ACTIONS COMMERCIALES (Offres / Retards / Relances)
   ----------------------------------------------------------------------------- */

.commerce-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-top: 8px;
    padding: 10px 4px 8px;
    border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.06));
    background: #fff;
}

.commerce-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 18px;
    text-decoration: none;
    color: inherit;
    /* Pas d'effet hover */
}

.commerce-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.04);
    color: var(--color-text-muted, #6b7280);
    flex-shrink: 0;
}

.commerce-action.is-warning .commerce-action-icon {
    background: rgba(186, 117, 23, 0.12);
    color: #BA7517;
}

.commerce-action-body {
    flex: 1;
    min-width: 0;
}

.commerce-action-label {
    font-size: 14px;
    color: var(--color-text-secondary, #4b5563);
    margin-bottom: 2px;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.3;
}

.commerce-action-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text, #111);
    line-height: 1.2;
}

.commerce-action-meta {
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text-light, #9ca3af);
    margin-left: 4px;
}


/* -----------------------------------------------------------------------------
   RESPONSIVE
   ----------------------------------------------------------------------------- */

@media (max-width: 1100px) {
    .commerce-funnel {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    .commerce-funnel-cell {
        padding: 8px 10px;
        border-radius: 6px;
    }
    .commerce-funnel-cell.is-greeting { grid-column: span 4; }
    .commerce-funnel-cell.is-output   { grid-column: span 4; text-align: left; }
    .commerce-funnel-cell.is-output .commerce-funnel-value {
        justify-content: flex-start;
    }
}

@media (max-width: 700px) {
    .commerce-funnel {
        grid-template-columns: repeat(2, 1fr);
    }
    .commerce-funnel-cell.is-greeting,
    .commerce-funnel-cell.is-output { grid-column: span 2; }

    .commerce-actions {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}
