/* APP LAYOUT */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* BOTTOM NAV (Mobile)*/
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(19, 19, 43, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding: 0 8px;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
  min-height: 52px;
}

.nav-item span {
  font-size: 0.65rem;
  font-weight: 600;
  font-family: 'Sora', sans-serif;
  letter-spacing: 0.03em;
  transition: color var(--transition);
}

.nav-item:hover {
  color: var(--text-secondary);
}

.nav-item.active {
  color: var(--purple-main);
}

.nav-item.active span {
  color: var(--purple-main);
}

.nav-item svg {
  transition: transform var(--transition);
}

.nav-item.active svg {
  transform: scale(1.1);
}

/* Active indicator dot */
.nav-item.active::after {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--purple-main);
  border-radius: var(--radius-full);
  position: absolute;
  bottom: 6px;
}

/* SIDEBAR (Desktop) */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.sidebar-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo-text {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  background: linear-gradient(135deg, var(--purple-main), var(--neon-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9375rem;
}

.sidebar-nav-item:hover {
  background: var(--bg-card);
  color: var(--text-secondary);
}

.sidebar-nav-item.active {
  background: rgba(108, 99, 255, 0.15);
  color: var(--purple-main);
  border: 1px solid rgba(108, 99, 255, 0.2);
}

.sidebar-nav-item.active svg {
  color: var(--purple-main);
}

.sidebar-bottom {
  padding: 16px 12px 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
}

.sidebar-user:hover {
  background: var(--bg-card);
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-level {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  padding-bottom: var(--nav-height);
  max-width: 100%;
  overflow-x: hidden;
}

/* Page wrapper inside main */
.page {
  display: none;
  flex-direction: column;
  min-height: calc(100vh - var(--nav-height));
  padding: 20px 16px 16px;
}

.page.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

/* PAGE HEADER */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.page-back {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
}

.page-back:hover {
  color: var(--text-primary);
  transform: translateY(-2px);

}

/* SECTION TITLE */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title h3 {
  font-size: 1rem;
  font-weight: 700;
}

.section-title a,
.section-title button {
  font-size: 0.8125rem;
  color: var(--purple-main);
  font-weight: 500;
  cursor: pointer;
  background: none;
  transition: opacity var(--transition);
}

.section-title a:hover {
  opacity: 0.8;
}

/* RESPONSIVE */
@media (min-width: 768px) {
  .bottom-nav {
    display: none;
  }

  .sidebar {
    display: flex;
  }

  .main-content {
    margin-left: var(--sidebar-width);
    padding-bottom: 0;
  }

  .page {
    padding: 28px 32px;
  }

  .page-header h1 {
    font-size: 1.75rem;
  }

  #toast-container {
    bottom: 24px;
  }
}

@media (max-width: 767px) {
  .sidebar {
    display: none;
  }
}