/* ==========================================================
   TeamoTrack Sidebar
   sidebar.css
   ========================================================== */

/* ==========================================================
   Sidebar
   ========================================================== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;

  width: var(--sidebar-width);
  height: 100vh;

  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);

  display: flex;
  flex-direction: column;

  z-index: var(--z-sidebar);

  transition: all var(--transition);

  overflow: hidden;
}

/* ==========================================================
   Collapsed Sidebar
   ========================================================== */

body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapse);
}

/* ==========================================================
   Logo
   ========================================================== */

.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;
  flex-shrink: 0;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-name h4 {
  margin: 0;
  font-size: 18px;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.brand-name small {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
}

.brand-logo img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: #fff;
}

.brand-name h4 {
  margin: 0;

  font-size: 18px;
  font-weight: var(--fw-bold);

  color: var(--text-primary);
}

.brand-name small {
  display: block;

  color: var(--text-secondary);

  font-size: 12px;
}

body.sidebar-collapsed .brand-name {
  display: none;
}

/* ==========================================================
   Navigation
   ========================================================== */

.sidebar-nav {
  flex: 1;

  overflow-y: auto;

  padding: 18px 14px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 20px;
}

/* ==========================================================
   Menu
   ========================================================== */

.menu {
  list-style: none;

  margin: 0;
  padding: 0;
}

.menu-item {
  margin-bottom: 6px;
}

/* ==========================================================
   Menu Links
   ========================================================== */

.menu-link {
  display: flex;
  align-items: center;

  gap: 14px;

  padding: 13px 16px;

  border-radius: var(--radius-md);

  color: var(--text-secondary);

  font-size: 15px;
  font-weight: var(--fw-medium);

  transition: all var(--transition-fast);

  cursor: pointer;
  user-select: none;

  text-decoration: none !important;
}

.menu-link i {
  width: 22px;

  text-align: center;

  font-size: 19px;
}

.menu-link:hover,
.menu-link:focus {
  background: rgba(37, 99, 235, 0.08);

  color: var(--primary);

  text-decoration: none !important;
}

/* ==========================================================
   Active Menu
   ========================================================== */

.menu-item.active > .menu-link {
  background: var(--primary-gradient);

  color: #fff;

  box-shadow: var(--shadow-sm);
}

.menu-item.active > .menu-link i {
  color: #fff;
}

/*
 * Parent menu with an active submenu should remain
 * visually normal instead of receiving the gradient.
 */

.menu-item.active > .menu-link {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.menu-item.active > .menu-link i {
  color: #fff;
}

/* ==========================================================
   Menu Arrow
   ========================================================== */

.menu-arrow {
  margin-left: auto;

  transition: transform 0.25s ease;
}

.menu-item.open > .menu-link .menu-arrow {
  transform: rotate(90deg);
}

body.sidebar-collapsed .menu-arrow {
  display: none;
}

/* ==========================================================
   Submenu
   ========================================================== */

.submenu {
  list-style: none;

  margin: 6px 0 8px 42px;
  padding: 0;

  display: none;
}

.menu-item.open > .submenu {
  display: block;
}

.submenu li {
  margin: 5px 0;
}

.submenu a {
  display: block;

  padding: 10px 14px;

  border-radius: var(--radius-sm);

  color: var(--text-secondary);

  font-size: 14px;

  transition: all 0.2s ease;

  text-decoration: none !important;
}

.submenu a:hover,
.submenu a:focus {
  background: rgba(37, 99, 235, 0.08);

  color: var(--primary);

  text-decoration: none !important;
}

/* ==========================================================
   Active Submenu
   ========================================================== */

.submenu a.active {
  background: rgba(37, 99, 235, 0.1);

  color: var(--primary);

  font-weight: var(--fw-semibold);

  text-decoration: none !important;
}

/* ==========================================================
   Collapsed Menu
   ========================================================== */

body.sidebar-collapsed .menu-text,
body.sidebar-collapsed .submenu {
  display: none;
}

body.sidebar-collapsed .menu-link {
  justify-content: center;

  padding: 14px 0;
}

body.sidebar-collapsed .menu-link i {
  margin: 0;

  font-size: 21px;
}

/* ==========================================================
   Footer
   ========================================================== */

.sidebar-footer {
  border-top: 1px solid var(--border-color);

  padding: 18px;

  flex-shrink: 0;
}

.user-card {
  display: flex;
  align-items: center;

  gap: 12px;

  border-radius: var(--radius-md);

  padding: 12px;

  background: var(--surface-soft);
}

.user-avatar {
  width: 42px;
  height: 42px;

  border-radius: 50%;

  background: var(--primary-gradient);

  display: flex;
  align-items: center;
  justify-content: center;

  color: #fff;

  font-weight: 700;
}

.user-info h6 {
  margin: 0;

  font-size: 14px;

  font-weight: var(--fw-semibold);
}

.user-info small {
  color: var(--text-secondary);
}

/* ==========================================================
   Collapsed Footer
   ========================================================== */

body.sidebar-collapsed .user-info {
  display: none;
}

body.sidebar-collapsed .user-card {
  justify-content: center;
}

.submenu a {
  display: flex;
  align-items: center;
  gap: 10px;
}

.submenu a i {
  width: 18px;
  font-size: 14px;
  flex-shrink: 0;
}

.brand-name h4 {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
/* ==========================================================
   Mobile Sidebar
   ========================================================== */

@media (max-width: 992px) {
  .sidebar {
    top: 0;
    bottom: 0;

    width: 280px;

    transform: translateX(-100%);

    transition: transform 0.3s ease;

    z-index: var(--z-sidebar);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
}
