.layout-admin {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding-left: 160px;
  background: $layout_admin_background;
  padding-top: 60px;
}

// Sidebar section:

.layout-admin__sidebar-container {
  z-index: 99;
  width: 160px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: $layout_admin_sidebar_background;
}

.layout-admin__logo-container {
  text-align: center;
  padding: 15px 0;
  background: darken($layout_admin_sidebar_background, 10);

  img {
    max-width: 50%;
  }
}

.layout-admin__menu-container {
  
}

.layout-admin__menu-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
  margin-top: 7.5px;

  li {
    margin: 0;
  }
}

.layout-admin__menu-item {
  border-bottom: solid 1px lighten($layout_admin_sidebar_background, 2);
  position: relative;
  font-family: 'latolight';

  &:hover {
    background: darken($layout_admin_sidebar_background, 5);

    .layout-admin__menu-sublist {
      display: block;
    }
  }
}

.layout-admin__menu-item--active {

  &:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 2px;
    background-color: $layout_admin_sidebar_color_text;
  }

  .layout-admin__menu-sublist {
    position: static;
    display: block;
    width: 160px;

    a {
      padding: 8px;
      padding-left: 14px;
      font-size: 0.9em;
    }
  }
}

.layout-admin__menu-item-link {
  display: block;
  padding: 10px 10px;
  text-decoration: none;
  color: $layout_admin_sidebar_color_text;
  outline: 0;
  cursor: pointer;

  i {
    display: inline-block;
    margin-right: 3px;
  }

  &:focus {
    background: darken($layout_admin_sidebar_background, 5);
  }

  &:hover {
    background: darken($layout_admin_sidebar_background, 5);
  }
}

.layout-admin__menu-item-link--active {
  position: relative;
  background: darken($layout_admin_sidebar_background, 3);
}

.layout-admin__menu-sublist {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  list-style-type: none;
  padding: 0;
  margin: 0;
  background: darken($layout_admin_sidebar_background, 5);
  width: 140px;
  overflow: hidden;
}

.layout-admin__menu-subitem {
  border-bottom: solid 1px darken($layout_admin_sidebar_background, 3);
}

.layout-admin__menu-subitem-link {
  display: block;
  padding: 10px 10px;
  text-decoration: none;
  color: $layout_admin_sidebar_color_text;
  outline: 0;
  cursor: pointer;

  &:hover {
    background: darken($layout_admin_sidebar_background, 2);
  }
}

// Header section:

.layout-admin__header-container {
  background: $layout_admin_header_background;
  box-shadow: 0px 11px 20px rgba(41,59,90,0.08);
  position: fixed;
  top: 0;
  left: 160px;
  width: calc(100% - 160px);
  height: 55px;
  z-index: 99;
}

.layout-admin__title-container {
  display: inline-block;
  margin-left: 10px;
  margin-top: 15px;
  max-width: 30%;

  h1 {
    color: $layout_admin_header_color_title;
    font-family: 'latolight';
    text-transform: uppercase;
    font-size: 20px;
    margin: 0;
    padding-right: 30px;
    width: 100%;
    @include oneLineText;
  }
}

.layout-admin__back-container {
  display: inline-block;
  margin-left: 15px;
  margin-top: 8px;
  float: left;

  .button {
    color: $layout_admin_header_color_back_text;
    background-color: $layout_admin_header_color_back_background;

    &:hover {
      background-color: $layout_admin_header_color_back_background_hover;
    }
  }
}

.layout-admin__profile-container {
  max-width: 200px;
  height: 55px;
  float: right;
  padding: 10px;
  position: relative;
  cursor: pointer;
  background-color: $layout_admin_header_background;
}

.layout-admin__profile-image {
  width: 35px;
  height: 35px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  border-radius: 50%;
  display: inline-block;
  float: left;
}

.layout-admin__profile-info {
  padding: 4px 10px;
  padding-left: 45px;
  color: $layout_admin_header_color_text;

  span:last-child {
    font-size: 0.8em;
    position: relative;
    top: -3px;
  }
}

.layout-admin__profile-menu-list {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: $layout_admin_header_background;
  margin: 0;
  padding: 0;
  list-style-type: none;
  width: 100%;
  min-width: 160px;
  overflow: hidden;
  box-shadow: 0px 11px 20px rgba(41,59,90,0.08);
  z-index: 99;
}

.layout-admin__profile-menu-list--active {
  display: block;
}

.layout-admin__profile-menu-item {
  margin: 0;
}

.layout-admin__profile-menu-link {
  text-decoration: none;
  display: block;
  padding: 10px 10px;
  font-size: 0.8em;
  color: $layout_admin_header_color_profile_menu_text;
  background-color: $layout_admin_header_color_profile_menu_background;
  border-top: solid 1px darken($layout_admin_header_color_profile_menu_background, 10);

  &:hover {
    background-color: $layout_admin_header_color_profile_menu_background_hover;
  }
}

.layout-admin__widgets-container {
  display: inline-block;
  float: right;
  margin-top: 16px;
  margin-right: 10px;
}

.layout-admin__widget-container {
  position: relative;
  display: inline-block;
  margin: 0 2px;
}

.layout-admin__widget-container--active {

  .layout-admin__widget-button {
    background-color: $layout_admin_header_color_widget_icon_background_hover;
  }

  .layout-admin__widget-content {
    display: block;
  }
}

.layout-admin__widget-button {
  font-size: 1em;
  color: $layout_admin_header_color_widget_icon;
  display: block;
  background-color: $layout_admin_header_color_widget_icon_background;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  position: relative;

  i {
    @include centerElement(xy);
  }

  &:hover, &:active, &:focus {
    outline: 0;
    background-color: $layout_admin_header_color_widget_icon_background_hover;
  }
}

.layout-admin__widget-content {
  display: none;
  background-color: $layout_admin_header_background;
  position: absolute;
  top: calc(100% + 5px);
  right: -30px;
  padding: 10px;
  width: 400px;
  min-height: 50px;
  box-shadow: 0px 11px 20px rgba(41,59,90,0.08);
  border: solid 2px darken($color_white, 5);
  border-radius: 0;
  z-index: 99;
  font-size: 0.8em;
}

// Main section:

.layout-admin__container {
  min-height: 100vh;
  padding: 15px;
}

// Partials:

.layout-admin__partials-container {

}

// *********************************************************************
// Responsive layout:

@media(max-width:767px) {
  .layout-admin {
    padding-left: 60px;
  }

  .layout-admin__header-container {
    left: 60px;
    width: calc(100% - 60px);
  }

  .layout-admin__logo-container {
    padding: 0;
    height: 55px; 
    img {
      display: none;
    }
  }

  .layout-admin__sidebar-container {
    width: 60px;
  }

  .layout-admin__menu-item--active {
    
    .layout-admin__menu-sublist {
      position: absolute;
      display: none;

      a {
        padding: 10px 10px;
        font-size: 1em;
      }
    }
  }

  .layout-admin__menu-item-link {
    text-align: center;

    span {
      display: none;
    }

    i {
      margin-right: 0;
    }
  }

  .layout-admin__profile-info {
    display: none;
  }

  .layout-admin__widget-content {
    position: fixed;
    top: 50px;
    right: 0;
    width: calc(100% - 60px);
  }
}