/* css/layout.css — App shell, header, sidebar, main */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────── */
.header {
  height: var(--hdr);
  background: #fff;
  border-bottom: 1px solid var(--neutral-200);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--neutral-900);
}

.logo-dot {
  width: 7px;
  height: 7px;
  background: var(--brand);
  border-radius: 50%;
  flex-shrink: 0;
}

.header-divider {
  width: 1px;
  height: 18px;
  background: var(--neutral-200);
}

.header-course {
  font-size: var(--text-sm);
  color: var(--neutral-600);
  font-weight: 400;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Role switch ─────────────────────────────────────────── */
.role-switch {
  display: flex;
  background: var(--neutral-100);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.role-opt {
  padding: 4px 14px;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  color: var(--neutral-600);
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
  line-height: 1.5;
}

.role-opt:hover { color: var(--neutral-900); background: rgba(255,255,255,0.8); }

.role-opt.active {
  background: #fff;
  color: var(--neutral-900);
  box-shadow: var(--shadow-sm);
}

/* ── Body / Sidebar / Main ───────────────────────────────── */
.body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.sidebar {
  width: var(--sidebar);
  background: #fff;
  border-right: 1px solid var(--neutral-200);
  padding: 8px 0 16px;
  flex-shrink: 0;
  position: sticky;
  top: var(--hdr);
  height: calc(100vh - var(--hdr));
  overflow-y: auto;
}

.main {
  flex: 1;
  padding: 28px 28px 40px;
  overflow-y: auto;
  max-width: 1200px;
}

/* ── Sidebar nav ─────────────────────────────────────────── */
.nav-section {
  padding: 14px 16px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--neutral-400);
  text-transform: uppercase;
  letter-spacing: 0.9px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 16px;
  margin: 1px 8px;
  cursor: pointer;
  color: var(--neutral-600);
  border-radius: var(--radius-md);
  transition: background var(--t-fast), color var(--t-fast);
  font-size: var(--text-base);
  font-weight: 400;
  user-select: none;
  border-left: none; /* override old style */
}

.nav-item:hover {
  background: var(--neutral-100);
  color: var(--neutral-900);
}

.nav-item.active {
  background: var(--brand-tint);
  color: var(--brand-dark);
  font-weight: 500;
}

.nav-item i {
  font-size: 16px;
  flex-shrink: 0;
  opacity: 0.65;
}

.nav-item.active i {
  opacity: 1;
  color: var(--brand-dark);
}

.nav-item:hover i { opacity: 0.9; }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  letter-spacing: 0;
}

/* ── Avatar ──────────────────────────────────────────────── */
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main    { padding: 16px; }
}
