/*
   ========================================
   Admin - admin.css (Version Améliorée)
   ========================================
*/

/* --- Reset et Base --- */
* {
    box-sizing: border-box;
}

body.admin-body {
    background-color: var(--gray-light);
    color: var(--text-color);
}

/* Force la page admin à toujours s'afficher */
#page-dashboard-admin.page {
    display: block !important;
    animation: none !important;
}

/* --- Conteneur principal --- */
.main-container {
    width: 90%;
    max-width: 1600px; /* Plus large pour un dashboard */
    margin: 2rem auto;
}

.dashboard-header {
    margin-bottom: 2rem;
}

#page-dashboard-admin h1 {
    color: var(--gray-dark);
    margin-bottom: 0.25rem;
    font-size: 2.25rem;
}

#page-dashboard-admin .dashboard-subtitle {
    font-size: 1.1rem;
    color: var(--gray-med);
    margin-bottom: 0;
}

/* --- Grille des statistiques (5 colonnes) --- */
.admin-grid {
    display: grid;
    /* NOUVEAU : 5 colonnes, s'adaptant au contenu */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-box {
    display: flex;
    align-items: center;
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.07);
}

.stat-box-icon {
    font-size: 2.5rem;
    color: var(--blue);
    margin-right: 1.25rem;
    padding: 10px;
    background-color: var(--blue-light);
    border-radius: 50%;
    line-height: 1;
    flex-shrink: 0;
}

.stat-box-icon i {
    line-height: 1;
    display: block; /* Correction alignement icônes boxicons */
}

.stat-box-info {
    display: flex;
    flex-direction: column;
}

.stat-box-title {
    font-size: 0.9rem; /* Plus petit pour plus de stats */
    font-weight: 500;
    color: var(--gray-med);
    white-space: nowrap;
}

.stat-box-number {
    font-size: 1.75rem; /* Plus petit pour plus de stats */
    font-weight: 700;
    color: var(--gray-dark);
    line-height: 1.2;
}

/* --- NOUVEAU : Layout principal (Graphique + Colonne latérale) --- */
.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 2/3 pour le main, 1/3 pour la sidebar */
    gap: 1.5rem;
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* --- Carte Admin (Style unifié) --- */
.admin-card {
    background: var(--white); 
    padding: 1.5rem; /* Moins de padding */
    border-radius: 12px; 
    border: 1px solid #E5E7EB;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--gray-light);
}

.admin-card-header h3 {
    font-size: 1.25rem;
    color: var(--gray-dark);
    margin: 0;
}

/* --- Style des boutons de timeframe (Graphique) --- */
.chart-timeframe-selector {
    display: flex;
    border-radius: 8px;
    background-color: var(--gray-light);
    padding: 2px;
}

.timeframe-btn {
    background-color: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-med);
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeframe-btn.active {
    background-color: var(--white);
    color: var(--blue-dark);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* --- Conteneur du graphique --- */
.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

/* --- NOUVEAU : Style des flux d'activité --- */
.activity-feed {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1; /* Permet à la carte de grandir */
}

.activity-feed li {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-light);
    font-size: 0.9rem;
}

.activity-feed li:last-child {
    border-bottom: none;
}

.activity-feed .feed-icon {
    font-size: 1.25rem;
    margin-right: 12px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-feed .feed-icon.candidat {
    background-color: var(--blue-light);
    color: var(--blue-dark);
}

.activity-feed .feed-icon.entreprise {
    background-color: #dcfce7; /* Vert clair de 'styles.css' */
    color: #15803d; /* Vert foncé */
}

.activity-feed .feed-icon.demande {
    background-color: #ffedd5; /* Orange clair */
    color: var(--orange);
}

.activity-feed .feed-text {
    flex-grow: 1;
    line-height: 1.4;
    color: var(--text-color);
}

.activity-feed .feed-text strong {
    color: var(--gray-dark);
}

.activity-feed .feed-time {
    font-size: 0.8rem;
    color: var(--gray-med);
    white-space: nowrap;
    margin-left: 10px;
}

.activity-feed .no-data {
    color: var(--gray-med);
    padding: 1rem 0;
    text-align: center;
}


/* --- Responsive --- */

@media (max-width: 1200px) {
    .dashboard-layout {
        grid-template-columns: 1fr; /* Passe en 1 colonne */
    }
}

@media (max-width: 768px) {
    .admin-grid {
        grid-template-columns: 1fr 1fr; /* 2 colonnes sur tablette */
    }
}

@media (max-width: 600px) {
    .admin-grid {
        grid-template-columns: 1fr; /* 1 colonne sur mobile */
    }
    
    .admin-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}