/* header.css — общая шапка для всех страниц */

header.top {
  background: linear-gradient(180deg, #0a0a0a 0%, #000 100%);
  color: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: nowrap;
  position: relative;
  border-bottom: 1px solid #1f1f1f;
  box-shadow: 0 2px 20px rgba(0,0,0,.4);
  z-index: 50;
}

header.top .logo-link {
  display: block;
  flex-shrink: 0;
  text-decoration: none;
  padding: 6px 0;
}

header.top .logo {
  height: 84px;
  display: block;
  filter: drop-shadow(0 0 10px rgba(37,99,235,.15));
}

/* ===== центральное меню (десктоп) ===== */
header.top .main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

header.top .main-nav button {
  border: 0;
  background: transparent;
  color: #94a3b8;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .2px;
  transition: color .15s, background .15s;
}
header.top .main-nav button:hover {
  color: #fff;
  background: #1a1a1a;
}
header.top .main-nav button.active {
  color: #fff;
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 14px rgba(37,99,235,.4);
}

/* ===== правая часть (десктоп) ===== */
header.top .top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

header.top .user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: #111;
  border: 1px solid #262626;
  border-radius: 999px;
  font-size: 13px;
  color: #cbd5e0;
}
header.top .user-chip .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 12px;
  text-transform: uppercase;
}
header.top .user-chip .role {
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

header.top .top-actions .btn {
  background: transparent;
  color: #e2e8f0;
  border: 1px solid #262626;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 10px;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
}
header.top .top-actions .btn:hover {
  background: #1a1a1a;
  color: #fff;
  border-color: #404040;
}
header.top .top-actions .btn.logout {
  color: #f87171;
  border-color: #3f1a1a;
}
header.top .top-actions .btn.logout:hover {
  background: #3f1a1a;
  color: #fca5a5;
}

/* ===== БУРГЕР (скрыт на десктопе) ===== */
header.top .burger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #111;
  border: 1px solid #262626;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
header.top .burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #cbd5e0;
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
header.top .burger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
header.top .burger.open span:nth-child(2) {
  opacity: 0;
}
header.top .burger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== МОБИЛЬНЫЙ РЕЖИМ ===== */
@media (max-width: 900px) {
  header.top {
    padding: 10px 14px;
    gap: 12px;
    flex-wrap: wrap;
  }

  header.top .logo { height: 56px; }

  header.top .burger {
    display: flex;
    margin-left: auto;
  }

  /* меню по умолчанию скрыто */
  header.top .main-nav,
  header.top .top-actions {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    order: 10;
  }

  /* когда шапка в режиме «открыто» — показываем */
  header.top.open .main-nav,
  header.top.open .top-actions {
    display: flex;
  }

  header.top .main-nav {
    padding-top: 12px;
    border-top: 1px solid #1f1f1f;
  }
  header.top .main-nav button {
    padding: 14px 16px;
    font-size: 16px;
    text-align: left;
    border-radius: 10px;
    background: #0d0d0f;
  }
  header.top .main-nav button.active {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  }

  header.top .top-actions {
    padding-top: 8px;
    border-top: 1px solid #1f1f1f;
  }

  header.top .top-actions .btn {
    width: 100%;
    text-align: center;
    padding: 12px 16px;
  }

  header.top .user-chip {
    width: 100%;
    padding: 10px 14px;
    justify-content: flex-start;
  }
  header.top .user-chip .avatar {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
  header.top .user-chip .name { display: block; }
}