:root {
  --health-sidebar-width: 300px;
  --health-sidebar-collapsed-width: 92px;
}

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

.health-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.health-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1030;
  width: var(--health-sidebar-width);
  background: #fff;
  border-right: 1px solid var(--health-primary, #ffbd00);
  box-shadow: 4px 0 18px rgba(20, 36, 55, 0.06);
  transition: width 0.25s ease, transform 0.25s ease;
}

.health-sidebar-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.health-sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 92px;
  padding: 18px 28px 12px;
}

.health-sidebar-logo img {
  display: block;
  width: 100%;
  max-width: 160px;
  max-height: 56px;
  object-fit: contain;
}

.health-sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 12px 18px;
  scrollbar-width: thin;
  scrollbar-color: #9aa3ad transparent;
}

.health-sidebar-scroll::-webkit-scrollbar {
  width: 5px;
}

.health-sidebar-scroll::-webkit-scrollbar-thumb {
  background: #9aa3ad;
  border-radius: 999px;
}

.health-sidebar-profile {
  margin-bottom: 8px;
  padding: 4px 6px 12px;
  border-bottom: 1px solid #eef0f2;
}

.health-sidebar-profile-title,
.health-sidebar-section-title {
  display: block;
  margin: 0;
  color: #6c757d;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
}

.health-sidebar-profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  min-width: 0;
}

.health-sidebar-avatar {
  flex: 0 0 auto;
  color: #343a40;
  font-size: 2.55rem;
}

.health-sidebar-profile-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: #343a40;
  line-height: 1.25;
}

.health-sidebar-profile-copy strong,
.health-sidebar-profile-copy span,
.health-sidebar-profile-link {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-sidebar-profile-link {
  color: #343a40;
}

.health-sidebar-profile-link:hover {
  color: #111;
  text-decoration: none;
}

.health-sidebar-profile-link .fa-edit {
  font-size: 0.78rem;
}

.health-sidebar-profile-copy span {
  margin-top: 2px;
  font-size: 0.91rem;
}

.health-sidebar-section {
  margin-top: 14px;
}

.health-sidebar-section:not(:has(.health-sidebar-item)) {
  display: none;
}

.health-sidebar-section-title {
  padding: 0 7px 4px;
}

.health-sidebar-section-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.health-sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 43px;
  padding: 9px 11px;
  border-radius: 5px;
  color: #454b52;
  font-size: 1rem;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.health-sidebar-item:hover,
.health-sidebar-item:focus-visible {
  background: #f2f4f6;
  color: #212529;
  text-decoration: none;
}

.health-sidebar-item:focus-visible,
.health-sidebar-collapse:focus-visible,
.health-mobile-menu-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--health-primary, #ffbd00) 45%, #fff);
  outline-offset: 2px;
}

.health-sidebar-item.active {
  background: var(--health-primary, #ffbd00);
  color: #fff;
  font-weight: 700;
}

.health-sidebar-item.active:hover {
  color: #fff;
  filter: brightness(0.97);
}

.health-sidebar-item-icon {
  flex: 0 0 22px;
  width: 22px;
  text-align: center;
}

.health-sidebar-item-label {
  min-width: 0;
}

.health-sidebar-footer {
  flex: 0 0 auto;
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid #e3e6e9;
  background: #fff;
  box-shadow: 0 -3px 12px rgba(20, 36, 55, 0.04);
}

.health-sidebar-session-action {
  justify-content: center;
  border: 1px solid #d7dce1;
  border-radius: 0;
}

.health-sidebar-collapse {
  position: absolute;
  top: 50%;
  right: -20px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--health-primary, #ffbd00);
  border-radius: 50%;
  background: #fff;
  color: #26313c;
  cursor: pointer;
  transform: translateY(-50%);
}

.health-content {
  width: calc(100% - var(--health-sidebar-width));
  min-width: 0;
  margin-left: var(--health-sidebar-width);
  transition: width 0.25s ease, margin-left 0.25s ease;
}

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

.health-sidebar-overlay {
  display: none;
}

.health-sidebar.is-collapsed {
  width: var(--health-sidebar-collapsed-width);
}

.health-sidebar.is-collapsed + .health-content {
  width: calc(100% - var(--health-sidebar-collapsed-width));
  margin-left: var(--health-sidebar-collapsed-width);
}

.health-sidebar.is-collapsed .health-sidebar-logo {
  min-height: 82px;
  padding: 16px 9px 10px;
}

.health-sidebar.is-collapsed .health-sidebar-logo img {
  max-width: 70px;
}

.health-sidebar.is-collapsed .health-sidebar-profile-title,
.health-sidebar.is-collapsed .health-sidebar-profile-copy,
.health-sidebar.is-collapsed .health-sidebar-section-title,
.health-sidebar.is-collapsed .health-sidebar-item-label {
  display: none;
}

.health-sidebar.is-collapsed .health-sidebar-profile-row,
.health-sidebar.is-collapsed .health-sidebar-item {
  justify-content: center;
}

.health-sidebar.is-collapsed .health-sidebar-scroll {
  padding-right: 10px;
  padding-left: 10px;
}

.health-sidebar.is-collapsed .health-sidebar-item {
  padding-right: 8px;
  padding-left: 8px;
  font-size: 1.2rem;
}

.health-sidebar.is-collapsed .health-sidebar-footer {
  padding-right: 10px;
  padding-left: 10px;
}

.health-sidebar.is-collapsed .health-sidebar-collapse i {
  transform: rotate(180deg);
}

@media (min-width: 901px) {
  .health-content .dropdown-menu {
    z-index: 1031;
  }
}

@media (max-width: 900px) {
  .health-sidebar {
    width: min(300px, calc(100vw - 48px));
    max-width: 100%;
    border-right: 0;
    box-shadow: 10px 0 28px rgba(13, 30, 47, 0.2);
    transform: translateX(-105%);
  }

  .health-sidebar.is-collapsed {
    width: min(300px, calc(100vw - 48px));
  }

  .health-sidebar.is-open {
    transform: translateX(0);
  }

  .health-sidebar .health-sidebar-profile-title,
  .health-sidebar .health-sidebar-section-title {
    display: block;
  }

  .health-sidebar .health-sidebar-profile-copy {
    display: flex;
  }

  .health-sidebar .health-sidebar-item-label {
    display: inline;
  }

  .health-sidebar .health-sidebar-profile-row,
  .health-sidebar .health-sidebar-item {
    justify-content: flex-start;
  }

  .health-sidebar .health-sidebar-item {
    padding-right: 11px;
    padding-left: 11px;
    font-size: 1rem;
  }

  .health-sidebar-collapse {
    display: none;
  }

  .health-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1025;
    display: block;
    background: rgba(14, 25, 36, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .health-sidebar-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .health-content,
  .health-sidebar.is-collapsed + .health-content {
    width: 100%;
    margin-left: 0;
  }

  .health-mobile-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    padding: 8px 64px;
    border-bottom: 8px solid var(--health-primary, #ffbd00);
    background: #fff;
    box-shadow: 0 2px 12px rgba(20, 36, 55, 0.08);
  }

  .health-mobile-header img {
    display: block;
    max-width: 150px;
    max-height: 48px;
    object-fit: contain;
  }

  .health-mobile-menu-button {
    position: absolute;
    left: max(14px, env(safe-area-inset-left));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 40px;
    border: 1px solid #d7dce1;
    border-radius: 5px;
    background: #fff;
    color: #26313c;
    cursor: pointer;
  }
}

@media (prefers-reduced-motion: reduce) {
  .health-sidebar,
  .health-content,
  .health-sidebar-overlay,
  .health-sidebar-item {
    transition: none;
  }
}
