<style>
    /* Premium modern styling for the top header */
    .navbar-custom {
        background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%) !important;
        padding: 0.5rem 1.5rem;
        min-height: 3.5rem;
        /* Aligns perfectly to the right side of the 250px scrollable sidebar */
        margin-left: 250px; 
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
    }
    
    .navbar-brand-text {
        font-size: 1.2rem;
        font-weight: 700;
        letter-spacing: 0.5px;
    }

    /* Polished profile button pill design */
    .user-profile-dropdown {
        color: rgba(255, 255, 255, 0.95) !important;
        font-weight: 600;
        font-size: 14px;
        background: rgba(255, 255, 255, 0.15);
        padding: 8px 18px;
        border-radius: 50px;
        text-decoration: none !important;
        transition: all 0.2s ease;
        display: inline-flex;
        align-items: center;
    }

    .user-profile-dropdown:hover {
        background: rgba(255, 255, 255, 0.25);
        color: #ffffff !important;
    }

    /* Context menu styling */
    .custom-dropdown-menu {
        border: none !important;
        border-radius: 12px !important;
        margin-top: 10px !important;
        padding: 6px 0 !important;
    }

    .custom-dropdown-menu .dropdown-item {
        padding: 10px 20px;
        font-size: 13px;
        font-weight: 500;
        color: #334155;
        transition: background 0.2s;
    }

    .custom-dropdown-menu .dropdown-item:hover {
        background-color: #f1f5f9;
        color: #1e293b;
    }

    .logo {
        margin: auto;
        font-size: 20px;
        background: white;
        padding: 7px 11px;
        border-radius: 50%;
        color: #000000b3;
    }

    /* Mobile responsive breakout fallback rule */
    @media (max-width: 768px) {
        .navbar-custom {
            margin-left: 0;
        }
    }
</style>

<nav class="navbar navbar-dark fixed-top navbar-custom">
    <div class="container-fluid d-flex justify-content-between align-items-center">
        
        <div class="text-white d-flex align-items-center">
            <span class="navbar-brand-text">
                <i class="fa fa-building mr-2"></i>
                <b><?php echo isset($_SESSION['system']['name']) ? $_SESSION['system']['name'] : 'Alam Group Rental Management System' ?></b>
            </span>
        </div>
        
        <div class="float-right">
            <div class="dropdown">
                <a href="#" class="dropdown-toggle user-profile-dropdown" id="account_settings" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    <i class="fa fa-user-circle mr-2" style="font-size: 16px;"></i>
                    <?php echo isset($_SESSION['login_name']) ? $_SESSION['login_name'] : 'Administrator' ?>
                </a>
                <div class="dropdown-menu dropdown-menu-right custom-dropdown-menu shadow" aria-labelledby="account_settings">
                    <a class="dropdown-item" href="javascript:void(0)" id="manage_my_account">
                        <i class="fa fa-cog mr-2 text-muted"></i> Manage Account
                    </a>
                    <div class="dropdown-divider my-1" style="border-top: 1px solid #f1f5f9;"></div>
                    <a class="dropdown-item text-danger" href="ajax.php?action=logout">
                        <i class="fa fa-power-off mr-2"></i> Logout
                    </a>
                </div>
            </div>
        </div>

    </div>
</nav>

<script>
    // Handles launching the account management profile modal overlay
    $('#manage_my_account').click(function(){
        uni_modal("Manage Account", "manage_user.php?id=<?php echo isset($_SESSION['login_id']) ? $_SESSION['login_id'] : '' ?>&mtype=own")
    })
</script>