/* =====================================================
   APP HEADER
   ===================================================== */
.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 12px;
    background-color: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0,0,0,.10);
    height: 56px;
    box-sizing: border-box;
}

.app-body {
    position: relative;
    padding: 0;
    flex: 1;
    padding-top: 56px;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    font-size: 22px;
    margin-right: 4px;
    border-radius: 4px;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background-color: rgba(0,0,0,.10);
}

.flex-grow {
    flex-grow: 1;
}

/* =====================================================
   PROFILE MENU (AppBarItems)
   ===================================================== */
.profile-menu-wrapper {
    position: relative;
    display: inline-block;
}

.profile-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    color: inherit;
}

.profile-btn:hover {
    background-color: rgba(0,0,0,.06);
}

.profile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 200px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    z-index: 2000;
    padding: 6px 0;
}

.profile-dropdown.open {
    display: block;
}

.profile-dropdown a,
.profile-dropdown button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 16px;
    text-decoration: none;
    color: #333;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    box-sizing: border-box;
}

.profile-dropdown a:hover,
.profile-dropdown button:hover {
    background-color: #f5f5f5;
}

.profile-dropdown .logout-btn {
    color: #d32f2f;
}


/* =====================================================
   SIDEBAR (BodyChantier / BodyAdmin)
   ===================================================== */


.app-sidebar {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    overflow-x: hidden;
    background: #212529;
    color: #dee2e6;
    transition: width 0.25s ease, min-width 0.25s ease;
    flex-shrink: 0;
/*    display: flex;*/
    flex-direction: column;
    position: sticky;
    top: 56px;
    align-self: flex-start;
}

.app-sidebar.collapsed {
    width: 0;
    min-width: 0;
}

.sidebar-chantier-name {
    padding: 10px 14px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: #dee2e6;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sidebar-item:hover,
.sidebar-item:focus {
    background-color: rgba(255,255,255,.08);
    color: #fff;
    outline: none;
}

.sidebar-item.active {
    background-color: rgba(255,255,255,.15);
    color: #fff;
    border-left: 3px solid #0d6efd;
    padding-left: 11px;
}

.sidebar-item i {
    font-size: 16px;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

/* Sidebar groups (accordion) */
.sidebar-group > .sidebar-group-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: #dee2e6;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sidebar-group > .sidebar-group-toggle:hover {
    background-color: rgba(255,255,255,.08);
    color: #fff;
}

.sidebar-group > .sidebar-group-toggle i.toggle-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform .2s;
}

.sidebar-group > .sidebar-group-toggle.open i.toggle-arrow {
    transform: rotate(90deg);
}

.sidebar-sub {
    display: none;
    background-color: rgba(0,0,0,.2);
}

.sidebar-sub.open {
    display: block;
}

.sidebar-sub .sidebar-item {
    padding-left: 38px;
    font-size: 13px;
}

.rz-tabview-panel {
    overflow: hidden !important;
}

/* =====================================================
   RESPONSIVE MOBILE (? 768px)
   ===================================================== */
@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 56px;
        height: calc(100vh - 56px);
        z-index: 9990;
        transform: translateX(0);
        transition: transform 0.25s ease, width 0.25s ease;
        width: 260px !important;
        min-width: 260px !important;
    }

    .app-sidebar.collapsed {
        transform: translateX(-100%);
        width: 260px !important;
        min-width: 260px !important;
    }

    .sidebar-mobile-overlay {
        position: fixed;
        inset: 56px 0 0 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 899;
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }

    .app-body {
        width: 100% !important;
    }
}
