/* --- Навигация (шапка) --- */
.header { position: relative; flex-wrap: wrap; }
.header-left { display: flex; align-items: center; gap: 4px; }
.header-right { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
  padding: 4px 8px;
  margin-left: 8px;
}

.navbar {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 20px;
}

.nav-item { position: relative; }
.nav-link { display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 700; color: var(--muted); text-decoration: none; background: none; border: none; cursor: pointer; font-family: inherit; white-space: nowrap; }
.nav-link:hover { color: var(--ink); background: var(--panel); }
.nav-item.active > .nav-link { color: var(--ink); background: var(--panel); }
.nav-link .caret { font-size: 9px; opacity: .6; }

.nav-dropdown { display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 6px; box-shadow: 0 10px 28px rgba(0,0,0,0.14); z-index: 60; }
.nav-item.open .nav-dropdown { display: block; }
.nav-dropdown a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 6px; font-size: 14px; color: var(--ink); text-decoration: none; }
.nav-dropdown a:hover { background: var(--panel); }
.nav-dropdown a svg.nav-ico { flex-shrink: 0; width: 16px; height: 16px; color: var(--muted); }
.nav-dropdown a:hover svg.nav-ico { color: var(--ink); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  /* логотип к левому краю, кнопка меню — к правому */
  .header-left { flex: 1 1 auto; justify-content: space-between; }
  .navbar {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    padding: 8px;
    gap: 0;
    z-index: 55;
  }
  .navbar.mobile-open { display: flex; }
  .nav-item.open .nav-dropdown { position: static; box-shadow: none; margin-top: 2px; border: none; padding-left: 12px; }
  .header-right span#userEmail { display: none; }
}

/* --- Страницы-заглушки --- */
.page-title { font-size: 22px; font-weight: 800; margin: 4px 0 18px; }
.page-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.page-tab { padding: 8px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--card); font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: none; }
.page-tab.current { color: #fff; background: var(--blue); border-color: var(--blue); }

.stub-list { display: flex; flex-direction: column; gap: 14px; }
.stub-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 22px 24px; color: var(--muted); }
.stub-card h2 { color: var(--ink); margin: 0 0 6px; font-size: 17px; }
.stub-card p { margin: 0; font-size: 14px; line-height: 1.5; }
.stub-card a { font-weight: 700; }
.stub-badge { display: inline-block; margin-bottom: 10px; padding: 3px 10px; border-radius: 20px; background: var(--panel); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }

/* --- narrow header: portfolio switcher takes the row, profile shows avatar only --- */
@media (max-width: 520px) {
  .header-right { gap: 8px; }
  #hdrAddWrap { margin-right: 2px !important; }
  #hdrPortfolioBox { flex: 1; min-width: 0; }
  #hdrPortfolioBtn { min-width: 0 !important; max-width: none !important; width: 100%; }
  .header a[href="profile.html"] span:last-child { display: none; }
  .header a[href="profile.html"] { padding-left: 6px; padding-right: 6px; }
}
