/* =========================================
   VARIABLES (UPDATED TO YOUR DESIGN SYSTEM)
========================================= */

$primary: #5e3817;
$primary-2: #7a4b20;

$primary-light: rgba(122, 75, 32, 0.08);
$primary-soft: rgba(122, 75, 32, 0.12);
$primary-soft-strong: rgba(122, 75, 32, 0.18);
$primary-border: rgba(122, 75, 32, 0.25);
$primary-muted: rgba(122, 75, 32, 0.6);

$border-light: rgba(0, 0, 0, 0.06);
$text-dark: #1a1a1a;
$text-muted: #6b6b6b;
$bg-soft: #faf8f6;

/* =========================================
   SIDEBAR WRAPPER
========================================= */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid $border-light;
  display: flex;
  flex-direction: column;
  z-index: 999;
  transition: transform 0.3s ease;
}

/* =========================================
   ADMIN HEADER
========================================= */

.sidebarAdmin {
  padding: 1.2rem 1.5rem 0.8rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;

  h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: $primary;
    margin: 0;
  }

  small {
    font-size: 0.7rem;
    font-weight: 500;
    color: $primary-muted;
  }
}

/* =========================================
   LINKS CONTAINER (SCROLLABLE)
========================================= */

.sidebarLinks {
  flex: 1;
  padding: 1rem 1rem 0.5rem 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;

  &::-webkit-scrollbar {
    width: 5px;
  }

  &::-webkit-scrollbar-thumb {
    background: rgba(122, 75, 32, 0.3);
    border-radius: 10px;
  }

  &::-webkit-scrollbar-thumb:hover {
    background: $primary;
  }
}

/* =========================================
   SECTION
========================================= */

.section {
  margin-bottom: 1.2rem;
  position: relative;
}

.section:not(:first-child) {
  padding-top: 0.8rem;
  border-top: 1px dashed $primary-light;
}

.sectionTitle {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: $primary-muted;
  margin: 0.6rem 0 0.6rem 0.8rem;
  transition: color 0.25s ease;
}

.section:has(.active) .sectionTitle {
  color: $primary;
}

/* =========================================
   LINK BASE
========================================= */

.link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
  text-decoration: none;
  color: $text-dark;
  position: relative;
  transition: all 0.25s ease;
}

.link:hover {
  background: $primary-light;
  transform: translateX(3px);
}

/* =========================================
   ICON
========================================= */

.icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: $bg-soft;
  display: flex;
  align-items: center;
  justify-content: center;
  color: $primary-muted;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.link:hover .icon {
  background: $primary-soft;
  color: $primary;
}

.iconActive {
  @extend .icon;
  background: linear-gradient(135deg, $primary, $primary-2);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(122, 75, 32, 0.25);
}

/* =========================================
   LINK TEXT
========================================= */

.linkText {
  display: flex;
  flex-direction: column;
  flex: 1;
  line-height: 1.2;
}

.linkLabel {
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.25s ease;
}

.linkDesc {
  font-size: 0.77rem;
  color: $text-muted;
  transition: all 0.25s ease;
  font-weight: 500 !important;
  opacity: .85;
}

.link:hover .linkLabel {
  color: $primary;
}

.link:hover .linkDesc {
  color: $primary-muted;
}

/* =========================================
   ACTIVE LINK
========================================= */

.active {
  @extend .link;
  background: linear-gradient(
    135deg,
    $primary-soft-strong,
    $primary-light
  );
  border: 1px solid $primary-border;
  box-shadow: 0 10px 25px rgba(122, 75, 32, 0.12);
}

.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  height: 64%;
  width: 4px;
  background: linear-gradient(to bottom, $primary, $primary-2);
  border-radius: 4px;
}

.active .linkLabel {
  color: $primary;
}

.active .linkDesc {
  color: $primary-muted;
}

.activeArrow {
  margin-left: auto;
  color: $primary;
  font-size: 1rem;
}

/* =========================================
   FOOTER
========================================= */

.sidebarFooter {
  margin: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: $bg-soft;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid $border-light;
  cursor: pointer;
  transition: all 0.25s ease;
}

.sidebarFooter:hover {
  background: $primary-light;
  border-color: $primary-border;
  transform: translateY(-1px);
}

.avatar {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, $primary, $primary-2);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.05em;
}

.footerText {
  display: flex;
  flex-direction: column;

  h4 {
    font-size: 0.88rem;
    font-weight: 600;
    color: $text-dark;
    margin: 0;
  }

  small {
    font-size: 0.72rem;
    color: $text-muted;
  }
}