/* Patch 2: grouped navigation for the shift-planning module. */

/* The compact switcher is enabled by the screen-only responsive stylesheet. */
#shiftNavigationToggle { display: none; }

#shiftPlansView .shift-heading-main {
  flex: 1 1 auto;
  min-width: 0;
}

#shiftPlansView .shift-heading-title-row {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
}

#shiftPlansView .shift-heading-title-row .shift-toolbar-view {
  flex: 0 0 236px;
  margin-left: auto;
}

#shiftPlansView .shift-module-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  box-sizing: border-box;
  width: 100%;
  margin-left: 0;
  padding-right: 0;
}

#shiftPlansView .shift-module-main {
  grid-area: 1 / 1;
  min-width: 0;
}

#shiftPlansView .shift-grouped-menu {
  position: sticky;
  top: 16px;
  z-index: 4;
  grid-area: 1 / 1;
  display: grid;
  gap: 20px;
  width: 196px;
  margin: 0 0 0 calc(50% - 50vw);
  padding: 16px 12px;
  overflow: visible;
  border: 1px solid #dbe3e9;
  border-left: 0;
  border-bottom: 1px solid #dbe3e9;
  border-radius: 0 12px 12px 0;
  background: #fff;
  box-shadow: 0 1px 2px rgba(18, 38, 56, 0.04);
}

#shiftPlansView .shift-menu-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

#shiftPlansView .shift-menu-group[hidden] {
  display: none;
}

#shiftPlansView .shift-menu-group-title {
  margin: 0;
  padding: 0 10px;
  color: #657582;
  font-size: var(--bs-text-12-5);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

#shiftPlansView .shift-menu-items {
  display: grid;
  gap: 3px;
  min-width: 0;
}

#shiftPlansView .shift-grouped-menu button {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 46px;
  width: 100%;
  flex: none;
  margin: 0;
  padding: 8px 12px 8px 9px;
  border: 0;
  border-left: 3px solid transparent;
  border-bottom: 0;
  border-radius: 8px;
  background: transparent;
  color: #304352;
  font-size: var(--bs-text-15);
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
}

#shiftPlansView .shift-grouped-menu button:hover {
  border-left-color: #c1d9cf;
  background: #f3f7f6;
  color: #18394d;
}

#shiftPlansView .shift-grouped-menu button:focus-visible {
  outline: 3px solid rgba(42, 143, 102, 0.28);
  outline-offset: 2px;
}

#shiftPlansView .shift-grouped-menu button.active,
#shiftPlansView .shift-grouped-menu button[aria-current="page"] {
  border-left-color: #2d8f68;
  border-bottom-color: transparent;
  background: #eaf5f0;
  color: #173d4e;
  font-weight: 700;
}

#shiftPlansView .shift-menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: #667986;
}

#shiftPlansView .shift-menu-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#shiftPlansView .shift-grouped-menu button.active .shift-menu-icon,
#shiftPlansView .shift-grouped-menu button[aria-current="page"] .shift-menu-icon {
  color: #287d5e;
}

@media (min-width: 1812px) {
  body.shift-plan-expanded #shiftPlansView .shift-module-shell {
    grid-template-columns: 196px minmax(0, 1fr);
    gap: 18px;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding-right: 12px;
  }

  body.shift-plan-expanded #shiftPlansView .shift-grouped-menu,
  body.shift-plan-expanded #shiftPlansView .shift-module-main {
    grid-area: auto;
  }

  body.shift-plan-expanded #shiftPlansView .shift-grouped-menu {
    margin-left: 0;
  }
}

@media (max-width: 1811px) {
  #shiftPlansView .shift-module-shell {
    display: block;
    width: auto;
    margin-left: 0;
    padding-right: 0;
  }

  #shiftPlansView .shift-module-main {
    grid-area: auto;
  }

  #shiftPlansView .shift-grouped-menu {
    position: static;
    grid-area: auto;
    display: flex;
    gap: 12px;
    width: 100%;
    margin: 0 0 18px;
    padding: 12px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    border-left: 1px solid #dbe3e9;
    border-radius: 12px;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
  }

  #shiftPlansView .shift-menu-group {
    flex: 0 0 184px;
    align-content: start;
    scroll-snap-align: start;
  }

  #shiftPlansView .shift-menu-group-title {
    padding-inline: 8px;
  }

  #shiftPlansView .shift-heading-title-row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px 20px;
  }
}

@media (max-width: 700px) {
  #shiftPlansView .shift-grouped-menu {
    gap: 9px;
    margin-inline: -4px;
    padding: 10px;
    border-radius: 10px;
  }

  #shiftPlansView .shift-menu-group {
    flex-basis: 168px;
  }

  #shiftPlansView .shift-heading-title-row .shift-toolbar-view {
    flex-basis: 100%;
    width: 100%;
    margin-left: 0;
  }

  #shiftPlansView .shift-grouped-menu button {
    min-height: 44px;
    font-size: var(--bs-text-14);
  }
}
