.chart-container {
    position: relative;
    height: 300px;
}

.kpi-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.kpi-card:hover::before {
    opacity: 1;
}

.kpi-card.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.kpi-card.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.kpi-card.info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Amélioration du contenu des KPIs */
.kpi-card .card-body {
    padding: 1.5rem 1rem !important;
    position: relative;
    z-index: 2;
}

.kpi-card .kpi-value {
    font-size: 2.2rem !important; /* Beaucoup plus petit que display-4 */
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.kpi-card .kpi-label {
    font-size: 0.9rem !important;
    font-weight: 500;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

.kpi-card .kpi-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    opacity: 0.3;
}

/* Version encore plus compacte pour mobile */
@media (max-width: 768px) {
    .kpi-card .kpi-value {
        font-size: 1.8rem !important;
    }

    .kpi-card .kpi-label {
        font-size: 0.8rem !important;
    }

    .kpi-card .card-body {
        padding: 1rem 0.75rem !important;
    }
}

/* Variante ultra-compacte si besoin */
.kpi-compact .kpi-value {
    font-size: 1.6rem !important;
}

.kpi-compact .kpi-label {
    font-size: 0.8rem !important;
}

.kpi-compact .card-body {
    padding: 1rem !important;
}

.dashboard-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    }
}

.training-row h6 {
    font-size: 0.95rem !important; /* Réduction du titre */
    font-weight: 600;
    margin-bottom: 2px;
}

.training-row small {
    font-size: 0.75rem !important; /* Sous-titre plus petit */
}

.table th {
    font-size: 0.85rem !important; /* En-têtes plus petits */
    font-weight: 600;
    padding: 0.75rem 1rem;
}

.table td {
    font-size: 0.85rem !important; /* Cellules plus petites */
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.badge {
    font-size: 0.75rem !important; /* Badges plus petits */
    font-weight: 500;
    padding: 0.4rem 0.8rem;
}

.btn-sm {
    font-size: 0.75rem !important; /* Boutons plus petits */
    padding: 0.25rem 0.75rem;
}

/* Icône plus petite */
.training-icon {
    width: 35px;
    height: 35px;
    font-size: 0.85rem;
}

.training-icon i {
    font-size: 1rem; /* Taille d'icône ajustée */
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .training-row h6 {
        font-size: 0.85rem !important;
    }

    .training-row small {
        font-size: 0.7rem !important;
    }

    .table th,
    .table td {
        font-size: 0.8rem !important;
        padding: 0.5rem 0.75rem;
    }

    .badge {
        font-size: 0.7rem !important;
        padding: 0.3rem 0.6rem;
    }
}

/* Version encore plus compacte si nécessaire */
.compact-table .training-row h6 {
    font-size: 0.85rem !important;
    margin-bottom: 1px;
}

.compact-table .training-row small {
    font-size: 0.7rem !important;
}

.compact-table .table th,
.compact-table .table td {
    font-size: 0.8rem !important;
    padding: 0.5rem 0.75rem;
}

/* =========================================================================
   Classement gamifié des appels (« arène » : podium 3 places + liste)
   Scope : .call-lb — markup dans templates/call_log/_leaderboard.html.twig
   ========================================================================= */
.call-lb {
    --lb-gold: #ffcf4d;
    --lb-silver: #d7dde8;
    --lb-bronze: #e0a06a;
}

/* --- Sélecteur de période (segmented control) --- */
.call-lb__periods {
    display: flex;
    gap: 2px;
    width: max-content;
    margin: 0 auto 1rem;
    padding: 3px;
    background: rgba(94, 110, 130, 0.1);
    border-radius: 999px;
}

.call-lb__period {
    border: 0;
    background: transparent;
    color: #5e6e82;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0.3rem 0.95rem;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.call-lb__period:hover {
    color: #232e3c;
}

.call-lb__period.is-active {
    background: #fff;
    color: #2c7be5;
    box-shadow: 0 2px 5px rgba(43, 47, 64, 0.16);
}

/* --- La scène (fond sombre premium) --- */
.call-lb__podium {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.3rem 0.6rem 1rem;
    border-radius: 16px;
    overflow: hidden;
    background:
        radial-gradient(125% 90% at 50% -15%, rgba(124, 108, 255, 0.4), transparent 60%),
        linear-gradient(160deg, #1d2342 0%, #2b2858 55%, #3a2f63 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 14px 30px -16px rgba(29, 35, 66, 0.7);
}

/* fines paillettes en fond */
.call-lb__podium::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1.5px 1.5px at 20% 30%, rgba(255, 255, 255, 0.5), transparent 100%),
        radial-gradient(1.5px 1.5px at 75% 18%, rgba(255, 255, 255, 0.35), transparent 100%),
        radial-gradient(1.5px 1.5px at 60% 60%, rgba(255, 255, 255, 0.3), transparent 100%),
        radial-gradient(1.5px 1.5px at 35% 75%, rgba(255, 255, 255, 0.25), transparent 100%);
    pointer-events: none;
}

/* --- Piliers du podium --- */
.call-lb__pillar {
    position: relative;
    z-index: 1;
    flex: 1 1 0;
    max-width: 124px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #fff;
    animation: lb-rise 0.55s cubic-bezier(0.21, 1.02, 0.73, 1) both;
}

.call-lb__pillar--1 { order: 2; }
.call-lb__pillar--2 { order: 1; animation-delay: 0.08s; }
.call-lb__pillar--3 { order: 3; animation-delay: 0.16s; }

.call-lb__crown {
    font-size: 1rem;
    line-height: 1;
    margin-bottom: 5px;
}

.is-gold .call-lb__crown { color: var(--lb-gold); filter: drop-shadow(0 0 7px rgba(255, 207, 77, 0.6)); }
.is-silver .call-lb__crown { color: var(--lb-silver); }
.is-bronze .call-lb__crown { color: var(--lb-bronze); }

.call-lb__pillar--1 .call-lb__crown {
    font-size: 1.45rem;
    animation: lb-bob 2.6s ease-in-out infinite;
}

.call-lb__avatar {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    background-color: var(--lb-accent, #2c7be5);
    background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(0, 0, 0, 0.22));
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16), 0 6px 14px -5px rgba(0, 0, 0, 0.55);
}

.call-lb__pillar--1 .call-lb__avatar {
    width: 70px;
    height: 70px;
    font-size: 1.35rem;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22), 0 0 24px -2px var(--lb-accent, #2c7be5), 0 8px 18px -5px rgba(0, 0, 0, 0.6);
}

.call-lb__name {
    margin-top: 0.5rem;
    max-width: 100%;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.call-lb__score {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

.call-lb__pillar--1 .call-lb__score {
    font-size: 2rem;
    text-shadow: 0 0 18px rgba(255, 207, 77, 0.45);
}

.call-lb__scorelabel {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    opacity: 0.6;
}

.call-lb__rate {
    margin-top: 0.25rem;
    font-size: 0.66rem;
    opacity: 0.82;
}

.call-lb__pedestal {
    margin-top: 0.65rem;
    width: 100%;
    display: grid;
    place-items: center;
    border-radius: 8px 8px 4px 4px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 800;
    font-size: 0.85rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.04));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.call-lb__pillar--1 .call-lb__pedestal { height: 56px; }
.call-lb__pillar--2 .call-lb__pedestal { height: 40px; }
.call-lb__pillar--3 .call-lb__pedestal { height: 28px; }
.is-gold .call-lb__pedestal { background: linear-gradient(180deg, rgba(255, 207, 77, 0.34), rgba(255, 207, 77, 0.07)); }

/* --- Liste du reste du classement --- */
.call-lb__list {
    list-style: none;
    margin: 0.85rem 0 0;
    padding: 0;
}

.call-lb__row {
    display: grid;
    grid-template-columns: 1.4rem 30px minmax(60px, 1fr) 74px 2.6rem 2rem;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.45rem;
    border-radius: 10px;
    animation: lb-fade 0.4s ease both;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.call-lb__row + .call-lb__row { border-top: 1px solid rgba(0, 0, 0, 0.05); }

.call-lb__row:hover {
    background: rgba(0, 0, 0, 0.025);
    box-shadow: inset 3px 0 0 var(--lb-accent, #2c7be5);
}

.call-lb__rank {
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: #8a94a6;
    font-variant-numeric: tabular-nums;
}

.call-lb__chip {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.66rem;
    font-weight: 700;
    color: #fff;
    background-color: var(--lb-accent, #2c7be5);
    background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.15));
}

.call-lb__rowname {
    font-size: 0.82rem;
    font-weight: 600;
    color: #344050;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.call-lb__bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.call-lb__bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background-color: var(--lb-accent, #2c7be5);
    background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0));
    transform-origin: left;
    animation: lb-grow 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.call-lb__rowrate {
    font-size: 0.7rem;
    font-weight: 600;
    color: #8a94a6;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.call-lb__total {
    font-size: 0.92rem;
    font-weight: 800;
    color: #344050;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* --- État vide --- */
.call-lb__empty {
    text-align: center;
    padding: 2.4rem 1rem;
    color: #8a94a6;
}

.call-lb__empty .fas { display: block; margin-bottom: 0.55rem; font-size: 1.9rem; opacity: 0.4; }
.call-lb__empty p { margin: 0; font-style: italic; }
.call-lb__empty small { opacity: 0.7; }

@media (max-width: 360px) {
    .call-lb__row { grid-template-columns: 1.2rem 26px minmax(40px, 1fr) 56px 1.8rem; }
    .call-lb__rowrate { display: none; }
}

/* --- Animations --- */
@keyframes lb-rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes lb-fade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes lb-grow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes lb-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
    .call-lb__pillar,
    .call-lb__row,
    .call-lb__bar-fill,
    .call-lb__pillar--1 .call-lb__crown {
        animation: none !important;
    }
}