/* ── App Shell ── */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ── */
.header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-lg);
  gap: var(--space-md);
  position: sticky;
  top: 0;
  z-index: 200;
  flex-shrink: 0;
}

.header__logo {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.header__logo span { color: var(--accent); }

.header__divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex-shrink: 0;
}

.header__nav {
  display: flex;
  gap: var(--space-xs);
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.header__nav::-webkit-scrollbar { display: none; }

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--t), color var(--t);
}
.nav-tab svg { width: 15px; height: 15px; }
.nav-tab:hover { background: var(--surface2); color: var(--text-soft); }
.nav-tab.active { background: var(--surface2); color: var(--accent); }

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
  margin-left: auto;
}

.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: color var(--t), background var(--t);
}
.icon-btn:hover { color: var(--text); background: var(--surface3); }
.icon-btn svg { width: 16px; height: 16px; }

.notification-dot {
  position: relative;
}
.notification-dot::after {
  content: '';
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

.avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: border-color var(--t);
}
.avatar-btn:hover { border-color: var(--accent); }

/* ── Main Body ── */
.body-wrap {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: var(--space-md) 0;
  flex-shrink: 0;
  overflow-y: auto;
  transition: transform var(--t-slow), width var(--t-slow);
}

.sidebar__section { padding: 0 var(--space-sm) var(--space-md); }
.sidebar__label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0 var(--space-sm) var(--space-xs);
  margin-bottom: var(--space-xs);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: 0.865rem;
  font-weight: 500;
  transition: background var(--t), color var(--t);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sidebar-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-link:hover { background: var(--surface2); color: var(--text); }
.sidebar-link.active { background: var(--accent-glow); color: var(--accent); }
.sidebar-link .badge {
  margin-left: auto;
  font-size: 0.7rem;
  background: var(--surface3);
  color: var(--muted);
  padding: 1px 7px;
  border-radius: 99px;
}
.sidebar-link.active .badge { background: var(--accent-glow); color: var(--accent); }

.sidebar__team {
  border-top: 1px solid var(--border);
  padding: var(--space-md) var(--space-sm) 0;
  margin-top: auto;
}
.team-member {
  display: flex; align-items: center; gap: 10px;
  padding: 6px var(--space-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t);
}
.team-member:hover { background: var(--surface2); }
.team-member__info { flex: 1; min-width: 0; }
.team-member__name { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-member__role { font-size: 0.7rem; color: var(--muted); }
.online-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.online-dot.online  { background: var(--green); }
.online-dot.away    { background: var(--yellow); }
.online-dot.offline { background: var(--muted); }

/* ── Content ── */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.page { display: none; padding: var(--space-lg); animation: fadeIn .2s ease; }
.page.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Mobile sidebar overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 150;
}

/* ── Hamburger ── */
.hamburger {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hamburger svg { width: 18px; height: 18px; }

/* ════════════ RESPONSIVE ════════════ */

/* Tablet */
@media (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
}

/* Mobile */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .header__divider { display: none; }

  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    z-index: 160;
    transform: translateX(-100%);
    width: 260px;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open { display: block; }

  .page { padding: var(--space-md); }
}

@media (max-width: 480px) {
  .header { padding: 0 var(--space-md); gap: var(--space-sm); }
  .header__logo { font-size: 1rem; }
  .header__nav { display: none; }
  .page { padding: var(--space-sm); }
}
