/**
 * Charts Modern - Style cohérent pour graphiques et KPI
 * Palette data, typographie, tooltips, animations
 */

/* ========== PAGE HEADER ========== */
.page-header-modern {
    margin-bottom: 1.5rem;
}

.page-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.page-header-subtitle {
    font-size: 0.9375rem;
}

/* ========== KPI CARDS ========== */
.kpi-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
    height: 100%;
}

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

.kpi-card .kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
    color: #fff;
}

.kpi-card .kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    margin-bottom: 4px;
}

.kpi-card .kpi-label {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

/* Variantes de couleurs KPI */
.kpi-card.kpi-primary .kpi-icon {
    background: linear-gradient(135deg, #a81734 0%, #c41e3a 100%);
}
.kpi-card.kpi-success .kpi-icon {
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
}
.kpi-card.kpi-warning .kpi-icon {
    background: linear-gradient(135deg, #fd7e14 0%, #ffc107 100%);
}
.kpi-card.kpi-info .kpi-icon {
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
}
.kpi-card.kpi-danger .kpi-icon {
    background: linear-gradient(135deg, #dc3545 0%, #e05d6b 100%);
}
.kpi-card.kpi-secondary .kpi-icon {
    background: linear-gradient(135deg, #6c757d 0%, #adb5bd 100%);
}

/* ========== CHART CONTAINER ========== */
.chart-modern-wrap {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chart-modern-wrap:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.chart-modern-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-modern-title i {
    color: #a81734;
    font-size: 18px;
}

/* Dashboard stats - grille uniforme */
.dashboard-stats .stats-charts {
    display: flex;
    flex-wrap: wrap;
}

.dashboard-stats .chart-container {
    min-height: 280px;
    position: relative;
}

.dashboard-stats .chart-modern-wrap {
    min-height: 360px;
}

/* Responsive - cartes plein largeur sur mobile */
@media (max-width: 991.98px) {
    .dashboard-stats .stats-charts .col-lg-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 575.98px) {
    .dashboard-stats .chart-modern-wrap {
        padding: 16px;
        min-height: 320px;
    }

    .dashboard-stats .chart-container {
        min-height: 240px;
    }
}

/* ========== SUGGESTIONS MODERNES (Dashboard) ========== */
.suggestions-modern {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.suggestions-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.suggestions-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.suggestions-title i {
    color: #a81734;
    font-size: 1.2rem;
}

.suggestions-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.suggestion-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.suggestion-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.suggestion-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.suggestion-badge {
    font-size: 11px;
    font-weight: 600;
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: none;
}

.suggestion-badge-discover {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.suggestion-card-body {
    display: flex;
    gap: 16px;
    flex: 1;
}

.suggestion-avatar-link {
    flex-shrink: 0;
}

.suggestion-avatar {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    background: #f1f5f9;
}

.suggestion-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.suggestion-avatar-mission {
    border-radius: 8px;
}

.suggestion-content {
    flex: 1;
    min-width: 0;
}

.suggestion-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
    transition: color 0.2s;
}

.suggestion-name:hover {
    color: #a81734;
}

.suggestion-headline {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0 0 6px 0;
}

.suggestion-location {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin: 0 0 8px 0;
}

.suggestion-location i {
    margin-right: 4px;
    font-size: 0.75rem;
}

.suggestion-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8125rem;
    color: #475569;
}

.suggestion-rate {
    font-weight: 600;
    color: #198754;
}

.suggestion-rating {
    color: #fd7e14;
}

.suggestion-date {
    color: #64748b;
}

.suggestion-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.suggestion-actions .btn-view {
    flex: 1;
    padding: 8px 14px;
    font-size: 0.875rem;
    font-weight: 600;
    background: #a81734;
    color: #fff;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s;
}

.suggestion-actions .btn-view:hover {
    background: #8f132c;
    color: #fff;
}

.suggestion-actions .btn-outline {
    padding: 8px 12px;
    font-size: 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s;
}

.suggestion-actions .btn-outline:hover {
    border-color: #a81734;
    color: #a81734;
}

.suggestion-actions .btn-icon {
    padding: 8px 10px;
    border: none;
    background: transparent;
    color: #94a3b8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-actions .btn-icon:hover {
    background: #fef2f2;
    color: #dc2626;
}

@media (max-width: 767.98px) {
    .suggestions-grid {
        grid-template-columns: 1fr;
    }

    .suggestion-card-body {
        flex-direction: column;
        align-items: flex-start;
    }

    .suggestion-avatar {
        width: 56px;
        height: 56px;
    }
}

/* ========== FILTRE PÉRIODE (pour usage futur) ========== */
.chart-period-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.chart-period-filter .btn-period {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-period-filter .btn-period:hover,
.chart-period-filter .btn-period.active {
    background: #a81734;
    border-color: #a81734;
    color: #fff;
}

/* ========== LOADING CHART ========== */
.chart-loading {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.chart-loading .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
}

/* ========== GLOBAL CONTENT (profil pages) ========== */
#content .container-fluid {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========== TDB — Détail segment « Missions par catégorie » (SweetAlert2) ========== */
.tdb-swal-category-popup {
    border-radius: 16px !important;
    overflow: hidden;
    box-shadow:
        0 25px 50px -12px rgba(15, 23, 42, 0.35),
        0 0 0 1px rgba(15, 23, 42, 0.06) !important;
    padding: 0 !important;
}

.tdb-swal-category-popup .swal2-html-container {
    margin: 0 !important;
    padding: 0 !important;
}

.tdb-swal-category-popup .swal2-actions {
    margin: 0 !important;
    padding: 0 1.25rem 1.25rem !important;
    width: 100%;
    box-sizing: border-box;
}

.tdb-swal-category-btn {
    border-radius: 10px !important;
    font-weight: 600 !important;
    padding: 0.55rem 1.35rem !important;
    font-size: 0.9375rem !important;
}

.tdb-category-detail {
    text-align: left;
    font-family:
        'Inter',
        system-ui,
        -apple-system,
        sans-serif;
}

.tdb-category-detail__accent {
    height: 6px;
    width: 100%;
}

.tdb-category-detail__inner {
    padding: 1.35rem 1.5rem 0.25rem;
}

.tdb-category-detail__eyebrow {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #94a3b8;
    margin: 0 0 0.5rem;
}

.tdb-category-detail__name {
    font-size: 1.375rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin: 0 0 1.25rem;
    line-height: 1.25;
}

.tdb-category-detail__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 1rem;
}

.tdb-category-detail__stat {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    text-align: center;
}

.tdb-category-detail__stat--pct {
    background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
    border-color: rgba(168, 23, 52, 0.18);
}

.tdb-category-detail__stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.tdb-category-detail__stat--pct .tdb-category-detail__stat-value {
    color: #a81734;
}

.tdb-category-detail__pct {
    font-size: 1.1rem;
    font-weight: 700;
    opacity: 0.9;
}

.tdb-category-detail__stat-label {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 4px;
    font-weight: 500;
}

.tdb-category-detail__hint {
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.45;
    margin: 0 0 0.5rem;
}
