/* ============================================================
   alumnAI — Layout
   App shell, sidebar, topbar, main content grid.
   ============================================================ */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: var(--space-5) var(--space-4);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2) var(--space-5);
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}
.sidebar-logo:hover { text-decoration: none; }

.sidebar-logo-text { line-height: 1.1; }
.sidebar-logo-name {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sidebar-logo-name .accent { color: var(--brand-blue); }
.sidebar-logo-sub {
  font-size: var(--fs-xs);
  color: var(--text-3);
  font-weight: 500;
  margin-top: 2px;
}

.nav-section { margin-bottom: var(--space-5); }
.nav-label {
  font-size: var(--fs-xs);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 var(--space-2) var(--space-2);
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px var(--space-3);
  border-radius: var(--radius);
  font-size: var(--fs-base);
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
  text-decoration: none;
  user-select: none;
}
.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.nav-item.active {
  background: var(--brand-blue-soft);
  color: var(--brand-navy);
  font-weight: 600;
}
.nav-item .ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: currentColor;
}
.nav-item.active .ico { color: var(--brand-blue); }
.nav-item-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-2);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}
.nav-item.active .nav-item-badge {
  background: var(--brand-blue);
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
  color: var(--text-3);
  line-height: 1.6;
}

/* ---- Main / topbar ---- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
}

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(140%) blur(8px);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--text-3);
}
.breadcrumb a { color: var(--brand-blue-dark); cursor: pointer; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--text-3); }
.breadcrumb .current { color: var(--text); font-weight: 500; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text);
}
.stat-pill .ico { width: 14px; height: 14px; }
.stat-pill.xp .ico { color: var(--brand-blue); }
.stat-pill.streak .ico { color: var(--warning); }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-navy);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
  transition: transform var(--t-fast) var(--ease);
}
.avatar:hover { transform: scale(1.04); }

.view {
  padding: var(--space-8) var(--space-8);
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* ---- Mobile ---- */
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-100%);
    transition: transform var(--t) var(--ease);
    z-index: 30;
    width: 280px;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .topbar { padding: 0 var(--space-4); }
  .view { padding: var(--space-5) var(--space-4); }
  .sidebar-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,25,50,0.4);
    z-index: 20;
  }
  .sidebar.open ~ .sidebar-mask { display: block; }
  .mobile-menu-btn { display: inline-flex !important; }
}

.mobile-menu-btn {
  display: none;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.mobile-menu-btn:hover { background: var(--surface-2); }
