/* ==========================================================================
   Sidebar — layout tokens (scoped to page shell)
   ========================================================================== */

.page-wrapper {
  --sidebar-width: 214px;
  --sidebar-width-collapsed: 72px;
  --sidebar-rail: 48px;
  --sidebar-gutter: 12px;
  --sidebar-inner-width: calc(var(--sidebar-width) - var(--sidebar-gutter) * 2);
  --sidebar-transition: 0.24s cubic-bezier(0.4, 0, 0.2, 1);

  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

.page-wrapper .page-content {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  min-height: 100vh;
  padding-left: 0;
}

.header {
  width: 100%;
}

.header-mobile-search {
  display: none;
}

@media (min-width: 769px) {
  .header {
    display: none;
    max-height: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  .page-wrapper .sidebar-wrapper .sidebar-search {
    display: block;
  }

  .header .header-mobile-search {
    display: none !important;
  }
}

/* ==========================================================================
   Mobile sidebar toggle (header button)
   ========================================================================== */

.header .toggle-btns #toggle-sidebar {
  display: none;
}

/* ==========================================================================
   Sidebar wrapper
   ========================================================================== */

.page-wrapper .sidebar-wrapper {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: var(--sidebar-width);
  flex-basis: var(--sidebar-width);
  height: 100vh;
  position: sticky;
  top: 0;
  left: auto;
  z-index: 999;
  background: var(--design-bg-page);
  border-right: 1px solid var(--design-border);
  padding-inline: var(--sidebar-gutter);
  overflow: visible;
  transition:
    width var(--sidebar-transition),
    flex-basis var(--sidebar-transition),
    padding var(--sidebar-transition);
  will-change: width, flex-basis;

  & > :is(.sidebar-brand, .sidebar-user-panel, .sidebar-search) {
    flex-shrink: 0;
  }

  /* Brand */
  & .sidebar-brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    min-height: 48px;
    padding-right: 4px;

    & .logo {
      display: flex;
      align-items: center;
      gap: 5px;
      flex: 1;
      min-width: 0;
      padding: 8px 0 8px 12px;
      min-height: 48px;
      text-decoration: none;
      transition:
        gap 0.2s ease,
        padding 0.2s ease;

      & .sidebar-brand__mark {
        width: auto;
        height: 32px;
        flex-shrink: 0;
        fill: none;

        & svg {
          display: block;
          width: auto;
          height: 100%;
        }
      }
    }

    & .sidebar-brand__tagline {
      display: flex;
      flex-direction: column;
      color: var(--design-danger) !important;
      font-size: 0.875rem;
      font-weight: bold;
      line-height: 1.15;
      letter-spacing: -0.41px;
      opacity: 1;
      transition:
        opacity 0.16s ease,
        transform 0.16s ease;
    }
  }

  & .sidebar-brand__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--design-text-secondary);
    cursor: pointer;
    transition:
      background-color 0.16s ease,
      border-color 0.16s ease,
      color 0.16s ease,
      opacity 0.16s ease,
      transform 0.2s ease;

    &:hover {
      color: var(--design-text-primary);
    }
  }

  & .sidebar-brand__toggle-icon {
    width: 32px;
    height: 32px;

    &:hover {
      background: var(--design-bg-subtle);
      border-radius: var(--design-border-radius);
    }

    & svg path {
      stroke: currentColor;
    }
  }

  /* User panel */
  & .sidebar-user-panel {
    display: flex;
    align-items: center;
    gap: 4px;
    width: var(--sidebar-inner-width);
    margin-top: 16px;
    transition:
      width 0.2s ease,
      margin-top 0.2s ease;
  }

  & :is(.sidebar-user, .sidebar-notifications) .dropdown-menu {
    top: 100% !important;
    transform: none !important;
    margin-top: 4px;
  }

  & .sidebar-user {
    min-width: 0;
    flex: 1 1 auto;

    & .dropdown-menu {
      left: 0 !important;
    }

    & .dropdown-menu.sidebar-user-menu {
      width: max-content;
      max-width: 266px;
      padding: 0 4px 4px;
      overflow: hidden;
      border: 1px solid var(--design-border);
      border-radius: var(--design-border-radius);
      background: var(--design-bg-surface);
      box-shadow:
        0 1px 3px 1px
          color-mix(in srgb, var(--design-neutral-900) 15%, transparent),
        0 4px 24px
          color-mix(in srgb, var(--design-neutral-900) 15%, transparent);
    }

    & .header-profile-actions {
      margin: 0;
      padding: 0;
    }

    & .header-user-profile {
      display: grid;
      grid-template-columns: 40px minmax(0, 1fr);
      column-gap: 16px;
      align-items: center;
      min-height: 56px;
      margin: 0 -4px;
      padding: 8px 12px;
      border-bottom: 1px solid var(--design-border);
    }

    & .header-user-profile .header-user {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      margin: 0;
      overflow: hidden;
      border-radius: 50%;
      color: var(--design-text-secondary);

      & img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
      }

      & .design-icon {
        width: 40px;
        height: 40px;
      }
    }

    & .sidebar-user-menu__identity {
      min-width: 0;

      & h5 {
        margin: 0 0 4px;
        overflow: hidden;
        color: var(--design-text-primary);
        font-size: 0.875rem;
        font-weight: 600;
        line-height: 1.15;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      & p {
        margin: 0;
        overflow: hidden;
        color: var(--design-text-secondary);
        font-size: 0.875rem;
        line-height: 1.15;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }

    & .sidebar-user-menu__item {
      display: flex;
      align-items: center;
      gap: 8px;
      min-height: 32px;
      margin-top: 2px;
      padding: 4px 8px;
      border: 0;
      border-radius: var(--design-border-radius);
      color: var(--design-text-secondary);
      font-size: 0.875rem;
      line-height: 1.5;
      text-decoration: none;
      cursor: pointer;

      &:hover,
      &:focus-visible {
        background: var(--design-bg-subtle);
        color: var(--design-text-secondary);
        outline: none;
      }

      & i {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 24px;
        width: 24px;
        height: 24px;
        margin: 0;
        color: currentColor;
        font-size: 1.25rem;
        font-weight: 400;
      }

      & span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }

    & .sidebar-user-menu__theme {
      justify-content: space-between;
    }

    & .sidebar-user-menu__theme-label {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }

    & .sidebar-theme-switcher {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex: 0 0 24px;
      width: 24px;
      height: 24px;
      border: 0;
      border-radius: 0;
      color: var(--design-text-secondary);
      background: transparent;
    }

    & .sidebar-theme-switcher .theme_switch {
      position: static;
      display: none;
      width: 24px;
      height: 24px;
      border-radius: 0;
      background: transparent;
      color: currentColor;
      line-height: 24px;
      text-align: center;

      &:not(.active) {
        display: inline-flex;
        align-items: center;
        justify-content: center;
      }

      &:hover {
        background: transparent;
        color: var(--design-text-primary);
      }

      & i {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 400;
      }
    }
  }

  & .sidebar-user__toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 154px;
    min-height: 32px;
    padding: 4px 4px 4px 12px;
    border-radius: var(--design-border-radius);
    color: var(--design-text-secondary);
    text-decoration: none;
  }

  & .sidebar-user__toggle:hover,
  & .sidebar-notifications__toggle:hover {
    background: var(--design-accent-cream);
    color: var(--design-text-primary);
  }

  & .sidebar-user.show .sidebar-user__toggle {
    background: var(--design-accent-cream);
    color: var(--design-primary);
  }

  & .sidebar-user.show .sidebar-user__avatar {
    box-shadow: 0 0 0 2px var(--design-primary);
  }

  & .sidebar-notifications.show .sidebar-notifications__toggle {
    background: var(--design-accent-cream);
    color: var(--design-primary);
  }

  & .sidebar-user__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin: 0;
    overflow: hidden;
    border-radius: 50%;
    color: var(--design-text-secondary);

    & img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    & .design-icon {
      width: 24px;
      height: 24px;
    }
  }

  & .sidebar-user__avatar--fallback {
    background: transparent;
  }

  & .sidebar-user__name {
    min-width: 0;
    max-width: 82px;
    overflow: hidden;
    color: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  & .sidebar-user__chevron {
    width: 24px;
    height: 24px;
    margin-left: auto;
  }

  & .sidebar-notifications {
    position: relative;
    flex: 0 0 32px;

    & .dropdown-menu {
      left: calc((var(--sidebar-inner-width) - 32px) * -1) !important;
      right: auto !important;
    }

    & .dropdown-menu.lrg {
      width: min(359px, calc(100vw - 16px));
      min-width: 280px;
      padding: 0;
      overflow: hidden;
      border: 1px solid var(--design-border);
      border-radius: var(--design-border-radius);
      background: var(--design-bg-surface);
      box-shadow:
        0 1px 3px 1px
          color-mix(in srgb, var(--design-neutral-900) 15%, transparent),
        0 4px 24px
          color-mix(in srgb, var(--design-neutral-900) 15%, transparent);
    }

    & .header-notifications {
      margin: 0;
      padding: 0;
      list-style: none;
    }

    & .header-notifications li {
      border-bottom: 1px solid var(--design-border);

      &:last-child {
        border-bottom: 0;
      }
    }

    & .header-notifications li a {
      display: grid;
      grid-template-columns: 40px minmax(0, 1fr) 108px;
      gap: 4px 8px;
      align-items: center;
      min-height: 64px;
      padding: 12px;
      color: var(--design-text-primary);
      text-decoration: none;

      &:hover {
        background: var(--design-bg-subtle);
        color: var(--design-text-primary);
      }
    }

    & .header-notifications li a > .user-img {
      grid-column: 1;
      grid-row: 1 / 3;
      width: 40px;
      height: 40px;
      margin: 0;
      border-radius: 50%;
      background: var(--design-accent-cream);
      color: var(--design-primary);
      font-size: 1.25rem;
      font-weight: 600;
      line-height: 40px;
      text-align: center;
    }

    & .header-notifications li a > .user-img::after {
      display: none;
    }

    & .header-notifications li a .details {
      display: contents;
    }

    & .header-notifications li a .details > .user-title {
      grid-column: 2;
      grid-row: 1;
      display: block;
      min-width: 0;
      height: auto;
      margin: 0;
      overflow: hidden;
      color: var(--design-text-primary);
      font-size: 0.875rem;
      font-weight: 600;
      line-height: 1.15;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    & .header-notifications li a .details .noti-details {
      grid-column: 2 / 4;
      grid-row: 2;
      display: block;
      min-width: 0;
      height: auto;
      overflow: hidden;
      color: var(--design-text-secondary);
      font-size: 0.875rem;
      line-height: 1.15;
      text-overflow: ellipsis;
      white-space: nowrap;
      line-clamp: unset;
      -webkit-line-clamp: unset;
      -webkit-box-orient: initial;
    }

    & .header-notifications li a .details .noti-date {
      grid-column: 3;
      grid-row: 1;
      min-width: 0;
      overflow: hidden;
      color: var(--design-text-secondary);
      font-size: 0.75rem;
      line-height: 1.15;
      opacity: 1;
      text-align: right;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    & .header-notifications li:last-child a {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 6px;
      min-height: 48px;
      padding: 12px;
      color: var(--design-text-secondary);
      font-size: 0.875rem;
      font-weight: 600;
      line-height: 1.5;

      & i {
        font-size: 1.25rem;
        color: currentColor;
      }
    }

    & .header-notifications li.text-center {
      padding: 20px 12px;
      color: var(--design-text-secondary);
      font-size: 0.875rem;
      text-align: center;
    }
  }

  & .sidebar-notifications__toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--design-border-radius);
    color: var(--design-text-secondary);
    text-decoration: none;

    & i {
      font-size: 1.25rem;
      color: inherit;
    }

    & .count-label {
      position: absolute;
      top: -2px;
      right: -2px;
      min-width: 18px;
      height: 18px;
      padding: 0 5px;
      border-radius: 100px;
      background: var(--design-primary);
      color: var(--design-white);
      font-size: 11px;
      font-weight: 700;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      box-sizing: border-box;
    }
  }

  /* Search */
  & .sidebar-search {
    width: var(--sidebar-inner-width);
    margin-top: 8px;
    transition:
      width 0.2s ease,
      margin-top 0.2s ease;

    & .custom-search {
      width: 100%;
      margin: 0;

      & .search-query {
        width: 100%;
        height: 32px;
        padding: 5px 36px 6px 11px;
        border: 1px solid var(--design-border);
        border-radius: var(--design-border-radius);
        background: var(--design-bg-surface);
        color: var(--design-text-secondary);
        font-size: 0.875rem;
        line-height: 1.5;
        transition:
          width 0.2s ease,
          padding 0.2s ease,
          border-color 0.2s ease,
          background-color 0.2s ease,
          color 0.12s ease;

        &:focus {
          border-color: var(--design-border-strong);
          outline: none;
        }
      }

      & i {
        right: 0;
        top: 0;
        width: 36px;
        height: 32px;
        padding: 0;
        border-left: 0;
        color: var(--design-text-secondary);
        font-size: 1.25rem;
        line-height: 32px;
        text-align: center;

        &:hover {
          color: var(--design-text-primary);
        }
      }
    }
  }

  & .sidebar-content {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Menu */
  & .sidebar-menu {
    padding-bottom: 10px;

    & > ul {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    & .header-menu {
      padding: 16px 12px 4px;
      font-size: 0.875rem;
      font-weight: 400;
      color: var(--design-text-muted);
      text-transform: none;
      letter-spacing: 0;
      pointer-events: none;
    }

    & ul li.active-page-link {
      position: relative;
    }

    & ul li a {
      display: flex;
      flex-wrap: nowrap;
      align-items: center;
      text-decoration: none;
      position: relative;
      width: 100%;
      padding: 3.5px 12px;
      min-height: 32px;
      color: var(--design-text-secondary);
      border-radius: var(--design-border-radius);
      font-size: 0.875rem;
      overflow: hidden;
      transition:
        background-color 0.2s ease,
        color 0.2s ease,
        padding 0.2s ease;

      & .menu-text {
        flex: 1 1 auto;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
      }

      &:hover {
        background: var(--design-bg-subtle);
      }

      & :is(i, > .design-icon:not(.sidebar-menu__chevron)) {
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 24px;
        width: 24px;
        min-width: 24px;
        height: 24px;
        margin-right: 8px;
        color: currentColor;
        transition:
          margin-right 0.2s ease,
          color 0.2s ease;
      }

      & > .design-icon:not(.sidebar-menu__chevron) {
        padding: 2px;
        overflow: hidden;
      }

      & > .design-icon svg {
        display: block;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        transform: none !important;
      }

      & > .design-icon svg :is(path, circle, rect, polygon) {
        fill: currentColor !important;
        transition: none;
      }

      & i {
        font-size: 1.25rem;
        line-height: 1;

        &::before {
          display: block;
          line-height: 1;
        }

        & svg {
          display: block;
          width: 20px;
          height: 20px;
          flex-shrink: 0;
        }

        & svg path {
          fill: currentColor;
        }

        & svg path[style] {
          fill: currentColor !important;
        }
      }
    }

    & ul li a.sidebar-menu__subitem {
      padding-left: 44px;
    }

    & ul li.active-page-link > a {
      background: var(--design-accent-cream);
      color: var(--design-primary);
      font-weight: 600;

      & :is(i, > .design-icon:not(.sidebar-menu__chevron)) {
        color: var(--design-primary);
      }
    }

    & ul li.active a.current-page {
      color: var(--design-primary);
      font-weight: 600;
    }

    /* Dropdown */
    & .sidebar-dropdown > a {
      padding-right: 32px;
    }

    & .sidebar-dropdown > a::after,
    & .sidebar-dropdown .sidebar-submenu ul li a::before {
      content: none !important;
      display: none !important;
    }

    & .sidebar-menu__chevron {
      position: absolute;
      top: 50%;
      right: 12px;
      width: 24px;
      height: 24px;
      margin-top: -12px;
      color: currentColor;
      transition: transform 0.3s ease;
      pointer-events: none;
    }

    & .sidebar-dropdown.active .sidebar-menu__chevron {
      transform: rotate(-180deg);
    }

    & ul li.active .sidebar-submenu {
      display: block;
    }

    & .sidebar-dropdown:not(.active) > .sidebar-submenu {
      display: none;
    }

    & .sidebar-dropdown .sidebar-submenu {
      padding: 0 12px 6px;

      & ul {
        margin: 0;
        padding: 2px 0;
        list-style: none;

        & li a {
          display: flex;
          align-items: center;
          justify-content: space-between;
          gap: 8px;
          padding: 3.5px 8px 3.5px 10px;
          min-height: 32px;
          font-size: 0.8125rem;
          color: var(--design-text-secondary);
          background: transparent;

          &:hover {
            background: var(--design-bg-subtle);
          }

          &.current-page {
            color: var(--design-primary);
            font-weight: 600;
          }
        }
      }
    }

    &
      ul
      li.sidebar-dropdown.active
      .sidebar-submenu
      ul
      li
      a:not(.current-page) {
      background: transparent;
      color: var(--design-text-secondary);
      font-weight: 400;

      &:hover {
        background: var(--design-bg-subtle);
      }
    }
  }
}

.dark_theme
  .page-wrapper
  .sidebar-wrapper
  .sidebar-menu
  ul
  li.active-page-link
  > a {
  color: var(--design-text-on-primary);

  & :is(i, > .design-icon:not(.sidebar-menu__chevron)) {
    color: var(--design-text-on-primary);
  }
}

/* ==========================================================================
   Collapsed (pinned) state — desktop
   ========================================================================== */

@media (min-width: 768px) {
  .page-wrapper.pinned:not(.sidebar-hovered) .sidebar-wrapper {
    width: var(--sidebar-width-collapsed);
    flex-basis: var(--sidebar-width-collapsed);

    & .sidebar-brand {
      justify-content: center;
      gap: 2px;
      padding: 8px 0;

      & .logo {
        flex: 0 0 36px;
        min-width: 0;
        padding: 0;
        overflow: hidden;

        & .sidebar-brand__mark {
          height: 32px;
        }
      }

      & .sidebar-brand__tagline {
        width: 0;
        opacity: 0;
        overflow: hidden;
        pointer-events: none;
        transform: translateX(-6px);
        white-space: nowrap;
      }
    }

    & .sidebar-brand__toggle {
      position: absolute;
      top: 12px;
      right: -8px;
      width: 24px;
      height: 24px;
      border: 1px solid var(--design-border);
      border-radius: 999px;
      background: var(--design-bg-surface);
      box-shadow: 0 2px 8px
        color-mix(in srgb, var(--design-neutral-900) 12%, transparent);
      opacity: 0;
      pointer-events: none;
      transform: translateX(4px);
      z-index: 2;
    }

    &:hover .sidebar-brand__toggle,
    & .sidebar-brand__toggle:focus-visible {
      opacity: 1;
      pointer-events: auto;
      transform: translateX(0);
    }

    & .sidebar-brand__toggle-icon {
      width: 18px;
      height: 18px;
      transform: rotate(180deg);
    }

    & .sidebar-user-panel {
      justify-content: center;
      width: var(--sidebar-rail);
      margin-top: 19px;

      & .sidebar-notifications {
        flex: 0 0 var(--sidebar-rail);
        width: var(--sidebar-rail);

        & .dropdown-menu {
          left: 0 !important;
        }
      }

      & .sidebar-notifications__toggle {
        width: var(--sidebar-rail);
        height: 32px;
        min-height: 32px;
      }
    }

    & .sidebar-user {
      display: none;
    }

    & .sidebar-search {
      width: var(--sidebar-rail);
      margin-top: 9px;

      & .custom-search {
        width: var(--sidebar-rail);
        height: 32px;
        min-height: 32px;
        border-radius: var(--design-border-radius);
        cursor: pointer;
        transition: background-color 0.2s ease;

        &:hover {
          background: var(--design-bg-subtle);
        }

        & .search-query {
          width: var(--sidebar-rail);
          padding: 0;
          border-color: transparent;
          background: transparent !important;
          color: transparent;
          cursor: pointer;

          &::placeholder {
            color: transparent;
          }
        }

        & i {
          left: 12px;
          right: auto;
          width: 24px;
          height: 32px;
          line-height: 32px;
          pointer-events: none;
        }

        &.sidebar-search--pinned-trigger {
          cursor: pointer;
        }
      }
    }

    & .sidebar-menu {
      & .header-menu {
        opacity: 0;
        pointer-events: none;
      }

      & ul li a {
        justify-content: center;
        width: var(--sidebar-rail);
        padding-inline: 0;

        & :is(i, > .design-icon:not(.sidebar-menu__chevron)) {
          margin-right: 0;
        }

        & > .design-icon:not(.sidebar-menu__chevron) {
          padding: 2px;
        }

        & :is(.menu-text, .text-wrap) {
          max-width: 0;
          opacity: 0;
          overflow: hidden;
          pointer-events: none;
        }

        & .sidebar-menu__chevron {
          display: none !important;
        }
      }

      & .wf_left_column_badge,
      & .sidebar-submenu {
        display: none !important;
      }
    }
  }
}

/* ==========================================================================
   Mobile
   ========================================================================== */

@media screen and (max-width: 768px) {
  .page-wrapper {
    --sidebar-width: 202px;

    display: block;
  }

  .page-wrapper .page-content {
    min-height: 100vh;
    padding-top: 48px;
  }

  .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1005;
    display: block;
    width: auto;
    height: 48px;
    padding: 0;
    background: var(--design-bg-page);
    border-bottom: 1px solid var(--design-border);
    pointer-events: none;
  }

  .header :is(.toggle-btns, .header-mobile-search, #toggle-sidebar) {
    pointer-events: auto;
  }

  .header::after {
    content: "";
    position: fixed;
    top: 8px;
    left: 50%;
    z-index: 1005;
    width: 38px;
    height: 32px;
    background: url("/view/icons/new-design/ui/logo.png") center / contain
      no-repeat;
    transform: translateX(-50%);
    pointer-events: none;
  }

  .page-wrapper .sidebar-wrapper {
    position: fixed;
    top: 48px;
    left: 0;
    width: 100%;
    height: calc(100vh - 48px);
    flex-basis: auto;
    z-index: 1006;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
    pointer-events: none;
  }

  .page-wrapper.toggled .sidebar-wrapper {
    pointer-events: auto;
  }

  .page-wrapper .sidebar-wrapper .sidebar-brand {
    display: none;
  }

  .page-wrapper .sidebar-wrapper .sidebar-user-panel {
    display: contents;
  }

  .page-wrapper .sidebar-wrapper .sidebar-content {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100%;
    padding-inline: 8px;
    background: var(--design-bg-page);
    border-right: 1px solid var(--design-border);
    box-shadow: 8px 0 24px
      color-mix(in srgb, var(--design-neutral-900) 12%, transparent);
    overflow-x: hidden;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform var(--sidebar-transition);
    pointer-events: none;
  }

  .page-wrapper.toggled .sidebar-wrapper .sidebar-content {
    transform: translateX(0);
    pointer-events: auto;
  }

  .page-wrapper .sidebar-wrapper .sidebar-user {
    position: fixed;
    top: 8px;
    right: 16px;
    z-index: 1006;
    display: block;
    width: 32px;
    height: 32px;
    pointer-events: auto;
  }

  .page-wrapper .sidebar-wrapper .sidebar-user__toggle {
    justify-content: center;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border-radius: 50%;
  }

  .page-wrapper .sidebar-wrapper .sidebar-user__avatar {
    width: 32px;
    height: 32px;
  }

  .page-wrapper .sidebar-wrapper .sidebar-user__name,
  .page-wrapper .sidebar-wrapper .sidebar-user__chevron {
    display: none;
  }

  .page-wrapper .sidebar-wrapper .sidebar-notifications {
    position: fixed;
    top: 8px;
    right: 64px;
    z-index: 1006;
    width: 32px;
    pointer-events: auto;
  }

  .page-wrapper .sidebar-wrapper .sidebar-notifications__toggle {
    width: 32px;
    height: 32px;
  }

  .page-wrapper .sidebar-wrapper .sidebar-notifications__toggle .count-label {
    top: -3px;
    right: -6px;
  }

  .page-wrapper .sidebar-wrapper .sidebar-search {
    display: none !important;
  }

  .header-mobile-search {
    position: fixed;
    top: 8px;
    left: 52px;
    z-index: 1006;
    display: block !important;
    width: 32px;
    height: 32px;
    margin: 0;
  }

  .header-mobile-search .custom-search {
    width: 32px;
    height: 32px;
    margin: 0;
  }

  .header-mobile-search .custom-search .search-query {
    width: 32px;
    height: 32px;
    padding: 0;
    border-color: transparent;
    background: transparent !important;
    color: transparent;
    cursor: pointer;
  }

  .header-mobile-search .custom-search .search-query::placeholder {
    color: transparent;
  }

  .header-mobile-search .custom-search i {
    left: 0;
    right: auto;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    color: var(--design-text-secondary);
    line-height: 32px;
    pointer-events: none;
    text-align: center;
  }

  .header-mobile-search__close {
    display: none;
  }

  .page-wrapper.mobile-search-open .header::after,
  .page-wrapper.mobile-search-open .header .toggle-btns,
  .page-wrapper.mobile-search-open .sidebar-wrapper .sidebar-user,
  .page-wrapper.mobile-search-open .sidebar-wrapper .sidebar-notifications {
    display: none;
  }

  .page-wrapper.mobile-search-open .header-mobile-search {
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 48px;
    padding: 8px 48px 8px 12px;
    background: var(--design-bg-surface);
    border-bottom: 1px solid var(--design-border);
  }

  .page-wrapper.mobile-search-open .header-mobile-search .custom-search,
  .page-wrapper.mobile-search-open
    .header-mobile-search
    .custom-search
    .search-query {
    width: calc(100vw - 60px);
    height: 32px;
  }

  .page-wrapper.mobile-search-open
    .header-mobile-search
    .custom-search
    .search-query {
    padding: 5px 36px 6px 11px;
    border: 1px solid var(--design-border);
    border-radius: var(--design-border-radius);
    background: var(--design-bg-surface);
    color: var(--design-text-primary);
    cursor: text;
  }

  .page-wrapper.mobile-search-open
    .header-mobile-search
    .custom-search
    .search-query::placeholder {
    color: var(--design-text-muted);
  }

  .page-wrapper.mobile-search-open .header-mobile-search .custom-search i {
    left: auto;
    right: 0;
    pointer-events: auto;
  }

  .page-wrapper.mobile-search-open .header-mobile-search__close {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--design-text-secondary);
    font-size: 1.75rem;
    line-height: 1;
  }

  .page-wrapper .sidebar-wrapper .sidebar-menu > ul {
    gap: 2px;
  }

  .page-wrapper .sidebar-wrapper .sidebar-menu .header-menu {
    padding: 8px 8px 2px;
  }

  .page-wrapper .sidebar-wrapper .sidebar-menu ul li a {
    min-height: 32px;
    padding: 4px 8px;
  }

  .page-wrapper .sidebar-wrapper .sidebar-menu ul li.active-page-link > a {
    background: var(--design-accent-cream);
    color: var(--design-primary);
  }

  .page-wrapper .sidebar-wrapper .sidebar-submenu {
    padding-inline: 8px;
  }

  .page-wrapper
    .sidebar-wrapper
    .sidebar-user
    .dropdown-menu.sidebar-user-menu {
    position: fixed !important;
    top: 56px !important;
    transform: none !important;
    left: calc(100vw - 260px) !important;
  }

  .page-wrapper .sidebar-wrapper .sidebar-notifications .dropdown-menu.lrg {
    position: fixed !important;
    top: 56px !important;
    right: 8px !important;
    left: 8px !important;
    z-index: 1007;
    width: auto;
    min-width: 0;
    max-width: none !important;
    max-height: calc(100vh - 72px);
    overflow-y: auto;
    transform: none !important;
  }

  .header .toggle-btns #toggle-sidebar {
    position: fixed;
    top: 12px;
    left: 16px;
    z-index: 1006;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;

    & i {
      display: none;
    }

    &::before {
      content: "";
      display: block;
      width: 24px;
      height: 24px;
      background: var(--design-text-primary);
      mask: url("/view/icons/new-design/ui/sidebar-panel.svg") center / 24px
        24px no-repeat;
      -webkit-mask: url("/view/icons/new-design/ui/sidebar-panel.svg") center /
        24px 24px no-repeat;
    }

    &:hover {
      background: transparent;
      border: 0;

      & i {
        color: var(--design-text-primary);
      }
    }
  }

  .page-wrapper .sidebar-wrapper .sidebar-brand__toggle {
    display: none;
  }
}

/* ==========================================================================
   Sidebar numeric badges (Figma: pill 18px, --design-primary)
   ========================================================================== */

.page-wrapper .sidebar-wrapper .sidebar-menu .wf_left_column_badge,
.page-wrapper .sidebar-wrapper .sidebar-notifications .count-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border: 0;
  box-sizing: border-box;
  vertical-align: middle;
  background: var(--design-primary) !important;
  color: var(--design-white) !important;
}

.page-wrapper .sidebar-wrapper .sidebar-menu .wf_left_column_badge:hover,
.page-wrapper .sidebar-wrapper .sidebar-notifications .count-label:hover {
  background: var(--design-primary) !important;
  color: var(--design-white) !important;
}

.page-wrapper
  .sidebar-wrapper
  .sidebar-menu
  > ul
  > li
  > a
  .wf_left_column_badge {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  margin: 0;
}

.page-wrapper
  .sidebar-wrapper
  .sidebar-menu
  .sidebar-submenu
  ul
  li
  a
  .wf_left_column_badge {
  position: static;
  transform: none;
  margin-left: auto;
  flex-shrink: 0;
}

/* ==========================================================================
   Legacy menu helpers
   ========================================================================== */

.tooltip.sidebar-menu-tooltip {
  z-index: 1200;
  pointer-events: none;
}

.tooltip.sidebar-menu-tooltip .tooltip-inner {
  background: var(--design-neutral-900);
  color: var(--design-text-on-primary);
  border-radius: var(--design-border-radius);
  padding: 6px 12px;
  font-size: 0.8125rem;
  box-shadow: 0 4px 12px
    color-mix(in srgb, var(--design-neutral-900) 18%, transparent);
  text-align: left;
  white-space: nowrap;
}

.tooltip.sidebar-menu-tooltip.bs-tooltip-end .tooltip-arrow::before {
  border-right-color: var(--design-neutral-900);
}

.tooltip.sidebar-menu-tooltip.bs-tooltip-start .tooltip-arrow::before {
  border-left-color: var(--design-neutral-900);
}

@media (min-width: 768px) {
  .page-wrapper.pinned:not(.sidebar-hovered)
    .sidebar-wrapper
    :is(
      .sidebar-brand__tagline,
      .sidebar-menu .header-menu,
      .sidebar-menu .menu-text,
      .sidebar-menu .text-wrap
    ) {
    opacity: 0 !important;
    pointer-events: none;
  }

  .page-wrapper.pinned:not(.sidebar-hovered)
    .sidebar-wrapper
    .sidebar-menu
    .sidebar-submenu {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .page-wrapper.pinned:not(.sidebar-hovered) .sidebar-menu__mini-hidden,
  .page-wrapper.pinned:not(.sidebar-hovered) .sidebar-menu__text-only,
  .page-wrapper.pinned:not(.sidebar-hovered)
    .sidebar-wrapper
    .sidebar-menu
    > ul
    > li
    > a.sidebar-menu__subitem {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .page-wrapper.pinned::before {
    content: "";
    flex: 0 0 var(--sidebar-width-collapsed);
    width: var(--sidebar-width-collapsed);
  }

  .page-wrapper.pinned:not(.sidebar-hovered) .sidebar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
  }

  .page-wrapper.pinned.sidebar-hovered .sidebar-wrapper {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1100;
    box-shadow: 8px 0 24px
      color-mix(in srgb, var(--design-neutral-900) 18%, transparent);
  }

  .page-wrapper.pinned:not(.sidebar-hovered)
    .sidebar-wrapper
    .sidebar-menu
    .header-menu {
    display: block;
    padding: 12px 0 4px;
    overflow: hidden;
    color: var(--design-text-muted);
    font-size: 8px;
    line-height: 10px;
    opacity: 1 !important;
    pointer-events: none;
    text-align: center;
    white-space: normal;
    word-break: break-word;
  }
}
