/* assets/css/admin.css */
body.admin-body {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100vh;
    font-family: 'Inter', -apple-system, sans-serif; /* Setup d'une fonte moderne typique SaaS */
}

#wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
    width: 100vw;
}

#sidebar-wrapper {
    min-height: 100vh;
    width: 260px;
    transition: width 0.25s ease-out, margin 0.25s ease-out;
    background-color: #1e293b !important; /* Couleur slate/dark bleu, tres tendance SaaS */
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 1000;
}

#page-content-wrapper {
    flex: 1;
    overflow-y: auto;
    background-color: #f8fafc;
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents flex children from overflowing */
}

#page-content-wrapper .navbar {
    position: sticky;
    top: 0;
    z-index: 1020;
}

.sidebar-heading {
    color: #f1f5f9;
}

.list-group-item {
    border: none;
    padding: 1rem 1.5rem;
    transition: all 0.2s ease-in-out;
    background-color: transparent !important;
    color: #cbd5e1 !important;
    font-weight: 500;
}

.list-group-item:hover, .list-group-item.active {
    background-color: rgba(255,255,255,0.1) !important;
    color: #fff !important;
    border-left: 4px solid #3b82f6;
}

/* Desktop behavior: Mini sidebar instead of disappearing */
@media (min-width: 769px) {
    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0;
        width: 80px;
    }
    #wrapper.toggled #sidebar-wrapper .sidebar-heading img {
        display: none;
    }
    #wrapper.toggled #sidebar-wrapper .sidebar-heading {
        padding: 24px 0 !important;
    }
    #wrapper.toggled #sidebar-wrapper .sidebar-heading::before {
        content: '\f1ad'; /* building */
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        font-size: 28px;
        color: #fff;
    }
    #wrapper.toggled #sidebar-wrapper .list-group-item {
        text-align: center !important;
        padding: 1rem 0 !important;
        white-space: nowrap;
        font-size: 0 !important; 
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    #wrapper.toggled #sidebar-wrapper .list-group-item i {
        font-size: 1.25rem !important;
        margin: 0 !important; /* Forces removal of me-3 etc. */
    }
    #wrapper.toggled #sidebar-wrapper .sidebar-icon-right {
        display: none !important;
    }
    #wrapper.toggled #sidebar-wrapper .badge {
        position: absolute !important;
        top: 8px !important;
        right: 10px !important;
        font-size: 0.65rem !important;
        padding: 0.35em 0.6em !important;
        margin: 0 !important;
    }
    #wrapper.toggled #sidebar-wrapper .mt-auto .text-white {
        font-size: 0 !important;
    }
    #wrapper.toggled #sidebar-wrapper .mt-auto .text-white i {
        font-size: 1.5rem !important;
        margin: 0 !important;
    }
    #wrapper.toggled #sidebar-wrapper .btn-light {
        font-size: 0 !important;
        padding: 0 !important;
        width: 44px !important;
        height: 44px !important;
        margin: 0 auto !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        border-radius: 50% !important; /* Make it a perfect circle */
    }
    #wrapper.toggled #sidebar-wrapper .btn-light i {
        font-size: 1.25rem !important;
        margin: 0 !important;
    }
    #wrapper.toggled #sidebar-wrapper .list-group-item.bg-danger,
    #wrapper.toggled #sidebar-wrapper .list-group-item.bg-primary {
        background-color: transparent !important;
    }
    #wrapper.toggled #sidebar-wrapper .list-group-item.bg-danger i {
        color: #dc3545 !important;
    }
    #wrapper.toggled #sidebar-wrapper .list-group-item.bg-primary i {
        color: #0d6efd !important;
    }
}

/* Mobile behavior: hide completely */
@media (max-width: 768px) {
    #sidebar-wrapper {
        margin-left: -260px;
    }
    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0;
        width: 260px !important;
    }
}

/* Modifs génériques Dashboard Card */
.card {
    border-radius: 12px;
}
.border-start.border-4 {
    border-left-width: 4px !important;
    border-radius: 12px;
}

/* SweetAlert2 Full-Height Fix */
body.swal2-height-auto, html.swal2-height-auto {
    height: 100vh !important;
}

/* --- HARMONIZED UPGRADE BANNERS --- */
.upgrade-banner { 
    background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%); 
    color: white !important; border-radius: 24px; padding: 24px 32px; 
    margin-bottom: 2.5rem; display: flex; align-items: center; 
    justify-content: space-between; box-shadow: 0 15px 35px rgba(59, 130, 246, 0.25); 
    border: 1px solid rgba(255,255,255,0.15);
    transition: transform 0.3s ease;
}
.upgrade-banner:hover { transform: scale(1.005); }
.upgrade-content { display: flex; align-items: center; gap: 20px; }
.upgrade-icon { 
    width: 55px; height: 55px; background: rgba(255,255,255,0.2); 
    border-radius: 16px; display: flex; align-items: center; 
    justify-content: center; font-size: 1.6rem; color: white;
}
.upgrade-text h5 { margin: 0; font-weight: 800; font-size: 1.25rem; color: white !important; letter-spacing: -0.5px; }
.upgrade-text p { margin: 0; font-size: 0.95rem; opacity: 0.9; font-weight: 500; color: white !important; }
.upgrade-btn { 
    background: white; color: #3b82f6 !important; font-weight: 800; padding: 12px 28px; 
    border-radius: 50px; text-decoration: none; font-size: 0.9rem; 
    transition: all 0.2s; white-space: nowrap; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.upgrade-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.15); color: #2563eb !important; }

@media (max-width: 991px) {
    .upgrade-banner { flex-direction: column; text-align: center; gap: 24px; padding: 30px 20px; }
    .upgrade-content { flex-direction: column; }
    .upgrade-text p { max-width: 400px; }
}
