/* Sidebar Navigation */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  z-index: 30;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.sidebar-brand img {
  width: 36px;
  height: 36px;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-name {
  font-weight: 700;
  font-size: 1rem;
  color: #111827;
  letter-spacing: 0.05em;
}

.sidebar-brand-sub {
  font-size: 0.65rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-menu {
  flex: 1;
  padding: 0.75rem 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}

.sidebar-item:hover {
  background: #f3f4f6;
  color: #374151;
}

.sidebar-item.is-active {
  color: #111827;
  background: #eff6ff;
  border-left-color: #3b82f6;
  font-weight: 600;
}

.sidebar-item .icon {
  width: 20px;
  text-align: center;
  font-size: 0.9rem;
}

.sidebar-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 0.5rem 1rem;
}

.sidebar-footer {
  padding: 0.75rem 0;
  border-top: 1px solid #e5e7eb;
}

.sidebar-user {
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #6b7280;
  font-size: 0.8rem;
}

.sidebar-user .user-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Content area offset */
.app-content {
  margin-left: 220px;
  min-height: 100vh;
  background: #f9fafb;
}

/* Override Bulma's main-content for the new layout */
.app-content .main-content {
  padding-top: 32px;
}

/* Mobile top bar (hamburger + brand) */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  align-items: center;
  padding: 0 16px;
  z-index: 40;
}

.mobile-topbar .sidebar-hamburger {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #6b7280;
}

.mobile-topbar .mobile-brand {
  font-weight: 700;
  margin-left: 12px;
  color: #111827;
}

/* Mobile: sidebar hidden by default, shown on toggle */
@media screen and (max-width: 1024px) {
  .mobile-topbar {
    display: flex;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 50;
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .app-content {
    margin-left: 0;
  }
  .app-content .main-content {
    margin-top: 48px;
  }
  /* Overlay when sidebar is open */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 45;
  }
  .sidebar-overlay.is-active {
    display: block;
  }
}
