/* ========================================= */
/* STRUCTURE GLOBALE ET LAYOUT               */
/* ========================================= */
body {
    min-height: 100vh;
}

main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0; /* Important pour le comportement des composants internes avec overflow */
}

/* --- COMPOSANTS NATIFS REUTILISABLES --- */
.dropdown-item.active {
    background: var(--bs-primary);
    color: #fff;
}
.transition-all {
    transition: all 0.2s ease;
}

/* ========================================= */
/* FOOTER GENERAL                            */
/* ========================================= */
.admin-mini-footer {
    height: 50px;
    background-color: #ffffff;
}

.ultra-small {
    font-size: 0.7rem;
}

.footer-link {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b; /* Gris ardoise plus lisible */
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--bs-primary) !important;
}

.isatis-logo img {
    transition: all 0.3s ease;
}

.isatis-logo:hover img {
    filter: grayscale(0) opacity(1) !important;
    transform: scale(1.05);
}

/* ========================================= */
/* BARRE DE NAVIGATION (NAVBAR)              */
/* ========================================= */
.navbar {
    height: 60px;
}

/* Style des liens de navigation */
.custom-nav-link {
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #64748b !important;
    padding: 0.5rem 0.8rem !important;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
}

.custom-nav-link:hover, .custom-nav-link.active {
    color: var(--bs-primary) !important;
    background-color: #f1f5f9;
}

.custom-nav-link svg, .btn-impersonate-link svg {
    font-size: 0.95rem;
    vertical-align: middle;
}

/* Bouton Profil / Utilisateur */
.btn-user-pill {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    padding: 4px 10px 4px 4px;
    transition: all 0.2s;
}

.btn-user-pill:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.user-avatar {
    width: 26px;
    height: 26px;
    background: var(--bs-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
}

.border-start.custom-navbar-actions {
    padding-left: 1.5rem;
    margin-left: 0.5rem;
}

/* Lien d'impersonation ("Quitter le test") */
.btn-impersonate-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: #dc3545 !important;
    display: inline-flex;
    align-items: center;
}

/* ========================================= */
/* CONFIGURATION DES LAYOUTS APPLICATIFS     */
/* ========================================= */
.admin-layout-wrapper {
    display: flex !important;
    flex-direction: row !important;
    width: 100%;
    height: calc(100vh - 60px);
    overflow: hidden;
    position: relative;
}

.admin-content {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 0;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background-color: #f8fafc;
    /* Masquage de la scrollbar native */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.admin-content::-webkit-scrollbar {
    display: none;
}

.admin-body-content {
    flex: 1 0 auto;
    width: 100%;
}

/* Empêche le double scroll sur desktop pour les dashboards */
@media (min-width: 992px) {
    body.overflow-hidden-desktop,
    body.overflow-hidden-desktop html {
        height: 100vh;
        width: 100vw;
        margin: 0;
        overflow: hidden;
    }
}

/* ========================================= */
/* RESPONSIVE TABLETTE & MOBILE (< 992px)    */
/* ========================================= */
@media (max-width: 991px) {
    /* Navbar Mobile */
    .navbar {
        height: auto;
    }
    .border-start.custom-navbar-actions {
        border: none !important;
        padding-left: 0 !important;
        margin-left: 0 !important;
    }

    /* Libération du scroll pour le tactile (Le correctif est ici !) */
    body {
        height: auto !important;
        min-height: 100vh;
        overflow-x: hidden;
    }

    .admin-layout-wrapper {
        flex-direction: column !important;
        height: auto !important;
        overflow: visible !important; /* Débloque le scroll */
    }

    .admin-content {
        height: auto !important;
        overflow: visible !important; /* Débloque le scroll */
        padding-bottom: 80px;
    }

    .admin-body-content {
        padding: 1.5rem 1rem !important;
    }
}
