:root {
    --primary: #1a253a; /* Bleu Nuit très sombre pour le National */
    --secondary: #2c3e50; /* Gris-Bleu pour le Dashboard */
    --accent: #f1c40f; /* Or pour le Super Admin */
    --green: #27ae60;
    --red: #c0392b;
    --bg-light: #f4f7f6;
    --text-color: #333;
    --card-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-color);
    padding-top: 70px; /* Espace pour la top-nav */
    padding-bottom: 80px; /* Espace pour la bottom-nav */
}

/* --- Barre de Navigation Supérieure --- */
.top-nav {
    position: fixed; top: 0; left: 0; width: 100%; height: 70px;
    background-color: var(--primary); color: white;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.nav-left { display: flex; align-items: center; }
.logo-img { height: 45px; margin-right: 15px;border-radius: 20%; } /* Ajustez selon votre logo */
.nav-title { font-size: 18px; font-weight: bold; }

.nav-right { display: flex; align-items: center; gap: 15px; }
.status-badge {
    padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: bold;
    display: flex; align-items: center; gap: 5px;
}
.status-badge.super-admin { background-color: var(--accent); color: #000; }
.logout-icon { color: white; font-size: 20px; text-decoration: none; opacity: 0.8; }
.logout-icon:hover { opacity: 1; }

/* --- Container Principal --- */
.main-container { padding: 20px; max-width: 1200px; margin: 0 auto; }
.section-title { font-size: 18px; margin-bottom: 20px; color: var(--secondary); display: flex; align-items: center; gap: 10px; }

/* --- Grille KPI --- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 15px; margin-bottom: 25px; }

.kpi-card {
    background: white; padding: 20px; border-radius: 12px;
    display: flex; align-items: center; gap: 20px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s;
}
.kpi-card:hover { transform: translateY(-3px); }

.kpi-icon {
    font-size: 30px; width: 60px; height: 60px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.kpi-data { display: flex; flex-direction: column; }
.kpi-label { font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: 1px; }
.kpi-value { font-size: 28px; font-weight: bold; color: var(--primary); }
.kpi-sub { font-size: 10px; color: #999; margin-top: -3px; }

/* Couleurs des cartes KPI */
.kpi-card.purple .kpi-icon { background-color: rgba(155, 89, 182, 0.1); color: #9b59b6; }
.kpi-card.blue .kpi-icon { background-color: rgba(52, 152, 219, 0.1); color: #3498db; }
.kpi-card.green .kpi-icon { background-color: rgba(39, 174, 96, 0.1); color: #27ae60; }

/* --- Ligne des Graphiques --- */
.charts-row { display: flex; flex-wrap: wrap; gap: 15px; }
.card { background: white; padding: 20px; border-radius: 12px; box-shadow: var(--card-shadow); }
.card h3 { font-size: 16px; margin-bottom: 15px; color: var(--primary); display: flex; align-items: center; gap: 10px; }

.chart-container { flex: 1; min-width: 320px; text-align: center; }
#geoStatusChart { max-width: 250px; margin: 0 auto; } /* Limite la taille du graphique en camembert */
.chart-legend { margin-top: 15px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; text-align: left; max-width: 250px; margin: 15px auto 0 auto;}
.legend-item { display: flex; align-items: center; gap: 8px; }

/* --- Flux des Réalisations (Feed) --- */
.feed-container { flex: 2; min-width: 350px; }
.feed-list { display: flex; flex-direction: column; gap: 15px; }
.feed-item { display: flex; gap: 15px; align-items: flex-start; padding-bottom: 10px; border-bottom: 1px solid #f0f0f0; }
.feed-item:last-child { border-bottom: none; }

.feed-icon {
    font-size: 18px; width: 40px; height: 40px; border-radius: 8px;
    background-color: rgba(52, 152, 219, 0.1); color: #3498db;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.feed-icon.orange { background-color: rgba(230, 126, 34, 0.1); color: #e67e22; }
.feed-icon.green { background-color: rgba(39, 174, 96, 0.1); color: #27ae60; }

.feed-content { display: flex; flex-direction: column; font-size: 13px; }
.feed-content strong { color: #555; font-size: 11px; text-transform: uppercase; }
.feed-content span { color: #333; margin: 3px 0; font-weight: 500; }
.feed-content small { color: #999; font-size: 10px; }
.feed-content small i { margin: 0 3px; }

/* --- Couleurs de légende --- */
.color-green { color: var(--green); }
.color-red { color: var(--red); }

/* --- Barre de Navigation Basse --- */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 65px;
    background-color: white; color: var(--primary);
    display: flex; align-items: center; justify-content: space-around;
    z-index: 1000; box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding: 0 10px;
}
.bottom-nav a { text-decoration: none; color: #999; text-align: center; flex: 1; padding: 10px; font-size: 10px;}
.bottom-nav a i { display: block; font-size: 20px; margin-bottom: 3px; }
.bottom-nav a span { display: block;}
.bottom-nav a.active { color: var(--green); font-weight: bold;} /* Vert AMAD pour l'actif */

.bottom-nav a {
    transition: all 0.3s ease;
    border-top: 3px solid transparent; /* Prépare l'effet de surbrillance */
}

/* Style quand l'onglet est actif */
.bottom-nav a.active {
    color: #27ae60; /* Vert AMAD */
    border-top: 3px solid #27ae60;
    background: rgba(39, 174, 96, 0.05); /* Léger fond vert */
}

.bottom-nav a.active i {
    transform: translateY(-2px); /* Petit saut de l'icône */
}

/* --- SIDEBAR --- */
.sidebar {
    position: fixed; top: 0; left: -280px; width: 280px; height: 100%;
    background: var(--primary); color: white; z-index: 2000;
    transition: 0.3s; box-shadow: 5px 0 15px rgba(0,0,0,0.3);
}
.sidebar.open { left: 0; }
.sidebar-header { padding: 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header img { width: 40px; border-radius: 20%; }
.sidebar-nav { padding: 10px 0; }
.sidebar-nav a { 
    display: flex; align-items: center; padding: 15px 20px; 
    color: #bdc3c7; text-decoration: none; font-size: 14px; gap: 15px;
}
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(255,255,255,0.1); color: white; border-left: 4px solid var(--accent); }
.sidebar-nav hr { border: 0; border-top: 1px solid rgba(255,255,255,0.05); margin: 10px 0; }

.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); display: none; z-index: 1500;
}
.overlay.show { display: block; }

.menu-btn { background: none; border: none; color: white; font-size: 20px; cursor: pointer; margin-right: 10px; }










/* --- Conteneur principal --- */
.admin-actions.card {
    margin-bottom: 20px;
    padding: 12px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* --- Container de recherche --- */
.search-bar-container {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}

/* --- Wrapper de l'input pour y mettre une icône --- */
.input-wrapper {
    position: relative;
    flex: 1; /* Prend tout l'espace restant */
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #bdc3c7;
    font-size: 0.9rem;
}

.input-wrapper .form-control {
    width: 100%;
    padding: 12px 12px 12px 35px !important; /* Espace pour l'icône loupe */
    border: 1px solid #dcdde1;
    border-radius: 10px;
    font-size: 16px !important; /* Évite le zoom auto sur iPhone/WebView */
}

/* --- Bouton Ajouter --- */
.btn-add {
    white-space: nowrap;
    padding: 12px 15px;
    height: 45px;
    border-radius: 10px;
}

/* --- ADAPTATION MOBILE (Écrans < 480px) --- */
@media (max-width: 480px) {
    .search-bar-container {
        flex-direction: row; /* On garde sur une ligne pour ne pas perdre de place verticale */
    }

    .btn-add span {
        display: none; /* On cache le texte "Ajouter" pour ne garder que le "+" */
    }
    
    .btn-add {
        padding: 0;
        width: 45px; /* Devient un bouton carré pour laisser la place à l'input */
        min-width: 45px;
    }

    .input-wrapper .form-control {
        font-size: 14px !important;
    }
}

/* Base commune pour tous les boutons */
button, .btn-amad {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px; /* Coins arrondis modernes */
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent; /* Supprime le flash bleu sur mobile */
    min-height: 48px; /* Hauteur minimale recommandée par Google/Apple pour le tactile */
}

/* Effet au clic (feedback tactile) */
button:active, .btn-amad:active {
    transform: scale(0.96);
    opacity: 0.9;
}

/* Bouton Principal (Action positive) */
.btn-primary {
    background-color: #27ae60;
    color: white;
    box-shadow: 0 4px 6px rgba(39, 174, 96, 0.2);
}

/* Bouton Secondaire (Neutre/Optionnel) */
.btn-secondary {
    background-color: #f8f9fa;
    color: #2c3e50;
    border: 1px solid #dee2e6;
}

/* Bouton Danger (Suppression/Urgence) */
.btn-danger {
    background-color: #e74c3c;
    color: white;
    box-shadow: 0 4px 6px rgba(231, 76, 60, 0.2);
}

/* Bouton Ghost (Discret / Barre d'outils) */
.btn-ghost {
    background-color: transparent;
    color: #7f8c8d;
}

.btn-ghost:hover {
    background-color: rgba(0,0,0,0.05);
}

/* Version Large (Prend toute la largeur sur mobile) */
.btn-block {
    display: flex;
    width: 100%;
}




/* Conteneur de la grille */
.post-media-grid {
    display: grid;
    gap: 2px;
    background: #eee;
    border-radius: 8px;
    overflow: hidden;
    height: 300px; /* Hauteur fixe pour l'harmonie */
    cursor: pointer;
}

/* Cas 1 image */
.grid-1 { grid-template-columns: 1fr; }
/* Cas 2 images */
.grid-2 { grid-template-columns: 1fr 1fr; }
/* Cas 3 images (1 grande à gauche, 2 à droite) */
.grid-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.grid-3 .media-item:first-child { grid-row: span 2; }
/* Cas 4+ images (Grille 2x2) */
.grid-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.media-item {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

/* Overlay pour le " +3 " si plus de 4 images */
.more-overlay::after {
    content: attr(data-more);
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: bold;
}

.tabs-structure{box-shadow: -7px -5px 10px rgba(0,0,0,0.07);}
.tabs-structure .tab-content {
  box-shadow: 0px 10px 10px rgba(0,0,0,0.08);
  padding-bottom: 1px;
}
.tab-content .list-container{
  margin: 0 5px;
}





@keyframes pulse-ring {
    0% {
        stroke-width: 2;
        stroke-opacity: 0.8;
        fill-opacity: 0.2;
    }
    50% {
        stroke-width: 15; /* L'anneau s'élargit vers l'extérieur */
        stroke-opacity: 0.4;
        fill-opacity: 0.4;
    }
    100% {
        stroke-width: 2;
        stroke-opacity: 0.8;
        fill-opacity: 0.2;
    }
}

.pulse-circle {
    animation: pulse-ring 2s infinite ease-in-out;
    /* On s'assure que le cercle ne bouge pas */
    transform-origin: center; 
}

.sidebar.open {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh; /* IMPORTANT */
    width: 250px; /* ou ce que tu veux */
    display: flex;
    flex-direction: column;
}

.sidebar.open .sidebar-nav {
    flex: 1; /* prend tout l’espace restant */
    overflow-y: auto; /* active le scroll vertical */
}

#closeSidebar {
  min-height: 30px !important;
  padding: 2px 13px;
}

td button {
  padding: 0px;
  min-height: 20px;
}
