

/* /admin/assets/css/style.css */

/* --- 1. Variables de Couleurs & Thème Global --- */
:root {
    --primary: #0d6efd;
    --primary-light: #eef5ff;
    --secondary: #6c757d;
    --dark: #2c3e50;
    --light: #f8f9fa;
    --text-dark: #34495e;
    --text-muted: #95a5a6;
    --border-color: #ecf0f1;
    --sidebar-bg: #ffffff;
    --sidebar-text: #34495e;
    --sidebar-hover-bg: var(--primary-light);
    --sidebar-active-text: var(--primary);
    --sidebar-bg: #ffffff;
    --sidebar-text-color: #5a5c69;
    --sidebar-icon-color: #adb5bd;
    --sidebar-hover-bg: #f0f8ff; /* Bleu très clair */
    --sidebar-active-bg: #e6f0ff; /* Bleu un peu plus prononcé */
    --sidebar-border-color: #e3e6f0;
}

body {
    overflow-x: hidden;
    background-color: var(--light);
    color: var(--text-dark);
}

/* --- 2. Page de Connexion (inchangée mais conservée) --- */
.login-body {
    background-color: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-container {
    max-width: 400px;
    width: 100%;
}
.login-card {
    background: #fff;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0,0,0,0.1);
}

/* --- 3. Layout Principal et Wrapper (CORRIGÉ) --- */
#wrapper {
    display: flex; /* Utilisation de Flexbox pour le layout principal */
    min-height: 100vh;
}

#page-content-wrapper {
    flex-grow: 1; /* Le contenu prend tout l'espace restant */
    padding-top: 60px; /* Espace pour la navbar supérieure */
}

/* --- Structure Globale de la Sidebar --- */
.sidebar {
    width: 15rem;
    min-height: 100vh;
    position: fixed;
    z-index: 1000;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border-color);
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    transition: margin-left 0.4s ease;
}
#wrapper.toggled .sidebar {
    margin-left: -15rem;
}

/* --- En-tête de la Sidebar (Logo) --- */
.sidebar-heading {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-border-color);
}
.sidebar-heading a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--bs-dark);
    font-size: 1.1rem;
    font-weight: 700;
}
.sidebar-logo {
    max-height: 35px; /* Ajuster la taille du logo */
    margin-right: 10px;
}

/* --- Corps de la Navigation --- */
.sidebar-nav {
    padding: 1rem 0;
    /* Permet le scroll si le menu devient trop long, sans affecter le header */
    max-height: calc(100vh - 70px); 
    overflow-y: auto;
}

/* --- Titres de Section --- */
.sidebar-section-heading {
    padding: 0.5rem 1.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--sidebar-text-color);
    font-weight: 700;
    margin-top: 1rem;
    letter-spacing: .05em;
}

/* --- Liens de Menu --- */
.sidebar .list-group-item {
    background: transparent;
    border: none;
    border-left: 4px solid transparent; /* Indicateur d'activité, transparent par défaut */
    border-radius: 0;
    color: var(--sidebar-text-color);
    font-weight: 500;
    padding: 0.9rem 1.25rem;
    transition: all 0.2s ease-in-out;
}
.sidebar .list-group-item i {
    color: var(--sidebar-icon-color);
    transition: color 0.2s ease-in-out;
}

/* --- État de Survol (Hover) --- */
.sidebar .list-group-item:hover {
    background: var(--sidebar-hover-bg);
    color: var(--bs-primary);
}
.sidebar .list-group-item:hover i {
    color: var(--bs-primary);
}

/* --- État Actif --- */
.sidebar .list-group-item.active {
    background: var(--sidebar-active-bg);
    color: var(--bs-primary);
    font-weight: 700;
    border-left-color: var(--bs-primary); /* L'indicateur devient visible */
}
.sidebar .list-group-item.active i {
    color: var(--bs-primary);
}

/* --- Ajustements du Contenu Principal --- */
#page-content-wrapper {
    width: 100%;
    padding-left: 15rem;
    transition: padding-left 0.4s ease;
}
#wrapper.toggled #page-content-wrapper {
    padding-left: 0;
}

/* --- Responsive --- */
@media (max-width: 767.98px) {
    .sidebar {
        margin-left: -15rem;
    }
    #wrapper.toggled .sidebar {
        margin-left: 0;
    }
    #page-content-wrapper {
        padding-left: 0;
    }
}

.list-group-item {
    background: transparent !important; /* Important pour surcharger Bootstrap */
    color: var(--sidebar-text) !important;
    border: none;
    border-left: 4px solid transparent;
    border-radius: 0;
    font-weight: 500;
    padding: 0.9rem 1.25rem;
    transition: all 0.2s ease-in-out;
}

.list-group-item:hover {
    background: var(--sidebar-hover-bg) !important;
    color: var(--sidebar-active-text) !important;
}

.list-group-item.active {
    background: var(--sidebar-hover-bg) !important;
    color: var(--sidebar-active-text) !important;
    font-weight: 700;
    border-left-color: var(--primary);
}
.list-group-item i {
    color: var(--text-muted);
    transition: color 0.2s ease-in-out;
}
.list-group-item:hover i,
.list-group-item.active i {
    color: var(--sidebar-active-text);
}

/* --- 5. Navbar Supérieure du Contenu --- */
#page-content-wrapper > .navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 260px; /* Largeur de la sidebar */
    z-index: 1030;
    transition: left 0.4s ease;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
#wrapper.toggled #page-content-wrapper > .navbar {
    left: 0;
}

/* --- 6. Styles des modules (conservés et améliorés) --- */
#modal-utilisateur .modal-header {
    background-color: var(--primary);
    color: #fff;
}
#modal-utilisateur .modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}
#modal-utilisateur .modal-title {
    font-weight: 600;
}

/* --- 7. Réactivité --- */
@media (max-width: 991.98px) {
    #sidebar-wrapper {
        margin-left: -260px;
    }
    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0;
    }
    #page-content-wrapper {
        width: 100%;
    }
    #page-content-wrapper > .navbar {
        left: 0;
    }
}

/* /admin/assets/css/style.css (ajouts) */
/* --- Module Équipe Dirigeante --- */
#sortable-equipe .list-group-item {
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
}
#sortable-equipe .list-group-item:active {
    cursor: grabbing;
}
#sortable-equipe .ui-sortable-placeholder {
    border: 2px dashed #ccc;
    background: #f8f9fa;
    visibility: visible !important;
}
#sortable-equipe .membre-info {
    font-weight: 500;
}
#sortable-equipe .membre-info small {
    display: block;
    color: #6c757d;
}


/* /admin/assets/css/style.css (ajouts) */

/* ======================================================= */
/*      STYLES SPÉCIFIQUES AU MODULE FORMATIONS            */
/* ======================================================= */

/* --- Interface de gestion du programme des cours --- */
.course-list {
    height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 5px;
}

.course-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.course-item:hover {
    background-color: #f8f9fa;
}

.course-item.selected {
    background-color: var(--bs-primary);
    color: #fff;
    border-color: var(--bs-primary);
}

#liste-cours-programme .course-item {
    cursor: grab;
}

.semester-input {
    width: 100px;
    display: inline-block;
}
.semester-input input {
    width: 60px;
    text-align: center;
}


/* /admin/assets/css/style.css (ajouts) */
/* --- Module Actualités --- */
#dataTableActualites .article-image-thumbnail {
    width: 100px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
}
.image-upload-zone {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-upload-zone.dragover {
    border-color: var(--bs-primary);
    background-color: #f0f8ff;
}
.upload-instructions i {
    font-size: 3rem;
    color: #ccc;
}
.upload-instructions p {
    margin-top: 10px;
    color: #6c757d;
}
.image-preview-container {
    position: relative;
    width: 100%;
    max-height: 200px;
}
#image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 5px;
}
.btn-remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 25px;
    height: 25px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

/* /admin/assets/css/style.css (ajouts) */
/* --- Module Événements --- */

/* Ajustements pour FullCalendar pour qu'il respecte notre thème */
#calendar {
    --fc-border-color: var(--bs-border-color);
    --fc-today-bg-color: rgba(13, 110, 253, 0.1);
    --fc-event-bg-color: var(--bs-primary);
    --fc-event-border-color: var(--bs-primary);
    --fc-event-text-color: #fff;
}

#calendar .fc-event {
    cursor: pointer;
}

/* /admin/assets/css/style.css (ajouts) */
/* --- Module Carrousel --- */
#sortable-slides .list-group-item {
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
#sortable-slides .slide-preview {
    width: 120px;
    height: 70px;
    flex-shrink: 0;
    border-radius: 5px;
    background-color: #f0f0f0;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #ccc;
}
#sortable-slides .slide-info {
    flex-grow: 1;
}
#sortable-slides .slide-info strong {
    display: block;
}
#sortable-slides .slide-info small {
    color: #6c757d;
}
.media-champ {
    border-left: 3px solid #eee;
    padding-left: 15px;
}



/* /admin/assets/css/style.css (ajouts) */
/* --- Module Médiathèque --- */
.media-card {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    background-color: #fff;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.media-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15);
}
.media-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}
.media-card-icon {
    font-size: 2.5rem;
    color: var(--bs-secondary);
    width: 60px;
    text-align: center;
}
.media-card-title {
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}
.media-card-body {
    padding: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
    flex-grow: 1;
}
.media-card-footer {
    padding: 1rem;
    background-color: #f8f9fa;
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* Zone d'upload de fichier */
.file-upload-zone {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.file-upload-zone.dragover {
    border-color: var(--bs-primary);
    background-color: #f0f8ff;
}
.file-info-container {
    text-align: center;
}
.file-info-container span {
    display: block;
    margin-top: 10px;
    font-weight: 600;
}
.btn-remove-file {
    position: absolute;
    top: 5px;
    right: 5px;
    /* ... (style identique à btn-remove-image) ... */
}


/* /admin/assets/css/style.css (ajouts) */
/* --- Module Cellules --- */
.member-list {
    height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 5px;
}
.member-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}
.member-item:hover {
    background-color: #f8f9fa;
}
.member-item.selected {
    background-color: var(--bs-primary);
    color: #fff;
    border-color: var(--bs-primary);
}
.member-item-info small {
    display: block;
    color: #6c757d;
}
.member-item.selected .member-item-info small {
    color: rgba(255,255,255,0.7);
}
.member-poste-input {
    width: 150px;
}


/* /admin/assets/css/style.css (ajouts) */
/* --- Module Messages --- */
#dataTableMessages tbody tr {
    cursor: pointer;
}
.message-non-lu td {
    font-weight: 700 !important;
    color: var(--bs-dark) !important;
}
.message-details p {
    margin-bottom: 0.5rem;
}
.message-content {
    background-color: #f8f9fa;
    border-radius: 5px;
    padding: 1.5rem;
    white-space: pre-wrap; /* Conserve les sauts de ligne du message */
    word-wrap: break-word;
}

/* /admin/assets/css/style.css (ajouts) */
/* --- Module Menus --- */
.dd { position: relative; display: block; margin: 0; padding: 0; max-width: 100%; list-style: none; font-size: 13px; line-height: 20px; }
.dd-list { display: block; position: relative; margin: 0; padding: 0; list-style: none; }
.dd-list .dd-list { padding-left: 30px; }
.dd-collapsed .dd-list { display: none; }
.dd-item, .dd-empty, .dd-placeholder { display: block; position: relative; margin: 0; padding: 0; min-height: 20px; font-size: 13px; line-height: 20px; }
.dd-handle { display: block; height: auto; margin: 5px 0; padding: 10px 15px; color: #333; text-decoration: none; font-weight: bold; border: 1px solid #ccc; background: #fafafa; border-radius: 3px; box-sizing: border-box; }
.dd-handle:hover { color: #2ea8e5; background: #fff; }
.dd-item > button { display: block; position: relative; cursor: pointer; float: left; width: 25px; height: 20px; margin: 5px 0; padding: 0; text-indent: 100%; white-space: nowrap; overflow: hidden; border: 0; background: transparent; font-size: 12px; line-height: 1; text-align: center; font-weight: bold; top:5px; }
.dd-item > button:before { content: '+'; display: block; position: absolute; width: 100%; text-align: center; text-indent: 0; }
.dd-item > button[data-action="collapse"]:before { content: '-'; }
.dd-placeholder, .dd-empty { margin: 5px 0; padding: 0; min-height: 30px; background: #f2f4f7; border: 1px dashed #b6bcbf; box-sizing: border-box; -moz-box-sizing: border-box; }
.dd-dragel { position: absolute; pointer-events: none; z-index: 9999; }
.dd-dragel > .dd-item .dd-handle { margin-top: 0; }
.dd-dragel .dd-handle { -webkit-box-shadow: 2px 4px 6px 0 rgba(0,0,0,.1); box-shadow: 2px 4px 6px 0 rgba(0,0,0,.1); }

/* Personnalisation */
#source-pages { max-height: 200px; overflow-y: auto; }
.source-item { padding: 5px; border: 1px solid #eee; margin-bottom: 5px; background: #f9f9f9; cursor: pointer; }
.dd-handle .item-details { display: none; margin-top: 10px; }
.dd-handle .item-details label { display: block; margin-top: 5px; }
.dd-handle .item-actions { float: right; }
.dd-handle .item-actions a { margin-left: 5px; }

/* /admin/assets/css/style.css (ajouts) */
/* --- Module Dashboard --- */
.kpi-card {
    border-radius: .5rem;
    transition: all 0.3s ease;
}
.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15) !important;
}
.kpi-card .card-body {
    padding: 1.25rem;
}
.kpi-card .text-xs {
    font-size: .8rem;
}
.border-left-primary { border-left: .25rem solid var(--bs-primary) !important; }
.border-left-success { border-left: .25rem solid var(--bs-success) !important; }
.border-left-info { border-left: .25rem solid var(--bs-info) !important; }
.border-left-warning { border-left: .25rem solid var(--bs-warning) !important; }
.text-gray-300 { color: #dddfeb !important; }
.text-gray-800 { color: #5a5c69 !important; }
#liste-actualites-recentes .badge, #liste-evenements-prochains .badge {
    min-width: 80px;
}

/* /admin/assets/css/style.css (ajouts) */
/* --- Module Mon Profil --- */
#profil-avatar {
    border: 4px solid #eee;
    object-fit: cover;
}
.nav-tabs .nav-link {
    color: var(--bs-secondary);
    font-weight: 500;
}
.nav-tabs .nav-link.active {
    color: var(--bs-primary);
    border-color: #dee2e6 #dee2e6 #fff;
    font-weight: 600;
}
.tab-content hr {
    margin: 1rem 0;
}
.image-upload-zone.small-zone {
    min-height: 100px;
    width: 150px;
    padding: 10px;
}
.image-upload-zone.small-zone .upload-instructions i {
    font-size: 2rem;
}
.image-upload-zone.small-zone .upload-instructions p {
    font-size: 0.8rem;
    margin-top: 5px;
}
.image-upload-zone.small-zone #image-preview {
    max-height: 100px;
}