.sidebar {
  position: sticky;
  top: 14px;
  z-index: 50;
  width: 58px;
  height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 14px 0 14px 18px;
  padding: 10px 8px;
  border: 1px solid rgba(61, 98, 110, 0.35);
  border-radius: 18px;
  background: linear-gradient(180deg, #0c2f2f 0%, #082827 50%, #071d22 100%);
  color: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  transition: width 0.2s ease, box-shadow 0.2s ease, border-radius 0.2s ease;
}

.sidebar:hover,
.sidebar:focus-within {
  width: 276px;
  padding: 10px 12px;
  overflow: auto;
  box-shadow: 28px 0 56px rgba(15, 23, 42, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  margin-bottom: 12px;
  padding: 2px 0 10px;
  border-bottom: 1px solid rgba(220, 227, 238, 0.12);
}

.brand > div:not(.brand-mark),
.side-section > summary,
.nav-item {
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.brand > div:not(.brand-mark),
.side-section > summary {
  opacity: 0;
  pointer-events: none;
}

.sidebar:hover .brand > div:not(.brand-mark),
.sidebar:focus-within .brand > div:not(.brand-mark),
.sidebar:hover .side-section > summary,
.sidebar:focus-within .side-section > summary {
  opacity: 1;
  pointer-events: auto;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #119885, #0d736b);
  box-shadow: 0 10px 24px rgba(13, 115, 107, 0.26);
  font-weight: 800;
}

.brand span {
  display: block;
  margin-top: 2px;
  color: #9aa7ba;
  font-size: 13px;
}

nav {
  display: grid;
  gap: 8px;
}

.side-section {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(220, 227, 238, 0.14);
}

.side-extra-nav {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(220, 227, 238, 0.14);
}

.side-section > summary {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  padding: 0 8px;
  color: #7f8ca3;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  cursor: pointer;
}

.side-section > summary::-webkit-details-marker {
  display: none;
}

.side-section > summary::before,
.nav-item::before {
  content: attr(data-icon);
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
  color: #9fd9d2;
  font-size: 12px;
  font-weight: 850;
  text-transform: none;
}

.side-section > summary::after {
  content: "⌄";
  margin-left: auto;
  color: #78919a;
  font-size: 13px;
  transition: transform 0.16s ease;
}

.side-section:not([open]) > summary::after {
  transform: rotate(-90deg);
}

.nav-item {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #c5cfdd;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.side-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.admin-nav-item {
  min-height: 36px;
  font-size: 13px;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(20, 184, 166, 0.13);
  color: #fff;
}

.nav-item:hover::before,
.nav-item.active::before {
  background: rgba(20, 184, 166, 0.18);
  color: #35f2d5;
  box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.18);
}

.nav-item:hover {
  transform: translateX(2px);
}

.sidebar:not(:hover):not(:focus-within) .brand > div:not(.brand-mark),
.sidebar:not(:hover):not(:focus-within) .side-section > summary {
  display: none;
}

.sidebar:not(:hover):not(:focus-within) .side-section {
  gap: 8px;
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
}

.sidebar:not(:hover):not(:focus-within) .side-extra-nav {
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(220, 227, 238, 0.12);
}

.sidebar:not(:hover):not(:focus-within) .nav-item {
  width: 40px;
  height: 40px;
  min-height: 40px;
  justify-content: center;
  padding: 0;
  color: transparent;
}

.sidebar:not(:hover):not(:focus-within) .nav-item::before {
  margin: 0;
}

.sidebar:not(:hover):not(:focus-within) .nav-item:not(.active) {
  background: transparent;
}

.sidebar:not(:hover):not(:focus-within) .nav-item:not(.active)::before {
  background: transparent;
  color: #8eb5b0;
}

.sidebar:not(:hover):not(:focus-within) .side-primary-nav {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(220, 227, 238, 0.12);
}

.side-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}

.side-help,
.side-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: #a9c7c2;
  font-weight: 800;
}

.side-avatar {
  background: linear-gradient(135deg, #f8fafc, #f4d6b2);
  color: #1f2937;
}

.side-section > summary::before,
.nav-item::before {
  content: "" !important;
  background:
    linear-gradient(90deg, #8fc9c2, #8fc9c2) center / 14px 2px no-repeat,
    linear-gradient(180deg, #8fc9c2, #8fc9c2) center / 2px 14px no-repeat,
    rgba(255, 255, 255, 0.045) !important;
  font-size: 0 !important;
}

.side-section > summary::after {
  content: "" !important;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #78919a;
  border-bottom: 1.5px solid #78919a;
  transform: rotate(45deg);
}

.side-section:not([open]) > summary::after {
  transform: rotate(-45deg);
}

.nav-item:hover::before,
.nav-item.active::before {
  background:
    linear-gradient(90deg, #7de3d4, #7de3d4) center / 15px 2px no-repeat,
    linear-gradient(180deg, #7de3d4, #7de3d4) center / 2px 15px no-repeat,
    rgba(17, 152, 133, 0.2) !important;
}

.sidebar:not(:hover):not(:focus-within) .nav-item:not(.active)::before {
  background:
    linear-gradient(90deg, #82ada8, #82ada8) center / 13px 2px no-repeat,
    linear-gradient(180deg, #82ada8, #82ada8) center / 2px 13px no-repeat,
    transparent !important;
}

.nav-item[data-nav-icon]::before,
.side-section > summary[data-nav-icon]::before {
  display: none !important;
}

.nav-svg {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
  color: #8fc9c2;
}

.nav-svg svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item:hover .nav-svg,
.nav-item.active .nav-svg {
  background: rgba(17, 152, 133, 0.2);
  color: #7de3d4;
  box-shadow: inset 0 0 0 1px rgba(125, 227, 212, 0.16);
}

.sidebar:not(:hover):not(:focus-within) .nav-item {
  gap: 0;
}

.sidebar:not(:hover):not(:focus-within) .nav-item:not(.active) .nav-svg {
  background: transparent;
  color: #82ada8;
}

.sidebar:not(:hover):not(:focus-within) .side-section > summary {
  width: 40px;
  height: 40px;
  min-height: 40px;
  display: flex;
  justify-content: center;
  padding: 0;
  color: transparent;
  opacity: 1;
  pointer-events: auto;
}

.sidebar:not(:hover):not(:focus-within) .side-section > summary::after {
  display: none;
}

.sidebar:not(:hover):not(:focus-within) .side-section > summary .nav-svg {
  background: transparent;
  color: #82ada8;
}

.sidebar:not(:hover):not(:focus-within) .side-section[open] > .nav-item {
  display: none;
}

.sidebar:not(:hover):not(:focus-within) .nav-item,
.sidebar:not(:hover):not(:focus-within) .side-section > summary {
  position: relative;
  display: grid !important;
  place-items: center !important;
  width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  overflow: hidden;
  transform: none !important;
}

.sidebar:not(:hover):not(:focus-within) .nav-svg {
  position: absolute;
  inset: 3px;
  margin: 0;
  width: 34px;
  height: 34px;
  transform: none !important;
}

.sidebar:not(:hover):not(:focus-within) .nav-svg svg {
  width: 18px;
  height: 18px;
}
