:root {
  --sidebar-fx-accent: 14, 165, 233;
  --sidebar-fx-text: #f8fafc;
  --sidebar-fx-muted: #aeb5ca;
}

.sidebar-fx {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: rgba(14, 25, 42, .56) !important;
  border-right: 1px solid rgba(174, 224, 255, .34) !important;
  box-shadow: 14px 0 38px rgba(0, 0, 0, .28), inset -1px 0 rgba(207, 239, 255, .12);
  backdrop-filter: blur(26px) saturate(145%);
  -webkit-backdrop-filter: blur(26px) saturate(145%);
  transition: width .28s cubic-bezier(.2, .8, .2, 1), background .2s ease, box-shadow .2s ease;
}

.sidebar-fx::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 5%, rgba(66, 178, 237, .30), transparent 27%),
    radial-gradient(circle at 92% 48%, rgba(245, 158, 11, .25), transparent 23%),
    radial-gradient(circle at 2% 75%, rgba(239, 68, 68, .25), transparent 27%),
    linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(8, 18, 31, .12) 34%, rgba(8, 18, 31, .38));
}

.sidebar-fx::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(219, 244, 255, .78), rgba(77, 191, 255, .18) 48%, rgba(219, 244, 255, .56));
  box-shadow: 0 0 18px rgba(94, 199, 255, .36);
}

.sidebar-fx-nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-fx-item {
  position: relative;
  z-index: 1;
  margin: 0 !important;
  border: 1px solid transparent;
  background: transparent !important;
  color: var(--sidebar-fx-muted);
  overflow: hidden;
  transition: color .2s ease, border-color .2s ease, transform .2s ease, filter .2s ease !important;
}

.sidebar-fx-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 4px 12px;
}

.sidebar-fx-control {
  min-height: 28px !important;
  padding: 5px 8px;
  border: 1px solid rgba(181, 220, 242, .18);
  background: rgba(255, 255, 255, .055) !important;
  color: #bdc9d9;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
}

.sidebar-fx-control:hover {
  color: #fff;
  border-color: rgba(var(--sidebar-fx-accent), .48);
  background: rgba(var(--sidebar-fx-accent), .13) !important;
}

.sidebar-fx-item::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, rgba(var(--sidebar-fx-accent), .16), rgba(var(--sidebar-fx-accent), .03));
  transition: opacity .2s ease;
}

.sidebar-fx-item:not(.active):hover {
  color: var(--sidebar-fx-text) !important;
  border-color: rgba(var(--sidebar-fx-accent), .32);
  transform: translateX(4px) !important;
}

.sidebar-fx-item:not(.active):hover::after {
  opacity: 1;
}

.sidebar-fx-icon {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  background: rgba(44, 48, 66, .9) !important;
  border: 1px solid rgba(255, 255, 255, .055);
  transition: color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.sidebar-fx-item:not(.active):hover .sidebar-fx-icon {
  color: rgb(var(--sidebar-fx-accent));
  background: rgba(var(--sidebar-fx-accent), .14) !important;
  box-shadow: 0 0 18px rgba(var(--sidebar-fx-accent), .16);
  transform: scale(1.05);
}

.sidebar-fx-label {
  position: relative;
  z-index: 1;
  min-width: 0;
  flex: 1 1 auto;
}

.sidebar-indicator {
  position: absolute;
  z-index: 0;
  left: 0;
  right: 0;
  top: 0;
  height: 46px;
  border: 1px solid rgba(var(--sidebar-fx-accent), .62);
  border-radius: 7px;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(110, 194, 226, .78), rgba(48, 130, 190, .58));
  box-shadow: 0 10px 30px rgba(25, 134, 210, .34), inset 0 1px rgba(255, 255, 255, .28);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), height .25s cubic-bezier(.2, .8, .2, 1), opacity .16s ease;
}

.sidebar-indicator::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, .88);
}

.sidebar-fx-status {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, .55);
  animation: sidebar-live-pulse 1.8s ease-out infinite;
}

.sidebar-count-badge {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font: 700 12px/24px 'Inter', sans-serif;
  text-align: center;
  box-shadow: 0 5px 15px rgba(239, 68, 68, .34);
}

@keyframes sidebar-live-pulse {
  70% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.sidebar-fx.fx-ready .sidebar-fx-item.active {
  color: var(--sidebar-fx-text) !important;
  border-color: transparent;
}

.sidebar-fx.fx-ready .sidebar-fx-item.active .sidebar-fx-icon {
  color: #fff;
  background: rgba(255, 255, 255, .18) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .18);
}

.sidebar-fx:not(.fx-ready) .sidebar-fx-item.active {
  color: #fff !important;
  background: rgb(var(--sidebar-fx-accent)) !important;
}

.sidebar-fx.fx-stagger .sidebar-fx-item {
  animation: sidebar-fx-enter .34s both;
  animation-delay: calc(var(--sidebar-fx-index, 0) * 28ms);
}

@keyframes sidebar-fx-enter {
  from { opacity: 0; transform: translateX(-9px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (min-width: 768px) {
  .sidebar-fx.is-collapsed {
    width: 5rem !important;
  }

  .sidebar-fx.is-collapsed .sidebar-fx-heading,
  .sidebar-fx.is-collapsed .sidebar-fx-replay,
  .sidebar-fx.is-collapsed .sidebar-fx-label,
  .sidebar-fx.is-collapsed .sidebar-fx-status {
    display: none;
  }

  .sidebar-fx.is-collapsed .sidebar-fx-controls {
    justify-content: center;
  }

  .sidebar-fx.is-collapsed .sidebar-fx-item {
    justify-content: center;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
}

@media (max-width: 767px) {
  .sidebar-fx {
    width: min(16rem, calc(100vw - 1rem));
    max-height: calc(100vh - 113px);
    overflow-y: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-fx-item,
  .sidebar-fx-icon,
  .sidebar-indicator {
    transition: none !important;
    animation: none !important;
  }
  .sidebar-live-dot { animation: none !important; }
}
