/* ============================================
   SIDEBAR COMPACT - Réduction des espacements
   ============================================ */

/* ============================================
   GLOBAL SEARCH - Recherche PDS
   ============================================ */

.header-search {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 8px;
}

.search-results.active {
    display: block;
}

.search-results-header {
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid #f1f5f9;
}

.search-result-item:hover {
    background: #f0f9ff;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    margin-bottom: 2px;
}

.search-result-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #64748b;
}

.search-result-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.search-result-meta i {
    font-size: 10px;
    opacity: 0.7;
}

.search-result-action {
    color: #3b82f6;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s;
}

.search-result-item:hover .search-result-action {
    opacity: 1;
}

.search-no-results {
    padding: 24px;
    text-align: center;
    color: #94a3b8;
}

.search-no-results i {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.search-loading {
    padding: 24px;
    text-align: center;
    color: #64748b;
}

.search-loading i {
    margin-right: 8px;
}

/* Menu principal - moins de padding */
.sidebar-menu {
    padding: 10px 8px !important;
}

/* Sections - marges réduites */
.menu-section-title {
    margin: 14px 0 6px 10px !important;
    font-size: 9px !important;
}

/* Items du menu - plus compacts */
.menu-item {
    padding: 8px 12px !important;
    margin: 2px 4px !important;
    font-size: 13px !important;
}

/* Footer - padding réduit */
.sidebar-footer {
    padding: 10px 12px !important;
}

/* Bouton déconnexion - plus compact */
.btn-logout {
    padding: 10px 14px !important;
}

/* Header logo - un peu plus compact */
.sidebar-header {
    padding: 8px 12px !important;
}

.sidebar-logo {
    max-height: 40px !important;
}

/* ============================================
   SIDEBAR BACKDROP - Overlay pour tous écrans
   ============================================ */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   SIDEBAR TOGGLE - Tous écrans
   ============================================ */
.sidebar {
    z-index: 1000 !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sidebar.active {
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15) !important;
}

/* Improve scroll in sidebar */
.sidebar-menu {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Logout button always visible */
.btn-logout {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Menu toggle button - toujours visible */
.menu-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f1f5f9;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-toggle:hover {
    background: #e2e8f0;
}

.menu-toggle i {
    font-size: 18px;
    color: #64748b;
}