/* ============================================
   LAYOUT GENERALE
============================================ */

body {
    margin: 0;
    background: #f4f5f8;
    font-family: Inter, sans-serif;
    --sidebar-expanded: 240px;
    --sidebar-collapsed-desktop: 78px;
    --sidebar-collapsed-mobile: 56px;
}

.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR (fissa)
============================================ */
.sidebar {
    width: 240px;
    min-height: 100vh;
    background: #1f2937;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

/* ============================================
   CONTENT WRAPPER
============================================ */
.content-wrapper {
    margin-left: var(--sidebar-expanded);
    width: calc(100% - var(--sidebar-expanded));
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease, width 0.25s ease;
}

/* Collapsed desktop */
body.sidebar-collapsed .content-wrapper {
    margin-left: var(--sidebar-collapsed-desktop);
    width: calc(100% - var(--sidebar-collapsed-desktop));
}

/* ============================================
   PAGE CONTENT
============================================ */
.page-content {
    padding: 20px;
    margin-top: 60px; /* spazio per la topbar */
    position: relative;
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 800px) {

    .sidebar {
        left: 0;
    }

    /* Su mobile il contenuto si sposta in base alla sidebar */
    .content-wrapper {
        margin-left: var(--sidebar-expanded);
        width: calc(100% - var(--sidebar-expanded));
    }

    body.sidebar-collapsed .content-wrapper {
        margin-left: var(--sidebar-collapsed-mobile);
        width: calc(100% - var(--sidebar-collapsed-mobile));
    }
}
