body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background: #f5f7fb;
}

.app-container {
    display: flex;
    flex-direction: row; /* sidebar + main content */
    min-height: 100vh;   /* toujours au moins 100% de la page */
}


.sidebar {
    border-radius: 0px 50px 0px 0px;
    width: 265px;
    min-width: 265px;   /* 🔒 largeur bloquée */
    flex-shrink: 0;  
    height: calc(100vh - 84px); /* prend la hauteur totale moins le header */
    margin-top: 84px;           /* pour laisser la place au header */
    background: #1e5bd8;
    color: #fff;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}


.logo {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 30px;
    margin-top: -72px;
    color:blue;
}
a{
    color:#fff !important;
}

.menu {
    list-style: none;
    padding: 0;
    flex: 1;
}

.menu li {
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 5px;
    color: white;
}

.menu li.active,
.menu li:hover {
    background: rgba(255,255,255,0.2);
    
}

.menu i {
    margin-right: 10px;
}

/* STORAGE */
.storage {
    background: rgba(255,255,255,0.15);
    padding: 15px;
    border-radius: 10px;
}

.progress {
    height: 6px;
    background: rgba(255,255,255,0.3);
}

.progress-bar {
    width: 60%;
    background: #fff;
}

/* MAIN */
.main-content {
    flex: 1;
    min-width: 0;          /* 🔥 obligatoire avec flex */
    overflow-x: hidden;   /* empêche le scroll global */
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* TOPBAR */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 5px;
    border-radius: 12px;
}

#rechercher {
    border: none;
    outline: none;
    width: 300px;
}

.btn-logout {
    background: none;
    border: none;
    color: black;
    cursor: pointer;
    padding: 0;
    font-size: 18px;
}

.btn-logout:hover {
    color: #e74c3c; /* rouge déconnexion */
}

.top-icons i {
    margin-left: 15px;
    cursor: pointer;
}

/* QUICK ACCESS */
.section-title {
    margin: 20px 0 10px;
    font-weight: 600;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.quick-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
}

.quick-card i {
    font-size: 28px;
    color: #1e5bd8;
    margin-bottom: 10px;
}

/* TABLE */
.table {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}
/* SIDEBAR FIXE SUR ORDINATEUR */
@media (min-width: 769px) {
    .sidebar {
        position: fixed;
        top: 0px;
        left: 0;
        height: calc(100vh - 84px);
        z-index: 100;
    }

    .main-content {
        margin-left: 265px; /* largeur exacte du menu */
    }
}

/* RESPONSIVE MOBILE */

@media (max-width: 768px) {

    /* CONTAINER */
    .app-container {
        overflow-x: hidden;
    }

    /* SIDEBAR CACHÉE */
    .sidebar {
        position: fixed;
        top: 84px;
        left: -265px;           /* 🔥 cachée */
        height: calc(100vh - 84px);
        z-index: 1000;
        transition: left 0.3s ease;
    }

    /* SIDEBAR VISIBLE */
    .sidebar.active {
        left: 0;
    }

    /* MAIN */
    .main-content {
        padding: 15px;
        width: 100%;
    }

    /* TABLE */
    #dataTable {
        min-width: 800px;
    }

    /* SEARCH */
    .topbar input {
        width: 100%;
        max-width: 180px;
    }
}
