/* Layout de base */
.page-wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--background-color);
    padding-top: 60px; /* Account for fixed navbar */
}

.page-wrapper.with-sidebar {
    /* 280px, matching base.css. These two files disagreed (250 here vs 280
       there) and layout.css won, so the sidebar was 30px narrower than the
       rest of the CSS assumed: "Monitoring" + its BUSINESS+ badge no longer
       fit on one line and .sidebar-nav's overflow-x:hidden silently clipped
       the last letter. Keep this in sync with .sidebar width below. */
    padding-left: 280px;
    padding-bottom: 2rem; /* Add bottom spacing */
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #0f172a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    width: 280px;  /* keep in sync with .page-wrapper.with-sidebar padding-left */
    background: #0f172a;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem 0;
}

.sidebar-footer {
    flex-shrink: 0;
}

@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0);
    }
    /* Desktop keeps the sidebar permanently open, so the hamburger toggle is
       dead weight next to the logo (Wajdi: "drop the burger"). Hide it here;
       it stays available under 769px where the sidebar is off-canvas. */
    .sidebar-toggle {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .page-wrapper.with-sidebar {
        padding-left: 0;
    }

    .sidebar {
        transform: translateX(-100%);
        z-index: 1001;
    }

    .sidebar.active {
        transform: translateX(0);
    }
}

.sidebar.active {
    transform: translateX(0);
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0; /* let flex children shrink so the content can use full width */
    margin-left: 0;
    margin-top: 0; /* Removed - page-wrapper handles top padding */
    /* Wajdi: "use more of the screen / the centre is too spaced". The content
       area sat inside 2rem side padding on top of the inner container padding,
       wasting ~24px of width per side. Trim the horizontal padding so the
       responsive grids fit more columns; keep the roomy top/bottom. */
    padding: 1.75rem 1.25rem 4rem;
}

/* @media (min-width: 768px) {
    .main-content {
        margin-left: 250px;
    }
} */

/* Dropdown menu */
.user-dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-width: 200px;
}

.dropdown-menu.active {
    display: block;
}
