/* =========================================================
   PAGE SHELL
========================================================= */

.site-shell {
  min-width: 0;
  overflow: visible;
}

.site-shell--with-sidebar {
  position: relative;

  display: grid;
  grid-template-columns:
    var(--stake-sidebar-width)
    minmax(0, 1fr);

  align-items: stretch;

  min-height: calc(100vh - var(--stake-header-height));

  min-height: calc(100dvh - var(--stake-header-height));

  background: linear-gradient(90deg, #091f2b 0, #091f2b var(--stake-sidebar-width), #102735 var(--stake-sidebar-width), #102735 100%);

  overflow: visible;
}

/* =========================================================
   DESKTOP GRID PLACEMENT
========================================================= */

.site-shell--with-sidebar > .site-sidebar {
  grid-column: 1;
  grid-row: 1;
}

.site-shell--with-sidebar > .site-shell__main {
  grid-column: 2;
  grid-row: 1;

  width: 100%;
  min-width: 0;
}

.site-shell__main {
  width: 100%;
  min-width: 0;

  overflow: visible;
}

/* =========================================================
   DESKTOP SIDEBAR
========================================================= */

.site-sidebar {
  position: sticky;

  top: var(--stake-header-height);

  z-index: 50;

  align-self: start;

  width: var(--stake-sidebar-width);

  height: calc(100vh - var(--stake-header-height));

  height: calc(100dvh - var(--stake-header-height));

  padding: 18px 16px 36px;

  overflow-x: hidden;
  overflow-y: auto;

  border-right: 1px solid rgba(154, 196, 219, 0.06);

  background: linear-gradient(180deg, #0a2230 0%, #081e2a 100%);

  scrollbar-width: thin;

  scrollbar-color: rgba(126, 160, 179, 0.28) transparent;
}

/* =========================================================
   SCROLLBAR
========================================================= */

.site-sidebar::-webkit-scrollbar {
  width: 4px;
}

.site-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.site-sidebar::-webkit-scrollbar-thumb {
  border-radius: 10px;

  background: rgba(126, 160, 179, 0.24);
}

.site-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(126, 160, 179, 0.4);
}

/* =========================================================
   NAV
========================================================= */

.site-sidebar__nav {
  width: 100%;
}

/* =========================================================
   MENU RESET
========================================================= */

.site-sidebar__menu,
.site-sidebar__menu ul {
  width: 100%;

  margin: 0;
  padding: 0;

  list-style: none;
}

.site-sidebar__menu li {
  position: relative;

  width: 100%;

  margin: 0;
  padding: 0;
}

.site-sidebar__menu > li + li {
  margin-top: 4px;
}

/* =========================================================
   TOP BUTTON ITEMS
========================================================= */

.site-sidebar__menu > .menu-item--top-button {
  display: none;
}
/* =========================================================
   MENU LINK
========================================================= */

.site-sidebar__menu a {
  position: relative;

  display: flex;
  align-items: center;

  gap: 12px;

  width: 100%;
  min-height: 46px;

  padding: 9px 12px;

  border-radius: 7px;

  color: #c5d5de;

  font-size: 14px;
  line-height: 1.3;
  font-weight: 650;

  text-decoration: none !important;

  transition:
    color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.site-sidebar__menu .menu-item--no-icon > a {
  padding-left: 42px;
}

/* =========================================================
   LABEL
========================================================= */

.site-sidebar__label {
  flex: 1;

  min-width: 0;

  color: inherit;

  overflow-wrap: anywhere;
}

/* =========================================================
   ICON
========================================================= */

.site-sidebar__icon {
  flex: 0 0 18px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 18px;
  height: 18px;

  color: #829eae;

  transition:
    color 0.18s ease,
    transform 0.18s ease,
    filter 0.18s ease;
}

.site-sidebar__icon svg {
  display: block;

  width: 18px;
  height: 18px;

  fill: none;

  stroke: currentColor;

  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-sidebar__icon--custom {
  width: 19px;
  height: 19px;
}

.site-sidebar__icon-image {
  display: block;

  width: 19px;
  height: 19px;

  object-fit: contain;
}

/* =========================================================
   MENU HOVER
========================================================= */

@media (hover: hover) and (pointer: fine) {
  .site-sidebar__menu a:hover {
    color: #ffffff;

    background: linear-gradient(90deg, rgba(55, 151, 228, 0.12), rgba(55, 151, 228, 0.025));

    transform: translateX(3px);

    box-shadow: inset 2px 0 0 rgba(88, 178, 244, 0.5);
  }

  .site-sidebar__menu a:hover .site-sidebar__icon {
    color: #8dcbf7;

    transform: translateY(-1px) scale(1.08);

    filter: drop-shadow(0 0 5px rgba(78, 172, 239, 0.26));
  }
}

/* =========================================================
   MANUAL HIGHLIGHT
========================================================= */

.site-sidebar__menu .menu-item--highlight > a {
  color: #ffffff;

  background: linear-gradient(90deg, rgba(42, 137, 215, 0.18), rgba(42, 137, 215, 0.04));
}

.site-sidebar__menu .menu-item--highlight > a .site-sidebar__icon {
  color: #8dccfa;
}

/* =========================================================
   SEPARATORS
========================================================= */

.site-sidebar__menu .menu-item--separator-before {
  margin-top: 13px;
  padding-top: 13px;

  border-top: 1px solid rgba(162, 199, 219, 0.12);
}

.site-sidebar__menu .menu-item--separator-after {
  margin-bottom: 13px;
  padding-bottom: 13px;

  border-bottom: 1px solid rgba(162, 199, 219, 0.12);
}

/* =========================================================
   RIGHT ICON
========================================================= */

.site-sidebar__menu .menu-item--icon-right > a .site-sidebar__icon {
  order: 2;

  margin-left: auto;
}

/* =========================================================
   SUBMENU
========================================================= */

.site-sidebar__menu .sub-menu {
  margin: 4px 0 8px;

  padding-left: 20px;
}

.site-sidebar__menu .sub-menu li + li {
  margin-top: 2px;
}

.site-sidebar__menu .sub-menu a {
  min-height: 38px;

  padding: 7px 10px;

  color: #8fa5b1;

  font-size: 12px;
  font-weight: 600;
}

/* =========================================================
   OVERLAY — HIDDEN ON DESKTOP
========================================================= */

.site-sidebar__overlay {
  display: none;
}

/* =========================================================
   MOBILE TOP ACTIONS
========================================================= */

.site-sidebar__mobile-actions {
  display: none;
}

/* =========================================================
   TABLET / MOBILE
========================================================= */

@media (max-width: 900px) {
  /* =======================================================
     PAGE SHELL
  ======================================================= */

  .site-shell--with-sidebar {
    display: block;

    min-height: 0;

    background: #102735;
  }

  /* =======================================================
     DRAWER
  ======================================================= */

  .site-sidebar {
    position: fixed;

    top: var(--stake-header-height);
    right: auto;
    bottom: 0;
    left: 0;

    z-index: 990;

    align-self: auto;

    width: min(320px, calc(100% - 46px));

    height: calc(100dvh - var(--stake-header-height));

    padding: 0 14px 28px;

    overflow-x: hidden;
    overflow-y: auto;

    border-right: 1px solid rgba(158, 199, 221, 0.09);

    background: linear-gradient(180deg, #0b2635 0%, #081d29 100%);

    box-shadow: 26px 12px 65px rgba(0, 0, 0, 0.38);

    transform: translate3d(-105%, 0, 0);

    visibility: hidden;

    pointer-events: none;

    will-change: transform;

    transition:
      transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0.28s ease;
  }

  .site-sidebar.is-open {
    transform: translate3d(0, 0, 0);

    visibility: visible;

    pointer-events: auto;
  }

  /* =======================================================
     MOBILE NAV POSITION
  ======================================================= */

  .site-sidebar__nav {
    width: 100%;

    padding-top: 10px !important;
    padding-bottom: 12px;
  }
  /* =======================================================
     MOBILE MENU
  ======================================================= */

  .site-sidebar__menu {
    padding-top: 0;
  }

  .site-sidebar__menu > li + li {
    margin-top: 4px;
  }

  .site-sidebar__menu a {
    min-height: 48px;

    padding: 9px 11px;

    gap: 12px;

    border-radius: 7px;

    font-size: 14px;
  }

  .site-sidebar__icon {
    flex-basis: 19px;

    width: 19px;
    height: 19px;
  }

  .site-sidebar__icon svg {
    width: 19px;
    height: 19px;
  }

  /* =======================================================
     OVERLAY
  ======================================================= */

  .site-sidebar__overlay {
    position: fixed;

    top: var(--stake-header-height);
    right: 0;
    bottom: 0;
    left: 0;

    z-index: 980;

    display: block;

    width: 100%;
    height: calc(100dvh - var(--stake-header-height));

    padding: 0;

    border: 0;

    background: rgba(2, 11, 17, 0.7);

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);

    transition:
      opacity 0.24s ease,
      visibility 0.24s ease;
  }

  .site-sidebar__overlay.is-open {
    opacity: 1;
    visibility: visible;

    pointer-events: auto;
  }

  /* =======================================================
     BODY LOCK
  ======================================================= */

  body.sidebar-is-open {
    overflow: hidden;
  }

  /* =======================================================
   MOBILE TOP ACTIONS
======================================================= */

  .site-sidebar__mobile-actions {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 8px;

    width: 100%;

    padding: 14px 0 14px;

    margin: 0;

    border-bottom: 1px solid rgba(162, 199, 219, 0.1);
  }

  /* =======================================================
   MOBILE TOP ACTION
======================================================= */

  .site-sidebar__mobile-action {
    display: flex;
    align-items: center;
    justify-content: flex-start;

    gap: 8px;

    min-width: 0;
    min-height: 44px;

    padding: 0 12px;

    border: 1px solid rgba(108, 182, 228, 0.12);

    border-radius: 8px;

    background: linear-gradient(180deg, rgba(33, 111, 163, 0.16) 0%, rgba(23, 77, 113, 0.09) 100%);

    color: #d7e6ee;

    font-size: 12.5px;
    line-height: 1.2;
    font-weight: 700;

    text-decoration: none !important;

    overflow: hidden;

    transition:
      color 0.18s ease,
      border-color 0.18s ease,
      background 0.18s ease,
      transform 0.18s ease;
  }

  /* =======================================================
   LABEL
======================================================= */

  .site-sidebar__mobile-action .site-sidebar__label {
    flex: 1;

    min-width: 0;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* =======================================================
   ICON
======================================================= */

  .site-sidebar__mobile-action .site-sidebar__icon {
    flex: 0 0 17px;

    width: 17px;
    height: 17px;

    color: #83c0e4;
  }

  .site-sidebar__mobile-action .site-sidebar__icon svg {
    width: 17px;
    height: 17px;
  }

  .site-sidebar__mobile-action .site-sidebar__icon-image {
    width: 17px;
    height: 17px;
  }

  /* =======================================================
   MOBILE ACTION HOVER
======================================================= */

  @media (hover: hover) and (pointer: fine) {
    .site-sidebar__mobile-action:hover {
      color: #ffffff;

      border-color: rgba(102, 184, 239, 0.22);

      background: linear-gradient(180deg, rgba(40, 133, 194, 0.22) 0%, rgba(26, 89, 130, 0.13) 100%);

      transform: translateY(-1px);
    }

    .site-sidebar__mobile-action:hover .site-sidebar__icon {
      color: #a3d9f7;
    }
  }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {
  .site-sidebar {
    width: min(300px, calc(100% - 42px));

    padding: 0 12px 26px;
  }

  .site-sidebar__nav {
    padding-top: 14px !important;
  }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
  .site-sidebar,
  .site-sidebar__overlay,
  .site-sidebar__menu a,
  .site-sidebar__icon {
    transition: none !important;
  }
}
