/* ============================
   CORRECTIONS DE CHEVAUCHEMENT
   ============================ */

/* Reset des marges et padding pour éviter les conflits */
.container-fluid,
.container {
    margin-top: 0;
    padding-top: 0;
}

/* Ajustement spécifique pour le header de page */
.page-header {
    margin-top: 0 !important;
    padding-top: 0.5rem !important;
}

/* Correction pour le contenu principal */
.main-content {
    position: relative;
    z-index: 1;
}

/* Ajustement des tableaux */
.table-responsive {
    margin-top: 0;
}

/* Correction des cartes */
.card {
    margin-top: 0;
}

/* Ajustement des formulaires */
.form-container {
    margin-top: 0;
    padding-top: 0;
}

/* Correction spécifique pour le dashboard */
.dashboard-stats {
    margin-top: 0;
}

/* Ajustement des boutons d'action */
.btn-toolbar {
    margin-top: 0;
}

/* Correction pour les modals */
.modal-content {
    margin-top: 0;
}

/* Ajustement des alertes */
.alert {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* Correction pour les badges */
.badge {
    margin-top: 0;
}

/* Ajustement des paginations */
.pagination {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* ============================
   RESPONSIVE ADJUSTMENTS
   ============================ */

@media (max-width: 991.98px) {
    .main-content {
        margin-top: 0 !important;
        padding-top: 0.5rem !important;
    }

    .page-header {
        padding-top: 0.25rem !important;
    }
}

@media (min-width: 992px) {
    /* Ajustement fin pour le contenu desktop */
    .main-content {
        padding-top: 1.5rem !important;
    }

    .page-header {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    /* Ajustement spécifique pour éviter tout chevauchement résiduel */
    .container-fluid:first-child {
        padding-top: 0.5rem;
    }
}

/* ============================
   CORRECTIONS SPÉCIFIQUES POUR LES PAGES
   ============================ */

/* Page de liste des candidats */
.candidate-list-header {
    margin-top: 0;
    padding-top: 0;
}

/* Page de détail candidat */
.candidate-detail-header {
    margin-top: 0;
}

/* Page de formulaire */
.form-page-header {
    margin-top: 0;
}

/* Tableau de bord */
.dashboard-header {
    margin-top: 0;
}

/* ============================
   CORRECTIONS DE Z-INDEX
   ============================ */

.navbar {
    z-index: 1030;
}

.sidebar {
    z-index: 1020;
}

.main-content {
    z-index: 1;
}

.dropdown-menu {
    z-index: 1040;
}

.modal {
    z-index: 1050;
}

/* ============================
   CORRECTIONS DE HAUTEUR
   ============================ */

html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1 0 auto;
}

.footer {
    flex-shrink: 0;
}

/* Ajustement pour le contenu scrollable */
.content-scrollable {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

/* ============================
   CORRECTIONS VISUELLES
   ============================ */

/* Assurer que le texte est toujours lisible */
.text-content {
    margin-top: 0;
    padding-top: 0.5rem;
}

/* Correction des espacements dans les lignes */
.row {
    margin-top: 0;
}

.row > [class*="col-"] {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Ajustement des titres */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

/* Correction des paragraphes */
p {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}
