/* ================= RESET ================= */

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
  font-family:Arial;
}

html,body{
  height:100%;
}

/* HIDE CHECKBOX */
#menu-toggle{
  display:none;
}

/* ================= BODY ================= */

body{
  background:#f1f5f9;
  
}

/* ================= HEADER ================= */

.header{
  height:56px;
  width:100%;
  background:white;
  border-bottom:1px solid #eee;
  display:grid;
  grid-template-columns:56px auto 56px;
  align-items:center;
  padding:0 8px;
  position:sticky;
  top:0;
  z-index:1000;
}

.menu{
  display:grid;
  place-items:center;
}

.menu label{
  cursor:pointer;
  height:40px;
  width:40px;
  display:grid;
  place-items:center;
  border-radius:10px;
  transition:0.2s;
}

.menu label:hover{
  background:#f1f5f9;
}

.name{
  background:linear-gradient(90deg,#00c6ff,#0072ff);
  -webkit-background-clip:text;
  color:transparent;
  font-weight:600;
  font-size:18px;
}

/* ================= LAYOUT ================= */

.layout{
  display:grid;
  grid-template-columns:220px 1fr;
  gap:16px;
  height:100%;
  min-height:0; /* IMPORTANT */
}

/* ================= SIDEBAR ================= */

.sidebar-container{
  height:100%;
  min-height:0;
}

/* SIDEBAR PANEL */

.sidebar{
  display:grid;
  grid-template-columns:56px 1fr;
  height:100%;
  min-height:0;
  background:white;

  overflow-y:auto; /* 🔥 FIX SCROLL */

  border-right:1px solid #e5e7eb;
  box-shadow:6px 0 20px rgba(0,0,0,0.08);
}

/* LEFT ICON BAR */

.sidebar .left{
  display:grid;
  grid-auto-rows:56px;
  background:#f3f4f6;
  border-right:1px solid #e5e7eb;
  padding-top:8px;
}

.sidebar .left div{
  display:grid;
  place-items:center;
}

/* RIGHT MENU */

.sidebar .right{
  display:grid;
  grid-auto-rows:56px;
  padding:0 18px;
  padding-top:8px;
}

.sidebar .right div{
  display:grid;
  align-items:center;
  cursor:pointer;
  padding-left:8px;
  transition:0.2s;
}

.sidebar .right div:hover{
  background:#f1f5f9;
}

/* ================= CONTENT ================= */

.content-container{
  border:0px solid yellow;
  height:100%;
  min-height:0;
  display:flex;
  flex-direction:column;
}

.content{
 background:white;
 grid-auto-rows:min-content;
  row-gap:16px;
  overflow-y:auto;
  min-height:0;
}

.content div
{
padding:24px;
height:100%;
background:white;
overflow:scroll;
}

/* ================= MOBILE ================= */

@media (max-width:768px){

  .layout{
    grid-template-columns:1fr;
  }

  /* SIDEBAR WRAPPER */
  .sidebar-container{
    position:fixed;
    top:56px;
    left:0;
    width:100%;
    height:calc(100% - 56px);
    z-index:1000;
    pointer-events:none;
  }

  /* SIDEBAR PANEL */
  .sidebar{
    position:absolute;
    left:-220px;
    width:220px;
    height:100%;
    transition:0.3s ease;
    z-index:2;
  }

  /* OVERLAY */
  .overlay{
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.25);
    opacity:0;
    transition:0.3s;
    z-index:1;
  }

  /* ===== OPEN STATE ===== */

  #menu-toggle:checked ~ .layout .sidebar{
    left:0;
  }

  #menu-toggle:checked ~ .layout .sidebar-container{
    pointer-events:auto;
  }

  #menu-toggle:checked ~ .layout .overlay{
    opacity:1;
  }
}