:root {
  --sidebar-width: 264px;
}

body {
  padding-left: var(--sidebar-width);
}

body.sidebar-collapsed {
  --sidebar-width: 82px;
}

.site-sidebar {
  position: fixed;
  z-index: 20;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid #dfe2eb;
  background: #f8f9fc;
  padding: 28px 18px 18px;
}

.site-sidebar .brand {
  min-width: 0;
  margin: 0;
  color: #101b3a;
}

.sidebar-brand-row {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 8px 28px;
}

.sidebar-toggle {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: #eeeff6;
  color: #47536b;
  font-size: 26px;
  line-height: 1;
}

.sidebar-toggle:hover {
  background: #e3e1ff;
  color: #5146d8;
}

.site-sidebar .brand span {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}

.side-nav,
.side-footer {
  display: grid;
  gap: 7px;
}

.side-nav {
  min-height: 0;
  flex: 1 1 auto;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 2px 10px;
  scrollbar-width: thin;
}

.side-nav button,
.side-footer button {
  display: grid;
  min-height: 48px;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 0 14px;
  color: #37425b;
  font-size: 17px;
  font-weight: 650;
  text-align: left;
}

.side-nav button i,
.side-footer button i {
  color: currentColor;
  font-size: 27px;
  font-style: normal;
  line-height: 1;
  text-align: center;
}

.side-nav button:hover,
.side-footer button:hover {
  background: #eeeff6;
}

.side-nav button.active {
  background: #ecebff;
  color: #5146d8;
}

.side-footer {
  max-height: 37vh;
  flex: 0 1 auto;
  margin-top: auto;
  border-top: 1px solid #dfe2eb;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: 15px;
  scrollbar-width: thin;
}

.side-footer button {
  min-height: 43px;
  font-size: 15px;
}

.side-footer button i {
  font-size: 22px;
}

.content-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 0 max(24px, calc((100vw - var(--sidebar-width) - 1180px) / 2));
}

.content-header .search {
  width: min(350px, 50vw);
}

body.sidebar-collapsed .site-sidebar {
  padding-right: 14px;
  padding-left: 14px;
}

body.sidebar-collapsed .sidebar-brand-row {
  justify-content: center;
  margin-right: 0;
  margin-left: 0;
}

body.sidebar-collapsed .site-sidebar .brand strong,
body.sidebar-collapsed .side-nav button span,
body.sidebar-collapsed .side-footer button span {
  display: none;
}

body.sidebar-collapsed .sidebar-toggle {
  position: absolute;
  top: 32px;
  right: -14px;
  width: 28px;
  height: 28px;
  border: 1px solid #dedfea;
  background: #fff;
  font-size: 23px;
  transform: rotate(180deg);
}

body.sidebar-collapsed .side-nav button,
body.sidebar-collapsed .side-footer button {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 0;
}

body.sidebar-collapsed .side-nav button i,
body.sidebar-collapsed .side-footer button i {
  font-size: 24px;
}

@media (max-width: 920px) {
  body {
    padding-left: 0;
  }

  .site-sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    min-height: 62px;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #dfe2eb;
    padding: 10px 16px;
  }

  .site-sidebar .brand {
    flex: 0 0 auto;
    margin: 0 12px 0 0;
  }

  .sidebar-brand-row {
    flex: 0 0 auto;
    margin: 0 12px 0 0;
  }

  .sidebar-toggle {
    display: none;
  }

  .side-nav {
    display: flex;
    min-height: auto;
    flex: 1 0 auto;
    overflow: visible;
    padding: 0;
    gap: 4px;
  }

  .side-nav button,
  .side-footer button {
    display: inline-flex;
    min-height: 40px;
    grid-template-columns: none;
    gap: 5px;
    padding: 0 10px;
    font-size: 13px;
  }

  .side-nav button i {
    font-size: 17px;
  }

  .side-footer {
    display: none;
  }

  .content-header {
    height: 56px;
    padding: 0 16px;
  }

  .content-header .search {
    width: 100%;
  }
}
