 /* ============================================
   e-UBIM - Styles UBIM (Rouge/Bordeaux)
   ============================================ */

:root {
    --ubim-primary: #E11B14;
    --ubim-secondary: #C00802;
    --ubim-dark: #1F0A0C;
    --ubim-light: #FBECED;
    --ubim-accent: #F7D0D1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background-color: #f9f9f9;
    color: #1C1B1B;
}

body {
    display: flex;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 260px;
    height: 100vh;
    background-color: #1F0A0C;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, width 0.3s ease;
    overflow: hidden;
}

/* Zones de la sidebar */
.sidebar-logo {
    flex-shrink: 0;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.sidebar-footer {
    flex-shrink: 0;
}

/* Liens */
.sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    border-radius: 8px;
    padding: 10px 14px;
    border-left: 3px solid transparent;
    white-space: nowrap;
    text-decoration: none;
    display: flex;
    align-items: center;
}
.sidebar .nav-link:hover {
    background-color: rgba(225, 27, 20, 0.15);
    color: white;
    border-left-color: #E11B14;
}
.sidebar .nav-link.active {
    background-color: rgba(225, 27, 20, 0.25);
    color: white;
    border-left-color: #E11B14;
    font-weight: 600;
}
.sidebar .nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* ========== CONTENU PRINCIPAL ========== */
#page-content {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
    padding: 20px;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

/* ========== TOGGLE (caché par défaut) ========== */
#toggleSidebar {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1100;
    background-color: #1F0A0C;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: white;
    font-size: 1.4rem;
    display: none;
    cursor: pointer;
}

/* ========== DESKTOP : réduction de la sidebar ========== */
@media (min-width: 769px) {
    body.sidebar-closed .sidebar {
        width: 70px !important;
    }
    body.sidebar-closed #page-content {
        margin-left: 70px !important;
        width: calc(100% - 70px) !important;
    }
    body.sidebar-closed .nav-text,
body.sidebar-closed .sidebar-logo h6 {
    display: none !important;
}

/* Conserver l'image du logo, centrée et légèrement réduite */
body.sidebar-closed .sidebar-logo img {
    display: block !important;
    margin: 0 auto;
    height: 35px;
    width: auto;
}
    body.sidebar-closed .nav-link {
        justify-content: center !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    body.sidebar-closed .nav-link i {
        margin-right: 0 !important;
        font-size: 1.4rem;
    }
    body.sidebar-closed #submenuParametres {
        display: none !important;
    }
    #toggleSidebar {
        display: block !important;
    }
}

/* ========== MOBILE : sidebar cachée, affichée via toggle ========== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 260px !important;
    }
    .sidebar.mobile-show {
        transform: translateX(0);
    }
    #page-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding-top: 50px;
    }
    #toggleSidebar {
        display: block !important;
    }
    #overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
    }
    #overlay.show {
        display: block;
    }
}

/* ========== CARTES, BOUTONS, TABLES ========== */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.btn-danger {
    background-color: #E11B14;
    border-color: #E11B14;
    color: white;
}
.btn-danger:hover {
    background-color: #C00802;
}
.btn-outline-danger {
    color: #E11B14;
    border-color: #E11B14;
}
.btn-outline-danger:hover {
    background-color: #E11B14;
    color: white;
}
.table thead {
    background-color: #1F0A0C;
    color: white;
}
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}
.table td, .table th {
    white-space: nowrap;
}

/* Réduire la police sur mobile */
@media (max-width: 768px) {
    .table td, .table th {
        font-size: 0.78rem;
        padding: 6px 4px;
    }
}