﻿/* Grille responsive: empilement correct */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* auto-fit pour supprimer les colonnes vides */
    gap: 18px 20px;
    width: 100%;
    grid-auto-flow: row;
}

@media (min-width: 1300px) {
    .analytics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Cartes comptes */
.account-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--backgroundBoutonMenuDashboard);
    border: var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    text-decoration: none;
    color: inherit;
    min-height: 92px;
    gap: 6px;
    /* permet au contenu de rétrécir sans forcer la largeur de la colonne */
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
}

    .account-card:hover {
        border-color: var(--color2);
        transform: translateY(-1px);
        box-shadow: 0 2px 10px rgb(0 0 0 / .12);
        text-decoration: none;
    }

    .account-card:active {
        transform: translateY(0);
    }

/* Blocs internes: pas de largeur minimale bloquante */
.acc-head,
.acc-meta,
.acc-foot {
    min-width: 0;
}

.acc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.acc-title {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.acc-sub {
    font-size: .85rem;
    opacity: .8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.badge {
    font-size: .72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--color2);
    background: color-mix(in oklab, var(--bg) 90%, transparent);
}

    .badge.dis {
        border-color: #f31260;
    }

    .badge.new {
        border-color: var(--color1);
    }

.acc-meta {
    display: flex;
    gap: 10px;
    margin-top: 2px;
    font-size: .86rem;
    opacity: .9;
    flex-wrap: wrap;
}

    .acc-meta .k {
        opacity: .7;
        margin-right: 4px;
    }

.acc-foot {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

    .metric .lbl {
        font-size: .72rem;
        opacity: .7;
    }

    .metric .val {
        font-weight: 800;
        font-size: 1rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.pnl.pos {
    color: #17c964;
}
/* vert */
.pnl.neg {
    color: #f31260;
}
/* rouge */